query stringlengths 10 2k | document stringlengths 20 51.2k | metadata dict | negatives listlengths 0 101 | negative_scores listlengths 0 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
This operation gets the DNS settings from a device. | def get_dns(self):
return self.mycam.devicemgmt.GetDNS() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_dns_server_config():\n query = {\n \"type\": \"config\",\n \"action\": \"get\",\n \"xpath\": \"/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/dns-setting/servers\",\n }\n\n return __proxy__[\"panos.call\"](query)",
"def dns_config(self) -> Optional[... | [
"0.64678514",
"0.63928276",
"0.63720673",
"0.6166762",
"0.60828495",
"0.60408455",
"0.6004255",
"0.5940321",
"0.58733785",
"0.586036",
"0.5795603",
"0.5724722",
"0.57097685",
"0.57028073",
"0.56547594",
"0.55348164",
"0.54790777",
"0.5432762",
"0.5334097",
"0.5331719",
"0.531... | 0.61766446 | 3 |
This operation gets the device system date and time. | def get_system_date_and_time(self):
return self.mycam.devicemgmt.GetSystemDateAndTime() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_system_date_time():\n query = {\"type\": \"op\", \"cmd\": \"<show><clock></clock></show>\"}\n\n return __proxy__[\"panos.call\"](query)",
"def device_time(self) -> str:\n ext_name = 'mobile: getDeviceTime'\n try:\n return self.assert_extension_exists(ext_name).execute_scrip... | [
"0.7913414",
"0.74700314",
"0.7328736",
"0.70159936",
"0.6867378",
"0.68138486",
"0.6801044",
"0.6727451",
"0.6635351",
"0.66029614",
"0.6578176",
"0.6540865",
"0.65284455",
"0.65101206",
"0.65101206",
"0.6505559",
"0.6504806",
"0.6500703",
"0.64956",
"0.6488631",
"0.64805204... | 0.8599086 | 0 |
This operation lists all available physical video inputs of the device. | def get_video_sources(self):
return self.camera_media.GetVideoSources() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_available_cameras():\n graph = FilterGraph()\n device_names = graph.get_input_devices()\n return device_names",
"def get_physical_input_channels(self):\r\n bufsize = 1024\r\n buf = ctypes.create_string_buffer(bufsize)\r\n CHK(NIDAQ_dll.DAQmxGetDevAIPhysicalChans(\r\n ... | [
"0.62154883",
"0.5859342",
"0.570393",
"0.5702355",
"0.56760305",
"0.5573731",
"0.55687475",
"0.55091965",
"0.55056244",
"0.54840153",
"0.5461272",
"0.5457633",
"0.53911066",
"0.5358529",
"0.53087866",
"0.5302861",
"0.52876705",
"0.5260599",
"0.51886904",
"0.51741046",
"0.516... | 0.4691562 | 92 |
Get the value associated with key as an absolute path assuming the key is relative to the file this config object was loaded from. | def getAsAbsolutePath(self, key, default=None):
filename = self.get(key, default)
if filename is None:
raise KeyError('Config key [%s] not found' % (key,))
return self._getAbsolutePath(filename) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_path(self, key):\n value = self.getn(key)\n if value is None:\n logger.warning(\"Specified config '%s' is None or not exist\" % key)\n return None\n if not isinstance(value, str):\n msg = \"Specified config '%s' is non-string: %s\" % (key, value)\n ... | [
"0.82769114",
"0.72002006",
"0.7183768",
"0.68173224",
"0.6578446",
"0.64622384",
"0.63973415",
"0.6341566",
"0.63308835",
"0.6310265",
"0.62807906",
"0.6245452",
"0.62209404",
"0.6216155",
"0.62006766",
"0.61324126",
"0.61266136",
"0.61065876",
"0.60979176",
"0.6094334",
"0.... | 0.83757246 | 0 |
Converts dlib.point instance to numpy array, as [x,y]. | def dlib_point_to_np_array(point: dlib.point):
return np.array([point.x, point.y]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def md_point_to_np_array(point: dict):\n return np.array([point[\"x\"], point[\"y\"]])",
"def np(self):\n return np.array([self.x, self.y])",
"def point_to_coords(self, point: Sequence[float]) -> np.ndarray:\n point = np.asarray(point)\n result = np.asarray([axis.point_to_number(point) ... | [
"0.7903689",
"0.73951495",
"0.73439354",
"0.7293667",
"0.71917224",
"0.7074025",
"0.6829621",
"0.67643136",
"0.6693111",
"0.66806954",
"0.6644349",
"0.6575195",
"0.65719104",
"0.65548784",
"0.6540824",
"0.65291667",
"0.6500076",
"0.64880925",
"0.64569306",
"0.64569306",
"0.64... | 0.8814276 | 0 |
Converts metadata point to numpy array, as [x,y]. | def md_point_to_np_array(point: dict):
return np.array([point["x"], point["y"]]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dlib_point_to_np_array(point: dlib.point):\n return np.array([point.x, point.y])",
"def np(self):\n return np.array([self.x, self.y])",
"def xy(self):\n xcol = self.xx.reshape(-1, 1)\n ycol = self.yy.reshape(-1, 1)\n return np.column_stack([xcol, ycol])",
"def get_xyz_coord... | [
"0.7138368",
"0.636208",
"0.6314531",
"0.6237923",
"0.6192467",
"0.6178788",
"0.6172535",
"0.61172384",
"0.60364574",
"0.6023491",
"0.59993565",
"0.59993565",
"0.5990991",
"0.59577835",
"0.595448",
"0.5940002",
"0.59375846",
"0.5895598",
"0.58817726",
"0.58793324",
"0.5875305... | 0.7372559 | 0 |
Test an unregistered user cannot log in. | def test_login_without_registration_false(self):
logins = {"email": "esta@x.com", "Password": "pass234"}
res = self.client().post('/api/v1/auth/login', data=logins)
self.assertTrue(res.status_code, 403) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_login_for_user_not_registered(self):\n response = self.client.post(LOGIN_URL,\n data=json.dumps(\n {'username': 'otieno', 'password': 'otieno254'}),\n content_type='application/json')\n ... | [
"0.7638649",
"0.74178535",
"0.74166274",
"0.74018294",
"0.7242789",
"0.7242789",
"0.7242789",
"0.7242789",
"0.7237411",
"0.7229067",
"0.7211795",
"0.71849227",
"0.7171471",
"0.7151751",
"0.71311945",
"0.71230495",
"0.71230495",
"0.71230495",
"0.71230495",
"0.71008426",
"0.710... | 0.74212563 | 1 |
Test user can make a request successfuly. | def test_make_ride_request_if_signed_in_success(self):
# signup
passenger = {
"Email": "dru@gmail.com",
"Type": "passenger",
"Password": "pass234",
"Confirm Password": "pass234"
}
res = self.client().post('/api/v1/auth/register', data=passe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _test_success(self, user, fields):\r\n resp = self._build_and_run_request(user, fields)\r\n self.assertEqual(resp.status_code, 200)",
"def test_status_code_for_privileged_user(self):\n self.grant_permission()\n self.client.login(username=\"john\", password=\"pass\")\n respo... | [
"0.74139535",
"0.70240563",
"0.7005999",
"0.6920235",
"0.69030786",
"0.6897883",
"0.6884959",
"0.68421245",
"0.682957",
"0.6758818",
"0.6758818",
"0.6758818",
"0.6758818",
"0.6734924",
"0.6734924",
"0.6716781",
"0.6695919",
"0.66468",
"0.6617824",
"0.66142607",
"0.6561173",
... | 0.0 | -1 |
Create a new logger instance. | def __init__(self, n_epochs, log_rate=9):
self.i_epoch = 0
self.i_train_batch = 0
self.i_val_batch = 0
self.n_epochs = n_epochs
self.n_batches_last = None
self.train_loss = 0.0
self.train_samples = 0
self.train_losses = {}
self.val_loss = 0.0
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_logger() -> logging.Logger:\n pass # TODO: Replace with implementation!",
"def create_logger():\r\n global logger\r\n logger = logging.getLogger(logger_name)\r\n\r\n formatter = logging.Formatter(fmt='%(asctime)s %(levelname)s %(message)s')\r\n \r\n handler = logging.StreamHandler()... | [
"0.8062197",
"0.79813015",
"0.7660072",
"0.76006454",
"0.7513307",
"0.74353385",
"0.73828954",
"0.732198",
"0.7302733",
"0.7179894",
"0.7143614",
"0.7135323",
"0.71153307",
"0.70623386",
"0.70549667",
"0.70474505",
"0.702152",
"0.70095277",
"0.6963999",
"0.6939103",
"0.693266... | 0.0 | -1 |
Returns a dataframe from a QuerySet Optionally specify the field names/columns to utilize and a field as the index | def read_frame(qs, fieldnames=(), index_col=None, coerce_float=False,
verbose=True, datetime_index=False, column_names=None):
if fieldnames:
fieldnames = pd.unique(fieldnames)
if index_col is not None and index_col not in fieldnames:
# Add it to the field names if not alr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_frame_from_query(the_query, colnames):\n df = DataFrame.from_records(list(the_query), columns=colnames)\n return df",
"def get_dataframe(q):\n cnx = create_engine(postgres_str)\n query = q\n return pd.read_sql_query(query, cnx)",
"def to_DataFrame(cls, qs):\n dates = [pd.to_dateti... | [
"0.64822567",
"0.6433564",
"0.6423118",
"0.6358734",
"0.635747",
"0.6325916",
"0.63072026",
"0.6236283",
"0.62165457",
"0.61668104",
"0.61633986",
"0.6149377",
"0.61281866",
"0.6091195",
"0.6049121",
"0.6002425",
"0.5978734",
"0.5977571",
"0.597493",
"0.5917463",
"0.5913408",... | 0.72651476 | 0 |
Normalize an argument value to None if it is an empty string. | def _normalize_argument(self, value):
return storepass.utils.normalize_empty_to_none(value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _nullify(self, value):\n if not str(value).strip():\n return None\n else:\n return value",
"def get_nonempty_str(arg: Any) -> Optional[str]:\n if isinstance(arg, str):\n if len(arg) > 0:\n return str(arg)\n return None",
"def silent_none(value):\n... | [
"0.75848675",
"0.73767436",
"0.71074647",
"0.7083895",
"0.70508033",
"0.704197",
"0.6726404",
"0.6641381",
"0.66169035",
"0.6606928",
"0.65899706",
"0.6506558",
"0.6500135",
"0.64558804",
"0.6430271",
"0.6414741",
"0.6407204",
"0.63384503",
"0.6330564",
"0.632549",
"0.6291241... | 0.8602844 | 0 |
Get the nature of the given behavior. | def getBehaviorNature(self, behavior):
if not self.proxy:
self.proxy = self.session.service("ALBehaviorManager")
return self.proxy.getBehaviorNature(behavior) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def piece_behavior(self):\n return self._piece_behavior",
"def piece_type(self):\n return self.piece_behavior.piece_type",
"def get_type(self):\n return self.__animal_type",
"def kind(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"kind\")",
"def kind(self) -> pulumi.Ou... | [
"0.6085287",
"0.5884751",
"0.58295727",
"0.5802423",
"0.5802423",
"0.57958454",
"0.5766477",
"0.5766477",
"0.5766477",
"0.5766477",
"0.5766477",
"0.57446635",
"0.5700036",
"0.5696327",
"0.5693028",
"0.5691021",
"0.5647198",
"0.56382996",
"0.5635809",
"0.56140184",
"0.5605605"... | 0.7952536 | 0 |
Return the number of DVs. Returns | def getNDV(self):
return len(self.globalDVList) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nvar(self):\n return len(self.v)",
"def count(self):\n return self.vcount",
"def n_Vrepresentation(self):\n return len(self.Vrepresentation())",
"def v_size(self) -> int:\n return self.nodes_on_graph",
"def get_devs_count(self):\n\t\treturn call_sdk_function('PrlVmCfg_GetDevsCou... | [
"0.70397526",
"0.6775279",
"0.6722472",
"0.6668715",
"0.6576497",
"0.6556998",
"0.645219",
"0.6428627",
"0.64161664",
"0.64062935",
"0.6392281",
"0.6392281",
"0.6349813",
"0.6341529",
"0.63283366",
"0.6323176",
"0.6270239",
"0.62686175",
"0.62611103",
"0.62606883",
"0.6250386... | 0.7330309 | 0 |
Initialize a new record. | def __init__(self, data, origin=None, raw_data=None,
field_offset_map=None):
self._data = data
if raw_data is None:
raw_data = data
self._raw_data = raw_data
if origin is None:
origin = Origin.get_caller_origin()
self._origin = origin
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, record=None):\n self.record = record",
"def __init__(self, seq_record=None):\n\t\tself._record = seq_record",
"def __init__(self,\n record_class: Optional[Type[_Record]] = None) -> None:\n self.fields: List[tsdb.Field] = []\n self._field_index: tsdb.Field... | [
"0.79525125",
"0.7463136",
"0.7072883",
"0.7064801",
"0.6935223",
"0.6703645",
"0.66618085",
"0.6630326",
"0.63647336",
"0.6320703",
"0.6319112",
"0.630688",
"0.6306812",
"0.6298128",
"0.6294068",
"0.62613344",
"0.6254469",
"0.624177",
"0.62386096",
"0.6235291",
"0.62286764",... | 0.0 | -1 |
The raw version of data set (dictionary) This property exposes the raw (original) version of the data encapsulated by this record. This data is as it was originally parsed, including all the whitespace layout. In some records this may be 'normal' data object itself (same object). | def raw_data(self):
return self._raw_data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def raw(self):\n return self.data",
"def get_raw_data(self):\n return self.__data",
"def data(self) -> RawData:\r\n\r\n return self.__data",
"def normalized_data(self):\n return self._data",
"def raw(self):\n return self._raw",
"def raw(self):\n return self._raw"... | [
"0.72271216",
"0.72093284",
"0.70468515",
"0.6987241",
"0.6966951",
"0.6966951",
"0.69475245",
"0.69475245",
"0.6946276",
"0.6878843",
"0.6865572",
"0.68456",
"0.68042636",
"0.66893977",
"0.66893977",
"0.6674772",
"0.65475374",
"0.65457845",
"0.65457845",
"0.65457845",
"0.654... | 0.7379907 | 0 |
The origin of the record. | def origin(self):
return self._origin | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dd_origin(self):\n # type: () -> Optional[Text]\n return self._meta.get(ORIGIN_KEY)",
"def getOrigin(self):\n return self.data",
"def origin(self) -> str:\n return self._event.get('origin')",
"def _get_origin(self):\n return self.__origin",
"def get_origin(self):\n ... | [
"0.7747454",
"0.7592031",
"0.75326556",
"0.7449492",
"0.7428114",
"0.7295713",
"0.7295713",
"0.7295713",
"0.71899056",
"0.70371044",
"0.70276314",
"0.68441206",
"0.6820178",
"0.67186165",
"0.6683777",
"0.66482687",
"0.65680104",
"0.6493267",
"0.64480865",
"0.6416394",
"0.6300... | 0.80100757 | 0 |
Returns an int64_list from a bool / enum / int / uint. | def _int64_feature(value):
values = value if isinstance(value, (list, tuple)) else [value]
return tf.train.Feature(int64_list=tf.train.Int64List(value=values)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _BoolsToInts(arg_list):\n result = []\n for arg in arg_list:\n if isinstance(arg, (list, tuple)):\n result.append(_BoolsToInts(arg))\n elif arg is True:\n result.append(1)\n elif arg is False:\n result.append(0)\n else:\n result.append(arg)\n\n return result",
"def convertT... | [
"0.68822104",
"0.6595804",
"0.6461252",
"0.6448161",
"0.6367609",
"0.62926817",
"0.6269916",
"0.621823",
"0.6104528",
"0.59533274",
"0.5947467",
"0.5901199",
"0.58563983",
"0.5844792",
"0.58434534",
"0.5829844",
"0.5801042",
"0.5793561",
"0.5793561",
"0.5793561",
"0.57893056"... | 0.5863832 | 13 |
Appends encoded NULL byte character at the end of payload | def tamper(payload, **kwargs):
return "%s%%00" % payload if payload else payload | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def encode_null_term(self, input):\n return input.encode() + b'\\x00'",
"def write_nul_bytes(self, n):\n self.write(b'\\x00' * n)",
"def _strip_nul(text):\n return text.replace('\\x00', '<NUL>')",
"def encode_prefix_length_null_term(self, input):\n return self.encode_prefix_length(inp... | [
"0.7128998",
"0.66081196",
"0.65193105",
"0.6266408",
"0.6263568",
"0.61699677",
"0.6101715",
"0.607311",
"0.59896475",
"0.59050715",
"0.56793195",
"0.56708825",
"0.55789244",
"0.5576834",
"0.55546665",
"0.54570657",
"0.5449386",
"0.5434637",
"0.5400641",
"0.5397952",
"0.5389... | 0.0 | -1 |
Returns the closest power of 2 that is less than x >>> closest_power_2(6) 4 >>> closest_power_2(32) 16 >>> closest_power_2(87) 64 >>> closest_power_2(4095) 2048 >>> closest_power_2(524290) 524288 | def closest_power_2(x):
if 2 ** (int(math.log(x, 2))) == x:
return 2 ** (int(math.log(x - 1, 2)))
else:
return 2 ** (int(math.log(x, 2))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _nearest_bigger_power_of_two(x: int) -> int:\n y = 2\n while y < x:\n y *= 2\n return y",
"def _find_nearest_power_of_two(x):\n\n return 1 << (x - 1).bit_length()",
"def _nearest_pow_2(x):\r\n a = math.pow(2, math.ceil(np.log2(x)))\r\n b = math.pow(2, math.floor(np.log2(x)))\r\... | [
"0.829415",
"0.80996364",
"0.7742128",
"0.7379482",
"0.72013843",
"0.70214355",
"0.6979433",
"0.67759824",
"0.6763856",
"0.6709277",
"0.6699281",
"0.658008",
"0.6403224",
"0.6402679",
"0.63612676",
"0.6338183",
"0.623631",
"0.618537",
"0.6142823",
"0.59364855",
"0.5913639",
... | 0.82553697 | 1 |
Return current authenticated user. | def get_user(self, validated_data):
user = CustomUser.objects.get(pk=validated_data['user_id'])
return user | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_user(self):\n user_dict = self.auth.get_user_by_session()\n return self.auth.store.user_model.get_by_id(user_dict['user_id'])",
"def get_current_user(self):\n return self.current_user",
"def current_user(self):\n user_dict = self.auth.get_user_by_session()\n if user_dict ... | [
"0.8798342",
"0.86410284",
"0.86162794",
"0.8610526",
"0.8531176",
"0.84969854",
"0.8474438",
"0.8340217",
"0.8340217",
"0.8287828",
"0.82609254",
"0.8243748",
"0.82364714",
"0.82364714",
"0.82364714",
"0.81615216",
"0.8153673",
"0.81263113",
"0.80952847",
"0.8014649",
"0.798... | 0.0 | -1 |
Update trainable parameters using backpropagation | def train(self, X, y):
h1_input, h1_output, h2_input, h2_output, final_output = self.forwardpass_train(
X
)
# calculate average loss per one data
train_loss = self.cross_entropy_loss(y, final_output)
dW1, db1, dW2, db2, dW3, db3 = self.backpropagation(
X, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_params(self, learning_rate):\n\t\t#######################################################################\n\t\t# ** START OF YOUR CODE **\n\t\t#######################################################################\n\t\tself._W = self._W - learning_rate * self._grad_W_current\n\t\t... | [
"0.7220745",
"0.7194221",
"0.7164742",
"0.7144565",
"0.71130294",
"0.7069491",
"0.7005749",
"0.70014435",
"0.699745",
"0.698032",
"0.69567126",
"0.69493204",
"0.69132507",
"0.6889848",
"0.6847116",
"0.681599",
"0.68113685",
"0.68074095",
"0.67913",
"0.6777887",
"0.6776674",
... | 0.0 | -1 |
Serve the index HTML | def player():
return render_template('deck.html') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index(self):\n single = os.path.join(\n os.path.dirname(os.path.abspath(__file__)),\n 'index.html')\n return serve_file(single)",
"def index():\n return render_template('index.html'), 200",
"def index():\n\n return render_template(\"index.html\"), 200",
"def inde... | [
"0.8685354",
"0.85523725",
"0.84890985",
"0.8468328",
"0.8451884",
"0.82966554",
"0.8292779",
"0.82886124",
"0.82686514",
"0.82686514",
"0.82643247",
"0.82445365",
"0.82445365",
"0.8232638",
"0.8232638",
"0.8232638",
"0.8232638",
"0.8232638",
"0.8232638",
"0.8232638",
"0.8232... | 0.0 | -1 |
We have two monkeys, a and b, and the parameters a_smile and b_smile indicate if each is smiling. We are in trouble if they are both smiling or if neither of them is smiling. Return True if we are in trouble. | def monkey_trouble(a_smile, b_smile):
if a_smile and b_smile:
return True
if not a_smile and not b_smile:
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def monkey_trouble(a_smile, b_smile):\n if (a_smile and b_smile) or (not(a_smile) and not(b_smile)):\n return True\n else:\n return False",
"def monkey_trouble(a_smile, b_smile):\r\n return a_smile == b_smile",
"def monkey_trouble2(a_smile, b_smile):\n if a_smile == b_smile:\n ... | [
"0.7802392",
"0.7768365",
"0.75957346",
"0.5833704",
"0.5833704",
"0.5760189",
"0.56684387",
"0.5522672",
"0.5436356",
"0.5384486",
"0.53546774",
"0.5349198",
"0.531989",
"0.53096116",
"0.52447766",
"0.5181048",
"0.5175187",
"0.5171826",
"0.51422817",
"0.5138446",
"0.5119486"... | 0.7982712 | 0 |
Generate IP address in CIDR format. | def generateIPAddress(base, subnet, host, mask):
addr = str(base)+'.'+str(subnet)+'.' + str(host)
if mask != None:
addr = addr + '/' + str(mask)
return addr | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def format_ip(ip_addr):\n ip = ip_addr.split(\"/\")[0]\n cidr = ip_network(ip_addr, strict=False).prefixlen\n result = \"{}/{}\".format(ip, cidr)\n log.debug(\"Converted '%s' to CIDR notation '%s'.\", ip_addr, result)\n return result",
"def cidr(self) -> pulumi.Output[str]:\n return pulumi.... | [
"0.74946463",
"0.7172451",
"0.7172451",
"0.7084753",
"0.7084753",
"0.69077945",
"0.6679513",
"0.6679513",
"0.66397405",
"0.64795285",
"0.6399701",
"0.63264924",
"0.62034786",
"0.6132214",
"0.61295575",
"0.60738873",
"0.6029608",
"0.60255253",
"0.60203344",
"0.60203344",
"0.60... | 0.63201785 | 12 |
The explicitly_required property getter. | def explicitly_required(self):
return self._explicit | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def implicitly_required(self):\n\n return self._implicit",
"def is_required(self):\r\n return self._required",
"def required(self):\n return self._required",
"def required(self):\n return self._required",
"def required(self) -> bool | None:\n return self._underlying.requi... | [
"0.7292475",
"0.72426236",
"0.7189438",
"0.7189438",
"0.7052701",
"0.6741348",
"0.6675226",
"0.6634331",
"0.66096973",
"0.65829355",
"0.65678114",
"0.65678114",
"0.6528718",
"0.6498723",
"0.64888996",
"0.64626163",
"0.6430115",
"0.6376159",
"0.63262385",
"0.6223015",
"0.61021... | 0.8126879 | 0 |
The implicitly_required property getter. | def implicitly_required(self):
return self._implicit | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def explicitly_required(self):\n\n return self._explicit",
"def is_required(self):\r\n return self._required",
"def required(self):\n return self._required",
"def required(self):\n return self._required",
"def required(self) -> bool | None:\n return self._underlying.requi... | [
"0.75253034",
"0.6895956",
"0.6857876",
"0.6857876",
"0.6783887",
"0.6319935",
"0.6317399",
"0.63037133",
"0.6289728",
"0.62500167",
"0.62288153",
"0.61902875",
"0.61759627",
"0.6140612",
"0.61015755",
"0.61015755",
"0.6009604",
"0.5948715",
"0.5900143",
"0.58599097",
"0.5845... | 0.8019381 | 0 |
Computes the bolometric flux in somewhat arbitrary, magnitude based units for comparison with other fluxes. Flux is computed as 10(2.5mag), such that it can be compared with other magnitudes. | def Fbol_SDSSg(Teff_vec, gmag_vec):
Teff_vec = np.float64(Teff_vec)
hdulist = fits.open('../Scratchwork/SDSS_filter_curves.fits')
data = hdulist[2].data
wvln = data['wavelength'] #ang
resp = data['respt']
wvln = wvln/1e4 #microns
minw, maxw = wvln[0], wvln[-1]
thru = interp1d(wvln, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def magtoflux(_mag, _id):\n return math.pow(10, -0.4*(_mag + VegaToAB[_id] - 8.9))",
"def mag2Flux(mag, unit='maggy'):\n flux = 10.0 ** (-0.4 * mag)\n\n if unit.lower().strip() == 'jy':\n return flux * 3631.0\n\n if unit.lower().strip() == 'maggy':\n return flux\n\n if unit.lower().s... | [
"0.6832122",
"0.65884715",
"0.6410879",
"0.640681",
"0.6384908",
"0.6316977",
"0.61603874",
"0.6110449",
"0.60917085",
"0.607172",
"0.6045959",
"0.6035474",
"0.6004315",
"0.595928",
"0.59452724",
"0.5937319",
"0.5917752",
"0.5909653",
"0.5908737",
"0.5888053",
"0.5860525",
... | 0.53893816 | 77 |
Return the appropriate indefinite article ('a' or 'an') to use with the object, based on starting character of self.short_desc. Overload for objects not starting with a vowel that should still use 'an' | def indefinite(self):
return "an" if self.short_desc[0] in 'aeiou' else "a" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def guess_article(item_name):\n return 'an' if item_name[0].lower() in 'aeiouy' else 'a'",
"def abstract_plaintext(self, include_shortened=False):\n text = ''\n shortened = False\n if self.abstract:\n text = self.abstract\n elif self.description:\n for block i... | [
"0.6809835",
"0.58409786",
"0.576589",
"0.57321626",
"0.57243824",
"0.5445246",
"0.5384102",
"0.53840834",
"0.53762144",
"0.5333027",
"0.5293774",
"0.5266759",
"0.5193273",
"0.51535153",
"0.5141306",
"0.51233315",
"0.5116255",
"0.50989485",
"0.50922614",
"0.50866276",
"0.5062... | 0.7457684 | 0 |
Tokenizes text, removing stopwords, lowercases, and removes punctuation | def tokenize(text):
text = text.translate(str.maketrans('', '', string.punctuation))
tokens = word_tokenize(text)
lemmatizer = WordNetLemmatizer()
clean_tokens = []
for tok in tokens:
clean_tok = lemmatizer.lemmatize(tok).lower().strip()
clean_tokens.append(clean_tok)
s = stopw... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def processText(text):\n\n no_punc = [word for word in text.split() if word.isalpha()] # and word not in stopwords.words('english')]\n #removes non-letter characters and only includes words not included in stopwords\n no_punc = \" \".join(no_punc) \n clean_words = nltk.word_tokenize(no_punc) #splits t... | [
"0.8290592",
"0.8255906",
"0.8034532",
"0.8015272",
"0.78982043",
"0.7875519",
"0.7875519",
"0.7805666",
"0.777934",
"0.77645767",
"0.7763247",
"0.7762879",
"0.77300817",
"0.7702453",
"0.7699918",
"0.7673935",
"0.76463276",
"0.7637563",
"0.7633818",
"0.7564662",
"0.75610834",... | 0.7832076 | 7 |
Handles main index page | def index():
graphs = [
message_genre_bar_chart(df),
category_bar_chart(df),
top_words_bar_chart(df)
]
# encode plotly graphs in JSON
ids = ["graph-{}".format(i) for i, _ in enumerate(graphs)]
graphJSON = json.dumps(graphs, cls=plotly.utils.PlotlyJSONEncoder)
# ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index(self):\n return render_template('main/index.html')",
"def index():\n return render_template(\n 'main/index.html',\n title='Main page'\n )",
"def index():\n return render_template('pages/index.html', isNav=True)",
"def index():\r\n return render_template('ind... | [
"0.7943412",
"0.79111314",
"0.7842225",
"0.78143936",
"0.7778844",
"0.7777737",
"0.7753939",
"0.77146935",
"0.7710479",
"0.7706429",
"0.7706429",
"0.76718855",
"0.76656437",
"0.76644415",
"0.76644415",
"0.76564443",
"0.7643881",
"0.7620972",
"0.7620972",
"0.7620972",
"0.75431... | 0.0 | -1 |
Returns the Storage Domain UUID using the provided disk object. Note that this assumes the disk only has one storage domain (i.e. in the case of a template with a disk copy or a vm created from such as template, the first instance will be returned which may either be the original disk or its copy) __author__ = "glazaro... | def get_sduuid(disk_object):
return disk_object.get_storage_domains().get_storage_domain()[0].get_id() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_voluuid(disk_object):\n return disk_object.get_image_id()",
"def get_uuid(disk):\n\n #TODO\n return \"Unknown\"",
"def get_imguuid(disk_object):\n return disk_object.get_id()",
"def get_disk_storage_domain_name(disk_name, vm_name=None, template_name=None):\n if vm_name and template_nam... | [
"0.73563534",
"0.72309357",
"0.70848477",
"0.69137985",
"0.6334011",
"0.61307776",
"0.60425466",
"0.596974",
"0.5889526",
"0.5888213",
"0.58662003",
"0.5797428",
"0.57831013",
"0.577453",
"0.5767729",
"0.5736031",
"0.56673014",
"0.56611335",
"0.5656751",
"0.5653856",
"0.56429... | 0.74159193 | 0 |
Returns the volUUID using the provided disk object __author__ = "glazarov" | def get_voluuid(disk_object):
return disk_object.get_image_id() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_uuid(disk):\n\n #TODO\n return \"Unknown\"",
"def get_imguuid(disk_object):\n return disk_object.get_id()",
"def get_id(disk):\n\n #TODO\n return \"Unknown\"",
"def get_name_by_uuid(disk_type, uuid, short=False):\n prefix = '%s_' % (disk_type[0] if short else disk_type)\n ... | [
"0.7387845",
"0.72865105",
"0.65337867",
"0.63221157",
"0.6223653",
"0.619652",
"0.61221236",
"0.6000279",
"0.5992914",
"0.59898216",
"0.59705704",
"0.59198904",
"0.5915715",
"0.59146315",
"0.5832495",
"0.5792462",
"0.57279605",
"0.5719388",
"0.5703042",
"0.5690544",
"0.56858... | 0.8490669 | 0 |
Invalid post must return status code 405. | def test_post(self):
self.assertEqual(
status.HTTP_405_METHOD_NOT_ALLOWED, self.response.status_code) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_post_not_allowed(self):\n res = self.client.post(ME_URL, {})\n\n self.assertEquals(res.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)",
"def test_post(self):\n response = self._post()\n self.assertEquals(response.status_code, 405)",
"def test_post_me_not_allowed(self):\n\... | [
"0.76892734",
"0.76467806",
"0.73506755",
"0.73391026",
"0.7333629",
"0.7269351",
"0.72559756",
"0.7248417",
"0.72394556",
"0.7210487",
"0.71943706",
"0.71537924",
"0.71537924",
"0.71218836",
"0.71118003",
"0.71081775",
"0.71050924",
"0.7064613",
"0.70360297",
"0.70315653",
"... | 0.79961324 | 0 |
Invalid post must return status code 405. | def test_post(self):
self.response = self.client.put(self.url, dict(name='São Paulo'))
self.assertEqual(
status.HTTP_405_METHOD_NOT_ALLOWED, self.response.status_code) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_post(self):\n self.assertEqual(\n status.HTTP_405_METHOD_NOT_ALLOWED, self.response.status_code)",
"def test_post_not_allowed(self):\n res = self.client.post(ME_URL, {})\n\n self.assertEquals(res.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)",
"def test_post(self):\n... | [
"0.79961324",
"0.76892734",
"0.76467806",
"0.73506755",
"0.73391026",
"0.7333629",
"0.7269351",
"0.72559756",
"0.7248417",
"0.72394556",
"0.7210487",
"0.71943706",
"0.71537924",
"0.71537924",
"0.71218836",
"0.71118003",
"0.71081775",
"0.71050924",
"0.7064613",
"0.70360297",
"... | 0.6830201 | 29 |
Invalid post must return status code 405. | def test_post(self):
self.response = self.client.delete(self.url)
self.assertEqual(
status.HTTP_405_METHOD_NOT_ALLOWED, self.response.status_code) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_post(self):\n self.assertEqual(\n status.HTTP_405_METHOD_NOT_ALLOWED, self.response.status_code)",
"def test_post_not_allowed(self):\n res = self.client.post(ME_URL, {})\n\n self.assertEquals(res.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)",
"def test_post(self):\n... | [
"0.79961324",
"0.76892734",
"0.76467806",
"0.73506755",
"0.73391026",
"0.7333629",
"0.7269351",
"0.72559756",
"0.7248417",
"0.72394556",
"0.7210487",
"0.71943706",
"0.71537924",
"0.71537924",
"0.71218836",
"0.71118003",
"0.71081775",
"0.7064613",
"0.70360297",
"0.70315653",
"... | 0.71050924 | 17 |
Get the bot's gateway latency. | async def ping(self, ctx : commands.Context) -> None:
embed = Embed(
title = "🏓 Pong!",
description = f"Gateway latency is {int(round(self.bot.latency * 1000, 2))}ms.",
color = maincolor
)
await ctx.send(embed = embed) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_latency(self):\n return self.latency",
"def latency(self) -> float:\n return float(\"nan\") if self.ws is None else self.ws.latency",
"def get_latency(self):\n raise NotImplementedError()",
"def get_propagation_time(self):\n return 0.0 # self.get_distance_to_gateway() / (3... | [
"0.7637588",
"0.72788775",
"0.71282333",
"0.6949799",
"0.68492514",
"0.661495",
"0.6399296",
"0.62728816",
"0.6232854",
"0.6197876",
"0.61647624",
"0.6157883",
"0.60625356",
"0.6047011",
"0.60044914",
"0.596016",
"0.596016",
"0.59399146",
"0.5919976",
"0.59117854",
"0.5873403... | 0.55605644 | 51 |
Will poll the x, y mag gauss values in order to establish min, max | def poll_mag_calibration(imu, mc, evt, verbose=True):
samples = 0
while not evt.is_set():
m = imu.mag_values()
samples += 1
x = m[lsm9ds1.XMAG_IND]
y = m[lsm9ds1.YMAG_IND]
if x < mc.xmin:
mc.xmin = x
if x > mc.xmax:
mc.xmax = x
if y... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def minmax ( self , nshoots = 100000 ) :\n ## try to get minmax directly from pdf/function \n if self.tricks and hasattr ( self.pdf , 'function' ) :\n if hasattr ( self.pdf , 'setPars' ) : self.pdf.setPars() \n f = self.pdf.function()\n if hasattr ( f , 'minmax' ) :\... | [
"0.661477",
"0.63510054",
"0.61018324",
"0.6000497",
"0.5934234",
"0.5933982",
"0.593039",
"0.59032494",
"0.59024364",
"0.585954",
"0.58481956",
"0.5834661",
"0.5805965",
"0.579995",
"0.5781945",
"0.5758812",
"0.57562363",
"0.57555723",
"0.5752557",
"0.5707881",
"0.5688473",
... | 0.5874589 | 9 |
Create a simple autoencoder model. Input is assumed to be an image | def create_model(input_shape):
h, w, c = input_shape
# %%%
inpt = tf.placeholder(tf.float32, (None,h,w,c), 'attributes')
inpt_flattenned = tf.contrib.layers.flatten(inpt) #tf.reshape(inpt, [-1, h*w*c])
H1 = tf.layers.dense(inpt_flattenned, units=200, activation=tf.sigmoid)
H2 = tf.layers.dense... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_full_conv_autoencoder():\n input_img = Input(shape=(84, 84, 3))\n\n x = Convolution2D(48, 8, 8, activation='relu', border_mode='same', name='c1')(input_img)\n x = MaxPooling2D((2, 2), border_mode='same')(x)\n x = Convolution2D(32, 4, 4, activation='relu', border_mode='same', name='c2')(x)\n ... | [
"0.7366315",
"0.7345976",
"0.7147522",
"0.7146389",
"0.70689833",
"0.70468843",
"0.6954387",
"0.69334674",
"0.6890163",
"0.68518096",
"0.6842528",
"0.6840599",
"0.66547394",
"0.6640439",
"0.6556569",
"0.6524608",
"0.6466948",
"0.6428764",
"0.64085937",
"0.6374725",
"0.6357629... | 0.0 | -1 |
Creates a suitable JWT auth token. | def authorization(self):
token = self.create_auth_token(
self.api_key.user, self.api_key.key, self.api_key.secret
)
return f'JWT {token}' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_auth_token():\n data = get_request_data(request)\n address = data.get(\"address\")\n expiration = int(data.get(\"expiration\"))\n\n pk = get_provider_private_key(use_universal_key=True)\n token = jwt.encode({\"exp\": expiration, \"address\": address}, pk, algorithm=\"HS256\")\n token =... | [
"0.8232185",
"0.8039812",
"0.7966597",
"0.773443",
"0.7657442",
"0.7628838",
"0.7576468",
"0.7575489",
"0.750647",
"0.7489256",
"0.7456178",
"0.7419456",
"0.7409646",
"0.73840845",
"0.73741823",
"0.73034567",
"0.7288875",
"0.7268425",
"0.72431004",
"0.72295964",
"0.72207654",... | 0.67362535 | 54 |
gets the result of decorated method. if the result is available in the cache, it will be get from there. otherwise the method will be called to produce result. | def __get__(self, instance, cls=None):
if cls is None:
cls = type(instance)
try:
return vars(cls)[self.__cache_name__]
except KeyError:
result = super().__get__(instance, cls)
setattr(cls, self.__cache_name__, result)
return result | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cache_result(f):\n @wraps(f)\n def wrapper(*args, **kwargs):\n assert len(args) == 0 and len(kwargs) == 0, \"Wrapped call must be empty\"\n if not hasattr(f, \"cached_result\"):\n f.cached_result = f()\n return f.cached_result\n return wrapper",
"def __call__(self, *a... | [
"0.7580007",
"0.75498784",
"0.75391227",
"0.7532074",
"0.7478096",
"0.73073906",
"0.72587883",
"0.7239201",
"0.70796925",
"0.70558953",
"0.7040115",
"0.70286435",
"0.6916056",
"0.691589",
"0.6898281",
"0.68918186",
"0.6881577",
"0.68727094",
"0.68319446",
"0.68067956",
"0.679... | 0.0 | -1 |
Given a question/exercise eid (String) and item_params (pd.DataFrame), return the concept that exercise corresponds to. Assumes eid is unique (maps to exactly 1 row) | def get_concept(eid, item_params):
concept = item_params[item_params[EID]==eid][CONCEPT]
if len(concept) < 1: # TODO: make this filter "!= 1" to be more strict
raise Exception("Exercise ID does not map to any exercises. eid: {}".format(eid))
else:
return concept.iloc[0]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filter_ordered_questions_by_concepts(questions, item_params, target_concept, concept_map): \n \n def get_parents(target, concept_map):\n \"\"\"\n Given a target concept, return a list of concept IDs for parent concepts\n \"\"\"\n parents = []\n target_index = concept_ma... | [
"0.6696086",
"0.6024824",
"0.59398514",
"0.5694827",
"0.5226326",
"0.5179715",
"0.51126415",
"0.5041601",
"0.4964912",
"0.48357213",
"0.46896613",
"0.4650214",
"0.46460772",
"0.46365854",
"0.46355215",
"0.4617294",
"0.4564755",
"0.4562624",
"0.45532185",
"0.45182484",
"0.4510... | 0.81109214 | 0 |
Simple function that loads bootstrap datasets (or whatever CSVs are in the specified directory). | def loadBootstrapData(dirName):
import glob
bsSetNames = glob.glob(dirName + "*.csv")
bsSets = []
# Load each bootstrap dataset's CSV
for bsn in bsSetNames:
bsSets.append(np.loadtxt(bsn, dtype="float"))
return bsSets | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load(name):\n if name in datasets:\n\n return pd.read_csv(os.path.join(datasets_path, \"%s.csv\" % name))\n else:\n raise ValueError(\"Dataset not found!\")",
"def load_datasets(inputdir):\n\n datasets = {}\n files = os.listdir(inputdir)\n\n for f in [f for f in files if f.endswi... | [
"0.6783151",
"0.6479632",
"0.64117914",
"0.630537",
"0.62995106",
"0.628098",
"0.62095726",
"0.6195598",
"0.61934537",
"0.6177197",
"0.61702424",
"0.6167318",
"0.6142415",
"0.6055728",
"0.6050631",
"0.60454214",
"0.60345644",
"0.6005527",
"0.5985536",
"0.59700507",
"0.5967849... | 0.796489 | 0 |
Return True/False if a schema (as a namespace string) is registered in DDE or not | def is_a_dde_schema(self, schema):
return schema in self.registered_dde_schemas | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_a_dde_schema(schema):\n return schema in registered_dde_schemas()",
"def _namespace_requested(self, namespace):\r\n if namespace is None:\r\n return False\r\n namespace_tuple = self._tuplefy_namespace(namespace)\r\n if namespace_tuple[0] in IGNORE_DBS:\r\n ret... | [
"0.76115173",
"0.6830498",
"0.6607439",
"0.6542236",
"0.63748866",
"0.6354594",
"0.6266387",
"0.61725825",
"0.6128686",
"0.603084",
"0.59839654",
"0.5958249",
"0.5933745",
"0.58731425",
"0.5863188",
"0.5824913",
"0.578404",
"0.57788366",
"0.5774494",
"0.5752633",
"0.571495",
... | 0.74424386 | 1 |
A class to hold the market information. | def __init__(self, market_info=[]):
self.lenders = []
for lender in market_info:
self.add_lender(lender) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getMarket(self):\n return self.market",
"def market(self):\n return self._market",
"def get_market_data(self) -> dict:\n return MarketData(asks=self.get_orders_by_action(OrderAction.SELL, self.deep.ask_count),\n bids=self.get_orders_by_action(OrderAction.BUY, s... | [
"0.75025994",
"0.73778915",
"0.710272",
"0.69156057",
"0.6788774",
"0.6746094",
"0.6549505",
"0.65111476",
"0.6488159",
"0.63414216",
"0.62947255",
"0.6255579",
"0.62295866",
"0.62273836",
"0.6179068",
"0.6145374",
"0.6132413",
"0.6132358",
"0.611326",
"0.60995996",
"0.607830... | 0.59832466 | 26 |
Plot the time series of SPX and VIX, and the scatter of their returns. | def SPXVIXPlot(self, startDate, endDate):
startDate = pd.Timestamp(startDate)
endDate = pd.Timestamp(endDate)
SPXIndex = (startDate < self.SPXHist.index) & (self.SPXHist.index < endDate)
VIXIndex = (startDate < self.VIXHist.index) & (self.VIXHist.index < endDate)
SPXVIXHist = pd.DataFrame({
'SPX': self.SPX... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_returns(self):\n strategy = self.equity_curve['equity_curve']\n benchmark, index = benchmark_return()\n fig, ax = plt.subplots()\n ax.plot(strategy.index.astype('datetime64'), strategy, label='strategy')\n ax.plot(benchmark.index.astype('datetime64'), benchmark, label=in... | [
"0.6401503",
"0.63736945",
"0.6272212",
"0.6260515",
"0.6243623",
"0.6126384",
"0.6110866",
"0.6084276",
"0.5968593",
"0.5962413",
"0.5905071",
"0.5894783",
"0.58778226",
"0.5856259",
"0.584552",
"0.58450377",
"0.5821614",
"0.5821173",
"0.5816314",
"0.5800598",
"0.578193",
... | 0.74145865 | 0 |
Returns bool whether item is in the tree. | def __contains__(self, item):
_, active, _ = self._find(item)
return active | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __contains__(self, item):\n if item in self._parents:\n return True\n else:\n return False",
"def __contains__(self, item):\n cur_node = self.head\n while cur_node is not None:\n if item in cur_node.data_list:\n return True\n ... | [
"0.78815967",
"0.7708244",
"0.77072114",
"0.743262",
"0.7379843",
"0.7379843",
"0.7184792",
"0.7143057",
"0.7103527",
"0.70937634",
"0.703049",
"0.6990592",
"0.6990592",
"0.6968399",
"0.69547397",
"0.69307894",
"0.6927775",
"0.6908653",
"0.6907604",
"0.6903288",
"0.6895992",
... | 0.6422395 | 62 |
Set programs separator to the given one. The parameter separator is used as new separator. | def set_separator(self, separator):
self._separator = separator | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetToolSeparation(self, separation):\r\n\r\n if self._art:\r\n self._art.SetElementSize(AUI_TBART_SEPARATOR_SIZE, separation)",
"def setDeviceInstanceSeparator(string: str) -> None:\n ...",
"def set_tag_separator(self, tag_separator):\n\n self._tag_separator = tag_separator",
... | [
"0.5973402",
"0.5964753",
"0.59480643",
"0.5712478",
"0.5471005",
"0.5454614",
"0.54486",
"0.5364358",
"0.5363095",
"0.5335822",
"0.53343725",
"0.5326136",
"0.5324486",
"0.52646875",
"0.5174469",
"0.51346594",
"0.50916135",
"0.5085028",
"0.50822365",
"0.50640804",
"0.50497824... | 0.7785443 | 0 |
Validate that the supplied email address is unique for the site. | def clean_email(self):
if User.objects.filter(email__iexact=self.cleaned_data['email']):
raise forms.ValidationError('This email address is already in use. Please supply a different email address.')
return self.cleaned_data['email'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_unique_email(email):\n if AssociatedEmail.objects.filter(email=email.lower(), is_primary_email=False):\n raise ValidationError(_(\"User with this email already exists.\"),\n code='email_not_unique',)\n if User.objects.filter(email=email.lower()):\n rais... | [
"0.7850552",
"0.7653591",
"0.7513791",
"0.7477482",
"0.73830235",
"0.73824567",
"0.73718166",
"0.73532605",
"0.72806543",
"0.72500783",
"0.7244289",
"0.723793",
"0.7192608",
"0.7190643",
"0.7180509",
"0.7163987",
"0.7153324",
"0.7149325",
"0.7125592",
"0.7125592",
"0.7105308"... | 0.712506 | 20 |
Verifiy that the values entered into the two password fields match. Note that an error here will end up in ``non_field_errors()`` because it doesn't apply to a single field. | def clean_password2(self):
if 'password1' in self.cleaned_data and 'password2' in self.cleaned_data:
if self.cleaned_data['password1'] and self.cleaned_data['password2']:
if self.cleaned_data['password1'] != self.cleaned_data['password2']:
raise forms.ValidationEr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean_password(self):\n password1 = self.cleaned_data.get('password1')\n password2 = self.cleaned_data.get('password2')\n if password1 and password2 and password1 != password2:\n raise forms.ValidationError('Passwords do not match')\n return password2",
"def clean(self)... | [
"0.79393995",
"0.78751373",
"0.7869208",
"0.7840083",
"0.7840083",
"0.7735661",
"0.7653578",
"0.76377136",
"0.76262844",
"0.7619865",
"0.76103294",
"0.75963074",
"0.7565969",
"0.75650203",
"0.75650203",
"0.756335",
"0.7547981",
"0.7527759",
"0.74647665",
"0.7378254",
"0.73761... | 0.7589395 | 12 |
Verifiy that the values entered into the two password fields match. Note that an error here will end up in ``non_field_errors()`` because it doesn't apply to a single field. | def clean(self):
if 'password1' in self.cleaned_data and 'password2' in self.cleaned_data:
if self.cleaned_data['password1'] and self.cleaned_data['password2']:
if self.cleaned_data['password1'] != self.cleaned_data['password2']:
raise forms.ValidationError('The t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean_password(self):\n password1 = self.cleaned_data.get('password1')\n password2 = self.cleaned_data.get('password2')\n if password1 and password2 and password1 != password2:\n raise forms.ValidationError('Passwords do not match')\n return password2",
"def clean(self)... | [
"0.7940046",
"0.7875402",
"0.7840341",
"0.7840341",
"0.77356493",
"0.76539767",
"0.7638036",
"0.7627391",
"0.7621562",
"0.76109874",
"0.75973123",
"0.7589881",
"0.7567204",
"0.7565528",
"0.7565528",
"0.756384",
"0.7548058",
"0.7528326",
"0.74655294",
"0.73782325",
"0.7376119"... | 0.78696346 | 2 |
Verifiy that the values entered into the two password fields match. Note that an error here will end up in ``non_field_errors()`` because it doesn't apply to a single field. | def clean_password_repeat(self):
if 'password' in self.cleaned_data and 'password_repeat' in self.cleaned_data:
if self.cleaned_data['password'] != self.cleaned_data['password_repeat']:
raise forms.ValidationError('The password fields didn\'t match: Password confirmation failed.')
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean_password(self):\n password1 = self.cleaned_data.get('password1')\n password2 = self.cleaned_data.get('password2')\n if password1 and password2 and password1 != password2:\n raise forms.ValidationError('Passwords do not match')\n return password2",
"def clean(self)... | [
"0.79393995",
"0.78751373",
"0.7869208",
"0.7840083",
"0.7840083",
"0.7735661",
"0.7653578",
"0.76377136",
"0.76262844",
"0.7619865",
"0.76103294",
"0.75963074",
"0.7589395",
"0.7565969",
"0.75650203",
"0.75650203",
"0.756335",
"0.7547981",
"0.7527759",
"0.74647665",
"0.73782... | 0.68792015 | 47 |
Verifiy that the values entered into the two password fields match. Note that an error here will end up in ``non_field_errors()`` because it doesn't apply to a single field. | def clean(self):
if 'password' in self.cleaned_data and 'password_repeat' in self.cleaned_data:
if self.cleaned_data['password'] != self.cleaned_data['password_repeat']:
raise forms.ValidationError('The two password fields didn\'t match.')
return self.cleaned_data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean_password(self):\n password1 = self.cleaned_data.get('password1')\n password2 = self.cleaned_data.get('password2')\n if password1 and password2 and password1 != password2:\n raise forms.ValidationError('Passwords do not match')\n return password2",
"def clean(self)... | [
"0.7940046",
"0.7875402",
"0.78696346",
"0.7840341",
"0.7840341",
"0.77356493",
"0.7638036",
"0.7627391",
"0.7621562",
"0.76109874",
"0.75973123",
"0.7589881",
"0.7567204",
"0.7565528",
"0.7565528",
"0.756384",
"0.7548058",
"0.7528326",
"0.74655294",
"0.73782325",
"0.7376119"... | 0.76539767 | 6 |
Sets the reject_microversion_skew of this PartStudiosEvalFeatureScriptBody. | def reject_microversion_skew(self, reject_microversion_skew):
self._reject_microversion_skew = reject_microversion_skew | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def disable_blockchain_proof(self, disable_blockchain_proof):\n\n self._disable_blockchain_proof = disable_blockchain_proof",
"def __init__(self, reject_microversion_skew=None, queries=None, serialization_version=None, source_microversion=None, script=None): # noqa: E501 # noqa: E501\n\n self._re... | [
"0.4690038",
"0.46852812",
"0.44892028",
"0.43486053",
"0.43444526",
"0.43218043",
"0.42818224",
"0.42693576",
"0.42570937",
"0.4250245",
"0.4250245",
"0.4250245",
"0.42217347",
"0.41276613",
"0.40998113",
"0.40583083",
"0.40437734",
"0.39891952",
"0.39567837",
"0.3917212",
"... | 0.8184326 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, PartStudiosEvalFeatureScriptBody):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748"
] | 0.0 | -1 |
Initialize the layer. Most of args are the same as tf.keras.layers.DepthwiseConv2D except it has an extra parameter "dilated" to indicate whether to use dilated conv to simulate large kernel_size size. If dilated=True, then dilation_rate is ignored. | def __init__(self, kernel_size, strides, dilated=False, **kwargs):
self._channel_axis = -1
self._dilated = dilated
self.kernels = kernel_size
self._conv_kwargs = {
'strides': strides,
'dilation_rate': kwargs.get('dilation_rate', (1, 1)),
'kernel_initi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _DepthwiseConv2D(self, name, filter_size, is_causal=False, qdomain=None):\n p = self.params\n conv_builder_params = conv_layers.Builder.Params()\n if p.norm_layer_tpl:\n conv_builder_params.norm_layer_tpl = p.norm_layer_tpl\n conv_builder = conv_builder_params.Instantiate()\n return conv_bu... | [
"0.6731891",
"0.6720038",
"0.6454271",
"0.6363813",
"0.6349132",
"0.6330251",
"0.6320493",
"0.6307017",
"0.6293599",
"0.62793976",
"0.62707204",
"0.6258856",
"0.62497294",
"0.6245011",
"0.61872303",
"0.6172221",
"0.6160311",
"0.61351246",
"0.6120835",
"0.60745156",
"0.6053211... | 0.6737982 | 0 |
Render the one page web app that's made w/ React | def root():
return render_template('root.html') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def renderPage():\n return render_template(\"index.html\")",
"def main_page():\n return render_template(\"index.html\")",
"def main():\n return render_template('index.html')",
"def main():\n return render_template('index.html')",
"def react():\n\n page = get_page_arg()\n\n items = load_data... | [
"0.71893144",
"0.70609593",
"0.6975321",
"0.6975321",
"0.6859785",
"0.67869157",
"0.6771258",
"0.67712045",
"0.67701375",
"0.67414296",
"0.673518",
"0.673518",
"0.6709388",
"0.6695443",
"0.6689611",
"0.6689611",
"0.6681669",
"0.6669215",
"0.6669215",
"0.6669215",
"0.6669215",... | 0.0 | -1 |
Unfortunately, isinstance(b_obj, Blender.Object.Object) does not work because the Object class is not exposed in the API. This method provides an alternative check. | def isinstance_blender_object(self, b_obj):
# lame and slow, but functional
return b_obj in Blender.Object.Get() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_object(obj):\n return (isinstance(obj, object) and\n type(obj) is not type and\n type(obj) is not types.FunctionType)",
"def verify_type(self, obj):\n return isinstance(obj, self.type_)",
"def is_object(space, w_obj):\n return space.wrap(space.is_object(w_obj))",
"de... | [
"0.73396015",
"0.72421074",
"0.7241538",
"0.70942605",
"0.6947016",
"0.6764485",
"0.67224467",
"0.6674045",
"0.6669795",
"0.6659099",
"0.6635752",
"0.66172034",
"0.6611103",
"0.6611103",
"0.6577691",
"0.6573875",
"0.656967",
"0.65637356",
"0.6563705",
"0.655426",
"0.65446913"... | 0.8872142 | 0 |
Yield successive nsized chunks from l. | def chunks(l, n):
for i in range(0, len(l), n):
yield l[i:i + n] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]",
"def chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]",
"def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]",
"def get_chunks(self, ... | [
"0.8037606",
"0.7922978",
"0.79210585",
"0.78825927",
"0.78753805",
"0.7813621",
"0.7763579",
"0.77534133",
"0.7742161",
"0.7729807",
"0.7726926",
"0.7723026",
"0.77007324",
"0.7687473",
"0.7687473",
"0.7662126",
"0.76550704",
"0.76538754",
"0.76538754",
"0.76439047",
"0.7643... | 0.7446901 | 65 |
Yield successive nsized chunks from l. | def chunks(l, n):
for i in range(0, len(l), n):
yield l[i:i + n] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]",
"def chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]",
"def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]",
"def get_chunks(self, ... | [
"0.8038813",
"0.79248375",
"0.7923423",
"0.7885103",
"0.78773195",
"0.7815877",
"0.77655786",
"0.77556044",
"0.77441615",
"0.7731815",
"0.77288336",
"0.772473",
"0.77028215",
"0.76889825",
"0.76889825",
"0.7664208",
"0.76570904",
"0.7655856",
"0.7655856",
"0.76458347",
"0.764... | 0.7448925 | 73 |
Clear db after a test | def tearDown(self):
db.session.remove()
db.drop_all() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tearDown(self):\r\n empty_db()",
"def tearDown(self):\r\n empty_db()",
"def tearDown(self):\r\n empty_db()",
"def tearDown(self):\r\n empty_db()",
"def tearDown(self):\r\n empty_db()",
"def tearDown(self):\r\n empty_db()",
"def clear_db():\n from example... | [
"0.86167634",
"0.86167634",
"0.86167634",
"0.86167634",
"0.86167634",
"0.86167634",
"0.8445946",
"0.8431777",
"0.8431777",
"0.8431777",
"0.8431777",
"0.8431777",
"0.8431777",
"0.8431777",
"0.8431777",
"0.8431777",
"0.83074045",
"0.8291444",
"0.8247634",
"0.8247634",
"0.820997... | 0.78193814 | 47 |
Clear db after a test | def tearDown(self):
db.session.remove()
db.drop_all() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tearDown(self):\r\n empty_db()",
"def tearDown(self):\r\n empty_db()",
"def tearDown(self):\r\n empty_db()",
"def tearDown(self):\r\n empty_db()",
"def tearDown(self):\r\n empty_db()",
"def tearDown(self):\r\n empty_db()",
"def clear_db():\n from example... | [
"0.86167634",
"0.86167634",
"0.86167634",
"0.86167634",
"0.86167634",
"0.86167634",
"0.8445946",
"0.8431777",
"0.8431777",
"0.8431777",
"0.8431777",
"0.8431777",
"0.8431777",
"0.8431777",
"0.8431777",
"0.8431777",
"0.83074045",
"0.8291444",
"0.8247634",
"0.8247634",
"0.820997... | 0.78193814 | 46 |
Initialize a ``CSVSerializer`` instance. | def __init__(self, content_type="text/csv"):
super(CSVSerializer, self).__init__(content_type=content_type) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, csv_file: str = None) -> None:\n super().__init__(csv_file)",
"def __init__(self, csv_file: str = None) -> None:\n super().__init__(csv_file)",
"def from_csv(cls, load_folder: Path) -> \"Parameters\":\n serializer = serializer_factory(fmt=SerializerEnum.CSV)\n ret... | [
"0.6366961",
"0.6366961",
"0.62145233",
"0.6189613",
"0.61792874",
"0.6119288",
"0.5820543",
"0.5816932",
"0.5659769",
"0.56077",
"0.5509766",
"0.5501838",
"0.5480202",
"0.5477529",
"0.547706",
"0.5475553",
"0.5470684",
"0.5448116",
"0.5404589",
"0.5372239",
"0.53636605",
"... | 0.6582983 | 0 |
Initialize a ``NumpySerializer`` instance. | def __init__(self, dtype=None, content_type="application/x-npy"):
super(NumpySerializer, self).__init__(content_type=content_type)
self.dtype = dtype | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deserialize_numpy(self, str, numpy):\n try:\n end = 0\n return self\n except struct.error as e:\n raise genpy.DeserializationError(e) #most likely buffer underfill",
"def deserialize_numpy(self, str, numpy):\n try:\n end = 0\n return self\n except struct.error as e:\n ... | [
"0.57969266",
"0.57969266",
"0.57969266",
"0.5790602",
"0.5754285",
"0.573142",
"0.5729467",
"0.57164",
"0.56844336",
"0.56404716",
"0.55973166",
"0.5580818",
"0.55704725",
"0.55558115",
"0.5514169",
"0.551416",
"0.5510062",
"0.5509803",
"0.5506396",
"0.55050737",
"0.54853415... | 0.75647634 | 0 |
Saves a NumPy array in a buffer. | def _serialize_array(self, array):
buffer = io.BytesIO()
np.save(buffer, array)
return buffer.getvalue() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def serialize_numpy(self, buff, numpy):\n try:\n _x = self\n buff.write(_get_struct_2i16dih().pack(_x.Timestamp_sec, _x.Timestamp_nsec, _x.Roll, _x.Pitch, _x.Yaw, _x.Wx, _x.Wy, _x.Wz, _x.AcelX, _x.AcelY, _x.AcelZ, _x.VelN, _x.VelE, _x.VelZ, _x.GPSLong, _x.GPSLat, _x.GPSAlt, _x.Temp, _x.IMUTime, _x.BIT... | [
"0.7249475",
"0.71799356",
"0.71462744",
"0.7142661",
"0.7116743",
"0.70868844",
"0.7066253",
"0.70610934",
"0.705624",
"0.7016406",
"0.7007785",
"0.6995079",
"0.6993546",
"0.69921464",
"0.69908214",
"0.6987858",
"0.697563",
"0.6953944",
"0.69223636",
"0.69114786",
"0.6894001... | 0.6995278 | 11 |
Initialize a ``JSONLinesSerializer`` instance. | def __init__(self, content_type="application/jsonlines"):
super(JSONLinesSerializer, self).__init__(content_type=content_type) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __json_init__(cls, **kwargs):\n return cls(**kwargs)",
"def initialize_serializer(self):\n serializer = self.pyleus_config.get('serializer')\n if serializer in SERIALIZERS:\n self._serializer = SERIALIZERS[serializer](\n self._input_stream, self._output_stream)\... | [
"0.64914906",
"0.6139526",
"0.6078591",
"0.5934656",
"0.5768948",
"0.56652415",
"0.5659624",
"0.55867124",
"0.5497619",
"0.53909266",
"0.53544825",
"0.53296036",
"0.52987075",
"0.5286695",
"0.5258065",
"0.52218354",
"0.52063346",
"0.51689655",
"0.5137563",
"0.5134463",
"0.512... | 0.76762986 | 0 |
Initialize a ``SparseMatrixSerializer`` instance. | def __init__(self, content_type="application/x-npz"):
super(SparseMatrixSerializer, self).__init__(content_type=content_type) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, rows, cols, bandwidth=0, sizeHint=None, matrix=None, storeZeros=True):\n sizeHint = sizeHint or max(rows, cols) * bandwidth\n if matrix is None:\n tmpMatrix = spmatrix.ll_mat(1, 1, 1)\n if hasattr(tmpMatrix, 'storeZeros'):\n matrix = spmatrix.ll... | [
"0.6597044",
"0.6334628",
"0.626398",
"0.6226039",
"0.6107381",
"0.6010016",
"0.5967334",
"0.5933073",
"0.58710015",
"0.5814555",
"0.5766136",
"0.5724216",
"0.5719806",
"0.57074803",
"0.5684424",
"0.56245625",
"0.56199634",
"0.56091565",
"0.56077117",
"0.5569531",
"0.55589354... | 0.6894269 | 0 |
Serialize a sparse matrix to a buffer using the .npz format. Sparse matrices can be in the ``csc``, ``csr``, ``bsr``, ``dia`` or ``coo`` formats. | def serialize(self, data):
buffer = io.BytesIO()
scipy.sparse.save_npz(buffer, data)
return buffer.getvalue() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _serialize_matrix(matrix):\n\n f = BytesIO()\n spsp.save_npz(f, matrix)\n result = f.getvalue().hex()\n return result",
"def j_sparse_vector_wrapper_to_scipy_spmatrix(j_obj: JavaObject):\n indices = np.frombuffer(j_obj.getIndicesBytes(), dtype=\"<i4\")\n values = np.... | [
"0.66604185",
"0.66034603",
"0.65096223",
"0.64803946",
"0.6232652",
"0.6231011",
"0.61950845",
"0.6067587",
"0.6034447",
"0.60299534",
"0.60273796",
"0.59657145",
"0.59219104",
"0.590105",
"0.5857091",
"0.5841524",
"0.5809503",
"0.5802568",
"0.5753788",
"0.5740184",
"0.57370... | 0.6831719 | 0 |
Initialize a ``DataSerializer`` instance. | def __init__(self, content_type="file-path/raw-bytes"):
super(DataSerializer, self).__init__(content_type=content_type) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_data(cls, data):\n # Validation\n if data.get(\"_Serializable_classname\") != cls.__name__:\n return None\n del data[\"_Serializable_classname\"]\n if data.get(\"_Serializable_version\") is not None:\n del data[\"_Serializable_version\"]\n\n this = ... | [
"0.69924796",
"0.6602728",
"0.65690506",
"0.6486016",
"0.64502925",
"0.6392547",
"0.6315833",
"0.61909044",
"0.6148438",
"0.6132114",
"0.6132114",
"0.6132114",
"0.6132114",
"0.6100955",
"0.60997754",
"0.6094915",
"0.6093771",
"0.6091694",
"0.60819024",
"0.6077195",
"0.6073425... | 0.6098145 | 15 |
Create the main application window and store a reference to it in a public property so that plugins can access it. | def _create_window(self):
self.window = Gtk.Window()
self.window.set_title("Yapsy Example")
self.window.set_default_size(400, 400)
self.window.connect("destroy", lambda w: Gtk.main_quit())
# PluginList() is a composite widget that shows all installed plugins
# in a Gtk.Tr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_main_window():\n main_win = MainWindow()\n main_windows.append(main_win)\n available_geometry = app.desktop().availableGeometry(main_win)\n main_win.resize(available_geometry.width() * 2 / 3,\n available_geometry.height() * 2 / 3)\n main_win.show()\n return main_win"... | [
"0.78959805",
"0.78500044",
"0.78331316",
"0.77441025",
"0.77441025",
"0.77441025",
"0.7665478",
"0.76466966",
"0.7604524",
"0.75060964",
"0.74977785",
"0.7433326",
"0.74006784",
"0.7330276",
"0.7312154",
"0.7200506",
"0.7186199",
"0.71520895",
"0.71520895",
"0.715173",
"0.71... | 0.6865913 | 27 |
To split the string into n word sentences | def limiting_sentence_length(input_text):
# To all the sentences into a list of words
training_words = []
# To store the training data as a list of 15 words
training_data_as_list = []
# Helper data structure
sample = []
for line in input_text:
line = line.split(" ")
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split(text):\n doc = nlp(text)\n sentences = [x.text_with_ws for x in doc.sents]\n return sentences",
"def split_into_sentences(s):\n s = re.sub(r\"\\s+\", \" \", s)\n s = re.sub(r\"[\\\\.\\\\?\\\\!]\", \"\\n\", s)\n return s.split(\"\\n\")",
"def split_into_sentences(s):\n s = re.... | [
"0.73200214",
"0.710987",
"0.710987",
"0.70877576",
"0.70214504",
"0.69115317",
"0.690946",
"0.6886092",
"0.6872956",
"0.6756728",
"0.67224",
"0.67224",
"0.67152095",
"0.66873205",
"0.66565806",
"0.6645246",
"0.66346675",
"0.663153",
"0.6621033",
"0.66206986",
"0.6619343",
... | 0.61737645 | 53 |
Serve a blank index.html page. | def on_get(self, req, resp, account, container):
with open('index.html') as fp:
resp.body = fp.read()
resp.content_type = 'text/html; charset=utf-8'
resp.status = falcon.HTTP_200 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index():\n return app.send_static_file(\"index.html\")",
"def index():\n return app.send_static_file('index.html')",
"def index(self):\n single = os.path.join(\n os.path.dirname(os.path.abspath(__file__)),\n 'index.html')\n return serve_file(single)",
"def index(... | [
"0.7773399",
"0.7744473",
"0.7690502",
"0.76757497",
"0.75892",
"0.7565354",
"0.7503155",
"0.73472583",
"0.7272371",
"0.725996",
"0.725996",
"0.7257987",
"0.7257987",
"0.7257987",
"0.7257987",
"0.7257987",
"0.7257987",
"0.7257987",
"0.7257987",
"0.7257987",
"0.7257987",
"0.... | 0.0 | -1 |
Given an array of ticks, converts vector values to strings, returning a list of 8 measure "sentence" concatenations. | def _ticks_to_sentences(ticks):
sentences = []
for seq in ticks:
sentence = []
for i in range(seq.shape[0]):
word = ''.join([str(x) for x in seq[i, :]])
sentence.append(word)
sentences.append(sentence)
return sentences | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tickStrings(\n values: Union[list, np.ndarray],\n scale: float = 1,\n spacing: Union[float, None] = None,\n tickPlacesAdd: int = 1,\n floatAdd: int = None,\n) -> list:\n # print ('tickplacesadd: ', tickPlacesAdd)\n\n if spacing is None:\n spacing = np.mean(np.diff(values))\n p... | [
"0.61883944",
"0.612657",
"0.61088234",
"0.6060614",
"0.6007161",
"0.57724977",
"0.5751414",
"0.5738252",
"0.57076925",
"0.57076925",
"0.57076925",
"0.56764126",
"0.56552166",
"0.56350344",
"0.5582748",
"0.55496114",
"0.5528298",
"0.5520876",
"0.5515736",
"0.55100536",
"0.549... | 0.7608239 | 0 |
Take a tree and compute its minimal subtree. All singletons are removed and the highest branching node is used as the new root. | def minimal_subtree(tree):
tree_copy = tree.copy()
for n in tree_copy.traverse():
if len(n.children) == 1:
n.delete()
new_root = tree_copy
while len(new_root.children) == 1:
new_root = new_root.children[0]
new_tree = new_root.detach()
return new_tree | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def minimal_tree(array: list):\n bst = BST()\n def build(l, r):\n if l == r: bst.insert(array[l]); return\n m = (l+r)//2\n # insert into the tree\n bst.insert(array[m])\n # build recursively\n build(l, m)\n build(m+1, r)\n build(0, len(array)-1)\n return... | [
"0.75560725",
"0.70830125",
"0.6968187",
"0.6887279",
"0.666889",
"0.66059935",
"0.65901893",
"0.644482",
"0.630798",
"0.61954314",
"0.61732197",
"0.6165037",
"0.61384404",
"0.61059755",
"0.6074304",
"0.6061891",
"0.60307187",
"0.6029223",
"0.60097814",
"0.60014284",
"0.59889... | 0.76969343 | 0 |
Checks if there is food at the current position | def checkforfood(curpos):
if DARK and not HAS_FLASHLIGHT:
printmessage("But you can't see a thing!", 5, MAGENTA, 2) # was 2
return
if FOOD_LIST[curpos] != 6:
printmessage("You found some %s here." % FOODTYPES[FOOD_LIST[curpos]], 5, MAGENTA, 0) # was 2
addnourishment(FOOD_LIST[cu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def checkFood(self, food):\n pass",
"def has_found_food(self):\r\n\r\n self.has_been_checked = True\r\n if self.identified_food is not None:\r\n return True\r\n else:\r\n return False",
"def checkforitems(curpos):\n if DARK and not HAS_FLASHLIGHT:\n p... | [
"0.75033605",
"0.7066022",
"0.67568284",
"0.67145896",
"0.6695587",
"0.6615866",
"0.6454997",
"0.6409303",
"0.6407111",
"0.6297591",
"0.6236832",
"0.62013453",
"0.61965805",
"0.61525005",
"0.61303025",
"0.60731",
"0.6060832",
"0.60239744",
"0.6013842",
"0.6003301",
"0.5993628... | 0.7693301 | 0 |
Book a recurring ride, then open the Details modal from its kebab menu. | def test_kebab_menu__open_details_modal(
self, recurring_ride_factory: Factory, service_with_recurring_rides: fixture,
) -> None:
ride: dict = recurring_ride_factory.create(service=service_with_recurring_rides)
self.rides.visit()
self.rides.sidebar.select_tab('Active')
row:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_details_modal__booked_rides_feature_details_link(\n self, recurring_ride_factory: Factory, service_with_recurring_rides: fixture,\n ) -> None:\n ride: dict = recurring_ride_factory.create(service=service_with_recurring_rides)\n\n self.rides.visit()\n\n self.rides.sidebar.sel... | [
"0.7069024",
"0.63961375",
"0.6151383",
"0.59754086",
"0.5784133",
"0.56462497",
"0.55578953",
"0.550107",
"0.54904264",
"0.5448133",
"0.539698",
"0.5392305",
"0.52704585",
"0.5264599",
"0.52595615",
"0.5244145",
"0.52424324",
"0.52294546",
"0.52186674",
"0.52186674",
"0.5218... | 0.62200546 | 2 |
Book a recurring ride, then verify its row matches ride data. | def test_ride_rows__row_features_ride_data(
self, recurring_ride_factory: Factory, service_with_recurring_rides: fixture,
) -> None:
ride: dict = recurring_ride_factory.create(service=service_with_recurring_rides)
self.rides.visit()
self.rides.sidebar.select_tab('Active')
r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_build__subsequent_calls_return_new_recurring_ride(self) -> None:\n ride_one: dict = RecurringRideFactory.build()\n ride_two: dict = RecurringRideFactory.build()\n\n assert ride_one != ride_two",
"def test_get_ride_if_exists_success(self):\n ride = {\n \"Destination... | [
"0.6052928",
"0.59886175",
"0.58513963",
"0.5814232",
"0.5716031",
"0.563403",
"0.56070113",
"0.55988985",
"0.5555548",
"0.5548603",
"0.55107796",
"0.54944783",
"0.5484683",
"0.5472799",
"0.54727167",
"0.543799",
"0.52897185",
"0.5283116",
"0.5281814",
"0.52746344",
"0.524541... | 0.57368386 | 4 |
Generate a timestamp from an internally stored date | def ts(self, which='now'):
if which == 'now':
return '%d%02d%02dT%02d%02d%02d' % self.date['now'][0:6]
else:
return '%05dT%02d%02d%02d' % (self.date['cc'][0], self.date['cc'][1], self.date['cc'][2], self.date['cc'][3]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _make_timestamp(self):\r\n\t\tlogger.debug(\"Get a timestamp\")\r\n\t\treturn time.mktime(datetime.today().timetuple())",
"def date_to_timestamp(date):\n return int(calendar.timegm(date.utctimetuple()))",
"def _generate_timestamp():\n\t\treturn strftime(\"%Y%m%dT%H%M%S\")",
"def _create_timestamp():\n... | [
"0.7691236",
"0.74230194",
"0.7347406",
"0.72382975",
"0.7054955",
"0.6973227",
"0.6924891",
"0.6919637",
"0.69107956",
"0.6908437",
"0.68982786",
"0.68794435",
"0.6824864",
"0.68110085",
"0.67792845",
"0.6775175",
"0.6730319",
"0.67250603",
"0.6703093",
"0.66942525",
"0.6640... | 0.0 | -1 |
Roughly estimate x0 for degradation data. | def guestimate_init_cond(x_data):
x0 = np.clip(np.max(x_data, 1), 1e-4, np.inf)
return x0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def zero_grad(x):\n return zero_grad_(x)",
"def grad_zero(self):\r\n pass",
"def grad_zero(self):\r\n pass",
"def estimate_no_grad(x, n0, *args):\n global call_count\n n = n0 + int(n_step * call_count)\n val, der = estimate(x, n, *args)\n call_count += 1\n return val",
"def ... | [
"0.64994234",
"0.64387083",
"0.64387083",
"0.6413356",
"0.6349449",
"0.628782",
"0.6227499",
"0.62132484",
"0.6113905",
"0.6106147",
"0.6102789",
"0.60778147",
"0.60687083",
"0.60299206",
"0.60021824",
"0.5983242",
"0.5939284",
"0.5876102",
"0.582885",
"0.582885",
"0.5810633"... | 0.5993099 | 15 |
Returns range (m), squared and converted to km. | def _get_range_squared(self) -> np.ndarray:
m2km = 0.001
return (self.range * m2km) ** 2 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def km2m(km):\n return km * 1000",
"def miles_to_kilometers(miles):\n #convert miles to km:\n return miles*1.60934",
"def kilometers_to_miles(km):\n #convert km to miles:\n return km*0.621371",
"def getRangeMM(self) -> float:\n ...",
"def mi_to_m(radius):\n return int(float(radius)... | [
"0.7106193",
"0.6711392",
"0.66035193",
"0.65372247",
"0.6487289",
"0.64564365",
"0.63763756",
"0.6356733",
"0.62891936",
"0.6246102",
"0.62308866",
"0.6137861",
"0.6126097",
"0.6109505",
"0.60963994",
"0.6033088",
"0.6025475",
"0.5938865",
"0.5928914",
"0.58674145",
"0.58339... | 0.6967881 | 1 |
A hobbit ages when it has a birthday. | def test_it_ages():
blake = Hobbit("Blake")
assert blake.age == 0
for _ in range(5):
blake.celebrate_birthday()
assert blake.age == 5
assert blake.is_adult() is False
for _ in range(28):
blake.celebrate_birthday()
assert blake.age == 33
assert blake.is_adult() is True... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def age(self):\n today = date.today()\n birthday = datetime.strptime(self.birt['date'], \"%d %b %Y\")\n return birthday",
"def _get_age(self):\n for employee in self:\n if employee.sudo().birthday:\n employee.age = relativedelta(\n fields.D... | [
"0.7011876",
"0.68672675",
"0.68346393",
"0.6775286",
"0.6769321",
"0.6745497",
"0.6742356",
"0.66476846",
"0.66184545",
"0.6613075",
"0.65790725",
"0.6425348",
"0.64220965",
"0.63992715",
"0.6368555",
"0.63079786",
"0.627678",
"0.6268975",
"0.62594837",
"0.6253634",
"0.62358... | 0.6462562 | 11 |
Create MetaData table if nonexistent. | def _create_meta_data_table(self) -> None:
self.dynamodb.create_table(
TableName=self.gene_metadata_table,
KeySchema=[
{"AttributeName": "src_name", "KeyType": "HASH"} # Partition key
],
AttributeDefinitions=[
{"AttributeName": "sr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __createTableIfNotExists(self):\n query = \"SELECT name FROM sqlite_master WHERE type='table'\"\n results = self._cursor.execute(query)\n name_list = [name for r in results for name in r]\n\n if self.table_name not in name_list:\n # Timestamp is for the time from pythons ... | [
"0.7405018",
"0.73484194",
"0.71658975",
"0.70714957",
"0.6958206",
"0.69226736",
"0.682997",
"0.66542673",
"0.66491467",
"0.6542916",
"0.65198517",
"0.651577",
"0.6493228",
"0.64639896",
"0.64616495",
"0.6411971",
"0.6393724",
"0.63801974",
"0.6350028",
"0.63279563",
"0.6320... | 0.64140105 | 15 |
Return True of obj has all the names attributes | def hasattrs(obj, names):
return all(hasattr(obj, attr) for attr in names) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def assertHasAttributes(self, obj, attr_names, msg=None):\n for attr_name in attr_names:\n self.assertHasAttribute(obj, attr_name, msg)",
"def has_attributes(self):\n\n pass",
"def has_attr(self, name):\n return name in self and not self[name] in EMPTY_VALUES",
"def assert_has... | [
"0.7255156",
"0.71262485",
"0.7038313",
"0.6916138",
"0.6914909",
"0.6878589",
"0.6875844",
"0.6553916",
"0.65097237",
"0.6506323",
"0.6430375",
"0.6398899",
"0.63936347",
"0.63565564",
"0.63306683",
"0.62981987",
"0.625086",
"0.6244275",
"0.6216647",
"0.62148595",
"0.6207111... | 0.81768256 | 1 |
Radial Basis Function kernel PCA implementation. | def rbf_kernel_pca(X, gamma, n_components):
# calculate the pairwise squared distances between the data points
sq_dists = pdist(X, "sqeuclidean")
# convert the distances into a square matrix
mat_sq_dists = squareform(sq_dists)
# calculate the kernel matrix
K = exp(-gamma * mat_sq_dists)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def constCVaR(self, Sample,mu,Rstar):\n [q,N] = Sample.shape; \n A = zeros((q,1+N+q));\n A[:,0] = -1;\n A[:,1:N+1] = -Sample;\n A[:,N+1:] = -eye(q); \n b = zeros((q,1)); \n Aeq = zeros((2,1+N+q));\n Aeq[0,1:N+1] = -mu.T;\n Aeq[1,1:N+1... | [
"0.5405095",
"0.523222",
"0.5212314",
"0.5211521",
"0.51815367",
"0.5144328",
"0.5142651",
"0.5118252",
"0.5106332",
"0.50987685",
"0.5088947",
"0.5039568",
"0.5024971",
"0.50098246",
"0.49971977",
"0.49741998",
"0.4946968",
"0.49461478",
"0.49408522",
"0.49395773",
"0.493780... | 0.4958177 | 16 |
Load config from an environment variable. We expect YAML in either a Base64encoded or plaintext string. | def load_from_env(cls, config):
try:
base64_config = config.decode('base64')
cls.providers = yaml.safe_load(base64_config)
return cls
except binascii.Error:
cls.providers = yaml.safe_load(config)
return cls
except yaml.YAMLError:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_env():\n global api_key\n\n # Load the config file\n env_file = path.join(path.dirname(path.abspath(__file__)), 'env.yml')\n try:\n stream = open(env_file, 'r')\n y = yaml.safe_load(stream)\n except IOError:\n print(\"ERROR: Environment file {} not found\".format(env_fi... | [
"0.6917811",
"0.6844287",
"0.6800473",
"0.67561316",
"0.6728543",
"0.66882694",
"0.6652779",
"0.663064",
"0.6611015",
"0.6490818",
"0.6479606",
"0.64436674",
"0.6423656",
"0.6407624",
"0.6407624",
"0.63828474",
"0.6347492",
"0.63330686",
"0.6296379",
"0.6243277",
"0.6237309",... | 0.7073263 | 0 |
Execute a worker until it has no more tasks. | def run_worker(worker_name, queue_name=None, quiet=False):
if queue_name is None:
for cfg_queue, cfg_worker in list(get_settings().asynctask_workers.items()):
if cfg_worker and worker_name == cfg_worker.worker:
queue_name = cfg_queue
break
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _worker(self):\n while True:\n request = self.queue.get()\n self.worker(request)\n self.queue.task_done()",
"def run(self):\n while True:\n next_task = self.task_queue.get()\n if next_task is None:\n # Poison pill means shutd... | [
"0.7071476",
"0.6998907",
"0.69485193",
"0.665235",
"0.6636126",
"0.6616721",
"0.6523519",
"0.6494759",
"0.64941984",
"0.6487904",
"0.6466613",
"0.64625937",
"0.64224535",
"0.6389622",
"0.6383152",
"0.6373835",
"0.6349737",
"0.632927",
"0.6239626",
"0.61632645",
"0.6136412",
... | 0.0 | -1 |
Convert annotations list or single annotation | def convert(self, annotations, from_format, to_format, conversion_func=None, item=None):
# check known format
if from_format.lower() not in self.known_formats and conversion_func is None:
raise exceptions.PlatformException(
"400",
"Unknown annotation format: {... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _convert_annotations(self, ast):\n self.annotations = IDLAnnotations(ast)",
"def to_synapse_annotations(annotations):\n \n if is_synapse_annotations(annotations):\n return annotations\n synapseAnnos = {}\n for key, value in annotations.iteritems():\n if key in ['id', 'etag', ... | [
"0.73455846",
"0.6744125",
"0.66229486",
"0.6088179",
"0.6088179",
"0.5981785",
"0.5975591",
"0.59734356",
"0.59533334",
"0.59533334",
"0.59504807",
"0.59429485",
"0.58284104",
"0.580086",
"0.572504",
"0.57146424",
"0.57042617",
"0.56723505",
"0.56544054",
"0.56273144",
"0.56... | 0.5964158 | 8 |
Get LectureDays around today(+offset) in range of range | def uni_get_days_around_lectures(offset, range): # noqa: E501
return 'do some magic!' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_offset():\n offset = datetime.date.today() - start_day\n return int(offset.days) - 4",
"def uni_get_day_lectures(offset): # noqa: E501\n return 'do some magic!'",
"def relative_days(from_day, from_year):\n if from_day == 30:\n relative_days = 2\n return relative_days\n eli... | [
"0.65104026",
"0.617163",
"0.5913025",
"0.5865344",
"0.5851389",
"0.5805303",
"0.57930297",
"0.5675259",
"0.5609689",
"0.5579714",
"0.55749565",
"0.55749565",
"0.5557975",
"0.5556903",
"0.5531304",
"0.55263287",
"0.55102193",
"0.55022997",
"0.5487998",
"0.5426723",
"0.5417529... | 0.75485516 | 0 |
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`. | def plot_confusion_matrix(cm, classes,
normalize=False,
title='Confusion matrix',
cmap=plt.cm.Blues):
plt.imshow(cm, interpolation='nearest', cmap=cmap)
plt.title(title)
plt.colorbar()
tick_marks = np.arange(len(classes))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n... | [
"0.8193291",
"0.8094472",
"0.8027684",
"0.80178267",
"0.799257",
"0.7989883",
"0.7979287",
"0.7974278",
"0.79594076",
"0.79549026",
"0.79360807",
"0.79330444",
"0.7932846",
"0.7929725",
"0.79248244",
"0.7923015",
"0.7922415",
"0.7922163",
"0.7921376",
"0.79207855",
"0.791628"... | 0.7841869 | 53 |
Gets the certificate_issuer_id of this CertificateIssuerConfigResponse. The ID of the certificate issuer. Null if Device Management internal HSM is used. | def certificate_issuer_id(self):
return self._certificate_issuer_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def certificate_issuer_value(self):\n\n if self._processed_extensions is False:\n self._set_extensions()\n return self._certificate_issuer_value",
"def issuer_did(self) -> str:\n return self._issuer_did",
"def issuer(self) -> pulumi.Output[str]:\n return pulumi.get(self, ... | [
"0.73640174",
"0.6950223",
"0.64665055",
"0.6409206",
"0.64090383",
"0.6320469",
"0.63189435",
"0.63189435",
"0.6240312",
"0.6180241",
"0.6155338",
"0.61368763",
"0.60711503",
"0.60711503",
"0.5958371",
"0.58158976",
"0.58089995",
"0.5797584",
"0.57446283",
"0.57446283",
"0.5... | 0.81923187 | 0 |
Gets the created_at of this CertificateIssuerConfigResponse. Created UTC time RFC3339. | def created_at(self):
return self._created_at | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def created_at(self):\n return string_to_datetime(self._dict.get('created_at'))",
"def created_at(self) -> str:\n return pulumi.get(self, \"created_at\")",
"def created_at(self) -> str:\n return pulumi.get(self, \"created_at\")",
"def created_at(self) -> str:\n return pulumi.get(s... | [
"0.7208754",
"0.71750414",
"0.71750414",
"0.71750414",
"0.7046377",
"0.7046377",
"0.7046377",
"0.7046377",
"0.7046377",
"0.7046377",
"0.7044834",
"0.70094824",
"0.6941492",
"0.6941492",
"0.6941492",
"0.6941492",
"0.6941492",
"0.6941492",
"0.69409084",
"0.68950075",
"0.6875357... | 0.7072778 | 6 |
Gets the etag of this CertificateIssuerConfigResponse. Entity instance signature. | def etag(self):
return self._etag | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def etag(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"etag\")",
"def etag(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"etag\")",
"def etag(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"etag\")",
"def etag(self) -> pulumi.Output[str]:\n return pul... | [
"0.73150766",
"0.73150766",
"0.73150766",
"0.73150766",
"0.73150766",
"0.73150766",
"0.73150766",
"0.71872115",
"0.71872115",
"0.71872115",
"0.71872115",
"0.71872115",
"0.71872115",
"0.71872115",
"0.71872115",
"0.71872115",
"0.71872115",
"0.71872115",
"0.69322544",
"0.68813956"... | 0.71044666 | 18 |
Gets the id of this CertificateIssuerConfigResponse. The ID of the certificate issuer configuration. | def id(self):
return self._id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def certificate_issuer_id(self):\n return self._certificate_issuer_id",
"def certificate_issuer_value(self):\n\n if self._processed_extensions is False:\n self._set_extensions()\n return self._certificate_issuer_value",
"def issuer_did(self) -> str:\n return self._issuer_... | [
"0.767815",
"0.6868982",
"0.665152",
"0.6385002",
"0.627576",
"0.6113055",
"0.60947835",
"0.5956971",
"0.59554976",
"0.59554976",
"0.5946193",
"0.5910276",
"0.5894633",
"0.5890666",
"0.5890666",
"0.5890666",
"0.5890666",
"0.58253616",
"0.58248055",
"0.5753658",
"0.57371473",
... | 0.0 | -1 |
Sets the id of this CertificateIssuerConfigResponse. The ID of the certificate issuer configuration. | def id(self, id):
self._id = id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def certificate_issuer_id(self, certificate_issuer_id):\n\n self._certificate_issuer_id = certificate_issuer_id",
"def certificate_issuer_id(self):\n return self._certificate_issuer_id",
"async def update_issuer(self, issuer_name: str, **kwargs) -> CertificateIssuer:\n\n enabled = kwargs.p... | [
"0.69106644",
"0.595221",
"0.55485",
"0.5463461",
"0.54356486",
"0.53828794",
"0.5274261",
"0.5247021",
"0.51983386",
"0.5095579",
"0.5075533",
"0.5073465",
"0.50666165",
"0.50320435",
"0.49876803",
"0.49848276",
"0.49848276",
"0.49848276",
"0.49848276",
"0.49848276",
"0.4984... | 0.0 | -1 |
Gets the is_custom of this CertificateIssuerConfigResponse. | def is_custom(self):
return self._is_custom | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_custom(self, is_custom):\n\n self._is_custom = is_custom",
"def is_custom(self, is_custom):\n\n self._is_custom = is_custom",
"def customs(self) -> Optional[Sequence['outputs.PermissionsResponseCustoms']]:\n return pulumi.get(self, \"customs\")",
"def custom(self):\n return... | [
"0.59674126",
"0.59674126",
"0.5959534",
"0.553564",
"0.54608613",
"0.54590744",
"0.54406047",
"0.52999485",
"0.5246151",
"0.524445",
"0.5219047",
"0.51721394",
"0.5152882",
"0.5127468",
"0.51133245",
"0.5096431",
"0.5061413",
"0.50246245",
"0.5010184",
"0.5010184",
"0.500308... | 0.67688453 | 0 |
Sets the is_custom of this CertificateIssuerConfigResponse. | def is_custom(self, is_custom):
self._is_custom = is_custom | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_custom(self):\n return self._is_custom",
"def custom(self, custom):\n self._context[\"custom\"] = custom",
"def custom_enroll_flag(self, custom_enroll_flag):\n\n self._custom_enroll_flag = custom_enroll_flag",
"def custom_data(self, custom_data):\n\n self._custom_data = cus... | [
"0.57039034",
"0.5623028",
"0.5567219",
"0.5094516",
"0.50240517",
"0.49527094",
"0.49304765",
"0.4920616",
"0.48188183",
"0.47919622",
"0.47626492",
"0.47604614",
"0.47325903",
"0.4722258",
"0.47077307",
"0.47038198",
"0.46687102",
"0.46679708",
"0.4658433",
"0.46453905",
"0... | 0.7235502 | 1 |
Gets the object of this CertificateIssuerConfigResponse. | def object(self):
return self._object | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def certificate_issuer_value(self):\n\n if self._processed_extensions is False:\n self._set_extensions()\n return self._certificate_issuer_value",
"def certificate_issuer_id(self):\n return self._certificate_issuer_id",
"def getIssuer(self):\n\n return X501DN.from_POW(sel... | [
"0.66683286",
"0.64135706",
"0.6203329",
"0.6203329",
"0.6164719",
"0.5928784",
"0.591318",
"0.58711183",
"0.5670082",
"0.56374484",
"0.5613733",
"0.5608754",
"0.5479684",
"0.5473356",
"0.5466543",
"0.5406446",
"0.5403012",
"0.53747505",
"0.53337854",
"0.53269744",
"0.5324799... | 0.0 | -1 |
Sets the object of this CertificateIssuerConfigResponse. | def object(self, object):
allowed_values = ["certificate-issuer-configuration"]
if object not in allowed_values:
raise ValueError(
"Invalid value for `object` ({0}), must be one of {1}"
.format(object, allowed_values)
)
self._object = obje... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def issuer(self, value):\n\n is_oscrypto = isinstance(value, asymmetric.Certificate)\n if not isinstance(value, x509.Certificate) and not is_oscrypto:\n raise TypeError(_pretty_message(\n '''\n issuer must be an instance of asn1crypto.x509.Certificate or\n ... | [
"0.6197153",
"0.6051841",
"0.6044818",
"0.5853071",
"0.58194405",
"0.5723335",
"0.5714387",
"0.53720814",
"0.52846956",
"0.5105405",
"0.5030741",
"0.49098122",
"0.48928398",
"0.48784375",
"0.48706433",
"0.48355475",
"0.48275125",
"0.4826689",
"0.47984084",
"0.47913238",
"0.47... | 0.70891905 | 0 |
Gets the reference of this CertificateIssuerConfigResponse. The certificate name to which the certificate issuer configuration applies. | def reference(self):
return self._reference | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def certificate_issuer_id(self):\n return self._certificate_issuer_id",
"def certificate_issuer_value(self):\n\n if self._processed_extensions is False:\n self._set_extensions()\n return self._certificate_issuer_value",
"def issuer(self) -> pulumi.Output[str]:\n return pu... | [
"0.71746",
"0.70525396",
"0.66885906",
"0.6650819",
"0.65378284",
"0.65378284",
"0.650183",
"0.6211053",
"0.6159365",
"0.6159365",
"0.61397505",
"0.6136924",
"0.61183226",
"0.60768634",
"0.6070187",
"0.6029877",
"0.6029877",
"0.6029877",
"0.59732294",
"0.5965258",
"0.59460765... | 0.0 | -1 |
Sets the reference of this CertificateIssuerConfigResponse. The certificate name to which the certificate issuer configuration applies. | def reference(self, reference):
self._reference = reference | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def certificate_issuer_id(self, certificate_issuer_id):\n\n self._certificate_issuer_id = certificate_issuer_id",
"def issuer(self, issuer: str):\n\n self._issuer = issuer",
"async def update_issuer(self, issuer_name: str, **kwargs) -> CertificateIssuer:\n\n enabled = kwargs.pop(\"enabled\... | [
"0.655455",
"0.60506773",
"0.5926493",
"0.57481295",
"0.57333213",
"0.5651279",
"0.5616088",
"0.5581897",
"0.5391093",
"0.5188407",
"0.5126663",
"0.5112704",
"0.5095034",
"0.5095034",
"0.49741864",
"0.49634892",
"0.49571466",
"0.49122858",
"0.48878798",
"0.48765698",
"0.47892... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.