code: def write_data(fo, datum, schema):
      
  
      record_type = extract_record_type(schema)
      logical_type = extract_logical_type(schema)
  
      fn = WRITERS.get(record_type)
      if fn:
          if logical_type:
              prepare = LOGICAL_WRITERS.get(logical_type)
              if prepare:
                  datum = prepare(datum, schema)
          return fn(fo, datum, schema)
      else:
          return write_data(fo, datum, SCHEMA_DEFS[record_type])
docs: Write a datum of data to output stream.
  
      Paramaters
      ----------
      fo: file-like
          Output file
      datum: object
          Data to write
      schema: dict
          Schemda to use