Returns gateways data.
777145
def gateways_info():
    
    data = netifaces.gateways()
    results = {'default': {}}

    with suppress(KeyError):
        results['ipv4'] = data[netifaces.AF_INET]
        results['default']['ipv4'] = data['default'][netifaces.AF_INET]
    with suppress(KeyError):
        results['ipv6'] = data[netifaces.AF_INET6]
        results['default']['ipv6'] = data['default'][netifaces.AF_INET6]

    return results
1317927
def get_conn_info(self):
        """"""
        return session.ConnectionInfo(self.request.remote_ip,
                                      self.request.cookies,
                                      self.request.arguments,
                                      self.request.headers,
                                      self.request.path)
1359206
public java.util.List<NetworkInterface> getGatewayNetworkInterfaces() {
        if (gatewayNetworkInterfaces == null) {
            gatewayNetworkInterfaces = new com.amazonaws.internal.SdkInternalList<NetworkInterface>();
        }
        return gatewayNetworkInterfaces;
    }
95957
public function getGateway()
    {
        return (!isset($this->gateway)) ?
            $this->gateway = $this->getDefaultGateway() :
            $this->gateway;
    }
492165
def _from_dict(cls, _dict):
        """"""
        args = {}
        if 'gateways' in _dict:
            args['gateways'] = [
                Gateway._from_dict(x) for x in (_dict.get('gateways'))
            ]
        return cls(**args)
108098
def get(self):
        
        config = self.get_block('^router bgp .*')
        if not config:
            return None

        response = dict()
        response.update(self._parse_bgp_as(config))
        response.update(self._parse_router_id(config))
        response.update(self._parse_max_paths(config))
        response.update(self._parse_shutdown(config))
        response.update(self._parse_networks(config))

        response['neighbors'] = self.neighbors.getall()

        return response
1038695
def get_gates():
        
        LOGGER.debug("GateService.get_gates")
        params = SessionService.complete_transactional_req(None)
        if params is None:
            if MappingService.driver_type != DriverFactory.DRIVER_REST:
                params = {'OPERATION': 'getGates'}
                args = {'properties': params}
            else:
                args = {'http_operation': 'GET', 'operation_path': ''}
        else:
            if MappingService.driver_type != DriverFactory.DRIVER_REST:
                params['OPERATION'] = 'getGates'
                args = {'properties': params}
            else:
                args = {'http_operation': 'GET', 'operation_path': '', 'parameters': params}

        response = GateService.requester.call(args)

        if MappingService.driver_type != DriverFactory.DRIVER_REST:
            response = response.get()

        ret = None
        if response.rc == 0:
            ret = []
            for gate in response.response_content['gates']:
                ret.append(Gate.json_2_gate(gate))
        elif response.rc != 404:
            err_msg = 'GateService.get_gates - Problem while getting nodes. ' \
                      '. Reason: ' + str(response.response_content) + ' - ' + str(response.error_message) + \
                      " (" + str(response.rc) + ")"
            LOGGER.warning(err_msg)
            if response.rc == 500 and ArianeMappingOverloadError.ERROR_MSG in response.error_message:
                raise ArianeMappingOverloadError("GateService.get_gates",
                                                 ArianeMappingOverloadError.ERROR_MSG)
            # traceback.print_stack()
        return ret
1369470
private function _convertGateways()
    {
        $gateways = (new Query())
            ->select(['id', 'settings'])
            ->where(['type' => 'craft\\commerce\\gateways\\Stripe'])
            ->from(['{{%commerce_gateways}}'])
            ->all();

        $dbConnection = Craft::$app->getDb();

        foreach ($gateways as $gateway) {

            $settings = Json::decodeIfJson($gateway['settings']);

            if ($settings && isset($settings['includeReceiptEmailInRequests'])) {
                $settings['sendReceiptEmail'] = $settings['includeReceiptEmailInRequests'];
                unset($settings['includeReceiptEmailInRequests']);
            } else {
                $settings = [];
            }

            $settings = Json::encode($settings);

            $values = [
                'type' => Gateway::class,
                'settings' => $settings
            ];

            $dbConnection->createCommand()
                ->update('{{%commerce_gateways}}', $values, ['id' => $gateway['id']])
                ->execute();
        }
    }
1316076
def get_flow(self):
        """"""
        if self.meta['protocol'] == 'TCP':
            self.meta['packet_list'].sort(key=lambda packet: packet['transport']['seq'])
            for packet in self.meta['packet_list']:
                self.meta['payload'] += packet['transport']['data']

        return self.meta
262132
def fetch_interfaces(self):
        
        return get('ISteamWebAPIUtil', 'GetSupportedAPIList', 1,
            https=self.https,
            apihost=self.apihost,
            caller=None,
            session=self.session,
            params={'format': 'json',
                    'key': self.key,
                    },
            )
753411
def portals(self):
        """"""
        url = "%s/portals" % self.root
        return _portals.Portals(url=url,
                                securityHandler=self._securityHandler,
                                proxy_url=self._proxy_url,
                                proxy_port=self._proxy_port)
401835
def _find_usages_vpn_gateways(self):
        """"""

        # do not include deleting and deleted in the results
        vpngws = self.conn.describe_vpn_gateways(Filters=[
            {
                'Name': 'state',
                'Values': [
                    'available',
                    'pending'
                ]
            }
        ])['VpnGateways']

        self.limits['Virtual private gateways']._add_current_usage(
            len(vpngws),
            aws_type='AWS::EC2::VPNGateway'
        )
539587
def get_data(conn_objs, providers):
    """"""
    cld_svc_map = {"aws": nodes_aws,
                   "azure": nodes_az,
                   "gcp": nodes_gcp,
                   "alicloud": nodes_ali}
    sys.stdout.write("\rCollecting Info:  ")
    sys.stdout.flush()
    busy_obj = busy_disp_on()
    collec_fn = [[cld_svc_map[x.rstrip('1234567890')], conn_objs[x]]
                 for x in providers]
    ngroup = Group()
    node_list = []
    node_list = ngroup.map(get_nodes, collec_fn)
    ngroup.join()
    busy_disp_off(dobj=busy_obj)
    sys.stdout.write("\r                                                 \r")
    sys.stdout.write("\033[?25h")  # cursor back on
    sys.stdout.flush()
    return node_list
641198
def get_connections(self):
        """"""

        if float(self._dsversion) < 10:
            connections = self._extract_legacy_connection()
        else:
            connections = self._extract_federated_connections()
        return connections
525140
function Gateway(opts) {

    this.controllers = []; // Hold controller objectHandler by device name
    this.activeClients = []; // Hold all active clients sort by uid

    // Add DebugTool to log messages
    this.uid  = "Gateway:" + opts.name;
    this.debug =  opts.debug;   
    
    // simple counter for job queue
    this.request = 1;
    
    // Database backend and user event handler are shared amont all servers
    this.event = new EventEmitter();
    this.opts     = opts;
    
    // Compute some opts and provide some defaults
    this.opts.name       = opts.name         || "Gateway-Track";
    this.opts.debug      = opts.debug        || 1;      // default 1
    this.opts.backend    = opts.backend      || "file"; // file-backend.js
    this.opts.inactivity = opts.inactivity   || 600;    // default 10mn
      
    // Call constructor
    this.Gateway (opts);
}
973893
def get_gateway_url(self, request):
        
        params = {
            'id': self.get_backend_setting('id'),
            'description': self.get_order_description(self.payment, self.payment.order),
            'amount': self.payment.amount,
            'currency': self.payment.currency,
            'type': 0,  # 0 = show "return" button after finished payment
            'control': self.payment.pk,
            'URL': self.get_URL(self.payment.pk),
            'URLC': self.get_URLC(),
            'api_version': 'dev',
        }

        user_data = {
            'email': None,
            'lang': None,
        }
        signals.user_data_query.send(sender=None, order=self.payment.order, user_data=user_data)

        if user_data['email']:
            params['email'] = user_data['email']

        if user_data['lang'] and user_data['lang'].lower() in self._ACCEPTED_LANGS:
            params['lang'] = user_data['lang'].lower()
        elif self.get_backend_setting('lang', False
                                      ) and self.get_backend_setting('lang').lower() in self._ACCEPTED_LANGS:
            params['lang'] = self.get_backend_setting('lang').lower()

        if self.get_backend_setting('onlinetransfer', False):
            params['onlinetransfer'] = 1
        if self.get_backend_setting('p_email', False):
            params['p_email'] = self.get_backend_setting('p_email')
        if self.get_backend_setting('p_info', False):
            params['p_info'] = self.get_backend_setting('p_info')
        if self.get_backend_setting('tax', False):
            params['tax'] = 1

        gateway_url = self.get_backend_setting('gateway_url', self._GATEWAY_URL)

        if self.get_backend_setting('method', 'get').lower() == 'post':
            return gateway_url, 'POST', params
        elif self.get_backend_setting('method', 'get').lower() == 'get':
            for key in params.keys():
                params[key] = six.text_type(params[key]).encode('utf-8')
            return gateway_url + '?' + urlencode(params), "GET", {}
        else:
            raise ImproperlyConfigured('Dotpay payment backend accepts only GET or POST')
18419
def _find_usage_gateways(self):
        """"""
        # Internet gateways
        gws = self.conn.describe_internet_gateways()
        self.limits['Internet gateways']._add_current_usage(
            len(gws['InternetGateways']),
            aws_type='AWS::EC2::InternetGateway',
        )