def content_type_for_file_extension(typeuri, file_extension):
    '\n    Returns content-type for given file extension as an instance of a given type URI,\n    or None.\n\n    >>> content_type_for_file_extension(ANNAL.CURIE.Richtext, "md") == "text/markdown"\n    True\n    >>> content_type_for_file_extension(ANNAL.CURIE.Resource, "md") == "text/markdown"\n    True\n    >>> content_type_for_file_extension(ANNAL.CURIE.Resource, "pdf") == "application/pdf"\n    True\n    >>> content_type_for_file_extension(ANNAL.CURIE.Resource, "unknown") == None\n    True\n\n    '
    for (fe, ct) in resource_types.get(typeuri, default_types):
        if (fe == file_extension):
            return ct
    return None
Returns content-type for given file extension as an instance of a given type URI,
or None.

>>> content_type_for_file_extension(ANNAL.CURIE.Richtext, "md") == "text/markdown"
True
>>> content_type_for_file_extension(ANNAL.CURIE.Resource, "md") == "text/markdown"
True
>>> content_type_for_file_extension(ANNAL.CURIE.Resource, "pdf") == "application/pdf"
True
>>> content_type_for_file_extension(ANNAL.CURIE.Resource, "unknown") == None
True
def content_type_for_file_extension(typeuri, file_extension):
    '\n    Returns content-type for given file extension as an instance of a given type URI,\n    or None.\n\n    >>> content_type_for_file_extension(ANNAL.CURIE.Richtext, "md") == "text/markdown"\n    True\n    >>> content_type_for_file_extension(ANNAL.CURIE.Resource, "md") == "text/markdown"\n    True\n    >>> content_type_for_file_extension(ANNAL.CURIE.Resource, "pdf") == "application/pdf"\n    True\n    >>> content_type_for_file_extension(ANNAL.CURIE.Resource, "unknown") == None\n    True\n\n    '
    for (fe, ct) in resource_types.get(typeuri, default_types):
        if (fe == file_extension):
            return ct
    return None