docs: def compare(testsuite, gold, select='i-id i-input mrs'):
      """
      Compare two [incr tsdb()] profiles.
  
      Args:
          testsuite (str, TestSuite): path to the test [incr tsdb()]
              testsuite or a :class:`TestSuite` object
          gold (str, TestSuite): path to the gold [incr tsdb()]
              testsuite or a :class:`TestSuite` object
          select: TSQL query to select (id, input, mrs) triples
              (default: `i-id i-input mrs`)
      Yields:
          dict: Comparison results as::
  
              {"id": "item identifier",
               "input": "input sentence",
               "test": number_of_unique_results_in_test,
               "shared": number_of_shared_results,
               "gold": number_of_unique_results_in_gold}
  
      """
      from delphin.mrs import simplemrs, compare as mrs_compare
  
      if not isinstance(testsuite, itsdb.TestSuite):
          if isinstance(testsuite, itsdb.ItsdbProfile):
              testsuite = testsuite.root
          testsuite = itsdb.TestSuite(testsuite)
      if not isinstance(gold, itsdb.TestSuite):
          if isinstance(gold, itsdb.ItsdbProfile):
              gold = gold.root
          gold = itsdb.TestSuite(gold)
  
      queryobj = tsql.inspect_query('select ' + select)
      if len(queryobj['projection']) != 3:
          raise ValueError('select does not return 3 fields: ' + select)
  
      input_select = '{} {}'.format(queryobj['projection'][0],
                                    queryobj['projection'][1])
      i_inputs = dict(tsql.select(input_select, testsuite))
  
      matched_rows = itsdb.match_rows(
          tsql.select(select, testsuite),
          tsql.select(select, gold),
          0)
  
      for (key, testrows, goldrows) in matched_rows:
          (test_unique, shared, gold_unique) = mrs_compare.compare_bags(
              [simplemrs.loads_one(row[2]) for row in testrows],
              [simplemrs.loads_one(row[2]) for row in goldrows])
          yield {'id': key,
                 'input': i_inputs[key],
                 'test': test_unique,
                 'shared': shared,
                 'gold': gold_unique}