tools/fuchsia/comparative_tester/generate_perf_report.py
def ZipListsByPredicate(left: List[T], right: List[T],
                        pred: Callable[[T], R]) -> Dict[R, Tuple[T, T]]:
  """This function takes two lists, and a predicate. The predicate is applied to
  the values in both lists to obtain a keying value from them. Each item is then
  inserted into the returned dictionary using the obtained key. The predicate
  should not map multiple values from one list to the same key.
  """
  paired_items = {}  # type: Dict [R, Tuple[T, T]]
  for item in left:
    key = pred(item)
    # the first list shouldn't cause any key collisions
    assert key not in paired_items.keys()
    paired_items[key] = item, None

  for item in right:
    key = pred(item)
    if key in paired_items.keys():
      # elem 1 of the tuple is always None if the key exists in the map
      prev, _ = paired_items[key]
      paired_items[key] = prev, item
    else:
      paired_items[key] = None, item

  return paired_items
This function takes two lists, and a predicate. The predicate is applied to
  the values in both lists to obtain a keying value from them. Each item is then
  inserted into the returned dictionary using the obtained key. The predicate
  should not map multiple values from one list to the same key.
  
This function takes two lists, and a predicate. The predicate is applied to
the values in both lists to obtain a keying value from them. Each item is then
inserted into the returned dictionary using the obtained key. The predicate
should not map multiple values from one list to the same key.
This function takes two lists and a predicate . The predicate is applied to the values in both lists to obtain a keying value from them . Each item is then inserted into the returned dictionary using the obtained key . The predicate should not map multiple values from one list to the same key .
def ZipListsByPredicate(left: List[T], right: List[T],
                        pred: Callable[[T], R]) -> Dict[R, Tuple[T, T]]:
  paired_items = {}  
  for item in left:
    key = pred(item)
    assert key not in paired_items.keys()
    paired_items[key] = item, None
  for item in right:
    key = pred(item)
    if key in paired_items.keys():
      prev, _ = paired_items[key]
      paired_items[key] = prev, item
    else:
      paired_items[key] = None, item
  return paired_items
def ZipListsByPredicate ( left : List [ T ] , right : List [ T ] , pred : Callable [ [ T ] , R ] ) -> Dict [ R , Tuple [ T , T ] ] : paired_items = { } for item in left : key = pred ( item ) assert key not in paired_items . keys ( ) paired_items [ key ] = item , None for item in right : key = pred ( item ) if key in paired_items . keys ( ) : prev , _ = paired_items [ key ] paired_items [ key ] = prev , item else : paired_items [ key ] = None , item return paired_items
This function takes two lists, and a predicate.
This function takes two lists and a predicate .
"""This function takes two lists, and a predicate. The predicate is applied to
  the values in both lists to obtain a keying value from them. Each item is then
  inserted into the returned dictionary using the obtained key. The predicate
  should not map multiple values from one list to the same key.
  """ # type: Dict [R, Tuple[T, T]] # the first list shouldn't cause any key collisions # elem 1 of the tuple is always None if the key exists in the map
left
List[T]
right
List[T]
pred
Callable[[T], R]