code: def merge(*tables, **kwargs):
      
  
      assert 'key' in kwargs, 'keyword argument "key" is required'
      key = kwargs['key']
      t1 = mergesort(*tables, **kwargs)
      t2 = mergeduplicates(t1, key=key, presorted=True)
      return t2
docs: Convenience function to combine multiple tables (via
      :func:`petl.transform.sorts.mergesort`) then combine duplicate rows by
      merging under the given key (via
      :func:`petl.transform.reductions.mergeduplicates`). E.g.::
  
          >>> import petl as etl
          >>> table1 = [['foo', 'bar', 'baz'],
          ...           [1, 'A', True],
          ...           [2, 'B', None],
          ...           [4, 'C', True]]
          >>> table2 = [['bar', 'baz', 'quux'],
          ...           ['A', True, 42.0],
          ...           ['B', False, 79.3],
          ...           ['C', False, 12.4]]
          >>> table3 = etl.merge(table1, table2, key='bar')
          >>> table3
          +-----+-----+-------------------------+------+
          | bar | foo | baz                     | quux |
          +=====+=====+=========================+======+
          | 'A' |   1 | True                    | 42.0 |
          +-----+-----+-------------------------+------+
          | 'B' |   2 | False                   | 79.3 |
          +-----+-----+-------------------------+------+
          | 'C' |   4 | Conflict({False, True}) | 12.4 |
          +-----+-----+-------------------------+------+
  
      Keyword arguments are the same as for
      :func:`petl.transform.sorts.mergesort`, except `key` is required.