def urlnoencode(query):
    """Convert a sequence of two-element tuples or dictionary into a URL query string
    without url-encoding.
    """
    output = []
    arg = "%s=%s"

    if hasattr(query, "items"):
        # mapping objects
        query = list(query.items())

    for k, val in query:
        output.append(arg % (k, val))

    return "&".join(output)