Generate matches with the given driver.

 @param driver [Driver]
 @option options [Integer] round the round to generate
 @option options [Boolean] bronze_match whether to generate a bronze match
     on the final round.
502539
def generate(driver, options = {})
      teams = driver.ranked_teams
      raise 'Page Playoffs only works with 4 teams' if teams.length != 4

      round = options[:round] || guess_round(driver)

      case round
      when 0 then semi_finals(driver, teams)
      when 1 then preliminary_finals(driver)
      when 2 then grand_finals(driver, options)
      else
        raise 'Invalid round number'
      end
    end
186376
def matching(staging_record, table_name = nil)
      table_name, id = Stagehand::Key.generate(staging_record, :table_name => table_name)
      prepare_to_modify(table_name)
      return Record.where(:id => id)
    end
381533
function Comparison (driver, comparisonList) {
	this._driver = driver;

	this._comparisons = {};
	comparisonList.forEach(function (comparison) {
		this._loadComparison(comparison);
	}.bind(this));
}
1188641
function Matcher(options) {

        options = options || {};

        /**
         * ### Matcher.x
         *
         * The row-index of the last returned match by Matcher.getMatch
         *
         * @see Matcher.getMatch
         */
        this.x = null;

        /**
         * ### Matcher.y
         *
         * The column-index of the last returned match by Matcher.getMatch
         *
         * @see Matcher.getMatch
         */
        this.y = null;

        /**
         * ### Matcher.matches
         *
         * Nested array of matches (with position-numbers)
         *
         * Nests a new array for each round, and within each round
         * individual matches are also array. For example:
         *
         * ```javascript
         *
         * // Matching array.
         * [
         *
         *   // First round.
         *   [ [ p1, p2 ], [ p3, p4 ], ... ],
         *
         *   // Second round.
         *   [ [ p2, p3 ], [ p4, p1 ], ... ],
         *
         *   // Further rounds.
         * ];
         * ```
         *
         * @see Matcher.setMatches
         */
        this.matches = null;

        /**
         * ### Matcher.resolvedMatches
         *
         * Nested array of matches (with id-strings)
         *
         * Exactly Matcher.matches, but with with ids instead of numbers
         *
         * This method is used both by getMatch and getMatchObject (if
         * a single match is requested).
         *
         * @see Matcher.matches
         * @see Matcher.resolvedMatchesObj
         * @see Matcher.resolvedMatchesById
         * @see Matcher.setIds
         * @see Matcher.setAssignerCb
         * @see Matcher.match
         */
        this.resolvedMatches = null;

        /**
         * ### Matcher.resolvedMatchesObj
         *
         * Array of maps id to partner, one map per round
         *
         * ```javascript
         *
         * // Matching array.
         * [
         *
         *   // First round.
         *   { p1: 'p2', p2: 'p1', p3: 'p4', p4: 'p3',  ... },
         *
         *   // Second round.
         *   { p2: 'p3', p3: 'p2', p4: 'p1', p1: 'p4',  ... },
         *
         *   // Further rounds.
         * ];
         * ```
         *
         * @see Matcher.resolvedMatches
         * @see Matcher.resolvedMatchesById
         * @see Matcher.setIds
         * @see Matcher.match
         */
        this.resolvedMatchesObj = null;

        /**
         * ### Matcher.resolvedMatchesById
         *
         * Maps ids to a sequence of matches
         *
         * ```javascript
         *
         * // Matching object.
         * {
         *
         *   // All rounds.
         *   p1: [ 'p2', 'p4', ... ],
         *   p2: [ 'p1', 'p3', ... ],
         *   p3: [ 'p4', 'p2', ... ],
         *   p4: [ 'p3', 'p1', ... ]
         *   ...
         *
         * };
         * ```
         *
         * @see Matcher.resolvedMatches
         * @see Matcher.resolvedMatchesObj
         * @see Matcher.setIds
         * @see Matcher.match
         */
        this.resolvedMatchesById = null;

        /**
         * ### Matcher.ids
         *
         * Array ids to match
         *
         * @see Matcher.setIds
         */
        this.ids = null;

        /**
         * ### Matcher.ids
         *
         * Array mapping each ordinal position to an id
         *
         * @see Matcher.ids
         * @see Matcher.assignerCb
         */
        this.assignedIds = null;

        /**
         * ### Matcher.idsMap
         *
         * Map ids to match
         *
         * @see Matcher.setIds
         */
        this.idsMap = null;

        /**
         * ### Matcher.assignedIdsMap
         *
         * Map ids to ordinal position in matches
         *
         * @see Matcher.idsMap
         * @see Matcher.assignedIds
         */
        this.assignedIdsMap = null;

        /**
         * ### Matcher.assignerCb
         *
         * Callback that assigns ids to positions
         *
         * An assigner callback must take as input an array of ids,
         * reorder them according to some criteria, and return it.
         * The order of the items in the returned array will be used to
         * match the numbers in the `matches` array.
         *
         * @see Matcher.ids
         * @see Matcher.matches
         * @see Matcher.assignedIds
         */
        this.assignerCb = Matcher.randomAssigner;

        /**
         * ## Matcher.missingId
         *
         * An id used to replace missing players ids
         */
        this.missingId = Matcher.missingId;

        /**
         * ## Matcher.missingId
         *
         * An id used by matching algorithms to complete unfinished matches
         */
        this.bye = Matcher.bye;

        /**
         * ## Matcher.doObjLists
         *
         * Flag that obj lists should be created when `match` is invoked
         *
         * @see Matcher.resolvedMatchesObj
         * @see Matcher.matcher
         */
        this.doObjLists = true;

        /**
         * ## Matcher.doIdLists
         *
         * Flag that id lists should be created when `match` is invoked
         *
         * @see Matcher.resolvedMatchesById
         * @see Matcher.matcher
         */
        this.doIdLists = true;

        /**
         * ## Matcher.doRoles
         *
         * Flag that roles should be assigned when `match` is invoked
         *
         * Requires roles to be set, otherwise an error is thrown
         *
         * @see Matcher.roles
         * @see Matcher.roler
         * @see Matcher.matcher
         */
        this.doRoles = false;

        /**
         * ## Matcher.roler
         *
         * Handles assigning roles to matches
         *
         * If null here, is initialized by `init` if doRoles is TRUE.
         *
         * @see Matcher.doRoles
         * @see Matcher.init
         */
        this.roler = options.roler || null;

        /**
         * ## Matcher.roles
         *
         * Roles map created if `doRoles` is TRUE
         *
         * @see Matcher.doRoles
         * @see Matcher.roler
         * @see Matcher.matcher
         */
        this.roler = options.roler || null;

        // Init.
        this.init(options);
    }
1238469
def check_rounds
      round = Hash.new
      round_last = last_round
      @player.values.each do |p|
        p.results.each do |r|
          round[r.round] = true
        end
      end
      (1..round_last).each { |r| raise "there are no results for round #{r}" unless round[r] }
      if rounds
        raise "declared number of rounds is #{rounds} but there are results in later rounds, such as #{round_last}" if rounds < round_last
        raise "declared number of rounds is #{rounds} but there are no results with rounds greater than #{round_last}" if rounds > round_last
      else
        self.rounds = round_last
      end
    end
1036411
def matches?(rendered)
      @rendered = rendered
      matches = Nokogiri::HTML::Document.parse(@rendered.to_s).css(@name).select do |element|
        matches_attributes?(element) && matches_content?(element) && matches_criteria?(element)
      end
      matches_count?(matches)
    end
603383
def gen_local_driver(browser, capabilities):
        ''' 
        '''
        if browser == "firefox":
            fp = capabilities.pop("firefox_profile",None)
            return webdriver.Firefox(desired_capabilities =capabilities, firefox_profile=fp)
                   
        elif browser == "chrome":            
            return webdriver.Chrome(desired_capabilities=capabilities)
        
        else:
            raise TypeError("Unsupport browser {}".format(browser))
430975
def run
      result = CssCompare::Engine.new(@options)
                                 .parse!
                                 .equal?
      write_output(result.to_s + "\n", @options[:output])
    end
239749
def generate
      options = {}
      options[:title]  = title  if title
      options[:format] = format if format
      options[:output] = output if output
      options[:config] = config if config

      options[:files]  = collect_files

      locat = ::LOCat::Command.new(options)

      locat.run
    end
485594
def make_driver(loop=None):
    ''' 
    '''
    loop = loop or asyncio.get_event_loop()

    def stop(i = None):
        loop.stop()

    def driver(sink):
        ''' The stop driver stops the asyncio event loop.
        The event loop is stopped as soon as an event is received on the 
        control observable or when it completes (both in case of success or 
        error).

        Parameters
        ----------
            sink: Sink
        '''
        sink.control.subscribe(
            on_next=stop,
            on_error=stop,
            on_completed=stop)
        return None

    return Component(call=driver, input=Sink)
501280
def setup_driver(scenario):
    
    if not hasattr(world, 'config_files'):
        world.config_files = ConfigFiles()

    # By default config directory is located in terrain path
    if not world.config_files.config_directory:
        world.config_files.set_config_directory(DriverWrappersPool.get_default_config_directory())

    world.global_status = {'test_passed': True}
    bdd_common_before_scenario(world, scenario)
839304
@Override
	public Collection<BioPAXElement> generate(Match match, int... ind)
	{
		Interaction inter = (Interaction) match.get(ind[0]);

		Set<Entity> taboo = new HashSet<Entity>();

		for (int i = 1; i < getVariableSize() - 1; i++)
		{
			taboo.add((Entity) match.get(ind[i]));
		}

		if (direction == null) return generate(inter, taboo);
		else return generate((Conversion) inter, direction, taboo);
	}
874536
def equal_driver_config?(config1, config2)
      return false unless config1[:host]        == config2[:host]
      return false unless config1[:port]        == config2[:port]
      return false unless config1[:timeout_sec] == config2[:timeout_sec]
      return false unless config1[:pool_size]   == config2[:pool_size]
      return false unless config1[:config_key]  == config2[:config_key]
      return true
    end
25463
private void generateStoreNewProxyMatcher() {
        String proxyMatcherType = Types.PROXY_MATCHER.getInternalName();

        // stack:
        insert(new TypeInsnNode(NEW, proxyMatcherType));
        // stack: <proxyMatcher>
        insert(new InsnNode(DUP));
        // stack: <proxyMatcher> :: <proxyMatcher>
        insert(new MethodInsnNode(INVOKESPECIAL, proxyMatcherType, "<init>", "()V", false));
        // stack: <proxyMatcher>
        generateStoreInCache();
        // stack: <proxyMatcher>
    }
679985
public static void generateSelect(Builder builder, SQLiteModelMethod method) throws ClassNotFoundException {
		SelectType selectResultType = SelectBuilderUtility.detectSelectType(method);

		// generate select method
		selectResultType.generate(builder, method);

		if (method.hasLiveData()) {
			// generate
			selectResultType.generateLiveData(builder, method);
		}

		if (method.contentProviderEntryPathEnabled) {
			// we need to generate UPDATE or DELETE for content provider to
			generateSelectForContentProvider(builder, method, selectResultType);
		}
	}
896966
def matches?(*rules)
      rules.flatten.each do |r|
        if r =~ /(.+)@\z/
          return r if File.fnmatch?($1, self.local)
        end
      end
      false
    end
547985
def generate(options = {})
      rule   = find_rule(options) || return
      number = generate_from_rule(rule)

      {
        number:  number,
        type:    rule[:type],
        country: rule[:country]
      }
    end