#NEWLINE# @ staticmethod #NEWLINE# def construct_api_url( api_url , **params ) : #NEWLINE# #INDENT# "Construct a Twitter API url, encoded, with parameters\n\n        :param api_url: URL of the Twitter API endpoint you are attempting to construct\n        :param \\*\\*params: Parameters that are accepted by Twitter for the endpoint you're requesting\n        :rtype: string\n\n        Usage::\n\n          >>> from twython import Twython\n          >>> twitter = Twython()\n\n          >>> api_url = 'https://api.twitter.com/1.1/search/tweets.json'\n          >>> constructed_url = twitter.construct_api_url(api_url, q='python', result_type='popular')\n          >>> print constructed_url\n          https://api.twitter.com/1.1/search/tweets.json?q=python&result_type=popular\n\n        " #NEWLINE# querystring = [ ] #NEWLINE# ( params , _ ) = _transparent_params ( ( params or { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) ) #NEWLINE# params = requests . utils . to_key_val_list ( params ) #NEWLINE# for ( k , v ) in params : #NEWLINE# #INDENT# querystring . append ( ( '%s=%s' % ( Twython . encode ( api_url ) , quote_plus ( Twython . encode ( v ) ) ) ) ) #NEWLINE# #UNINDENT# return ( '%s?%s' % ( api_url , '&' . join ( querystring ) ) )