code: def encode_transit(records):
      '''Returns the records serialized as Transit/json in utf8'''
      with StringIO() as buf:
          writer = Writer(buf, "json")
          writer.write(records)
          return buf.getvalue().encode('utf8'f encode_transit(records):
      '''Returns the records serialized as Transit/json in utf8'''
      with StringIO() as buf:
          writer = Writer(buf, "json")
          writer.write(records)
          return buf.getvalue().encode('utf8')
docs: Returns the records serialized as Transit/json in utf8