@property
    def token(self):
        """
        set the instance attribute `token` following the following logic,
        stopping whenever a token is found. Raises NoTokenFound is no token
        is found
        - environment variables TOKEN_ENVIRON_VARS
        - file containing plaintext as the contents in TOKEN_FILES
        - ads.config.token
        """
        if self._token is None:
            for v in map(os.environ.get, TOKEN_ENVIRON_VARS):
                if v is not None:
                    self._token = v
                    return self._token
            for f in TOKEN_FILES:
                try:
                    with open(f) as fp:
                        self._token = fp.read().strip()
                        return self._token
                except __HOLE__:
                    pass
            if ads.config.token is not None:
                self._token = ads.config.token
                return self._token
            warnings.warn("No token found", RuntimeWarning)
        return self._token
dataset/ETHPy150Open andycasey/ads/ads/base.py/BaseQuery.token