def __init__(self, app_key=None, app_secret=None, oauth_token=None,<EOL>oauth_token_secret=None, access_token=None,<EOL>token_type='<STR_LIT>', oauth_version=<NUM_LIT:1>, api_version='<STR_LIT>',<EOL>client_args=None, auth_endpoint='<STR_LIT>'):
<EOL>self.api_version = api_version<EOL>self.api_url = '<STR_LIT>'<EOL>self.app_key = app_key<EOL>self.app_secret = app_secret<EOL>self.oauth_token = oauth_token<EOL>self.oauth_token_secret = oauth_token_secret<EOL>self.access_token = access_token<EOL>self.request_token_url = self.api_url % '<STR_LIT>'<EOL>self.access_token_url = self.api_url % '<STR_LIT>'<EOL>self.authenticate_url = self.api_url % ('<STR_LIT>' % auth_endpoint)<EOL>if self.access_token:  <EOL><INDENT>oauth_version = <NUM_LIT:2><EOL><DEDENT>self.oauth_version = oauth_version<EOL>if oauth_version == <NUM_LIT:2>:<EOL><INDENT>self.request_token_url = self.api_url % '<STR_LIT>'<EOL><DEDENT>self.client_args = client_args or {}<EOL>default_headers = {'<STR_LIT>': '<STR_LIT>' + __version__}<EOL>if '<STR_LIT>' not in self.client_args:<EOL><INDENT>self.client_args['<STR_LIT>'] = default_headers<EOL><DEDENT>elif '<STR_LIT>' not in self.client_args['<STR_LIT>']:<EOL><INDENT>self.client_args['<STR_LIT>'].update(default_headers)<EOL><DEDENT>auth = None<EOL>if oauth_version == <NUM_LIT:1>:<EOL><INDENT>if self.app_key is not None and self.app_secret is not None:<EOL><INDENT>auth = OAuth1(self.app_key, self.app_secret,<EOL>self.oauth_token, self.oauth_token_secret)<EOL><DEDENT><DEDENT>elif oauth_version == <NUM_LIT:2> and self.access_token:<EOL><INDENT>token = {'<STR_LIT>': token_type,<EOL>'<STR_LIT>': self.access_token}<EOL>auth = OAuth2(self.app_key, token=token)<EOL><DEDENT>self.client = requests.Session()<EOL>self.client.auth = auth<EOL>client_args_copy = self.client_args.copy()<EOL>for k, v in client_args_copy.items():<EOL><INDENT>if k in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>setattr(self.client, k, v)<EOL>self.client_args.pop(k)  <EOL><DEDENT><DEDENT>self.client.headers.update(self.client_args.pop('<STR_LIT>'))<EOL>self._last_call = None<EOL>
Instantiates an instance of Twython. Takes optional parameters for
        authentication and such (see below).

        :param app_key: (optional) Your applications key
        :param app_secret: (optional) Your applications secret key
        :param oauth_token: (optional) When using **OAuth 1**, combined with
        oauth_token_secret to make authenticated calls
        :param oauth_token_secret: (optional) When using **OAuth 1** combined
        with oauth_token to make authenticated calls
        :param access_token: (optional) When using **OAuth 2**, provide a
        valid access token if you have one
        :param token_type: (optional) When using **OAuth 2**, provide your
        token type. Default: bearer
        :param oauth_version: (optional) Choose which OAuth version to use.
        Default: 1
        :param api_version: (optional) Choose which Twitter API version to
        use. Default: 1.1

        :param client_args: (optional) Accepts some requests Session parameters
        and some requests Request parameters.
              See http://docs.python-requests.org/en/latest/api/#sessionapi
              and requests section below it for details.
              [ex. headers, proxies, verify(SSL verification)]
        :param auth_endpoint: (optional) Lets you select which authentication
        endpoint will use your application.
              This will allow the application to have DM access
              if the endpoint is 'authorize'.
                Default: authenticate.