def expand_query_to_parameters(query=None):
    ' Convert a dictionary to URL parameters '
    params = []
    if (query is None):
        return ''
    keys = sorted(query.keys())
    for key in keys:
        value = query[key]
        params = (params + expand_parameter_to_parameters(key, value))
    return '&'.join(params)
Convert a dictionary to URL parameters
def expand_query_to_parameters(query=None):
    '  '
    params = []
    if (query is None):
        return 
    keys = sorted(query.keys())
    for key in keys:
        value = query[key]
        params = (params + expand_parameter_to_parameters(key, value))
    return '&'.join(params)