Display all forwarding phones:
195779
function processResponse(error, response, data){
	if(error){
		return console.log(error); 
	}
	
	if(!data || !data.phones || !data.phoneList){
		return console.log('No forwarding phones');
	}
	
	console.log('\nForwarding phone ids: ', data.phoneList.join(', '));
	
	var phones = data.phones;
	//console.log(phones)
	console.log('\nForwarding phone details:');
	for(var id in phones){
		console.log(
			id+':',
			voicejs.DEFAULTS.phoneTypeMap[phones[id].type],
			phones[id].phoneNumber,
			phones[id].carrier,
			phones[id].verified ? 'verified' : 'unverified',
			phones[id].smsEnabled ? 'receives SMS' : ''
		);
	}
	if(data.settings.smsNotifications.length){
		console.log('\nForwarding phones that receive sms voicemail notifications:');
		data.settings.smsNotifications.forEach(function(phone){
			console.log(phone.address);
		})
	}
}
1206342
def list_port_forwarding_rules(ip_address_id=nil, listall=false)
      params = { 'command' => 'listPortForwardingRules' }
      params['ipAddressId'] = ip_address_id if ip_address_id
      params['listall'] = listall
      json = send_request(params)
      json['portforwardingrule']
    end
905394
def _get_callsites(self, function_address):
        

        all_predecessors = []

        nodes = self.get_all_nodes(function_address)
        for n in nodes:
            predecessors = list(self.get_predecessors(n))
            all_predecessors.extend(predecessors)

        return all_predecessors
1226209
def getNeighbouringDevices(self):
        
        print '%s call getNeighbouringDevices' % self.port
        neighbourList = []

        # get parent info
        parentAddr = self.getParentAddress()
        if parentAddr != 0:
            neighbourList.append(parentAddr)

        # get ED/SED children info
        childNeighbours = self.getChildrenInfo()
        if childNeighbours != None and len(childNeighbours) > 0:
            for entry in childNeighbours:
                neighbourList.append(entry)

        # get neighboring routers info
        routerNeighbours = self.getNeighbouringRouters()
        if routerNeighbours != None and len(routerNeighbours) > 0:
            for entry in routerNeighbours:
                neighbourList.append(entry)

        print neighbourList
        return neighbourList
133229
def forward_message(self, *args, **kwargs):
        """"""
        return forward_message(*args, **self._merge_overrides(**kwargs)).run()
978738
def list_port_fwd(zone, permanent=True):
    '''
    
    '''
    ret = []

    cmd = '--zone={0} --list-forward-ports'.format(zone)

    if permanent:
        cmd += ' --permanent'

    for i in __firewall_cmd(cmd).splitlines():
        (src, proto, dest, addr) = i.split(':')

        ret.append(
            {'Source port': src.split('=')[1],
             'Protocol': proto.split('=')[1],
             'Destination port': dest.split('=')[1],
             'Destination address': addr.split('=')[1]}
        )

    return ret
968956
def show_all(key):
    '''
    
    '''
    def func(request, abbr, session, bill_id, key):
        # get fixed version
        fixed_bill_id = fix_bill_id(bill_id)
        # redirect if URL's id isn't fixed id without spaces
        if fixed_bill_id.replace(' ', '') != bill_id:
            return redirect('bill', abbr=abbr, session=session,
                            bill_id=fixed_bill_id.replace(' ', ''))
        bill = db.bills.find_one({settings.LEVEL_FIELD: abbr,
                                  'session': session,
                                  'bill_id': fixed_bill_id})
        if bill is None:
            raise Http404('no bill found {0} {1} {2}'.format(abbr, session,
                                                             bill_id))
        return render(request, templatename('bill_all_%s' % key),
                      dict(abbr=abbr, metadata=Metadata.get_object(abbr),
                           bill=bill, sources=bill['sources'],
                           nav_active='bills'))
    return func
307605
async function listConnections() {
    const connList = await executeCommand(
        ['nmcli', '-f', 'NAME,DEVICE', '-t', 'connection', 'show']);
    const ret = {};
    connList.split('\n').map((l) => {
        return l.split(/:/);
    }).filter((ary) => {
        return ary[0] && ary[1];
    }).forEach((ary) => {
        ret[ary[0]] = ary[1];
    });
    return ret;
}
1113123
def _AddForwardedIps(self, forwarded_ips, interface):
    
    for address in forwarded_ips:
      self.ip_forwarding_utils.AddForwardedIp(address, interface)
228855
def poll_devices(self):
        """"""
        for addr in self.devices:
            device = self.devices[addr]
            if not device.address.is_x10:
                device.async_refresh_state()
284972
def forward(self, device_port, local_port=None):
        
        port = self._adb_device.forward(device_port, local_port)
        return (self._host, port)
871183
def x_forwarded_for(self):
        
        ip = self._request.META.get('REMOTE_ADDR')
        current_xff = self.headers.get('X-Forwarded-For')

        return '%s, %s' % (current_xff, ip) if current_xff else ip
1035973
function Forwarded(ip, port, secured) {
  this.ip = ip || '127.0.0.1';
  this.secure = !!secured;
  this.port = +port || 0;
}
77293
def connected(self):
        """"""
        ret = [u for u in self.channel.recipients if self.voice_state_for(u) is not None]
        me = self.channel.me
        if self.voice_state_for(me) is not None:
            ret.append(me)

        return ret
361654
public function index()
    {
        error_reporting(0);
        header('Content-type: text/plain');
        set_time_limit(100);

        //get inputs
        $sessionId = $_REQUEST["sessionId"];
        $serviceCode = $_REQUEST["serviceCode"];
        $phoneNumber = $_REQUEST["phoneNumber"];
        $text = $_REQUEST["text"];   //


        $data = ['phone' => $phoneNumber, 'text' => $text, 'service_code' => $serviceCode, 'session_id' => $sessionId];
//        print_r($data);
//        exit;
        //log USSD request
        ussd_logs::create($data);

        //verify that the user exists
        $no = substr($phoneNumber, -9);

        $user = ussd_user::where('phone', "0" . $no)->orWhere('phone', "254" . $no)->first();

        if (!$user) {
            //if user phone doesn't exist, we check out if they have been registered to mifos
            $usr = array();
            $usr['phone'] = "0".$no;
            $usr['session'] = 0;
            $usr['progress'] = 0;
            $usr['confirm_from'] = 0;
            $usr['menu_item_id'] = 0;

            $user = ussd_user::create($usr);
        }

        if (self::user_is_starting($text)) {
            //lets get the home menu
            //reset user
            self::resetUser($user);
            //user authentication
            $message = '';

                $response = self::getMenuAndItems($user,1);
        
            //get the home menu
            self::sendResponse($response, 1, $user);
        } else {

            //message is the latest stuff
            $result = explode("*", $text);
            if (empty($result)) {
                $message = $text;
            } else {
                end($result);
                // move the internal pointer to the end of the array
                $message = current($result);
            }

            switch ($user->session) {

                case 0 :
                    //neutral user
                    break;
                case 1 :
                    $response = self::continueUssdMenuProcess($user, $message);
                    //echo "Main Menu";
                    break;
                case 2 :
                    //confirm USSD Process
                    $response = self::confirmUssdProcess($user, $message);
                    break;
                case 3 :
                    //Go back menu
                    $response = self::confirmGoBack($user, $message);
                    break;
                case 4 :
                    //Go back menu
                    $response = self::confirmGoBack($user, $message);
                    break;
                default:
                    break;
            }

            self::sendResponse($response, 1, $user);
        }

    }
81691
def refresh_devices(self):
        ''''''
        try:
            response = self.api.get("/api/v2/devices", {'properties':'all'})
            for device_data in response['DeviceList']:
                self.devices.append(Device(device_data, self))
        except APIError as e:
            print("API error: ")
            for key,value in e.data.iteritems:
                print(str(key) + ": " + str(value))
146948
def get_all_hosting_devices(self, context):
        """"""
        cctxt = self.client.prepare()
        return cctxt.call(context,
                          'get_all_hosting_devices',
                          host=self.host)