def accessToken(self):

        session = current.session

        token = session.token
        if token and "expires" in token:
            expires = token["expires"]
            # reuse token until expiration
            if expires == 0 or expires > time.time():
                return token["access_token"]

        code = session.code
        if code:
            data = {"client_id": self.client_id,
                    "client_secret": self.client_secret,
                    "redirect_uri": self.args["redirect_uri"],
                    "code": code,
                    "grant_type": "authorization_code",
                    "scope": self.args["scope"],
                    }

            open_url = None
            opener = self.__build_url_opener(self.token_url)
            try:
                open_url = opener.open(self.token_url, urllib.urlencode(data))
            except urllib2.HTTPError, e:
                raise Exception(e.read())
            finally:
                del session.code # throw it away

            if open_url:
                try:
                    token = json.loads(open_url.read())
                    token["expires"] = int(token["expires_in"]) + time.time()
                finally:
                    opener.close()
                session.token = token
                return token["access_token"]

        session.token = None
        return None

    # -------------------------------------------------------------------------
Read an unsigned 16-bit value from the specified register, with the
dataset/ETHPy150Open sahana/eden/modules/s3oauth.py/HumanitarianIDAccount.accessToken--crossover with--dataset/ETHPy150Open adafruit/Adafruit_Python_GPIO/Adafruit_GPIO/I2C.py/Device.readU16