query stringlengths 10 2k | document stringlengths 20 51.2k | metadata dict | negatives listlengths 0 101 | negative_scores listlengths 0 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
Returns the compact records for all attachments on the task. | def find_by_task(self, task, params={}, **options):
path = "/tasks/%s/attachments" % (task)
return self.client.get_collection(path, params, **options) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_queryset(self, **kwargs):\n print(\"inside attachmentlistview for object %s\" % self.gfk_object)\n attachments = self.gfk_object.attachments.all()\n self.checker.prefetch_perms(attachments)\n return attachments",
"def attachments(self):\n return [Attachment(part) for pa... | [
"0.5632252",
"0.55883867",
"0.5525202",
"0.5488394",
"0.5463912",
"0.53595084",
"0.52364033",
"0.518364",
"0.51545906",
"0.5051283",
"0.5045633",
"0.501367",
"0.4967292",
"0.49381027",
"0.49259013",
"0.4923468",
"0.49119914",
"0.48875046",
"0.48870787",
"0.4859254",
"0.482298... | 0.52603304 | 6 |
Initialize the audio recorder. | def __init__(
self,
channels: int = 1,
chunk_size: int = 1024,
framerate: int = 44100):
self.audio_interface = pyaudio.PyAudio()
self.do_record: bool = False
self.channels: int = channels
self.chunk_size: int = chunk_size
self.frame... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initAudio(self):\n\t\t# Initialize pitch detection\n\t\tself.listener = PitchDetect(channels=1)\n\t\tself.listener.listen()\n\t\tself.recording = False\n\t\tself.paused = False",
"def init_recording(self):\n self.statusBar().showMessage('Initialising...')\n self.streams = resolve_stream('type',... | [
"0.7969136",
"0.77465457",
"0.694623",
"0.65840256",
"0.65149903",
"0.6455523",
"0.64353704",
"0.6416108",
"0.6362843",
"0.62887937",
"0.62634784",
"0.62535757",
"0.61542404",
"0.6131643",
"0.611427",
"0.6105745",
"0.60926855",
"0.6090424",
"0.6056593",
"0.605459",
"0.6046958... | 0.597156 | 25 |
Returns the current model version that is being used. | def get_model_version():
d = {}
file = MODEL_PATH + "/model_version.txt"
with open(file) as f:
for line in f:
(key, value) = line.split(",")
d[key] = value
return d["model version"] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_version():\n global __model\n return __model.__version__",
"def model_version(self) -> str:\n return pulumi.get(self, \"model_version\")",
"def version(self):\n return self.get_current_version()",
"def get_version(self):\n return self.version",
"def get_current_version(se... | [
"0.8860181",
"0.8713543",
"0.8404392",
"0.81729317",
"0.8051358",
"0.8019811",
"0.8019811",
"0.7990323",
"0.79573834",
"0.7953396",
"0.7953396",
"0.7931517",
"0.7908191",
"0.7901453",
"0.7853436",
"0.7806518",
"0.7801677",
"0.7731159",
"0.7730727",
"0.7723906",
"0.76860297",
... | 0.0 | -1 |
distance entre (x,y) a (x2,y2) | def DISTANCE(x,y,x2=0,y2=0):
return sqrt((x-x2)*(x-x2)+(y-y2)*(y-y2)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def distance(x1, y1, x2, y2):\n return ((x2 - x1) ** 2 + (y2 - y1) ** 2) ** 0.5",
"def get_distance(x1, y1, x2, y2):\n return math.sqrt((x1 - x2) ** 2 + (y1 * 2.38 - y2 * 2.38) ** 2)",
"def distance(p1,p2):\n return ((p1.x - p2.x)**2 + (p1.y - p2.y)**2)**0.5",
"def distance(x1, y1, x2, y2):\n dis... | [
"0.8578777",
"0.84616524",
"0.82376426",
"0.82217366",
"0.8189253",
"0.81299496",
"0.81079173",
"0.8066122",
"0.8065951",
"0.80604225",
"0.8053258",
"0.8040548",
"0.8040402",
"0.8016909",
"0.7973561",
"0.7930424",
"0.7913016",
"0.7862245",
"0.7812645",
"0.78024817",
"0.779811... | 0.7843424 | 18 |
Return all Conv2D ops that were in the graph when `self` was created. | def all_conv_ops(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def channels(self) -> Tuple[chans.Channel]:\n return self.operands",
"def __init__(self):\n self._conv_to_gamma = collections.defaultdict(set)\n for op in tf.get_default_graph().get_operations():\n if op.type != 'FusedBatchNorm':\n continue\n\n convs = _dfs(op)\n for conv in co... | [
"0.60008216",
"0.58251077",
"0.57010907",
"0.56970924",
"0.5687658",
"0.568355",
"0.56683254",
"0.56332326",
"0.56086457",
"0.55784947",
"0.5539517",
"0.55273575",
"0.5525051",
"0.5524235",
"0.55027443",
"0.54982394",
"0.5480031",
"0.5464814",
"0.5461911",
"0.5459056",
"0.544... | 0.6908821 | 0 |
Fetches a variable by name (like tf.get_variable with reuse=True). The reason why we can't simply use tf.get_variable with reuse=True is that when variable partitioner is used, tf.get_variable requires knowing the shape of the variable (even though it knows it and thus shouldn't require it). This helper is a convenienc... | def _get_existing_variable(name):
try:
op = tf.get_default_graph().get_operation_by_name(name)
except KeyError:
return None
# Among all cases (partitioned variable, resource variable, or regular one),
# we assume that there's either a shape attribute to the op or to its output.
try:
shape = tf.Te... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_variable(self, variable_name):\n with self._graph.as_default():\n return self._sess.run(self._get_tensor_by_name(variable_name))",
"def get_variable_by_name(var_name):\n global_vars = ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)\n\n def _filter_fn(item):\n try:\n return var_name =... | [
"0.7706543",
"0.7443449",
"0.7327384",
"0.72280097",
"0.71235067",
"0.70656633",
"0.7012553",
"0.6829421",
"0.6721947",
"0.6650945",
"0.6632645",
"0.6583236",
"0.6567573",
"0.6567573",
"0.6556751",
"0.65530396",
"0.65377516",
"0.65162945",
"0.65149677",
"0.6389653",
"0.638830... | 0.79840314 | 0 |
This special view just renders a custom 404 page. We do this so that the 404 page fits nicely into our global layout. | def notfound(request):
return {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def custom_404(request, exception=None):\n return render(request, \"404.html\", {\"exception\": exception})",
"def page_not_found(e):\n return render_template(\"404.html\", page_title=404)",
"def error_404(self):\n response = self.render_template('404.html')\n response.status_code = 404\n ... | [
"0.8473042",
"0.8469589",
"0.83740014",
"0.83566475",
"0.83566475",
"0.83454525",
"0.83418304",
"0.8315424",
"0.82897997",
"0.8258756",
"0.8247422",
"0.81765383",
"0.81449676",
"0.8089407",
"0.8078276",
"0.80388564",
"0.80335736",
"0.80214727",
"0.79859",
"0.7979914",
"0.7967... | 0.0 | -1 |
Unload a config entry. | async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
if unload_ok := await hass.config_entries.async_unload_platforms(
config_entry, PLATFORMS
):
del hass.data[DOMAIN][config_entry.unique_id]
if not hass.data[DOMAIN]:
async_unload_services(hass)
r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def async_unload_entry(hass, config_entry):\n unload_ok = await hass.config_entries.async_forward_entry_unload(\n config_entry, \"climate\"\n )\n return unload_ok",
"async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:\n hass.data.pop(DOMAIN)\n return True",
... | [
"0.697284",
"0.6888074",
"0.6779855",
"0.6747459",
"0.6689002",
"0.6657831",
"0.66162205",
"0.6603433",
"0.65925974",
"0.65595686",
"0.65411645",
"0.6507643",
"0.6507643",
"0.6507643",
"0.6507643",
"0.64977276",
"0.64931643",
"0.6486601",
"0.6486601",
"0.6486601",
"0.6486601"... | 0.61827 | 58 |
A method to initialize the weight matrices of the neural network | def create_weight_matrices(self):
rad = 1 / np.sqrt(self.no_of_in_nodes)
X = truncated_normal(mean=0,
sd=1,
low=-rad,
upp=rad)
self.wih = X.rvs((self.no_of_hidden_nodes,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _initialize_weights(self):\n pass",
"def __initialize_weights__(num_neurons: int) -> np.ndarray:\n\n weights = np.zeros((num_neurons, num_neurons))\n\n return weights",
"def __init__(self, layerNeurons, numberOfLayers, initialWeights = None, lowerBound = None, upperBound = None):\r\n ... | [
"0.79101557",
"0.7823027",
"0.7680514",
"0.7647122",
"0.7619412",
"0.7514427",
"0.7486472",
"0.7483291",
"0.747333",
"0.7439607",
"0.7434485",
"0.7415247",
"0.7415247",
"0.7415247",
"0.7405477",
"0.73851675",
"0.7381978",
"0.732718",
"0.7326214",
"0.72958493",
"0.7277155",
... | 0.76108575 | 5 |
Return all models for this package | def models(self):
return self.config.models() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_models(self):\n self.load()\n return self._models",
"def models(self):\n return self._base.classes",
"def models(self):\n models = []\n for bundle in self.bundles.values():\n models.extend(list(bundle.models.values()))\n\n return models",
"def mode... | [
"0.8120881",
"0.7775702",
"0.75307536",
"0.7503053",
"0.7502738",
"0.7487087",
"0.74715954",
"0.74590635",
"0.74221176",
"0.7374514",
"0.7355504",
"0.7201942",
"0.71983826",
"0.7136512",
"0.7134999",
"0.71347255",
"0.71347255",
"0.71338195",
"0.71240234",
"0.7076645",
"0.7008... | 0.80048996 | 1 |
Provides an Elastic Transcoder pipeline resource. | def __init__(__self__, resource_name, opts=None, aws_kms_key_arn=None, content_config=None, content_config_permissions=None, input_bucket=None, name=None, notifications=None, output_bucket=None, role=None, thumbnail_config=None, thumbnail_config_permissions=None, __props__=None, __name__=None, __opts__=None):
i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pipeline(self) -> Pipeline:\n if self._to_pipeline is None:\n raise AttributeError(\n \"pipeline not available because `to_pipeline` was not set on __init__.\"\n )\n return self._to_pipeline(self)",
"def _create_pipeline(self) -> codepipeline.Pipeline:\n ... | [
"0.626101",
"0.6219813",
"0.61951226",
"0.6080427",
"0.59189564",
"0.5891496",
"0.58826566",
"0.58826566",
"0.5776212",
"0.57197475",
"0.5704538",
"0.56580055",
"0.56465614",
"0.5646217",
"0.5617565",
"0.56156844",
"0.55874455",
"0.55465984",
"0.55416036",
"0.55069274",
"0.54... | 0.5477407 | 23 |
Get an existing Pipeline resource's state with the given name, id, and optional extra properties used to qualify the lookup. | def get(resource_name, id, opts=None, arn=None, aws_kms_key_arn=None, content_config=None, content_config_permissions=None, input_bucket=None, name=None, notifications=None, output_bucket=None, role=None, thumbnail_config=None, thumbnail_config_permissions=None):
opts = pulumi.ResourceOptions.merge(opts, pulumi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(resource_name, id, opts=None, arn=None, artifact_store=None, name=None, role_arn=None, stages=None, tags=None):\n opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))\n\n __props__ = dict()\n __props__[\"arn\"] = arn\n __props__[\"artifact_store\"] = artifact... | [
"0.65629584",
"0.6305222",
"0.6137626",
"0.55851334",
"0.558452",
"0.5573303",
"0.5518145",
"0.5510742",
"0.5496675",
"0.54952633",
"0.54903036",
"0.5455046",
"0.54531443",
"0.54273576",
"0.53915834",
"0.5355077",
"0.53269154",
"0.5323903",
"0.53054225",
"0.52698195",
"0.5265... | 0.5629204 | 3 |
Batches generator for keras fit_generator. Returns batches of patches 40x40px | def chunks(X, y, batch_size=32, augmentation_times=4, thickness=0,
data_generator=ImageDataGenerator(dim_ordering="th"), is_training=True):
while 1:
prct_pop, prct1 = 0.2, 0.2 # (1) of all the training set, how much we keep (2) % of 1's
idx_1 = [i for i in range(len(y)) if y[i] == 1]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def patchGenerator(gen, patch_size=128, patch_batch_size=1):\n \n for imgs, masks in gen: # For each batch\n img_list = []\n mask_list = []\n for i in range(0, imgs.shape[0]): # For each image in a batch\n patch_x = patchify(imgs[i], (patch_size, patch_size, imgs[i].shape[-1])... | [
"0.75850147",
"0.68815976",
"0.68326396",
"0.6755585",
"0.6644264",
"0.6620349",
"0.6575366",
"0.6522162",
"0.651144",
"0.64903986",
"0.64785254",
"0.6468773",
"0.6439617",
"0.641493",
"0.6412302",
"0.6401784",
"0.6395237",
"0.6349848",
"0.63443595",
"0.6343094",
"0.6311528",... | 0.59383214 | 84 |
Initialize the vizual API instance. Either expects an API instance or a dictionary from which an instance can be loaded. The second option is only attempted if the given api is None. | def __init__(self, api=None, properties=None):
if not api is None:
self.api = api | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, api):\n self.api = api\n self.data = None",
"def __init__(self, api_use=False):\n self.api_use = api_use",
"def __init__(self, **kwargs):\n\n session = vk_api.VkApi(**kwargs)\n try:\n session.auth(token_only=True)\n except vk_api.AuthError... | [
"0.704837",
"0.69297767",
"0.66669494",
"0.66658497",
"0.66658497",
"0.65633357",
"0.6538071",
"0.6495853",
"0.6428577",
"0.6426494",
"0.637943",
"0.63387316",
"0.631297",
"0.62820774",
"0.6267703",
"0.62651426",
"0.62651426",
"0.62174606",
"0.61411256",
"0.61384624",
"0.6131... | 0.70418453 | 1 |
Recall metric. Only computes a batchwise average of recall. Computes the recall, a metric for multilabel classification of how many relevant items are selected. | def recall(y_true, y_pred):
true_positives = K.sum(K.round(K.clip(y_true * y_pred, 0, 1)))
possible_positives = K.sum(K.round(K.clip(y_true, 0, 1)))
recall = true_positives / (possible_positives + K.epsilon())
return recall | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def recall(y_true, y_pred, average, labels):\n\n y_true, y_pred = check_metric_args(y_true, y_pred, average, labels)\n\n result = None\n\n m = len(y_true)\n n = len(labels)\n\n confusion_matrix = get_confusion_matrix(y_true, y_pred, labels).T\n\n if average == \"micro\":\n numerator = np.t... | [
"0.76047015",
"0.74474794",
"0.74041575",
"0.7280166",
"0.7208148",
"0.716517",
"0.7156958",
"0.7144544",
"0.7144544",
"0.7144544",
"0.7144544",
"0.7144544",
"0.7144544",
"0.7131029",
"0.710041",
"0.7065585",
"0.7064068",
"0.7062088",
"0.7062088",
"0.7062088",
"0.7062088",
... | 0.7096404 | 29 |
Precision metric. Only computes a batchwise average of precision. Computes the precision, a metric for multilabel classification of how many selected items are relevant. | def precision(y_true, y_pred):
true_positives = K.sum(K.round(K.clip(y_true * y_pred, 0, 1)))
predicted_positives = K.sum(K.round(K.clip(y_pred, 0, 1)))
precision = true_positives / (predicted_positives + K.epsilon())
return precision | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def precision(self):\n self.overall_precision = precision_score(\n self.y_true, self.y_pred, average = self.average_type).round(self.digits_count_fp)\n self.classes_precision = precision_score(\n self.y_true, self.y_pred, average = None).round(self.digits_count_fp)",
"def comp... | [
"0.74906194",
"0.7289004",
"0.7160026",
"0.7153636",
"0.70664865",
"0.69872606",
"0.696703",
"0.6955486",
"0.6913438",
"0.683529",
"0.68184656",
"0.6810287",
"0.68057126",
"0.68057126",
"0.68057126",
"0.68057126",
"0.68057126",
"0.68057126",
"0.67864585",
"0.6758343",
"0.6758... | 0.675569 | 42 |
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`. | def plot_confusion_matrix(cm, classes=None, normalize=False,
title='Confusion matrix', cmap=plt.cm.Blues):
if normalize:
cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]
print("Normalized confusion matrix")
else:
print('Confusion matrix, without normaliza... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n... | [
"0.8194862",
"0.80949175",
"0.8029915",
"0.8019153",
"0.79941195",
"0.7991258",
"0.7980955",
"0.7976606",
"0.79610753",
"0.79590565",
"0.79378676",
"0.7934962",
"0.7934504",
"0.79313844",
"0.7926313",
"0.7924577",
"0.79241234",
"0.7923211",
"0.7923023",
"0.7921931",
"0.791787... | 0.7822435 | 83 |
Create a dataset given the option. This function wraps the class CustomDatasetDataLoader. This is the main interface between this package and 'train.py'/'test.py' | def create_dataset(opt):
data_loader = CustomDatasetDataLoader(opt)
dataset = data_loader.load_data()
return dataset | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_dataset(opt):\n data_loader = CustomDatasetDataLoader(opt)\n dataset = data_loader.load_data()\n return dataset",
"def dataset(options):\n pass",
"def create_dataset(dataset_type, soruce, opts): \n\n p = PreProcessor(dataset_type, opts)\n\n # If we are NOT running \"implementation.... | [
"0.86547446",
"0.73279417",
"0.7206806",
"0.7136899",
"0.7091097",
"0.7000412",
"0.69710624",
"0.6920948",
"0.6885193",
"0.6882524",
"0.6872056",
"0.68634677",
"0.68610644",
"0.6838574",
"0.68384725",
"0.68295753",
"0.68007475",
"0.6762982",
"0.67489755",
"0.6738657",
"0.6731... | 0.861957 | 1 |
Return the number of data in the dataset | def __len__(self):
return min(len(self.dataset), self.opt.max_dataset_size) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def data_count(self):\n return(len(self.data))",
"def count_data(self):\n try:\n ndata = len(self.x)\n logger.info(\"Number of data points: {0}\".format(ndata))\n except AttributeError:\n logger.error(\"Data object has not been defined\")\n ndata =... | [
"0.85221523",
"0.8378141",
"0.82205755",
"0.8141319",
"0.8054871",
"0.79933023",
"0.7989313",
"0.7789385",
"0.76775163",
"0.76177317",
"0.76037794",
"0.75928235",
"0.7564491",
"0.7530984",
"0.7469992",
"0.74464196",
"0.7399506",
"0.7392637",
"0.73787904",
"0.73774236",
"0.736... | 0.6896656 | 79 |
Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix inorder arguments and keyword arguments. | def __init__(self, *args, **kwds):
if args or kwds:
super(Rscanpose, self).__init__(*args, **kwds)
#message fields cannot be None, assign default values for those that are
if self.Rscanpose is None:
self.Rscanpose = [0.] * 645
else:
self.Rscanpose = [0.] * 645 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, *args, **kwds):\n if args or kwds:\n super(KomodoSpeechRecCommand, self).__init__(*args, **kwds)\n #message fields cannot be None, assign default values for those that are\n if self.header is None:\n self.header = std_msgs.msg.Header()\n if self.cmd is None:\n ... | [
"0.77936935",
"0.77195734",
"0.77195734",
"0.76861507",
"0.76260346",
"0.7563092",
"0.7439089",
"0.74163747",
"0.73512906",
"0.73076564",
"0.72798854",
"0.72372425",
"0.7226609",
"0.7223668",
"0.7223668",
"0.7218618",
"0.7210883",
"0.7210883",
"0.7210883",
"0.7210883",
"0.721... | 0.0 | -1 |
Parses a single tf.Example into image and label tensors. | def single_example_parser(serialized_example):
# Dimensions of the images in the CIFAR-10 dataset.
# See http://www.cs.toronto.edu/~kriz/cifar.html for a description of the
# input format.
features = tf.parse_single_example(
serialized_example,
features={
'image': tf.FixedLen... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _parse_tfexample(example):\n\n ## parse\n features = tf.parse_single_example(example, KEYS2FEATURES)\n\n image = tf.image.decode_png(features['image/encoded'])\n label = tf.image.decode_png(features['label/encoded'])\n # label is decoded as a 3-D png image\n label = label[..., 0]\n im_path = features['i... | [
"0.83829236",
"0.8046354",
"0.80220467",
"0.792347",
"0.78906894",
"0.7831778",
"0.77363175",
"0.76417243",
"0.7498123",
"0.7488421",
"0.74800056",
"0.7437563",
"0.7437213",
"0.7389777",
"0.73031527",
"0.7254027",
"0.7237167",
"0.7227293",
"0.7180672",
"0.7136457",
"0.7120209... | 0.8229335 | 1 |
make empty boggle grid | def make_grid(width, height):
return {(row, col): choice(ascii_uppercase)
for row in range (height) # remove ' ' and add choice()
for col in range(width)} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def empty_board():\n return [['','',''],\n ['','',''],\n ['','','']]",
"def emptyGrid(self, gameGrid=None, emptyValue=0):\n if not gameGrid:\n gameGrid = self.gameGrid\n for r, c in gameGrid:\n self.emptyCell(r, c, gameGrid=gameGrid, emptyV... | [
"0.6874487",
"0.67928714",
"0.6782125",
"0.67666495",
"0.6757196",
"0.673991",
"0.6732009",
"0.6715818",
"0.67102534",
"0.6696798",
"0.66834736",
"0.66779596",
"0.6673599",
"0.6665801",
"0.66280323",
"0.66040796",
"0.6552258",
"0.65505785",
"0.65319175",
"0.6530315",
"0.65237... | 0.0 | -1 |
Returns the environment variables that the command exports to shell. | def _get_environ(args=None):
if args is not None:
if not isinstance(args, list):
args = [args]
args += ['>', 'nul', '&&']
args += ['set']
popen = subprocess.Popen(args, shell=True, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_env(self):\n env = {}\n for k, v in os.environ.items():\n k = k.decode() if isinstance(k, bytes) else k\n v = v.decode() if isinstance(v, bytes) else v\n env[k] = v\n return list(env.items())",
"def show_env():\n envs = [\"PATH\", \"ORACLE_HOME\",... | [
"0.76085585",
"0.74995005",
"0.7212889",
"0.71174705",
"0.7094753",
"0.70785105",
"0.7041463",
"0.6980493",
"0.6939119",
"0.6925751",
"0.6904933",
"0.6883877",
"0.68133074",
"0.6768039",
"0.6748998",
"0.67447126",
"0.6741414",
"0.67398554",
"0.6677551",
"0.6653996",
"0.665326... | 0.66250956 | 22 |
Add two integer strings of same length without carry >>> add_wo_carry('9876', '5432') '0008' | def add_wo_carry(n1, n2):
l1 = [int(x) for x in str(n1)]
l2 = [int(x) for x in str(n2)]
res1 = map(operator.add, l1, l2)
res2 = [str(x)[-1] for x in res1]
return "".join(res2) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_str_binary(num_one, num_two):\n\n max_len = max(len(num_one), len(num_two))\n v_num_one = list(map(int, list(num_one.zfill(max_len))))\n v_num_two = list(map(int, list(num_two.zfill(max_len))))\n sum_bits = [None] * max_len\n carry = 0\n\n for r_idx in reversed(range(max_len)):\n r... | [
"0.738321",
"0.73441905",
"0.72760355",
"0.71834505",
"0.70681775",
"0.7062339",
"0.7016835",
"0.6959322",
"0.68051505",
"0.67834264",
"0.6699625",
"0.66355956",
"0.6570719",
"0.6534934",
"0.65145355",
"0.6485566",
"0.64543813",
"0.6364307",
"0.6349641",
"0.6289134",
"0.62795... | 0.788304 | 0 |
Substract two integer strings of same length without carry >>> sub_wo_carry('9007', '1234') '8873' | def sub_wo_carry(n1, n2):
l1 = [int(x)+10 for x in str(n1)]
l2 = [int(x) for x in str(n2)]
res1 = map(operator.sub, l1, l2)
res2 = [str(x)[-1] for x in res1]
return "".join(res2) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def substraction_nocarry(a,b): #Beware, it is not commuative\n result = bytearray()\n carry = 0\n for byte1, byte2 in zip(a,b):\n byte_res = (byte1-byte2-carry)\n #print(byte_res)\n if byte_res < 0:\n carry = 1\n result.append(byte_res%256)\n else:\n ... | [
"0.6733123",
"0.64523053",
"0.63948476",
"0.6362099",
"0.62545234",
"0.6232102",
"0.6148664",
"0.6140974",
"0.6140974",
"0.6140974",
"0.6094881",
"0.6085639",
"0.60787594",
"0.6003238",
"0.6003238",
"0.5995954",
"0.5995954",
"0.5995954",
"0.5990235",
"0.59888077",
"0.59712374... | 0.7895557 | 0 |
Compares two comparable numeric quantities to see if they are within tolerable limits or not (0.1% of correct answer). Returns True or False | def compare_quantities(m_magn, m_unit, a_magn, a_unit):
global ureg
try:
if m_unit == "":
solutionComparableValue = m_magn;
return abs((solutionComparableValue - a_magn) / solutionComparableValue) <= 0.0001 # corrected after DemoProblem error
else:
# solution... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def arecloseenough(x1, x2):\n\n if abs(x1 - x2) <= VERYSMALL:\n return True\n \n return False",
"def almost_equal_values(x, y, precision):\n return round(x - y, precision) == 0",
"def isGE(self, a : float, b : float) -> bool:\n return (a >= b - self.tol * max(abs(a), abs(b), 1.0)) #and (a >... | [
"0.7460852",
"0.7255448",
"0.7163253",
"0.71208143",
"0.71011686",
"0.69799984",
"0.69520193",
"0.69399184",
"0.691082",
"0.69083834",
"0.6908233",
"0.68960756",
"0.6864178",
"0.68553567",
"0.6822016",
"0.6818452",
"0.6815394",
"0.68087286",
"0.68070555",
"0.6800536",
"0.6800... | 0.63796777 | 54 |
Return true if the queue is on. | def is_on(self):
return self._data["enabled"] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def active(self):\n return len(self.queue) > 0",
"def any(self) -> bool:\n return len(self.queue) > 0",
"def is_queued(self):\n qstat = self._grep_qstat('queued')\n if qstat:\n return True\n return False",
"def in_queue(self):\n if self.get_db('jobid') is None:\n ... | [
"0.80942106",
"0.7644684",
"0.7554481",
"0.7320227",
"0.7318586",
"0.7317834",
"0.7231066",
"0.71622443",
"0.70926577",
"0.7089679",
"0.70846164",
"0.70846164",
"0.70846164",
"0.7056037",
"0.70450974",
"0.7022867",
"0.6987548",
"0.6979007",
"0.6972467",
"0.6970045",
"0.697004... | 0.0 | -1 |
Return the port state attributes. | def device_state_attributes(self):
attributes = self._attrs
for variable in self._sid_data["sid_attr"]:
if variable in self._data:
attributes[format_attribute(variable)] = self._data[variable]
return attributes | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extra_state_attributes(self):\n return self._poe_data.ports[self._port]",
"def state(self):\n return {\n 'port' : self.self.__port.port, #port name/number as set by the user\n 'baudrate' : self.self.__port.baudrate, #current baudrate setting\n 'bytesiz... | [
"0.8186696",
"0.79095244",
"0.7908586",
"0.7832808",
"0.7832808",
"0.7816633",
"0.7804596",
"0.77929586",
"0.77929586",
"0.7736866",
"0.7708524",
"0.7708524",
"0.7708524",
"0.7708524",
"0.7708524",
"0.7708524",
"0.7708524",
"0.7708524",
"0.7708524",
"0.7708524",
"0.7708524",
... | 0.7354149 | 35 |
COMPLETE THIS FUNCTION (PART 1) Given a sequence, this function should return a list of ngrams, where each ngram is a Python tuple. This should work for arbitrary values of 1 <= n < len(sequence). | def get_ngrams(sequence, n):
# Example: n = 3, length = 4
# we want 0:3, 1:4
result = []
if n == 1:
result.append(tuple(["START"]))
result.append(tuple(["STOP"]))
if n == 3 and len(sequence) == 1:
result.append(tuple(["START","START",sequence[0]]))
result.append(tup... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_ngrams(sequence, n):\n length = len(sequence)\n #if only require 1-gram, then we need to add one START and one END to the sequence. \n if n==1 or n==2:\n sequence=[\"START\"]*n+sequence+[\"STOP\"]\n end = n+1 #end i means that when n==1, we need to read one more data, that is to the... | [
"0.8763529",
"0.85098594",
"0.8387284",
"0.8298498",
"0.8086003",
"0.79911363",
"0.78336895",
"0.7663164",
"0.7625829",
"0.7546381",
"0.7535764",
"0.7534203",
"0.75049025",
"0.7498775",
"0.7474024",
"0.7469835",
"0.7446558",
"0.7443803",
"0.74133855",
"0.7399401",
"0.73655355... | 0.8256341 | 4 |
COMPLETE THIS METHOD (PART 3) Returns the raw (unsmoothed) trigram probability | def raw_trigram_probability(self, trigram):
num = self.trigramcounts[trigram]
den = self.bigramcounts[trigram[:-1]]
# ??? why would there be a case where trigram has length 2 ???
if len(trigram) == 2:
print(trigram)
return self.raw_bigram_probability(trigram)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def smoothed_trigram_probability(self, trigram):\n lambda1 = 1/3.0\n lambda2 = 1/3.0\n lambda3 = 1/3.0\n p_uni = self.raw_unigram_probability((trigram[2],))\n p_bi = self.raw_bigram_probability((trigram[1],trigram[2],))\n p_tir = self.raw_trigram_probability(trigram)\n ... | [
"0.7756939",
"0.77344036",
"0.76416236",
"0.74117917",
"0.7331346",
"0.73155785",
"0.7222813",
"0.71737164",
"0.71000147",
"0.7094879",
"0.691427",
"0.6834663",
"0.67442095",
"0.6739439",
"0.6738607",
"0.6699013",
"0.6678823",
"0.6635451",
"0.66307485",
"0.66089636",
"0.66001... | 0.73499596 | 4 |
return the config filename | def configFilename(self):
return self.name()+'.py' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getConfigFileName(self):\n return self._configFileName",
"def filename():\n\tglobal _cfgfn\n\treturn _cfgfn",
"def config_file_name(self):\n return self._config_file_name",
"def get_config_file_name(self):\n argv = sys.argv\n config_type = \"dev\" # default configuration type\... | [
"0.83283734",
"0.82707685",
"0.8267743",
"0.82336384",
"0.81004906",
"0.7963827",
"0.78473616",
"0.77613986",
"0.7551578",
"0.75452465",
"0.7498181",
"0.745226",
"0.74485326",
"0.7446891",
"0.7392078",
"0.7389087",
"0.7388546",
"0.7279395",
"0.72120994",
"0.72119015",
"0.7201... | 0.85215724 | 0 |
Initialize 2layer network. Weight matrices are initialized randomly. Biases are zero vectors. | def __init__(self, input_size, hidden_size, output_size, weight_init_std=0.01):
self.params = {}
self.params['W1'] = weight_init_std * \
np.random.randn(input_size, hidden_size)
self.params['b1'] = np.zeros(hidden_size)
self.params['W2'] = weight_init_std * \
np.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_weights(self, load_weights=None):\n if load_weights:\n # TODO\n pass\n else:\n # x: lower layer nodes n\n # y: current layer nodes n\n x = self.weights_shape[1]\n y = self.weights_shape[0]\n self.weights = np.random.randn(y, x) / np.sqrt(x) # pylint: disable=no-mem... | [
"0.75092906",
"0.73077995",
"0.72071165",
"0.7204983",
"0.7148916",
"0.71056473",
"0.7079986",
"0.7031666",
"0.70306444",
"0.6973227",
"0.6963526",
"0.69350827",
"0.69296825",
"0.69054693",
"0.68843025",
"0.68821084",
"0.68821084",
"0.68821084",
"0.6861307",
"0.6726525",
"0.6... | 0.0 | -1 |
Opens a new database connection if there is none yet for the current application context. | def get_db():
if not hasattr(g, 'sqlite_db'):
g.sqlite_db = connect_db()
return g.sqlite_db | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def db_open():\n if not hasattr(g, 'sqlite_db'):\n g.sqlite_db = db_connect()\n return g.sqlite_db",
"def open_database(self):\n if self._conn is None:\n self._conn = sqlite3.connect(self._db_path)",
"def open_db(db_name: str = DB_NAME) -> DBConnection:\n return sqlite3.connec... | [
"0.7737639",
"0.7582971",
"0.73180443",
"0.71693045",
"0.70220166",
"0.6966687",
"0.6954785",
"0.69486743",
"0.6897534",
"0.6842663",
"0.68292314",
"0.68191963",
"0.680592",
"0.67950195",
"0.67697805",
"0.6762173",
"0.6751266",
"0.6746273",
"0.67316663",
"0.670031",
"0.668866... | 0.640242 | 74 |
Checks if the currently logged in user is the administrator. | def isAdmin():
if 'username' in session and session['username'] == 'admin':
return True
else:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_admin(self):\n if not self.current_user:\n return False\n else:\n return self.current_user in [\"1\"]",
"def is_admin_user(self):\n if \"is_admin\" in self._properties and self.is_admin == 'YES':\n return True\n return False",
"def is_admin(us... | [
"0.86273277",
"0.841409",
"0.83798116",
"0.8318721",
"0.82656795",
"0.82064736",
"0.8204422",
"0.81897783",
"0.8162296",
"0.81430477",
"0.8127073",
"0.80692375",
"0.80692375",
"0.7976512",
"0.7941674",
"0.79382646",
"0.7923693",
"0.790627",
"0.78834516",
"0.7822475",
"0.78079... | 0.8058512 | 13 |
takes a list of np arrays of different lengths where other dimensions are of same size, returns padded np array w/ shape (n_items, max_sequence_length, ) + (n_dimensions,) pads evenly on start and end w/ greater pads on end if not %2 | def list_to_padded_array(x_list, pad_type='edge', dt='float32'):
n_items = len(x_list)
max_sequence_length = max(map(lambda x: x.shape[0], x_list))
other_dims = x_list[0].shape[1:]
X = np.zeros((n_items, max_sequence_length) + other_dims, dt)
for i, x in enumerate(x_list):
pad_start = (max_s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pad_sequences(sequences):\n max_len = max(s.shape[0] for s in sequences)\n padded = []\n for seq in sequences:\n zero_pad = np.concatenate(\n [seq, np.zeros((max_len - seq.shape[0], ) + seq.shape[1:])])\n padded.append(zero_pad[np.newaxis, :])\n\n return np.concatenate(padd... | [
"0.7648255",
"0.72513604",
"0.7160173",
"0.7104164",
"0.70251584",
"0.69889945",
"0.69644034",
"0.6961522",
"0.6952945",
"0.6940661",
"0.69116616",
"0.69115156",
"0.6900491",
"0.68814635",
"0.6854474",
"0.67933303",
"0.67689484",
"0.6767432",
"0.67457503",
"0.6737443",
"0.673... | 0.7213359 | 2 |
Initializing attributes of the class Users. | def __init__(
self,
first_name,
last_name,
username,
age,
location):
self.first_name = first_name
self.last_name = last_name
self.username = username
self.age = age
self.location = location
self.login... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\r\n self.__type = ALL_USERS\r\n self.__user = None",
"def __init__(self, users: List[str]=None, public: bool=None): # noqa: E501\n self.swagger_types = {\n 'users': List[str],\n 'public': bool\n }\n\n self.attribute_map = {\n ... | [
"0.6936763",
"0.6777871",
"0.6712647",
"0.67002547",
"0.65750587",
"0.6560765",
"0.64976335",
"0.6433575",
"0.642979",
"0.64200366",
"0.6419934",
"0.6378849",
"0.63592553",
"0.6348923",
"0.6329101",
"0.63264585",
"0.63236374",
"0.6315715",
"0.6308108",
"0.62455976",
"0.623937... | 0.60661155 | 38 |
cast(itkLightObject obj) > itkLabelShapeOpeningImageFilterIUC2 | def cast(*args):
return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUC2_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkLabelShapeOpeningImageFilterIUC2_cast(*args):\n return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUC2_cast(*args)",
"def itkLabelShapeOpeningImageFilterIUL2_cast(*args):\n return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUL2_cast(*args)",
"def i... | [
"0.8085982",
"0.79233956",
"0.7915338",
"0.78901803",
"0.78609645",
"0.7858094",
"0.7706184",
"0.7705733",
"0.7705527",
"0.7697832",
"0.7669698",
"0.76657593",
"0.76649",
"0.76632285",
"0.7658371",
"0.7654769",
"0.7640764",
"0.7640531",
"0.76203465",
"0.7596636",
"0.75846297"... | 0.77181613 | 6 |
New() > itkLabelShapeOpeningImageFilterIUC2 Create a new object of the class itkLabelShapeOpeningImageFilterIUC2 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named para... | def New(*args, **kargs):
obj = itkLabelShapeOpeningImageFilterIUC2.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkLabelShapeOpeningImageFilterIUL2.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkLabelShapeOpeningImageFilterIUS2.__New_orig__()\n import itkTemplate\n ... | [
"0.7852894",
"0.7628601",
"0.74670064",
"0.7380148",
"0.7335118",
"0.7327023",
"0.7306951",
"0.7301522",
"0.72992057",
"0.72827893",
"0.72700286",
"0.7247629",
"0.72205573",
"0.7217248",
"0.7213627",
"0.721344",
"0.72126853",
"0.7207099",
"0.7206555",
"0.7194717",
"0.7168512"... | 0.8175631 | 0 |
itkLabelShapeOpeningImageFilterIUC2_cast(itkLightObject obj) > itkLabelShapeOpeningImageFilterIUC2 | def itkLabelShapeOpeningImageFilterIUC2_cast(*args):
return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUC2_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkLabelStatisticsImageFilterIF2IUC2_cast(obj: 'itkLightObject') -> \"itkLabelStatisticsImageFilterIF2IUC2 *\":\n return _itkLabelStatisticsImageFilterPython.itkLabelStatisticsImageFilterIF2IUC2_cast(obj)",
"def itkLabelStatisticsImageFilterIUC2IUC2_cast(obj: 'itkLightObject') -> \"itkLabelStatisticsImage... | [
"0.8314873",
"0.8312219",
"0.82890284",
"0.8148178",
"0.8117329",
"0.81110466",
"0.81009364",
"0.80737984",
"0.8047413",
"0.80406207",
"0.7976132",
"0.7951859",
"0.79404116",
"0.7932154",
"0.79199076",
"0.79181635",
"0.7915808",
"0.79149115",
"0.7912903",
"0.790627",
"0.78931... | 0.8553355 | 0 |
cast(itkLightObject obj) > itkLabelShapeOpeningImageFilterIUC3 | def cast(*args):
return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUC3_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkLabelShapeOpeningImageFilterIUC3_cast(*args):\n return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUC3_cast(*args)",
"def itkLabelShapeOpeningImageFilterIUL3_cast(*args):\n return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUL3_cast(*args)",
"def i... | [
"0.8051953",
"0.79690355",
"0.77631503",
"0.7752133",
"0.77365917",
"0.7735961",
"0.77260625",
"0.7670788",
"0.76261944",
"0.762288",
"0.7604216",
"0.7598049",
"0.75894624",
"0.7575746",
"0.7574246",
"0.75711226",
"0.75663704",
"0.75631124",
"0.7562301",
"0.7561385",
"0.75491... | 0.76631546 | 8 |
New() > itkLabelShapeOpeningImageFilterIUC3 Create a new object of the class itkLabelShapeOpeningImageFilterIUC3 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named para... | def New(*args, **kargs):
obj = itkLabelShapeOpeningImageFilterIUC3.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkLabelShapeOpeningImageFilterIUL3.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkLabelShapeOpeningImageFilterIUS3.__New_orig__()\n import itkTemplate\n ... | [
"0.78404844",
"0.75513065",
"0.74313855",
"0.7421334",
"0.7409808",
"0.74061596",
"0.7401589",
"0.7397313",
"0.7372884",
"0.7364181",
"0.734163",
"0.73392516",
"0.7337199",
"0.7329389",
"0.73292536",
"0.73244727",
"0.73165715",
"0.7310209",
"0.7305626",
"0.7275945",
"0.726687... | 0.8143032 | 0 |
itkLabelShapeOpeningImageFilterIUC3_cast(itkLightObject obj) > itkLabelShapeOpeningImageFilterIUC3 | def itkLabelShapeOpeningImageFilterIUC3_cast(*args):
return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUC3_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkLabelShapeOpeningImageFilterIUL3_cast(*args):\n return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUL3_cast(*args)",
"def itkLabelStatisticsImageFilterIUC3IUC3_cast(obj: 'itkLightObject') -> \"itkLabelStatisticsImageFilterIUC3IUC3 *\":\n return _itkLabelStatisticsImageFilter... | [
"0.8368045",
"0.821621",
"0.82030636",
"0.80841976",
"0.8079337",
"0.80573875",
"0.8032679",
"0.80321443",
"0.7976718",
"0.7959224",
"0.7952724",
"0.7899733",
"0.78784776",
"0.78730375",
"0.7858763",
"0.78403157",
"0.7838943",
"0.78322345",
"0.7828861",
"0.7824089",
"0.781159... | 0.8525797 | 0 |
GetBackgroundValue(self) > unsigned long | def GetBackgroundValue(self):
return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUL2_GetBackgroundValue(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetBackgroundValue(self) -> \"unsigned short\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUS2_GetBackgroundValue(self)",
"def GetBackgroundValue(self) -> \"unsigned short\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUS3_GetBack... | [
"0.7737006",
"0.77182204",
"0.7681286",
"0.7642128",
"0.75252587",
"0.7524116",
"0.7383692",
"0.73833084",
"0.7315721",
"0.727174",
"0.7264374",
"0.716038",
"0.70613956",
"0.7033896",
"0.70272636",
"0.69789225",
"0.6837921",
"0.68291885",
"0.67811203",
"0.67353165",
"0.669298... | 0.6340069 | 27 |
cast(itkLightObject obj) > itkLabelShapeOpeningImageFilterIUL2 | def cast(*args):
return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUL2_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkLabelShapeOpeningImageFilterIUL2_cast(*args):\n return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUL2_cast(*args)",
"def itkLabelShapeOpeningImageFilterIUC2_cast(*args):\n return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUC2_cast(*args)",
"def c... | [
"0.8012293",
"0.7730993",
"0.758959",
"0.75821096",
"0.7559438",
"0.75055397",
"0.7494203",
"0.74905676",
"0.74472886",
"0.74340004",
"0.74072564",
"0.7395963",
"0.7391285",
"0.7386178",
"0.7386141",
"0.7385466",
"0.7384272",
"0.7365174",
"0.73477453",
"0.73245186",
"0.731464... | 0.76258916 | 2 |
New() > itkLabelShapeOpeningImageFilterIUL2 Create a new object of the class itkLabelShapeOpeningImageFilterIUL2 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named para... | def New(*args, **kargs):
obj = itkLabelShapeOpeningImageFilterIUL2.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkLabelShapeOpeningImageFilterIUC2.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkLabelShapeOpeningImageFilterIUS2.__New_orig__()\n import itkTemplate\n ... | [
"0.80340856",
"0.77699167",
"0.7615085",
"0.7349321",
"0.73308325",
"0.6981616",
"0.69504404",
"0.69433874",
"0.69157785",
"0.69061863",
"0.69024414",
"0.69007784",
"0.68895066",
"0.68852204",
"0.6870489",
"0.68364483",
"0.6835135",
"0.682967",
"0.6820463",
"0.6812641",
"0.67... | 0.8186143 | 0 |
itkLabelShapeOpeningImageFilterIUL2_cast(itkLightObject obj) > itkLabelShapeOpeningImageFilterIUL2 | def itkLabelShapeOpeningImageFilterIUL2_cast(*args):
return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUL2_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkLabelShapeOpeningImageFilterIUC2_cast(*args):\n return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUC2_cast(*args)",
"def cast(*args):\n return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUL2_cast(*args)",
"def itkLabelShapeOpeningImageFilter... | [
"0.8184659",
"0.7999193",
"0.79628026",
"0.7903417",
"0.78431404",
"0.78352135",
"0.77649355",
"0.773157",
"0.7722059",
"0.77089065",
"0.77064925",
"0.7694309",
"0.76898223",
"0.76773995",
"0.7674774",
"0.7671728",
"0.7659833",
"0.7641825",
"0.76295376",
"0.7629418",
"0.76189... | 0.85288584 | 0 |
GetBackgroundValue(self) > unsigned long | def GetBackgroundValue(self):
return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUL3_GetBackgroundValue(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetBackgroundValue(self) -> \"unsigned short\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUS2_GetBackgroundValue(self)",
"def GetBackgroundValue(self) -> \"unsigned short\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUS3_GetBack... | [
"0.7737006",
"0.77182204",
"0.7681286",
"0.7642128",
"0.75252587",
"0.7524116",
"0.7383692",
"0.73833084",
"0.7315721",
"0.727174",
"0.7264374",
"0.716038",
"0.70613956",
"0.7033896",
"0.70272636",
"0.69789225",
"0.6837921",
"0.68291885",
"0.67811203",
"0.67353165",
"0.669298... | 0.63008976 | 30 |
cast(itkLightObject obj) > itkLabelShapeOpeningImageFilterIUL3 | def cast(*args):
return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUL3_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkLabelShapeOpeningImageFilterIUL3_cast(*args):\n return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUL3_cast(*args)",
"def itkLabelShapeOpeningImageFilterIUC3_cast(*args):\n return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUC3_cast(*args)",
"def i... | [
"0.79298866",
"0.76909214",
"0.7654205",
"0.75990516",
"0.74745476",
"0.74678576",
"0.74460673",
"0.74419695",
"0.7441349",
"0.7426428",
"0.742581",
"0.7419738",
"0.74058115",
"0.74055374",
"0.7391793",
"0.73847324",
"0.738118",
"0.7375612",
"0.7370897",
"0.7366151",
"0.73527... | 0.7554147 | 4 |
New() > itkLabelShapeOpeningImageFilterIUL3 Create a new object of the class itkLabelShapeOpeningImageFilterIUL3 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named para... | def New(*args, **kargs):
obj = itkLabelShapeOpeningImageFilterIUL3.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkLabelShapeOpeningImageFilterIUC3.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkLabelShapeOpeningImageFilterIUS3.__New_orig__()\n import itkTemplate\n ... | [
"0.8013044",
"0.7707837",
"0.7301679",
"0.70666283",
"0.70537907",
"0.7053348",
"0.7042634",
"0.703377",
"0.7026652",
"0.70244336",
"0.70075125",
"0.70022047",
"0.69982916",
"0.69788796",
"0.6973958",
"0.6966385",
"0.69632",
"0.69575906",
"0.69466597",
"0.69424224",
"0.693756... | 0.81305206 | 0 |
itkLabelShapeOpeningImageFilterIUL3_cast(itkLightObject obj) > itkLabelShapeOpeningImageFilterIUL3 | def itkLabelShapeOpeningImageFilterIUL3_cast(*args):
return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUL3_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkLabelShapeOpeningImageFilterIUC3_cast(*args):\n return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUC3_cast(*args)",
"def itkLabelShapeOpeningImageFilterIUS3_cast(*args):\n return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUS3_cast(*args)",
"def c... | [
"0.8204645",
"0.8092552",
"0.79199415",
"0.784081",
"0.78191406",
"0.7811634",
"0.7788143",
"0.7774149",
"0.77606213",
"0.7754849",
"0.7739077",
"0.77293634",
"0.7710111",
"0.7707036",
"0.77046067",
"0.7674444",
"0.7663901",
"0.76611704",
"0.76608115",
"0.765003",
"0.7647054"... | 0.84926444 | 0 |
cast(itkLightObject obj) > itkLabelShapeOpeningImageFilterIUS2 | def cast(*args):
return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUS2_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkLabelShapeOpeningImageFilterIUS2_cast(*args):\n return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUS2_cast(*args)",
"def itkLabelShapeOpeningImageFilterIUL2_cast(*args):\n return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUL2_cast(*args)",
"def c... | [
"0.78920436",
"0.7706312",
"0.755923",
"0.75433284",
"0.7542991",
"0.74543655",
"0.74205667",
"0.74183464",
"0.7374501",
"0.7373725",
"0.73734075",
"0.7360082",
"0.7357408",
"0.7348211",
"0.7313102",
"0.7310419",
"0.7298819",
"0.7269222",
"0.72484714",
"0.7234487",
"0.721592"... | 0.7505284 | 5 |
New() > itkLabelShapeOpeningImageFilterIUS2 Create a new object of the class itkLabelShapeOpeningImageFilterIUS2 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named para... | def New(*args, **kargs):
obj = itkLabelShapeOpeningImageFilterIUS2.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkLabelShapeOpeningImageFilterIUL2.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkLabelShapeOpeningImageFilterIUC2.__New_orig__()\n import itkTemplate\n ... | [
"0.78754896",
"0.78627527",
"0.77313423",
"0.72295743",
"0.7186022",
"0.71564853",
"0.7122956",
"0.70924604",
"0.70854133",
"0.70552564",
"0.704826",
"0.70434165",
"0.702327",
"0.70126545",
"0.7008473",
"0.6999009",
"0.6993559",
"0.69662863",
"0.694241",
"0.693873",
"0.691870... | 0.82265264 | 0 |
itkLabelShapeOpeningImageFilterIUS2_cast(itkLightObject obj) > itkLabelShapeOpeningImageFilterIUS2 | def itkLabelShapeOpeningImageFilterIUS2_cast(*args):
return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUS2_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkLabelShapeOpeningImageFilterIUL2_cast(*args):\n return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUL2_cast(*args)",
"def itkLabelStatisticsImageFilterIF2IUS2_cast(obj: 'itkLightObject') -> \"itkLabelStatisticsImageFilterIF2IUS2 *\":\n return _itkLabelStatisticsImageFilterPy... | [
"0.81107277",
"0.79696566",
"0.7944072",
"0.7922931",
"0.78640664",
"0.7825589",
"0.7775871",
"0.77724737",
"0.77195656",
"0.7696881",
"0.76931864",
"0.76890504",
"0.76636183",
"0.76281",
"0.760129",
"0.7600809",
"0.7598741",
"0.75879145",
"0.7558603",
"0.7557666",
"0.7528054... | 0.84580594 | 0 |
cast(itkLightObject obj) > itkLabelShapeOpeningImageFilterIUS3 | def cast(*args):
return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUS3_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkLabelShapeOpeningImageFilterIUS3_cast(*args):\n return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUS3_cast(*args)",
"def itkLabelShapeOpeningImageFilterIUL3_cast(*args):\n return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUL3_cast(*args)",
"def i... | [
"0.7884982",
"0.76935387",
"0.7568831",
"0.75332016",
"0.7443235",
"0.7396062",
"0.73916113",
"0.73763156",
"0.73639095",
"0.73534125",
"0.73343885",
"0.73245275",
"0.7321727",
"0.72910506",
"0.7285906",
"0.7268845",
"0.72526383",
"0.72371423",
"0.7233805",
"0.72321534",
"0.7... | 0.75723696 | 2 |
New() > itkLabelShapeOpeningImageFilterIUS3 Create a new object of the class itkLabelShapeOpeningImageFilterIUS3 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named para... | def New(*args, **kargs):
obj = itkLabelShapeOpeningImageFilterIUS3.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkLabelShapeOpeningImageFilterIUL3.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkLabelShapeOpeningImageFilterIUC3.__New_orig__()\n import itkTemplate\n ... | [
"0.7854471",
"0.78389716",
"0.74344563",
"0.72061753",
"0.7174974",
"0.71529996",
"0.7135097",
"0.7134907",
"0.7100368",
"0.7098662",
"0.7092609",
"0.7090714",
"0.7085719",
"0.70746416",
"0.70310676",
"0.70302635",
"0.7022295",
"0.70202935",
"0.7012143",
"0.70068055",
"0.6989... | 0.81266874 | 0 |
itkLabelShapeOpeningImageFilterIUS3_cast(itkLightObject obj) > itkLabelShapeOpeningImageFilterIUS3 | def itkLabelShapeOpeningImageFilterIUS3_cast(*args):
return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUS3_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkLabelShapeOpeningImageFilterIUL3_cast(*args):\n return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUL3_cast(*args)",
"def itkLabelShapeOpeningImageFilterIUC3_cast(*args):\n return _itkLabelShapeOpeningImageFilterPython.itkLabelShapeOpeningImageFilterIUC3_cast(*args)",
"def c... | [
"0.8211752",
"0.8041203",
"0.7922317",
"0.78247",
"0.7805688",
"0.77466166",
"0.77002645",
"0.7686547",
"0.7650522",
"0.75920635",
"0.75889456",
"0.7578653",
"0.75711036",
"0.7565041",
"0.7539838",
"0.75260305",
"0.7518246",
"0.74956864",
"0.74885267",
"0.7477896",
"0.7435774... | 0.8460685 | 0 |
Set the charge for selected atoms. Note that both the hierarchy and the xray_structure must be passed here in the context of the pdbtools app, the scattering_type attributes will override the atom's element and charge when the structure is written out. | def set_atomic_charge (
hierarchy,
xray_structure,
pdb_atoms,
selection,
charge,
log=None) :
assert isinstance(charge, int)
if (selection is None) :
raise Sorry("You must specify an atom selection to apply a charge to.")
if (abs(charge) >= 10) :
raise Sorry("The charge must be in t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_charge(self, type, charge):\n assert type < self.num_atom_types + 1\n assert type > 0\n self.charges[type] = charge",
"def setCharge(self, *args):\n return _libsbml.Species_setCharge(self, *args)",
"def setCharge(self, *args):\n return _libsbml.FbcSpeciesPlugin_setCha... | [
"0.63067305",
"0.62471193",
"0.6138",
"0.58585244",
"0.5833018",
"0.5355907",
"0.5249129",
"0.5106193",
"0.5055654",
"0.4987439",
"0.49700603",
"0.4951861",
"0.4843085",
"0.47947472",
"0.47832185",
"0.4735127",
"0.47171184",
"0.46691176",
"0.4664291",
"0.46586925",
"0.4658002... | 0.82591903 | 0 |
Sorts and capitalize all words | def format_words(words):
return sorted(words, key=str.lower) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _camelify(words):\n newText = ''\n for word in words:\n if newText == '':\n newText = word[:1].lower() + word[1:]\n else:\n newText = '%s%s' % (newText, word.capitalize())\n return newText",
"def correctCasing(words):\n strings = words.split(' ')\n strings =... | [
"0.74322474",
"0.7253092",
"0.7168752",
"0.7088848",
"0.70584476",
"0.70159197",
"0.69449323",
"0.68793505",
"0.6873719",
"0.67511594",
"0.67342377",
"0.6706985",
"0.67053354",
"0.6685236",
"0.66767406",
"0.6650773",
"0.6645728",
"0.6617403",
"0.6613444",
"0.6611285",
"0.6608... | 0.7406095 | 1 |
return the total amount paid after emi_num | def balance(self, emi_num):
total_lumpsum = 0
for k in self.txn_log.keys():
if k <= emi_num:
total_lumpsum += self.txn_log[k]
total_emi_amount_paid = self.monthly_emi * emi_num
paid_amount = total_lumpsum + total_emi_amount_paid
remaining_amount = self... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def total_paid(self) -> Decimal:\n return self.total_principal + self.total_interest",
"def get_total_paid(self):\n return sum(self.paid)",
"def compute_total_paid(self):\n total = 0.0\n for line in self.loan_ids:\n if line.pay:\n total += line.amount\n ... | [
"0.65935636",
"0.65385884",
"0.6187814",
"0.5992375",
"0.59199977",
"0.58948976",
"0.58948976",
"0.5891049",
"0.58753014",
"0.58020794",
"0.57931286",
"0.5786181",
"0.576278",
"0.57526463",
"0.5748888",
"0.57236874",
"0.5693929",
"0.567132",
"0.5671129",
"0.56479716",
"0.5641... | 0.6651568 | 0 |
Return the MM calculated energy of the structure | def get_energy(self, position):
# update the positions of the system
self.simulation.context.setPositions(position)
# Get the energy from the new state
state = self.simulation.context.getState(getEnergy=True)
energy = state.getPotentialEnergy().value_in_unit(unit.kilocalories_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_energy(self):\n return self.momentum*self.momentum/(2*self.mass)",
"def _calc_Em(self):\n return (self.parameters.E0 +\n self.x * sqrt2 * self.parameters.sigma * self.mt)",
"def energy(self):\n nocc, gmo, e = self.nocc, self.gmo, self.e\n\n Ec = 0.0\n f... | [
"0.8011897",
"0.7236766",
"0.72213215",
"0.719831",
"0.7176835",
"0.7128191",
"0.70815146",
"0.70300055",
"0.6976268",
"0.69536984",
"0.6949243",
"0.6921412",
"0.6911287",
"0.69055843",
"0.690532",
"0.6850432",
"0.683771",
"0.6818059",
"0.6803566",
"0.6761848",
"0.67555153",
... | 0.61439055 | 82 |
Close an active session for the client process. After closing a session, the client process is required to call open_session() again before using any of the clientfacing member functions. Closing an active session will remove the record of which signals and controls the client process has access to; thus, this record i... | def close_session(self, client_pid):
self._active_sessions.check_client_active(client_pid, 'PlatformCloseSession')
reference_count = self._active_sessions.get_reference_count(client_pid)
if reference_count == 0:
# The daemon died, restarted, and found a session with
# zer... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _close_session_completely(self, client_pid):\n sess = self._active_sessions.remove_client(client_pid)\n if sess is not None:\n GLib.source_remove(sess['watch_id'])\n batch_pid = sess.get('batch_server')\n if batch_pid is not None:\n try:\n ... | [
"0.7437084",
"0.690607",
"0.68884754",
"0.6834479",
"0.66683245",
"0.65452087",
"0.65006196",
"0.6426763",
"0.6408033",
"0.6401355",
"0.639842",
"0.63926005",
"0.63916206",
"0.6341986",
"0.6329491",
"0.6316306",
"0.6316306",
"0.6316306",
"0.6270928",
"0.6270928",
"0.6270928",... | 0.7810562 | 0 |
The name of the resource group. The name is case insensitive. | def resource_group_name(self) -> pulumi.Input[str]:
return pulumi.get(self, "resource_group_name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_group_name(self) -> str:\n return pulumi.get(self, \"resource_group_name\")",
"def group_name(self) -> str:\n return pulumi.get(self, \"group_name\")",
"def resource_group_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"resource_group_name\")",
"def resource_gr... | [
"0.8591477",
"0.8364604",
"0.8203347",
"0.8203347",
"0.8203347",
"0.8203347",
"0.8203347",
"0.8203347",
"0.8203347",
"0.8203347",
"0.8203347",
"0.8203347",
"0.8203347",
"0.8203347",
"0.81754756",
"0.8084906",
"0.8084906",
"0.8084906",
"0.8084906",
"0.8084906",
"0.8084906",
... | 0.80879456 | 44 |
The number of records that have been successfully ingested. | def ingested_record_count(self) -> pulumi.Output[int]:
return pulumi.get(self, "ingested_record_count") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ingested_record_count(self) -> int:\n return pulumi.get(self, \"ingested_record_count\")",
"def valid_record_count(self) -> pulumi.Output[int]:\n return pulumi.get(self, \"valid_record_count\")",
"def get_num_records(self):\n return self.__num_records",
"def total_record_count(self) ... | [
"0.8487349",
"0.7815422",
"0.7733585",
"0.75136316",
"0.749256",
"0.7402974",
"0.73891795",
"0.73745716",
"0.73220044",
"0.73096746",
"0.73080456",
"0.72314",
"0.7164667",
"0.7136669",
"0.71226245",
"0.7111875",
"0.71010864",
"0.71010864",
"0.71010864",
"0.71010864",
"0.71010... | 0.8518079 | 0 |
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" | def type(self) -> pulumi.Output[str]:
return pulumi.get(self, "type") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")",
"def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")",
"def resource_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"resource_type\")",
"def ... | [
"0.7918516",
"0.7918516",
"0.7866337",
"0.7866337",
"0.7866337",
"0.7866337",
"0.7866337",
"0.7708053",
"0.75534964",
"0.7282099",
"0.70591027",
"0.6979169",
"0.69202054",
"0.6868452",
"0.67303157",
"0.67049116",
"0.6654272",
"0.6646357",
"0.66396123",
"0.66396123",
"0.663961... | 0.0 | -1 |
1D array of the range of xcoordinates of simulated grid points. | def x_points(self):
return self._x_points | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_xrange(self) -> np.array:\n # todo: ensure this functions work as well for y_values\n lower, upper = self.get_xrange_indices()\n return self.x[lower, upper + 1]",
"def get_xrange(self):\n return self.xvec[0], self.xvec[-1]",
"def get_Xc_starts(self):\r\n start_list = ... | [
"0.78571814",
"0.7176431",
"0.69910145",
"0.6824067",
"0.675544",
"0.6752765",
"0.6751219",
"0.67341363",
"0.6685781",
"0.66097045",
"0.66063",
"0.66007453",
"0.656058",
"0.6520074",
"0.651184",
"0.6488101",
"0.647228",
"0.6442931",
"0.6423826",
"0.63745934",
"0.6354807",
"... | 0.6104764 | 33 |
1D array of the range of ycoordinates of simulated grid points. | def y_points(self):
return self._y_points | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def y0(self, level):\n resolution = self.resolution(level)\n return np.arange(0, (self.y_extent + resolution - 1) // resolution, 64)",
"def ystagg_xy_coordinates(self):\n\n x = self.center_grid.x0 + np.arange(self.nx) * self.dx\n y_s = self.corner_grid.y0 + np.arange(self.ny+1) * self... | [
"0.65916383",
"0.6579203",
"0.6470338",
"0.6320861",
"0.6312931",
"0.6268279",
"0.6261383",
"0.62526274",
"0.61985606",
"0.61934626",
"0.61716056",
"0.6162058",
"0.6158355",
"0.6142149",
"0.6118493",
"0.61113155",
"0.61075926",
"0.6102357",
"0.6090378",
"0.6074509",
"0.607450... | 0.6352446 | 3 |
Test API can edit an existing candidate. (PUT request) | def test_candidate_update(self):
self.register_user()
result = self.login_user()
access_token = json.loads(result.data.decode())['access_token']
# first, we create a candidate by making a POST request
rv = self.client().post('/candidate',headers=dict(Authorization=access_t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_can_edit_ride_offer(self):\n response = self.app.put('/api/v1/users/rides/1',\n data=json.dumps(self.ride),\n content_type='application/json',\n headers=self.headers)\n self.assertEqual(response.status_code, 200... | [
"0.6611098",
"0.66103894",
"0.64359283",
"0.631056",
"0.6284428",
"0.6220648",
"0.6183864",
"0.61323905",
"0.6097053",
"0.6091945",
"0.6084329",
"0.60665303",
"0.6065541",
"0.60520715",
"0.60402054",
"0.60301983",
"0.6026076",
"0.6023222",
"0.6022955",
"0.6002233",
"0.5990035... | 0.835647 | 0 |
Return the learning rate for the network depending on the size | def lr(self):
return .1 / self.h ** 1.5 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_learning_rate():\n return 0.00001",
"def learning_rate(epoch):\n self.lr = self.lr / 1.00000001\n return self.lr",
"def get_learning_rate(learning_rate, hidden_size, learning_rate_warmup_steps):\n with tf.name_scope(\"learning_rate\"):\n warmup_steps = tf.to_float(lea... | [
"0.78287953",
"0.7724514",
"0.7442814",
"0.73025054",
"0.73025054",
"0.72176313",
"0.7148397",
"0.71479964",
"0.71163183",
"0.7093668",
"0.6739542",
"0.6723354",
"0.6671022",
"0.6593442",
"0.6576625",
"0.65572596",
"0.65374106",
"0.65373266",
"0.65011245",
"0.64905524",
"0.64... | 0.0 | -1 |
Return the learning rate for the network depending on the size | def lr(self):
return 0.1 / self.h | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_learning_rate():\n return 0.00001",
"def learning_rate(epoch):\n self.lr = self.lr / 1.00000001\n return self.lr",
"def get_learning_rate(learning_rate, hidden_size, learning_rate_warmup_steps):\n with tf.name_scope(\"learning_rate\"):\n warmup_steps = tf.to_float(lea... | [
"0.78287953",
"0.7724514",
"0.7442814",
"0.73025054",
"0.73025054",
"0.72176313",
"0.7148397",
"0.71479964",
"0.71163183",
"0.7093668",
"0.6739542",
"0.6723354",
"0.6671022",
"0.6593442",
"0.6576625",
"0.65572596",
"0.65374106",
"0.65373266",
"0.65011245",
"0.64905524",
"0.64... | 0.0 | -1 |
Tries to get the coordinates for the given stations. | def get_coordinates(addresses, boroughs):
latitude = []
longitude = []
for address, borough in zip(addresses, boroughs):
try:
g = geocoder.osm('{}, {}, New York'.format(address, borough)).json
latitude.append(g['lat'])
longitude.append(g['lng'])
except:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calcStationCoords(station, gridSquares):\n\n # calculate coordinates and precision\n gridRef = station[\"gridReference\"]\n gridCode = gridRef[:2]\n station[\"precision\"] = 10 ** (5 - len(gridRef[2:])/2) # Units: meters\n station[\"easting\"] = (\n gridSquares[gridCode][0] + int(gridRef... | [
"0.6694319",
"0.642123",
"0.63363254",
"0.62377053",
"0.62344146",
"0.61675394",
"0.60888624",
"0.5959338",
"0.595098",
"0.5932836",
"0.5925174",
"0.5890509",
"0.5879424",
"0.5800218",
"0.579859",
"0.57925904",
"0.5722443",
"0.57109815",
"0.5709719",
"0.5709719",
"0.56924045"... | 0.55364794 | 31 |
Compute and return the output of the network when parameterized with `params` on `input_data`. | def compute_network_output(self, params, input_data):
feed_dict = dict(zip(self.network_params, params))
feed_dict[self.X_Minibatch] = input_data
return self.session.run(self.f_output, feed_dict=feed_dict) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Evaluate(self, input_data: np.ndarray) -> np.ndarray:\n if input_data.shape[0] != self.input_layer_size:\n raise IndexError(f\"Input data length is {input_data.shape[0]}, must match length of input layer size {self.input_layer_size}\")\n\n # Evaulate hidden layer given input values\n hidden_layer... | [
"0.6962737",
"0.65651304",
"0.64880806",
"0.62049186",
"0.61080664",
"0.61079204",
"0.6062648",
"0.6043072",
"0.5967871",
"0.5962566",
"0.5879268",
"0.58225167",
"0.58205044",
"0.5813368",
"0.5806537",
"0.5801782",
"0.57999605",
"0.57720494",
"0.57394594",
"0.5698388",
"0.568... | 0.8428336 | 0 |
Compute and return the output of the network when parameterized with `params` on `input_data`. | def compute_pred_network_output(self, model_idx, input_data):
feed_dict = {}
feed_dict[self.X_Minibatch] = input_data
return self.session.run(self.pred_output[model_idx], feed_dict=feed_dict) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_network_output(self, params, input_data):\n\n feed_dict = dict(zip(self.network_params, params))\n feed_dict[self.X_Minibatch] = input_data\n return self.session.run(self.f_output, feed_dict=feed_dict)",
"def Evaluate(self, input_data: np.ndarray) -> np.ndarray:\n if input_dat... | [
"0.8427756",
"0.69635",
"0.65663815",
"0.648931",
"0.62063706",
"0.6109536",
"0.61083716",
"0.60447276",
"0.5968614",
"0.5964566",
"0.58792645",
"0.5823191",
"0.5822008",
"0.58138376",
"0.5807008",
"0.58025354",
"0.58011687",
"0.57735956",
"0.5739798",
"0.5700363",
"0.5679638... | 0.6064794 | 7 |
Cumulative standard normal distribution. | def Phi(x):
# constants
a1 = 0.254829592
a2 = -0.284496736
a3 = 1.421413741
a4 = -1.453152027
a5 = 1.061405429
p = 0.3275911
# Save the sign of x
sign = 1
if x < 0:
sign = -1
x = abs(x)/math.sqrt(2.0)
# A&S formula 7.1.26
t = 1.0/(1.0 + p*x)
y = 1.0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cumulative_normal_distribution(z):\n from math import exp\n\n b1 = +0.319381530\n b2 = -0.356563782\n b3 = +1.781477937\n b4 = -1.821255978\n b5 = +1.330274429\n p = +0.2316419\n c = +0.39894228\n\n if z >= 0.0:\n t = 1.0 / (1.0 + p * z)\n return 1.0 - c * exp(-z * z / ... | [
"0.76851344",
"0.74152076",
"0.73346686",
"0.7244333",
"0.71839005",
"0.7131577",
"0.69278485",
"0.6810465",
"0.67138207",
"0.67137516",
"0.67103475",
"0.6588341",
"0.65674835",
"0.6525102",
"0.65181786",
"0.6465767",
"0.6455078",
"0.639367",
"0.6375049",
"0.6215783",
"0.6209... | 0.0 | -1 |
This is a primitive function of e^(gamma y)sin ((n pi y)/A), multiplied by 2/Aexp(gammay). | def U(n,gamma,A,y):
return (2*A*gamma*math.sin(math.pi*n*y/A) - 2*math.pi*n*math.cos (math.pi*n*y/A))/(A**2*gamma**2 + math.pi**2 * n**2) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exp_func(x, initial, lifetime):\n return initial * np.exp(-x/lifetime)",
"def exp_integral(x):\n gamma = 0.577215665\n return (-gamma - expn(x,1) - np.log(x))",
"def GB(x, eta):\n return 1 / np.pi * 1 / eta * np.exp(-(x / eta) ** 2)",
"def F(x):\n return math.exp(-0.5 * (x ** 2))",
"def ... | [
"0.6812344",
"0.67157173",
"0.66481435",
"0.651393",
"0.6510742",
"0.64022386",
"0.6401282",
"0.6373076",
"0.63730127",
"0.6355589",
"0.63467276",
"0.6331447",
"0.6275051",
"0.6263549",
"0.6216546",
"0.6213597",
"0.6194261",
"0.6193766",
"0.616869",
"0.6166437",
"0.6155559",
... | 0.74732214 | 0 |
Returns a numpy array that is binary packed. | def write_bin(raw):
a = raw.astype('i1')
b = a.reshape((-1,2))
b[:,1] = b[:,1] << 4
c = np.bitwise_or(b[:,0], b[:,1]).astype('i1')
return c | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tobinary_multiples(arr):\n return [np.array(arr_i).tobytes() for arr_i in arr]",
"def data_to_bitarray(data):\n ba = bitarray()\n ba.frombytes(data)\n return ba",
"def to_nibble_array(arr: ndarray) -> ndarray:\n arr = arr.ravel()\n return (arr[::2] + (arr[1::2] << 4)).astype(\"uint8\")",
... | [
"0.68155456",
"0.6657949",
"0.655781",
"0.6490013",
"0.6446903",
"0.6441773",
"0.64400554",
"0.6390015",
"0.63689923",
"0.6288171",
"0.62178695",
"0.62070173",
"0.6167479",
"0.61575425",
"0.6156892",
"0.6128707",
"0.61157036",
"0.6106918",
"0.609474",
"0.60929173",
"0.6087773... | 0.60609436 | 22 |
Update Gaussian parameters with diagonal covariance | def updateMeanAndVar(X, log_gamma, varianceFloor=5.0):
N = X.shape[0]#71*13
D = X.shape[1]
M = log_gamma.shape[1]
means = np.zeros((M, D))
covars = np.zeros((M, D))
#means = np.mean(X, axis=0)
#covars = np.cov(X.T)
for k in range(M):
for n in range(N):
means[k, :] += ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_covariance(self):\n raise RuntimeError(\"Internal cosmosis error in SingleValueGaussianLikelihood\")",
"def build_covariance(self):\n raise RuntimeError(\"Your Gaussian covariance code needs to \"\n \"over-ride the build_covariance method so it knows how to \"\n \"lo... | [
"0.6520932",
"0.6244814",
"0.6132422",
"0.6097101",
"0.5980771",
"0.59680223",
"0.5890005",
"0.58773696",
"0.5821621",
"0.5801322",
"0.579809",
"0.5795447",
"0.57706726",
"0.5733653",
"0.573118",
"0.57129925",
"0.5638596",
"0.5631603",
"0.5613267",
"0.56101966",
"0.55793625",... | 0.5636483 | 17 |
Force the module under test to be reimported. Because pytest runs all tests within the same scope (this makes me cry) we have to do some manual housekeeping to avoid tests polluting each other. Since conftest.py already does some sys.modules mangling I see no reason not to do the same thing here. | def force_reimport(module):
if "." in module:
steps = module.split(".")
else:
steps = [module]
for i in range(len(steps)):
module = ".".join(steps[0:i + 1])
try:
del sys.modules[module]
except KeyError:
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_register_post_import_hook_reimport(self):\n test_hook = mock.MagicMock()\n register_post_import_hook('tests.utils.test_module', test_hook)\n import tests.utils.test_module\n reload_module(tests.utils.test_module)\n self.assertEqual(test_hook.call_count, 2)",
"def clean... | [
"0.6746044",
"0.66979873",
"0.6477635",
"0.63719857",
"0.6252365",
"0.6235158",
"0.62041223",
"0.6198232",
"0.6108221",
"0.6085866",
"0.6078852",
"0.60534996",
"0.60254765",
"0.600301",
"0.5997715",
"0.59392923",
"0.5877362",
"0.587497",
"0.5871731",
"0.586319",
"0.585239",
... | 0.7124968 | 0 |
Create new rz single qubit gate. | def __init__(self, phi):
super().__init__("rz", 1, [phi]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rz(self, phi, q): # pylint: disable=invalid-name\n return self.append(RZGate(phi), [q], [])",
"def Z(self, qubit_expr): \n self.apply_gate_operation('Z', qubit_expr)",
"def _template_circuit(self, amp_param) -> QuantumCircuit:\n gate = Gate(name=self.__rabi_gate_name__, num_qubits=... | [
"0.64287657",
"0.6099297",
"0.5898651",
"0.5861154",
"0.580816",
"0.57955754",
"0.57367224",
"0.5729241",
"0.5719736",
"0.5706072",
"0.5680553",
"0.5639831",
"0.5627709",
"0.5623784",
"0.56206375",
"0.55766356",
"0.55131817",
"0.54742813",
"0.544934",
"0.5444207",
"0.53942406... | 0.47234657 | 100 |
Apply Rz to q. | def rz(self, phi, q): # pylint: disable=invalid-name
return self.append(RZGate(phi), [q], []) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Rz(q):\n sin_q, cos_q = sin(q), cos(q)\n return numpy.matrix([\n [cos_q, sin_q, 0, 0],\n [-sin_q, cos_q, 0, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1],\n ])",
"def Z(self, qubit_expr): \n self.apply_gate_operation('Z', qubit_expr)",
"def _apply_z(self, state, axes... | [
"0.70316553",
"0.6450491",
"0.632264",
"0.6186978",
"0.6071907",
"0.59562814",
"0.58147013",
"0.57785785",
"0.57325786",
"0.5728475",
"0.57197875",
"0.56993246",
"0.5659389",
"0.5620494",
"0.56044215",
"0.5576617",
"0.5520912",
"0.5506319",
"0.5459853",
"0.54062986",
"0.54034... | 0.68994224 | 1 |
Set the name of the room | def set_name(self, room_name):
self.name = room_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_name(self, newname=\"\"):\n self.name = newname",
"def setName(self, name):\n self.name = str(name)",
"def set_name(self, name: str) -> None:\n lib.wlr_seat_set_name(self._ptr, name.encode())",
"def rename_room(self, old: str, new: str):\n for room in self.rooms:\n ... | [
"0.713663",
"0.70908546",
"0.70468944",
"0.69912845",
"0.6983755",
"0.6948137",
"0.6906284",
"0.6906284",
"0.6906284",
"0.6906284",
"0.6906284",
"0.68945503",
"0.68945503",
"0.68907464",
"0.68319714",
"0.68319714",
"0.68319714",
"0.68319714",
"0.6798939",
"0.67978996",
"0.678... | 0.9014936 | 0 |
Connect rooms together, to create the map of rooms | def link_room(self, room_to_link, direction):
self.linked_rooms[direction] = room_to_link
# print(self.name + " linked rooms :" + repr(self.linked_rooms) ) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _add_rooms(self):\r\n rooms = self.model.get_all_rooms()\r\n\r\n for room in rooms:\r\n self._add_room(room)",
"def _create_room(new_map, room):\n for x in range(room.x1 + 1, room.x2):\n for y in range(room.y1 + 1, room.y2):\n new_map.terrain[x][y] = 1",
"def r... | [
"0.6852546",
"0.6832722",
"0.6804679",
"0.6800517",
"0.67645746",
"0.67229444",
"0.65797603",
"0.6555584",
"0.65234435",
"0.65117246",
"0.64874405",
"0.6484442",
"0.6471041",
"0.64631975",
"0.6395378",
"0.636149",
"0.6319884",
"0.6252946",
"0.61874944",
"0.61856043",
"0.61520... | 0.6127214 | 22 |
Get the index left child of index | def left(self, index):
try:
if index == self.root_index():
index = self.adjacency_list[index][0]
else:
index = self.adjacency_list[index][1]
return index
except IndexError:
return -1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def left_child(self, index):\n return 2 * index + 1",
"def left_child(self, index):\n return 2 * index",
"def get_left_child_index(self):\n return (2 * self.index) + 1",
"def left_child_idx(idx):\n return (idx << 1) + 1",
"def get_left_child_index(self, parent):\n return 2*pa... | [
"0.90987784",
"0.90317005",
"0.8905215",
"0.8503361",
"0.8332863",
"0.8146887",
"0.7957613",
"0.7887684",
"0.7869901",
"0.7869901",
"0.78112483",
"0.7800396",
"0.77713263",
"0.7691286",
"0.76460344",
"0.7619399",
"0.7607053",
"0.7548032",
"0.75244474",
"0.74123925",
"0.740149... | 0.80303824 | 6 |
Compute finite difference approximation to firstderivative of f | def fd_1deriv(f, eps, x, dx, scheme):
if scheme == 'fd1' :
f0 = f(x)
fp = f(x+eps*dx)
return (1.0/eps)*(fp-f0)
elif scheme == 'bd1':
f0 = f(x)
fm = f(x-eps*dx)
return (1.0/eps)*(f0-fm)
elif scheme == 'cd2':
fp = f(x+eps*dx)
fm = f(x-eps*dx)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def first_derivative(x, f):\n deriv = np.diff(f, n=1)\n deriv = np.insert(deriv, -1, 2 * deriv[-1] - deriv[-2])\n dx = x[1] - x[2]\n return deriv / dx",
"def partial_derivative(f, x, i, epsilon = 1e-10):\n x_ = np.copy(x).astype(np.float64)\n x_[i] = x_[i] + epsilon\n value = (f(x_) - f(x)) ... | [
"0.82054245",
"0.77715814",
"0.7437851",
"0.7435485",
"0.7296304",
"0.7296304",
"0.71847135",
"0.71778184",
"0.71445215",
"0.70453423",
"0.69946945",
"0.6958921",
"0.6929292",
"0.6924365",
"0.6880624",
"0.6861173",
"0.68156135",
"0.67985636",
"0.6746113",
"0.67382216",
"0.672... | 0.65189505 | 28 |
Settlement date, formatted as yyyyMM or yyyyMMdd (ISO8601) | def settlement_date(self) -> datetime.date:
return self.__settlement_date | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __get_settlement_date():\n day_after_tomorrow = datetime.now(timezone.utc).date() + \\\n timedelta(days=2)\n settlement_date = day_after_tomorrow.strftime(\"%Y%m%d\")\n\n return settlement_date",
"def settlement_date(self, value):\n if value:\n self._settleme... | [
"0.73603165",
"0.6983856",
"0.65309083",
"0.65231663",
"0.6507806",
"0.63602024",
"0.62975174",
"0.624039",
"0.62308675",
"0.62168384",
"0.617023",
"0.6140942",
"0.61178774",
"0.61154044",
"0.6107389",
"0.60865355",
"0.6077755",
"0.6075849",
"0.60738987",
"0.6050871",
"0.6048... | 0.72565615 | 1 |
Creation time as ISO8601 UTC instant | def created_time(self) -> datetime.datetime:
return self.__created_time | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def creation_time_str(self):\n return \"%Y/%m/%d %I:%M:%S\".format(self.creation_time)",
"def creation_time(self) -> str:\n return pulumi.get(self, \"creation_time\")",
"def creation_time(self) -> str:\n return pulumi.get(self, \"creation_time\")",
"def creation_time(self) -> str:\n ... | [
"0.76311934",
"0.76114553",
"0.76114553",
"0.76114553",
"0.741649",
"0.73525983",
"0.7321246",
"0.7321246",
"0.7321246",
"0.7321246",
"0.7321246",
"0.7321246",
"0.7321246",
"0.7321246",
"0.7321246",
"0.7321246",
"0.7321246",
"0.7321246",
"0.7321246",
"0.7321246",
"0.7321246",... | 0.68319273 | 57 |
Return callable that returns config value if it exists. | def config_value(name):
def get():
try:
return config.get('yourls', name)
except (NoOptionError, NoSectionError):
return None
return get | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _fake_safe_get(self, value):\n try:\n val = getattr(self.configuration, value)\n except AttributeError:\n val = None\n return val",
"def __call__(self, name):\n return getattr(self.config, name, getattr(self, name, None))",
"def test_get_is_callable():\n ... | [
"0.63374597",
"0.63292855",
"0.63210374",
"0.62549025",
"0.6202626",
"0.6121607",
"0.60557956",
"0.59862566",
"0.59833014",
"0.59367955",
"0.5911785",
"0.58831775",
"0.5851627",
"0.5848557",
"0.5846965",
"0.5840532",
"0.58229953",
"0.58227575",
"0.5800165",
"0.577961",
"0.577... | 0.709517 | 0 |
Add one or more MQTT topics to subscribe to. Add the topic(s) afterwards to the list of subscribedto topics. | def subscribeTopic(self, topic:str|list[str], callback:MQTTCallback=None, **kwargs:Any) -> None:
def _subscribe(topic:str) -> None:
""" Handle subscription of a single topic.
"""
if topic in self.subscribedTopics:
self.messageHandler and self.messageHandler.logging(self.mqttClient, logging.WARNING, f'MQT... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_subscription_topics(self, topics: List[str]) -> None:\n self.log.debug(f\"Adding {topics} to {self.topics}\")\n self.topics.extend(topics)",
"def subscribe_mqtt(self, topic):\n if topic not in self.subscriptions:\n self.subscriptions.append(topic)\n self.mqtt.su... | [
"0.79668194",
"0.7013201",
"0.68434346",
"0.65632993",
"0.6552192",
"0.64358073",
"0.6357499",
"0.6307314",
"0.6243517",
"0.62268454",
"0.6182504",
"0.6163507",
"0.6141364",
"0.6074601",
"0.6019518",
"0.600262",
"0.5982004",
"0.59341836",
"0.5918623",
"0.59090877",
"0.5887492... | 0.64738464 | 5 |
Unsubscribe from a topic. `topic` is either an MQTTTopic structure with a previously subscribed to topic, or a topic name, in which case it is searched for in the list of MQTTTopics. | def unsubscribeTopic(self, topic:str|MQTTTopic) -> None:
if isinstance(topic, MQTTTopic):
if topic.topic not in self.subscribedTopics:
self.messageHandler and self.messageHandler.logging(self.mqttClient, logging.WARNING, f'MQTT: unknown topic: {topic.topic}')
return
if (r := self.mqttClient.unsubscribe(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unsubscribe(self, topic):\n request = protos.RequestUnsubscribe(topic=topic)\n return self.stub.unsubscribe(request)",
"async def unsubscribe(self, topic: str, subscription_id: int = None) -> None:\n ...",
"def unsubscribe_topic(self, topic_id: str) -> bool:\n result = self.__tw... | [
"0.8346598",
"0.77913505",
"0.75999",
"0.7499919",
"0.7160631",
"0.6972879",
"0.68356097",
"0.6703196",
"0.6680555",
"0.6609505",
"0.6113541",
"0.59910476",
"0.583082",
"0.58190256",
"0.57220286",
"0.57081944",
"0.5667056",
"0.56057805",
"0.5574315",
"0.556646",
"0.55532223",... | 0.859222 | 0 |
Check whether the number managed subscriptions matches the number of currently subscribedto topics. | def isFullySubscribed(self) -> bool:
return self.subscribedCount == len(self.subscribedTopics) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_topics_for_products(self):\n desktop_topics = topics_for(product=self.desktop)\n eq_(len(desktop_topics), 3)\n\n mobile_topics = topics_for(product=self.mobile)\n eq_(len(mobile_topics), 2)",
"def count_subscribers(self, topic_name):\n return self._count_publishers_or_... | [
"0.6529019",
"0.64319134",
"0.6344029",
"0.61946326",
"0.61635345",
"0.60581344",
"0.60397667",
"0.6008687",
"0.6005124",
"0.60028076",
"0.5832667",
"0.57937104",
"0.57245815",
"0.57192606",
"0.569042",
"0.5664807",
"0.5654088",
"0.5635794",
"0.56060433",
"0.559429",
"0.55886... | 0.6339416 | 3 |
Return the name of the sensor. | def name(self):
return self._name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return self._sensor.name",
"def get_sensor_name(self):\n return self.data[1]",
"def name(self):\n return self.device.device_data[self.device_id]['name'] + \\\n f' {self._sensor_type}'",
"def name(self):\n return f\"{self._name} {SENSOR_TYPES[self.senso... | [
"0.91896784",
"0.9168378",
"0.890185",
"0.8770976",
"0.8511273",
"0.8479953",
"0.844435",
"0.8299758",
"0.8186503",
"0.8105667",
"0.8079737",
"0.8066149",
"0.8049647",
"0.7700968",
"0.7612295",
"0.7611456",
"0.7600605",
"0.7600605",
"0.7600605",
"0.75392073",
"0.75166553",
... | 0.0 | -1 |
Return the state attributes. | def device_state_attributes(self):
return self._attributes | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def state_attributes(self):\n return self._attributes",
"def state_attributes(self):\n return self._attributes",
"def device_state_attributes(self):\r\n return self.attributes",
"def device_state_attributes(self):\n return self._state_attrs",
"def device_state_attributes(self):\... | [
"0.8953404",
"0.8953404",
"0.85239846",
"0.8366765",
"0.8366765",
"0.8363429",
"0.83362615",
"0.8334551",
"0.8310377",
"0.8292682",
"0.8289349",
"0.8289349",
"0.8273077",
"0.82236886",
"0.8223562",
"0.8205066",
"0.8184393",
"0.81659013",
"0.8102565",
"0.8064994",
"0.8064994",... | 0.82871646 | 19 |
Split the input data to test / train split to be used in machine learning | def __init__(self, predictor_vars, response_var, train_split: float, seed: int):
super().__init__(predictor_vars=predictor_vars, response_var=response_var)
self.seed = seed
self.train_split = train_split
if type(self.seed) != int:
raise ValueError(f"seed value not an int, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split_data_into_train_and_test(raw_training_data):\n train_set, test_set = train_test_split(raw_training_data, test_size=0.2, random_state=42)\n return train_set, test_set",
"def split_data(data, test_size):\r\n ntest = int(round(len(data) * (1 - test_size)))+1\r\n \r\n train, test = data[:ntes... | [
"0.85633165",
"0.8388454",
"0.8346235",
"0.8271904",
"0.8251709",
"0.8218088",
"0.8209363",
"0.8198223",
"0.81865114",
"0.80025434",
"0.7921232",
"0.7919696",
"0.7889015",
"0.78807575",
"0.78798896",
"0.78700984",
"0.78617764",
"0.7857819",
"0.7816629",
"0.774531",
"0.771966"... | 0.0 | -1 |
Sets the heap_max of this TaskManagerMetricsInfo. | def heap_max(self, heap_max):
self._heap_max = heap_max | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def non_heap_max(self, non_heap_max):\n\n self._non_heap_max = non_heap_max",
"def max_memory_mb(self, max_memory_mb):\n\n self._max_memory_mb = max_memory_mb",
"def _set_max_mem(self, max_mem):\n\n if max_mem is None:\n self.max_mem = None\n return\n elif type... | [
"0.6626879",
"0.6181461",
"0.61811733",
"0.61060923",
"0.5978751",
"0.59258306",
"0.59258306",
"0.5867038",
"0.5867038",
"0.5867038",
"0.5849855",
"0.58473265",
"0.5834918",
"0.5814143",
"0.5769788",
"0.5769788",
"0.57570934",
"0.5704619",
"0.56911886",
"0.5622587",
"0.558877... | 0.8110456 | 0 |
Sets the non_heap_used of this TaskManagerMetricsInfo. | def non_heap_used(self, non_heap_used):
self._non_heap_used = non_heap_used | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def heap_used(self, heap_used):\n\n self._heap_used = heap_used",
"def set_used_mem(self, u_mem):\n self.used_mem = u_mem\n return",
"def memory_used(self, memory_used: int):\r\n self._memory_used = memory_used",
"def non_heap_max(self, non_heap_max):\n\n self._non_heap_max... | [
"0.6291598",
"0.6273463",
"0.6097252",
"0.5613726",
"0.55397135",
"0.5297318",
"0.52758723",
"0.5258061",
"0.51918805",
"0.5188622",
"0.49513888",
"0.48736694",
"0.485139",
"0.4845899",
"0.4845725",
"0.48365203",
"0.48168665",
"0.47932005",
"0.47764748",
"0.4773068",
"0.47532... | 0.794406 | 0 |
Sets the non_heap_committed of this TaskManagerMetricsInfo. | def non_heap_committed(self, non_heap_committed):
self._non_heap_committed = non_heap_committed | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def non_heap_used(self, non_heap_used):\n\n self._non_heap_used = non_heap_used",
"def non_heap_max(self, non_heap_max):\n\n self._non_heap_max = non_heap_max",
"def heap_committed(self, heap_committed):\n\n self._heap_committed = heap_committed",
"def disk_num_not(self, disk_num_not):\n... | [
"0.64571434",
"0.5781086",
"0.5648441",
"0.5366493",
"0.50516164",
"0.48842835",
"0.48411992",
"0.48010585",
"0.47936597",
"0.47573137",
"0.47312197",
"0.47151467",
"0.4713035",
"0.4684705",
"0.46108097",
"0.4602422",
"0.45990223",
"0.45906383",
"0.457726",
"0.45559895",
"0.4... | 0.78811336 | 0 |
Sets the non_heap_max of this TaskManagerMetricsInfo. | def non_heap_max(self, non_heap_max):
self._non_heap_max = non_heap_max | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def non_heap_used(self, non_heap_used):\n\n self._non_heap_used = non_heap_used",
"def heap_max(self, heap_max):\n\n self._heap_max = heap_max",
"def set_is_max(self, is_max):\n self.__is_max = is_max",
"def setMaxValue(self, max_value):\r\n\t\tself.MaxValue = max_value",
"def setMaxVa... | [
"0.6502602",
"0.60926497",
"0.60050774",
"0.5792456",
"0.5792456",
"0.5707673",
"0.5694867",
"0.5675417",
"0.5636486",
"0.562897",
"0.55975515",
"0.554014",
"0.5482629",
"0.5482629",
"0.5482629",
"0.54631966",
"0.54631966",
"0.54238504",
"0.54039484",
"0.54009366",
"0.539634"... | 0.8380408 | 0 |
Sets the mapped_count of this TaskManagerMetricsInfo. | def mapped_count(self, mapped_count):
self._mapped_count = mapped_count | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setMappedInfo(self, mapped_info):\n \n self.mapped_info = mapped_info",
"def mapped_used(self, mapped_used):\n\n self._mapped_used = mapped_used",
"def process_count(self, process_count):\n\n self._process_count = process_count",
"def get_total_mapped_line_items_count(self):\n... | [
"0.66207695",
"0.64716375",
"0.56269515",
"0.5459901",
"0.53556633",
"0.531744",
"0.5303203",
"0.52530044",
"0.5246449",
"0.52354133",
"0.5216228",
"0.5139872",
"0.5057147",
"0.5055907",
"0.5055124",
"0.49604854",
"0.4921465",
"0.48765808",
"0.48717633",
"0.48644963",
"0.4860... | 0.81148535 | 0 |
Sets the memory_segments_total of this TaskManagerMetricsInfo. | def memory_segments_total(self, memory_segments_total):
self._memory_segments_total = memory_segments_total | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def total_memory(self, total_memory):\n\n self._total_memory = total_memory",
"def set_total_mem(self, mem):\n self.total_mem = mem\n return",
"def total_actual_memory(self, total_actual_memory):\n\n self._total_actual_memory = total_actual_memory",
"def memory_segments_available(... | [
"0.7018766",
"0.6743253",
"0.66498226",
"0.65172005",
"0.6190984",
"0.5889619",
"0.57065934",
"0.5548552",
"0.5511228",
"0.540781",
"0.53714246",
"0.533922",
"0.5301006",
"0.52449936",
"0.5217802",
"0.51979667",
"0.5142255",
"0.51377094",
"0.50974166",
"0.50959224",
"0.509259... | 0.86381906 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, TaskManagerMetricsInfo):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748"
] | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.