query stringlengths 9 9.05k | document stringlengths 10 222k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 4 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Obtain the statistics of a NIC. | def get_nic_statistics(self, nic_id):
return self._nic_mgmt.get_nic_statistics(nic_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def net_if_stats():\n ret = {}\n rawdict = cext.net_if_stats()\n for name, items in rawdict.items():\n if not PY3:\n assert isinstance(name, unicode), type(name)\n name = py2_strencode(name)\n isup, duplex, speed, mtu = items\n if hasattr(_common, 'NicDuplex'):\n... | [
"0.7753599",
"0.6423824",
"0.6105017",
"0.61031115",
"0.6079203",
"0.6048821",
"0.6016919",
"0.6014767",
"0.60094005",
"0.60058945",
"0.59886146",
"0.59816986",
"0.59121054",
"0.5828287",
"0.5790003",
"0.5785249",
"0.5766392",
"0.5762208",
"0.57266897",
"0.5714033",
"0.570610... | 0.77570844 | 0 |
Return the system id. | def get_system_id(self):
return system.SystemManagement(self.client).get_system_id() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_system_id(self):\n return self.machine_config_file_value(\"DEFAULT.SID\").strip('\"')",
"def file_system_id(self) -> str:\n return pulumi.get(self, \"file_system_id\")",
"def get_clone_system_id(self):\n\n sys_id = self.user_systems_mgr.get_system_id()\n return sys_id",
"d... | [
"0.83615786",
"0.7682273",
"0.7644981",
"0.7439022",
"0.72430104",
"0.7030237",
"0.70283455",
"0.7012562",
"0.68498755",
"0.6808678",
"0.6769043",
"0.6738126",
"0.6701721",
"0.6693738",
"0.6680318",
"0.66737354",
"0.66718143",
"0.6656414",
"0.6632786",
"0.6624779",
"0.6610771... | 0.9230369 | 0 |
Return the system model name. | def get_system_model_name(self):
return system.SystemManagement(self.client).get_system_model_name() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_model_name(self) -> str:\n return self._get_string(openvr.Prop_RenderModelName_String)",
"def get_model_name(self):\n\n model_name = []\n model_name.append(self.get_model_type_hash())\n model_name.append(str(int(time.time())))\n return \"_\".join(model_name) + \".model\... | [
"0.8073972",
"0.7907462",
"0.7865882",
"0.7822895",
"0.77484596",
"0.77091956",
"0.7602069",
"0.7596205",
"0.7582411",
"0.75579596",
"0.74520415",
"0.73455113",
"0.7313186",
"0.72846437",
"0.7255404",
"0.7246455",
"0.72429657",
"0.72080094",
"0.7186412",
"0.71400344",
"0.7137... | 0.9344253 | 0 |
Return the system service tag. | def get_system_service_tag(self):
return system.SystemManagement(self.client).get_system_service_tag() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def service(self) -> str:\n return pulumi.get(self, \"service\")",
"def system_service_type(self) -> pulumi.Input[Union[str, 'SystemServiceType']]:\n return pulumi.get(self, \"system_service_type\")",
"def name(self):\n return \"systemd Service\"",
"def tag(self) -> str:\n return ... | [
"0.6653975",
"0.6572798",
"0.65147954",
"0.6493566",
"0.6415243",
"0.6226118",
"0.6220162",
"0.6183548",
"0.6183548",
"0.61804986",
"0.61804986",
"0.61804986",
"0.61514616",
"0.6142467",
"0.6142467",
"0.6120087",
"0.6049482",
"0.6047134",
"0.6006878",
"0.6002862",
"0.59983057... | 0.9170598 | 0 |
Return true if the legacy, nonUEFI, boot protocol of a NIC is NONE, false otherwise. | def is_nic_legacy_boot_protocol_none(self, nic_id):
return self._nic_cfg.is_nic_legacy_boot_protocol_none(nic_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_nic_legacy_boot_protocol_pxe(self, nic_id):\n return self._nic_cfg.is_nic_legacy_boot_protocol_pxe(nic_id)",
"def check_ethernet_network():\n default_iface = get_default_route()\n\n assert default_iface[1] == sc.conf.iface, \"incorrect sc.conf.iface\"\n iface_str = ''\n if sys.platform.... | [
"0.66154706",
"0.63741845",
"0.6357392",
"0.61974496",
"0.6125806",
"0.59614533",
"0.5941091",
"0.5925817",
"0.591169",
"0.58899873",
"0.5883946",
"0.58777124",
"0.5874255",
"0.5867285",
"0.586479",
"0.5854184",
"0.583347",
"0.5828231",
"0.58214307",
"0.5816505",
"0.5798436",... | 0.7572183 | 0 |
Return true if the legacy, nonUEFI, boot protocol of a NIC is PXE, false otherwise. | def is_nic_legacy_boot_protocol_pxe(self, nic_id):
return self._nic_cfg.is_nic_legacy_boot_protocol_pxe(nic_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _is_boot_mode_uefi(self):\n boot_mode = self.get_current_boot_mode()\n if boot_mode == 'UEFI':\n return True\n else:\n return False",
"def pilotIsBootValid (self):\n return self.isBootValid()",
"def set_nic_legacy_boot_protocol_pxe(self, nic_id):\n r... | [
"0.6369349",
"0.61551464",
"0.6151524",
"0.58789355",
"0.5854465",
"0.5850924",
"0.58316624",
"0.58264965",
"0.5778411",
"0.5718265",
"0.56990516",
"0.56512976",
"0.56229997",
"0.5622764",
"0.5621647",
"0.5593441",
"0.55838615",
"0.55536574",
"0.5550629",
"0.5543813",
"0.5538... | 0.7476674 | 0 |
Return true if the link status of a NIC is up, false otherwise. | def is_nic_link_up(self, nic_id):
return self._nic_mgmt.is_nic_link_up(nic_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def IsLinkup(nic,timeout):\n nic = nic.strip()\n current = time.time()\n timeout += current\n while current < timeout:\n data = os.popen(\"ipconfig\").read().split(\"Ethernet adapter\")\n for item in data:\n if item.count(nic) and item.count(\"isconnected\") == 0: #Connected\n... | [
"0.7716848",
"0.72441226",
"0.7074061",
"0.70293516",
"0.6758236",
"0.6741784",
"0.67188364",
"0.66291785",
"0.66074085",
"0.6605761",
"0.6487093",
"0.64246756",
"0.6413659",
"0.63578165",
"0.6322977",
"0.62656623",
"0.6259921",
"0.62360674",
"0.6233668",
"0.62157416",
"0.621... | 0.78771025 | 0 |
Return the list of integrated NICs. | def list_integrated_nics(self, sort=False):
return self._nic_mgmt.list_integrated_nics(sort) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_network_interfaces(self):\n return self.mycam.devicemgmt.GetNetworkInterfaces()",
"def list():\n\n\treturn netifaces.interfaces()",
"def list_nics(self, sort=False):\n return self._nic_mgmt.list_nics(sort)",
"def find_nic():\n result = subprocess.run([\"iw\", \"dev\"], capture_output... | [
"0.7046846",
"0.6910179",
"0.67962945",
"0.6772716",
"0.67553645",
"0.6754463",
"0.6702723",
"0.65841603",
"0.6415843",
"0.63678586",
"0.6367431",
"0.6342075",
"0.63199943",
"0.63144964",
"0.6306874",
"0.6298536",
"0.62208396",
"0.6210721",
"0.6205201",
"0.61946857",
"0.61757... | 0.75222945 | 0 |
Return the list of attribute settings of a NIC. | def list_nic_settings(self, nic_id):
return self._nic_cfg.list_nic_settings(nic_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_nic_attributes(cls, interface):\n return NodeNICInterfaceClusterPlugin.\\\n get_all_enabled_attributes_by_interface(interface)",
"def get_nic_settings(bmc):\n nic_settings = bmc.list_nics()\n return nic_settings",
"def get_attribute_list(self):\n return self.dp.get_attrib... | [
"0.7211066",
"0.66627526",
"0.6172818",
"0.61454195",
"0.5977508",
"0.57929236",
"0.5752779",
"0.57477176",
"0.57086796",
"0.56704056",
"0.5659287",
"0.5601022",
"0.55941725",
"0.55941725",
"0.5570813",
"0.5560112",
"0.55204666",
"0.5490301",
"0.547466",
"0.54474443",
"0.5440... | 0.67747986 | 1 |
Return the list of NICs. | def list_nics(self, sort=False):
return self._nic_mgmt.list_nics(sort) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list():\n\n\treturn netifaces.interfaces()",
"def do_nic_list(cc, args):\n nics = cc.nic.list()\n names = ['%s (uuid) %s (mac)' % (nic.get('uuid'), nic.get('mac')) for nic in\n nics['nics']]\n cliutils.print_list(names, args.json)",
"def list_net(self):\n _url = \"http://\" + se... | [
"0.753512",
"0.74959314",
"0.73965627",
"0.7247876",
"0.69917715",
"0.68175",
"0.67618614",
"0.67329895",
"0.6687937",
"0.6673624",
"0.66728854",
"0.66436124",
"0.66415584",
"0.65566283",
"0.6548407",
"0.6429445",
"0.6410612",
"0.63945276",
"0.637308",
"0.6348048",
"0.6319437... | 0.760934 | 0 |
Schedules jobs for execution in a specified order. | def schedule_job_execution(self, job_ids, start_time='TIME_NOW'):
return self._job_mgmt.schedule_job_execution(job_ids, start_time) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def schedule(self, jobs):\n assert(isinstance(jobs, list) or jobs is None)\n with self.__lock:\n for job in jobs:\n while True:\n try:\n self.__queue.put(job, False)\n self.__lock.notify_all()\n ... | [
"0.64295745",
"0.5901927",
"0.58836645",
"0.5856689",
"0.5843526",
"0.5808002",
"0.574288",
"0.574288",
"0.5588306",
"0.554542",
"0.55356306",
"0.5499866",
"0.5479379",
"0.5449489",
"0.5427825",
"0.54005593",
"0.5362565",
"0.53619784",
"0.5353917",
"0.5340982",
"0.53276175",
... | 0.59230965 | 1 |
Set the legacy, nonUEFI, boot protocol of a NIC. If successful, the pending value of the NIC's legacy boot protocol attribute is set. For the new value to be applied, a configuration job must be created and the node must be rebooted. | def set_nic_legacy_boot_protocol(self, nic_id, value):
return self._nic_cfg.set_nic_legacy_boot_protocol(nic_id, value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_nic_legacy_boot_protocol_none(self, nic_id):\n return self._nic_cfg.set_nic_legacy_boot_protocol(nic_id, 'NONE')",
"def set_nic_legacy_boot_protocol_pxe(self, nic_id):\n return self._nic_cfg.set_nic_legacy_boot_protocol(nic_id, 'PXE')",
"def set_pending_boot_mode(self, boot_mode):\n ... | [
"0.68213123",
"0.6571011",
"0.6390049",
"0.6221169",
"0.62201256",
"0.5706811",
"0.55207795",
"0.5489483",
"0.5489388",
"0.54601496",
"0.5429905",
"0.53446037",
"0.5271917",
"0.5240692",
"0.51808566",
"0.51247257",
"0.51149714",
"0.5068805",
"0.5055276",
"0.50475967",
"0.5020... | 0.79571086 | 0 |
Set the legacy, nonUEFI, boot protocol of a NIC to NONE. If successful, the pending value of the NIC's legacy boot protocol attribute is set. For the new value to be applied, a configuration job must be created and the node must be rebooted. | def set_nic_legacy_boot_protocol_none(self, nic_id):
return self._nic_cfg.set_nic_legacy_boot_protocol(nic_id, 'NONE') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_nic_legacy_boot_protocol(self, nic_id, value):\n return self._nic_cfg.set_nic_legacy_boot_protocol(nic_id, value)",
"def is_nic_legacy_boot_protocol_none(self, nic_id):\n return self._nic_cfg.is_nic_legacy_boot_protocol_none(nic_id)",
"def set_nic_legacy_boot_protocol_pxe(self, nic_id):\n... | [
"0.7080708",
"0.67770797",
"0.6196294",
"0.5887492",
"0.5865701",
"0.57495344",
"0.5609847",
"0.55483353",
"0.5510577",
"0.5472218",
"0.54610366",
"0.5409589",
"0.5379189",
"0.5184566",
"0.51787657",
"0.5177618",
"0.5174813",
"0.5163825",
"0.5162536",
"0.51537764",
"0.5110679... | 0.8150516 | 0 |
Set the legacy, nonUEFI, boot protocol of a NIC to PXE. If successful, the pending value of the NIC's legacy boot protocol attribute is set. For the new value to be applied, a configuration job must be created and the node must be rebooted. | def set_nic_legacy_boot_protocol_pxe(self, nic_id):
return self._nic_cfg.set_nic_legacy_boot_protocol(nic_id, 'PXE') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_nic_legacy_boot_protocol(self, nic_id, value):\n return self._nic_cfg.set_nic_legacy_boot_protocol(nic_id, value)",
"def set_pending_boot_mode(self, boot_mode):\n boot_mode = boot_mode.lower()\n if boot_mode not in ['uefi', 'legacy']:\n msg = 'Invalid Boot mode specified'\... | [
"0.6869364",
"0.59294105",
"0.5910383",
"0.581359",
"0.5732103",
"0.5631665",
"0.56119615",
"0.54020804",
"0.5247397",
"0.5175284",
"0.5159106",
"0.5112706",
"0.5091555",
"0.50698566",
"0.5003087",
"0.49630225",
"0.4952853",
"0.49507043",
"0.49433762",
"0.48527044",
"0.484163... | 0.7358659 | 0 |
Modify a setting of a NIC. If successful, the pending value of the attribute is set. For the new value to be applied, a configuration job must be created and the node must be rebooted. | def set_nic_setting(self, nic_id, attribute_name, value):
return self._nic_cfg.set_nic_setting(nic_id, attribute_name, value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def do_nic_update(cc, args):\n\n patch = utils.args_array_to_patch(args.attributes[0])\n result = cc.nic.update(args.uuid, patch)\n cliutils.print_dict(result)",
"def _ApplyNicMods(self, idx, nic, params, private):\n changes = []\n\n for key in [constants.INIC_MAC, constants.INIC_IP, constants.INI... | [
"0.602123",
"0.58192426",
"0.5802508",
"0.5783846",
"0.5681156",
"0.56103724",
"0.5568371",
"0.55253685",
"0.5505217",
"0.5504358",
"0.54779464",
"0.54318684",
"0.5402808",
"0.539177",
"0.53857595",
"0.5385296",
"0.53848606",
"0.53735757",
"0.53488266",
"0.53465766",
"0.53465... | 0.7097443 | 0 |
Modify one or more settings of a NIC. If successful, the pending values of the attributes are set. For the new values to be applied, a configuration job must be created and the node must be rebooted. | def set_nic_settings(self, nic_id, settings):
return self._nic_cfg.set_nic_settings(nic_id, settings) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_nic_setting(self, nic_id, attribute_name, value):\n return self._nic_cfg.set_nic_setting(nic_id, attribute_name, value)",
"def _ApplyNicMods(self, idx, nic, params, private):\n changes = []\n\n for key in [constants.INIC_MAC, constants.INIC_IP, constants.INIC_NAME]:\n if key in params:\... | [
"0.6353005",
"0.63099056",
"0.6132525",
"0.5717877",
"0.5647892",
"0.5579225",
"0.5547068",
"0.55100584",
"0.5498269",
"0.54694575",
"0.54531837",
"0.5437021",
"0.5431047",
"0.53944135",
"0.5393298",
"0.5388977",
"0.53056186",
"0.5285326",
"0.51902294",
"0.5187543",
"0.514826... | 0.64070183 | 0 |
Applies all pending changes on a RAID controller ...by creating a config job. | def commit_pending_raid_changes(self, raid_controller, reboot=False,
start_time='TIME_NOW'):
return self._job_mgmt.create_config_job(
resource_uri=ironic_uris.DCIM_RAIDService,
cim_creation_class_name='DCIM_RAIDService',
cim_name='DCIM:RAID... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def apply_config(dts, acg, xact, action, scratch):\n self.log.debug(\"Apply Config\")\n return rwtypes.RwStatus.SUCCESS",
"def apply_config(\n hostname: str, config: str, dry_run: bool, job_id: Optional[int] = None, scheduled_by: Optional[str] = None\n) -> NornirJobResult:\n logger = ... | [
"0.59766585",
"0.57936853",
"0.577992",
"0.5772036",
"0.57508814",
"0.5709033",
"0.5448869",
"0.5360297",
"0.5341171",
"0.52653414",
"0.5233503",
"0.52317417",
"0.51950896",
"0.5162699",
"0.5160941",
"0.51412576",
"0.50951284",
"0.5054649",
"0.5042832",
"0.50163287",
"0.49999... | 0.6687969 | 0 |
Generate weightmaps for the images using the binary masks | def create_weightmaps(path,
folders,
w0=10.,
sigma=3.,
thresh_fn=lambda x:x>0,
name_weights_folder=True):
# set up some pipelines
w_pipe = ImageWeightMap2(w0=w0, sigma=sigma)
for d in folders:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_weight_map(masks, w0=10, sigma=5, longest_max_size=-1):\n nrows, ncols = masks.shape[1:]\n\n if longest_max_size > 0:\n old_rows, old_cols = nrows, ncols\n max_size = max(nrows, ncols)\n new_rows, new_cols = longest_max_size * nrows // max_size, longest_max_size * ncols // max_s... | [
"0.6640836",
"0.6275805",
"0.60981536",
"0.6081133",
"0.6068288",
"0.60453105",
"0.6001575",
"0.5891197",
"0.58610183",
"0.5838815",
"0.57847476",
"0.57843643",
"0.5777125",
"0.5762508",
"0.5748882",
"0.5746224",
"0.574566",
"0.57455665",
"0.5738557",
"0.5715211",
"0.5675463"... | 0.7141074 | 0 |
Updates current data with dataframe, stores old data in history | def update_current_data(self, data):
if self.current_data is not None:
current_results = self.get_results()
self._history.append((self.current_data, current_results))
self.current_data = data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_data(self, data):\n start_time = data.index[-1].strftime(\"%Y-%m-%dT%H:%M:%S.000000Z\")\n temp_data = self.gather_data(start=start_time)\n temp_data = self._list_to_df(temp_data)\n if (len(temp_data) > 1):\n # temp_data[0] is the same as data[-1]\n out_d... | [
"0.6701856",
"0.6649733",
"0.6549324",
"0.6426941",
"0.6328103",
"0.6311179",
"0.6242696",
"0.6232504",
"0.6194989",
"0.6187145",
"0.61294377",
"0.61294377",
"0.6119569",
"0.6101014",
"0.6090818",
"0.60787976",
"0.6045064",
"0.60259575",
"0.60231996",
"0.60224056",
"0.6018149... | 0.6706491 | 0 |
Aggregated history, i.e. in two single dataframes corresponding to "current data" attributes and results | def agg_history(self):
cd_list, cr_list = zip(*self._history)
return pd.concat(cd_list), pd.concat(cr_list) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _calculate_history(self, df: DataFrame) -> DataFrame:\n\n base_columns = {\"op\", \"id\", \"ts\"}\n data_columns = list(set(df.schema.names) - base_columns)\n\n window_spec = Window.partitionBy(\"id\").orderBy(\"ts\")\n agg_columns = [last(column, ignorenulls=True).over(window_spec)... | [
"0.68992007",
"0.6481204",
"0.62190855",
"0.60813546",
"0.60175997",
"0.6004348",
"0.5911996",
"0.58084685",
"0.58043",
"0.5802159",
"0.57765096",
"0.5699813",
"0.56859416",
"0.5673143",
"0.56662226",
"0.56241435",
"0.56107074",
"0.56097555",
"0.55994374",
"0.55979264",
"0.55... | 0.74194807 | 0 |
This function partly overrides the standard QFileSystemModel data function to return custom file and folder icons | def data(self, index, role):
fileInfo = self.getFileInfo(index)[4]
if role == QtCore.Qt.DecorationRole:
if fileInfo.isDir():
return QtGui.QPixmap(os.path.join(ICONS_L, 'Folder.png'))
elif fileInfo.isFile():
return QtGui.QPixmap(os.path.jo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_icon(self):\r\n raise NotImplementedError",
"def icon(self):",
"def get_icon(self):\n raise NotImplementedError",
"def _icons(self):",
"def icon(self):\n return ICON",
"def icon(self):\n return ICON",
"def icon(self):\n return ICON",
"def icon(self):\n ... | [
"0.6583041",
"0.6500342",
"0.6448918",
"0.62393034",
"0.6156974",
"0.6156974",
"0.6156974",
"0.6156974",
"0.6156974",
"0.6156974",
"0.6156974",
"0.6156974",
"0.6156974",
"0.6156974",
"0.61385536",
"0.61385536",
"0.61254543",
"0.6075093",
"0.5986688",
"0.5986688",
"0.59493023"... | 0.78969663 | 0 |
The external fixed IPs of the router. | def external_fixed_ips(self) -> Sequence['outputs.GetRouterExternalFixedIpResult']:
return pulumi.get(self, "external_fixed_ips") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_floating_ips(self):\n return self.router.get(l3_constants.FLOATINGIP_KEY, [])",
"def ip_addresses(self):\n try:\n return socket.gethostbyaddr(self.fqdn)[-1]\n except socket.error as _:\n return ['127.0.0.1']",
"def external_IP(self):\r\n return self._ex... | [
"0.73665017",
"0.72443134",
"0.6921729",
"0.6901388",
"0.68353254",
"0.6818246",
"0.68095595",
"0.6784862",
"0.67622966",
"0.67588675",
"0.6741735",
"0.673702",
"0.6674886",
"0.6626563",
"0.6607832",
"0.6575119",
"0.6543172",
"0.6542807",
"0.65271246",
"0.6526337",
"0.6521113... | 0.82707417 | 0 |
The network UUID of an external gateway for the router. | def external_network_id(self) -> str:
return pulumi.get(self, "external_network_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_network_id(self):\n\t\treturn call_sdk_function('PrlVirtNet_GetNetworkId', self.handle)",
"def get_device_id(self, network):\n # There could be more than one dhcp server per network, so create\n # a device id that combines host and network ids\n\n host_uuid = uuid.uuid5(uuid.NAMESPAC... | [
"0.69283426",
"0.68110025",
"0.67746633",
"0.668923",
"0.668923",
"0.668923",
"0.6625821",
"0.6577762",
"0.65629625",
"0.6535451",
"0.651444",
"0.651444",
"0.64417446",
"0.6367765",
"0.63646585",
"0.6359441",
"0.6353521",
"0.63178164",
"0.63145465",
"0.62964016",
"0.6283311",... | 0.7114002 | 0 |
Test if attribute is a property. | def isprop(v):
return isinstance(v, property) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isproperty(object):\n return isinstance(object, property)",
"def _is_propertyable(\n names, # type: List[str]\n attrs, # type: Dict[str, Any]\n annotations, # type: Dict[str, type]\n attr, # Dict[str, Any]\n):\n # type: (...) -> bool\n return (\n attr in annotations\n a... | [
"0.7569112",
"0.71270937",
"0.65027094",
"0.64971614",
"0.645277",
"0.63821",
"0.6280971",
"0.62516636",
"0.62270504",
"0.6196012",
"0.6137933",
"0.6086928",
"0.60693777",
"0.6069171",
"0.60603017",
"0.59751207",
"0.59495217",
"0.58659714",
"0.5848836",
"0.58300596",
"0.58074... | 0.7676597 | 0 |
calculates beam xy and other parameters. | def calculate_beam_xy(self):
info = []
# Import relevant info
pixel_size = self.info.pixel_size
for i in [j.final for j in self.final_objects]:
try:
info.append(
[
i,
i["beamX"],
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def xy(self):\n ...",
"def beam(xb,yb,zb,wx,wy,wavelen):\n\n zRx = np.pi * wx**2 / wavelen\n zRy = np.pi * wy**2 / wavelen \n \n sqrtX = np.sqrt( 1 + np.power(zb/zRx,2) ) \n sqrtY = np.sqrt( 1 + np.power(zb/zRy,2) ) \n intensity = np.exp( -2.*( np.power(xb/(wx*sqrtX ),2) \\\n ... | [
"0.6129466",
"0.60761815",
"0.6049173",
"0.5987054",
"0.59085387",
"0.58142376",
"0.58065397",
"0.5801077",
"0.5798147",
"0.57459855",
"0.57192415",
"0.57188255",
"0.5706152",
"0.5704091",
"0.5699249",
"0.5691896",
"0.5674206",
"0.5672045",
"0.5594236",
"0.5586325",
"0.556433... | 0.73167294 | 0 |
Calls unit cell analysis module, which uses hierarchical clustering (Zeldin, et al, Acta D, 2015) to split integration results according to detected morphological groupings (if any). Most useful with preliminary integration without target unit cell specified. | def unit_cell_analysis(self):
# Will not run clustering if only one integration result found or if turned off
if not self.info.categories["integrated"]:
util.main_log(
self.info.logfile, "\n\n{:-^80}\n".format(" UNIT CELL ANALYSIS "), True
)
util.main... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def main(argv):\n args = process_command_line(argv)\n name = job_string(args)\n #That feel when no torison ;_;\n if args.dihed:\n raise Exception(\"Dihed is not supported right now\")\n #SDFS!\n if args.sdf:\n handle_sdf(args)\n #Conversion, pruning\n pybel_mols = convert_to_p... | [
"0.5610221",
"0.5556858",
"0.5512909",
"0.546379",
"0.54304254",
"0.5370964",
"0.536435",
"0.53357214",
"0.5281515",
"0.5277882",
"0.52746207",
"0.5239652",
"0.52363443",
"0.5225614",
"0.52088296",
"0.52050596",
"0.5199139",
"0.5171439",
"0.5166146",
"0.51584786",
"0.51337284... | 0.75939274 | 0 |
Imports default PRIME input parameters, modifies correct entries and prints out a starting PHIL file to be used with PRIME. | def make_prime_input(self, filename="prime.phil", run_zero=False):
assert self.info
pixel_size = self.info.pixel_size
hres = self.info.stats["res"]
lres = self.info.stats["lres"]
# If symmetry / unit cell were not overridden from GUI, set from INFO
if not self.best_pg:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Usage():\r\n print \"Correct Usage:\"\r\n print \"python primesBelow.py <integer>\"",
"def pr(form, *args):\n # variables\n global lPr, lMaPr\n\n if lPr < lMaPr:\n for l in range(lPr + 1):\n sys.stdout.write('-')\n if len(args) == 0:\n print form\n ... | [
"0.57706285",
"0.5497428",
"0.5485556",
"0.5466297",
"0.54553556",
"0.542836",
"0.5421417",
"0.53975254",
"0.53920454",
"0.53487873",
"0.5346001",
"0.5343639",
"0.53339195",
"0.5314539",
"0.53113174",
"0.5310713",
"0.5290864",
"0.52821314",
"0.52764744",
"0.5268802",
"0.52430... | 0.6344126 | 0 |
This main function allows you to run the backup manually. | def main():
parser = init_parser()
args = parser.parse_args()
# Set up logging.
level = logging.INFO
if args.debug:
level = logging.DEBUG
logging.basicConfig(format='%(asctime)s %(levelname)s %(filename)s:' \
'%(lineno)s %(message)s ', level=level)
logging.info("Logging started")
message = "B... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run_backup():\n host = re.search(\"([\\w.-]+)[:]?\", env.host).group()\n date = time.strftime('%Y%m%d%H%M%S')\n fname = '%(host)s-backup-%(date)s.gz' % {'date': date, 'host': host}\n green(\"Ingrese la contraseña de la clave privada local.\")\n sudo(\"pg_dump kine | gzip > /tmp/%s\" % fname, use... | [
"0.7348714",
"0.7322273",
"0.72442436",
"0.71869266",
"0.7080326",
"0.7026621",
"0.6823129",
"0.6735388",
"0.66656953",
"0.6550088",
"0.6538847",
"0.6439064",
"0.63912153",
"0.6356379",
"0.63234514",
"0.6314879",
"0.6291406",
"0.6277249",
"0.62609226",
"0.6228204",
"0.6194076... | 0.7343254 | 1 |
Returns a function which takes Paths into the user data and returns csums. | def reverser(num_segs=3):
r = re.compile("((\/([0-9]|[a-f])+){%d})$" % (num_segs+1))
def checksum_from_link(link):
"""Takes a path into the userdata, returns the matching csum."""
m = r.search(safetype(link))
if (m):
csum_slash = m.group()[1:]
csum = _remove_sep_(csum_slash)
return csu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate(d):\r\n\r\n # Set correct slashes for the OS\r\n if sys.platform == 'windows':\r\n slash = '\\\\'\r\n elif sys.platform == 'linux':\r\n slash = '/'\r\n else:\r\n print('#Error. Unknown platform.')\r\n return\r\n\r\n print('Files in the current directory and ... | [
"0.5616519",
"0.5510596",
"0.54699963",
"0.5451842",
"0.54407364",
"0.53760487",
"0.5368446",
"0.53618073",
"0.5279357",
"0.52358234",
"0.52341944",
"0.5196225",
"0.5176148",
"0.51656383",
"0.51610726",
"0.5154971",
"0.5148992",
"0.5138188",
"0.5128646",
"0.51273227",
"0.5117... | 0.59194446 | 0 |
Return absolute Path to a blob given a csum | def csum_to_path(self, csum):
#TODO remove callers so we can make internal.
return Path(self._csum_to_name(csum), self.root) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def link_to_blob(self, path, csum):\n new_link = self.csum_to_path(csum)\n ensure_symlink(path, new_link)\n ensure_readonly(path)",
"def _csum_to_name(self, csum):\n #TODO someday when csums are parameterized, we inject the has params here.\n return _checksum_to_path(csum)",
... | [
"0.6760842",
"0.6556648",
"0.64958185",
"0.6435036",
"0.62205434",
"0.58019423",
"0.5726288",
"0.55842215",
"0.5583444",
"0.5474924",
"0.5454985",
"0.5429763",
"0.5375666",
"0.5375143",
"0.5340256",
"0.5335034",
"0.5317139",
"0.53109914",
"0.5301503",
"0.5301253",
"0.5236432"... | 0.7445334 | 0 |
Takes a csum, and removes it from the blobstore | def delete_blob(self, csum):
blob_path = self.csum_to_path(csum)
blob_path.unlink(clean=self.root) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove():",
"def remove(self, data):\n data_hash = hashlib.sha256(data).digest()\n self.denominator = (self.denominator * data_to_num3072(data_hash)) % self.MODULUS",
"def __do_binary_delete(item):\n\n file_path = DTF_BINARIES_DIR + item.install_name\n\n if utils.delete_file(file_path) ... | [
"0.5757154",
"0.5642187",
"0.5564729",
"0.5475264",
"0.5464008",
"0.5457136",
"0.53968495",
"0.5358681",
"0.5354388",
"0.5342333",
"0.53273803",
"0.5321266",
"0.5296075",
"0.52734",
"0.5217147",
"0.5210733",
"0.5208237",
"0.5182357",
"0.5178936",
"0.5171412",
"0.5165453",
"... | 0.78742325 | 0 |
Forces path into a symlink to csum | def link_to_blob(self, path, csum):
new_link = self.csum_to_path(csum)
ensure_symlink(path, new_link)
ensure_readonly(path) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def relink(f):\n if os.path.islink(f):\n linkto = os.path.join(NEW_LINK_BASE, os.path.basename(os.readlink(f)))\n #print 'Relinking %s-> %s from \\n %s' % (f, linkto, os.readlink(f))\n #print 'removing %s' % f\n os.remove(f)\n os.symlink(linkto, f)",
"def symlink(self, req, li... | [
"0.6718929",
"0.66228133",
"0.6465445",
"0.6442848",
"0.6344745",
"0.6339009",
"0.6291033",
"0.625382",
"0.62475646",
"0.62025553",
"0.6126322",
"0.61046165",
"0.6099585",
"0.6029164",
"0.5990421",
"0.5971646",
"0.59707147",
"0.5963814",
"0.5950644",
"0.5917308",
"0.58955467"... | 0.72160524 | 0 |
Returns True when the blob's checksum matches. Returns False when there is a checksum corruption. | def verify_blob_checksum(self, blob):
path = self.csum_to_path(blob)
csum = path.checksum()
return csum != blob | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_checksum(self):\n return self.calculate_checksum() == self.checksum()",
"def verify_checksum(self):\n return self.generate_header_checksum(omit_checksum=False) == 0",
"def _verify_checksum(data, checksum):\n sha256_hash = hashlib.sha256(data).hexdigest().encode()\n return to_bi... | [
"0.7736474",
"0.7485926",
"0.74634707",
"0.7280268",
"0.71696",
"0.71337336",
"0.71063906",
"0.7051834",
"0.69469905",
"0.6904954",
"0.6893968",
"0.68395376",
"0.6808126",
"0.6773289",
"0.67445666",
"0.673051",
"0.6638136",
"0.6498566",
"0.6496091",
"0.63991594",
"0.6348812",... | 0.8861687 | 0 |
Returns True when the blob's permissions is read only. Returns False when the blob is mutable. | def verify_blob_permissions(self, blob):
path = self.csum_to_path(blob)
return is_readonly(path) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_only(self):\n return bool(self.__read_only)",
"def is_read_only(self):\n\t\treturn bool(call_sdk_function('PrlShare_IsReadOnly', self.handle))",
"def is_read_only(self) -> pulumi.Output[Optional[bool]]:\n return pulumi.get(self, \"is_read_only\")",
"def get_can_read(self):\n\t\tif not ... | [
"0.74087244",
"0.7357655",
"0.7207462",
"0.7194548",
"0.718061",
"0.7174269",
"0.7069815",
"0.70423627",
"0.70013654",
"0.70013654",
"0.6821539",
"0.6797577",
"0.67828053",
"0.67828053",
"0.67828053",
"0.67828053",
"0.6748725",
"0.65980434",
"0.65751696",
"0.65058196",
"0.650... | 0.7997186 | 0 |
Iterator across all blobs | def blobs(self):
def blob_iterator():
with s3conn(self.access_id, self.secret) as s3:
key_iter = s3.list_bucket(self.bucket, prefix=self.prefix+"/")
for key in key_iter:
blob = key[len(self.prefix)+1:]
yield blob
return ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def blob_generator(self):\n for blob in self.data:\n yield blob",
"def blob_stats(self):\n def blob_iterator():\n with s3conn(self.access_id, self.secret) as s3:\n key_iter = s3.list_bucket2(self.bucket, prefix=self.prefix+\"/\")\n for head in key... | [
"0.7579303",
"0.6972601",
"0.6484718",
"0.64345145",
"0.6410156",
"0.62850124",
"0.6241016",
"0.61964935",
"0.6173275",
"0.61723167",
"0.61494774",
"0.6100578",
"0.60827994",
"0.6061901",
"0.6057329",
"0.60366875",
"0.60343045",
"0.6032287",
"0.5957977",
"0.5957977",
"0.59544... | 0.7229534 | 1 |
Iterator across all blobs, retaining the listing information | def blob_stats(self):
def blob_iterator():
with s3conn(self.access_id, self.secret) as s3:
key_iter = s3.list_bucket2(self.bucket, prefix=self.prefix+"/")
for head in key_iter:
blob = head[LIST_BUCKET_KEY][len(self.prefix)+1:]
h... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def blobs(self):\n def blob_iterator():\n with s3conn(self.access_id, self.secret) as s3:\n key_iter = s3.list_bucket(self.bucket, prefix=self.prefix+\"/\")\n for key in key_iter:\n blob = key[len(self.prefix)+1:]\n yield blob\n ... | [
"0.68466896",
"0.6780061",
"0.6164148",
"0.6107229",
"0.60251284",
"0.60030335",
"0.5962732",
"0.5953068",
"0.58656806",
"0.58382636",
"0.5753683",
"0.5752837",
"0.5747022",
"0.57239527",
"0.57012093",
"0.56974304",
"0.56971043",
"0.56695175",
"0.56648165",
"0.56566805",
"0.5... | 0.72505546 | 0 |
reload a module, either larch or python | def _reload(mod,larch=None,**kw):
if isinstance(mod, str):
return larch.import_module(mod, do_reload=True)
for k,v in chain(larch.symtable._sys.modules.iteritems(), sys.modules.iteritems()):
if v == mod:
modname = k
break
try:
return larch.import_module(modn... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reload_module(module_name):\n try:\n reload(eval(module_name))\n except:\n pass",
"def reloadModule(module):\n\ttry:\n\t\treload # Python 2.7\n\texcept NameError:\n\t\ttry:\n\t\t\tfrom importlib import reload # Python 3.4+\n\t\texcept ImportError:\n\t\t\tfrom imp import reload # Python... | [
"0.80148953",
"0.7742815",
"0.7427528",
"0.73654693",
"0.7348668",
"0.7205982",
"0.7027763",
"0.6984617",
"0.69592416",
"0.69405115",
"0.6676888",
"0.6640121",
"0.6631857",
"0.65679514",
"0.655727",
"0.6529555",
"0.647623",
"0.64265627",
"0.639218",
"0.6344517",
"0.63303524",... | 0.8660127 | 0 |
show lines of text in the style of more | def show_more(text,filename=None,writer=None,pagelength=30,prefix=''): # pragma: no cover
pager(text) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def abbrev_help_more_text(self):\n pass",
"def generate_excerpt():",
"def echo(self):\n new_paragraph = True\n for line in self.msg.splitlines():\n if not line.strip():\n new_paragraph = True\n click.echo()\n elif new_paragraph:\n ... | [
"0.6258086",
"0.61826456",
"0.6127772",
"0.5877098",
"0.5868962",
"0.5836664",
"0.5801012",
"0.57793504",
"0.5729908",
"0.57035375",
"0.5700666",
"0.5665235",
"0.56474644",
"0.56377524",
"0.5631425",
"0.56087565",
"0.5605236",
"0.5601699",
"0.55921155",
"0.55473125",
"0.55454... | 0.6663092 | 0 |
class that maintains all data related to the regulatory on the FContact | def __init__(self, contact = None):
try:
self.__contact = contact
if not self.__contact:
FRegulatoryLogger.ERROR(logger, "The name on the contact is the unique identifier of the contact. Kindly provide a valid acm.FContact object")
return None
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def RegulatoryInfo(self):\n conactRegInfo = FContactRegulatoryInfo(self)\n return conactRegInfo",
"def Attributes(self):\n return FRegulatoryUtils.log_attributes('FContactRegulatoryInfo', self)",
"def __init__(self):\n\n\t\tself.__contacts = None\n\t\tself.__accounts = None\n\t\tself.__deals = Non... | [
"0.7621419",
"0.6440766",
"0.6052107",
"0.58735913",
"0.58644634",
"0.56104106",
"0.55951077",
"0.55670434",
"0.5546189",
"0.5410019",
"0.53739226",
"0.5360233",
"0.53541",
"0.53510576",
"0.52669334",
"0.5263579",
"0.5242533",
"0.52414125",
"0.521908",
"0.5218182",
"0.5214554... | 0.6573449 | 1 |
NationalId of the concerned natural person | def NationalId(self, reg_national_id = VALUE_NOT_SET):
if reg_national_id != VALUE_NOT_SET:
self.__reg_national_id = reg_national_id
try:
self.__contact.AdditionalInfo().NationalId(self.__reg_national_id)
except:
pass
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_NID():\n return NID",
"def government_id_number(self) -> str:\n return self._government_id_number",
"def get_person_id(person_data):\n person_ref = person_data['Casualty_Reference']\n veh_ref = person_data['Vehicle_Reference']\n acc_id = get_acc_id_from_data(person_data)\n person_... | [
"0.6752156",
"0.64024127",
"0.6256402",
"0.6193446",
"0.61844784",
"0.6149932",
"0.6149932",
"0.61367977",
"0.6133966",
"0.6050021",
"0.6030649",
"0.6021784",
"0.6012439",
"0.59253937",
"0.59218484",
"0.58435404",
"0.58401144",
"0.5793599",
"0.57825446",
"0.57644486",
"0.5758... | 0.73979646 | 0 |
An optional unique name, if specified there can only be one contact with this name for each party. | def UniqueName(self, unique_name = VALUE_NOT_SET):
if unique_name != VALUE_NOT_SET:
try:
if FIntegrationUtils.FIntegrationUtils.get_acm_version_override() >= 2017.2:
self.__contact.UniqueName(unique_name)
else:
is_unique, contac... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def contact_name(self) -> str:\n return pulumi.get(self, \"contact_name\")",
"def party_id(self):\n pass",
"def create_contact(contact, party_type, party):\n\tcontact = contact\t.split(\" \")\n\n\tcontact = frappe.get_doc({\n\t\t\"doctype\":\"Contact\",\n\t\t\"first_name\":contact[0],\n\t\t\"last... | [
"0.58776766",
"0.5617005",
"0.56108975",
"0.5571864",
"0.556685",
"0.556685",
"0.5513689",
"0.5500145",
"0.5463818",
"0.536946",
"0.5348271",
"0.53382397",
"0.53270036",
"0.5291315",
"0.52906907",
"0.5287689",
"0.52846396",
"0.52846396",
"0.52688885",
"0.52560043",
"0.5240531... | 0.70607924 | 0 |
returns the ClientType based on where the CrmId is found on the linked objects | def ClientType(self):
self.__client_type = FRegulatoryUtils.getClientType(self.__contact)
return self.__client_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def client_type(self) -> Optional[str]:\n return pulumi.get(self, \"client_type\")",
"def type(self):\n return _internals.CorrelationId_type(self)",
"def find_type(source, target):\n x = [r for r in source.synset_relations if r.target == target.id]\n if len(x) != 1:\n raise Exception... | [
"0.5487231",
"0.5164598",
"0.51574206",
"0.51353335",
"0.5011951",
"0.49763677",
"0.49734464",
"0.49716905",
"0.49659985",
"0.49616665",
"0.49428558",
"0.49414885",
"0.4923532",
"0.49094817",
"0.48822343",
"0.48643944",
"0.48532623",
"0.48462522",
"0.48260435",
"0.48219457",
... | 0.5837794 | 0 |
Committing this instance will automatically commit all the RegulatorySupport related attributes on the contact | def Commit(self):
try:
acm.BeginTransaction()
self.__contact.Commit()
if FIntegrationUtils.FIntegrationUtils.get_acm_version_override() < 2015.4:
self.__integration_utils.set_additional_info('DateOfBirth', self.__contact, self.__reg_date_of_birth)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def commit(self):\n self.cnx.commit()",
"def commit(self):\n pass",
"def commit(self):\n pass",
"def commit(self):\n pass",
"def commit(self):\n pass",
"def commit(self):\n pass",
"def commit(self):\n return",
"def commitChanges(self):\n \n ... | [
"0.6179308",
"0.6118413",
"0.6118413",
"0.6118413",
"0.6118413",
"0.6118413",
"0.60592747",
"0.6013804",
"0.59319466",
"0.5926993",
"0.5916751",
"0.5899212",
"0.58974123",
"0.5881195",
"0.5875204",
"0.5863884",
"0.58605444",
"0.5854823",
"0.5801967",
"0.5795815",
"0.57171786"... | 0.79224825 | 0 |
Deleting this instance automatically deletes all the attributes related to the reporting on the instrument or on the ContactRegulatoryInfo in the ADS | def Delete(self):
FRegulatoryUtils.Delete(self.__contact, "Contact")
FRegulatoryLogger.DEBUG(logger, "Deleted all AdditionalInfos on Contact related to Regulatory Reporting") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cleanup_aai(cls):\n logger.info(\"####################### Start to clean up AAI settings\")\n aai = Customer.get_by_global_customer_id(\"5GCustomer\")\n aai.delete()",
"def delete(self):\n self._instance.delete()\n self._instance = None\n self._data_defs = []",
"de... | [
"0.6274676",
"0.6151817",
"0.60736465",
"0.58964264",
"0.58367074",
"0.58200717",
"0.58007216",
"0.5781004",
"0.57804185",
"0.5743467",
"0.5707958",
"0.56463885",
"0.56211966",
"0.56100756",
"0.5555345",
"0.5555345",
"0.5555345",
"0.5555345",
"0.55472887",
"0.55391157",
"0.55... | 0.74394304 | 0 |
returns the attributes on the FContactRegulatoryInfoBase instance | def Attributes(self):
return FRegulatoryUtils.log_attributes('FContactRegulatoryInfo', self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def RegulatoryInfo(self):\n conactRegInfo = FContactRegulatoryInfo(self)\n return conactRegInfo",
"def getAttributes(self):\n pass",
"def get_attributes(self):\n return self.attributes",
"def get_attributes(cls):\r\n return []",
"def get_attributes(self):\n _attributes = {... | [
"0.76906836",
"0.7054827",
"0.67832905",
"0.67631334",
"0.6749298",
"0.67152345",
"0.66815585",
"0.6680654",
"0.6680654",
"0.66506875",
"0.66434884",
"0.6618119",
"0.65413237",
"0.6490594",
"0.64605737",
"0.64063853",
"0.6323494",
"0.6309063",
"0.63062006",
"0.62716734",
"0.6... | 0.85865146 | 0 |
returns the FContactRegulatoryInfoBase instance for the given contact | def RegulatoryInfo(self):
conactRegInfo = FContactRegulatoryInfo(self)
return conactRegInfo | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, contact = None):\n try:\n self.__contact = contact\n if not self.__contact:\n FRegulatoryLogger.ERROR(logger, \"The name on the contact is the unique identifier of the contact. Kindly provide a valid acm.FContact object\")\n return None\... | [
"0.71412814",
"0.62537146",
"0.58082145",
"0.5799355",
"0.55888337",
"0.5545059",
"0.55302864",
"0.55302864",
"0.54784495",
"0.54784495",
"0.54784495",
"0.53763604",
"0.532584",
"0.5272704",
"0.52715975",
"0.52623534",
"0.5120345",
"0.51012933",
"0.50584227",
"0.50581264",
"0... | 0.76837945 | 0 |
Function to print a header with satellite info for the satellite number | def print_satellite_header(st):
# Retrieve TLE data
print "Satellite Number/Launch Year/Launch Number of Year: %s/20%s/%s" % \
(st.get_satellite_number(), st.get_launch_year(), \
st.get_launch_year_number())
year = 2000 + int(st.get_epoch_year())
fracyear = timedelta(float(st.get_ep... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_header():\n print(\"STEM Center Temperature Project\")\n print(\"Shaotong Wen\")",
"def print_header_information():\n\t\tprint \"Elijah Molloy\"\n\t\tprint \"70-510 - Spring 1 - 2018\"\n\t\tprint \"PROGRAMMING ASSIGNMENT #4\\n\"",
"def print_the_header():\n print('-------------------')\n ... | [
"0.73586893",
"0.71547425",
"0.6722391",
"0.64073485",
"0.6397794",
"0.6378043",
"0.63605297",
"0.6274469",
"0.6251121",
"0.6184243",
"0.616818",
"0.6158332",
"0.61397535",
"0.61184627",
"0.6110125",
"0.6110125",
"0.6106982",
"0.60947645",
"0.60926664",
"0.608937",
"0.6087103... | 0.8453364 | 0 |
Function to print the inviews | def print_inviews(gs, inviews):
#print "Number of inviews from %s to %s: %d" % \
# (today_start.isoformat(), today_end.isoformat(),len(inviews))
for i in range(0, len(inviews)):
#print "%s to %s" % (inviews[i][0].isoformat(), inviews[i][1].isoformat())
print_inview(inviews[i][0], invi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_details(self):\n self.view.print_details()",
"def print(self):\r\n self.print_avec_separateur()",
"def print_out():\n pass",
"def _print_inwards(middleware_name):\n if _VERBOSE_MODE:\n print('{}--->'.format(middleware_name))",
"def pprint(self):\n # just here... | [
"0.67796624",
"0.6479328",
"0.6461996",
"0.6318401",
"0.63149685",
"0.61923224",
"0.61706716",
"0.61218095",
"0.6109504",
"0.6102467",
"0.6101652",
"0.6087358",
"0.60798454",
"0.6077613",
"0.60708314",
"0.6038918",
"0.60107464",
"0.6009129",
"0.5995637",
"0.59919393",
"0.5979... | 0.75969446 | 0 |
Function to print a table of time, azimuth, elevation for each inview | def print_azeltables(inviews, ic):
for i in range(0, len(inviews)):
print " "
print "Az/El for inview %s to %s" % (inviews[i][0], inviews[i][1])
azels = ic.compute_azels(inviews[i][0], inviews[i][1], 15)
for j in range(0, len(azels)):
print "At %s, azimuth=%8.2f, elevatio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_inview_header(minimum_elevation_angle, now, gs):\n print \"Inviews (above %s degrees) on %s-%s-%s\" % \\\n (minimum_elevation_angle, now.year, now.month, now.day)\n print \"At %s: Lat/Lon/El: %s/%s/%s\" % \\\n (gs.get_name(), gs.get_latitude(), gs.get_longitude(),\n gs.... | [
"0.7208172",
"0.67271405",
"0.6130861",
"0.61259687",
"0.59162146",
"0.5775518",
"0.57627594",
"0.5703854",
"0.56089044",
"0.5606912",
"0.56049377",
"0.5569098",
"0.5553486",
"0.5533526",
"0.54851115",
"0.5451577",
"0.54403365",
"0.5424925",
"0.54075736",
"0.5402264",
"0.5393... | 0.7502286 | 0 |
Use as a decorator to print info about the function and its result. Follows deferred results. | def showResult(f):
def substitute(self, *args, **kw):
def msg(result, callInfo):
resultInfo = str(result)
if len(callInfo) + len(resultInfo) > 70:
callInfo += "\n"
print("\n{} -> {}".format(callInfo, resultInfo))
return result
SR_STUFF... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_result(func):\n def new_func(*args, **kwargs):\n result = func(*args, **kwargs)\n print(result)\n return result\n return new_func",
"def print_log(func):\n @wraps(func)\n def wrapper(*args, **kwargs):\n n = func.__name__\n print('{} has started with argume... | [
"0.7564186",
"0.69486636",
"0.68396944",
"0.67687505",
"0.6661167",
"0.6646779",
"0.6636007",
"0.6607297",
"0.65720874",
"0.6512646",
"0.6510811",
"0.65025723",
"0.64824915",
"0.6458015",
"0.6400681",
"0.639704",
"0.63808566",
"0.6372295",
"0.6261466",
"0.62549406",
"0.622034... | 0.78961205 | 0 |
Returns the fully qualified name of the supplied string if it can be imported and then reflected back into the FQN, or C{None} if not. | def strToFQN(self, x):
try:
obj = reflect.namedObject(x)
fqn = reflect.fullyQualifiedName(obj)
except:
return
return fqn | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def try_import(import_str, default=None):\r\n try:\r\n return import_module(import_str)\r\n except ImportError:\r\n return default",
"def get_qualified_class_name(o):\n module = o.__class__.__module__\n module = '' if module in IGNORABLE_MODULES else module\n module = module + '.' if... | [
"0.6144014",
"0.6059056",
"0.60289675",
"0.6027369",
"0.5973197",
"0.5959286",
"0.5954686",
"0.58813894",
"0.5866241",
"0.5862896",
"0.58329266",
"0.58159465",
"0.58044475",
"0.5801065",
"0.57967067",
"0.5795597",
"0.5794225",
"0.57900107",
"0.5770697",
"0.57595575",
"0.57583... | 0.610944 | 1 |
Returns the fully qualified name of the supplied object if it can be reflected into an FQN and back again, or C{None} if not. | def objToFQN(self, x):
try:
fqn = reflect.fullyQualifiedName(x)
reflect.namedObject(fqn)
except:
return
return fqn | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def full_object_name(obj):\n\n try:\n module = obj.__module__\n if module is None or module == str.__class__.__module__:\n return obj.__name__ # Avoid reporting __builtin__\n else:\n return module + '.' + obj.__name__\n except Exception:\n return None",
"d... | [
"0.720825",
"0.68506885",
"0.68197757",
"0.6692258",
"0.669201",
"0.66850084",
"0.6678043",
"0.6637933",
"0.655427",
"0.6363912",
"0.6304597",
"0.62705034",
"0.6256707",
"0.6187803",
"0.6154",
"0.6152605",
"0.612782",
"0.6108689",
"0.603036",
"0.60212445",
"0.60132855",
"0.... | 0.6943579 | 1 |
Attempts to convert the supplied object to a pickle and, failing that, to a fully qualified name. | def processObject(self, x):
pickled = self.objToPickle(x)
if pickled:
return pickled
return self.objToFQN(x) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def try_pickle_dumps(obj):\n try:\n return cloudpickle.dumps(obj)\n except Exception:\n pass\n\n try:\n return pickle.dumps(obj)\n except Exception:\n raise",
"def pickle_object(obj, ofname: \"Path|str\"):\n ofname = Path(ofname)\n maybe_make_output_dir(ofname)\n ... | [
"0.7063126",
"0.64876986",
"0.60792595",
"0.5974439",
"0.58921015",
"0.58882225",
"0.58367944",
"0.57654095",
"0.5750935",
"0.57494664",
"0.5721882",
"0.56769556",
"0.5674027",
"0.5642555",
"0.56334174",
"0.5625167",
"0.5624294",
"0.560091",
"0.560091",
"0.5558587",
"0.555558... | 0.6659083 | 1 |
Sets my current fargskw tuple, returning a reference to myself to allow easy method chaining. The function I{f} must be an actual callable object if you want to use L{nn}. Otherwise it can also be a string depicting a callable. You can specify I{args} with a second argument (as a list or tuple), and I{kw} with a third ... | def setCall(self, *metaArgs, **kw):
if metaArgs:
equiv = True
if self.lastMetaArgs is None:
equiv = False
elif len(metaArgs) != len(self.lastMetaArgs):
equiv = False
else:
for k, arg in enumerate(metaArgs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, func, *args, **kwargs):\n self._func = func\n self._args = args\n self._kwargs = kwargs\n self._fully_bound = None",
"def set_func_args(self, *args, **kwargs):\n self._func_args = args \n self._func_kw_args = kwargs",
"def call(f):\n def g(*args, **kwds):\n ... | [
"0.5703724",
"0.56538165",
"0.55401057",
"0.5524479",
"0.54307365",
"0.5427452",
"0.54265815",
"0.5302647",
"0.52991205",
"0.5291197",
"0.5282004",
"0.5254453",
"0.5248723",
"0.523779",
"0.52307767",
"0.52307767",
"0.52307767",
"0.52307767",
"0.52307767",
"0.52307767",
"0.523... | 0.6287769 | 0 |
Returns a unique ID for my current callable. | def ID(self):
if hasattr(self, 'currentID'):
return self.currentID
if hasattr(self, 'callDict'):
thisID = hashIt(self.callDict)
if hasattr(self, 'pastInfo'):
self.pastInfo[thisID] = {'callDict': self.callDict}
else:
thisID = None
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_id(self): # real signature unknown; restored from __doc__\n return \"\"",
"def _get_unique_id(self):\n now = datetime.now()\n\n u_id = now.second + 60*(now.minute + 60*(now.hour + 24*(now.day + 31*(now.month + 366*(now.year)))))\n return \"instance\" + str(u_id)",
"def gener... | [
"0.7378038",
"0.70565146",
"0.7052797",
"0.69692785",
"0.6922952",
"0.685859",
"0.68508834",
"0.6849531",
"0.6843613",
"0.68147796",
"0.68109673",
"0.68109673",
"0.68109673",
"0.68109673",
"0.6809885",
"0.67909235",
"0.67909235",
"0.67909235",
"0.67909235",
"0.67909235",
"0.6... | 0.7128812 | 1 |
Use this whenever info won't be needed anymore for the specified call ID, to avoid memory leaks. | def forgetID(self, ID):
if ID in getattr(self, 'pastInfo', {}):
del self.pastInfo[ID] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _validate_call_id(self, call_id):\n\n self._validate_required_data(call_id, self.CALL_ID)\n\n query = CallRecord.objects.filter(call_id=call_id)\n\n if query.exists():\n raise NotAcceptable(\n detail='Call id is already in use. Please, choose another')",
"def _s... | [
"0.5423897",
"0.53597885",
"0.5170545",
"0.51276785",
"0.5111587",
"0.5107926",
"0.50829285",
"0.5059674",
"0.50555295",
"0.49963364",
"0.49642846",
"0.495139",
"0.4910475",
"0.48489508",
"0.47891104",
"0.4779412",
"0.47645634",
"0.47535005",
"0.47411475",
"0.4731908",
"0.469... | 0.59721094 | 0 |
Context manager for setting and getting call info. Call this context manager method with info about a particular call (same format as L{setCall} uses) and it yields an L{InfoHolder} object keyed to that call. It lets you get info about the call inside the context, without worrying about the ID or calling L{forgetID}, e... | def context(self, *metaArgs, **kw):
if not hasattr(self, 'pastInfo'):
raise Exception(
"Can't use a context manager without saving call info")
ID = self.setCall(*metaArgs, **kw).ID
yield InfoHolder(self, ID)
self.forgetID(ID) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def aboutCall(self, ID=None, nowForget=False):\n if ID:\n pastInfo = self.getInfo(ID, 'aboutCall', nowForget)\n if pastInfo:\n return pastInfo\n callDict = self.getInfo(ID, 'callDict')\n if not callDict:\n return \"\"\n func, args, kw = [c... | [
"0.6116589",
"0.5598187",
"0.55867136",
"0.5528214",
"0.53109026",
"0.5237054",
"0.51175916",
"0.51127905",
"0.50732195",
"0.5064161",
"0.5057853",
"0.50216436",
"0.50200754",
"0.5004932",
"0.50042874",
"0.49915943",
"0.4979725",
"0.49719357",
"0.49228385",
"0.4916614",
"0.49... | 0.7960227 | 0 |
Provides info about a call. If the supplied name is 'callDict', returns the fargskwinstance dict for my current callable. The value of I{ID} is ignored in such case. Otherwise, returns the named information attribute for the previous call identified with the supplied ID. | def getInfo(self, ID, name, nowForget=False):
def getCallDict():
if hasattr(self, 'callDict'):
result = self.callDict
if nowForget:
del self.callDict
else:
result = None
return result
if hasa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def aboutCall(self, ID=None, nowForget=False):\n if ID:\n pastInfo = self.getInfo(ID, 'aboutCall', nowForget)\n if pastInfo:\n return pastInfo\n callDict = self.getInfo(ID, 'callDict')\n if not callDict:\n return \"\"\n func, args, kw = [c... | [
"0.6510412",
"0.5486511",
"0.5346446",
"0.52030444",
"0.5146749",
"0.5081739",
"0.5034171",
"0.50240844",
"0.50165373",
"0.4871073",
"0.48639536",
"0.48548323",
"0.4849726",
"0.48485854",
"0.48369116",
"0.48026302",
"0.47847903",
"0.4784088",
"0.4783681",
"0.47752234",
"0.476... | 0.6836767 | 0 |
Returns an informative string describing my current function call or a previous one identified by ID. | def aboutCall(self, ID=None, nowForget=False):
if ID:
pastInfo = self.getInfo(ID, 'aboutCall', nowForget)
if pastInfo:
return pastInfo
callDict = self.getInfo(ID, 'callDict')
if not callDict:
return ""
func, args, kw = [callDict[x] for ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _function_name(func):\n return \"Calling the function: def {}()\".format(func.__name__)",
"def get_call_string(self) -> Optional[str]: # noqa\n call_repr = get_call_string(self.func_name, self.args, self.kwargs, max_length=75)\n return call_repr",
"def __repr__(self):\n\t\treturn self.fun... | [
"0.6560909",
"0.6306112",
"0.6107266",
"0.6059423",
"0.6059423",
"0.6059423",
"0.6059423",
"0.6059423",
"0.6059423",
"0.6059423",
"0.6059423",
"0.6041999",
"0.6041999",
"0.6041999",
"0.6029351",
"0.6029351",
"0.6029351",
"0.6029351",
"0.6029351",
"0.60204625",
"0.6013816",
... | 0.71258074 | 0 |
Returns an informative string describing an exception raised from my function call or a previous one identified by ID, or one you supply (as an instance, not a class). | def aboutException(self, ID=None, exception=None, nowForget=False):
if ID:
pastInfo = self.getInfo(ID, 'aboutException', nowForget)
if pastInfo:
return pastInfo
if exception:
lineList = ["Exception '{}'".format(repr(exception))]
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ErrorString(self): # real signature unknown; restored from __doc__\n pass",
"def __str__(self):\n error = '{0} ({1}): {2}'.format(self.__class__.__name__, self.code,\n self.args)\n return error",
"def __str__(self):\n return \"Error: %s\"%s... | [
"0.64060336",
"0.63906485",
"0.62958705",
"0.62437165",
"0.6237594",
"0.62264633",
"0.61808884",
"0.61449856",
"0.6136974",
"0.613228",
"0.6131623",
"0.61072975",
"0.60843146",
"0.60669607",
"0.6061389",
"0.60569376",
"0.6030983",
"0.60280555",
"0.6019237",
"0.6018687",
"0.60... | 0.6514721 | 0 |
this method is invoked on the first turn. first player can puts only one stone on board. this method should return 2tuple, default is (10, 10) | def firstMove(self):
return (10, 10) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def firstMove(board):\r\n x = board.size / 2\r\n return (x, x)",
"def take_turn(self, board, other_player):\n\n # Always pick the middle box on the first round\n position = 4 if self.turn_count == 0 else None\n\n if self.turn_count == 1:\n # On the second turn, after the hum... | [
"0.75705034",
"0.65747726",
"0.65377414",
"0.6350882",
"0.6316932",
"0.6271466",
"0.61944956",
"0.61604035",
"0.61389923",
"0.6138155",
"0.61295015",
"0.61253476",
"0.6120447",
"0.6111359",
"0.61091137",
"0.610629",
"0.61005545",
"0.6098801",
"0.60883456",
"0.60808027",
"0.60... | 0.75002813 | 1 |
Initialize neural net and check output layer shape. | def test_init() -> None:
neural_net = NeuralNetwork()
assert neural_net.model.get_layer('output_layer').output_shape, (None, 4) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_init_net_simple(self):\n net = ecn.NeuralNet(2, (2,), 1)\n self.assertEqual(2, len(net.weights.keys()))\n self.assertEqual((2, 3), np.shape(net.weights['h0']))\n self.assertEqual((1, 3), np.shape(net.weights['y']))\n print('Finished testing simple neural net init\\n')",
... | [
"0.7603709",
"0.7023699",
"0.6976295",
"0.69317013",
"0.69186133",
"0.6909801",
"0.6901226",
"0.6877522",
"0.6854779",
"0.6819741",
"0.6771726",
"0.67149144",
"0.66965085",
"0.66904634",
"0.6672968",
"0.66600806",
"0.6655046",
"0.6619668",
"0.66193616",
"0.6618829",
"0.659733... | 0.8320543 | 0 |
update the list of d_bison_obs | def update_d_bison_obs(bison_i):
for i in range(obs_n):
d_bison_obs[i][bison_i] = calculate_d(bison_x[bison_i], bison_y[bison_i], obstacles[i][0], obstacles[i][1]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update(self, bsd):\n raise NotImplementedError()",
"def update_bison_obs(x_tan, y_tan, i, k):\n d_tan_bison = calculate_d(elude_bison[k][i][0], elude_bison[k][i][1], x_tan, y_tan)\n turn_v = math.sqrt(math.fabs(bison_v ** 2 - 10 * bison_v * (1 - math.cos(bison_angle[i]) ** 2) / math.cos(bison_an... | [
"0.6155102",
"0.5999859",
"0.59011286",
"0.5888638",
"0.58285916",
"0.5765711",
"0.5587305",
"0.5576261",
"0.5576261",
"0.5572444",
"0.55177706",
"0.54821646",
"0.54729325",
"0.54384035",
"0.54384035",
"0.54246837",
"0.54121697",
"0.54096115",
"0.53964806",
"0.53757375",
"0.5... | 0.69077736 | 0 |
if the distance between bison_i and obs_i less than 2.5, it should elude this obstacle | def elude_obstacles(bison_i, k):
# Ax+By+C=0
global predict_wolf
r = obstacles[k][2]
xk = obstacles[k][0]
yk = obstacles[k][1]
a = (bison_y[bison_i] - wolf_y[0]) / (bison_x[bison_i] - wolf_x[0])
b = -1
c = bison_y[bison_i] - (a * bison_x[bison_i])
d_obs_dir = math.fabs(a * xk + b * y... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_terminal(self,bump,DLightBump, AnalogBump, IR):\r\n terminal = False\r\n # signal returned from distance to obstacle /terminal 50 mm,5cm\r\n # by measurement, small obstacle (height = height of light bumper) in 2cm: signal 120 ~300\r\n # within 1cm >400\r\n # if big ob... | [
"0.62927634",
"0.6241226",
"0.620058",
"0.6018024",
"0.59719473",
"0.59486395",
"0.5917246",
"0.59119254",
"0.5910905",
"0.58528554",
"0.5772193",
"0.5666695",
"0.56637704",
"0.5658386",
"0.56462765",
"0.5594453",
"0.55852175",
"0.5563984",
"0.5561192",
"0.55316013",
"0.55280... | 0.7006195 | 0 |
find the index of minimum distance in list of d | def find_min_distance():
return np.argmin(d) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __idx_of_minimum(cls, lst: list) -> int:\n\t\treturn lst.index(min(lst))",
"def _minimum_distance(self,arg):\n return min([abs(arg-e) for e in self if not e is arg])",
"def min_distance(distance, spt_set, self_nodes):\n minimum = sys.maxsize\n minimum_node = None\n f... | [
"0.7192563",
"0.71359694",
"0.70440257",
"0.7035856",
"0.70053023",
"0.69904137",
"0.6925225",
"0.6874505",
"0.6810732",
"0.67803216",
"0.6676719",
"0.66622704",
"0.66444784",
"0.6632789",
"0.6621095",
"0.66131043",
"0.6592418",
"0.6562787",
"0.6508623",
"0.649189",
"0.647867... | 0.8462347 | 0 |
runs a community detection algorithm on graph and returns a coloring of the nodes based on the found communities | def node_community_colors(graph, communities):
colors = nx_helpers.generate_colors(len(communities))
def which_color(node):
"""finds which community node is in and returns
its corresponding color
"""
for i, com in enumerate(communities):
if node in com:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def community_detection(net_G):\r\n if list(nx.isolates(net_G)) == []:\r\n part = community.best_partition(net_G)\r\n #values = [part.get(node) for node in net_G.nodes()]\r\n #nx.draw_spring(net_G, cmap = plt.get_cmap('jet'), node_color = values, node_size=30, with_labels=False)\r\n ... | [
"0.7544369",
"0.67278713",
"0.67230785",
"0.6600129",
"0.6450803",
"0.62319934",
"0.62119263",
"0.6207066",
"0.62020797",
"0.61163753",
"0.61084396",
"0.6086533",
"0.5949669",
"0.591313",
"0.59082705",
"0.5903655",
"0.58992743",
"0.58878565",
"0.5877019",
"0.58694255",
"0.586... | 0.7250731 | 1 |
finds which community node is in and returns its corresponding color | def which_color(node):
for i, com in enumerate(communities):
if node in com:
return colors[i]
return nx_helpers.rgb_to_hex((0, 0, 0)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def node_community_colors(graph, communities):\n colors = nx_helpers.generate_colors(len(communities))\n\n def which_color(node):\n \"\"\"finds which community node is in and returns\n its corresponding color\n \"\"\"\n for i, com in enumerate(communities):\n if node in... | [
"0.75510806",
"0.69493985",
"0.66909236",
"0.66592944",
"0.6608618",
"0.64989406",
"0.6450056",
"0.64425915",
"0.64138216",
"0.6396164",
"0.6335987",
"0.6323094",
"0.62105125",
"0.6205423",
"0.61846185",
"0.617105",
"0.6087763",
"0.59781784",
"0.5975609",
"0.59191763",
"0.590... | 0.83000135 | 0 |
returns a list of colors for coloring nodes based on which set each node is in | def node_set_colors(nodes, spanset, gapset, preset, postset):
node_colors = []
for n in nodes:
if n in preset:
node_colors.append(nx_helpers.rgb_to_hex((255, 0, 0)))
elif n in postset:
node_colors.append(nx_helpers.rgb_to_hex((255, 255, 0)))
## reads now may be m... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_groups(nodes):\n return list(set([node.color for node in nodes]))",
"def get_colors(self):\n colors = [\"#244486\", \"#A6A6A6\", \"#B12122\"]\n cmap = LinearSegmentedColormap.from_list(\"mycmap\", colors)\n\n color_palette=[cmap(i) for i in np.linspace(0, 1, len(set(self.nodes_lis... | [
"0.78957987",
"0.7514314",
"0.712716",
"0.69475394",
"0.6675967",
"0.66652167",
"0.66599905",
"0.66454685",
"0.64734924",
"0.6415016",
"0.64149046",
"0.6397059",
"0.63902277",
"0.63846207",
"0.63146603",
"0.6292402",
"0.627562",
"0.627562",
"0.62653184",
"0.62567157",
"0.6220... | 0.7795284 | 1 |
generates and returns overlap graph from .paf files | def generate_graph(params):
alignedreads = read_paf(params, should_filter_paf=True)
aligned = [(t, h) for t, h, _ in alignedreads]
graph = nx.Graph()
graph.add_edges_from(aligned)
return graph | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def overlap_graph(input, overlap):\n\n sequence_dict = {}\n seq_id_list = []\n\n for seq_record in SeqIO.parse(input, \"fasta\"): # change input variable.\n sequence_dict[seq_record.id] = seq_record.seq\n seq_id_list.append(seq_record.id)\n\n adjacency_list= []\n\n index = overlap\n\n ... | [
"0.6383634",
"0.61519605",
"0.60640895",
"0.5620521",
"0.54954714",
"0.5461694",
"0.5433732",
"0.54307693",
"0.5381156",
"0.53631675",
"0.5311818",
"0.5308905",
"0.52986294",
"0.52673423",
"0.5267266",
"0.52432793",
"0.52378273",
"0.52373457",
"0.5227681",
"0.5227558",
"0.522... | 0.64970756 | 0 |
removes nodes from graph in they are in communities smaller than n | def drop_small_communities(graph, communities, n=4):
for community in communities:
if len(community) < n:
nx_helpers.remove_nodes(graph, community)
communities = [c for c in communities if len(c) >= n]
return graph, communities | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def keep_important_nodes(graph, number_of_nodes):\n sorted_dict = np.array(\n [\n [k, v]\n for k, v in sorted(\n dict(graph.degree()).items(),\n key=lambda item: item[1],\n )\n ]\n )\n use_nodes = sorted_dict[-number_of_nodes:, 0... | [
"0.69280136",
"0.68292296",
"0.67802733",
"0.66563076",
"0.6461734",
"0.64381963",
"0.64123416",
"0.63864523",
"0.6341436",
"0.62839335",
"0.6267461",
"0.6262071",
"0.6231139",
"0.61691225",
"0.6163174",
"0.6140132",
"0.61174977",
"0.61075747",
"0.61025345",
"0.60737944",
"0.... | 0.8111857 | 0 |
Determines the quality of the mapping (assignment of edges) based on the "ground truth" of spanset and gapset. Sums up number of edges between spanset and gapset. Assumes undirected graph see comments | def mapping_quality(graph, spanset, gapset):
the_sum = sum(sum(1 for edge in graph.edges(node) if edge[1] in gapset) for node in spanset)
# if directed graph, uncomment this:
#the_sum += sum(sum(1 for edge in graph.edges(node) if edge[1] in spanset) for node in gapset)
return the_sum | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def countEdges(self):\n n = 0\n for (hub, table) in self.totsupport.iteritems():\n n += len(table)\n return n",
"def community_quality(communities, spanset, gapset):\n if len(communities) != 2:\n return -1\n\n com_sets = [set(c) for c in communities]\n spanset = se... | [
"0.55912036",
"0.553591",
"0.5377618",
"0.53747284",
"0.53365",
"0.5324719",
"0.5322185",
"0.5320498",
"0.5284785",
"0.52796876",
"0.5255801",
"0.5249715",
"0.5231621",
"0.5206148",
"0.51990473",
"0.519828",
"0.51928836",
"0.51651835",
"0.51341033",
"0.5120622",
"0.511521",
... | 0.8308598 | 0 |
Determines the quality of the communities based on the "ground truth" of spanset and gapset. First, determines which community corresponds to gapset and spanset. Then, returns number of wrong nodes. | def community_quality(communities, spanset, gapset):
if len(communities) != 2:
return -1
com_sets = [set(c) for c in communities]
spanset = set(spanset)
gapset = set(gapset)
spanset_0 = len(com_sets[0].difference(spanset))
spanset_1 = len(com_sets[1].difference(spanset))
gapset_0 =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mapping_quality(graph, spanset, gapset):\n the_sum = sum(sum(1 for edge in graph.edges(node) if edge[1] in gapset) for node in spanset)\n # if directed graph, uncomment this:\n #the_sum += sum(sum(1 for edge in graph.edges(node) if edge[1] in spanset) for node in gapset)\n return the_sum",
"def c... | [
"0.63994",
"0.58635193",
"0.5778622",
"0.5743064",
"0.55880827",
"0.555476",
"0.53169554",
"0.52722627",
"0.52660155",
"0.52518225",
"0.52481997",
"0.52412534",
"0.5223429",
"0.5208664",
"0.5191661",
"0.5173846",
"0.51651204",
"0.51604426",
"0.51279247",
"0.51213825",
"0.5113... | 0.75630814 | 0 |
Create a producer. Calls pykafka.topic.Topic.get_producer to create the producer Returns pykafka.producer.Producer | def create(self):
topic = self.__conn__.create_topic(self.__topic__)
return topic.get_producer(*self.__args__, **self.__kargs__) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_producer(self, topic_id: str) -> Producer:\n backend = None\n if self.vendor == 'kafka':\n backend = KafkaClient(topic_id, self.configs['kafka_servers'])\n else:\n project_id = os.getenv(\"GOOGLE_CLOUD_PROJECT\")\n subscription_id = os.getenv(\"GOOGL... | [
"0.77851456",
"0.72549456",
"0.6957942",
"0.6930621",
"0.69090855",
"0.68014026",
"0.66531676",
"0.66403145",
"0.6623068",
"0.6583257",
"0.6494753",
"0.6437796",
"0.63862807",
"0.6300328",
"0.6213889",
"0.6204735",
"0.60279506",
"0.59126776",
"0.58620876",
"0.58424014",
"0.58... | 0.77106583 | 1 |
Check that broken __unicode__/__str__ actually raises an error. | def test_force_text_exception(self):
class MyString(object):
def __str__(self):
return b'\xc3\xb6\xc3\xa4\xc3\xbc'
__unicode__ = __str__
# str(s) raises a TypeError on python 3 if the result is not a text type.
# python 2 fails when it tries converting f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _validate_unicode(data, err=\"Input not valid unicode\"):\n try:\n if not isinstance(data, str) and not isinstance(data, str):\n raise UnicodeError(err)\n # In some cases we pass the above, but it's still inappropriate utf-8.\n str(data)\n except UnicodeError:\n rai... | [
"0.7820335",
"0.712562",
"0.7090174",
"0.6981514",
"0.6951635",
"0.67255706",
"0.66341805",
"0.6598654",
"0.6582145",
"0.6511867",
"0.6404797",
"0.6359545",
"0.6332364",
"0.6303237",
"0.6299061",
"0.6286056",
"0.6273976",
"0.62645805",
"0.6254592",
"0.6227654",
"0.62090826",
... | 0.74112284 | 1 |
Test that force_bytes knows how to convert to bytes an exception containing nonASCII characters in its args. | def test_force_bytes_exception(self):
error_msg = "This is an exception, voilà"
exc = ValueError(error_msg)
result = force_bytes(exc)
self.assertEqual(result, error_msg.encode('utf-8')) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_nonASCIIBytesToString(self):\n self.assertRaises(UnicodeError, nativeString, b\"\\xFF\")",
"def test_py2_transaction_exception_message_bytes_implicit_encoding_non_english():\n try:\n\n # Bytes literal with non-ascii compatible characters only allowed in\n # python 2\n\n ra... | [
"0.77594966",
"0.7754345",
"0.748256",
"0.74188924",
"0.7351609",
"0.7313225",
"0.7176732",
"0.71660197",
"0.71446127",
"0.71294063",
"0.7124105",
"0.71056265",
"0.7031364",
"0.70092523",
"0.6898177",
"0.6873759",
"0.68179154",
"0.6805716",
"0.6797002",
"0.67729616",
"0.67559... | 0.81311226 | 0 |
Get response from Cloud Vision API. | def get_response_from_cv_api(data):
url = 'https://vision.googleapis.com/v1/images:annotate?key={}'.format(API_KEY)
response = requests.post(url=url, data=data, headers={'Content-Type': 'application/json'})
return response | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_response(image):\n encoded = base64.b64encode(image.read())\n GOOGLE_CLOUD_VISION_API_URL = 'https://vision.googleapis.com/v1/images:annotate?key='\n API_KEY = 'AIzaSyCKFsYnfYoLFeD2OHpvcjky9opfhHKFnP0'\n api_url = GOOGLE_CLOUD_VISION_API_URL + API_KEY\n header = {'Content-Type': 'application... | [
"0.6588146",
"0.641112",
"0.61037785",
"0.57874006",
"0.571129",
"0.5638207",
"0.5509912",
"0.54499793",
"0.5273775",
"0.52694327",
"0.5254997",
"0.52453876",
"0.5232203",
"0.52142817",
"0.519771",
"0.51782495",
"0.51781756",
"0.51781756",
"0.51781756",
"0.51781756",
"0.51781... | 0.7367046 | 0 |
Determines whether a given user from the authentication server has a certain right or not. | def has_right(self, username: str, right: str) -> bool:
form: str = urlencode({'username': username, 'right': right})
headers: dict = {
'Content-type': 'application/x-www-form-urlencoded'
}
connection: HTTPConnection = self.__get_connection()
connection.request('GET',... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_roles_check(request):\n logger.debug('right_user_check')\n options = {\n 'api_file': {'GET': True, 'POST': False}\n }\n url_name = request.request.resolver_match.url_name\n if not request.request.user.is_authenticated:\n return False\n user_have_right = options[url_name][re... | [
"0.6864294",
"0.6832401",
"0.6566839",
"0.65181917",
"0.650468",
"0.6478974",
"0.64769286",
"0.64769286",
"0.6463664",
"0.64017993",
"0.6368617",
"0.634587",
"0.6326526",
"0.63013756",
"0.6293979",
"0.62584096",
"0.62548155",
"0.62485784",
"0.62485784",
"0.6244719",
"0.624461... | 0.7994539 | 0 |
Write data to transport. | def send_data(self, data):
self._transport.write(data) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write(self, data, timeout_ms=None, **kwargs):\n raise NotImplementedError(\"implement in derived transport class\")",
"def send_message(self, data):\n self.transport.write(data)",
"def write(self, data):\n if self.closed:\n raise ConnectionResetError(\n 'Trans... | [
"0.7657331",
"0.76417875",
"0.76139855",
"0.7602521",
"0.7583665",
"0.75793827",
"0.75037515",
"0.7470128",
"0.74523485",
"0.739304",
"0.73432237",
"0.7279804",
"0.7269122",
"0.7266278",
"0.72515565",
"0.72349596",
"0.7186108",
"0.71751815",
"0.7171012",
"0.7165056",
"0.70937... | 0.8111547 | 0 |
Pause writing callback from transport. | def pause_writing(self):
self._stream.pause_writing() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resume_writing(self):\n self._stream.resume_writing()",
"def _write(self, chunk):\n if self.consumer and not self.stop_event.is_set():\n self.consumer.write(chunk)",
"def write(self, data):\n if self.closed:\n raise ConnectionResetError(\n 'Transpor... | [
"0.6722218",
"0.6428597",
"0.6101962",
"0.6073248",
"0.60059124",
"0.59187335",
"0.59112674",
"0.5894187",
"0.58766466",
"0.5876161",
"0.5810171",
"0.5754038",
"0.5754038",
"0.57490945",
"0.5720258",
"0.57075626",
"0.5706053",
"0.5704085",
"0.56786174",
"0.56786174",
"0.56483... | 0.7620428 | 0 |
Resume writing callback from transport. | def resume_writing(self):
self._stream.resume_writing() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resume_reading(self):\n raise NotImplementedError",
"def resume_reading(self):\n if not self._paused_reading:\n raise RuntimeError('Not paused')\n self._paused_reading = False\n if not self._closing:\n self._loop.add_reader(self._sock_fd)",
"def pause_writi... | [
"0.66734207",
"0.6322468",
"0.6029015",
"0.60129535",
"0.5927665",
"0.5927665",
"0.5844039",
"0.5816916",
"0.5816916",
"0.5816916",
"0.5802818",
"0.57859164",
"0.578517",
"0.57731336",
"0.5732798",
"0.5677215",
"0.56752896",
"0.5654607",
"0.5628291",
"0.5628291",
"0.5628291",... | 0.76703745 | 0 |
Report the member's replica set state Submit a service check. Create an event on state change. | def _report_replica_set_state(self, state, clean_server_name, replset_name, agentConfig):
last_state = self._last_state_by_server.get(clean_server_name, -1)
self._last_state_by_server[clean_server_name] = state
if last_state != state and last_state != -1:
return self.create_event(las... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def query_member_status():\n notify_member_status()\n logger.info('signal sent for status report')",
"def send_event(instance_config, status, output):\n # This function assumes the input is a string like \"mumble.main\"\n monitoring_overrides = instance_config.get_monitoring()\n if 'alert_after' n... | [
"0.6125251",
"0.60838777",
"0.59746987",
"0.544692",
"0.54446894",
"0.5343415",
"0.5315016",
"0.5272492",
"0.5270251",
"0.52520496",
"0.52330935",
"0.5200511",
"0.519126",
"0.5157797",
"0.51535314",
"0.5149566",
"0.5147222",
"0.51382697",
"0.5132011",
"0.5124594",
"0.5110116"... | 0.6736493 | 0 |
Return a reasonable hostname for a replset membership event to mention. | def hostname_for_event(self, clean_server_name, agentConfig):
uri = urlsplit(clean_server_name)
if '@' in uri.netloc:
hostname = uri.netloc.split('@')[1].split(':')[0]
else:
hostname = uri.netloc.split(':')[0]
if hostname == 'localhost':
hostname = sel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hostname(self) -> str:\n _args: list[Arg] = []\n _ctx = self._select(\"hostname\", _args)\n return _ctx.execute_sync(str)",
"def get_host_name():\n return socket.gethostname()",
"def get_hostname(self):\n return self.name",
"def get_hostname(self):\n prompt = self.se... | [
"0.6662921",
"0.6660988",
"0.6594623",
"0.6580937",
"0.65463096",
"0.65075785",
"0.650404",
"0.64858186",
"0.64726937",
"0.64697844",
"0.64234984",
"0.64135784",
"0.6406523",
"0.63904727",
"0.6379771",
"0.63460785",
"0.6342044",
"0.6332148",
"0.63308704",
"0.63301355",
"0.632... | 0.73296475 | 0 |
Create an event with a message describing the replication state of a mongo node | def create_event(self, last_state, state, clean_server_name, replset_name, agentConfig):
status = self.get_state_description(state)
short_status = self.get_state_name(state)
last_short_status = self.get_state_name(last_state)
hostname = self.hostname_for_event(clean_server_name, agentCo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def printstatechange(self, event):\n print('printstatechange; event: %s, %s->%s' % (event.event, event.src, event.dst))\n try:\n self.mqttclient.publish(\"{}/{}/events\".format(self.config['MQTT']['TOPICBASE'],\n self.config['CLIENTI... | [
"0.53126144",
"0.5274733",
"0.5268226",
"0.52290887",
"0.52170926",
"0.5165227",
"0.51233536",
"0.5103651",
"0.50933707",
"0.50899076",
"0.50673026",
"0.4976149",
"0.49485195",
"0.48921156",
"0.48767117",
"0.48721194",
"0.48523217",
"0.4849296",
"0.48433527",
"0.47988123",
"0... | 0.61032283 | 0 |
Build the metric list to collect based on the instance preferences. | def _build_metric_list_to_collect(self, additional_metrics):
metrics_to_collect = {}
# Defaut metrics
for default_metrics in self.DEFAULT_METRICS.itervalues():
metrics_to_collect.update(default_metrics)
# Additional metrics metrics
for option in additional_metrics:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_metrics_to_collect(self, instance_key, additional_metrics):\n if instance_key not in self.metrics_to_collect_by_instance:\n self.metrics_to_collect_by_instance[instance_key] = \\\n self._build_metric_list_to_collect(additional_metrics)\n return self.metrics_to_colle... | [
"0.65387714",
"0.6310117",
"0.62119526",
"0.5793617",
"0.57547987",
"0.57211876",
"0.56583136",
"0.5615191",
"0.55901927",
"0.5546556",
"0.5533608",
"0.5482031",
"0.5463035",
"0.5445631",
"0.5387678",
"0.53774405",
"0.5351017",
"0.53399146",
"0.5310214",
"0.52838415",
"0.5282... | 0.6790621 | 0 |
Return the submit method and the metric name to use. | def _resolve_metric(self, original_metric_name, metrics_to_collect, prefix=""):
submit_method = metrics_to_collect[original_metric_name][0] \
if isinstance(metrics_to_collect[original_metric_name], tuple) \
else metrics_to_collect[original_metric_name]
metric_name = metrics_to_c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def method(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"method\")",
"def metric_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"metric_name\")",
"def metric_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"metric_name\")",
"def metric_name(self) -> pul... | [
"0.60242224",
"0.5900693",
"0.5900693",
"0.5900693",
"0.5900693",
"0.5900693",
"0.5900693",
"0.5900693",
"0.5900693",
"0.5900693",
"0.5779224",
"0.5709764",
"0.56761044",
"0.5673215",
"0.56213224",
"0.5533348",
"0.550876",
"0.54920304",
"0.5490709",
"0.5478249",
"0.5478249",
... | 0.6122732 | 0 |
Replace casesensitive metric name characters, normalize the metric name, prefix and suffix according to its type. | def _normalize(self, metric_name, submit_method, prefix):
metric_prefix = "mongodb." if not prefix else "mongodb.{0}.".format(prefix)
metric_suffix = "ps" if submit_method == RATE else ""
# Replace case-sensitive metric name characters
for pattern, repl in self.CASE_SENSITIVE_METRIC_NAM... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sanitize_metric_name(name: str) -> str:\n name = name.replace(\":\", \"-\")\n return name",
"def normalize_label(label: str) -> str:\n label = re.sub(r\"['\\\"`]+\", \"\", label) # remove apostrophes\n label = re.sub(r\"[-/\\\\ \\t_]+\", \" \", label) # normalize separators\n low... | [
"0.6782942",
"0.6727968",
"0.6660268",
"0.65970635",
"0.6492408",
"0.63663113",
"0.63579243",
"0.62790793",
"0.6254779",
"0.6217546",
"0.6214412",
"0.61892366",
"0.6164987",
"0.6164987",
"0.6164987",
"0.60686266",
"0.602515",
"0.60172975",
"0.5997466",
"0.59772354",
"0.597167... | 0.7554459 | 0 |
Collect indexes statistics for all collections in the configuration. This use the "$indexStats" command. | def _collect_indexes_stats(self, instance, db, tags):
for coll_name in instance.get('collections', []):
try:
for stats in db[coll_name].aggregate([{"$indexStats": {}}], cursor={}):
idx_tags = tags + [
"name:{0}".format(stats.get('name', 'un... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_index_stats(self):\n #Create Index\n self.run_multi_operations(buckets = self.buckets,\n query_definitions = self.query_definitions,\n create_index = True, drop_index = False)\n #Check Index Stats\n self.sleep(30)\n index_map = self.get_index_stats(... | [
"0.7033326",
"0.6837621",
"0.66362005",
"0.65313584",
"0.626018",
"0.62069684",
"0.6138566",
"0.612696",
"0.6071093",
"0.58983314",
"0.58849525",
"0.58647007",
"0.5845978",
"0.58452255",
"0.5805989",
"0.57855815",
"0.577376",
"0.5711172",
"0.5703516",
"0.56850964",
"0.5676570... | 0.78779423 | 0 |
Test case for upload_area | def test_upload_area(self):
area = areamsg
query_string = [('deliveryAckEndPoint', 'https://localhost:8002')]
response = self.client.open('/area',
method='POST',
data=area,
query_string=qu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_multi_area(self):\n pass",
"def test_upload_file(self):\n pass",
"def test_upload_file1(self):\n pass",
"def test_upload_job_description_file_post(self):\n pass",
"def test_upload(self):\n with self.client:\n file = dict(\n file=(BytesIO... | [
"0.68717897",
"0.67497677",
"0.64811105",
"0.6158702",
"0.61027944",
"0.60922873",
"0.59541386",
"0.59376353",
"0.5898766",
"0.5843938",
"0.58039546",
"0.5802995",
"0.5782079",
"0.5776933",
"0.5713552",
"0.56940377",
"0.5679234",
"0.5669817",
"0.56505054",
"0.56200916",
"0.56... | 0.67986137 | 1 |
Test case for upload_area cleanup | def test_upload_area_cleanup(self):
vis2_uvid='urn:mrn:stm:service:instance:furuno:vis2'
p = Path('import')
files = list(p.glob('**/urn:mrn:s124:*'))
for item in files:
print(item)
os.remove(str(item))
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_final_cleanup():\n cleanup_file(\"tfsaves\")",
"def tearDown(self):\n self.tmp.cleanup()",
"def cleanup():",
"def _cleanup(self):\n pass",
"def test_cleanup(self):\n imgurl = \"{}spei03.nc\".format(self.processor.base_url)\n httpretty.register_uri(httpretty.GET, imgurl,\... | [
"0.6206157",
"0.6140681",
"0.6071183",
"0.6062651",
"0.6050911",
"0.6030279",
"0.6009838",
"0.6004148",
"0.6004148",
"0.6004148",
"0.6001869",
"0.5971952",
"0.5948387",
"0.59369427",
"0.59284383",
"0.5869602",
"0.5861927",
"0.5838485",
"0.5838485",
"0.5813883",
"0.5788908",
... | 0.6698037 | 0 |
Takes in a trajectory file and uploads it to the database | def upload_trajectory(cls, trajectory_file):
# extract the attributes from the file name
pitch, roll, u0 = cls.extract_pitch_roll_velocity(
trajectory_file)
# get or create a database object with those attributes
trajectory, created = SolvedTrajectory.objects.get_or_create(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_trajectory(trajectory):\n query = \"INSERT INTO trajectories (idUser, startTime, endTime) VALUES (%(id_user)s, %(start_time)s, %(end_time)s)\"\n\n trajectory_data = {\n 'id_user': trajectory.id_user,\n 'start_time': trajectory.start_time,\n 'end_time': trajectory.end_time\n }... | [
"0.67590135",
"0.6199504",
"0.60810244",
"0.5968449",
"0.5886125",
"0.5864965",
"0.58335364",
"0.5823321",
"0.58050644",
"0.5799841",
"0.57324755",
"0.57312024",
"0.57259333",
"0.57164156",
"0.5702718",
"0.569988",
"0.5675204",
"0.5665265",
"0.5634949",
"0.5631133",
"0.563033... | 0.7878746 | 0 |
Iterates through every trajectory that has been solved for and then uploads the trajectory that has been solved for | def sync_dir(self):
# mark the trajectories that we have seen
trajectories = os.listdir(self.trajectory_dir)
for trajectory_file in trajectories:
if trajectory_file not in self.seen_trajectories:
created = self.upload_trajectory(trajectory_file)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build(self, trajectory):\n #TODO Implement?",
"def build(self, trajectory):\n pass",
"def compute_trajectory():\n pass",
"def _insertAllSteps(self): \n self.uMics = self.inputCoordinatesTiltedPairs.get().getUntilted().getMicrographs()\n self.tMics = self.inputCoordina... | [
"0.59522563",
"0.59471226",
"0.5912256",
"0.5899517",
"0.5856624",
"0.5813247",
"0.57508117",
"0.57315934",
"0.5581307",
"0.55410546",
"0.5502698",
"0.54654527",
"0.5458855",
"0.53929365",
"0.53702384",
"0.5347481",
"0.5322975",
"0.53141",
"0.52880365",
"0.5242809",
"0.524104... | 0.6943155 | 0 |
returns a list of classes and titles, parsing through 'html' | def get_classes(html):
# elements = html.find_all("span", "code")
# titles = html.find_all("span", "title")
# classes = []
# for i in range(len(elements)):
# item = elements[i]
# tit = titles[i]
# classes += [(item.text.replace('\xa0', ' '), tit.text.replace('\xa0', ' '))]
# ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def EnrolledClasses(self,html): \n classes = []\n soup = BeautifulSoup(html)\n for element in soup.find_all(\"input\"):\n if element[\"name\"] == \"TITLE\" and element[\"value\"]:\n classes.append(element.get(\"value\"))\n return classes",
"def extract_all_tags(final_link, driver):\n\n ... | [
"0.8052008",
"0.6688938",
"0.6265724",
"0.6265724",
"0.61887735",
"0.6152137",
"0.60088265",
"0.5969638",
"0.5957513",
"0.59506553",
"0.59392065",
"0.59321856",
"0.5919949",
"0.5894865",
"0.5883525",
"0.5863221",
"0.5795686",
"0.5791473",
"0.57911634",
"0.5790925",
"0.5789725... | 0.80175537 | 1 |
Download master cdf file from cdaweb for 'dataset' | def _download_metafile(dataset, path=None):
if not path:
path = sunpy.config.get('downloads', 'sample_dir')
base_url = 'https://spdf.gsfc.nasa.gov/pub/software/cdawlib/0MASTERS/'
fname = dataset.lower() + '_00000000_v01.cdf'
url = base_url + fname
try:
downloaded_file = pooch.retriev... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def downloadFile()-> None:\n logging.info(f\"Downloading current data set {getTime()}\")\n with open(DATA_FILE,\"wb\") as f:\n f.write(get(\"https://covid.ourworldindata.org/data/owid-covid-data.csv\").text.encode())\n logging.info(f\"Finished Downloading current data set {getTime()}\")",
"def do... | [
"0.6694223",
"0.6588644",
"0.65666646",
"0.65666646",
"0.6565688",
"0.64363176",
"0.64334583",
"0.6366243",
"0.63625884",
"0.63276845",
"0.6297841",
"0.6201097",
"0.61550426",
"0.61423147",
"0.61154634",
"0.6100518",
"0.6091457",
"0.60131127",
"0.5990933",
"0.5977136",
"0.591... | 0.71092033 | 0 |
Downloads Wind/3DP CDF files via SunPy/Fido from CDAWeb | def wind3dp_download_fido(dataset, startdate, enddate, path=None, max_conn=5):
trange = a.Time(startdate, enddate)
cda_dataset = a.cdaweb.Dataset(dataset)
try:
result = Fido.search(trange, cda_dataset)
filelist = [i[0].split('/')[-1] for i in result.show('URL')[0]]
filelist.sort()
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def download_engine(fcsd): #fcsd = first comic strip date\n\n url_list = get_comic_strip_url(fcsd)\n\n for url in url_list:\n session = requests.Session()\n response = session.get(url)\n download_url = get_image_comic_url(session, response)\n# download_dilbert(session, download_ur... | [
"0.6992597",
"0.6586604",
"0.6586604",
"0.62284845",
"0.62214994",
"0.6183709",
"0.6142462",
"0.61349034",
"0.60533696",
"0.6041575",
"0.6032721",
"0.601811",
"0.5998015",
"0.5983272",
"0.59466475",
"0.5895252",
"0.5893261",
"0.5883837",
"0.58763474",
"0.58670187",
"0.5820259... | 0.6681552 | 1 |
Download a single Wind/3DP level 2 data file from SRL Berkeley to local path | def wind3dp_single_download(file, path=None):
# add a OS-specific '/' to end end of 'path'
if path:
if not path[-1] == os.sep:
path = f'{path}{os.sep}'
else:
path = sunpy.config.get('downloads', 'download_dir') + os.sep
data = file.split('_')[1] # e.g. 'sfsp'
year = fi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def download_hess_dr1_data():\n download_data_files(FILENAMES_HESS_DR1)",
"def download():\r\n reader = GSODDataReader()\r\n year_list = range(2001, 2012)\r\n austin = reader.collect_data(year_list, exact_station=True,\r\n station_name='AUSTIN CAMP MABRY', state='TX', country='US')\r\n hous... | [
"0.67398626",
"0.6583231",
"0.6520613",
"0.6331625",
"0.6304204",
"0.6291874",
"0.6226741",
"0.62254614",
"0.62199074",
"0.61869997",
"0.60891455",
"0.60750973",
"0.6024186",
"0.60179967",
"0.60074246",
"0.5984744",
"0.59611046",
"0.5960039",
"0.5954429",
"0.5950052",
"0.5932... | 0.69402546 | 0 |
Returns the current state of the gameboard and the two player's colors. Returns np.ndarray a flat 1D representation of the gameboard appended by the two players' colors | def get_state(self):
return np.append(self.game.game_board.get_board(),
[self.game.player_1.color, self.game.player_2.color])[None, :] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_current_game_state(board):\n return np.concatenate((_get_pieces_one_hot(board, color=False),\n _get_pieces_one_hot(board, color=True)),\n axis=-1)",
"def return_state(board):\r\n state = np.array(INIT_ARRAY)\r\n for pos in BOARD_POSITIO... | [
"0.6973377",
"0.6708354",
"0.6522196",
"0.651381",
"0.651381",
"0.6499365",
"0.6218236",
"0.6212448",
"0.6204406",
"0.61157256",
"0.6032963",
"0.60149604",
"0.6009506",
"0.59559596",
"0.5954081",
"0.5951532",
"0.58624077",
"0.58483106",
"0.58110374",
"0.57483196",
"0.5746821"... | 0.8583118 | 0 |
Returns the possible color options that can be played. Returns list a list of the possible color options (as integers) | def get_color_options(self):
mask = (self.all_colors != self.player_1.color) & (self.all_colors != self.player_2.color)
return self.all_colors[mask] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_player_colors() -> List[Tuple[float, float, float]]:\n return PLAYER_COLORS",
"def supported_color_modes(self) -> set[str] | None:\n color_modes = [COLOR_MODE_ONOFF]\n if self.dp_code_bright in self.tuya_device.status:\n color_modes.append(COLOR_MODE_BRIGHTNESS)\n\n if ... | [
"0.70465565",
"0.65711427",
"0.6478505",
"0.64456594",
"0.6323879",
"0.62680316",
"0.61799985",
"0.6158194",
"0.61572695",
"0.61044914",
"0.6100955",
"0.60627854",
"0.60627854",
"0.60460067",
"0.60313606",
"0.59857523",
"0.59533656",
"0.5913804",
"0.5863346",
"0.58114314",
"0... | 0.75890493 | 0 |
Completes a single turn by showing the gameboard, playing each of the players' turns, and printing the result. The former and latter are only done if the game type is RL. | def play_single_turn(self, action=None):
self.turn_count += 1
if self.save_images_suffix:
self.game_board.graphical_output(save=True, display=False,
image_suffix=f'{self.save_images_suffix}_{self.turn_count}')
if self.game_type == self.gam... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def finishTurn(self):\n print \"go\"\n sys.stdout.flush()",
"def play(self, turn):\n # global black_prompt, white_prompt, res, pi, board\n if turn % 2 == 0:\n prompt, requests_add, responses_add, color_to_play = self.bp, self.bp, self.wp, BLACK\n print(\"pure\")\... | [
"0.688064",
"0.66935813",
"0.6467623",
"0.64412105",
"0.6440219",
"0.6420127",
"0.63784677",
"0.6366233",
"0.635333",
"0.62903583",
"0.62639993",
"0.62625086",
"0.6251562",
"0.6237911",
"0.6230091",
"0.6221477",
"0.62081194",
"0.6202306",
"0.616118",
"0.6145242",
"0.6123327",... | 0.67183626 | 1 |
Outputs the gameboard as text. | def text_output(self):
print(self.board)
print() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def display_board(self):\n print(self.game_board)",
"def render_board(self):\n print \"\"\n for row in self._board:\n print row",
"def draw(self):\n res = ''\n # ANSI code to clear the screen\n #res += chr(27) + \"[2J\"\n for position, value in enumer... | [
"0.76990277",
"0.7684276",
"0.7571131",
"0.75571936",
"0.75506896",
"0.75325507",
"0.7497205",
"0.7475444",
"0.74271286",
"0.7372031",
"0.7361939",
"0.73593736",
"0.7353311",
"0.73500687",
"0.7348999",
"0.7339537",
"0.73229283",
"0.73167104",
"0.7309406",
"0.7297968",
"0.7288... | 0.8650465 | 0 |
Gets the color at the specified coordinates on the gameboard. | def get_color(self, coord):
return self.board[coord[0], coord[1]] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_color(self, _pos):\n return self.__framebuffer[_pos]",
"def _get_color(self, r, g, b):\n clr = (r, g, b)\n return clr",
"def get_colour(self, x, y):\n if x >= self.width or y >= self.height:\n return (0, 0, 0)\n\n return self.env_img.get_at((int(x), int(y))... | [
"0.6995972",
"0.67755926",
"0.6742886",
"0.6678613",
"0.66424483",
"0.6595865",
"0.65444714",
"0.6500604",
"0.6482022",
"0.64749384",
"0.64731526",
"0.6466952",
"0.6460171",
"0.6415692",
"0.6340766",
"0.6315026",
"0.63021356",
"0.6299288",
"0.62905073",
"0.62475747",
"0.62238... | 0.81525886 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.