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 |
|---|---|---|---|---|---|---|
Test removing a config entry. | async def test_setup_and_remove_config_entry(
hass: HomeAssistant,
target_domain: Platform,
) -> None:
registry = er.async_get(hass)
# Setup the config entry
switch_as_x_config_entry = MockConfigEntry(
data={},
domain=DOMAIN,
options={
CONF_ENTITY_ID: "switch.tes... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def test_unload_config_entry(\n hass: HomeAssistant, aioclient_mock: AiohttpClientMocker\n) -> None:\n entry = await init_integration(hass, aioclient_mock)\n assert hass.data[DOMAIN]\n\n await hass.config_entries.async_unload(entry.entry_id)\n await hass.async_block_till_done()\n assert not... | [
"0.6794943",
"0.67607576",
"0.6741416",
"0.66078603",
"0.6600545",
"0.6585527",
"0.6517025",
"0.64718556",
"0.6432699",
"0.6423662",
"0.6422932",
"0.63950044",
"0.63535124",
"0.6318535",
"0.63124114",
"0.62889904",
"0.628844",
"0.6277168",
"0.6267392",
"0.62319726",
"0.622030... | 0.60206574 | 33 |
Test removing a config entry restores assistant expose settings. | async def test_restore_expose_settings(
hass: HomeAssistant,
target_domain: Platform,
) -> None:
await async_setup_component(hass, "homeassistant", {})
registry = er.async_get(hass)
switch_entity_entry = registry.async_get_or_create(
"switch",
"test",
"unique",
origi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def test_unload_config_entry(\n hass: HomeAssistant, aioclient_mock: AiohttpClientMocker\n) -> None:\n entry = await init_integration(hass, aioclient_mock)\n assert hass.data[DOMAIN]\n\n await hass.config_entries.async_unload(entry.entry_id)\n await hass.async_block_till_done()\n assert not... | [
"0.71226645",
"0.6908797",
"0.6855264",
"0.6637656",
"0.6562663",
"0.6540723",
"0.648373",
"0.6463226",
"0.64506954",
"0.64284444",
"0.63742214",
"0.6373202",
"0.6333878",
"0.63282835",
"0.6264061",
"0.62605166",
"0.6242518",
"0.62409437",
"0.624044",
"0.6238645",
"0.6230249"... | 0.0 | -1 |
Returns the pixel width of the image for the current test dimensions. | def expected_width(self):
return self.expected_tile_width * TILE_SIZE | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_width(self):\n width = np.size(self.img, 0)\n return width",
"def width(self) -> int:\n return self._image_data.width",
"def getWidth(self):\n return self._image.width()",
"def getWidth(self):\n return _tkCall(self.image.width)",
"def numPixels(self):\n\t\treturn self... | [
"0.8090083",
"0.8090057",
"0.8073078",
"0.7651389",
"0.7412325",
"0.7412325",
"0.7344347",
"0.73064363",
"0.72439915",
"0.7169658",
"0.7138261",
"0.71101564",
"0.7085659",
"0.707055",
"0.70686865",
"0.70643705",
"0.7061719",
"0.70256",
"0.7020718",
"0.7015426",
"0.70134586",
... | 0.7578232 | 4 |
Return a text/plain HttpResponse with content "pinned" or "not pinned". | def _pinned():
result = "pinned" if this_thread_is_pinned() else "not pinned"
return HttpResponse(result, content_type="text/plain") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def head(*args, **kwargs):\r\n\r\n return HttpResponse()",
"def status(request):\n return HttpResponse('Hi, I am healty!')",
"def renderHTTP(self, ctx):\n return 'Keep trying. You are almost there.'",
"def pinned_tasks_srp(request):\n return Task.objects.select_related('project').filter(... | [
"0.5446802",
"0.54019904",
"0.5344352",
"0.52621114",
"0.525818",
"0.52391475",
"0.51942843",
"0.51916856",
"0.5173171",
"0.51656467",
"0.51618356",
"0.51245207",
"0.50807655",
"0.50224704",
"0.50194836",
"0.5010902",
"0.49873188",
"0.49803162",
"0.4970237",
"0.49619696",
"0.... | 0.8694406 | 0 |
Parses a package.json manifest file. | def parse_manifest(manifest_path):
with open(manifest_path, 'r') as f:
data = f.read()
if data:
return json.loads(data)
else:
return {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _read_manifest_json(self):\n with open(os.path.join(self._crx_dir, \"manifest.json\")) as manifest:\n return json.load(manifest)",
"def parse_manifest(location):\n mode = 'r'\n with open(location, mode) as manifest:\n return parse_manifest_data(manifest.read())",
"def parse_m... | [
"0.7180901",
"0.689963",
"0.68955094",
"0.6789212",
"0.6763122",
"0.6508273",
"0.64473075",
"0.64258265",
"0.6346553",
"0.6274756",
"0.6266436",
"0.62427926",
"0.6213141",
"0.6211603",
"0.62106264",
"0.61133146",
"0.6078295",
"0.6078295",
"0.6051729",
"0.6027925",
"0.5962825"... | 0.7607986 | 0 |
Pause the specified instance. | def pause(self, instance):
try:
cont_id = self._find_container_by_name(instance['name']).get('id')
if not self.docker.pause_container(cont_id):
raise exception.NovaException
except Exception as e:
msg = _('Cannot pause container: {0}')
rais... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pause(self, instance):\n self.power_off(instance)",
"def pause(self, instance, callback):\n pass",
"def pause(self, arguments):\n instance_name = arguments['<instance>']\n instance_name = self.activate(instance_name)\n\n vmrun = VMrun(self.vmx, user=self.user, password=se... | [
"0.7846346",
"0.7688921",
"0.7469233",
"0.73539656",
"0.70026976",
"0.6733456",
"0.6724526",
"0.66634697",
"0.66456866",
"0.66079676",
"0.66079676",
"0.6529071",
"0.65127313",
"0.65127313",
"0.6469562",
"0.6466887",
"0.64643747",
"0.64550567",
"0.6448383",
"0.64472795",
"0.64... | 0.7138054 | 4 |
There're better ways to generate unique colors, but this isn't awful. | def uniqueish_color(color_data):
# return plt.cm.gist_ncar(color_data)
# return plt.cm.binary(color_data)
return plt.cm.bwr(color_data) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def uniqueish_color():\n return plt.cm.gist_ncar(np.random.random())",
"def unique_color(n=1):\n \n if n == 1:\n c='xkcd:red'\n elif n== 2:\n c='xkcd:green'\n elif n== 3:\n c='xkcd:yellow'\n elif n== 4:\n c='xkcd:blue'\n elif n== 5:\n c='xkcd:orange'\n elif... | [
"0.7695123",
"0.75671566",
"0.75583816",
"0.7357631",
"0.7342208",
"0.72853166",
"0.72480094",
"0.71011716",
"0.7098262",
"0.70767504",
"0.7062771",
"0.70538425",
"0.70175236",
"0.7003569",
"0.68944114",
"0.6891342",
"0.6822742",
"0.6812799",
"0.6809275",
"0.6775157",
"0.6725... | 0.69415236 | 14 |
A test to check conversion between path to namespace for InnerEye and external namespaces | def test_namespace_to_path(is_external: bool, test_output_dirs: OutputFolderForTests) -> None:
if is_external:
folder_name = "logs"
full_folder = test_output_dirs.root_dir / folder_name
assert namespace_to_path(folder_name, root=test_output_dirs.root_dir) == full_folder
else:
fro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_namespace(self):\n pass",
"def test_read_net_namespace(self):\n pass",
"def test_replace_net_namespace(self):\n pass",
"def test_path_to_namespace(is_external: bool, test_output_dirs: OutputFolderForTests) -> None:\n if is_external:\n folder_name = \"logs\"\n ... | [
"0.73029065",
"0.6965997",
"0.6900048",
"0.68341947",
"0.67262053",
"0.6407285",
"0.63938856",
"0.63662964",
"0.6257283",
"0.61628664",
"0.61357117",
"0.60621345",
"0.60217685",
"0.6020565",
"0.59647584",
"0.58429635",
"0.58099943",
"0.57819664",
"0.575428",
"0.5750365",
"0.5... | 0.6388923 | 7 |
A test to check conversion between namespace to path for InnerEye and external namespaces | def test_path_to_namespace(is_external: bool, test_output_dirs: OutputFolderForTests) -> None:
if is_external:
folder_name = "logs"
full_folder = test_output_dirs.root_dir / folder_name
assert path_to_namespace(
path=full_folder,
root=test_output_dirs.root_dir
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_namespace(self):\n pass",
"def test_read_net_namespace(self):\n pass",
"def test_namespace_to_path(is_external: bool, test_output_dirs: OutputFolderForTests) -> None:\n if is_external:\n folder_name = \"logs\"\n full_folder = test_output_dirs.root_dir / folder_name\n... | [
"0.73165166",
"0.6915954",
"0.6753333",
"0.67226464",
"0.6679871",
"0.6459391",
"0.641153",
"0.6366573",
"0.6270574",
"0.61011595",
"0.60762215",
"0.60427475",
"0.6017366",
"0.5910802",
"0.58862346",
"0.5809101",
"0.57427335",
"0.5739951",
"0.57314265",
"0.57177037",
"0.57061... | 0.6943418 | 1 |
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`. | def plot_confusion_matrix(cm, classes,
normalize=False,
title=None,
cmap=plt.cm.Blues):
if not title:
if normalize:
title = 'Normalized confusion matrix'
else:
title = 'Confusion matrix, without normalization'
fig, ax = plt.subplots()
im = ax.imshow(cm, interpolation='nearest', cma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n... | [
"0.81940335",
"0.8095006",
"0.80290395",
"0.8019189",
"0.7993875",
"0.7991161",
"0.79809004",
"0.7975263",
"0.7961412",
"0.7956938",
"0.7937461",
"0.7934524",
"0.7934342",
"0.7931134",
"0.7926225",
"0.79244965",
"0.792367",
"0.79231006",
"0.7922885",
"0.792215",
"0.7917699",
... | 0.0 | -1 |
Shuffle two (numpy) arrays while keeping values at the same indices consistent between the two arrays. | def shuffle_arrays_together(array_a: np.ndarray, array_b: np.ndarray):
_list = list(zip(array_a, array_b))
random.shuffle(_list)
_a, _b = list(zip(*_list))
return np.array(_a), np.array(_b) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def randomize_data(arr_a, arr_b):\n for ix in range(0, len(arr_a)-1):\n j = random.randint(ix+1, len(arr_a)-1)\n swap(ix, j, arr_a, arr_b)",
"def _shuffle(x, y):\n ind = np.arange(y.shape[0])\n np.random.shuffle(ind)\n\n return x[:, ind, :], y[ind]",
"def shuffle_in_unison... | [
"0.76986414",
"0.75944936",
"0.7552783",
"0.73425084",
"0.7003211",
"0.6981852",
"0.69262284",
"0.69198114",
"0.6874657",
"0.6783941",
"0.6783941",
"0.6783941",
"0.67834735",
"0.67456245",
"0.67006373",
"0.66353536",
"0.6576977",
"0.65682966",
"0.6488185",
"0.6398037",
"0.639... | 0.7891924 | 0 |
determine if its own bottom edge is lower than {item_or_group}'s bottom edge | def is_bottom_edge_below(self, item_or_group):
if isinstance(item_or_group, Item):
item = item_or_group
return self.bottom > item.bottom
elif isinstance(item_or_group, ItemGroup):
item_group = item_or_group
return self.bottom > item_group.bottom
el... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_bottom_edge_above(self, item_or_group):\n return not self.is_bottom_edge_below(item_or_group)",
"def group_has_bottom(group: pygame.sprite.Group, bottom: int):\r\n for sprite in group:\r\n if sprite.rect.bottom == bottom:\r\n return True\r\n return False",
"def _is_bottom_... | [
"0.8367411",
"0.6601129",
"0.6381611",
"0.6213488",
"0.6155999",
"0.6150277",
"0.6072957",
"0.6011137",
"0.5915268",
"0.58969814",
"0.58455807",
"0.5840544",
"0.57969046",
"0.5791927",
"0.5779468",
"0.57299614",
"0.5660132",
"0.5645648",
"0.563967",
"0.5624196",
"0.5619945",
... | 0.7922941 | 1 |
determine if its own bottom edge is higher than {item_or_group}'s bottom edge | def is_bottom_edge_above(self, item_or_group):
return not self.is_bottom_edge_below(item_or_group) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_bottom_edge_below(self, item_or_group):\n if isinstance(item_or_group, Item):\n item = item_or_group\n return self.bottom > item.bottom\n elif isinstance(item_or_group, ItemGroup):\n item_group = item_or_group\n return self.bottom > item_group.bottom... | [
"0.8312248",
"0.67943615",
"0.67004293",
"0.6466782",
"0.6365225",
"0.62959373",
"0.60863155",
"0.6085255",
"0.6067151",
"0.6014576",
"0.5995667",
"0.58887464",
"0.58841914",
"0.5846384",
"0.5845368",
"0.58413243",
"0.5760431",
"0.5660495",
"0.56547433",
"0.5645941",
"0.55345... | 0.8409423 | 0 |
determine if its own bottom edge is within than {item_or_group}'s bottom edge and top edge | def is_foot_vertically_inside(self, item_or_group):
if isinstance(item_or_group, ItemGroup):
return not self.is_bottom_edge_below(item_or_group) and self.is_bottom_edge_below_top_foot(item_or_group)
else:
raise TypeError("item_or_group must be instance of ItemGroup.") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_bottom_edge_above(self, item_or_group):\n return not self.is_bottom_edge_below(item_or_group)",
"def is_bottom_edge_below(self, item_or_group):\n if isinstance(item_or_group, Item):\n item = item_or_group\n return self.bottom > item.bottom\n elif isinstance(item_... | [
"0.80232906",
"0.7723987",
"0.6707917",
"0.6390316",
"0.6296792",
"0.62473303",
"0.615441",
"0.61110735",
"0.60845906",
"0.6065328",
"0.60120636",
"0.5985478",
"0.594437",
"0.5871533",
"0.58092225",
"0.57769895",
"0.5773324",
"0.572963",
"0.5676477",
"0.56643605",
"0.566321",... | 0.6200156 | 6 |
String for representing the Model object. | def __str__(self):
return self.name + ' - ' + str(self.date_of_contact) + ' - ' + str(self.specialty) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n return super().__str__() + self.model.__str__()",
"def __str__(self):\n return \"DataModel(name={},attributes={},description={})\".format(\n self.name, {a.name: str(a) for a in self.attributes}, self.description\n )",
"def __str__(self):\n \n res =... | [
"0.8236334",
"0.7989569",
"0.7848069",
"0.7846481",
"0.77509546",
"0.7624108",
"0.7624108",
"0.7623108",
"0.7623108",
"0.75479686",
"0.75224715",
"0.7470156",
"0.74694866",
"0.7446042",
"0.7446042",
"0.7430364",
"0.7427066",
"0.73897326",
"0.7349858",
"0.7340906",
"0.7322887"... | 0.0 | -1 |
String for representing the Model object. | def __str__(self):
return self.name + ' - ' + self.procedure_name + ' - ' + str(self.date_of_contact) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n return super().__str__() + self.model.__str__()",
"def __str__(self):\n return \"DataModel(name={},attributes={},description={})\".format(\n self.name, {a.name: str(a) for a in self.attributes}, self.description\n )",
"def __str__(self):\n \n res =... | [
"0.8237102",
"0.79895926",
"0.78485906",
"0.7846189",
"0.77511",
"0.76247364",
"0.76247364",
"0.7622933",
"0.7622933",
"0.7547188",
"0.75233495",
"0.74708194",
"0.7470042",
"0.74472684",
"0.74472684",
"0.7431884",
"0.74270374",
"0.73904866",
"0.7351086",
"0.7342717",
"0.73235... | 0.0 | -1 |
String for representing the Model object. | def __str__(self):
return self.specialty | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n return super().__str__() + self.model.__str__()",
"def __str__(self):\n return \"DataModel(name={},attributes={},description={})\".format(\n self.name, {a.name: str(a) for a in self.attributes}, self.description\n )",
"def __str__(self):\n \n res =... | [
"0.82368803",
"0.79901737",
"0.7849152",
"0.78468513",
"0.77520275",
"0.7625378",
"0.7625378",
"0.76225406",
"0.76225406",
"0.75483394",
"0.7522958",
"0.7470355",
"0.7469358",
"0.7447144",
"0.7447144",
"0.74314755",
"0.7427648",
"0.7389925",
"0.7351721",
"0.73424315",
"0.7322... | 0.0 | -1 |
String for representing the Model object. | def __str__(self):
return str(self.pk) + ' - ' + self.procedure_class | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n return super().__str__() + self.model.__str__()",
"def __str__(self):\n return \"DataModel(name={},attributes={},description={})\".format(\n self.name, {a.name: str(a) for a in self.attributes}, self.description\n )",
"def __str__(self):\n \n res =... | [
"0.8236244",
"0.7990606",
"0.78480387",
"0.7846219",
"0.77502006",
"0.7623238",
"0.7623238",
"0.7620921",
"0.7620921",
"0.7546437",
"0.75244987",
"0.7472402",
"0.7470912",
"0.7448822",
"0.7448822",
"0.7432068",
"0.7427943",
"0.73915136",
"0.73503023",
"0.7343569",
"0.7324108"... | 0.0 | -1 |
String for representing the Model object. | def __str__(self):
return f'{self.location}' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n return super().__str__() + self.model.__str__()",
"def __str__(self):\n return \"DataModel(name={},attributes={},description={})\".format(\n self.name, {a.name: str(a) for a in self.attributes}, self.description\n )",
"def __str__(self):\n \n res =... | [
"0.8236334",
"0.7989569",
"0.7848069",
"0.7846481",
"0.77509546",
"0.7624108",
"0.7624108",
"0.7623108",
"0.7623108",
"0.75479686",
"0.75224715",
"0.7470156",
"0.74694866",
"0.7446042",
"0.7446042",
"0.7430364",
"0.7427066",
"0.73897326",
"0.7349858",
"0.7340906",
"0.7322887"... | 0.0 | -1 |
Sets the id of this KeyDerivationInstance. | def id(self, id):
if id is None:
raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501
self._id = id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_id(self, id):\n self.__id = id",
"def set_id(self, id_):\n\n self.id_ = id_",
"def set_id(self, id):\n\n\t\tif id is not None and not isinstance(id, int):\n\t\t\traise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)\n\t\t\n\t\tself.__id = id\n\t\tself.__k... | [
"0.7509662",
"0.7361725",
"0.73109734",
"0.71761066",
"0.716533",
"0.7128722",
"0.7110745",
"0.7107104",
"0.71040905",
"0.7098716",
"0.70985717",
"0.70784897",
"0.70784897",
"0.70784897",
"0.70784897",
"0.70784897",
"0.7078088",
"0.7054215",
"0.7054215",
"0.7054215",
"0.70461... | 0.0 | -1 |
Sets the service_ids of this KeyDerivationInstance. | def service_ids(self, service_ids):
if service_ids is None:
raise ValueError("Invalid value for `service_ids`, must not be `None`") # noqa: E501
self._service_ids = service_ids | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def service_ids(self, service_ids):\n\n self._service_ids = service_ids",
"def services(self, services):\n\n self._services = services",
"def services(self, services):\n\n self._services = services",
"def ids(self, ids):\n self._ids = ids",
"def update_services(self, new_service... | [
"0.8166759",
"0.6859378",
"0.6859378",
"0.57768804",
"0.5719516",
"0.55878645",
"0.5536941",
"0.5459062",
"0.54398865",
"0.53966534",
"0.5395017",
"0.53295904",
"0.5324174",
"0.5228824",
"0.5222563",
"0.5189729",
"0.51248205",
"0.5121617",
"0.5110716",
"0.51074433",
"0.507656... | 0.7109271 | 1 |
Sets the version of this KeyDerivationInstance. | def version(self, version):
if version is None:
raise ValueError("Invalid value for `version`, must not be `None`") # noqa: E501
self._version = version | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def version(self, version):\n \n self._version = version",
"def version(self, version: str):\n\n self._version = version",
"def version(self, version: str):\n\n self._version = version",
"def version(self, version):\n self._version = version",
"def version(self, version):... | [
"0.71815616",
"0.7169777",
"0.7169777",
"0.71428466",
"0.71428466",
"0.71407634",
"0.71001387",
"0.71001387",
"0.71001387",
"0.71001387",
"0.71001387",
"0.71001387",
"0.71001387",
"0.71001387",
"0.71001387",
"0.71001387",
"0.71001387",
"0.71001387",
"0.71001387",
"0.71001387",
... | 0.66523635 | 30 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, KeyDerivationInstance):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.80891633",
"0.80891633",
"0.8055254",
"0.7983334",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.8457167",
"0.8393036",
"0.81455255",
"0.8139734",
"0.81333447",
"0.8094964",
"0.8093362",
"0.8093362",
"0.8093362",
"0.80863476",
"0.80863476",
"0.8077286",
"0.8077286",
"0.806682"
] | 0.0 | -1 |
Set up the EnsembleSampler of the emcee. | def EnsembleSampler(self, nwalkers, **kwargs):
self.nwalkers = nwalkers
self.__sampler = "EnsembleSampler"
if self.lnlikeType == "gcs":
logpargs = (self.x, self.y, self.xerr, self.yerr, self.pRanges)
logpkwargs = {
"flag": self.flag,
"fix_m... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setUp(self):\n self.sampler = {\n \"name\": \"samplername\",\n \"backend_name\": \"\",\n \"backend_header\": \"\",\n \"backend_prefix\": \"\",\n \"backend_suffix\": \"\",\n \"backend_footer\": \"\",\n \"ncores\": 2,\n ... | [
"0.67693484",
"0.6195275",
"0.61627173",
"0.60521036",
"0.5903268",
"0.5883507",
"0.58497375",
"0.5835446",
"0.5819078",
"0.5778005",
"0.5714813",
"0.57051784",
"0.5703039",
"0.56904703",
"0.56869334",
"0.5671283",
"0.56460005",
"0.5630085",
"0.56248015",
"0.5595351",
"0.5565... | 0.6606227 | 1 |
Update the information stored concerning a specific prefix. | def update(self, prefix, peer, value):
peer_sym = self.peers.get(peer, None)
if peer_sym is None:
peer_sym = self.peers[peer] = peer
node = self.radix.add(prefix)
node.data[peer_sym] = value
return node | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _update_prefix(self, prefix: str, operator: Operator):\n cached_operator: Optional[Operator] = self.lookup(prefix)\n if cached_operator:\n cached_price = cached_operator.price_for_prefix(prefix)\n if cached_price:\n if operator.has_better_price_for_prefix(pref... | [
"0.7243679",
"0.70026356",
"0.70026344",
"0.6948627",
"0.69161",
"0.69161",
"0.6898115",
"0.68590176",
"0.6710644",
"0.66757613",
"0.660613",
"0.65959245",
"0.65296745",
"0.63046926",
"0.6160213",
"0.6154241",
"0.6148926",
"0.612614",
"0.6099805",
"0.6034504",
"0.6033006",
... | 0.5604809 | 39 |
Name of the attachment | def attachment_name(self):
if self.__attachment_name is not None:
return self.__attachment_name
if self.__attachment_name_property:
return getattr(self, self.__attachment_name_property, '')
else:
# property order resolution:
# 1) try property 'subj... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return self._filename",
"def get_name(self):\n return self._file.name",
"def get_name(self):\n return self.file_name",
"def file_name(self):\n return self.__file_name",
"def file_name(self):\n return self._file_name",
"def file_name(self):\n ret... | [
"0.7697845",
"0.76398706",
"0.75814885",
"0.7384647",
"0.7347543",
"0.7347543",
"0.7347543",
"0.7347543",
"0.7347543",
"0.72732687",
"0.72732687",
"0.72565854",
"0.724476",
"0.7242976",
"0.7223506",
"0.7210613",
"0.7190505",
"0.71667844",
"0.7098693",
"0.6940856",
"0.692581",... | 0.81711423 | 0 |
Returns the size of this attachment | def __len__(self):
return self.size | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getSize(self):\n return self._size",
"def getSize(self):\n return self.__size",
"def get_size(self):\n return self._size",
"def get_size(self):\n return self._size",
"def file_size(self):\n return self.context.getObjSize(self.context)",
"def get_size(self):\n ... | [
"0.80585337",
"0.8017296",
"0.80141336",
"0.80141336",
"0.8004944",
"0.7998625",
"0.7998625",
"0.7998625",
"0.7973392",
"0.796913",
"0.7957654",
"0.79560673",
"0.79524714",
"0.79428864",
"0.7924541",
"0.7924541",
"0.7878226",
"0.7874525",
"0.7872566",
"0.78691196",
"0.7784387... | 0.0 | -1 |
Compute masked entropy for a position in the sequences | def base_entropy_masked(seq_list, base_set, base_idx):
# entropy analysis
base_list = [seq[base_idx] for seq in seq_list]
freq_dict = Counter(base_list)
mask_list = ['-', 'N']
n_seq = sum([freq_dict[base] for base in freq_dict if base not in mask_list])
H = 0
total_masked = 0
for base in... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exploitEntropy(self, position):\n pass",
"def exploreEntropy(self, position):\n pass",
"def entropy(x):\n nz = np.nonzero(x)[0]\n return -np.sum(x[nz]*np.log2(x[nz]))",
"def entropy(image, selem, out=None, mask=None, shift_x=False, shift_y=False):\n\n return _apply(_crank8.entropy,... | [
"0.70269614",
"0.6864408",
"0.6633201",
"0.65077466",
"0.6431512",
"0.6406239",
"0.63890517",
"0.63039684",
"0.6269086",
"0.62388676",
"0.6200157",
"0.6187284",
"0.6105708",
"0.60649717",
"0.60404694",
"0.60330796",
"0.60251886",
"0.60128623",
"0.60012263",
"0.599101",
"0.598... | 0.7283822 | 0 |
Adds additional query parameters to a URL while preserving existing ones. The URL will be normalized according to the OAuth specification with the exception that the URL fragment is preserved. | def url_add_query(url, extra_query_params, allow_func=None):
scheme, netloc, path, params, query, fragment = urlparse_normalized(url)
d = query_add(query, extra_query_params)
qs = urlencode_s(d, allow_func=allow_func)
return urlunparse((scheme, netloc, path, params, qs, fragment)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def append_query_params(original_url, **kwargs):\n scheme, netloc, path, query_string, fragment = urlsplit(original_url)\n query_params = parse_qs(query_string)\n if kwargs is not None:\n for key, value in kwargs.items():\n query_params[key] = [value]\n\n new_query_string = urlencode(... | [
"0.81322277",
"0.81322277",
"0.7697985",
"0.74217576",
"0.74037313",
"0.7225958",
"0.7088054",
"0.7003053",
"0.678398",
"0.67807525",
"0.6750052",
"0.6741299",
"0.6726893",
"0.6655746",
"0.6655746",
"0.66181564",
"0.65065897",
"0.6493678",
"0.6435593",
"0.6376228",
"0.6375366... | 0.74030685 | 5 |
Appends query params to any existing query string in the URL and returns a properly formatted URL. URL fragments are preserved. | def url_append_query(url, query_params):
if not query_params:
return url
scheme, netloc, path, params, query, fragment = urlparse_normalized(url)
query = (query + "&") if query else query
query_string = query + urlencode_s(query_unflatten(query_params))
return urlunparse((scheme, netloc, pat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def append_query_params(original_url, **kwargs):\n scheme, netloc, path, query_string, fragment = urlsplit(original_url)\n query_params = parse_qs(query_string)\n if kwargs is not None:\n for key, value in kwargs.items():\n query_params[key] = [value]\n\n new_query_string = urlencode(... | [
"0.81549567",
"0.81549567",
"0.7707903",
"0.761501",
"0.7487683",
"0.7482286",
"0.7348673",
"0.7198075",
"0.71472",
"0.71472",
"0.71208537",
"0.7081905",
"0.707324",
"0.7036059",
"0.7025032",
"0.69859105",
"0.6948436",
"0.6826538",
"0.6749152",
"0.6728942",
"0.66652775",
"0... | 0.8076933 | 2 |
Appends additional query parameters to a query string. The additional query parameters appear after the initial query string. | def query_append(*query_params):
li = []
for qp in query_params:
qs = urlencode_s(query_unflatten(qp))
if qs:
li.append(qs)
return "&".join(li) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def append_query_params(original_url, **kwargs):\n scheme, netloc, path, query_string, fragment = urlsplit(original_url)\n query_params = parse_qs(query_string)\n if kwargs is not None:\n for key, value in kwargs.items():\n query_params[key] = [value]\n\n new_query_string = urlencode(... | [
"0.7972452",
"0.7972452",
"0.76173997",
"0.71207464",
"0.708434",
"0.6994136",
"0.6894514",
"0.68572116",
"0.68572116",
"0.6857165",
"0.6819232",
"0.6753768",
"0.6700751",
"0.6586015",
"0.6504417",
"0.6501435",
"0.6488579",
"0.64446956",
"0.64316726",
"0.6397329",
"0.63870513... | 0.79330975 | 2 |
Return a custom 404 error. | def error_404(error):
return 'Bummer, there is nothing at this URL.' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def not_found():\n return HttpError(404)",
"def error_404(error):\n return '404 Error'",
"def error_not_found(error):\n return 'No page here, dood. 404!', 404",
"def not_found(self, error):\n return jsonify({'error': 'NOT FOUND'}), 404",
"def page_not_found(err):\n return error_formatter(cod... | [
"0.8116449",
"0.80424213",
"0.7737413",
"0.7717836",
"0.7688941",
"0.76715463",
"0.7611543",
"0.7602619",
"0.7570821",
"0.7553308",
"0.7546265",
"0.75196016",
"0.74747616",
"0.7457757",
"0.74563175",
"0.7455935",
"0.7449881",
"0.7442611",
"0.74283564",
"0.74061334",
"0.738941... | 0.7740178 | 2 |
r""" Return num_tokens tokens that have the highest probability for a given token | def _get_best_tokens(self, num_tokens=5):
return self.sorted_probs[:num_tokens], self.sorted_indices[:num_tokens] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cond_prob(self, token, prev_tokens=None):\n if not prev_tokens:\n assert self.n == 1\n prev_tokens = tuple()\n\n hits = self.count((tuple(prev_tokens)+(token,)))\n sub_count = self.count(tuple(prev_tokens))\n # heuristic\n return (hits+1) / (float(sub_co... | [
"0.65624195",
"0.6506481",
"0.6409731",
"0.63341427",
"0.62845147",
"0.6278294",
"0.62720203",
"0.62008363",
"0.6197267",
"0.61947036",
"0.618999",
"0.6155716",
"0.61184216",
"0.60942173",
"0.60871065",
"0.606312",
"0.60536104",
"0.6039921",
"0.60361195",
"0.5967945",
"0.5948... | 0.6555723 | 1 |
Compute length of rupture (km). For EdgeRupture, we compute the length as the length of the top edge projected to the surface. | def getLength(self):
lons = self._toplons
lats = self._toplats
seg = self._group_index
groups = np.unique(seg)
ng = len(groups)
rlength = 0
for i in range(ng):
group_segments = np.where(groups[i] == seg)[0]
nseg = len(group_segments) - 1
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getLength(self):\n return self.geometry.length",
"def total_length(self):\n # YOUR CODE HERE\n return abs(self.radius*self.angle)",
"def edge_length(self):\n if self.edge_length_l is not None:\n return self.edge_length_l\n else:\n self.edge_length_l ... | [
"0.64138377",
"0.6371502",
"0.6361713",
"0.6359372",
"0.6292256",
"0.6232948",
"0.617673",
"0.6171692",
"0.6152697",
"0.6150844",
"0.6129092",
"0.60557646",
"0.603729",
"0.60209924",
"0.60047835",
"0.5941919",
"0.59414583",
"0.59180874",
"0.5902702",
"0.5872497",
"0.5871046",... | 0.6412288 | 1 |
Compute average rupture width in km. For EdgeRupture, we compute this as the rupture area divided by teh rupture length. | def getWidth(self):
area = self.getArea()
length = self.getLength()
return area / length | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_average_start_radius(self):\n total_length = len(self.pixel_list)\n\n if not total_length:\n return 0\n elif total_length < 5:\n total_radius = 0\n for i in range(total_length):\n total_radius += self.pixel_list[i].radius\n ret... | [
"0.6624762",
"0.65968335",
"0.65738505",
"0.6547333",
"0.64843774",
"0.6439279",
"0.64153314",
"0.6219351",
"0.6213662",
"0.6213351",
"0.6193978",
"0.6106133",
"0.608973",
"0.60745883",
"0.60640675",
"0.60470635",
"0.6012936",
"0.59919083",
"0.59919083",
"0.59919083",
"0.5979... | 0.7063443 | 0 |
Compute the rupture area. For EdgeRupture, we compute this by grouping the traces into "quadrilaterals" for which the verticies may not be coplanar. We then break up the quadrilaterals into triangles for which we can compute area. | def getArea(self):
seg = self._group_index
groups = np.unique(seg)
ng = len(groups)
area = 0
for i in range(ng):
group_segments = np.where(groups[i] == seg)[0]
nseg = len(group_segments) - 1
for j in range(nseg):
ind = group_seg... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getArea(self):\n asum = 0.0\n for quad in self._quadrilaterals:\n w = get_quad_width(quad)\n l = get_quad_length(quad)\n asum = asum + w * l\n return asum",
"def compute_surface_area(self):\n return np.sum(self._find_triangle_areas())",
"def area... | [
"0.7013552",
"0.68570894",
"0.6799231",
"0.6769213",
"0.6753739",
"0.65391105",
"0.65222216",
"0.6455655",
"0.6383921",
"0.6287806",
"0.6272543",
"0.62584573",
"0.6199514",
"0.6170186",
"0.61609316",
"0.6155303",
"0.61455363",
"0.61228013",
"0.6122473",
"0.6095361",
"0.609447... | 0.5679689 | 79 |
Representative dip for this rupture. Note that dip can vary along the rupture. | def getDip(self):
return self._dip | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getDip(self):\n dipsum = 0.0\n for quad in self._quadrilaterals:\n N = get_quad_normal(quad)\n V = get_vertical_vector(quad)\n dipsum = dipsum + np.degrees(np.arccos(Vector.dot(N, V)))\n dip = dipsum / len(self._quadrilaterals)\n return dip",
"def ... | [
"0.7617527",
"0.7015266",
"0.68828595",
"0.60466355",
"0.5933084",
"0.58175373",
"0.5804979",
"0.5777768",
"0.5777768",
"0.5777768",
"0.574449",
"0.5713865",
"0.56749266",
"0.5604726",
"0.55940163",
"0.5577946",
"0.5557142",
"0.5515827",
"0.5498956",
"0.54768693",
"0.5442315"... | 0.77606183 | 0 |
Return a list of segment group indexes. | def _getGroupIndex(self):
return copy.deepcopy(self._group_index) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def group_indexes(self) -> Optional[List[float]]:\n return pulumi.get(self, \"group_indexes\")",
"def group_indexes(self) -> Optional[List[float]]:\n return pulumi.get(self, \"group_indexes\")",
"def group_indexes(self) -> Optional[List[float]]:\n return pulumi.get(self, \"group_indexes\")... | [
"0.7649554",
"0.7649554",
"0.7649554",
"0.6590446",
"0.6556585",
"0.63233477",
"0.6090118",
"0.6073933",
"0.60477996",
"0.6004251",
"0.5978857",
"0.59540415",
"0.5948172",
"0.5935903",
"0.59121877",
"0.59044003",
"0.5897838",
"0.5877048",
"0.58745444",
"0.5870968",
"0.5851569... | 0.60656494 | 8 |
Class method for constructing a QuadRupture from arrays of longitude latitude, and depth. The arrays should start on the top and move in the strike direction, then down to the bottom and move back (without closing) followed by a nan. | def fromArrays(cls, lon, lat, depth, origin, reference=''):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _setQuadrilaterals(self):\n\n # Make sure arrays are numpy arrays.\n self._lon = np.array(self._lon)\n self._lat = np.array(self._lat)\n self._depth = np.array(self._depth)\n\n # Find the nans, which tells is where the separate polygons/groups are\n group_ends = np.whe... | [
"0.6234956",
"0.5870408",
"0.5581966",
"0.55158466",
"0.5465272",
"0.54137504",
"0.5395955",
"0.5265526",
"0.521684",
"0.51630944",
"0.51617074",
"0.51607037",
"0.5122908",
"0.51187325",
"0.5112348",
"0.50894845",
"0.5088815",
"0.5083854",
"0.5019792",
"0.50077057",
"0.498970... | 0.49321148 | 23 |
Compute area of rupture. | def getArea(self):
asum = 0.0
for quad in self._quadrilaterals:
w = get_quad_width(quad)
l = get_quad_length(quad)
asum = asum + w * l
return asum | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def total_area(self):\n return numpy.prod([r[1] - r[0] for r in self.range_])",
"def area(self) -> float:\n raise NotImplementedError",
"def total_area(self) :\n area = 0\n for i in self.residues :\n area += i.solvent_acc_area\n return area",
"def area(self):\n ... | [
"0.7949629",
"0.7576201",
"0.74550194",
"0.7412263",
"0.7390755",
"0.7303413",
"0.7257002",
"0.7186071",
"0.7157383",
"0.7139753",
"0.7099595",
"0.7095079",
"0.705244",
"0.7023055",
"0.69719845",
"0.69620824",
"0.6955189",
"0.6953933",
"0.6946397",
"0.6946397",
"0.6928151",
... | 0.7117331 | 10 |
Create a QuadRupture instance from a set of vertices that define the top of the rupture, and an array of widths/dips. Each rupture quadrilaterial is defined by specifying the latitude, longitude, and depth of the two vertices on the top edges, which must have the dame depths. The other verticies are then constructed fr... | def fromTrace(cls, xp0, yp0, xp1, yp1, zp, widths, dips, origin,
strike=None, group_index=None, reference=""):
if len(xp0) == len(yp0) == len(xp1) == len(
yp1) == len(zp) == len(dips) == len(widths):
pass
else:
raise ShakeLibException(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _setQuadrilaterals(self):\n\n # Make sure arrays are numpy arrays.\n self._lon = np.array(self._lon)\n self._lat = np.array(self._lat)\n self._depth = np.array(self._depth)\n\n # Find the nans, which tells is where the separate polygons/groups are\n group_ends = np.whe... | [
"0.5803847",
"0.5600614",
"0.534415",
"0.5322971",
"0.53100234",
"0.530041",
"0.524864",
"0.5220212",
"0.51713824",
"0.5157542",
"0.51333773",
"0.51098377",
"0.51026887",
"0.50921524",
"0.5065189",
"0.49655724",
"0.49467236",
"0.49325755",
"0.49294132",
"0.48882174",
"0.48634... | 0.4399244 | 92 |
Create internal list of N quadrilaterals. Reverses quad if dip direction is incorrect. | def _setQuadrilaterals(self):
# Make sure arrays are numpy arrays.
self._lon = np.array(self._lon)
self._lat = np.array(self._lat)
self._depth = np.array(self._depth)
# Find the nans, which tells is where the separate polygons/groups are
group_ends = np.where(np.isnan(s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getQuadrilaterals(self):\n pass",
"def getQuadrilaterals(self):\n ugroup = np.unique(self._group_index)\n ngroup = len(ugroup)\n qlist = []\n for i in range(ngroup):\n ind = np.where(self._group_index == ugroup[i])[0]\n nq = len(ind) - 1\n f... | [
"0.6426125",
"0.64216346",
"0.6285212",
"0.62718266",
"0.60343295",
"0.5950274",
"0.5667338",
"0.56576777",
"0.5653566",
"0.56501204",
"0.5648209",
"0.561839",
"0.5604851",
"0.5555668",
"0.55422294",
"0.5538652",
"0.54485786",
"0.54257244",
"0.54197216",
"0.5405007",
"0.53973... | 0.64734024 | 0 |
Return a list of segment group indexes. | def _getGroupIndex(self):
return copy.deepcopy(self._group_index) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def group_indexes(self) -> Optional[List[float]]:\n return pulumi.get(self, \"group_indexes\")",
"def group_indexes(self) -> Optional[List[float]]:\n return pulumi.get(self, \"group_indexes\")",
"def group_indexes(self) -> Optional[List[float]]:\n return pulumi.get(self, \"group_indexes\")... | [
"0.7649334",
"0.7649334",
"0.7649334",
"0.65905434",
"0.6556632",
"0.63231343",
"0.6090134",
"0.60737765",
"0.60477185",
"0.6004068",
"0.5978902",
"0.59539485",
"0.59481966",
"0.59357756",
"0.5912173",
"0.5904235",
"0.58977395",
"0.58770025",
"0.58746374",
"0.58709896",
"0.58... | 0.6065495 | 9 |
Compute the components of a unit slip vector. | def get_local_unit_slip_vector(strike, dip, rake):
strike = np.radians(strike)
dip = np.radians(dip)
rake = np.radians(rake)
sx = np.sin(rake) * np.cos(dip) * np.cos(strike) + \
np.cos(rake) * np.sin(strike)
sy = np.sin(rake) * np.cos(dip) * np.sin(strike) + \
np.cos(rake) * np.cos(s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vector_component(u, v):\n x = dot_vectors(u, v) / length_vector_sqrd(v)\n return scale_vector(v, x)",
"def unit_vector(vector):\n #print 'unit_vector'\n #print vector\n #print type(vector)\n #npvector = np.array(vector)\n return vector / np.linalg.norm(vector)",
"def cal_unit_vec(vecto... | [
"0.7101245",
"0.6650332",
"0.6628364",
"0.65481466",
"0.65072",
"0.64970964",
"0.6468489",
"0.6465301",
"0.6465301",
"0.6465301",
"0.6442099",
"0.64355296",
"0.642071",
"0.6392865",
"0.63770634",
"0.63770634",
"0.63770634",
"0.63770634",
"0.63770634",
"0.63770634",
"0.6377063... | 0.5675425 | 74 |
Compute the unit normal vector for a quadrilateral in ECEF coordinates. | def get_quad_normal(q):
P0, P1, P2, P3 = q
p0 = Vector.fromPoint(P0) # fromPoint converts to ECEF
p1 = Vector.fromPoint(P1)
p3 = Vector.fromPoint(P3)
v1 = p1 - p0
v2 = p3 - p0
vn = Vector.cross(v2, v1).norm()
return vn | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_normal(self):\n c, s = np.cos(self.eangles), np.sin(self.eangles)\n r = np.array([[c, -s], [s, c]])\n u = np.array([1, 0])\n return np.dot(r, u)",
"def get_quad_strike_vector(q):\n P0, P1, P2, P3 = q\n p0 = Vector.fromPoint(P0) # fromPoint converts to ECEF\n p1 = Vec... | [
"0.6373712",
"0.6277061",
"0.6265934",
"0.626547",
"0.620199",
"0.61762315",
"0.59915715",
"0.5976844",
"0.5942278",
"0.5892512",
"0.58643585",
"0.58362436",
"0.5817145",
"0.57800645",
"0.5771206",
"0.57570195",
"0.57390314",
"0.57093453",
"0.56973886",
"0.56887335",
"0.56652... | 0.732289 | 0 |
Compute the vertical unit vector for a quadrilateral in ECEF coordinates. | def get_vertical_vector(q):
P0, P1, P2, P3 = q
P0_up = copy.deepcopy(P0)
P0_up.depth = P0_up.depth - 1.0
p0 = Vector.fromPoint(P0) # fromPoint converts to ECEF
p1 = Vector.fromPoint(P0_up)
v1 = (p1 - p0).norm()
return v1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_quad_down_dip_vector(q):\n P0, P1, P2, P3 = q\n p0 = Vector.fromPoint(P0) # fromPoint converts to ECEF\n p1 = Vector.fromPoint(P1)\n p0p1 = p1 - p0\n qnv = get_quad_normal(q)\n ddv = Vector.cross(p0p1, qnv).norm()\n return ddv",
"def get_quad_strike_vector(q):\n P0, P1, P2, P3 = ... | [
"0.6518399",
"0.6430079",
"0.59680825",
"0.5838643",
"0.5774217",
"0.57682586",
"0.5742409",
"0.57137823",
"0.5679971",
"0.5671822",
"0.5651268",
"0.5639558",
"0.5635968",
"0.56325215",
"0.5598869",
"0.55685306",
"0.553252",
"0.54953593",
"0.54532224",
"0.5435116",
"0.5433409... | 0.754239 | 0 |
Calculate the distance^2 from the origin to a segment defined by two vectors | def _distance_sq_to_segment(p0, p1):
# /*
# * This algorithm is from (Vince's) CS1 class.
# * It returns the distance^2 from the origin to a segment defined
# * by two vectors
# */
dist = np.zeros_like(p1[:, 0])
# /* Are the two points equal? */
idx_equal = (p0[:, 0] == p1[:, 0]) & ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dist(v1: vect2d, v2: vect2d) -> float:\n d = ((v2.x - v1.x)**2 + (v2.y - v1.y)**2) ** 0.5\n return d",
"def _vector_dist(self, vec1, vec2):\r\n return sqrt(sum([(float(v1) - float(v2)) ** 2 for v1, v2 in\r\n zip(vec1, vec2)]))",
"def dist_2D(v1, v2):\n return ((v1[0]... | [
"0.76526505",
"0.74865806",
"0.7423698",
"0.73689497",
"0.7205784",
"0.71581054",
"0.7135231",
"0.71073353",
"0.7055259",
"0.70442456",
"0.7030081",
"0.70101863",
"0.69712126",
"0.696673",
"0.6965842",
"0.69552",
"0.69378436",
"0.69204396",
"0.69099534",
"0.6899135",
"0.68986... | 0.7392863 | 3 |
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`. | def plot_confusion_matrix(self, cm, classes, normalize=False, cmap=plt.cm.Blues):
if normalize:
cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]
title='Normalized confusion matrix'
else:
title='Confusion matrix'
self.plt_num += 1
plt.figure(sel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n... | [
"0.81940335",
"0.8095006",
"0.80290395",
"0.8019189",
"0.7993875",
"0.7991161",
"0.79809004",
"0.7975263",
"0.7961412",
"0.7956938",
"0.7937461",
"0.7934524",
"0.7934342",
"0.7931134",
"0.7926225",
"0.79244965",
"0.792367",
"0.79231006",
"0.7922885",
"0.792215",
"0.7917699",
... | 0.0 | -1 |
Sets Selenium options and returns driver | def init_driver(self):
# Set UserAgent to prevent issues with blocking bot
self.chrome_options.add_argument(
"user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36")
# Set headless
if self.headless... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_driver_with_options():\n #options = get_driver_options()\n #return webdriver.Chrome(options=options)\n return webdriver.Chrome()",
"def __init__(self, driver_path: str = None, waiter_timeout: int = 3, options: List[str] = None):\n\n # selecting driver\n if not driver_path:\n ... | [
"0.8057054",
"0.708947",
"0.69968826",
"0.6911238",
"0.69095063",
"0.68970937",
"0.6814126",
"0.67816955",
"0.6770387",
"0.6672688",
"0.66312623",
"0.66301274",
"0.66073716",
"0.65865606",
"0.6582146",
"0.6569406",
"0.65414834",
"0.6523243",
"0.65005714",
"0.6442095",
"0.6439... | 0.6938842 | 3 |
Generate the headers required for using the token as an auth. | def _token_header(token=None):
if not token:
return None
message = '{token}:Ignored'.format(token=token)
headers = {'Authorization': 'Basic {code}'.format(
code=base64.b64encode(message))}
return headers | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_headers(self):\n return {\n 'Authorization': 'JWT {}'.format(self.token)\n }",
"def get_headers():\n headers = {\n \"Authorization\": \"Token {}\".format(get_token()),\n }\n\n return headers",
"def _auth_headers(self):\n if self.token_str:\n ... | [
"0.8091391",
"0.8062149",
"0.804831",
"0.8005494",
"0.79917735",
"0.7826117",
"0.78182995",
"0.77772725",
"0.773813",
"0.7694959",
"0.7689246",
"0.7612669",
"0.755713",
"0.7540428",
"0.7509418",
"0.7506742",
"0.74680114",
"0.7446962",
"0.7445161",
"0.743165",
"0.7427711",
"... | 0.7134794 | 36 |
Assert the the response is an OK. Extra fields can be expected in the `extras` parameter. | def assertJsonOk(self, response, **extras):
expected = {'status': 'OK'}
if extras:
expected.update(extras)
self.assertStatusCode(response, 200)
self.assertJson(response, expected)
return | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def checkResponseOK(response):\n assert response['result'] == 'OK'",
"def assertJSONOk(self, response, **extras):\n expected = {'status': 'OK'}\n if extras:\n expected.update(extras)\n\n self.assertStatus(response, 200)\n self.assertJSON(response, expected)\n retu... | [
"0.8296555",
"0.8127737",
"0.78719413",
"0.7775044",
"0.7658192",
"0.7588231",
"0.75510305",
"0.7550003",
"0.75312257",
"0.7314572",
"0.7205102",
"0.7108372",
"0.70734847",
"0.7006003",
"0.7000779",
"0.69692844",
"0.6950052",
"0.6825439",
"0.681572",
"0.6810266",
"0.6793165",... | 0.8230501 | 1 |
Assert that the response is an error. Extra fields returned in the JSON can be expected in the `extras` parameter. | def assertJsonError(self, response, status, message, **extras):
expected = {'status': 'ERROR', 'message': message}
if extras:
expected.update(extras)
self.assertStatusCode(response, status)
self.assertJson(response, expected)
return | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def assert_api_error(response, msg: Optional[str] = None) -> None:\n assert response.status_code == 200\n assert not response.json[\"success\"]\n if msg:\n assert msg in response.json[\"error\"]",
"def assert_has_valid_error(self, response, expected_code):\r\n assert 'error' in respons... | [
"0.779303",
"0.7741365",
"0.7584659",
"0.7528866",
"0.7159448",
"0.71301717",
"0.7120402",
"0.70875424",
"0.70858455",
"0.7065084",
"0.70433134",
"0.70217675",
"0.69692373",
"0.69486886",
"0.69292754",
"0.6886598",
"0.6877572",
"0.6828764",
"0.68070066",
"0.6804364",
"0.67979... | 0.8422305 | 0 |
Send a PUT request to the URL. | def put(self, url, data, token=None):
return self.app.put(url,
data=json.dumps(data),
headers=_token_header(token),
content_type='application/json') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def put(self, url, body, headers={}):\n return self.request(url, \"PUT\", body, headers)",
"def _put(self, url, **kwargs):\n return self._call('PUT', url, kwargs)",
"def put(url, to_error=_default_to_error, data=None, **kwargs):\n\n return request('put', url, to_error=to_error, data=data, **kw... | [
"0.83192074",
"0.8288409",
"0.8159255",
"0.81300706",
"0.7931903",
"0.7921917",
"0.7916441",
"0.7915346",
"0.7908504",
"0.78794545",
"0.7711567",
"0.7711194",
"0.7668916",
"0.7533713",
"0.7490836",
"0.7451101",
"0.73925275",
"0.72986305",
"0.72695446",
"0.72669786",
"0.725458... | 0.71287555 | 24 |
Send a GET request to the URL. There is no data to be send. | def get(self, url, token=None):
return self.app.get(url,
headers=_token_header(token)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def do_GET(self):\n self.http_method = 'GET'\n self.response()",
"def do_GET(self):\r\n self._send_handler_response('GET')",
"def do_GET(self):\n self._try_to_process_request(self._handle_get_request)",
"def send_get(self, api_url, query=None):\n resp = requests.get(self.ba... | [
"0.77420527",
"0.77094686",
"0.7393626",
"0.7372147",
"0.73245174",
"0.7322977",
"0.7279094",
"0.72747684",
"0.72692585",
"0.72555494",
"0.71882886",
"0.7172191",
"0.7145851",
"0.7055571",
"0.70314294",
"0.7028103",
"0.7025007",
"0.69873273",
"0.6925966",
"0.69149184",
"0.689... | 0.0 | -1 |
The set of arguments for constructing a ClusterAgentToken resource. | def __init__(__self__, *,
agent_id: pulumi.Input[int],
project: pulumi.Input[str],
description: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None):
pulumi.set(__self__, "agent_id", agent_id)
pulumi.set(__self_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(__self__,\n resource_name: str,\n args: ClusterAgentTokenArgs,\n opts: Optional[pulumi.ResourceOptions] = None):\n ...",
"def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None,... | [
"0.7123412",
"0.6074739",
"0.54533434",
"0.5437853",
"0.539873",
"0.5126117",
"0.50890976",
"0.5071293",
"0.5059594",
"0.50391245",
"0.5038286",
"0.50301427",
"0.5018265",
"0.5017211",
"0.5017211",
"0.5017211",
"0.50164014",
"0.4995681",
"0.49886116",
"0.4978059",
"0.49468428... | 0.0 | -1 |
The ID of the agent. | def agent_id(self) -> pulumi.Input[int]:
return pulumi.get(self, "agent_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def agent_id(self):\n return self._agent_id",
"def agent_id(self) -> pulumi.Output[int]:\n return pulumi.get(self, \"agent_id\")",
"def getAgentID(self):\n\t\treturn self.agentID",
"def agent_id(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"agent_id\")",
"def getId(... | [
"0.8720701",
"0.8608742",
"0.83940953",
"0.81804967",
"0.77296793",
"0.73145324",
"0.73134726",
"0.72479194",
"0.7237987",
"0.723608",
"0.71908015",
"0.7102319",
"0.7062146",
"0.7062146",
"0.7062146",
"0.7062146",
"0.7062146",
"0.7062146",
"0.7062146",
"0.7062146",
"0.7062146... | 0.8595378 | 2 |
The Name of the agent. | def name(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def server_agent_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"server_agent_name\")",
"def job_agent_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"job_agent_name\")",
"def server_agent_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"ser... | [
"0.78339463",
"0.75301194",
"0.7490555",
"0.7490555",
"0.74010587",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
... | 0.0 | -1 |
The ID of the agent. | def agent_id(self) -> Optional[pulumi.Input[int]]:
return pulumi.get(self, "agent_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def agent_id(self):\n return self._agent_id",
"def agent_id(self) -> pulumi.Output[int]:\n return pulumi.get(self, \"agent_id\")",
"def agent_id(self) -> pulumi.Input[int]:\n return pulumi.get(self, \"agent_id\")",
"def getAgentID(self):\n\t\treturn self.agentID",
"def getId(self):\n ... | [
"0.8720701",
"0.8608742",
"0.8595378",
"0.83940953",
"0.77296793",
"0.73145324",
"0.73134726",
"0.72479194",
"0.7237987",
"0.723608",
"0.71908015",
"0.7102319",
"0.7062146",
"0.7062146",
"0.7062146",
"0.7062146",
"0.7062146",
"0.7062146",
"0.7062146",
"0.7062146",
"0.7062146"... | 0.81804967 | 4 |
The ISO8601 datetime when the agent was created. | def created_at(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "created_at") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def created_date_time(self) -> str:\n return pulumi.get(self, \"created_date_time\")",
"def date(self):\n return DateTime(self.created)",
"def date_created(self) -> datetime:\n return self._date_created",
"def get_creation_time(self):\n return self.get_attr('date_created')",
"de... | [
"0.78082407",
"0.77266705",
"0.7683405",
"0.76564795",
"0.7579632",
"0.7579632",
"0.7579632",
"0.75597674",
"0.75597674",
"0.755122",
"0.755122",
"0.755122",
"0.753003",
"0.74929994",
"0.7490399",
"0.74360967",
"0.74360967",
"0.74360967",
"0.7433252",
"0.7433252",
"0.7433252"... | 0.0 | -1 |
The ID of the user who created the agent. | def created_by_user_id(self) -> Optional[pulumi.Input[int]]:
return pulumi.get(self, "created_by_user_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_user_id(self):\n return self.id_user",
"def created_by_user_id(self) -> pulumi.Output[int]:\n return pulumi.get(self, \"created_by_user_id\")",
"def get_id(self):\n return self.user_id",
"def user_id(self):\n return self.status.user[\"id\"]",
"def user_id(self) -> str:\n... | [
"0.7638431",
"0.75843173",
"0.7528844",
"0.7520064",
"0.74972904",
"0.74972904",
"0.7490891",
"0.7482224",
"0.74562764",
"0.74562764",
"0.7432956",
"0.7432956",
"0.7432956",
"0.7432956",
"0.7432956",
"0.7397565",
"0.7390052",
"0.7390052",
"0.7390052",
"0.73788756",
"0.7327726... | 0.76406336 | 0 |
The ISO8601 datetime when the token was last used. | def last_used_at(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "last_used_at") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def token_expiry_date(self):\n return self.__token_expiry_date",
"def get_timestamp(self):\n return datetime.datetime.utcnow()",
"def timestamp(self) -> datetime:\r\n return self._timestamp",
"def datetime(self):\n return self._datetime",
"def timestamp(self):\n return se... | [
"0.76950127",
"0.73088133",
"0.7157943",
"0.70777804",
"0.70218694",
"0.69645715",
"0.69645715",
"0.69645715",
"0.6955441",
"0.6955441",
"0.6955441",
"0.6955441",
"0.6955441",
"0.6955441",
"0.6955441",
"0.6935181",
"0.6915821",
"0.69136053",
"0.69136053",
"0.69136053",
"0.690... | 0.0 | -1 |
The Name of the agent. | def name(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def server_agent_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"server_agent_name\")",
"def job_agent_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"job_agent_name\")",
"def server_agent_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"ser... | [
"0.78339463",
"0.75301194",
"0.7490555",
"0.7490555",
"0.74010587",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
... | 0.0 | -1 |
The status of the token. Valid values are `active`, `revoked`. | def status(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "status") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def auth_status(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"auth_status\")",
"def status(self):\n return self.get(self._names[\"status\"])",
"def status(self):\n return self._data['status']",
"def status(self):\n return STATUS[self.fields['status']]",
"def get_statu... | [
"0.7031284",
"0.6989282",
"0.6973444",
"0.6900319",
"0.6879644",
"0.6879644",
"0.6879644",
"0.6879554",
"0.67883444",
"0.67843896",
"0.67843896",
"0.67843896",
"0.67843896",
"0.67843896",
"0.67843896",
"0.67843896",
"0.67843896",
"0.67843896",
"0.67843896",
"0.67843896",
"0.6... | 0.0 | -1 |
The secret token for the agent. The `token` is not available in imported resources. | def token(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "token") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def token():\n return os.environ.get('TOKEN', None)",
"def _get_token(self) -> str:\n if IS_SUPERVISOR:\n # On supervisor installs the token is provided by a environment variable\n return os.environ[\"HASSIO_TOKEN\"]\n return self._token",
"def getToken():\n token = ge... | [
"0.7648019",
"0.7171449",
"0.6983897",
"0.69376534",
"0.69183296",
"0.69183296",
"0.69183296",
"0.68213236",
"0.6653326",
"0.66345036",
"0.6579541",
"0.6536636",
"0.64807683",
"0.64256006",
"0.6393913",
"0.6385044",
"0.63803583",
"0.63743347",
"0.63743347",
"0.63743347",
"0.6... | 0.6102924 | 50 |
The ID of the token. | def token_id(self) -> Optional[pulumi.Input[int]]:
return pulumi.get(self, "token_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def token_id(self) -> pulumi.Output[int]:\n return pulumi.get(self, \"token_id\")",
"def identifier(self) -> str:\n return self.current_token",
"def get_token_id(self):\n return f\"{self.document_title}_{self.index}\"",
"def token_id_hex(self) -> str: # this is *ALSO* a MINT property\n ... | [
"0.86078334",
"0.8088483",
"0.7809443",
"0.775026",
"0.75488836",
"0.75207514",
"0.7356456",
"0.727146",
"0.727146",
"0.727146",
"0.7270929",
"0.7269105",
"0.7263741",
"0.7260225",
"0.7201723",
"0.7189615",
"0.71678805",
"0.7160857",
"0.7155969",
"0.71258813",
"0.71140665",
... | 0.82888305 | 1 |
Get an existing ClusterAgentToken resource's state with the given name, id, and optional extra properties used to qualify the lookup. | def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
agent_id: Optional[pulumi.Input[int]] = None,
created_at: Optional[pulumi.Input[str]] = None,
created_by_user_id: Optional[pulumi.Input[int]] = None,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None,\n activation_key: Optional[pulumi.Input[str]] = None,\n arn: Optional[pulumi.Input[str]] = None,\n ip_address: Optional[pulumi.Input[str]] = None,\n ... | [
"0.5729356",
"0.5240354",
"0.4993941",
"0.49915427",
"0.48459008",
"0.47981727",
"0.47868702",
"0.47089988",
"0.4699771",
"0.4669539",
"0.4664007",
"0.46348143",
"0.46191856",
"0.45810008",
"0.45749027",
"0.4571029",
"0.45167115",
"0.44843623",
"0.44670457",
"0.44451842",
"0.... | 0.71814287 | 0 |
The ID of the agent. | def agent_id(self) -> pulumi.Output[int]:
return pulumi.get(self, "agent_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def agent_id(self):\n return self._agent_id",
"def agent_id(self) -> pulumi.Input[int]:\n return pulumi.get(self, \"agent_id\")",
"def getAgentID(self):\n\t\treturn self.agentID",
"def agent_id(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"agent_id\")",
"def getId(s... | [
"0.8720701",
"0.8595378",
"0.83940953",
"0.81804967",
"0.77296793",
"0.73145324",
"0.73134726",
"0.72479194",
"0.7237987",
"0.723608",
"0.71908015",
"0.7102319",
"0.7062146",
"0.7062146",
"0.7062146",
"0.7062146",
"0.7062146",
"0.7062146",
"0.7062146",
"0.7062146",
"0.7062146... | 0.8608742 | 1 |
The ISO8601 datetime when the agent was created. | def created_at(self) -> pulumi.Output[str]:
return pulumi.get(self, "created_at") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def created_date_time(self) -> str:\n return pulumi.get(self, \"created_date_time\")",
"def date(self):\n return DateTime(self.created)",
"def date_created(self) -> datetime:\n return self._date_created",
"def get_creation_time(self):\n return self.get_attr('date_created')",
"de... | [
"0.78082407",
"0.77266705",
"0.7683405",
"0.76564795",
"0.7579632",
"0.7579632",
"0.7579632",
"0.75597674",
"0.75597674",
"0.755122",
"0.755122",
"0.755122",
"0.753003",
"0.74929994",
"0.7490399",
"0.74360967",
"0.74360967",
"0.74360967",
"0.7433252",
"0.7433252",
"0.7433252"... | 0.7078203 | 82 |
The ID of the user who created the agent. | def created_by_user_id(self) -> pulumi.Output[int]:
return pulumi.get(self, "created_by_user_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def created_by_user_id(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"created_by_user_id\")",
"def get_user_id(self):\n return self.id_user",
"def get_id(self):\n return self.user_id",
"def user_id(self):\n return self.status.user[\"id\"]",
"def user_id(self) ... | [
"0.76406336",
"0.7638431",
"0.7528844",
"0.7520064",
"0.74972904",
"0.74972904",
"0.7490891",
"0.7482224",
"0.74562764",
"0.74562764",
"0.7432956",
"0.7432956",
"0.7432956",
"0.7432956",
"0.7432956",
"0.7397565",
"0.7390052",
"0.7390052",
"0.7390052",
"0.73788756",
"0.7327726... | 0.75843173 | 2 |
The ISO8601 datetime when the token was last used. | def last_used_at(self) -> pulumi.Output[str]:
return pulumi.get(self, "last_used_at") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def token_expiry_date(self):\n return self.__token_expiry_date",
"def get_timestamp(self):\n return datetime.datetime.utcnow()",
"def timestamp(self) -> datetime:\r\n return self._timestamp",
"def datetime(self):\n return self._datetime",
"def timestamp(self):\n return se... | [
"0.76950127",
"0.73088133",
"0.7157943",
"0.70777804",
"0.70218694",
"0.69645715",
"0.69645715",
"0.69645715",
"0.6955441",
"0.6955441",
"0.6955441",
"0.6955441",
"0.6955441",
"0.6955441",
"0.6955441",
"0.6935181",
"0.6915821",
"0.69136053",
"0.69136053",
"0.69136053",
"0.690... | 0.0 | -1 |
The Name of the agent. | def name(self) -> pulumi.Output[str]:
return pulumi.get(self, "name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def server_agent_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"server_agent_name\")",
"def job_agent_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"job_agent_name\")",
"def server_agent_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"ser... | [
"0.78339463",
"0.75301194",
"0.7490555",
"0.7490555",
"0.74010587",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
... | 0.0 | -1 |
The status of the token. Valid values are `active`, `revoked`. | def status(self) -> pulumi.Output[str]:
return pulumi.get(self, "status") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def auth_status(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"auth_status\")",
"def status(self):\n return self.get(self._names[\"status\"])",
"def status(self):\n return self._data['status']",
"def status(self):\n return STATUS[self.fields['status']]",
"def get_statu... | [
"0.7031284",
"0.6989282",
"0.6973444",
"0.6900319",
"0.6879644",
"0.6879644",
"0.6879644",
"0.6879554",
"0.67883444",
"0.67843896",
"0.67843896",
"0.67843896",
"0.67843896",
"0.67843896",
"0.67843896",
"0.67843896",
"0.67843896",
"0.67843896",
"0.67843896",
"0.67843896",
"0.6... | 0.0 | -1 |
The secret token for the agent. The `token` is not available in imported resources. | def token(self) -> pulumi.Output[str]:
return pulumi.get(self, "token") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def token():\n return os.environ.get('TOKEN', None)",
"def _get_token(self) -> str:\n if IS_SUPERVISOR:\n # On supervisor installs the token is provided by a environment variable\n return os.environ[\"HASSIO_TOKEN\"]\n return self._token",
"def getToken():\n token = ge... | [
"0.7648019",
"0.7171449",
"0.6983897",
"0.69376534",
"0.69183296",
"0.69183296",
"0.69183296",
"0.68213236",
"0.6653326",
"0.66345036",
"0.6579541",
"0.6536636",
"0.64807683",
"0.64256006",
"0.6385044",
"0.63803583",
"0.63743347",
"0.63743347",
"0.63743347",
"0.63204384",
"0.... | 0.6393913 | 14 |
The ID of the token. | def token_id(self) -> pulumi.Output[int]:
return pulumi.get(self, "token_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def token_id(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"token_id\")",
"def identifier(self) -> str:\n return self.current_token",
"def get_token_id(self):\n return f\"{self.document_title}_{self.index}\"",
"def token_id_hex(self) -> str: # this is *ALSO* a MINT pr... | [
"0.82888305",
"0.8088483",
"0.7809443",
"0.775026",
"0.75488836",
"0.75207514",
"0.7356456",
"0.727146",
"0.727146",
"0.727146",
"0.7270929",
"0.7269105",
"0.7263741",
"0.7260225",
"0.7201723",
"0.7189615",
"0.71678805",
"0.7160857",
"0.7155969",
"0.71258813",
"0.71140665",
... | 0.86078334 | 0 |
Returns the next valid date given a datetime.date object. | def increment_day(date):
year, month, day = (date.year, date.month, date.day)
try:
day += 1
return datetime.date(year, month, day)
except ValueError:
try:
month += 1
day = 1
return datetime.date(year, month, day)
except ValueError:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def next_day(date):\n return date + datetime.timedelta(days=1)",
"def next_day(date):\n return date + datetime.timedelta(days=1)",
"def find_next_valid(data, date):\n correct_date = None\n while correct_date is None:\n try:\n _ = data.loc[date]\n correct_date = date\n ... | [
"0.78486747",
"0.78486747",
"0.7615841",
"0.694042",
"0.671127",
"0.6605883",
"0.65694004",
"0.6512969",
"0.6512533",
"0.6448639",
"0.6387723",
"0.6386412",
"0.6384641",
"0.6356952",
"0.6345007",
"0.6292043",
"0.6283096",
"0.62576383",
"0.6245417",
"0.6240974",
"0.623508",
... | 0.65591383 | 7 |
Override default getattr to return tracked attribute. | def __getattr__(self, item):
if item.startswith("_"):
return super(Slicer, self).__getattr__(item)
if item == "o":
return reduced_o(self._anon)
else:
tracked = self._objects.get(item, None)
if tracked is None:
tracked = self._alias... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __getattr__(self, attr):\n return self.get(attr)",
"def __getattr__(self, attr):\n return getattr(self.obj, attr)",
"def __getattr__(self, attr):\n return getattr(self.obj, attr)",
"def __getattr__(self, name: str) -> Any:\n return self.__getattribute__(name)",
"def get(self... | [
"0.7684176",
"0.73574626",
"0.73574626",
"0.71724224",
"0.7144134",
"0.7143065",
"0.7102811",
"0.70685124",
"0.7052267",
"0.7050965",
"0.7042985",
"0.7042985",
"0.7042985",
"0.7042985",
"0.7042985",
"0.7042985",
"0.7042985",
"0.7042985",
"0.70120555",
"0.7006711",
"0.70016825... | 0.62623334 | 93 |
Override default setattr to sync tracking of slicer. | def __setattr__(self, key, value):
if key.startswith("_"):
return super(Slicer, self).__setattr__(key, value)
# Grab previous objects if they exist:
old_obj = self._objects.get(key, None)
old_alias = self._aliases.get(key, None)
# For existing attributes, honor Alia... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __setattr__(self, attr, value):\n super().__setattr__(attr, value)",
"def __setattr__(self, *args, **kwargs): # real signature unknown\n pass",
"def __setattr__(self, *args, **kwargs): # real signature unknown\n pass",
"def __setattr__(self, *args, **kwargs): # real signature unknown... | [
"0.6426999",
"0.6182711",
"0.6182711",
"0.6182711",
"0.6182711",
"0.6182711",
"0.6182711",
"0.6182711",
"0.6182711",
"0.6182711",
"0.6182711",
"0.6182711",
"0.6182711",
"0.6182711",
"0.6182711",
"0.6182711",
"0.6182711",
"0.6182711",
"0.6182711",
"0.6182711",
"0.6182711",
"... | 0.61814886 | 61 |
Override default repr for human readability. | def __repr__(self):
orig = self.__dict__
di = {}
for key, value in orig.items():
if not key.startswith("_"):
di[key] = value
return f"{self.__class__.__name__}({str(di)})" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _extra_repr(self):\n return ''",
"def repr(self):\n raise InterpreterError(\"Unimplemented repr()\")",
"def __repr__(self):\n # this is a good default __repr__\n # Q: using the docs, can you figure out what this is doing?\n return f\"<{type(self).__name__} {self.__dict__}... | [
"0.7940475",
"0.76482254",
"0.7644189",
"0.7599362",
"0.7593376",
"0.7589166",
"0.7574318",
"0.7574318",
"0.75735915",
"0.74729484",
"0.746941",
"0.7391284",
"0.7391284",
"0.7391284",
"0.7391284",
"0.7382557",
"0.7378745",
"0.73776764",
"0.73640203",
"0.73519033",
"0.7345789"... | 0.0 | -1 |
Add extra Q for user list queryset | def register_extra_query(cls, func_get_query):
cls._extra_query.append(func_get_query) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_queryset(self, *args, **kwargs):\n qs = super().get_queryset(*args, **kwargs).filter(user=self.request.user)\n return qs",
"def get_queryset(self):\n queryset = super(viewsets.ModelViewSet, self).get_queryset().order_by('first_name')\n\n if self.request.GET.get('q', None):\n ... | [
"0.68715924",
"0.6788188",
"0.66180813",
"0.66014534",
"0.65773475",
"0.6528261",
"0.65206707",
"0.6518756",
"0.6466846",
"0.6454059",
"0.6451597",
"0.644785",
"0.6385647",
"0.6349942",
"0.6347449",
"0.6340275",
"0.6340275",
"0.6340275",
"0.6335473",
"0.6320915",
"0.6317904",... | 0.0 | -1 |
An adaptive learning rate optimizer | def adadelta(lr, tparams, grads, x, y, cost):
zipped_grads = [theano.shared(p.get_value() * numpy_floatX(0.),
name='%s_grad' % k)
for k, p in tparams.iteritems()]
running_up2 = [theano.shared(p.get_value() * numpy_floatX(0.),
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def adjust_learning_rate(optimizer):\n for group in optimizer.param_groups:\n if 'step' not in group:\n group['step'] = 0\n group['step'] += 1\n\n group['lr'] = args.lr / (1 + group['step'] * args.lr_decay)",
"def adjust_learning_rate(optimizer):\n for group in optimizer.par... | [
"0.7576067",
"0.7522943",
"0.7405154",
"0.7300586",
"0.7292182",
"0.7284016",
"0.7246172",
"0.72219795",
"0.72171766",
"0.71947455",
"0.71901083",
"0.71776354",
"0.7175784",
"0.7175784",
"0.7175784",
"0.7174171",
"0.717094",
"0.71655536",
"0.71610427",
"0.71595126",
"0.715858... | 0.0 | -1 |
Convert decoded JSON to a ClientData object. Take the object decoded from the JSON and if it corresponds to ClientData objects, convert it to a ClientData object. | def _object_decode(self, d):
if ((isinstance(d, dict)) and
('clientId' in d)):
cd = ClientData(**d)
return cd
elif self._other_object_hook is not None:
return self._other_object_hook(d)
else:
return d | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _decode(self, data: bytes):\n\n return json.loads(data.decode('utf-8'))",
"def json_decode(data):\n if isinstance(data, bytes):\n data = data.decode(\"utf-8\")\n\n return json.loads(data)",
"def _from_json(return_obj):\n\n return json.loads(return_obj.decode())",
"def from_json... | [
"0.65471876",
"0.6504613",
"0.64651257",
"0.645426",
"0.6378964",
"0.6175173",
"0.61399347",
"0.6085762",
"0.607858",
"0.6064476",
"0.6034679",
"0.60334545",
"0.6027644",
"0.5978138",
"0.59381735",
"0.5936755",
"0.59308106",
"0.5926971",
"0.59009254",
"0.5885581",
"0.58525854... | 0.7351155 | 0 |
Constructor for ClientData object. Used by ClientDataDecoder, a JSONDecoder. | def __init__(self, **kw_args):
self._isoFmt = "%Y%m%dT%H%M%S%z"
self._init_client_id(kw_args)
self._init_shared_secret(kw_args)
self._init_counter_from_time(kw_args)
self._init_last_count(kw_args)
self._init_last_count_update_time(kw_args)
self._init_period(kw_ar... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_client(self, data):\r\n pass",
"def __init__(self, client=None):\n self._client = client",
"def __init__(self, data):\n self.data = data\n return",
"def __init__(self, client):\n self._client = client",
"def __init__(self, client):\n\n self.client = client... | [
"0.6422746",
"0.6390529",
"0.63650286",
"0.6287494",
"0.62591165",
"0.6249365",
"0.6191964",
"0.618473",
"0.6179052",
"0.6158204",
"0.6158204",
"0.6158204",
"0.61580455",
"0.6119559",
"0.6112144",
"0.6112144",
"0.6112144",
"0.6112144",
"0.6058809",
"0.6056181",
"0.60296744",
... | 0.57924926 | 40 |
Whether this object is equal to the other. | def __eq__(self, other):
if type(self) != type(other):
return False
s_vars = vars(self)
o_vars = vars(other)
for v in vars(self):
if s_vars[v] != o_vars[v]:
print("unequal property {0}\n".format(v))
if v.endswith("last_count_update_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return self is other",
"def __eq__(self, other):\n return self is other",
"def __eq__(self,other):\n return self is other",
"def __eq__(self, other):\n if isinstance(self, other.__class__):\n return self.__dict__ == other.__dict__\n ret... | [
"0.867391",
"0.867391",
"0.85389054",
"0.8401829",
"0.8389734",
"0.8389734",
"0.8358202",
"0.8312268",
"0.8312268",
"0.82864183",
"0.8281654",
"0.82786906",
"0.82786906",
"0.8276752",
"0.82594275",
"0.82587564",
"0.8248307",
"0.8210511",
"0.8210511",
"0.8210511",
"0.8210511",... | 0.0 | -1 |
Whether this object is not equal to the other. | def __ne__(self, other):
if type(self) != type(other):
return True
s_vars = vars(self)
o_vars = vars(other)
for v in vars(self):
if s_vars[v] != o_vars[v]:
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__ (self, other):\n return not self == other",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other):\n return not self == other",
"def __ne__(self, other):\n return not self == other",
"def __ne__(self, other):\n return not ... | [
"0.8941533",
"0.87022775",
"0.86881167",
"0.86881167",
"0.86881167",
"0.86881167",
"0.86881167",
"0.86881167",
"0.86881167",
"0.86881167",
"0.86881167",
"0.86881167",
"0.86881167",
"0.86881167",
"0.86881167",
"0.86881167",
"0.86881167",
"0.86881167",
"0.86881167",
"0.86881167",... | 0.0 | -1 |
Canonical string representation of this object. | def __repr__(self):
result = []
result.append(
"ClientData(client_id='{0}',".format(self.__client_id))
result.append(
"shared_secret='{0}',".format(self.__shared_secret))
result.append(
"last_count_update_time='{0}')".format(
self.__las... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_string(self):\r\n return self.__str__()",
"def serialize(self):\n\n return str(self)",
"def as_string(self):\n return self.__repr__()",
"def serialize(self):\n\n\t\treturn str(self)",
"def __str__(self):\n return str(self.serialize())",
"def __str__(self) -> str:\n ... | [
"0.7634768",
"0.76202106",
"0.7586968",
"0.7519495",
"0.7494388",
"0.74759656",
"0.7447208",
"0.7422603",
"0.740179",
"0.7383906",
"0.73731464",
"0.73479104",
"0.73324186",
"0.731711",
"0.731711",
"0.731711",
"0.72959983",
"0.72874147",
"0.72874147",
"0.72874147",
"0.72874147... | 0.0 | -1 |
Store ClientData objects into encrypted file. Store the list of ClientData objects as a JSON document in a file encrypted with the passphrase. | def save(self, filepath, client_data_list, new_passphrase=None):
import struct
plain_text = json.dumps(
client_data_list, sort_keys=True, indent=4, separators=(',', ': '),
cls=ClientDataEncoder)
header = b''.join([
struct.pack("!I", self.__magic_number),
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _write(self):\n raw_data = {'file_version': 1}\n raw_creds = []\n raw_data['data'] = raw_creds\n for (cred_key, cred) in self._data.items():\n raw_key = dict(cred_key)\n raw_cred = json.loads(cred.to_json())\n raw_creds.append({'key': raw_key, 'crede... | [
"0.6999334",
"0.63331616",
"0.63203996",
"0.6197662",
"0.61815417",
"0.6113151",
"0.60673785",
"0.5794931",
"0.5777157",
"0.5735691",
"0.57253367",
"0.56854194",
"0.56848943",
"0.5683715",
"0.56807464",
"0.56693393",
"0.5633521",
"0.5616779",
"0.5616678",
"0.5586651",
"0.5569... | 0.8028827 | 0 |
Return True if the tile (m, n) has been cleaned. Assumes that (m, n) represents a valid tile inside the room. | def isTileCleaned(self, m, n):
return self.tiles[n][m] == True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isTileCleaned(self, m, n):\n if (m, n) in self.clean_tiles:\n return True\n return False",
"def isTileCleaned(self, m, n):\n \n if self.tiles[Position(m, n)] == 'clean':\n return True\n else:\n return False",
"def isTileCleaned(self, m, n)... | [
"0.88597345",
"0.85988295",
"0.85317594",
"0.85142916",
"0.84697247",
"0.846929",
"0.71480703",
"0.6396753",
"0.63434696",
"0.6323528",
"0.62693465",
"0.625582",
"0.624673",
"0.62339276",
"0.6221796",
"0.6211104",
"0.61941254",
"0.6129271",
"0.6124708",
"0.61234796",
"0.60972... | 0.88561296 | 1 |
Return the total number of tiles in the room. | def getNumTiles(self):
return self.w * self.h | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getNumTiles(self):\n return self.height * self.width",
"def getNumTiles(self):\n return len(list(product(list(range(self.width+1))[1:], list(range(self.height+1))[1:])))",
"def getNumTiles(self):\n return (self.width) * (self.height)",
"def num_tiles(self):\n return self.num_row_t... | [
"0.8205867",
"0.81903553",
"0.81504375",
"0.8046322",
"0.8039323",
"0.7871275",
"0.78123623",
"0.7472709",
"0.7407938",
"0.7151273",
"0.7067083",
"0.6982381",
"0.69224",
"0.6857802",
"0.6832814",
"0.6813225",
"0.67038375",
"0.66893554",
"0.66816777",
"0.6676057",
"0.66583914"... | 0.79811716 | 5 |
Return a random position inside the room. | def getRandomPosition(self):
return Position(random.random()*self.w, random.random()*self.h) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getRandomPosition(self):\n x = random.randint(0, self.width - 1)\n y = random.randint(0, self.height - 1)\n return Position(x, y)",
"def getRandomPosition(self):\n return Position(random.uniform(0, self.width), random.uniform(0, self.height))",
"def _get_random_position(self):\n... | [
"0.8408874",
"0.8339333",
"0.8331419",
"0.83306754",
"0.8253471",
"0.8129327",
"0.79893064",
"0.7975111",
"0.79634804",
"0.78944933",
"0.76948863",
"0.74812585",
"0.74559724",
"0.73774105",
"0.73208076",
"0.730955",
"0.7219106",
"0.7115554",
"0.7098047",
"0.70740753",
"0.7016... | 0.84095305 | 0 |
Return True if pos is inside the room. | def isPositionInRoom(self, pos):
if pos.getX() >= 0 and pos.getX() < self.w:
if pos.getY() >= 0 and pos.getY() < self.h:
return True
return False
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isPositionInRoom(self, pos):\n posX = pos.getX()\n posY = pos.getY()\n if posX >= 0 and posX < self.width and posY >= 0 and posY < self.height:\n return True\n return False",
"def isPositionInRoom(self, pos):\n\t\tif pos.getX() >= 0.0 and pos.getX() < float(self.width):... | [
"0.85856265",
"0.8501791",
"0.8394953",
"0.8270461",
"0.81534183",
"0.79472804",
"0.7664707",
"0.75780624",
"0.7245776",
"0.7134537",
"0.70549065",
"0.7034335",
"0.6900973",
"0.6892583",
"0.6865422",
"0.6829012",
"0.6828001",
"0.6822237",
"0.68087435",
"0.68055147",
"0.679743... | 0.85830444 | 1 |
returns absolute path to archive file | def getArchiveURI(sha1,archivePath,fileType='jpg'):
(sha1Path,filename)=getSha1Path(sha1)
return(archivePath+'/'+sha1Path+'/'+filename+'.'+fileType) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def archive_path(self):\n return os.path.join(self.destination_directory, self.__archive_name__)",
"def path_as_archived( wav_file_path, archive_dir ):\n return os.path.join( archive_dir, os.path.basename( wav_file_path ) )",
"def getZipArchiveFullPath(self):\n\n if self._mode == \"zip\":\n ... | [
"0.8228015",
"0.7616653",
"0.757709",
"0.74785423",
"0.7088997",
"0.6817138",
"0.67750716",
"0.6671779",
"0.6665287",
"0.6606364",
"0.6548457",
"0.6540361",
"0.65281206",
"0.65281206",
"0.65260977",
"0.65006596",
"0.64912564",
"0.6480579",
"0.6474086",
"0.6454516",
"0.6430595... | 0.6911957 | 5 |
Convert data to standard ascii characters. | def _decode_data(self, data):
return data.decode('ISO-8859-1') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _convert_to_text(self):\n if type(self.data) is not list:\n return -1\n out = str()\n for element in self.data:\n out += chr(int(element))\n return (out)",
"def _string_data(self, data):\n print(\"_string_data:\")\n string_to_print = []\n ... | [
"0.7197761",
"0.68423116",
"0.68288904",
"0.6794233",
"0.67692846",
"0.6685742",
"0.6560976",
"0.6391082",
"0.63756526",
"0.6294149",
"0.6287743",
"0.6281194",
"0.6278725",
"0.62426907",
"0.6227459",
"0.61793",
"0.617161",
"0.61366737",
"0.6102505",
"0.6090761",
"0.60786945",... | 0.5391506 | 85 |
numerically stable log_softmax implementation that prevents overflow | def log_prob_from_logits(x):
axis = len(x.get_shape())-1
m = tf.reduce_max(x, axis, keep_dims=True)
return x - m - tf.log(tf.reduce_sum(tf.exp(x-m), axis, keep_dims=True)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stablesoftmax(x):\r\n shiftx = x - np.max(x)\r\n exps = np.exp(shiftx)\r\n return exps / np.sum(exps)",
"def log_softmax(input, dim, inplace=False):\n return FunctionLib.apply(\n 'LogSoftmax', input.device, [input],\n outputs=[input if inplace else None], axis=dim)",
"def log_soft... | [
"0.77298",
"0.77168965",
"0.77082556",
"0.76411545",
"0.76040596",
"0.7375868",
"0.7335469",
"0.7334381",
"0.7319122",
"0.7316114",
"0.7291785",
"0.72785354",
"0.72421026",
"0.7237872",
"0.7236452",
"0.7203207",
"0.7203207",
"0.7200916",
"0.719867",
"0.7190057",
"0.71697676",... | 0.7343657 | 6 |
We split the words so we can analyze them seperately | def author_name(text):
tag = text.split()
"""
We take the beginning of the text since the
author name will likely be there
"""
tag = tag[:100]
author = []
current_tag = 0
"""
We go through each word until we find the first instance
of the word 'by' or 'author', which shoul... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _split(self):\n \n self._words = []\n \n # (1) Expand contractions\n text = self._text.replace(\"'m \", \" am \")\n text = text.replace(\"'d \", \" would \")\n text = text.replace(\"'ll \", \" will \")\n text = text.replace(\"'ve \", \" have \")\n ... | [
"0.74844486",
"0.7355455",
"0.7257714",
"0.7257714",
"0.72485566",
"0.70969605",
"0.70969605",
"0.7084676",
"0.708436",
"0.708436",
"0.708436",
"0.708436",
"0.708436",
"0.7069055",
"0.70544416",
"0.70502704",
"0.6975336",
"0.69170445",
"0.68933433",
"0.6893294",
"0.6865692",
... | 0.0 | -1 |
Compute the size needed by a homogeneous BoxLayout. In a homogeneous box, the size allocated to the children is the same for all. The algorithm looks at all the children and finds the size of the biggest one. This size is used for all the children. This method is generic in the sense that it doesn't know whether the Bo... | def _requestSizeHomogeneous(self, children):
primary_length_name = self.PRIMARY_LENGTH
secondary_length_name = self.SECONDARY_LENGTH
max_size = Size(0, 0)
try:
for child in children:
max_size |= child.requested_size
except AttributeError as ex:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_compute_box_size(self):\n def compute_best_size_for(dim):\n size = ((self.element_space[dim]-1)//self.box_space[dim]) + 1\n size += 2 * self.ghost_space[dim]\n while size % Level.BOX_ALIGNMENTS[dim]:\n size += 1\n return size\n\n r... | [
"0.66977483",
"0.6370156",
"0.6296549",
"0.62391824",
"0.61786366",
"0.5886009",
"0.5824547",
"0.58231586",
"0.58202034",
"0.57819533",
"0.5761914",
"0.5759858",
"0.57494634",
"0.57494634",
"0.5701179",
"0.560091",
"0.5596764",
"0.5589172",
"0.5572187",
"0.5556853",
"0.552199... | 0.60242397 | 5 |
Compute the size needed by a heterogeneous BoxLayout. In a heterogeneous box, the size requested is just enough to hold the children with their requested size. The algorithm looks through all the children, summing their width or height (depends on the direction of the box), and taking the max of their height or width i... | def _requestSizeHeterogeneous(self, children):
primary_length_name = self.PRIMARY_LENGTH
secondary_length_name = self.SECONDARY_LENGTH
primary_length = secondary_length = 0
for child in children:
child_size = child.requested_size
primary_length += getattr(child_si... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_compute_box_size(self):\n def compute_best_size_for(dim):\n size = ((self.element_space[dim]-1)//self.box_space[dim]) + 1\n size += 2 * self.ghost_space[dim]\n while size % Level.BOX_ALIGNMENTS[dim]:\n size += 1\n return size\n\n r... | [
"0.67952865",
"0.62145597",
"0.6214305",
"0.6127589",
"0.6067746",
"0.5848009",
"0.58155066",
"0.57733303",
"0.57298225",
"0.568806",
"0.568806",
"0.56697273",
"0.5612735",
"0.55830956",
"0.5576738",
"0.55723006",
"0.55685544",
"0.55630285",
"0.5552761",
"0.55480534",
"0.5541... | 0.6069013 | 4 |
Check if queue is empty | def isEmpty(self):
self.logger.debug('Check if queue job is empty')
isEmpty = self.queue.empty()
self.logger.debug('Queue job is empty ?: %s'%(isEmpty))
return isEmpty | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_empty(self):\n return self.queue == []",
"def is_empty(self):\n return len(self.queue) == 0",
"def is_empty(self):\n return len(self.queue) == 0",
"def is_empty(self):\n return len(self.__queue) > 0",
"def is_empty(self):\n return len(self.the_queue) == 0",
"def ... | [
"0.8924103",
"0.88415533",
"0.88415533",
"0.8801944",
"0.87844974",
"0.87179065",
"0.87071383",
"0.8638672",
"0.8625907",
"0.8614518",
"0.85417366",
"0.8499197",
"0.8484975",
"0.84700626",
"0.8439533",
"0.84354514",
"0.8434577",
"0.8399098",
"0.83621544",
"0.83621544",
"0.825... | 0.8143622 | 28 |
Return the condition list from its index | def give_cond(self, idx):
return self._conds[idx] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_cond_instance(self, cond):\n tmp = integrate_multilabel_index(self.index, label_size=self._label_size, check_arr=False)\n if cond == 0:\n return [tp[0] for tp in tmp if len(tp) == 1]\n else:\n return [tp[0] for tp in tmp if len(tp) > 1]",
"def extractLIFO(self,... | [
"0.63874984",
"0.58443344",
"0.5766281",
"0.57433796",
"0.5672717",
"0.56280476",
"0.56280476",
"0.56280476",
"0.5627868",
"0.56104404",
"0.55799097",
"0.55588",
"0.55019385",
"0.5497234",
"0.5486861",
"0.544971",
"0.54467297",
"0.5436731",
"0.53251415",
"0.5252113",
"0.52408... | 0.6061257 | 2 |
Return the condition list from its index | def give_cond(self, idx):
return self._conds[idx] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_cond_instance(self, cond):\n tmp = integrate_multilabel_index(self.index, label_size=self._label_size, check_arr=False)\n if cond == 0:\n return [tp[0] for tp in tmp if len(tp) == 1]\n else:\n return [tp[0] for tp in tmp if len(tp) > 1]",
"def extractLIFO(self,... | [
"0.63874984",
"0.58443344",
"0.5766281",
"0.57433796",
"0.5672717",
"0.56280476",
"0.56280476",
"0.56280476",
"0.5627868",
"0.56104404",
"0.55799097",
"0.55588",
"0.55019385",
"0.5497234",
"0.5486861",
"0.544971",
"0.54467297",
"0.5436731",
"0.53251415",
"0.5252113",
"0.52408... | 0.6061257 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.