def load_schema(filename, context=None):
table = import_from_uri(filename)<EOL>field_names = table.field_names<EOL>assert "<STR_LIT>" in field_names<EOL>assert "<STR_LIT>" in field_names<EOL>context = context or {<EOL>key.replace("<STR_LIT>", "<STR_LIT>").lower(): getattr(rows.fields, key)<EOL>for key in dir(rows.fields)<EOL>if "<STR_LIT>" in key and key != "<STR_LIT>"<EOL>}<EOL>return OrderedDict(<EOL>[<EOL>(row.field_name, context[row.field_type])<EOL>for row in table<EOL>]<EOL>)<EOL>
Load schema from file in any of the supported formats

    The table must have at least the fields `field_name` and `field_type`.
    `context` is a `dict` with field_type as key pointing to field class, like:
        {"text": rows.fields.TextField, "value": MyCustomField}