code: def match_rows(rows1, rows2, key, sort_keys=True):
      
      matched = OrderedDict()
      for i, rows in enumerate([rows1, rows2]):
          for row in rows:
              val = row[key]
              try:
                  data = matched[val]
              except KeyError:
                  matched[val] = ([], [])
                  data = matched[val]
              data[i].append(row)
      vals = matched.keys()
      if sort_keys:
          vals = sorted(vals, key=safe_int)
      for val in vals:
          left, right = matched[val]
          yield (val, left, right)
docs: Yield triples of `(value, left_rows, right_rows)` where
      `left_rows` and `right_rows` are lists of rows that share the same
      column value for *key*. This means that both *rows1* and *rows2*
      must have a column with the same name *key*.
  
      .. warning::
  
         Both *rows1* and *rows2* will exist in memory for this
         operation, so it is not recommended for very large tables on
         low-memory systems.
  
      Args:
          rows1: a :class:`Table` or list of :class:`Record` objects
          rows2: a :class:`Table` or list of :class:`Record` objects
          key (str): the column name on which to match
          sort_keys (bool): if `True`, yield matching rows sorted by the
              matched key instead of the original order