Returns an Avro binary or JSON encoded datum dict using its schema.
Parameters
SCHEMA (str or avro.Schema) –
A parsed schema object from avro.schema.parse() or a string containing the schema.
datum (dict) –
A dict of key-value pairs containing the data to encode (the entries must match the schema).