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
Right shift with public integral offset.
def __rshift__(self, other): # TODO: extend to secret offset if not isinstance(other, int): return NotImplemented return self.__floordiv__(1<<other)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _right_shift_scalar(x, y):\n return inner.bit_right_shift(x, y)", "def shift_right(self):\n self.pointer = (self.pointer + 1) % len(self.data)", "def lrshift(val, n) -> np.int64:\n return (val % (1 << 64)) >> n", "def test_rshift():\n value = 42\n num_a = param.Integer(value=va...
[ "0.7279014", "0.7240078", "0.7054455", "0.6930216", "0.683616", "0.683616", "0.6801652", "0.67621094", "0.67214423", "0.666759", "0.6592119", "0.6589057", "0.6582795", "0.6571957", "0.6547719", "0.653962", "0.65293795", "0.64895654", "0.6363365", "0.6218795", "0.6206821", "...
0.7234058
2
Right shift (with reflected arguments).
def __rrshift__(self, other): return NotImplemented
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def right_shift(lhs, rhs):\n return _make.right_shift(lhs, rhs)", "def __rshift__(self, fn):\n if self is Nothing:\n return Nothing\n else:\n v = self.right if self.is_right() else self.left\n fn = liftF(fn, self.__class__)\n return unlift(fn(v))", "...
[ "0.7731636", "0.7417664", "0.73450357", "0.73384696", "0.716404", "0.7117388", "0.711274", "0.71020246", "0.703883", "0.70261127", "0.6973108", "0.6972289", "0.687048", "0.6858747", "0.680647", "0.680647", "0.67318946", "0.669549", "0.669549", "0.66619515", "0.6643595", "0....
0.65678996
24
Internal method. Load and overwite the weights of savable layers.
def _load_local_weights(self, h5file): for name, layer in self._layers_to_save.items(): self._load_layer_weights(layer, name, h5file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _save_local_weights(self, h5file):\n for name, layer in self._layers_to_save.items():\n self._save_layer_weights(layer, name, h5file)", "def load_weigths_into_target_network(self):\n logging.debug(\"Transfer Weight!\")\n self.network.save_weights(self._save_path)\n self...
[ "0.7112637", "0.6886456", "0.68030757", "0.67139125", "0.66837305", "0.65610504", "0.65234435", "0.65043664", "0.64603144", "0.6424455", "0.6416083", "0.63992655", "0.63778496", "0.6374594", "0.6349747", "0.62888044", "0.6262619", "0.6246883", "0.62425447", "0.62310976", "0.6...
0.745677
0
Internal method. Load the weights of one layer from a h5py file object.
def _load_layer_weights(self, layer, name, h5file): group = h5file[name] length = group['length'][0] weights = [group["{}".format(idx)] for idx in range(length)] layer.set_weights(weights)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_weights(self, filepath, by_name=False):\n if h5py is None:\n raise ImportError('`load_weights` requires h5py.')\n with h5py.File(filepath, 'r') as f:\n if 'layer_names' not in f.attrs and 'model_weights' in f:\n f = f['model_weights']\n if by_name:\n load_weights_from_hd...
[ "0.7762422", "0.7741495", "0.7162051", "0.70875186", "0.7042549", "0.69837266", "0.6980732", "0.68744195", "0.68642384", "0.68527466", "0.6803724", "0.6780911", "0.67803186", "0.67626196", "0.67356473", "0.6702431", "0.6684989", "0.66833407", "0.6679716", "0.66557705", "0.661...
0.8173073
0
Initialise the dense layer providing the input. Implement any necessary initialization in the subclass.
def init_dense(self, layer): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, input_dim: int, output_dim: int):\n\n super().__init__()\n\n self.input_dim = input_dim\n self.output_dim = output_dim\n\n self.batchNorm1 = layers.BatchNormalization()\n self.dense1 = layers.Dense(\n 64, input_shape=(input_dim+output_dim,),\n ...
[ "0.7554496", "0.7480992", "0.71194774", "0.6937145", "0.6901332", "0.68904847", "0.68022543", "0.67635393", "0.6720167", "0.67137855", "0.6669927", "0.6656371", "0.6638359", "0.66269267", "0.6613141", "0.6611152", "0.6595971", "0.65903264", "0.658748", "0.65860504", "0.655012...
0.84982526
0
Generate a random name of the form "export_XXXXXX" where XXXXXX are 6 random characters.
def generate_rand_name() -> str: suf = "".join(random.choices(string.ascii_uppercase + string.digits, k=6)) return f"exporters_{suf}"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_name(prefix='test'):\n rndbytes = os.urandom(8)\n md5 = hashlib.md5()\n md5.update(rndbytes)\n return '{}_{}'.format(prefix, md5.hexdigest()[:7])", "def generate_unique_name(base):\n random_length = 10\n random_string = ''.join(random.choices(string.ascii_lowercase,\n ...
[ "0.768563", "0.76545644", "0.75999147", "0.7569935", "0.7542139", "0.7486131", "0.7448492", "0.7422053", "0.73991156", "0.7305884", "0.72978884", "0.7269345", "0.72691554", "0.7266666", "0.72513133", "0.72499096", "0.72090775", "0.7191241", "0.7174157", "0.71657175", "0.71649...
0.872831
0
Given a username provide the password hash for verification.
def get_password_hash(self, username): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_password(username, password):\n if username in user_auth and check_password_hash(user_auth.get(username), password):\n return username", "def hash_password(username, password):\n m = hashlib.sha512()\n m.update(username.encode('utf-8'))\n m.update(password.encode('utf-8'))\n retu...
[ "0.76989436", "0.74546", "0.74088085", "0.6934754", "0.6850222", "0.6827627", "0.681311", "0.67802805", "0.6749425", "0.67201895", "0.67056984", "0.6703862", "0.6681003", "0.66740316", "0.6672733", "0.66718876", "0.6665299", "0.66435826", "0.66078746", "0.6593887", "0.6589873...
0.8096595
0
Get the configuration that created this connection. Under certain circumstances (notably, OAuth token refreshing), fields of this configuration object are modifiable after the connection has been created; see the documentation for
def config(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config_connection(self):\n return self.m_connection.config", "def get_configuration(self) -> dict:\n return self.config", "def config(self) -> ClientConfig:\n return self._config", "def get_config(self):\n return self.config", "def configuration(self):\n return se...
[ "0.77958065", "0.7750327", "0.76211256", "0.7601931", "0.7556502", "0.74666893", "0.7444813", "0.7441127", "0.74105966", "0.74105966", "0.740344", "0.740344", "0.740344", "0.7372919", "0.7354639", "0.73074126", "0.7298534", "0.7281869", "0.7276039", "0.7276039", "0.7262093", ...
0.0
-1
Takes a formula and a set of atoms (that do not necessarily appear in the formula), and returns a set of models of the formula, where each model is represented by a dictionary that maps each atom to a Boolean value, where atoms are drawn from the set of atoms that appear in ``formula`` and the set of atoms represented ...
def models_with_all_atoms(formula, atoms): if formula == True: return [model for model in tablize(atoms)] original_models = [model for model in satisfiable(formula, all_models=True)] extra_atoms = atoms - formula.atoms() if not extra_atoms: return original_models else: mode...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def truth_values(formula: Formula, models: Iterable[Model]) -> Iterable[bool]:\r\n # Task 2.3\r\n # all_models_local = all_models(list(formula.variables()))\r\n to_return = list()\r\n for l_model in models:\r\n to_return.append(evaluate(formula, l_model))\r\n return to_return", "def truth_v...
[ "0.6231055", "0.61913365", "0.6105409", "0.60890245", "0.5991903", "0.59173256", "0.54118824", "0.5358695", "0.5334758", "0.5264302", "0.52000153", "0.5052022", "0.50512755", "0.5039385", "0.5019679", "0.50089824", "0.48878434", "0.48770222", "0.48583898", "0.48507598", "0.48...
0.76160675
0
Set password for this ConnectionParams.Builder
def password(self, password): self._password = password return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_password(self, password):\n self.PASSWORD = password", "def set_password(self, password):\n self.PASS = password", "def set_password(self, password):\n self.password = password", "def password(self, password: str):\n\n self._password = password", "def password(self, pass...
[ "0.7413525", "0.7361076", "0.72716075", "0.71548104", "0.7055864", "0.7055864", "0.7055864", "0.7055864", "0.6945425", "0.6945209", "0.6943506", "0.68906", "0.6664701", "0.6658458", "0.6613256", "0.6560402", "0.65255666", "0.6515033", "0.651441", "0.6474545", "0.64088285", ...
0.72465926
3
Returns a boolean of whether the raw_password was correct. Handles hashing formats behind the scenes.
def check_password(self, raw_password): def setter(raw_password): self.set_password(raw_password) self.save(update_fields=["password"]) return check_password(raw_password, self.password, setter)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_password(self, raw_password):\n return check_password(raw_password, self.password)", "def check_password(raw_password, enc_password):\n algo, salt, hsh = enc_password.split('$')\n return hsh == get_hexdigest(algo, salt, raw_password)", "def check_password(raw_password, enc_password):\n ...
[ "0.8014878", "0.76401216", "0.76401216", "0.74129486", "0.73400986", "0.7255763", "0.70965827", "0.7089921", "0.7077994", "0.7064628", "0.7058551", "0.70322514", "0.7022479", "0.7020057", "0.70097", "0.6995121", "0.69727314", "0.69459444", "0.6943152", "0.6896846", "0.6895963...
0.71083105
6
Divides an iterable in slices/chunks of size size
def chunk(iter_list, size): iter_list = iter(iter_list) # lambda: creates a returning expression function # which returns slices # iter, with the second argument () stops creating # iterators when it reaches the end return iter(lambda: tuple(islice(iter_list, size)), ())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _split_on_chunks(self, iterable, size):\n return utils.split_on_chunks(iterable, size)", "def chunks(iterable: Iterable, size: int) -> Iterable:\n it = iter(iterable)\n item = list(itertools.islice(it, size))\n while item:\n yield item\n item = list(itertools.islice(it, size))",...
[ "0.78909814", "0.7767243", "0.7690632", "0.7690632", "0.7690632", "0.7626673", "0.76194537", "0.7608236", "0.75428337", "0.73960936", "0.7352128", "0.733166", "0.73105484", "0.7285378", "0.7267432", "0.72592026", "0.7238026", "0.7238013", "0.7229984", "0.7222476", "0.71650386...
0.71808845
20
Close and remove any global registrations. Always call this function when finished with this instance as it ensures that it can be garbage collected. This function is defined instead of a __del__ function because Python calls the __del__ function unreliably.
def close(self) -> None: logs.remove_record_handler(self.execution_uid)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_registrar(self):\n self.registrar.destroy()", "def __del__(self):\n for key_path_prefix, registry_file in iter(self._registry_files.items()):\n self._registry_files[key_path_prefix] = None\n if registry_file:\n registry_file.Close()", "def _shutdown(): \n for GD in Gl...
[ "0.75686306", "0.7412972", "0.7136398", "0.7110037", "0.70395434", "0.685597", "0.685597", "0.685597", "0.685597", "0.685597", "0.685597", "0.685597", "0.685597", "0.6852275", "0.68152225", "0.6754472", "0.67464596", "0.6707297", "0.67025554", "0.67020535", "0.66946137", "0...
0.0
-1
Get the name of the currently running phase, or None. Note that this name is not guaranteed to still be accurate by the time this method returns, so this should only be used for log messages/user display and not for programmatic purposes.
def last_run_phase_name(self) -> Optional[Text]: if self.running_phase_state: return self.running_phase_state.name return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def phase(self) -> Optional[str]:\n return pulumi.get(self, \"phase\")", "def getName(self):\n return self.stepDictionary[self.getLocation()]", "def phase(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"phase\")", "def phase(self) -> Optional[pulumi.Input[str]]:\n ...
[ "0.71856076", "0.69921845", "0.66996187", "0.66996187", "0.66996187", "0.6474902", "0.63779265", "0.63779265", "0.6363522", "0.62794316", "0.62593573", "0.62593573", "0.62593573", "0.62593573", "0.62593573", "0.62593573", "0.62593573", "0.62593573", "0.62593573", "0.62593573", ...
0.8030202
0
Set the TestRecord's start_time_millis field.
def mark_test_started(self) -> None: # Blow up instead of blowing away a previously set start_time_millis. assert self.test_record.start_time_millis == 0 self.test_record.start_time_millis = util.time_millis() self.notify_update()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_time(self, value):\n self._start_time = value", "def set_start_time():\n __start = current_time_milli()", "def start_time(self, start_time):\n self._start_time = start_time", "def start_time(self, start_time):\n self._start_time = start_time", "def start_time(self, start_t...
[ "0.7461097", "0.713004", "0.71145236", "0.71145236", "0.70517486", "0.70517486", "0.70517486", "0.70517486", "0.70517486", "0.6792198", "0.67304593", "0.6597893", "0.6538643", "0.643264", "0.6413857", "0.6389587", "0.6382834", "0.63800573", "0.633039", "0.6307586", "0.6255372...
0.7052474
4
Called for a `new` instruction.
def on_new(self, ins, const): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_object(self):\r\n\t\tpass", "def __new__(*args, **kwargs):\n ...", "def __new__(*args, **kwargs):\n ...", "def __new__(*args, **kwargs):\n ...", "def __new__(*args, **kwargs):\n ...", "def __new__(*args, **kwargs):\n ...", "def __new__(*args, **kwargs):\n ...
[ "0.74818504", "0.7395534", "0.7395534", "0.7395534", "0.7395534", "0.7395534", "0.7395534", "0.7395534", "0.7395534", "0.7395534", "0.7395534", "0.7395534", "0.7395534", "0.7395534", "0.7395534", "0.7395534", "0.7395534", "0.7395534", "0.7395534", "0.7395534", "0.7395534", ...
0.0
-1
Onehot encode integer labels y. The number of classes is assumed to be the largest value in y
def onehot_encode_labels(y): return OneHotEncoder(categories="auto", sparse=False).fit_transform(y.reshape(y.shape[0],1))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _onehot(y, n_classes=False):\n if not n_classes:\n \"\"\"Create one-hot encoded labels.\"\"\"\n n_classes = len(set(y))\n out = np.zeros((len(y), n_classes))\n for i, ii in enumerate(y):\n out[i][ii] += 1\n y_onehot = out.astype(int)\n return y_onehot", "def onehot_encode_...
[ "0.8922882", "0.8852088", "0.8606835", "0.8596903", "0.8584284", "0.84639335", "0.84183574", "0.837195", "0.8359242", "0.8348002", "0.83127004", "0.8293814", "0.8278722", "0.8263784", "0.82605064", "0.8256802", "0.8183106", "0.8183106", "0.8076087", "0.8067563", "0.8013488", ...
0.8860286
1
Compute the accuracy of predictions using onehot encoded labels
def accuracy_onehot(labels, preds): assert labels.shape[0]==preds.shape[0] return np.sum(np.argmax(preds, axis=1) == np.argmax(labels, axis=1))/float(labels.shape[0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accuracy_onehot(y_pred, y_label):\n return (y_pred.argmax(dim=1) == y_label).float().mean().item()", "def accuracy(preds, labels):\n correct = preds == labels\n return correct.sum().float() / correct.shape[0]", "def accuracy(probabilities: np.ndarray, labels: np.ndarray) -> float:\n # [...
[ "0.8403834", "0.78746563", "0.7833525", "0.7828252", "0.78266877", "0.78144145", "0.7745161", "0.76643187", "0.7623697", "0.7589688", "0.7578266", "0.75630087", "0.7504252", "0.74835384", "0.7456411", "0.74351454", "0.7418144", "0.7388466", "0.73777604", "0.73777604", "0.7372...
0.856095
0
Compute the accuracy of predictions using integer labels
def accuracy(labels, preds): assert labels.shape[0]==preds.shape[0] return np.sum(preds==labels)/float(labels.shape[0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accuracy(labels, predictions):\n if len(labels) != len(predictions):\n return -1\n\n correct = 0\n total = 0\n\n for i,v in enumerate(predictions):\n if labels[i] == str(v):\n correct += 1\n total += 1\n\n return (float(correct) / float(total)) * 100.0", "def ...
[ "0.85062397", "0.8452206", "0.84218514", "0.84087497", "0.8266391", "0.8255349", "0.8220492", "0.81306535", "0.79728043", "0.7951841", "0.79321593", "0.7858775", "0.7839066", "0.7813306", "0.778941", "0.778941", "0.7783211", "0.7775989", "0.7763696", "0.77389365", "0.77336806...
0.8182313
7
Returns the current mean of the proposal distribution.
def mean(self): return self.x_guessed()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mean(self):\n return self._mean", "def mean(self):\n return self._mean", "def mean(self):\n return self.mu", "def mean(self):\n return math.exp(self.mu + (self.sigma ** 2) / 2)", "def getMean(self):\n return self.mean", "def mean(self):\n return self._lift(\"...
[ "0.80405176", "0.80405176", "0.80261374", "0.7949538", "0.78918725", "0.78884816", "0.7801771", "0.779538", "0.77003163", "0.7698231", "0.76978433", "0.7694228", "0.76512897", "0.76409745", "0.7524871", "0.75216967", "0.749616", "0.7481523", "0.74699676", "0.74551845", "0.736...
0.72261935
27
Removes words from valid_words based on whether or not the guess was correct
def results_of_guess(self): print(self.best_guess) print(self.chosen_letter) #self.best_guess = input("Enter word with correct letters and stars " + "as blank spaces.") wrong_words = set() if self.chosen_letter in self.best_guess: # in case of success ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_unwanted_words(self) -> None:\n pad_open: bool = False\n for word in self.report.get_words():\n if word.text in self.rules.citation_delimiters:\n pad_open = not pad_open\n continue\n if pad_open:\n continue\n for u...
[ "0.6978611", "0.6823432", "0.6815923", "0.6780036", "0.67796695", "0.6741111", "0.66481566", "0.6629511", "0.65828186", "0.6519755", "0.65046734", "0.6459031", "0.64308256", "0.639935", "0.63974833", "0.6388123", "0.63726896", "0.63508546", "0.6338871", "0.6332879", "0.632384...
0.58976465
96
get_dynamic_pressure returns the dynamic pressure at a given velocity in this environment. Be careful to ensure consistant units with the model in use.
def get_dynamic_pressure(self, velocity): dynamic_press = 0.5 * self.Density * velocity**2 return dynamic_press
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pressure(vv, tt, chemical_potential, gbar=2.0, *args, **kwargs):\n # type: (np.ndarray, np.ndarray, float, list, dict) -> np.ndarray\n y = chemical_potential / tt\n pressure = (\n gbar * np.sqrt(2) / (3 * np.pi ** 2) * tt ** (2.5) * _1d_call(_fdk, y, k=1.5)\n )\n return pressure", "...
[ "0.6063561", "0.5771036", "0.56866175", "0.5550248", "0.54784036", "0.5464602", "0.5461538", "0.5454981", "0.5406294", "0.53102523", "0.5305995", "0.525358", "0.52433705", "0.52364284", "0.521001", "0.51836723", "0.5177972", "0.5147309", "0.513841", "0.51174736", "0.50451267"...
0.8371995
0
Computes the sum along segments of a tensor. Analogous to tf.unsorted_segment_sum.
def unsorted_segment_sum(data: torch.Tensor, segment_ids: torch.Tensor, num_segments: int) -> torch.Tensor: if len(segment_ids.shape) != 1: raise AssertionError("segment_ids have be a 1-D tensor") if data.shape[0] != segment_ids.shape[0]: raise AssertionError( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _rowwise_unsorted_segment_sum(values, indices, n):\n batch, k = tf.unstack(tf.shape(indices), num=2)\n indices_flat = tf.reshape(\n indices, [-1]) + tf.div(tf.range(batch * k), k) * n\n ret_flat = tf.unsorted_segment_sum(\n tf.reshape(values, [-1]), indices_flat, batch * n)\n return t...
[ "0.7506605", "0.74699783", "0.72073925", "0.6586497", "0.6506094", "0.6485964", "0.6485964", "0.6485964", "0.6485964", "0.6485964", "0.6312732", "0.63053745", "0.6110864", "0.5963782", "0.595026", "0.59458345", "0.5915711", "0.57985264", "0.55721176", "0.551346", "0.5353314",...
0.7578235
0
Visualize an image once. Used to visualize generator before training.
def visualize_digits(tensor_to_visualize): with tf.Session() as sess: sess.run(tf.global_variables_initializer()) with queues.QueueRunners(sess): images_np = sess.run(tensor_to_visualize) plt.axis('off') plt.imshow(np.squeeze(images_np), cmap='gray')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def visualizeImg(img):\n plt.figure(figsize=(10,4))\n plt.imshow(img)\n plt.show()", "def show_image(self):\n cv2.imshow(self.config.DISPLAY_NAME, self.image)", "def plot_single_image(image):\n image = image.cpu()\n \n assert type(image) is torch.Tensor, 'Image to plot is not torch.Tensor'\n...
[ "0.70964646", "0.7073794", "0.7072046", "0.7047754", "0.7041124", "0.7021574", "0.7016016", "0.6949454", "0.6937185", "0.6934807", "0.69317704", "0.6912239", "0.6893389", "0.6878521", "0.6850345", "0.6825746", "0.68001765", "0.67989963", "0.6793074", "0.6774607", "0.6701023",...
0.60928327
88
Get the mosaic filename Returns
def getMosaic(self): from .gsMosaic import Mosaic mfn = Mosaic(self.mosaicFilename, "r") return mfn
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mosaic_art_file_name(target_im):\n target_file_name = extract_file_name(target_im)\n now_dt = now_datetime()\n return '{0}_mosaic_{1}.png'.format(target_file_name, now_dt)", "def file(self):\n\n dlos_filename = super(DlosPhotoz, self).file()\n\n photoz_str = 'DLOS_photoz_'\n \n ...
[ "0.7708499", "0.6606807", "0.64587444", "0.64475816", "0.6422161", "0.64113533", "0.63816094", "0.63787526", "0.6374186", "0.6363668", "0.636102", "0.63525915", "0.6346686", "0.6340294", "0.6334211", "0.63274634", "0.63243693", "0.6322172", "0.6318359", "0.6304304", "0.628762...
0.75586784
1
Get all variables Returns list of file variables
def getVariables(self): statVars = [self[vn] for vn in self.statVars] timeVars = [self[vn] for vn in self.timeVars] return statVars + timeVars
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_of_vars_in_user_file():\n # parser = argparse.ArgumentParser()\n # parser.add_argument(\"path\")\n # path = parser.parse_args().path\n # path = DUMMY_FILE_PATH\n path = parser.parse_args().path\n logger.info(\"Using the file: {}\".format(path))\n\n if not os.path.exists(path):\n ...
[ "0.7833039", "0.7238103", "0.69869554", "0.69644547", "0.6915969", "0.69140524", "0.68490237", "0.68011314", "0.66436243", "0.66335595", "0.66191787", "0.66188616", "0.659308", "0.6590448", "0.65887153", "0.6578212", "0.6574628", "0.6574628", "0.6574628", "0.64851946", "0.647...
0.63103765
29
Get neighbors of hexagon at single distance
def get_neighbors_ring(self,distance): return self.grid.get_neighbors_ring(self,distance)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_neighbors(y, x, H, W):\n neighbors = []\n\n for i in (y-1, y, y+1):\n for j in (x-1, x, x+1):\n if i >= 0 and i < H and j >= 0 and j < W:\n if (i == y and j == x):\n continue\n neighbors.append((i, j))\n\n return neighbors", "def...
[ "0.71405435", "0.71405435", "0.71400833", "0.7114397", "0.7093709", "0.7070817", "0.7065186", "0.6994093", "0.69804674", "0.69762784", "0.68680763", "0.68249947", "0.68156403", "0.6794492", "0.6780366", "0.6755422", "0.67513496", "0.67236304", "0.6703036", "0.6687287", "0.668...
0.6547329
42
Get mean reproductive probability
def get_average_repro(self): return np.mean([agent.get_fledge_probability() for agent in self.agents])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mean(self):\r\n\t\treturn sum(self.sample)/len(self.sample)", "def mean(self):\n return sum(p * x for x, p in self.items())", "def theoretical_effective(dataset):\n return float(sum(dataset))/len(dataset)", "def generalized_mean(x, p, N):\n if p != 0:\n D = 1/(N)\n out = (D*sum...
[ "0.68868256", "0.6808948", "0.67508686", "0.6708355", "0.6678046", "0.6669184", "0.66402876", "0.66308576", "0.6544661", "0.6532276", "0.6529878", "0.6504319", "0.6502189", "0.6440113", "0.6434963", "0.64111936", "0.63990843", "0.63824254", "0.6371108", "0.6353391", "0.632530...
0.6948326
0
Check that the minikube test deployment is available. The host IP will be set automatically from `minikube ip` if the test suite is run from `make test`.
def test_dashboard_is_up(dashboard_address): response = requests.get(f"{dashboard_address}/health") assert response.status_code == 200 assert response.text == "ok"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_test_environment(context, coreapi_url):\n if context.running_locally:\n logger.info(\"Note: integration tests are running localy via docker-compose\")\n if coreapi_url:\n _check_env_for_remote_tests(\"F8A_API_URL\")\n _check_env_for_remote_tests(\"F8A_JOB_API_URL\")...
[ "0.6146589", "0.61194855", "0.60403854", "0.60009164", "0.59269255", "0.5863339", "0.58181006", "0.5811339", "0.5811339", "0.57909757", "0.5786613", "0.5777058", "0.57660544", "0.57660544", "0.57452726", "0.57452726", "0.57452726", "0.57452726", "0.57452726", "0.57452726", "0...
0.54493207
67
Create a New Quote under a PartnerID by passing the API Fields as described in the API Docs
def create_quote(self, query_params=dict(), **kwargs): quote = Quote(partner_id=self.partner, prefix=self.prefix) response = quote._create(query_params, **kwargs) quote.set_values(response) return quote
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quote_create(request: HttpRequest) -> HttpResponse: # noqa: 201\n form = QuoteForm(request.POST or None)\n\n if form.is_valid():\n form.save()\n messages.success(request, \"Created quote.\")\n return redirect(\"quotes:quote_list\")\n\n return render(\n request,\n \"...
[ "0.6508626", "0.6300435", "0.60182333", "0.5754441", "0.55294424", "0.5461251", "0.5461251", "0.54391956", "0.54281914", "0.5370511", "0.536926", "0.5358496", "0.5356512", "0.5340314", "0.5337365", "0.531263", "0.52982354", "0.5228273", "0.52240545", "0.52228206", "0.5216454"...
0.66437835
0
Converts a value to a numpy ndarray
def tn(value): if not isinstance(value, np.ndarray): if isinstance(value, torch.Tensor): value = value.detach() value = value.numpy() else: value = np.array(value) return value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _to_ndarray(data):\n return np.atleast_1d(getattr(data, 'values', data))", "def asarray(val, dtype=np.float64):\n # val is a list, tuple etc\n if not np.isscalar(val) and np.ndim(val) > 0:\n np_val = np.asarray(val, dtype=dtype)\n else:\n # val is a scalar number\n np_val = n...
[ "0.7342944", "0.73237365", "0.7122219", "0.71056193", "0.7008842", "0.69852966", "0.6949396", "0.69432265", "0.6791192", "0.6785318", "0.67441803", "0.6679968", "0.66765916", "0.66706157", "0.6669246", "0.6667281", "0.6647875", "0.6602765", "0.6590373", "0.6569443", "0.656213...
0.0
-1
Perform the dot product between unitdirection vector and the S/C separation vectors
def calc_k_dot_r(self): self.k_dot_r = self.k[0]*self.rij[0,:,:,:] + self.k[1]*self.rij[1,:,:,:] + self.k[2]*self.rij[2,:,:,:] return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dotproduct(first, other):\n if isinstance(first,FreeCAD.Vector) and isinstance(other,FreeCAD.Vector):\n return (first.x*other.x + first.y*other.y + first.z*other.z)", "def dot_vectors(u, v):\n return u[0] * v[0] + u[1] * v[1] + u[2] * v[2]", "def vector_dot(v1,v2):\n return (v1.x * v2.x) + ...
[ "0.70557386", "0.7046572", "0.6932845", "0.69139516", "0.6910045", "0.68896127", "0.6831115", "0.67832065", "0.6752343", "0.67217207", "0.66839135", "0.66520125", "0.66479564", "0.66193724", "0.6602823", "0.65993774", "0.6577685", "0.6576553", "0.655416", "0.65529716", "0.653...
0.0
-1
Return the candidate for self project
def self_candidate(self) -> Candidate: return self.environment.project.make_self_candidate(not self.no_editable)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def candidate(self):\n return Candidate(self.lan_address, self.tunnel)", "def __get_project_version__(self):\n api = FortifyApi(self.ssc_server, token=self.token, verify_ssl=False)\n try:\n response = api.get_project_versions() # api should support a search expression here. alas....
[ "0.6132052", "0.58670956", "0.5773933", "0.5742885", "0.5729504", "0.55947673", "0.55636394", "0.55636394", "0.55636394", "0.55636394", "0.55636394", "0.553479", "0.55334324", "0.55334324", "0.55283254", "0.55283254", "0.55283254", "0.55283254", "0.55283254", "0.55283254", "0...
0.74467826
0
Check if the candidate should be updated
def _should_update(self, dist: Distribution, can: Candidate) -> bool: backend = self.environment.project.backend if self.reinstall or can.req.editable: # Always update if incoming is editable return True if is_editable(dist): # only update editable if no_editable is True ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def needs_update(self) -> bool:\n return False", "def should_update(self, instance, **kwargs):\n return True", "def check(self):\n\n self.check_auto_update()\n assert not self.empty()", "def available(self):\n last_update_success = super().available\n if last_update_...
[ "0.7251842", "0.72159237", "0.6971171", "0.68684727", "0.67902607", "0.6635805", "0.6622813", "0.6614182", "0.6592253", "0.65711755", "0.65584683", "0.6510388", "0.6384584", "0.6378037", "0.6332267", "0.6302957", "0.63011354", "0.6282399", "0.6275278", "0.6267735", "0.6263581...
0.63267577
15
Get and format the current date and time
def get_current_time(): dateTime = datetime.datetime.now() # "%Y-%m-%d %H:%M:%S:%f" is default formatting with everything dateTime = dateTime.strftime("%m-%d-%y %H:%M:%S") logger.logger.debug("Getting current time: {}".format(dateTime)) return dateTime
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_current_datetime_string ( ) :\n return get_current_datetime( ).strftime( \"%Y%m%d-%H%M%S\" )", "def get_now():\r\n now = dt.datetime.now()\r\n now_str = now.strftime(\"%d/%m %H:%M\")\r\n return now_str", "def time_date(self):\r\n from datetime import date\r\n from datetime impo...
[ "0.8117235", "0.81108576", "0.8060017", "0.80028796", "0.7949157", "0.7922295", "0.7877222", "0.7872565", "0.77984124", "0.77962625", "0.7785793", "0.7756726", "0.7746075", "0.77448994", "0.7717051", "0.77154213", "0.769685", "0.76686645", "0.7666582", "0.7618142", "0.7608392...
0.74429864
30
Devuelve una lista con los partidos que se pueden jugar sin que coincida alguno que este en juego
def get_partidos_espera_equipos_no_jugando_list(fase): partidos_espera_list = get_partidos_espera_list(fase) partidos_jugando_list = get_partidos_jugando_list(fase) equipos_jugando = [] for partido_jugando in partidos_jugando_list: equipos_jugando.append(partido_jugando.equipo_local) equipos_jugando.append(part...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_partidos_con_campos_para_forzar(fase):\n\tpartidos_espera_list = get_partidos_espera_list(fase)\n\tcampos_para_forzar_list = CampoController.get_campos_para_forzar(fase)\n\tpartido_campo = []\n\tfor x in range(0, len(partidos_espera_list)):\n\t\taux = [partidos_espera_list[x], campos_para_forzar_list[x]]\n...
[ "0.6413991", "0.6191988", "0.60349923", "0.60153407", "0.5992194", "0.59495085", "0.588866", "0.58527535", "0.5836585", "0.5836233", "0.5734299", "0.5733459", "0.5731731", "0.5705199", "0.5682125", "0.5680923", "0.56652087", "0.5656599", "0.56458247", "0.5629024", "0.5614137"...
0.6662118
0
Devuelve una lista de listas con los partidos que se pueden jugar en los campos disponibles [[partido,[campo,campo]],[partido,[campo]],[partido,[]]...]
def get_partidos_con_campos_para_forzar(fase): partidos_espera_list = get_partidos_espera_list(fase) campos_para_forzar_list = CampoController.get_campos_para_forzar(fase) partido_campo = [] for x in range(0, len(partidos_espera_list)): aux = [partidos_espera_list[x], campos_para_forzar_list[x]] partido_campo.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Obtener_Lista(self):\n\t\treturn [self,self.Nombre+\" \"+self.Apellido,self.ID,self.Fecha, \n\t\tself.Edad,self.Test,self.Posicion,self.Prioridad,self.Progreso,self.Informe]", "def create(data):\n \n return Partlist(\n list_id = data['id'],\n name = data['name'],\n ...
[ "0.57043856", "0.556433", "0.54877603", "0.5456322", "0.54476345", "0.5342808", "0.52981555", "0.5272106", "0.52518976", "0.5249799", "0.5224575", "0.5204291", "0.5182426", "0.51744527", "0.5125516", "0.50919276", "0.50887084", "0.50761926", "0.5071486", "0.5049791", "0.50497...
0.6551099
0
Loads a file containing patient names and creates a list with this patient names.
def load(self, file): with open(file) as file: self.dataset = [line.strip() for line in file] return self.dataset
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_patient_data():\n data_file = open(\"test_data.txt\", \"r\")\n still_finding_patients = True\n my_patients = []\n while still_finding_patients is True:\n name_line = next(data_file)\n if name_line != \"END\":\n name_line = name_line.split()\n fname = name_li...
[ "0.74465054", "0.72751886", "0.70801824", "0.69113815", "0.67271835", "0.65779763", "0.64283526", "0.6418345", "0.64065945", "0.63961107", "0.63270026", "0.62678576", "0.6242179", "0.6219133", "0.62162596", "0.6143537", "0.6118897", "0.6108945", "0.6098199", "0.60511035", "0....
0.0
-1
\ Sorts a sequence naturally (alphabetically and numerically), not lexicographically. >>> a = ['num3', 'num5', 'num2'] >>> natsorted(a) [{u}'num2', {u}'num3', {u}'num5'] >>> b = [('a', 'num3'), ('b', 'num5'), ('c', 'num2')] >>> from operator import itemgetter >>> natsorted(b, key=itemgetter(1)) [({u}'c', {u}'num2'), ({...
def natsorted(seq, key=lambda x: x, number_type=float, signed=True, exp=True): try: return sorted(seq, key=lambda x: natsort_key(key(x), number_type=number_type, signed=signed, exp=exp)) except Type...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def natsorted(lst):\n return sorted(lst, key=natsort_key)", "def natsort(lst):\n lst.sort(key=natsort_key)", "def sortn(xs):\n return sorted(xs, key=sortnkey)", "def test_natsort(self):\r\n # string with alpha and numerics sort correctly\r\n s = 'sample1 sample2 sample11 sample12'.spli...
[ "0.74952155", "0.74768174", "0.74548995", "0.72836107", "0.7272402", "0.6909862", "0.6882879", "0.6769698", "0.657235", "0.657235", "0.6534188", "0.6512605", "0.65114564", "0.65060633", "0.6485239", "0.6460914", "0.64180344", "0.63837373", "0.6367795", "0.6362458", "0.6357439...
0.72283715
5
Return a provider for this entry, or None if none are fund
def get_provider(self): if self.provided_by: return list(self.provided_by)[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_provider(self) -> Optional[Provider]:\n if not self.provider:\n return None\n return Provider.objects.get_subclass(pk=self.provider.pk)", "def provider(self) -> Optional[Provider]:\n return self._provider", "def provider(self):\n try:\n return self._db....
[ "0.7247628", "0.6971993", "0.693917", "0.6874071", "0.6558484", "0.64705896", "0.634195", "0.63254255", "0.63254255", "0.6318839", "0.62664706", "0.62477016", "0.62474966", "0.6197627", "0.6098378", "0.60772276", "0.60581833", "0.6009731", "0.5994667", "0.5939482", "0.58209",...
0.69177693
3
Rounds a float to the next higher, odd number and returns an int.
def round_odd(x): return int(np.ceil(x) // 2 * 2 + 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ir(some_value):\r\n return int(round(some_value))", "def _float2int(x: float) -> int:\n return round(x * 100)", "def floor(n: float) -> int:\n return (int(n))", "def int_r(f):\n return int(np.round(f))", "def iceil(f: SupportsFloat) -> int:\n\t\t# noinspection PyTypeChecker\n\t\treturn int(np...
[ "0.6515358", "0.65141606", "0.6482262", "0.64531314", "0.6435338", "0.6423786", "0.64132315", "0.6332228", "0.6300176", "0.62954473", "0.6271339", "0.6220065", "0.6179443", "0.61396897", "0.6044374", "0.60331684", "0.6007368", "0.59475386", "0.5904001", "0.5889451", "0.587316...
0.63668364
7
Yield successive nsized chunks from l.
def _chunks(l, n): for i in xrange(0, len(l), n): yield l[i:i + n]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]", "def chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def get_chunks(self, ...
[ "0.8038813", "0.79248375", "0.7923423", "0.7885103", "0.78773195", "0.7815877", "0.77655786", "0.77556044", "0.77441615", "0.7731815", "0.77288336", "0.772473", "0.77028215", "0.76889825", "0.76889825", "0.7664208", "0.76570904", "0.7655856", "0.7655856", "0.76458347", "0.764...
0.7473358
32
Yield special chunks from l.
def _chunks2(l, cs): cs = [2, 4, 8, 16, 32, 64] ci = 0 lin = 0 while True: li = lin if li > (len(l) - 1): break lin = li + cs[ci] ci = (ci + 1) % len(cs) yield l[li:lin]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]", "def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def get_chunks(self, l, n):\r\n for i in range(0, len(l), n):\r\n yield l[i:i+n]", "def chunks(self...
[ "0.7605439", "0.74776727", "0.74354833", "0.7345512", "0.73297155", "0.72910947", "0.7256956", "0.7144419", "0.713686", "0.713686", "0.71151924", "0.7104219", "0.7086884", "0.70718455", "0.7015892", "0.70150197", "0.7010776", "0.7002283", "0.69969225", "0.69969225", "0.698990...
0.0
-1
Test if this labyrinth list of nodes is equal to an other list of nodes. Return True if the lists are the same, False else.
def equals_list_nodes(self, self_list_nodes, other_list_nodes): #If the two list of nodes have different lengths, they are automatically different if len(self_list_nodes) != len(other_list_nodes): return False else: #We sort both list of nodes self_list_node...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_same(lst1, lst2):\n return len(lst1) == len(lst2) and all([x == y for x, y in zip(lst1, lst2)])", "def __eq__(self, other: LinkedList) -> bool:\n curr1 = self._first\n curr2 = other._first\n are_equal = True\n\n while are_equal and curr1 is not None and curr2 is not None:\...
[ "0.73232615", "0.7302792", "0.72638583", "0.7238595", "0.71936786", "0.6982857", "0.6915042", "0.6912449", "0.6912093", "0.6910182", "0.68487555", "0.6829646", "0.68256193", "0.6825079", "0.6809668", "0.6764149", "0.6756064", "0.6748823", "0.6730351", "0.6709269", "0.6703674"...
0.7905905
0
Close connection when class object is garbage collected
def __del__(self): self.close_connection() self.close_engine()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close(self):\r\n self.conn.close()\r\n gc.collect()", "def close(self): \n\t\tself.connection = None", "def close(self):\n self.connection = None", "def close(self): \n self.connection.close()", "def close(self):\n self._connection.close()", "def _close_connection(self)...
[ "0.8247631", "0.82462347", "0.79897016", "0.79579836", "0.7908414", "0.7801764", "0.77779824", "0.77334297", "0.7681331", "0.7675295", "0.7671122", "0.76388806", "0.76286304", "0.76245934", "0.7614287", "0.7583629", "0.7583629", "0.75770783", "0.7563015", "0.7560027", "0.7560...
0.79511744
4
Returns starting state of the board.
def initial_state(): return [[EMPTY, EMPTY, EMPTY], [EMPTY, EMPTY, EMPTY], [EMPTY, EMPTY, EMPTY]]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_state(self):\r\n return np.zeros(self.board_size, dtype=np.int8)", "def start_state():\n return chess.Board()", "def startingState(self):\n # Returns starting position and 4 false because no corners are visited yet\n return (self.startingPosition, (False, False, False, False))...
[ "0.8081514", "0.7890486", "0.7534929", "0.72789717", "0.72789717", "0.72262055", "0.72262055", "0.72262055", "0.72262055", "0.72262055", "0.72262055", "0.72262055", "0.72262055", "0.72262055", "0.72262055", "0.72262055", "0.72262055", "0.72262055", "0.72262055", "0.72262055", ...
0.0
-1
Returns player who has the next turn on a board.
def player(board): X_count = 0 O_count = 0 for row in board: X_count += row.count(X) O_count += row.count(O) if X_count <= O_count: return X else: return O
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_player(board, prev_player):\n opp = Othello.opponent(prev_player)\n if Othello.any_legal_move(opp, board):\n return opp\n elif Othello.any_legal_move(prev_player, board):\n return prev_player\n return None", "def next_player(self,board, prev_player):\r\n...
[ "0.7911148", "0.7521969", "0.74204457", "0.73687756", "0.71954805", "0.69775087", "0.69621766", "0.69253695", "0.69208723", "0.69010353", "0.6845991", "0.6841043", "0.6838282", "0.68265843", "0.67751175", "0.67751175", "0.6769739", "0.6713109", "0.67060393", "0.66561204", "0....
0.0
-1
Returns the optimal action for the current player on the board.
def minimax(board): if terminal(board): return None max_action_value = -1 min_action_value = 1 best_action = None for action in actions(board): if player(board) == X: # Action value given by O player minimizing the action value on next state action_value = m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_best_action(self):\n if self.bestAction is None:\n self.calculate_best_action()\n return self.bestAction", "def getAction(self, gameState: GameState):\n _max = float(\"-inf\")\n action = None\n for move in gameState.getLegalActions(0):\n util = min...
[ "0.7766856", "0.76323676", "0.75855315", "0.75285065", "0.75175256", "0.74667144", "0.7460485", "0.74263537", "0.7416421", "0.73943585", "0.7375846", "0.7333894", "0.73147565", "0.7306611", "0.7284639", "0.72650313", "0.72650313", "0.7250975", "0.72331834", "0.7203267", "0.71...
0.7032568
34
Recursive function to calculate primes up to n. Incorporates fact that it is enought to examine multiples of the prime numbers up to sqrt(n)
def primes(n): if n == 0 or n == 1: return [] else: p = primes(int(sqrt(n))) no_p = { j for i in p for j in xrange(i*2, n+1, i) } p = { x for x in xrange(2, n + 1) if x not in no_p } return p
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def primes(n):\n sqrtN=n**0.5\n odds=[2]\n odds+=[i for i in range(3,n) if i%2>0]\n\n for i in odds:\n if i!=0 and i<=sqrtN:\n for j in odds[odds.index(i)+1:]:\n if j%i==0:\n odds[odds.index(j)]=0\n return [i for i in odds if i!=0]", "def find_n_...
[ "0.7935951", "0.7668389", "0.7620961", "0.7600138", "0.75702995", "0.756856", "0.7554707", "0.7548644", "0.7548644", "0.7532233", "0.74427325", "0.7426799", "0.74236226", "0.74150395", "0.739119", "0.7381784", "0.7375258", "0.737497", "0.73526174", "0.7323778", "0.73236036", ...
0.7261082
30
mag2flux is a function to convert AB magnitude to flam.
def mag2flux(mag,emag,wave): flam = 10**(-0.4 * (mag + 2.406 + 5.*np.log10(wave))) eflam = flam * np.log(10.) * 0.4 * emag return flam,eflam
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mag_to_flux(mag, mag_zp):\n return 10 ** (-0.4 * (mag - mag_zp))", "def magtoflux(_mag, _id):\n return math.pow(10, -0.4*(_mag + VegaToAB[_id] - 8.9))", "def mag2Flux(mag, unit='maggy'):\n flux = 10.0 ** (-0.4 * mag)\n\n if unit.lower().strip() == 'jy':\n return flux * 3631.0\n\n if u...
[ "0.7661163", "0.76591533", "0.7333106", "0.72614634", "0.7211719", "0.70236474", "0.6988646", "0.69357157", "0.6924593", "0.683043", "0.6827836", "0.67973167", "0.6711155", "0.64483994", "0.63337207", "0.6265689", "0.61794144", "0.6156138", "0.61506623", "0.6146087", "0.61387...
0.77937734
0
The Cloud SQL collation value.
def collation(self) -> str: return pulumi.get(self, "collation")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collation(self) -> Optional[str]:\n return pulumi.get(self, \"collation\")", "def collation(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"collation\")", "def collation(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"collation\")", "def collation(self) -> ...
[ "0.8259287", "0.8153705", "0.80996335", "0.80996335", "0.7659596", "0.68911797", "0.670639", "0.64089656", "0.60281724", "0.59352213", "0.57849586", "0.5730767", "0.5675355", "0.5572144", "0.5428307", "0.5390299", "0.5383137", "0.5351167", "0.53033125", "0.5221688", "0.521594...
0.8421332
1
The name of the Cloud SQL instance. This does not include the project ID.
def instance(self) -> str: return pulumi.get(self, "instance")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return self._client.project_name + '/instances/' + self.instance_id", "def cloud_name(self):\n return self._cloud_name", "def name(self):\n _LOGGER.debug(self._shelly_cloud_device_name + ' >>> ' +\n self._shelly_cloud_entity_name + ' >>> name() >>> ' ...
[ "0.82063854", "0.72441554", "0.7120339", "0.70252013", "0.6960602", "0.69432664", "0.6916303", "0.6888547", "0.6888547", "0.68760103", "0.68502605", "0.6832102", "0.6796444", "0.67627484", "0.67627484", "0.67627484", "0.67627484", "0.67395926", "0.673649", "0.67351305", "0.67...
0.0
-1
The URI of this resource.
def self_link(self) -> str: return pulumi.get(self, "self_link")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uri(self) -> str:\n return self._uri", "def uri(self):\n return self._uri", "def uri(self):\n return self._uri", "def uri(self):\n return self._uri", "def uri(self):\n return self._uri", "def uri(self):\n return self._uri", "def uri(self):\n return s...
[ "0.8812683", "0.8718146", "0.8718146", "0.8718146", "0.8718146", "0.8718146", "0.8718146", "0.8695291", "0.8589555", "0.8529888", "0.83778185", "0.8267541", "0.82543814", "0.81543136", "0.8079777", "0.80435663", "0.8043164", "0.8011471", "0.7937294", "0.786632", "0.786632", ...
0.0
-1
Capacity is the static size of the array. fillValue is placed at each position.
def __init__(self, capacity, fillValue = None): self._items = list() self._fillValue = fillValue self._DEFAULT_CAPACITY = capacity self._logicalSize = 0 #as required by exercise 1 for count in xrange(capacity): self._items.append(self._fill...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, capacity, fillValue=None):\r\n self._items = list()\r\n for count in range(capacity):\r\n self._items.append(fillValue)", "def __init__(self, capacity, fillValue=None):\r\n self._items = list()\r\n self._logicalSize = 0\r\n # Track the capacity and...
[ "0.72756517", "0.7070662", "0.69123954", "0.68207943", "0.6160506", "0.6125096", "0.6075469", "0.603681", "0.6020266", "0.5992947", "0.5944047", "0.5909096", "0.5896172", "0.58946216", "0.5862521", "0.58049583", "0.57762265", "0.5775138", "0.57401764", "0.5713871", "0.5699855...
0.7228704
1
Returns the logical size of the array.
def _size(self): return self._logicalSize
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def array_size(self):\n return self._array_size", "def getArrayLength(self):\r\n return self.arraySize", "def size(self):\r\n return self._logicalSize", "def length(self):\n length = 0\n a = self.array_form\n for i in xrange(len(a)):\n if a[i] != i:\n ...
[ "0.7718455", "0.7451456", "0.73996395", "0.7324857", "0.73047715", "0.72781324", "0.7265324", "0.7227996", "0.72259665", "0.71991956", "0.71350807", "0.71260655", "0.70993924", "0.70918214", "0.70736474", "0.70736474", "0.7060375", "0.7049942", "0.7030675", "0.7029503", "0.69...
0.72903556
5
Return the self.data attribute.
def get_data(self): return self.data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data(self):\n if not hasattr(self, \"_data\"):\n self._data = self._get_data()\n return self._data", "def data(self):\n return self.__data", "def data(self):\n return self.__data", "def data(self):\n return self.__data", "def data(self):\n return sel...
[ "0.9074872", "0.90206456", "0.90206456", "0.90206456", "0.90206456", "0.90206456", "0.90206456", "0.90206456", "0.90206456", "0.90206456", "0.89081913", "0.89081913", "0.89081913", "0.89081913", "0.88319004", "0.88319004", "0.88319004", "0.88211125", "0.8807483", "0.8782527", ...
0.8939653
12
Replace the existing value of the self.data attribute with new_data parameter.
def set_data(self, new_data): self.data = new_data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setData(self,newData):\r\n pass", "def setData(self,newdata):\n self.record(inspect.currentframe())\n if np.shape(newdata) == np.shape(self.data):\n self.data = np.copy(newdata)", "def _update_data(self, data, update_original=False):\n self._data.update(dict((key, sel...
[ "0.79708254", "0.77804124", "0.7759733", "0.77236235", "0.77044475", "0.7677274", "0.7677114", "0.7594061", "0.75861555", "0.75861555", "0.75861555", "0.75591713", "0.748598", "0.7440727", "0.7426882", "0.7426882", "0.73479205", "0.7342873", "0.73273635", "0.7314341", "0.7314...
0.86256135
0
Replace the existing value of the self.previous attribute with new_previous parameter.
def set_previous(self, new_previous): self.previous = new_previous
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setPrev(self, prev):\n\t\t\tself.prev = prev", "def prev(self, prev):\n\n self._prev = prev", "def set_prev(self, p) -> None:\n self.prev = p", "def prev(self,p):\n assert type(p) is type(self)\n self.__prev = p", "def previous(self, _event):\n self.set_val(self.val -...
[ "0.7485387", "0.7345779", "0.70232517", "0.67961776", "0.67961144", "0.6632646", "0.6509174", "0.64484227", "0.64224696", "0.63190126", "0.62682027", "0.6267136", "0.6227941", "0.62051636", "0.6194809", "0.6149025", "0.6143375", "0.6099491", "0.6030055", "0.6028772", "0.59858...
0.8530623
0
Checks if group "group" contains a sprite with bottom "bottom"
def group_has_bottom(group: pygame.sprite.Group, bottom: int): for sprite in group: if sprite.rect.bottom == bottom: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def group_bottom_sprites(group: pygame.sprite.Group):\r\n bottom = max(map(lambda sprt: sprt.rect.bottom, group), default=RESOLUTION[1])\r\n return list(filter(lambda sprt: sprt.rect.bottom == bottom, group))", "def checkBottom(self):\n exposed = True\n for sprite in self.overlapping_sprites:...
[ "0.7531233", "0.7388793", "0.72969383", "0.673616", "0.66741395", "0.66741395", "0.6610362", "0.6590212", "0.6354262", "0.63413304", "0.6324987", "0.61557347", "0.61441636", "0.6143327", "0.6131096", "0.611867", "0.60630614", "0.6060846", "0.6043869", "0.603344", "0.58899593"...
0.909547
0
Returns the bottom of the lowest (on the screen) sprite in the group
def group_bottom(group: pygame.sprite.Group): return max(map(lambda sprt: sprt.rect.bottom, group), default=0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def group_bottom_sprites(group: pygame.sprite.Group):\r\n bottom = max(map(lambda sprt: sprt.rect.bottom, group), default=RESOLUTION[1])\r\n return list(filter(lambda sprt: sprt.rect.bottom == bottom, group))", "def _rect_bottom(self):\n\treturn min(self.y, self.y + self.h)", "def group_top(group: pygame...
[ "0.73001444", "0.72404194", "0.7028626", "0.6935661", "0.68792474", "0.68075174", "0.6570141", "0.64901865", "0.6404709", "0.6368164", "0.63623774", "0.63623774", "0.6303562", "0.61939776", "0.61793435", "0.6111214", "0.61104757", "0.6104443", "0.6100537", "0.60762507", "0.60...
0.8172834
0
Returns the highest (on the screen) top of the group's sprites whose rects have the same centerx as "rect.centerx" and lower (on the screen) centery than "rect.centery"
def group_top(group: pygame.sprite.Group, rect: pygame.Rect): same_centerx_lower_centery = filter(lambda sprt: sprt.rect.centerx == rect.centerx and sprt.rect.centery >= rect.centery, group) return min(map(lambda sprt: sprt.rect.top, same_centerx_lower_cen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _rect_top(self):\n\treturn max(self.y, self.y + self.h)", "def absolute_collide_bottomright(self):\n x,y = self.position\n rect = self.collide_rect\n return (x+rect.width/2, y)", "def absolute_collide_topleft(self):\n x,y = self.position\n rect = self.collide_rect\n ...
[ "0.7039691", "0.6915761", "0.6821774", "0.6605683", "0.62852794", "0.6066323", "0.6051855", "0.5955852", "0.5951763", "0.5937266", "0.58950734", "0.58910495", "0.5854065", "0.58135986", "0.57965654", "0.57935864", "0.57926077", "0.5782943", "0.5777361", "0.57640344", "0.57552...
0.82293385
0
Convert a MAC address to a readable/printable string
def mac_addr(address): print(':'.join('%02x' % compat_ord(b) for b in address)) return ':'.join('%s' % format(compat_ord(b), '0>8b') for b in address)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mac_ntoa(mac):\n return '%.2x:%.2x:%.2x:%.2x:%.2x:%.2x' % tuple(map(ord, list(mac)))", "def _mac_addr(address):\n return ':'.join('%02x' % ord(b) for b in address)", "def get_mac_string():\n mac_int = getnode()\n mac_str = ':'.join((\"%012x\" % mac_int)[i:i + 2] for i in range(0, 12, 2))\n re...
[ "0.8274901", "0.7819506", "0.7799624", "0.7411498", "0.7411498", "0.7411498", "0.7411498", "0.7393615", "0.72612065", "0.7243841", "0.7214834", "0.71748555", "0.7040925", "0.69946724", "0.6982126", "0.6982003", "0.6913715", "0.67323697", "0.671812", "0.6642322", "0.6640873", ...
0.78023726
2
Adds a NonLocal block for self attention to the input tensor. Input tensor can be or rank 3 (temporal), 4 (spatial) or 5 (spatiotemporal).
def non_local_block(tensor, intermediate_dim=None, compression=2, mode='embedded', add_residual=True): ip_shape = tensor.shape if mode not in ['gaussian', 'embedded', 'dot', 'concatenate']: raise ValueError('`mode` must be one of `gaussian`, `embedded`, `dot` or `concatenate`')...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def block(inp, scope, past, config):\n with tf.variable_scope(scope):\n nx = inp.shape[-1].value\n norm = normalise_tensor(inp, 'ln_1')\n attn, present = attention(norm, 'attn', nx, past=past, config=config)\n out = attn + inp\n norm = normalise_tensor(out, 'ln_2')\n ml...
[ "0.62141865", "0.6140175", "0.56112856", "0.5536797", "0.5524303", "0.54469675", "0.53028214", "0.52685374", "0.52312326", "0.5201063", "0.5178927", "0.51200116", "0.5079189", "0.5038994", "0.5023708", "0.5018548", "0.501318", "0.49847504", "0.49840927", "0.49484515", "0.4929...
0.47946736
29
Retorna True se possuir as mesmas coordenadas que o outro vetor
def __eq__(self, other): return self._coords == other._coords
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def overlaps_minmaxlatlon(self,other):\n self_corners = get_2d_false_corners(self)\n other_corners = get_2d_false_corners(other)\n log.info(' Swath 2d False Corners: '+str(self_corners))\n log.info(' Other 2d False Corners: '+str(other_corners))\n\n for i in self_corners:\n...
[ "0.66272175", "0.6620873", "0.6529714", "0.64961547", "0.64827085", "0.64459527", "0.6431178", "0.6398887", "0.63909835", "0.63765305", "0.63517183", "0.63402206", "0.63402206", "0.63402206", "0.6335013", "0.6323806", "0.63210446", "0.63041556", "0.63010156", "0.6261332", "0....
0.0
-1
Assert ValueError raised if unknown string passed to sample label
def test_label_indices_unknown(): with pytest.raises(ValueError): util.get_label_indices(3, "random_str")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_missing_dataset_label():\n svl_string = \"HISTOGRAM X temperature\"\n\n with pytest.raises(SvlMissingValue):\n parse_svl(svl_string)", "def test_label_cannot_be_converted_to_string(self):\n\n class NoStr:\n def __str__(self) -> str:\n raise NotImplementedErr...
[ "0.76607716", "0.7414696", "0.72858727", "0.7277616", "0.72738194", "0.72576404", "0.7256908", "0.7159097", "0.6929822", "0.6865203", "0.68603027", "0.67808443", "0.67769974", "0.67663556", "0.67543674", "0.6659788", "0.66358453", "0.6624844", "0.661589", "0.65718335", "0.656...
0.7018802
8
return min quadrant containing self.
def bounding_quadrant(self): quadrant = Quadrant.empty_quadrant(2) for point in self.endpoints: quadrant.add_point(point) return quadrant
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min(self):\n return self._min_coords", "def min(self):\n return min(self)", "def min(self):\n return self._min(self.root)", "def get_min(self):\n\t\tif self.left:\n\t\t\treturn self.left.get_min()\n\t\treturn self.value", "def quadrant(self) -> Quadrant:\n\n if self.x > 0:\n...
[ "0.6570156", "0.6567512", "0.64077145", "0.63673735", "0.63671726", "0.63096184", "0.6303415", "0.62699646", "0.6267708", "0.6267708", "0.62233114", "0.6182831", "0.6164376", "0.6160065", "0.615448", "0.6129046", "0.6098565", "0.60662574", "0.6057143", "0.60569054", "0.605290...
0.58154714
47
Sets the gift needed for a friend character.
def set_gift(self, gift_name): self.gift = gift_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_damage():\n\n global character\n character['Damage'] = randint(1, 6)", "async def _forcesetgender(self, ctx, *args):\n if len(args) < 2:\n await ctx.send(\"Include both a name and a gender!\")\n return\n\n god = database.getGodName(args[0], ctx.guild.id)\n ...
[ "0.5870756", "0.5683692", "0.54332036", "0.54275256", "0.5402585", "0.5094512", "0.5079681", "0.50593126", "0.50358963", "0.5034555", "0.50138766", "0.5001107", "0.49965438", "0.49908543", "0.4982959", "0.49759075", "0.49700886", "0.4932639", "0.49175462", "0.4915319", "0.491...
0.71853125
0
Shifts the canvas to the left as many places as count.
def lshift(self, count): self._c = self._c[count:] + (bitarray('0') * count)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def go_left(self):\n self.rect.centerx -= 9", "def move_left(self):\n\n if self.xcor() < -230:\n self.setx(-255)\n else:\n new_x = self.xcor() - 40\n self.setx(new_x)", "def left():\n global x, canvas # x é modificado\n canvas.create_li...
[ "0.6973135", "0.65973675", "0.65681225", "0.6491277", "0.6452235", "0.64477813", "0.64477813", "0.6382884", "0.63495415", "0.6223446", "0.61753625", "0.61332804", "0.6129764", "0.60913485", "0.60909826", "0.60822546", "0.6027661", "0.598671", "0.5962182", "0.59535974", "0.589...
0.6103269
13
Returns a bitarray of the requested column, starting from offset.
def getCol(self, n, offset=0): return self._c[(n*self.__height + offset):((n+1) * self.__height)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_col(self, y):\n colrange = self._col_range(y)\n col = []\n\n for i in colrange:\n col.append(self._read_bit(i))\n\n return col", "def get_column_offsets(self):\n offsets = [x + self.bitcell_array_inst.lx() for x in self.bitcell_array.get_column_offsets()]\n ...
[ "0.6265687", "0.62398607", "0.5663601", "0.5645953", "0.5600698", "0.55636734", "0.54829437", "0.5459227", "0.5454153", "0.5450655", "0.5450495", "0.5449891", "0.54187745", "0.54068595", "0.53789526", "0.5348315", "0.5333947", "0.5326166", "0.5322707", "0.5305193", "0.5281067...
0.6364678
0
Get the URL address of the current page.
def get_url(self): return self.base_driver.current_url
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_url(self) -> str:\n\n return self.__page_url", "def current_url(self):\n return self.browser.current_url", "def get_current_url():\n return current_url", "def get_url(self):\n url = self.driver.current_url\n return url", "def getUrl(self):\n result = self.CORE....
[ "0.78724766", "0.7816947", "0.75905514", "0.75497556", "0.75209177", "0.7510771", "0.71664745", "0.7093864", "0.7093456", "0.70141834", "0.6956512", "0.6902963", "0.68774617", "0.6868716", "0.6845411", "0.6841052", "0.68401", "0.68181163", "0.6793231", "0.6751907", "0.6703284...
0.73895264
6
Return the nearest value to n, that's within minimum to maximum (incl)
def clamp(minimum, n, maximum): return max(minimum, min(n, maximum))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nearest(n, number):\n return math.floor((n / number) + 0.5) * number", "def get_closest(a, n):\n pos = bisect_left(a, n)\n if pos == 0:\n return a[0]\n if pos == len(a):\n return a[-1]\n before = a[pos - 1]\n after = a[pos]\n if after - n < n - before:\n return after\...
[ "0.80670035", "0.7556305", "0.74266535", "0.6989169", "0.695356", "0.6940631", "0.68467945", "0.68275744", "0.68275744", "0.6813598", "0.68054414", "0.6789903", "0.67638695", "0.67372537", "0.673462", "0.6709242", "0.6693157", "0.6693157", "0.6693157", "0.66812485", "0.662817...
0.6287495
39
Returns the block object corresponding to the given block number
def get_block_by_number(self, num: int) -> dict[str, Any]: block_data: MutableAttributeDict = MutableAttributeDict(self.w3.eth.get_block(num)) # type: ignore # pylint: disable=no-member # noqa: E501 block_data['hash'] = hex_or_bytes_to_str(block_data['hash']) return dict(block_data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_block(self, block_num):\n data = self._rpc_request(\"eth_getBlockByNumber\", [hex(block_num), True], \"result\")\n return GethBlock(data)", "def get_block(blockhash):\n return requests.get(BASE+f'/api/block/{blockhash}').json()", "def get_block(self, blockhash):\n\n return self....
[ "0.8087125", "0.7556677", "0.75418997", "0.7485878", "0.73917955", "0.73745257", "0.7338567", "0.7326097", "0.721394", "0.7193616", "0.71194774", "0.7058133", "0.7023227", "0.6988294", "0.69521517", "0.69308317", "0.6920114", "0.6916975", "0.6859873", "0.6843513", "0.68090606...
0.6629838
32
Get a specific invoice
def get(self, invoice_id): invoice = Invoice.query.filter(Invoice.invoice_id == invoice_id).first() if invoice: if current_user.access == ACCESS_ORGANIZER or current_user == invoice.user: return send_from_directory(invoice.directory, filename=invoice.filename, cache_timeout=0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invoices(self,org_id=None,invoice_id=''):\n if org_id is None:\n org_id = self.org_id\n return self.get('{}/orgs/{}/invoices/{}'.format(ApiVersion.A1.value,org_id,invoice_id))", "def getInvoice(self):\n return self.base.get(\"invoice\", [])", "def get_latest_invoice(self) -> CreditorInvoi...
[ "0.758962", "0.73973596", "0.7232925", "0.7215784", "0.7116271", "0.7105881", "0.7084835", "0.70778435", "0.68534166", "0.68458676", "0.67541814", "0.67020684", "0.6611625", "0.6592966", "0.65505654", "0.6401914", "0.62992907", "0.62443125", "0.62132996", "0.61796445", "0.613...
0.63232446
16
Paint a checkbox without the label.
def paint(self, painter, option, index): if self.verbose: print('myCheckBoxDelegate.paint()') #print(' option:', option, 'index:', index) #print(' index.data():', type(index.data()), index.data()) #HasCheckIndicator = QtWidget.QStyleOptionViewItem.HasCheckIndicator # options.Ha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def DrawCheckBox(*args, **kwargs):\n return _gdi_.RendererNative_DrawCheckBox(*args, **kwargs)", "def _onCheckBox(self, widget):\n widget.setStateCheck(not widget.getStateCheck())", "def paint(self, painter, option, index):\n self.drawCheck(painter, option, option.rect, Qt.Unchecked if int...
[ "0.6658085", "0.61212695", "0.6071485", "0.6009462", "0.598491", "0.57794183", "0.57696193", "0.56871", "0.5511196", "0.54637843", "0.5397577", "0.5356402", "0.53238875", "0.53046924", "0.5289639", "0.52892673", "0.52746964", "0.5273674", "0.5241159", "0.5222188", "0.5207558"...
0.5316491
13
Call this to declare a queue from Python.
def declare_queue(self, topic): #from trove.rpc.impl_kombu import Connection from trove.openstack.common.rpc import create_connection with create_connection() as conn: consumer = conn.declare_topic_consumer(topic=topic)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def declare_queue(self):\n\n self._channel.queue_declare(queue=self._queue_name, durable=True)\n print(\"Queue declared....\")", "def setup_queue(self):\n self.logger.info('declaring queue %s', self.queue)\n if self.otq:\n self._channel.queue_declare(self.on_queue_declareok...
[ "0.78895473", "0.77636707", "0.76180214", "0.75774866", "0.733846", "0.7275951", "0.7204507", "0.7119546", "0.69524336", "0.6901246", "0.6829329", "0.6776023", "0.67643684", "0.6760528", "0.6749917", "0.6743524", "0.6740188", "0.6689743", "0.66686416", "0.66452515", "0.664437...
0.7023522
8
Checks valid password format
def is_valid_password(self, password): rex = "^[a-zA-Z0-9@_+-.]{3,}$" return re.match(rex, password)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_password(password):\n return isinstance(password, str) and len(password) >= 8 and \\\n re.search(r'[A-Z]', password) and re.search(r'[0-9]', password)", "def validate_password(data):\n\n if \"password\" not in data:\n return False\n password = data[\"password\"]\n ...
[ "0.8014377", "0.7961472", "0.7835832", "0.77590317", "0.7756984", "0.76763004", "0.76739216", "0.7664568", "0.76487744", "0.76411885", "0.7640014", "0.7607594", "0.7600007", "0.7599284", "0.7593639", "0.75532585", "0.7541393", "0.7498413", "0.7492344", "0.74806035", "0.746394...
0.77100986
5
Return a filename within the output directory.
def GetOutputFilename(fname): return os.path.join(outdir, fname)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _make_output_path(self, filename):\n return os.path.join(self._output_directory, filename)", "def getOutputFile(fname):\n return os.path.join(Configurations.getOutputDir(), fname)", "def get_filename(out_dir, file_date, extension):\n return path.join(out_dir, f'CrossrefCitations_{file_date...
[ "0.79068506", "0.7682309", "0.7528231", "0.74512047", "0.7444181", "0.73997456", "0.73594296", "0.73369807", "0.7334667", "0.7203401", "0.72021586", "0.71942586", "0.718863", "0.7164495", "0.71479046", "0.7146181", "0.71377903", "0.7103986", "0.7084866", "0.70560557", "0.7038...
0.8252266
0
Convert a bytes type into a str type
def ToString(bval): return bval.decode('utf-8')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bytes2str(val):\n if isinstance(val, bytes):\n return str(val, \"utf8\")\n else:\n return val", "def bytes_to_str(self, data):\n if isinstance(data, str):\n return data\n return data.decode(\"utf-8\")", "def _bytes_bytearray_to_str(s):\n if isinstance(s, (byt...
[ "0.84038895", "0.8048227", "0.80108756", "0.80036676", "0.79327965", "0.7768747", "0.7710036", "0.7669526", "0.76199824", "0.76076", "0.75653654", "0.7494964", "0.73805976", "0.73805976", "0.7335101", "0.73164606", "0.7313014", "0.7311498", "0.7305442", "0.7278219", "0.727005...
0.6855471
46
Gets a collection of `InputExample`s for the train set.
def get_train_examples(self, data_dir): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_train_inputs(self, example):\n return example", "def get_train_examples(self):\n raise NotImplementedError()", "def get_train_examples(self, input_file):\r\n raise NotImplementedError()", "def _create_examples(self, data, set_type):\n examples = []\n for (i, elem) in en...
[ "0.73499966", "0.7173421", "0.7126833", "0.65602446", "0.64204013", "0.64052176", "0.63422555", "0.6290186", "0.6282746", "0.625262", "0.62499267", "0.6233708", "0.62225735", "0.62225735", "0.6205607", "0.6205607", "0.6205607", "0.6205607", "0.6205607", "0.6205607", "0.620560...
0.62466323
21
Gets a collection of `InputExample`s for the dev set.
def get_dev_examples(self, data_dir): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dev_examples(self, input_file):\r\n raise NotImplementedError()", "def get_train_inputs(self, example):\n return example", "def get_examples(self, env):\n return self.fam.c_get_examples(self, env)", "def get_dev_examples(self):\n raise NotImplementedError()", "def _create_ex...
[ "0.68112403", "0.6588688", "0.655683", "0.6552607", "0.64272827", "0.63816285", "0.6255956", "0.61930686", "0.61160946", "0.6094262", "0.6054992", "0.6051947", "0.5989807", "0.5927489", "0.5922901", "0.5920675", "0.59200704", "0.59155166", "0.59155166", "0.59155166", "0.59155...
0.5994604
22
Compute 2ndorder finite difference coefficients for a centered, threenode stencil.
def compute_2nd_order_finite_difference_coefficients(x): h = x[1:] - x[:-1] hm = h[:-1] hp = h[1:] am = 2./(hm*hp + hm*hm) a0 = -2./(hm*hp) ap = 2./(hm*hp + hp*hp) return am, a0, ap
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def second_derivative(x, y, finitediff_scheme = 'central'):\n if finitediff_scheme == 'central':\n y = [0] + list(y) + [0]\n numerator = np.array([y[i-1] - 2*y[i] + y[i+1] for i in range(1, len(y)-1)])\n denominator = (x[1]-x[0])**2\n return numerator/denominator \n \n elif fi...
[ "0.6164855", "0.6041468", "0.591912", "0.59089077", "0.57669914", "0.5734599", "0.56985176", "0.5676495", "0.55888265", "0.5578456", "0.5574001", "0.55704814", "0.55545104", "0.55524015", "0.5544189", "0.5531737", "0.5528984", "0.54625225", "0.5450969", "0.5446708", "0.542414...
0.5608314
8
Create and configure an instance of the Flask application.
def create_app(test_config=None): app = Flask(__name__, instance_relative_config=True) app.config.from_mapping( # a default secret that should be overridden by instance config SECRET_KEY="dev", # store the database in the instance folder # DATABASE=os.path.join(app.instance_path,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_app():\n\n # 1 Create Flask application\n app = Flask(\n import_name=__name__,\n template_folder=\"templates\",\n static_folder=\"static\"\n )\n\n # 2 Update the apps configuration\n app = config_selector(app)\n register_error_handlers(app)\n\n cache.init_app(app...
[ "0.8524236", "0.8516853", "0.8504485", "0.83319825", "0.82396483", "0.82314265", "0.8200104", "0.81300336", "0.80288595", "0.8026753", "0.8019436", "0.79989535", "0.7984679", "0.7978355", "0.7973289", "0.7970172", "0.7959833", "0.79556865", "0.7952428", "0.7946338", "0.793713...
0.7487347
85
Sets the id of this MessageGroup.
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 setId(self, *args):\n return _libsbml.Group_setId(self, *args)", "def set_id(self, id):\n self.__id = id", "def set_id(self, id):\n self.data['id'] = id", "def SetId(self, id):\n self.id = int(id)", "def setID(self, id):\...
[ "0.74233574", "0.74022263", "0.73261553", "0.7253963", "0.71760607", "0.7020873", "0.6985994", "0.69337493", "0.69337493", "0.69337493", "0.69337493", "0.69337493", "0.69337493", "0.6932817", "0.68581843", "0.6855207", "0.6855207", "0.6855207", "0.6841887", "0.6841887", "0.68...
0.0
-1
Sets the user_full_name of this MessageGroup.
def user_full_name(self, user_full_name): self._user_full_name = user_full_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def full_name(self, full_name):\n\n self._full_name = full_name", "def full_name(self, full_name):\n\n self._full_name = full_name", "def user_name(self, user_name):\n\n self._user_name = user_name", "def set_fullname(self, value):\n self.fullname = value", "def sent_by_full_nam...
[ "0.69892496", "0.69892496", "0.63426995", "0.5873931", "0.5870512", "0.58664143", "0.57916003", "0.5769776", "0.57607913", "0.5697961", "0.5589663", "0.55581176", "0.5533578", "0.5505131", "0.549579", "0.549579", "0.549579", "0.549579", "0.549579", "0.549579", "0.549579", "...
0.8340968
0
Sets the type of this MessageGroup.
def type(self, type): allowed_values = ["M", "C", "P", "V", "1", "I", "U", "Z", "S", "T", "R", "J", "X", "B", "G", "F", "W", "H", "E", "D", "N", "Y", "A", "K", "O", "Q", "L", "2", "3", "4", "5"] # noqa: E501 if type not in allowed_values: raise ValueError( "Invalid value for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 type(self, type: str):\n\n self._type = type", "def item_group_type(self, item_group_type):\n\n self._item_group_type = ite...
[ "0.73644555", "0.7362164", "0.7362164", "0.706289", "0.7052939", "0.6881219", "0.6881219", "0.6860441", "0.6860441", "0.6860441", "0.6860441", "0.6860441", "0.6860441", "0.6860441", "0.6860441", "0.6860441", "0.6860441", "0.6860441", "0.6860441", "0.6860441", "0.6860441", "...
0.65050435
46
Sets the status of this MessageGroup.
def status(self, status): allowed_values = ["D", "P", "V", "S", "M", "I", "R", "C"] # noqa: E501 if status not in allowed_values: raise ValueError( "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 .format(status, allowed_values) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_status(self, status):\n self.status = status", "def set_status(self, status):\n self.status = status", "def set_status(self, status):\n self.status = status", "def setstatus(self, status):\n with self.lock:\n self.status = status", "def setStatus(self, status)...
[ "0.7301581", "0.7301581", "0.7301581", "0.7259759", "0.72286296", "0.71960115", "0.70997185", "0.7078124", "0.6987622", "0.6987622", "0.6987622", "0.6987622", "0.6987622", "0.6987622", "0.6987622", "0.6971246", "0.69520956", "0.6943355", "0.6943355", "0.6943355", "0.6943355",...
0.6336027
61
Sets the mail_msg_id of this MessageGroup.
def mail_msg_id(self, mail_msg_id): self._mail_msg_id = mail_msg_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def message_id(self, val: str):\n self._message_id = val", "def mailing_id(self, val: str):\n self._mailing_id = val", "def pop3_msg_id(self, pop3_msg_id):\n\n self._pop3_msg_id = pop3_msg_id", "def set_email_template_id(self, email_template_id):\n self.email_template_id = email_t...
[ "0.6015266", "0.58872676", "0.56251985", "0.5620189", "0.54886806", "0.54886806", "0.54886806", "0.54886806", "0.54886806", "0.54886806", "0.532044", "0.52057475", "0.5202128", "0.518962", "0.50464046", "0.5020832", "0.49766263", "0.49766263", "0.49766263", "0.49766263", "0.4...
0.86478096
0
Sets the pop3_msg_id of this MessageGroup.
def pop3_msg_id(self, pop3_msg_id): self._pop3_msg_id = pop3_msg_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mail_msg_id(self, mail_msg_id):\n\n self._mail_msg_id = mail_msg_id", "def message_id(self, val: str):\n self._message_id = val", "def message_group_id(self) -> Optional[str]:\n return pulumi.get(self, \"message_group_id\")", "def group_id(self, group_id):\n\n self._group_id =...
[ "0.63237476", "0.5964633", "0.5207801", "0.5155486", "0.5155486", "0.5155486", "0.5155486", "0.5155486", "0.5155486", "0.508969", "0.50258756", "0.50252366", "0.50252366", "0.50252366", "0.50252366", "0.4945956", "0.49097177", "0.48777446", "0.48777446", "0.48528895", "0.4839...
0.871121
0
Sets the messages of this MessageGroup.
def messages(self, messages): self._messages = messages
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def messages(self, messages):\n self._messages = messages", "def messages(self, messages):\r\n\r\n self._messages = messages", "def unread_messages(self, unread_messages):\n\n self._unread_messages = unread_messages", "def _set_message(self, value):\n self.__message = value", "d...
[ "0.75375044", "0.74025875", "0.59419316", "0.578991", "0.56408775", "0.56408775", "0.56408775", "0.56408775", "0.56408775", "0.56408775", "0.56408775", "0.56408775", "0.56408775", "0.56408775", "0.56408775", "0.56408775", "0.56408775", "0.56408775", "0.56408775", "0.56408775", ...
0.75711966
1
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, MessageGroup): 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
Return heart rate ensemble data.
def get_hr_ensemble(self, ensemble_id: str): return self.hr_ensemble.get(ensemble_id, None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_heart(self):\n measurement = self._hr_service.measurement_values\n if measurement is None:\n heart = self._previous_heart\n else:\n heart = measurement.heart_rate\n self._previous_heart = measurement.heart_rate\n\n if heart:\n heart =...
[ "0.667245", "0.5989915", "0.5981545", "0.5928599", "0.58314437", "0.570082", "0.56978804", "0.5626074", "0.55555457", "0.5519672", "0.5459378", "0.54582685", "0.54388577", "0.54160833", "0.54139334", "0.54016525", "0.540147", "0.5346398", "0.52863216", "0.5264556", "0.5247471...
0.0
-1
Draw a boxplot with significance brackets, specifically designed for saliva features.
def saliva_feature_boxplot( self, x: str, saliva_type: str, feature: Optional[str] = None, stats_kwargs: Optional[Dict] = None, **kwargs, ) -> Tuple[plt.Figure, plt.Axes]: # TODO: add support for computing saliva features return plot.saliva_feature_box...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def boxplot(data):\n sns.boxplot(data, width=0.5, palette=\"colorblind\")\n # add points on the plot\n sns.swarmplot(data, color='red', alpha=0.75)", "def box_plot():\n # download the data from Kaggle: https://www.kaggle.com/camnugent/california-housing-prices/download\n\n df = pd.read_csv('./hous...
[ "0.684459", "0.66147965", "0.65949404", "0.6565683", "0.64441955", "0.64235526", "0.64079005", "0.6400797", "0.6376822", "0.62469685", "0.6212203", "0.6173418", "0.61095124", "0.6087079", "0.6052114", "0.60235816", "0.6008725", "0.59160924", "0.59078074", "0.5885543", "0.5885...
0.5825925
27
Draw multiple features as boxplots with significance brackets, specifically designed for saliva features.
def saliva_multi_feature_boxplot( data: SalivaFeatureDataFrame, saliva_type: str, features: Union[Sequence[str], Dict[str, Union[str, Sequence[str]]]], hue: Optional[str] = None, stats_kwargs: Optional[Dict] = None, **kwargs, ) -> Tuple[plt.Figure, Iterable[plt.Axes]]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_feature_boxplots(self):\n\n num_features = len(self.feature_names)\n fig, ax = plt.subplots(nrows=1, ncols=num_features, figsize=(50, 2), tight_layout=True)\n fig.suptitle('Boxplots of 19 features', fontsize=14)\n\n for i in range(num_features):\n ax[i].boxplot(self....
[ "0.7276096", "0.6756028", "0.67420524", "0.66334265", "0.66136825", "0.66105974", "0.63785017", "0.63277566", "0.63201016", "0.6297335", "0.6288415", "0.62793034", "0.62766385", "0.6269879", "0.6266449", "0.62377346", "0.6190599", "0.6162445", "0.6156448", "0.6155786", "0.614...
0.6806002
1
Set a slug only if the original slug is not already previously set.
def set_slug(self, slug): if self.slug is None: self.slug = slug
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def slug(self, value: str):\n if value and self.slug:\n raise Exception('Order slug should never be updated.')\n elif value:\n self._slug = value", "def set_slug(self):\n if not self.slug:\n self.slug = slugify(self.name)[:50]", "def set_unique_slug(self):\...
[ "0.7520469", "0.7504834", "0.7118982", "0.70759165", "0.70759165", "0.7063391", "0.69718677", "0.6893182", "0.68507", "0.68228143", "0.68121773", "0.67801267", "0.6757212", "0.66788137", "0.63008267", "0.62607974", "0.6224608", "0.6210882", "0.6163315", "0.61136633", "0.60966...
0.81769043
0
Add an episode to the buffer.
def store_episode(self): episode_buffer = self._convert_episode_to_batch_major() episode_batch_size = len(episode_buffer['observation']) idx = self._get_storage_idx(episode_batch_size) for key in self._buffer: self._buffer[key][idx] = episode_buffer[key] self._n_tran...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_episode(self, ep):\n #make da season\n ses = self._add_season(ep)\n dvdses = self._add_season(ep, dvd=True) \n self._add_episode(ep, ses)\n self._add_episode(ep, dvdses, dvd=True)", "def add(self, episodes: Union[List[\"_Episode\"], \"_Episode\"]):\n if is...
[ "0.735657", "0.6706511", "0.6660055", "0.6591364", "0.6410487", "0.6221398", "0.6196031", "0.6182731", "0.6150623", "0.60092854", "0.5909298", "0.59027225", "0.5887077", "0.57419723", "0.57027376", "0.56611764", "0.56372035", "0.5620019", "0.5590021", "0.5589109", "0.558431",...
0.6222137
5
Add one transition into the replay buffer.
def add_transition(self, **kwargs): transition = {k: [v] for k, v in kwargs.items()} self.add_transitions(**transition)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 return ()\n\n # add a multi step transition\n reward, next_state, done ...
[ "0.740349", "0.7356286", "0.72938615", "0.72733086", "0.72257", "0.7169166", "0.70568347", "0.70209605", "0.69462705", "0.681859", "0.6677153", "0.6562752", "0.65208566", "0.6471675", "0.644765", "0.6423717", "0.6406294", "0.63530767", "0.6215138", "0.6184234", "0.6182884", ...
0.5403305
86
Add multiple transitions into the replay buffer. A transition contains one or multiple entries, e.g. observation, action, reward, terminal and next_observation. The same entry of all the transitions are stacked, e.g.
def add_transitions(self, **kwargs): if not self._initialized_buffer: self._initialize_buffer(**kwargs) for key, value in kwargs.items(): self._episode_buffer[key].append(value) if len(self._episode_buffer['observation']) == self._time_horizon: self.store_ep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extend(self, transitions: list):\n for transition in transitions:\n self.add(*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_buff...
[ "0.6677511", "0.65858775", "0.6410083", "0.63191545", "0.62429816", "0.6203609", "0.6202936", "0.61612046", "0.61373895", "0.60175425", "0.6013549", "0.5996358", "0.5974118", "0.5894838", "0.58591044", "0.5832437", "0.5821877", "0.5789959", "0.5712879", "0.56887907", "0.56742...
0.6860526
0
Return the size of the replay buffer.
def n_transitions_stored(self): return self._n_transitions_stored
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def size(self):\n return len(self.buffer)", "def get_buffer_size(self):\n return len(self._buffers) if self._buffers is not None else 0", "def buffer_size(self):\n if not hasattr(self, '_buffer_size'):\n self._buffer_size = 0\n return int(self._buffer_size)\n e...
[ "0.7708229", "0.75622433", "0.739335", "0.7224203", "0.7218663", "0.7210331", "0.71338546", "0.71338546", "0.7107053", "0.7040967", "0.702228", "0.7016174", "0.68591017", "0.6839616", "0.6815589", "0.6810943", "0.67780447", "0.67733026", "0.67710954", "0.67578244", "0.675195"...
0.0
-1
Male of age greater than 10 are the wanderers in the camp
def create_wanderer_column(gender, age): return np.logical_and([gender == 1], [age >= 10]).transpose()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_age_medicals(self, medicament):\n age = self.get_age()\n if age:\n if age > medicament.maximum_age and medicament.maximum_age:\n return {\"valid\": False, \"message\": _(f\"The patient is {age} years old, and {medicament.name} could not be taken for ages above {me...
[ "0.68103325", "0.61463815", "0.61307013", "0.60826564", "0.6061001", "0.60349363", "0.6031252", "0.60239834", "0.59546506", "0.5953632", "0.59528995", "0.58525604", "0.5847692", "0.57500136", "0.57150906", "0.5714132", "0.56923485", "0.5692144", "0.5692144", "0.5682057", "0.5...
0.63310003
1