def detect_source(uri, verify_ssl, progress, timeout=<NUM_LIT:5>):
<EOL>if uri.lower().startswith("<STR_LIT>") or uri.lower().startswith("<STR_LIT>"):<EOL><INDENT>return download_file(<EOL>uri, verify_ssl=verify_ssl, timeout=timeout, progress=progress, detect=True<EOL>)<EOL><DEDENT>elif uri.startswith("<STR_LIT>"):<EOL><INDENT>return Source(<EOL>should_delete=False,<EOL>encoding=None,<EOL>plugin_name="<STR_LIT>",<EOL>uri=uri,<EOL>is_file=False,<EOL>local=None,<EOL>)<EOL><DEDENT>else:<EOL><INDENT>return local_file(uri)<EOL><DEDENT>
Return a `rows.Source` with information for a given URI

    If URI starts with "http" or "https" the file will be downloaded.

    This function should only be used if the URI already exists because it's
    going to download/open the file to detect its encoding and MIME type.