(encoder, datum, schema, named_schemas, fname)
Maps are encoded as a series of blocks.

    Each block consists of a long count value, followed by that many key/value
    pairs.  A block with count zero indicates the end of the map.  Each item is
    encoded per the map's value schema.

    If a block's count is negative, then the count is followed immediately by a
    long block size, indicating the number of bytes in the block. The actual
    count in this case is the absolute value of the count written.
Maps are encoded as a series of blocks.
Maps are encoded as a series of blocks .
def write_map(encoder, datum, schema, named_schemas, fname):
    """Maps are encoded as a series of blocks.

    Each block consists of a long count value, followed by that many key/value
    pairs.  A block with count zero indicates the end of the map.  Each item is
    encoded per the map's value schema.

    If a block's count is negative, then the count is followed immediately by a
    long block size, indicating the number of bytes in the block. The actual
    count in this case is the absolute value of the count written."""
    encoder.write_map_start()
    if len(datum) > 0:
        encoder.write_item_count(len(datum))
        vtype = schema["values"]
        for key, val in datum.items():
            encoder.write_utf8(key)
            write_data(encoder, val, vtype, named_schemas, fname)
    encoder.write_map_end()
def write_map ( encoder , datum , schema , named_schemas , fname ) : encoder . write_map_start ( ) if len ( datum ) > 0 : encoder . write_item_count ( len ( datum ) ) vtype = schema [ "values" ] for key , val in datum . items ( ) : encoder . write_utf8 ( key ) write_data ( encoder , val , vtype , named_schemas , fname ) encoder . write_map_end ( )