Available PCC stock

REST: GET /dedicatedCloud/location/{pccZone}/stock/pcc
@param pccZone [required] Name of pccZone
542928
public ArrayList<OvhPccStockProfile> location_pccZone_stock_pcc_GET(String pccZone) throws IOException {
		String qPath = "/dedicatedCloud/location/{pccZone}/stock/pcc";
		StringBuilder sb = path(qPath, pccZone);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, t9);
	}
114470
def _get_location(self, regions, datacenter):
        """"""
        for region in regions:
            # list of locations
            if region['location']['location']['name'] == datacenter:
                return region

        raise SoftLayer.SoftLayerError("Could not find valid location for: '%s'" % datacenter)
194585
@Override
	public List<CommerceOrderItem> findByC_S(long commerceOrderId,
		boolean subscription) {
		return findByC_S(commerceOrderId, subscription, QueryUtil.ALL_POS,
			QueryUtil.ALL_POS, null);
	}
217727
private function _fetchPClasses($storage, $country, $language, $currency)
    {
        $digestSecret = self::digest(
            $this->_eid . ":" . $currency . ":" . $this->_secret
        );
        $paramList = array(
            $this->_eid,
            $currency,
            $digestSecret,
            $country,
            $language
        );

        self::printDebug('get_pclasses array', $paramList);

        $result = $this->xmlrpc_call('get_pclasses', $paramList);

        self::printDebug('get_pclasses result', $result);

        foreach ($result as &$pclass) {
            //numeric htmlentities
            $pclass[1] = Klarna::num_htmlentities($pclass[1]);

            //Below values are in "cents", fix them.
            $pclass[3] /= 100; //divide start fee with 100
            $pclass[4] /= 100; //divide invoice fee with 100
            $pclass[5] /= 100; //divide interest rate with 100
            $pclass[6] /= 100; //divide min amount with 100

            if ($pclass[9] != '-') {
                //unix timestamp instead of yyyy-mm-dd
                $pclass[9] = strtotime($pclass[9]);
            }

            //Associate the PClass with this estore.
            array_unshift($pclass, $this->_eid);

            $storage->addPClass(new KlarnaPClass($pclass));
        }
    }
592810
def add_elasticache_node(self, node, cluster, region):
        '''  '''

        # Only want available nodes unless all_elasticache_nodes is True
        if not self.all_elasticache_nodes and node['CacheNodeStatus'] != 'available':
            return

        # Select the best destination address
        dest = node['Endpoint']['Address']

        if not dest:
            # Skip nodes we cannot address (e.g. private VPC subnet)
            return

        node_id = self.to_safe(cluster['CacheClusterId'] + '_' + node['CacheNodeId'])

        # Add to index
        self.index[dest] = [region, node_id]

        # Inventory: Group by node ID (always a group of 1)
        if self.group_by_instance_id:
            self.inventory[node_id] = [dest]
            if self.nested_groups:
                self.push_group(self.inventory, 'instances', node_id)

        # Inventory: Group by region
        if self.group_by_region:
            self.push(self.inventory, region, dest)
            if self.nested_groups:
                self.push_group(self.inventory, 'regions', region)

        # Inventory: Group by availability zone
        if self.group_by_availability_zone:
            self.push(self.inventory, cluster['PreferredAvailabilityZone'], dest)
            if self.nested_groups:
                if self.group_by_region:
                    self.push_group(self.inventory, region, cluster['PreferredAvailabilityZone'])
                self.push_group(self.inventory, 'zones', cluster['PreferredAvailabilityZone'])

        # Inventory: Group by node type
        if self.group_by_instance_type:
            type_name = self.to_safe('type_' + cluster['CacheNodeType'])
            self.push(self.inventory, type_name, dest)
            if self.nested_groups:
                self.push_group(self.inventory, 'types', type_name)

        # Inventory: Group by VPC (information not available in the current
        # AWS API version for ElastiCache)

        # Inventory: Group by security group
        if self.group_by_security_group:

            # Check for the existence of the 'SecurityGroups' key and also if
            # this key has some value. When the cluster is not placed in a SG
            # the query can return None here and cause an error.
            if 'SecurityGroups' in cluster and cluster['SecurityGroups'] is not None:
                for security_group in cluster['SecurityGroups']:
                    key = self.to_safe("security_group_" + security_group['SecurityGroupId'])
                    self.push(self.inventory, key, dest)
                    if self.nested_groups:
                        self.push_group(self.inventory, 'security_groups', key)

        # Inventory: Group by engine
        if self.group_by_elasticache_engine:
            self.push(self.inventory, self.to_safe("elasticache_" + cluster['Engine']), dest)
            if self.nested_groups:
                self.push_group(self.inventory, 'elasticache_engines', self.to_safe("elasticache_" + cluster['Engine']))

        # Inventory: Group by parameter group (done at cluster level)

        # Inventory: Group by replication group (done at cluster level)

        # Inventory: Group by ElastiCache Cluster
        if self.group_by_elasticache_cluster:
            self.push(self.inventory, self.to_safe("elasticache_cluster_" + cluster['CacheClusterId']), dest)

        # Global Tag: all ElastiCache nodes
        self.push(self.inventory, 'elasticache_nodes', dest)

        host_info = self.get_host_info_dict_from_describe_dict(node)

        if dest in self.inventory["_meta"]["hostvars"]:
            self.inventory["_meta"]["hostvars"][dest].update(host_info)
        else:
            self.inventory["_meta"]["hostvars"][dest] = host_info
480967
@Override
	public List<CommerceOrderItem> findByC_I(long commerceOrderId,
		long CPInstanceId) {
		return findByC_I(commerceOrderId, CPInstanceId, QueryUtil.ALL_POS,
			QueryUtil.ALL_POS, null);
	}
865469
def GET_utxos_insight( self, path_info, address ):
        
        if not BLOCKSTACK_TEST:
            return self._send_headers(status_code=404, content_type='text/plain')

        if not check_address(address):
            return self._reply_json({'error': 'Invalid address'}, status_code=400)

        bitcoind_opts = get_bitcoin_opts()
        bitcoind_host = bitcoind_opts['bitcoind_server']
        bitcoind_port = bitcoind_opts['bitcoind_port']
        bitcoind_user = bitcoind_opts['bitcoind_user']
        bitcoind_passwd = bitcoind_opts['bitcoind_passwd']

        bitcoind = create_bitcoind_service_proxy(bitcoind_user, bitcoind_passwd, server=bitcoind_host, port=bitcoind_port)
        address = virtualchain.address_reencode(address)
        utxos = get_unspents(address, bitcoind)
        return self._reply_json(utxos)
1187974
public function findByStockItemAndLocation(
        StockItemInterface $item,
        Location $location,
        ?BatchInterface $batch = null
    ): array {
        return array_filter(
            $this->findAll(),
            function ($su) use ($item, $location) {
                return $su->getLocation() == $location && $su->getStockItem() == $item;
            }
        );
    }
457050
def get(method, hmc, uri, uri_parms, logon_required):
        """"""
        query_str = uri_parms[0]
        try:
            console = hmc.consoles.lookup_by_oid(None)
        except KeyError:
            raise InvalidResourceError(method, uri)

        result_ucpcs = []
        filter_args = parse_query_parms(method, uri, query_str)
        for ucpc in console.unmanaged_cpcs.list(filter_args):
            result_ucpc = {}
            for prop in ucpc.properties:
                if prop in ('object-uri', 'name'):
                    result_ucpc[prop] = ucpc.properties[prop]
            result_ucpcs.append(result_ucpc)
        return {'cpcs': result_ucpcs}
766106
def get(method, hmc, uri, uri_parms, logon_required):
        """"""
        cpc_oid = uri_parms[0]
        query_str = uri_parms[1]
        try:
            cpc = hmc.cpcs.lookup_by_oid(cpc_oid)
        except KeyError:
            raise InvalidResourceError(method, uri)
        result_adapters = []
        if cpc.dpm_enabled:
            filter_args = parse_query_parms(method, uri, query_str)
            for adapter in cpc.adapters.list(filter_args):
                result_adapter = {}
                for prop in adapter.properties:
                    if prop in ('object-uri', 'name', 'status'):
                        result_adapter[prop] = adapter.properties[prop]
                result_adapters.append(result_adapter)
        return {'adapters': result_adapters}
215950
@Override
	public List<CommerceOrderItem> findByCPInstanceId(long CPInstanceId) {
		return findByCPInstanceId(CPInstanceId, QueryUtil.ALL_POS,
			QueryUtil.ALL_POS, null);
	}
1128379
def C_stock(self):
        
        return self._C_sys * (self._Q_sys / self._Q_stock).to(u.dimensionless)
641575
@RequestMapping(value = "/listPriceByPeriod", method = RequestMethod.GET)
	
	public @ResponseBody
	JsonNode listPriceByPeriod(
			@RequestParam(value = "stockName", required = true) String stockName,
			@RequestParam(value = "period", required = true) PERIOD period) {
		logger.debug("Received request to list gedik stocks");
		
		JsonNode priceList = myNetFinansService.getPricesByPeriod(stockName, period);
		
		return priceList;

	}
817026
def avail_locations(call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The avail_locations function must be called with '
            '-f or --function, or with the --list-locations option'
        )

    ret = {}
    for key in JOYENT_LOCATIONS:
        ret[key] = {
            'name': key,
            'region': JOYENT_LOCATIONS[key]
        }

    # this can be enabled when the bug in the joyent get data centers call is
    # corrected, currently only the European dc (new api) returns the correct
    # values
    # ret = {}
    # rcode, datacenters = query(
    #     command='my/datacenters', location=DEFAULT_LOCATION, method='GET'
    # )
    # if rcode in VALID_RESPONSE_CODES and isinstance(datacenters, dict):
    #     for key in datacenters:
    #     ret[key] = {
    #         'name': key,
    #         'url': datacenters[key]
    #     }
    return ret
777488
@Override
	public List<CommerceAddressRestriction> findByC_C(long classNameId,
		long classPK) {
		return findByC_C(classNameId, classPK, QueryUtil.ALL_POS,
			QueryUtil.ALL_POS, null);
	}
654717
public ContentBasedLocalBundleRepository getBundleRepository(String featureName, WsLocationAdmin locService) {
        return BundleRepositoryRegistry.getRepositoryHolder(featureName).getBundleRepository();
    }
1254290
def get_stock_codes(realtime=False):
    """"""
    if realtime:
        all_stock_codes_url = "http://www.shdjt.com/js/lib/astock.js"
        grep_stock_codes = re.compile(r"~(\d+)`")
        response = requests.get(all_stock_codes_url)
        stock_codes = grep_stock_codes.findall(response.text)
        with open(stock_code_path(), "w") as f:
            f.write(json.dumps(dict(stock=stock_codes)))
        return stock_codes

    with open(stock_code_path()) as f:
        return json.load(f)["stock"]