def url_for(endpoint, **values):
    """Generates a URL to the given endpoint with the method provided.

    Variable arguments that are unknown to the target endpoint are appended
    to the generated URL as query arguments.  If the value of a query argument
    is `None`, the whole pair is skipped.  In case blueprints are active
    you can shortcut references to the same blueprint by prefixing the
    local endpoint with a dot (``.``).

    This will reference the index function local to the current blueprint::

        url_for('.index')

    For more information, head over to the :ref:`Quickstart <url-building>`.

    :param endpoint: the endpoint of the URL (name of the function)
    :param values: the variable arguments of the URL rule
    :param _external: if set to `True`, an absolute URL is generated.
    """
    ctx = _request_ctx_stack.top
    blueprint_name = request.blueprint
    if not ctx.request._is_old_module:
        if endpoint[:1] == '.':
            if blueprint_name is not None:
                endpoint = blueprint_name + endpoint
            else:
                endpoint = endpoint[1:]
    else:
        # TODO: get rid of this deprecated functionality in 1.0
        if '.' not in endpoint:
            if blueprint_name is not None:
                endpoint = blueprint_name + '.' + endpoint
        elif endpoint.startswith('.'):
            endpoint = endpoint[1:]
    external = values.pop('_external', False)
    ctx.app.inject_url_defaults(endpoint, values)
    return ctx.url_adapter.build(endpoint, values, force_external=external)
dataset/ETHPy150Open hhstore/flask-annotated/flask-0.7/flask/helpers.py/url_for/original