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

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