query stringlengths 10 2k | document stringlengths 20 51.2k | metadata dict | negatives listlengths 0 101 | negative_scores listlengths 0 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
Returns a gaussian function with the given parameters | def gaussian(height, center_x, center_y, width_x, width_y, rotation):
width_x = float(width_x)
width_y = float(width_y)
rotation = np.deg2rad(rotation)
center_x = center_x * np.cos(rotation) - center_y * np.sin(rotation)
center_y = center_x * np.sin(rotation) + center_y * np.cos... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gaussian(x, *parameters):\n position, sigma, amplitude, background = parameters\n return amplitude * np.exp(-(x - position)**2 / (2.0 * sigma**2)) + background",
"def gaussian(pars, x):\n A, b, mu, sigma = pars\n # return b + A/(np.sqrt(2*np.pi)*sigma**2) \\\n return b + A \\\n * np.exp... | [
"0.7934865",
"0.7810317",
"0.7587476",
"0.74887896",
"0.7464076",
"0.7385345",
"0.7374554",
"0.7266868",
"0.7266868",
"0.7266868",
"0.72426987",
"0.7226114",
"0.72215724",
"0.71309364",
"0.71272105",
"0.7118073",
"0.7088956",
"0.70818025",
"0.7071268",
"0.70585066",
"0.703256... | 0.65859294 | 53 |
Returns a gaussian function with the given parameters | def gaussian_norot(height, center_x, center_y, width_x, width_y):
width_x = float(width_x)
width_y = float(width_y)
return lambda x,y: height*np.exp(
-(((center_x-x)/width_x)**2+((center_y-y)/width_y)**2)/2) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gaussian(x, *parameters):\n position, sigma, amplitude, background = parameters\n return amplitude * np.exp(-(x - position)**2 / (2.0 * sigma**2)) + background",
"def gaussian(pars, x):\n A, b, mu, sigma = pars\n # return b + A/(np.sqrt(2*np.pi)*sigma**2) \\\n return b + A \\\n * np.exp... | [
"0.7936006",
"0.78110605",
"0.7589353",
"0.749031",
"0.74657845",
"0.7387422",
"0.73763347",
"0.7267818",
"0.7267818",
"0.7267818",
"0.7243705",
"0.7227015",
"0.72231114",
"0.713038",
"0.7127564",
"0.7118518",
"0.70896465",
"0.7083726",
"0.70708406",
"0.70604295",
"0.70323956... | 0.0 | -1 |
Add headers to both force latest IE rendering engine or Chrome Frame, and also to cache the rendered page for 10 minutes. | def add_header(r):
r.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
r.headers["Pragma"] = "no-cache"
r.headers["Expires"] = "0"
r.headers["Cache-Control"] = "public, max-age=0"
return r | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, max-age=60'\n return response",
"def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, m... | [
"0.822267",
"0.8221825",
"0.8221825",
"0.8221825",
"0.8221825",
"0.81952775",
"0.8162643",
"0.8162643",
"0.8162643",
"0.8162643",
"0.8162643",
"0.8162643",
"0.8162643",
"0.8162643",
"0.8162643",
"0.8162643",
"0.8162643",
"0.8162643",
"0.8162643",
"0.8162643",
"0.8162643",
"... | 0.71365863 | 45 |
The id of the sensor. | def unique_id(self):
return f"octopus_energy_intelligent_charge_limit" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unique_id(self):\n return self.device_id + '_' + self._sensor_type",
"def unique_id(self):\n id = \"{}{}{}\".format(\n DOMAIN, self._account, self.sensorName.lower().replace(\" \", \"\")\n )\n return id",
"def entity_id(self):\n return 'sensor.{}_{}'.format(sel... | [
"0.81542426",
"0.7885806",
"0.7845372",
"0.7695466",
"0.7657747",
"0.7657747",
"0.7657747",
"0.7657747",
"0.7657747",
"0.7657747",
"0.7657747",
"0.7657747",
"0.7657747",
"0.7657747",
"0.7657747",
"0.7657747",
"0.7657747",
"0.7657747",
"0.7657747",
"0.7657747",
"0.7657747",
... | 0.0 | -1 |
Name of the sensor. | def name(self):
return f"Octopus Energy Intelligent Charge Limit" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return self._sensor.name",
"def name(self):\n return f\"{self._name} {SENSOR_TYPES[self.sensor][0]}\"",
"def get_sensor_name(self):\n return self.data[1]",
"def name(self):\n return self.device.device_data[self.device_id]['name'] + \\\n f' {self._senso... | [
"0.9250166",
"0.90057385",
"0.89274466",
"0.8871892",
"0.8865032",
"0.8857324",
"0.85477203",
"0.85042745",
"0.8349108",
"0.8343337",
"0.82704717",
"0.8116982",
"0.7734933",
"0.7707925",
"0.76887643",
"0.7471656",
"0.7456977",
"0.7451284",
"0.7451284",
"0.7451284",
"0.7438701... | 0.0 | -1 |
The column name or None if the columns is unnamed. | def name(self) -> Optional[str]:
return self._name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def column_name(self) -> Optional[str]:\n return pulumi.get(self, \"column_name\")",
"def column_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"column_name\")",
"def column_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"column_name\")",
"def get_name(self):\n ... | [
"0.8554235",
"0.7827321",
"0.7827321",
"0.7580142",
"0.7558711",
"0.7342569",
"0.7230717",
"0.7026928",
"0.7021342",
"0.69703585",
"0.69391495",
"0.6922486",
"0.6922486",
"0.69133884",
"0.68881273",
"0.6797143",
"0.6723555",
"0.6708394",
"0.6701048",
"0.6684345",
"0.6658754",... | 0.0 | -1 |
Whether this column is optional. | def optional(self) -> bool:
return self._optional | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_optional(cls) -> bool:\n return cls.optional",
"def is_optional(self) -> bool:\n return bool(AnnotationWrapper.opt_field_re.match(self.data))",
"def isOptional(self):\n return self._field.label == FieldDescriptor.LABEL_OPTIONAL or self.isRepeated()",
"def optional(self) -> bool:\n... | [
"0.7986084",
"0.78232783",
"0.7535859",
"0.74422103",
"0.74265426",
"0.74265426",
"0.74265426",
"0.74265426",
"0.74265426",
"0.74265426",
"0.74265426",
"0.74265426",
"0.74265426",
"0.74265426",
"0.74265426",
"0.74265426",
"0.74265426",
"0.74265426",
"0.74265426",
"0.74265426",
... | 0.76410925 | 2 |
Deserialize from a json loaded dictionary. The dictionary is expected to contain `dtype` and `shape` keys. | def from_json_dict(cls, **kwargs):
if not {"dtype", "shape"} <= set(kwargs.keys()):
raise MlflowException(
"Missing keys in TensorSpec JSON. Expected to find keys `dtype` and `shape`"
)
tensor_type = np.dtype(kwargs["dtype"])
tensor_shape = tuple(kwargs["s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def json_numpy_obj_hook(dct):\n if isinstance(dct, dict) and '__ndarray__' in dct:\n data = base64.b64decode(dct['__ndarray__'])\n return np.frombuffer(data, dct['dtype']).reshape(dct['shape'])\n return dct",
"def json_numpy_obj_hook(dct):\n if isinstance(dct, dict) and '__ndarray__' in dc... | [
"0.6346653",
"0.6346653",
"0.6346653",
"0.6262504",
"0.6226852",
"0.6124331",
"0.6119451",
"0.60499054",
"0.6042176",
"0.6040868",
"0.5904905",
"0.5904379",
"0.5898837",
"0.5881666",
"0.5858799",
"0.5832042",
"0.5828539",
"0.5815559",
"0.58065915",
"0.579569",
"0.579569",
"... | 0.71330523 | 0 |
Whether this tensor is optional. | def optional(self) -> bool:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_optional(cls) -> bool:\n return cls.optional",
"def optional(self) -> bool:\n return self._optional",
"def optional(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"optional\")",
"def optional(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self... | [
"0.7788841",
"0.7465427",
"0.726416",
"0.726416",
"0.726416",
"0.726416",
"0.726416",
"0.726416",
"0.7258665",
"0.7258665",
"0.7258665",
"0.7258665",
"0.7258665",
"0.7258665",
"0.7258665",
"0.7258665",
"0.7258665",
"0.7258665",
"0.7258665",
"0.7258665",
"0.7258665",
"0.7258... | 0.7330157 | 2 |
Deserialize from a json loaded dictionary. The dictionary is expected to contain `type` and `tensorspec` keys. | def from_json_dict(cls, **kwargs):
if not {"tensor-spec", "type"} <= set(kwargs.keys()):
raise MlflowException(
"Missing keys in TensorSpec JSON. Expected to find keys `tensor-spec` and `type`"
)
if kwargs["type"] != "tensor":
raise MlflowException("Ty... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_json_dict(cls, **kwargs):\n if not {\"dtype\", \"shape\"} <= set(kwargs.keys()):\n raise MlflowException(\n \"Missing keys in TensorSpec JSON. Expected to find keys `dtype` and `shape`\"\n )\n tensor_type = np.dtype(kwargs[\"dtype\"])\n tensor_shap... | [
"0.6717568",
"0.6475844",
"0.5921668",
"0.57201827",
"0.5712029",
"0.565757",
"0.556388",
"0.55401796",
"0.5503761",
"0.55017537",
"0.54763174",
"0.5475381",
"0.547456",
"0.5465548",
"0.5463203",
"0.54470825",
"0.5446951",
"0.5446507",
"0.5443184",
"0.5415699",
"0.5411698",
... | 0.6818149 | 0 |
Return true iff this schema declares names, false otherwise. | def has_input_names(self) -> bool:
return self.inputs and self.inputs[0].name is not None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_named(self):\n return self._name != \"\"",
"def has_name(self):\n return self.name is not None",
"def has_name(self):\n return self.unpack_word(0x2) != 0",
"def hasname(self):\n\t\treturn self.name is not None",
"def is_named(self):\n return isinstance(self.uri, rdflib.UR... | [
"0.67626655",
"0.65662235",
"0.65542966",
"0.65278155",
"0.6318693",
"0.62735355",
"0.62677515",
"0.62423134",
"0.6233214",
"0.6197741",
"0.6192188",
"0.6183855",
"0.6135794",
"0.6091593",
"0.6084331",
"0.6082097",
"0.60806525",
"0.6075674",
"0.6074233",
"0.6058121",
"0.60302... | 0.6635011 | 1 |
Maps column names to types, iff this schema declares names. | def input_types_dict(self) -> Dict[str, Union[DataType, np.dtype]]:
if not self.has_input_names():
raise MlflowException("Cannot get input types as a dict for schema without names.")
return {x.name: x.type for x in self.inputs} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_column_types(self, table_name):\n\n curs = self.cursor()\n curs.execute('PRAGMA table_info(%s)' % table_name)\n\n types = {str(d[1].lower()): _TYPE_MAP[d[2].split()[0]] for d in curs.fetchall()}\n\n curs.close()\n\n return types",
"def assign_column_types(self):\n ... | [
"0.692183",
"0.67302734",
"0.66053855",
"0.6532717",
"0.63393945",
"0.63310647",
"0.6190115",
"0.6062526",
"0.59779215",
"0.5975234",
"0.5958275",
"0.59387136",
"0.59001875",
"0.58346313",
"0.58331823",
"0.5801466",
"0.57774895",
"0.57765615",
"0.5760592",
"0.56661457",
"0.56... | 0.59006613 | 12 |
Serialize into json string. | def to_json(self) -> str:
return json.dumps([x.to_dict() for x in self.inputs]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def asJsonString(self):\n return json.dumps(self.asDict(), sort_keys=True)",
"def to_json(self) -> str:\n return json.dumps(self.to_dict())",
"def to_json(self) -> str:\n return json.dumps(self.to_dict())",
"def to_json(self) -> str:\n return json.dumps(self.to_dict())",
"def to... | [
"0.815869",
"0.81317866",
"0.81317866",
"0.81317866",
"0.81317866",
"0.81317866",
"0.81317866",
"0.81317866",
"0.81317866",
"0.81317866",
"0.81269664",
"0.80760473",
"0.80508965",
"0.8033703",
"0.8026007",
"0.80217457",
"0.80151135",
"0.8006934",
"0.79775727",
"0.79511034",
"... | 0.0 | -1 |
Deserialize from a json string. | def from_json(cls, json_str: str):
def read_input(x: dict):
return TensorSpec.from_json_dict(**x) if x["type"] == "tensor" else ColSpec(**x)
return cls([read_input(x) for x in json.loads(json_str)]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deserialize_json(self, json_string):\n return self._json_deserializer.from_json(json_string)",
"def from_json(cls, string):\n dct = json.loads(string)\n return cls.from_dict(dct)",
"def from_json_str(cls, json_str):\n return cls.from_json(simplejson.loads(json_str))",
"def from_js... | [
"0.86942583",
"0.84268326",
"0.8174877",
"0.80163425",
"0.7936675",
"0.7922665",
"0.7922665",
"0.7865149",
"0.77800536",
"0.7697291",
"0.7650574",
"0.76407224",
"0.7620077",
"0.7584465",
"0.75656927",
"0.75526947",
"0.7549321",
"0.75463074",
"0.75419647",
"0.7532575",
"0.7531... | 0.0 | -1 |
The parameter shape. If shape is None, the parameter is a scalar. | def shape(self) -> Optional[tuple]:
return self._shape | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shape(tensor):\n raise NotImplementedError",
"def shape(self):\n return () if self.data is None else self.data.shape",
"def get_shape(self):\n if self.__data is None:\n return None\n return self.__data.shape",
"def shape(self):\n return None",
"def shape(se... | [
"0.6924879",
"0.6893731",
"0.6866802",
"0.6865781",
"0.68652874",
"0.68652874",
"0.6821286",
"0.6821286",
"0.68035334",
"0.6766341",
"0.673566",
"0.67304426",
"0.67222726",
"0.67222726",
"0.67222726",
"0.67082804",
"0.67057914",
"0.66809076",
"0.6637465",
"0.66297925",
"0.659... | 0.7097256 | 0 |
Deserialize from a json loaded dictionary. The dictionary is expected to contain `name`, `dtype` and `default` keys. | def from_json_dict(cls, **kwargs):
if not {"name", "dtype", "default"} <= set(kwargs.keys()):
raise MlflowException.invalid_parameter_value(
"Missing keys in ParamSpec JSON. Expected to find "
"keys `name`, `dtype` and `default`",
)
return cls(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_dict(dtype, data):\n try:\n field_map = {field.name: field.type for field in fields(dtype)}\n return dtype(**{key: from_dict(field_map[key], val) for key, val in data.items()})\n except:\n return data",
"def from_dict(cls, dikt) -> 'Data':\n return util.deserialize_mode... | [
"0.65025043",
"0.6450461",
"0.64315695",
"0.6395811",
"0.6343944",
"0.61597955",
"0.61597955",
"0.6130065",
"0.60474235",
"0.6044787",
"0.6044787",
"0.6044787",
"0.6044787",
"0.6044787",
"0.6044787",
"0.6035153",
"0.60263526",
"0.60216767",
"0.5999314",
"0.5984175",
"0.596573... | 0.66446763 | 0 |
Serialize into json string. | def to_json(self) -> str:
return json.dumps(self.to_dict()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def asJsonString(self):\n return json.dumps(self.asDict(), sort_keys=True)",
"def to_json(self) -> str:\n return json.dumps(asdict(self))",
"def to_json(self):\n return json.dumps(self.serialize())",
"def toJSONString(self):\n JSONObject = self.toDict()\n\n return json.dump... | [
"0.8157503",
"0.81270546",
"0.8076674",
"0.8049625",
"0.80336577",
"0.80251175",
"0.802235",
"0.8013918",
"0.8006178",
"0.797767",
"0.7951587",
"0.7922114",
"0.79219955",
"0.79219955",
"0.79219955",
"0.79219955",
"0.79219955",
"0.79219955",
"0.79219955",
"0.79219955",
"0.7921... | 0.8132591 | 9 |
Deserialize from a json string. | def from_json(cls, json_str: str):
return cls([ParamSpec.from_json_dict(**x) for x in json.loads(json_str)]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deserialize_json(self, json_string):\n return self._json_deserializer.from_json(json_string)",
"def from_json(cls, string):\n dct = json.loads(string)\n return cls.from_dict(dct)",
"def from_json_str(cls, json_str):\n return cls.from_json(simplejson.loads(json_str))",
"def from_js... | [
"0.86942583",
"0.84268326",
"0.8174877",
"0.80163425",
"0.7936675",
"0.7922665",
"0.7922665",
"0.7865149",
"0.77800536",
"0.7697291",
"0.7650574",
"0.76407224",
"0.7620077",
"0.7584465",
"0.75656927",
"0.75526947",
"0.7549321",
"0.75463074",
"0.75419647",
"0.7532575",
"0.7531... | 0.0 | -1 |
Build query filter as a string. Returns str The GraphQL query as a string. | def build(self) -> str:
query = "{Get{"
for get in self.get_builder:
query += get.build(wrap_get=False)
return query + "}}" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_filter_string(cls, filter_specification):\n registry = get_current_registry()\n visitor_cls = registry.getUtility(IFilterSpecificationVisitor,\n name=EXPRESSION_KINDS.CQL)\n visitor = visitor_cls()\n filter_specification.accept(visitor)\... | [
"0.74125916",
"0.71838963",
"0.6988103",
"0.6860145",
"0.6769535",
"0.67061317",
"0.66882765",
"0.6645348",
"0.64236826",
"0.63187414",
"0.630014",
"0.6278591",
"0.62779576",
"0.6249063",
"0.62368876",
"0.61931336",
"0.6160826",
"0.61475235",
"0.6099248",
"0.6072618",
"0.6072... | 0.59333086 | 28 |
Test locking pathlib2 on python2.7 which needs `scandir`, but fails to resolve when using a fresh dependency cache. | def test_lock_missing_cache_entries_gets_all_hashes(PipenvInstance, tmpdir):
with temp_environ():
os.environ["PIPENV_CACHE_DIR"] = str(tmpdir.strpath)
with PipenvInstance(chdir=True) as p:
p._pipfile.add("pathlib2", "*")
assert "pathlib2" in p.pipfile["packages"]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_multiple_file_locks(tmp_path, monkeypatch):\n monkeypatch.setenv(\"RAY_TMPDIR\", str(tmp_path))\n with TempFileLock(path=\"abc.txt\"):\n with TempFileLock(path=\"subdir/abc.txt\"):\n assert RAY_LOCKFILE_DIR in os.listdir(tmp_path)\n # We should have 2 locks, one for abc.... | [
"0.6222418",
"0.6130201",
"0.59925234",
"0.5901809",
"0.5773521",
"0.5565444",
"0.55019283",
"0.5500261",
"0.5484437",
"0.5481608",
"0.54605097",
"0.5448761",
"0.54419774",
"0.54357016",
"0.5403511",
"0.5388962",
"0.53638595",
"0.5358114",
"0.5355904",
"0.5307997",
"0.5273019... | 0.65530354 | 0 |
Sets the in_crc_errors of this EthernetInterfaceStateCounters. | def in_crc_errors(self, in_crc_errors: str):
self._in_crc_errors = in_crc_errors | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def in_crc_errors(self) -> str:\n return self._in_crc_errors",
"def pin_errors(self):\n for m in range(self.stage_width_list[-1]):\n error, _ = rqrmilib.calculate_submodel_error(self._get_native_object(), self.probe, len(self)-1, m)\n if error < 0: error = 0\n self.... | [
"0.5896342",
"0.5395938",
"0.5179257",
"0.50623256",
"0.5042801",
"0.50183034",
"0.4890702",
"0.48866343",
"0.48642448",
"0.48521268",
"0.47887892",
"0.4782435",
"0.4781247",
"0.47763357",
"0.47662553",
"0.47409695",
"0.47344616",
"0.47318164",
"0.47045618",
"0.46937796",
"0.... | 0.73171175 | 0 |
Gets the out_mac_control_frames of this EthernetInterfaceStateCounters. | def out_mac_control_frames(self) -> str:
return self._out_mac_control_frames | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def out_mac_control_frames(self, out_mac_control_frames: str):\n\n self._out_mac_control_frames = out_mac_control_frames",
"def in_mac_control_frames(self) -> str:\n return self._in_mac_control_frames",
"def get_output_states(self):\n return self.states[-self.num_output_states:]",
"def o... | [
"0.7033605",
"0.60319555",
"0.5943384",
"0.5885427",
"0.52819777",
"0.5132673",
"0.51014555",
"0.4915829",
"0.48474354",
"0.48359475",
"0.48331392",
"0.47986776",
"0.47774732",
"0.4737987",
"0.47231963",
"0.47011515",
"0.4689595",
"0.46890107",
"0.46843612",
"0.467629",
"0.46... | 0.7588379 | 0 |
Gets the in_mac_control_frames of this EthernetInterfaceStateCounters. | def in_mac_control_frames(self) -> str:
return self._in_mac_control_frames | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def out_mac_control_frames(self) -> str:\n return self._out_mac_control_frames",
"def out_mac_control_frames(self, out_mac_control_frames: str):\n\n self._out_mac_control_frames = out_mac_control_frames",
"def in_mac_control_frames(self, in_mac_control_frames: str):\n\n self._in_mac_contro... | [
"0.7189915",
"0.60180163",
"0.56577426",
"0.5392892",
"0.53714496",
"0.519221",
"0.5056037",
"0.4978782",
"0.49660945",
"0.49532452",
"0.49423724",
"0.49228832",
"0.4908662",
"0.48266155",
"0.48219743",
"0.48202595",
"0.4776814",
"0.47630805",
"0.47527596",
"0.4747052",
"0.47... | 0.6799863 | 1 |
Gets the out_mac_pause_frames of this EthernetInterfaceStateCounters. | def out_mac_pause_frames(self) -> str:
return self._out_mac_pause_frames | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def out_mac_pause_frames(self, out_mac_pause_frames: str):\n\n self._out_mac_pause_frames = out_mac_pause_frames",
"def in_mac_pause_frames(self) -> str:\n return self._in_mac_pause_frames",
"def out_mac_control_frames(self) -> str:\n return self._out_mac_control_frames",
"def out_mac_co... | [
"0.7055911",
"0.7000019",
"0.6444536",
"0.5876658",
"0.5625761",
"0.5483489",
"0.5453817",
"0.52632076",
"0.50456977",
"0.5024305",
"0.49135113",
"0.4865369",
"0.47719425",
"0.46946684",
"0.46814248",
"0.46787965",
"0.46339795",
"0.4571558",
"0.45673487",
"0.45552033",
"0.448... | 0.79727316 | 0 |
Gets the out8021q_frames of this EthernetInterfaceStateCounters. | def out8021q_frames(self) -> str:
return self._out8021q_frames | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def in8021q_frames(self) -> str:\n return self._in8021q_frames",
"def out8021q_frames(self, out8021q_frames: str):\n\n self._out8021q_frames = out8021q_frames",
"def get_output_states(self):\n return self.states[-self.num_output_states:]",
"def getRxBitstreamFrames(self):\n \n ... | [
"0.71820015",
"0.6744631",
"0.5510278",
"0.5383207",
"0.5346667",
"0.5344923",
"0.5344923",
"0.53183883",
"0.5306723",
"0.53010005",
"0.5296889",
"0.5202992",
"0.5148645",
"0.51365405",
"0.5051905",
"0.5047685",
"0.49978513",
"0.4979188",
"0.49165463",
"0.49043173",
"0.489526... | 0.7720255 | 0 |
Sets the out8021q_frames of this EthernetInterfaceStateCounters. | def out8021q_frames(self, out8021q_frames: str):
self._out8021q_frames = out8021q_frames | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def out8021q_frames(self) -> str:\n return self._out8021q_frames",
"def in8021q_frames(self, in8021q_frames: str):\n\n self._in8021q_frames = in8021q_frames",
"def in8021q_frames(self) -> str:\n return self._in8021q_frames",
"def out_mac_pause_frames(self, out_mac_pause_frames: str):\n\n... | [
"0.6585833",
"0.65762675",
"0.59554595",
"0.55730844",
"0.5493888",
"0.5312083",
"0.528559",
"0.52488816",
"0.51416796",
"0.50839984",
"0.5076395",
"0.5046384",
"0.5038749",
"0.5011937",
"0.48653182",
"0.4750888",
"0.47085947",
"0.46981674",
"0.46793467",
"0.46746898",
"0.466... | 0.7767299 | 0 |
Gets the in_mac_pause_frames of this EthernetInterfaceStateCounters. | def in_mac_pause_frames(self) -> str:
return self._in_mac_pause_frames | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def out_mac_pause_frames(self) -> str:\n return self._out_mac_pause_frames",
"def out_mac_pause_frames(self, out_mac_pause_frames: str):\n\n self._out_mac_pause_frames = out_mac_pause_frames",
"def in_mac_pause_frames(self, in_mac_pause_frames: str):\n\n self._in_mac_pause_frames = in_mac_... | [
"0.7584451",
"0.6313009",
"0.62560797",
"0.5867498",
"0.55427855",
"0.5449392",
"0.53424543",
"0.53121024",
"0.51813775",
"0.5081472",
"0.50513446",
"0.49324334",
"0.4919263",
"0.48718634",
"0.48567387",
"0.4841383",
"0.48389903",
"0.48388624",
"0.48338",
"0.47508964",
"0.470... | 0.7560741 | 1 |
Gets the in_undersize_frames of this EthernetInterfaceStateCounters. | def in_undersize_frames(self) -> str:
return self._in_undersize_frames | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def in_undersize_frames(self, in_undersize_frames: str):\n\n self._in_undersize_frames = in_undersize_frames",
"def in_oversize_frames(self) -> str:\n return self._in_oversize_frames",
"def dropped_frames(self):\n # type: () -> int\n return self._dropped_frames",
"def _interFrameL... | [
"0.6350905",
"0.5982443",
"0.5291823",
"0.52876616",
"0.52365714",
"0.52146083",
"0.5165647",
"0.5130818",
"0.5070019",
"0.5034629",
"0.49446666",
"0.49277195",
"0.49043852",
"0.48926738",
"0.4868733",
"0.48662025",
"0.48474854",
"0.48189792",
"0.48124316",
"0.48051026",
"0.4... | 0.7037414 | 0 |
Sets the in_oversize_frames of this EthernetInterfaceStateCounters. | def in_oversize_frames(self, in_oversize_frames: str):
self._in_oversize_frames = in_oversize_frames | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def in_undersize_frames(self, in_undersize_frames: str):\n\n self._in_undersize_frames = in_undersize_frames",
"def in_oversize_frames(self) -> str:\n return self._in_oversize_frames",
"def set_frame_size(self, frame_size_selector):\n raise NotImplementedError",
"def in_undersize_frames(... | [
"0.63065225",
"0.5737221",
"0.5047642",
"0.48290065",
"0.4820693",
"0.47127584",
"0.46951994",
"0.4627127",
"0.46249563",
"0.46246624",
"0.45549476",
"0.45269623",
"0.44501114",
"0.439822",
"0.4381662",
"0.43761912",
"0.43570787",
"0.43373895",
"0.43185344",
"0.43166107",
"0.... | 0.75814646 | 0 |
Initialize vocabulary from file. | def initialize_vocabulary(self,vocabulary_path):
if tf.gfile.Exists(vocabulary_path):
vocab = corpora.Dictionary.load(vocabulary_path)
print("vocab length: ",len(vocab.token2id))
return vocab.token2id, vocab.token2id.keys()
else:
raise ValueError("Vocabul... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_vocabulary():\n global vocabulary_list, vocabulary_dict\n vocabulary_list = []\n vocabulary_dict = {}\n\n with open(_VOCABULARY_PATH, 'r') as f:\n for index, line in enumerate(f):\n line = line.strip()\n vocabulary_dict[line] = index\n vocabulary_list.ap... | [
"0.77525496",
"0.76920307",
"0.76315725",
"0.7592861",
"0.75801814",
"0.75644326",
"0.7466838",
"0.7466838",
"0.744741",
"0.7426106",
"0.7416072",
"0.71661425",
"0.71474075",
"0.7117412",
"0.70894724",
"0.7076142",
"0.7025968",
"0.6955337",
"0.69535863",
"0.6949669",
"0.69139... | 0.6884775 | 23 |
Tokenize data file and turn into tokenids using given vocabulary file. This function loads data linebyline from data_path, calls the above sentence_to_token_ids, and saves the result to target_path. See comment for sentence_to_token_ids on the details of tokenids format. | def data_to_token_ids(self,data_path, target_path, vocab,
tokenizer=None, normalize_digits=True):
# if not gfile.Exists(target_path):
if True:
with tf.gfile.GFile(data_path, mode="r") as data_file:
counter = 0
results = []
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def data_to_token_ids(data_path, target_path, vocabulary_path):\n if not gfile.Exists(target_path):\n print(\"Tokenizing data in %s\" % data_path)\n vocab, _ = initialize_vocabulary(vocabulary_path)\n with gfile.GFile(data_path, mode=\"rb\") as data_file:\n with gfile.GFile(targe... | [
"0.88172233",
"0.8454611",
"0.84509355",
"0.83874106",
"0.8368273",
"0.81036496",
"0.73654294",
"0.72655636",
"0.7236587",
"0.7133063",
"0.70920354",
"0.7088108",
"0.7088108",
"0.7057991",
"0.7037901",
"0.6946553",
"0.6747089",
"0.67289793",
"0.6647752",
"0.6557015",
"0.64360... | 0.828191 | 5 |
A formatted string for the time | def _time_str(self):
try:
if not self._time:
raise ValueError
format_ = '%a, %d %b %Y %H:%M:%S'
return datetime.fromtimestamp(float(self._time)).strftime(format_)
except ValueError:
return plastic_date() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_time_string(self):\n return f\"{self.year} {self.month:02} \" \\\n f\"{self.start_day:02} {self.start_hour:02} 00 {self.get_duration():6}\"",
"def get_time_str():\n return time.strftime(time_fmt)",
"def timestr():\n return dt.strftime(dt.now(),'%H:%M:%S')",
"def get_time() -> ... | [
"0.8351121",
"0.83088106",
"0.8237446",
"0.8126203",
"0.80516624",
"0.79543203",
"0.7938748",
"0.7932358",
"0.7905305",
"0.7883502",
"0.7874176",
"0.77869517",
"0.77774405",
"0.7762425",
"0.7730145",
"0.77095145",
"0.7668199",
"0.76607364",
"0.7654668",
"0.76154906",
"0.76074... | 0.84001446 | 0 |
Initialise a neural network layer. This represents a row in the fully connected neural network. | def __init__(self, InputDimentions, OutputDimentions, WeightArray, BiasArray, **kwargs):
self.WeightMatrixT = WeightArray
# We reshape the array to allow easy matrix multiplication. Using this method rather than ".reshape()", ensures
# that the view is kept in tact
self.WeightMatrixT... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, layerNeurons, numberOfLayers, initialWeights = None, lowerBound = None, upperBound = None):\r\n \r\n # Ensure that there is at-least one input and one output layer in the network\r\n assert len(layerNeurons) > 1, \"At least one input layer and one output layer is... | [
"0.72187805",
"0.7091657",
"0.6991233",
"0.69221675",
"0.6853026",
"0.6725666",
"0.67145205",
"0.670589",
"0.6645132",
"0.66430634",
"0.66232926",
"0.661554",
"0.6613391",
"0.65839446",
"0.6567393",
"0.65533143",
"0.65439385",
"0.65343356",
"0.64952546",
"0.6472634",
"0.64644... | 0.0 | -1 |
This function propagates the input through this layer of the network | def forwardPropagate(self, inputMatrix):
return 1.0/(1.0+np.exp(-np.einsum('ji, li->lj', self.WeightMatrixT, inputMatrix)-self.BiasVector)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forward(self, input):\n raise NotImplementedError",
"def forward(self, input):\n raise NotImplementedError",
"def forward(self, input):\n raise NotImplementedError()",
"def forward(self, input):\n\n return self.network(input)",
"def forward(self, input):\n\n return se... | [
"0.75695884",
"0.75695884",
"0.7498898",
"0.73512256",
"0.73512256",
"0.73512256",
"0.7294327",
"0.7028215",
"0.7026481",
"0.69368887",
"0.6916702",
"0.6916702",
"0.68992376",
"0.6855834",
"0.6855364",
"0.68475586",
"0.68308514",
"0.67154044",
"0.6682401",
"0.6673185",
"0.665... | 0.0 | -1 |
Propagates the inputMatrix through this layer of the Neural Network system, storing all the data needed for forward propogation. | def zStoreForwardPropagate(self, inputMatrix):
self.prevX=inputMatrix
self.prevZ=1.0/(1.0+np.exp(-np.einsum('ji, li->lj', self.WeightMatrixT, inputMatrix)-self.BiasVector))
return self.prevZ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forwardPropagate(self, inputMatrix):\r\n # Preform the forward propogation through the layers \r\n # setting the output of one layer to the input of the next\r\n for layer in self.layers:\r\n inputMatrix = layer.forwardPropagate(inputMatrix)\r\n # The output of the last l... | [
"0.82535034",
"0.78960943",
"0.74579775",
"0.7361109",
"0.6999765",
"0.6909882",
"0.6905435",
"0.6873252",
"0.68318474",
"0.6776069",
"0.6734231",
"0.6606671",
"0.6551953",
"0.6550836",
"0.6534804",
"0.653128",
"0.6499487",
"0.6495003",
"0.64940166",
"0.6482823",
"0.6469403",... | 0.7207421 | 4 |
Initialise a neural network layer. This represents a row in the fully connected neural network. | def __init__(self, InputDimentions, OutputDimentions, WeightArray, BiasArray, **kwargs):
self.WeightMatrixT = WeightArray
# We reshape the array to allow easy matrix multiplication. Using this method rather than ".reshape()", ensures
# that the view is kept in tact
self.WeightMatrixT... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, layerNeurons, numberOfLayers, initialWeights = None, lowerBound = None, upperBound = None):\r\n \r\n # Ensure that there is at-least one input and one output layer in the network\r\n assert len(layerNeurons) > 1, \"At least one input layer and one output layer is... | [
"0.72189254",
"0.70916563",
"0.6992227",
"0.69223356",
"0.6853501",
"0.6726644",
"0.6713536",
"0.67050654",
"0.66441894",
"0.6643193",
"0.6622798",
"0.66156",
"0.66122633",
"0.65846664",
"0.6566025",
"0.6551572",
"0.6546014",
"0.65331733",
"0.6494993",
"0.6471598",
"0.6464173... | 0.0 | -1 |
This function propagates the input through this layer of the network | def forwardPropagate(self, inputVector):
return 1.0/(1.0+np.exp(-np.dot(self.WeightMatrixT, inputVector)-self.BiasVector)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forward(self, input):\n raise NotImplementedError",
"def forward(self, input):\n raise NotImplementedError",
"def forward(self, input):\n raise NotImplementedError()",
"def forward(self, input):\n\n return self.network(input)",
"def forward(self, input):\n\n return se... | [
"0.75695884",
"0.75695884",
"0.7498898",
"0.73512256",
"0.73512256",
"0.73512256",
"0.7294327",
"0.7028215",
"0.7026481",
"0.69368887",
"0.6916702",
"0.6916702",
"0.68992376",
"0.6855834",
"0.6855364",
"0.68475586",
"0.68308514",
"0.67154044",
"0.6682401",
"0.6673185",
"0.665... | 0.0 | -1 |
Updated the weights of this node through the rules of backward propagation. | def backwardPropagate(self, relevantDeltaData, learningRate):
delta = self.calcDelta(relevantDeltaData)
deltaBias = -learningRate*delta
holdOut = np.dot(self.WeightMatrixT.T, delta)
self.WeightMatrixT += np.dot(deltaBias, self.prevX.T)
self.Bias... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_weights(self):\n\n self.weights -= self.loss_grads\n self.loss_grads = np.zeros(self.weights.shape)",
"def update_weights(self):\n self._weights = self._weights + self.update_weights_value",
"def update_weights(self):\n\t\tpass",
"def update_weights(self):\r\n\r\n inedg... | [
"0.7816906",
"0.76641405",
"0.76337385",
"0.76029587",
"0.753471",
"0.7500747",
"0.7354102",
"0.72123134",
"0.7101375",
"0.70314777",
"0.6993384",
"0.69618654",
"0.6951611",
"0.6928284",
"0.69236344",
"0.6916257",
"0.6911287",
"0.6891276",
"0.683676",
"0.68339705",
"0.6734525... | 0.6882789 | 18 |
Propagates the input through each layer in the network | def forwardPropagate(self, inputVector):
# Preform the forward propagation through the layers
# setting the output of one layer to the input of the next
for layer in self.layers:
inputVector = layer.forwardPropagate(inputVector)
# The output of the last layer is returned... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forward_propagate(self):\n for i in range(0, len(self.output_layer)):\n output = 0\n\n # Loop through each Neuron in the hidden layer\n for neuron in self.hidden_layer:\n output += neuron.weights[i] * neuron.output\n\n # Update summation for out... | [
"0.7740809",
"0.76146704",
"0.75252163",
"0.74372053",
"0.74124414",
"0.7400514",
"0.7367848",
"0.73495466",
"0.7317932",
"0.7301284",
"0.7286102",
"0.7263771",
"0.7226023",
"0.72043985",
"0.7105665",
"0.7101289",
"0.70909244",
"0.70703316",
"0.69899",
"0.6989871",
"0.6987367... | 0.67436093 | 55 |
Propagates the input through each layer in the network, storing the relivant information. | def zStoreForwardPropagate(self, inputVector):
# Preform the forward propagation through the layers
# setting the output of one layer to the input of the next
for layer in self.layers:
inputVector = layer.zStoreForwardPropagate(inputVector)
# The output of the last layer... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forward_propagate(self):\n for i in range(0, len(self.output_layer)):\n output = 0\n\n # Loop through each Neuron in the hidden layer\n for neuron in self.hidden_layer:\n output += neuron.weights[i] * neuron.output\n\n # Update summation for out... | [
"0.751263",
"0.70837843",
"0.70762634",
"0.6972104",
"0.689705",
"0.6865343",
"0.67699575",
"0.67097884",
"0.668636",
"0.66822803",
"0.6657874",
"0.66553247",
"0.66453344",
"0.6627603",
"0.6610045",
"0.65924096",
"0.6582179",
"0.65686387",
"0.6559142",
"0.6552605",
"0.6534557... | 0.6371521 | 32 |
Create a layer in a batch neural network where multiple neural networks can be forward Propagated at the same time with multiple inputs. | def __init__(self, InputDimentions, OutputDimentions, numberOfLayers, WeightArray, BiasArray):
self.WeightMatrixT = WeightArray
self.WeightMatrixT.shape = (numberOfLayers, OutputDimentions, InputDimentions)
self.BiasVector = BiasArray
self.BiasVector.shape = (numberOfLayers, 1, Outpu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forward_prop(x, layer_sizes, activations, epsilon=1e-8):\n prev = x\n for i in range(len(layer_sizes)):\n n = layer_sizes[i]\n activation = activations[i]\n if i == len(layer_sizes) - 1:\n layer = create_layer(prev, n, activation)\n else:\n layer = create... | [
"0.6811914",
"0.67452794",
"0.6727068",
"0.67042804",
"0.6654821",
"0.66531205",
"0.6636965",
"0.65494895",
"0.65494895",
"0.6534917",
"0.6533359",
"0.64899075",
"0.6467785",
"0.6467785",
"0.6459928",
"0.63923264",
"0.63898593",
"0.63896316",
"0.63887405",
"0.637373",
"0.6357... | 0.0 | -1 |
Propagates the inputMatrix through this layer of the Neural Network system | def forwardPropagate(self, inputMatrix):
return 1.0/(1.0+np.exp(-np.einsum('kji, kli->klj', self.WeightMatrixT, inputMatrix)-self.BiasVector)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forwardPropagate(self, inputMatrix):\r\n # Preform the forward propogation through the layers \r\n # setting the output of one layer to the input of the next\r\n for layer in self.layers:\r\n inputMatrix = layer.forwardPropagate(inputMatrix)\r\n # The output of the last l... | [
"0.7979367",
"0.76356184",
"0.74619824",
"0.70375025",
"0.6977889",
"0.6933175",
"0.67826056",
"0.67665344",
"0.6759669",
"0.66595",
"0.650995",
"0.64655715",
"0.6451507",
"0.64484715",
"0.64422953",
"0.6434437",
"0.64069194",
"0.6383748",
"0.63788235",
"0.6378728",
"0.635839... | 0.7563982 | 2 |
Propagates the inputMatrix through this layer of the Neural Network system | def forwardPropagateBest(self, inputMatrix, index):
return 1.0/(1.0+np.exp(-np.einsum('ji, li->lj', self.WeightMatrixT[index], inputMatrix)-self.BiasVector[index])) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forwardPropagate(self, inputMatrix):\r\n # Preform the forward propogation through the layers \r\n # setting the output of one layer to the input of the next\r\n for layer in self.layers:\r\n inputMatrix = layer.forwardPropagate(inputMatrix)\r\n # The output of the last l... | [
"0.7979367",
"0.76356184",
"0.7563982",
"0.74619824",
"0.70375025",
"0.6977889",
"0.6933175",
"0.67826056",
"0.67665344",
"0.6759669",
"0.66595",
"0.650995",
"0.64655715",
"0.6451507",
"0.64484715",
"0.64422953",
"0.6434437",
"0.64069194",
"0.6383748",
"0.63788235",
"0.637872... | 0.0 | -1 |
Propagates the input through each layer in the network | def forwardPropagate(self, inputMatrix):
# Preform the forward propogation through the layers
# setting the output of one layer to the input of the next
for layer in self.layers:
inputMatrix = layer.forwardPropagate(inputMatrix)
# The output of the last layer is returne... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forward_propagate(self):\n for i in range(0, len(self.output_layer)):\n output = 0\n\n # Loop through each Neuron in the hidden layer\n for neuron in self.hidden_layer:\n output += neuron.weights[i] * neuron.output\n\n # Update summation for out... | [
"0.7740809",
"0.76146704",
"0.75252163",
"0.74372053",
"0.74124414",
"0.7400514",
"0.7367848",
"0.73495466",
"0.7317932",
"0.7301284",
"0.7286102",
"0.7263771",
"0.7226023",
"0.72043985",
"0.7105665",
"0.70909244",
"0.70703316",
"0.69899",
"0.6989871",
"0.6987367",
"0.6987220... | 0.7101289 | 15 |
Propagates the input through each layer in the network | def forwardPropagateBest(self, inputMatrix, index):
# Preform the forward propogation through the layers
# setting the output of one layer to the input of the next
for layer in self.layers:
inputMatrix = layer.forwardPropagateBest(inputMatrix, index)
# The output of the... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forward_propagate(self):\n for i in range(0, len(self.output_layer)):\n output = 0\n\n # Loop through each Neuron in the hidden layer\n for neuron in self.hidden_layer:\n output += neuron.weights[i] * neuron.output\n\n # Update summation for out... | [
"0.7740809",
"0.76146704",
"0.75252163",
"0.74372053",
"0.74124414",
"0.7400514",
"0.7367848",
"0.73495466",
"0.7317932",
"0.7301284",
"0.7286102",
"0.7263771",
"0.7226023",
"0.72043985",
"0.7105665",
"0.7101289",
"0.70909244",
"0.70703316",
"0.69899",
"0.6989871",
"0.6987367... | 0.0 | -1 |
Recursively parse a list & replace all dicts with Yaco objects | def _list_parser(self, old_list):
for i, item in enumerate(old_list):
if isinstance(item, dict):
old_list[i] = Yaco(item)
elif isinstance(item, list):
old_list[i] = self._list_parser(item)
else:
pass
return old_list | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _populate_attributes(self, obj, traverse_list=True):\n for key, value in obj.__dict__.items():\n if isinstance(value, dict):\n obj.__dict__[key] = self._reconstruct_object(value)\n elif isinstance(value, list):\n obj.__dict__[key] = [self._reconstruct_... | [
"0.6077241",
"0.6071965",
"0.59434056",
"0.5891732",
"0.5702263",
"0.56620353",
"0.54863834",
"0.54181623",
"0.5404956",
"0.53706634",
"0.53459495",
"0.5338",
"0.5303963",
"0.5240408",
"0.52308273",
"0.52279073",
"0.5220153",
"0.5219189",
"0.5162217",
"0.51530033",
"0.5148448... | 0.71860534 | 0 |
Test that pages do not require authorization. | def test_public(client, url):
response = client.get(url, secure=True)
assert response.status_code == 200 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_user_not_authorized(self):\n response = self.client.post(self.url)\n self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)",
"def test_public_status_page_remove_authorization_from_public_status_page(self):\n pass",
"def testNoPermission(self):\n self.login_user(... | [
"0.7805355",
"0.7573366",
"0.7550531",
"0.754393",
"0.7477464",
"0.7453274",
"0.74418205",
"0.74418205",
"0.74051666",
"0.7386679",
"0.73852646",
"0.73436177",
"0.73432076",
"0.733158",
"0.733158",
"0.7320706",
"0.7308524",
"0.7308524",
"0.7308524",
"0.7308524",
"0.72869086",... | 0.0 | -1 |
Convenience wrapper around diagnose that returns only one result. If no results are found, this returns None. | def diagnose_one(self, symptoms, age_group=None):
try:
return self.diagnose(symptoms, age_group=age_group)[0]
except IndexError:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def diagnose(patient: Patient) -> Disease:\n symptom_lists = Doctor.check_symptoms()\n for idx, value in enumerate(symptom_lists):\n print(idx + 1, end=': ')\n print(value)\n list_num = input_integer('Select set of symptoms do you have, Enter number (i.e 1): ') - 1\n ... | [
"0.540709",
"0.52838403",
"0.50949544",
"0.49411562",
"0.48334944",
"0.47625622",
"0.47504145",
"0.4722249",
"0.4666538",
"0.4665239",
"0.4658295",
"0.46503997",
"0.46331224",
"0.46240985",
"0.45917788",
"0.45883182",
"0.4586515",
"0.45854995",
"0.45789608",
"0.45501754",
"0.... | 0.72394943 | 0 |
Creates a draft post that can be used for previews. | def get_version(self, version):
if self.version == version:
return self
#version_slug = self.get_version_slug(version)
parent_version_id = self.get_parent_version().id
try:
versioned_post = Post.objects.get(blog=self.blog, version_id=parent_version_id, version... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def post(title, drafts=False):\n # Parsing options\n if drafts:\n dest = _drafts_dest\n else:\n dest = _posts_dest\n\n # File name\n date = get_date()\n name = sanitize(title)\n fname = \"{}-{}{}\".format(date, name, _post_ext)\n\n # Front Matter\n front_matter = []\n fr... | [
"0.73266816",
"0.7294677",
"0.6981046",
"0.6762516",
"0.66025543",
"0.6574814",
"0.6551589",
"0.65167874",
"0.6436928",
"0.6419594",
"0.6409352",
"0.6406731",
"0.63520414",
"0.63309544",
"0.63243884",
"0.63102156",
"0.6299198",
"0.6296672",
"0.62663203",
"0.6253211",
"0.62458... | 0.0 | -1 |
Removes the draft object associated with a post. | def delete_version(self, version):
parent_version_id = self.get_parent_version().id
try:
versioned_post = Post.objects.get(blog=self.blog,
version_id=parent_version_id,
version=version)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_post(self: User, post_id: str) -> Optional[Post]:\n post = dangerously_get_post(post_id)\n if self != post.author:\n raise UnauthorizedAccess()\n\n # do not nullify the user to keep consistent with the below implementation\n nullify_notifications(post.make_href(), post.author)\n\n ... | [
"0.6820618",
"0.6650175",
"0.6624265",
"0.65966284",
"0.65310454",
"0.648292",
"0.6350372",
"0.63480896",
"0.6301361",
"0.625187",
"0.60437536",
"0.603751",
"0.6018303",
"0.59448963",
"0.59249693",
"0.59247077",
"0.5907492",
"0.58861166",
"0.5872001",
"0.5864228",
"0.58454126... | 0.5463146 | 45 |
Returns maximum number of guests you can satisfy | def max_guests(appetite: list[int], cake: list[int]) -> int:
guest_count = 0
appetite_index = len(appetite) - 1
cake_index = len(cake) - 1
while appetite_index >= 0 and cake_index >= 0:
appetite_size = appetite[appetite_index]
cake_size = cake[cake_index]
if cake_size >= appet... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def max_individuals(self) -> int:\n return self.group_size.upper * self.groups_allowed",
"def find_max_guesses():\n print(\"You'll get 5 guesses per problem!\")\n return 5",
"def get_number_of_non_exhausted_votes(self):\n return (\n len(self._ballots) * self._number_of_votes_pr_v... | [
"0.67058694",
"0.6673283",
"0.6292351",
"0.62110734",
"0.6177681",
"0.6132566",
"0.61130244",
"0.61001515",
"0.60693204",
"0.60392797",
"0.60035145",
"0.5987563",
"0.59809804",
"0.5945763",
"0.5935348",
"0.5923318",
"0.5913736",
"0.59127784",
"0.5906886",
"0.590217",
"0.59005... | 0.77078587 | 0 |
Method computes discounted sum of rewards and final gamma multiplier | def reduce_rewards(self,rewards):
reduced_rewards = np.zeros((len(rewards),1))
gamma_multipliers = np.zeros((len(rewards),1))
for i in range(len(rewards)):
gammas = [GAMMA**t for t in range(len(rewards[i]))]
reduced_rewards[i][0] = np.sum(np.multiply... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def computed_discounted_rewards(rewards: list[float], gamma: float = 0.95) -> float:\n discounted_reward = 0\n for i, r in enumerate(rewards):\n discounted_reward += gamma**i * r\n return discounted_reward",
"def discount_rewards(rewards, gamma):\n reward_shape = rewards.shape\n if len(rewa... | [
"0.7850066",
"0.7810609",
"0.75006557",
"0.7417289",
"0.73832476",
"0.7369275",
"0.72433805",
"0.72328746",
"0.7221629",
"0.72104144",
"0.71979684",
"0.7166232",
"0.7162594",
"0.7160576",
"0.7158987",
"0.71378905",
"0.7118783",
"0.7096021",
"0.7093055",
"0.7088048",
"0.701991... | 0.63818336 | 45 |
Force the price to always be a decimal | def price(self, value):
self._price = Decimal(value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_default_w_decimals(self):\n self.assertEqual(currency(188.00), \"$188.00\")",
"def price_pounds(self):\n price = '{0:03d}'.format(self.price)\n return price[:-2] + '.' + price[-2:]",
"def test_no_decimals_01(self):\n self.assertEqual(currency(188.01, False), \"$188.01\")",
... | [
"0.7094489",
"0.69616205",
"0.69607484",
"0.69215906",
"0.6918236",
"0.6917614",
"0.6878256",
"0.6877267",
"0.68123305",
"0.6707481",
"0.6675492",
"0.6626306",
"0.6549107",
"0.65450263",
"0.652165",
"0.652165",
"0.65029174",
"0.649064",
"0.6486598",
"0.6452186",
"0.6442555",
... | 0.7397563 | 0 |
The total effect of the net_affecting charges (note affect vs effect here). Currently this is single currency only (AMAAS110). Cast to Decimal in case the result is zero (no net_affecting charges). | def charges_net_effect(self):
return Decimal(
sum(
[
charge.charge_value
for charge in self.charges.values()
if charge.net_affecting
]
)
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def total(self):\n total_price = self.get_total_amount()\n discounts = self.get_total_discount()\n\n return total_price - discounts",
"def cash_ratio(self):\n return self.cash / self.current_liabilities",
"def effectiveness(self):\n self._effectiveness = 0.20 * self.ANA + 0.2... | [
"0.62570715",
"0.6235157",
"0.6229145",
"0.6225129",
"0.6173853",
"0.6153339",
"0.61397296",
"0.61204726",
"0.6097956",
"0.6082619",
"0.6073412",
"0.60558987",
"0.6020385",
"0.6011036",
"0.5980294",
"0.5978931",
"0.59489465",
"0.5926228",
"0.5893641",
"0.5872979",
"0.58686703... | 0.82955116 | 0 |
Generates the simulated data, and converts the NumPy array into a Pandas object. | def simulate(self):
# Worker ID
self.RawData[:, 0] = np.arange(start=1, stop=self.NumInd+1, step=1, dtype=np.int8)
# IID draws for observables from standard normal distribution
self.RawData[:, 1] = np.random.randn(self.NumInd) # Draw for X
self.RawData[:,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def runSimulationDF(cls, **kwargs):\r\n fittedTS = NamedTimeseries(namedArray=cls.runSimulationArr(**kwargs))\r\n return fittedTS.to_dataframe()",
"def data_pandas(detections):\n return DataWrapperPandas(detections, duplicates_radius=1)",
"def __array__(self):\n return pa.column(\"dummy... | [
"0.6616016",
"0.63311",
"0.62777793",
"0.6224565",
"0.6224565",
"0.6224565",
"0.6031011",
"0.60152894",
"0.60152894",
"0.60106426",
"0.59912723",
"0.5978612",
"0.5976738",
"0.5974885",
"0.5971159",
"0.59629136",
"0.5947969",
"0.59129465",
"0.5887937",
"0.58757704",
"0.5870532... | 0.0 | -1 |
Create a new SampleSheetLinter instance | def __init__(self,sample_sheet=None,sample_sheet_file=None,fp=None):
# Initialise
self._fp = fp
self._sample_sheet_file = sample_sheet_file
self._sample_sheet = sample_sheet
if self._fp is None:
if self._sample_sheet is None:
self._sample_sheet = Sampl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_generate_sample_sheet(self):\n pass",
"def test_parse_sample_sheet(self):\n pass",
"def sheet_setup(self):\n raise NotImplementedError",
"def make_custom_sample_sheet(input_sample_sheet,output_sample_sheet=None,\n lanes=None,fmt=None):\n # Load the... | [
"0.64703894",
"0.60520726",
"0.5796375",
"0.57756877",
"0.5608455",
"0.5526609",
"0.5502461",
"0.5458941",
"0.53156066",
"0.53110546",
"0.52634317",
"0.5259123",
"0.52486336",
"0.52098095",
"0.51362187",
"0.5122741",
"0.51171523",
"0.51142883",
"0.50685805",
"0.5064624",
"0.5... | 0.4757722 | 36 |
Check if a sample sheet barcode sequence is valid Valid barcodes must consist of only the letters A,T,G or C in any order, and always uppercase. 10xGenomics sample set IDs of the form e.g. 'SIP03C9' or 'SIGAB3' are also considered to be valid. | def barcode_is_valid(s):
return (bool(re.match(r'^[ATGC]*$',s))
or barcode_is_10xgenomics(s)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_check_barcode(self):\r\n self.assertEqual(check_barcode('AA', None, ['AA']), (False, 'AA',\r\n False))\r\n self.assertEqual(check_barcode('GCATCGTCCACA', 'golay_12',\r\n ['GCATCGTCAACA']), (2, '... | [
"0.69598264",
"0.68189746",
"0.6814072",
"0.6746378",
"0.66955096",
"0.6686557",
"0.6580686",
"0.6572843",
"0.6543185",
"0.65183085",
"0.64993525",
"0.6435424",
"0.64148444",
"0.6411794",
"0.63436776",
"0.632945",
"0.62934846",
"0.6290663",
"0.62555736",
"0.6236995",
"0.62254... | 0.7333045 | 0 |
Returns the contact.html page where users can create new orders | def contact(request):
if request.method == "POST":
contact_form = ContactForm(request.POST)
if contact_form.is_valid():
contact = contact_form.save(commit=False)
contact.client = request.user
contact.save()
messages.success(
request,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def contact():\n return render_template('contact.html')",
"def contact():\n\n\treturn render_template('contact.html', title='Contact',\n\t\t\t\t\t\t year=datetime.now().year,\n\t\t\t\t\t\t message='Your contact page.')",
"def contact():\n return render_template(\n 'contact.html',\n titl... | [
"0.70360345",
"0.69447637",
"0.68679965",
"0.68521833",
"0.68521833",
"0.6830059",
"0.6797079",
"0.6797079",
"0.6797079",
"0.6797079",
"0.6797079",
"0.6797079",
"0.6797079",
"0.6797079",
"0.67613214",
"0.6722574",
"0.6713562",
"0.66886973",
"0.6648806",
"0.66480136",
"0.66378... | 0.58658874 | 56 |
Read a JSON file with a stricted schema and save tokens for API usage. | def process_tokens(self, path_to_file):
with open(path_to_file, "r") as f:
app = json.load(f)
# Validate the schema of the API KEYS file.
if not utils.validate_apikeys_schema(app):
raise BadSchemaError("""The schema of the file containing the keys does not
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_verifies_token_file_contains_json(self):\n\n with open(self.sample_token_file, 'w',\n encoding=\"utf8\", errors=\"surrogateescape\") as stf_h:\n stf_h.write(\"Bad JSON\")\n\n with self.assertRaises(json.decoder.JSONDecodeError):\n badgr = BadgrLite(toke... | [
"0.63374525",
"0.61470073",
"0.6133104",
"0.60747564",
"0.6047224",
"0.60425025",
"0.604178",
"0.60354614",
"0.60354614",
"0.59988725",
"0.5938045",
"0.59292054",
"0.5925781",
"0.5899029",
"0.5899029",
"0.58986986",
"0.58678305",
"0.5860026",
"0.58547544",
"0.5850087",
"0.584... | 0.59467316 | 10 |
Matrix multiplication between user and product embedding vectors. | def forward(self, user, item):
item_emb = self.product_factors(item.view(-1)) + self.product_bias(
item.view(-1)
)
user_emb = self.user_factors(user.view(-1)) + self.user_bias(user.view(-1))
mat_mult = (item_emb * user_emb).sum(1)
return mat_mult | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def matrix_vector_prod(m,u):\n each_product = []\n for v in m:\n each_product.append(dot_prod(v, u))\n return each_product",
"def dot_prod(u,v):\n each_product = []\n for i in range(len(u)):\n each_product.append(u[i] * v[i])\n return sum(each_product)",
"def __matmul__(self, q:... | [
"0.71450377",
"0.6601506",
"0.65911454",
"0.6426624",
"0.6353698",
"0.63360727",
"0.6333448",
"0.63314486",
"0.63314",
"0.62880665",
"0.6271462",
"0.62517476",
"0.6227162",
"0.6225085",
"0.62097186",
"0.6173876",
"0.61589456",
"0.6139892",
"0.61377186",
"0.6124998",
"0.611732... | 0.6710064 | 1 |
Convert the probabilities from the final activation into a binary classification. | def _prob_to_class(self, forward):
predict_pos = self.activation(forward)
predict_neg = 1 - predict_pos
return torch.stack((predict_neg, predict_pos)).argmax(0).float() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def predict_class_binary(self):\n return round(logistic(self.input_matrix[len(self.dimens)-1][0]))",
"def predict(self):\n probabilities = self.probability_array()\n # THIS ASSUMES the classifiers are in order: 0th column of the\n # probabilities corresponds to label = 0, ..., 9th col... | [
"0.70773786",
"0.65384024",
"0.6517004",
"0.64338917",
"0.6222777",
"0.6203145",
"0.6188469",
"0.6169673",
"0.6164701",
"0.6145782",
"0.61333895",
"0.61301404",
"0.61202914",
"0.60944176",
"0.60828745",
"0.6074585",
"0.60721594",
"0.60615075",
"0.6035476",
"0.60293",
"0.60258... | 0.6932463 | 1 |
Return duration as timedelta. | def handle(self, value, context: typing.MutableMapping):
if isinstance(value, timedelta):
return value
elif isinstance(value, int):
return timedelta(milliseconds=int(value * self.resolution))
try:
return timedelta(
milliseconds=int(Decimal(valu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def duration(self) -> datetime.timedelta:\n return self._duration",
"def timedelta(self) -> datetime.timedelta:\n factor = -1 if self.negative else 1\n return datetime.timedelta(\n hours=factor * self.hours, minutes=factor * self.minutes\n )",
"def get_duration(self):\n ... | [
"0.7739758",
"0.7537782",
"0.7461609",
"0.74411243",
"0.7387828",
"0.7235751",
"0.72178787",
"0.72178787",
"0.7191434",
"0.71682596",
"0.71657807",
"0.71348643",
"0.7069964",
"0.70382273",
"0.6993275",
"0.698985",
"0.6984892",
"0.69740856",
"0.6935967",
"0.6885637",
"0.688563... | 0.0 | -1 |
Return a friendly HTTP greeting. | def get(self):
self.render('view.html') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_greeting(name):\n\n greeting = (f\"Hello, {name.title()}. It's nice to meet you!\")\n return greeting",
"def welcome():\n return 'Welcome to Flask!'",
"def greeting_message(name):\n print('My name is ' + name)",
"def Welcome():\n return (\n f\"Welcome to the Surf's Up API!\... | [
"0.67860854",
"0.6719625",
"0.67095745",
"0.6680697",
"0.6663219",
"0.6638394",
"0.6633062",
"0.6628187",
"0.6556032",
"0.6536937",
"0.64776874",
"0.6477268",
"0.64715713",
"0.64644194",
"0.6443056",
"0.6435385",
"0.6400719",
"0.6400167",
"0.637615",
"0.637615",
"0.6367243",
... | 0.0 | -1 |
Get Wind Direction Stability Scatter Figure. Plot the wind direction stability scatter of a given variable (or category of variables) grouped by a given condition (or set of conditions). | def stability_winddir_scatter(metdat, catinfo, category, vertloc=80, basecolor='red', exclude_angles=[(46, 228)]):
stabconds = utils.get_stabconds()
colors = utils.get_colors(len(stabconds),basecolor='span')
nrelcolors = utils.get_nrelcolors()
# Set up data
dircol, _, _= utils.get_vertical_lo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_scatter_wdir(x_wdir_series, y_wdir_series, x_label=None, y_label=None,\n x_limits=(0, 360), y_limits=(0, 360)):\n if x_label is None:\n x_label = x_wdir_series.name + ' [°]'\n if y_label is None:\n y_label = y_wdir_series.name + ' [°]'\n scat_plot = plot_scatter... | [
"0.66559976",
"0.6573864",
"0.6164912",
"0.5787601",
"0.5492207",
"0.52874935",
"0.5255771",
"0.5182858",
"0.51538205",
"0.51537097",
"0.5100614",
"0.50840086",
"0.50757194",
"0.5037733",
"0.50375617",
"0.50303334",
"0.5014262",
"0.5010639",
"0.5003671",
"0.50019526",
"0.5000... | 0.67901206 | 0 |
Returns the label associated with an instance's note_type. | def get_note_type_label(self):
id, note_type = self.NOTE_TYPE_CHOICES[self.note_type]
return note_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_label(cls):\r\n return cls._type_name(cls.label)",
"def get_label(cls):\n return cls._type_name(cls.label)",
"def label_type(self) -> str:\n return pulumi.get(self, \"label_type\")",
"def label(self) -> str:\n return self._underlying.label",
"def get_name_type_label(self... | [
"0.74779636",
"0.7477245",
"0.734536",
"0.65523994",
"0.6424233",
"0.6397581",
"0.63923883",
"0.6378323",
"0.6355385",
"0.63546616",
"0.63546616",
"0.63546616",
"0.63546616",
"0.6340338",
"0.6332156",
"0.6327013",
"0.6327013",
"0.6327013",
"0.6327013",
"0.6327013",
"0.6327013... | 0.8313583 | 0 |
Returns the label associated with an instance's variant_type. | def get_variant_type_label(self):
id, variant_type = self.VARIANT_TYPE_CHOICES[self.variant_type]
return variant_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_label(cls):\r\n return cls._type_name(cls.label)",
"def get_label(cls):\n return cls._type_name(cls.label)",
"def label_type(self) -> str:\n return pulumi.get(self, \"label_type\")",
"def get_name_type_label(self):\n id, name_type = self.NAME_TYPE_CHOICES[self.name_type]\n... | [
"0.76794106",
"0.76705414",
"0.71622086",
"0.6931583",
"0.66962516",
"0.64937234",
"0.6492316",
"0.6412995",
"0.6381852",
"0.6371005",
"0.6371005",
"0.6371005",
"0.6371005",
"0.6337221",
"0.6337221",
"0.632418",
"0.63064885",
"0.6300181",
"0.62756264",
"0.62536997",
"0.625356... | 0.8463431 | 0 |
Retrieves all Name objects that have an Active record status and are not merged with any other Name objects. | def visible(self):
return self.get_queryset().filter(
record_status=self.model.ACTIVE, merged_with=None) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def active(self):\n return self.filter(active=True)",
"def active_objects(self):\n return self._active_objects",
"def list_active_customers():\n init_database()\n return Customer.select().where(Customer.active_status).count()",
"def users_active(self):\n return self.users(\"inactiv... | [
"0.573245",
"0.54057163",
"0.5369031",
"0.5366051",
"0.53631514",
"0.5359773",
"0.5348273",
"0.5306778",
"0.5292781",
"0.52740806",
"0.5220222",
"0.5202809",
"0.5157408",
"0.51407903",
"0.5135581",
"0.50979877",
"0.50868213",
"0.50803673",
"0.50751674",
"0.50739914",
"0.50644... | 0.5284229 | 9 |
Calculates the number of Names by month according to the date_column passed in. This will return a ValueQuerySet where each element is in the form of { | def _counts_per_month(self, date_column):
def grouper(name):
return (getattr(name, date_column).year,
getattr(name, date_column).month)
def convert_key(year, month):
datetime_obj = datetime(year=year, month=month, day=1)
tzinfo = timezone.get_curr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_months(self):\n months = mcache.get_months()\n if months is not None:\n return months\n\n posts = self.base_query().fetch()\n names = []\n for post in posts:\n names.append('%d/%02d' % (post.date_published.year, post.date_published.month))\n ... | [
"0.5893774",
"0.5776333",
"0.5764562",
"0.5668571",
"0.5616421",
"0.5498272",
"0.5409395",
"0.53431386",
"0.52919984",
"0.52524847",
"0.52359885",
"0.5217198",
"0.5182471",
"0.5168364",
"0.5156918",
"0.5121955",
"0.5077757",
"0.50577384",
"0.5047405",
"0.5011774",
"0.4963014"... | 0.72177887 | 0 |
Returns a list of the number of Names created per month. | def created_stats(self):
return self._counts_per_month('date_created') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def orders_per_month():\n months = []\n month = 1\n for _ in range(12):\n months.append(Order.objects.filter(created__month=f'{month}').count())\n month += 1\n return months",
"def get_months(self):\n months = mcache.get_months()\n if months is not None:\n retu... | [
"0.7266339",
"0.67492783",
"0.65750355",
"0.6373555",
"0.635102",
"0.6151513",
"0.6058118",
"0.5962825",
"0.59505415",
"0.59505415",
"0.5905971",
"0.5892279",
"0.58562136",
"0.5767861",
"0.57602185",
"0.57081175",
"0.5678768",
"0.5664801",
"0.5613809",
"0.56133544",
"0.560193... | 0.70788836 | 1 |
Get the absolute url to the Name detail page. | def get_absolute_url(self):
return reverse('name:detail', args=[self.name_id]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_absolute_url(self):\n return reverse('name-detail', args=[str(self.id)])",
"def get_absolute_url(self):\n return reverse('structured-name-detail', args=[str(self.id)])",
"def get_absolute_url(self):\n return reverse('qualifier-name-detail', args=[str(self.id)])",
"def get_absolut... | [
"0.8379215",
"0.8287903",
"0.7458786",
"0.72039384",
"0.7195119",
"0.7185269",
"0.7146667",
"0.71287423",
"0.7105562",
"0.71013343",
"0.7083134",
"0.7078725",
"0.70766395",
"0.7051252",
"0.70459056",
"0.7045733",
"0.7040046",
"0.702496",
"0.7001649",
"0.69901264",
"0.69814223... | 0.83816564 | 0 |
True if the instance has one or more related Locations. | def has_geocode(self):
if self.location_set.count():
return True
else:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_valid(self):\n for location in self.locations.values():\n if not location.is_valid:\n return False\n return True",
"def is_island(self):\n return bool(not self.children.exists() and not self.parents.exists())",
"def has_current_location(self):\n retu... | [
"0.672408",
"0.6540387",
"0.6498398",
"0.6355618",
"0.62472194",
"0.6228896",
"0.60386276",
"0.59779376",
"0.59742",
"0.5946262",
"0.5944238",
"0.5886578",
"0.58795923",
"0.58748704",
"0.5872665",
"0.58403385",
"0.58367074",
"0.583446",
"0.5834089",
"0.5833635",
"0.5831239",
... | 0.69102573 | 0 |
True if the instance has a schema url. | def has_schema_url(self):
return self.get_schema_url() is not None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_url(self):\n return hasattr(self, \"_url\") and self._url is not None",
"def check_schema_uri(self):\n import asdf\n\n if self.schema_uri is not None:\n with log.augment_exception(\"Invalid ASDF schema URI:\", self.schema_uri):\n asdf.schema.load_schema(self... | [
"0.7385665",
"0.7253008",
"0.71321785",
"0.6716494",
"0.65870833",
"0.65679157",
"0.6527726",
"0.6379631",
"0.6324214",
"0.6283591",
"0.6263991",
"0.6259547",
"0.62323517",
"0.62118566",
"0.619182",
"0.61833054",
"0.61728114",
"0.6151307",
"0.6116028",
"0.6077104",
"0.6024767... | 0.9238091 | 0 |
True if the Name has the Deleted status. | def is_deleted(self):
return self._is_record_status(self.DELETED) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_deleted(self):\n if self.deleted:\n return True\n return False",
"def is_deleted(self):\n return self.state == TrackState.Deleted",
"def is_deleted(self):\n return self.state == TrackState.Deleted",
"def deleted(self) -> bool:\n return pulumi.get(self, \"d... | [
"0.76865155",
"0.7318823",
"0.7318823",
"0.7313983",
"0.7155666",
"0.71253496",
"0.7085702",
"0.688097",
"0.67141795",
"0.6706298",
"0.6405018",
"0.62997466",
"0.6246021",
"0.6180651",
"0.6165892",
"0.61252886",
"0.60292065",
"0.6022981",
"0.5963385",
"0.5961148",
"0.5870249"... | 0.75322896 | 1 |
Normalize the name attribute and assign it the normalized_name attribute. | def __normalize_name(self):
self.normalized_name = normalizeSimplified(self.name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def normalize_name(self):\n name = self.ua_data.get('name', '')\n if not name:\n return\n self.ua_data['name'] = self.normalized_name.get(name.lower(), name)",
"def normalize_name(cls, name):\n\t\treturn ' '.join(name.lower().strip().split())",
"def normalize_name(cls, name):\n\... | [
"0.8145657",
"0.7358192",
"0.7358192",
"0.7358192",
"0.73001164",
"0.71639097",
"0.70434594",
"0.66868776",
"0.66818297",
"0.6645059",
"0.66193527",
"0.6603514",
"0.65407497",
"0.6513661",
"0.6509814",
"0.64971495",
"0.6418087",
"0.64082617",
"0.63728404",
"0.63634264",
"0.63... | 0.8653227 | 0 |
Use the BaseTicketing object to assign a name_id. | def __assign_name_id(self):
if not self.name_id:
self.name_id = str(BaseTicketing.objects.create()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, id_, name):\n self._id = id_\n\n self._name = name\n self._name = self._name.title()",
"def name(self, name) :\n\t\ttry :\n\t\t\tself._name = name\n\t\texcept Exception as e:\n\t\t\traise e",
"def name(self, name):\n self._name = name",
"def name(self, name):\n ... | [
"0.6540638",
"0.6511959",
"0.63940686",
"0.63940686",
"0.63940686",
"0.63940686",
"0.63940686",
"0.63940686",
"0.63940686",
"0.63940686",
"0.63940686",
"0.63940686",
"0.63940686",
"0.63940686",
"0.6350768",
"0.6348479",
"0.6348479",
"0.6348479",
"0.6348479",
"0.63030946",
"0.... | 0.8805637 | 0 |
True if the value is specified but not equal to given value | def specifies_not_equal(self, key, value):
return self.current_state[key] != value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__( self, value ):\r\n\t\treturn not ( self == value )",
"def __ne__(self, value):\n return self.real == value",
"def __ne__(self, v):\n\t\treturn not (self == v)",
"def ne(self, val):\n\t\treturn NotEquals(self, val)",
"def are_not_equal(value1, value2):\n return not ObjectComparator... | [
"0.7900962",
"0.7695068",
"0.717268",
"0.7090686",
"0.7065771",
"0.7042022",
"0.7023445",
"0.6978899",
"0.69233185",
"0.69159967",
"0.69159967",
"0.6747208",
"0.6665396",
"0.6649007",
"0.6633002",
"0.65957606",
"0.65941167",
"0.6581698",
"0.6573916",
"0.65672916",
"0.6565411"... | 0.7632957 | 2 |
Contours (Shapely) of the image. This refere's to the wcs solution | def get_contours(self,pixel=True):
if not self.has_wcs():
raise NotImplementedError("Only WCS contours implemented and this has no wcs solution")
if pixel:
return self.wcs.contours_pxl
return self.wcs.contours | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def preprocessing(self, img):\n [a, contours, c] = cv2.findContours(img, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)\n return contours",
"def getContours(img):\n # mode: gets only exrteme outer contours\n # method: stores all contour points\n contours, hierarchy = cv2.findContours(img, mode=cv... | [
"0.7042124",
"0.7037773",
"0.70217437",
"0.6626976",
"0.65512246",
"0.6527685",
"0.6513463",
"0.6480915",
"0.64495337",
"0.6416148",
"0.63662136",
"0.6339927",
"0.633573",
"0.63300663",
"0.63069415",
"0.62716395",
"0.62647414",
"0.6234572",
"0.61648804",
"0.61507297",
"0.6128... | 0.67573464 | 3 |
Display the 2Dimage. The displayed information can be "data", "background", "rawdata", "variance" or anything known by self.`toshow` that is a 2D image. | def show(self,toshow="data",savefile=None,logscale=True,
ax=None,show=True,zoomon=None,zoom=200,zunits="pixels",
show_sepobjects=False,propsep={},
show_catalogue=False,proptarget={},
show_target=True,
localcircle=[None,"arcsec"],
add_colorbar... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show2d(self, data):\n self.__plot2d.clear()\n self.__plot2d.addImage(legend=\"data\", data=data)\n self.setCurrentIndex(self.__index2d)",
"def display(self):\n display(self.image)",
"def display(self, image):\n raise NotImplementedError()",
"def show(self) -> None:\n ... | [
"0.7079018",
"0.6938098",
"0.6810474",
"0.6672983",
"0.65725887",
"0.6550816",
"0.64947116",
"0.64207715",
"0.6418871",
"0.63853234",
"0.63503224",
"0.63487375",
"0.62995255",
"0.6278606",
"0.62592036",
"0.62469983",
"0.62454057",
"0.6224395",
"0.62240344",
"0.6220876",
"0.62... | 0.574892 | 90 |
Initialize the Samplers. Remark that all flux, fluxerr and lbda are requested to draw the samplers | def __init__(self, fluxsamples, lbda=None, empty=False, negative_fluxmag=None):
self.__build__()
if empty:
return
self.set_samplers(fluxsamples)
if lbda is not None:
self.set_lbda(lbda, negative_fluxmag=negative_fluxmag) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_samplers(self):\n for sampler in self.gltf.samplers:\n # Use a sane default sampler if the sampler data is empty\n # Samplers can simply just be json data: \"{}\"\n if sampler.minFilter is sampler.magFilter is None:\n self.samplers.append(\n ... | [
"0.72320765",
"0.6541044",
"0.65216345",
"0.6249392",
"0.6141176",
"0.60598165",
"0.6045578",
"0.59606373",
"0.5945856",
"0.5941458",
"0.5934796",
"0.590171",
"0.585322",
"0.5834441",
"0.5730423",
"0.57284707",
"0.56967485",
"0.5693186",
"0.5692392",
"0.5686067",
"0.5684817",... | 0.66458225 | 1 |
set the effective wavelength (in Angstrom) of the filter used to get the flux. This is requested to get magnitudes. If you derive the magnitudes (derived_mag=True) you can set the `negative_fluxmag`. If None, the negative fluxes will be ignored. | def set_lbda(self, lbda, derive_mag=True, negative_fluxmag=None):
self._properties["lbda"] = lbda
if derive_mag:
self.derive_magsamples(negative_fluxmag=negative_fluxmag) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_Mag_Value(self, input):\n self.magflux = input",
"def getMagFlux(self):\n return self.magflux",
"def set_flux(self, flux, var):\n self._properties[\"flux\"] = np.float(flux)\n self._properties[\"var\"] = np.float(var) if var is not None else np.NaN\n self._reset_deri... | [
"0.6607722",
"0.6282279",
"0.6223754",
"0.6169867",
"0.6124141",
"0.60669667",
"0.6050869",
"0.6018524",
"0.5906808",
"0.58183944",
"0.5804606",
"0.57989717",
"0.5795527",
"0.5795139",
"0.5759371",
"0.57186896",
"0.5703757",
"0.56988597",
"0.56535476",
"0.5628846",
"0.5611421... | 0.0 | -1 |
Change the name of the bandname. | def set_bandname(self,value):
if value is not None:
if type(value) != str and type(value) != np.string_:
raise TypeError("The bandname must be a string", type(value))
self._properties["bandname"] = value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bandname(self):\n if self._properties['bandname'] is None:\n self._properties['bandname'] = \"fuv\" if \"-fd-\" in self.filename else \"nuv\" if \"-nd-\" in self.filename \\\n else \"unknown\"\n return self._properties['bandname']",
"def new_name(self,new_name):\n ... | [
"0.7241578",
"0.69039625",
"0.6895791",
"0.6833014",
"0.6807056",
"0.6751194",
"0.6734371",
"0.6734371",
"0.6689476",
"0.6630472",
"0.66169816",
"0.6559574",
"0.65430295",
"0.65027386",
"0.6474839",
"0.6459341",
"0.6459341",
"0.64104074",
"0.64104074",
"0.64104074",
"0.641040... | 0.8280091 | 0 |
This method returns a list of fields (either its column specification, like c64_0_0 or its rename like myfield) that are of type integer. | def _get_integer_fields(self, columns):
int_columns = []
for col in columns:
if col == 'eid':
continue
match = re.search(Pheno2SQL.RE_FULL_COLUMN_NAME_RENAME, col)
if match is None:
continue
col_field = match.group('fiel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_fields(self, table):\n fields = list()\n for column in table.columns:\n fields.append({'id': column.name, 'type': str(column.type)})\n return fields",
"def column_types(self):\n return self._hndl.column_types()",
"def identify_numeric_columns(dataset):\n retur... | [
"0.68269765",
"0.6456442",
"0.6351034",
"0.6348163",
"0.63085",
"0.61558086",
"0.61520594",
"0.6149548",
"0.6130748",
"0.6124146",
"0.6053448",
"0.60428953",
"0.603779",
"0.6013474",
"0.5993608",
"0.5993608",
"0.59647644",
"0.5925211",
"0.59218806",
"0.59146714",
"0.59055597"... | 0.751693 | 0 |
Restricts queryset to participants that a researcher has permission to view. | def get_queryset(self):
valid_child_ids = self.valid_responses().values_list("child", flat=True)
return (
User.objects.filter(children__in=valid_child_ids)
.prefetch_related(
Prefetch(
"children", queryset=Child.objects.filter(id__in=valid_chil... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filter_queryset(self, queryset):\n user = self.request.user\n if user.is_superuser:\n return super().filter_queryset(queryset)\n return queryset.filter(collaborators=user)",
"def query_filters_restricted (self) :\n user = self.user_restriction\n if user is not No... | [
"0.68830305",
"0.6817467",
"0.6420612",
"0.6410337",
"0.63657975",
"0.6346137",
"0.63454413",
"0.6290058",
"0.6277561",
"0.6258345",
"0.62524164",
"0.61282426",
"0.61201954",
"0.6110073",
"0.6086972",
"0.60713714",
"0.60701144",
"0.60460436",
"0.6018136",
"0.59960234",
"0.597... | 0.0 | -1 |
Return the position of the mesh | def get_pos(self):
return self.pos | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def meshx(self):\n if self._meshx is None:\n self._meshx = self.get_mesh_coord(1)\n\n return self._meshx",
"def get_position(self):\n ret = _pal.Vec3()\n _pal.lib.geometry_get_position(self._geometry, ret)\n return [x for x in ret]",
"def getPosition(self):\n ... | [
"0.74844855",
"0.7165373",
"0.7056257",
"0.70084876",
"0.69951004",
"0.6929574",
"0.6929574",
"0.6929574",
"0.6929574",
"0.68559617",
"0.6853179",
"0.6848365",
"0.6839652",
"0.6839652",
"0.68380034",
"0.67717224",
"0.6768897",
"0.67412925",
"0.67412925",
"0.6738634",
"0.67321... | 0.66142356 | 24 |
Plot imshow with LST and frequency on axis | def plot_waterfall(d, freqs, lsts, t_unit='hr', f_unit='MHz',
raster=True):
plt.imshow(d, aspect='auto', interpolation='none',
rasterized=raster,
extent=(freqs[0], freqs[-1], lsts[0], lsts[-1]))
plt.xlabel("Frequency [%s]" % f_unit)
plt.ylabel("Time [%s]" % ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dat_imshow(x):\n plt.imshow(x,interpolation='nearest',aspect='auto')",
"def plot_img():\n plt.subplot(121)\n plt.imshow(data.data.numpy()[0,].squeeze())\n plt.subplot(122)\n plt.imshow(dec_mean.view(-1,28,28).data.numpy()[0,].squeeze())\n\n plt.show()\n plt.pause(1e-6)\n plt.gcf()... | [
"0.6595442",
"0.6546843",
"0.6486268",
"0.6478849",
"0.6407354",
"0.6405614",
"0.638233",
"0.638233",
"0.638233",
"0.6351962",
"0.6345301",
"0.6289991",
"0.6261279",
"0.6251073",
"0.6237511",
"0.6231321",
"0.6218993",
"0.62077045",
"0.62039596",
"0.61940545",
"0.61826867",
... | 0.60841966 | 26 |
Returns a chromosome after mutating the given chrom at a random position with the probability of m_prob | def mutate(self, chrom):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mutation(chrom, p_m=0.05):\n\n for i in range(len(chrom)):\n # generate number between 0 and 1, responsible for deciding\n # whether to appply mutation\n r = random.uniform(0, 1)\n\n # if r is smaller/equal the mutation probability, mutate!\n if r <= p_m:\n # g... | [
"0.7668443",
"0.6968176",
"0.6934928",
"0.6473813",
"0.6395521",
"0.635583",
"0.6326035",
"0.63115",
"0.60010433",
"0.5998952",
"0.59684354",
"0.59304327",
"0.58632594",
"0.5812154",
"0.57758886",
"0.56718475",
"0.5638582",
"0.5542621",
"0.5474017",
"0.54676455",
"0.5427838",... | 0.60303295 | 8 |
Returns an offspring obtained by applying crossover to the two given chromosomes, chrom1 and chrom2. If the crossover occurs at a random index i, then the offspring is created | def crossover(self, chrom1, chrom2):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def crossover(chromosome_1, chromosome_2):\n (x1, y1) = (randrange(col_count), randrange(row_count))\n (x2, y2) = (randrange(x1+1, col_count+1), randrange(y1+1, row_count+1))\n def mate(chromosome_1, chromosome_2):\n used = set(chromosome_1[x+y*col_count] for x in range(x1, x2) for ... | [
"0.7741972",
"0.71026045",
"0.69760233",
"0.6832219",
"0.65046716",
"0.631999",
"0.6303768",
"0.623347",
"0.6162992",
"0.61589414",
"0.61228406",
"0.6118747",
"0.61057234",
"0.60661435",
"0.6047666",
"0.6026608",
"0.60084987",
"0.60013145",
"0.59919107",
"0.5970242",
"0.59259... | 0.73467314 | 1 |
Returns a list of m chromosomes randomly selected from the given population using fitness proportionate selection. | def select(self, m, population):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def selection(pop, fitness, n_keep):\n total_fit = sum([1.0 / x for x in fitness])\n prob = []\n cumulative = 0.0\n for f in fitness:\n cumulative += ((1.0 / f) / total_fit)\n prob.append(cumulative)\n new_pop = []\n for i in range(len(pop) - n_keep):\n r = np.random.rand()\n... | [
"0.7132417",
"0.70821095",
"0.70478785",
"0.69175357",
"0.6856188",
"0.6800783",
"0.67463666",
"0.6634756",
"0.6626589",
"0.66166633",
"0.6573062",
"0.6564178",
"0.65358746",
"0.6531804",
"0.64658576",
"0.6442349",
"0.6423676",
"0.641488",
"0.6390252",
"0.6388689",
"0.6357823... | 0.62602013 | 28 |
Returns the list of vertices in the graph. | def vertices(self):
s = set([x for x in self.edges.keys()])
t = set([y for v in self.edges.values() for (y,d) in v.items()])
v = s.union(t)
return list(v) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vertices(self):\n return list(self._graph)",
"def vertices(self):\n return list(self.__graph.values())",
"def list_vertices(self):\n return list(self.graph_dict.keys())",
"def vertices(self):\n return list(self.graph_dict.keys())",
"def vertices(self):\n return list(s... | [
"0.89336514",
"0.88066614",
"0.8703548",
"0.85232145",
"0.8515054",
"0.8515054",
"0.8515054",
"0.84759367",
"0.8463788",
"0.82295424",
"0.82260996",
"0.817331",
"0.81516325",
"0.81507564",
"0.8129831",
"0.8116676",
"0.8029951",
"0.7917647",
"0.79126275",
"0.78899944",
"0.7887... | 0.77419245 | 23 |
Set the direction of the selected agents by deviating their current direction by an angle given by von mises distribution. | def set_direction_von_mises(self, arr_selected_agents, kappa):
arr_selected_agents = np.array(arr_selected_agents, dtype=bool)
pos_x = np.array(self.df_population['coord_x'], dtype=np.float)
pos_y = np.array(self.df_population['coord_y'], dtype=np.float)
pos_z = np.array(self.df_populat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_direction_to_north(self, arr_selected_agents):\n arr_selected_agents = np.array(arr_selected_agents, dtype=bool)\n\n pos_x = np.array(self.df_population['coord_x'], dtype=np.float)\n pos_y = np.array(self.df_population['coord_y'], dtype=np.float)\n pos_z = np.array(self.df_popul... | [
"0.621206",
"0.597278",
"0.5859308",
"0.5800002",
"0.5755136",
"0.5755136",
"0.5723313",
"0.5677956",
"0.5668672",
"0.5663365",
"0.56591505",
"0.56193614",
"0.55996156",
"0.5554558",
"0.5554558",
"0.5536821",
"0.55331975",
"0.5523699",
"0.5523263",
"0.552083",
"0.54946107",
... | 0.7386967 | 0 |
Returns the neighbour elements given the element position. | def find_excited_location_neighbours(self):
heart_cir = self._heart_circumference
heart_end = self._heart_end
excited_cell_list = []
for excited_location in Heart.find_excited_locations(self):
x = excited_location[0]
y = excited_location[1]
excited_ce... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def element_neighbors(self):\n if self.element_neighbors_data is not None:\n return self.element_neighbors_data\n\n max_nr_edges = self.header['element_infos'][0, 2]\n\n # initialize the neighbor array\n self.element_neighbors_data = []\n self.element_neighbors_edges =... | [
"0.6952352",
"0.68906534",
"0.67226654",
"0.6646848",
"0.6631842",
"0.65668446",
"0.65414554",
"0.651502",
"0.6505405",
"0.64814734",
"0.64392084",
"0.6421696",
"0.6405796",
"0.6353888",
"0.6351741",
"0.6312198",
"0.63070565",
"0.6304033",
"0.62928617",
"0.6265332",
"0.625952... | 0.0 | -1 |
Test API to get bucketlist by id when id does not exist | def test_api_get_bucketlist_by_id_not_exist(self):
res = self.client().get(f"/bucketlist/99")
self.assertEqual(res.status_code, 404) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_no_bucket_returned_by_given_id(self):\n with self.client:\n token = self.get_user_token()\n\n response = self.client.get(\n '/bucketlists/1',\n headers=dict(Authorization='Bearer ' + token)\n )\n data = json.loads(response.da... | [
"0.8452869",
"0.8115867",
"0.8113846",
"0.767868",
"0.73052067",
"0.72711307",
"0.72450787",
"0.715663",
"0.69706464",
"0.6965228",
"0.69445795",
"0.6921409",
"0.6859074",
"0.6812505",
"0.6802468",
"0.67841727",
"0.6780305",
"0.6775552",
"0.67690146",
"0.67414135",
"0.6733725... | 0.8581222 | 0 |
Test API to edit bucketlist (PUT Request) | def test_api_edit_bucketlist(self):
res_post = self.client().post('/bucketlist', data={'name': 'Wake up, Eat, Code, Sleep & Repeat'})
self.assertEqual(res_post.status_code, 201)
res_post_in_json = json.loads(res_post.data.decode('UTF-8').replace("'", "\""))
id = res_post_in_json['id']
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_edit_bucketlist(self):\n post_data = self.post_a_bucket()\n self.assertEqual(post_data.status_code, 201)\n result_of_put_method = self.client().put(\n '/bucketlists/1',\n headers=dict(Authorization='Bearer '\n + self.token()\n ... | [
"0.8703054",
"0.7808431",
"0.73537976",
"0.7250397",
"0.72338814",
"0.7148291",
"0.7121116",
"0.6990683",
"0.6962019",
"0.6898072",
"0.6881871",
"0.68014103",
"0.67995316",
"0.67813414",
"0.6766084",
"0.6743543",
"0.67432564",
"0.6681097",
"0.6671989",
"0.66679364",
"0.664234... | 0.86224693 | 1 |
Return a MongoDB collection for the passed name. | def set_collection(cls, collection_name):
return Database.db()[collection_name] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_collection(db, name):\n\n if db.hasCollection(name) is False:\n return db.createCollection(name=name)\n\n return db[name]",
"def get_db_collection(db_name, collection_name):\n\n # Create a connection to the mongodb instance. \n # Passing no parameters will connect to default host (loca... | [
"0.84404695",
"0.79067606",
"0.7540072",
"0.7426461",
"0.72409904",
"0.7238661",
"0.7229681",
"0.7153125",
"0.7047086",
"0.68828183",
"0.68782574",
"0.6820162",
"0.6805131",
"0.6801796",
"0.67250705",
"0.6653849",
"0.6617294",
"0.65541834",
"0.6530393",
"0.647048",
"0.6439306... | 0.74381703 | 3 |
Instantiate with data in `record`. | def __init__(self, record=None):
self.record = record | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _new_record():\n nonlocal key\n nonlocal value_list\n nonlocal record\n nonlocal origin\n nonlocal field_offset_map\n key = None\n value_list = None\n if source is not None:\n origin = Origin(source, None, None)\n field_offset_map = {}\n... | [
"0.7235988",
"0.7165694",
"0.6930202",
"0.6895159",
"0.6846218",
"0.6821071",
"0.68088585",
"0.66876",
"0.66790855",
"0.6578508",
"0.6575916",
"0.6553236",
"0.6496165",
"0.6494365",
"0.64263445",
"0.6400598",
"0.639081",
"0.6372391",
"0.63090974",
"0.6307076",
"0.6273901",
... | 0.7857227 | 0 |
Append a transition to this replay buffer. | def append(self, state, action, reward, next_state=None, next_action=None,
is_state_terminal=False):
raise NotImplementedError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def storeTransition(self, transition):\n self.buffer.append(transition)",
"def add(self, transition: Tuple[np.ndarray, ...]) -> Tuple[Any, ...]:\n self.n_step_buffer.append(transition)\n\n # single step transition is not ready\n if len(self.n_step_buffer) < self.n_step:\n r... | [
"0.7663282",
"0.718715",
"0.712925",
"0.69533914",
"0.6947914",
"0.6947191",
"0.68793166",
"0.6812801",
"0.6733622",
"0.6583606",
"0.65735734",
"0.654736",
"0.65000296",
"0.6462874",
"0.64273465",
"0.62920296",
"0.6190002",
"0.61723566",
"0.6153173",
"0.6118729",
"0.60905623"... | 0.5877804 | 31 |
Test instantiation of base object | def test_base_agave_object(self):
base_object = BaseAgaveObject(api_client=self.IDS_SYS_CLIENT)
self.assertIsNotNone(base_object)
self.assertEqual(base_object._api_client, self.IDS_SYS_CLIENT) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_base_object_create(self):\n obj1 = Base()\n test1 = str(obj1)\n self.assertTrue(test1[:50], '<models.base.Base object at ')\n self.assertTrue(obj1.id, 1)\n\n obj2 = Base(420)\n test2 = str(obj2)\n self.assertTrue(test2[:50], '<models.base.Base object at ')\... | [
"0.75064766",
"0.7350004",
"0.7156196",
"0.70872116",
"0.707545",
"0.7049001",
"0.7021522",
"0.70207465",
"0.6986435",
"0.6966611",
"0.69528365",
"0.6835019",
"0.6835019",
"0.68020636",
"0.6798122",
"0.67937195",
"0.6790586",
"0.676744",
"0.67331874",
"0.6704704",
"0.6690436"... | 0.67533976 | 18 |
Return the most recent round number in which the current leader was previously leader. | def prev_round_with_same_leader(self):
for r in range(self.round - 1, 0, -1):
if self.leaders[r] == self.leader:
return r
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def latest_score(self):\r\n if not self.child_history:\r\n return None\r\n return self.score_for_attempt(-1)",
"def latest_score(self):\r\n if not self.child_history:\r\n return None\r\n return self.child_history[-1].get('score')",
"def get_current_turn(self):\... | [
"0.6638657",
"0.6398866",
"0.6312401",
"0.630607",
"0.62277234",
"0.61071503",
"0.61071503",
"0.6046409",
"0.60040575",
"0.59547776",
"0.59475803",
"0.5873872",
"0.58482575",
"0.58208615",
"0.5816444",
"0.58012736",
"0.5780201",
"0.5770921",
"0.57672983",
"0.57581395",
"0.575... | 0.7695777 | 0 |
Returns the next message from the message queue without removing it. | def next_message(self) -> Optional[MessageQueueItem]:
if self._message_queue:
return self._message_queue[0]
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pop_next_message(self):\n messages = self._msq_queue.receive_messages(\n AttributeNames=['All'],\n MessageAttributeNames=['All'],\n MaxNumberOfMessages=1,\n VisibilityTimeout=self._vis_timeout,\n WaitTimeSeconds=self._wait_time,\n )\n ... | [
"0.79111135",
"0.7808662",
"0.76835024",
"0.7362662",
"0.73599327",
"0.7308949",
"0.7258198",
"0.7168249",
"0.71140194",
"0.7090979",
"0.70531934",
"0.70370066",
"0.69149953",
"0.69149953",
"0.6863086",
"0.68589836",
"0.6842349",
"0.6840149",
"0.68179965",
"0.6813469",
"0.677... | 0.87598956 | 0 |
Compute RMS difference between two Numeric vectors. | def diffStats(name1, vals1, name2, vals2):
from Stats import Stats
label = name2 + ' - ' + name1
diff = vals2 - vals1
return Stats().label(label).addm(diff) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rmsd(a,b):\n\tDi=[]\n\tfor i in range(len(a)):\n\t\tD=((a[i][0]-b[i][0])**2+(a[i][1]-b[i][1])**2+(a[i][2]-b[i][2])**2)\n\t\tDi.append(D)\n\tRMSD=sqrt(0.01*fsum(Di))\n\treturn RMSD",
"def fit_rms(a,b):\n\tif len(a)!=len(b):\n\t\traise ValueError('Input vectors have unequal lengths.')\n\treturn rms(np.subtract... | [
"0.7263409",
"0.6774092",
"0.6655138",
"0.66530836",
"0.6575068",
"0.65204257",
"0.6507846",
"0.6381194",
"0.62833047",
"0.625324",
"0.62486935",
"0.6236806",
"0.61763144",
"0.6148883",
"0.6089612",
"0.6081539",
"0.60053456",
"0.6001604",
"0.6000584",
"0.59957194",
"0.5977787... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.