List the forwarding addresses for a certain api key
    (and on a specific blockchain)
6448
def list_forwarding_addresses(api_key, offset=None, coin_symbol='btc'):
    '''
    
    '''

    assert is_valid_coin_symbol(coin_symbol)
    assert api_key

    url = make_url(coin_symbol, 'payments')

    params = {'token': api_key}

    if offset:
        params['start'] = offset

    r = requests.get(url, params=params, verify=True, timeout=TIMEOUT_IN_SECONDS)
    return get_valid_json(r)
887925
def file_list_hosts( blockchain_id, wallet_keys=None, config_path=CONFIG_PATH ):
    
    config_dir = os.path.dirname(config_path)
    try:
        ret = blockstack_gpg.gpg_list_app_keys( blockchain_id, APP_NAME, wallet_keys=wallet_keys, config_dir=config_dir )
    except Exception, e:
        ret = {'error': traceback.format_exc(e)}

    if 'error' in ret:
        log.error("Failed to list app keys: %s" % ret['error'])
        return {'error': 'Failed to list app keys'}

    hosts = []
    for key_info in ret:
        hostname = key_info['keyName']
        hosts.append(hostname)

    return {'status': True, 'hosts': hosts}
428173
def _get_api_key_ops():
    """"""
    auth_header = request.authorization
    if not auth_header:
        logging.debug('API request lacks authorization header')
        abort(flask.Response(
            'API key required', 401,
            {'WWW-Authenticate': 'Basic realm="API key required"'}))

    return operations.ApiKeyOps(auth_header.username, auth_header.password)
332672
def get_destinations(cls, domain, source):
        """"""
        forwards = cls.list(domain, {'items_per_page': 500})
        for fwd in forwards:
            if fwd['source'] == source:
                return fwd['destinations']

        return []
1196230
def get_forwarders(resolv="resolv.conf"):
    
    ns = []
    if os.path.exists(resolv):
        for l in open(resolv):
            if l.startswith("nameserver"):
                address = l.strip().split(" ", 2)[1]
                # forwarding to ourselves would be bad
                if not address.startswith("127"):
                    ns.append(address)
    if not ns:
        ns = ['8.8.8.8', '8.8.4.4']
    return ns
1035973
function Forwarded(ip, port, secured) {
  this.ip = ip || '127.0.0.1';
  this.secure = !!secured;
  this.port = +port || 0;
}
172826
def _get_forwarded(request, key):
        
        forwarded = request.headers.get('Forwarded', '')
        match = re.search(
            r'(?<={}=).+?(?=[\s,;]|$)'.format(key),
            forwarded,
            re.IGNORECASE)

        if match is not None:
            header = match.group(0)

            if header[0] == '"' and header[-1] == '"':
                return header[1:-1]

            return header

        return request.headers.get('X-Forwarded-{}'.format(key.title()), '')
757071
def get_keys(self):
        
        return github.PaginatedList.PaginatedList(
            github.UserKey.UserKey,
            self._requester,
            self.url + "/keys",
            None
        )
349934
def get_api_key(key, request_options = {})
      client.get(Protocol.index_key_uri(name, key), :read, request_options)
    end
678147
def list_ipsecpolicies(self, retrieve_all=True, **_params):
        """"""
        return self.list('ipsecpolicies',
                         self.ipsecpolicies_path,
                         retrieve_all,
                         **_params)
891445
def list_address(self):
        """"""
        result = []
        for addrStr in self.wallet.Addresses:
            addr = self.wallet.GetAddress(addrStr)
            result.append({
                "address": addrStr,
                "haskey": not addr.IsWatchOnly,
                "label": None,
                "watchonly": addr.IsWatchOnly,
            })
        return result
296782
def instance_ip_grouping_key():
    """"""
    with closing(socket.socket(socket.AF_INET, socket.SOCK_DGRAM)) as s:
        s.connect(('localhost', 0))
        return {'instance': s.getsockname()[0]}
135287
def _list_keys(self):
        
        req = self.request(self.uri + '/keys')
        keys = req.get().json()
        if keys:
            self._keys = {}
            for key in keys:
                self._keys[key['id']] = Key(key, self)
        else:
            self._keys = {}
937830
def show_rsa(minion_id, dns_name):
    '''
    
    '''
    cache = salt.cache.Cache(__opts__, syspaths.CACHE_DIR)
    bank = 'digicert/domains'
    data = cache.fetch(
        bank, dns_name
    )
    return data['private_key']
913715
def my_address_string(self):
        
        addr = getattr(self, 'client_address', ('', None))[0]

        # If listed in proxy_ips, use the X-Forwarded-For header, if present.
        if addr in self.proxy_ips:
            return self.headers.getheader('x-forwarded-for', addr)
        return addr
765113
def service_addresses!(service, index = nil)
      meta = {}
      resp = _service.get(service, :all, {index: index, wait: '2s'}, meta)

      if (nindex = meta[:index]) != index
        addresses = resp.map do |address|
          {
            id: address.ServiceID,
            ip: address.ServiceAddress,
            node: address.Node,
            port: address.ServicePort
          }
        end

        [addresses, nindex]
      end
    end
568419
def list_nodes(call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The list_nodes function must be called with -f or --function.'
        )

    ret = {}
    nodes = list_nodes_full()
    if 'error' in nodes:
        raise SaltCloudSystemExit(
            'An error occurred while listing nodes: {0}'.format(
                nodes['error']['Errors']['Error']['Message']
            )
        )
    for node in nodes:
        ret[node] = {
            'id': nodes[node]['hostname'],
            'ram': nodes[node]['maxMemory'],
            'cpus': nodes[node]['maxCpu'],
        }
        if 'primaryIpAddress' in nodes[node]:
            ret[node]['public_ips'] = nodes[node]['primaryIpAddress']
        if 'primaryBackendIpAddress' in nodes[node]:
            ret[node]['private_ips'] = nodes[node]['primaryBackendIpAddress']
        if 'status' in nodes[node]:
            ret[node]['state'] = six.text_type(nodes[node]['status']['name'])
    return ret