:reference: https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/get-account-verify_credentials
            :allowed_param:'include_entities', 'skip_status', 'include_email'
514733
def verify_credentials(self, **kargs):
        
        try:
            return bind_api(
                api=self,
                path='/account/verify_credentials.json',
                payload_type='user',
                require_auth=True,
                allowed_param=['include_entities', 'skip_status', 'include_email'],
            )(**kargs)
        except TweepError as e:
            if e.response and e.response.status == 401:
                return False
            raise
180720
def verify_user_alias(user, token):
    
    if token.to_alias_type == 'EMAIL':
        if token.to_alias == getattr(user, api_settings.PASSWORDLESS_USER_EMAIL_FIELD_NAME):
            setattr(user, api_settings.PASSWORDLESS_USER_EMAIL_VERIFIED_FIELD_NAME, True)
    elif token.to_alias_type == 'MOBILE':
        if token.to_alias == getattr(user, api_settings.PASSWORDLESS_USER_MOBILE_FIELD_NAME):
            setattr(user, api_settings.PASSWORDLESS_USER_MOBILE_VERIFIED_FIELD_NAME, True)
    else:
        return False
    user.save()
    return True
818746
def _verify_credentials(self):
        
        r = requests.get(self.apiurl + "account/verify_credentials.xml",
                         auth=HTTPBasicAuth(self._username, self._password),
                         headers=self.header)
        if r.status_code != 200:
            raise UserLoginFailed("Username or Password incorrect.")
20965
def verify_credentials(self, delegate=None):
        ""
        parser = txml.Users(delegate)
        return self.__downloadPage('/account/verify_credentials.xml', parser)
961950
def fetch_credential_report(self, credentials, ignore_exception = False):
        
        iam_report = {}
        try:
            api_client = connect_service('iam', credentials, silent = True)
            response = api_client.generate_credential_report()
            if response['State'] != 'COMPLETE':
                if not ignore_exception:
                    printError('Failed to generate a credential report.')
                return
            report = api_client.get_credential_report()['Content']
            lines = report.splitlines()
            keys = lines[0].decode('utf-8').split(',')
            for line in lines[1:]:
                values = line.decode('utf-8').split(',')
                manage_dictionary(iam_report, values[0], {})
                for key, value in zip(keys, values):
                    iam_report[values[0]][key] = value
            self.credential_report = iam_report
            self.fetchstatuslogger.counts['credential_report']['fetched'] = 1
        except Exception as e:
            if ignore_exception:
                return
            printError('Failed to download a credential report.')
            printException(e)
1296410
@Override
    public Account verify(String id, Credential credential) {
        if (id == null || id.length() == 0) {
            HttpServerLogger.ROOT_LOGGER.debug("Missing or empty username received, aborting account verification.");
            return null;
        }

        if (credential instanceof PasswordCredential) {
            return verify(id, (PasswordCredential) credential);
        } else if (credential instanceof DigestCredential) {
            return verify(id, (DigestCredential) credential);
        }

        throw HttpServerLogger.ROOT_LOGGER.invalidCredentialType(credential.getClass().getName());
    }
261207
def credential_update(self, cred_id, **options):
        
        payload = None

        # First we pull the credentials and populate the payload if we
        # find a match.
        for cred in self.credentials()['credentials']:
            if cred['id'] == str(cred_id):
                payload = {
                    'id': cred_id,
                    'type': cred['type'],
                    'name': cred['name'],
                    'description': cred['description'],
                    'visibility': cred['visibility'],
                    'group': cred['group'],
                    'users': cred['users'],
                }

                if cred['type'] == 'kerberos':
                    payload['ip'] = cred['ip']
                    payload['port'] = cred['port']
                    payload['protocol'] = cred['protocol']
                    payload['realm'] = cred['realm']

                if cred['type'] == 'snmp':
                    payload['communityString'] = cred['communityString']

                if cred['type'] == 'ssh':
                    payload['username'] = cred['username']
                    payload['publickey'] = cred['publickey']
                    payload['privatekey'] = cred['privatekey']
                    payload['priviledgeEscalation'] = cred['priviledgeEscalation']
                    payload['escalationUsername'] = cred['escalationUsername']

                if cred['type'] == 'windows':
                    payload['username'] = cred['username']
                    payload['domain'] = cred['domain']

        if payload is None:
            raise APIError(13, 'cred_id %s does not exist' % cred_id)

        for option in options:
            payload[option] = options[option]

        return self.raw_query('credential', 'edit', data=payload)
1077204
def __authenticate(self):
        
        if self.api_token:
            # verify current API token
            check_auth_uri = self.uri.split('/api/v1')[0] + '/check_token'
            req = self.request(check_auth_uri)
            try:
                ping = req.get().json()
            except Exception as exc:
                if str(exc).startswith('User not authenticated'):
                    self.api_token = None
            else:
                if self.email == ping['hello']:
                    return
                print "Authentication failed"
                sys.exit(1)

        auth_uri = self.uri.split('/api/v1')[0] + '/auth'
        payload = {
            'email': self.email,
            'password': self.password,
            'org_id': self.org_name
        }
        data = json.dumps(payload)
        req = self.request(auth_uri, data=data)
        response = req.post().json()
        token = response.get('mist_api_token', None)
        if token:
            # backwards compatibility with old Authentication system
            self.api_token = "mist_1 %s:%s" % (self.email, token)
        else:
            self.api_token = response.get('token', None)
231348
def get_tweepy_auth(twitter_api_key,
                    twitter_api_secret,
                    twitter_access_token,
                    twitter_access_token_secret):
    """"""
    auth = tweepy.OAuthHandler(twitter_api_key, twitter_api_secret)
    auth.set_access_token(twitter_access_token, twitter_access_token_secret)
    return auth
1128937
def set_include_entities(self, include):
        

        if not isinstance(include, bool):
            raise TwitterSearchException(1008)
        self.arguments.update(
            {'include_entities': 'true' if include else 'false'}
        )
115957
function getUser(req, result, cb) {
    if (!result || !result.access_token) return process.nextTick(cb);
    request.get(
      'https://api.github.com/user/emails?access_token=' + result.access_token,
      { headers:{ 'Accept':'application/vnd.github.v3+json' } },
      function(err, resp, body) {
        if (err) { debug(err); return cb(err); }
        var list = JSON.parse(body); debug(list);
        var email = u.find(list, function(entry) { return entry.primary; });
        if (email) {
          email = email.email;
          if (req.session && !req.session.user) { req.session.user = email; }
          result.user = email;
        }
        cb();
    });
  }
1068093
def get_aws_creds(account, tenant, token):
    
    url = (FAWS_API_URL.format(account))
    headers = {
        'X-Auth-Token': token,
        'X-Tenant-Id': tenant,
    }
    response = requests.post(url, headers=headers,
                             json={'credential': {'duration': '3600'}})

    if not response.ok:
        sys.exit(FAWS_API_ERROR.format(response.status_code, response.text))
    return response.json()['credential']
1071816
def verify_account(self, email_address):
        ''' 
        '''
        request = self._get_request()
        resp = request.post(self.ACCOUNT_VERIFY_URL, {
            'email_address': email_address
        })
        return ('account' in resp)
716503
def format_key_vault_credential_settings(result):
    '''
    
    '''
    from collections import OrderedDict
    # Only display parameters that have content
    order_dict = OrderedDict()
    if result.enable is not None:
        order_dict['enable'] = result.enable
    if result.credential_name is not None:
        order_dict['credentialName'] = result.credential_name
    if result.azure_key_vault_url is not None:
        order_dict['azureKeyVaultUrl'] = result.azure_key_vault_url

    return order_dict
901680
def fetch_credentials(auth_id, auth_token):
    """"""

    if not (auth_id and auth_token):
        try:
            auth_id = os.environ['PLIVO_AUTH_ID']
            auth_token = os.environ['PLIVO_AUTH_TOKEN']
        except KeyError:
            raise AuthenticationError('The Plivo Python SDK '
                                      'could not find your auth credentials.')

    if not (is_valid_mainaccount(auth_id) or is_valid_subaccount(auth_id)):
        raise AuthenticationError('Invalid auth_id supplied: %s' % auth_id)

    return AuthenticationCredentials(auth_id=auth_id, auth_token=auth_token)
214449
async def get_contents(self, **params):
		
		logging.debug("[+] -- Get contents")
		if params.get("message"):
			params = json.loads(params.get("message", "{}"))

		if not params or not params.get("public_key"):
			return {"error":400, "reason":"Missed required fields"}

		# Try to get account
		account = await self.collection.find_one({"public_key":params["public_key"]})
		# Return error if does not exist the one
		if not account:
			return {"error":404, "reason":"Get contents. Not found account"}

		contents = {i:[] for i in settings.AVAILABLE_COIN_ID}
		for coinid in settings.AVAILABLE_COIN_ID:
			logging.debug(coinid)
			database = client[coinid]
			content_collection = database[settings.CONTENT]
			async for document in content_collection.find({"owner":account["public_key"]}):
				contents[coinid].append((document["cid"], document["txid"]))

		return contents
644412
def credentials_required(method_func):
    
    def _checkcredentials(self, *args, **kwargs):
        if self.username and self.password:
            return method_func(self, *args, **kwargs)
        else:
            raise CredentialsMissingError("This is a private method. \
You must provide a username and password when you initialize the \
DocumentCloud client to attempt this type of request.")

    return wraps(method_func)(_checkcredentials)