<commit_before>// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The SFC licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.

package org.openqa.selenium.grid.distributor.config;


import com.beust.jcommander.Parameter;
import com.google.auto.service.AutoService;
import org.openqa.selenium.grid.config.ConfigValue;
import org.openqa.selenium.grid.config.HasRoles;
import org.openqa.selenium.grid.config.Role;

import java.net.URI;
import java.util.Collections;
import java.util.Set;

import static org.openqa.selenium.grid.config.StandardGridRoles.DISTRIBUTOR_ROLE;
import static org.openqa.selenium.grid.distributor.config.DistributorOptions.DEFAULT_DISTRIBUTOR_IMPLEMENTATION;
import static org.openqa.selenium.grid.distributor.config.DistributorOptions.DEFAULT_GRID_MODEL_IMPLEMENTATION;
import static org.openqa.selenium.grid.distributor.config.DistributorOptions.DEFAULT_HEALTHCHECK_INTERVAL;
import static org.openqa.selenium.grid.distributor.config.DistributorOptions.DEFAULT_REJECT_UNSUPPORTED_CAPS;
import static org.openqa.selenium.grid.distributor.config.DistributorOptions.DEFAULT_SLOT_MATCHER;
import static org.openqa.selenium.grid.distributor.config.DistributorOptions.DEFAULT_SLOT_SELECTOR_IMPLEMENTATION;
import static org.openqa.selenium.grid.distributor.config.DistributorOptions.DISTRIBUTOR_SECTION;

@SuppressWarnings("FieldMayBeFinal")
@AutoService(HasRoles.class)
public class DistributorFlags implements HasRoles {

  @Parameter(names = {"-d", "--distributor"}, description = "Url of the distributor.")
  @ConfigValue(section = DISTRIBUTOR_SECTION, name = "host", example = "\"http://localhost:5553\"")
  private URI distributorServer;

  @Parameter(
    names = "--distributor-port",
    description = "Port on which the distributor is listening.")
  @ConfigValue(section = DISTRIBUTOR_SECTION, name = "port", example = "5553")
  private Integer distributorServerPort;

  @Parameter(
    names = "--distributor-host",
    description = "Host on which the distributor is listening.")
  @ConfigValue(section = DISTRIBUTOR_SECTION, name = "hostname", example = "\"localhost\"")
  private String distributorServerHost;

  @Parameter(
    names = {"--distributor-implementation"},
    description = "Full classname of non-default distributor implementation")
  @ConfigValue(
    section = DISTRIBUTOR_SECTION,
    name = "implementation",
    example = DEFAULT_DISTRIBUTOR_IMPLEMENTATION)
  private String implementation = DEFAULT_DISTRIBUTOR_IMPLEMENTATION;

  @Parameter(
    names = {"--grid-model"},
    description = "Full classname of non-default grid model. This is used to store states of the all the registered Nodes.")
  @ConfigValue(section = DISTRIBUTOR_SECTION, name = "grid-model", example = DEFAULT_GRID_MODEL_IMPLEMENTATION)
  private String gridModel = DEFAULT_GRID_MODEL_IMPLEMENTATION;

  @Parameter(
    names = {"--slot-matcher"},
    description = "Full classname of non-default slot matcher to use. This is used to determine whether a Node can support a particular session.")
  @ConfigValue(section = DISTRIBUTOR_SECTION, name = "slot-matcher", example = DEFAULT_SLOT_MATCHER)
  private String slotMatcher = DEFAULT_SLOT_MATCHER;

  @Parameter(
    names = {"--slot-selector"},
    description = "Full classname of non-default slot selector. This is used to select a slot in a Node once the Node has been matched.")
  @ConfigValue(section = DISTRIBUTOR_SECTION, name = "slot-selector", example = DEFAULT_SLOT_SELECTOR_IMPLEMENTATION)
  private String slotSelector = DEFAULT_SLOT_SELECTOR_IMPLEMENTATION;

  @Parameter(
    names = {"--healthcheck-interval"},
    description = "How often, in seconds, will the health check run for all Nodes." +
      "This ensures the server can ping all the Nodes successfully.")
  @ConfigValue(section = DISTRIBUTOR_SECTION, name = "healthcheck-interval", example = "60")
  public int healthcheckInterval =  DEFAULT_HEALTHCHECK_INTERVAL;

  @Parameter(description = "Allow the Distributor to reject a request immediately if the Grid does not support the requested capability." +
    "Rejecting requests immediately is suitable for Grid set up that does not spin up Nodes on demand.",
    names = "--reject-unsupported-caps", arity = 1)
  @ConfigValue(section = DISTRIBUTOR_SECTION, name = "--reject-unsupported-caps", example = "true")
  private boolean rejectUnsupportedCaps = DEFAULT_REJECT_UNSUPPORTED_CAPS;

  @Override
  public Set<Role> getRoles() {
    return Collections.singleton(DISTRIBUTOR_ROLE);
  }
}
<commit_msg>Config settings do not use `--` in their names<commit_after>// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The SFC licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.

package org.openqa.selenium.grid.distributor.config;


import com.beust.jcommander.Parameter;
import com.google.auto.service.AutoService;
import org.openqa.selenium.grid.config.ConfigValue;
import org.openqa.selenium.grid.config.HasRoles;
import org.openqa.selenium.grid.config.Role;

import java.net.URI;
import java.util.Collections;
import java.util.Set;

import static org.openqa.selenium.grid.config.StandardGridRoles.DISTRIBUTOR_ROLE;
import static org.openqa.selenium.grid.distributor.config.DistributorOptions.DEFAULT_DISTRIBUTOR_IMPLEMENTATION;
import static org.openqa.selenium.grid.distributor.config.DistributorOptions.DEFAULT_GRID_MODEL_IMPLEMENTATION;
import static org.openqa.selenium.grid.distributor.config.DistributorOptions.DEFAULT_HEALTHCHECK_INTERVAL;
import static org.openqa.selenium.grid.distributor.config.DistributorOptions.DEFAULT_REJECT_UNSUPPORTED_CAPS;
import static org.openqa.selenium.grid.distributor.config.DistributorOptions.DEFAULT_SLOT_MATCHER;
import static org.openqa.selenium.grid.distributor.config.DistributorOptions.DEFAULT_SLOT_SELECTOR_IMPLEMENTATION;
import static org.openqa.selenium.grid.distributor.config.DistributorOptions.DISTRIBUTOR_SECTION;

@SuppressWarnings("FieldMayBeFinal")
@AutoService(HasRoles.class)
public class DistributorFlags implements HasRoles {

  @Parameter(names = {"-d", "--distributor"}, description = "Url of the distributor.")
  @ConfigValue(section = DISTRIBUTOR_SECTION, name = "host", example = "\"http://localhost:5553\"")
  private URI distributorServer;

  @Parameter(
    names = "--distributor-port",
    description = "Port on which the distributor is listening.")
  @ConfigValue(section = DISTRIBUTOR_SECTION, name = "port", example = "5553")
  private Integer distributorServerPort;

  @Parameter(
    names = "--distributor-host",
    description = "Host on which the distributor is listening.")
  @ConfigValue(section = DISTRIBUTOR_SECTION, name = "hostname", example = "\"localhost\"")
  private String distributorServerHost;

  @Parameter(
    names = {"--distributor-implementation"},
    description = "Full classname of non-default distributor implementation")
  @ConfigValue(
    section = DISTRIBUTOR_SECTION,
    name = "implementation",
    example = DEFAULT_DISTRIBUTOR_IMPLEMENTATION)
  private String implementation = DEFAULT_DISTRIBUTOR_IMPLEMENTATION;

  @Parameter(
    names = {"--grid-model"},
    description = "Full classname of non-default grid model. This is used to store states of the all the registered Nodes.")
  @ConfigValue(section = DISTRIBUTOR_SECTION, name = "grid-model", example = DEFAULT_GRID_MODEL_IMPLEMENTATION)
  private String gridModel = DEFAULT_GRID_MODEL_IMPLEMENTATION;

  @Parameter(
    names = {"--slot-matcher"},
    description = "Full classname of non-default slot matcher to use. This is used to determine whether a Node can support a particular session.")
  @ConfigValue(section = DISTRIBUTOR_SECTION, name = "slot-matcher", example = DEFAULT_SLOT_MATCHER)
  private String slotMatcher = DEFAULT_SLOT_MATCHER;

  @Parameter(
    names = {"--slot-selector"},
    description = "Full classname of non-default slot selector. This is used to select a slot in a Node once the Node has been matched.")
  @ConfigValue(section = DISTRIBUTOR_SECTION, name = "slot-selector", example = DEFAULT_SLOT_SELECTOR_IMPLEMENTATION)
  private String slotSelector = DEFAULT_SLOT_SELECTOR_IMPLEMENTATION;

  @Parameter(
    names = {"--healthcheck-interval"},
    description = "How often, in seconds, will the health check run for all Nodes." +
      "This ensures the server can ping all the Nodes successfully.")
  @ConfigValue(section = DISTRIBUTOR_SECTION, name = "healthcheck-interval", example = "60")
  public int healthcheckInterval =  DEFAULT_HEALTHCHECK_INTERVAL;

  @Parameter(description = "Allow the Distributor to reject a request immediately if the Grid does not support the requested capability." +
    "Rejecting requests immediately is suitable for Grid set up that does not spin up Nodes on demand.",
    names = "--reject-unsupported-caps", arity = 1)
  @ConfigValue(section = DISTRIBUTOR_SECTION, name = "reject-unsupported-caps", example = "true")
  private boolean rejectUnsupportedCaps = DEFAULT_REJECT_UNSUPPORTED_CAPS;

  @Override
  public Set<Role> getRoles() {
    return Collections.singleton(DISTRIBUTOR_ROLE);
  }
}

{'fraction_non_alphanumeric': 0.09320164924729121, 'fraction_numerical': 0.0028765941125707163, 'mean_word_length': 4.9565962307252995, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6349503', 'n_tokens_mistral': 3019, 'n_tokens_neox': 2912, 'n_words': 875}