def is_type(url, types=[], wait=<NUM_LIT:10>):
<EOL>if isinstance(types, str):<EOL><INDENT>types = [types]<EOL><DEDENT>try: connection = open(url, wait)<EOL>except:<EOL><INDENT>return False<EOL><DEDENT>type = connection.info()["<STR_LIT:Content-Type>"]<EOL>for t in types:<EOL><INDENT>if type.startswith(t): return True<EOL><DEDENT>return False<EOL>
Determine the MIME-type of the document behind the url.

    MIME is more reliable than simply checking the document extension.
    Returns True when the MIME-type starts with anything in the list of types.