def prepare_query_string(params):
 params = sorted(params.items(), key=(lambda x: x[0]))
 return (('?%s' % parse.urlencode(params)) if params else '')

def prepare_query_string ( params ) : params = sorted ( params . items ( ) , key = ( lambda x : x [ 0 ] ) ) return ( ( '?%s' % parse . urlencode ( params ) ) if params else '' )
convert dict params to query string .