def __init__(self, app_id=environ.get('NYLAS_APP_ID'),
                 app_secret=environ.get('NYLAS_APP_SECRET'),
                 access_token=environ.get('NYLAS_ACCESS_TOKEN'),
                 api_server=API_SERVER,
                 auth_server=None):
        if "://" not in api_server:
            raise Exception("When overriding the Nylas API server address, you"
                            " must include https://")
        self.api_server = api_server
        self.authorize_url = api_server + '/oauth/authorize'
        self.access_token_url = api_server + '/oauth/token'

        self.app_secret = app_secret
        self.app_id = app_id

        self.session = requests.Session()
        self.version = __VERSION__
        major, minor, revision, _, __ = sys.version_info
        version_header = 'Nylas Python SDK {} - {}.{}.{}'.format(self.version,
                                                                 major, minor,
                                                                 revision)
        self.session.headers = {'X-Nylas-API-Wrapper': 'python',
                                'User-Agent': version_header}
        self.access_token = access_token

        # Requests to the /a/ namespace don't use an auth token but
        # the app_secret. Set up a specific session for this.
        self.admin_session = requests.Session()

        if app_secret is not None:
            self.admin_session.headers = {'Authorization': 'Bearer ' +
                                          app_secret,
                                          'X-Nylas-API-Wrapper': 'python',
                                          'User-Agent': version_header}
dataset/ETHPy150Open nylas/nylas-python/nylas/client/client.py/APIClient.__init__/original