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 |
|---|---|---|---|---|---|---|
Return the name of this entity. | def name(self):
return self._name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def entity_name(self):\n return self.__entity_name",
"def get_name(self) -> str:\n return self.name",
"def get_name(self) -> str:\n return self.name",
"def get_name(self) -> str:\n return self.name",
"def get_name(self) -> str:\n\n return self.name_",
"def name(self):\n... | [
"0.8896158",
"0.83494925",
"0.83494925",
"0.83494925",
"0.83492255",
"0.83472687",
"0.83090514",
"0.83090514",
"0.8295769",
"0.8295769",
"0.82843965",
"0.82720363",
"0.82517374",
"0.8249726",
"0.8249726",
"0.8249726",
"0.8249726",
"0.8249726",
"0.8249726",
"0.8249726",
"0.824... | 0.0 | -1 |
Return device specific state attributes. | def device_state_attributes(self):
node = self.gateway.sensors[self.node_id]
child = node.children[self.child_id]
attr = {
ATTR_BATTERY_LEVEL: node.battery_level,
ATTR_HEARTBEAT: node.heartbeat,
ATTR_CHILD_ID: self.child_id,
ATTR_DESCRIPTION: child... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def device_state_attributes(self):\r\n return self.attributes",
"def device_state_attributes(self):\n return self.attr",
"def device_state_attributes(self):\n return self.attr",
"def device_state_attributes(self): # Can be remove from 0.99\n return self._attr",
"def device_stat... | [
"0.87326586",
"0.87130606",
"0.87130606",
"0.8661474",
"0.86244243",
"0.86244243",
"0.86156",
"0.8589153",
"0.85687816",
"0.85626554",
"0.85169643",
"0.84891194",
"0.84891194",
"0.84891194",
"0.84891194",
"0.84891194",
"0.84891194",
"0.84891194",
"0.84891194",
"0.84891194",
"... | 0.7913699 | 63 |
Gets set id for this test set. | def setid(self):
return self.__setid | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def data_set_id(self) -> str:\n return self.__data_set_id",
"def set_ident(self) -> int:\n return self._set_id",
"def target_set_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"target_set_id\")",
"def get_id(self):\n\n\t\treturn self.__id",
"def get_id(self):\n return... | [
"0.7612788",
"0.7225671",
"0.70273244",
"0.6457544",
"0.64520437",
"0.64520437",
"0.64520437",
"0.64520437",
"0.64520437",
"0.64520437",
"0.64496386",
"0.643195",
"0.64304936",
"0.64304936",
"0.6424694",
"0.6402841",
"0.6402841",
"0.6402841",
"0.6402841",
"0.6402841",
"0.6402... | 0.7679466 | 0 |
Return the home html file | def index(request):
return render(request, 'home.html') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def home():\n return render_template('homepage.html')",
"def home_page() -> str:\r\n return render_template(\"home.html\")",
"def get_home():\n return render_template(\"home.html\")",
"def home():\n return render_template(\"home.html\")",
"def home():\n return render_template(\"home.html\")"... | [
"0.79395235",
"0.7933178",
"0.78785425",
"0.77922004",
"0.77922004",
"0.7783674",
"0.7780822",
"0.7780822",
"0.7780822",
"0.7780822",
"0.7780822",
"0.7780822",
"0.7780822",
"0.7780822",
"0.7780822",
"0.7780822",
"0.7780822",
"0.7780822",
"0.7780822",
"0.7780822",
"0.7780822",... | 0.0 | -1 |
Return all input tensor names defined in the graph. | def collect_inputs(graph_def):
collection, outputs = set(), {''}
if hasattr(graph_def, 'op'):
ops = graph_def.op
elif hasattr(graph_def, 'node'):
ops = graph_def.node
else:
raise ValueError('GraphDef dose not have attr <op> or <node>.')
for op in ops:
for input in op.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_input_names(self):\n inputNames = []\n for inVar in self.inputs:\n # inVar is of type InOutVar and the object that it contains is a PyFMI variable\n inputNames.append(inVar.get_object().name)\n return inputNames",
"def get_input_names(self):\n return self._in... | [
"0.72187924",
"0.7095354",
"0.6925131",
"0.6736828",
"0.66923285",
"0.66857135",
"0.6684789",
"0.6664351",
"0.66202825",
"0.65689266",
"0.6541566",
"0.6527553",
"0.65040815",
"0.64884186",
"0.6481652",
"0.64691085",
"0.6430708",
"0.64019746",
"0.63909775",
"0.63857746",
"0.63... | 0.5882511 | 45 |
Return the value of a tensor argument. | def fetch_argument(op_def, arg, ws):
desc = arg if isinstance(arg, bytes) else arg.s
if sys.version_info >= (3, 0):
desc = desc.decode('utf-8')
desc = desc.replace('$HANDLE', op_def.name)
value = ws.get_tensor(desc).ToNumpy()
if value.size == 1:
return value.flatten()[0]
return v... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def value(self):\n if not self.isscalar():\n raise ValueError(\"value called on a non-scalar tensor.\")\n else:\n return self.defval",
"def scalar(val: torch.Tensor):\n return val.item()",
"def tensor(*args, **kwargs):\n return Tensor(*args, **kwargs)",
"def __call__... | [
"0.75215",
"0.7357786",
"0.68471634",
"0.6833459",
"0.6769256",
"0.6682887",
"0.6666343",
"0.6576867",
"0.6519469",
"0.64855105",
"0.6476631",
"0.6404168",
"0.6396344",
"0.63678443",
"0.6253142",
"0.6236389",
"0.61960393",
"0.61854583",
"0.6123141",
"0.608457",
"0.60721207",
... | 0.58617723 | 35 |
Returns a timestamp per ISO 8601 | def _generate_timestamp():
return strftime("%Y%m%dT%H%M%S") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_timestamp():\n return '{}Z'.format(\n datetime.datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S.%f')[:-3]\n )",
"def ts_datetime(val):\n return val.isoformat() + \"Z\"",
"def timet_iso(t=time.time()):\n return datetime.datetime.now().isoformat()[0:19]",
"def _timestamp():... | [
"0.76862216",
"0.75397044",
"0.73823166",
"0.7311504",
"0.73027974",
"0.72895986",
"0.7258926",
"0.72511864",
"0.7190431",
"0.71315944",
"0.70913875",
"0.70826674",
"0.7047653",
"0.70120203",
"0.70009935",
"0.69954664",
"0.69491893",
"0.691869",
"0.68864244",
"0.6858347",
"0.... | 0.7025689 | 13 |
Hash a password for storing. | def hash_password(password):
salt = hashlib.sha256(os.urandom(60)).hexdigest().encode('ascii')
pwdhash = hashlib.pbkdf2_hmac('sha512', password.encode('utf-8'),salt,100000)
pwdhash = binascii.hexlify(pwdhash)
return (salt+pwdhash).decode('ascii') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hash_password(self):\n self.__password = self.str_to_hash(self.__password)",
"def hash_password(self, password):\n self.password = pwd_context.encrypt(password)",
"def hash_password(self, password):\n self.password_hash = generate_password_hash(password)",
"def hash_passwd(password, ... | [
"0.847967",
"0.8346137",
"0.82644516",
"0.80417943",
"0.7999399",
"0.7979167",
"0.7971465",
"0.7947968",
"0.7919728",
"0.78821445",
"0.78162515",
"0.77545875",
"0.77411246",
"0.766462",
"0.76507545",
"0.76267356",
"0.75862885",
"0.75638247",
"0.7549114",
"0.75445807",
"0.7519... | 0.755944 | 18 |
Returns the density ratio at which a given rpm produces a given manifold pressure at full throttle. | def _DR_FT_from_MP(rpm, MP):
if MP >= 28:
mp1 = 28
elif MP <= 12:
mp1 = 12
else:
mp1 = MP - MP % 2
mp2 = mp1 + 2
DR1 = DR_FT_alt[rpm][mp1]
DR2 = DR_FT_alt[rpm][mp2]
DR_rpm = DR1 + (MP - mp1) * (DR2 - DR1) / (mp2 - mp1)
return DR_rpm | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cuttingSpeed(self, diameter, rpm):\n return (math.pi * diameter * rpm)/12",
"def _density(self):\n fraction = np.array([0.]+[m.value for m in self.fraction])\n # TODO: handle invalid fractions using penalty functions\n # S = sum(fraction)\n # scale = S/100 if S > 100 else 1... | [
"0.6489943",
"0.6160069",
"0.6150237",
"0.6136697",
"0.61085963",
"0.6018846",
"0.5991893",
"0.59440553",
"0.5900421",
"0.5880482",
"0.5875776",
"0.5862124",
"0.58546954",
"0.5819689",
"0.5818343",
"0.58016974",
"0.57967865",
"0.57885194",
"0.57442427",
"0.57409024",
"0.57377... | 0.5488019 | 38 |
Returns the horsepower at full throttle at a given rpm and altitude. | def _hp_at_FT(rpm, altitude):
# get density ratio from the altitude
DR = SA.alt2density_ratio(altitude)
# get power at rpm
hp_sl = HP_FT[rpm]['hp_sl']
hp_23K = HP_FT[rpm]['hp_23K']
hp_at_FT = hp_sl - (1 - DR) * (hp_sl - hp_23K) / (1 - DR_23K)
return hp_at_FT | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _pwr_std_temp(rpm, MP, altitude):\n # get the power at sea level (i.e. point B on the left side of the Lycoming power chart)\n \n # get pwr at two even hundreds of rpm, and then interpolate\n if rpm >= 2600:\n rpm1 = 2600\n elif rpm <= 1800:\n rpm1 = 1800\n else:\n rpm1 =... | [
"0.670079",
"0.6492461",
"0.60579807",
"0.57500625",
"0.5696251",
"0.5591175",
"0.5575474",
"0.5567831",
"0.5548539",
"0.5548411",
"0.5490819",
"0.5474912",
"0.5444569",
"0.54275835",
"0.5416151",
"0.5413709",
"0.5355762",
"0.5347962",
"0.5345135",
"0.5331719",
"0.5326029",
... | 0.70600414 | 0 |
Returns the power and density ratio at a given rpm and MP at full throttle. | def _hp_at_MP_and_altitude(rpm, MP):
# get density ratio for this MP and altitude, at full throttle
DR = _DR_FT_from_MP(rpm, MP)
# get power at this condition
altitude = SA.density_ratio2alt(DR)
hp = _hp_at_FT(rpm, altitude)
return hp, DR | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _pwr_std_temp(rpm, MP, altitude):\n # get the power at sea level (i.e. point B on the left side of the Lycoming power chart)\n \n # get pwr at two even hundreds of rpm, and then interpolate\n if rpm >= 2600:\n rpm1 = 2600\n elif rpm <= 1800:\n rpm1 = 1800\n else:\n rpm1 =... | [
"0.6615068",
"0.6342144",
"0.61372244",
"0.6133213",
"0.60578066",
"0.59942627",
"0.59933364",
"0.5912659",
"0.5883268",
"0.58807445",
"0.58509046",
"0.5815233",
"0.57769156",
"0.5711127",
"0.5676773",
"0.56375843",
"0.5597784",
"0.55970603",
"0.55600506",
"0.5537246",
"0.550... | 0.6720952 | 0 |
Returns fuel flow. Defaults to mixture for best power ("pwr"), but may also be used with mixture for best economy ("econ"). Fuel flow units default to USG/hr, but pounds per hour ("lb/hr") and litres per hour ("l/hr") may also be selected. | def pwr2ff(pwr, rpm, mixture = 'pwr', ff_units = 'gph'):
if mixture == 'pwr':
if rpm >= 2600:
rpm1 = 2600
rpm2 = 2700
elif rpm >= 2400:
rpm1 = 2400
rpm2 = 2600
elif rpm >= 2200:
rpm1 = 2200
rpm2 = 2400
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fuelconsumption(self):\n self.convert_window(\"Fuel Consumption\", \"liters/100 kilometer\", [\"car(2014 US Average)\", \"gallon(UK)/100 miles\", \"gallon(US)/100 miles\", \"kilometer/liter\", \"liters/100 kilometer\", \"liters/meter\", \"miles/gallon(UK)\", \"miles/gallon(US)\"])",
"def get_remaining... | [
"0.5946324",
"0.59424746",
"0.5745323",
"0.5691712",
"0.559113",
"0.5558082",
"0.55569834",
"0.5515621",
"0.551311",
"0.55106956",
"0.54426336",
"0.5414112",
"0.5369306",
"0.53222626",
"0.52677715",
"0.5266878",
"0.5248871",
"0.5217561",
"0.5202962",
"0.51956296",
"0.51956296... | 0.5614236 | 4 |
Given bounds of the form [[x_min, x_max],[y_min, y_max]] return the area of the described rectangle. | def _area(bounds):
return (bounds[0, 1] - bounds[0, 0]) * (bounds[1, 1] - bounds[1, 0]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rect_area(rect):\n return rect[2] * rect[3]",
"def area_rect(w, h):\n return w * h",
"def rectangle_area(coordinates):\n return (coordinates[2] - coordinates[0]) * (coordinates[3] - coordinates[1])",
"def rectangle_area(base, height):\n return (base * height)",
"def rectArea(base, height):\... | [
"0.76508164",
"0.7607309",
"0.7462141",
"0.73754925",
"0.721451",
"0.71700054",
"0.7097508",
"0.704826",
"0.6900583",
"0.68721724",
"0.683904",
"0.6800166",
"0.67838025",
"0.67597103",
"0.6751761",
"0.6751761",
"0.6746655",
"0.67107785",
"0.6704145",
"0.67017585",
"0.6648099"... | 0.8262736 | 0 |
Broadcast an array to a target shape. | def broadcast_array(array, axis_index, shape):
if type(axis_index) in [float, int]:
start_axis_index = end_axis_index = axis_index
else:
assert len(axis_index) == 2
start_axis_index, end_axis_index = axis_index
dim = start_axis_index - 1
while dim >= 0:
array = arra... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def broadcast_to(x, shape):\n if x.shape == shape:\n return chainer.as_variable(x)\n y, = BroadcastTo(shape).apply((x,))\n return y",
"def relay_distribute(c, array, shape):\n assert shape.is_constant(tuple)\n # Make sure shape is a tuple of builtin Python integers.\n relay_shape = tuple... | [
"0.6918194",
"0.6413195",
"0.6309866",
"0.5963478",
"0.55756885",
"0.5518553",
"0.5475983",
"0.54576737",
"0.5445085",
"0.5391392",
"0.5333",
"0.5329016",
"0.5266595",
"0.52479815",
"0.5236618",
"0.5231119",
"0.5172915",
"0.51645386",
"0.5159238",
"0.5156939",
"0.51118803",
... | 0.6021787 | 3 |
Filter dictionary according to specified keys. | def dict_filter(indict, key_list):
return dict((key, value) for key, value in list(indict.items()) if key in key_list) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _filter_keys(d: dict, keys: set) -> dict:\n return {key: d[key] for key in keys if key in d}",
"def dict_filter(d, keys, into=dict):\n \n if hasattr(keys, \"__call__\"):\n f = keys\n keys = filter(f, d.keys())\n return into(map(lambda k:(k,d[k]), keys))",
"def filter_dic_by_ke... | [
"0.7930761",
"0.78764176",
"0.7741155",
"0.76546943",
"0.75392926",
"0.7358723",
"0.7302243",
"0.7277782",
"0.7248452",
"0.72335577",
"0.7135989",
"0.712751",
"0.70455676",
"0.70406085",
"0.703766",
"0.689502",
"0.68690187",
"0.68505603",
"0.6831804",
"0.6765758",
"0.6752565"... | 0.7394921 | 5 |
Find the closest array item to value. | def find_nearest(array, value, index=False):
idx = (numpy.abs(numpy.array(array) - value)).argmin()
error = array[idx] - value
if index:
return idx, error
else:
return array[idx], error | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def closest(array, value):\n idx = (np.abs(array-value)).argmin()\n return idx",
"def find_nearest(array, value):\n idx = (np.abs(array-value)).argmin()\n return array[idx]",
"def find_nearest(array, value):\n idx = (np.abs(array-value)).argmin()\n return array[idx]",
"def find_nearest(arra... | [
"0.77864516",
"0.773474",
"0.773474",
"0.77311647",
"0.76984245",
"0.75918335",
"0.75688106",
"0.74678254",
"0.7455249",
"0.74242896",
"0.74242896",
"0.7370131",
"0.73672867",
"0.72797984",
"0.72606367",
"0.7259429",
"0.71078265",
"0.70479393",
"0.6948239",
"0.6927688",
"0.68... | 0.6979301 | 18 |
Instantiate a new queue. | def new_queue() -> Queue:
return multiprocessing.Queue() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _queue_create(self, **kwargs):\n name = self.generate_random_name()\n return self.clients(\"zaqar\").queue(name, **kwargs)",
"def instantiate_queue(self):\n serialized_queue = self.cache.get('queue')\n queue = ast.literal_eval(serialized_queue.decode('utf-8'))\n return queu... | [
"0.7841289",
"0.75244033",
"0.7522018",
"0.74640113",
"0.7422767",
"0.7313239",
"0.723213",
"0.7230453",
"0.71969986",
"0.7086344",
"0.7086344",
"0.7086344",
"0.7086344",
"0.7086344",
"0.7081707",
"0.706328",
"0.7062478",
"0.7062478",
"0.7062478",
"0.7062478",
"0.7044726",
... | 0.79009104 | 0 |
Get X509 extension count. | def get_ext_count(self):
return m2.x509_get_ext_count(self.x509) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getNumExtension(self, *args):\n return _libsbml.SBMLExtensionRegistry_getNumExtension(self, *args)",
"def getNumCerts(self):\r\n return len(self.x509List)",
"def unknown_extension_count():\n extensions = []\n for ext in Statistics.all_unknown_extension():\n extensions.append(\n ... | [
"0.70555073",
"0.6305053",
"0.6111253",
"0.600512",
"0.5943954",
"0.58774674",
"0.58276004",
"0.5725417",
"0.5680908",
"0.56491846",
"0.5628155",
"0.56208456",
"0.55440754",
"0.5529577",
"0.5495404",
"0.5487244",
"0.5483188",
"0.5457494",
"0.54472035",
"0.54180956",
"0.541087... | 0.8695183 | 0 |
Build dataframes containing evaluated symbolic functions. | def build_dataframes(self, ode_sols: list, used_fs: list):
# Create empty lists to house the stacked theta's and u's
dataframes = []
# Create the dataframes
for sol, f in zip(ode_sols, used_fs):
# Prepare independent variable
x_data = sol.t
x = Indepe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def runCalculators(series, calculators=[]):\n df_obj = {}\n for ind, fn in enumerate(calculators):\n df_obj[fn.__name__] = fn(series)\n return pd.DataFrame(df_obj)",
"def make_df(raw_data, variables):\n vars = []\n for v in requirement_order(variables):\n vars.append(v(raw_data))\n ... | [
"0.65260476",
"0.5977529",
"0.58888173",
"0.5824303",
"0.5801469",
"0.5783029",
"0.5741829",
"0.5653855",
"0.5553497",
"0.55050355",
"0.548221",
"0.5481139",
"0.54733086",
"0.5439582",
"0.5430116",
"0.5391746",
"0.5342683",
"0.53277475",
"0.52953726",
"0.5292279",
"0.52898544... | 0.6206946 | 1 |
Assert that any of the model types support "equal" comparisons against expected types. | def test_model_supports_eq_with_expected_types(model_with_eq_bytes):
model_type, equal_bytes = model_with_eq_bytes
model = model_type(equal_bytes)
assert model == model_type(equal_bytes)
assert model == bytes(equal_bytes)
assert model == bytearray(equal_bytes)
assert model == memoryview(equal_b... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_types_are_equal(self):\n self.assertEqual(True, comparator.types_are_equal(None, None))\n self.assertEqual(True, comparator.types_are_equal(True, True))\n self.assertEqual(True, comparator.types_are_equal(True, False))\n self.assertEqual(True, comparator.types_are_equal(int(), ... | [
"0.7583787",
"0.70162624",
"0.69057155",
"0.678198",
"0.6744791",
"0.669955",
"0.6672378",
"0.66065145",
"0.6586775",
"0.65678626",
"0.655128",
"0.6521056",
"0.65021616",
"0.64980686",
"0.64774406",
"0.6442611",
"0.640196",
"0.636395",
"0.6363593",
"0.63635164",
"0.6357821",
... | 0.74301857 | 1 |
Takes in valid file path, returns dict of json output | def load_json(path):
import json
def _load_json(*args, **kwargs):
with open(path) as data_file:
return json.load(data_file)
return _load_json() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_json_file(self, fname):\n return {}",
"def get_json(filename) :\n result = json.load(open(filename,'r'))\n return result",
"def json_dict(path):\n json_file=open(path)\n json_str = json_file.read()\n json_data = loads(json_str)\n return json_data",
"def json_dict(path):\n ... | [
"0.75435334",
"0.7382354",
"0.7318951",
"0.72940236",
"0.71253276",
"0.70528173",
"0.7038496",
"0.7038227",
"0.70150024",
"0.6980671",
"0.6977913",
"0.69599766",
"0.69317627",
"0.69278425",
"0.6914285",
"0.68943906",
"0.68664026",
"0.6849014",
"0.6827581",
"0.6826417",
"0.682... | 0.6236423 | 99 |
Testing "conf_interval" function, normal method, no slices have enough samples | def test_conf_interval_normal_method_fallback(data):
df = data["df"]
df = df.sample(n=10)
new_df = data["new_df"]
# ``quantile_estimation_method = "normal_fit"``
# fallback expected for all slices as df is small (10)
# and ``sample_size_thresh`` is large (20)
with pytest.warns(Warning):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_conf_interval_normal_method_with_bounds(data):\n df = data[\"df\"]\n new_df = data[\"new_df\"]\n # ``quantile_estimation_method = \"normal_fit\"``\n # with enforced lower limit (``min_admissible_value``)\n ci_model = conf_interval(\n df=df,\n value_col=\"y\",\n residual... | [
"0.67586243",
"0.66923",
"0.6617031",
"0.6604541",
"0.6489499",
"0.64478433",
"0.6429191",
"0.63606536",
"0.6318297",
"0.62879133",
"0.6199159",
"0.6172652",
"0.61325",
"0.60761166",
"0.60562444",
"0.6049863",
"0.60399145",
"0.6022082",
"0.59907657",
"0.5985368",
"0.594623",
... | 0.6539714 | 4 |
Testing "conf_interval" function, normal method, with no conditioning. | def test_conf_interval_normal_method_no_conditionals(data):
df = data["df"]
new_df = data["new_df"]
# ``quantile_estimation_method = "normal_fit"``;
# with no ``conditional_cols``
ci_model = conf_interval(
df=df,
value_col="y",
residual_col="residual",
conditional_col... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_interval(self):\n\n\t\tself.assertEqual(self.interval, self.tracker.server_class.interval)",
"def test_interval(self):\n space = Space()\n probs = (0.1, 0.2, 0.3, 0.4)\n categories = (\"asdfa\", 2, 3, 4)\n dim = Categorical(\"yolo\", OrderedDict(zip(categories, probs)), shape... | [
"0.6521694",
"0.64755964",
"0.64601326",
"0.63855517",
"0.63650644",
"0.6248469",
"0.62321806",
"0.6211536",
"0.61683774",
"0.61659425",
"0.60759526",
"0.606888",
"0.605436",
"0.604148",
"0.6028188",
"0.5997982",
"0.5972774",
"0.59567285",
"0.59217346",
"0.5901854",
"0.589964... | 0.61895114 | 8 |
Testing "conf_interval" function, normal method, no small sample size calculation | def test_conf_interval_normal_method_no_small_sample_calc(data):
df = data["df"]
new_df = data["new_df"]
# ``quantile_estimation_method = "normal_fit"``;
# with no small sample size calculation
ci_model = conf_interval(
df=df,
value_col="y",
residual_col="residual",
c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_conf_interval_normal_method(data):\n df = data[\"df\"]\n new_df = data[\"new_df\"]\n # ``quantile_estimation_method = \"normal_fit\"``\n ci_model = conf_interval(\n df=df,\n value_col=\"y\",\n residual_col=\"residual\",\n conditional_cols=[\"x\"],\n quantiles... | [
"0.6606613",
"0.6490512",
"0.648579",
"0.6397159",
"0.63010037",
"0.6299123",
"0.62481505",
"0.61707187",
"0.6122008",
"0.6107042",
"0.6066163",
"0.6031395",
"0.6017054",
"0.6014699",
"0.6004228",
"0.59864295",
"0.5981038",
"0.5938319",
"0.5931015",
"0.58754426",
"0.58591354"... | 0.68414664 | 0 |
Sets the id of this Finding. | def id(self, id):
self._id = id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_id(self, id_):\n\n self.id_ = id_",
"def set_id(self, id):\n self.__id = id",
"def SetId(self, id):\n self.id = int(id)",
"def setID(self, id):\n self._id = id\n return self.callRemote('setID', id)",
"def set_id(self, id):\n self.data['id'] = id",
"def se... | [
"0.80519384",
"0.8000514",
"0.7818477",
"0.77366567",
"0.7707841",
"0.7613569",
"0.756991",
"0.75259",
"0.75259",
"0.75259",
"0.75259",
"0.75259",
"0.75259",
"0.75259",
"0.75259",
"0.75259",
"0.75259",
"0.75259",
"0.75259",
"0.7512748",
"0.7508286",
"0.7508286",
"0.750828... | 0.74108106 | 72 |
Sets the date of this Finding. | def date(self, date):
self._date = date | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_date(self, date):\n self.date = date\n return",
"def set_date(self, date):\n self.date = date",
"def date(self, date):\n self._date = date",
"def founding_date(self, founding_date: datetime):\n\n self._founding_date = founding_date",
"def date(self, new_date):\n ... | [
"0.8212537",
"0.8208652",
"0.7824177",
"0.775078",
"0.7658921",
"0.765151",
"0.7558582",
"0.75522596",
"0.75522596",
"0.75245047",
"0.7281142",
"0.72494656",
"0.72140753",
"0.7132366",
"0.7099919",
"0.70167434",
"0.6986302",
"0.69759274",
"0.69312805",
"0.68850017",
"0.680292... | 0.7710626 | 6 |
Sets the url of this Finding. | def url(self, url):
if url is not None and len(url) < 1:
raise ValueError("Invalid value for `url`, length must be greater than or equal to `1`") # noqa: E501
self._url = url | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_url(self, url):\n self.url = url",
"def _set_url(self): \n self.url = self.geturl()",
"def set_url(self, url):\n if url is not None:\n self.url = url",
"def set_url(self, url):\n self.url = url",
"def set_url(self, url):\n self.data['url'] = url",
... | [
"0.82140255",
"0.80629647",
"0.7957484",
"0.7948235",
"0.77779543",
"0.770976",
"0.7706451",
"0.7706451",
"0.7706451",
"0.7706451",
"0.7706451",
"0.7706451",
"0.7706451",
"0.7567593",
"0.7567593",
"0.7567593",
"0.7224449",
"0.7160982",
"0.69969106",
"0.69086534",
"0.6704176",... | 0.66415226 | 22 |
Sets the severity of this Finding. | def severity(self, severity):
if severity is None:
raise ValueError("Invalid value for `severity`, must not be `None`") # noqa: E501
if severity is not None and len(severity) > 200:
raise ValueError("Invalid value for `severity`, length must be less than or equal to `200`") # n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def severity(self, severity):\n self._severity = severity",
"def severity(self, severity):\n\n self._severity = severity",
"def severity(self, severity):\n if severity is None:\n raise ValueError(\"Invalid value for `severity`, must not be `None`\") # noqa: E501\n\n self... | [
"0.81098",
"0.80175745",
"0.7361516",
"0.72605544",
"0.6626435",
"0.6623764",
"0.64813507",
"0.64813507",
"0.64542913",
"0.64542913",
"0.64542913",
"0.64307696",
"0.64307696",
"0.64307696",
"0.63137186",
"0.61775494",
"0.6171423",
"0.60582215",
"0.60244787",
"0.57793206",
"0.... | 0.7140314 | 4 |
Sets the description of this Finding. | def description(self, description):
if description is None:
raise ValueError("Invalid value for `description`, must not be `None`") # noqa: E501
if description is not None and len(description) < 1:
raise ValueError("Invalid value for `description`, length must be greater than or... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_description(self, description):\r\n self.__description = description",
"def set_description(self, description):\n self.description = description",
"def set_description(self, description):\n self.__description = description",
"def set_description(self, description):\n self.... | [
"0.8188638",
"0.8180431",
"0.8148751",
"0.808997",
"0.8037212",
"0.8037212",
"0.8037212",
"0.8037212",
"0.7980374",
"0.7955401",
"0.7955401",
"0.7955401",
"0.7955401",
"0.7955401",
"0.7955401",
"0.7955401",
"0.7955401",
"0.7955401",
"0.7955401",
"0.7955401",
"0.7955401",
"0... | 0.66102266 | 97 |
Sets the impact of this Finding. | def impact(self, impact):
if impact is None:
raise ValueError("Invalid value for `impact`, must not be `None`") # noqa: E501
if impact is not None and len(impact) < 1:
raise ValueError("Invalid value for `impact`, length must be greater than or equal to `1`") # noqa: E501
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setExperience(self, damage, enemyShip):\n experience = damage/25.0\n if experience > 0:\n self.myCaptain.addExperience(experience)\n enemyShip.myCaptain.addExperience(experience)",
"def set_experience(self):\n if self.__experience < 50:\n self.__experienc... | [
"0.59221643",
"0.58621556",
"0.5606283",
"0.5597777",
"0.5525032",
"0.5394613",
"0.53606826",
"0.5329237",
"0.5274561",
"0.525864",
"0.52578574",
"0.5237974",
"0.5220516",
"0.51929873",
"0.5154473",
"0.5139406",
"0.5138795",
"0.5132232",
"0.5124831",
"0.5107665",
"0.5101155",... | 0.61716855 | 0 |
Sets the thread_id of this Finding. | def thread_id(self, thread_id):
self._thread_id = thread_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_thread_name(self, thread_name: str):\n self.thread_name = thread_name",
"def set_tid(self, tid):\n self.__tid = tid",
"def thread(self, thread):\n\n self._thread = thread",
"async def set_pin_thread(self, thread: int) -> None:\n await self.AD.threading.set_pin_thread(self.... | [
"0.63807136",
"0.637374",
"0.63235277",
"0.62702554",
"0.61503106",
"0.6105179",
"0.5976203",
"0.57605016",
"0.5711145",
"0.5687795",
"0.56499785",
"0.5642432",
"0.5638906",
"0.562864",
"0.5615846",
"0.5571751",
"0.55335456",
"0.55335456",
"0.55335456",
"0.5528578",
"0.552136... | 0.8253602 | 1 |
Sets the numerical_severity of this Finding. | def numerical_severity(self, numerical_severity):
if numerical_severity is None:
raise ValueError("Invalid value for `numerical_severity`, must not be `None`") # noqa: E501
if numerical_severity is not None and len(numerical_severity) > 4:
raise ValueError("Invalid value for `nu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def severity(self, severity):\n self._severity = severity",
"def severity(self, severity):\n\n self._severity = severity",
"def severity(self, severity):\n if severity is None:\n raise ValueError(\"Invalid value for `severity`, must not be `None`\") # noqa: E501\n\n self... | [
"0.70312357",
"0.69504195",
"0.6056087",
"0.5866975",
"0.58487254",
"0.56784946",
"0.53979814",
"0.53979814",
"0.5347689",
"0.532361",
"0.5317774",
"0.53107584",
"0.52069896",
"0.5194592",
"0.51884854",
"0.5153899",
"0.5153899",
"0.5153899",
"0.5122025",
"0.509542",
"0.504196... | 0.7459507 | 0 |
Sets the last_reviewed of this Finding. | def last_reviewed(self, last_reviewed):
self._last_reviewed = last_reviewed | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_reviewed_by(self, last_reviewed_by):\n\n self._last_reviewed_by = last_reviewed_by",
"def last_updated(self, last_updated):\n\n self._last_updated = last_updated",
"def last_updated(self, last_updated):\n\n self._last_updated = last_updated",
"def last_updated(self, last_updated... | [
"0.7755603",
"0.63661575",
"0.63661575",
"0.63661575",
"0.63661575",
"0.6272486",
"0.6263831",
"0.6116794",
"0.60889816",
"0.60505205",
"0.60140896",
"0.59420484",
"0.58359915",
"0.570513",
"0.56955117",
"0.56791735",
"0.56767905",
"0.5624951",
"0.56221116",
"0.5613982",
"0.5... | 0.89560175 | 0 |
Sets the scanner_confidence of this Finding. | def scanner_confidence(self, scanner_confidence):
self._scanner_confidence = scanner_confidence | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def confidence(self, confidence):\n\n self._confidence = confidence",
"def confidence(self, confidence):\n\n self._confidence = confidence",
"def confidence(self, confidence):\n self._confidence = confidence",
"def confidence(self, confidence):\n self._confidence = confidence",
... | [
"0.69514847",
"0.69514847",
"0.6947945",
"0.6947945",
"0.694054",
"0.6170676",
"0.54872805",
"0.54872805",
"0.5474622",
"0.5474622",
"0.54345167",
"0.54066634",
"0.5313893",
"0.5262962",
"0.5262962",
"0.50407827",
"0.5028977",
"0.5003185",
"0.49880823",
"0.4872491",
"0.486848... | 0.8823388 | 0 |
Sets the last_reviewed_by of this Finding. | def last_reviewed_by(self, last_reviewed_by):
self._last_reviewed_by = last_reviewed_by | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_reviewed(self, last_reviewed):\n\n self._last_reviewed = last_reviewed",
"def last_modified_by(self, last_modified_by):\n\n self._last_modified_by = last_modified_by",
"def last_modified_by(self, last_modified_by):\n\n self._last_modified_by = last_modified_by",
"def last_modifi... | [
"0.79556274",
"0.7197687",
"0.7197687",
"0.66010195",
"0.6503434",
"0.6279238",
"0.6124746",
"0.58754367",
"0.5853754",
"0.5853754",
"0.5853754",
"0.5812513",
"0.5798303",
"0.5798303",
"0.5798303",
"0.5798303",
"0.57652587",
"0.56792426",
"0.559972",
"0.559972",
"0.559972",
... | 0.8904637 | 0 |
Sets the reviewers of this Finding. | def reviewers(self, reviewers):
self._reviewers = reviewers | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reviews(self, reviews: object):\n\n self._reviews = reviews",
"def review(self, review):\n self._review = review",
"def _upd_reviewers(self, new_reviewers):\n if self.review[\"reviewers\"]:\n if new_reviewers and new_reviewers[0] not in self.review[\"reviewers\"]:\n self.review... | [
"0.7149326",
"0.66016865",
"0.653844",
"0.6431182",
"0.6363863",
"0.6168382",
"0.6114938",
"0.60685486",
"0.60613334",
"0.60613334",
"0.5854484",
"0.5761171",
"0.576108",
"0.57578826",
"0.56420034",
"0.562614",
"0.5604291",
"0.5501873",
"0.54779947",
"0.54476804",
"0.53713536... | 0.831613 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, Finding):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.8457179",
"0.8393067",
"0.81457263",
"0.8140635",
"0.8133462",
"0.8094992",
"0.8093376",
"0.8093376",
"0.8093376",
"0.80863357",
"0.80863357",
"0.8077303",
"0.8077303",
"0.8066831"
] | 0.0 | -1 |
Sets a specific log level for the App. | def set_log_level(self, level: str) -> None:
self.logger.setLevel(self._logging.log_levels[level])
self.err.setLevel(self._logging.log_levels[level])
for log in self.user_logs:
self.user_logs[log].setLevel(self._logging.log_levels[level]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_log_level(self, level):\n if level == 'info':\n level = logging.INFO\n if level == 'debug':\n level = logging.DEBUG\n if level == 'error':\n level = logging.ERROR\n self._log.setLevel(level)",
"def level(self, log_level):\n self.logger.s... | [
"0.7558605",
"0.7517535",
"0.74757224",
"0.74700105",
"0.74436486",
"0.74316233",
"0.742563",
"0.74025863",
"0.73675454",
"0.7343067",
"0.7342877",
"0.729561",
"0.7243659",
"0.7237248",
"0.72039235",
"0.7199979",
"0.7127519",
"0.7110913",
"0.7059928",
"0.6998318",
"0.69825935... | 0.7113943 | 17 |
Sets an App to be pinned or unpinned. | async def set_app_pin(self, pin: bool) -> None:
await self.AD.threading.set_app_pin(self.name, pin) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pinned(self, pinned):\n if pinned is None:\n raise ValueError(\"Invalid value for `pinned`, must not be `None`\") # noqa: E501\n\n self._pinned = pinned",
"def set_application(self, app):\n \n self.app = app",
"def set_all_pins(self, ap):\n self.allpins = ap",... | [
"0.58168226",
"0.5742242",
"0.56856865",
"0.55636704",
"0.5159775",
"0.5078989",
"0.5036599",
"0.5036471",
"0.50056607",
"0.49910948",
"0.49754983",
"0.4926896",
"0.49026492",
"0.48561022",
"0.4800552",
"0.4794215",
"0.47908068",
"0.47760552",
"0.47625145",
"0.47483006",
"0.4... | 0.68459177 | 0 |
Sets the thread that the App will be pinned to. | async def set_pin_thread(self, thread: int) -> None:
await self.AD.threading.set_pin_thread(self.name, thread) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def thread(self, thread):\n\n self._thread = thread",
"def pin_thread(request, course_id, thread_id):\r\n user = cc.User.from_django_user(request.user)\r\n thread = cc.Thread.find(thread_id)\r\n thread.pin(user, thread_id)\r\n return JsonResponse(utils.safe_content(thread.to_dict()))",
"asyn... | [
"0.60138106",
"0.60135186",
"0.5912089",
"0.58179",
"0.58179",
"0.58179",
"0.5484811",
"0.54823303",
"0.5443001",
"0.5283483",
"0.5252374",
"0.52245486",
"0.5202273",
"0.51888347",
"0.51873344",
"0.51796937",
"0.51657015",
"0.5145812",
"0.51124924",
"0.5089819",
"0.508948",
... | 0.8124858 | 0 |
Returns the App's namespace. | def get_namespace(self) -> str:
return self._namespace | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def app_id_namespace(self):\n return self.__key.app_id_namespace()",
"def namespace(self) -> str:\n return pulumi.get(self, \"namespace\")",
"def namespace (self) :\n\n return self.__namespace__",
"def namespace(self) -> Optional[str]:\n return pulumi.get(self, \"namespace\")",
"def... | [
"0.7818359",
"0.7581196",
"0.7523769",
"0.744232",
"0.744232",
"0.744232",
"0.73690593",
"0.73176533",
"0.73058736",
"0.7288913",
"0.72369635",
"0.7154205",
"0.71245193",
"0.71245193",
"0.71245193",
"0.71245193",
"0.71245193",
"0.7035851",
"0.702897",
"0.702897",
"0.702897",
... | 0.7737416 | 1 |
Checks the existence of a namespace in AppDaemon. | async def namespace_exists(self, namespace: str) -> bool:
return await self.AD.state.namespace_exists(namespace) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hasNS(self, *args):\n return _libsbml.XMLNamespaces_hasNS(self, *args)",
"def hasNamespaceNS(self, *args):\n return _libsbml.XMLToken_hasNamespaceNS(self, *args)",
"def check(self):\n BadNamespaces = list()\n\n for namespace in pm.listNamespaces():\n BadNamespaces.app... | [
"0.6678822",
"0.6416857",
"0.6351905",
"0.62983334",
"0.60599357",
"0.60576105",
"0.5898541",
"0.58682704",
"0.58569133",
"0.5845881",
"0.5823017",
"0.5748463",
"0.57174844",
"0.5701834",
"0.5697997",
"0.5660734",
"0.5619079",
"0.55770165",
"0.5546747",
"0.5542397",
"0.549885... | 0.79155934 | 0 |
Returns a string with the current version of AppDaemon. | def get_ad_version() -> str:
return utils.__version__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def app_version(self) -> str:\n return pulumi.get(self, \"app_version\")",
"def version(self) -> str:\n data = \"none yet\"\n if self.STARTED:\n data = (\n self.about.get(\"Version\")\n or self.about.get(\"Installed Version\")\n or \"DE... | [
"0.78239375",
"0.7364082",
"0.72954816",
"0.7288494",
"0.7190012",
"0.71836114",
"0.7146934",
"0.71142846",
"0.7109753",
"0.71033996",
"0.71001375",
"0.7084407",
"0.70538753",
"0.7039063",
"0.70299983",
"0.7007608",
"0.69993293",
"0.6946852",
"0.69423586",
"0.6941588",
"0.694... | 0.67131543 | 39 |
Splits an entity into parts. This utility function will take a fully qualified entity id of the form ``light.hall_light`` and split it into 2 values, the device and the entity, e.g. light and hall_light. | async def split_entity(self, entity_id: str, **kwargs) -> list:
await self._check_entity(self._get_namespace(**kwargs), entity_id)
return entity_id.split(".") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extract_entity_ids(hass, service_call, expand_group=True):\n if not (service_call.data and ATTR_ENTITY_ID in service_call.data):\n return []\n\n group = hass.components.group\n\n # Entity ID attr can be a list or a string\n service_ent_id = service_call.data[ATTR_ENTITY_ID]\n\n if expand_... | [
"0.5421866",
"0.5310347",
"0.52229977",
"0.5156989",
"0.50385386",
"0.50330603",
"0.5018565",
"0.49255732",
"0.49005437",
"0.4857359",
"0.4844326",
"0.47844097",
"0.47261876",
"0.46915856",
"0.46879286",
"0.46319097",
"0.4617935",
"0.4617935",
"0.46139228",
"0.460867",
"0.460... | 0.6903694 | 0 |
Converts a UTC to its string representation. | def parse_utc_string(self, utc_string: str) -> dt.datetime:
return dt.datetime(*map(int, re.split(r"[^\d]", utc_string)[:-1])).timestamp() + self.get_tz_offset() * 60 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_UTC_string(\n self,\n dt: datetime,\n local_tz: str = \"America/Los_Angeles\",\n fmt: str = \"%Y%m%dT%H:%M-0000\",\n ) -> str:\n\n tz_ = pytz.timezone(local_tz)\n return tz_.localize(dt).astimezone(pytz.UTC).strftime(fmt)",
"def get_mdal_datetime_to_string(da... | [
"0.6996518",
"0.6894786",
"0.68704474",
"0.66723883",
"0.6668228",
"0.6547503",
"0.6458103",
"0.6429441",
"0.6427205",
"0.6362157",
"0.62697",
"0.621867",
"0.61533654",
"0.60075605",
"0.60017383",
"0.6000897",
"0.59977907",
"0.5956235",
"0.5934517",
"0.5922591",
"0.589924",
... | 0.0 | -1 |
Returns the timezone difference between UTC and Local Time in minutes. | def get_tz_offset(self) -> float:
return self.AD.tz.utcoffset(self.datetime()).total_seconds() / 60 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_timezone_offset():\n timezone = get_localzone()\n offset_minutes = timezone.utcoffset(datetime.datetime.now()).total_seconds() // SECONDS_IN_MINUTE\n return parse_int(offset_minutes)",
"def calculate_total_minutes_now(self):\n total_seconds = (timezone.now() - self.login_time).total_secon... | [
"0.6962526",
"0.64590317",
"0.63273156",
"0.6204471",
"0.6134031",
"0.6095512",
"0.6058189",
"0.599899",
"0.59393954",
"0.5696481",
"0.56729996",
"0.55918396",
"0.55561167",
"0.5550008",
"0.55356145",
"0.55269843",
"0.5464474",
"0.54571015",
"0.5455233",
"0.54504496",
"0.5429... | 0.63600135 | 2 |
Gets a `datetime` object for the specified UTC. Home Assistant provides timestamps of several different sorts that may be used to gain additional insight into state changes. These timestamps are in UTC and are coded as `ISO 8601` combined date and time strings. This function will accept one of these strings and convert... | def convert_utc(utc) -> dt.datetime:
return iso8601.parse_date(utc) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_utc_string(self, utc_string: str) -> dt.datetime:\n return dt.datetime(*map(int, re.split(r\"[^\\d]\", utc_string)[:-1])).timestamp() + self.get_tz_offset() * 60",
"def dt(*args, **kwargs):\n \n if 'tz' in kwargs:\n tzinfo = kwargs.pop('tz')\n else:\n tzinfo = kwargs.pop(... | [
"0.68134195",
"0.6664888",
"0.66034484",
"0.6412319",
"0.6279774",
"0.62740326",
"0.6213979",
"0.61867625",
"0.6155598",
"0.6061952",
"0.60599995",
"0.60480607",
"0.60124755",
"0.5995227",
"0.5994532",
"0.5976109",
"0.59397435",
"0.5923152",
"0.5887481",
"0.58699644",
"0.5865... | 0.6755258 | 1 |
Returns the current Local Date and Time. | async def get_now(self) -> dt.datetime:
now = await self.AD.sched.get_now()
return now.astimezone(self.AD.tz) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_local_date(self):\n tz = pytz.timezone(self.timezone)\n utc = pytz.utc\n utc_now = datetime.datetime.now(utc)\n return utc_now.astimezone(tz).date()",
"def local_time():\n return datetime.datetime.now().isoformat()[:len('2017-01-24T10:44:00')]",
"def local_time(self) -> S... | [
"0.7974621",
"0.754679",
"0.7460392",
"0.7234882",
"0.7233887",
"0.72182626",
"0.71714985",
"0.7031889",
"0.70153993",
"0.7011552",
"0.6978009",
"0.69682276",
"0.6964058",
"0.68957794",
"0.6825947",
"0.6771817",
"0.6746145",
"0.673458",
"0.6725429",
"0.6695585",
"0.6674806",
... | 0.0 | -1 |
Returns a `datetime` object that represents the next time Sunset will occur. | async def sunset(self, aware=False, today=False, days_offset=0) -> dt.datetime:
return await self.AD.sched.sunset(aware, today=today, days_offset=days_offset) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_next_midnight():\n return pytz.utc.localize(datetime.datetime.today()).replace(\n hour=0, minute=0, second=0, microsecond=0\n ) + datetime.timedelta(days=1)",
"def get_next_midnight():\n return pytz.utc.localize(datetime.datetime.today()).replace(\n hour=0, minute=0, second=0, micr... | [
"0.59284073",
"0.59284073",
"0.5627837",
"0.5581784",
"0.558134",
"0.5559283",
"0.55503",
"0.55176926",
"0.53529865",
"0.5287078",
"0.5287078",
"0.5258559",
"0.52453923",
"0.5236068",
"0.5235606",
"0.51961917",
"0.5164138",
"0.5137998",
"0.51070905",
"0.50964105",
"0.5091824"... | 0.54751915 | 8 |
Returns a `datetime` object representing the current Local Date and Time. Use this in preference to the standard Python ways to discover the current datetime, especially when using the "Time Travel" feature for testing. | async def datetime(self, aware=False) -> dt.datetime:
if aware is True:
now = await self.AD.sched.get_now()
return now.astimezone(self.AD.tz)
else:
return await self.AD.sched.get_now_naive() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_local_date(self):\n tz = pytz.timezone(self.timezone)\n utc = pytz.utc\n utc_now = datetime.datetime.now(utc)\n return utc_now.astimezone(tz).date()",
"def now(cls):\n return DateTime(*time.localtime())",
"def get_now():\n local_tz = timezone(os.getenv('TZ', settin... | [
"0.7723511",
"0.72861975",
"0.71777886",
"0.6996592",
"0.69887424",
"0.6844981",
"0.68242544",
"0.68094176",
"0.6770957",
"0.67681295",
"0.67506874",
"0.6706513",
"0.6651755",
"0.66489494",
"0.66436887",
"0.6623519",
"0.6573794",
"0.656366",
"0.65439755",
"0.6527555",
"0.6523... | 0.691807 | 5 |
Returns a localised `date` object representing the current Local Date. Use this in preference to the standard Python ways to discover the current date, especially when using the "Time Travel" feature for testing. | async def date(self) -> dt.date:
now = await self.AD.sched.get_now()
return now.astimezone(self.AD.tz).date() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_local_date(self):\n tz = pytz.timezone(self.timezone)\n utc = pytz.utc\n utc_now = datetime.datetime.now(utc)\n return utc_now.astimezone(tz).date()",
"def localized_date(self):\r\n date_ = self._post['effective_date']\r\n to_localized = self.context.toLocalizedT... | [
"0.76625293",
"0.7122432",
"0.61320484",
"0.60722226",
"0.60417783",
"0.59187806",
"0.5879957",
"0.5817179",
"0.57770675",
"0.57534593",
"0.57467014",
"0.57281846",
"0.5713947",
"0.5702662",
"0.56792057",
"0.5670506",
"0.56336594",
"0.5628586",
"0.5571912",
"0.55485845",
"0.5... | 0.55515593 | 19 |
Returns the current time zone. | def get_timezone(self) -> str:
return self.AD.time_zone | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def time_zone():\n return timezone('Etc/GMT-10')",
"def timezone():\n\n return time.timezone",
"def time_zone(self) -> str:\n return pulumi.get(self, \"time_zone\")",
"def get_timezone():\n return dates.get_timezone(_get_tz())",
"def time_zone(self):\n # type: () -> string_types\... | [
"0.844105",
"0.83640087",
"0.8318234",
"0.8215657",
"0.8146761",
"0.7781727",
"0.76746887",
"0.76746887",
"0.76746887",
"0.7626581",
"0.75894994",
"0.7564373",
"0.7525584",
"0.7518053",
"0.75106853",
"0.75056183",
"0.75044364",
"0.75039095",
"0.74752784",
"0.747492",
"0.74192... | 0.8120747 | 5 |
Schedules a Coroutine to be executed. | async def create_task(self, coro: Callable, callback=None, **kwargs) -> Future:
# get stuff we'll need to fake scheduler call
sched_data = {
"id": uuid.uuid4().hex,
"name": self.name,
"objectid": self.AD.app_management.objects[self.name]["id"],
"type": "sc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def async_schedule(self) -> None:\n # We want to reschedule the timer in the future\n # every time this is called.\n self._async_cancel_timer()\n self._timer = self._loop.call_later(self._timeout, self._async_execute)",
"def schedule(executor: Executor) -> asyncio.Future:\n awaitab... | [
"0.661637",
"0.6503686",
"0.64401066",
"0.63942635",
"0.62644666",
"0.6207389",
"0.57838684",
"0.5754927",
"0.5742368",
"0.5742368",
"0.5717073",
"0.5709896",
"0.5620978",
"0.560368",
"0.55951834",
"0.5589505",
"0.5577786",
"0.5529105",
"0.5504422",
"0.548319",
"0.5479216",
... | 0.53102165 | 26 |
Sets the cluster_resource_whitelist of this V1alpha1AppProjectSpec. | def cluster_resource_whitelist(self, cluster_resource_whitelist):
self._cluster_resource_whitelist = cluster_resource_whitelist | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cluster_resource_blacklist(self, cluster_resource_blacklist):\n\n self._cluster_resource_blacklist = cluster_resource_blacklist",
"def namespace_resource_whitelist(self, namespace_resource_whitelist):\n\n self._namespace_resource_whitelist = namespace_resource_whitelist",
"def setWhitelist(se... | [
"0.62739164",
"0.60411185",
"0.5089617",
"0.50537497",
"0.48310104",
"0.47624213",
"0.47124147",
"0.45890537",
"0.45889914",
"0.45767656",
"0.4558406",
"0.44039834",
"0.4389433",
"0.4330078",
"0.4303742",
"0.42995507",
"0.42841667",
"0.42841667",
"0.42841667",
"0.42841667",
"... | 0.81803614 | 0 |
Sets the description of this V1alpha1AppProjectSpec. | def description(self, description):
self._description = description | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_description(self, desc: str) -> None:\n self.metadata.data[\"description\"] = desc",
"def set_description(self, description):\n self.description = description",
"def description(self, description: ConfigNodePropertyString):\n\n self._description = description",
"def set_descripti... | [
"0.60105383",
"0.576722",
"0.5706146",
"0.5699718",
"0.5674395",
"0.5659235",
"0.5659235",
"0.5654857",
"0.5644802",
"0.5644802",
"0.5644802",
"0.5644802",
"0.56209004",
"0.56041",
"0.55915743",
"0.55740786",
"0.55740786",
"0.55740786",
"0.55740786",
"0.55251354",
"0.5507792"... | 0.5574401 | 28 |
Sets the sync_windows of this V1alpha1AppProjectSpec. | def sync_windows(self, sync_windows):
self._sync_windows = sync_windows | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setSyncObj(self, sync_obj):\n \n self.sync_obj = sync_obj",
"def sync(self, sync):\n self._sync = sync",
"def sync(self, sync):\n\n self._sync = sync",
"def sync_ready_files(self, sync_config=None):\n\n if sync_config is None:\n sync_config = config.getSettin... | [
"0.5222951",
"0.48990247",
"0.48569527",
"0.47897488",
"0.4723029",
"0.46186468",
"0.45443392",
"0.45117566",
"0.4501894",
"0.44092584",
"0.43864316",
"0.43804726",
"0.4367945",
"0.42415252",
"0.42376322",
"0.4209161",
"0.41754746",
"0.41705188",
"0.41681433",
"0.41671357",
"... | 0.73873824 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, V1alpha1AppProjectSpec):
return False
return self.to_dict() == other.to_dict() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
if not isinstance(other, V1alpha1AppProjectSpec):
return True
return self.to_dict() != other.to_dict() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.8457179",
"0.8393067",
"0.81457263",
"0.8140635",
"0.8133462",
"0.8094992",
"0.8093376",
"0.8093376",
"0.8093376",
"0.80863357",
"0.80863357",
"0.8077303",
"0.8077303",
"0.8066831",
"0.8043635",
"0.8043635",
"0.8043635",
"0.8043635",
"0.8043635",
"0.8043635",
"0.8043635",
... | 0.0 | -1 |
Constructor for the wall that the player can run into. | def __init__(self, x, y, width, height):
# Call the parent's constructor
super().__init__()
# Make a blue wall, of the size specified in the parameters
self.image = pygame.Surface([width, height])
self.image.fill([255, 123, 123])
# Make our top-left corner the passed-... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, name):\n self.in_wall = False",
"def __init__(self):\n \n self._wall = BrickWall() \n self._paddle = GRectangle(\n x=GAME_WIDTH/2 - PADDLE_WIDTH/2,\n y=PADDLE_OFFSET,\n width=PADDLE_WIDTH,\n height=PADDLE_HEIGHT,\n ... | [
"0.72698617",
"0.6831052",
"0.6706422",
"0.6522639",
"0.6520364",
"0.64114624",
"0.63946164",
"0.6367411",
"0.63655734",
"0.6318666",
"0.6317601",
"0.6316701",
"0.6313095",
"0.628962",
"0.62723625",
"0.62669694",
"0.62627596",
"0.6221299",
"0.62078446",
"0.6198207",
"0.613301... | 0.5999903 | 29 |
Returns True if user has permission to edit users | def checkPermissionEditUsers(self):
user = self.REQUEST.AUTHENTICATED_USER
return bool(user.has_permission(eionet_edit_users, self)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_can_edit(self, user):\n return user == self.owner",
"def can_edit_user(user):\n\tu = current_user._get_current_object()\n\treturn u==user or u.is_admin()",
"def can_user_edit(self, user):\n\n return user.is_authenticated and (\n user.has_role('admin') or\n unicode(self.... | [
"0.8726221",
"0.8716841",
"0.85940164",
"0.85784805",
"0.8540383",
"0.8510323",
"0.80649334",
"0.7974299",
"0.7866127",
"0.78361",
"0.7830706",
"0.7819337",
"0.781882",
"0.7777895",
"0.7730689",
"0.7687929",
"0.7654",
"0.75878876",
"0.75763524",
"0.7546193",
"0.7524768",
"0... | 0.85952216 | 2 |
Returns True if user has the manager role in Zope | def checkPermissionZopeManager(self):
user = self.REQUEST.AUTHENTICATED_USER
return bool(user.has_permission(view_management_screens, self)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_manager(self) -> bool:\n return self.role in EmployeeRole.manager_roles()",
"def is_usermanager(self):\n return self.can(Permission.CRUD_USERS)",
"def is_usermanager(self):\n return False",
"def has_role(self, role):\n return False",
"def is_admin(self):\n return R... | [
"0.83775353",
"0.75895",
"0.7565792",
"0.69969046",
"0.6991211",
"0.6841049",
"0.6834974",
"0.6761669",
"0.67078745",
"0.6706873",
"0.6680206",
"0.6645307",
"0.66012686",
"0.65661323",
"0.65420175",
"0.6535259",
"0.65302247",
"0.6519171",
"0.6512877",
"0.6510826",
"0.65051144... | 0.74464244 | 3 |
This function takes in a reference array and a target array, and returns a list of indices corresponding to the reference array representing the nearest location for each element in the target array. | def find_nearest(ref_array,target_array):
ref_tree = scipy.spatial.cKDTree(ref_array)
dist, indices = ref_tree.query(target_array, k=1)
return indices | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_nearest(numbers, target):\n numbers = np.asarray(numbers)\n idx = (np.abs(numbers - target)).argmin()\n return numbers[idx]",
"def find_closest(A, target):\n idx = A.searchsorted(target)\n idx = np.clip(idx, 1, len(A)-1)\n left = A[idx-1]\n right = A[idx]\n idx -= tar... | [
"0.7376947",
"0.71696067",
"0.68925834",
"0.6638693",
"0.6502767",
"0.6429031",
"0.642404",
"0.6402894",
"0.6369818",
"0.62598187",
"0.62439954",
"0.6227487",
"0.6172433",
"0.61081296",
"0.6093826",
"0.60883665",
"0.6081583",
"0.6078421",
"0.60658765",
"0.6052211",
"0.6019307... | 0.88203615 | 0 |
Given a time tuple from the time module, this will return a string in the proper format to be properly interpreted by the NERSC Slurm queue scheduler. | def nersc_format_datetime(timetup=None):
if timetup is None:
timetup = time.localtime()
# YYYY-MM-DD[THH:MM[:SS]]
return time.strftime('%Y-%m-%dT%H:%M:%S', timetup) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _time_str(self):\n try:\n if not self._time:\n raise ValueError\n format_ = '%a, %d %b %Y %H:%M:%S'\n return datetime.fromtimestamp(float(self._time)).strftime(format_)\n except ValueError:\n return plastic_date()",
"def get_time_str():... | [
"0.6887524",
"0.68554753",
"0.6790278",
"0.6497162",
"0.6450492",
"0.63140774",
"0.6303596",
"0.62895006",
"0.6277823",
"0.62736946",
"0.62463444",
"0.624165",
"0.6240419",
"0.62301135",
"0.62144166",
"0.62058026",
"0.6201831",
"0.61929095",
"0.61327076",
"0.61308956",
"0.610... | 0.599904 | 29 |
Build the path to where we will save the model, log, and training data. | def build_out_path(d):
assert "output_dir" in d, "Dictionary must have output dir"
path = d.pop("output_dir")
weights_path = path + "weights_"
log_path = path + "log_"
train_data_path = path + "train_data_"
# Sort dictionary for consistency
odict = OrderedDict(sorted(d.items(), key=lambda... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_model_for_train(self):\n if self.train_time is None:\n self.train_time = datetime.now().strftime('%Y-%m-%d_%H-%M-%S')\n\n self.curr_folder = data_functions.create_path(\n self.save_path, self.train_time)\n logger.info(f\"training results will be stored in: {self.c... | [
"0.7385029",
"0.719692",
"0.70823556",
"0.6912779",
"0.6901646",
"0.689384",
"0.68816435",
"0.6837266",
"0.68280375",
"0.68262345",
"0.6782599",
"0.67070335",
"0.670633",
"0.6689848",
"0.6648505",
"0.6634551",
"0.6634551",
"0.6625061",
"0.6572605",
"0.6566484",
"0.65306336",
... | 0.6534696 | 20 |
Setup a test object ready to be xfailed. | def setup_python27(self):
self.client = doubles.Python27TestResult()
self.setup_protocol() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setUpClass(self):\n super(TestExpedition, self).setUpClass()",
"def setUp(self):\n if not self.flag:\n self.fail(self.err_msg)",
"def __call__(self, result=None):\n self._pre_setup()\n super(TestCase, self).__call__(result)\n self._post_tearDown()",
"def setUp(s... | [
"0.67054874",
"0.66981673",
"0.6652925",
"0.65969735",
"0.65659106",
"0.65602225",
"0.65493834",
"0.6546702",
"0.65373814",
"0.65373814",
"0.6523658",
"0.6518793",
"0.65139467",
"0.65092283",
"0.64989567",
"0.6486261",
"0.6486261",
"0.6470025",
"0.64607066",
"0.6448175",
"0.6... | 0.0 | -1 |
Setup the protocol based on self.client. | def setup_protocol(self):
self.protocol = pysubunit.TestProtocolServer(self.client)
self.protocol.lineReceived(compat._b("test mcdonalds farm\n"))
self.test = self.client._events[-1][-1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def client_setup(self):\n self.client = Client()",
"def __init__(self, protocol):\r\n self._protocol = protocol",
"def __init__(self, *args, **kwargs):\n self._initialize_protocols()\n super().__init__(*args, **kwargs)",
"def setUp(self):\n self.client_socket = open_client_... | [
"0.7288116",
"0.7124259",
"0.69174033",
"0.6859433",
"0.6859433",
"0.68221205",
"0.68184197",
"0.67478687",
"0.6703389",
"0.6677637",
"0.6666801",
"0.66570115",
"0.6615127",
"0.6614503",
"0.65891117",
"0.6587854",
"0.657798",
"0.6550881",
"0.65483314",
"0.65121764",
"0.648973... | 0.7121218 | 2 |
Setup a test object ready to be xfailed. | def setup_python27(self):
self.client = doubles.Python27TestResult()
self.setup_protocol() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setUpClass(self):\n super(TestExpedition, self).setUpClass()",
"def setUp(self):\n if not self.flag:\n self.fail(self.err_msg)",
"def __call__(self, result=None):\n self._pre_setup()\n super(TestCase, self).__call__(result)\n self._post_tearDown()",
"def setUp(s... | [
"0.67054874",
"0.66981673",
"0.6652925",
"0.65969735",
"0.65659106",
"0.65602225",
"0.65493834",
"0.6546702",
"0.65373814",
"0.65373814",
"0.6523658",
"0.6518793",
"0.65139467",
"0.65092283",
"0.64989567",
"0.6486261",
"0.6486261",
"0.6470025",
"0.64607066",
"0.6448175",
"0.6... | 0.0 | -1 |
Setup the protocol based on self.client. | def setup_protocol(self):
self.protocol = pysubunit.TestProtocolServer(self.client)
self.protocol.lineReceived(compat._b("test mcdonalds farm\n"))
self.test = self.client._events[-1][-1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def client_setup(self):\n self.client = Client()",
"def __init__(self, protocol):\r\n self._protocol = protocol",
"def __init__(self, *args, **kwargs):\n self._initialize_protocols()\n super().__init__(*args, **kwargs)",
"def setUp(self):\n self.client_socket = open_client_... | [
"0.7288116",
"0.7124259",
"0.69174033",
"0.6859433",
"0.6859433",
"0.68221205",
"0.68184197",
"0.67478687",
"0.6703389",
"0.6677637",
"0.6666801",
"0.66570115",
"0.6615127",
"0.6614503",
"0.65891117",
"0.6587854",
"0.657798",
"0.6550881",
"0.65483314",
"0.65121764",
"0.648973... | 0.7121218 | 3 |
Setup a test object ready to be skipped. | def setUp(self):
super(TestTestProtocolServerAddSkip, self).setUp()
self.client = doubles.ExtendedTestResult()
self.protocol = pysubunit.TestProtocolServer(self.client)
self.protocol.lineReceived(compat._b("test mcdonalds farm\n"))
self.test = self.client._events[-1][-1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setUp(self):\r\n # nothing to do, all tests use different things\r\n pass",
"def setUp(self):\r\n pass # nothing used by all\r",
"def setUp(self):\r\n pass # nothing required by all\r",
"def setUp(self):\n pass #because we dont have anything to setup.",
"def setUp(s... | [
"0.69580096",
"0.68873096",
"0.6872546",
"0.6849005",
"0.6832378",
"0.6818499",
"0.6818499",
"0.67407024",
"0.6722946",
"0.67216897",
"0.671967",
"0.671967",
"0.671967",
"0.671967",
"0.671967",
"0.671967",
"0.671967",
"0.671967",
"0.671967",
"0.671967",
"0.671967",
"0.67196... | 0.0 | -1 |
Takes raw feature sequences and produces a single word embedding | def _embeddings(self, xs):
n_feats, batch_size, seq_len = xs.size()
assert n_feats == self.n_feats
res = [emb(x) for emb, x in zip(self.embeddings, xs)]
x = torch.cat(res, 2)
return x | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def embed(self, sequence):\n words = sequence.split(' ')\n vecs = [self._E[self._w2i[i]] if i in self._w2i else self._E[self._w2i[\"UNK\"]]\n for i in words]\n return vecs",
"def __glove_embed__(sequence, model):\n embedded = []\n for word in sequence:\n embedded.... | [
"0.68755037",
"0.67340124",
"0.67207664",
"0.6680156",
"0.65494156",
"0.64782584",
"0.64626986",
"0.646174",
"0.6401196",
"0.6385242",
"0.63788855",
"0.6370292",
"0.6358444",
"0.63461417",
"0.6330022",
"0.6327004",
"0.631903",
"0.6307482",
"0.6305534",
"0.62901145",
"0.628246... | 0.61062783 | 39 |
Create a new ConvLayer parameter object. This then is passed as an argument to all the convolution operations. | def conv_layer(self, dtype,
N, C, K,
D=1, H=1, W=1,
T=1, R=1, S=1,
pad_d=0, pad_h=0, pad_w=0,
str_d=1, str_h=1, str_w=1,
dil_d=1, dil_h=1, dil_w=1):
return layer_mkl.ConvLayerMKL(
self, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _append_conv_layer(self, param):\n self._parameterized_conv_layers.append(\n tf.keras.layers.Conv3D(\n padding='same',\n use_bias=False,\n kernel_regularizer=self._kernel_regularizer,\n **param,\n ))\n norm_layer_params = self._build_norm_layer_pa... | [
"0.7299219",
"0.7284989",
"0.6991409",
"0.6857302",
"0.66879696",
"0.6516313",
"0.6362162",
"0.6331609",
"0.6323929",
"0.6301969",
"0.62925035",
"0.62904906",
"0.6207038",
"0.61736035",
"0.61650074",
"0.6143445",
"0.61347514",
"0.61172616",
"0.6107373",
"0.61070704",
"0.60799... | 0.56929135 | 85 |
Forward propagate pooling layer. | def fprop_pool(self, layer, I, O, argmax=None, beta=0.0):
assert layer.sizeI == I.size
assert layer.sizeO == O.size
assert layer.op == "max" or layer.op == 'avg'
if layer.op == "max":
assert layer.sizeO == argmax.size
J, T, R, S = layer.JTRS
C, D, H, W, N = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forward(self, x, pool_size=(2, 2), pool_type=\"avg\"):\n\n x = F.relu_(self.norm1(self.conv1(x)))\n x = F.relu_(self.norm2(self.conv2(x)))\n if pool_type == \"max\":\n x = F.max_pool2d(x, kernel_size=pool_size)\n elif pool_type == \"avg\":\n x = F.avg_pool2d(x,... | [
"0.6759806",
"0.672352",
"0.6687427",
"0.661162",
"0.65769327",
"0.65617645",
"0.65459424",
"0.65459424",
"0.64906347",
"0.6399893",
"0.635291",
"0.63190377",
"0.63090295",
"0.63088256",
"0.62982357",
"0.62831634",
"0.6248009",
"0.6245617",
"0.6209486",
"0.62025726",
"0.61838... | 0.0 | -1 |
Doing following operations ( is dot product) C = alpha A B + beta C C = alpha A.T B + beta C C = alpha A B.T + beta C. | def compound_dot(self, A, B, C, alpha=1.0, beta=0.0, relu=False, bsum=None):
# checking type and shape
assert A.dtype == B.dtype == C.dtype
assert A.shape[0] == C.shape[0]
assert B.shape[1] == C.shape[1]
assert A.shape[1] == B.shape[0]
# cleaner implementation, shall be... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dot_product(a, b):\n a1, a2, a3 = a\n b1, b2, b3 = b\n return a1 * b1 + a2 * b2 + a3 * b3",
"def dot(a,b):\n return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]",
"def dot_product(a,b):\n return sum(pairwise_mult(a,b))",
"def dot(a, b):\n return a[0]*b[0] + a[1]*b[1] + a[2]*b[2]",
"def dotproduct(fi... | [
"0.703049",
"0.6972193",
"0.6962898",
"0.6943959",
"0.6843877",
"0.6811131",
"0.6810457",
"0.6789144",
"0.67202604",
"0.67055047",
"0.6690397",
"0.66159105",
"0.6615744",
"0.65986776",
"0.6591225",
"0.6581338",
"0.6566474",
"0.6558373",
"0.6546115",
"0.6546061",
"0.652328",
... | 0.76985675 | 0 |
Convert time in MIDI ticks to seconds. | def ppq_to_time(self, ppq):
time = RPR.MIDI_GetProjTimeFromPPQPos(self.id, ppq)
return time | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def time_to_int(self):\n minutes = self.hour * 60 + self.minute\n seconds = minutes * 60 + self.second\n return seconds",
"def to_seconds(time):\n return 3600 * time",
"def t_sec(self):\n return self.t/self.parameters['time_conversion']",
"def time_to_int(self):\n minute... | [
"0.70950663",
"0.69691896",
"0.69141406",
"0.68453336",
"0.68036675",
"0.67750376",
"0.65990186",
"0.6590982",
"0.65887845",
"0.655404",
"0.6412949",
"0.636735",
"0.6359089",
"0.63254684",
"0.6322513",
"0.63148654",
"0.6303605",
"0.6298143",
"0.6273635",
"0.62561315",
"0.6253... | 0.0 | -1 |
Start time of the take relative to start of source file. | def start_offset(self):
return self.get_info_value("D_STARTOFFS") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_time(self) -> float:\r\n ...",
"def start_time(self):\n pass",
"def start_time(self):\n return self.__start",
"def start_time(self) -> float:\n return self._start_time",
"def get_starttime(self):\n filetime = datetime.datetime.strptime(self.filenametime,\n ... | [
"0.75792843",
"0.7564217",
"0.7423111",
"0.7348056",
"0.731952",
"0.73139507",
"0.7253079",
"0.72230965",
"0.71687794",
"0.71687794",
"0.71687794",
"0.71687794",
"0.71687794",
"0.71687794",
"0.71687794",
"0.71687794",
"0.71486765",
"0.7140183",
"0.70838135",
"0.7060851",
"0.7... | 0.0 | -1 |
Status code should be 400 when missing server_list. | def test_create_missing_server_list(self):
self.mockTicketGetTicket()
maint_params = {
'master_ticket' : '080102-00121',
'description' : 'do stuff',
'expedite' : False,
'additional_duration_minutes': '60',
'service_type_id' ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_with_bad_server(self):\n self.mockAuthToken()\n self.mockServerGetDetailsByComputers()\n self.mockTicketGetTicket()\n maint_params = \"master_ticket=080102-00121&service_type_id=1&employee_contact_id=1&servers=9999\"\n response = self.app.post(url_for(controller='... | [
"0.6061596",
"0.60476696",
"0.5971526",
"0.5775313",
"0.57593954",
"0.57020354",
"0.5686953",
"0.5639251",
"0.56079996",
"0.55966985",
"0.55747646",
"0.54868317",
"0.54784334",
"0.547263",
"0.5455668",
"0.5448346",
"0.5430323",
"0.5426539",
"0.54029393",
"0.5386585",
"0.53825... | 0.6700875 | 0 |
Status code should be 400 when missing employee number. | def test_create_missing_service_type(self):
self.mockTicketGetTicket()
maint_params = {
'master_ticket' : '080102-00121',
'description' : 'do stuff',
'expedite' : False,
#'billing_text' : 'send me the bill',
'additional_dura... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bad_request():\n return HttpError(400)",
"def test_bad_requests_give_400(self):\n self.assertEqual(self._request({}), 400)",
"def test_invalid_model_code(self) -> None:\n model_code = 90\n res = self.app.get('/model-parameters', query_string={\"number\": model_code})\n self.a... | [
"0.6388745",
"0.63343936",
"0.6221456",
"0.6122366",
"0.61216146",
"0.6115139",
"0.60957575",
"0.6074696",
"0.6009305",
"0.5990971",
"0.5952085",
"0.59436554",
"0.5921277",
"0.5893393",
"0.587008",
"0.5849544",
"0.58426946",
"0.58279604",
"0.5825068",
"0.5819319",
"0.5818202"... | 0.0 | -1 |
Constructs a new ExtendedAttributes from a dict of key and values. | def _create_extended_attributes(self, key_values):
assert isinstance(key_values, dict)
return ExtendedAttributes([
ExtendedAttribute(key=key, values=values)
for key, values in key_values.items()
]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_from_dict(self, d):\n for k, v in d.items():\n # First, keys must be strings, not ints\n if isinstance(k, int):\n k = str(k)\n # Now, assign to the key, handling nested AttrDicts properly\n if isinstance(v, dict):\n self.set_... | [
"0.6382485",
"0.6297906",
"0.62670505",
"0.60473675",
"0.5974632",
"0.5972618",
"0.5915098",
"0.59051406",
"0.5895183",
"0.58589345",
"0.58556575",
"0.5846577",
"0.5841459",
"0.57766926",
"0.57535666",
"0.5723234",
"0.5703971",
"0.5693542",
"0.56668705",
"0.5658858",
"0.56458... | 0.8257896 | 0 |
Constructs a new Operation.IR from simple parameters. | def _create_operation(self,
identifier,
arguments=None,
return_type=None,
extended_attributes=None,
node=None):
if not return_type:
return_type = self._create_type('void'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, osi):\n self.osi = osi\n self._parameters = [self.op_type]\n self.to_process(osi)",
"def __init__(self, osi):\n self.osi = osi\n self._parameters = [self.op_type]\n self.to_process(osi)",
"def __init__(self, osi):\n self.osi = osi\n sel... | [
"0.6135305",
"0.6135305",
"0.6135305",
"0.6135305",
"0.6135305",
"0.61084044",
"0.59634215",
"0.5880054",
"0.5851098",
"0.5848407",
"0.5813872",
"0.5797516",
"0.5786671",
"0.57640713",
"0.57393676",
"0.5716554",
"0.5714805",
"0.5707394",
"0.56981313",
"0.56833816",
"0.5668892... | 0.6603862 | 0 |
Get name of bmp files in DIR | def get_file_names(DIR):
return sorted(glob.glob(DIR+"*.bmp")) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_images_name(folder):\n onlyfiles = [f for f in os.listdir(folder) if os.path.isfile(os.path.join(folder, f))]\n for f in onlyfiles:\n yield f",
"def get_file_names(image_path):\n image_filename = []\n for filename in glob.glob(image_path):\n name = os.pat... | [
"0.6813418",
"0.6575166",
"0.6507314",
"0.64919734",
"0.61937845",
"0.617483",
"0.6102902",
"0.609273",
"0.6068926",
"0.6065499",
"0.6035004",
"0.59730935",
"0.58905023",
"0.5877417",
"0.5874521",
"0.5871658",
"0.5854602",
"0.58270043",
"0.5801679",
"0.5763564",
"0.57602686",... | 0.76513433 | 0 |
Test exception that occurs if StrucId is incorrect. | def test_incorrect_strucid_exception(self):
rfh2 = pymqi.RFH2()
try:
rfh2.unpack(self.single_rfh2_message[116:])
except pymqi.PYIFError as e:
self.assertEqual(str(e),
"PYMQI Error: RFH2 - StrucId not MQRFH_STRUC_ID. Value: {0}".format(b'ame>'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testIdNonUniqueIdOnInit(self):\n\n cdl_convert.config.HALT_ON_ERROR = True\n\n self.assertRaises(\n ValueError,\n cdl_convert.ColorCorrection,\n 'uniqueId',\n 'file'\n )\n\n cdl_convert.config.HALT_ON_ERROR = False\n\n try:\n ... | [
"0.655885",
"0.6551604",
"0.65069973",
"0.6470638",
"0.6455571",
"0.6311512",
"0.63031745",
"0.62980914",
"0.6233814",
"0.6203228",
"0.617211",
"0.615754",
"0.6150864",
"0.6129383",
"0.61292565",
"0.61287606",
"0.61018896",
"0.61001426",
"0.60925776",
"0.6091522",
"0.6077896"... | 0.74511755 | 0 |
Infer a release date from a version number. | def infer_release_date(tagname: str) -> Optional[datetime]:
if tagname in RELEASE_DATES:
return RELEASE_DATES[tagname]
elif tagname[0] == "w" and tagname < "w_2020_43":
# Weeklies used to be reliably produced on Saturdays, but that changed
# in October of 2020.
return datetime.st... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def needs_revision(self, text):\n match = re.search(\"rev: ([\\\\d]+)-([\\\\d]+)-([\\\\d]+)$\", text)\n\n if match is None:\n return\n\n month, day, year = match.groups()\n return date(int(year), int(month), int(day))",
"def create_date_to_version(release_info):\n # Comb... | [
"0.63451815",
"0.63275576",
"0.6183602",
"0.6182205",
"0.6032317",
"0.5992137",
"0.5973601",
"0.58885676",
"0.5822706",
"0.5729662",
"0.572475",
"0.5678374",
"0.5626042",
"0.56251943",
"0.5614573",
"0.56109214",
"0.5548936",
"0.551132",
"0.55056673",
"0.548209",
"0.547741",
... | 0.65208346 | 0 |
Computes x^t L x for inputs x and laplacian L | def call(self, inputs, training=None):
with tf.device("/device:GPU:0"):
return tf.reshape(tf.einsum('bj,jk,bk->b', inputs, self.laplacian, inputs), (-1, 1)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate_L(self, n_t, n_n, l0, l1, dt, ctant):\n d_scl = np.sqrt((self.t_D.get_value() ** 2).sum(1).mean())\n\n a = n_t * n_n * l1 * dt * d_scl ** 2 * np.log(l1 / l0) ** 2\n # try:\n # self._b\n # except:\n # from scipy.linalg import eigh as largest_eigh\n... | [
"0.69043463",
"0.6841943",
"0.6789103",
"0.67128855",
"0.6628679",
"0.6580443",
"0.655683",
"0.6529571",
"0.6500844",
"0.64947116",
"0.6410058",
"0.63998556",
"0.6339357",
"0.6329191",
"0.63032526",
"0.63030875",
"0.6301978",
"0.62928885",
"0.62881255",
"0.62781066",
"0.62736... | 0.0 | -1 |
Open the manual in a browser. | def open_manual() -> None:
path = os.path.abspath(
os.path.join("docs", "_build", "html", "index.html"))
webbrowser.open("file:{}".format(pathname2url(path))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def open_in_browser(self):\n webbrowser.open(self.url)",
"def _open_browser(self, single_doc_html):\n url = os.path.join(\"file://\", DOC_PATH, \"build\", \"html\", single_doc_html)\n webbrowser.open(url, new=2)",
"def _open_browser(self, single_doc_html):\n url = os.path.join(\n ... | [
"0.7433816",
"0.7352811",
"0.73442435",
"0.73061067",
"0.7230955",
"0.7013308",
"0.6984234",
"0.6982259",
"0.6967149",
"0.69596386",
"0.6930381",
"0.68684727",
"0.6858726",
"0.68558747",
"0.67257833",
"0.6705721",
"0.6699542",
"0.6688857",
"0.6664168",
"0.6647107",
"0.664138"... | 0.8556528 | 0 |
Creates a data loader for AudioDatasets. | def __init__(self, *args, **kwargs):
super(DeepSpeakerDataLoader, self).__init__(*args, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _init_train_loader(self):\n # Choose the right dataset type\n if self.config_args[\"num_members\"] > 1:\n class_dataset_wrapper = dataset_wrapper.MixMoDataset\n else:\n class_dataset_wrapper = dataset_wrapper.MSDADataset\n\n # Load augmentations\n self.t... | [
"0.6753313",
"0.67081624",
"0.6566129",
"0.6525789",
"0.64995086",
"0.64633924",
"0.6463052",
"0.64046866",
"0.6393812",
"0.6380992",
"0.6355359",
"0.6344864",
"0.6339794",
"0.632222",
"0.62972176",
"0.6295378",
"0.6235412",
"0.6207986",
"0.6169932",
"0.6165656",
"0.61565197"... | 0.57498676 | 70 |
Get current CPS Should return a float | def get_cps(self):
return self._cookies_per_second | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cps(self):\n\n if self._cps is not None:\n return self._cps\n else:\n try:\n return self.counts / self.livetime\n except TypeError:\n raise SpectrumError(\n 'Unknown livetime; cannot calculate CPS from counts')",
... | [
"0.7728652",
"0.7462495",
"0.736031",
"0.736031",
"0.736031",
"0.7036479",
"0.7036479",
"0.6906312",
"0.68568826",
"0.65149987",
"0.64797735",
"0.64733404",
"0.64303815",
"0.6356482",
"0.6325371",
"0.6296346",
"0.6296247",
"0.6290065",
"0.62089956",
"0.6181946",
"0.61742765",... | 0.6835569 | 9 |
Test for when the 'user' field is a SimpleLazyObject, as would be gotten from request.user. | def test_get_page_affiliation_lazyuser(self):
from django.utils.functional import SimpleLazyObject
from main.permissions import FullUser, get_page_affiliation, Affiliation
# Authenticated case
auth_fu = FullUser(
SimpleLazyObject(lambda: self.user),
'1.2.3.4',
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_lazy_user(user):\n # Anonymous users are not lazy.\n\n if user.is_anonymous:\n return False\n\n # Check the user backend. If the lazy signup backend\n # authenticated them, then the user is lazy.\n backend = getattr(user, 'backend', None)\n if backend == 'lazysignup.backends.LazySig... | [
"0.6777848",
"0.63071007",
"0.6238106",
"0.60494596",
"0.60494596",
"0.5962974",
"0.59352154",
"0.59352154",
"0.5920214",
"0.5912301",
"0.587548",
"0.5840634",
"0.5754563",
"0.5720521",
"0.57197946",
"0.57184756",
"0.5714658",
"0.5688272",
"0.56874174",
"0.5683659",
"0.567244... | 0.5774602 | 12 |
Makes sure that the creator of an anonymous page (i.e. quick page) can set the admin options for that page, and that these options are correctly propagated to other users. | def test_anon_page_admin(self):
self._make_quick_page()
dropdown_menu_btn = self._get_one('.dropdown-toggle')
show_opts_btn = self._get_one('.options-btn')
options_menu = self._get_one('.pageOptions')
self.assertTrue(dropdown_menu_btn.is_displayed())
dropdown_menu_btn.c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def admin_only():\n return 'Super-seekrit admin page.'",
"def set_main_user_options(self):\n if self.user:\n self.template_values[self._tp_logoutLink] = True\n self.template_values[self._tp_userName] = self.user.username\n else:\n self.template_values[self._tp_lo... | [
"0.60113853",
"0.589839",
"0.5891344",
"0.5891344",
"0.5891344",
"0.5891344",
"0.5891344",
"0.5837993",
"0.5770133",
"0.56898016",
"0.5682634",
"0.56806123",
"0.5677221",
"0.5621111",
"0.5578521",
"0.55629647",
"0.5524499",
"0.5507416",
"0.54981744",
"0.54981744",
"0.5494439"... | 0.7569566 | 0 |
Sets the id of this Publication. | def id(self, id):
self._id = id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_id(self, id):\n self.__id = id",
"def set_id(self, id_):\n\n self.id_ = id_",
"def SetId(self, id):\n self.id = int(id)",
"def set_id(self, id):\n self.data['id'] = id",
"def set_id(self, id_=None):\n if id_ is None:\n self.id = id(self)\n else:\... | [
"0.79174346",
"0.78849626",
"0.768334",
"0.75542766",
"0.75396407",
"0.7411434",
"0.7411434",
"0.7411434",
"0.7411434",
"0.7411434",
"0.7394535",
"0.73935086",
"0.73935086",
"0.73935086",
"0.73935086",
"0.73935086",
"0.73935086",
"0.73935086",
"0.73935086",
"0.73935086",
"0.7... | 0.7344533 | 83 |
Sets the pmid of this Publication. | def pmid(self, pmid):
self._pmid = pmid | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mid(self, mid):\n\n self._mid = mid",
"def set_pid(self, kp=None, ki=None, kd=None):\n if kp is not None:\n self.k_p = kp\n if ki is not None:\n self.k_i = ki\n if kd is not None:\n self.k_d = kd\n\n self.reset_sum()",
"def pid(self, pid):... | [
"0.64601755",
"0.6295589",
"0.62318575",
"0.62318575",
"0.61486214",
"0.61322916",
"0.5798742",
"0.5683031",
"0.5676941",
"0.56131643",
"0.55427146",
"0.55277747",
"0.55277747",
"0.5411092",
"0.54087585",
"0.5285532",
"0.5265903",
"0.52623296",
"0.5245304",
"0.521699",
"0.519... | 0.83832806 | 0 |
Sets the source of this Publication. | def source(self, source):
self._source = source | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_source(self, source):\n self.data['source'] = source",
"def source(self, source: Source):\n self._source = source",
"def set_source(self, source_name):\n self.source = source_name",
"def source_of_published(self, source_of_published):\n\n self._source_of_published = source... | [
"0.8054158",
"0.7858201",
"0.7699919",
"0.73895085",
"0.72873306",
"0.7237529",
"0.71994",
"0.7039341",
"0.70237",
"0.70189184",
"0.6892271",
"0.67206526",
"0.6694732",
"0.6694732",
"0.6693525",
"0.6688251",
"0.664211",
"0.66212803",
"0.659989",
"0.6511267",
"0.6497968",
"0... | 0.79950905 | 5 |
Sets the journal_name of this Publication. | def journal_name(self, journal_name):
self._journal_name = journal_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def journal_iso_abbreviation(self, journal_iso_abbreviation):\n\n self._journal_iso_abbreviation = journal_iso_abbreviation",
"def archive_name(self, archive_name):\n\n self._archive_name = archive_name",
"def set_archive_name(self, archive_name):\n self._basket.set_archive_name(archive_na... | [
"0.6408077",
"0.6168033",
"0.6107733",
"0.60907996",
"0.6050696",
"0.6050696",
"0.6050696",
"0.59526277",
"0.5830123",
"0.5753452",
"0.5753452",
"0.57079756",
"0.5674655",
"0.5664289",
"0.5664289",
"0.56537396",
"0.56533635",
"0.5646587",
"0.5646587",
"0.56399703",
"0.5603891... | 0.88384 | 0 |
Sets the conclusion of this Publication. | def conclusion(self, conclusion):
self._conclusion = conclusion | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def conclusion(self) -> ExpressionNode:\n return self.__conclusion",
"def conclusion_function(self):\n pass",
"def add_inclusion(self, inclusion):\n self.inclusion_entries.add(inclusion)\n return self",
"def setIncludeConfidence(self, b):\n return self._set(includeConfidenc... | [
"0.58858013",
"0.5487552",
"0.53644097",
"0.52748466",
"0.52748466",
"0.5172756",
"0.5154618",
"0.5154618",
"0.505102",
"0.49883157",
"0.48824987",
"0.47619435",
"0.47473696",
"0.4727532",
"0.46906888",
"0.4654397",
"0.46235895",
"0.46076193",
"0.46076193",
"0.45952684",
"0.4... | 0.7493759 | 0 |
Sets the citation of this Publication. | def citation(self, citation):
self._citation = citation | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def citation_date(self, citation_date):\n\n self._citation_date = citation_date",
"def pubchem(self, pubchem):\n\n self._pubchem = pubchem",
"def cidade(self, cidade):\n self._cidade = cidade",
"def set_cite(self, value):\n return self._set_one_attribute(self.AttributeNames.CITE, ... | [
"0.68507504",
"0.6",
"0.57756525",
"0.571414",
"0.5516147",
"0.5138177",
"0.5092435",
"0.5092435",
"0.5092435",
"0.5092435",
"0.5092435",
"0.5092435",
"0.5092435",
"0.5092435",
"0.5092435",
"0.50919425",
"0.5042359",
"0.50287807",
"0.50279677",
"0.5005527",
"0.5005527",
"0.... | 0.8340678 | 0 |
Sets the publication_type of this Publication. | def publication_type(self, publication_type):
self._publication_type = publication_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setDistributionType(self, distribution_type):\n self._distribution_type = distribution_type",
"def set_type(self, type):\n self._type = type",
"def set_type(self, type):\n self.type = type",
"def set_type(self, type):\n self.type = type",
"def membership_type(self, membershi... | [
"0.71468675",
"0.66209954",
"0.654961",
"0.654961",
"0.64959747",
"0.6219027",
"0.6219027",
"0.6219027",
"0.6194358",
"0.61815953",
"0.61815953",
"0.6154818",
"0.6146462",
"0.61333877",
"0.6132584",
"0.61233485",
"0.61233485",
"0.61178285",
"0.61178285",
"0.61178285",
"0.6117... | 0.90298676 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, Publication):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748"
] | 0.0 | -1 |
Tests the RegisterOutput and DeregisterOutput functions. | def testRegistration(self):
# pylint: disable=protected-access
number_of_parsers = len(manager.OutputManager._output_classes)
manager.OutputManager.RegisterOutput(TestOutput)
with self.assertRaises(KeyError):
manager.OutputManager.RegisterOutput(TestOutput)
self.assertEqual(
len(man... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testGetOutputClass(self):\n manager.OutputManager.RegisterOutput(TestOutput)\n\n output_class = manager.OutputManager.GetOutputClass('test_output')\n self.assertEqual(output_class, TestOutput)\n\n with self.assertRaises(ValueError):\n _ = manager.OutputManager.GetOutputClass(1)\n\n with sel... | [
"0.70004165",
"0.6896971",
"0.6818848",
"0.67098594",
"0.6170298",
"0.60725737",
"0.5968327",
"0.5891343",
"0.5696411",
"0.56727475",
"0.5653276",
"0.5636194",
"0.56343514",
"0.56317496",
"0.5601879",
"0.56005484",
"0.55969363",
"0.5569692",
"0.55619335",
"0.55437595",
"0.553... | 0.7706916 | 0 |
The app.route to the html home page | def hello():
now = time.ctime()
print(now)
return render_template("home.html", now = now) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def home():\n logging.info('Entering route: HOME')\n\n logging.info('Rendering template: main.html')\n return render_template('main.html')",
"def home():\n payload = manager.get_payload()\n return render_template('index.html', payload=payload)",
"def home():\n\n return render_template('index.... | [
"0.8352355",
"0.77659625",
"0.76862687",
"0.7666914",
"0.76406604",
"0.76406604",
"0.76406604",
"0.76406604",
"0.76406604",
"0.76406604",
"0.7638217",
"0.7638217",
"0.7638217",
"0.7638217",
"0.75935763",
"0.7582378",
"0.7578918",
"0.75566244",
"0.7553498",
"0.75516313",
"0.75... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.