Get a list of all Accounts authorized for the provided token.

        Args:

        Returns:
            v20.response.Response containing the results from submitting the
            request
5545
def list(
        self,
        **kwargs
    ):
        

        request = Request(
            'GET',
            '/v3/accounts'
        )

        response = self.ctx.request(request)


        if response.content_type is None:
            return response

        if not response.content_type.startswith("application/json"):
            return response

        jbody = json.loads(response.raw_body)

        parsed_body = {}

        #
        # Parse responses as defined by the API specification
        #
        if str(response.status) == "200":
            if jbody.get('accounts') is not None:
                parsed_body['accounts'] = [
                    self.ctx.account.AccountProperties.from_dict(d, self.ctx)
                    for d in jbody.get('accounts')
                ]

        elif str(response.status) == "401":
            if jbody.get('errorCode') is not None:
                parsed_body['errorCode'] = \
                    jbody.get('errorCode')

            if jbody.get('errorMessage') is not None:
                parsed_body['errorMessage'] = \
                    jbody.get('errorMessage')

        elif str(response.status) == "405":
            if jbody.get('errorCode') is not None:
                parsed_body['errorCode'] = \
                    jbody.get('errorCode')

            if jbody.get('errorMessage') is not None:
                parsed_body['errorMessage'] = \
                    jbody.get('errorMessage')

        #
        # Unexpected response status
        #
        else:
            parsed_body = jbody

        response.body = parsed_body

        return response
1224345
def get_sepa_accounts(self):
        

        with self._get_dialog() as dialog:
            response = dialog.send(HKSPA1())
            
        self.accounts = []
        for seg in response.find_segments(HISPA1, throw=True):
            self.accounts.extend(seg.accounts)

        return [a for a in [acc.as_sepa_account() for acc in self.accounts] if a]
831118
def list(self):
        
        response = self.session.get(self.url)
        return [Bot(self, **bot) for bot in response.data]
152992
def get_accounts(self, **params):
        """"""
        response = self._get('v2', 'accounts', params=params)
        return self._make_api_object(response, Account)
406099
def get_account
      url = ApiRequest.base_path("questionpro.survey.getAccount")
      result = self.class.get(url, body: self.options)

      self.full_response = result
      self.status = result['status']
      
      account = Account.new(result['response']['account'])
      
      return account
    end
1226580
def GetAccounts(self):
    
    selector = {
        'fields': ['CustomerId', 'CanManageClients']
    }

    accounts = self.client.GetService('ManagedCustomerService').get(selector)

    return accounts['entries']
407212
def list(cls, params=None, custom_headers=None):
        

        if params is None:
            params = {}

        if custom_headers is None:
            custom_headers = {}

        api_client = client.ApiClient(cls._get_api_context())
        endpoint_url = cls._ENDPOINT_URL_LISTING.format(
            cls._determine_user_id())
        response_raw = api_client.get(endpoint_url, params, custom_headers)

        return BunqResponseOauthClientList.cast_from_bunq_response(
            cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
        )
393164
def list_accounts(self, id, max_id=None, min_id=None, since_id=None, limit=None):
        
        id = self.__unpack_id(id)
        
        if max_id != None:
            max_id = self.__unpack_id(max_id)
        
        if min_id != None:
            min_id = self.__unpack_id(min_id)
        
        if since_id != None:
            since_id = self.__unpack_id(since_id)
        
        params = self.__generate_params(locals(), ['id']) 
        return self.__api_request('GET', '/api/v1/lists/{0}/accounts'.format(id))
1058915
def get_all(self) -> List[Account]:
        
        return [account for account in self.book.accounts if account.parent.name != "Template Root"]
1063476
def GET_account_tokens(self, path_info, account_addr):
        
        if not check_account_address(account_addr):
            return self._reply_json({'error': 'Invalid address'}, status_code=400)

        blockstackd_url = get_blockstackd_url()
        res = blockstackd_client.get_account_tokens(account_addr, hostport=blockstackd_url)
        if json_is_error(res):
            log.error("Failed to load tokens for {}: {}".format(account_addr, res['error']))
            return self._reply_json({'error': 'Failed to load tokens for {}: {}'.format(account_addr, res['error'])}, status_code=res.get('http_status', 500))

        self._reply_json({'tokens': res})
        return
104710
def authorized(self):
        
        if self.redirect_url:
            next_url = self.redirect_url
        elif self.redirect_to:
            next_url = url_for(self.redirect_to)
        else:
            next_url = "/"

        try:
            self.session.parse_authorization_response(request.url)
        except TokenMissing as err:
            message = err.args[0]
            response = getattr(err, "response", None)
            log.warning("OAuth 1 access token error: %s", message)
            oauth_error.send(self, message=message, response=response)
            return redirect(next_url)

        try:
            token = self.session.fetch_access_token(
                self.access_token_url, should_load_token=False
            )
        except ValueError as err:
            # can't proceed with OAuth, have to just redirect to next_url
            message = err.args[0]
            response = getattr(err, "response", None)
            log.warning("OAuth 1 access token error: %s", message)
            oauth_error.send(self, message=message, response=response)
            return redirect(next_url)

        results = oauth_authorized.send(self, token=token) or []
        set_token = True
        for func, ret in results:
            if isinstance(ret, (Response, current_app.response_class)):
                return ret
            if ret == False:
                set_token = False

        if set_token:
            self.token = token
        return redirect(next_url)
802391
def GetAccounts(alias=None):
		""""""
		if alias is not None:  payload = {'AccountAlias': alias}
		else:  payload = {}
		r = clc.v1.API.Call('post','Account/GetAccounts',payload)
		if int(r['StatusCode']) == 0:  
			# Assume first response is always the original account.  Not sure if this is reliable
			if not clc.ALIAS:  clc.ALIAS = r['Accounts'][0]['AccountAlias']
			if not clc.LOCATION:  clc.LOCATION = r['Accounts'][0]['Location']

			return(r['Accounts'])
747708
def accounts(self):
        
        response = self.graph.get('%s/accounts' % self.id)

        accounts = []
        for item in response['data']:
            account = Structure(
                page = Page(
                    id = item['id'],
                    name = item['name'],
                    category = item['category']
                ),
                access_token = item['access_token'],
                permissions = item['perms']
            )

            accounts.append(account)

        return accounts
857126
def access_token_response(self, access_token):
        

        response_data = {
            'access_token': access_token.token,
            'token_type': constants.TOKEN_TYPE,
            'expires_in': access_token.get_expire_delta(),
            'scope': ' '.join(scope.names(access_token.scope)),
        }

        # Not all access_tokens are given a refresh_token
        # (for example, public clients doing password auth)
        try:
            rt = access_token.refresh_token
            response_data['refresh_token'] = rt.token
        except ObjectDoesNotExist:
            pass

        return HttpResponse(
            json.dumps(response_data), mimetype='application/json'
        )
420594
def _getAuth(self):
        
        parameters = {
            'service'     : 'reader',
            'Email'       : self.username,
            'Passwd'      : self.password,
            'accountType' : 'GOOGLE'}
        req = requests.post(ClientAuthMethod.CLIENT_URL, data=parameters)
        if req.status_code != 200:
            raise IOError("Error getting the Auth token, have you entered a"
                    "correct username and password?")
        data = req.text
        #Strip newline and non token text.
        token_dict = dict(x.split('=') for x in data.split('\n') if x)
        return token_dict["Auth"]
380663
def validation_requests(self):
        
        if self._validation_requests is None:
            self._validation_requests = ValidationRequestList(self._version, account_sid=self._solution['sid'], )
        return self._validation_requests
279007
def get_account_details(self):
        
        headers = self._manager.get_account_headers()
        acct_prefix = "x-account-"
        meta_prefix = ACCOUNT_META_PREFIX.lower()
        ret = {}
        for hkey, hval in list(headers.items()):
            lowkey = hkey.lower()
            if lowkey.startswith(acct_prefix):
                if not lowkey.startswith(meta_prefix):
                    cleaned = hkey.replace(acct_prefix, "").replace("-", "_")
                    try:
                        # Most values are ints
                        ret[cleaned] = int(hval)
                    except ValueError:
                        ret[cleaned] = hval
        return ret