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
Generate a request dictionary using the parameters initializing the object.
def _to_request_dict(self): collection_config_request = {"CollectionName": self.name} if self.parameters is not None: collection_config_request["CollectionParameters"] = self.parameters return collection_config_request
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request_params(self):\n return {'key': self.key, 'hash': self.hash}", "def construct_request_obj(cls, dict_):\n\n entry_object = {\"entry\": dict_}\n\n return entry_object", "def _generate_params(self):\n return {\n 'lis_outcome_service_url': self.lis_outcome_service_...
[ "0.71107423", "0.7104725", "0.69365865", "0.6935517", "0.67949605", "0.6737553", "0.6696849", "0.6684821", "0.66708016", "0.66552", "0.6628386", "0.66156214", "0.66003114", "0.656966", "0.65651494", "0.6534603", "0.65263844", "0.65190125", "0.6478461", "0.64606273", "0.640891...
0.6413095
20
The setter for the fragment size. The size must be an integer, and greater than 0.
def frag_size(self, frag_size): self.logger.debug("In 'frag_size' setter.") if frag_size < 0: raise ValueError("Invalid frag_size. Must be non-negative.") self._frag_size = frag_size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setsize(self, size):\n self.__size = size", "def size(self, size):\n if type(size) is not int:\n raise TypeError(\"size must be an integer\")\n elif size < 0:\n raise ValueError(\"size must be >= 0\")\n self.__size = size", "def size(self, size):\n s...
[ "0.6871763", "0.6815224", "0.67508185", "0.67071486", "0.6643165", "0.6643165", "0.6643165", "0.6643165", "0.6540341", "0.6519864", "0.64786845", "0.6470635", "0.6424402", "0.6424402", "0.6424402", "0.6292627", "0.6292627", "0.62508154", "0.62508154", "0.6174837", "0.61612636...
0.82633924
0
The setter for the MIMS data. The provided dictionary must validate based on the MIMS class.
def mims(self, mims): self.logger.debug("In 'mims' setter.") valid_dictionary = MIMS.check_dict(mims) # Validate the incoming MIMS data if valid_dictionary: self.logger.debug("MIMS data seems correct.") self._mims = mims else: raise MimsExcep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assign_values(self, data):\n\n for key in self.__dict__.keys():\n if key in data.keys():\n setattr(self, key, data[key]) # handy built-in function", "def updateFromDict(self, data):\n for key, value in data.items():\n setattr(self, key, value)", "def set_d...
[ "0.59664863", "0.590598", "0.5699656", "0.5670765", "0.563502", "0.5567609", "0.5497725", "0.54743993", "0.54615325", "0.54381835", "0.5434119", "0.5413692", "0.53685", "0.53665406", "0.5347449", "0.53049284", "0.5298172", "0.5290091", "0.52648103", "0.52648103", "0.524783", ...
0.75908107
0
The setter for the NCBI Taxon ID.
def ncbi_taxon_id(self, ncbi_taxon_id): self.logger.debug("In 'ncbi_taxon_id' setter.") self._ncbi_taxon_id = ncbi_taxon_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tax_id(self, tax_id: str):\n\n self._tax_id = tax_id", "def tax_id(self, tax_id):\n\n self._tax_id = tax_id", "def set_tax_id_value(self, tax_id_value):\n self.tax_id_value = tax_id_value", "def tax_id(self) -> str:\n return self._tax_id", "def tax_id(self):\n return ...
[ "0.75118405", "0.7378991", "0.7188856", "0.7115929", "0.7048571", "0.7047489", "0.7022096", "0.62972564", "0.6293847", "0.61339676", "0.6125449", "0.6017244", "0.58965874", "0.58690494", "0.5717478", "0.5629113", "0.55614746", "0.55463874", "0.55385774", "0.5464861", "0.54648...
0.8147634
0
The setter for the SRS ID. The ID must be a string, and greater than 3 characters long.
def srs_id(self, srs_id): self.logger.debug("In 'srs_id' setter.") if len(srs_id) < 3: raise Exception("SRS ID is too short, must be more than 3 characters.") self._srs_id = srs_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_id(self, ssc_id):\r\n self.ssc_id = ssc_id", "def set_id(self, value: str) -> None:\n if not isinstance(value, str):\n raise TypeError('id must be a string, not {0}'.format(type(value)))\n self._id = value", "def id(self, val: str) -> None:\n\n self._id = val", ...
[ "0.7129446", "0.695021", "0.6914657", "0.690006", "0.68060774", "0.67940915", "0.6789471", "0.66667074", "0.65809685", "0.6556487", "0.6509159", "0.6487585", "0.6425962", "0.6399813", "0.63728064", "0.63578117", "0.63411665", "0.6298653", "0.6297197", "0.62942773", "0.6294277...
0.8023891
0
The setter for the HostSeqPrep storage duration. The duration must be an integer, and greater than 0.
def storage_duration(self, storage_duration): self.logger.debug("In 'storage_duration' setter.") if storage_duration < 0: raise ValueError("Invalid storage_duration. Must be non-negative.") self._storage_duration = storage_duration
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def duration(self, duration):\n self._duration = duration", "def duration(self, duration):\n self._duration = duration", "def duration(self, duration):\n\n self._duration = duration", "def duration(self, duration):\n\n self._duration = duration", "def duration(self, duration):\n...
[ "0.5906801", "0.5906801", "0.5829037", "0.5829037", "0.5829037", "0.5829037", "0.5829037", "0.5829037", "0.5829037", "0.5829037", "0.5747316", "0.57193017", "0.56565815", "0.55492413", "0.5451925", "0.53313327", "0.5273855", "0.52732307", "0.52533764", "0.52045745", "0.512654...
0.61251867
0
Forward function for PWCNet when model training.
def forward_train( self, imgs: Tensor, flow_gt: Tensor, valid: Optional[Tensor] = None, img_metas: Optional[Sequence[dict]] = None) -> Dict[str, Tensor]: feat1, feat2 = self.extract_feat(imgs) return self.decoder.forward_train( feat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward_train(self, *args, **kwargs):\n pass", "def forward(self, X, training=False):\n pass", "def forward(self, X, training=True):\n self.layer_input = X\n return np.dot(X, self.W) + self.b", "def forward(self, input):\n\n ########################\n # PUT YOUR CODE HER...
[ "0.7302973", "0.72637373", "0.70253354", "0.68908453", "0.6863415", "0.6848232", "0.68340826", "0.67995745", "0.67659676", "0.6756458", "0.6754377", "0.67483383", "0.67273813", "0.6681345", "0.664606", "0.6639757", "0.6614233", "0.65814936", "0.6553733", "0.65514916", "0.6549...
0.0
-1
This function hardcodes a pandas dataframe containing 1 Million rows & 3 columns, and stores it as a csv file in ../data/data_for_test_aspects/. Columns = [Name, Age, Gender] Around half of the rows would be Gender = Male, and such rows will be placed at odd row indices.
def generate_1(): number_of_rows = 1000000 map_gender = {0 : 'Female', 1: 'Male'} # Generating a list of random strings as Names list_names = [randstr.randstr(16) for row in range(number_of_rows)] # Generating a list of random integers between 1 - 100 as Ages list_age = [random.randint(1, 100)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_dataframe(test_csv):\n\tif not os.path.isfile(test_csv):\n\t\tlogger.error(\"path {} does not exit\".format(test_csv))\n\t\tsys.exit(\"---test csv file--- does not exits\")\n\n\ttest_df = pd.read_csv(test_csv)\n\ttest_df['Case ID'] = test_df['Case ID'].apply(lambda x:\n\t\t\t\t\t\t\t\t\t\t\t\t\t str(x)+'....
[ "0.627383", "0.6166351", "0.61284494", "0.5975487", "0.59067297", "0.5885268", "0.588325", "0.5852776", "0.58039445", "0.5793694", "0.57885516", "0.57846516", "0.5758668", "0.575799", "0.57468385", "0.5740229", "0.57362205", "0.5725827", "0.57226914", "0.5716954", "0.56754446...
0.6572776
0
Sets the seed for this env's random number generator(s).
def seed(self, seed=None): # to have a different environment at each time (resolve python random problem) self.np_random, seed1 = seeding.np_random(seed) seed2 = seeding.hash_seed(seed1 + 1) % 2 ** 31 return [seed1, seed2]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_seed(cls, seed: Any) -> None:\n cls.rand = Random(seed)", "def set_seed(self, seed: int):\n self.__sim.seed(seed)", "def set_seed(self, seed):\n self.seed = seed", "def seed(self, seed=None):\n if seed is not None:\n self._rng.seed(seed)", "def set_random_seed...
[ "0.8373416", "0.81172967", "0.80869454", "0.80810714", "0.8069588", "0.8069588", "0.8034409", "0.79714894", "0.79493755", "0.7905962", "0.7904587", "0.7860609", "0.7830962", "0.78271914", "0.7818474", "0.779217", "0.77705204", "0.776895", "0.7746135", "0.7739743", "0.7726455"...
0.7501346
42
Toggle the border mode on disabling movement of surfaces and showcasing only the borders, also enabling selection of the borders
def toggle_border_mode(self): for poly in self.poly_list: poly.setFlag(QGraphicsItem.GraphicsItemFlag.ItemIsSelectable, False) poly.setBrush(QColor(0, 0, 0, 0)) for point in self.point_marker_list: if point.childItems(): point.childItems()[0].setVisib...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def border(self):\n sel=self.ch_border.isChecked()\n for i in [ self.sb_border_width, self.cb_style, self.b_color ]:\n i.setEnabled(sel)", "def toggle_surface_mode(self):\n for poly in self.poly_list:\n poly.setFlag(QGraphicsItem.GraphicsItemFlag.ItemIsSelectable, True)...
[ "0.71732706", "0.7075409", "0.61885154", "0.613644", "0.61179405", "0.6068956", "0.5952692", "0.59313744", "0.5889281", "0.5839096", "0.58221287", "0.57880896", "0.575999", "0.5726431", "0.567707", "0.5643086", "0.56062186", "0.56058586", "0.5604492", "0.560153", "0.5598783",...
0.7917616
0
Locate the leftmost value exactly equal to x
def index(a, x): i = bisect_left(a, x) if i != len(a) and a[i] == x: return i raise ValueError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _findIndex(self, x):\n if x< self[0][0] or x> self[-1][0]:\n return None\n\n idx = bisect.bisect_left(self.xproxy, x)\n if self[idx][0] == x:\n return idx\n else:\n return idx-1", "def find_le(a, x):\n i = bisect_right(a, x)\n if i:\n return a[i - 1]\n ...
[ "0.7036286", "0.7017491", "0.6938362", "0.6818791", "0.6761426", "0.6674703", "0.6646176", "0.6568154", "0.65420395", "0.6253547", "0.62398744", "0.62246436", "0.6199987", "0.6139905", "0.61346895", "0.6122583", "0.61003524", "0.6030517", "0.60159653", "0.6010258", "0.596662"...
0.6445971
9
Return the parameters config for this policy definition
def parameters_config(self) -> dict: if not self.params_optional and not self.params_required: return {} parameters = dict() for parameter, parameter_details in self.parameters.items(): parameters[parameter_details.name] = parameter_details.parameter_config() retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config(self):\n config = super(Sc2Policy, self).get_config()\n config['eps'] = self.eps\n config['testing'] = self.testing\n return config", "def parameters(self) -> dict:\n return self._config.get('parameters', dict())", "def get_configuration_parameters_values(self)...
[ "0.78314453", "0.7714849", "0.71517944", "0.7039205", "0.70076877", "0.70076877", "0.69503415", "0.692481", "0.69022447", "0.6887829", "0.6864944", "0.68604285", "0.6815788", "0.6791453", "0.67682594", "0.6740042", "0.67272204", "0.6710705", "0.6707941", "0.6651179", "0.66511...
0.75907063
2
Read file to DataFrame
def read_file(file): return pd.read_csv(file, header=0, index_col=0, parse_dates=['Trading_date'], infer_datetime_format=True, keep_date_col=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_file_to_dataframe(self, file_path: str) -> pd.DataFrame:\n return pd.read_csv(file_path, sep=\"\\t\")", "def read_file(fname: str) -> pd.DataFrame:\n raw_data = (\n pd.read_hdf(fname).to_frame().reset_index(level=[0, 1]).loc[ANALYSIS_DATE]\n )\n raw_data[\"date\"] ...
[ "0.8084967", "0.7880502", "0.77656376", "0.77656376", "0.77656376", "0.7490695", "0.73577774", "0.7289315", "0.7273159", "0.72016376", "0.7196495", "0.7177103", "0.7175373", "0.71386427", "0.7111662", "0.71058863", "0.7087962", "0.7081647", "0.7026265", "0.700432", "0.7000766...
0.70090675
19
Set the source address of the packet
def source(self, value: Union[str, Station]): if type(value) is str: # Passed a str if len(value) <= 9: self._source = value else: raise ValueError("Source must be a maximum of 9 characters") elif type(value) is Station: # P...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_source_address(self, srcAddr):\n self.source.address = srcAddr", "def add_source_address(self, srcAddr):\n self.source.address = srcAddr", "def setAddressSource(self, address_source):\n # type: (str)->None\n\n self._validator.validate_one(\n 'source', VALID_OPTS['...
[ "0.7479188", "0.7479188", "0.7397337", "0.69436145", "0.65639615", "0.656261", "0.6463999", "0.6463999", "0.6463999", "0.6463999", "0.6463999", "0.6463999", "0.6463999", "0.6406151", "0.64037424", "0.6325264", "0.63053906", "0.63053906", "0.628591", "0.62519747", "0.6237874",...
0.5358071
82
Get the data type ID of the packet
def data_type_id(self) -> str: return self._data_type_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pkt_type(self):\n return uint16_packer.unpack(self[32:34])[0]", "def data_id(self):\n return self.unpack_string(0x4, 2)", "def data_type():\n return DataTypeUtil.getDTypeForName(DataTypeUtil.getDtypeFromContext())", "def data_type(self) -> int:\n return self.data[\"args\"][\"dataT...
[ "0.71458256", "0.7124954", "0.69061893", "0.6828673", "0.67216694", "0.6694123", "0.64902556", "0.6482982", "0.64091945", "0.64066756", "0.63942605", "0.63942605", "0.63942605", "0.63788575", "0.63747776", "0.63625455", "0.6359538", "0.63510555", "0.63436085", "0.62676513", "...
0.75204676
0
Set the symbol ID of the packet
def symbol_id(self, value: str): self._symbol = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_symbol(self, symbol):\r\n self.symbol = symbol", "def symbol(self, symbol):\n self._symbol = symbol", "def symbol(self, symbol):\n\n self._symbol = symbol", "def symbol_id(self) -> str:\n return self._symbol", "def setBitsPerSymbol(self, bits_per_symbol):\n \n ...
[ "0.7119838", "0.7047342", "0.6924819", "0.6362424", "0.62312365", "0.62285507", "0.6132986", "0.5980197", "0.5967315", "0.5901641", "0.5861733", "0.576689", "0.5749202", "0.56958884", "0.5676357", "0.5663099", "0.56466335", "0.5622091", "0.5618607", "0.5584967", "0.5571887", ...
0.76358664
0
Randomly drop input words.
def word_dropout(self, x, l): if self.params.word_dropout == 0: return x, l assert 0 < self.params.word_dropout < 1 # define words to drop # eos = self.params.eos_index # assert (x[0] == eos).sum() == l.size(0) keep = np.random.rand(x.size(0) - 1, x.size(1)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def word_dropout(tokens, dropout):\n return [constant.UNK_ID if x != constant.UNK_ID and np.random.random() < dropout \\\n else x for x in tokens]", "def delete_word(name, times=1, min_words=2):\r\n\twords = name.split(\" \")\r\n\tif len(words) <= min_words:\r\n\t\treturn words\r\n\telse: \r\n\t\tf...
[ "0.7160742", "0.7058587", "0.6751603", "0.6694172", "0.66447455", "0.6535932", "0.6500295", "0.6483926", "0.6446551", "0.6314012", "0.6314012", "0.6314012", "0.63134915", "0.63114", "0.62585974", "0.6209542", "0.62072986", "0.62052494", "0.618475", "0.6166957", "0.61622363", ...
0.69549847
2
Randomly blank input words.
def word_blank(self, x, l): if self.params.word_blank == 0: return x, l assert 0 < self.params.word_blank < 1 # define words to blank eos = self.params.eos_index assert (x[0] == eos).sum() == l.size(0) keep = np.random.rand(x.size(0) - 1, x.size(1)) >= self.p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_words(name, times=1, words_in_token=2):\r\n\twords = name.split(\" \")\r\n\tif words_in_token > len(words):\r\n\t\twords_in_token = len(words)\r\n\tfor i in range(times):\r\n\t\trandnum = random.randint(0, len(words) - words_in_token)\r\n\t\tremoved = \"\"\r\n\t\tfor index in range(words_in_token):\...
[ "0.71243674", "0.6794822", "0.6755961", "0.65642047", "0.6558932", "0.6490112", "0.63830966", "0.6377494", "0.63684475", "0.62439", "0.6230462", "0.62100255", "0.61784554", "0.6122306", "0.6122306", "0.6122306", "0.6110098", "0.60995924", "0.6078731", "0.6078078", "0.60726124...
0.6622092
3
Return a batch of sentences from a dataset.
def get_cross_lingual_batch(self, iter_name, lang1, lang2=None, stream=False): assert lang1 in self.params.langs assert lang2 is None or lang2 in self.params.langs # assert stream is False or lang2 is None iterator = self.iterators.get((iter_name, lang1, lang2), None) if iterator...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gather_sentences(self):\n sentences = Sentence.objects.all()\n return sentences", "def split_to_sentences(data):\r\n sentences = data.split(\"\\n\")\r\n \r\n sentences = [s.strip() for s in sentences]\r\n sentences = [s for s in sentences if len(s) > 0]\r\n \r\n return sentenc...
[ "0.6724796", "0.6619705", "0.64720875", "0.6435097", "0.64037824", "0.63717926", "0.63717926", "0.63504994", "0.63474", "0.62938994", "0.62938994", "0.6270098", "0.619197", "0.61856043", "0.61792094", "0.61736786", "0.61695194", "0.6154717", "0.610849", "0.60986835", "0.60839...
0.0
-1
For float16 only. Subsample sentences in a batch, and add padding, so that each dimension is a multiple of 8.
def round_batch(self, x, lengths, positions, langs): params = self.params if not params.fp16 or len(lengths) < 8: return x, lengths, positions, langs, None # number of sentences == 0 [8] bs1 = len(lengths) bs2 = 8 * (bs1 // 8) assert bs2 > 0 and bs2 % 8 == 0 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Docu_Size_Normalization(batch, batch_len, pad_token, batch_size):\n padded_batch = []\n max_doc_len = max(batch_len)\n need_more_list = []\n\n for doc in batch:\n pos_doc = doc[0]\n neg_doc = doc[1]\n\n need_more = max_doc_len-len(pos_doc)\n if need_more==0:\n ...
[ "0.60369086", "0.5932823", "0.5796465", "0.57662976", "0.5764486", "0.5751936", "0.5728226", "0.5717317", "0.57160985", "0.56851363", "0.5660307", "0.5657823", "0.56346", "0.5600802", "0.5569707", "0.5567691", "0.5544695", "0.5541298", "0.55405223", "0.5534319", "0.55159205",...
0.0
-1
Return a batch of sentences from a dataset.
def get_batch(self, iter_name, lang1, lang2=None): assert lang2 == 'img' iterator = self.iterators.get((iter_name, lang1, lang2), None) if iterator is None: iterator = self.get_iterator(iter_name, lang1, lang2) self.iterators[(iter_name, lang1, lang2)] = iterator ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gather_sentences(self):\n sentences = Sentence.objects.all()\n return sentences", "def split_to_sentences(data):\r\n sentences = data.split(\"\\n\")\r\n \r\n sentences = [s.strip() for s in sentences]\r\n sentences = [s for s in sentences if len(s) > 0]\r\n \r\n return sentenc...
[ "0.6724796", "0.6619705", "0.64720875", "0.6435097", "0.64037824", "0.63717926", "0.63717926", "0.63504994", "0.63474", "0.62938994", "0.62938994", "0.6270098", "0.619197", "0.61856043", "0.61792094", "0.61736786", "0.61695194", "0.6154717", "0.610849", "0.60986835", "0.60839...
0.0
-1
Normalizes using the following formula. We use it because species abundance should be greater or equal to zero. Z = X min(X) / max(X) min(x) It assumes that the dataset is twodimentional matrix where each row represents a different community. Outliers may cause troubles
def normalize_ds(dataset): dataset = copy.copy(dataset) dim_dataset = dataset.shape for n_row in range(dim_dataset[0]): k = dataset[n_row,:] k_norm =(k - np.min(k))/(np.max(k) - np.min(k)) dataset[n_row,:] = k_norm return dataset
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize(X):\n # z-score\n mean = np.mean(X, axis=(0, 1, 2, 3))\n std = np.std(X, axis=(0, 1, 2, 3))\n # avoid dividing zero by adding a very small number\n X = (X - mean) / (std + 1e-7)\n\n return X", "def normalize(data):\n data = numpy.asmatrix(data)\n std_devs = numpy.std(data, a...
[ "0.7553753", "0.6956243", "0.6825983", "0.6825983", "0.68163425", "0.67706674", "0.6738918", "0.6702088", "0.6672367", "0.6575717", "0.6575717", "0.6571815", "0.65488994", "0.6515912", "0.6493665", "0.64794064", "0.64660096", "0.646328", "0.64398605", "0.63487065", "0.6347436...
0.0
-1
Creates a QRcode from string data, resized to the specified dimensions.
def encode_scaled(data, size, version=0, level=QR_ECLEVEL_L, hint=QR_MODE_8, case_sensitive=True): version, src_size, im = encode(data, version, level, hint, case_sensitive) if size < src_size: size = src_size qr_size = (size / src_size) * src_size im = im.resize((qr_size, qr_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_qr(data):\n qr = qrcode.QRCode(\n version=2,\n error_correction=qrcode.constants.ERROR_CORRECT_M,\n border=1.5,\n box_size=25,\n )\n qr.add_data(data)\n image = qr.make_image(fill_color=\"black\", back_color=\"white\")\n img_path = NamedTemporaryFile(delete=Fal...
[ "0.6091118", "0.59300584", "0.5801997", "0.5699206", "0.5381448", "0.534199", "0.5258807", "0.51802313", "0.51665926", "0.51038796", "0.5050951", "0.50123954", "0.5004126", "0.49536055", "0.49137425", "0.48529857", "0.48409575", "0.47760788", "0.47573766", "0.47455263", "0.46...
0.5447894
4
returns True iff self and other are the same propositions (i.e. same structure and same variables, just like any binary tree equality)
def __eq__(self, other): return self.conn == other.conn and self.p1 == other.p1 and self.p2 == other.p2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_same_as(self, other) -> bool:\n return self.x == other.x and self.y == other.y", "def __eq__(self, other):\n return (type(self) == type(other) and\n self.puzzle == other.puzzle and\n all([x in self.children for x in other.children]) and\n all([x i...
[ "0.76160985", "0.74827313", "0.74396557", "0.74386466", "0.74309963", "0.74119335", "0.7399154", "0.7393731", "0.7328676", "0.73281515", "0.7327489", "0.7326173", "0.7316905", "0.73092574", "0.73067164", "0.72918177", "0.72806126", "0.72806126", "0.72806126", "0.72806126", "0...
0.7190561
31
returns a list of all sequents in the leaves of the tree
def get_leaves(self): l = [] r = [] if self.left_subtree is None and self.right_subtree is None: return [self.root] else: if self.left_subtree is not None: l = self.left_subtree.get_leaves() if self.right_subtree is not None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_leaves(self):\n return list(set(list(self._traverse_tree())))", "def get_leaves(tree):\n if tree.is_leaf:\n return [tree.indices]\n else:\n return get_leaves(tree.left_child) + get_leaves(tree.right_child)", "def leaves(tree):\n if is_leaf(tree):\n return [label(tre...
[ "0.7434227", "0.7144391", "0.71424335", "0.710453", "0.7035174", "0.70226085", "0.6935758", "0.6893309", "0.68922234", "0.6876663", "0.68628806", "0.6849735", "0.68293613", "0.6744344", "0.673734", "0.6592101", "0.65864867", "0.6561257", "0.65494466", "0.6528873", "0.651073",...
0.67279845
15
The opposite of __eq__.
def __ne__(self, other): if not isinstance(other, Key): return NotImplemented return not self.__eq__(other)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other):\n return not (self == other) # opposite of __eq__", "def __ne__(self, other):\n return not (self == other) # opposite of __eq__", "def __ne__(self, other):\n return not self.__eq__(other)", "def __eq__(self, other):\n return super().__ne__(ot...
[ "0.86799085", "0.86575395", "0.85569334", "0.8469498", "0.84674203", "0.84659725", "0.84617543", "0.84505033", "0.84505033", "0.84505033", "0.84505033", "0.84332985", "0.8380452", "0.83736825", "0.83736825", "0.83736825", "0.83736825", "0.83736825", "0.83736825", "0.83736825", ...
0.0
-1
Return the kind of the entity referenced. This is the kind from the last (kind, id) pair.
def kind(self): return self.__pairs[-1][0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kind(self):\n return self.get_data(\"kind\")", "def get_kind(klass, obj):\n if isinstance(obj, basestring):\n return str(obj.split('_')[0])\n elif isinstance(obj, ndb.Key):\n return obj.kind()\n else:\n return obj.__class__.__name__", "def get_ki...
[ "0.6986992", "0.6889572", "0.6839759", "0.6836857", "0.6836857", "0.6828723", "0.6828723", "0.6828723", "0.6828723", "0.6828723", "0.6828723", "0.6828723", "0.6828723", "0.6828723", "0.6828723", "0.6828723", "0.6828723", "0.6828723", "0.6828723", "0.6828723", "0.6828723", "...
0.6618575
40
Applies the linear layer.
def __call__(self, x): if self.W.data is None: in_size = functools.reduce(operator.mul, x.shape[1:], 1) self._initialize_params(in_size) return linear.linear(x, self.W, self.b)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _add_final_linear_layer(model_1, model_2):\n data_1 = model_1.weight.data\n data_2 = model_2.weight.data\n\n new_weight = torch.cat((data_1, data_2), dim=1)\n new_bias = model_1.bias + model_2.bias\n\n result_model = torch.nn.Linear(\n model_1.in_features + model_2.in_features, model_1.ou...
[ "0.69687086", "0.6941232", "0.6796415", "0.67366546", "0.6459044", "0.6247846", "0.6246267", "0.62435764", "0.62029964", "0.61661565", "0.61601895", "0.6055346", "0.6020693", "0.5988108", "0.5977499", "0.59479916", "0.5939581", "0.5923229", "0.59169745", "0.5910826", "0.58995...
0.6045514
12
Get the nth element of the buffer.
def __getitem__(self, key): return self.__buffer[key]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, n):\n return self._array[n]", "def nth(iterable, index):\n return next(itertools.islice(iterable, index, None))", "def __getitem__(self, index):\n return self.buffer[index]", "def nth(n, seq):\n try:\n return seq[n]\n except TypeError:\n return next(iter...
[ "0.7235373", "0.71733665", "0.6958556", "0.6939846", "0.6709893", "0.66067815", "0.66067815", "0.66067815", "0.6454594", "0.64141613", "0.6341759", "0.6332345", "0.6285747", "0.6267266", "0.62541986", "0.6253691", "0.61594164", "0.6088129", "0.60836804", "0.60589814", "0.6054...
0.5928624
31
Converts a datetime value into a string using the format which Go understands
def format_datetime(datetime_value): datetime_string_value = datetime_value.strftime('%Y-%m-%dT%H:%M:%S') # NOTE: Go can parse only strings where the timezone contains a colon (e.g., -07:00) # Unfortunately, Python doesn't support such format and we have to do it manually # We assume that all the dates...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_to_str(value: datetime) -> str:\n\n if value is None or not isinstance(value, datetime):\n raise ValueError(\"provided value is not a valid datetime object\")\n\n return value.strftime(\"%Y-%m-%dT%H:%M:%SZ\")", "def dump_datetime(value):\n return value.strftime('%Y-%m-%dT%H:%M:%SZ')", ...
[ "0.80794865", "0.7657144", "0.76196694", "0.76196694", "0.7615532", "0.7598322", "0.75098556", "0.7498449", "0.7462025", "0.74196917", "0.7384133", "0.7370229", "0.73596805", "0.7357847", "0.73302037", "0.7326985", "0.7324953", "0.72960335", "0.7270174", "0.71836823", "0.7143...
0.71703637
20
Return all ngrams with in range ngminngmax. The function specified by 'tokenizer' should return a list of tokens. By default, the tokenizer splits the string into its characters.
def get_ngrams(s, ngmin=1, ngmax=1, tokenizer=list, separator="|"): ngrams = [[] for x in range(ngmin, ngmax + 1)] s = tokenizer(s) for i, ch in enumerate(s): for ngsize in range(ngmin, ngmax + 1): if (i + ngsize) <= len(s): ngrams[ngsize - 1].append(separator.join(s[i:i+...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_ngrams(tokens, min_n, max_n):\n all_ngrams = list()\n n_tokens = len(tokens)\n for i in range(n_tokens):\n for j in range(i + min_n, min(n_tokens, i + max_n) + 1):\n all_ngrams.append(\" \".join(tokens[i:j]))\n return all_ngrams", "def range_ngrams(tokens, ngramRange=(1,2)):...
[ "0.6866132", "0.67631656", "0.6426783", "0.6213516", "0.61674476", "0.6112253", "0.60135216", "0.5810516", "0.5795834", "0.5682799", "0.56436926", "0.551494", "0.5462299", "0.54569304", "0.5408345", "0.539461", "0.53851444", "0.5382439", "0.5332021", "0.53106326", "0.53012186...
0.74832654
0
Loads the pretrained weights into model. Used to continue training.
def from_previous_ckpt(network, checkpoint): if os.path.exists(checkpoint): if os.path.isfile(checkpoint): try: network.load_state_dict(torch.load(checkpoint)) print(f"Loaded weights from {checkpoint}") except RuntimeError: print(f"{che...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_weights(self):\n if isinstance(self.pretrained, str):\n logger = get_root_logger()\n logger.info(f'load model from: {self.pretrained}')\n load_checkpoint(self, self.pretrained, strict=False, logger=logger)\n elif self.pretrained is None:\n pass\n ...
[ "0.8151311", "0.79608643", "0.7911507", "0.7896199", "0.77633524", "0.7720637", "0.7683719", "0.75965995", "0.7549043", "0.753047", "0.753047", "0.7518715", "0.750231", "0.7494693", "0.7492814", "0.7489758", "0.7486513", "0.7428052", "0.7418214", "0.7414042", "0.74098176", ...
0.0
-1
defines the constructor for the node class has three variables state, which holds the name of the state the info which holds some information about the state, and next, a pointer to the next node or None
def __init__(self): self.state = None self.info = None self.next = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, name, state):\n self.name = name\n self.state = state\n self.onSolnPath = False\n self.parent = None\n self.nextOnPath = None", "def __init__(self, state, parent=None, action=None):\n\t\tself.state = state\n\t\tself.parent = parent\n\t\tself.action = action\n...
[ "0.75706154", "0.72242486", "0.71966743", "0.7126082", "0.7103551", "0.7073191", "0.70528173", "0.7024703", "0.69880855", "0.6979154", "0.6918164", "0.6881379", "0.68226427", "0.68030244", "0.68018526", "0.6800388", "0.67761135", "0.6768832", "0.67566264", "0.6743088", "0.672...
0.7862477
0
defines the constructor for the LinkedList class The two variables in the linked list are the current node, which is the end of the list an the head which is the beginning of the list
def __init__(self): self.current = None self.head = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, linked_list: object):\n self.current_node = linked_list._head", "def __init__(self):\n node = ListNode(0) # dummy\n self.head = node\n self.tail = node\n self.len = 0", "def __init__(self):\n self.head = None\n self.tail = None\n self....
[ "0.80952704", "0.80352217", "0.79213846", "0.7914769", "0.78402495", "0.78402495", "0.78402495", "0.78402495", "0.78402495", "0.76633257", "0.7631188", "0.76196617", "0.7615718", "0.7615718", "0.7615718", "0.7615718", "0.76113075", "0.7593392", "0.7582047", "0.75795543", "0.7...
0.7571661
21
Create a SHAP summary plot, colored by feature values when they are provided.
def summary_plot(shap_values, features=None, feature_names=None, max_display=None, plot_type="dot", color=None, axis_color="#333333", title=None, alpha=1, show=True, sort=True, color_bar=True, auto_size_plot=True, layered_violin_max_num_bins=20, class_names=None): multi_class = Fa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shap_dependence_plot(ind, shap_values, features, feature_names=None, display_features=None,\n interaction_index=\"auto\", color=\"#1E88E5\", axis_color=\"#333333\",\n dot_size=16, alpha=1, title=None, show=True):\n \n labels = {\n 'MAIN_EFFECT': \"SHAP main ef...
[ "0.7074037", "0.65418", "0.6142789", "0.60753316", "0.59306794", "0.59020174", "0.56968063", "0.541854", "0.53407687", "0.52517164", "0.5227549", "0.51808596", "0.5136868", "0.5105006", "0.50637704", "0.5044137", "0.50264955", "0.50244725", "0.5014622", "0.5012969", "0.499672...
0.80770236
0
>>> a = numpy.ones((10,), numpy.double) >>> one_dim_ccontig(a) (2.0, 1)
def one_dim_ccontig(a: cython.double[::1]): a[0] *= 2 return a[0], a.ndim
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tocontig(x):\n if not x.flags.c_contiguous:\n x = x.copy()\n return x", "def one_dim_nogil_cfunc(a: cython.double[:]):\n with cython.nogil:\n result = _one_dim_nogil_cfunc(a)\n return result", "def test_RaggedIndexedContiguousArray_to_memory(self):\n compressed_data = cfdm....
[ "0.7013403", "0.6169621", "0.6008104", "0.5857891", "0.57865465", "0.5753654", "0.56531703", "0.5613855", "0.5557058", "0.5532005", "0.55261934", "0.5504516", "0.5496318", "0.54844075", "0.54777277", "0.5456162", "0.54412496", "0.5432076", "0.5395448", "0.5371493", "0.5363658...
0.89460915
0
Creates an empty Marker.
def empty(cls): return Marker()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def MarkerDefineDefault(self):\n #self.MarkerDefine(TextView.MARKER_NUM, wx.stc.STC_MARK_ROUNDRECT, wx.BLACK, wx.BLUE)\n pass", "def create_simple_marker(self, marker_id, d, style, transform):\n defs = self.docroot.find(svgns('defs'))\n if defs is None:\n defs = etree.SubEl...
[ "0.6442062", "0.62504405", "0.60328424", "0.5948232", "0.5752946", "0.57177347", "0.570756", "0.5704991", "0.56874335", "0.56707615", "0.5638822", "0.5638507", "0.56144035", "0.56107044", "0.56069875", "0.56069875", "0.56069875", "0.56069875", "0.5580221", "0.55230457", "0.54...
0.83619297
0
Obtain the ngrams given a string TEXT and a number N to subdivide it
def calculateNGrams(text, n): return ([text[i:i+n] for i in range(len(text)-n+1)])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ngrams(text, n):\n return chain(*[ngrams_(text, i) for i in range(n + 1)])", "def ngrams_(text, n):\n return zip(*[text[i:] for i in range(n)])", "def ngrams(text, n):\n grams = zip(*[text[i:] for i in range(n)])\n return [''.join(gram) for gram in grams]", "def word2ngrams(text, n=3)...
[ "0.82593703", "0.803158", "0.8021819", "0.79209596", "0.77919656", "0.77875364", "0.7773107", "0.74047214", "0.73800784", "0.73482174", "0.7285334", "0.7280856", "0.726495", "0.72496694", "0.724736", "0.7209116", "0.71872246", "0.71679157", "0.7123238", "0.7121608", "0.711271...
0.7060475
23
Returns a prediction class.
def classify( self, image_path: Optional[str] = None, image_data: Optional[bytes] = None ): tensor = None if image_path: tensor = self.__load_image(image_path=image_path) elif image_data: tensor = self.__load_image_from_bytes(image_data=image_data) if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict(self):\n probabilities = self.probability_array()\n # THIS ASSUMES the classifiers are in order: 0th column of the\n # probabilities corresponds to label = 0, ..., 9th col is for 9.\n classes = np.argmax(probabilities, axis=1)\n return classes", "def predict(self, X...
[ "0.7495211", "0.7409932", "0.7207142", "0.71963304", "0.71963304", "0.7190837", "0.708304", "0.7040421", "0.70123416", "0.70039725", "0.6975401", "0.69685256", "0.69627184", "0.6954415", "0.69540715", "0.69414705", "0.6932956", "0.69101006", "0.6879766", "0.68283844", "0.6823...
0.0
-1
Compute Scaled Dot Product Attention
def attention(query, key, value, mask=None, dropout=None): d_k = query.size(-1) scores = torch.matmul(query, key.transpose(-2, -1)) \ / math.sqrt(d_k) # batch * head * N_q * N_k assert len(scores.shape) == 4 if mask is not None: # scores = scores.masked_fill(mask == 0, -1e9) # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dot4(a,b):\n return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]", "def dot(a,b):\n return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]", "def dot(a, b):\n return a[0]*b[0] + a[1]*b[1] + a[2]*b[2]", "def dot(p1, p2):\n return p1[0] * p2[0] + p1[1] * p2[1]", "def dotproduct(v1, v2):\n\treturn sum(imap(operator....
[ "0.7150994", "0.6948599", "0.68710893", "0.6861066", "0.6845917", "0.6803066", "0.6801279", "0.6772394", "0.67098886", "0.66974396", "0.66911495", "0.66808933", "0.6662266", "0.66521204", "0.6643786", "0.6622362", "0.66080844", "0.660323", "0.66025805", "0.6596596", "0.659229...
0.0
-1
Append a document to the destination.
def append(self, doc): if doc is None: return assert isinstance(doc, Document) self.fh.write(doc.save_mem(fmt="json")) self.fh.write("\n") self.n += 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append(self, doc):\n pass", "def append(self, document):\n raise NotImplemented(\"Corpus does not allow appending\")", "def append(self, doc):\n if doc is None:\n return\n assert isinstance(doc, Document)\n path = self.file_path_maker(doc=doc, idx=self.idx)\n ...
[ "0.75560576", "0.7148849", "0.6969346", "0.6737264", "0.64884186", "0.632746", "0.61650366", "0.6055999", "0.5949818", "0.59452105", "0.5940739", "0.5901114", "0.58505744", "0.58358955", "0.5796151", "0.56070495", "0.5574677", "0.5565324", "0.5545741", "0.55126077", "0.548277...
0.6846161
3
Append a document to the destination.
def append(self, doc): if doc is None: return assert isinstance(doc, Document) data = {} if self.data_fields: if isinstance(self.data_fields, list): for fname in self.data_fields: data[fname] = doc.features[self.data_feature][fn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append(self, doc):\n pass", "def append(self, document):\n raise NotImplemented(\"Corpus does not allow appending\")", "def append(self, doc):\n if doc is None:\n return\n assert isinstance(doc, Document)\n path = self.file_path_maker(doc=doc, idx=self.idx)\n ...
[ "0.75560576", "0.7148849", "0.6969346", "0.6846161", "0.6737264", "0.632746", "0.61650366", "0.6055999", "0.5949818", "0.59452105", "0.5940739", "0.5901114", "0.58505744", "0.58358955", "0.5796151", "0.56070495", "0.5574677", "0.5565324", "0.5545741", "0.55126077", "0.548277"...
0.64884186
5
Gets the id of this Garage.
def id(self) -> int: return self._id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_id(self):\n return self._id", "def get_id(self):\n return self._id", "def get_id(self):\n return self._id", "def get_id(self):\n return self._id", "def get_id(self):\n return self._id", "def get_id(self):\n return self._id", "def getID(self):\n r...
[ "0.7678977", "0.7678977", "0.7678977", "0.7678977", "0.7678977", "0.7678977", "0.7639645", "0.7590466", "0.7571382", "0.7571382", "0.7571382", "0.7571382", "0.7571382", "0.7571382", "0.7571382", "0.7571382", "0.7571382", "0.7571382", "0.7571382", "0.7571382", "0.7571382", "...
0.7365577
42
Sets the id of this Garage.
def id(self, id: int): 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 set_id(self, id):\n self.data['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 se...
[ "0.7922891", "0.7895641", "0.7772734", "0.77427995", "0.75168437", "0.74363256", "0.74302393", "0.74302393", "0.74302393", "0.74302393", "0.74302393", "0.7414917", "0.7414917", "0.7414917", "0.7414917", "0.7414917", "0.7414917", "0.7414917", "0.7414917", "0.7414917", "0.74149...
0.74978536
11
Gets the name of this Garage.
def name(self) -> str: return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_name(self):\n return self._g.get_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 return self.name", "def get_name(self) ->...
[ "0.8429597", "0.78359544", "0.78359544", "0.7788796", "0.7788796", "0.7788796", "0.7782208", "0.7782208", "0.7782208", "0.7782208", "0.7782208", "0.7782208", "0.7782208", "0.7782208", "0.7782208", "0.7782208", "0.7778571", "0.7778571", "0.7755903", "0.77458197", "0.7737592", ...
0.0
-1
Sets the name of this Garage.
def name(self, name: str): if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n ...
[ "0.8138566", "0.8138566", "0.8138566", "0.8138566", "0.8138566", "0.8131188", "0.8098616", "0.80924493", "0.8075417", "0.80559045", "0.80559045", "0.8033954", "0.80266047", "0.7967703", "0.7967703", "0.79532176", "0.7865564", "0.77789176", "0.7745701", "0.7745701", "0.769814"...
0.0
-1
Gets the date_created of this Garage.
def date_created(self) -> datetime: return self._date_created
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def date_created(self):\n return self._date_created", "def date_created(self):\n return self._date_created", "def date_created(self):\n return self._date_created", "def date_created(self) -> str:\n return pulumi.get(self, \"date_created\")", "def created_date(self):\n ret...
[ "0.8493139", "0.8493139", "0.8493139", "0.8265013", "0.82438064", "0.82438064", "0.8204632", "0.79228884", "0.78626007", "0.78008056", "0.77255654", "0.77255654", "0.77255654", "0.76819724", "0.7623199", "0.75637865", "0.7562326", "0.7515601", "0.7515601", "0.7515601", "0.751...
0.83430344
3
Gets the max_capacity of this Garage.
def max_capacity(self) -> int: return self._max_capacity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_capacity_gb(self) -> str:\n return pulumi.get(self, \"max_capacity_gb\")", "def maximum_over_capacity(self):\n return self._maximum_over_capacity", "def max_capacity(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"max_capacity\")", "def max_capacity(self) -> Opt...
[ "0.83317983", "0.8093285", "0.80798125", "0.80798125", "0.80798125", "0.79002285", "0.7564016", "0.7564016", "0.74535024", "0.72862035", "0.72803277", "0.72803277", "0.72803277", "0.72803277", "0.71895933", "0.71895933", "0.71895933", "0.71895933", "0.71895933", "0.71895933", ...
0.8563169
0
Sets the max_capacity of this Garage.
def max_capacity(self, max_capacity: int): if max_capacity is None: raise ValueError("Invalid value for `max_capacity`, must not be `None`") # noqa: E501 if max_capacity is not None and max_capacity < 1: # noqa: E501 raise ValueError("Invalid value for `max_capacity`, must be a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maximum_over_capacity(self, maximum_over_capacity):\n self._maximum_over_capacity = maximum_over_capacity", "def set_max_vehicle_capacity(self, new_max_vehicle):\n if(new_max_vehicle == None):\n self._logger.write(\"Error! new_max_vehicle cannot be a NoneType\")\n elif(type(ne...
[ "0.77083373", "0.76158303", "0.72696203", "0.72696203", "0.7143532", "0.70594406", "0.70447755", "0.70447755", "0.6996339", "0.69511205", "0.6892887", "0.68749714", "0.68749714", "0.68749714", "0.68708336", "0.6861346", "0.6820634", "0.6754649", "0.6750872", "0.6750872", "0.6...
0.7791236
0
Format the given timestamp
def date_from(timestamp): return datetime.fromtimestamp(timestamp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _format_ts(cls, timestamp):\n return localtime(timestamp).strftime('%Y-%m-%d %H:%M:%S')", "def formatTimestamp(self, timestamp):\n return time.strftime('%Y%m%d-%H%M%S-%Z', time.localtime(timestamp))", "def format_timestamp(timestamp):\n try:\n date = datetime.strptime(timestamp, '%Y...
[ "0.85859376", "0.84332734", "0.8141878", "0.8015693", "0.78866494", "0.7761162", "0.7654955", "0.76233286", "0.75740767", "0.7554459", "0.7554459", "0.7554459", "0.7514401", "0.7391859", "0.73560953", "0.7343664", "0.7327695", "0.7297931", "0.7252867", "0.7252867", "0.7132071...
0.0
-1
Return all questions except for hidden/deleted not written by user
def viewable_only(self, user): # TODO: integrate this into questions() probably as standard and have # TODO: a separate all_questions() method to return all, including # TODO: hidden and deleted questions. return self.filter(Q(user=user) | Q(is_hidden=False) | ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _filter_unanswerable_samples(self):\n a = []\n q = []\n annotations = []\n for i in range(len(self.answers)):\n if len(self.answers[i].nonzero()) > 0:\n a.append(self.answers[i])\n q.append(self.questions[i])\n\n annotations.ap...
[ "0.65610087", "0.6468048", "0.6468048", "0.64185435", "0.6384654", "0.62625414", "0.60557026", "0.60337454", "0.59628606", "0.59628606", "0.5924082", "0.5920818", "0.5920818", "0.5920818", "0.5920818", "0.5920818", "0.5920818", "0.5920818", "0.5920818", "0.5920818", "0.592081...
0.69806886
0
Return the number of actual upvotes.
def count_upvotes(self): return self.filter(value=1).count()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_upvotes(self, obj):\n content_type = ContentType.objects.get_for_model(obj)\n\n votes = self.filter(content_type=content_type, object_id=obj._get_pk_val(), vote__exact=UPVOTE).aggregate(upvotes=Sum('vote'))\n\n if votes['upvotes'] is None:\n votes['upvotes'] = 0\n\n r...
[ "0.75133723", "0.7368305", "0.71925443", "0.6851246", "0.6633", "0.66265863", "0.66202134", "0.66178", "0.6599069", "0.65637183", "0.65595716", "0.6526548", "0.6477841", "0.6476779", "0.6426231", "0.6420989", "0.64096403", "0.6392472", "0.63293004", "0.6277293", "0.62764126",...
0.8612749
0
The first derivative of the polynomial.
def dfdx(x): return (1/np.cos(x))**2 - np.cos(x)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def derivative(self) -> Polynomial:\n coefficients: list[float] = [0] * self.degree\n for i in range(self.degree):\n coefficients[i] = self.coefficients[i + 1] * (i + 1)\n return Polynomial(self.degree - 1, coefficients)", "def deriv(self):\n poly_deriv = []\n for i,...
[ "0.783444", "0.71931547", "0.7122334", "0.7095058", "0.69898516", "0.6980233", "0.69042194", "0.6867219", "0.6829471", "0.682617", "0.6815108", "0.6810376", "0.67613554", "0.66930586", "0.66930586", "0.6645595", "0.66154826", "0.66066754", "0.6561886", "0.65557486", "0.654005...
0.0
-1
User joins a room
def on_join(data): username = data["username"] room = data["room"] join_room(room) # Broadcast that new user has joined send({"msg": username + " has joined the " + room + " room."}, room=room)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def join_room(room):\n return request.namespace.join_room(room)", "def join_room(self, client, room):\n if room.verify_if_is_invited(client):\n room.add_member(client)\n self.send_message('Te has unido a la sala {}'.format(room.get_name()), client)\n else:\n self...
[ "0.79336053", "0.7647316", "0.7620029", "0.756637", "0.75567204", "0.7553508", "0.7495531", "0.7397555", "0.7364757", "0.7364757", "0.73289055", "0.7120005", "0.7108429", "0.7075653", "0.7052177", "0.6878502", "0.68780726", "0.68632704", "0.6840359", "0.68288136", "0.6807557"...
0.70728827
14
Return the microbit peer.
def peer(self) -> Optional[MicrobitPeer]: return self.__peer
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def peer(self) -> str:\n return \"{0.host}:{0.port}\".format(self.transport.getPeer())", "def getPeer(self):\n return \"Peer:PID:\" + str(self.transport.pid)", "def peer_address(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"peer_address\")", "def getPeerToPeerNetwork(self):\r\n...
[ "0.62530434", "0.61438745", "0.5780009", "0.5733765", "0.5710719", "0.57017183", "0.56997615", "0.5630028", "0.55796206", "0.5474737", "0.5301718", "0.5278261", "0.5276698", "0.52685046", "0.5240961", "0.5217008", "0.5197913", "0.5185687", "0.5185687", "0.51803523", "0.517937...
0.79214066
0
Set the microbit peer.
def peer(self, value: Optional[MicrobitPeer]) -> None: if self.__peer is not None: self.__peer.remove_listener(self.__execute) if value is not None: value.add_listener(self.__execute) self.__peer = value self.__sync_x() self.__sync_y() self.__syn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setPeer (self, peer):\n\t\tself.peer = peer", "async def set_bit(self, instance, value):\n print(f\"Server: {'set_bit'} Got 'put' request from outside: new value is {value} and type {type(value)}\")\n if self.device is not None:\n self.device.set_bit_server(value)\n else:\n ...
[ "0.6491437", "0.5861135", "0.5841203", "0.5640628", "0.55474085", "0.5525343", "0.54958934", "0.54620194", "0.52957875", "0.5281907", "0.52796304", "0.51956534", "0.51790273", "0.515032", "0.5122765", "0.5122092", "0.5117041", "0.5085881", "0.50625646", "0.50356996", "0.50276...
0.60361516
1
Gets the max value.
def max_value(self) -> int: return self.__max_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_max(self):\n return self._max", "def get_max_value(self):\n max_value = max(self.values)\n return max_value", "def _get_maximum(self):\n return self._maximum", "def get_max(self):\n return self.max[-1]", "def _get_maximum_value(self):\n if hasattr(self, '_m...
[ "0.90112054", "0.9004486", "0.8921443", "0.8721012", "0.8683063", "0.86826056", "0.8678509", "0.8657126", "0.8657126", "0.85134864", "0.85134864", "0.84549254", "0.8381516", "0.8347718", "0.83032054", "0.8275961", "0.8257808", "0.8257808", "0.82571656", "0.82475704", "0.82438...
0.8694199
4
Get the x value.
def get_x(self) -> int: return self.__x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetX(self):\r\n\r\n return self._x", "def x ( self ) :\n return self.xvar", "def getX(self):\n return self.x", "def getX(self):\r\n\t\treturn self._x", "def getX(self):\n return self.__x", "def x(self):\n return self[\"x\"]", "def x(self):\n return self....
[ "0.85576457", "0.8431207", "0.8405212", "0.8394556", "0.83829755", "0.8361564", "0.8224815", "0.8224815", "0.8224815", "0.8224815", "0.8224815", "0.8224815", "0.8224815", "0.8224815", "0.8224815", "0.8224815", "0.8224815", "0.8224815", "0.8224815", "0.8224815", "0.8224815", ...
0.85869133
0
Set the y value.
def set_y(self, value: int) -> None: assert -self.__max_value <= value and value <= self.__max_value should_sync = self.__y != value self.__y = value if should_sync: self.__sync_y()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setY(self, y):\n self.y = y\n pass", "def set_y(self, y):\n self._y = y", "def SetY(self, y):\r\n\r\n self._y = y", "def setY(self, y):\r\n\t\tself._y=y", "def set_y(self, y: float):\n self.y = y", "def set_y(self, new_y):\r\n self.y = new_y", "def Y(self, ...
[ "0.91783255", "0.9177041", "0.91724205", "0.9139327", "0.91323686", "0.89285487", "0.86470485", "0.8559519", "0.8559519", "0.8505951", "0.8473426", "0.84378093", "0.8412426", "0.8245122", "0.82340264", "0.81917775", "0.81796765", "0.81796765", "0.81530505", "0.81530505", "0.8...
0.84196734
12
Get the y value.
def get_y(self): return self.__y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetY(self):\r\n\r\n return self._y", "def y(self):\n return self[\"y\"]", "def getY(self):\r\n\t\treturn self._y", "def getY(self):\n return self.__y", "def y ( self ) :\n return self.yvar", "def getY(self):\n return self.y", "def getY(self):\n return se...
[ "0.89329463", "0.873289", "0.87246585", "0.8706226", "0.8688207", "0.8685727", "0.8685727", "0.8672898", "0.8586805", "0.8585733", "0.8585733", "0.8585733", "0.8585733", "0.8585733", "0.8585733", "0.8585733", "0.8585733", "0.8585733", "0.8585733", "0.8549393", "0.85366607", ...
0.8939336
0
Stop the current gesture.
def stop_gesture(self) -> None: self.__current_gesture = "" self.__sync_current_gesture()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop(self, **kwargs):\n self.turn_off()", "def stop(self):\n self._stopped.set()\n if self._timer:\n self._timer.cancel()\n self._timer = None", "def stop(self):\n with self.stop_lock:\n self._stop_event.set()", "def stop(self):\n self._stop...
[ "0.7156627", "0.7123282", "0.70088357", "0.69684297", "0.69684297", "0.69578743", "0.69578743", "0.69394386", "0.67612296", "0.6752848", "0.6739944", "0.6732477", "0.6730176", "0.67179364", "0.6709468", "0.6700906", "0.6688671", "0.6684845", "0.6670879", "0.6662773", "0.66489...
0.83734083
0
Get the current gesture.
def current_gesture(self) -> Union[Gesture, Literal[""]]: return self.__current_gesture
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gesture(self, Qt_GestureType): # real signature unknown; restored from __doc__\n return QGesture", "def getGesture(points):\n return _identifyStrokes(points)[0]", "def get_gesture_type(self):\n if self.left_data is not None and self.right_data is None:\n return 'L'\n elif...
[ "0.69967324", "0.668051", "0.6262725", "0.6069199", "0.5974628", "0.5705471", "0.5569297", "0.55568045", "0.5498311", "0.54349875", "0.5384862", "0.53449714", "0.5280186", "0.52757716", "0.52691865", "0.52581656", "0.5220597", "0.51951015", "0.5136752", "0.5121245", "0.511765...
0.8551822
0
Sync the accelerometer's x value.
def __sync_x(self) -> None: if self.__peer is not None: try: self.__peer.send_command(MicrobitAccelerometerGetX(x=self.__x)) except CommunicationClosedError: self.__peer = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_x(self, value: int) -> None:\n assert -self.__max_value <= value and value <= self.__max_value\n\n should_sync = self.__x != value\n self.__x = value\n if should_sync:\n self.__sync_x()", "def speedup_x(self):\r\n new_speed = math.cos((self.__direction*math.p...
[ "0.67773545", "0.6735433", "0.64704436", "0.64245063", "0.63962626", "0.6334382", "0.63085324", "0.630839", "0.6287431", "0.62687534", "0.62414396", "0.6189156", "0.6163046", "0.61516947", "0.61507916", "0.61129045", "0.60850734", "0.6013757", "0.60041493", "0.5997128", "0.59...
0.7960099
0
Sync the accelerometer's y value.
def __sync_y(self) -> None: if self.__peer is not None: try: self.__peer.send_command(MicrobitAccelerometerGetY(y=self.__y)) except CommunicationClosedError: self.__peer = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_y(self, value: int) -> None:\n assert -self.__max_value <= value and value <= self.__max_value\n\n should_sync = self.__y != value\n self.__y = value\n if should_sync:\n self.__sync_y()", "def speedup_y(self):\r\n new_speed = math.sin((self.__direction*math.p...
[ "0.6801893", "0.67293483", "0.6588843", "0.6551162", "0.6407189", "0.6328648", "0.63263756", "0.63195825", "0.6310286", "0.6283239", "0.6283239", "0.62830544", "0.6280561", "0.6223051", "0.62230486", "0.6198967", "0.6166152", "0.615751", "0.6121388", "0.6118693", "0.6104192",...
0.79798937
0
Creates a classification model.
def create_model(bert_config, is_training, input_ids, input_mask, segment_ids, use_one_hot_embeddings): model = modeling.BertModel( config=bert_config, is_training=is_training, input_ids=input_ids, input_mask=input_mask, token_type_ids=segment_ids, us...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_model(self):\n self.classifier = DecisionTreeClassifier(max_depth=1)", "def create_model(self, C : float =1):\n self.classifier = RandomForestClassifier(max_depth=5)", "def create_model():\n\n # Create a sequential model (a simple NN is created) adding a softmax activation at the en...
[ "0.7451048", "0.716728", "0.70753753", "0.69427526", "0.69337225", "0.69306064", "0.6929345", "0.68631464", "0.68004555", "0.6769279", "0.6737084", "0.66838384", "0.66709864", "0.660953", "0.65912193", "0.6564333", "0.6534873", "0.6526978", "0.6525293", "0.6521778", "0.651739...
0.0
-1
Compute softmax probability over raw logits.
def _compute_softmax(scores): if not scores: return [] max_score = None for score in scores: if max_score is None or score > max_score: max_score = score exp_scores = [] total_sum = 0.0 for score in scores: x = math.exp(score - max_score) exp_scores....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax(x):\r\n exps = np.exp(x)\r\n return exps / np.sum(exps)", "def softmax(x):\n npX = np.array(x)\n expX = np.exp(x)\n\n return expX/sum(expX)", "def softmax(inputs):\n probs = np.exp(inputs)\n # print(probs.shape)\n # t = np.sum(probs, axis=0)\n # print(t.shape)\n\n prob...
[ "0.7719119", "0.7703024", "0.7702844", "0.7688321", "0.7677464", "0.7666627", "0.7666627", "0.76138234", "0.7608393", "0.75940377", "0.7590872", "0.75784117", "0.757828", "0.7574457", "0.7565043", "0.75643724", "0.75629324", "0.75555575", "0.75555575", "0.75555575", "0.755555...
0.0
-1
Checks to make sure the file_name exists and if it has a valid file extension
def check_valid_file_name(self, file_name, input_output): if self.check_file_exists (file_name): if self.check_file_name_extensions (file_name, input_output): return True else: return False else: print ("File does not exist") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_valid_filename(filename, ext):\n if not isinstance(filename, str):\n return False\n\n if not(ext == filename.split('.')[-1]):\n return False\n fname = os.path.abspath(filename)\n return os.path.isfile(fname)", "def __validate_file(self, file_name, extension):\n if not os....
[ "0.78563887", "0.7841278", "0.7745945", "0.7737157", "0.7706187", "0.756824", "0.7564719", "0.75225776", "0.74528295", "0.743284", "0.73741484", "0.7295282", "0.72948843", "0.72736377", "0.72690964", "0.72609377", "0.72323495", "0.7220412", "0.7215007", "0.71899843", "0.71858...
0.78573644
0
Returns the output tensor at the given index.
def get_output_tensor(interpreter, index): output_details = interpreter.get_output_details()[index] tensor = np.squeeze(interpreter.get_tensor(output_details['index'])) return tensor
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_output_tensor(index):\n output_details = interpreter.get_output_details()[index]\n tensor = np.squeeze(interpreter.get_tensor(output_details['index']))\n return tensor", "def get_output_tensor(self, index):\n output_details = self.model.get_output_details()[index]\n tensor = np.squ...
[ "0.88110566", "0.8773681", "0.87153566", "0.86581725", "0.8446493", "0.8446493", "0.8446493", "0.75534517", "0.7171569", "0.68134344", "0.6715133", "0.6542007", "0.65397805", "0.65058136", "0.6436549", "0.6430624", "0.63161963", "0.6215072", "0.6104049", "0.6095873", "0.60824...
0.8473132
4
Returns all nodes in graph G that have m neighbors.
def nodes_with_m_nbrs(G, m): nodes = set() # Iterate over all nodes in G for n in G.nodes(): # Check if the number of neighbors of n matches m if len(G.neighbors(n)) == m: # Add the node n to the set nodes.add(n) # Return the nodes with m neighbors return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nodes_with_m_nbrs(G,m):\n nodes = set()\n \n # Iterate over all nodes in G\n for n in G.nodes():\n \n # Check if the number of neighbors of n matches m\n if len(G.neighbors(n)) == m:\n \n # Add the node n to the set\n nodes.add(n)\n \n # R...
[ "0.8611826", "0.6694918", "0.66392255", "0.6585885", "0.6573389", "0.6364125", "0.6353012", "0.63486534", "0.63272214", "0.6289994", "0.6281156", "0.62779665", "0.6257227", "0.6218758", "0.62072706", "0.62052596", "0.62052596", "0.62052596", "0.62052596", "0.6190875", "0.6189...
0.86768496
0
This function checks whether a path exists between two nodes (node1, node2) in graph G.
def path_exists(G, node1, node2): visited_nodes = set() # Initialize the queue of cells to visit with the first node: queue queue = [node1] # Iterate over the nodes in the queue for node in queue: # Get neighbors of the node neighbors = G.neighbors(node) # Check to see if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path_exists(graph, start, end):\n explored = set()\n q = deque([start])\n while q:\n current = q.pop()\n if current == end:\n return True\n if current in explored:\n continue\n explored.add(current)\n for adjacent in graph.get(current, set()):\n...
[ "0.6943105", "0.68517166", "0.6840615", "0.6810195", "0.65086275", "0.6480424", "0.64223945", "0.6386917", "0.6321646", "0.6309421", "0.63006365", "0.6280186", "0.62410045", "0.62335056", "0.62323713", "0.62128574", "0.6171903", "0.6098448", "0.60888064", "0.6085345", "0.6071...
0.8637796
0
Checks whether a node `n` in graph `G` is in a triangle relationship or not. Returns a boolean.
def is_in_triangle(G, n): in_triangle = False # Iterate over all possible triangle relationship combinations for n1, n2 in combinations(G.neighbors(n), 2): # Check if an edge exists between n1 and n2 if G.has_edge(n1, n2): in_triangle = True break return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def node_in_open_triangle(G, n):\n in_open_triangle = False\n \n # Iterate over all possible triangle relationship combinations\n for n1, n2 in combinations(G.neighbors(n), 2):\n \n # Check if n1 and n2 do NOT have an edge between them\n if not G.has_edge(n1, n2):\n \n ...
[ "0.80673873", "0.74983394", "0.7368563", "0.7163264", "0.70398825", "0.6632318", "0.649864", "0.6482819", "0.6476794", "0.6462537", "0.6296207", "0.62886333", "0.6224689", "0.6202732", "0.6095971", "0.5974917", "0.594652", "0.58008486", "0.57799", "0.57577145", "0.57143116", ...
0.8815758
0
Returns the nodes in a graph `G` that are involved in a triangle relationship with the node `n`.
def nodes_in_triangle(G, n): triangle_nodes = set([n]) # Iterate over all possible triangle relationship combinations for n1, n2 in combinations(G.neighbors(n), 2): # Check if n1 and n2 have an edge between them if G.has_edge(n1, n2): # Add n1 to triangle_nodes...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_in_triangle(G, n):\n in_triangle = False\n \n # Iterate over all possible triangle relationship combinations\n for n1, n2 in combinations(G.neighbors(n), 2):\n \n # Check if an edge exists between n1 and n2\n if G.has_edge(n1, n2):\n in_triangle = True\n br...
[ "0.7200647", "0.70751977", "0.7030461", "0.6967375", "0.6726736", "0.6687455", "0.6641613", "0.6337595", "0.62355125", "0.6166675", "0.6157203", "0.61543846", "0.61370933", "0.61247176", "0.6108059", "0.6106579", "0.60956824", "0.60282546", "0.60016006", "0.5980921", "0.59495...
0.8840714
0
Create the full URL where user is redirected after a successful payment By default adds the UI return URL to the final URL as a query parameter. If the provider does not support that, you should use get_vene_success_url() instead, override extract_ui_return_url() and handle the UI return URL yourself.
def get_success_url(self, lang: str = settings.LANGUAGE_CODE) -> str: return self._get_final_return_url(self.get_vene_success_url(), lang=lang)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_success_url(self):\n return \"/\"", "def get_success_url(self):\n return self.request.GET.get(\n 'next',\n super().get_success_url()\n )", "def extract_ui_return_url(self) -> str:\n return (\n \"\"\n if not self.request\n ...
[ "0.6956609", "0.691428", "0.6869406", "0.6833668", "0.6805369", "0.66576135", "0.66576135", "0.6619087", "0.6619087", "0.6592127", "0.65738183", "0.65738183", "0.65553343", "0.654024", "0.65352786", "0.65345085", "0.64838356", "0.6482777", "0.64638734", "0.6405875", "0.635814...
0.70585924
0
Create the full URL where user is redirected after a failed payment By default adds the UI return URL to the final URL as a query parameter. If the provider does not support that, you should use get_vene_failure_url() instead, override extract_ui_return_url() and handle the UI return URL yourself.
def get_failure_url(self, lang: str = settings.LANGUAGE_CODE) -> str: return self._get_final_return_url(self.get_vene_failure_url(), lang=lang)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_ui_return_url(self) -> str:\n return (\n \"\"\n if not self.request\n else self.request.GET.get(self.ui_return_url_param_name, \"\")\n )", "def ui_redirect_failure(self, order: Order = None) -> HttpResponse:\n ui_return_url = self.extract_ui_retur...
[ "0.6778495", "0.644192", "0.6424082", "0.6393199", "0.63245904", "0.615833", "0.6089511", "0.6088285", "0.6088285", "0.60731703", "0.60424805", "0.6021025", "0.5991029", "0.5989583", "0.595857", "0.595857", "0.5911122", "0.5909357", "0.59072787", "0.5870938", "0.5842406", "...
0.74606955
0
Creates DataLoader for the Image Searcher task.
def create(cls, image_embedder_path: str, metadata_type: _MetadataType = _MetadataType.FROM_FILE_NAME, l2_normalize: bool = False) -> "DataLoader": # Creates ImageEmbedder. image_embedder_path = os.path.abspath(image_embedder_path) with tf.io.gfile.GFile(image_embedder...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_loader(config, image_path, crop_size, batch_size,sampler, num_workers=2, mode='train', augmentation_prob=0.4):\r\n\r\n dataset = ImageFolder(config)\r\n data_loader = data.DataLoader(dataset=dataset, batch_size=batch_size, num_workers=num_workers, sampler=sampler)\r\n \r\n return data_loader", "...
[ "0.7213517", "0.70392615", "0.6907643", "0.68996435", "0.6878223", "0.6812338", "0.6788178", "0.6727513", "0.67158157", "0.6680051", "0.66543525", "0.6616925", "0.66098905", "0.6606795", "0.6599352", "0.65874934", "0.6572469", "0.656441", "0.6551389", "0.6489163", "0.6479297"...
0.0
-1
Return a copy of the CCDData object.
def copy(self): try: return self.__class__(self, copy=True) except TypeError: new = self.__class__(copy.deepcopy(self)) return new
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data(self):\r\n return self.data.copy()", "def copy(self):\n return self.as_dataframe(self.data.copy())", "def copy(self):\n new_data_collection = DataCollection()\n for item in self.iteritems():\n new_data_collection.add_data(item)\n return new_data_collec...
[ "0.7388654", "0.71962273", "0.7060531", "0.7050748", "0.69976884", "0.69801843", "0.69674885", "0.69674885", "0.69674885", "0.6967355", "0.6956928", "0.6956928", "0.6956928", "0.6956928", "0.6943422", "0.69372576", "0.68984807", "0.68984807", "0.68984807", "0.68984807", "0.68...
0.0
-1
Compares whether two Axes are equal
def __eq__(self, other): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_equal(self, a, b):\n return a.X[0] == b.X[0]", "def equal(series1, series2):\n # pylint: disable=protected-access\n return bool(\n series1._data is series2._data and\n series1._collection is series2._collection\n )", "def __eq__(self, other):\n\n ...
[ "0.73399436", "0.70706445", "0.70041007", "0.69437516", "0.69136065", "0.68838495", "0.68680936", "0.68627703", "0.68532085", "0.68273085", "0.68273085", "0.6822007", "0.6807372", "0.6781316", "0.6768064", "0.6737717", "0.6734158", "0.6703094", "0.6699488", "0.6695706", "0.66...
0.0
-1
Get a mock hardware API.
def mock_sync_hardware_api(decoy: Decoy) -> SyncHardwareAPI: return decoy.mock(cls=SyncHardwareAPI)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_device(self):\n pass", "def test_get_device(self):\n pass", "def fusion_api_get_server_hardware(self, uri=None, param='', api=None, headers=None):\n return self.sh.get(uri=uri, api=api, headers=headers, param=param)", "def test_all_hardware(self, mock_co2, mock_humidity)...
[ "0.64604783", "0.64604783", "0.62741643", "0.62369776", "0.62237847", "0.61899555", "0.61140347", "0.61140347", "0.61055815", "0.6006752", "0.5950113", "0.5943221", "0.59326565", "0.590018", "0.5898683", "0.5887933", "0.58574957", "0.5842354", "0.5810103", "0.58021426", "0.57...
0.6989172
0
Get a ProtocolCore test subject with its dependencies mocked out.
def subject( decoy: Decoy, mock_engine_client: EngineClient, api_version: APIVersion, mock_sync_hardware_api: SyncHardwareAPI, ) -> ProtocolCore: decoy.when(mock_engine_client.state.labware.get_fixed_trash_id()).then_return( "fixed-trash-123" ) decoy.when( mock_engine_client....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_labware_on_module(\n decoy: Decoy, mock_engine_client: EngineClient, subject: ProtocolCore\n) -> None:\n mock_module_core = decoy.mock(cls=ModuleCore)\n mock_labware_core = decoy.mock(cls=LabwareCore)\n\n decoy.when(mock_module_core.module_id).then_return(\"abc\")\n decoy.when(mock_engi...
[ "0.6230572", "0.6092015", "0.6072974", "0.57625884", "0.57251626", "0.5713692", "0.552068", "0.5485966", "0.5476035", "0.53310484", "0.5298081", "0.52960753", "0.51859534", "0.51852", "0.51669186", "0.5128245", "0.5108863", "0.50735456", "0.5059354", "0.5059354", "0.5041078",...
0.6689637
0
It should return the labware location as None to represent an off deck labware.
def test_get_labware_location_off_deck( decoy: Decoy, mock_engine_client: EngineClient, subject: ProtocolCore, ) -> None: mock_labware_core = decoy.mock(cls=LabwareCore) decoy.when(mock_labware_core.labware_id).then_return("abc") decoy.when(mock_engine_client.state.labware.get_location("abc"))....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_location(self):\r\n return None", "def get_location(self, labware_id: str) -> LabwareLocation:\n return self.get(labware_id).location", "def Lokation(self):\n return self.getMylocation()", "def default_location(self, thing):\n return None", "def default_location(self, th...
[ "0.6586029", "0.63894314", "0.59915197", "0.597539", "0.597539", "0.597539", "0.58957124", "0.58957124", "0.58957124", "0.5881793", "0.5850138", "0.57638246", "0.57638246", "0.5755115", "0.5733677", "0.56211126", "0.5618291", "0.5592803", "0.55512035", "0.5532904", "0.5525985...
0.5801264
11
Initializes weights with Xavier Uniform weights
def init_weights(self): for m in self.modules(): if isinstance(m, nn.Conv2d) or isinstance(m, nn.ConvTranspose2d): xavier_uniform_(m.weight) if m.bias is not None: zeros_(m.bias)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_weight(self):\r\n xavier_init(self.output_proj, distribution='uniform', bias=0.)", "def initialize_weights_xavier(self):\n\t\tself.weights = [np.random.uniform(-1/sqrt(size1), 1/sqrt(size1)) for size1, size2 in zip(self.sizes[:-1], self.sizes[1:])]\n\t\tself.biases = [np.zeros([size, ]) for size ...
[ "0.83391386", "0.8253223", "0.8242716", "0.78062576", "0.7781362", "0.77582437", "0.7745297", "0.771026", "0.7708891", "0.7708891", "0.76764816", "0.76604545", "0.7655313", "0.76306367", "0.76011425", "0.7589836", "0.7575014", "0.756051", "0.75355405", "0.75308365", "0.753083...
0.74998313
24
Returns list of tokens
def get_list(file_name): with open(file_name, "r", encoding="latin-1") as file: text = file.read() text = text.lower() # Make everything lowercase text = text.split("\n") return text
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tokens(self) -> List[str]:\n return self.tokens", "def tokens(self):\n # type: () -> List[Token]\n return self._tokens", "def getTokens(self):\n list = []\n for i in range(self.startIdx, self.endIdx + 1):\n token = self.sentence[i]\n list.append(token)\n...
[ "0.8692819", "0.83587223", "0.8256717", "0.8179336", "0.8071129", "0.8071129", "0.8071129", "0.8046761", "0.79709417", "0.79518163", "0.78814375", "0.78461784", "0.7809024", "0.7729823", "0.7709143", "0.7637755", "0.7635449", "0.76215005", "0.761888", "0.7594405", "0.7579235"...
0.0
-1
Convert string to float with rounding a number to 2 decimal digits.
def convert_to_float(word: str) -> float: return round(float(word), 2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _convert_to_float(s):\n try:\n return float(s)\n except:\n return s", "def _to_float(self, s: str) -> float:\n return int(s[:-1]) / 1e9 if s.endswith('n') else float(s[:-1])", "def ffloat(string):\n try:\n return float(string.strip())\n except:\n return 0", ...
[ "0.7336639", "0.7283961", "0.72290075", "0.7156843", "0.71271056", "0.7008569", "0.69197106", "0.6907133", "0.6850413", "0.68414634", "0.6827214", "0.68237615", "0.67459255", "0.6712711", "0.6684748", "0.66701394", "0.665725", "0.66012114", "0.6575152", "0.655052", "0.6536627...
0.74341446
0
A list of currentlyavailable actions for a particular player (assists validation).
def _available_actions(self, state, colour): available_actions = [] if colour == "white": stacks = +state.state else: stacks = -state.state for square in stacks.keys(): available_actions.append(("BOOM", square)) for square, n in stacks.items():...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_available_actions(self):\n return self.actions", "def get_list_of_actions(self):\n return self.actions", "def legal_actions(self):\n\n if self.player == TERMINAL: # is terminal\n return []\n elif self.player == CHANCE: # is chance\n if self.phase == P...
[ "0.7792816", "0.73725057", "0.73346114", "0.7290577", "0.7270822", "0.7250239", "0.7242199", "0.7199739", "0.71789706", "0.71789706", "0.71286947", "0.71046364", "0.7091521", "0.70578146", "0.697194", "0.6890252", "0.6884658", "0.68529266", "0.68224347", "0.67924285", "0.6787...
0.59574014
94
Initialize the __json_args__ to sane defaults. If __json_args__ is specified on this class, it's values will extend the defaults. The default output configuration does not include any relationships.
def init_json_args(cls): defaults = cls._base_json_args() if cls.__json_args__ is None: cls.__json_args__ = defaults else: cls.__json_args__ = mapping_extend(defaults, cls.__json_args__)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _base_json_args(cls):\n relationships = cls.__mapper__.relationships.keys()\n relationship_options = dict([(x, False) for x in relationships])\n\n defaults = {'relationships': relationship_options,\n 'exclude_attrs': [],\n 'include_attrs': []}\n ...
[ "0.76450163", "0.6532611", "0.62817293", "0.62146294", "0.6005211", "0.58852124", "0.58388937", "0.576647", "0.57045346", "0.5700878", "0.56684846", "0.5641262", "0.5618536", "0.5615553", "0.55523103", "0.555061", "0.5539106", "0.5504525", "0.5504515", "0.55035186", "0.549450...
0.8174069
0
Serialize a model object to a JSONcompatible dict. Relationships are included or not based on their boolean value in `self.__json_args__['relationships']`. If an attribute is specified in __json_args__['exclude_attrs'], it will be excluded UNLESS it is also included (therefore overridden) in __json_args__['include_attr...
def __json__(self, request, options={}): if '_override' not in options: json_args = mapping_extend({}, self.__json_args__, options) else: # Full override json_args = mapping_extend({}, self._base_json_args(), options) obj = {} for column_attr in self._...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _base_json_args(cls):\n relationships = cls.__mapper__.relationships.keys()\n relationship_options = dict([(x, False) for x in relationships])\n\n defaults = {'relationships': relationship_options,\n 'exclude_attrs': [],\n 'include_attrs': []}\n ...
[ "0.67924076", "0.6053082", "0.60486937", "0.60293204", "0.5987507", "0.59164476", "0.5890153", "0.5870675", "0.58285195", "0.58101517", "0.5801752", "0.57988626", "0.5789711", "0.57568455", "0.5739113", "0.57194453", "0.57138354", "0.57047623", "0.5698286", "0.5689306", "0.56...
0.74892545
0
Generates a transformation matrix for the specified color.
def generate_matrix(color): # You do not need to understand this function. if color == 'red': c = [[.567, .433, 0], [.558, .442, 0], [0, .242, .758]] elif color == 'green': c = [[0.625, 0.375, 0], [0.7, 0.3, 0], [0, 0.142, 0.858]] elif color == 'blue': c = [[.95, 0.05, 0], [0, 0.433, 0.567], [0, 0.475, .525]]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_lab_color2_matrix(color):\r\n if not color.__class__.__name__ == 'LabColor':\r\n raise ValueError(\r\n \"Delta E functions can only be used with two LabColor objects.\")\r\n return numpy.array([(color.lab_l, color.lab_a, color.lab_b)])", "def get_multiplied_color(color, m):\n ...
[ "0.58761674", "0.56306136", "0.55811155", "0.5510646", "0.53022265", "0.520729", "0.5199081", "0.5169888", "0.51208043", "0.5084354", "0.5033543", "0.501534", "0.5011352", "0.50034934", "0.49816066", "0.4956812", "0.49341697", "0.49186152", "0.49118412", "0.49118412", "0.4902...
0.72394973
0
Conversion from SI wind speed units to km/hr. Note
def si_to_kmh(vals): return vals * 3600.0 / 1000.0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _mps_to_kph(self) -> None:\n if self.units == \"m/s\":\n self.units = \"km/h\"\n self.value = ((self.value * 360) / 100).__round__(2)\n else:\n msg = (\n \"Not a valid unit conversion, expected units to be in 'm/s' but instead \"\n + ...
[ "0.7602264", "0.71233475", "0.70470756", "0.70326", "0.67385817", "0.66836435", "0.64556485", "0.6439641", "0.64128006", "0.64057386", "0.6366491", "0.63206816", "0.6317612", "0.6289376", "0.62567335", "0.6238002", "0.6233124", "0.6223903", "0.62005377", "0.61861044", "0.6176...
0.6920316
4
Sets the inactive of this EmailPerformanceCustomerHistogramPeriod.
def inactive(self, inactive): self._inactive = inactive
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_inactive(self):\n self.active = False", "def inactive(self, community, now):\n self._get_or_create_timestamps(community).last_active = now - CANDIDATE_INACTIVE", "def inactive(self, community, now):\n timestamps = self._get_or_create_timestamps(community)\n timestamps.last_a...
[ "0.64443934", "0.5664479", "0.5562693", "0.5444888", "0.54022795", "0.5372697", "0.5370656", "0.5224421", "0.5091643", "0.5091643", "0.50757796", "0.5074865", "0.5068548", "0.5057734", "0.49839193", "0.4978823", "0.49768656", "0.49245912", "0.48997295", "0.48938453", "0.48801...
0.68939173
0
Sets the month of this EmailPerformanceCustomerHistogramPeriod.
def month(self, month): self._month = month
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setMonth(self, *args):\n return _libsbml.Date_setMonth(self, *args)", "def set_Month(self, value):\n super(GetTimestampFromDateParametersInputSet, self)._set_input('Month', value)", "def setIndexMonth(self,index):\n self.indexMonth = index", "def set_month(self, month):\n # if...
[ "0.6901338", "0.64767337", "0.64282155", "0.6300462", "0.6278975", "0.6233307", "0.6209926", "0.6004832", "0.5933341", "0.59280217", "0.58695054", "0.58659804", "0.5823816", "0.57044506", "0.5669081", "0.56657326", "0.56657326", "0.564192", "0.56039", "0.56010914", "0.5601091...
0.71851057
0
Sets the total of this EmailPerformanceCustomerHistogramPeriod.
def total(self, total): self._total = total
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total(self, total):\n if self.local_vars_configuration.client_side_validation and total is None: # noqa: E501\n raise ValueError(\"Invalid value for `total`, must not be `None`\") # noqa: E501\n\n self._total = total", "def total_amount(self, total_amount):\n\n self._total_a...
[ "0.6017421", "0.5976307", "0.5893863", "0.58774394", "0.58696204", "0.58666426", "0.5833891", "0.5776506", "0.56699765", "0.5603666", "0.5600698", "0.5578407", "0.557836", "0.55546445", "0.5456406", "0.543631", "0.54132706", "0.54132706", "0.5391783", "0.5379822", "0.5373157"...
0.6298483
3
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, EmailPerformanceCustomerHistogramPeriod): 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
Creates model based classfifier, a shim around basic Keras Model class. This takes two inputs, concatenates them, and optimizes a model that predicts the output. This is generally used as a classifier, and more specifically a matchmistmatch classifier.
def __init__(self, input_dataset, num_hidden_list=None, **kwargs): if not isinstance(input_dataset, tf.data.Dataset): raise TypeError('Dataset must be a tf.data.datasert, not a %s' % type(input_dataset)) if num_hidden_list is None: num_hidden_list = [] if not isinstance(num...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_classify(self, num_classes: int = 10) -> KM.Model:\n input_tensor = KL.Input(shape=(32, 32, 3))\n # if self.train_mode == \"classifier\":\n # # Use the pretrained encoder for classifier only training\n # self.encoder_model = KM.load_model(\"ae_model/ae_model.h5\").get_...
[ "0.63104266", "0.63034606", "0.6285313", "0.6271002", "0.6270968", "0.6269223", "0.6177669", "0.61671036", "0.61490303", "0.6135432", "0.61305517", "0.6091723", "0.6079866", "0.6076947", "0.6074812", "0.6070947", "0.60418636", "0.6028118", "0.6012048", "0.5992968", "0.5991425...
0.0
-1
Sets the categories of this ItemsSelector.
def categories(self, categories): self._categories = categories
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def categories(self, categories):\n self._categories = categories", "def categories(self, categories: List[str]):\n\n self._categories = categories", "def set_categories(self, categories: NounCategories):\n \n self._categories = categories", "def setCategories(self, categories):\n ...
[ "0.7601983", "0.7440327", "0.7250317", "0.6546528", "0.61389256", "0.587392", "0.58068913", "0.5774093", "0.57231003", "0.56830543", "0.5493475", "0.54800624", "0.5463272", "0.5452792", "0.5443772", "0.5443772", "0.5443772", "0.5443772", "0.5443772", "0.5417962", "0.53965527"...
0.75876725
3
Sets the collections of this ItemsSelector.
def collections(self, collections): self._collections = collections
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setCollection(self, collection):\n self.collectionName = collection[\"name\"]\n self.collectionType = collection[\"type\"]\n return", "def set_collection(self, collection):\n if isinstance(collection, BangumiSubjectCollection):\n return self.set_sub_collection(collectio...
[ "0.6235105", "0.60253304", "0.58556604", "0.5585991", "0.5544324", "0.5451709", "0.54423255", "0.5417106", "0.5346088", "0.53086007", "0.5273648", "0.5273648", "0.52255446", "0.5218052", "0.5201216", "0.5182574", "0.51562154", "0.5152388", "0.5066864", "0.5012771", "0.5006454...
0.76447016
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, ItemsSelector): 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
Validates the phone number type as home, office, or cell
def validatePhoneNumberType(self): ## Declaring a Flag to control a while loop phone_number_type_ok = False ## While loop to have user retry their input if they enter incorrectly while not phone_number_type_ok: if self.phone_number_type.lower() in self.valid_phone_number_type...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_phoneNumber(number):\n return isinstance(number, int)", "def validate_phone_number(value):\n\n try:\n z = phonenumbers.parse(value, None)\n except phonenumbers.NumberParseException:\n raise forms.ValidationError(\"Enter a valid phone number.\")\n\n if not phonenumbers.i...
[ "0.70305324", "0.68899775", "0.68249553", "0.6770853", "0.67523545", "0.67342925", "0.66789687", "0.6664315", "0.6659713", "0.66564447", "0.665364", "0.6605897", "0.6571009", "0.65343964", "0.6522932", "0.6502887", "0.644504", "0.64377046", "0.63330984", "0.63199764", "0.6273...
0.7573053
0
Given a string, return a new string where the first and last characters have been swapped. If the string is empty or only has one character then return the string unchanged.
def front_back(string): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def swapCharacters(word):\n l = list(word)\n temp = word[-1]\n l[-1] = l[0]\n l[0] = temp\n return ''.join(l)", "def swap_ends(s):\n first = s[0]\n last = s[-1]\n mid = s[1:-1]\n final = last + mid + first\n return final", "def mirror(s):\n mir_str = s\n for i in range(1, le...
[ "0.691872", "0.6858679", "0.6847623", "0.68313974", "0.67932975", "0.6791847", "0.67635304", "0.66983736", "0.6659495", "0.66465527", "0.66446614", "0.65621656", "0.6549693", "0.64818126", "0.6473427", "0.6467974", "0.6458662", "0.6399627", "0.6395326", "0.6394613", "0.639437...
0.0
-1