body stringlengths 26 98.2k | body_hash int64 -9,222,864,604,528,158,000 9,221,803,474B | docstring stringlengths 1 16.8k | path stringlengths 5 230 | name stringlengths 1 96 | repository_name stringlengths 7 89 | lang stringclasses 1
value | body_without_docstring stringlengths 20 98.2k |
|---|---|---|---|---|---|---|---|
def select_threshold(model=None, data=None, curve=None, FPR=None, FNR=None, thread_count=(- 1)):
'\n Selects a threshold for prediction.\n\n Parameters\n ----------\n model : catboost.CatBoost\n The trained model.\n\n data : catboost.Pool or list of catboost.Pool\n Set of samples to bui... | 5,361,321,896,420,254,000 | Selects a threshold for prediction.
Parameters
----------
model : catboost.CatBoost
The trained model.
data : catboost.Pool or list of catboost.Pool
Set of samples to build ROC curve with.
If set, curve parameter must not be set.
curve : tuple of three arrays (fpr, tpr, thresholds)
ROC curve points i... | catboost/python-package/catboost/utils.py | select_threshold | infected-mushroom/catboost | python | def select_threshold(model=None, data=None, curve=None, FPR=None, FNR=None, thread_count=(- 1)):
'\n Selects a threshold for prediction.\n\n Parameters\n ----------\n model : catboost.CatBoost\n The trained model.\n\n data : catboost.Pool or list of catboost.Pool\n Set of samples to bui... |
def make_color_data(data_dict):
'\n make a dataset consisting of the i-band mag and the five colors\n Returns:\n --------\n input_data: (nd-array)\n array of imag and 5 colors\n '
input_data = data_dict['mag_i_lsst']
bands = ['u', 'g', 'r', 'i', 'z', 'y']
for i in range(5):
ban... | 7,638,051,411,495,268,000 | make a dataset consisting of the i-band mag and the five colors
Returns:
--------
input_data: (nd-array)
array of imag and 5 colors | rail/estimation/algos/sklearn_nn.py | make_color_data | pwhatfield/RAIL | python | def make_color_data(data_dict):
'\n make a dataset consisting of the i-band mag and the five colors\n Returns:\n --------\n input_data: (nd-array)\n array of imag and 5 colors\n '
input_data = data_dict['mag_i_lsst']
bands = ['u', 'g', 'r', 'i', 'z', 'y']
for i in range(5):
ban... |
def __init__(self, base_config, config_dict):
'\n Parameters:\n -----------\n run_dict: dict\n dictionary of all variables read in from the run_params\n values in the yaml file\n '
super().__init__(base_config=base_config, config_dict=config_dict)
inputs = self.... | 153,539,649,409,833,100 | Parameters:
-----------
run_dict: dict
dictionary of all variables read in from the run_params
values in the yaml file | rail/estimation/algos/sklearn_nn.py | __init__ | pwhatfield/RAIL | python | def __init__(self, base_config, config_dict):
'\n Parameters:\n -----------\n run_dict: dict\n dictionary of all variables read in from the run_params\n values in the yaml file\n '
super().__init__(base_config=base_config, config_dict=config_dict)
inputs = self.... |
def inform(self):
'\n train the NN model\n '
speczs = self.training_data['redshift']
print('stacking some data...')
color_data = make_color_data(self.training_data)
input_data = regularize_data(color_data)
simplenn = sknn.MLPRegressor(hidden_layer_sizes=(12, 12), activation='tanh... | -8,780,587,404,442,871,000 | train the NN model | rail/estimation/algos/sklearn_nn.py | inform | pwhatfield/RAIL | python | def inform(self):
'\n \n '
speczs = self.training_data['redshift']
print('stacking some data...')
color_data = make_color_data(self.training_data)
input_data = regularize_data(color_data)
simplenn = sknn.MLPRegressor(hidden_layer_sizes=(12, 12), activation='tanh', solver='lbfgs')... |
def get_agent_distribution_builder(distribution, python_version):
"\n Find agent distribution docker image for smoke testing.\n :param distribution: distribution name on which agent package should be installed.\n Possible values are in the 'ALL_DISTRIBUTION_NAMES' constant.\n :param python_version: Vers... | -431,017,511,871,805,100 | Find agent distribution docker image for smoke testing.
:param distribution: distribution name on which agent package should be installed.
Possible values are in the 'ALL_DISTRIBUTION_NAMES' constant.
:param python_version: Version of the python interpreter in the distribution. | smoke_tests/tools/package/__init__.py | get_agent_distribution_builder | zak905/scalyr-agent-2 | python | def get_agent_distribution_builder(distribution, python_version):
"\n Find agent distribution docker image for smoke testing.\n :param distribution: distribution name on which agent package should be installed.\n Possible values are in the 'ALL_DISTRIBUTION_NAMES' constant.\n :param python_version: Vers... |
def readVectorFromFile(UFile):
' \n\tArg: \n\ttauFile: The directory path of OpenFOAM vector file (e.g., velocity)\n\n\tRegurn: \n\tvector: Matrix of vector \n\t'
resMid = extractVector(UFile)
fout = open('Utemp', 'w')
glob_pattern = resMid.group()
glob_pattern = re.sub('\\(', '', glob_pattern)
... | 7,155,401,464,782,885,000 | Arg:
tauFile: The directory path of OpenFOAM vector file (e.g., velocity)
Regurn:
vector: Matrix of vector | demo0/foamFileOperation.py | readVectorFromFile | Jianxun-Wang/PICNNSR | python | def readVectorFromFile(UFile):
' \n\tArg: \n\ttauFile: The directory path of OpenFOAM vector file (e.g., velocity)\n\n\tRegurn: \n\tvector: Matrix of vector \n\t'
resMid = extractVector(UFile)
fout = open('Utemp', 'w')
glob_pattern = resMid.group()
glob_pattern = re.sub('\\(', , glob_pattern)
... |
def readScalarFromFile(fileName):
' \n\n\tArg: \n\tfileName: The file name of OpenFOAM scalar field\n\n\tRegurn: \n\ta vector of scalar field \n\t'
resMid = extractScalar(fileName)
fout = open('temp.txt', 'w')
glob_patternx = resMid.group()
glob_patternx = re.sub('\\(', '', glob_patternx)
glo... | -5,231,281,418,861,886,000 | Arg:
fileName: The file name of OpenFOAM scalar field
Regurn:
a vector of scalar field | demo0/foamFileOperation.py | readScalarFromFile | Jianxun-Wang/PICNNSR | python | def readScalarFromFile(fileName):
' \n\n\tArg: \n\tfileName: The file name of OpenFOAM scalar field\n\n\tRegurn: \n\ta vector of scalar field \n\t'
resMid = extractScalar(fileName)
fout = open('temp.txt', 'w')
glob_patternx = resMid.group()
glob_patternx = re.sub('\\(', , glob_patternx)
glob_... |
def extractVector(vectorFile):
' Function is using regular expression select Vector value out\n\t\n\tArgs:\n\tUFile: The directory path of file: U\n\n\tReturns:\n\tresMid: the U as (Ux1,Uy1,Uz1);(Ux2,Uy2,Uz2);........\n\t'
fin = open(vectorFile, 'r')
line = fin.read()
fin.close()
patternMid = re.com... | -6,847,724,994,685,365,000 | Function is using regular expression select Vector value out
Args:
UFile: The directory path of file: U
Returns:
resMid: the U as (Ux1,Uy1,Uz1);(Ux2,Uy2,Uz2);........ | demo0/foamFileOperation.py | extractVector | Jianxun-Wang/PICNNSR | python | def extractVector(vectorFile):
' Function is using regular expression select Vector value out\n\t\n\tArgs:\n\tUFile: The directory path of file: U\n\n\tReturns:\n\tresMid: the U as (Ux1,Uy1,Uz1);(Ux2,Uy2,Uz2);........\n\t'
fin = open(vectorFile, 'r')
line = fin.read()
fin.close()
patternMid = re.com... |
def extractScalar(scalarFile):
' subFunction of readTurbStressFromFile\n\t\tUsing regular expression to select scalar value out \n\t\n\tArgs:\n\tscalarFile: The directory path of file of scalar\n\n\tReturns:\n\tresMid: scalar selected;\n\t\t\tyou need use resMid.group() to see the content.\n\t'
fin = open(scala... | 278,923,963,489,089,860 | subFunction of readTurbStressFromFile
Using regular expression to select scalar value out
Args:
scalarFile: The directory path of file of scalar
Returns:
resMid: scalar selected;
you need use resMid.group() to see the content. | demo0/foamFileOperation.py | extractScalar | Jianxun-Wang/PICNNSR | python | def extractScalar(scalarFile):
' subFunction of readTurbStressFromFile\n\t\tUsing regular expression to select scalar value out \n\t\n\tArgs:\n\tscalarFile: The directory path of file of scalar\n\n\tReturns:\n\tresMid: scalar selected;\n\t\t\tyou need use resMid.group() to see the content.\n\t'
fin = open(scala... |
def evaluate(X: np.ndarray, A: float=7.0, B: float=0.1) -> np.ndarray:
"Non-monotonic Ishigami-Homma three parameter test function:\n\n `f(x) = \\sin(x_{1}) + A \\sin(x_{2})^2 + Bx^{4}_{3}\\sin(x_{1})`\n\n This test function is commonly used to benchmark global sensitivity \n methods as variance-based sens... | 5,111,868,029,495,385,000 | Non-monotonic Ishigami-Homma three parameter test function:
`f(x) = \sin(x_{1}) + A \sin(x_{2})^2 + Bx^{4}_{3}\sin(x_{1})`
This test function is commonly used to benchmark global sensitivity
methods as variance-based sensitivities of this function can be
analytically determined.
See listed references below.
In [2... | src/SALib/test_functions/Ishigami.py | evaluate | QianWanghhu/SALib | python | def evaluate(X: np.ndarray, A: float=7.0, B: float=0.1) -> np.ndarray:
"Non-monotonic Ishigami-Homma three parameter test function:\n\n `f(x) = \\sin(x_{1}) + A \\sin(x_{2})^2 + Bx^{4}_{3}\\sin(x_{1})`\n\n This test function is commonly used to benchmark global sensitivity \n methods as variance-based sens... |
def _cell(self, x: torch.Tensor, i: torch.Tensor, states: Tuple[(torch.Tensor, torch.Tensor)]) -> Tuple[(torch.Tensor, torch.Tensor)]:
'Single time step logic of EA-LSTM cell'
(h_0, c_0) = states
gates = self.dynamic_gates(h_0, x)
(f, o, g) = gates.chunk(3, 1)
c_1 = ((torch.sigmoid(f) * c_0) + (i * ... | 7,109,717,501,171,930,000 | Single time step logic of EA-LSTM cell | neuralhydrology/modelzoo/ealstm.py | _cell | visr/neuralhydrology | python | def _cell(self, x: torch.Tensor, i: torch.Tensor, states: Tuple[(torch.Tensor, torch.Tensor)]) -> Tuple[(torch.Tensor, torch.Tensor)]:
(h_0, c_0) = states
gates = self.dynamic_gates(h_0, x)
(f, o, g) = gates.chunk(3, 1)
c_1 = ((torch.sigmoid(f) * c_0) + (i * torch.tanh(g)))
h_1 = (torch.sigmoid... |
def forward(self, data: Dict[(str, torch.Tensor)]) -> Dict[(str, torch.Tensor)]:
'Perform a forward pass on the EA-LSTM model.\n\n Parameters\n ----------\n data : Dict[str, torch.Tensor]\n Dictionary, containing input features as key-value pairs.\n\n Returns\n -------\... | -4,725,919,336,773,386,000 | Perform a forward pass on the EA-LSTM model.
Parameters
----------
data : Dict[str, torch.Tensor]
Dictionary, containing input features as key-value pairs.
Returns
-------
Dict[str, torch.Tensor]
Model outputs and intermediate states as a dictionary.
- `y_hat`: model predictions of shape [batch size,... | neuralhydrology/modelzoo/ealstm.py | forward | visr/neuralhydrology | python | def forward(self, data: Dict[(str, torch.Tensor)]) -> Dict[(str, torch.Tensor)]:
'Perform a forward pass on the EA-LSTM model.\n\n Parameters\n ----------\n data : Dict[str, torch.Tensor]\n Dictionary, containing input features as key-value pairs.\n\n Returns\n -------\... |
def _reset_parameters(self):
'Special initialization of certain model weights.'
nn.init.orthogonal_(self.weight_ih.data)
weight_hh_data = torch.eye(self.cfg.hidden_size)
weight_hh_data = weight_hh_data.repeat(1, 3)
self.weight_hh.data = weight_hh_data
nn.init.constant_(self.bias.data, val=0)
... | 7,564,674,853,396,321,000 | Special initialization of certain model weights. | neuralhydrology/modelzoo/ealstm.py | _reset_parameters | visr/neuralhydrology | python | def _reset_parameters(self):
nn.init.orthogonal_(self.weight_ih.data)
weight_hh_data = torch.eye(self.cfg.hidden_size)
weight_hh_data = weight_hh_data.repeat(1, 3)
self.weight_hh.data = weight_hh_data
nn.init.constant_(self.bias.data, val=0)
if (self.cfg.initial_forget_bias is not None):
... |
def naive_cut_rod_recursive(n: int, prices: list):
'\n Solves the rod-cutting problem via naively without using the benefit of dynamic\n programming. The results is the same sub-problems are solved several times\n leading to an exponential runtime\n\n Runtime: O(2^n)\n\n Arguments\n -------\n n... | 2,580,167,286,780,686,000 | Solves the rod-cutting problem via naively without using the benefit of dynamic
programming. The results is the same sub-problems are solved several times
leading to an exponential runtime
Runtime: O(2^n)
Arguments
-------
n: int, the length of the rod
prices: list, the prices for each piece of rod. ``p[i-i]`` is the... | dynamic_programming/rod_cutting.py | naive_cut_rod_recursive | AlgorithmAndLeetCode/TheAlgorithms-Python | python | def naive_cut_rod_recursive(n: int, prices: list):
'\n Solves the rod-cutting problem via naively without using the benefit of dynamic\n programming. The results is the same sub-problems are solved several times\n leading to an exponential runtime\n\n Runtime: O(2^n)\n\n Arguments\n -------\n n... |
def top_down_cut_rod(n: int, prices: list):
"\n Constructs a top-down dynamic programming solution for the rod-cutting\n problem via memoization. This function serves as a wrapper for\n _top_down_cut_rod_recursive\n\n Runtime: O(n^2)\n\n Arguments\n --------\n n: int, the length of the rod\n ... | 7,519,621,116,936,795,000 | Constructs a top-down dynamic programming solution for the rod-cutting
problem via memoization. This function serves as a wrapper for
_top_down_cut_rod_recursive
Runtime: O(n^2)
Arguments
--------
n: int, the length of the rod
prices: list, the prices for each piece of rod. ``p[i-i]`` is the
price for a rod of length... | dynamic_programming/rod_cutting.py | top_down_cut_rod | AlgorithmAndLeetCode/TheAlgorithms-Python | python | def top_down_cut_rod(n: int, prices: list):
"\n Constructs a top-down dynamic programming solution for the rod-cutting\n problem via memoization. This function serves as a wrapper for\n _top_down_cut_rod_recursive\n\n Runtime: O(n^2)\n\n Arguments\n --------\n n: int, the length of the rod\n ... |
def _top_down_cut_rod_recursive(n: int, prices: list, max_rev: list):
'\n Constructs a top-down dynamic programming solution for the rod-cutting problem\n via memoization.\n\n Runtime: O(n^2)\n\n Arguments\n --------\n n: int, the length of the rod\n prices: list, the prices for each piece of r... | 3,821,172,561,322,750,000 | Constructs a top-down dynamic programming solution for the rod-cutting problem
via memoization.
Runtime: O(n^2)
Arguments
--------
n: int, the length of the rod
prices: list, the prices for each piece of rod. ``p[i-i]`` is the
price for a rod of length ``i``
max_rev: list, the computed maximum revenue for a piece of ... | dynamic_programming/rod_cutting.py | _top_down_cut_rod_recursive | AlgorithmAndLeetCode/TheAlgorithms-Python | python | def _top_down_cut_rod_recursive(n: int, prices: list, max_rev: list):
'\n Constructs a top-down dynamic programming solution for the rod-cutting problem\n via memoization.\n\n Runtime: O(n^2)\n\n Arguments\n --------\n n: int, the length of the rod\n prices: list, the prices for each piece of r... |
def bottom_up_cut_rod(n: int, prices: list):
'\n Constructs a bottom-up dynamic programming solution for the rod-cutting problem\n\n Runtime: O(n^2)\n\n Arguments\n ----------\n n: int, the maximum length of the rod.\n prices: list, the prices for each piece of rod. ``p[i-i]`` is the\n price fo... | 3,542,587,413,765,805,000 | Constructs a bottom-up dynamic programming solution for the rod-cutting problem
Runtime: O(n^2)
Arguments
----------
n: int, the maximum length of the rod.
prices: list, the prices for each piece of rod. ``p[i-i]`` is the
price for a rod of length ``i``
Returns
-------
The maximum revenue obtainable from cutting a r... | dynamic_programming/rod_cutting.py | bottom_up_cut_rod | AlgorithmAndLeetCode/TheAlgorithms-Python | python | def bottom_up_cut_rod(n: int, prices: list):
'\n Constructs a bottom-up dynamic programming solution for the rod-cutting problem\n\n Runtime: O(n^2)\n\n Arguments\n ----------\n n: int, the maximum length of the rod.\n prices: list, the prices for each piece of rod. ``p[i-i]`` is the\n price fo... |
def _enforce_args(n: int, prices: list):
'\n Basic checks on the arguments to the rod-cutting algorithms\n\n n: int, the length of the rod\n prices: list, the price list for each piece of rod.\n\n Throws ValueError:\n\n if n is negative or there are fewer items in the price list than the length of\n ... | -643,413,616,167,749,200 | Basic checks on the arguments to the rod-cutting algorithms
n: int, the length of the rod
prices: list, the price list for each piece of rod.
Throws ValueError:
if n is negative or there are fewer items in the price list than the length of
the rod | dynamic_programming/rod_cutting.py | _enforce_args | AlgorithmAndLeetCode/TheAlgorithms-Python | python | def _enforce_args(n: int, prices: list):
'\n Basic checks on the arguments to the rod-cutting algorithms\n\n n: int, the length of the rod\n prices: list, the price list for each piece of rod.\n\n Throws ValueError:\n\n if n is negative or there are fewer items in the price list than the length of\n ... |
def convert_gis_to_geodata(net, node_geodata=True, branch_geodata=True):
'\n Extracts information on bus and line geodata from the geometries of a geopandas geodataframe.\n\n :param net: The net for which to convert the geodata\n :type net: pandapowerNet\n :param node_geodata: flag if to extract x and y... | 540,785,274,749,335,400 | Extracts information on bus and line geodata from the geometries of a geopandas geodataframe.
:param net: The net for which to convert the geodata
:type net: pandapowerNet
:param node_geodata: flag if to extract x and y values for bus geodata
:type node_geodata: bool, default True
:param branch_geodata: flag if to ext... | pandapipes/plotting/geo.py | convert_gis_to_geodata | Fraank-dash/pandapipes | python | def convert_gis_to_geodata(net, node_geodata=True, branch_geodata=True):
'\n Extracts information on bus and line geodata from the geometries of a geopandas geodataframe.\n\n :param net: The net for which to convert the geodata\n :type net: pandapowerNet\n :param node_geodata: flag if to extract x and y... |
def convert_geodata_to_gis(net, epsg=31467, node_geodata=True, branch_geodata=True):
'\n Transforms the bus and line geodata of a net into a geopandaas geodataframe with the respective\n geometries.\n\n :param net: The net for which to convert the geodata\n :type net: pandapowerNet\n :param epsg: cur... | 1,760,503,386,158,919,700 | Transforms the bus and line geodata of a net into a geopandaas geodataframe with the respective
geometries.
:param net: The net for which to convert the geodata
:type net: pandapowerNet
:param epsg: current epsg projection
:type epsg: int, default 4326 (= WGS84)
:param node_geodata: flag if to transform the bus geodat... | pandapipes/plotting/geo.py | convert_geodata_to_gis | Fraank-dash/pandapipes | python | def convert_geodata_to_gis(net, epsg=31467, node_geodata=True, branch_geodata=True):
'\n Transforms the bus and line geodata of a net into a geopandaas geodataframe with the respective\n geometries.\n\n :param net: The net for which to convert the geodata\n :type net: pandapowerNet\n :param epsg: cur... |
def convert_epsg_bus_geodata(net, epsg_in=4326, epsg_out=31467):
'\n Converts bus geodata in net from epsg_in to epsg_out\n\n :param net: The pandapower network\n :type net: pandapowerNet\n :param epsg_in: current epsg projection\n :type epsg_in: int, default 4326 (= WGS84)\n :param epsg_out: epsg... | 6,620,877,165,603,603,000 | Converts bus geodata in net from epsg_in to epsg_out
:param net: The pandapower network
:type net: pandapowerNet
:param epsg_in: current epsg projection
:type epsg_in: int, default 4326 (= WGS84)
:param epsg_out: epsg projection to be transformed to
:type epsg_out: int, default 31467 (= Gauss-Krüger Zone 3)
:return: n... | pandapipes/plotting/geo.py | convert_epsg_bus_geodata | Fraank-dash/pandapipes | python | def convert_epsg_bus_geodata(net, epsg_in=4326, epsg_out=31467):
'\n Converts bus geodata in net from epsg_in to epsg_out\n\n :param net: The pandapower network\n :type net: pandapowerNet\n :param epsg_in: current epsg projection\n :type epsg_in: int, default 4326 (= WGS84)\n :param epsg_out: epsg... |
@csrf_exempt
def addChangeHostInfo(request):
'\n 新增主机\n 修改主机\n '
v_hostId = request.POST.get('host_id')
v_businessName = request.POST.get('business_name')
v_serviceEnv = request.POST.get('service_env')
v_hostName = request.POST.get('host_name')
v_intranetIpAddr = request.POST.get('intra... | 2,577,743,367,787,272,700 | 新增主机
修改主机 | cmdb/views_ajax.py | addChangeHostInfo | bopopescu/dbsupport | python | @csrf_exempt
def addChangeHostInfo(request):
'\n 新增主机\n 修改主机\n '
v_hostId = request.POST.get('host_id')
v_businessName = request.POST.get('business_name')
v_serviceEnv = request.POST.get('service_env')
v_hostName = request.POST.get('host_name')
v_intranetIpAddr = request.POST.get('intra... |
@csrf_exempt
def addChangeHostUserInfo(request):
'\n 新增主机用户\n 修改主机用户\n '
v_hostUserId = request.POST.get('host_user_id')
v_hostId = request.POST.get('host_id')
v_hostUser = request.POST.get('host_user')
v_hostPasswd = request.POST.get('host_passwd')
v_userDesc = request.POST.get('user_d... | 84,332,024,188,917,280 | 新增主机用户
修改主机用户 | cmdb/views_ajax.py | addChangeHostUserInfo | bopopescu/dbsupport | python | @csrf_exempt
def addChangeHostUserInfo(request):
'\n 新增主机用户\n 修改主机用户\n '
v_hostUserId = request.POST.get('host_user_id')
v_hostId = request.POST.get('host_id')
v_hostUser = request.POST.get('host_user')
v_hostPasswd = request.POST.get('host_passwd')
v_userDesc = request.POST.get('user_d... |
@csrf_exempt
def addChangeDbGroupInfo(request):
'\n 新增数据库组\n 修改数据库组\n '
v_groupId = request.POST.get('group_id')
v_businessName = request.POST.get('business_name')
v_groupName = request.POST.get('group_name')
v_groupStatus = request.POST.get('group_status')
v_groupDesc = request.POST.ge... | 7,565,920,559,405,733,000 | 新增数据库组
修改数据库组 | cmdb/views_ajax.py | addChangeDbGroupInfo | bopopescu/dbsupport | python | @csrf_exempt
def addChangeDbGroupInfo(request):
'\n 新增数据库组\n 修改数据库组\n '
v_groupId = request.POST.get('group_id')
v_businessName = request.POST.get('business_name')
v_groupName = request.POST.get('group_name')
v_groupStatus = request.POST.get('group_status')
v_groupDesc = request.POST.ge... |
@csrf_exempt
def addChangeDbInstanceInfo(request):
'\n 新增数据库实例\n 修改数据库实例\n '
v_instanceId = request.POST.get('instance_id')
v_groupId = request.POST.get('group_id')
v_host_id = request.POST.get('host_id')
v_instanceName = request.POST.get('instance_env')
v_instanceType =... | -1,685,775,773,127,927,800 | 新增数据库实例
修改数据库实例 | cmdb/views_ajax.py | addChangeDbInstanceInfo | bopopescu/dbsupport | python | @csrf_exempt
def addChangeDbInstanceInfo(request):
'\n 新增数据库实例\n 修改数据库实例\n '
v_instanceId = request.POST.get('instance_id')
v_groupId = request.POST.get('group_id')
v_host_id = request.POST.get('host_id')
v_instanceName = request.POST.get('instance_env')
v_instanceType =... |
def _get_size(self, tokenL):
' return the size of the next object.'
if (tokenL == 15):
m = (ord(self._fp.read(1)[0]) & 3)
s = (1 << m)
f = ('>' + _BINARY_FORMAT[s])
return struct.unpack(f, self._fp.read(s))[0]
return tokenL | 1,455,404,657,340,850,700 | return the size of the next object. | Scripts/plist.py | _get_size | 640921008/gibMacOS | python | def _get_size(self, tokenL):
' '
if (tokenL == 15):
m = (ord(self._fp.read(1)[0]) & 3)
s = (1 << m)
f = ('>' + _BINARY_FORMAT[s])
return struct.unpack(f, self._fp.read(s))[0]
return tokenL |
def _read_object(self, ref):
'\n read the object by reference.\n May recursively read sub-objects (content of an array/dict/set)\n '
result = self._objects[ref]
if (result is not _undefined):
return result
offset = self._object_offsets[ref]
self._fp.seek(offset)
toke... | 5,374,556,891,309,387,000 | read the object by reference.
May recursively read sub-objects (content of an array/dict/set) | Scripts/plist.py | _read_object | 640921008/gibMacOS | python | def _read_object(self, ref):
'\n read the object by reference.\n May recursively read sub-objects (content of an array/dict/set)\n '
result = self._objects[ref]
if (result is not _undefined):
return result
offset = self._object_offsets[ref]
self._fp.seek(offset)
toke... |
def querybuild(cls, **kwargs):
"\n Instantiates and returns a QueryBuilder instance.\n\n The QueryBuilder's path has one vertice so far, namely this class.\n Additional parameters (e.g. filters or a label),\n can be passes as keyword arguments.\n\n :param label: Label to give\n :param filters: fil... | 6,510,601,466,728,924,000 | Instantiates and returns a QueryBuilder instance.
The QueryBuilder's path has one vertice so far, namely this class.
Additional parameters (e.g. filters or a label),
can be passes as keyword arguments.
:param label: Label to give
:param filters: filters to apply
:param project: projections
:returns: a QueryBuilder in... | aiida_vasp/utils/aiida_utils.py | querybuild | kavanase/aiida-vasp | python | def querybuild(cls, **kwargs):
"\n Instantiates and returns a QueryBuilder instance.\n\n The QueryBuilder's path has one vertice so far, namely this class.\n Additional parameters (e.g. filters or a label),\n can be passes as keyword arguments.\n\n :param label: Label to give\n :param filters: fil... |
@with_dbenv()
def get_data_class(data_type):
'Provide access to the orm.data classes with deferred dbenv loading.'
from aiida.plugins import DataFactory
from aiida.common.exceptions import MissingEntryPointError
data_cls = None
try:
data_cls = DataFactory(data_type)
except MissingEntryPo... | -8,014,482,675,913,156,000 | Provide access to the orm.data classes with deferred dbenv loading. | aiida_vasp/utils/aiida_utils.py | get_data_class | kavanase/aiida-vasp | python | @with_dbenv()
def get_data_class(data_type):
from aiida.plugins import DataFactory
from aiida.common.exceptions import MissingEntryPointError
data_cls = None
try:
data_cls = DataFactory(data_type)
except MissingEntryPointError as err:
raise err
return data_cls |
def get_current_user():
'Get current user.'
current_user = User.objects.get_default()
return current_user | 306,002,596,648,056,500 | Get current user. | aiida_vasp/utils/aiida_utils.py | get_current_user | kavanase/aiida-vasp | python | def get_current_user():
current_user = User.objects.get_default()
return current_user |
def copy_parameter(old_parameter):
'Assemble a new Dict.'
return get_data_node('dict', dict=old_parameter.get_dict()) | -5,951,678,597,882,443,000 | Assemble a new Dict. | aiida_vasp/utils/aiida_utils.py | copy_parameter | kavanase/aiida-vasp | python | def copy_parameter(old_parameter):
return get_data_node('dict', dict=old_parameter.get_dict()) |
def displace_position(structure, displacement, entry):
'Displace a position in the StructureData.'
sites = structure.sites
positions = []
for site in sites:
positions.append(site.position)
new_position = (np.asarray(positions[(entry - 1)]) + displacement)
new_position = new_position.toli... | -5,977,429,901,558,767,000 | Displace a position in the StructureData. | aiida_vasp/utils/aiida_utils.py | displace_position | kavanase/aiida-vasp | python | def displace_position(structure, displacement, entry):
sites = structure.sites
positions = []
for site in sites:
positions.append(site.position)
new_position = (np.asarray(positions[(entry - 1)]) + displacement)
new_position = new_position.tolist()
positions[(entry - 1)] = tuple(new... |
def compress_cell(structure, volume_change):
'Apply compression or tensile forces to the unit cell.'
cell = structure.cell
new_cell = (np.array(cell) * volume_change)
structure.reset_cell(new_cell.tolist()) | -589,114,200,885,345,800 | Apply compression or tensile forces to the unit cell. | aiida_vasp/utils/aiida_utils.py | compress_cell | kavanase/aiida-vasp | python | def compress_cell(structure, volume_change):
cell = structure.cell
new_cell = (np.array(cell) * volume_change)
structure.reset_cell(new_cell.tolist()) |
def cmp_load_verdi_data():
'Load the verdi data click command group for any version since 0.11.'
verdi_data = None
import_errors = []
try:
from aiida.cmdline.commands import data_cmd as verdi_data
except ImportError as err:
import_errors.append(err)
if (not verdi_data):
t... | -1,284,042,890,687,403,800 | Load the verdi data click command group for any version since 0.11. | aiida_vasp/utils/aiida_utils.py | cmp_load_verdi_data | kavanase/aiida-vasp | python | def cmp_load_verdi_data():
verdi_data = None
import_errors = []
try:
from aiida.cmdline.commands import data_cmd as verdi_data
except ImportError as err:
import_errors.append(err)
if (not verdi_data):
try:
from aiida.cmdline.commands import verdi_data
... |
def create_authinfo(computer, store=False):
'Allow the current user to use the given computer.'
from aiida.orm import AuthInfo
authinfo = AuthInfo(computer=computer, user=get_current_user())
if store:
authinfo.store()
return authinfo | -1,969,563,057,198,590,200 | Allow the current user to use the given computer. | aiida_vasp/utils/aiida_utils.py | create_authinfo | kavanase/aiida-vasp | python | def create_authinfo(computer, store=False):
from aiida.orm import AuthInfo
authinfo = AuthInfo(computer=computer, user=get_current_user())
if store:
authinfo.store()
return authinfo |
def cmp_get_authinfo(computer):
'Get an existing authinfo or None for the given computer and current user.'
return computer.get_authinfo(get_current_user()) | -3,414,521,374,861,117,400 | Get an existing authinfo or None for the given computer and current user. | aiida_vasp/utils/aiida_utils.py | cmp_get_authinfo | kavanase/aiida-vasp | python | def cmp_get_authinfo(computer):
return computer.get_authinfo(get_current_user()) |
@paddle.no_grad()
def get_offset(self, anchors, featmap_size, stride):
'\n Args:\n anchors: [M,5] xc,yc,w,h,angle\n featmap_size: (feat_h, feat_w)\n stride: 8\n Returns:\n\n '
anchors = paddle.reshape(anchors, [(- 1), 5])
dtype = anchors.dtype
feat_h... | 5,071,276,570,165,933,000 | Args:
anchors: [M,5] xc,yc,w,h,angle
featmap_size: (feat_h, feat_w)
stride: 8
Returns: | ppdet/modeling/heads/s2anet_head.py | get_offset | 1190202328/PaddleDetection | python | @paddle.no_grad()
def get_offset(self, anchors, featmap_size, stride):
'\n Args:\n anchors: [M,5] xc,yc,w,h,angle\n featmap_size: (feat_h, feat_w)\n stride: 8\n Returns:\n\n '
anchors = paddle.reshape(anchors, [(- 1), 5])
dtype = anchors.dtype
feat_h... |
def smooth_l1_loss(self, pred, label, delta=(1.0 / 9.0)):
'\n Args:\n pred: pred score\n label: label\n delta: delta\n Returns: loss\n '
assert ((pred.shape == label.shape) and (label.numel() > 0))
assert (delta > 0)
diff = paddle.abs((pred - label))... | 886,629,821,782,605,200 | Args:
pred: pred score
label: label
delta: delta
Returns: loss | ppdet/modeling/heads/s2anet_head.py | smooth_l1_loss | 1190202328/PaddleDetection | python | def smooth_l1_loss(self, pred, label, delta=(1.0 / 9.0)):
'\n Args:\n pred: pred score\n label: label\n delta: delta\n Returns: loss\n '
assert ((pred.shape == label.shape) and (label.numel() > 0))
assert (delta > 0)
diff = paddle.abs((pred - label))... |
def rect2rbox(self, bboxes):
'\n :param bboxes: shape (n, 4) (xmin, ymin, xmax, ymax)\n :return: dbboxes: shape (n, 5) (x_ctr, y_ctr, w, h, angle)\n '
bboxes = paddle.reshape(bboxes, [(- 1), 4])
num_boxes = paddle.shape(bboxes)[0]
x_ctr = ((bboxes[:, 2] + bboxes[:, 0]) / 2.0)
y_... | 8,184,311,432,423,110,000 | :param bboxes: shape (n, 4) (xmin, ymin, xmax, ymax)
:return: dbboxes: shape (n, 5) (x_ctr, y_ctr, w, h, angle) | ppdet/modeling/heads/s2anet_head.py | rect2rbox | 1190202328/PaddleDetection | python | def rect2rbox(self, bboxes):
'\n :param bboxes: shape (n, 4) (xmin, ymin, xmax, ymax)\n :return: dbboxes: shape (n, 5) (x_ctr, y_ctr, w, h, angle)\n '
bboxes = paddle.reshape(bboxes, [(- 1), 4])
num_boxes = paddle.shape(bboxes)[0]
x_ctr = ((bboxes[:, 2] + bboxes[:, 0]) / 2.0)
y_... |
def delta2rbox(self, rrois, deltas, wh_ratio_clip=1e-06):
'\n :param rrois: (cx, cy, w, h, theta)\n :param deltas: (dx, dy, dw, dh, dtheta)\n :param means: means of anchor\n :param stds: stds of anchor\n :param wh_ratio_clip: clip threshold of wh_ratio\n :return:\n '... | 7,948,377,434,776,396,000 | :param rrois: (cx, cy, w, h, theta)
:param deltas: (dx, dy, dw, dh, dtheta)
:param means: means of anchor
:param stds: stds of anchor
:param wh_ratio_clip: clip threshold of wh_ratio
:return: | ppdet/modeling/heads/s2anet_head.py | delta2rbox | 1190202328/PaddleDetection | python | def delta2rbox(self, rrois, deltas, wh_ratio_clip=1e-06):
'\n :param rrois: (cx, cy, w, h, theta)\n :param deltas: (dx, dy, dw, dh, dtheta)\n :param means: means of anchor\n :param stds: stds of anchor\n :param wh_ratio_clip: clip threshold of wh_ratio\n :return:\n '... |
def bbox_decode(self, bbox_preds, anchors):
'decode bbox from deltas\n Args:\n bbox_preds: [N,H,W,5]\n anchors: [H*W,5]\n return:\n bboxes: [N,H,W,5]\n '
(num_imgs, H, W, _) = bbox_preds.shape
bbox_delta = paddle.reshape(bbox_preds, [(- 1), 5])
bboxe... | -8,842,847,705,775,022,000 | decode bbox from deltas
Args:
bbox_preds: [N,H,W,5]
anchors: [H*W,5]
return:
bboxes: [N,H,W,5] | ppdet/modeling/heads/s2anet_head.py | bbox_decode | 1190202328/PaddleDetection | python | def bbox_decode(self, bbox_preds, anchors):
'decode bbox from deltas\n Args:\n bbox_preds: [N,H,W,5]\n anchors: [H*W,5]\n return:\n bboxes: [N,H,W,5]\n '
(num_imgs, H, W, _) = bbox_preds.shape
bbox_delta = paddle.reshape(bbox_preds, [(- 1), 5])
bboxe... |
def get_properties(self):
'\n construct 3 dictionaries:\n - joint index to joint name x2 (1 for revolute, 1 for fixed joints)\n - link name to link index dictionary\n '
rev_joint_index_name_dic = {}
fixed_joint_index_name_dic = {}
prismatic_joint_index_name_dic = {}
link_... | -2,535,933,811,214,409,700 | construct 3 dictionaries:
- joint index to joint name x2 (1 for revolute, 1 for fixed joints)
- link name to link index dictionary | pybullet_ros/pybullet_ros_wrapper.py | get_properties | packbionics/pybullet_ros | python | def get_properties(self):
'\n construct 3 dictionaries:\n - joint index to joint name x2 (1 for revolute, 1 for fixed joints)\n - link name to link index dictionary\n '
rev_joint_index_name_dic = {}
fixed_joint_index_name_dic = {}
prismatic_joint_index_name_dic = {}
link_... |
def handle_reset_simulation(self, req):
'Callback to handle the service offered by this node to reset the simulation'
self.get_logger().info('reseting simulation now')
self.pb.resetSimulation()
return Empty() | -6,883,740,475,398,433,000 | Callback to handle the service offered by this node to reset the simulation | pybullet_ros/pybullet_ros_wrapper.py | handle_reset_simulation | packbionics/pybullet_ros | python | def handle_reset_simulation(self, req):
self.get_logger().info('reseting simulation now')
self.pb.resetSimulation()
return Empty() |
def start_gui(self, gui=True):
'start physics engine (client) with or without gui'
if gui:
self.get_logger().info('Running pybullet with gui')
self.get_logger().info('-------------------------')
gui_options = self.get_parameter('gui_options').value
return self.pb.connect(self.pb.... | -1,342,515,236,442,768,000 | start physics engine (client) with or without gui | pybullet_ros/pybullet_ros_wrapper.py | start_gui | packbionics/pybullet_ros | python | def start_gui(self, gui=True):
if gui:
self.get_logger().info('Running pybullet with gui')
self.get_logger().info('-------------------------')
gui_options = self.get_parameter('gui_options').value
return self.pb.connect(self.pb.GUI, options=gui_options)
else:
self.ge... |
def init_pybullet_robot(self):
'load robot URDF model, set gravity, ground plane and environment'
urdf_path = self.get_parameter('robot_urdf_path').value
if (urdf_path == None):
self.get_logger().warn('mandatory param robot_urdf_path not set, will exit now')
rclpy.shutdown()
if (not os.p... | -4,932,683,326,942,651,000 | load robot URDF model, set gravity, ground plane and environment | pybullet_ros/pybullet_ros_wrapper.py | init_pybullet_robot | packbionics/pybullet_ros | python | def init_pybullet_robot(self):
urdf_path = self.get_parameter('robot_urdf_path').value
if (urdf_path == None):
self.get_logger().warn('mandatory param robot_urdf_path not set, will exit now')
rclpy.shutdown()
if (not os.path.isfile(urdf_path)):
self.get_logger().error(('param ro... |
def handle_reset_simulation(self, req):
'Callback to handle the service offered by this node to reset the simulation'
self.get_logger().info('reseting simulation now')
self.pause_simulation = True
self.pb.resetSimulation()
self.init_pybullet_robot()
self.pause_simulation = False
return [] | -1,467,310,471,600,018,400 | Callback to handle the service offered by this node to reset the simulation | pybullet_ros/pybullet_ros_wrapper.py | handle_reset_simulation | packbionics/pybullet_ros | python | def handle_reset_simulation(self, req):
self.get_logger().info('reseting simulation now')
self.pause_simulation = True
self.pb.resetSimulation()
self.init_pybullet_robot()
self.pause_simulation = False
return [] |
def handle_pause_physics(self, req):
'pause simulation, raise flag to prevent pybullet to execute self.pb.stepSimulation()'
self.get_logger().info('pausing simulation')
self.pause_simulation = False
return [] | 6,490,197,465,917,417,000 | pause simulation, raise flag to prevent pybullet to execute self.pb.stepSimulation() | pybullet_ros/pybullet_ros_wrapper.py | handle_pause_physics | packbionics/pybullet_ros | python | def handle_pause_physics(self, req):
self.get_logger().info('pausing simulation')
self.pause_simulation = False
return [] |
def handle_unpause_physics(self, req):
'unpause simulation, lower flag to allow pybullet to execute self.pb.stepSimulation()'
self.get_logger().info('unpausing simulation')
self.pause_simulation = True
return [] | 276,483,701,356,102,600 | unpause simulation, lower flag to allow pybullet to execute self.pb.stepSimulation() | pybullet_ros/pybullet_ros_wrapper.py | handle_unpause_physics | packbionics/pybullet_ros | python | def handle_unpause_physics(self, req):
self.get_logger().info('unpausing simulation')
self.pause_simulation = True
return [] |
def __init__(__self__, resource_name, opts=None, bucket=None, filter=None, name=None, storage_class_analysis=None, __props__=None, __name__=None, __opts__=None):
'\n Provides a S3 bucket [analytics configuration](https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html) resource.\n\n ... | -7,051,861,357,956,645,000 | Provides a S3 bucket [analytics configuration](https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html) resource.
## Example Usage
### Add analytics configuration for entire S3 bucket and export results to a second S3 bucket
```python
import pulumi
import pulumi_aws as aws
example = aws.s3.Bucke... | sdk/python/pulumi_aws/s3/analytics_configuration.py | __init__ | michael-golden/pulumi-aws | python | def __init__(__self__, resource_name, opts=None, bucket=None, filter=None, name=None, storage_class_analysis=None, __props__=None, __name__=None, __opts__=None):
'\n Provides a S3 bucket [analytics configuration](https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html) resource.\n\n ... |
@staticmethod
def get(resource_name, id, opts=None, bucket=None, filter=None, name=None, storage_class_analysis=None):
"\n Get an existing AnalyticsConfiguration resource's state with the given name, id, and optional extra\n properties used to qualify the lookup.\n\n :param str resource_name: T... | -381,802,085,651,716,030 | Get an existing AnalyticsConfiguration resource's state with the given name, id, and optional extra
properties used to qualify the lookup.
:param str resource_name: The unique name of the resulting resource.
:param str id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions opts: Options fo... | sdk/python/pulumi_aws/s3/analytics_configuration.py | get | michael-golden/pulumi-aws | python | @staticmethod
def get(resource_name, id, opts=None, bucket=None, filter=None, name=None, storage_class_analysis=None):
"\n Get an existing AnalyticsConfiguration resource's state with the given name, id, and optional extra\n properties used to qualify the lookup.\n\n :param str resource_name: T... |
def test_create_file(self):
'Test the creation of a simple XlsxWriter file.'
workbook = Workbook(self.got_filename)
worksheet = workbook.add_worksheet()
chart = workbook.add_chart({'type': 'scatter', 'subtype': 'straight'})
chart.axis_ids = [54010624, 45705856]
data = [[1, 2, 3, 4, 5], [2, 4, 6,... | -8,052,261,018,325,395,000 | Test the creation of a simple XlsxWriter file. | xlsxwriter/test/comparison/test_chart_scatter03.py | test_create_file | CrackerCat/XlsxWriter | python | def test_create_file(self):
workbook = Workbook(self.got_filename)
worksheet = workbook.add_worksheet()
chart = workbook.add_chart({'type': 'scatter', 'subtype': 'straight'})
chart.axis_ids = [54010624, 45705856]
data = [[1, 2, 3, 4, 5], [2, 4, 6, 8, 10], [3, 6, 9, 12, 15]]
worksheet.write_... |
def zipf_distribution(nbr_symbols, alpha):
"Helper function: Create a Zipf distribution.\n\n Args:\n nbr_symbols: number of symbols to use in the distribution.\n alpha: float, Zipf's Law Distribution parameter. Default = 1.5.\n Usually for modelling natural text distribution is in\n the range [1.1-... | 5,605,568,572,597,886,000 | Helper function: Create a Zipf distribution.
Args:
nbr_symbols: number of symbols to use in the distribution.
alpha: float, Zipf's Law Distribution parameter. Default = 1.5.
Usually for modelling natural text distribution is in
the range [1.1-1.6].
Returns:
distr_map: list of float, Zipf's distribution ... | tensor2tensor/data_generators/algorithmic.py | zipf_distribution | PedroLelis/tensor2tensor | python | def zipf_distribution(nbr_symbols, alpha):
"Helper function: Create a Zipf distribution.\n\n Args:\n nbr_symbols: number of symbols to use in the distribution.\n alpha: float, Zipf's Law Distribution parameter. Default = 1.5.\n Usually for modelling natural text distribution is in\n the range [1.1-... |
def zipf_random_sample(distr_map, sample_len):
"Helper function: Generate a random Zipf sample of given length.\n\n Args:\n distr_map: list of float, Zipf's distribution over nbr_symbols.\n sample_len: integer, length of sequence to generate.\n\n Returns:\n sample: list of integer, Zipf's random sample o... | 3,990,493,769,506,299,400 | Helper function: Generate a random Zipf sample of given length.
Args:
distr_map: list of float, Zipf's distribution over nbr_symbols.
sample_len: integer, length of sequence to generate.
Returns:
sample: list of integer, Zipf's random sample over nbr_symbols. | tensor2tensor/data_generators/algorithmic.py | zipf_random_sample | PedroLelis/tensor2tensor | python | def zipf_random_sample(distr_map, sample_len):
"Helper function: Generate a random Zipf sample of given length.\n\n Args:\n distr_map: list of float, Zipf's distribution over nbr_symbols.\n sample_len: integer, length of sequence to generate.\n\n Returns:\n sample: list of integer, Zipf's random sample o... |
def reverse_generator_nlplike(nbr_symbols, max_length, nbr_cases, scale_std_dev=100, alpha=1.5):
'Generator for the reversing nlp-like task on sequences of symbols.\n\n The length of the sequence is drawn from a Gaussian(Normal) distribution\n at random from [1, max_length] and with std deviation of 1%,\n then s... | 6,382,139,318,736,053,000 | Generator for the reversing nlp-like task on sequences of symbols.
The length of the sequence is drawn from a Gaussian(Normal) distribution
at random from [1, max_length] and with std deviation of 1%,
then symbols are drawn from Zipf's law at random from [0, nbr_symbols) until
nbr_cases sequences have been produced.
... | tensor2tensor/data_generators/algorithmic.py | reverse_generator_nlplike | PedroLelis/tensor2tensor | python | def reverse_generator_nlplike(nbr_symbols, max_length, nbr_cases, scale_std_dev=100, alpha=1.5):
'Generator for the reversing nlp-like task on sequences of symbols.\n\n The length of the sequence is drawn from a Gaussian(Normal) distribution\n at random from [1, max_length] and with std deviation of 1%,\n then s... |
def lower_endian_to_number(l, base):
'Helper function: convert a list of digits in the given base to a number.'
return sum([(d * (base ** i)) for (i, d) in enumerate(l)]) | 2,888,343,823,394,923,000 | Helper function: convert a list of digits in the given base to a number. | tensor2tensor/data_generators/algorithmic.py | lower_endian_to_number | PedroLelis/tensor2tensor | python | def lower_endian_to_number(l, base):
return sum([(d * (base ** i)) for (i, d) in enumerate(l)]) |
def number_to_lower_endian(n, base):
'Helper function: convert a number to a list of digits in the given base.'
if (n < base):
return [n]
return ([(n % base)] + number_to_lower_endian((n // base), base)) | -7,649,382,115,913,318,000 | Helper function: convert a number to a list of digits in the given base. | tensor2tensor/data_generators/algorithmic.py | number_to_lower_endian | PedroLelis/tensor2tensor | python | def number_to_lower_endian(n, base):
if (n < base):
return [n]
return ([(n % base)] + number_to_lower_endian((n // base), base)) |
def random_number_lower_endian(length, base):
'Helper function: generate a random number as a lower-endian digits list.'
if (length == 1):
return [np.random.randint(base)]
prefix = [np.random.randint(base) for _ in range((length - 1))]
return (prefix + [(np.random.randint((base - 1)) + 1)]) | -609,732,790,837,893,400 | Helper function: generate a random number as a lower-endian digits list. | tensor2tensor/data_generators/algorithmic.py | random_number_lower_endian | PedroLelis/tensor2tensor | python | def random_number_lower_endian(length, base):
if (length == 1):
return [np.random.randint(base)]
prefix = [np.random.randint(base) for _ in range((length - 1))]
return (prefix + [(np.random.randint((base - 1)) + 1)]) |
def generator(self, nbr_symbols, max_length, nbr_cases):
'Generates the data.'
raise NotImplementedError() | 101,036,179,159,610,560 | Generates the data. | tensor2tensor/data_generators/algorithmic.py | generator | PedroLelis/tensor2tensor | python | def generator(self, nbr_symbols, max_length, nbr_cases):
raise NotImplementedError() |
def generator(self, nbr_symbols, max_length, nbr_cases):
'Generator for the identity (copy) task on sequences of symbols.\n\n The length of the sequence is drawn uniformly at random from [1, max_length]\n and then symbols are drawn uniformly at random from [0, nbr_symbols) until\n nbr_cases sequences have ... | 1,047,746,998,304,470,700 | Generator for the identity (copy) task on sequences of symbols.
The length of the sequence is drawn uniformly at random from [1, max_length]
and then symbols are drawn uniformly at random from [0, nbr_symbols) until
nbr_cases sequences have been produced.
Args:
nbr_symbols: number of symbols to use in each sequence... | tensor2tensor/data_generators/algorithmic.py | generator | PedroLelis/tensor2tensor | python | def generator(self, nbr_symbols, max_length, nbr_cases):
'Generator for the identity (copy) task on sequences of symbols.\n\n The length of the sequence is drawn uniformly at random from [1, max_length]\n and then symbols are drawn uniformly at random from [0, nbr_symbols) until\n nbr_cases sequences have ... |
def generator(self, nbr_symbols, max_length, nbr_cases):
'Generator for the shift task on sequences of symbols.\n\n The length of the sequence is drawn uniformly at random from [1, max_length]\n and then symbols are drawn uniformly at random from [0, nbr_symbols - shift]\n until nbr_cases sequences have be... | 8,281,185,637,235,074,000 | Generator for the shift task on sequences of symbols.
The length of the sequence is drawn uniformly at random from [1, max_length]
and then symbols are drawn uniformly at random from [0, nbr_symbols - shift]
until nbr_cases sequences have been produced (output[i] = input[i] + shift).
Args:
nbr_symbols: number of sy... | tensor2tensor/data_generators/algorithmic.py | generator | PedroLelis/tensor2tensor | python | def generator(self, nbr_symbols, max_length, nbr_cases):
'Generator for the shift task on sequences of symbols.\n\n The length of the sequence is drawn uniformly at random from [1, max_length]\n and then symbols are drawn uniformly at random from [0, nbr_symbols - shift]\n until nbr_cases sequences have be... |
def generator(self, nbr_symbols, max_length, nbr_cases):
'Generator for the reversing task on sequences of symbols.\n\n The length of the sequence is drawn uniformly at random from [1, max_length]\n and then symbols are drawn uniformly at random from [0, nbr_symbols) until\n nbr_cases sequences have been p... | -171,245,036,602,414,620 | Generator for the reversing task on sequences of symbols.
The length of the sequence is drawn uniformly at random from [1, max_length]
and then symbols are drawn uniformly at random from [0, nbr_symbols) until
nbr_cases sequences have been produced.
Args:
nbr_symbols: number of symbols to use in each sequence.
ma... | tensor2tensor/data_generators/algorithmic.py | generator | PedroLelis/tensor2tensor | python | def generator(self, nbr_symbols, max_length, nbr_cases):
'Generator for the reversing task on sequences of symbols.\n\n The length of the sequence is drawn uniformly at random from [1, max_length]\n and then symbols are drawn uniformly at random from [0, nbr_symbols) until\n nbr_cases sequences have been p... |
def generator(self, base, max_length, nbr_cases):
'Generator for the addition task.\n\n The length of each number is drawn uniformly at random in [1, max_length/2]\n and then digits are drawn uniformly at random. The numbers are added and\n separated by [base] in the input. Stops at nbr_cases.\n\n Args:... | -496,073,463,817,623,360 | Generator for the addition task.
The length of each number is drawn uniformly at random in [1, max_length/2]
and then digits are drawn uniformly at random. The numbers are added and
separated by [base] in the input. Stops at nbr_cases.
Args:
base: in which base are the numbers.
max_length: integer, maximum length... | tensor2tensor/data_generators/algorithmic.py | generator | PedroLelis/tensor2tensor | python | def generator(self, base, max_length, nbr_cases):
'Generator for the addition task.\n\n The length of each number is drawn uniformly at random in [1, max_length/2]\n and then digits are drawn uniformly at random. The numbers are added and\n separated by [base] in the input. Stops at nbr_cases.\n\n Args:... |
def generator(self, base, max_length, nbr_cases):
'Generator for the multiplication task.\n\n The length of each number is drawn uniformly at random in [1, max_length/2]\n and then digits are drawn uniformly at random. The numbers are multiplied\n and separated by [base] in the input. Stops at nbr_cases.\n... | 3,938,567,779,248,577,500 | Generator for the multiplication task.
The length of each number is drawn uniformly at random in [1, max_length/2]
and then digits are drawn uniformly at random. The numbers are multiplied
and separated by [base] in the input. Stops at nbr_cases.
Args:
base: in which base are the numbers.
max_length: integer, max... | tensor2tensor/data_generators/algorithmic.py | generator | PedroLelis/tensor2tensor | python | def generator(self, base, max_length, nbr_cases):
'Generator for the multiplication task.\n\n The length of each number is drawn uniformly at random in [1, max_length/2]\n and then digits are drawn uniformly at random. The numbers are multiplied\n and separated by [base] in the input. Stops at nbr_cases.\n... |
@property
def unique(self):
'Unique numbers wo/ replacement or w/ replacement in sorting task.'
return False | -7,437,857,752,923,323,000 | Unique numbers wo/ replacement or w/ replacement in sorting task. | tensor2tensor/data_generators/algorithmic.py | unique | PedroLelis/tensor2tensor | python | @property
def unique(self):
return False |
def generator(self, nbr_symbols, max_length, nbr_cases):
'Generating for sorting task on sequence of symbols.\n\n The length of the sequence is drawn uniformly at random from [1, max_length]\n and then symbols are drawn (uniquely w/ or w/o replacement) uniformly at\n random from [0, nbr_symbols) until nbr_... | 540,110,827,905,498,500 | Generating for sorting task on sequence of symbols.
The length of the sequence is drawn uniformly at random from [1, max_length]
and then symbols are drawn (uniquely w/ or w/o replacement) uniformly at
random from [0, nbr_symbols) until nbr_cases sequences have been produced.
Args:
nbr_symbols: number of symbols to... | tensor2tensor/data_generators/algorithmic.py | generator | PedroLelis/tensor2tensor | python | def generator(self, nbr_symbols, max_length, nbr_cases):
'Generating for sorting task on sequence of symbols.\n\n The length of the sequence is drawn uniformly at random from [1, max_length]\n and then symbols are drawn (uniquely w/ or w/o replacement) uniformly at\n random from [0, nbr_symbols) until nbr_... |
def generate_data(self, data_dir, tmp_dir, task_id=(- 1)):
'Ganerate data for this problem.'
del tmp_dir, task_id
identity_problem = AlgorithmicIdentityBinary40()
utils.generate_files(identity_problem.generator(self.num_symbols, 40, 100000), self.training_filepaths(data_dir, 1, shuffled=True), 100)
... | 5,385,898,703,597,336,000 | Ganerate data for this problem. | tensor2tensor/data_generators/algorithmic.py | generate_data | PedroLelis/tensor2tensor | python | def generate_data(self, data_dir, tmp_dir, task_id=(- 1)):
del tmp_dir, task_id
identity_problem = AlgorithmicIdentityBinary40()
utils.generate_files(identity_problem.generator(self.num_symbols, 40, 100000), self.training_filepaths(data_dir, 1, shuffled=True), 100)
utils.generate_files(identity_pro... |
@classmethod
def setup_for_test(cls):
'Setup directories and files required to run the problem.'
tmp_dir = tf.test.get_temp_dir()
shutil.rmtree(tmp_dir)
os.mkdir(tmp_dir)
cls.data_dir = tmp_dir
cls().generate_data(TinyAlgo.data_dir, None) | 6,394,519,504,221,772,000 | Setup directories and files required to run the problem. | tensor2tensor/data_generators/algorithmic.py | setup_for_test | PedroLelis/tensor2tensor | python | @classmethod
def setup_for_test(cls):
tmp_dir = tf.test.get_temp_dir()
shutil.rmtree(tmp_dir)
os.mkdir(tmp_dir)
cls.data_dir = tmp_dir
cls().generate_data(TinyAlgo.data_dir, None) |
def generator_eos(nbr_symbols, max_length, nbr_cases):
'Shift by NUM_RESERVED_IDS and append EOS token.'
for case in self.generator(nbr_symbols, max_length, nbr_cases):
new_case = {}
for feature in case:
new_case[feature] = ([(i + text_encoder.NUM_RESERVED_TOKENS) for i in case[featu... | 3,016,446,733,464,996,000 | Shift by NUM_RESERVED_IDS and append EOS token. | tensor2tensor/data_generators/algorithmic.py | generator_eos | PedroLelis/tensor2tensor | python | def generator_eos(nbr_symbols, max_length, nbr_cases):
for case in self.generator(nbr_symbols, max_length, nbr_cases):
new_case = {}
for feature in case:
new_case[feature] = ([(i + text_encoder.NUM_RESERVED_TOKENS) for i in case[feature]] + [text_encoder.EOS_ID])
(yield new_... |
@app.errorhandler(404)
def page_not_found(e):
'Return a custom 404 error.'
return ('Sorry, nothing at this URL.', 404) | 8,151,873,939,979,943,000 | Return a custom 404 error. | main.py | page_not_found | rekab/papt | python | @app.errorhandler(404)
def page_not_found(e):
return ('Sorry, nothing at this URL.', 404) |
def generate_data(rollouts, data_dir, noise_type):
' Generates data '
assert exists(data_dir), 'The data directory does not exist...'
env = gym.make('CarRacing-v0')
seq_len = 1000
for i in range(rollouts):
env.reset()
env.env.viewer.window.dispatch_events()
if (noise_type == ... | -2,347,582,097,888,886,000 | Generates data | data/carracing.py | generate_data | susanwe/world-models | python | def generate_data(rollouts, data_dir, noise_type):
' '
assert exists(data_dir), 'The data directory does not exist...'
env = gym.make('CarRacing-v0')
seq_len = 1000
for i in range(rollouts):
env.reset()
env.env.viewer.window.dispatch_events()
if (noise_type == 'white'):
... |
def __init__(__self__, *, accelerator_count: Optional[pulumi.Input[int]]=None, accelerator_type: Optional[pulumi.Input[str]]=None):
'\n A specification of the type and number of accelerator cards attached to the instance.\n :param pulumi.Input[int] accelerator_count: The number of the guest accelerato... | -8,764,338,972,364,156,000 | A specification of the type and number of accelerator cards attached to the instance.
:param pulumi.Input[int] accelerator_count: The number of the guest accelerator cards exposed to this instance.
:param pulumi.Input[str] accelerator_type: Full or partial URL of the accelerator type resource to attach to this instance... | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | __init__ | AaronFriel/pulumi-google-native | python | def __init__(__self__, *, accelerator_count: Optional[pulumi.Input[int]]=None, accelerator_type: Optional[pulumi.Input[str]]=None):
'\n A specification of the type and number of accelerator cards attached to the instance.\n :param pulumi.Input[int] accelerator_count: The number of the guest accelerato... |
@property
@pulumi.getter(name='acceleratorCount')
def accelerator_count(self) -> Optional[pulumi.Input[int]]:
'\n The number of the guest accelerator cards exposed to this instance.\n '
return pulumi.get(self, 'accelerator_count') | -1,876,897,111,891,348,000 | The number of the guest accelerator cards exposed to this instance. | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | accelerator_count | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter(name='acceleratorCount')
def accelerator_count(self) -> Optional[pulumi.Input[int]]:
'\n \n '
return pulumi.get(self, 'accelerator_count') |
@property
@pulumi.getter(name='acceleratorType')
def accelerator_type(self) -> Optional[pulumi.Input[str]]:
'\n Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an insta... | 7,495,562,579,804,966,000 | Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types. | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | accelerator_type | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter(name='acceleratorType')
def accelerator_type(self) -> Optional[pulumi.Input[str]]:
'\n \n '
return pulumi.get(self, 'accelerator_type') |
def __init__(__self__, *, external_ipv6: Optional[pulumi.Input[str]]=None, external_ipv6_prefix_length: Optional[pulumi.Input[int]]=None, name: Optional[pulumi.Input[str]]=None, nat_ip: Optional[pulumi.Input[str]]=None, network_tier: Optional[pulumi.Input['AccessConfigNetworkTier']]=None, public_ptr_domain_name: Option... | -9,004,404,242,649,221,000 | An access configuration attached to an instance's network interface. Only one access config per instance is supported.
:param pulumi.Input[str] external_ipv6: The first IPv6 address of the external IPv6 range associated with this instance, prefix length is stored in externalIpv6PrefixLength in ipv6AccessConfig. The fie... | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | __init__ | AaronFriel/pulumi-google-native | python | def __init__(__self__, *, external_ipv6: Optional[pulumi.Input[str]]=None, external_ipv6_prefix_length: Optional[pulumi.Input[int]]=None, name: Optional[pulumi.Input[str]]=None, nat_ip: Optional[pulumi.Input[str]]=None, network_tier: Optional[pulumi.Input['AccessConfigNetworkTier']]=None, public_ptr_domain_name: Option... |
@property
@pulumi.getter(name='externalIpv6')
def external_ipv6(self) -> Optional[pulumi.Input[str]]:
'\n The first IPv6 address of the external IPv6 range associated with this instance, prefix length is stored in externalIpv6PrefixLength in ipv6AccessConfig. The field is output only, an IPv6 address from a ... | -2,103,181,351,474,099,700 | The first IPv6 address of the external IPv6 range associated with this instance, prefix length is stored in externalIpv6PrefixLength in ipv6AccessConfig. The field is output only, an IPv6 address from a subnetwork associated with the instance will be allocated dynamically. | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | external_ipv6 | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter(name='externalIpv6')
def external_ipv6(self) -> Optional[pulumi.Input[str]]:
'\n \n '
return pulumi.get(self, 'external_ipv6') |
@property
@pulumi.getter(name='externalIpv6PrefixLength')
def external_ipv6_prefix_length(self) -> Optional[pulumi.Input[int]]:
'\n The prefix length of the external IPv6 range.\n '
return pulumi.get(self, 'external_ipv6_prefix_length') | -3,134,954,939,221,654,500 | The prefix length of the external IPv6 range. | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | external_ipv6_prefix_length | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter(name='externalIpv6PrefixLength')
def external_ipv6_prefix_length(self) -> Optional[pulumi.Input[int]]:
'\n \n '
return pulumi.get(self, 'external_ipv6_prefix_length') |
@property
@pulumi.getter
def name(self) -> Optional[pulumi.Input[str]]:
'\n The name of this access configuration. The default and recommended name is External NAT, but you can use any arbitrary string, such as My external IP or Network Access.\n '
return pulumi.get(self, 'name') | 5,549,982,464,012,904,000 | The name of this access configuration. The default and recommended name is External NAT, but you can use any arbitrary string, such as My external IP or Network Access. | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | name | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter
def name(self) -> Optional[pulumi.Input[str]]:
'\n \n '
return pulumi.get(self, 'name') |
@property
@pulumi.getter(name='natIP')
def nat_ip(self) -> Optional[pulumi.Input[str]]:
'\n An external IP address associated with this instance. Specify an unused static external IP address available to the project or leave this field undefined to use an IP from a shared ephemeral IP address pool. If you sp... | -7,582,645,951,335,333,000 | An external IP address associated with this instance. Specify an unused static external IP address available to the project or leave this field undefined to use an IP from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance. | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | nat_ip | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter(name='natIP')
def nat_ip(self) -> Optional[pulumi.Input[str]]:
'\n \n '
return pulumi.get(self, 'nat_ip') |
@property
@pulumi.getter(name='networkTier')
def network_tier(self) -> Optional[pulumi.Input['AccessConfigNetworkTier']]:
'\n This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM, STANDARD. If an AccessConfig is specified without a ... | 4,396,969,283,455,139,300 | This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM, STANDARD. If an AccessConfig is specified without a valid external IP address, an ephemeral IP will be created with this networkTier. If an AccessConfig with a valid external IP address is ... | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | network_tier | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter(name='networkTier')
def network_tier(self) -> Optional[pulumi.Input['AccessConfigNetworkTier']]:
'\n \n '
return pulumi.get(self, 'network_tier') |
@property
@pulumi.getter(name='publicPtrDomainName')
def public_ptr_domain_name(self) -> Optional[pulumi.Input[str]]:
'\n The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled in accessConfig. If this field is unspecified in ipv6AccessConfig, a defa... | 5,687,630,777,437,308,000 | The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled in accessConfig. If this field is unspecified in ipv6AccessConfig, a default PTR record will be createc for first IP in associated external IPv6 range. | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | public_ptr_domain_name | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter(name='publicPtrDomainName')
def public_ptr_domain_name(self) -> Optional[pulumi.Input[str]]:
'\n \n '
return pulumi.get(self, 'public_ptr_domain_name') |
@property
@pulumi.getter(name='setPublicDns')
def set_public_dns(self) -> Optional[pulumi.Input[bool]]:
"\n Specifies whether a public DNS 'A' record should be created for the external IP address of this access configuration.\n "
return pulumi.get(self, 'set_public_dns') | -2,032,867,425,056,029,200 | Specifies whether a public DNS 'A' record should be created for the external IP address of this access configuration. | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | set_public_dns | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter(name='setPublicDns')
def set_public_dns(self) -> Optional[pulumi.Input[bool]]:
"\n \n "
return pulumi.get(self, 'set_public_dns') |
@property
@pulumi.getter(name='setPublicPtr')
def set_public_ptr(self) -> Optional[pulumi.Input[bool]]:
"\n Specifies whether a public DNS 'PTR' record should be created to map the external IP address of the instance to a DNS domain name. This field is not used in ipv6AccessConfig. A default PTR record will ... | -5,875,192,349,570,517,000 | Specifies whether a public DNS 'PTR' record should be created to map the external IP address of the instance to a DNS domain name. This field is not used in ipv6AccessConfig. A default PTR record will be created if the VM has external IPv6 range associated. | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | set_public_ptr | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter(name='setPublicPtr')
def set_public_ptr(self) -> Optional[pulumi.Input[bool]]:
"\n \n "
return pulumi.get(self, 'set_public_ptr') |
@property
@pulumi.getter
def type(self) -> Optional[pulumi.Input['AccessConfigType']]:
'\n The type of configuration. The default and only option is ONE_TO_ONE_NAT.\n '
return pulumi.get(self, 'type') | -2,253,677,793,493,363,500 | The type of configuration. The default and only option is ONE_TO_ONE_NAT. | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | type | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter
def type(self) -> Optional[pulumi.Input['AccessConfigType']]:
'\n \n '
return pulumi.get(self, 'type') |
def __init__(__self__, *, enable_nested_virtualization: Optional[pulumi.Input[bool]]=None, enable_uefi_networking: Optional[pulumi.Input[bool]]=None, numa_node_count: Optional[pulumi.Input[int]]=None, threads_per_core: Optional[pulumi.Input[int]]=None, visible_core_count: Optional[pulumi.Input[int]]=None):
"\n ... | -2,016,403,648,159,950,600 | Specifies options for controlling advanced machine features. Options that would traditionally be configured in a BIOS belong here. Features that require operating system support may have corresponding entries in the GuestOsFeatures of an Image (e.g., whether or not the OS in the Image supports nested virtualization bei... | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | __init__ | AaronFriel/pulumi-google-native | python | def __init__(__self__, *, enable_nested_virtualization: Optional[pulumi.Input[bool]]=None, enable_uefi_networking: Optional[pulumi.Input[bool]]=None, numa_node_count: Optional[pulumi.Input[int]]=None, threads_per_core: Optional[pulumi.Input[int]]=None, visible_core_count: Optional[pulumi.Input[int]]=None):
"\n ... |
@property
@pulumi.getter(name='enableNestedVirtualization')
def enable_nested_virtualization(self) -> Optional[pulumi.Input[bool]]:
'\n Whether to enable nested virtualization or not (default is false).\n '
return pulumi.get(self, 'enable_nested_virtualization') | 2,855,175,695,610,519,600 | Whether to enable nested virtualization or not (default is false). | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | enable_nested_virtualization | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter(name='enableNestedVirtualization')
def enable_nested_virtualization(self) -> Optional[pulumi.Input[bool]]:
'\n \n '
return pulumi.get(self, 'enable_nested_virtualization') |
@property
@pulumi.getter(name='enableUefiNetworking')
def enable_uefi_networking(self) -> Optional[pulumi.Input[bool]]:
'\n Whether to enable UEFI networking for instance creation.\n '
return pulumi.get(self, 'enable_uefi_networking') | 8,976,873,232,754,444,000 | Whether to enable UEFI networking for instance creation. | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | enable_uefi_networking | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter(name='enableUefiNetworking')
def enable_uefi_networking(self) -> Optional[pulumi.Input[bool]]:
'\n \n '
return pulumi.get(self, 'enable_uefi_networking') |
@property
@pulumi.getter(name='numaNodeCount')
def numa_node_count(self) -> Optional[pulumi.Input[int]]:
'\n The number of vNUMA nodes.\n '
return pulumi.get(self, 'numa_node_count') | 219,648,407,840,407,680 | The number of vNUMA nodes. | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | numa_node_count | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter(name='numaNodeCount')
def numa_node_count(self) -> Optional[pulumi.Input[int]]:
'\n \n '
return pulumi.get(self, 'numa_node_count') |
@property
@pulumi.getter(name='threadsPerCore')
def threads_per_core(self) -> Optional[pulumi.Input[int]]:
'\n The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed... | -1,823,393,903,935,214,300 | The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed. | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | threads_per_core | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter(name='threadsPerCore')
def threads_per_core(self) -> Optional[pulumi.Input[int]]:
'\n \n '
return pulumi.get(self, 'threads_per_core') |
@property
@pulumi.getter(name='visibleCoreCount')
def visible_core_count(self) -> Optional[pulumi.Input[int]]:
"\n The number of physical cores to expose to an instance. Multiply by the number of threads per core to compute the total number of virtual CPUs to expose to the instance. If unset, the number of c... | 5,973,611,084,607,250,000 | The number of physical cores to expose to an instance. Multiply by the number of threads per core to compute the total number of virtual CPUs to expose to the instance. If unset, the number of cores is inferred from the instance's nominal CPU count and the underlying platform's SMT width. | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | visible_core_count | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter(name='visibleCoreCount')
def visible_core_count(self) -> Optional[pulumi.Input[int]]:
"\n \n "
return pulumi.get(self, 'visible_core_count') |
def __init__(__self__, *, ip_cidr_range: Optional[pulumi.Input[str]]=None, subnetwork_range_name: Optional[pulumi.Input[str]]=None):
"\n An alias IP range attached to an instance's network interface.\n :param pulumi.Input[str] ip_cidr_range: The IP alias ranges to allocate for this interface. This IP ... | -545,162,838,509,802,430 | An alias IP range attached to an instance's network interface.
:param pulumi.Input[str] ip_cidr_range: The IP alias ranges to allocate for this interface. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This range may be ... | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | __init__ | AaronFriel/pulumi-google-native | python | def __init__(__self__, *, ip_cidr_range: Optional[pulumi.Input[str]]=None, subnetwork_range_name: Optional[pulumi.Input[str]]=None):
"\n An alias IP range attached to an instance's network interface.\n :param pulumi.Input[str] ip_cidr_range: The IP alias ranges to allocate for this interface. This IP ... |
@property
@pulumi.getter(name='ipCidrRange')
def ip_cidr_range(self) -> Optional[pulumi.Input[str]]:
'\n The IP alias ranges to allocate for this interface. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This ... | -6,477,900,350,978,033,000 | The IP alias ranges to allocate for this interface. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This range may be a single IP address (such as 10.2.3.4), a netmask (such as /24) or a CIDR-formatted string (such as 10.... | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | ip_cidr_range | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter(name='ipCidrRange')
def ip_cidr_range(self) -> Optional[pulumi.Input[str]]:
'\n \n '
return pulumi.get(self, 'ip_cidr_range') |
@property
@pulumi.getter(name='subnetworkRangeName')
def subnetwork_range_name(self) -> Optional[pulumi.Input[str]]:
'\n The name of a subnetwork secondary IP range from which to allocate an IP alias range. If not specified, the primary range of the subnetwork is used.\n '
return pulumi.get(self, ... | -5,519,317,913,827,085,000 | The name of a subnetwork secondary IP range from which to allocate an IP alias range. If not specified, the primary range of the subnetwork is used. | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | subnetwork_range_name | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter(name='subnetworkRangeName')
def subnetwork_range_name(self) -> Optional[pulumi.Input[str]]:
'\n \n '
return pulumi.get(self, 'subnetwork_range_name') |
def __init__(__self__, *, disk_size_gb: Optional[pulumi.Input[str]]=None, interface: Optional[pulumi.Input['AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDiskInterface']]=None):
"\n :param pulumi.Input[str] disk_size_gb: Specifies the size of the disk in base-2 GB.\n :param pulumi.... | 9,095,536,866,581,036,000 | :param pulumi.Input[str] disk_size_gb: Specifies the size of the disk in base-2 GB.
:param pulumi.Input['AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDiskInterface'] interface: Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. For perfor... | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | __init__ | AaronFriel/pulumi-google-native | python | def __init__(__self__, *, disk_size_gb: Optional[pulumi.Input[str]]=None, interface: Optional[pulumi.Input['AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDiskInterface']]=None):
"\n :param pulumi.Input[str] disk_size_gb: Specifies the size of the disk in base-2 GB.\n :param pulumi.... |
@property
@pulumi.getter(name='diskSizeGb')
def disk_size_gb(self) -> Optional[pulumi.Input[str]]:
'\n Specifies the size of the disk in base-2 GB.\n '
return pulumi.get(self, 'disk_size_gb') | -5,508,228,374,896,146,000 | Specifies the size of the disk in base-2 GB. | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | disk_size_gb | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter(name='diskSizeGb')
def disk_size_gb(self) -> Optional[pulumi.Input[str]]:
'\n \n '
return pulumi.get(self, 'disk_size_gb') |
@property
@pulumi.getter
def interface(self) -> Optional[pulumi.Input['AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDiskInterface']]:
'\n Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. For performance characteristics of SCS... | -8,973,237,185,586,475,000 | Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance. | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | interface | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter
def interface(self) -> Optional[pulumi.Input['AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDiskInterface']]:
'\n \n '
return pulumi.get(self, 'interface') |
def __init__(__self__, *, guest_accelerators: Optional[pulumi.Input[Sequence[pulumi.Input['AcceleratorConfigArgs']]]]=None, local_ssds: Optional[pulumi.Input[Sequence[pulumi.Input['AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDiskArgs']]]]=None, location_hint: Optional[pulumi.Input[str]]=None, mach... | 7,669,833,283,022,695,000 | Properties of the SKU instances being reserved. Next ID: 9
:param pulumi.Input[Sequence[pulumi.Input['AcceleratorConfigArgs']]] guest_accelerators: Specifies accelerator type and count.
:param pulumi.Input[Sequence[pulumi.Input['AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDiskArgs']]] local_ssds: ... | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | __init__ | AaronFriel/pulumi-google-native | python | def __init__(__self__, *, guest_accelerators: Optional[pulumi.Input[Sequence[pulumi.Input['AcceleratorConfigArgs']]]]=None, local_ssds: Optional[pulumi.Input[Sequence[pulumi.Input['AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDiskArgs']]]]=None, location_hint: Optional[pulumi.Input[str]]=None, mach... |
@property
@pulumi.getter(name='guestAccelerators')
def guest_accelerators(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['AcceleratorConfigArgs']]]]:
'\n Specifies accelerator type and count.\n '
return pulumi.get(self, 'guest_accelerators') | 404,136,063,061,147,700 | Specifies accelerator type and count. | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | guest_accelerators | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter(name='guestAccelerators')
def guest_accelerators(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['AcceleratorConfigArgs']]]]:
'\n \n '
return pulumi.get(self, 'guest_accelerators') |
@property
@pulumi.getter(name='localSsds')
def local_ssds(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDiskArgs']]]]:
'\n Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd.\n '
retur... | -8,683,957,141,601,295,000 | Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd. | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | local_ssds | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter(name='localSsds')
def local_ssds(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDiskArgs']]]]:
'\n \n '
return pulumi.get(self, 'local_ssds') |
@property
@pulumi.getter(name='locationHint')
def location_hint(self) -> Optional[pulumi.Input[str]]:
'\n An opaque location hint used to place the allocation close to other resources. This field is for use by internal tools that use the public API.\n '
return pulumi.get(self, 'location_hint') | 2,775,091,061,924,199,000 | An opaque location hint used to place the allocation close to other resources. This field is for use by internal tools that use the public API. | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | location_hint | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter(name='locationHint')
def location_hint(self) -> Optional[pulumi.Input[str]]:
'\n \n '
return pulumi.get(self, 'location_hint') |
@property
@pulumi.getter(name='machineType')
def machine_type(self) -> Optional[pulumi.Input[str]]:
'\n Specifies type of machine (name only) which has fixed number of vCPUs and fixed amount of memory. This also includes specifying custom machine type following custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern.... | -261,754,411,147,046,600 | Specifies type of machine (name only) which has fixed number of vCPUs and fixed amount of memory. This also includes specifying custom machine type following custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern. | sdk/python/pulumi_google_native/compute/alpha/_inputs.py | machine_type | AaronFriel/pulumi-google-native | python | @property
@pulumi.getter(name='machineType')
def machine_type(self) -> Optional[pulumi.Input[str]]:
'\n \n '
return pulumi.get(self, 'machine_type') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.