def create_engine(url, con=None, header=True, show_progress=<NUM_LIT>, clear_progress=True):
url = urlparse(url)<EOL>engine_type = url.scheme if url.scheme else '<STR_LIT>'<EOL>if con is None:<EOL><INDENT>if url.netloc:<EOL><INDENT>apikey, host = url.netloc.split('<STR_LIT:@>')<EOL>con = Connection(apikey=apikey, endpoint="<STR_LIT>".format(host))<EOL><DEDENT>else:<EOL><INDENT>con = Connection()<EOL><DEDENT><DEDENT>database = url.path[<NUM_LIT:1>:] if url.path.startswith('<STR_LIT:/>') else url.path<EOL>params = {<EOL>'<STR_LIT:type>': engine_type,<EOL>}<EOL>params.update(parse_qsl(url.query))<EOL>return QueryEngine(con, database, params,<EOL>header=header,<EOL>show_progress=show_progress,<EOL>clear_progress=clear_progress)<EOL>
Create a handler for query engine based on a URL.

    The following environment variables are used for default connection:

      TD_API_KEY     API key
      TD_API_SERVER  API server (default: api.treasuredata.com)
      HTTP_PROXY     HTTP proxy (optional)

    Parameters
    ----------
    url : string
        Engine descriptor in the form "type://apikey@host/database?params..."
        Use shorthand notation "type:database?params..." for the default connection.
    con : Connection, optional
        Handler returned by connect. If not given, default connection is used.
    header : string or boolean, default True
        Prepend comment strings, in the form "-- comment", as a header of queries.
        Set False to disable header.
    show_progress : double or boolean, default 5.0
        Number of seconds to wait before printing progress.
        Set False to disable progress entirely.
    clear_progress : boolean, default True
        If True, clear progress when query completed.

    Returns
    -------
    QueryEngine