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 |
|---|---|---|---|---|---|---|
Get the file path matching `location`. Raises NonFileResourceExistsError If a nonfile already exists at the corresponding path. | async def _get_path_to_dump(self, location: PhysicalResourceLocation) -> Path:
path = location.path.with_suffix(self.suffix)
if path.exists() and not path.is_file():
raise NonFileResourceExistsError(path)
return path | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_static_path_from_location(location):\r\n if location is not None:\r\n return u\"/static/{name}\".format(name=location.name)\r\n else:\r\n return None",
"def locateResource(name, loc=\"tbl\", isFile=True, mustExist=True, base=None):\n if mustExist and isFile and os.p... | [
"0.63059545",
"0.58870035",
"0.57867014",
"0.57574975",
"0.5752023",
"0.56901425",
"0.560654",
"0.55420464",
"0.54838985",
"0.5422001",
"0.5389424",
"0.5387648",
"0.53414893",
"0.5296627",
"0.52949095",
"0.52947044",
"0.52462447",
"0.5213336",
"0.5185853",
"0.5149415",
"0.508... | 0.730535 | 0 |
Adds a mask to a dictionary of tensors. | def _add_mask(batch, num_batch_dims):
mask = tf.ones(tf.shape(list(batch.values())[0])[:num_batch_dims])
if "mask" in batch:
mask *= batch["mask"]
batch["mask"] = mask
return batch | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def attention_mask_key(key_mask, num_tile, dtype=tf.float32):\n key_mask = tf.cast(key_mask, dtype)\n key_mask = tf.tile(key_mask, [num_tile, 1]) # (h*N, seqlen)\n key_mask = tf.expand_dims(key_mask, 1) # (h*N, 1, seqlen)\n mask = key_mask * - tf.cast(1e10, dtype)\n return mask",
"def Expand_Mas... | [
"0.63797325",
"0.60069853",
"0.5828103",
"0.57267064",
"0.5698066",
"0.5682244",
"0.568187",
"0.56797856",
"0.56375194",
"0.56301284",
"0.5624282",
"0.5595792",
"0.55565226",
"0.55510443",
"0.55327576",
"0.5527024",
"0.55156976",
"0.54957926",
"0.54877454",
"0.54824936",
"0.5... | 0.6673014 | 0 |
gets the current date | def get_date(self):
return self.date | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_current_date():\n return datetime.datetime.today().strftime(constants.DATE_FORMAT)",
"def getdate():\r\n import datetime\r\n return datetime.datetime.now()",
"def get_date():\n return datetime.datetime.now()",
"def _get_date():\n return datetime.datetime.now()",
"def get_current_... | [
"0.8901928",
"0.8560942",
"0.8339298",
"0.81877",
"0.8158519",
"0.8134809",
"0.81083214",
"0.8052615",
"0.8046193",
"0.80148673",
"0.8012653",
"0.80031914",
"0.79822606",
"0.79757285",
"0.79150814",
"0.78518665",
"0.78123",
"0.77809644",
"0.7777391",
"0.77613634",
"0.7685352"... | 0.7160766 | 57 |
gets the remaining number of data points available to retrieve | def shuffled_data_available(self):
available = 0
for stock in self.unique_data.keys():
available += len(self.unique_data[stock])
return available | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def n_points(self):\n\n if self.data_reduced:\n return len(self.data_reduced[0])\n else:\n return 0",
"def __len__(self): \r\n length = len(self.data) - 2* self.skip_window\r\n #print ('length', length)\r\n return length\r\n #raise NotImpleme... | [
"0.7110319",
"0.70555514",
"0.69371045",
"0.67593426",
"0.67593426",
"0.67593426",
"0.67417103",
"0.66273177",
"0.66191435",
"0.657385",
"0.65373194",
"0.6377821",
"0.6371105",
"0.6363136",
"0.6281178",
"0.6264219",
"0.62554044",
"0.6253623",
"0.62257147",
"0.6213827",
"0.617... | 0.0 | -1 |
Total rewards obtained so far | def total_rewards(self) -> float:
return self.__total_rewards | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def total_reward(self):\n return np.sum(self.rewards)",
"def getTotalReward(self):\n return self.cumreward",
"def getTotalReward(self):\n return self.cumreward",
"def getTotalReward(self):\n return self.lastFitness",
"def get_ave_reward(self):\n return sum(self._gameRewar... | [
"0.81112605",
"0.79923415",
"0.79923415",
"0.7611807",
"0.7320893",
"0.7320893",
"0.7320893",
"0.7193612",
"0.706961",
"0.7020179",
"0.7019914",
"0.6868504",
"0.6851601",
"0.6851601",
"0.6847372",
"0.6839915",
"0.6816528",
"0.6815556",
"0.6806919",
"0.6725671",
"0.67215997",
... | 0.8384159 | 0 |
Validate that the supplied email address is unique for the site. | def clean_email(self):
if User.objects.filter(email__iexact=self.cleaned_data['email']):
raise forms.ValidationError(_("This email address is already in use. Please supply a different email address."))
return self.cleaned_data['email'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_unique_email(email):\n if AssociatedEmail.objects.filter(email=email.lower(), is_primary_email=False):\n raise ValidationError(_(\"User with this email already exists.\"),\n code='email_not_unique',)\n if User.objects.filter(email=email.lower()):\n rais... | [
"0.7853141",
"0.7655458",
"0.75150234",
"0.74791735",
"0.73846847",
"0.7384654",
"0.7372314",
"0.73539346",
"0.72824067",
"0.7252353",
"0.7246325",
"0.7239674",
"0.71946406",
"0.71906227",
"0.71826446",
"0.71657395",
"0.71555",
"0.7150741",
"0.71265936",
"0.7107152",
"0.70523... | 0.71271753 | 18 |
Verifiy that the values entered into the two password fields match. Note that an error here will end up in ``non_field_errors()`` because it doesn't apply to a single field. | def clean(self):
if 'password1' in self.cleaned_data and 'password2' in self.cleaned_data:
if self.cleaned_data['password1'] != self.cleaned_data['password2']:
raise forms.ValidationError(_("The two password fields didn't match."))
return self.cleaned_data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean_password(self):\n password1 = self.cleaned_data.get('password1')\n password2 = self.cleaned_data.get('password2')\n if password1 and password2 and password1 != password2:\n raise forms.ValidationError('Passwords do not match')\n return password2",
"def clean(self)... | [
"0.7940086",
"0.7875071",
"0.7869033",
"0.77356064",
"0.7653496",
"0.7638424",
"0.76268595",
"0.7620595",
"0.76104516",
"0.75970405",
"0.7590136",
"0.75667995",
"0.7566083",
"0.7566083",
"0.7564348",
"0.75485694",
"0.75278497",
"0.74662095",
"0.7378596",
"0.73764795",
"0.7363... | 0.7840069 | 3 |
Clone(itkBinaryGrindPeakImageFilterISS2 self) > itkBinaryGrindPeakImageFilterISS2_Pointer | def Clone(self) -> "itkBinaryGrindPeakImageFilterISS2_Pointer":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterISS2_Clone(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Clone(self) -> \"itkBinaryGrindPeakImageFilterIUC2_Pointer\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUC2_Clone(self)",
"def Clone(self) -> \"itkBinaryGrindPeakImageFilterIUS2_Pointer\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFil... | [
"0.8925642",
"0.85860264",
"0.84538805",
"0.8121555",
"0.80974126",
"0.79202366",
"0.7919423",
"0.78980196",
"0.78436804",
"0.7814346",
"0.77955496",
"0.7679004",
"0.7636388",
"0.75993735",
"0.75958794",
"0.7548792",
"0.75323826",
"0.7531992",
"0.75262773",
"0.749505",
"0.745... | 0.927415 | 0 |
SetFullyConnected(itkBinaryGrindPeakImageFilterISS2 self, bool const _arg) | def SetFullyConnected(self, _arg: 'bool const') -> "void":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterISS2_SetFullyConnected(self, _arg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetFullyConnected(self, _arg: 'bool const') -> \"void\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUC2_SetFullyConnected(self, _arg)",
"def SetFullyConnected(self, _arg: 'bool const') -> \"void\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeak... | [
"0.88861656",
"0.87755585",
"0.87532836",
"0.8215966",
"0.82131344",
"0.7909696",
"0.7538962",
"0.7444286",
"0.7328243",
"0.7263238",
"0.7205376",
"0.713833",
"0.71099645",
"0.70385027",
"0.7025256",
"0.69138503",
"0.6839181",
"0.6836708",
"0.66981024",
"0.6607653",
"0.658542... | 0.9239495 | 0 |
cast(itkLightObject obj) > itkBinaryGrindPeakImageFilterISS2 | def cast(obj: 'itkLightObject') -> "itkBinaryGrindPeakImageFilterISS2 *":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterISS2_cast(obj) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkBinaryGrindPeakImageFilterISS2_cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterISS2 *\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterISS2_cast(obj)",
"def cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterIUC2 *\":\n return _itkBinaryGrind... | [
"0.85718864",
"0.8415509",
"0.82797456",
"0.82647824",
"0.8135406",
"0.81065875",
"0.7960117",
"0.7893481",
"0.7872574",
"0.7689789",
"0.7649803",
"0.76217115",
"0.7556522",
"0.75489926",
"0.7538801",
"0.7518458",
"0.74970675",
"0.74767625",
"0.74686974",
"0.7450991",
"0.7429... | 0.8572363 | 0 |
New() > itkBinaryGrindPeakImageFilterISS2 Create a new object of the class itkBinaryGrindPeakImageFilterISS2 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 paramete... | def New(*args, **kargs):
obj = itkBinaryGrindPeakImageFilterISS2.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkBinaryGrindPeakImageFilterIUC2.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkBinaryGrindPeakImageFilterISS3.__New_orig__()\n import itkTemplate\n i... | [
"0.76755625",
"0.75817704",
"0.74693596",
"0.7308406",
"0.72610563",
"0.7160594",
"0.7134761",
"0.7122668",
"0.7077472",
"0.70544827",
"0.7050623",
"0.7012762",
"0.69964963",
"0.69652486",
"0.69383335",
"0.6930624",
"0.691109",
"0.6900334",
"0.6884688",
"0.68826485",
"0.68697... | 0.8133845 | 0 |
itkBinaryGrindPeakImageFilterISS2_cast(itkLightObject obj) > itkBinaryGrindPeakImageFilterISS2 | def itkBinaryGrindPeakImageFilterISS2_cast(obj: 'itkLightObject') -> "itkBinaryGrindPeakImageFilterISS2 *":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterISS2_cast(obj) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterISS2 *\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterISS2_cast(obj)",
"def cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterIUC2 *\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinar... | [
"0.89928603",
"0.8720781",
"0.8717563",
"0.8568086",
"0.8560796",
"0.82888114",
"0.82768375",
"0.802703",
"0.7947959",
"0.79243535",
"0.7909418",
"0.7872995",
"0.77999234",
"0.7783638",
"0.7765844",
"0.77274173",
"0.7723018",
"0.7720015",
"0.7708329",
"0.77045435",
"0.7687365... | 0.9189573 | 0 |
Clone(itkBinaryGrindPeakImageFilterISS3 self) > itkBinaryGrindPeakImageFilterISS3_Pointer | def Clone(self) -> "itkBinaryGrindPeakImageFilterISS3_Pointer":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterISS3_Clone(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Clone(self) -> \"itkBinaryGrindPeakImageFilterIUC3_Pointer\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUC3_Clone(self)",
"def Clone(self) -> \"itkBinaryGrindPeakImageFilterISS2_Pointer\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFil... | [
"0.8876795",
"0.8712196",
"0.8681507",
"0.8549365",
"0.8177197",
"0.7796697",
"0.7706848",
"0.7663916",
"0.75994253",
"0.758879",
"0.7584328",
"0.7578289",
"0.75310355",
"0.744788",
"0.74244547",
"0.74231935",
"0.7410796",
"0.73855597",
"0.7379846",
"0.7362118",
"0.7330671",
... | 0.9206206 | 0 |
SetFullyConnected(itkBinaryGrindPeakImageFilterISS3 self, bool const _arg) | def SetFullyConnected(self, _arg: 'bool const') -> "void":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterISS3_SetFullyConnected(self, _arg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetFullyConnected(self, _arg: 'bool const') -> \"void\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterISS2_SetFullyConnected(self, _arg)",
"def SetFullyConnected(self, _arg: 'bool const') -> \"void\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeak... | [
"0.8839462",
"0.8828302",
"0.8801879",
"0.8572159",
"0.84500724",
"0.77598864",
"0.74277645",
"0.74099636",
"0.740855",
"0.73987484",
"0.72716755",
"0.72589654",
"0.7163252",
"0.71452016",
"0.7123413",
"0.710868",
"0.7042831",
"0.6921004",
"0.6847232",
"0.68352133",
"0.680525... | 0.9174858 | 0 |
cast(itkLightObject obj) > itkBinaryGrindPeakImageFilterISS3 | def cast(obj: 'itkLightObject') -> "itkBinaryGrindPeakImageFilterISS3 *":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterISS3_cast(obj) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterISS2 *\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterISS2_cast(obj)",
"def cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterIUC2 *\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinar... | [
"0.83918774",
"0.8313914",
"0.82982063",
"0.82657737",
"0.82368094",
"0.82046205",
"0.8198453",
"0.81218636",
"0.80011564",
"0.7973201",
"0.79226327",
"0.7554412",
"0.7499379",
"0.7386012",
"0.7350302",
"0.73500425",
"0.73476493",
"0.7345747",
"0.73181915",
"0.73059756",
"0.7... | 0.83645284 | 1 |
New() > itkBinaryGrindPeakImageFilterISS3 Create a new object of the class itkBinaryGrindPeakImageFilterISS3 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 paramete... | def New(*args, **kargs):
obj = itkBinaryGrindPeakImageFilterISS3.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkBinaryGrindPeakImageFilterIUC3.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkBinaryGrindPeakImageFilterIUS3.__New_orig__()\n import itkTemplate\n i... | [
"0.77052885",
"0.74059755",
"0.73619866",
"0.7322838",
"0.7241379",
"0.72388697",
"0.72187215",
"0.7217179",
"0.7203237",
"0.71927404",
"0.71362114",
"0.7126715",
"0.7120892",
"0.7110622",
"0.7075773",
"0.7053308",
"0.70055723",
"0.70008034",
"0.6981112",
"0.6961312",
"0.6956... | 0.7934171 | 0 |
itkBinaryGrindPeakImageFilterISS3_cast(itkLightObject obj) > itkBinaryGrindPeakImageFilterISS3 | def itkBinaryGrindPeakImageFilterISS3_cast(obj: 'itkLightObject') -> "itkBinaryGrindPeakImageFilterISS3 *":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterISS3_cast(obj) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterISS3 *\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterISS3_cast(obj)",
"def cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterIUC3 *\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinar... | [
"0.8923842",
"0.8732757",
"0.8706479",
"0.8652369",
"0.86211795",
"0.8570539",
"0.85544276",
"0.8458835",
"0.8390562",
"0.8303943",
"0.81954145",
"0.7726904",
"0.7704856",
"0.76706153",
"0.7645125",
"0.76355743",
"0.7606523",
"0.75840926",
"0.756631",
"0.75658065",
"0.7561536... | 0.9088993 | 0 |
Clone(itkBinaryGrindPeakImageFilterIUC2 self) > itkBinaryGrindPeakImageFilterIUC2_Pointer | def Clone(self) -> "itkBinaryGrindPeakImageFilterIUC2_Pointer":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUC2_Clone(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Clone(self) -> \"itkBinaryGrindPeakImageFilterISS2_Pointer\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterISS2_Clone(self)",
"def Clone(self) -> \"itkBinaryGrindPeakImageFilterIUS2_Pointer\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFil... | [
"0.8732643",
"0.8692721",
"0.8398516",
"0.8289617",
"0.8217488",
"0.81512654",
"0.8129832",
"0.80586934",
"0.80358183",
"0.79686373",
"0.79457235",
"0.79124117",
"0.78388906",
"0.7832553",
"0.7758662",
"0.77506787",
"0.7743077",
"0.7739696",
"0.76403356",
"0.76240003",
"0.758... | 0.93139046 | 0 |
SetFullyConnected(itkBinaryGrindPeakImageFilterIUC2 self, bool const _arg) | def SetFullyConnected(self, _arg: 'bool const') -> "void":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUC2_SetFullyConnected(self, _arg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetFullyConnected(self, _arg: 'bool const') -> \"void\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUS2_SetFullyConnected(self, _arg)",
"def SetFullyConnected(self, _arg: 'bool const') -> \"void\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeak... | [
"0.8827381",
"0.87816393",
"0.85334456",
"0.847451",
"0.8373766",
"0.79267216",
"0.75815964",
"0.7479199",
"0.7385737",
"0.73551375",
"0.7219622",
"0.7100234",
"0.70545423",
"0.6944103",
"0.6926366",
"0.68915945",
"0.68093055",
"0.67819303",
"0.67486167",
"0.6726849",
"0.6672... | 0.9213735 | 0 |
cast(itkLightObject obj) > itkBinaryGrindPeakImageFilterIUC2 | def cast(obj: 'itkLightObject') -> "itkBinaryGrindPeakImageFilterIUC2 *":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUC2_cast(obj) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkBinaryGrindPeakImageFilterIUC2_cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterIUC2 *\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUC2_cast(obj)",
"def cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterIUS2 *\":\n return _itkBinaryGrind... | [
"0.8729429",
"0.82718897",
"0.8245691",
"0.8222527",
"0.819831",
"0.8100178",
"0.7957307",
"0.78505766",
"0.78434855",
"0.78395414",
"0.783381",
"0.78218013",
"0.77981573",
"0.77527916",
"0.7731006",
"0.7727938",
"0.7705051",
"0.7648252",
"0.764342",
"0.7640949",
"0.7631519",... | 0.86969626 | 1 |
New() > itkBinaryGrindPeakImageFilterIUC2 Create a new object of the class itkBinaryGrindPeakImageFilterIUC2 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 paramete... | def New(*args, **kargs):
obj = itkBinaryGrindPeakImageFilterIUC2.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkBinaryGrindPeakImageFilterISS2.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkHuangThresholdImageFilterIUC2IUC2.__New_orig__()\n import itkTemplate\n ... | [
"0.7590048",
"0.7578962",
"0.7526749",
"0.7460817",
"0.7446953",
"0.7434069",
"0.7409818",
"0.7396386",
"0.7385937",
"0.7380007",
"0.735464",
"0.7314156",
"0.7244954",
"0.71897155",
"0.71630746",
"0.7156564",
"0.71451294",
"0.7132676",
"0.7131984",
"0.7121352",
"0.7098518",
... | 0.8144624 | 0 |
itkBinaryGrindPeakImageFilterIUC2_cast(itkLightObject obj) > itkBinaryGrindPeakImageFilterIUC2 | def itkBinaryGrindPeakImageFilterIUC2_cast(obj: 'itkLightObject') -> "itkBinaryGrindPeakImageFilterIUC2 *":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUC2_cast(obj) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterIUC2 *\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUC2_cast(obj)",
"def itkBinaryGrindPeakImageFilterIUS2_cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterIUS2 *\":\n return _itkBinaryGrind... | [
"0.9041367",
"0.8575325",
"0.85048246",
"0.8471235",
"0.8373859",
"0.8289397",
"0.8267589",
"0.8225154",
"0.8221371",
"0.8096129",
"0.80954903",
"0.8077476",
"0.8034777",
"0.80104095",
"0.79891664",
"0.79883784",
"0.7982099",
"0.795264",
"0.79484487",
"0.7916014",
"0.79144746... | 0.93165183 | 0 |
Clone(itkBinaryGrindPeakImageFilterIUC3 self) > itkBinaryGrindPeakImageFilterIUC3_Pointer | def Clone(self) -> "itkBinaryGrindPeakImageFilterIUC3_Pointer":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUC3_Clone(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Clone(self) -> \"itkBinaryGrindPeakImageFilterISS3_Pointer\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterISS3_Clone(self)",
"def Clone(self) -> \"itkBinaryGrindPeakImageFilterIUS3_Pointer\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFil... | [
"0.8862799",
"0.8846645",
"0.8477491",
"0.817248",
"0.80255",
"0.79897946",
"0.7985236",
"0.7909239",
"0.7895415",
"0.7878183",
"0.7845289",
"0.78425574",
"0.78375685",
"0.78125536",
"0.78101474",
"0.78078914",
"0.7751362",
"0.76439524",
"0.75996035",
"0.7582764",
"0.75056076... | 0.92937905 | 0 |
SetFullyConnected(itkBinaryGrindPeakImageFilterIUC3 self, bool const _arg) | def SetFullyConnected(self, _arg: 'bool const') -> "void":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUC3_SetFullyConnected(self, _arg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetFullyConnected(self, _arg: 'bool const') -> \"void\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUS3_SetFullyConnected(self, _arg)",
"def SetFullyConnected(self, _arg: 'bool const') -> \"void\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeak... | [
"0.8988938",
"0.88599473",
"0.8535825",
"0.8220513",
"0.8084027",
"0.7953736",
"0.7706058",
"0.7627464",
"0.762129",
"0.75994587",
"0.7423183",
"0.7311595",
"0.7279888",
"0.72567064",
"0.72148347",
"0.70198226",
"0.68657404",
"0.67372143",
"0.6720947",
"0.67061955",
"0.657452... | 0.9174264 | 0 |
GetBackgroundValue(itkBinaryGrindPeakImageFilterIUC3 self) > unsigned char | def GetBackgroundValue(self) -> "unsigned char":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUC3_GetBackgroundValue(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetBackgroundValue(self) -> \"unsigned char\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUC2_GetBackgroundValue(self)",
"def GetBackgroundValue(self) -> \"unsigned short\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUS3_GetBackg... | [
"0.89356005",
"0.8534703",
"0.8426723",
"0.84104747",
"0.83192235",
"0.8272547",
"0.8207836",
"0.8169306",
"0.8129366",
"0.79510707",
"0.79173654",
"0.7619456",
"0.7603041",
"0.7596908",
"0.75591356",
"0.75538707",
"0.75222373",
"0.7467384",
"0.7354986",
"0.7330427",
"0.73132... | 0.90777147 | 0 |
cast(itkLightObject obj) > itkBinaryGrindPeakImageFilterIUC3 | def cast(obj: 'itkLightObject') -> "itkBinaryGrindPeakImageFilterIUC3 *":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUC3_cast(obj) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkBinaryGrindPeakImageFilterIUC3_cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterIUC3 *\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUC3_cast(obj)",
"def cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterIUC2 *\":\n return _itkBinaryGrind... | [
"0.8597664",
"0.8399665",
"0.8364652",
"0.8332195",
"0.8327759",
"0.8311556",
"0.8229066",
"0.8052296",
"0.7958038",
"0.78646666",
"0.7795486",
"0.76999813",
"0.765983",
"0.76414806",
"0.7627056",
"0.7594754",
"0.7584091",
"0.7580591",
"0.75760794",
"0.755111",
"0.754918",
... | 0.86387855 | 0 |
New() > itkBinaryGrindPeakImageFilterIUC3 Create a new object of the class itkBinaryGrindPeakImageFilterIUC3 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 paramete... | def New(*args, **kargs):
obj = itkBinaryGrindPeakImageFilterIUC3.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkHuangThresholdImageFilterIUC3IUC3.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkHuangThresholdImageFilterIUC3IUS3.__New_orig__()\n import itkTemplate\n ... | [
"0.76815534",
"0.76078093",
"0.7597328",
"0.75721437",
"0.75483376",
"0.75231814",
"0.7506337",
"0.7465791",
"0.74426514",
"0.74089247",
"0.73875415",
"0.7386567",
"0.7384847",
"0.73598874",
"0.7330515",
"0.73096436",
"0.72982085",
"0.72821254",
"0.7235362",
"0.7222636",
"0.7... | 0.8093238 | 0 |
itkBinaryGrindPeakImageFilterIUC3_cast(itkLightObject obj) > itkBinaryGrindPeakImageFilterIUC3 | def itkBinaryGrindPeakImageFilterIUC3_cast(obj: 'itkLightObject') -> "itkBinaryGrindPeakImageFilterIUC3 *":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUC3_cast(obj) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterIUC3 *\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUC3_cast(obj)",
"def itkBinaryGrindPeakImageFilterIUS3_cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterIUS3 *\":\n return _itkBinaryGrind... | [
"0.9006677",
"0.8740094",
"0.87201196",
"0.86231756",
"0.85207313",
"0.85121006",
"0.8416255",
"0.80824816",
"0.8004674",
"0.7960213",
"0.7934037",
"0.7896872",
"0.78956884",
"0.7891577",
"0.7878281",
"0.7870418",
"0.78671503",
"0.7866906",
"0.7832205",
"0.78220475",
"0.78068... | 0.9261055 | 0 |
Clone(itkBinaryGrindPeakImageFilterIUS2 self) > itkBinaryGrindPeakImageFilterIUS2_Pointer | def Clone(self) -> "itkBinaryGrindPeakImageFilterIUS2_Pointer":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUS2_Clone(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Clone(self) -> \"itkBinaryGrindPeakImageFilterIUC2_Pointer\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUC2_Clone(self)",
"def Clone(self) -> \"itkBinaryGrindPeakImageFilterISS2_Pointer\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFil... | [
"0.88420725",
"0.8597294",
"0.85428566",
"0.81022936",
"0.805526",
"0.7972036",
"0.7965567",
"0.79295146",
"0.7907425",
"0.789911",
"0.78637516",
"0.75674045",
"0.7545655",
"0.75410444",
"0.7489191",
"0.7429045",
"0.7421937",
"0.7386206",
"0.73724234",
"0.7333426",
"0.7328995... | 0.92587835 | 0 |
SetFullyConnected(itkBinaryGrindPeakImageFilterIUS2 self, bool const _arg) | def SetFullyConnected(self, _arg: 'bool const') -> "void":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUS2_SetFullyConnected(self, _arg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetFullyConnected(self, _arg: 'bool const') -> \"void\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUC2_SetFullyConnected(self, _arg)",
"def SetFullyConnected(self, _arg: 'bool const') -> \"void\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeak... | [
"0.8852804",
"0.8770752",
"0.86809474",
"0.84747845",
"0.83220464",
"0.7546128",
"0.73816156",
"0.73266965",
"0.7299612",
"0.72175753",
"0.71663886",
"0.70034647",
"0.68833935",
"0.68630296",
"0.68418735",
"0.67994416",
"0.67557114",
"0.67255145",
"0.66571516",
"0.6612578",
"... | 0.9231529 | 0 |
cast(itkLightObject obj) > itkBinaryGrindPeakImageFilterIUS2 | def cast(obj: 'itkLightObject') -> "itkBinaryGrindPeakImageFilterIUS2 *":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUS2_cast(obj) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkBinaryGrindPeakImageFilterIUS2_cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterIUS2 *\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUS2_cast(obj)",
"def cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterIUC2 *\":\n return _itkBinaryGrind... | [
"0.86766297",
"0.8407279",
"0.831999",
"0.82932925",
"0.8277896",
"0.8237853",
"0.8048517",
"0.7932627",
"0.7917771",
"0.7794567",
"0.77796495",
"0.777566",
"0.7695316",
"0.76405394",
"0.7601407",
"0.75079626",
"0.7502785",
"0.7497994",
"0.74612045",
"0.7460025",
"0.7448611",... | 0.8698061 | 0 |
New() > itkBinaryGrindPeakImageFilterIUS2 Create a new object of the class itkBinaryGrindPeakImageFilterIUS2 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 paramete... | def New(*args, **kargs):
obj = itkBinaryGrindPeakImageFilterIUS2.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkBinaryGrindPeakImageFilterIUC2.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkBinaryGrindPeakImageFilterISS2.__New_orig__()\n import itkTemplate\n i... | [
"0.7882058",
"0.7793295",
"0.76868206",
"0.73569304",
"0.73537314",
"0.73399514",
"0.73374856",
"0.7240598",
"0.71629566",
"0.7160941",
"0.7158536",
"0.7134235",
"0.71229523",
"0.7119372",
"0.71056694",
"0.71010363",
"0.7073679",
"0.700835",
"0.69610304",
"0.69060105",
"0.690... | 0.8162599 | 0 |
itkBinaryGrindPeakImageFilterIUS2_cast(itkLightObject obj) > itkBinaryGrindPeakImageFilterIUS2 | def itkBinaryGrindPeakImageFilterIUS2_cast(obj: 'itkLightObject') -> "itkBinaryGrindPeakImageFilterIUS2 *":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUS2_cast(obj) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterIUS2 *\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUS2_cast(obj)",
"def itkBinaryGrindPeakImageFilterIUC2_cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterIUC2 *\":\n return _itkBinaryGrind... | [
"0.90395874",
"0.8700136",
"0.8639672",
"0.8570773",
"0.84592086",
"0.8369406",
"0.83655405",
"0.80681044",
"0.80042255",
"0.79196846",
"0.7913727",
"0.78854436",
"0.7882197",
"0.7875907",
"0.77721035",
"0.7760337",
"0.7726943",
"0.7721212",
"0.7697834",
"0.76789397",
"0.7657... | 0.92287165 | 0 |
Clone(itkBinaryGrindPeakImageFilterIUS3 self) > itkBinaryGrindPeakImageFilterIUS3_Pointer | def Clone(self) -> "itkBinaryGrindPeakImageFilterIUS3_Pointer":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUS3_Clone(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Clone(self) -> \"itkBinaryGrindPeakImageFilterIUS2_Pointer\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUS2_Clone(self)",
"def Clone(self) -> \"itkBinaryGrindPeakImageFilterIUC3_Pointer\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFil... | [
"0.8766165",
"0.87575215",
"0.85900646",
"0.83742493",
"0.8004635",
"0.7781406",
"0.7698886",
"0.768004",
"0.76562583",
"0.7649845",
"0.7640672",
"0.7587221",
"0.75612503",
"0.7504697",
"0.7501542",
"0.74947387",
"0.7447628",
"0.7366007",
"0.72788644",
"0.7267075",
"0.722716"... | 0.9182748 | 0 |
SetFullyConnected(itkBinaryGrindPeakImageFilterIUS3 self, bool const _arg) | def SetFullyConnected(self, _arg: 'bool const') -> "void":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUS3_SetFullyConnected(self, _arg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetFullyConnected(self, _arg: 'bool const') -> \"void\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUC3_SetFullyConnected(self, _arg)",
"def SetFullyConnected(self, _arg: 'bool const') -> \"void\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeak... | [
"0.8859103",
"0.8856352",
"0.8806219",
"0.8535786",
"0.8372453",
"0.7570174",
"0.7391265",
"0.7353059",
"0.7315231",
"0.72554386",
"0.7174828",
"0.70810765",
"0.70442766",
"0.7014054",
"0.6974452",
"0.69253606",
"0.69101167",
"0.68560815",
"0.68213063",
"0.68108445",
"0.67246... | 0.9150167 | 0 |
cast(itkLightObject obj) > itkBinaryGrindPeakImageFilterIUS3 | def cast(obj: 'itkLightObject') -> "itkBinaryGrindPeakImageFilterIUS3 *":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUS3_cast(obj) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterIUS2 *\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUS2_cast(obj)",
"def itkBinaryGrindPeakImageFilterIUS3_cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterIUS3 *\":\n return _itkBinaryGrind... | [
"0.8517594",
"0.84254897",
"0.84155124",
"0.83131754",
"0.8285704",
"0.8269661",
"0.81935686",
"0.8147762",
"0.8134531",
"0.8130955",
"0.8022923",
"0.7671403",
"0.7585557",
"0.7571817",
"0.7514587",
"0.7432766",
"0.74060863",
"0.7375732",
"0.7370226",
"0.7357456",
"0.7343532"... | 0.85536873 | 0 |
New() > itkBinaryGrindPeakImageFilterIUS3 Create a new object of the class itkBinaryGrindPeakImageFilterIUS3 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 paramete... | def New(*args, **kargs):
obj = itkBinaryGrindPeakImageFilterIUS3.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkBinaryGrindPeakImageFilterIUC3.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkBinaryGrindPeakImageFilterISS3.__New_orig__()\n import itkTemplate\n i... | [
"0.7864564",
"0.76295394",
"0.74288356",
"0.7403234",
"0.73679817",
"0.7330997",
"0.73224014",
"0.72757417",
"0.7253312",
"0.7230051",
"0.719004",
"0.71510935",
"0.7141664",
"0.713156",
"0.7126638",
"0.7117754",
"0.704284",
"0.69730353",
"0.6911727",
"0.689908",
"0.68907726",... | 0.80100465 | 0 |
itkBinaryGrindPeakImageFilterIUS3_cast(itkLightObject obj) > itkBinaryGrindPeakImageFilterIUS3 | def itkBinaryGrindPeakImageFilterIUS3_cast(obj: 'itkLightObject') -> "itkBinaryGrindPeakImageFilterIUS3 *":
return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUS3_cast(obj) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterIUS3 *\":\n return _itkBinaryGrindPeakImageFilterPython.itkBinaryGrindPeakImageFilterIUS3_cast(obj)",
"def itkBinaryGrindPeakImageFilterIUC3_cast(obj: 'itkLightObject') -> \"itkBinaryGrindPeakImageFilterIUC3 *\":\n return _itkBinaryGrind... | [
"0.89776754",
"0.875917",
"0.86927044",
"0.86782396",
"0.86396724",
"0.8596644",
"0.85315394",
"0.82759166",
"0.8267506",
"0.7979505",
"0.7925907",
"0.77322257",
"0.77180076",
"0.7717646",
"0.76103073",
"0.75721395",
"0.7548538",
"0.754839",
"0.7539177",
"0.7527868",
"0.75274... | 0.9147029 | 0 |
Convert datetime to string | def get_crpp_date(dtThis):
# Model: yyyy-MM-dd'T'HH:mm:ss
sDate = dtThis.strftime("%Y-%m-%dT%H:%M:%S")
return sDate | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def datetime_to_str(obj):\n return obj.strftime(\"%Y-%m-%d %H:%M:%S\")",
"def datetime_to_str(date_time):\n\n\treturn (date_time.strftime(\"%Y-%m-%dT%H:%M:%S.%fZ\"))",
"def convert_datetime_to_string(dt):\n\treturn '{0}-{1}-{2}'.format(dt.year, dt.month, dt.day)",
"def convert_datetime_to_string(dt):\n\tr... | [
"0.815902",
"0.80510914",
"0.8046754",
"0.8046754",
"0.80430394",
"0.7809829",
"0.7701866",
"0.7684149",
"0.7662111",
"0.7654658",
"0.7584085",
"0.756532",
"0.7561354",
"0.7544618",
"0.754069",
"0.7539123",
"0.7510419",
"0.74905056",
"0.74707377",
"0.73240894",
"0.7319827",
... | 0.0 | -1 |
Utility to find Spotify resource_provider instance in the resource_manager. | def get_spotify_provider():
provider_path = 'elisa.plugins.spotify.resource_provider:SpotifyResourceProvider'
manager = common.application.resource_manager
provider = manager.get_resource_provider_by_path(provider_path)
return provider | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_resource_provider(self, uuid):\n resp = self.get(\"/resource_providers/%s\" % uuid)\n if resp.status_code == 200:\n data = resp.json()\n return objects.ResourceProvider(\n uuid=uuid,\n name=data['name'],\n generat... | [
"0.6656658",
"0.6474095",
"0.64571875",
"0.63537645",
"0.6143773",
"0.6137012",
"0.60670763",
"0.59830105",
"0.58492106",
"0.58332294",
"0.5823978",
"0.5823978",
"0.5814655",
"0.581047",
"0.5772117",
"0.5765059",
"0.56737345",
"0.5583717",
"0.5514415",
"0.5514415",
"0.5504045... | 0.7855766 | 0 |
Constructor for the LabelSmoothing module. | def __init__(self, smoothing=0.1):
super(LabelSmoothing, self).__init__()
self.confidence = 1.0 - smoothing
self.smoothing = smoothing | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, smoothing=0.0):\n super(LabelSmoothing, self).__init__()\n self.confidence = 1.0 - smoothing\n self.smoothing = smoothing",
"def __init__(self, smoothing=0.0):\n super(LabelSmoothing, self).__init__()\n self.confidence = 1.0 - smoothing\n self.smoothin... | [
"0.8505097",
"0.8505097",
"0.7740796",
"0.76720005",
"0.6831716",
"0.6535184",
"0.64484084",
"0.6373303",
"0.6344245",
"0.6325938",
"0.6322719",
"0.6288337",
"0.61676824",
"0.616322",
"0.6125794",
"0.60863334",
"0.60729283",
"0.60607344",
"0.59531105",
"0.59465086",
"0.591395... | 0.85014725 | 2 |
Round a number and return as int. | def rint(a: Number) -> int:
return np.round(a).astype(int) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def round_int(num):\n try:\n float(num)\n except TypeError:\n _logger.debug(\"error trying to convert %s to number\" % (str(num)))\n raise pythonerror(\"#syntaxerror\")\n\n if int(float(num)) == num:\n return int(num)\n else:\n if float(num) < 0:\n _nn = in... | [
"0.7689237",
"0.721122",
"0.7180295",
"0.7178572",
"0.71360165",
"0.7012079",
"0.69322276",
"0.6926029",
"0.68270856",
"0.67484105",
"0.6743091",
"0.67159003",
"0.66163",
"0.6562026",
"0.6539934",
"0.64703447",
"0.64589244",
"0.6457436",
"0.6408609",
"0.6383739",
"0.6379456",... | 0.7130756 | 5 |
Handles an empty string passed as argument | def test_handles_empty_string(self):
result = encode_run_length("")
self.assertEqual(result, "") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __call__(self, value):\n value = str(value).strip()\n\n if len(value) == 0:\n pass\n\n else:\n super().__call__(value)",
"def handle_empty_string(item):\n\n convert_to_string = str(item)\n\n return None if len(convert_to_string.strip()) == 0 or convert_to_stri... | [
"0.75953496",
"0.71057844",
"0.69147646",
"0.6846267",
"0.6819083",
"0.68100876",
"0.67331797",
"0.65884864",
"0.6581572",
"0.6546589",
"0.65322596",
"0.6502848",
"0.64975566",
"0.6495991",
"0.64911824",
"0.64739746",
"0.643346",
"0.64297974",
"0.6420964",
"0.64032257",
"0.63... | 0.61686206 | 37 |
Ensure that only objects with a licence matching the user are returned | def get_uc2_entries(user):
license_perms = License.objects.all().select_related("view_permission")
license_set = set()
for license_perm in license_perms:
perm_string = license_perm.view_permission.codename
license_set.add(perm_string)
# license
uc2_entries = get_objects_for_user(use... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean(self):\n data = super().clean()\n if (str(self.instance.resource_type.id) in data['license'].resource_types\n and data['access_policy'] == data['license'].access_policy):\n return data\n\n raise forms.ValidationError('Invalid policy license combination.')",
... | [
"0.58524394",
"0.5701066",
"0.55575097",
"0.54962546",
"0.54400456",
"0.5409029",
"0.54035246",
"0.5398727",
"0.5388406",
"0.53652936",
"0.53466463",
"0.5335267",
"0.53170866",
"0.53054684",
"0.5305267",
"0.52991354",
"0.5292588",
"0.5289807",
"0.5283852",
"0.5272876",
"0.526... | 0.0 | -1 |
Get internal data frame of trajectory. | def __data_frame(self):
return self._trajectory | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_raw_data(self, idx=0):\n # Get the time step then make a data frame\n raise NotImplementedError('Code me up!')\n #data = self._data[???]\n return data",
"def dataframe(self):\n\t\treturn self._dataframe",
"def dataFrame(self):\n return self._dataFrame",
"def datafr... | [
"0.7426966",
"0.70600194",
"0.69820315",
"0.69620925",
"0.6873473",
"0.68183285",
"0.67601174",
"0.66516894",
"0.6628261",
"0.6597061",
"0.65691066",
"0.64855856",
"0.6479818",
"0.6411853",
"0.63866204",
"0.63653815",
"0.6358235",
"0.6321551",
"0.63025594",
"0.6267579",
"0.62... | 0.8666503 | 0 |
Cumulative reward of the trajectory. | def average_reward(self):
T = len(self)
return np.sum(self.rewards / T) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate_cumulative_reward(self, gamma: float = 1.0):\n num_transitions = len(self)\n assert num_transitions > 0, \"called on empty trajectory\"\n rewards = self.reward\n discounts = [gamma**i for i in range(num_transitions)]\n return sum(reward * discount for reward, discou... | [
"0.79235786",
"0.7600248",
"0.75553286",
"0.75553286",
"0.73449546",
"0.7276127",
"0.72409505",
"0.7213243",
"0.71849245",
"0.7122892",
"0.70538735",
"0.7037944",
"0.7027323",
"0.70200735",
"0.6859662",
"0.68517745",
"0.6838638",
"0.68339366",
"0.68273705",
"0.6825384",
"0.68... | 0.0 | -1 |
Cumulative reward of the trajectory. | def total_reward(self):
return np.sum(self.rewards) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate_cumulative_reward(self, gamma: float = 1.0):\n num_transitions = len(self)\n assert num_transitions > 0, \"called on empty trajectory\"\n rewards = self.reward\n discounts = [gamma**i for i in range(num_transitions)]\n return sum(reward * discount for reward, discou... | [
"0.79235786",
"0.7600248",
"0.75553286",
"0.75553286",
"0.73449546",
"0.7276127",
"0.72409505",
"0.7213243",
"0.71849245",
"0.7122892",
"0.70538735",
"0.7037944",
"0.7027323",
"0.70200735",
"0.6859662",
"0.68517745",
"0.6838638",
"0.68339366",
"0.68273705",
"0.6825384",
"0.68... | 0.64825445 | 58 |
Cumulative reward of the trajectory. | def discounted_reward(self, discount):
tl = len(self)
return (1 - discount) * np.sum(discount ** np.arange(tl) * self.rewards) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate_cumulative_reward(self, gamma: float = 1.0):\n num_transitions = len(self)\n assert num_transitions > 0, \"called on empty trajectory\"\n rewards = self.reward\n discounts = [gamma**i for i in range(num_transitions)]\n return sum(reward * discount for reward, discou... | [
"0.79235786",
"0.7600248",
"0.75553286",
"0.75553286",
"0.73449546",
"0.7276127",
"0.72409505",
"0.7213243",
"0.71849245",
"0.7122892",
"0.70538735",
"0.7037944",
"0.7027323",
"0.70200735",
"0.6859662",
"0.68517745",
"0.6838638",
"0.68339366",
"0.68273705",
"0.6825384",
"0.68... | 0.0 | -1 |
Linear loss function, naive implementation (with loops) Inputs have dimension D, there are N examples. | def linear_loss_naive(W, X, y, reg):
# Initialize the loss and gradient to zero.
loss = 0.0
dW = np.zeros_like(W)
#############################################################################
# TODO: Compute the linear loss and its gradient using explicit loops. #
# Store the loss in loss a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def l1_loss(D, G, real_data, generated_data, losses, options):\n return torch.nn.L1Loss()(generated_data, real_data)",
"def nll_loss(\n inputs,\n axis=1,\n ignore_index=None,\n reduction='valid',\n **kwargs\n):\n args = ArgHelper.parse(locals())\n args['reduction'] = reduction.upper()\n ... | [
"0.70255506",
"0.6862295",
"0.6483021",
"0.63896585",
"0.63722295",
"0.63109964",
"0.6235679",
"0.622537",
"0.61884075",
"0.61737955",
"0.6165907",
"0.6148951",
"0.61382896",
"0.6095585",
"0.6083436",
"0.60462224",
"0.59896874",
"0.59839773",
"0.5971675",
"0.5964857",
"0.5958... | 0.66878414 | 2 |
return list of articles | def articles():
tem = jinjaEnv.get_template("articles.html")
h = tem.render(
articleList = getArticles(),
)
return h | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def articles(self):\n return articles.Articles(self)",
"def articles(self):\r\n return articles.Articles(self)",
"def list_articles():\n\n return template(\"index\", articles=get_articles())",
"def list():\r\n articles = []\r\n if request.method == 'GET':\r\n # Get all articles\... | [
"0.81118023",
"0.81084186",
"0.80087215",
"0.7990941",
"0.7942128",
"0.7909345",
"0.78275144",
"0.77109367",
"0.7700316",
"0.7658915",
"0.7572116",
"0.7562268",
"0.7549797",
"0.74023247",
"0.73470825",
"0.7338978",
"0.7330949",
"0.73240846",
"0.72791016",
"0.7245549",
"0.7221... | 0.7704525 | 8 |
Gets the data and the cutoff and return the true and false values of the max | def spec_to_peaks(data, value, fp = iterate_structure(generate_binary_structure(rank = 2, connectivity=2), 10)):
max_arr = maximum_filter(data, footprint = fp)
return (data == max_arr) & (data > value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Max(data):\n return data.max()",
"def max():\n valid=result_alpha.F>0\n src_data.F[valid]=np.maximum( src_data.F[valid],result_data.F[valid] )",
"def _single_value_max(data, threshold):\r\n amin = np.min(data)\r\n amax = np.max(data)\r\n limit = amax - (amax - amin... | [
"0.7253256",
"0.69861084",
"0.68490386",
"0.68353945",
"0.6744364",
"0.67174274",
"0.66939205",
"0.6605674",
"0.6597477",
"0.65972984",
"0.65530556",
"0.6525529",
"0.6500432",
"0.64816195",
"0.6457462",
"0.6454499",
"0.6451798",
"0.64447767",
"0.6371153",
"0.63674265",
"0.635... | 0.0 | -1 |
Return the name of the entity. | def name(self):
if self.resource.is_client:
return f"{self.network.name} {self.resource.name_connection_type} {SWITCH_TYPES[self.variable][0]}"
elif self.resource.is_eero or self.resource.is_profile:
return f"{self.network.name} {self.resource.name} {SWITCH_TYPES[self.variable][0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def entity_name(self):\n return self.__entity_name",
"def entity_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"entity_name\")",
"def entity_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"entity_name\")",
"def name(self):\n return \"{} {}\".format(self.... | [
"0.8988398",
"0.83023036",
"0.83023036",
"0.7979217",
"0.7969564",
"0.75555485",
"0.7543831",
"0.7536042",
"0.7536042",
"0.7536042",
"0.75337434",
"0.75239676",
"0.7496596",
"0.74891084",
"0.74777347",
"0.74761146",
"0.7462404",
"0.74502766",
"0.74502766",
"0.74502766",
"0.74... | 0.0 | -1 |
Return the class of this device, from component DEVICE_CLASSES. | def device_class(self):
return DEVICE_CLASS_SWITCH | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def device_class(self):\n return DEVICE_CLASSES.get(self.sensor_data[\"model\"])",
"def device_class(self):\n return self.sensor_type[\"class\"]",
"def device_class(self):\n return SENSOR_TYPES[self.sensor][3].get(\"device_class\")",
"def get_class(self):\n return devices.get_clas... | [
"0.87266827",
"0.852074",
"0.8471363",
"0.8442806",
"0.83113384",
"0.83078414",
"0.8241434",
"0.8241434",
"0.8241434",
"0.8241434",
"0.8241434",
"0.8197917",
"0.81939846",
"0.8125181",
"0.8109455",
"0.8109455",
"0.8109455",
"0.8059611",
"0.8053818",
"0.8053818",
"0.80360585",... | 0.74936664 | 33 |
Method that takes in a account_name and returns a credential that matches that account_name. | def find_credential(cls, account):
for credential in cls.credential_list:
if credential.account == account:
return credential | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_credential(account):\n return Credentials.find_by_username(account)",
"def find_credential(account):\n return Credentials.find_credential(account)",
"def find_by_account_name(cls, account_name):\n for account in cls.credentials_list:\n if account.account_name == account_name:\n... | [
"0.8098947",
"0.78015816",
"0.75848585",
"0.7533741",
"0.7345407",
"0.7099223",
"0.7058192",
"0.68899024",
"0.6813482",
"0.67732596",
"0.6710552",
"0.66674626",
"0.6582527",
"0.65544134",
"0.648282",
"0.644849",
"0.64300513",
"0.64049256",
"0.6320072",
"0.6308408",
"0.6101349... | 0.75223625 | 4 |
Converts date strings into datetime format | def convert_date_string(df,col_name):
df[col_name] = pd.to_datetime(df[col_name], infer_datetime_format=True)
return df | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_date_type(dates):\n try:\n return datetime.strptime(dates, '%Y-%m-%d')\n except ValueError:\n return datetime.strptime(dates, '%d/%m/%Y')",
"def datemake(datestring):\n return dtt.datetime.strptime(datestring,'%m/%d/%Y')",
"def convert_date(date_str):\n return datetime.str... | [
"0.7161522",
"0.7031803",
"0.69314915",
"0.69310683",
"0.692899",
"0.69234216",
"0.6892844",
"0.67555624",
"0.67394334",
"0.673222",
"0.67301404",
"0.6715539",
"0.6692217",
"0.6646435",
"0.6614729",
"0.6548035",
"0.65125006",
"0.648393",
"0.641785",
"0.6411302",
"0.64026594",... | 0.0 | -1 |
Creates an additional columns 'tokens' to the dataset. It contains a list of stemmed and lemmatized tokens. | def tokenize(dataset_path: str) -> str:
dtypes = {
"id": int,
"keyword": str,
"location": str,
"text": str
}
if "train" in dataset_path:
dtypes["target"] = int
new_path = _make_new_filepath(dataset_path, "tokenized")
df = pd.read_csv(f"/data/{dataset_path}",... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tokenization(dataframe):\n nlp = English()\n tokenizer = nlp.Defaults.create_tokenizer(nlp)\n stemmer = SnowballStemmer(\"english\")\n\n dataframe.loc[:, \"tokens\"] = dataframe.loc[:, \"content\"].apply(\n lambda cell: [\n token.lemma_\n for token in tokenizer(cell)\n ... | [
"0.6494572",
"0.6389808",
"0.63039017",
"0.6254563",
"0.6243018",
"0.6138968",
"0.6120583",
"0.60892904",
"0.60040784",
"0.5983506",
"0.59746194",
"0.5874366",
"0.5872793",
"0.5872026",
"0.5870165",
"0.58513236",
"0.58356553",
"0.5794141",
"0.5774568",
"0.57506484",
"0.571476... | 0.5655413 | 23 |
Applies stopwords removal to the 'tokens' colums for each dataset row. | def remove_stopwords(dataset_path: str) -> str:
dtypes = {
"id": int,
"keyword": str,
"location": str,
"text": str,
"text_stemmed": str,
"text_lemmatized": str,
}
if "train" in dataset_path:
dtypes["target"] = int
def _rm_stopwords(tokens: List[s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _remove_stopwords(data, settings):\n column = settings['input_col']\n output_col = settings['output_col']\n frag = settings['id_frag']\n\n stopwords = settings['news_stops_words']\n stopwords += settings['stopwords']\n stopwords = np.unique(stopwords)\n\n tmp = []\n if data.shape[0] > 0... | [
"0.73293066",
"0.7125451",
"0.69574547",
"0.6875915",
"0.6592536",
"0.655768",
"0.653758",
"0.6451508",
"0.642322",
"0.64191824",
"0.6297908",
"0.6289256",
"0.6227335",
"0.6144405",
"0.61233485",
"0.6116757",
"0.603559",
"0.60240823",
"0.60127515",
"0.5959388",
"0.5916599",
... | 0.63855165 | 10 |
Initialize an inst_adsentries object. | def __init__(self, config):
self.config = config.config
self.staff = []
self.history = {}
self.pub_auth_all = {}
self.pub_auth_top = {}
self.pub_inst_all = {}
self.pub_inst_top = {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, owner, entries=None):\n\n self.owner = owner\n # self.entries = EntriesDict({})\n self.entries = EntriesDict(self)\n\n if entries is None:\n return\n\n # self.add_entries(entries)",
"def __init__(self, entries):\n # objects representing data... | [
"0.6336638",
"0.5971795",
"0.56298834",
"0.5508412",
"0.54021513",
"0.5356761",
"0.5335855",
"0.5334061",
"0.5325085",
"0.52985835",
"0.52923965",
"0.52620536",
"0.5138052",
"0.5107653",
"0.5100914",
"0.5100914",
"0.50950235",
"0.5093168",
"0.5012681",
"0.49803844",
"0.497088... | 0.0 | -1 |
staff_iate, function. Given a paper (python ads class Article), check if there is at least one author which is a member of an institution | def is_staff_institute(article, institution_keys):
isinst = False
for aff in article.aff:
thisis = any(word in aff for word in institution_keys)
isinst = isinst or thisis
return isinst | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_if_in_dept(author_url, schl_name):\n\t# Get list of the <a> elements linking to all the papers on the author's page\n\tauthor_page_tree = get_tree(author_url)\n\ta_elems = get_a_elems_for_papers(author_page_tree)\n\tin_dept = False\n\n\tfor a_elem in a_elems:\n\t\t# For each paper, get the school info fo... | [
"0.6104734",
"0.6014623",
"0.5984418",
"0.58621",
"0.57830095",
"0.5712993",
"0.569334",
"0.56724024",
"0.5653351",
"0.5642445",
"0.56329525",
"0.5621238",
"0.561703",
"0.5580654",
"0.55369467",
"0.5512479",
"0.55075306",
"0.5502403",
"0.54770684",
"0.5475226",
"0.54718405",
... | 0.6786643 | 0 |
A simple linear layer output = W.X + b | def linear(X, X_test, input_shape, output_size):
W = theano.shared(
numpy.random.uniform(low=-0.1, high=0.1, size=(input_shape[1], output_size)).astype(numpy.float32),
'linear_weights'
)
b = theano.shared(numpy.zeros(output_size).astype(numpy.float32))
output = tensor.dot(X, W) + b
output_test = tensor.dot(X... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def linear_layer(self, W, b, x, use_relu=True):\n\n if use_relu is True:\n return np.maximum(W @ x + b, 0)\n return W @ x + b",
"def linear(x,output_dim):\n w=tf.get_variable(\"w\", [x.get_shape()[1], output_dim])\n b=tf.get_variable(\"b\", [output_dim], initializer=tf.constant_initial... | [
"0.82238114",
"0.80804074",
"0.75202507",
"0.72941864",
"0.721842",
"0.7120809",
"0.70968974",
"0.7056413",
"0.6984556",
"0.69712335",
"0.69712335",
"0.69209296",
"0.6837847",
"0.6772131",
"0.67446196",
"0.6715414",
"0.67081565",
"0.67016375",
"0.6677974",
"0.6615366",
"0.658... | 0.6361478 | 42 |
r""" Return loaders for the passed datasets | def get_loaders(train_dataset, val_dataset, test_dataset, batch_size=128):
train_loader = DataLoader(train_dataset, batch_size=batch_size, num_workers=8,
shuffle=True)
val_loader = DataLoader(val_dataset, batch_size=batch_size, num_workers=8,
shuffle=Fa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_data_loaders(opt):\n return find_dataloader_using_name(opt.dataloader)(opt).load_data()",
"def get_data_loaders(args, tokenizer):\n personachat = get_dataset(tokenizer, args.dataset_path, args.dataset_cache, args.train_lang)\n _ = personachat.pop(\"test\", None)\n logger.info(\"Build inputs a... | [
"0.7801111",
"0.7585403",
"0.75460434",
"0.73615956",
"0.72978973",
"0.7281325",
"0.7259096",
"0.7184863",
"0.70834017",
"0.70742893",
"0.70579267",
"0.7055441",
"0.70362586",
"0.7029724",
"0.69592905",
"0.6930703",
"0.6908616",
"0.68829453",
"0.6856844",
"0.6856844",
"0.6856... | 0.81899023 | 0 |
r""" Get dataloader for coreset. Used in classincremental setup. Currently unfinished. | def get_coreset_loader(train_dataset, coreset_size=100):
coreset = train_dataset.get_random_coreset(size=coreset_size)
if coreset is not None:
coreset_loader = DataLoader(coreset, batch_size=128, num_workers=4,
shuffle=True)
else:
coreset_loader = None
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_dataloader(self):\n shuffle = True if self.mode == \"train\" else False\n return DataLoader(self.get_dataset(), batch_size=self.batch_size, shuffle = shuffle, \n collate_fn=create_mini_batch)",
"def dataloader(self):\n return DataLoader",
"def get_train_... | [
"0.7459599",
"0.7189616",
"0.69098645",
"0.66868496",
"0.6645819",
"0.6588509",
"0.6452816",
"0.6304796",
"0.6291291",
"0.6220771",
"0.6199559",
"0.6199041",
"0.6173421",
"0.6125723",
"0.6081583",
"0.6061391",
"0.6055056",
"0.5999358",
"0.5976626",
"0.59340525",
"0.5925384",
... | 0.7773889 | 0 |
Creates and saves a superuser with the given email and password. | def create_superuser(self, email, wink_username, wink_password, password):
user = self.create_user(email,
password=password,
wink_username = wink_username,
wink_password = wink_password,
)
user.is_admin = True
user.save(using=self._db)
return user | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def createsuperuser():\n\n email = prompt('User E-Mail')\n email_confirm = prompt('Confirm E-Mail')\n\n if not email == email_confirm:\n sys.exit('\\nCould not create user: E-Mail did not match')\n\n if not EMAIL_REGEX.match(email):\n sys.exit('\\nCould not create user: Invalid E-Mail add... | [
"0.83361775",
"0.828295",
"0.8259977",
"0.8250611",
"0.8249943",
"0.82250875",
"0.8214708",
"0.8212031",
"0.8182371",
"0.81775945",
"0.8175486",
"0.8160761",
"0.8157207",
"0.8153185",
"0.81484836",
"0.81483996",
"0.8148305",
"0.8148305",
"0.8148305",
"0.8147124",
"0.8132914",... | 0.0 | -1 |
labels = class labels | def get_scores_dict(models, X, y, labels, encode=True):
results = {}
for model in models:
mdl, scores = score_model(X, y, model, encode=encode)
# output per class:
data_cls = {}
for i, c in enumerate(labels):
data_cls[c] = {'P':scores[0][i],
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prepare_labels(labels, class_mask):\n mask = [1 if elt else -1 for elt in class_mask]\n mask = np.array(mask)\n return labels.dot(mask)",
"def class_labels(self):\n return self._class_labels",
"def labels_to_labels(class_labels, num_classes =4):\n levels = []\n for label in class_labe... | [
"0.7447972",
"0.7438544",
"0.739998",
"0.7397551",
"0.7397551",
"0.72695744",
"0.72160393",
"0.72160393",
"0.72160393",
"0.7214847",
"0.715397",
"0.70725965",
"0.70224565",
"0.6989703",
"0.69182247",
"0.6860545",
"0.68573546",
"0.6853445",
"0.68478024",
"0.6845334",
"0.684533... | 0.0 | -1 |
Add code to remove xml files created for each test if needed | def tearDown(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tearDown(self):\n self.remove_test_files()",
"def tearDown(self) -> None:\n filtered = [f for f in glob.glob('steps/tests/test_output/*') if not re.match(r'\\.keep', f)]\n for file in filtered:\n try:\n if Path(file).is_dir():\n shutil.rmtree(... | [
"0.7199814",
"0.7091662",
"0.70463413",
"0.70265406",
"0.7019789",
"0.69317615",
"0.6896303",
"0.6819506",
"0.68089265",
"0.672958",
"0.6716219",
"0.6698092",
"0.66893184",
"0.66854584",
"0.66433346",
"0.66349834",
"0.66349834",
"0.66349834",
"0.6620281",
"0.6615271",
"0.6593... | 0.0 | -1 |
Create a new Valence3 object. | def __init__(self, name = 'Triatomic valence', angle = 'rad', supplementary = False,
embedding_mode = 0):
super().__init__(self._csv3_q2x, nQ = 3,
nX = 9, name = name,
Qstr = ['r1', 'r2', 'theta'],
maxderiv = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, _x, _y, _z):\n self.position = Position3d(int(_x), int(_y), int(_z))\n self.velocity = Velocity3d(0, 0, 0)",
"def createNew(cls, x0, y0, z0, a, b, c):\n p0 = Vector(x0, y0, z0)\n d = Vector(a, b, c)\n return cls(p0, d)",
"def New(*args, **kargs):\n o... | [
"0.57769066",
"0.5618583",
"0.5599207",
"0.5580559",
"0.5565433",
"0.55610406",
"0.554252",
"0.5513668",
"0.5510952",
"0.5498387",
"0.54972744",
"0.54348683",
"0.5431365",
"0.53688514",
"0.5365434",
"0.5362083",
"0.53488636",
"0.5342071",
"0.5311019",
"0.5310587",
"0.5310077"... | 0.5681084 | 1 |
Create a LinearTrans object. | def __init__(self, T, t = None, Qpstr = None, name = None):
if np.ndim(T) != 2:
raise ValueError("T must be 2-dimensional")
m,n = T.shape
# m is the number of Q coordinates
# n is the number of Q' coordinates
super().__init__(self._lintrans, nQp = n, nQ =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __lineartrans(self):\n do = self.domain\n self.transpoints = copy(self.pts)\n def t(x):\n return (x - do[0])/(do[1]-do[0])\n for i in range(len(self.transpoints)):\n self.transpoints[i,0] = t(self.transpoints[i,0])",
"def __init__(self, coefficients, degree=1... | [
"0.6395334",
"0.6368814",
"0.61524385",
"0.5990929",
"0.5911513",
"0.589439",
"0.58715034",
"0.57321095",
"0.5709922",
"0.5640645",
"0.56197566",
"0.5567641",
"0.5504294",
"0.5468873",
"0.5451293",
"0.5450555",
"0.542788",
"0.54231477",
"0.54080814",
"0.53919756",
"0.5391663"... | 0.5705041 | 9 |
Returns a copy of the molecule that when displayed shows atom indices. | def mol_with_atom_index(mol: Chem.Mol) -> Chem.Mol:
cp = Chem.Mol(mol)
atoms = cp.GetNumAtoms()
for idx in range(atoms):
cp.GetAtomWithIdx(idx).SetProp('molAtomMapNumber', str(mol.GetAtomWithIdx(idx).GetIdx()))
return cp | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def atomIndex(molecule):\n for i in range(len(molecule.index) - 1):\n start = molecule.index[i]\n end = molecule.index[i+1]\n if end - start > 1:\n for I in range(start, end):\n element = molecule.type_list[I] + str(I)\n molecule.setAtoms(I, element = elemen... | [
"0.63938123",
"0.6128892",
"0.59481066",
"0.5941609",
"0.58735675",
"0.5866619",
"0.5679796",
"0.5522938",
"0.55067396",
"0.54886174",
"0.546395",
"0.5447676",
"0.5446423",
"0.54085374",
"0.5396512",
"0.5384452",
"0.5377978",
"0.53628105",
"0.5330334",
"0.53296465",
"0.531012... | 0.6105306 | 2 |
Yield successive nsized chunks from l. | def chunks(self, list_to_chunk, size):
for i in range(0, len(list_to_chunk), size):
yield list_to_chunk[i:i + size] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]",
"def chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]",
"def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]",
"def get_chunks(self, ... | [
"0.8038813",
"0.79248375",
"0.7923423",
"0.7885103",
"0.78773195",
"0.7815877",
"0.77655786",
"0.77556044",
"0.77441615",
"0.7731815",
"0.77288336",
"0.772473",
"0.77028215",
"0.76889825",
"0.76889825",
"0.7664208",
"0.76570904",
"0.7655856",
"0.7655856",
"0.76458347",
"0.764... | 0.0 | -1 |
Checks if the node is equal to some other node. | def __eq__(self, node):
if node == None or self.element != node.element:
return False
return self.index == node.index | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return type(self) == type(other) and self.node is other.node",
"def __eq__(self, other):\n return type(other) is type(self) and other._node is self._node",
"def __eq__(self, other):\n return type(other) is type(self) and other._node is self._node",
... | [
"0.83220375",
"0.83041865",
"0.83041865",
"0.83041865",
"0.83041865",
"0.83041865",
"0.82573247",
"0.81490266",
"0.8123923",
"0.80946773",
"0.7951766",
"0.7885503",
"0.7802659",
"0.77216864",
"0.7721365",
"0.7702047",
"0.7608962",
"0.7608962",
"0.74593896",
"0.74259835",
"0.7... | 0.7704498 | 15 |
Sets the element of the node. | def set_element(self, element):
self.element = element | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_element(self, newelement):\n self._element = newelement",
"def set(self, node, value):\n self.val[node] = value",
"def __setitem__(self, index, value):\n self.elem[index] = value",
"def set_node(self, node):\n self.__node = node",
"def set_element(self, rel_unit_cell, el... | [
"0.7613508",
"0.71508247",
"0.7081755",
"0.6995755",
"0.69267434",
"0.6826552",
"0.6825495",
"0.68035525",
"0.6695301",
"0.66854227",
"0.6632226",
"0.66252565",
"0.6593624",
"0.65107405",
"0.64697385",
"0.6419151",
"0.6367809",
"0.6358329",
"0.63369894",
"0.6300109",
"0.62989... | 0.82612103 | 0 |
Gets the index of the left child of this node. | def get_left_child_index(self):
return (2 * self.index) + 1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def left_child(self, index):\n return 2 * index + 1",
"def get_leftchild(self):\n return self._leftchild",
"def left_child(self, index):\n return 2 * index",
"def get_left_child_index(self, parent):\n return 2*parent+1",
"def getLeftChild(self):\n return _libsbml.ASTNode_... | [
"0.83618385",
"0.82356805",
"0.8144245",
"0.8100829",
"0.8051605",
"0.78735614",
"0.78672826",
"0.78672826",
"0.7855055",
"0.78340274",
"0.77783483",
"0.777283",
"0.7707099",
"0.7707099",
"0.7698154",
"0.766255",
"0.76456517",
"0.763264",
"0.7620917",
"0.75668985",
"0.7481574... | 0.8819194 | 0 |
Gets the index of the right child of this node. | def get_right_child_index(self):
return (2 * self.index) + 2 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def right_child(self, index):\n return 2 * index + 1",
"def rightChild(self, pos):\n return (2 * pos) + 1",
"def rightChild(self, pos):\n return (2 * pos) + 1",
"def get_right_child_index(self, parent):\n return 2*parent+2",
"def right_child(self, index):\n return... | [
"0.83613634",
"0.83464897",
"0.83464897",
"0.8271728",
"0.8235776",
"0.81026554",
"0.7723686",
"0.7653053",
"0.7643088",
"0.76126087",
"0.75171787",
"0.74982953",
"0.74676996",
"0.7187859",
"0.71869355",
"0.71784186",
"0.7112526",
"0.70967793",
"0.70866776",
"0.7066573",
"0.7... | 0.8937082 | 0 |
Gets the index of the parent of this node. | def get_parent_index(self):
return (self.index - 1) // 2 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parent(self, index):\n if index == 0:\n return -1\n return self.adjacency_list[index][0]",
"def parent_id(self) -> int:\n return self._parent_id",
"def _parent(self, index):\r\n # Declaring the \"root\" its own parent, otherwise usual math\r\n return (index - 1... | [
"0.8084155",
"0.8021728",
"0.7863768",
"0.78360665",
"0.7801948",
"0.7770504",
"0.77490574",
"0.77490574",
"0.7706327",
"0.76327807",
"0.76272184",
"0.7564791",
"0.75492895",
"0.75480026",
"0.75477743",
"0.7544163",
"0.75373137",
"0.75373137",
"0.74437684",
"0.7396543",
"0.73... | 0.8294789 | 0 |
Round the given value to arbitrary decimal points, in any direction. Perhaps rename `scale` to `sigfigs` or something? Not really in 'log' scaling... Arguments | def around(val, decimals=0, scale='log', dir='near'):
from zcode.plot import plot_core
islog = plot_core._scale_to_log_flag(scale)
if np.size(val) > 1:
raise ValueError("Arrays are not yet supported.")
# Round to nearest ('n'earest)
if dir.startswith('n'):
dir_int = 0
# Round up... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def log_scale(self, value: float):\n assert value > 1\n self.__log_scale = value\n self.logarithmic = self.logarithmic",
"def round_sigfigs(num, sig_figs):\n#http://code.activestate.com/recipes/578114-round-number-to-specified-number-of-significant-di/\n if num != 0:\n return round... | [
"0.6658478",
"0.6600313",
"0.64854336",
"0.64854336",
"0.64571035",
"0.64482206",
"0.6428062",
"0.64238656",
"0.6419928",
"0.63071346",
"0.6262527",
"0.6257937",
"0.6222144",
"0.6222144",
"0.6173379",
"0.61453897",
"0.6092683",
"0.60566807",
"0.6042249",
"0.60141534",
"0.6002... | 0.5778589 | 30 |
Find the indices of the input array which are within the given extrema. | def indsWithin(vals, extr, edges=True):
assert np.ndim(vals) == 1, "Only `ndim = 1` arrays allowed!"
bnds = minmax(extr)
if(edges):
inds = np.where((vals >= bnds[0]) & (vals <= bnds[1]))[0]
else:
inds = np.where((vals > bnds[0]) & (vals < bnds[1]))[0]
return inds | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_interval(array, min_value, max_value, epsilon_1=0, epsilon_2=0):\n min_index = np.min(np.where(array >= min_value + epsilon_1))\n max_index = np.max(np.where(array <= max_value - epsilon_2))\n\n indexes = np.arange(min_index, max_index + 1)\n\n return indexes",
"def relevant_indexes(data, min... | [
"0.6338899",
"0.6317",
"0.62691265",
"0.6255338",
"0.62061244",
"0.59966356",
"0.5950391",
"0.5925405",
"0.59072196",
"0.5888313",
"0.5838544",
"0.5791472",
"0.5780675",
"0.5780675",
"0.57387227",
"0.57361704",
"0.5723166",
"0.5701627",
"0.5692449",
"0.5690497",
"0.5664793",
... | 0.5644346 | 22 |
Return the midpoints between values in the given array. If the given array is Ndimensional, midpoints are calculated from the last dimension. Arguments | def midpoints(arr, log=False, frac=0.5, axis=-1, squeeze=True):
if (np.shape(arr)[axis] < 2):
raise RuntimeError("Input ``arr`` does not have a valid shape!")
# Convert to log-space
if log:
user = np.log10(arr)
else:
user = np.array(arr)
diff = np.diff(user, axis=axis)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def midpoints(self):\n return self.bins[:, 1]",
"def midpoint(p1, p2):\n return np.array([(p1[0] + p2[0]) / 2, (p1[1] + p2[1]) / 2, (p1[2] + p2[2]) / 2])",
"def get_valid_midpoints ( feature_array: np.ndarray, target_array: np.ndarray ):\n # Get sorted indices\n indices = np.argsort ( f... | [
"0.6972088",
"0.6209636",
"0.62037843",
"0.61801594",
"0.61744726",
"0.6062895",
"0.60024357",
"0.5956291",
"0.5865705",
"0.58354646",
"0.57833093",
"0.57496905",
"0.5619331",
"0.557309",
"0.54937124",
"0.5483402",
"0.5480893",
"0.5478209",
"0.5397841",
"0.5389621",
"0.534113... | 0.6435713 | 1 |
Check for monotonicity in the given array. Arguments | def mono(arr, type='g', axis=-1):
arr = np.atleast_1d(arr)
if arr.size == 1: return True
good_type = ['g', 'ge', 'l', 'le', 'e']
assert type in good_type, "Type '%s' Unrecognized." % (type)
# Retrieve the numpy comparison function (e.g. np.greater) for the given `type` (e.g. 'g')
func = _compari... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isMonotonic(self):\n\n #assume monotonic non-increasing\n nonIncreasingMono = True\n contradictions = 0\n prev=self.fluorescence[0]\n for point in self.fluorescence[1:]:\n if point > prev+self.monoThresh:\n #found contradiction, even with forgive thr... | [
"0.6881368",
"0.65863895",
"0.6407818",
"0.62682784",
"0.6236112",
"0.617855",
"0.61075896",
"0.6011164",
"0.5917663",
"0.5895557",
"0.58815193",
"0.58379316",
"0.57907337",
"0.5754667",
"0.5744951",
"0.5727187",
"0.5639834",
"0.5624304",
"0.56123656",
"0.55561125",
"0.553498... | 0.5351557 | 30 |
Test whether an array_like is really 1D (i.e. not a jagged ND array). Test whether the input array is uniformly onedimensional, as apposed to (e.g.) a ``ndim == 1`` list or array of irregularly shaped sublists/subarrays. True for an empty list `[]`. Arguments | def really1d(arr):
if np.ndim(arr) != 1:
return False
# Empty list or array
if len(arr) == 0:
return True
if np.any(np.vectorize(np.ndim)(arr)):
return False
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is1d(a):\n return np.sum(asarray(asarray(a).shape) > 1) <= 1",
"def _is_1d_varray(arr):\r\n return len(arr.shape) < 2 or arr.shape[1] == 1",
"def _is_1d_harray(arr):\r\n return len(arr.shape) < 2 or arr.shape[0] == 1",
"def is_empty_arraylike(arraylike):\n # pylint: disable=len-as-condition\n ... | [
"0.7702074",
"0.7491834",
"0.7229691",
"0.70547795",
"0.6916041",
"0.69028723",
"0.6803852",
"0.67006594",
"0.6421575",
"0.6404329",
"0.6361778",
"0.6300612",
"0.62617975",
"0.62063605",
"0.6134587",
"0.60615265",
"0.6012569",
"0.59308934",
"0.5910403",
"0.5903275",
"0.590059... | 0.82512337 | 0 |
Pad the input signal to make the fwt matrix work. | def fwt_pad(data: torch.Tensor,
wavelet: pywt.Wavelet,
level: int,
mode: str = "reflect") -> torch.Tensor:
if mode == "zero":
# convert pywt to pytorch convention.
mode = "constant"
padr, padl = get_pad(data.shape[-1], len(wavelet.dec_lo))
data_pad = torc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Padding_Signal(signal,M = 10):\t\t\t\t\t\t\t\t\t\t# Function to pad a signal\n\ts = signal.shape[0]\n\tsignal_change = np.zeros(s+2*M)\n\tsignal_change[M:s+M] = signal\n\t\n\treturn signal_change",
"def zero_pad_front(self, zf):\n self.zf = zf\n self.nfft = self.N+self.zb+self.zf\n if se... | [
"0.65574765",
"0.63365877",
"0.61031973",
"0.607646",
"0.6054116",
"0.5766341",
"0.5763826",
"0.57418394",
"0.57383424",
"0.5726199",
"0.57045215",
"0.5672251",
"0.5671559",
"0.56571954",
"0.5644132",
"0.56439185",
"0.5636079",
"0.5624202",
"0.56095874",
"0.558962",
"0.557250... | 0.6118189 | 2 |
Pad data for the 2d FWT. | def fwt_pad2d(data, wavelet, level, mode="reflect"):
padb, padt = get_pad(data.shape[-2], len(wavelet.dec_lo))
padr, padl = get_pad(data.shape[-1], len(wavelet.dec_lo))
data_pad = torch.nn.functional.pad(
data, [padl, padr, padt, padb], mode=mode)
return data_pad | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _pad(x, depth=4):\n divisor = np.power(2, depth)\n remainder = x.shape[0] % divisor\n\n # no padding because already of even shape\n if remainder == 0:\n return x\n # add zero rows after 1D feature\n elif len(x.shape) == 2:\n return np.pad(x, [(0, divisor - remainder), (0, 0)], ... | [
"0.6509254",
"0.6504801",
"0.64622766",
"0.6334278",
"0.6250836",
"0.62382317",
"0.6157697",
"0.6081306",
"0.60803825",
"0.6062623",
"0.6028899",
"0.6011693",
"0.60108685",
"0.599538",
"0.593309",
"0.59210646",
"0.5898071",
"0.5889973",
"0.58613193",
"0.58361995",
"0.58324236... | 0.70868105 | 0 |
Torch implementation of numpy's outer for vectors. | def _outer(a, b):
a_flat = torch.reshape(a, [-1])
b_flat = torch.reshape(b, [-1])
a_mul = torch.unsqueeze(a_flat, dim=-1)
b_mul = torch.unsqueeze(b_flat, dim=0)
return a_mul * b_mul | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def outer_product(u: Vector3D, v: Vector3D):\n cx = u.y * v.z - u.z * v.y\n cy = u.z * v.x - u.x * v.z\n cz = u.x * v.y - u.y * v.x\n return Vector3D(cx, cy, cz, coordinate_system='cartesian')",
"def outer(x, y):\r\n if x.ndim != 1:\r\n x = x.flatten()\r\n if y.ndim != 1:\r\n y = ... | [
"0.694576",
"0.68335795",
"0.6582529",
"0.61524993",
"0.61341304",
"0.612201",
"0.6117658",
"0.6090153",
"0.6041434",
"0.6023976",
"0.5973987",
"0.59543735",
"0.59315336",
"0.5929931",
"0.5928676",
"0.59258986",
"0.5895171",
"0.588365",
"0.58742356",
"0.58457726",
"0.5830929"... | 0.6419953 | 3 |
Returns a list x for all the data points. Each element of x is a NumPy vector with 5,000 elements, one for each word. | def create_vectors(list_dict, num_words):
x = [] # list that will hold data
for d in list_dict:
# initializing numpy vector
# it contains 5,000 (number of words) zeros
temp = np.zeros(num_words, dtype=np.float64)
for key, val in d.items():
if key < num_words:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def word_to_vector_list(self, word, numeric=False, xsampa=False, normalize=True):\n if xsampa:\n word = self.xsampa.convert(word)\n segs = self.word_fts(word, normalize or xsampa)\n if numeric:\n tensor = [x.numeric() for x in segs]\n else:\n tensor = [x... | [
"0.63979566",
"0.6323328",
"0.6139044",
"0.60804874",
"0.60651577",
"0.6064752",
"0.6061148",
"0.59422743",
"0.58800566",
"0.5839348",
"0.5831127",
"0.58252704",
"0.5818373",
"0.5810647",
"0.5805296",
"0.57933176",
"0.5783019",
"0.5781592",
"0.57792187",
"0.57715917",
"0.5734... | 0.61157244 | 3 |
Scale train and test data using specified scaler (default StandardScaler). | def scale_data(x_train: DF, x_test: DF, scaler: object = None) -> tp.Tuple[ARR, ARR]:
if not scaler:
scaler = StandardScaler()
scaler.fit(x_train)
return scaler.transform(x_train), scaler.transform(x_test) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scale(train, test):\n # fit scaler\n scaler = MinMaxScaler(feature_range=(-1, 1))\n scaler = scaler.fit(train)\n # transform train\n train = train.reshape(train.shape[0], train.shape[1])\n train_scaled = scaler.transform(train)\n # transform test\n test = test.reshape(test.shape[0], tes... | [
"0.8058943",
"0.78255606",
"0.7745955",
"0.76353145",
"0.7631244",
"0.7630237",
"0.7629898",
"0.74093133",
"0.73940223",
"0.734513",
"0.71210337",
"0.70563996",
"0.70318884",
"0.70147914",
"0.69263864",
"0.6895547",
"0.6738539",
"0.6687696",
"0.66528374",
"0.6634528",
"0.6630... | 0.72964644 | 10 |
Return a saved state value, None if item is undefined. | def __getitem__(self, item):
return self._state["data"].get(item, None) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __getitem__(self, item):\r\n return self._state[\"data\"].get(item, None)",
"def __getitem__(self, item):\r\n return self._state[\"data\"].get(item, None)",
"def __getattr__(self, item):\r\n return self._state[\"data\"].get(item, None)",
"def __getattr__(self, item):\r\n retur... | [
"0.6426262",
"0.6426262",
"0.6146485",
"0.6146485",
"0.6143656",
"0.61336714",
"0.6097194",
"0.6097194",
"0.6097194",
"0.5940735",
"0.5818517",
"0.57955533",
"0.57518315",
"0.5735236",
"0.5724344",
"0.5724344",
"0.5723242",
"0.5687774",
"0.5687774",
"0.5687774",
"0.5687774",
... | 0.63554496 | 3 |
Return a saved state value, None if item is undefined. | def __getattr__(self, item):
return self._state["data"].get(item, None) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __getitem__(self, item):\r\n return self._state[\"data\"].get(item, None)",
"def __getitem__(self, item):\r\n return self._state[\"data\"].get(item, None)",
"def __getitem__(self, item):\n return self._state[\"data\"].get(item, None)",
"def __getitem__(self, item):\n return se... | [
"0.6429514",
"0.6429514",
"0.6358824",
"0.6358824",
"0.6358824",
"0.6149625",
"0.6149625",
"0.6145407",
"0.61317384",
"0.5938212",
"0.58158153",
"0.5793487",
"0.5748117",
"0.57325107",
"0.5726615",
"0.5721914",
"0.5721914",
"0.5684511",
"0.5684511",
"0.5684511",
"0.5684511",
... | 0.61004424 | 9 |
This gets the initial x position and velocity values | def get_x_input():
# Ask for and validate user input for x pos and vel
while True:
try:
posx = float(input("Please enter the initial x position in m: "))
except ValueError:
print("Invalid Input")
continue
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getXVelocity(self):\n return self.xvelocity",
"def getXVelocity(self):\n return self._vx",
"def getTopLeftVelocity(self):\n\t\tif len(self.prevPositions) < 2:\n\t\t\tself.velocity = (0,0,0)\n\t\telse:\n\t\t\ttime = self.position[2] - self.prevPositions[len(self.prevPositions)-1][2]\n\t\t\txdi... | [
"0.7702927",
"0.7289026",
"0.7086318",
"0.69733465",
"0.6954075",
"0.681477",
"0.6774038",
"0.67447424",
"0.6699862",
"0.66686124",
"0.6652677",
"0.6582294",
"0.65165436",
"0.651492",
"0.65128016",
"0.6478118",
"0.64708734",
"0.6444521",
"0.6441185",
"0.6412755",
"0.64098376"... | 0.5998061 | 68 |
This gets the initial y position and velocity values | def get_y_input():
# Ask for and validate user input for y pos and vel
while True:
try:
posy = float(input("Please enter the initial y position in m: "))
#start at ground
if posy < 0:
print("Please enter a positive value.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getVelocity(self):\n\t\tif len(self.prevPositions) < 2:\n\t\t\tself.velocity = 0\n\t\telse:\n\t\t\ttime = self.position[2] - self.prevPositions[len(self.prevPositions)-1][2]\n\t\t\txdist = self.position[0][0] - self.prevPositions[len(self.prevPositions)-1][0][0]\n\t\t\tydist = self.position[0][1] - self.prevPo... | [
"0.743665",
"0.73924863",
"0.72868377",
"0.7080948",
"0.7022498",
"0.69990927",
"0.69655246",
"0.692328",
"0.69025296",
"0.6864296",
"0.68117964",
"0.67906684",
"0.67715365",
"0.6760214",
"0.6760214",
"0.6735987",
"0.67078984",
"0.6707297",
"0.6690351",
"0.6673502",
"0.663971... | 0.0 | -1 |
Computes a gradient clipping coefficient based on gradient norm. | def clip_gradient(model, clip_norm):
totalnorm = 0
for p in model.parameters():
if p.requires_grad:
modulenorm = p.grad.data.norm()
totalnorm += modulenorm ** 2
totalnorm = np.sqrt(totalnorm)
norm = clip_norm / max(totalnorm, clip_norm)
for p in model.parame... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clip_gradient(parameters, clip):\n totalnorm = 0\n for p in parameters:\n modulenorm = p.grad.data.norm()\n totalnorm += modulenorm ** 2\n totalnorm = math.sqrt(totalnorm)\n return min(1, clip / (totalnorm + 1e-6))",
"def clip_gradient(model, clip_norm):\n totalnorm = 0\n for ... | [
"0.8192957",
"0.7836212",
"0.7812888",
"0.7684024",
"0.6941484",
"0.6935386",
"0.6885898",
"0.67271453",
"0.6653705",
"0.65643364",
"0.65286523",
"0.65286523",
"0.65286523",
"0.65286523",
"0.65286523",
"0.6526018",
"0.64746755",
"0.6459472",
"0.6434548",
"0.63848907",
"0.6342... | 0.78191525 | 2 |
Get all actions currently in the replay memory, ordered by time where they were taken. | def actions(self):
return self._actions.getSlice(0) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_action_results(self,last_states,actions,time_i):\n return [],actions",
"def actions(self) -> list:\n if self.debug: print(f\"AState.actions()\")\n if not self._examined:\n if self.debug: print(f\"\\tExamining...\")\n self._actions = self._generate_actions()\n ... | [
"0.67279744",
"0.6710008",
"0.66840154",
"0.6538076",
"0.6326077",
"0.62980324",
"0.6246879",
"0.6191621",
"0.6170337",
"0.6132707",
"0.60533214",
"0.6049664",
"0.603641",
"0.59729457",
"0.5941164",
"0.591611",
"0.591611",
"0.591611",
"0.5800242",
"0.5789079",
"0.57405037",
... | 0.6430174 | 5 |
Returns a batch of states, actions, rewards, terminal status, and next_states for a number batch_size of randomly chosen transitions. Note that if terminal[i] == True, then next_states[s][i] == np.zeros_like(states[s][i]) for each s. | def randomBatch(self, batch_size, use_priority):
batch = {}
if (self._max_history_size + self.sticky_action - 1 >= self.n_elems):
raise SliceError(
"Not enough elements in the dataset to create a "
"complete state. {} elements in dataset; requires {}"
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random_batch(self, batch_size):\n # Allocate the response.\n states = np.zeros((batch_size, self.state_size), dtype=self.states.dtype)\n actions = np.zeros((batch_size, self.action_size), dtype=self.actions.dtype)\n rewards = np.zeros((batch_size, 1), dtype=self.rewards.dtype)\n ... | [
"0.7682383",
"0.73538345",
"0.72486675",
"0.71613854",
"0.6614158",
"0.6602941",
"0.65052855",
"0.64579755",
"0.6406741",
"0.63441855",
"0.6317695",
"0.63068056",
"0.6278373",
"0.6261944",
"0.6232763",
"0.6186115",
"0.6132042",
"0.6089072",
"0.60756314",
"0.6010676",
"0.60013... | 0.641919 | 8 |
Represents a CloudFormation Parameter Type. | def __init__(self, parameter_type):
self.parameter_type = parameter_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getTypeCode(self):\n return _libsbml.Parameter_getTypeCode(self)",
"def get_parameter_type(self, name):\n raise NotImplementedError()",
"def type_name(self):\n return \"%s %s\" % (self.param_type, self.name)",
"def get_type(self, instance):\n if instance.type == BaseParameter.... | [
"0.6564639",
"0.65468276",
"0.6381778",
"0.6367714",
"0.6326458",
"0.6242839",
"0.62366515",
"0.60643727",
"0.60609674",
"0.6017571",
"0.6017571",
"0.6017571",
"0.6017571",
"0.6017571",
"0.6017571",
"0.6017571",
"0.6017571",
"0.6017571",
"0.6017571",
"0.6017571",
"0.6017571",... | 0.6391266 | 2 |
Calculate the poststratified producer's standard error from an nxn confusion matrix. If the reference data contain no instances of a class, returns a NaN for that element. | def poststratified_producers_standard_error(error_matrix, wh):
totals = error_matrix.sum(axis=1)
# Handle the n_ix matrix
n_ix_weights = _divide_with_0s(
(wh ** 2),
(totals * np.where(totals != 1, totals - 1, totals)))
n_ix = n_ix_weights[:, None] * error_matrix * (1-_divide_wi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def poststratified_producers_standard_error_overall(error_matrix, wh):\r\n\r\n return np.sqrt(np.nansum((users_standard_error(error_matrix)**2) * (wh**2)))",
"def poststratified_producers_accuracy_overall(error_matrix, wh):\r\n\r\n totals = error_matrix.sum(axis=1)\r\n\r\n return np.nansum(_divide_with_... | [
"0.6594165",
"0.5980478",
"0.5967284",
"0.5833904",
"0.53923666",
"0.53497136",
"0.53346",
"0.53004783",
"0.5284852",
"0.52500373",
"0.5232466",
"0.52304405",
"0.5212",
"0.52038735",
"0.51789427",
"0.5174164",
"0.5174143",
"0.51510143",
"0.51360506",
"0.51187974",
"0.51158494... | 0.6640561 | 0 |
Calculates the estimated map area proportion standard error of each class. | def area_proportion_standard_error(error_matrix, wh):
area_estimate = _area_estimate_matrix(error_matrix, wh)
totals = error_matrix.sum(axis=1)
calc_matrix = _divide_with_0s(
(wh[:, None]**2) * area_estimate * (1 - area_estimate),
np.where(totals != 1, totals - 1, totals)[:, None]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def area_proportion(error_matrix, wh):\r\n\r\n return np.nansum(_area_estimate_matrix(error_matrix, wh), axis=0)",
"def classProbs(observation, tree, classes):\n res = classify(observation, tree) #res = results\n total = sum(res.values())\n probs = []\n for c in classes:\n if c in res.keys(... | [
"0.6088287",
"0.5973438",
"0.5811182",
"0.5734903",
"0.5542816",
"0.5501405",
"0.5437083",
"0.5436517",
"0.54157174",
"0.53905636",
"0.53837764",
"0.5373578",
"0.5361072",
"0.5356154",
"0.53239554",
"0.53184605",
"0.53089184",
"0.5276285",
"0.52629274",
"0.52629095",
"0.52291... | 0.6280762 | 0 |
Chain a sequence of iterators together into a single sequence. | def gen_concatenate(iterators):
for it in iterators:
yield from it | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def concat(iterables):\n return itertools.chain.from_iterable(iterables)",
"def chain(*streams):\n return Stream(itertools.chain(*streams))",
"def concat(seqs):\n return itertools.chain.from_iterable(seqs)",
"def concat(*seqs):\n return itertools.chain.from_iterable(seqs)",
"def union(itera... | [
"0.74589974",
"0.73797214",
"0.7302038",
"0.7065293",
"0.69541234",
"0.68697006",
"0.68476707",
"0.669383",
"0.6481802",
"0.64331365",
"0.6369508",
"0.62915415",
"0.62771094",
"0.6243485",
"0.62408453",
"0.6204148",
"0.619794",
"0.61951923",
"0.61575425",
"0.6144743",
"0.6127... | 0.75486547 | 0 |
Delete a tag for a shipment. Deletes an existing shipment tag using the specified data. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. | def delete_shipment_tag(self, shipment_id, shipment_tag, **kwargs):
all_params = ['shipment_id', 'shipment_tag']
all_params.append('callback')
params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_tag(self, session, tag):\n self._tag(session.delete, key=tag, delete=True, session=session)",
"def delete_tag(self, tag):\n return self.__datacatalog.delete_tag(name=tag.name)",
"def delete(self, tag, params={}, **options):\n path = \"/tags/%s\" % (tag)\n return self.clie... | [
"0.6579873",
"0.6539505",
"0.6331027",
"0.6111765",
"0.5944577",
"0.57388806",
"0.56845975",
"0.5675672",
"0.56745243",
"0.5633165",
"0.561809",
"0.5608334",
"0.56073457",
"0.5593881",
"0.5581662",
"0.5568866",
"0.5545619",
"0.55157214",
"0.5504911",
"0.5431472",
"0.54307646"... | 0.7137268 | 0 |
Writes FlowMessages and updates corresponding requests. | def WriteFlowResponses(self, responses):
status_available = {}
requests_updated = set()
task_ids_by_request = {}
for response in responses:
flow_key = (response.client_id, response.flow_id)
if flow_key not in self.flows:
logging.error("Received response for unknown flow %s, %s.",
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def WriteMessageHandlerRequests(self, requests):\n now = rdfvalue.RDFDatetime.Now()\n for r in requests:\n flow_dict = self.message_handler_requests.setdefault(r.handler_name, {})\n cloned_request = r.Copy()\n cloned_request.timestamp = now\n flow_dict[cloned_request.request_id] = cloned_... | [
"0.6500873",
"0.6490644",
"0.63209665",
"0.59280133",
"0.58675605",
"0.58517003",
"0.5800597",
"0.5790333",
"0.5783791",
"0.57623583",
"0.5735354",
"0.5697957",
"0.5671796",
"0.56649125",
"0.5646273",
"0.5629229",
"0.5579454",
"0.5486141",
"0.54256356",
"0.5411077",
"0.538781... | 0.6187173 | 3 |
return a generator For lists and sets the generator yields each item. For dictionaries it yield (key, value) | def __iter__(self):
if self.is_payload(set, list):
return iter(self._attr)
if self.is_payload(dict):
as_key_pairs = [(k, v) for k, v in self._attr.items()]
return iter(as_key_pairs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __iter__(self):\n\n # For each key in set of keys\n for key in self.keys_set:\n\n # Yield that key and associated value\n yield key, self.__getitem__(key)",
"def __iter__(self):\n for key, value in self.read():\n yield key, value",
"def iteritems(self):\r\n ... | [
"0.68467915",
"0.6383323",
"0.6329462",
"0.6329462",
"0.62629426",
"0.62063944",
"0.6182053",
"0.6160723",
"0.61546445",
"0.61522615",
"0.61364806",
"0.6100662",
"0.6090066",
"0.6001733",
"0.59969515",
"0.59860563",
"0.5985557",
"0.5980867",
"0.59785616",
"0.5966618",
"0.5947... | 0.56173646 | 37 |
Compute a constant advection field by finding a translation vector that maximizes the correlation between two successive images. | def constant(R, **kwargs):
X, Y = np.meshgrid(np.arange(R.shape[2]), np.arange(R.shape[1]))
def f(v):
XYW = [Y + v[1], X + v[0]]
R_w = ip.map_coordinates(R[-2, :, :], XYW, mode="constant", cval=np.nan,
order=0, prefilter=False)
mask = np.isfinite(R_w)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _gs_decorrelation(w, W, j):\n w -= np.linalg.multi_dot([w, W[:j].T, W[:j]])\n return w",
"def cross_correlation(field1, field2):\n array_len = len(field1)\n # Take the index of the largest value in the array of correlation values calculated via a full convolve\n # cross correlation.\n arg_m... | [
"0.5850066",
"0.5803377",
"0.5755366",
"0.574165",
"0.56482035",
"0.5560038",
"0.549698",
"0.5449303",
"0.54393864",
"0.5371599",
"0.5358288",
"0.53550553",
"0.53504306",
"0.533009",
"0.531916",
"0.53184044",
"0.5300711",
"0.5293101",
"0.5291579",
"0.5290975",
"0.52828693",
... | 0.57652813 | 2 |
Compute softmax values for each sets of scores in x. | def softmax(x):
e_x = np.exp(x - np.expand_dims(np.max(x, axis=-1), axis=-1))
return e_x / np.expand_dims(e_x.sum(axis=-1), axis=-1) # only difference
| {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def softmax(self, scores):\n\n\n # for each sample, for each class ,caclulate\n # np.exp(scores) : still (n_samples, n_classes)\n\n # axis = 1\n # a00, a01, a02 as a sinlge one to perfrom np_sum\n # which is the same sample \n # sum_exp : still (n_samples, 1)\n\n # ... | [
"0.7796373",
"0.7761191",
"0.7759723",
"0.77571064",
"0.765803",
"0.765803",
"0.765803",
"0.765803",
"0.75856936",
"0.74314815",
"0.74069375",
"0.73939854",
"0.7358033",
"0.7317298",
"0.72690034",
"0.7262341",
"0.7261389",
"0.72569704",
"0.72300184",
"0.72146094",
"0.72015774... | 0.69421 | 98 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.