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
Number of nodes in the tree.
def tree_size(self): if self._tree_size is not None: return self._tree_size if self.is_root: self.arbor._setup_tree(self) # pass back to the arbor to avoid calculating again self.arbor._store_node_info(self, '_tree_size') else: self._tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count(self):\n return self.__tree.node_count", "def numNodes(self):\n res = 0\n for n in self.iternodes():\n res += 1\n return res", "def number_of_nodes(self):\n return int(self._data['number_of_nodes'])", "def node_count(self):\n return self._root.co...
[ "0.87771", "0.876103", "0.87113464", "0.8688446", "0.8679165", "0.8642875", "0.85500014", "0.85063654", "0.8487128", "0.8469054", "0.84642124", "0.84633803", "0.8463188", "0.84412813", "0.84390837", "0.84262526", "0.8424474", "0.8424474", "0.83696264", "0.8285416", "0.8208172...
0.77037966
52
Get all leaf nodes from the tree of which this is the head. This returns a generator of all leaf nodes belonging to this tree. A leaf node is a node that has no ancestors.
def get_leaf_nodes(self, selector=None): if selector is None: if self.is_root: selector = "forest" else: selector = "tree" uids = self[selector, "uid"] desc_uids = self[selector, "desc_uid"] lids = np.where(~np.in1d(uids, desc_uid...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def leaf_nodes(self):\n deps = set([\n item for sublist in self.edges.values() for item in sublist\n ]) # Now contains all nodes that contain dependencies.\n return (x for x in self.nodes if x not in deps) # Generator that\n # contains all nodes *without* any dependencies (...
[ "0.7606356", "0.7265476", "0.7202606", "0.71604365", "0.71463764", "0.71184134", "0.7054126", "0.7034083", "0.69661665", "0.6925725", "0.685431", "0.6741353", "0.6739723", "0.67098", "0.67022145", "0.668154", "0.66534376", "0.66515875", "0.66343683", "0.6592297", "0.6588354",...
0.7058569
6
Get all root nodes from the forest to which this node belongs. This returns a generator of all root nodes in the forest. A root node is a node that has no descendents. Returns
def get_root_nodes(self): selector = "forest" desc_uids = self[selector, "desc_uid"] rids = np.where(desc_uids == -1)[0] for rid in rids: yield self.get_node(selector, rid)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def roots(self):\n for node in self:\n if not node.incoming:\n yield node", "def get_nodes(self):\n all_nodes = [] \n if not self._root is None:\n all_nodes.append(self._root)\n i = 0\n while i < len(all_nodes):\n for ...
[ "0.7504852", "0.6858595", "0.68569803", "0.68552417", "0.6780215", "0.67416185", "0.6731141", "0.67081296", "0.668952", "0.65601224", "0.65464175", "0.65101284", "0.64965814", "0.64653754", "0.6418019", "0.6351439", "0.63415235", "0.63213944", "0.63096553", "0.6249233", "0.62...
0.7747892
0
Return the field array indices for all TreeNodes in the tree beneath, starting with this TreeNode.
def _tree_field_indices(self): if self._tfi is not None: return self._tfi self.arbor._grow_tree(self) self._tfi = np.array([node.tree_id for node in self._tree_nodes]) return self._tfi
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _forest_field_indices(self):\n return self._ffi", "def _prog_field_indices(self):\n\n if self._pfi is not None:\n return self._pfi\n\n self.arbor._grow_tree(self)\n self._pfi = np.array([node.tree_id for node in self._prog_nodes])\n return self._pfi", "def iter...
[ "0.68725413", "0.684114", "0.62957066", "0.61334234", "0.610952", "0.6079161", "0.6061128", "0.59328806", "0.5931311", "0.5866322", "0.58386046", "0.58168143", "0.58105195", "0.58016896", "0.57985693", "0.57763493", "0.575891", "0.5744971", "0.5728258", "0.5713622", "0.571149...
0.8350539
0
Return the field array indices for all TreeNodes in the progenitor list, starting with this TreeNode.
def _prog_field_indices(self): if self._pfi is not None: return self._pfi self.arbor._grow_tree(self) self._pfi = np.array([node.tree_id for node in self._prog_nodes]) return self._pfi
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _tree_field_indices(self):\n\n if self._tfi is not None:\n return self._tfi\n\n self.arbor._grow_tree(self)\n self._tfi = np.array([node.tree_id for node in self._tree_nodes])\n return self._tfi", "def _forest_field_indices(self):\n return self._ffi", "def atom...
[ "0.80564946", "0.6520078", "0.61335653", "0.60979617", "0.5926736", "0.5916426", "0.5908792", "0.59066695", "0.58951336", "0.587203", "0.584773", "0.5845271", "0.5817503", "0.58022374", "0.58008176", "0.5798868", "0.5784032", "0.57836574", "0.57620966", "0.57543164", "0.57272...
0.75537264
1
Displays the GUI frame.
def start(self): if self._system.get_settings().show_gui and not self.is_running(): self.frame = True app = QtWidgets.QApplication(sys.argv) self.gui = GUI(self._system) if self.is_speech_enabled: self.gui.enable_speech(True) # if not ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_gui():\n pass", "def show(self):\r\n\t\tself.frame.Show(True)", "def show(self):\n self.frame.grid()\n self.visible = True", "def display(self) -> None:\n self.root.display()", "def iniciaUI(self):\n\n self.setGeometry(100,100, 300, 200)\n self.setWindowTi...
[ "0.79651785", "0.7507943", "0.7257487", "0.72238183", "0.71769357", "0.7044597", "0.7023292", "0.69915986", "0.6982538", "0.6949862", "0.6939466", "0.69197243", "0.689979", "0.68448013", "0.6805102", "0.68050927", "0.6786359", "0.67839664", "0.67568046", "0.67529875", "0.6707...
0.63411075
67
Create a schedule with a learning rate that decreases following the values of the cosine function between 0 and `pi cycles` after a warmup period during which it increases linearly between 0 and 1.
def get_cosine_schedule_with_warmup(optimizer, num_warmup_steps, num_training_steps, num_cycles=.5, last_epoch=-1): def lr_lambda(current_step): if current_step < num_warmup_steps: return float(current_step) / float(max(1, num_warmup_steps)) progress = float(current_step - num_warmup_ste...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def learning_rate_schedule(total_steps):\n learning_rate = learning_schedules.cosine_decay_with_warmup(global_step=tf.train.get_or_create_global_step(),\n learning_rate_base=0.04,\n tota...
[ "0.71117914", "0.69005686", "0.6646178", "0.6642547", "0.66401637", "0.6588159", "0.6563767", "0.6551723", "0.65377104", "0.65334845", "0.6471999", "0.6443835", "0.6401223", "0.6353843", "0.633249", "0.633249", "0.6309466", "0.6226509", "0.6216965", "0.6216965", "0.6216965", ...
0.6750027
2
decaying the learning rate
def learning_rate_decaying(optimizer, rate): lr = get_learning_rate(optimizer) * rate for param_group in optimizer.param_groups: param_group["lr"] = lr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lr_decay(step):\n return(alpha / (1 + decay_rate * step))", "def step_decay(epoch):\n # initial_lrate = 1.0 # no longer needed\n #drop = 0.5\n #epochs_drop = number_epoch_drop\n #lrate = init_lr * math.pow(drop,\n #math.floor((1+epoch)/epochs_drop))\n lr = learning_rate\n ...
[ "0.8667119", "0.8320443", "0.82278764", "0.8163907", "0.807087", "0.8066573", "0.80086863", "0.7910637", "0.78965694", "0.7796221", "0.77716106", "0.77685934", "0.7720703", "0.7712578", "0.76935744", "0.7663555", "0.7641688", "0.7590731", "0.7559678", "0.73559076", "0.7338", ...
0.75940657
17
find the index of a given value in a given list
def indexAll(inputList=None, value=None): if not isinstance(inputList, list): raise TypeError('Input list must be a list object.') return [i for i, x in enumerate(inputList) if x == value]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index(liste, value):\n\n for ii in range(len(liste)):\n if liste[ii] == value:\n return ii\n return None", "def find(self, list, key, value):\n for i, dic in enumerate(list):\n if dic[key] == value:\n return i\n return -1", "def index(self, va...
[ "0.8687077", "0.810302", "0.79014814", "0.7769255", "0.77509016", "0.7699577", "0.76754856", "0.76398146", "0.7632851", "0.7620169", "0.7612017", "0.7606102", "0.7561632", "0.7558114", "0.75460845", "0.7532872", "0.74935573", "0.74557704", "0.7413306", "0.7389148", "0.7354836...
0.68561393
43
Performs a Lorentz transform on the vector.
def lorentz_transform(self, transformation_matrix): t = super(GenericVector, self).lorentz_transform(transformation_matrix) return GenericVector( t.tensor(), syms=self.syms, config=self.config, parent_metric=None, name=_change_name(self.name, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lvec(self):\n lv = ROOT.TLorentzVector()\n# if self.pt < 0 or abs(self.eta) > 6:\n# raise Exception(\"Invalid values for TLorentzVector\")\n lv.SetPtEtaPhiM(self.pt, self.eta, self.phi, self.mass)\n# if abs(lv.Pt()) > 100000 or abs(lv.Eta()) > 100000:\n# raise Exception(\"Invalid valu...
[ "0.6331831", "0.6181236", "0.6142289", "0.59298164", "0.5923603", "0.5902213", "0.5847495", "0.56440014", "0.56340456", "0.56318974", "0.5612878", "0.55883527", "0.55797714", "0.55745167", "0.5567964", "0.5529249", "0.5522221", "0.55176085", "0.5491763", "0.5486713", "0.54774...
0.60128504
3
Render the homepage template on the / route
def homepage(): return render_template("home/index.html")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home():\n return render_template('homepage.html')", "def homepage():\n return render_template('homepage.html')", "def homepage():\n return render_template(\"home/index.html\", title=\"Welcome\")", "def render_home():\r\n\treturn render_template(\"index.html\")", "def home_page():\n\n return r...
[ "0.8568932", "0.8526821", "0.8473926", "0.8473321", "0.84519774", "0.84239286", "0.84239286", "0.8420498", "0.8387553", "0.8311804", "0.82661605", "0.82661605", "0.82661605", "0.82661605", "0.82661605", "0.82661605", "0.8263859", "0.8259376", "0.82504493", "0.82504493", "0.82...
0.8596693
0
Render the about_us template on the /aboutus route
def about_us(): return render_template('home/about-us.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def about_us():\n\n return render_template('about_us.html')", "def about_us():\r\n return render_template(\"about_us.html\")", "def aboutus():\n return render_template(\"aboutUs.html\")", "def about_us(request):\n\treturn render(request, 'about_us.html')", "def about():\n return render_temp...
[ "0.8903028", "0.8835818", "0.8761167", "0.8633831", "0.8625896", "0.86161256", "0.856144", "0.84916216", "0.8441198", "0.8436129", "0.8402152", "0.84006095", "0.83976036", "0.8381833", "0.8356158", "0.8356158", "0.8356158", "0.8356158", "0.8356158", "0.8356158", "0.8356158", ...
0.89343494
0
Render the contact_us template on the /contactus route
def contact_us(): return render_template('home/contact-us.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contact():\n return render_template('contact.html')", "def contact_us(environ):\n return render_template(\n template_name=\"contact.html\", context={\"path\": environ.get(\"PATH_INFO\")}\n )", "def contact():\n return render_template(\n 'contact.html',\n title='Contact',\n ...
[ "0.8353081", "0.82002187", "0.80727744", "0.805473", "0.80517304", "0.8047666", "0.8047666", "0.8031661", "0.8029988", "0.8029988", "0.8029988", "0.8029988", "0.8029988", "0.8029988", "0.8029988", "0.8029988", "0.79944587", "0.79249156", "0.79147327", "0.7856688", "0.78550154...
0.88874876
0
Get distance from start and destination coordinates.
def get_distance(latitude, longitude, del_latitude, del_longitude): coord = (latitude, longitude) del_coord = (del_latitude, del_longitude) return distance.geodesic(coord, del_coord).km
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_distance(start, end):\n\n\t\tloc_start, loc_end, dst_node = create_distance(start, end)\n\t\tdistance = cmds.getAttr(\"%s.distance\" % dst_node)\n\n\t\tcmds.delete([loc_start, loc_end, dst_node])\n\n\t\treturn distance", "def _getDistance(self, source, dest):\n\n lat1 = source[0]\n lat2 = d...
[ "0.8166633", "0.79528666", "0.7804172", "0.7737754", "0.7346324", "0.732576", "0.7267776", "0.7264587", "0.72487295", "0.7244245", "0.7168621", "0.71665347", "0.71612674", "0.71542186", "0.7149351", "0.71472156", "0.7099931", "0.7070449", "0.7069942", "0.70689565", "0.705163"...
0.0
-1
Get distance from two coordinates.
def get_fast_distance(lat1, lon1, lat2, lon2): KM = 6371.393 lat1, lon1, lat2, lon2 = map(np.deg2rad, [lat1, lon1, lat2, lon2]) dlat = lat2 - lat1 dlon = lon2 - lon1 a = np.sin(dlat / 2) ** 2 + np.cos(lat1) * np.cos(lat2) * np.sin(dlon / 2) ** 2 c = 2 * np.arcsin(np.sqrt(a)) distance = KM * ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getDistanceBetweenTwoPoints(self, one, two):\n dx = one.x - two.x\n dy = one.y - two.y\n return math.sqrt(dx * dx + dy * dy)", "def distance(coords1, coords2):\n dx = coords1.x - coords2.x\n dy = coords1.y - coords2.y\n return math.sqrt(dx * dx + dy * dy)", "def get_distance(x...
[ "0.8170887", "0.8095228", "0.809197", "0.80104154", "0.8001834", "0.7926047", "0.7912562", "0.7904516", "0.789397", "0.7885519", "0.7874656", "0.78444225", "0.7842947", "0.7834536", "0.7818351", "0.78146046", "0.78054804", "0.7803747", "0.7760409", "0.77574486", "0.77199554",...
0.0
-1
Shift time by timezone to all cities
def set_time_by_timezone(df): df = set_city_time_by_timezone(df, 1078, 3) df = set_city_time_by_timezone(df, 22390, 4) df = set_city_time_by_timezone(df, 22430, 4) df = set_city_time_by_timezone(df, 22438, 5) return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_city_time_by_timezone(df, city_id, hour_diff):\n df[df.main_id_locality == city_id][['OrderedDate']].apply(lambda x: x - timedelta(hours=hour_diff))\n return df", "def timezone():\n \n pass", "def correct_tz(df,site):\n if site == 'berk':\n tz_offset = df.index.name[-5:]\n i...
[ "0.6614628", "0.64892036", "0.58666486", "0.58491415", "0.5836806", "0.57713103", "0.57510126", "0.5715088", "0.568087", "0.5669149", "0.56524056", "0.56185365", "0.56127524", "0.55835557", "0.55559874", "0.5555039", "0.55279166", "0.5504311", "0.5499577", "0.54788864", "0.54...
0.7495316
0
Construct a new Section instance, located using the specified attribute and attributevalue OR a supplied xpath.
def __init__(self, identifier=None, attribute=None, xpath=None): super().__init__( element_type="section", identifier=identifier, attribute=attribute, xpath=xpath, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set(self, path, child=False, attribute=False):\n xml_path = path.split('/')\n xml_doc = self.doc\n\n # traverse full XML element path string `path`\n for element_name in xml_path:\n # get existing XML element by `element_name`\n element = self.doc.getElementsBy...
[ "0.55087703", "0.48760945", "0.4855316", "0.48539492", "0.48430482", "0.4826501", "0.480831", "0.47075155", "0.45331714", "0.4529393", "0.45273814", "0.45112675", "0.44956315", "0.44864228", "0.4480916", "0.447953", "0.4436473", "0.4433798", "0.4395288", "0.43912488", "0.4367...
0.697304
0
Update position of bullets to get rid of bullets that have exited screen
def _update_bullets(self): # Remove bullets that have reached top of screen self.bullets.update() ## MOVED HERE !!!!!! for bullet in self.bullets.copy(): if bullet.rect.bottom <= 0: self.bullets.remove(bullet) # print(len(self.bullets)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_bullets(self):\n # Update bullet positions.\n\n # Get rid of bullets that have disappeared.\n for bullet in self.bullets.copy():\n if bullet.rect.bottom <= 0:\n self.bullets.remove(bullet)", "def _update_bullet(self):\n\n # update position of old ...
[ "0.8220918", "0.8209496", "0.80927676", "0.7921505", "0.7895895", "0.7889641", "0.76503944", "0.7634875", "0.7633335", "0.7574489", "0.74772364", "0.74678594", "0.73834866", "0.73242325", "0.7258007", "0.7257042", "0.72246635", "0.71733856", "0.6927442", "0.69240916", "0.6899...
0.8126849
2
Verify if aliends reach bottom od screen
def _check_aliens_bottom(self): screen_rect = self.screen.get_rect() for alien in self.aliens.sprites(): if alien.rect.bottom >= screen_rect.bottom: self._ship_hit() break
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_aliens_bottom(self):\n screen_rect = self.screen.get_rect()\n for alien in self.aliens.sprites():\n if alien.rect.bottom >= screen_rect.bottom:\n # Treat the same as if ship got hit.\n self._ship_hit()\n break", "def hits_top_or_bot...
[ "0.7724187", "0.7674752", "0.7479625", "0.73927456", "0.72978747", "0.7296279", "0.72872806", "0.72289807", "0.7205694", "0.7181904", "0.700385", "0.6819365", "0.6752128", "0.66071683", "0.65507865", "0.6502241", "0.64941067", "0.640842", "0.6407622", "0.62794805", "0.6277700...
0.7673087
3
Return the current location This is the fastest way to receive the current location. The current location is set by init() and stored in a global variable. This function provides access to this global variable.
def get_current_location(): global current_location return current_location
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_current_location(self):\n return self._current_loc", "def get_current_location(self):\n return self.enu_2_local()", "def get_location(self):\n\t\treturn self.location", "def get_location(self):\n self.location = self.func(0)", "def get_location(self):\r\n return self.__l...
[ "0.8349494", "0.81059754", "0.75150764", "0.7470198", "0.74093384", "0.72308797", "0.7229095", "0.72238237", "0.7163456", "0.7026359", "0.70226884", "0.70051014", "0.7003448", "0.6947182", "0.6839595", "0.6810496", "0.67843527", "0.6762033", "0.6746848", "0.6724896", "0.67248...
0.8971525
0
Return the current gis database (gisdbase) This is the fastest way to receive the current gisdbase. The current gisdbase is set by init() and stored in a global variable. This function provides access to this global variable.
def get_current_gisdbase(): global current_gisdbase return current_gisdbase
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tgis_database():\n global tgis_database\n return tgis_database", "def get_db():\n if not hasattr(g, \"sql_db\"):\n g.sql_db = connect_db()\n return g.sql_db", "def get_db():\n if ( g.get( 'db' ) is None ):\n g.db = connect_db()\n\n return g.db.connect()", "def get_db()...
[ "0.7361921", "0.721205", "0.7100395", "0.7065702", "0.7052889", "0.70309776", "0.70309776", "0.70215815", "0.7017342", "0.7017283", "0.7001556", "0.69798386", "0.6971853", "0.6960738", "0.6960738", "0.6960738", "0.6960738", "0.6960738", "0.6960738", "0.6960738", "0.6960738", ...
0.8945491
0
Close the DBMI connection There may be several temporal databases in a location, hence close all temporal databases that have been opened.
def close(self): for key in self.unique_connections.keys(): self.unique_connections[key].close() self.connected = False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close(self):\n if self._dbopen:\n self._dbcon.close()", "def close_db(self):\n with nostderr():\n tb.file._open_files.close_all()", "def close_database(self):\n if self._conn is not None:\n self._conn.close()\n self._conn = None", "def _clo...
[ "0.7387683", "0.73765916", "0.7347628", "0.726698", "0.7245583", "0.7219529", "0.7213888", "0.7198183", "0.71847427", "0.71828026", "0.71057165", "0.70927864", "0.7089359", "0.7072032", "0.7061039", "0.7053634", "0.70442593", "0.70442593", "0.70442593", "0.70140606", "0.70058...
0.0
-1
Creates all unique combinations of a list a that is passed in.
def permute(a): a.sort() # Sort. ## Output the first input sorted. yield list(a) i = 0 first = 0 alen = len(a) ## "alen" could also be used for the reference to the last element. while True: i = alen - 1 while True: i -= 1 # i-- if a[i] < ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def combinations(*args: List[Any]) -> List[List]:\n return list([list(el) for el in list(product(*args))])", "def unique_permutations(items):\n return set(permutations(items))", "def genSubset2(L):\n import itertools\n result = []\n for i in range(len(L) + 1):\n result += list(itertools.c...
[ "0.66352284", "0.6468013", "0.6387283", "0.6282946", "0.6236239", "0.6219714", "0.6143335", "0.61014414", "0.6070962", "0.6062573", "0.6048774", "0.6014745", "0.5958898", "0.5946201", "0.5919083", "0.5903067", "0.5886177", "0.5845741", "0.5800105", "0.5798076", "0.57739854", ...
0.0
-1
Builds months. It's extreamly slow since it's fetching all posts.
def get_months(self): months = mcache.get_months() if months is not None: return months posts = self.base_query().fetch() names = [] for post in posts: names.append('%d/%02d' % (post.date_published.year, post.date_published.month)) names.sort() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_months(self, cr, uid, context):\n months=[(str(n),str(n)) for n in range(1,13)]\n return months", "def get_months_group(self):\n m = {}\n for post in self:\n d = \"-\".join(post.Date.split(\"-\")[:2])\n if d not in m:\n m[d] = []\n ...
[ "0.6594332", "0.6573108", "0.65620947", "0.6464085", "0.6354909", "0.6310111", "0.63038605", "0.59203243", "0.5852066", "0.5843194", "0.5827282", "0.5811662", "0.5798935", "0.5758575", "0.57321835", "0.57141775", "0.56937027", "0.5691933", "0.56731457", "0.5627034", "0.562507...
0.69626737
0
note that the order of value in input_batch tuple matters Args input_batch, tuple (encoder_input, decoder_input, decoder_label) encoder_len, a length list shape of (batch_size) decoder_len, a length list shape of (batch_size+1) with one more word or Returns
def create_feed_dict(self, input_batch, sent_len, encoder_len, label_batch=None, decoder_len=None, mode='train'): if mode == 'train': placeholders = (self.ph_encoder_input, self.ph_input_encoder_sentence_len, self.ph_decoder_label, self.ph_input_encoder_len, self.ph_inpu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict_batch(self, batch):\n # batch = src_tensor when predicting = [batch_size, src len]\n\n src_tensor = batch\n src_mask = self.make_src_mask(batch)\n\n # src_mask = [batch size, 1, 1, src len]\n\n enc_src = self.encoder(src_tensor, src_mask)\n\n # enc_src = [batch...
[ "0.66344386", "0.65888876", "0.64937705", "0.64207864", "0.6388816", "0.63103473", "0.6309044", "0.6307817", "0.6304426", "0.6299908", "0.62840825", "0.62738085", "0.6260539", "0.6242666", "0.6239428", "0.62268186", "0.6218688", "0.6183289", "0.61484134", "0.6148167", "0.6142...
0.0
-1
Context vector calculation function. Here the encoder's contribution to attention remains the same and can be computed earlier. We perform currying to return a function that takes as input just the decoder state.
def calc_attention(self, encoder_hidden_states): params = self.dec_params if len(encoder_hidden_states.shape) == 3: # Squeeze the first dimension encoder_hidden_states = np.squeeze(encoder_hidden_states, axis=0) # T x Attn_vec_size attn_enc_term = np.matmul(enco...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self, inputs, state, context=None):\n if not self._wt_attention:\n r, z = tf.split(1, 2, tf.matmul(tf.concat(1, [inputs, state]), tf.concat(0, [self._W_z_r, self._U_z_r])) + self._B_z_r)\n ###### Debug\n #print tf.concat(1, [inputs, state]).get_shape(), tf.conca...
[ "0.63690066", "0.6275593", "0.6264098", "0.6199529", "0.59737337", "0.5918458", "0.58860505", "0.58325225", "0.5768694", "0.5685881", "0.5639822", "0.55264103", "0.5508727", "0.5404031", "0.53728426", "0.5359123", "0.53201216", "0.53117514", "0.53001666", "0.5289079", "0.5286...
0.56646925
10
A generator, which gets a frame generator as an input.
def align_faces(frames): align = get_entry('recognition')['face alignment'] provider = align['provider'] logger = logging.getLogger('alignment') logger.setLevel(logging.INFO) logger.info('alignment provider: ' + provider) if provider == 'opencv': from faceR.alignment import opencv as a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def frame_generator(self):\n frame = 0\n while not self.process.termination:\n yield frame\n frame += 1", "def frame_generator(self, frame_size, frame_step):\n num_frames = frame_size\n while self.ya:\n ya = self.ya[:num_frames]\n del self.y...
[ "0.7335359", "0.71742725", "0.7088323", "0.70659345", "0.6973411", "0.69498765", "0.69046044", "0.68536127", "0.6816608", "0.6806921", "0.6806921", "0.6806921", "0.6806921", "0.6806921", "0.6806921", "0.6806921", "0.6806921", "0.6806081", "0.6786263", "0.6715308", "0.66840833...
0.0
-1
Gets the name of this Company.
def name(self): return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def company_name(self):\n if \"companyName\" in self._prop_dict:\n return self._prop_dict[\"companyName\"]\n else:\n return None", "def company_name(self) -> Optional[str]:\n return pulumi.get(self, \"company_name\")", "def get_name(self) -> str:\n\n return sel...
[ "0.7926703", "0.7775462", "0.7774501", "0.7692799", "0.7619582", "0.7619582", "0.75912875", "0.7579159", "0.7579159", "0.7568535", "0.7568535", "0.7568535", "0.7517485", "0.7517485", "0.7517485", "0.7517485", "0.7517485", "0.7517485", "0.7517485", "0.7517485", "0.7517485", ...
0.0
-1
Sets the name of this Company.
def name(self, name): self._name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def company_name(self, company_name):\n\n self._company_name = company_name", "def SetName(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", ...
[ "0.7888336", "0.7711231", "0.7685548", "0.7661592", "0.7661592", "0.7661592", "0.7661592", "0.7661592", "0.7647515", "0.75937706", "0.7523401", "0.7523401", "0.75214493", "0.7444677", "0.7439563", "0.74340993", "0.74340993", "0.73960227", "0.7386336", "0.7386336", "0.73589766...
0.0
-1
Gets the description of this Company.
def description(self): return self._description
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_description(self):\n return self._description", "def get_description(self):\n return self.description", "def get_description(self):\n return self.description", "def get_description(self):\n return self.description", "def get_description(self):\n return self.descri...
[ "0.80592185", "0.80585045", "0.80585045", "0.80585045", "0.80585045", "0.8009937", "0.79839545", "0.797689", "0.7951439", "0.79141355", "0.79141355", "0.79141355", "0.79141355", "0.79141355", "0.79141355", "0.79141355", "0.79141355", "0.79141355", "0.79141355", "0.79141355", ...
0.77512527
70
Sets the description of this Company.
def description(self, description): self._description = description
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_description(self, description):\n self.description = description", "def set_description(self, description):\n self._description = description", "def set_description(self, description):\r\n self.__description = description", "def set_description(self, description):\n self._...
[ "0.8320545", "0.82596636", "0.8246851", "0.82402205", "0.81133765", "0.7964233", "0.7964233", "0.7964233", "0.7964233", "0.79296684", "0.7899737", "0.7899737", "0.7899737", "0.7899737", "0.7861616", "0.77460575", "0.7637197", "0.76277846", "0.75996643", "0.7534183", "0.745419...
0.7965466
31
Gets the address_1 of this Company.
def address_1(self): return self._address_1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def address1(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"address1\")", "def address1(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"address1\")", "def address1(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"address1\")", "def s...
[ "0.779159", "0.7574656", "0.7574656", "0.7460589", "0.7195744", "0.71361697", "0.7024129", "0.6889645", "0.6849692", "0.6801628", "0.6735676", "0.6718778", "0.6708028", "0.6685305", "0.66586125", "0.6644929", "0.6634718", "0.66256124", "0.66256124", "0.65462595", "0.64831024"...
0.8136192
0
Sets the address_1 of this Company.
def address_1(self, address_1): self._address_1 = address_1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def address1(self, address1):\n\n self._address1 = address1", "def address_line1(self, address_line1):\n\n self._address_line1 = address_line1", "def address_line1(self, address_line1):\n\n self._address_line1 = address_line1", "def address_line1(self, address_line1):\n if address...
[ "0.8197091", "0.7381611", "0.7381611", "0.7173592", "0.70151013", "0.6688908", "0.6550875", "0.65290755", "0.65156233", "0.6468798", "0.6466647", "0.6401733", "0.62853265", "0.6220995", "0.62102145", "0.6180758", "0.6180758", "0.6157007", "0.6132031", "0.6081737", "0.6081737"...
0.83252025
0
Gets the address_2 of this Company.
def address_2(self): return self._address_2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def address2(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"address2\")", "def address2(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"address2\")", "def address2(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"address2\")", "def a...
[ "0.79922736", "0.7832418", "0.7832418", "0.76082075", "0.74009013", "0.680921", "0.68006164", "0.676114", "0.66945094", "0.66733724", "0.65642446", "0.6523316", "0.64951575", "0.6484699", "0.6447007", "0.6443324", "0.63932294", "0.6370246", "0.6357862", "0.6357862", "0.635761...
0.8279981
0
Sets the address_2 of this Company.
def address_2(self, address_2): self._address_2 = address_2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def address2(self, address2):\n\n self._address2 = address2", "def address_line2(self, address_line2):\n\n self._address_line2 = address_line2", "def address_line2(self, address_line2):\n\n self._address_line2 = address_line2", "def address_line2(self, address_line2):\n\n self._ad...
[ "0.8420217", "0.75927866", "0.75927866", "0.75927866", "0.7307024", "0.691906", "0.6805402", "0.6756377", "0.6611891", "0.6541268", "0.64908457", "0.64300764", "0.64300764", "0.635333", "0.62606573", "0.61777145", "0.61408424", "0.5984044", "0.5935465", "0.5875783", "0.584719...
0.8543798
0
Gets the postcode of this Company.
def postcode(self): return self._postcode
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def postal_code(self):\n return self._postal_code", "def postal_code(self):\n if \"postalCode\" in self._prop_dict:\n return self._prop_dict[\"postalCode\"]\n else:\n return None", "def postal_code(self):\n if \"postalCode\" in self._prop_dict:\n ret...
[ "0.7425708", "0.73551387", "0.73551387", "0.73383325", "0.6910429", "0.67521304", "0.67521304", "0.67521304", "0.671513", "0.6070526", "0.6022538", "0.6011883", "0.5995387", "0.5939424", "0.5856153", "0.58192235", "0.58192235", "0.58192235", "0.58192235", "0.58192235", "0.581...
0.81306285
1
Sets the postcode of this Company.
def postcode(self, postcode): self._postcode = postcode
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_code(self, post_code):\n\n self._post_code = post_code", "def postal_code(self, postal_code):\n\n self._postal_code = postal_code", "def postal_code(self, postal_code):\n\n self._postal_code = postal_code", "def postal_code(self, postal_code):\n\n self._postal_code = post...
[ "0.7746496", "0.7240486", "0.7240486", "0.7240486", "0.6933452", "0.6356589", "0.62528837", "0.62528837", "0.56795007", "0.56297016", "0.5546234", "0.55123204", "0.54621243", "0.54621243", "0.5391004", "0.5304791", "0.5304791", "0.5297066", "0.52903193", "0.5253824", "0.51896...
0.8149303
1
Sets the country_id of this Company.
def country_id(self, country_id): self._country_id = country_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def country(self, country):\n\n self._country = country", "def country(self, country):\n\n self._country = country", "def country(self, country):\n\n self._country = country", "def country(self, country):\n\n self._country = country", "def country(self, country):\n\n self...
[ "0.7315682", "0.7315682", "0.7315682", "0.7315682", "0.7315682", "0.6993897", "0.6839812", "0.662452", "0.6393392", "0.6393392", "0.63233525", "0.6018672", "0.59501576", "0.58453393", "0.57888764", "0.57541275", "0.5719039", "0.570507", "0.5695646", "0.5568804", "0.54427946",...
0.8399308
1
Sets the currency_id of this Company.
def currency_id(self, currency_id): self._currency_id = currency_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def set_currency(self, currency: str):\n json = {**self.get_data(), \"currencyId\": currency}\n return await self.easee.put(f\"/api/sites/{self.id}\", json=json)", "def currency(self, currency):\n\n self._currency = currency", "def currency(self, currency):\n\n self._currency ...
[ "0.7101681", "0.68601733", "0.68601733", "0.68601733", "0.68601733", "0.68110937", "0.6571344", "0.6540228", "0.6540228", "0.6540228", "0.6540228", "0.6540228", "0.63970655", "0.6365557", "0.63166565", "0.62406725", "0.61308426", "0.61069095", "0.6100509", "0.59956086", "0.59...
0.838314
0
Sets the business_email of this Company.
def business_email(self, business_email): self._business_email = business_email
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def business_owner_email(self, business_owner_email):\n\n self._business_owner_email = business_owner_email", "def business_account(self, business_account):\n\n self._business_account = business_account", "def business_owner(self, business_owner):\n\n self._business_owner = business_owner"...
[ "0.8080338", "0.689418", "0.686568", "0.67763877", "0.67261475", "0.66786194", "0.6668555", "0.6668555", "0.6586404", "0.657997", "0.657997", "0.657997", "0.657997", "0.657997", "0.657997", "0.657997", "0.657997", "0.657997", "0.657997", "0.65718806", "0.6424658", "0.633523...
0.8853504
0
Gets the business_phone of this Company.
def business_phone(self): return self._business_phone
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def business_phones(self):\n if \"businessPhones\" in self._prop_dict:\n return self._prop_dict[\"businessPhones\"]\n else:\n return None", "def business_phones(self):\n if \"businessPhones\" in self._prop_dict:\n return self._prop_dict[\"businessPhones\"]\n ...
[ "0.7370643", "0.7370643", "0.7370643", "0.7165213", "0.6941323", "0.6880082", "0.68516576", "0.68516576", "0.68516576", "0.6811236", "0.67628103", "0.6624384", "0.65310836", "0.64551425", "0.6450338", "0.6450338", "0.635741", "0.6334432", "0.6310043", "0.60831684", "0.6026935...
0.8635432
0
Sets the business_phone of this Company.
def business_phone(self, business_phone): self._business_phone = business_phone
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def business_phone_number(self, business_phone_number):\n\n self._business_phone_number = business_phone_number", "def setPhone(self,phone):\r\n self.phone = phone", "def business_phone(self):\n return self._business_phone", "def setPhone(self, phone):\n self.phone = phone\n ...
[ "0.8076993", "0.6945956", "0.6847377", "0.6815752", "0.67607933", "0.66212636", "0.66212636", "0.66212636", "0.66212636", "0.66212636", "0.6500315", "0.644862", "0.6441339", "0.6301416", "0.62995297", "0.62439615", "0.62439615", "0.62439615", "0.62439615", "0.62408894", "0.61...
0.87642604
0
Gets the vat_number of this Company.
def vat_number(self): return self._vat_number
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vat_id(self):\n return self._vat_id", "def vat_id(self) -> str:\n return self._vat_id", "def vcn_id(self):\n return self._vcn_id", "def contract_number(self):\n return self._contract_number", "def carrier_voyage_number(self) -> Object:\n return self._carrier_voyage_nu...
[ "0.7281263", "0.7006975", "0.6277326", "0.6089214", "0.60248196", "0.57753575", "0.562731", "0.5602054", "0.5568899", "0.5547058", "0.54992557", "0.54235643", "0.53771305", "0.53771305", "0.53552306", "0.5316702", "0.53111017", "0.5291103", "0.52378243", "0.52328", "0.5231529...
0.8119231
0
Gets the registration_number of this Company.
def registration_number(self): return self._registration_number
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_registration_number(self):\n return self._reg_number", "def registration_code(self):\n return self._regcode", "def registration_definition_id(self) -> str:\n return pulumi.get(self, \"registration_definition_id\")", "def account_number(self):\n return self.__account_number...
[ "0.82520056", "0.70589495", "0.6414419", "0.63728654", "0.6371001", "0.6345038", "0.6274442", "0.6094897", "0.60431165", "0.60099185", "0.60011536", "0.598054", "0.59553367", "0.5921105", "0.58988446", "0.5841004", "0.58306414", "0.58209103", "0.58139616", "0.58067155", "0.57...
0.839242
0
Sets the registration_number of this Company.
def registration_number(self, registration_number): self._registration_number = registration_number
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def registration_id(self, registration_id):\n\n self._registration_id = registration_id", "def registry_number(self, registry_number):\n\n self._registry_number = registry_number", "def business_phone_number(self, business_phone_number):\n\n self._business_phone_number = business_phone_num...
[ "0.6912592", "0.6457588", "0.6257057", "0.6224843", "0.61997736", "0.60711586", "0.60256827", "0.5984901", "0.5948491", "0.58809835", "0.5849947", "0.5833053", "0.5739443", "0.5689491", "0.5689491", "0.5689491", "0.5689491", "0.5641926", "0.5641356", "0.56060535", "0.55992377...
0.80694664
0
Gets the timezone of this Company.
def timezone(self): return self._timezone
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timezone(self):\n return self._tz", "def timezone(self) -> str:\n return self._tz", "def timezone(self):\n return self.data.get(\"timezone\")", "def get_timezone(self) -> str:\n return self.AD.time_zone", "def timezone(self):\n tz_data = self._router_request(\n ...
[ "0.8252713", "0.8000823", "0.78496724", "0.77686936", "0.77271044", "0.77052397", "0.76508176", "0.75870216", "0.7469745", "0.728207", "0.722694", "0.7185324", "0.7130271", "0.70653164", "0.7024833", "0.700182", "0.6941019", "0.6834261", "0.66794467", "0.6624282", "0.6568153"...
0.80441254
2
Sets the timezone of this Company.
def timezone(self, timezone): self._timezone = timezone
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_timezone(self, to_tz):\n self.startdate = to_tz.localize(self.startdate.replace(tzinfo=None))\n self.enddate = to_tz.localize(self.enddate.replace(tzinfo=None))\n self.timezone = to_tz", "def time_zone(self, time_zone):\n\n self._time_zone = time_zone", "def set(self, tzone)...
[ "0.7343945", "0.68632", "0.64408696", "0.6346224", "0.63077927", "0.6267625", "0.5988582", "0.59514844", "0.5927159", "0.58890826", "0.58873683", "0.58839226", "0.5845754", "0.57898414", "0.577315", "0.577315", "0.56699646", "0.56699646", "0.56699646", "0.5620195", "0.5603739...
0.7526051
3
Gets the contact of this Company.
def contact(self): return self._contact
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Contact(self):\n return self.__contact", "def get_contact(self, object_name, user_key = None):\n\t\treturn self.get_object('contact',object_name, user_key = user_key)", "def contact(self, contactid):\r\n return contacts.Contact(self, contactid)", "def get_contact(self, guid):\n for c...
[ "0.7899693", "0.71088445", "0.7083013", "0.7066555", "0.7037144", "0.70047146", "0.6858584", "0.67821676", "0.67773175", "0.6624245", "0.6598721", "0.6589603", "0.6589603", "0.6572919", "0.65651846", "0.6555251", "0.6555251", "0.6555251", "0.6416731", "0.6378814", "0.6339303"...
0.7883839
2
Returns true if both objects are equal
def __eq__(self, other): 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.7961088", "0.7961088", "0.79433626", "0.79303336", "0.7926563", "0.7897525", "0.78826123", "0.78826123", "0.78806067", "0.7872423", "0.7868354", "0.78668815", "0.7825702", "0.7819993", "0.78162885", "0.78078854", "0.78068...
0.79670393
36
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
List all the available triggers on current engine.
def list_triggers(engine: Engine) -> List[TriggerResult]: query_result = engine.execute( "SELECT event_object_schema as schema," " event_object_table as table_name," " trigger_schema," " trigger_name," " action_statement as definition, " " ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_triggers(self, table_name=None):\n if not table_name:\n table_name = self.name\n\n triggers = self.execute(self.commands.get_triggers(self.db.name, table_name))\n return [x[0] for x in triggers]", "def list_trigger(self, ids=[], tags=[]):\n params = {'triggerIds': i...
[ "0.7431098", "0.6860732", "0.6859406", "0.6841385", "0.68203676", "0.663856", "0.6513156", "0.6513156", "0.6493004", "0.6228277", "0.62007135", "0.6017275", "0.6012129", "0.59884036", "0.5939788", "0.5913822", "0.5836523", "0.5688732", "0.56261116", "0.55999434", "0.55907685"...
0.7638215
0
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.8038813", "0.79248375", "0.7923423", "0.7885103", "0.78773195", "0.7815877", "0.77655786", "0.77556044", "0.77441615", "0.7731815", "0.77288336", "0.772473", "0.77028215", "0.76889825", "0.76889825", "0.7664208", "0.76570904", "0.7655856", "0.7655856", "0.76458347", "0.764...
0.7448925
69
Formats a LUSID cash ladder response to a pandas DataFrame.
def cashladder_to_df(response) -> pd.DataFrame: base_df = new_data_frame() for element in response.values: shks = {shk: value.value.label_value for shk, value in element.sub_holding_keys.items()} for record in element.records: working_df = add_open_row(element, record) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_frame(records: list) -> pandas.DataFrame:\n return pandas.DataFrame(records, columns=lciafmt_cols)", "def cash_flow_response_to_df(\n portfolio_cash_flows_response: lusid.ResourceListOfPortfolioCashFlow,\n sum_by_date: bool = True\n) -> pd.DataFrame:\n\n def select_cols(\n ...
[ "0.63423157", "0.5973283", "0.5932889", "0.5777047", "0.57526", "0.5706653", "0.568698", "0.56812215", "0.56495386", "0.56055146", "0.55479723", "0.5523329", "0.5516826", "0.5491577", "0.54050946", "0.5397629", "0.53685623", "0.53604895", "0.53483397", "0.53479195", "0.534146...
0.6482358
0
Returns whether or not an object can be converted to JSON.
def is_JSONable(obj, encoder=json_encoder): try: encoded_string = json_encoder.encode(obj) except Exception as e: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_json(my_object):\n try:\n json.loads(my_object)\n except ValueError:\n return False\n\n return True", "def is_jsonable(self, input):\n try:\n json.dumps(input)\n return True\n except (TypeError, OverflowError):\n return False", "def _...
[ "0.79664415", "0.78763944", "0.7367911", "0.7197148", "0.713905", "0.6969035", "0.6829706", "0.680232", "0.67917013", "0.67396057", "0.6645885", "0.662105", "0.6602041", "0.65659904", "0.65080845", "0.63526535", "0.62688875", "0.6190081", "0.6122338", "0.6118775", "0.60716945...
0.82562476
0
Filters text that is too short for analyzing readability
def filter_out_data(text): if len(text) < 30: return None return text
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def restrict_text(text):\n\n if len(text) > 400:\n\n return text[:400] + ' ...'\n \n return text", "def remove_longer_words(text):\n return \" \".join([word for word in str(text).split() if len(word) <= 12])", "def short(text):\n rep = {\n ' *health *center': '',\n ' *he...
[ "0.73136395", "0.68807745", "0.6618025", "0.650179", "0.619532", "0.61639285", "0.61639285", "0.61639285", "0.61639285", "0.61639285", "0.61639285", "0.6150892", "0.6134878", "0.61055446", "0.60902816", "0.6079755", "0.6065434", "0.6006502", "0.5986323", "0.5932173", "0.59119...
0.64893574
4
Make the model object behave like a dict.
def update(self, values): for k, v in six.iteritems(values): setattr(self, k, v)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_basedict(self):\n tester = BaseModel()\n self.assertTrue(dict, type(tester.to_dict()))", "def to_dict_model(self) -> dict:\n return dict((key, getattr(self, key)) for key in self.__mapper__.c.keys())", "def dict(self) -> Dict:\r\n return super().dict()", "def dict(self) -> Di...
[ "0.7156991", "0.70300174", "0.6915193", "0.6915193", "0.68749535", "0.68191147", "0.6766341", "0.6752122", "0.66892827", "0.6662648", "0.66206944", "0.65513957", "0.6487081", "0.6468018", "0.6455899", "0.6440813", "0.6429715", "0.6374103", "0.63627994", "0.635863", "0.6354428...
0.0
-1
Function read files in 'images' folder, and asks user to chose file
def define_file() -> str: print('===SELECT FILE===') filenames = next(walk(IMAGES), (None, None, []))[2] filenames.append('Exit the program') command = menu(filenames) if int(command) == len(filenames): exit() else: return filenames[int(command) - 1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def image_list(path):\n global user_select\n user_list = os.listdir(path)\n print('=======================================')\n print('Listing files...')\n for i, v in enumerate(user_list):\n print(i, v)\n print('=======================================')\n user_select = input_path+'/'+us...
[ "0.719572", "0.70949745", "0.682704", "0.68198854", "0.67932004", "0.67099917", "0.6636783", "0.6574526", "0.65283275", "0.65054274", "0.64513147", "0.6334133", "0.6333946", "0.62933576", "0.62772834", "0.6180488", "0.6057207", "0.6052334", "0.60423726", "0.6016772", "0.60085...
0.656131
8
Plot boxplot of data using seaborn.boxplot
def box(df, y="value", x=None, by=None, legend=True, title=None, ax=None, **kwargs): # default x-axis to time-col attribute from an IamDataFrame, else use "year" x = x or time_col_or_year(df) # cast to DataFrame if necessary # TODO: select only relevant meta columns if not isinstance(df, pd.DataFr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def boxplot(data):\n sns.boxplot(data, width=0.5, palette=\"colorblind\")\n # add points on the plot\n sns.swarmplot(data, color='red', alpha=0.75)", "def box_plot():\n # download the data from Kaggle: https://www.kaggle.com/camnugent/california-housing-prices/download\n\n df = pd.read_csv('./hous...
[ "0.8502467", "0.7457859", "0.74180037", "0.709566", "0.70572317", "0.7054994", "0.69945204", "0.69095457", "0.6896563", "0.68391865", "0.68065375", "0.67931604", "0.6766868", "0.67599857", "0.67527527", "0.6731448", "0.66956323", "0.66836214", "0.66387737", "0.66069305", "0.6...
0.6115522
35
Return a taxlot state populated with pseudo random data
def get_taxlot_state(self, org, **kw): taxlot_details = self.get_details() taxlot_details.update(kw) tls = TaxLotState.objects.create(organization=org, **taxlot_details) auditlog_detail = {} TaxLotAuditLog.objects.create(organization=org, state=tls, **auditlog_detail) r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_state(self):\n \n self.state = np.random.choice(['checkout', 'dairy', 'drinks', 'fruit', 'spices'], p=self.tr_array_dict[f'{self.state}'])", "def rand(self):\n return self.State.rand()", "def sample(self):\n x = self.state\n# dx = self.theta * (self.mu - x) + self.sig...
[ "0.7410216", "0.6749461", "0.67086345", "0.670357", "0.670357", "0.670357", "0.670357", "0.670357", "0.6696778", "0.66843545", "0.66800725", "0.66706353", "0.6645671", "0.6628989", "0.66086066", "0.6599826", "0.64371413", "0.63752556", "0.6357058", "0.63456243", "0.6310371", ...
0.0
-1
Calculates IoU of the given box with the array of the given boxes.
def compute_inters(box, boxes, box_area): # Calculate intersection areas y1 = np.maximum(box[0], boxes[:, 0]) y2 = np.minimum(box[2], boxes[:, 2]) x1 = np.maximum(box[1], boxes[:, 1]) x2 = np.minimum(box[3], boxes[:, 3]) return np.divide(np.maximum(x2 - x1, 0) * np.maximum(y2 - y1, 0),box_area)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_iou(box, boxes):\n # Calculate intersection areas\n iou = [box.intersection(b).area / box.union(b).area for b in boxes]\n\n return np.array(iou, dtype=np.float32)", "def compute_iou(box, boxes, box_area, boxes_area):\n # Calculate intersection areas\n x1 = np.maximum(box[0], boxes[:, 0...
[ "0.8233654", "0.8128509", "0.8116598", "0.8116598", "0.8116598", "0.80252707", "0.79859704", "0.7928408", "0.77582073", "0.77385104", "0.77119327", "0.7706524", "0.7639222", "0.7638932", "0.7638932", "0.76373506", "0.76087755", "0.76022065", "0.76022065", "0.75603807", "0.751...
0.0
-1
Calculates IoU of the given box with the array of the given boxes.
def compute_iou(box, boxes, box_area, boxes_area): # Calculate intersection areas y1 = np.maximum(box[0], boxes[:, 0]) y2 = np.minimum(box[2], boxes[:, 2]) x1 = np.maximum(box[1], boxes[:, 1]) x2 = np.minimum(box[3], boxes[:, 3]) intersection = np.maximum(x2 - x1, 0) * np.maximum(y2 - y1, 0) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_iou(box, boxes):\n # Calculate intersection areas\n iou = [box.intersection(b).area / box.union(b).area for b in boxes]\n\n return np.array(iou, dtype=np.float32)", "def compute_iou(box, boxes, box_area, boxes_area):\n # Calculate intersection areas\n x1 = np.maximum(box[0], boxes[:, 0...
[ "0.8233654", "0.8128509", "0.80252707", "0.79859704", "0.7928408", "0.77582073", "0.77385104", "0.77119327", "0.7706524", "0.7639222", "0.7638932", "0.7638932", "0.76373506", "0.76087755", "0.76022065", "0.76022065", "0.75603807", "0.7515975", "0.72115165", "0.7174434", "0.71...
0.8116598
3
Computes IoU overlaps between two sets of boxes.
def compute_overlaps(boxes1, boxes2): # Areas of anchors and GT boxes area1 = (boxes1[:, 2] - boxes1[:, 0]) * (boxes1[:, 3] - boxes1[:, 1]) area2 = (boxes2[:, 2] - boxes2[:, 0]) * (boxes2[:, 3] - boxes2[:, 1]) # Compute overlaps to generate matrix [boxes1 count, boxes2 count] # Each cell contains t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bbox_overlaps(bboxes1, bboxes2, mode='iou'):\n\n from icv.data.core.bbox import BBox\n assert mode in ['iou', 'iof']\n\n bboxes1 = np.array([np.array(b.bbox) if isinstance(b,BBox) else b for b in bboxes1])\n bboxes2 = np.array([np.array(b.bbox) if isinstance(b,BBox) else b for b in bboxes2])\n\n ...
[ "0.7990258", "0.78904206", "0.7689194", "0.7660567", "0.7657809", "0.7563204", "0.7563204", "0.7537507", "0.7537489", "0.7537075", "0.7535801", "0.7518172", "0.74753666", "0.7450694", "0.74426514", "0.74420667", "0.73539835", "0.7332804", "0.731948", "0.7306193", "0.72520274"...
0.81729996
0
Get all the pairs of interacting residues from two proteins that are within a certain distance.
def get_interactions(list_atoms1, list_atoms2, dist): beta_carbons1 = list(filter(lambda x: x.get_id() == "CB", list_atoms1)) beta_carbons2 = list(filter(lambda x: x.get_id() == "CB", list_atoms2)) ns = NeighborSearch(beta_carbons1) interactions = [] for atom in beta_carbons2: interact = ns...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_closest_points_2d(P1, P2):\r\n\r\n A_1 = []\r\n A_2 = []\r\n\r\n for p1_id in range(0,len(P1)):\r\n d_i = 100000\r\n d_f = 0\r\n\r\n Point = []\r\n\r\n for p2_id in range(0,len(P2)):\r\n d_f = euclidean_distance_2(P1[p1_id],P2[p2_id])\r\n\r\n if d_...
[ "0.6220838", "0.61719257", "0.59122163", "0.58906657", "0.586396", "0.5844812", "0.58085406", "0.5768291", "0.5693437", "0.5661015", "0.56012255", "0.55946124", "0.5582859", "0.55632806", "0.55475515", "0.5537653", "0.5498095", "0.54965824", "0.5456797", "0.54521513", "0.5415...
0.59804183
2
Close and shutdown sockets and connection
def close(self) -> None: self.__is_active = False if self.__connection is not None: self.__connection.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shutdown(self):\r\n self.socket.close()\r\n # self.socket_video.close()\r\n self.socket_state.close()", "def shutdown(self):\n self.sock.close()", "def close(self):\n if self.socket is not None:\n try:\n self.socket.shutdown(2)\n excep...
[ "0.8226016", "0.7964312", "0.784553", "0.7837744", "0.77594286", "0.7735829", "0.7615989", "0.7611033", "0.760557", "0.75683033", "0.7541371", "0.7538251", "0.75269824", "0.7443392", "0.741075", "0.7410218", "0.7409785", "0.7402068", "0.74015504", "0.74015135", "0.74015135", ...
0.0
-1
Return the version identifier of the current store state.
def version(self): raise NotImplementedError('version')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def version(self) -> Optional[pulumi.Input['FhirStoreVersion']]:\n return pulumi.get(self, \"version\")", "def version(self):\r\n return self.version_guid", "def identifier_version(self):\n return next(self.graph[self.identifier_bound:owl.versionIRI])", "def version_id(self) -> pulumi.Ou...
[ "0.72512376", "0.695747", "0.6941922", "0.687185", "0.68630636", "0.67687935", "0.67407936", "0.67307717", "0.67116773", "0.6640965", "0.66392475", "0.66392475", "0.66392475", "0.66392475", "0.6635625", "0.6613744", "0.6588299", "0.6582557", "0.6547867", "0.65447706", "0.6541...
0.0
-1
Turn off all LEDs of the DotStar strip.
def clear_strip(self): self.spi.write(bytearray([0] * 4 + [255, 0, 0, 0] * self.bmp2led.num_pixels + [255] * ((self.bmp2led.num_pixels + 15) // 16)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def off(self):\n for light in self.all:\n GPIO.output(light, 0)", "def turn_all_off(self):\n for led_type in LED:\n self.led_off(led_type)\n logging.info('LED: ALL - Status: 0')", "def all_off():\n Leds.red_left.brightness = 0\n Leds.red_right.brightness...
[ "0.7888904", "0.7400187", "0.73682964", "0.7360544", "0.7255599", "0.7219795", "0.7209766", "0.7132352", "0.70545423", "0.69862396", "0.6957128", "0.6953507", "0.6932725", "0.6909033", "0.6853271", "0.68143815", "0.6800145", "0.6759947", "0.67106116", "0.6708061", "0.66907585...
0.0
-1
Return the value of the given stateaction pair
def get_state_action_value(self, state, action): state_tensor = torch.from_numpy(state).float().to(self.device) output = torch.dot(self.weights[action,:],state_tensor) return output
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def action_value(self, state, action):\n return self.value_function[to_table_index(state, action)]", "def get_state_action_value(self, state, action):\n raise NotImplementedError", "def getQValue(self, state, action):\n \"*** YOUR CODE HERE ***\"\n\n return self.values[(str(state), ...
[ "0.8025442", "0.79498625", "0.78717256", "0.7635291", "0.7574047", "0.75734794", "0.75489855", "0.7420877", "0.73798805", "0.73798805", "0.73798805", "0.73798805", "0.7344557", "0.73308986", "0.73293626", "0.73293626", "0.73293626", "0.73293626", "0.73293626", "0.73293626", "...
0.7288848
26
Return the value of the given stateaction pair
def get_state_action_value(self, state, action): state_tensor = torch.from_numpy(state).float().to(self.device) output = torch.dot(self.weights[action,:],state_tensor.view(-1)) return output
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def action_value(self, state, action):\n return self.value_function[to_table_index(state, action)]", "def get_state_action_value(self, state, action):\n raise NotImplementedError", "def getQValue(self, state, action):\n \"*** YOUR CODE HERE ***\"\n\n return self.values[(str(state), ...
[ "0.80276626", "0.795146", "0.7872588", "0.76328826", "0.75749767", "0.75744814", "0.7549472", "0.7418124", "0.73807997", "0.73807997", "0.73807997", "0.73807997", "0.73456675", "0.73264176", "0.73264176", "0.73264176", "0.73264176", "0.73264176", "0.73264176", "0.73264176", "...
0.7332363
13
Return the group ID
def group_id(self): return self._id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def group_id(self) -> str:\n return pulumi.get(self, \"group_id\")", "def group_id(self) -> str:\n return pulumi.get(self, \"group_id\")", "def GroupId(self):\n\t\treturn self._get_attribute('groupId')", "def group_id(self):\n return self._group_id", "def group_id(self):\n retur...
[ "0.89156306", "0.89156306", "0.8833338", "0.8735677", "0.8735677", "0.8735677", "0.8662106", "0.8641046", "0.8603176", "0.8590198", "0.85514855", "0.8358276", "0.83364713", "0.83364713", "0.83364713", "0.78458196", "0.7838624", "0.7830914", "0.78196335", "0.7753614", "0.77427...
0.8825894
3
Return True if this is a group amdin group Returns bool indicating whether or not members of this group are able to administer group memberships of any groups on the system.
def is_group_admin_group(self): groups = self['__store'] return self.group_id in groups.get_group_admin_group_ids()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_admin(self,user):\n if user.is_superuser:\n return True\n\n if user.groups.filter(name=self.admin_group_name).count() > 0:\n return True\n else:\n return False", "def is_admin(self, user) -> bool:\n return (\n user.is_superuser\n ...
[ "0.72873867", "0.7059797", "0.68159175", "0.6769821", "0.6706483", "0.67023385", "0.66888475", "0.6678075", "0.6653066", "0.6600334", "0.65930074", "0.65486026", "0.65431315", "0.65217096", "0.651486", "0.6501157", "0.64216006", "0.64158636", "0.6395955", "0.6382704", "0.6366...
0.8059573
0
Returns the administrator group name
def administrators(self): store = self['__store'] admin_group = store.get(self.get('admin_group_id', None)) if admin_group: return admin_group.name return 'nothing'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def admin_group_name(self):\n return self.short_name+\"_admins\"", "def get_group_name(self):\n return self.groupname", "def group_name(self) -> str:\n return pulumi.get(self, \"group_name\")", "def get_security_group_short_name(self):\n return self.config['security_group']", "d...
[ "0.82731897", "0.75625664", "0.74049485", "0.7158549", "0.7133534", "0.7036086", "0.6978985", "0.6978985", "0.69113356", "0.68901753", "0.67829925", "0.67626375", "0.6743625", "0.6741621", "0.6741621", "0.6728629", "0.6712347", "0.6568609", "0.65675133", "0.6515803", "0.65049...
0.8095456
1
Update apps by app group ids
def update_apps_by_id(self, app_ids): return self.update_supergroups_by_id(app_ids, 'app')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_app_groups(self, app_groups, operation_type):\n for app_group in app_groups:\n app_group[\"flags\"] = {\n operation_type: True\n }\n self._app_groups = app_groups\n self._modify_schedule_policy_properties()", "def set_apps(self, new_apps):\n ...
[ "0.6434253", "0.63284683", "0.61405957", "0.6094547", "0.6081245", "0.6024579", "0.5925237", "0.59032786", "0.58908784", "0.58757144", "0.5824666", "0.58239055", "0.5814318", "0.5791068", "0.57755035", "0.5754458", "0.5739425", "0.5735661", "0.5687409", "0.56152153", "0.56049...
0.8027855
0
Post updated group memberships
def update_members_by_id(self, user_ids): updated = set(int(id) for id in user_ids) logger = logging.getLogger(__name__) debug = logger.debug db = self['__store'].db users = zoom.users.Users(db) debug('updating members: %r', updated) cmd = 'select user_id fro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_users_groups_post(self):\n pass", "def groups_update(self, mar, request):\n group_id = mar.viewed_user_auth.user_id\n member_ids_dict, owner_ids_dict = self._services.usergroup.LookupMembers(\n mar.cnxn, [group_id])\n owner_ids = owner_ids_dict.get(group_id, [])\n member_ids = ...
[ "0.66777635", "0.66728055", "0.65853345", "0.65093434", "0.6490823", "0.6481676", "0.6472818", "0.64283276", "0.6389209", "0.6298107", "0.62815", "0.6263807", "0.62254673", "0.6215808", "0.621252", "0.61899585", "0.6180922", "0.6166971", "0.6136744", "0.6129081", "0.60964304"...
0.56305474
40
tocs One or more TOCs (Tables of Contents), normally an Analysis.pure. If this TOC has an attribute `_code_cache`, this is expected to be a dict of module code objects from ModuleGraph. kwargs
def __init__(self, *tocs, **kwargs): from PyInstaller.config import CONF Target.__init__(self) name = kwargs.get('name', None) cipher = kwargs.get('cipher', None) self.toc = TOC() # If available, use code objects directly from ModuleGraph to speed up PyInstaller. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compile_pycos(toc):\n global BUILDPATH\n\n # For those modules that need to be rebuilt, use the build directory\n # PyInstaller creates during the build process.\n basepath = \"/\".join([BUILDPATH, \"localpycos\"])\n\n new_toc = []\n for (nm, fnm, typ) in toc:\n\n # Trim the terminal \...
[ "0.6388336", "0.5847333", "0.53447455", "0.53239065", "0.53239065", "0.53239065", "0.5264372", "0.5197867", "0.50625503", "0.49940208", "0.49513757", "0.49335647", "0.4905165", "0.48410487", "0.4824864", "0.4794297", "0.4791417", "0.47382355", "0.4663958", "0.46632838", "0.46...
0.5248665
7
check string is valid ip address string
def is_ip(self,inputs): format = '((?:(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d))' pattern = re.match(format, inputs) if pattern is not None: return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_valid_ipaddress(str_ip: str) -> bool:\n try:\n ipaddress.ip_address(str_ip)\n return True\n except ValueError:\n return False", "def is_ip(string):\n return ipv4.is_ip(string) or ipv6.is_ip(string)", "def is_valid_ip(ip):\n ...", "def _is_valid_ip(self, address):\r\n ...
[ "0.8318397", "0.79284453", "0.78429705", "0.77904046", "0.77660614", "0.7712624", "0.7698703", "0.76797354", "0.76436925", "0.76039636", "0.754775", "0.7510383", "0.7503149", "0.7499064", "0.7481129", "0.7459918", "0.7459599", "0.74506295", "0.74488795", "0.74433327", "0.7376...
0.7686832
7
Gather all torch parameters in each `TorchPipe`s, and create an optimizer.
def resume_training(self, **kwargs) -> Optimizer: # type: ignore assert hasattr(self, "pipeline") params = self.get_params() return self.create_optimizer(params, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def optimization(self, pipeline, max_evals):\n hyperparameter = self.hyperparameter_tunning(pipeline, max_evals)\n self.pipeline_dict['hyperparameter'] = hyperparameter", "def __init__(self,\n forward_models,\n forward_model_optim=tf.keras.optimizers.Adam,\n ...
[ "0.62348574", "0.6012905", "0.5845732", "0.5806131", "0.57638663", "0.5680216", "0.567872", "0.56155795", "0.55297214", "0.5504017", "0.5502343", "0.54859793", "0.5485532", "0.54807246", "0.5449912", "0.5447135", "0.5431203", "0.5419512", "0.54169554", "0.54083735", "0.540735...
0.0
-1
Opens a new database connection if there is none yet for the current application context.
def get_db(): if not hasattr(g, 'sqlite_db'): g.sqlite_db = connect_db() return g.sqlite_db
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def db_open():\n if not hasattr(g, 'sqlite_db'):\n g.sqlite_db = db_connect()\n return g.sqlite_db", "def open_database(self):\n if self._conn is None:\n self._conn = sqlite3.connect(self._db_path)", "def open_db(db_name: str = DB_NAME) -> DBConnection:\n return sqlite3.connec...
[ "0.7737639", "0.7582971", "0.73180443", "0.71693045", "0.70220166", "0.6966687", "0.6954785", "0.69486743", "0.6897534", "0.6842663", "0.68292314", "0.68191963", "0.680592", "0.67950195", "0.67697805", "0.6762173", "0.6751266", "0.6746273", "0.67316663", "0.670031", "0.668866...
0.640242
77
Specify who you want to pay for release. Defaults to you.
async def _bailout_heist(self, ctx, user: discord.Member=None): author = ctx.message.author theme = await self.thief.get_guild_theme(ctx.guild) t_bail = theme["Bail"] t_sentence = theme["Sentence"] if user is None: player = author else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_owner(self, owner):\n self.settings[\"owner\"] = owner", "def use(target, name):\n return \"You use the \" + name + \" to pay \" + target.name", "def owner(self, owner: str):\n\n self._owner = owner", "def distributor(self) -> Optional[pulumi.Input[str]]:\n return pulumi.g...
[ "0.56409293", "0.56209874", "0.51891136", "0.5075082", "0.5075082", "0.5007444", "0.49734676", "0.49693066", "0.4951719", "0.49499342", "0.49372828", "0.49185884", "0.49091807", "0.48933157", "0.48930064", "0.48854217", "0.4863039", "0.48510385", "0.48455834", "0.48428652", "...
0.0
-1
tokenize documents and preprocess with stemmer (or not) removes small words (12 chars) removes numbers returns array of arrays (list of tokens in each document)
def tokenizer(docs, stop, stemmer): init = time.time() import re regex = re.compile('^\d*[.,]?\d*$') tok_docs = [] for doc in docs: toks = [stemmer.stem(tok) for tok in word_tokenize(doc) if not tok in stop ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def processes_and_tokenize(raw_document):\n\ttokenizer = RegexpTokenizer(r'\\w+')\n\ttokens = tokenizer.tokenize(raw_document.lower())\t\t# tokens = nltk.word_tokenize(corpus.lower()) # without removing punctiation\n\n\t#remove stop words\n\tstop_words = set(nltk.corpus.stopwords.words('english'))\n\t#stop_words =...
[ "0.7697597", "0.74643224", "0.74624354", "0.7413457", "0.74129677", "0.7384192", "0.7372711", "0.73623204", "0.73561376", "0.7347036", "0.7222008", "0.72213477", "0.71896404", "0.7183078", "0.7180746", "0.7178835", "0.71431893", "0.7136261", "0.7091147", "0.7082246", "0.70801...
0.7133871
18
Tests windows of small length that are normalized to 1. See the documentation for the Taylor window for more information on normalization.
def test_normalized(self): assert_allclose(windows.taylor(1, 2, 15), 1.0) assert_allclose( windows.taylor(5, 2, 15), np.array([0.75803341, 0.90757699, 1.0, 0.90757699, 0.75803341]) ) assert_allclose( windows.taylor(6, 2, 15), np.array([ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_non_normalized(self):\n assert_allclose(\n windows.taylor(5, 2, 15, norm=False),\n np.array([\n 0.87508054, 1.04771499, 1.15440894, 1.04771499, 0.87508054\n ])\n )\n assert_allclose(\n windows.taylor(6, 2, 15, norm=False),\n ...
[ "0.693231", "0.5852944", "0.5824091", "0.5813663", "0.5779127", "0.5678927", "0.56341004", "0.5628803", "0.56145126", "0.5593999", "0.55509543", "0.5528892", "0.55057746", "0.54885566", "0.5449871", "0.5432865", "0.5407584", "0.540464", "0.54026544", "0.5385893", "0.537957", ...
0.740907
0
Compute new learning rate given the old learning rate
def update_lr(self, *args, **kwargs): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def learning_rate(epoch):\n self.lr = self.lr / 1.00000001\n return self.lr", "def get_learning_rate():\n return 0.00001", "def update_learning_rate(self):\n self.scheduler.step()\n lr = self.optimizer.param_groups[0]['lr']\n print('learning rate = %.7f' % lr)", ...
[ "0.79107493", "0.7664384", "0.76230997", "0.7568912", "0.7563467", "0.7563467", "0.74999577", "0.7457279", "0.7454079", "0.74362475", "0.74362475", "0.74102443", "0.7405542", "0.73833823", "0.7355138", "0.7353453", "0.73001283", "0.72837174", "0.7250734", "0.72296596", "0.716...
0.0
-1
Get the precipitation forecast for the specified time frame.
def get_precipitation(self, lat: Optional[float] = None, long: Optional[float] = None, time_frame: Optional[int] = None) -> BuienradarPrecipitationResponse: data = self.get_data(lat, long, time_frame).get('precipitation_forecast', {}) return BuienradarPrecipitationResponse( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forecast(self) -> TSDataset:\n future = self.ts.make_future(self.horizon)\n predictions = self.model.forecast(future)\n return predictions", "def get_forecast(self, index: int) -> QuantileForecasts:\n # If this job was initialized from Sagemaker, load it from the Sagemaker job\n ...
[ "0.6218127", "0.5919591", "0.5877034", "0.58056325", "0.57791793", "0.5666769", "0.55921024", "0.5525678", "0.5510178", "0.5471158", "0.54336786", "0.53708804", "0.5324199", "0.52646524", "0.525668", "0.5227249", "0.51410526", "0.5125636", "0.50894153", "0.5080412", "0.505378...
0.5582583
7
Return the node's NodeGraph NodeGraph
def nodegraph(self): return self._nodegraph
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getOneNodeGraph(self):\n layer = self.makeLayer()\n self.addNodeToLayer(layer)\n\n return self.graph", "def get_graph(self):\n return self._graph", "def graph(self):\n return self.__graph", "def getGraph(self):\n\t\treturn self.graph", "def graph(self):\n retur...
[ "0.73016775", "0.7204065", "0.71601033", "0.7048062", "0.7035083", "0.7035083", "0.6930696", "0.69170517", "0.6902187", "0.6896812", "0.687968", "0.6845988", "0.68274575", "0.6810035", "0.675057", "0.6749938", "0.6485926", "0.6470273", "0.64138275", "0.6396021", "0.6389931", ...
0.84522706
0
Loads PaLM vocab only works internally.
def load_vocab(): # vocab loaded internally at google unused = r.sp_model del unused return r
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_vocab(self, fn):\n vocab = load_vocab(fn)\n self.vocab = vocab\n self.has_vocab = True", "def load_vocab(fn):\n return corpora.Dictionary.load(fn)", "def load_vocab(path: str) -> Vocab:\n return torch.load(path, map_location=lambda storage, loc: storage)['args'].vocab", "d...
[ "0.74547046", "0.7163356", "0.7048411", "0.673345", "0.6692046", "0.6650584", "0.66093504", "0.6512217", "0.65044004", "0.6490185", "0.6481662", "0.647369", "0.64578485", "0.64502347", "0.64196974", "0.6409408", "0.63728464", "0.6166811", "0.6137364", "0.6061744", "0.60443956...
0.782089
0
Returns the pytree from a checkpoint file path.
def parse_checkpoint(checkpoint_path): with gfile.Open(checkpoint_path, 'rb') as fp: raw_contents = fp.read() if raw_contents.startswith(b'model_checkpoint_path'): raise ValueError( 'Attempting to restore a TensorFlow checkpoint as a native T5X ' f'checkpoint. Path: {checkpoint_path}...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_checkpoint_file(path, checkpoint):\n if checkpoint is not None:\n return checkpoint\n else:\n file_list = glob.glob(path + \"/*.pt\")\n if not file_list:\n raise AssertionError(\"Please ensure a checkpoint file (.pt)\"\n f\" is present i...
[ "0.6083149", "0.60600823", "0.5867521", "0.5751019", "0.5648478", "0.5643851", "0.56255007", "0.56063", "0.5599683", "0.55895084", "0.5570945", "0.5542903", "0.54789066", "0.5448071", "0.5443102", "0.54409754", "0.5418238", "0.5418188", "0.54128486", "0.54072845", "0.53696245...
0.6173213
0
Splits an iterable into chunks of size n.
def batch( iterable: Iterable[_T], n: int ) -> Generator[tuple[_T, ...], None, None]: iterator = iter(iterable) while True: try: # Unnecessary list here, but a generator won't raise StopIteration, # instead it will raise RuntimeError: "generator raises StopIteration". # I'd rather have a l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_to_batches(iterable, n=1):\n l = len(iterable)\n for ndx in range(0, l, n):\n yield iterable[ndx:min(ndx + n, l)]", "def chunk(iterable, n):\n iterable = [e for e in iterable]\n avg_length = int(math.ceil(len(iterable) / n))\n return [iterable[i * avg_length:(i + 1) * avg_length] ...
[ "0.84885985", "0.8449931", "0.83416164", "0.83344704", "0.8277892", "0.8257809", "0.82528317", "0.8247746", "0.824125", "0.8226297", "0.82259643", "0.82184935", "0.8208977", "0.8184857", "0.8184857", "0.8184857", "0.8184857", "0.8184857", "0.81651706", "0.8160641", "0.8158792...
0.0
-1
converts a timestamp to seconds
def hours_minutes_seconds(value): try: return int(value) except ValueError: pass match = (_hours_minutes_seconds_re.match(value) or _hours_minutes_seconds_2_re.match(value)) if not match: raise ValueError s = 0 s += int(match.group("hours") or "0") * 60 * 6...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timestamp2sec(timestamp):\n return (int(timestamp.seconds) + 60 * int(timestamp.minutes) + 3600 * int(timestamp.hours) + float(int(timestamp.hours) / 1000))", "def to_seconds(time):\n return 3600 * time", "def ts_to_epoch_seconds(t) -> float:\n return t.astype(int) / 1e9", "def to_seconds(hours,...
[ "0.84017295", "0.75573933", "0.74558437", "0.7085874", "0.70557505", "0.70189095", "0.70137745", "0.69444406", "0.6938694", "0.68768996", "0.6874828", "0.6825287", "0.6779684", "0.6731789", "0.67272127", "0.6722617", "0.6683075", "0.6654156", "0.66440445", "0.6640721", "0.663...
0.0
-1
Gets all Todos resource.
def get(self): todos = { 'todos': [ { 'id': 1, 'description': 'Create README file' }, { 'id': 2, 'description': 'Publish to Github' } ] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def todos(self):\r\n return Todos(self)", "def get_todos(self):\n if self.is_new:\n # if its a new project then create the todo items from the yml\n # templates\n return self.get_yml_todos()\n else:\n # check for existing todos\n return ...
[ "0.75168145", "0.6883351", "0.68827796", "0.6579338", "0.65217936", "0.6414708", "0.63957435", "0.6243867", "0.60718876", "0.5891086", "0.5819834", "0.5784376", "0.5775382", "0.57740855", "0.5772143", "0.567011", "0.5657571", "0.56499344", "0.5645021", "0.56344616", "0.562194...
0.6604196
3
Create an isoformat date string from this Date.
def to_isoformat(self) -> str: return self.isoformat()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isoformat(self):\n return \"%04d-%02d-%02d\" % (self._year, self._month, self._day)", "def isoformat(self):\n s = '{0:04}'.format(self._year)\n if self._month:\n s += '-{0:02}'.format(self._month)\n if self._day:\n s += '-{0:02}'.format(self._day)\n ...
[ "0.75414586", "0.736134", "0.71829635", "0.71418405", "0.7099204", "0.6878252", "0.6816845", "0.6789153", "0.6730386", "0.6695931", "0.66583467", "0.66230786", "0.6574283", "0.650539", "0.6443834", "0.6401029", "0.6397785", "0.63933116", "0.63633114", "0.62939066", "0.6256426...
0.75690156
0
Create a date string from this Date using a format string.
def to_format(self, format_string: str) -> str: return self.strftime(format_string)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strfdate(self, fmt):\n pattern = r'%({})'.format(reduce(lambda x, y: '{}|{}'.format(x, y), FORMAT_MAP.keys()))\n for f in re.findall(pattern, fmt):\n fmt = fmt.replace('%{}'.format(f), FORMAT_MAP[f](self))\n return fmt", "def from_format(cls, date_string: str, format_string: s...
[ "0.6933965", "0.68708915", "0.68092424", "0.6585816", "0.6450375", "0.63761795", "0.6354226", "0.6313782", "0.63034517", "0.62871087", "0.6269514", "0.62582916", "0.6254345", "0.6223545", "0.6222153", "0.6173694", "0.613281", "0.6124387", "0.6120722", "0.6117278", "0.61069894...
0.69485676
0
Create a humanreadable time string from this DateTime with several options.
def to_casual(self, full_month: bool = False, day_first: bool = True, day_suffix: bool = False) -> str: day, month, year = self.Day.with_suffix if day_suffix else self.day, self.Month.full if full_month else self.Month.short, self.Year.with_century return " ".join([str(item) for item in ((day, month, ye...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_time_string(self):\n return f\"{self.year} {self.month:02} \" \\\n f\"{self.start_day:02} {self.start_hour:02} 00 {self.get_duration():6}\"", "def create_time_str(self):\n ts = time.localtime(self._create_ts)\n return time.strftime(\"%Y-%m-%d %H:%M:%S\", ts)", "def __str...
[ "0.7110949", "0.6817784", "0.6801233", "0.6718882", "0.6642093", "0.66080934", "0.6581386", "0.6561189", "0.6560545", "0.6442802", "0.6390975", "0.63618034", "0.63426423", "0.6267777", "0.626095", "0.6247236", "0.62433845", "0.6239813", "0.62271416", "0.62006533", "0.619565",...
0.0
-1
Create a Date from today at midnight.
def today(cls, **kwargs: Any) -> Date: return cls.from_date(dt.date.today())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def today(cls):\n timestamp = time.localtime()\n return Date(timestamp[0], timestamp[1], timestamp[3], timestamp[6], timestamp[7])", "def get_today() -> datetime.date:\n return datetime.date.today()", "def _today() -> datetime.date:\n return datetime.today().date()", "def today():\n to...
[ "0.74099165", "0.7333084", "0.7278586", "0.72465634", "0.7152306", "0.69251025", "0.68287486", "0.68287486", "0.6661718", "0.6661391", "0.665765", "0.6654856", "0.6652682", "0.6538258", "0.6535921", "0.6450293", "0.6362922", "0.6357925", "0.6332802", "0.6300479", "0.627944", ...
0.74643505
0
Create a Date from a time.date object.
def from_date(cls, date: dt.date) -> Date: return cls(date.year, date.month, date.day)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_datetime_obj(date, time):\n\n conv_date = datetime.strptime(date, \"%Y-%m-%d\").date()\n conv_time = datetime.strptime(time, \"%H:%M\").time()\n\n return datetime.combine(conv_date, conv_time)", "def fromdate(cls, date):\n return cls(date.year, date.month, date.day)", "def date_to_date...
[ "0.7220657", "0.6966645", "0.6937123", "0.67936563", "0.6624508", "0.6614254", "0.65052974", "0.64413595", "0.63926005", "0.6317461", "0.62916887", "0.6284789", "0.6274759", "0.6233129", "0.6200301", "0.6173724", "0.6166902", "0.6122965", "0.6098339", "0.6051661", "0.59796745...
0.7382172
0
Create a Date from a valid python object. Raises TypeError if an unsupported type is passed. Raises ValueError if an invalid instance of a supported type (like 'str' or 'int') is passed.
def infer(cls, datelike: Union[dt.datetime, dt.date, int, str]) -> Date: if isinstance(datelike, dt.datetime): return cls(datelike.year, datelike.month, datelike.day) elif isinstance(datelike, cls): return datelike elif isinstance(datelike, dt.date): return cl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_date(obj: \"Any\") -> date:\n if isinstance(obj, date):\n return obj\n elif isinstance(obj, datetime):\n return obj.date()\n elif isinstance(obj, (int, float)):\n return date(1970, 1, 1) + timedelta(days=obj)\n elif isinstance(obj, str):\n for fmt in DATE_FORMATS:\n ...
[ "0.7450836", "0.6951005", "0.6691249", "0.66588193", "0.63721585", "0.6272691", "0.61928105", "0.6164889", "0.61193395", "0.60615635", "0.60614127", "0.6043271", "0.5995233", "0.59876716", "0.5985614", "0.59645593", "0.5880631", "0.5874277", "0.58578247", "0.58540434", "0.584...
0.6367289
5
Construct a `Search` instance from a draw dict containing the search body.
def from_dict(cls, d): s = cls() s.update_from_dict(d) return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, dikt) -> 'SearchResult':\n return util.deserialize_model(dikt, cls)", "def create(ctx, payload):\n payload = parse_payload(ctx, payload)\n r = SavedSearch(ctx.obj['TOKEN'], ctx.obj['DEBUG']).create(payload)\n click.echo(json_dumps(r, ctx.obj['PRETTY']))", "def construct(self)...
[ "0.57710487", "0.56360793", "0.5615689", "0.55305743", "0.55175436", "0.5382924", "0.5382924", "0.52906585", "0.52845085", "0.5235228", "0.522636", "0.5198401", "0.5188544", "0.5185464", "0.5156216", "0.51433825", "0.5136985", "0.51216304", "0.5109404", "0.5091168", "0.503521...
0.4971267
73
Add sorting information to the search request. If called without arguments it will remove all sort requirements. Otherwise it will
def sort(self, *keys): s = self._clone() s._sort = [] for k in keys: if isinstance(k, str) and k.startswith('-'): k = {k[1:]: {"order": "desc"}} s._sort.append(k) return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_by_user_arg(user_argument = 'sort by ex. artist'):\n pass", "def init(req, model):\n\n rels = model.relationships\n fields = model.all_fields\n\n params = req.get_param_as_list('sort') or [goldman.config.SORT]\n params = [Sortable(param.lower()) for param in params]\n\n for param in pa...
[ "0.66080487", "0.6545593", "0.6393814", "0.6366594", "0.6349183", "0.6149911", "0.6138048", "0.6136657", "0.6129322", "0.60635847", "0.60281175", "0.6025556", "0.602447", "0.5989252", "0.59840035", "0.59762186", "0.590449", "0.58013254", "0.5782561", "0.5769298", "0.5759062",...
0.0
-1
Timezones are often stored as abreviations such as EST. These are ambiguous, but should still be handled. See
def getTimeZoneDict(): if not len(TimeZoneDict): for tz_descr in map(str.split, TimeZoneStr.split('\n')): tz_offset = int(float(tz_descr[0]) * 3600) for tz_code in tz_descr[1:]: TimeZoneDict[tz_code] = tz_offset return TimeZoneDict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timezone():\n \n pass", "def test_timezones(self):\n a_user = User.objects.create()\n user = VSBUser.objects.create(user=a_user)\n\n today_datetime = timezone.datetime.today()\n today_datetime = timezone.datetime(year=today_datetime.year, month=today_datetime.month, day=today...
[ "0.69378114", "0.69220954", "0.6883536", "0.67076755", "0.6446923", "0.64340466", "0.6388828", "0.6376133", "0.6367042", "0.63650316", "0.6356866", "0.6356866", "0.6356866", "0.6356866", "0.6356866", "0.6356866", "0.6356866", "0.6356866", "0.6356866", "0.6356866", "0.6356866"...
0.5615681
79
Convert a timezone relative datetime a to nonrelative utc datetime.
def datetime_to_utc(dt): if dt.tzinfo: # Reduce [24, 48) hour offsets. if dt.tzinfo._offset >= datetime.timedelta(1): dt.tzinfo._offset -= datetime.timedelta(1) dt += datetime.timedelta(1) elif dt.tzinfo._offset <= datetime.timedelta(-1): dt.tzinfo._offset...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tz_as_utc(dt: datetime) -> datetime:\n if dt.tzinfo is None:\n return dt.replace(tzinfo=tzutc())\n return dt.astimezone(tzutc())", "def to_utc(dt):\n if dt.tzinfo is None:\n return dt.replace(tzinfo=pytz.utc)\n else:\n return dt.astimezone(pytz.utc)", "def fromutc(self, dt)...
[ "0.7210858", "0.71615225", "0.7091327", "0.7077078", "0.7048212", "0.70145214", "0.7007961", "0.69734097", "0.69734097", "0.69734097", "0.693837", "0.6934955", "0.6908958", "0.69082457", "0.6906368", "0.6901625", "0.68752646", "0.6771138", "0.67469096", "0.67440575", "0.67392...
0.7210598
1
Sets the learning rate to the initial LR decayed by 10 every 30 epochs
def adjust_learning_rate(optimizer, epoch,threshold,lr_init,lr_decay_rate): lr = lr_init * (lr_decay_rate ** (epoch // threshold)) for param_group in optimizer.param_groups: param_group['lr'] = lr return lr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjust_learning_rate(init_lr, optimizer, epoch, n=100):\n init_lr = init_lr * (0.1 ** (epoch // n))\n print('learning rate : ', init_lr)\n for param_group in optimizer.param_groups:\n param_group['lr'] = init_lr", "def adjust_learning_rate(start_lr, optimizer, epoch, total_epoch_num):\n #l...
[ "0.7913536", "0.7906521", "0.7849834", "0.777524", "0.77338326", "0.77306354", "0.7722718", "0.77224237", "0.771982", "0.77092624", "0.7693604", "0.76742035", "0.7665748", "0.7665748", "0.7665748", "0.7655329", "0.76419765", "0.76399755", "0.7637868", "0.7626077", "0.76247585...
0.757343
34
Returns a set of MotionAction(s) that are valid to be executed from robot pose (i.e. they will not bump into obstacles). The validity is determined under the assumption that the robot dynamics is deterministic.
def valid_motions(self, robot_id, robot_pose, all_motion_actions): state = MosOOState(self._obstacle_states) state.set_object_state(robot_id, RobotState(robot_id, robot_pose, None, None)) valid = set({}) for motion_action in all_motion_actions: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_valid_move_actions(pos,obstacles):\n\n valid_actions = [False]*len(global_defs.Actions)\n for idx,action in enumerate(global_defs.Actions[:-1]):\n valid = check_valid(pos+global_defs.ACTIONS_TO_MOVES[action])\n if valid:\n valid_actions[idx] = True\n #The last action, i.e....
[ "0.7243671", "0.6776928", "0.67530525", "0.64807683", "0.62983394", "0.6268939", "0.62421227", "0.62382", "0.6225572", "0.6219347", "0.61160934", "0.6113396", "0.61110914", "0.6083935", "0.60742635", "0.60727865", "0.6024543", "0.60100716", "0.59611654", "0.5959929", "0.59446...
0.7322208
0