Get the list of tokens that this address owns
421269
def get_account_tokens(self, address):
        
        cur = self.db.cursor()
        return namedb_get_account_tokens(cur, address)
318759
def list_wallet_names(api_key, is_hd_wallet=False, coin_symbol='btc'):
    '''  '''
    assert is_valid_coin_symbol(coin_symbol), coin_symbol
    assert api_key

    params = {'token': api_key}

    kwargs = dict(wallets='hd' if is_hd_wallet else '')
    url = make_url(coin_symbol, **kwargs)

    r = requests.get(url, params=params, verify=True, timeout=TIMEOUT_IN_SECONDS)
    return get_valid_json(r)
1342496
def get_token_network(
            self,
            token_address: TokenAddress,
            block_identifier: BlockSpecification = 'latest',
    ) -> Optional[Address]:
        
        if not isinstance(token_address, T_TargetAddress):
            raise ValueError('token_address must be an address')

        address = self.proxy.contract.functions.token_to_token_networks(
            to_checksum_address(token_address),
        ).call(block_identifier=block_identifier)
        address = to_canonical_address(address)

        if is_same_address(address, NULL_ADDRESS):
            return None

        return address
896101
@Override
	public List<String> getAlternateAddresses(Exchange exchange) {
		return locatorCache.getFailoverEndpoints(getServiceName(exchange));
	}
961164
def get_balance(self, address):
        
        url_append = "/balance?token=%s" % self.api_key
        url = self.base_url("addrs/%s" % (address + url_append))
        result = json.loads(urlopen(url).read().decode("utf8"))
        return result
615288
def list_address(self, domain):
        " "

        try:
            response = self.get('/REST/ARecord/%s/%s' % (
                self.zone, domain))
        except self.NotFoundError:
            return []

        # Return a generator with the addresses.
        addresses = response.content['data']
        return [Address.from_url(self, uri) for uri in addresses]
294533
def get_addresses(self, account_id, **params):
        """"""
        response = self._get('v2', 'accounts', account_id, 'addresses', params=params)
        return self._make_api_object(response, Address)
542991
public List<Token> scan() {
		while (peek() != EOF) {
			if (peek() == '#') {
				if (scanDire()) {
					continue ;
				}
				if (scanSingleLineComment()) {
					continue ;
				}
				if (scanMultiLineComment()) {
					continue ;
				}
				if (scanNoParse()) {
					continue ;
				}
			}
			
			scanText();
		}
		return tokens;
	}
990646
def list_addresses(self):
        
        
        params = self.build_basic_request()
        response = util.call_api("merchant/{0}/list".format(self.identifier), params, base_url=self.service_url)

        json_response = json.loads(response)
        self.parse_error(json_response)
        
        addresses = []
        for a in json_response['addresses']:
            address = Address(a['balance'], a['address'], a.get('label'), a['total_received'])
            addresses.append(address)
            
        return addresses
67003
def get_account_tokens(address, hostport=None, proxy=None):
    
    assert proxy or hostport, 'Need proxy or hostport'
    if proxy is None:
        proxy = connect_hostport(hostport)

    tokens_schema = {
        'type': 'object',
        'properties': {
            'token_types': {
                'type': 'array',
                'pattern': '^(.+){1,19}',
            },
        },
        'required': [
            'token_types',
        ]
    }

    schema = json_response_schema(tokens_schema)

    try:
        resp = proxy.get_account_tokens(address)
        resp = json_validate(schema, resp)
        if json_is_error(resp):
            return resp

    except ValidationError as ve:
        if BLOCKSTACK_DEBUG:
            log.exception(ve)

        resp = {'error': 'Server response did not match expected schema.  You are likely communicating with an out-of-date Blockstack node.', 'http_status': 502}
        return resp

    except socket.timeout:
        log.error("Connection timed out")
        resp = {'error': 'Connection to remote host timed out.', 'http_status': 503}
        return resp

    except socket.error as se:
        log.error("Connection error {}".format(se.errno))
        resp = {'error': 'Connection to remote host failed.', 'http_status': 502}
        return resp

    except AssertionError as ae:
        if BLOCKSTACK_DEBUG:
            log.exception(ae)

        resp = json_traceback(resp.get('error'))
        return resp

    except Exception as ee:
        if BLOCKSTACK_DEBUG:
            log.exception(ee)

        log.error("Caught exception while connecting to Blockstack node: {}".format(ee))
        resp = {'error': 'Failed to contact Blockstack node.  Try again with `--debug`.', 'http_status': 500}
        return resp

    resp['token_types'].sort()
    return resp['token_types']
450090
def getaddresses (addr):
    """"""
    parsed = [mail for name, mail in AddressList(addr).addresslist if mail]
    if parsed:
        addresses = parsed
    elif addr:
        # we could not parse any mail addresses, so try with the raw string
        addresses = [addr]
    else:
        addresses = []
    return addresses
670160
private String token() {
        List<String> key = new ArrayList<String>();
        key.add(email);
        key.add(getRemoteURL().toExternalForm().toLowerCase());
        Log.v(TAG, "FacebookAuthorizer looking up key: %s from list of access tokens", key);
        return sRegisteredTokens.get(key);
    }
805330
def get_owner_asset_ids(self, address):
        
        block_filter = self._get_event_filter(owner=address)
        log_items = block_filter.get_all_entries(max_tries=5)
        did_list = []
        for log_i in log_items:
            did_list.append(id_to_did(log_i.args['_did']))

        return did_list
1293114
def get_wallet_addresses(wallet_name, api_key, is_hd_wallet=False,
        zero_balance=None, used=None, omit_addresses=False, coin_symbol='btc'):
    '''
    
    '''
    assert is_valid_coin_symbol(coin_symbol)
    assert api_key
    assert len(wallet_name) <= 25, wallet_name
    assert zero_balance in (None, True, False)
    assert used in (None, True, False)
    assert isinstance(omit_addresses, bool), omit_addresses

    params = {'token': api_key}
    kwargs = {'hd/' if is_hd_wallet else '': wallet_name} # hack!
    url = make_url(coin_symbol, 'wallets', **kwargs)

    if zero_balance is True:
        params['zerobalance'] = 'true'
    elif zero_balance is False:
        params['zerobalance'] = 'false'
    if used is True:
        params['used'] = 'true'
    elif used is False:
        params['used'] = 'false'
    if omit_addresses:
        params['omitWalletAddresses'] = 'true'

    r = requests.get(url, params=params, verify=True, timeout=TIMEOUT_IN_SECONDS)
    return get_valid_json(r)
352999
def getaddresses(fieldvalues):
    """"""
    all = COMMASPACE.join(fieldvalues)
    a = _AddressList(all)
    return a.addresslist
465698
def get_subdomains_owned_by_address(self, owner, cur=None):
        
        get_cmd = "SELECT fully_qualified_subdomain, MAX(sequence) FROM {} WHERE owner = ? AND accepted=1 GROUP BY fully_qualified_subdomain".format(self.subdomain_table)

        cursor = None
        if cur is None:
            cursor = self.conn.cursor()
        else:
            cursor = cur

        db_query_execute(cursor, get_cmd, (owner,))

        try:
            return [ x['fully_qualified_subdomain'] for x in cursor.fetchall() ]
        except Exception as e:
            if BLOCKSTACK_DEBUG:
                log.exception(e)

            return []
60665
def list_tokens(opts):
    '''
    
    '''
    ret = []
    redis_client = _redis_client(opts)
    if not redis_client:
        return []
    serial = salt.payload.Serial(opts)
    try:
        return [k.decode('utf8') for k in redis_client.keys()]
    except Exception as err:
        log.warning('Failed to list keys: %s', err)
        return []