def _validate_creds_file(self, verbose=False):
        oauth1 = False
        oauth1_keys = ['app_key', 'app_secret', 'oauth_token', 'oauth_token_secret']
        oauth2 = False
        oauth2_keys = ['app_key', 'app_secret', 'access_token']
        if all(k in self.oauth for k in oauth1_keys):
            oauth1 = True
        elif all(k in self.oauth for k in oauth2_keys):
            oauth2 = True

        if not (oauth1 or oauth2):
            msg = 'Missing or incorrect entries in {}\n'.format(self.creds_file)
            msg += pprint.pformat(self.oauth)
            raise ValueError(msg)
        elif verbose:
            print('Credentials file "{}" looks good'.format(self.creds_file))
Check validity of a credentials file.
dataset/ETHPy150Open nltk/nltk/nltk/twitter/util.py/Authenticate._validate_creds_file