def METHOD_NAME(schema: Schema, named_schemas: NamedSchemas) -> Schema:
    # union schemas
    if isinstance(schema, list):
        return [METHOD_NAME(s, named_schemas) for s in schema]
    # string schemas; this could be either a named schema or a primitive type
    elif not isinstance(schema, dict):
        if schema in PRIMITIVES:
            return schema
        else:
            return f"A_{_md5(schema)}"
    else:
        # Remaining valid schemas must be dict types
        schema_type = schema["type"]
        parsed_schema = {}
        parsed_schema["type"] = schema_type
        if "doc" in schema:
            parsed_schema["doc"] = _md5(schema["doc"])
        if schema_type == "array":
            parsed_schema["items"] = METHOD_NAME(schema["items"], named_schemas)
        elif schema_type == "map":
            parsed_schema["values"] = METHOD_NAME(schema["values"], named_schemas)
        elif schema_type == "enum":
            parsed_schema["name"] = f"A_{_md5(schema['name'])}"
            parsed_schema["symbols"] = [
                f"A_{_md5(symbol)}" for symbol in schema["symbols"]
            ]
        elif schema_type == "fixed":
            parsed_schema["name"] = f"A_{_md5(schema['name'])}"
            parsed_schema["size"] = schema["size"]
        elif schema_type == "record" or schema_type == "error":
            # records
            parsed_schema["name"] = f"A_{_md5(schema['name'])}"
            parsed_schema["fields"] = [
                anonymize_field(field, named_schemas) for field in schema["fields"]
            ]
        elif schema_type in PRIMITIVES:
            parsed_schema["type"] = schema_type
        return parsed_schema