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
Destroy the driver session, this function is called everytime a driver instance is destroyed This is a good place to close any open sessions, finish writing to log files
def cleanup(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_session(self):\n self.driver.close()", "def dispose():\n if _driver:\n log.msg_debug(\"[{driver}] dispose\".format(driver=_driver.get_name()))\n _driver.dispose()", "def __del__(self):\n\n self.session.close()", "def clean_up(self):\n self.session.close()", "...
[ "0.7129763", "0.70032936", "0.6854024", "0.68136895", "0.681202", "0.6650462", "0.66460943", "0.65916353", "0.65916353", "0.65916353", "0.65733254", "0.65268165", "0.651241", "0.650918", "0.6485256", "0.6419419", "0.64114165", "0.63965607", "0.63878316", "0.6378344", "0.63581...
0.0
-1
Returns largest snap id from DBA_HIST_SNAPSHOT
def get_max_snapid(db_conn, logger): Snapshots.__validate(db_conn=db_conn, logger=logger) # max_snapshot_query = "select snap_id " \ "from dba_hist_snapshot " \ "where end_interval_time = (select max(end_inter...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_most_current_snapshot(db_identifier, today_date):\n snapshots = rds_client.describe_db_snapshots(SnapshotType='automated')['DBSnapshots']\n if db_identifier and not 'None':\n snapshots = filter(lambda x: db_identifier in x.get('DBInstanceIdentifier'), snapshots)\n\n for snapshot in snapsho...
[ "0.6332178", "0.61792976", "0.6137891", "0.5978063", "0.58039176", "0.57572174", "0.5721936", "0.5678851", "0.56595546", "0.5648404", "0.5631838", "0.5611582", "0.5611572", "0.55914605", "0.55815375", "0.5579846", "0.5533067", "0.5527304", "0.5488597", "0.54624677", "0.545834...
0.8024712
0
Return the number of total users who rated the movie.
def total_rated(users: List[int], movie: int, ratings: UserRatingDict) -> int: result = 0 for i in users: if movie in list(ratings[i].keys()): result += 1 return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tot_movies():\n total = movies['Number of Movies'].sum()\n return ('tot_movies', total)", "def get_user_view_count(self, username):\n self.cur.execute(\"SELECT CAST(SUM(view_count) AS DECIMAL(10, 0)) FROM videos WHERE uploader = \\\"{}\\\"\".format(username))\n return self.cur.fet...
[ "0.6916057", "0.660642", "0.65746045", "0.65171784", "0.64303356", "0.6368172", "0.63395154", "0.6249641", "0.61884147", "0.618811", "0.6143058", "0.613632", "0.6118675", "0.6101042", "0.6051294", "0.6027137", "0.6027137", "0.6020774", "0.60160595", "0.5994691", "0.5966524", ...
0.8175688
0
Check to see if we created the 0001 frame of this file.
def check_already_extracted(video_parts): train_or_test, classname, filename_no_ext, _ = video_parts return bool(os.path.exists(os.path.join("/data/niteshku001/Ravdess", train_or_test, classname, filename_no_ext + '-0001.jpg')))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def my_frame(self):\n first_byte_as_bits = bin(int(self.packet_body[self.reader], base=16))[2:].zfill(8)\n return first_byte_as_bits[0:3] == \"001\"", "def check_encoder(self):\n file = Path(self.get_encoder_path() + \".data-00000-of-00001\")\n\n return file.exists()", "def hasCurre...
[ "0.6845341", "0.6385996", "0.62448496", "0.6057301", "0.58535653", "0.5787386", "0.57349885", "0.57237864", "0.56976765", "0.56358933", "0.5621559", "0.559981", "0.55927694", "0.5521344", "0.550883", "0.5489131", "0.5481525", "0.54558146", "0.5454623", "0.54435945", "0.543617...
0.0
-1
Load the pretrained weights to the models' encoder and decoder modules
def load_weights(base_name, model, ep, opt): # Paths to encoder and decoder files model_name = os.path.join(base_name, "i3d_ep"+str(ep)+"_"+opt+".pt") if os.path.isfile(model_name): model.load_state_dict(torch.load(model_name)) print("Loading I3D weights... : {}".format(model_name)) retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_encoder_weights(self, encoder_weights):\n self.encoder.load_weights(encoder_weights)", "def load_model(self):\n self.opt.load_weights_folder = os.path.expanduser(self.opt.load_weights_folder)\n\n assert os.path.isdir(self.opt.load_weights_folder), \\\n \"Cannot find folde...
[ "0.7682749", "0.75298536", "0.744381", "0.73971266", "0.73269916", "0.73150736", "0.72718525", "0.71863985", "0.7173713", "0.7090004", "0.70568687", "0.70343035", "0.7021351", "0.69961375", "0.69401944", "0.69265676", "0.69052786", "0.68935543", "0.6872852", "0.680937", "0.68...
0.713369
9
Add headers to both force latest IE rendering engine or Chrome Frame, and also to cache the rendered page for 10 minutes.
def add_header(response): response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1' response.headers['Cache-Control'] = 'public, max-age=0' return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, max-age=60'\n return response", "def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, m...
[ "0.8221727", "0.8220911", "0.8220911", "0.8220911", "0.8220911", "0.81940746", "0.81111443", "0.80852413", "0.79712725", "0.78637785", "0.7659569", "0.72363365", "0.71586627", "0.71513546", "0.71513546", "0.71502376", "0.71502376", "0.7140211", "0.7135492", "0.7126684", "0.71...
0.8161616
28
Return the left view of the tree.
def left_view(self)->list: queue=[] left=[] queue.append(self) while(len(queue)>0): for i in range(len(queue)): if(i==0): left.append(queue[0].data) node=queue[0] queue.pop(0) if(node.left!=None): queue.append(node.left) if(node.right!=None): queue.append(node.right) retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def left_root(self):\n return self.left_child(self.virtual_root)", "def get_left(self):\n return self.__left", "def get_left(self):\n return self.left", "def getLeft(self):\n return self.left", "def left(self):\n return self._left", "def left(self):\n return self...
[ "0.82560426", "0.8169316", "0.81584114", "0.81019026", "0.79926074", "0.79926074", "0.7983903", "0.79575205", "0.7887999", "0.7720716", "0.7680289", "0.7620984", "0.7599738", "0.75866836", "0.7574569", "0.7570451", "0.75311977", "0.7524592", "0.7524592", "0.7419764", "0.73872...
0.75937116
13
Return the maxdepth of the tree.
def maxDepth(node): if node is None: return 0 else: lDepth=maxDepth(node.left) rDepth=maxDepth(node.right) if lDepth>rDepth: return lDepth+1 else: return rDepth+1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_tree_depth(self):\n\n depths = np.array([leaf.tree_depth for leaf in self.leaves])\n\n return depths.max()", "def max_depth(self) -> int:\n return pulumi.get(self, \"max_depth\")", "def get_max_depth(self):\n return self.MAX_DEPTH", "def _max_depth(self):\n max_dept...
[ "0.9047189", "0.8690967", "0.8652321", "0.86203194", "0.82904667", "0.8260008", "0.825735", "0.82057595", "0.8127802", "0.81242335", "0.80207545", "0.79476947", "0.79170525", "0.78820616", "0.7824556", "0.7822474", "0.76324034", "0.76061285", "0.75666094", "0.75245845", "0.75...
0.7863341
14
initialize model and weights and such
def __init__(self): super(CustomNetwork, self).__init__() self.fc1 = nn.Linear(28*28, 500) self.fc2 = nn.Linear(500, 256) self.fc3 = nn.Linear(256, 10) self.loss = Loss()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_weights(model):\n ...", "def _initialize_weights(self):\n pass", "def initialize(self):\n LOG.info(\"Initializing Model.\")\n self.model = self.convert(df=self.training_df)\n if self.bootstraps is not None:\n LOG.info(\"Bootstrapping Data.\")\n ...
[ "0.8507747", "0.79880965", "0.7678937", "0.76385456", "0.7630126", "0.76079684", "0.7595659", "0.75947237", "0.756255", "0.7554624", "0.7542726", "0.75413126", "0.75398123", "0.75327426", "0.7494399", "0.7475801", "0.74594414", "0.74441767", "0.74408776", "0.7432825", "0.7418...
0.0
-1
Converts newlines into and s.
def linebreaks(value, autoescape=False): value = normalize_newlines(value) paras = re.split('\n{2,}', value) if autoescape: paras = ['<p data-parnum="%s">%s</p>' % (i, escape(p).replace('\n', '<br />')) for i, p in enumerate(paras)] else: paras = ['<p data-parnum="%s">%s</p>' % (i, p.rep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def modify(s):\n\tl = s.splitlines(True)\n\ttry:\n\t\tif l[1] in ('\\r\\n', '\\n', '</br>'):\n\t\t\tl = everyother(l)\n\texcept IndexError:\n\t\tpass\n\ttry:\n\t\tif l[-1] not in ('\\r\\n', '\\n', '</br>'):\n\t\t\tl.append('\\r\\n')\n\texcept IndexError:\n\t\tpass\n\treturn ''.join(l)", "def nl2br(s):\n retur...
[ "0.62194276", "0.6193952", "0.59154564", "0.5836151", "0.5775937", "0.56506264", "0.563082", "0.560965", "0.5548996", "0.55323863", "0.5523938", "0.54555607", "0.53958887", "0.53954804", "0.5392902", "0.53920454", "0.5309197", "0.53079605", "0.5304625", "0.53003716", "0.52933...
0.0
-1
Split input data into batches and iterate over the minibatches.
def __iterate_minibatches(self, dataset, batchsize, shuffle=False): n = len(dataset[0]) assert len(dataset[1]) == n batchsize = min(batchsize, n) indices = numpy.arange(n) numpy.random.shuffle(indices) for start_idx in range(0, n - batchsize + 1, batchsize): e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_minibatches(self):\n batch_size = self.params['batch_size']\n start_index = 0\n while start_index + batch_size < 500:\n end_index = start_index + batch_size\n yield self.input[start_index:end_index], self.y[start_index:end_index]\n start_index = end_in...
[ "0.7514821", "0.7228337", "0.7189508", "0.7113607", "0.7111697", "0.70808095", "0.70292306", "0.6942698", "0.691379", "0.6896721", "0.6891105", "0.6889889", "0.6845333", "0.6832212", "0.6813091", "0.67320377", "0.67196655", "0.6714967", "0.6660149", "0.6641212", "0.66309243",...
0.63300085
43
Sets the cellular_technology of this Network.
def cellular_technology(self, cellular_technology): self._cellular_technology = cellular_technology
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_electrical_type(self, connection_etype):\n self.etype = connection_etype", "def __init__(self, cellular_technology=None, is_voice_roaming_enabled=None, imei=None, iccid=None, meid=None, carrier_settings_version=None, current_carrier_network=None, current_mobile_country_code=None, current_mobile_ne...
[ "0.54518664", "0.513338", "0.5067461", "0.48523462", "0.48099002", "0.47702315", "0.47393814", "0.47324398", "0.47281742", "0.47162086", "0.47092837", "0.4702348", "0.46906355", "0.4670833", "0.46497086", "0.46365848", "0.46365848", "0.46365848", "0.46365848", "0.4601058", "0...
0.9004759
0
Sets the is_voice_roaming_enabled of this Network.
def is_voice_roaming_enabled(self, is_voice_roaming_enabled): self._is_voice_roaming_enabled = is_voice_roaming_enabled
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_data_roaming_enabled(self, is_data_roaming_enabled):\n\n self._is_data_roaming_enabled = is_data_roaming_enabled", "def is_roaming(self, is_roaming):\n\n self._is_roaming = is_roaming", "def set_use_music(self, bEnabled):\n\t\tcall_sdk_function('PrlVmCfg_SetUseMusic', self.handle, bEnabled...
[ "0.61055624", "0.6026634", "0.5206036", "0.51777315", "0.51712847", "0.5089319", "0.50430036", "0.50387585", "0.49048346", "0.48185816", "0.4809759", "0.47629684", "0.4733111", "0.47227722", "0.47078836", "0.46761084", "0.46498984", "0.4649474", "0.4648588", "0.46294358", "0....
0.8437524
0
Sets the iccid of this Network.
def iccid(self, iccid): self._iccid = iccid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_cid(self, cid):\n self.__cid = cid", "def set_cid(self, cid):\n self.__cid = cid", "def cidr(self, cidr):\n \n self._cidr = cidr", "def vcn_id(self, vcn_id):\n self._vcn_id = vcn_id", "def set_nci(self, nci: int) -> None:\n self.config[\"nci\"] = \"0x{}0\"....
[ "0.76381475", "0.76381475", "0.6284573", "0.6230802", "0.59487116", "0.58567274", "0.5854948", "0.5794281", "0.5778503", "0.57716906", "0.57712877", "0.56311375", "0.5618979", "0.5597367", "0.5567419", "0.5507964", "0.5456775", "0.5440663", "0.5435232", "0.5421832", "0.539432...
0.8163385
0
Sets the meid of this Network.
def meid(self, meid): self._meid = meid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_node_id(self, node_id):\n self._node_id = node_id", "def moid(self, moid):\n\n self._moid = moid", "def moid(self, moid):\n\n self._moid = moid", "def ion_node_id(self, ion_node_id):\n\n self._ion_node_id = ion_node_id", "def setID(self, id):\r\n raise NotImplemen...
[ "0.6020895", "0.59873366", "0.59873366", "0.5859316", "0.5817441", "0.580129", "0.5799491", "0.57427883", "0.5689283", "0.5608548", "0.5602765", "0.55243534", "0.55241156", "0.5490868", "0.54837626", "0.547197", "0.54190207", "0.5397504", "0.53779083", "0.536733", "0.52938765...
0.7898926
0
Sets the carrier_settings_version of this Network.
def carrier_settings_version(self, carrier_settings_version): self._carrier_settings_version = carrier_settings_version
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_version(self, version: str) -> None:\n if self.current_version == version:\n return\n self.current_version = version\n self._del_cached_property(\"version\")", "def set_os_version(self, nVmOsVersion):\n\t\tcall_sdk_function('PrlVmCfg_SetOsVersion', self.handle, nVmOsVersio...
[ "0.5824551", "0.57495904", "0.5720873", "0.57051086", "0.57051086", "0.57051086", "0.57051086", "0.57051086", "0.57051086", "0.57051086", "0.57051086", "0.57051086", "0.57051086", "0.57051086", "0.57051086", "0.57051086", "0.57051086", "0.57051086", "0.57051086", "0.57051086", ...
0.87969404
0
Sets the current_mobile_country_code of this Network.
def current_mobile_country_code(self, current_mobile_country_code): self._current_mobile_country_code = current_mobile_country_code
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_mobile_network_code(self, current_mobile_network_code):\n\n self._current_mobile_network_code = current_mobile_network_code", "def home_mobile_country_code(self, home_mobile_country_code):\n\n self._home_mobile_country_code = home_mobile_country_code", "def country_code(self, country_...
[ "0.75514936", "0.7182278", "0.6717251", "0.6359026", "0.593765", "0.5569723", "0.5569723", "0.5569723", "0.5569723", "0.5569723", "0.5498544", "0.5447177", "0.536674", "0.536674", "0.53656566", "0.53653145", "0.53653145", "0.513803", "0.513803", "0.513803", "0.513803", "0.5...
0.8659426
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, Network): return False return self.to_dict() == other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): if not isinstance(other, Network): return True return self.to_dict() != other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.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.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", ...
0.0
-1
Performs the dot product test of the operator
def dottest(self,add=False): # Create random model and data m = np.random.rand(self.__nm).astype('float32') mh = np.zeros(self.__nm,dtype='float32') d = np.random.rand(self.__nd).astype('float32') dh = np.zeros(self.__nd,dtype='float32') if(add): self.forward(True,m ,dh) self.adjo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dotproduct(x, y):\n return sum(imap(operator.mul, x, y))", "def test_dot():\n assert_equal(dot(Vector(3.0, 2.0), Vector(2.0, -1.0)), 4.0)", "def dotTest(self, verbose=False, tol=1e-4):\n \n def _testing(add, dt1, dt2, tol, verbose=False):\n if isinstance(dt2, np.complex):\n ...
[ "0.69024014", "0.68140763", "0.68031317", "0.676828", "0.67511", "0.6713871", "0.6648119", "0.65855217", "0.65703064", "0.65469015", "0.6541166", "0.653501", "0.6533239", "0.6471148", "0.64683616", "0.6450868", "0.6417883", "0.64006025", "0.63975275", "0.6376887", "0.63654643...
0.63216424
22
Return True if number is Prime, returns False otherwise
def prime_checker(num): if num <= 0: return "Error: num must be a positive nonzero integer" elif num <= 3: return num > 1 elif num % 2 == 0 or num % 3 == 0: return False else: k = 5 while k * k < num: if (num % k == 0) or (num % (k+2) == 0): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isprime(number: int) -> bool:\n for i in range(2, int(number ** 0.5) + 1):\n if number % i == 0:\n return False\n return True", "def is_prime(number):\n\t\n\tif number < 2: return False\n\telif number == 2: return True\n\telif number % 2 == 0: return False\n\telse:\n\t\tfor x in range...
[ "0.8324353", "0.82894903", "0.8287755", "0.8254705", "0.82238996", "0.8218619", "0.8216518", "0.82014275", "0.8184489", "0.81208134", "0.8108795", "0.81040025", "0.81014293", "0.809502", "0.8062484", "0.80597156", "0.80333364", "0.8023087", "0.80171406", "0.8012948", "0.80119...
0.0
-1
Returns the bytes of the newly created Lua precompiled script If is set, prepend a Lua header
def export(self, root=False): out = [] if root: out.append(b'\x1bLuaQ\x00\x01\x04\x08\x04\x08\x00') out.append(b"\x00" * 0x10) out.append(struct.pack("BBBB", self.nb_upvalues, self.nb_params, self.is_vararg, self.max_stacksize)) out.append(struct.pack("<I", self.nb_in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_cfile_head(self):\n head = \"\"\"#include <stdio.h>\n#include <stdlib.h>\n#include <time.h>\n#include \"../init_array_lib/init_dyn_array.h\"\n#include \"../pips_lib/define_script.h\"\n\n\nint main(int argc, const char* argv[])\n{\n srand(time(NULL));\n \"\"\"\n\n self.append_text...
[ "0.5740971", "0.56519836", "0.5596711", "0.5559799", "0.54937595", "0.5361915", "0.5309566", "0.5284", "0.52791834", "0.52038765", "0.51887095", "0.51740164", "0.51268655", "0.5124086", "0.5108427", "0.50826967", "0.5069326", "0.50397694", "0.503007", "0.5003297", "0.50006205...
0.0
-1
Similar to funcy's walk_values, but does so recursively, including mapping f over lists.
def walk_values_rec(f, coll): if is_mapping(coll): return f(walk_values(walk_values_rec(f), coll)) elif is_list(coll): return f(list(map(walk_values_rec(f), coll))) else: return f(coll)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def map_leaf_values(f, value):\n if isinstance(value, list):\n return map(lambda x: map_leaf_values(f, x), value)\n elif isinstance(value, dict):\n ret = {}\n for (dict_key, dict_value) in value.items():\n key = map_leaf_values(f, dict_key)\n value = map_leaf_values...
[ "0.6835669", "0.65501076", "0.64315075", "0.64061004", "0.63632864", "0.63422924", "0.62596405", "0.62184924", "0.6192604", "0.61345893", "0.6108685", "0.60270596", "0.5974672", "0.5957392", "0.5901332", "0.5897045", "0.58449996", "0.5798345", "0.57810193", "0.57624316", "0.5...
0.7711836
0
Get all paths that satisfy the predicate fn pred. First gets all paths and then filters them based on pred.
def get_only_paths(coll, pred, prefix_path=(), stop_at=None, stop_below=None): all_paths = get_all_paths(coll, prefix_path=prefix_path, stop_at=stop_at, stop_below=stop_below) return list(filter(pred, all_paths))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find(self, predicate):\n return [d for d in self.iter_tree if predicate(d)]", "def filter(self, fn: Callable[[Tuple[K, List[V]]], bool]) -> Iterator[Tuple[K, List[V]]]:\n return (entry for entry in iter(self) if fn(entry))", "def filter(pred):\n def _filter_xducer(step):\n def _filt...
[ "0.58912474", "0.5614927", "0.5588043", "0.55599666", "0.5515684", "0.5437235", "0.5294925", "0.5270902", "0.5248339", "0.52460486", "0.52391595", "0.5229164", "0.5229164", "0.52200574", "0.5179738", "0.51675797", "0.51408434", "0.511593", "0.5087934", "0.5060589", "0.5051039...
0.766953
0
Verifies that emails used for registration do not already exist in the system.
def validate_email(self, email_field): user = User.query.filter_by(email=email_field.data).first() if user: if user.email: current_app.logger.error('{} tried to register user with email {} but user already exists.'.format( user.email, email_field.data)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_already_registered_email_validation(self):\n\n main_page = pages.mainpage.MainPage(self.driver)\n main_page.click_sign_in_button()\n \n sign_in_page = pages.signinpage.SignInPage(self.driver)\n sign_in_page.enter_create_account_email_addres('test@test.test')\n sig...
[ "0.75320035", "0.7509098", "0.7423442", "0.73514503", "0.73245853", "0.72490704", "0.7067881", "0.70219", "0.7013615", "0.69796586", "0.6883644", "0.687144", "0.68452424", "0.6785827", "0.6784702", "0.67555803", "0.67275876", "0.6706148", "0.668442", "0.6668196", "0.665997", ...
0.62377894
64
Used to verify that password meets security criteria.
def validate_password(self, password_field): if len(password_field.data) < 8: raise ValidationError('Your password must be 8 or more characters') has_num = False has_capital = False for i in password_field.data: if i.isdigit(): has_num = True ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_password(self, password):\n return check_password_hash(self.password_hash, password)", "def _check_password(self, body):\n if not self.config.security_initialize:\n raise RuntimeError(\"First set a password\")\n\n password = hash_password(body[ATTR_PASSWORD])\n if pa...
[ "0.8094068", "0.8023478", "0.79991645", "0.7997635", "0.79468477", "0.7942166", "0.7920561", "0.79031956", "0.78346103", "0.78028333", "0.7768781", "0.76980144", "0.7672169", "0.7667544", "0.766167", "0.766167", "0.766167", "0.766167", "0.766167", "0.766167", "0.766167", "0...
0.0
-1
Verifies that emails used for registration do not already exist in the system.
def validate_email(self, email_field): if User.query.filter_by(email=email_field.data).first(): raise ValidationError('An account with this email address already exists') return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_already_registered_email_validation(self):\n\n main_page = pages.mainpage.MainPage(self.driver)\n main_page.click_sign_in_button()\n \n sign_in_page = pages.signinpage.SignInPage(self.driver)\n sign_in_page.enter_create_account_email_addres('test@test.test')\n sig...
[ "0.75320035", "0.7509098", "0.7423442", "0.73514503", "0.73245853", "0.72490704", "0.7067881", "0.70219", "0.7013615", "0.69796586", "0.6883644", "0.687144", "0.68452424", "0.6785827", "0.6784702", "0.67555803", "0.67275876", "0.6706148", "0.668442", "0.6668196", "0.665997", ...
0.62950325
55
Does the mathematical operation sigmoid of param x
def sigmoid(x): return 1 / (1 + m.exp(-x))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sigmoid(x):\n return 1 / (1 + exp(-x))", "def sigmoid(x):\n return 1 / (1 + exp(-x))", "def sigmoid(x):\r\n\r\n return 1 / (1 + np.exp(-x))", "def sigmoid(x):\r\n return 1 / (1 + np.exp(-x))", "def sigmoid(x):\n return 1 / (1 + math.exp(-x))", "def sigmoid(x):\n\n return 1 / (1 + math...
[ "0.89131176", "0.89131176", "0.8848284", "0.8844675", "0.88111484", "0.88030547", "0.88030547", "0.8796431", "0.879332", "0.87928", "0.8783767", "0.87791777", "0.8758823", "0.8758823", "0.8758823", "0.8758823", "0.8758823", "0.8758823", "0.87582564", "0.8748229", "0.87373173"...
0.8975717
0
Calculate funtion Calculates activation for each neuron in the row
def calc(self): for neuron in self.neurons.items(): neuron.calculate()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_activation(self):\r\n\r\n x=0\r\n edges=self.in_edges\r\n for edge in edges:\r\n x+= edge.source.activation*edge.weight\r\n self.activation=1/(1+exp(-x))", "def activation(x):\n # return np.tanh(x)\n return np.maximum(0,x)", "def activation_function(X):\n\tz...
[ "0.7508421", "0.7192541", "0.6914692", "0.6874679", "0.6874679", "0.68145347", "0.6747684", "0.67097825", "0.6688922", "0.6644365", "0.6611161", "0.66051877", "0.66035444", "0.65753466", "0.6522521", "0.6515267", "0.6514489", "0.6512711", "0.65074676", "0.6489272", "0.6479981...
0.6044962
64
Returns just filename with or without extension from the full path.
def path2name(path, slash="/", hid_char=".", extension=False): if extension is True: return str(path.split(slash)[-1].strip(hid_char)) else: return str(path.split(slash)[-1].strip(hid_char).split(".")[0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_file_name_with_ext(path: str) -> str:\n return os.path.basename(path)", "def get_file_name(path: str) -> str:\n return os.path.splitext(os.path.basename(path))[0]", "def get_filename(path):\n return path.split('/')[-1]", "def get_fileext(file_path):\n\n # Get rid of directories and etc\n ...
[ "0.8166714", "0.7787711", "0.77349335", "0.7718269", "0.7702644", "0.7674369", "0.7673921", "0.7666838", "0.7651945", "0.7629352", "0.7610525", "0.7599016", "0.75293034", "0.75200695", "0.75085855", "0.7477795", "0.7470729", "0.7462713", "0.7410326", "0.74050814", "0.7403718"...
0.66333425
100
return an iterator that will iterate over records in a given file. each record is returned as a list of lines
def getMissedRecordIterator(taskType,records,infile): # get generator method by task type generator=missedRecordGenerator.get(taskType,reBasedRecordGenerator) # call generator to get iterator generator(taskType,records,infile)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fileStreamer(self, filePath):\n\t\tfor line in open(filePath):\n\t\t\tyield line", "def read_lines(fp: TextIO) -> Iterator[str]:\n while line := fp.readline().strip():\n yield line", "def read_lines(filename):\n with file(filename) as f:\n for line in f:\n _line = line.strip(...
[ "0.723143", "0.6980368", "0.6928537", "0.68619937", "0.68575156", "0.68504083", "0.6848712", "0.6846169", "0.6834265", "0.6832111", "0.6811981", "0.68009275", "0.67837363", "0.67457247", "0.66707927", "0.6632928", "0.6579308", "0.6555346", "0.65524304", "0.6551592", "0.654425...
0.0
-1
updates the public instance attribute updated_at with the current datetime.
def save(self): self.updated_at = datetime.now() storage.save()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updated_at(self, updated_at: \"datetime\"):\n self._attrs[\"updatedAt\"] = updated_at", "def updated_at(self, updated_at: \"datetime\"):\n self._attrs[\"updatedAt\"] = updated_at", "def updated_at(self, updated_at: \"datetime\"):\n self._attrs[\"updatedAt\"] = updated_at", "def updat...
[ "0.8297064", "0.8297064", "0.8297064", "0.7899627", "0.7899627", "0.7899627", "0.7899627", "0.7899627", "0.7899627", "0.7899627", "0.7899627", "0.7899627", "0.7899627", "0.7741202", "0.7624038", "0.7587348", "0.74332345", "0.74332345", "0.74332345", "0.74268264", "0.74268264"...
0.6132821
94
returns a dictionary containing all keys/values of __dict__ of the instance
def to_dict(self): str_dict = self.__dict__.copy() str_dict["__class__"] = self.__class__.__name__ str_dict["created_at"] = self.created_at.isoformat() str_dict["updated_at"] = self.updated_at.isoformat() return str_dict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_dict(self):\n return {k: v for k, v in vars(self).items()}", "def dict(cls):\n if cls._dict is None:\n cls._dict = {attr: getattr(cls, attr) for attr in cls.keys()}\n return cls._dict", "def as_dict(self):\n return self.__dict__", "def attributes(self):\n return d...
[ "0.8071886", "0.80406255", "0.80328685", "0.8028978", "0.80134267", "0.80134267", "0.80134267", "0.80134267", "0.80134267", "0.80134267", "0.80134267", "0.7946372", "0.7856889", "0.7856648", "0.78149813", "0.77974623", "0.779462", "0.77706295", "0.7718883", "0.7703186", "0.77...
0.0
-1
Simulate a tetrahedron made out of 4 ebnt wire triangles. To transform a list of points, create a rotation_matrix (defined in transformations.py),
def tetrahedron(length=40.0, r=3.175 / 2): t_pts, o_pts = triangle(length, r) # todo: find proper rotation matrix to make tetrahedron. t3 = polyline_to_3D(t_pts) o3 = polyline_to_3D(o_pts) sideIter = takeNGenerator(o_pts.simplified().points, 2) sides = [(t3, o3)] for side in sideIter: side3 = polyline_to_3D(Po...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_tetrahedron():\n obj = glGenLists(1)\n glNewList(obj, GL_COMPILE)\n glPushMatrix()\n try:\n glutSolidTetrahedron()\n except:\n if not _ERRS[5]:\n printGLError(\n \"la version actual de OpenGL no posee la funcion glutSolidTetrahedron\")\n _ERR...
[ "0.6605458", "0.636742", "0.62838066", "0.6187469", "0.6167494", "0.6153674", "0.613946", "0.6077823", "0.6048186", "0.604122", "0.59904253", "0.59671134", "0.59339255", "0.587405", "0.5851065", "0.57919925", "0.5787562", "0.5779007", "0.5775938", "0.5772443", "0.5737264", ...
0.63756156
1
returns a generator of all subsequences of length n in the list, in order.
def takeNGenerator(seq, n): index = 0 while index + n <= len(seq): yield seq[index:index + n] index = index + 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_by_n(seq, n):\n while seq:\n yield seq[:n]\n seq = seq[n:]", "def iter_n(sequence: Sequence[T], n: int) -> List[T]:\n\t\n\tfor i in range(len(sequence) - (n-1)):\n\t\tyield sequence[i:i+n]", "def split_by_n( seq, n ):\n while seq:\n yield seq[:n]\n seq = ...
[ "0.7532438", "0.747377", "0.7448144", "0.7033229", "0.70130324", "0.68090546", "0.6761082", "0.6734165", "0.6728467", "0.6728467", "0.67268085", "0.6724893", "0.6708959", "0.6707084", "0.6704036", "0.6702462", "0.6702462", "0.670244", "0.66995776", "0.66995776", "0.66995776",...
0.7431545
3
Splitting dataframe into training and test set for selecting the model
def splitting_df(dataframe): dataframe = dataframe.dropna() index = 100 train_set = dataframe.iloc[:index] test_set = dataframe.iloc[index:] return train_set, test_set, dataframe
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_test_split(df):\n training_size = int(len(df) * .67)\n test_size = int(len(df) - training_size)\n train, test = df[0:training_size], df[training_size:len(df)]\n return train, test", "def split_data(df: pd.DataFrame):\n size = int(df.shape[0] * 0.8)\n indexes = np.random.choice(df.inde...
[ "0.7638615", "0.7587735", "0.7582882", "0.74526", "0.7408693", "0.7361765", "0.7346422", "0.7338608", "0.73139936", "0.72734904", "0.72582716", "0.71744806", "0.71277773", "0.7011699", "0.69551307", "0.6950113", "0.69354945", "0.6922527", "0.6918691", "0.6875654", "0.68753266...
0.7225979
11
Computes the accuracy on the given batch of predictions
def batch_accuracy(labels, predictions, weights, name=None): with tf.name_scope(name, 'batch_accuracy', [labels, predictions, weights]): weights_mean = tf.reduce_mean(weights) accuracy_batch = tf.reduce_mean( tf.divide( tf.to_float(tf.equal(labels, predictions)) * weight...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accuracy(predictions, targets):\n return accuracy", "def accuracy(predictions, targets):\n\n ########################\n # PUT YOUR CODE HERE #\n #######################\n n_samples = targets.shape[0]\n _, y_pred = predictions.max(dim=1)\n accuracy = (y_pred == targets).sum().item() / n_samples\n #...
[ "0.79902244", "0.7934165", "0.7865013", "0.7844088", "0.7807453", "0.7767435", "0.7745531", "0.77343833", "0.77283275", "0.7708016", "0.7708016", "0.76890004", "0.7659078", "0.7653637", "0.7622236", "0.7609113", "0.7607177", "0.7551928", "0.7536903", "0.7501754", "0.7496515",...
0.7356364
35
Return JSON representation of a file
def to_json_string(my_obj): obj = j.dumps(my_obj) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_file(file):\n with open(file) as data_file:\n return json.load(data_file)", "def read_json_file(self, fname):\n return {}", "def get_json(filename) :\n result = json.load(open(filename,'r'))\n return result", "def parse_files(files):\r\n return json.dumps(files.split()...
[ "0.7441481", "0.7413895", "0.7365258", "0.7362204", "0.71942586", "0.7185419", "0.7154442", "0.7080278", "0.69222635", "0.69013035", "0.67946815", "0.6783969", "0.67625594", "0.67625594", "0.6758317", "0.67575884", "0.6747577", "0.67304564", "0.6716846", "0.66916776", "0.6667...
0.0
-1
Sets the starting player
def sort_player(self, player): if not player: return random.choice(self.players) return player
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_first_player(self):\n if self.player2.won_previous:\n self.current_player = self.player2\n else: self.current_player = self.player1", "def setCurrentPlayer(self):\n self.current_player = next(self.get_player_order_fn())", "def set_player(self, new_player):\n self....
[ "0.75605375", "0.7314304", "0.72100085", "0.70760864", "0.70383465", "0.69941014", "0.69805706", "0.68357134", "0.68007314", "0.67199373", "0.6690114", "0.661817", "0.65881526", "0.655607", "0.6553688", "0.65519774", "0.6541512", "0.65349615", "0.6519828", "0.64760214", "0.64...
0.0
-1
Returns the percentage of uncertainty reduction by the stimulus prediction.
def calc_uncertainty_reduction(trains_a, trains_b, metric, z, tau): return calc_mutual_information(calc_probability_matrix( trains_a, trains_b, metric, tau, z)) / calc_stimuli_entropy()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mape(self) -> float:\n return float(np.mean(np.abs((self.true - self.predicted) / self.true)) * 100)", "def rmdspe(self) -> float:\n return float(np.sqrt(np.median(np.square(self._percentage_error()))) * 100.0)", "def percent_accuracy(self, test_set, predicted_values):\r\n\r\n correct ...
[ "0.69722545", "0.6931428", "0.6875434", "0.68467116", "0.6761176", "0.6761176", "0.6761015", "0.6646365", "0.6573585", "0.65165967", "0.6513019", "0.650552", "0.6488078", "0.6484404", "0.6466145", "0.64660054", "0.64485806", "0.6439387", "0.64278936", "0.6405042", "0.63699096...
0.0
-1
Returns the next element in the iteration without advancing the iterator.
def peek(self): return self.next_val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __next__(self):\n return next(self.iterator)", "def __next__(self):\n return next(self.iter)", "def __next__(self):\n\t\tif self.i >= len(self.l):\n\t\t\tself.i = 0\n\t\t\traise StopIteration\n\t\tresult = self.l[self.i]\n\t\tself.i += 1\n\t\treturn result", "def __next__(self):\n if...
[ "0.794775", "0.7844546", "0.77520233", "0.77018774", "0.7683268", "0.76663107", "0.76579", "0.76458085", "0.7600991", "0.7565993", "0.7555897", "0.7524951", "0.75006497", "0.75006497", "0.74555266", "0.741625", "0.7375549", "0.73719597", "0.7362884", "0.7346874", "0.7346874",...
0.0
-1
checks if for all items of an iterable sequence (list, tuple, etc.) a least common dtype exists to which all items can be safely be casted.
def check_iterable_item_type(first_item,iter_obj): if ( operator.length_hint(first_item) > 1 or ( operator.length_hint(first_item) == 1 and not isinstance(first_item,(str,bytes)) ) or np.ndim(first_item) != 0 ): return None dtype = np.dtype(first_item.__class__) if dtyp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checktypestest(chosen_df):\n for i in chosen_df:\n if not chosen_df.dtypes[1] == chosen_df.dtypes[i]:\n raise ValueError('Types do not match')", "def _is_iterable(items):\n return isinstance(items, (list, tuple, set, np.ndarray))", "def _check_dtype(self):\n\n # assert valid ...
[ "0.6362347", "0.6343529", "0.62670493", "0.61364025", "0.604948", "0.60003525", "0.5951121", "0.59251696", "0.59064656", "0.58969873", "0.5886752", "0.5865586", "0.5847587", "0.5837936", "0.58233356", "0.58031726", "0.57854974", "0.5770386", "0.5718282", "0.57134825", "0.5699...
0.6867192
0
Creates a dataset or group for setlike objects.
def create_setlike_dataset(py_obj,h_group,name,**kwargs): # set objects do not support indexing thus determination of item dtype has to # be handled specially. Call create_listlike_dataset for proper creation # of corresponding dataset if not py_obj: # dump empty set return h_group.crea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create(setup_teardown_file):\n f = setup_teardown_file[3]\n grp = f.create_group(\"test\")\n\n dset = grp.require_dataset('foo', (10, 3), 'f')\n assert isinstance(dset, Dataset)\n assert dset.shape == (10, 3)\n\n dset2 = grp.require_dataset('bar', data=(3, 10))\n dset3 = grp.require_d...
[ "0.7293513", "0.6944663", "0.68141973", "0.67504334", "0.6663288", "0.66492665", "0.6386901", "0.6369093", "0.6327021", "0.62965447", "0.6215188", "0.6212039", "0.6188282", "0.618563", "0.6178783", "0.60782236", "0.6078073", "0.60116506", "0.5993186", "0.5990595", "0.5959553"...
0.78888154
0
Test that concatenation incompatible BDFHeaders raises an error.
def test_concatenate_errors(self): header = BDFHeader.from_path(TestData.bdf_2048) header2 = BDFHeader.from_path(TestData.bdf_256) with pytest.raises(ValueError): header.concatenate(header2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_concatenate(self):\n header = BDFHeader.from_path(TestData.bdf_256)\n header2 = BDFHeader.from_path(TestData.bdf_256)\n assert header.nb_data_records == 60\n assert header.data_duration == 1\n assert header2.nb_data_records == 60\n assert header2.data_duration == ...
[ "0.6942362", "0.6769108", "0.66527015", "0.6559913", "0.65270996", "0.6523384", "0.64484555", "0.64477885", "0.6425812", "0.6408705", "0.6387548", "0.6293834", "0.6290951", "0.6230164", "0.6216027", "0.6194131", "0.6190126", "0.61479235", "0.6133429", "0.61012334", "0.6099877...
0.8221753
0
Returns a shifted version of this waveform.
def shift_by(self, xshift): return Waveform(self.xvec + xshift, self.yvec, self.xtol, order=self.order, ext=self.ext)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shift(self):\n return self._shift", "def shifted(self, shift):\n new_location = None if self.location is None else self.location + shift\n reference = None if self.reference is None else self.reference + shift\n return self.copy_with_changes(\n location=new_location, re...
[ "0.70573044", "0.68794996", "0.67823905", "0.6607027", "0.6580733", "0.6546684", "0.65308696", "0.6385998", "0.63854915", "0.63047343", "0.6260316", "0.62372833", "0.620768", "0.6188425", "0.6046912", "0.5993672", "0.59832287", "0.5950894", "0.5915576", "0.5869959", "0.586502...
0.7225545
0
Returns the X value at which this waveform crosses the given threshold.
def get_crossing(self, threshold, start=None, stop=None, n=1, edge='both'): xval_list = self.get_all_crossings(threshold, start=start, stop=stop, edge=edge) if len(xval_list) < n: return None return xval_list[n - 1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def soft_threshold(X, threshold):\n X_thresholded = (np.abs(X) > threshold).astype('int')\n X_soft_threshold = np.sign(X) * (np.abs(X) - threshold) * X_thresholded\n return X_soft_threshold", "def threshold(self) -> pulumi.Input[float]:\n return pulumi.get(self, \"threshold\")", "de...
[ "0.63141197", "0.6267766", "0.6267766", "0.6267766", "0.6267766", "0.6267766", "0.6052995", "0.6004842", "0.5958804", "0.59584147", "0.59584147", "0.594345", "0.5942724", "0.58972937", "0.58845794", "0.5850298", "0.58501846", "0.58430636", "0.5794639", "0.5761636", "0.5761636...
0.6182369
6
Returns the X and Y arrays representing this waveform.
def to_arrays(self, xmin=None, xmax=None): sidx = 0 if xmin is None else np.searchsorted(self.xvec, [xmin])[0] eidx = len(self.xvec) if xmax is None else np.searchsorted(self.xvec, [xmax])[0] if eidx < len(self.xvec) and self.xvec[eidx] == xmax: eidx += 1 xtemp = self.xvec[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def array(self):\n return np.array([self.w, self.x, self.y, self.z])", "def get_dataset(self):\n return self._X, self._y", "def np(self):\n return np.array([self.x, self.y])", "def get_data(self):\n return self.X_train, self.X_test, self.y_train, self.y_test", "def points(self):...
[ "0.7363212", "0.7266499", "0.72189385", "0.69336814", "0.6890735", "0.6877929", "0.68748236", "0.6873088", "0.6859353", "0.6856248", "0.6796392", "0.6784848", "0.67333937", "0.67246", "0.67090386", "0.6689536", "0.66541594", "0.6628827", "0.653957", "0.6525675", "0.65222037",...
0.0
-1
Select function takes a row as a list and a column name and returns the date in that column.
def select_date(self, rows: List[Row], column: DateColumn) -> Date: dates: List[Date] = [] for row in rows: cell_value = row.values[column.name] if isinstance(cell_value, Date): dates.append(cell_value) return dates[0] if dates else Date(-1, -1, -1) # ty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select (a_data,a_column) :\n return a_data[a_column]", "def to_column(col):\n if callable(col):\n return col\n\n def fn(model, dates):\n return model[col + \":dates\"].loc[dates]\n\n return fn", "def get_date():\n temp = pd.read_sql_query(_query['date'], connect())\n return ...
[ "0.64095426", "0.5910437", "0.5812094", "0.577219", "0.57420665", "0.56979394", "0.5663", "0.557336", "0.54978937", "0.54614013", "0.5435102", "0.54271084", "0.5343865", "0.5339443", "0.5339443", "0.53258955", "0.53258955", "0.5315905", "0.52771246", "0.5244023", "0.52343035"...
0.72989994
0
Takes a row and a column and returns a list of rows from the full set of rows that contain the same value under the given column as the given row.
def same_as(self, rows: List[Row], column: Column) -> List[Row]: return_list: List[Row] = [] if not rows: return return_list cell_value = rows[0].values[column.name] for table_row in self.table_data: new_cell_value = table_row.values[column.name] if ne...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_column(col, row):\n return col == column", "def contains_row(matrix, row):\n return (matrix == row).all(axis=1).any()", "def find_twice_in_row_cols(row,item):\n results = [item]\n for i in range(9):\n if item in row[i]:\n results.append(i)\n return results", "d...
[ "0.62868875", "0.62431186", "0.62410134", "0.61804324", "0.6039535", "0.6029036", "0.60096765", "0.5946368", "0.5907833", "0.5806139", "0.5640903", "0.5634834", "0.5626018", "0.5624631", "0.5616684", "0.5552495", "0.55122364", "0.5482484", "0.5468303", "0.5461566", "0.5460028...
0.6885463
0
Takes an expression that evaluates to a single row, and returns the row that occurs before the input row in the original set of rows. If the input row happens to be the top row, we will return an empty list.
def previous(self, rows: List[Row]) -> List[Row]: if not rows: return [] input_row_index = self._get_row_index(rows[0]) if input_row_index > 0: return [self.table_data[input_row_index - 1]] return []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __find_immediate_predecessors(storm_object_table, target_row):\n\n error_checking.assert_is_integer(target_row)\n error_checking.assert_is_geq(target_row, 0)\n error_checking.assert_is_less_than(\n target_row, len(storm_object_table.index)\n )\n\n predecessor_sec_id_strings = [\n s...
[ "0.60980666", "0.5759736", "0.5662903", "0.555074", "0.55055183", "0.5382356", "0.5318377", "0.5304695", "0.5299359", "0.5293577", "0.5258907", "0.525828", "0.5255998", "0.5253842", "0.5205088", "0.51679647", "0.5138992", "0.5135898", "0.51252824", "0.5119567", "0.5104057", ...
0.6535429
0
Takes an expression that evaluates to a single row, and returns the row that occurs after the input row in the original set of rows. If the input row happens to be the last row, we will return an empty list.
def next(self, rows: List[Row]) -> List[Row]: if not rows: return [] input_row_index = self._get_row_index(rows[0]) if input_row_index < len(self.table_data) - 1 and input_row_index != -1: return [self.table_data[input_row_index + 1]] return []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last(self, rows: List[Row]) -> List[Row]:\n if not rows:\n logger.warning(\"Trying to get last row from an empty list\")\n return []\n return [rows[-1]]", "def previous(self, rows: List[Row]) -> List[Row]:\n if not rows:\n return []\n input_row_ind...
[ "0.6032308", "0.5938329", "0.54547274", "0.53779274", "0.5222563", "0.5210325", "0.5177654", "0.51763713", "0.51762176", "0.51662195", "0.51235795", "0.50886416", "0.5066228", "0.5066197", "0.5050721", "0.50220096", "0.50119585", "0.49934322", "0.49829265", "0.49711132", "0.4...
0.5954463
1
Takes a list of rows and a column and returns a list containing a single row (dict from columns to cells) that has the minimum numerical value in the given column. We return a list instead of a single dict to be consistent with the return type of ``select`` and ``all_rows``.
def argmin(self, rows: List[Row], column: ComparableColumn) -> List[Row]: if not rows: return [] value_row_pairs = [(row.values[column.name], row) for row in rows if row.values[column.name] is not None] if not value_row_pairs: return [] # Returns a list containing...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min_number(self, rows: List[Row], column: NumberColumn) -> Number:\n cell_values = [row.values[column.name] for row in rows if row.values[column.name] is not None]\n if not cell_values:\n return 0.0 # type: ignore\n if not all([isinstance(value, Number) for value in cell_values...
[ "0.75653225", "0.7539637", "0.6910616", "0.6830543", "0.66967833", "0.6549738", "0.64496356", "0.6391014", "0.6244352", "0.6130919", "0.6083585", "0.58972543", "0.58682424", "0.5853501", "0.5829412", "0.5822962", "0.5805565", "0.5800395", "0.57847565", "0.577833", "0.57663935...
0.8007047
0
Takes a list of rows and a column and returns the min of the values under that column in those rows.
def min_date(self, rows: List[Row], column: DateColumn) -> Date: cell_values = [row.values[column.name] for row in rows if row.values[column.name] is not None] if not cell_values: return Date(-1, -1, -1) if not all([isinstance(value, Date) for value in cell_values]): rais...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def argmin(self, rows: List[Row], column: ComparableColumn) -> List[Row]:\n if not rows:\n return []\n value_row_pairs = [(row.values[column.name], row) for row in rows if row.values[column.name] is not None]\n if not value_row_pairs:\n return []\n # Returns a list...
[ "0.7523535", "0.74018383", "0.7087411", "0.6939389", "0.67967975", "0.6786008", "0.67342144", "0.66141933", "0.65818274", "0.65026927", "0.648818", "0.6451681", "0.64404196", "0.636798", "0.63540655", "0.62884", "0.6276553", "0.6243605", "0.62028164", "0.61936027", "0.6181301...
0.629917
15
Takes a list of rows and a column and returns the min of the values under that column in those rows.
def min_number(self, rows: List[Row], column: NumberColumn) -> Number: cell_values = [row.values[column.name] for row in rows if row.values[column.name] is not None] if not cell_values: return 0.0 # type: ignore if not all([isinstance(value, Number) for value in cell_values]): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def argmin(self, rows: List[Row], column: ComparableColumn) -> List[Row]:\n if not rows:\n return []\n value_row_pairs = [(row.values[column.name], row) for row in rows if row.values[column.name] is not None]\n if not value_row_pairs:\n return []\n # Returns a list...
[ "0.75244665", "0.7399412", "0.70864445", "0.6938738", "0.6783435", "0.6732415", "0.6612353", "0.657953", "0.65019745", "0.6487431", "0.64490616", "0.6439465", "0.63666445", "0.6352567", "0.6297611", "0.62861377", "0.6275725", "0.624219", "0.6201092", "0.61909586", "0.6179357"...
0.679573
4
Draws All Buttons to GUI
def draw_buttons(): # DEFINE BUTTONS # ============== # Reset Button btn_reset = pygame.Rect(486, 651, 75, 30) # creates a rectangle object res_border = pygame.Rect(485, 650, 77, 32) # creates a rectangle object reset_txt = BTN_FONT.render('Reset', True, TEXTCOLOR) # render font glo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_buttons(self):\n for button in self.playing_buttons:\n button.draw(self.screen)", "def show_buttons(self):\n for button in self.buttons:\n x = button.starting_x\n y = button.starting_y\n self.screen.fill(button.color, ((x, y), (button.width, butt...
[ "0.8148419", "0.8043647", "0.7862937", "0.75703615", "0.7406315", "0.73479193", "0.7254064", "0.7142009", "0.70529723", "0.69970584", "0.6992408", "0.696211", "0.6854136", "0.68483263", "0.681257", "0.68122077", "0.6778881", "0.67738396", "0.6761473", "0.67216533", "0.6712798...
0.6459926
35
Returns the node with the minimum distance value that has not yet been added
def min_distance(distance, spt_set, self_nodes): minimum = sys.maxsize minimum_node = None for curr_node in self_nodes.values(): if distance[curr_node.id] < minimum and not spt_set[curr_node.id]: minimum = distance[curr_node.id] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_min(self):\n return min(self.nodes, key=int)", "def nodeAtMinimumDistance(self, notFoundYet, distances):\n # found minimal\n minimal = None\n for node in notFoundYet:\n if (distances[node] >= 0): \n if minimal == None or (distances[minimal] > distanc...
[ "0.78858924", "0.787231", "0.7753907", "0.7746355", "0.7600601", "0.74848473", "0.74233663", "0.73584545", "0.7117518", "0.70708716", "0.70418245", "0.7010514", "0.69857085", "0.6977521", "0.6963034", "0.69528985", "0.6935069", "0.6933698", "0.6920054", "0.6915494", "0.689716...
0.8087776
0
Given an index return an example from the position.
def __getitem__(self, item: int) -> Dict[str, torch.Tensor]: return { "inputs": self.inputs[item], "targets": self.targets[item], }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_item(self, index, rng=None):\n if index is None:\n rng = kwarray.ensure_rng(rng)\n index = rng.randint(0, self.n_samples)\n\n if index < self.n_positives:\n sample = self.get_positive(index, rng=rng)\n else:\n index = index - self.n_positives...
[ "0.687162", "0.68613625", "0.6797727", "0.6635945", "0.66340935", "0.66258556", "0.6469114", "0.6392246", "0.6353309", "0.63301975", "0.6330024", "0.6317322", "0.63113004", "0.629802", "0.6282028", "0.62789893", "0.6267358", "0.616299", "0.6149191", "0.61026996", "0.6092401",...
0.0
-1
Calculate the kinetic friction energy accumulation in W per m^2
def calc_e_akin(self, ui=None, res_dir=None): print_it("calculating e_a,kin") pv_local = np.multiply(self.sun.press.sum(1), self.rel_vel) self.sun.e_akin = np.absolute( np.divide(np.multiply(pv_local, self.sun.overroll_t_incr), self.sun.no_overroll_t)) / 10...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_ked_WFI(self):\n\n #Initialize kinetic energy density\n self.ked_WFI = np.zeros( (self.grid.Nelem, 1))\n\n #Figure out the number of occupied orbitals\n if self.m == 0:\n if self.pol == 1:\n Nocc = np.floor(self.N/2)\n nu = self.N / 2 - Nocc\n else:\n ...
[ "0.7126182", "0.7104277", "0.7098813", "0.6898806", "0.6850775", "0.6695181", "0.6694417", "0.6630467", "0.66192275", "0.65845263", "0.6557857", "0.6498804", "0.648682", "0.63695234", "0.6365874", "0.6348018", "0.6293771", "0.6192064", "0.6157473", "0.61543435", "0.6140866", ...
0.0
-1
Function to create the head of an HTML page.
def html_open(title="Bibliography", description=""): description_p = "".join(["""<p class="col-head__intro">""", description, \ """</p><!-- /.intro -->"""]) if len(description) > 0 else \ description return("".join(["""<!DOCTYPE html> <!--[if lte IE 8 ]> <html lang="en" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_head(css, title):\r\n doc = \"<!DOCTYPE html>\\n<html>\\n\"\r\n head = \"<head>\\n<title>\" + title + \"\\n</title>\" + css + \"</head>\\n\"\r\n header = doc + head + \"<body>\\n<h1>\" + title + \"\\n</h1>\\n<hr/>\\n\"\r\n return header", "def open_head(self) -> str:\n self.html_doc...
[ "0.7782793", "0.7599929", "0.7026214", "0.6854899", "0.6698826", "0.66224366", "0.66171515", "0.6499955", "0.6458969", "0.64198273", "0.6388665", "0.63801056", "0.6240883", "0.6218867", "0.6156001", "0.61453176", "0.6141499", "0.6121602", "0.6094304", "0.60518056", "0.6040031...
0.5776175
33
Get posts that are visible to the current user
def get(self): user_id = get_jwt_identity() user = find_user(user_id) args = pagination_parser.parse_args() to_id = args.get('to_id', None) if to_id: return poll_latest_posts_on_home(user, to_id), 200 from_id = args.get('from_id', None) return retriev...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def visible_posts_for(user):\n own = Post.objects.filter(author=user)\n public = Post.objects.filter(circles=PUBLIC_CIRCLE)\n my_circle = Post.objects.filter(circles__owner=user.pk)\n in_circle = Post.objects.filter(circles__members=user.pk)\n return own | public | my_circle | in_circle", "def get...
[ "0.81670207", "0.7655564", "0.67592925", "0.6730649", "0.6661472", "0.6491123", "0.62494636", "0.6184312", "0.6151358", "0.61494964", "0.61494964", "0.6137622", "0.61323327", "0.6113242", "0.60920924", "0.60774386", "0.60637724", "0.6035682", "0.599383", "0.5980113", "0.59709...
0.0
-1
boxes is classified as each class
def nms(bobj, cf_thresh, nms_thresh): bboxs = bobj["boxs"] scores = bobj["scores"] cfvalid_ids = np.where(scores >= cf_thresh)[0] if len(cfvalid_ids) == 0: return None, None bboxs = bobj["boxs"][cfvalid_ids] scores = scores[cfvalid_ids] ids = bobj["ids"][cfvalid_ids] masks = bobj...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _nms_boxes(self, boxes, scores):\n all_boxes = [[] for _ in range(self.num_classes)]\n # skip j = 0, because it's the background class\n for class_id in range(1, self.num_classes):\n # Whether to use only the top class for each box or\n # all classes over a certain th...
[ "0.6748143", "0.6706603", "0.65761703", "0.6505872", "0.64785993", "0.6463101", "0.6340289", "0.62898487", "0.62246555", "0.6217917", "0.621656", "0.621656", "0.621656", "0.6201196", "0.6196101", "0.6184682", "0.61672515", "0.6158482", "0.6108624", "0.6106724", "0.6099241", ...
0.0
-1
boxes is classified as each class
def nms_all_class(bound_corr_objs, nms_thresh): bboxs, scores, masks, labels = [], [], [], [] for obj in bound_corr_objs: bboxs.append(obj['box']) scores.append(obj['score']) # masks.append(obj['mask']) # labels.append(obj['label']) bboxs = np.asarray(bboxs) scores = np.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _nms_boxes(self, boxes, scores):\n all_boxes = [[] for _ in range(self.num_classes)]\n # skip j = 0, because it's the background class\n for class_id in range(1, self.num_classes):\n # Whether to use only the top class for each box or\n # all classes over a certain th...
[ "0.6746694", "0.67042625", "0.6574946", "0.650384", "0.6474119", "0.6462304", "0.6338391", "0.62925005", "0.6223383", "0.6216839", "0.6216839", "0.6216839", "0.6216638", "0.6197468", "0.6193416", "0.6181465", "0.6162474", "0.61557955", "0.61059815", "0.6103387", "0.6097034", ...
0.0
-1
Draw a line on the axes according to configuration. lcfg Line config ptree node. The ptree node should have a form of line.0. parent Parent axes object
def draw(cls, lcfg, parent): axes = parent.getAxes() props = {} line = None label = None idx = int(lcfg.key) for child in lcfg.children: key = child.key val = child.val if key == cls.XY: xvals = [] yvals ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _defLine(self):\n self._dline=GPath(points = [0,100,GAME_WIDTH,100], linewidth = 1.5,\n linecolor = 'cyan')", "def draw_shape_line(self, line, xform, colour):\n pts = [xform.chain(p) for p in (line.p1, line.p2)]\n self.canvas.line([(p.x, p.y) for p in pts], fill=colour)", "d...
[ "0.6225547", "0.6141533", "0.61045897", "0.600791", "0.6007842", "0.5936059", "0.5892966", "0.58667046", "0.5863274", "0.58571774", "0.58557117", "0.5844072", "0.584371", "0.5840684", "0.58211356", "0.5790988", "0.5788605", "0.5773601", "0.5761556", "0.5751793", "0.5739298", ...
0.73061675
0
returns True if elements are increasing in the list
def increasing(list_of_integers): for i in range(1, len(list_of_integers)): if list_of_integers[i - 1] > list_of_integers[i]: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_increasing(values):\n\n return all([i <= j for i, j in zip(values, values[1:])])", "def verify_increasing(seq):\n\n # https://stackoverflow.com/questions/24577688/compare-current-item-to-next-item-in-a-python-list\n\n for i, j in enumerate(seq[:-1]):\n if j >= seq[i + 1]:\n retu...
[ "0.75365275", "0.74925673", "0.7437871", "0.7341398", "0.73314816", "0.7152774", "0.70650816", "0.7060437", "0.6938094", "0.68970126", "0.6854094", "0.67911744", "0.67843443", "0.6645524", "0.6639718", "0.6618736", "0.6597812", "0.656644", "0.64711887", "0.6441244", "0.643506...
0.7917129
0
Backporting assert_allclose from Numpy 1.5 to 1.4
def assert_allclose(actual, desired, rtol=1e-7, atol=0, err_msg="", verbose=True): from numpy.testing.utils import assert_array_compare # @UnresolvedImport def compare(x, y): return np.allclose(x, y, rtol=rtol, atol=atol) actual, desired = np.asanyarray(actual), np.asanyarray(desi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assert_allclose(x, y, atol=1e-5, rtol=1e-4, verbose=True):\n try:\n #logging.warning(\"int8_outputis {} and fp32 output is {} \".format(x, y))\n np.testing.assert_allclose(\n x, y, atol=atol, rtol=rtol, verbose=verbose)\n return True\n except AssertionError as e:\n ...
[ "0.7790505", "0.76344216", "0.7608641", "0.72859603", "0.72088796", "0.68970716", "0.689204", "0.68787265", "0.6840159", "0.68233395", "0.67868304", "0.66912603", "0.6664636", "0.65971446", "0.65823704", "0.65746313", "0.65227747", "0.65197223", "0.64776856", "0.6448907", "0....
0.7302566
3
Compute area of a triangle given 3 points
def compute_triangle_area(triangle_points: np.ndarray) -> float: (x1, y1), (x2, y2), (x3, y3) = unpack_triangle_coordinates(triangle_points) # Pythagorean theorem l1 = sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2) l2 = sqrt((x2 - x3) ** 2 + (y2 - y3) ** 2) l3 = sqrt((x3 - x1) ** 2 + (y3 - y1) ** 2) # He...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _triangle_area_at_points(self, p1, p2, p3):\n a = sqrt((p1[0] - p2[0]) ** 2 + (p1[1] - p2[1]) ** 2)\n b = sqrt((p2[0] - p3[0]) ** 2 + (p2[1] - p3[1]) ** 2)\n c = sqrt((p1[0] - p3[0]) ** 2 + (p1[1] - p3[1]) ** 2)\n s = (a + b + c) / float(2)\n area = sqrt(s * (s - a) * (s - b)...
[ "0.85674906", "0.8521497", "0.8367698", "0.82647604", "0.8232608", "0.8184442", "0.8148324", "0.8110756", "0.80933315", "0.806593", "0.7962348", "0.7912458", "0.78917634", "0.78031754", "0.7793102", "0.77343196", "0.7730719", "0.77258563", "0.7697316", "0.75490457", "0.749381...
0.8155868
6
Yield successive nsized chunks from l.
def chunks(l, n): for i in range(0, len(l), n): yield l[i:i + n]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]", "def chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def get_chunks(self, ...
[ "0.80373776", "0.7923372", "0.7921526", "0.78832066", "0.78758025", "0.78139895", "0.77639675", "0.7753964", "0.7742553", "0.7730092", "0.7727218", "0.7723365", "0.7701169", "0.76873696", "0.76873696", "0.7662493", "0.765539", "0.7654256", "0.7654256", "0.76442516", "0.764425...
0.7536213
28
Converts an index (integer) in a token (string/unicode) using the vocab.
def _convert_id_to_token(self, index, return_unicode=True): token = self.sp_model.IdToPiece(index) return token
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _convert_id_to_token(self, index):\n return self.reverse_vocab.get(index, self.unk_token)", "def id_to_token(self, index):\r\n return self.decoder.get(index)", "def _convert_id_to_token(self, index):\n if index in self.fairseq_ids_to_tokens:\n return self.fairseq_ids_to_toke...
[ "0.76504004", "0.67995644", "0.6546384", "0.65350676", "0.6404568", "0.6375889", "0.6370274", "0.6370274", "0.6272747", "0.62470657", "0.6219838", "0.6162691", "0.6122522", "0.6113642", "0.6081953", "0.60777116", "0.60551715", "0.6027793", "0.6003488", "0.6001299", "0.5868207...
0.66577786
2
Return the name of the sensor.
def name(self): return f"{self.client_name} {self.variable}"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return self._sensor.name", "def get_sensor_name(self):\n return self.data[1]", "def name(self):\n return self.device.device_data[self.device_id]['name'] + \\\n f' {self._sensor_type}'", "def name(self):\n return f\"{self._name} {SENSOR_TYPES[self.senso...
[ "0.91896784", "0.9168378", "0.890185", "0.8770976", "0.8511273", "0.8479953", "0.844435", "0.8299758", "0.8186503", "0.8105667", "0.8079737", "0.8066149", "0.8049647", "0.7700968", "0.7612295", "0.7611456", "0.7600605", "0.7600605", "0.7600605", "0.75392073", "0.75166553", ...
0.0
-1
Return the unit of measurement of this entity, if any.
def unit_of_measurement(self): return SENSOR_TYPES[self.variable][1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unit_of_measurement(self):\n return self._metadata[1]", "def unit_of_measurement(self):\n return self._unit", "def unit_of_measurement(self):\n return self._unit", "def unit_of_measurement(self):\n return self._unit", "def unit_of_measurement(self):\n return self._uni...
[ "0.8565862", "0.8477338", "0.8477338", "0.8477338", "0.8477338", "0.8477338", "0.8477338", "0.8477338", "0.8473674", "0.845385", "0.845385", "0.845385", "0.845385", "0.845385", "0.845385", "0.845385", "0.845385", "0.845385", "0.845385", "0.845385", "0.845385", "0.845385", ...
0.7864599
57
Return the state attributes.
def extra_state_attributes(self): return { ATTR_ATTRIBUTION: ATTRIBUTION, ATTR_STATION: self.probe.get_data("station_name"), ATTR_UPDATED: self.probe.last_update.isoformat(), }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state_attributes(self):\n return self._attributes", "def state_attributes(self):\n return self._attributes", "def device_state_attributes(self):\r\n return self.attributes", "def device_state_attributes(self):\n return self._state_attrs", "def device_state_attributes(self):\...
[ "0.8953404", "0.8953404", "0.85239846", "0.8366765", "0.8366765", "0.8363429", "0.83362615", "0.8334551", "0.8310377", "0.8292682", "0.8289349", "0.8289349", "0.82871646", "0.82871646", "0.82871646", "0.82871646", "0.82871646", "0.82871646", "0.82871646", "0.82871646", "0.828...
0.7570609
66
Return the timestamp of the most recent data.
def last_update(self): date, time = self.data.get("update_date"), self.data.get("update_time") if date is not None and time is not None: return datetime.strptime(date + time, "%d-%m-%Y%H:%M").replace( tzinfo=VIENNA_TIME_ZONE )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_timestamp(self):\n return self._last_timestamp", "def last_timestamp(self):\n LOGGER.debug('Getting last_timestamp as: %s', self._last_timestamp)\n return self._last_timestamp", "def get_last_timestamp(self):\n return self._frame_timestamp", "def last_updated(self):\n ...
[ "0.76486593", "0.7364548", "0.7179991", "0.7173839", "0.7130857", "0.70484143", "0.70463294", "0.6992933", "0.69910926", "0.6957483", "0.6927991", "0.69162804", "0.69113654", "0.6870302", "0.6845708", "0.68390936", "0.6821002", "0.68018234", "0.6779948", "0.677855", "0.675511...
0.6285578
89
Map from level to values based on max_value.
def level_to_value(level, max_value): return (level / _MAX_LEVEL) * max_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_value_maxes(self):\n\n value_maxes = {name: 0 for name in self.group_names}\n\n data_to_ax = self.get_transform_func('data_to_ax')\n\n if self.plot == 'violinplot':\n value_maxes = self._get_value_maxes_violin(value_maxes, data_to_ax)\n\n else:\n for ...
[ "0.6779481", "0.661854", "0.6521915", "0.6355942", "0.6317978", "0.6265277", "0.6263087", "0.60138875", "0.59535027", "0.56714624", "0.56714624", "0.56714624", "0.56249654", "0.5619479", "0.5619479", "0.55993503", "0.55812144", "0.5558521", "0.55277836", "0.5520914", "0.55194...
0.7440842
0
Randomly negate value based on random_negative_prob.
def random_negative(value, random_negative_prob): return -value if np.random.rand() < random_negative_prob else value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def beta_gen_nonneg(p):\n return np.clip(np.random.normal(0, 3, p), 0, None)", "def randomly_negate_level(value: Any) -> Any:\n return -value if ImageTransformationBase._toss_fair_coin() else value", "def _sample_neg(self, assign_result, num_expected, **kwargs):\n neg_inds = torch.nonzero(assi...
[ "0.73109514", "0.72899586", "0.71196777", "0.68769", "0.6795558", "0.6721659", "0.6665848", "0.6632971", "0.64435655", "0.62850845", "0.6261009", "0.61856455", "0.61799836", "0.6109974", "0.60397655", "0.60113966", "0.59970397", "0.59902626", "0.5978632", "0.59776896", "0.597...
0.8853844
0
Instantiates Ability Objects for Pokemon created by the PokemonFactory.
def __add_expanded_abilities(self, name): loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) abilities = loop.run_until_complete(self.api.process_requests( "ability", name)) ability_list = [] factory = PokemonAbilityFactory(abilities, True) for abili...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def instantiate_pokemon(self\n , type:str\n , hp: int = 0\n , attack: int = 0\n , defense: int = 0\n , sp_atk: int = 0\n , sp_def: int = 0\n , speed: int = 0\n , level: int = 0\n ...
[ "0.6599456", "0.6198109", "0.5792694", "0.56491464", "0.5476171", "0.5426263", "0.5405217", "0.5305281", "0.5284343", "0.5241347", "0.52400786", "0.51918274", "0.5175356", "0.5154798", "0.5147674", "0.51380134", "0.513156", "0.5124926", "0.5121062", "0.5120388", "0.5118778", ...
0.545424
5
Gets the x of this Point2D.
def x(self): return self._x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def x(self):\n return _libsbml.Point_x(self)", "def get_x(self):\n return self.coords[0]", "def x(self):\n return self._coords[0]", "def x(self):\n return self.coords[0]", "def x(self):\n if self._x is None:\n self.compute_coordinates()\n return self._x"...
[ "0.8202853", "0.7964946", "0.7899306", "0.7832003", "0.77950877", "0.7770974", "0.7767594", "0.7655691", "0.75853753", "0.7541222", "0.7513232", "0.74670273", "0.74613774", "0.7420815", "0.74085504", "0.74006236", "0.7338587", "0.72459483", "0.72445965", "0.72348505", "0.7130...
0.6978998
45
Gets the y of this Point2D.
def y(self): return self._y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def y(self):\n return _libsbml.Point_y(self)", "def getY(self):\n return self.__y", "def get_y(self):\n return self.coords[1]", "def y(self):\n return self._coords[1]", "def getY(self):\n return self.y", "def getY(self):\n return self.y", "def getY(self):\r\n\t...
[ "0.83229166", "0.82235724", "0.82125914", "0.8158935", "0.8101928", "0.8101928", "0.8083137", "0.8040786", "0.8029575", "0.80111855", "0.7996456", "0.79616183", "0.79490346", "0.7942596", "0.792801", "0.7853457", "0.7839556", "0.77639574", "0.77575284", "0.7748724", "0.770901...
0.74073845
38
Sets the y of this Point2D.
def y(self, y): if y is None: raise ValueError("Invalid value for `y`, must not be `None`") # noqa: E501 self._y = y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetY(self, y):\r\n\r\n self._y = y", "def set_y(self, y):\n self._y = y", "def setY(self, y):\n self.y = y\n pass", "def setY(self, y):\r\n\t\tself._y=y", "def set_y(self, y: float):\n self.y = y", "def setY(self, y):\n self.position.setY(y)", "def set_y(se...
[ "0.8453378", "0.8452764", "0.84150106", "0.8326392", "0.825327", "0.8120081", "0.8114923", "0.80978614", "0.7752102", "0.7601844", "0.7427981", "0.7388533", "0.7356006", "0.7351102", "0.7351102", "0.72065663", "0.7160429", "0.7160429", "0.7140703", "0.70442504", "0.69907975",...
0.75235146
11
Return a bar chart that shows total amount paid for taxi rides by payment type for weekdays.
def draw_bar(df=data): pt = { 1: 'Credit card', 2: 'Cash', 3: 'No charge', 4: 'Dispute', 5: 'Unknown', 6: 'Voided trip', } df['payment_type'] = df['payment_type'].replace(pt) gr = df.groupby(['payment_type', 'weekday']) \ .agg(total_amount=('total_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def amount_total(path, file_type):\n final_frame = clean_kdr_data(path, file_type)\n amount_work = final_frame.groupby(\"Date\")[\"Place\"].count()\n amount_work = amount_work.to_frame()\n amount_work.columns = [\"Freq\"]\n\n # Dropping outlier data\n amount_work = amount_work.drop([\"2019-01-04\...
[ "0.54274887", "0.5399363", "0.532895", "0.5269458", "0.52669287", "0.526326", "0.520962", "0.5144436", "0.5111402", "0.51094276", "0.5091132", "0.5074277", "0.505586", "0.50367224", "0.50361025", "0.50286853", "0.500151", "0.4954292", "0.49293423", "0.4892176", "0.48813832", ...
0.7296597
0
Return a kpi card that shows total trip distance.
def kpi_card2(df=data): total = df['trip_distance'].sum().round() return [ html.H4('Total Trip Distance', className='card-title'), html.P(f'{int(total):,d}', className='card-value'), ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kpi_card1(df=data):\n total = len(df)\n return [\n html.H4('Total Trips', className='card-title'),\n html.P(f'{int(total):,d}', className='card-value'),\n ]", "def kpi_card4(df=data):\n total = df['passenger_count'].sum().round()\n return [\n html.H4('Total Passenger Amoun...
[ "0.6902948", "0.67450553", "0.6496759", "0.55972195", "0.54019475", "0.5264698", "0.5192559", "0.50993186", "0.50779825", "0.5046142", "0.50450855", "0.5006136", "0.49951693", "0.4979992", "0.49640006", "0.49563554", "0.49417576", "0.49336472", "0.49320427", "0.4930143", "0.4...
0.8057181
0
Path where the HDF5 file is located posixpath.dirname()
def file_path(self): return posixpath.dirname(self.file_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def working_directory(self):\n project_full_path = \"/\".join(self.file_name.split(\"/\")[:-1])\n file_name = self.file_name.split(\"/\")[-1]\n if \".h5\" in file_name:\n file_name = file_name.split(\".h5\")[0]\n file_name += \"_hdf5\"\n if self.h5_path[0] == \"/\":\n ...
[ "0.7998137", "0.79434365", "0.7897259", "0.78762734", "0.7342185", "0.69924957", "0.68913627", "0.67971563", "0.6705226", "0.669286", "0.66440845", "0.65817255", "0.6524634", "0.65175104", "0.65127057", "0.6463314", "0.6432335", "0.6418457", "0.6416585", "0.6412822", "0.63692...
0.72412133
5
Get a specific value from a pandas.Dataframe
def get_from_table(self, path, name): df_table = self.get(path) keys = df_table["Parameter"] if name in keys: job_id = keys.index(name) return df_table["Value"][job_id] raise ValueError("Unknown name: {0}".format(name))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, key):\n return self.df[key]", "def _get_value(self, value_column):\n pass", "def get(self, column_name, row_index):\n self.check_for_column(column_name)\n return self.data[column_name][row_index]", "def __getitem__(self, idx):\n return self.data.iloc[i...
[ "0.70596415", "0.65514344", "0.65166146", "0.6503485", "0.640726", "0.6406935", "0.6392975", "0.63324744", "0.6270443", "0.62415093", "0.6231693", "0.62117183", "0.6199969", "0.6198087", "0.6134324", "0.61122453", "0.6106325", "0.6095749", "0.6086242", "0.60455424", "0.602240...
0.5452858
79
The absolute path to of the current pyiron project absolute path on the file system, not including the HDF5 path.
def base_name(self): return self._project.path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path(self):\n return os.path.join(self._project.path, self.h5_path[1:]).replace(\"\\\\\", \"/\")", "def full_path(self):\n return os.path.abspath(self.path)", "def path(self):\n path = os.path.join(self.base_dir, self.store().replace(' ', '_'), self.package_name())\n return os.p...
[ "0.749917", "0.7469245", "0.746837", "0.74283326", "0.74239373", "0.74075603", "0.73930174", "0.73682487", "0.7350641", "0.7349053", "0.7340121", "0.7337939", "0.73337173", "0.733115", "0.7286074", "0.72558075", "0.72558075", "0.72309726", "0.72283375", "0.7200086", "0.717058...
0.0
-1
the relative path of the current project / folder starting from the root path of the pyiron user directory
def project_path(self): return self._project.project_path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def root_dir():\r\n return Path(__file__).parent.parent", "def get_project_root() -> pl.Path:\n return pl.Path(__file__).parent.parent", "def get_project_root():\n return Path(__file__).parent.parent", "def get_project_root():\n return str(Path(__file__).parent.parent)", "def get_project_root()...
[ "0.8077613", "0.79924023", "0.7989185", "0.79072905", "0.79072905", "0.78957456", "0.78957456", "0.78957456", "0.78957456", "0.7894728", "0.78666586", "0.78622246", "0.7831149", "0.7732454", "0.77062273", "0.7705708", "0.76734066", "0.76734066", "0.7659947", "0.75575066", "0....
0.6910063
73
Convert a batch of sentences to a list of text sentences.
def convert_to_text(batch, lengths, dico, params): batch = batch.cpu().numpy() lengths = lengths.cpu().numpy() slen, bs = batch.shape assert lengths.max() == slen and lengths.shape[0] == bs assert (batch[0] == params.eos_index).sum() == bs assert (batch == params.eos_index).sum() == 2 * bs ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _ticks_to_sentences(ticks):\n sentences = []\n\n for seq in ticks:\n sentence = []\n for i in range(seq.shape[0]):\n word = ''.join([str(x) for x in seq[i, :]])\n sentence.append(word)\n sentences.append(sentence)\n\n return se...
[ "0.7126118", "0.70990527", "0.70990527", "0.6939262", "0.68789613", "0.6865277", "0.685531", "0.6848978", "0.680459", "0.67145294", "0.6697414", "0.66851515", "0.667955", "0.66777897", "0.6654887", "0.6624871", "0.66241395", "0.6622438", "0.65980744", "0.65934867", "0.6570346...
0.6501711
28
Create parametric Weiner transfer function W.
def weiner_tf(H, K): W = (1 / H) * ((np.conjugate(H) * H) / ((np.conjugate(H) * H) + K)) return W
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _derW(self, w, x, y, z):\n raise NotImplementedError()", "def gen_tb_tb_weights(weight=1.):\r\n W = np.zeros([8, 8])\r\n sinusoid = -(np.cos(np.linspace(0, 2 * np.pi, 8, endpoint=False)) - 1) / 2\r\n for i in range(8):\r\n values = np.roll(sinusoid, i)\r\n W[i, :] = values\r\n ...
[ "0.68442386", "0.6284554", "0.6163431", "0.6146897", "0.6098888", "0.6081491", "0.5974907", "0.59509724", "0.58886975", "0.58877337", "0.58492213", "0.58441037", "0.5829238", "0.5819616", "0.5819407", "0.5818731", "0.5802386", "0.5796633", "0.57884014", "0.5780335", "0.577209...
0.66408455
1
Gets the name of this ConnectionDto. Connection name
def name(self): return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connection_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"connection_name\")", "def connection_name(self) -> str:\n return pulumi.get(self, \"connection_name\")", "def connection_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"connection_name\")", ...
[ "0.8109987", "0.78770113", "0.7587713", "0.7132375", "0.7012354", "0.6970042", "0.68702656", "0.68620515", "0.686156", "0.68561816", "0.6841437", "0.6841437", "0.6827014", "0.6827014", "0.6827014", "0.6827014", "0.6827014", "0.6827014", "0.6827014", "0.6827014", "0.6827014", ...
0.0
-1
Sets the name of this ConnectionDto. Connection name
def name(self, name): if name is not None and len(name) > 1024: raise ValueError("Invalid value for `name`, length must be less than or equal to `1024`") if name is not None and len(name) < 0: raise ValueError("Invalid value for `name`, length must be greater than or equal to `0`...
{ "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: str):...
[ "0.698652", "0.698652", "0.698652", "0.698652", "0.698652", "0.6979957", "0.6964318", "0.6835835", "0.6835835", "0.681234", "0.6805783", "0.6798256", "0.67915547", "0.67788064", "0.67788064", "0.67788064", "0.67788064", "0.67711574", "0.67684996", "0.67496085", "0.67287225", ...
0.0
-1
Gets the type of this ConnectionDto. Database Type
def type(self): return self._type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connection_type(self):\n return self._connection_type", "def connection_type(self):\n return self._connection_type", "def connection_type(self) -> Optional[str]: # noqa: D401\n return self._connection_type", "def type(self):\n return self.container['type']", "def type(self)...
[ "0.7701488", "0.7701488", "0.7398385", "0.7073261", "0.7073261", "0.6880846", "0.686116", "0.6806209", "0.6728022", "0.6728022", "0.67221564", "0.67090166", "0.6699046", "0.6699046", "0.6678888", "0.66640633", "0.6648504", "0.66438884", "0.6623585", "0.6623563", "0.6607306", ...
0.68063855
19
Sets the type of this ConnectionDto. Database Type
def type(self, type): if type is None: raise ValueError("Invalid value for `type`, must not be `None`") self._type = type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type(self, type):\n allowed_values = [\"postgres\", \"redshift\", \"snowflake\", \"bigquery\"] # noqa: E501\n if type not in allowed_values:\n raise ValueError(\n \"Invalid value for `type` ({0}), must be one of {1}\" # noqa: E501\n .format(type, allowed...
[ "0.6778424", "0.653501", "0.653501", "0.65224236", "0.65224236", "0.639923", "0.6380722", "0.6380722", "0.63556075", "0.6291323", "0.6291323", "0.6264483", "0.6264483", "0.6264483", "0.6264483", "0.6264483", "0.6264483", "0.6264483", "0.6264483", "0.6264483", "0.6264483", "...
0.58769876
46
Gets the database of this ConnectionDto. Database/Schema Logical Name
def database(self): return self._database
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_database(self):\n return self.database", "def get_database(self):\n if self._database is None:\n conn = self.get_connection()\n db = conn[self.database]\n self._database = db\n\n return self._database", "def getDb(self):\n return self.db", ...
[ "0.79545844", "0.7820087", "0.75245094", "0.75190026", "0.75059843", "0.75059843", "0.7470187", "0.7464767", "0.7464767", "0.73580176", "0.7350807", "0.7336733", "0.73366016", "0.7235801", "0.7198867", "0.7195163", "0.71335024", "0.713143", "0.7127368", "0.71237785", "0.71162...
0.75912845
2
Gets the ssh_tunnel of this ConnectionDto. ssh tunnel configuration
def ssh_tunnel(self): return self._ssh_tunnel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tunnel(self):\n return self._tunnel", "def bokeh_tunnel(self) -> TunnelInternal:\n return self._bokeh_tunnel", "def get_on_tunnel(self):\n return self._is_on_tunnel", "def ssh(self) -> Optional[pulumi.Input['LinuxProfilePropertiesSshArgs']]:\n return pulumi.get(self, \"ssh\")"...
[ "0.73422706", "0.6544547", "0.6299176", "0.6244284", "0.60938513", "0.60583705", "0.5866291", "0.5851794", "0.5851004", "0.58175737", "0.57334214", "0.5707023", "0.5700237", "0.5695588", "0.56744146", "0.56185466", "0.5577173", "0.55543524", "0.55237", "0.55128473", "0.548714...
0.824663
0
Sets the ssh_tunnel of this ConnectionDto. ssh tunnel configuration
def ssh_tunnel(self, ssh_tunnel): self._ssh_tunnel = ssh_tunnel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ssh_tunnel(self):\n\n host = self.sshTunnelDict[\"ssh_ip\"]\n user = self.sshTunnelDict[\"ssh_user\"]\n password = self.sshTunnelDict[\"ssh_password\"]\n sfcs = self.sshTunnelDict[\"target_ip\"]\n\n tunnel_command = 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChec...
[ "0.675914", "0.6605099", "0.6178373", "0.60904634", "0.5605444", "0.5476674", "0.5387961", "0.53618294", "0.5321048", "0.53140545", "0.53031087", "0.5296444", "0.52829975", "0.5275553", "0.5245315", "0.5192569", "0.5149504", "0.5147113", "0.51296663", "0.51175994", "0.5111401...
0.83524567
0
Sets the verify_server_certificate of this ConnectionDto. Should server certificate be verified
def verify_server_certificate(self, verify_server_certificate): self._verify_server_certificate = verify_server_certificate
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_server_certificate(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"verify_server_certificate\")", "def verify_server_certificate(self) -> bool:\n return pulumi.get(self, \"verify_server_certificate\")", "def verify_server_certificate(self):\n return self._veri...
[ "0.7235582", "0.7048329", "0.6964776", "0.6545746", "0.60307807", "0.5979448", "0.593226", "0.5889066", "0.57489", "0.57173", "0.57043093", "0.56502354", "0.5499581", "0.5421345", "0.5383809", "0.53299206", "0.532554", "0.53128654", "0.5297012", "0.5278152", "0.52709925", "...
0.8727834
0
Sets the trusted_server_certificates of this ConnectionDto. trusted server certificates
def trusted_server_certificates(self, trusted_server_certificates): if trusted_server_certificates is not None and len(trusted_server_certificates) > 100000: raise ValueError("Invalid value for `trusted_server_certificates`, length must be less than or equal to `100000`") if trusted_server_c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trusted_server_certificates(self):\n return self._trusted_server_certificates", "def verify_server_certificate(self, verify_server_certificate):\n\n self._verify_server_certificate = verify_server_certificate", "def trusted(self, trusted):\n\n self._trusted = trusted", "def SetTruste...
[ "0.7097847", "0.58575535", "0.5850346", "0.5725505", "0.51788056", "0.5088869", "0.5085747", "0.49595064", "0.4896925", "0.48946217", "0.48745573", "0.4861071", "0.4839228", "0.48203716", "0.47829595", "0.47604677", "0.47415882", "0.47400114", "0.47115654", "0.46886235", "0.4...
0.82548046
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, ConnectionDto): 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.84564555", "0.8391999", "0.8144653", "0.81410354", "0.81326365", "0.8094085", "0.80921024", "0.80921024", "0.80921024", "0.8085453", "0.8085453", "0.807646", "0.807646", "0.806588" ]
0.0
-1
Reads the file from the given path (json file). Returns list of instance dictionaries.
def read(path): data = [] with open(path, "r", encoding="utf-8") as file: for instance in file: data.append(json.loads(instance)) return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_file(path: str) -> list:\n try:\n with open(path, 'r') as file:\n rooms = json.loads(file.read())\n rooms = [Room(room['id'], room['name']) for room in rooms]\n return rooms\n except FileNotFoundError:\n raise Exception('Json fil...
[ "0.7766656", "0.7736186", "0.7732027", "0.76517224", "0.7560417", "0.7480914", "0.7474814", "0.7468895", "0.7413743", "0.7388412", "0.7386593", "0.73859185", "0.7371623", "0.73595375", "0.73497754", "0.7344601", "0.734342", "0.7338777", "0.733736", "0.7318205", "0.72966874", ...
0.8198233
0
remove numbers from the grid to create the puzzle
def remove_numbers_from_grid(self): #get all non-empty squares from the grid non_empty_squares = self.get_non_empty_squares(self.grid) non_empty_squares_count = len(non_empty_squares) rounds = 3 while rounds > 0 and non_empty_squares_count >= 17: #there should be at l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_numbers(self):\n for i in range(len(self.board.board[0])):\n while self.board.board[i].count(0) < 6:\n random_val = random.randint(0, 8)\n self.board.update_board((i, random_val), 0)", "def _hide_numbers(self):\n global counter\n\n # num of...
[ "0.7139495", "0.6978002", "0.6917827", "0.6523514", "0.64967364", "0.6485853", "0.6434701", "0.63681704", "0.6326973", "0.6315295", "0.6241159", "0.6212497", "0.6210529", "0.6207884", "0.6165753", "0.61619693", "0.6159317", "0.61558974", "0.611644", "0.6094093", "0.6085968", ...
0.8469444
0
list files in a directory recursively, excluding dot files and dot directories. return array of relative to path and alwasy use '/' even on Windows.
def list_files(path, base=None): if not base: base = path bag = [] for entry in os.listdir(path): if entry[0] == '.': continue # skip dot files and directories fullpath = '/'.join([path, entry]) # not use os.path.join if os.path.isfile(fullpath): bag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_files(path: str) -> List[str]:\n if not isdir(path):\n return [path] # its expected to return a list each time even if its a single element\n return [file for fileOrDir in listdir(path) for file in get_files(path + '/' + fileOrDir)]\n # return list of each file returned by the recursive ca...
[ "0.7524943", "0.7516233", "0.7486052", "0.7436258", "0.74204797", "0.74015516", "0.73997855", "0.7381417", "0.738034", "0.73428553", "0.73118794", "0.7263268", "0.722073", "0.7219745", "0.7209468", "0.72025824", "0.7198464", "0.7194337", "0.71721375", "0.7162895", "0.7162691"...
0.70587146
31