parameters: (json1, json2)
return_statement: return partitions
docstring: While preserving the ordering, find benchmarks with the same names in
      both of the inputs, and group them.
      (i.e. partition/filter into groups with common name)
docstring_summary: While preserving the ordering, find benchmarks with the same names in
      both of the inputs, and group them.
      (i.e. partition/filter into groups with common name)
docstring_tokens: While preserving the ordering find benchmarks with the same names in both of the inputs and group them . ( i . e . partition / filter into groups with common name )
function: def partition_benchmarks(json1, json2):
      """
      While preserving the ordering, find benchmarks with the same names in
      both of the inputs, and group them.
      (i.e. partition/filter into groups with common name)
      """
      json1_unique_names = get_unique_benchmark_names(json1)
      json2_unique_names = get_unique_benchmark_names(json2)
      names = intersect(json1_unique_names, json2_unique_names)
      partitions = []
      for name in names:
          time_unit = None
          # Pick the time unit from the first entry of the lhs benchmark.
          # We should be careful not to crash with unexpected input.
          for x in json1['benchmarks']:
              if (x['name'] == name and is_potentially_comparable_benchmark(x)):
                  time_unit = x['time_unit']
                  break
          if time_unit is None:
              continue
          # Filter by name and time unit.
          # All the repetitions are assumed to be comparable.
          lhs = [x for x in json1['benchmarks'] if x['name'] == name and
                 x['time_unit'] == time_unit]
          rhs = [x for x in json2['benchmarks'] if x['name'] == name and
                 x['time_unit'] == time_unit]
          partitions.append([lhs, rhs])
      return partitions
function_tokens: def partition_benchmarks ( json1 , json2 ) : json1_unique_names = get_unique_benchmark_names ( json1 ) json2_unique_names = get_unique_benchmark_names ( json2 ) names = intersect ( json1_unique_names , json2_unique_names ) partitions = [ ] for name in names : time_unit = None # Pick the time unit from the first entry of the lhs benchmark. # We should be careful not to crash with unexpected input. for x in json1 [ 'benchmarks' ] : if ( x [ 'name' ] == name and is_potentially_comparable_benchmark ( x ) ) : time_unit = x [ 'time_unit' ] break if time_unit is None : continue # Filter by name and time unit. # All the repetitions are assumed to be comparable. lhs = [ x for x in json1 [ 'benchmarks' ] if x [ 'name' ] == name and x [ 'time_unit' ] == time_unit ] rhs = [ x for x in json2 [ 'benchmarks' ] if x [ 'name' ] == name and x [ 'time_unit' ] == time_unit ] partitions . append ( [ lhs , rhs ] ) return partitions