query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
r"""Bipartite minimum vertex cover by Koenig's theorem
def bipartite_vertex_cover(bigraph, algo="Hopcroft-Karp"): if algo == "Hopcroft-Karp": coord = [(irow,icol) for irow,cols in enumerate(bigraph) for icol in cols] coord = np.array(coord) graph = csr_matrix((np.ones(coord.shape[0]),(coord[:,0],coord[:,1]))) matchV = maximum_bipartite_m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exact_min_vertex_cover(graph):\n for N in range(1,len(graph.nodes())+1):\n for graph_sub in it.combinations(sorted(graph.nodes(), reverse=True), N):\n graph_temp = graph.copy()\n graph_temp.remove_nodes_from(graph_sub)\n if len(graph_temp.edges()) == 0:\n ...
[ "0.67481375", "0.61694205", "0.6149757", "0.609714", "0.5962849", "0.5844434", "0.5786878", "0.5711792", "0.5663171", "0.55802995", "0.5518253", "0.55088633", "0.5498447", "0.5490648", "0.54636157", "0.5463585", "0.5462697", "0.5456863", "0.5441173", "0.5436142", "0.5426519",...
0.73563415
0
connect to db, return list of all countries in our database
def get_countries(): cnx,cur = connect_to_db() #get connection with db cur.execute("SELECT DISTINCT country FROM locations order by country") lst = cur.fetchall() cur.close() cnx.close() return lst
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def countries(cls) -> list[str]:\n\n with cls.cursor() as cur:\n cur.execute(\"SELECT country_code FROM countries;\")\n return list(row[0] for row in cur.fetchall())", "def countries():\r\n\r\n # Use Pandas to perform the sql query\r\n results = db.session.query(Worldmapdata.to...
[ "0.75844103", "0.7495018", "0.7299894", "0.706824", "0.69610363", "0.6842248", "0.68342304", "0.66941845", "0.6635394", "0.6581248", "0.6520463", "0.6463135", "0.6417038", "0.6323724", "0.629832", "0.62638366", "0.6236338", "0.6191476", "0.6147915", "0.6086902", "0.6058759", ...
0.7699451
0
connect to db, return list of all movies in our database
def get_all_movies(): cnx,cur = connect_to_db() #get connection with db cur.execute("SELECT movie_id, title FROM movies") lst = cur.fetchall() cur.close() cnx.close() return lst
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query_all_movies():\n result = session.query(Movie).all()\n print(\"total movies: %s\" % len(result))\n for movie in result:\n print(\"movie poster: %s\" % movie.poster)\n print(\"%s trailer:%s genre:%s user_id:%s\" %\n (movie.name, movie.trailer_url, movie.genre, movie.use...
[ "0.7575918", "0.7394547", "0.71646106", "0.71287847", "0.71278125", "0.7119112", "0.7102788", "0.70923334", "0.69678295", "0.69676894", "0.6929546", "0.69007593", "0.6888458", "0.6825333", "0.67964745", "0.67843485", "0.66729456", "0.65358865", "0.64731866", "0.6341258", "0.6...
0.81240064
0
connect to db, return list of all roles in our database
def get_all_roles(): cnx,cur = connect_to_db() #get connection with db cur.execute("SELECT DISTINCT role FROM movie_crew") lst = cur.fetchall() cur.close() cnx.close() return lst
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list(self):\n return self.client.find_all_roles()", "def roles(self):\n params = {\n \"f\" : \"json\"\n }\n uURL = self._url + \"/roles\"\n return self._con.get(path=uURL, params=params)", "def get_roles_list(self):\n try:\n roles = self.db_handle...
[ "0.7254935", "0.71285075", "0.70127875", "0.6980049", "0.69445276", "0.69194496", "0.68533516", "0.6790466", "0.67293274", "0.66895515", "0.66317916", "0.6621162", "0.66202486", "0.6610948", "0.658188", "0.6577628", "0.65745056", "0.6569808", "0.6554018", "0.6531496", "0.6526...
0.7690347
0
retrun list all roles available in country names keyword arguments country the country we look at
def get_country_roles(country): cnx,cur = connect_to_db() cur.execute("SELECT DISTINCT role FROM locations, movie_crew " "WHERE locations.country LIKE '%" + country + "%' AND locations.movie_id = movie_crew.movie_id") lst = cur.fetchall() cur.close() cnx.close() return lst
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_profiles_by_role_and_counrty(role,country):\n cnx,cur = connect_to_db()\n cur.execute(\"SELECT DISTINCT profile.profile_id, name, gender, age, main_department, popularity, biography, photo_link \"+\n \"FROM profile, movie_crew, locations \"\n \"WHERE locations.country LI...
[ "0.6042842", "0.59430945", "0.5855204", "0.580577", "0.5773021", "0.57682675", "0.57515913", "0.5595493", "0.5529594", "0.55103564", "0.54374224", "0.54288787", "0.5425346", "0.5405663", "0.5389338", "0.5375712", "0.5368", "0.5365893", "0.53640467", "0.5354778", "0.5354778", ...
0.7540212
0
connect to db, return list of all roles in specific movie
def get_movie_roles(movie_id): cnx,cur = connect_to_db() #get connection with db cur.execute("SELECT DISTINCT role FROM movie_crew WHERE movie_id = " + movie_id ) lst = cur.fetchall() cur.close() cnx.close() return lst
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_roles():\n\n cnx,cur = connect_to_db() #get connection with db\n cur.execute(\"SELECT DISTINCT role FROM movie_crew\")\n lst = cur.fetchall()\n cur.close()\n cnx.close()\n return lst", "def get_profiles_by_role_and_movie(role,movie_id):\n cnx,cur = connect_to_db()\n ...
[ "0.7756702", "0.67316157", "0.6518053", "0.6515545", "0.64876217", "0.6458658", "0.6324471", "0.6274752", "0.62522054", "0.62489176", "0.6168529", "0.6165426", "0.61641127", "0.61589545", "0.61493874", "0.6126791", "0.6123138", "0.60780305", "0.6063313", "0.6044927", "0.60070...
0.81025505
0
returnd female ratio in movie crew for all movies or NULL if data is missing.
def get_female_diversity_movies_lst(): cnx,cur = connect_to_db() #get connection with db cur.execute("SELECT movies.movie_id, movies.title as title, COUNT(IF(profile.gender='1',1,NULL)) / NULLIF(COUNT(IF(profile.gender='1',1,NULL))+COUNT(IF(profile.gender='2',1,NULL)), 0) as ratio" + " FROM movi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _find_male_female_percentage():\r\n count, male = 0, 0\r\n for resource in resources:\r\n patient = resource[\"resource\"]\r\n if \"gender\" in patient:\r\n count += 1\r\n if patient[\"gender\"] == \"male\":\r\n male += 1\r\n if count == 0:\r\n ...
[ "0.63052785", "0.56925154", "0.5619383", "0.5616633", "0.5566029", "0.5447945", "0.5386111", "0.5260145", "0.52555877", "0.52282083", "0.51620466", "0.5156269", "0.5154307", "0.5144613", "0.5082942", "0.5081683", "0.5070487", "0.5065608", "0.5051129", "0.50402385", "0.5029965...
0.6855065
0
return a list of movies that includes the given words in their overview.
def get_movies_by_words(words): cnx,cur = connect_to_db() text = "'"; for word in words: text += "+"+word+" " text += "'" cur.execute("SELECT * FROM movies " "Where match(overview) against("+text+" IN BOOLEAN MODE) LIMIT 100 ") lst = cur.fetchall() size = len(lst) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_movies(query,page=1):\n\t# Local variables\n\tlanguages_list=[\"fr\"]\n\tcomplete_list=[]\n\n\t# Query the API using the query in parameter\n\tfor cur_language in languages_list:\n\t\tmovies_list=tmvdb_connect(os.path.join(app.config['API_URL'],(\"search/movie?api_key=\" + app.config['API_KEY'] + \"&lan...
[ "0.6128392", "0.5973172", "0.5964992", "0.5935176", "0.5901673", "0.5835245", "0.58226585", "0.5811459", "0.58018035", "0.5743491", "0.5716431", "0.569377", "0.5666165", "0.5663047", "0.56209415", "0.5598757", "0.5561089", "0.5546164", "0.5537836", "0.5537325", "0.5531928", ...
0.71396816
0
take a collection of entries and put together a log buffer omit tags allow us to omit a certain tag on export/extract if omit tag is given, do not print the tag for any of the entries.
def from_entries(self, entries, omits=[], include_path=False): #need to make an explicit decision on where to start writing #with out that it is completely dependent on where the last #seek operation left the pointer in the file #could be the beginning, could be the end #need to ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_multiple_tags(self):\n self.request.log(\"Hello World\", tags=[\"tag1\", \"tag2\"])\n self.request.end()\n entry = self.get_entry()\n assert len(entry['tags']) == 2\n assert entry['tags'][0] == \"tag1\"\n assert entry['tags'][1] == \"tag2\"", "def main_log(logfi...
[ "0.50946254", "0.5088302", "0.50440687", "0.49992514", "0.49558786", "0.4828132", "0.47299513", "0.47146204", "0.46390933", "0.46373844", "0.46084967", "0.4600929", "0.45900854", "0.45806527", "0.45747688", "0.45612344", "0.45323935", "0.4496259", "0.4494711", "0.44729376", "...
0.7144475
0
convert log to a list of entry objects (essentially what a log is) if moments_only is true, only Moments will be created if add_time is false, and moments_only is true, upon reaching an Entry only (... ) (no timestamp) that information will be added to the previous Moment (this is useful when parsing data that was not ...
def to_entries(self, add_tags=[], add_time=False, moments_only=False): entries = [] entry_regex = "\*" entry_search = re.compile(entry_regex) cur_entry = Moment() cur_entry.path = self.name new_entry = None try: self.seek(0) lin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flatten_log(self, log):\n # TODO take out flat_log by reference\n flat_log = []\n try:\n self.parser.parse_snapshot(log['chunkedSnapshot'], flat_log)\n self.parser.parse_log(log['changelog'], flat_log)\n except KeyError:\n self.logger.exception('Miss...
[ "0.6035292", "0.5690432", "0.5530638", "0.5505197", "0.53293675", "0.52958155", "0.5208506", "0.52055335", "0.5146613", "0.5125524", "0.50947475", "0.509261", "0.5060924", "0.50138193", "0.4998745", "0.49941766", "0.4983759", "0.49312794", "0.4882121", "0.4831412", "0.4819198...
0.81702995
0
A function to read data for KNN dataset provided.
def read_KNN_dataFile(file): A = np.genfromtxt(file) return A
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loadData(infile,k):\n f = open(infile,'r')\n #f = f.read().split(\"\\n\")\n #raw = json.loads(f[1])\n f = f.read()\n raw = json.loads(f)\n data = np.array(raw)\n dataset = data[k]\n return dataset", "def _read_train_datas(self):\r\n with open(self.train_label_path, 'r') as fb:\...
[ "0.67655015", "0.63244337", "0.62342364", "0.615238", "0.6094346", "0.6093189", "0.609245", "0.60408294", "0.60307324", "0.6029054", "0.6009927", "0.59829533", "0.5982479", "0.597629", "0.59517777", "0.59301966", "0.5930096", "0.59186935", "0.5874883", "0.5874883", "0.5872828...
0.65857494
1
Writes 'lines' to the temp file, adding a newline after each line.
def _create_tempfile_with_lines(self, *lines): for line in lines: self.tempfile.write(line) self.tempfile.write('\n') self.tempfile.flush()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writelines(self, lines):\n for line in lines:\n self.write(line)", "def write(self, lines):\n strip_lines = lines.strip()\n if strip_lines:\n for line in strip_lines.split('\\n'):\n self._add(line.strip())", "def writelines(lines, filename, encoding...
[ "0.75505406", "0.7404465", "0.7391618", "0.7391271", "0.731553", "0.7270408", "0.7169841", "0.7069379", "0.7058138", "0.7042016", "0.696213", "0.68376106", "0.68376106", "0.6824313", "0.67990315", "0.66173816", "0.6436395", "0.63295263", "0.6240338", "0.6167742", "0.61377347"...
0.8135784
0
Utility method for creating a set of Points from a list of tuples.
def _pointset_from_tuples(self, *tuples): newset = set() for t in tuples: newset.add(Point(*t)) return newset
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_shapely_points_to_tuples(list_of_points) -> list:\n return [(p.x, p.y) for p in list_of_points]", "def createFromTuples(cls, *tps, **kwargs):\n pts = [Point(*tp) for tp in tps]\n return cls(*pts, **kwargs)", "def createFromTuples(cls, tps, conversion=True, radius=0.01, **kwargs...
[ "0.68660456", "0.68095356", "0.6508174", "0.6356046", "0.6353586", "0.6149713", "0.59917295", "0.59542376", "0.58643", "0.58472383", "0.57597196", "0.57299364", "0.5724781", "0.57070076", "0.5678446", "0.56717265", "0.56543237", "0.5627746", "0.56242645", "0.56055135", "0.559...
0.8636774
0
the distance between XYZ1 and XYZ2
def distance(XYZ1=np.array([0, 0, 0], dtype='float32'), XYZ2=np.array([1, 1, 1], dtype='float32')): a=XYZ2-XYZ1 b=a**2 c=b.sum() return np.sqrt(c)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance_checker(xyz1, xyz2):\n return math.sqrt((xyz1[0] - xyz2[0])**2 + (xyz1[1] - xyz2[1])**2 +\n (xyz1[2] - xyz2[2])**2)", "def distance(self, coord1, coord2):\n return (abs(coord1.x - coord2.x) + abs(coord1.y - coord2.y) + abs(coord1.z - coord2.z))//2", "def nn_distance(xyz1,...
[ "0.83254284", "0.8035158", "0.79549634", "0.7812954", "0.77764976", "0.77309227", "0.77300996", "0.7622272", "0.76175225", "0.75870013", "0.75810266", "0.7580824", "0.75692993", "0.7559177", "0.7554321", "0.75298625", "0.752346", "0.75219285", "0.751534", "0.7510841", "0.7505...
0.8461445
0
return the indice of water in a radius
def indice_in_Radius(t, water_indice, r=RADIUS): for i in water_indice: wat_indice=[] if distance(t.xyz[0,i,:],XYZ) < RADIUS: wat_indice.append(i) wat_indice.append(i+1) wat_indice.append(i+2) print "H...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index():\n return get_in_radius(50)", "def get_radius(self):", "def get_gate_index(radar, dist_km=5):\n if radar.range['units'] == 'meters':\n return (radar.range['data']< dist_km*1000).sum()", "def radius(self) -> int:\n pass", "def get_radius(self):\r\n return 1", "def qu...
[ "0.64011747", "0.6387108", "0.61902535", "0.61676484", "0.6148669", "0.60763097", "0.60763097", "0.5905478", "0.5905478", "0.589957", "0.5872742", "0.5849221", "0.58365214", "0.5835059", "0.5828708", "0.58278495", "0.5778599", "0.5777915", "0.5736594", "0.5717128", "0.5707772...
0.78405035
0
Writes a xml file with detailed match data
def write_output(self): os.chdir(self.basedir) root = ET.Element('othello-match') colors = [self.board.BLACK, self.board.WHITE, 'None'] self.player_dirs.append('None') # trick for writing a draw match timing = ET.SubElement(root, 'timing') timing.set('start', time.asc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_output(matches: list, output_file_name: str = 'matches.txt'):\n with open(\"test/Matches/\" + output_file_name, 'w') as f:\n for match in matches:\n for event in match.events:\n f.write(\"%s\\n\" % event.payload)\n f.write(\"\\n\")", "def write_to_xml(dictD...
[ "0.6347397", "0.6100876", "0.6049694", "0.6042765", "0.59667975", "0.59554106", "0.5937762", "0.59330463", "0.5846637", "0.5818026", "0.58029646", "0.5797077", "0.5771405", "0.5760826", "0.5759962", "0.5678757", "0.5665039", "0.5639492", "0.5623684", "0.5600524", "0.55897886"...
0.6457788
0
Return text of thank you letter for given donor
def get_thank_you(self, donor): donor_dict = {'name': donor.name, 'donation': donor.donations[-1], 'num_donations': len(donor.donations)} donor_dict['multiple'] = 's' if len(donor.donations) > 1 else '' thankyou = ('Dear {name}:\n' 'Thank you for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_letter(donor):\n msg = get_thankyou_message(donor)\n print(msg)", "def get_thankyou_message(donor):\n message = '''Dear {}, \n Thank you so much for your generosity with your most recent donation of ${}. \n It will be put to very good use.\n Sincerely.'''\n ...
[ "0.8134733", "0.7551357", "0.7546796", "0.7234831", "0.71572757", "0.71421903", "0.7091716", "0.6723348", "0.671078", "0.6693161", "0.6677722", "0.66460943", "0.65808696", "0.6469738", "0.63770133", "0.6361782", "0.63165945", "0.6302818", "0.63006103", "0.62570703", "0.620567...
0.7595476
1
Sets mix precision policy.
def set_mixed_precision_policy(args): if args.dtype == 'fp16': policy = tf.keras.mixed_precision.experimental.Policy('mixed_float16', loss_scale=loss_scale) tf.keras.mixed_precision.experimental.set_policy(policy) elif args.dtype == 'bf16': policy = tf.keras.mixed_precision.experimental....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_precision(self, precision) :\n self.__precision = self.parent().monoid().filter(precision)", "def _set_precision(self, precision) :\n self.__precision = self.parent().action().filter(precision)", "def SetPrecision(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_Tool_SetPrecision...
[ "0.67833453", "0.66036195", "0.6455265", "0.63099825", "0.5834427", "0.5745001", "0.5732571", "0.57183176", "0.5604077", "0.55707586", "0.555399", "0.54969645", "0.54267806", "0.5408962", "0.54050326", "0.53820294", "0.5333987", "0.52891576", "0.52469313", "0.5245356", "0.523...
0.6641289
1
r""" Replace dollar signs with backticks in string `rst_str` More precisely, do a regular expression search. Replace a plain dollar sign ($) by a backtick (`). Replace an escaped dollar sign (\$) by a dollar sign ($). Don't change a dollar sign preceded or followed by a backtick (`$ or $`), because of strings like "``$...
def rst_dollars_to_math(rst_str, protector=rst_protector, dollar_repl=r":math:`\1`"): if rst_str.find("$") == -1: return rst_str out_str = protector.protect(rst_str) # matches $...$ dollars = re.compile(r"(?<!\$)(?<!\\)\$([^\$]+?)\$") # regular...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_dollars(app, docname, source):\r\n s = \"\\n\".join(source)\r\n if s.find(\"$\") == -1:\r\n return\r\n # This searches for \"$blah$\" inside a pair of curly braces --\r\n # don't change these, since they're probably coming from a nested\r\n # math environment. So for each match, ...
[ "0.55302393", "0.54387796", "0.5281515", "0.512396", "0.49956375", "0.49954414", "0.49006099", "0.48170063", "0.47715148", "0.4770573", "0.47581977", "0.47411573", "0.47002962", "0.46849915", "0.4649751", "0.46194765", "0.459962", "0.45990545", "0.45764372", "0.4575215", "0.4...
0.7038648
0
Launches drones and waits for them to leave the drone bay. User must manually set the "launch drones" hotkey to be Shiftl.
def launch_drones(drone_num): if drone_num != 0: logging.info('launching drones') time.sleep(float(random.randint(5, 500)) / 1000) key.hotkey('shift', 'l') for tries in range(1, 25): drones_launched = lo.mlocate( './img/indicators/drones/0_drone_in_bay.bm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shut_down():\n #return_to_center()\n stop_move()\n qpt.close()", "def tearDown(self):\n for i in xrange(6): d.press('back') #send BACK key 6 times. exit from APP\n d.press('home') #send HOME key. exit from APP\n d.press('home') #send HOME key. exit from APP\n for i in xra...
[ "0.55510455", "0.5420403", "0.5374102", "0.5372056", "0.5308188", "0.52848196", "0.52700806", "0.5201395", "0.51981914", "0.51974416", "0.5185468", "0.5183495", "0.51669586", "0.5143397", "0.51214015", "0.51207787", "0.508884", "0.5085928", "0.5073226", "0.5049468", "0.504036...
0.5927063
0
Recalls drones and waits for them to return to the drone bay.
def recall_drones(drone_num): if drone_num != 0: time.sleep(float(random.randint(5, 500)) / 1000) key.hotkey('shift', 'r') time.sleep(float(random.randint(1000, 2000)) / 1000) # Wait for all drones to return to drone bay. Very sensitive to the # drones variable. Won't work u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait_for_others(self):\n self.log.debug('Waiting for other drones')\n\n # Tell other drones that this drone is complete\n msg_data={'ip_addr': self.this_drone[0], 'id': self.drone_id}\n for drone in self.other_drones:\n drone_ip, drone_port = drone\n self.log.d...
[ "0.5827099", "0.57097244", "0.56317496", "0.5601708", "0.5586946", "0.5556565", "0.5534031", "0.54586405", "0.54252607", "0.537422", "0.5339857", "0.53109217", "0.5310279", "0.52646875", "0.5241174", "0.52386224", "0.5218707", "0.52106744", "0.5209333", "0.5206689", "0.520191...
0.7147624
0
Gets the span's SpanContext. Get an immutable, serializable identifier for this span that can be used to create new child spans.
def get_span_context(self) -> "SpanContext": return SpanContext( trace_id=int(self.elastic_span.transaction.trace_parent.trace_id, base=16), span_id=int(self.elastic_span.id, base=16), is_remote=False, trace_flags=TraceFlags( TraceFlags.SAMPLED if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_current_span(cls) -> Span:\n return execution_context.get_current_span()", "def span_instance(self) -> Span:\n return self._span_instance", "def _find_parent_span_id(span: Span) -> bytes:\n for ref in span.references:\n ref: SpanRef = ref\n if ref.trace_id == ...
[ "0.69673425", "0.6701817", "0.6398975", "0.6025314", "0.5992022", "0.5902299", "0.54798776", "0.528805", "0.52552825", "0.5177428", "0.5167686", "0.5156717", "0.51151973", "0.5110383", "0.5087465", "0.5058877", "0.50387514", "0.501822", "0.50158745", "0.4972219", "0.4968383",...
0.74331594
0
Sets Attributes. Sets Attributes with the key and value passed as arguments dict.
def set_attributes(self, attributes: typing.Dict[str, types.AttributeValue]) -> None: if not attributes: return for key, value in attributes.items(): self.set_attribute(key, value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setAttributes(self, args):\n for atr in self.defaultAttributes:\n if args.has_key(atr):\n # convert atr to proper type\n objAttr = getattr(self, atr)\n myType = type(args[atr])\n if type(objAttr) == types.IntType and myType <> types....
[ "0.7349471", "0.73087156", "0.72599375", "0.72599375", "0.72599375", "0.71845883", "0.68633765", "0.681083", "0.6806032", "0.67704785", "0.670731", "0.6704557", "0.6639586", "0.66325206", "0.65996146", "0.65959686", "0.6590383", "0.6587632", "0.6570109", "0.65620553", "0.6556...
0.74702024
0
Adds an `Event`. Adds a single `Event` with the name and, optionally, a timestamp and attributes passed as arguments. Implementations should generate a timestamp if the `timestamp` argument is omitted.
def add_event( self, name: str, attributes: types.Attributes = None, timestamp: Optional[int] = None, ) -> None: raise NotImplementedError("Events are not implemented in the otel bridge at this time")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_event(self, ownerid, name, location, year=None, month=None, day=None):\n date = None\n if year and month and day:\n date = datetime.date(year, month, day)\n e = Event(ownerid, name, location, date)\n self.s.add(e)\n self.s.commit()\n return e", "def ad...
[ "0.6589342", "0.65841043", "0.6459136", "0.6431371", "0.634523", "0.632059", "0.6229638", "0.59900135", "0.5970425", "0.5944216", "0.5941925", "0.5893773", "0.5878829", "0.58018637", "0.579426", "0.5779904", "0.57532156", "0.57506347", "0.56264853", "0.5626456", "0.56060445",...
0.8069043
0
Updates the `Span` name.
def update_name(self, name: str) -> None: self.elastic_span.name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_override_span_name(self):\n span_name = \"Dymaxion\"\n\n def get_predefined_span_details(_):\n return span_name, {}\n\n def update_expected_span_name(expected):\n for entry in expected:\n entry[\"name\"] = \" \".join(\n [span_nam...
[ "0.6784585", "0.64633507", "0.6381467", "0.6381467", "0.631499", "0.6287401", "0.61269325", "0.6118638", "0.6039786", "0.59635496", "0.59511626", "0.5816417", "0.57921976", "0.57152724", "0.56965166", "0.5658837", "0.5656928", "0.5651131", "0.5618034", "0.5618034", "0.5595899...
0.8008213
0
Returns whether this span will be recorded. Returns true if this Span is active and recording information like events with the add_event operation and attributes using set_attribute.
def is_recording(self) -> bool: return self.elastic_span.transaction.is_sampled and not self.elastic_span.ended_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_recording(self):\n return self._isrecording", "def is_recording(self):\n return self._recording_status in RECORDING_STATUS", "def is_recording(self):\n return True if self._device.device_data[self._uuid]['streaming_state'] == \\\n 'streaming-enabled' else False", "def i...
[ "0.6949476", "0.68603706", "0.6636954", "0.6536332", "0.64022106", "0.632599", "0.6308412", "0.5990814", "0.5946713", "0.5778547", "0.57752436", "0.5753895", "0.57518107", "0.57408404", "0.57110083", "0.570826", "0.5706867", "0.5700976", "0.5697869", "0.5695388", "0.5680746",...
0.76505053
0
Sets the Status of the Span. If used, this will override the default Span status.
def set_status(self, status: Status) -> None: if status.status_code == StatusCode.ERROR: self.elastic_span.outcome = constants.OUTCOME.FAILURE elif status.status_code == StatusCode.OK: self.elastic_span.outcome = constants.OUTCOME.SUCCESS else: self.elastic_sp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetStatus(self, status):\r\n self.status = status", "def set_status(self, status):\n self.status = status", "def set_status(self, status):\n self.status = status", "def set_status(self, status):\n self.status = status", "def setStatus(self, newStatus):\n self._status = ne...
[ "0.70254743", "0.6940442", "0.6940442", "0.6940442", "0.6860455", "0.68032646", "0.67347556", "0.67347556", "0.67347556", "0.67347556", "0.67347556", "0.67347556", "0.67347556", "0.67319447", "0.6660799", "0.6646686", "0.6646686", "0.6646686", "0.6646686", "0.6646686", "0.664...
0.76601464
0
Invoked when `Span` is used as a context manager. Returns the `Span` itself.
def __enter__(self) -> "Span": return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_current_span(cls) -> Span:\n return execution_context.get_current_span()", "def span_instance(self) -> Span:\n return self._span_instance", "def get_span_context(self) -> \"SpanContext\":\n return SpanContext(\n trace_id=int(self.elastic_span.transaction.trace_parent.tra...
[ "0.7406219", "0.691365", "0.66352385", "0.656983", "0.65633976", "0.6300246", "0.6250805", "0.61151636", "0.60539347", "0.5921227", "0.5863554", "0.57009506", "0.56670046", "0.5641782", "0.53814673", "0.5291771", "0.528971", "0.52618665", "0.52551264", "0.5250123", "0.5171593...
0.72198784
1
Set the types and subtypes for the underlying Elastic transaction/span
def _set_types(self): if isinstance(self.elastic_span, elasticapm.traces.Transaction): attributes = self.elastic_span.context.get("otel_attributes", {}) span_kind = self.elastic_span.context["otel_spankind"] is_rpc = bool(attributes.get("rpc.system")) is_http = bo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getBlockTypesToModify(self):\n raise NotImplementedError", "def entity_type(self, entity_type):\n self._entity_type = entity_type", "def types(self, types):\n\n self._types = types", "def type(self, type):\n\n self.container['type'] = type", "def type(self, type):\n\n ...
[ "0.56362516", "0.54294163", "0.5425162", "0.5339411", "0.5339411", "0.5297806", "0.52871776", "0.5281815", "0.52581257", "0.5182225", "0.5148201", "0.51419014", "0.5120444", "0.5117765", "0.5100052", "0.5008841", "0.5008841", "0.49963897", "0.49882588", "0.49882588", "0.49879...
0.79753953
0
Returns a grid that shows the occupation of an element. If an element is occupied it gets the value of 1. Else, 0.
def occupiedElements(self): occupiedMatrix = [[0 for x in range(self.gridSize)] for y in range(self.gridSize)] for i in range(len(self.changeable)): for j in range(self.length[i]): if self.direction[i] == "h": occupiedMatrix[self.fixed[i]][self.changeable...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_occupied_tiles(self):\r\n occupied = np.zeros(self.searchenv.conv.num_tiles)\r\n #Convert current state (positions of agents) to tile indices\r\n tiles = self.searchenv.conv.state_to_tile(self.searchstate.positions)\r\n valid_tiles = tiles[self.searchstate.actives == 1]\r\n ...
[ "0.65052027", "0.6486239", "0.6229242", "0.62289476", "0.61961895", "0.6187337", "0.61659586", "0.61261445", "0.61127967", "0.6085117", "0.60714185", "0.6053579", "0.60162085", "0.5994323", "0.5972663", "0.59617853", "0.59587926", "0.59030676", "0.58769006", "0.58435386", "0....
0.6657969
0
Determine if the price history is completewe can't use stocks with partial histories.
def are_historical_prices_complete(self, required_num_historical_prices: int) -> bool: if required_num_historical_prices == -1: # -1 signals that we're in test mode, so price history is always valid return True else: return len(self.price_history) == required_num_hist...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_out_of_stock(self) -> bool:\n return self.on_hand == 0", "def is_consolidating(symbol):\n \n try:\n df = web.DataReader(symbol, source, start, end)\n df['52wk High'] = df.High.rolling(250).max()\n if df['52wk High'][-1] == df['52wk High'][-20]:\n return True\n ...
[ "0.64826447", "0.6151527", "0.6138433", "0.61287713", "0.60715914", "0.59869087", "0.59549546", "0.58867043", "0.5825584", "0.58232075", "0.5821788", "0.5790132", "0.575792", "0.56676376", "0.5662289", "0.5634733", "0.56337917", "0.5628226", "0.56168646", "0.5612685", "0.5571...
0.65783775
0
Buy a fixed value worth of shares of this stock, and return postpurchase cash balance.
def buy(self, date_idx: int, cash_balance: float, buy_budget: float) -> float: todays_price: float = float(self.price_history.iat[date_idx, 1]) bought_shares: float = buy_budget / todays_price self.shares = bought_shares new_cash_balance: float = cash_balance - buy_budget self.la...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _pay(self, asked_value):\n\t\tpayment_value = min(self.stock, asked_value)\n\t\tself.stock -= payment_value\n\t\treturn payment_value", "def buy(self, stock, amount):\n self.orders[stock] += amount", "async def buy(self, ctx, name, shares: int):\n\t\tplural = 's' if shares != 1 else ''\n\t\tcurrency...
[ "0.681833", "0.67136455", "0.6712106", "0.6639873", "0.6533521", "0.6418039", "0.6354535", "0.63155806", "0.6302284", "0.62978804", "0.62771595", "0.6276398", "0.62295955", "0.61957103", "0.61510074", "0.6140673", "0.6131333", "0.61236316", "0.6107711", "0.60954744", "0.60951...
0.6761582
1
Read price data for this stock from the DB, then pickle it for faster reference in the future.
def load_db_price_history(self, ticker: str, conn: sqlite3.Connection) -> pd.DataFrame: sql = f"SELECT date, closing_price FROM historical_prices WHERE ticker = '{ticker}' ORDER BY date;" price_history = pd.read_sql(sql, conn) if not os.path.exists(Portfolio.PICKLE_DIR): os.mkdir(Po...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_data(self):\n\n data_dict = {\n 'price': self.get_current_price(),\n }\n\n return self.save_data(data_dict)", "def read_stock(db, openfile):\n pass", "def load_pickled_price_history(self, ticker: str) -> pd.DataFrame:\n try:\n price_history = pd.re...
[ "0.6647683", "0.65389717", "0.65350014", "0.6332609", "0.63166934", "0.6294863", "0.6224005", "0.6091986", "0.60108304", "0.59479207", "0.5925451", "0.59020305", "0.5901426", "0.5875953", "0.58613026", "0.58266103", "0.57867426", "0.5772673", "0.57414925", "0.5718519", "0.570...
0.6596617
1
Buy initial shares of each stock.
def ramp_up(self) -> None: self.cash_balance: float = self.initial_cash_balance() for stock in self.stocks: initial_date_idx = 0 self.cash_balance = stock.buy(initial_date_idx, self.cash_balance, self.buy_budget)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def buy(self, stock, amount):\n self.orders[stock] += amount", "def buy_stock (self, ticker, buy_date, sell_date, amount):\n\n if self.__buy_stock_init__(ticker, buy_date, sell_date, amount) == False:\n return\n\n if self.__get_hist__() == False:\n return\n\n sel...
[ "0.65276843", "0.65002215", "0.630925", "0.6265346", "0.6134108", "0.59956604", "0.5893807", "0.5875289", "0.58539927", "0.5823931", "0.5823715", "0.58211595", "0.5816876", "0.5792299", "0.5760585", "0.57598615", "0.5754664", "0.5746373", "0.5737933", "0.56979966", "0.5684521...
0.65788734
0
Calculate how much cash the portfolio had before buying any stocks. This amount should be just enough to buy a fixed value worth of each of the S&P 500 stocks.
def initial_cash_balance(self) -> float: return self.buy_budget * len(self.stocks)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cash(self, qtt_100s, qtt_50s, qtt_20s):\n return (qtt_100s * 100) + (qtt_50s * 50) + (qtt_20s * 20)", "def cash_flow(self):\n _cash_flow = self.after_tax_profit() + self.depreciation()\n return _cash_flow", "def cash(self) -> float:\n return self._cash", "def calc_total_money(...
[ "0.6709676", "0.6701409", "0.64627534", "0.64136297", "0.64061856", "0.63561624", "0.63381624", "0.6322919", "0.6298005", "0.6286239", "0.6267098", "0.6247333", "0.62184674", "0.6214726", "0.62063104", "0.61712736", "0.6151916", "0.61452335", "0.61423993", "0.6125519", "0.612...
0.73833686
0
Reset the cash balance to whatever's needed to buy a fixed value of every stock.
def reset(self) -> None: self.cash_balance = self.initial_cash_balance()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(self):\n for key in self.portfolio.keys():\n self.portfolio[key] = {'holdings': 0}\n self.buys[key] = 0\n self.portfolio['balance'] = 2500000.0", "def reset(self):\n self.state = {\n \"price\" : self.history[0]['price'],\n \"timestamp\" :...
[ "0.70810556", "0.6822448", "0.66875416", "0.6640092", "0.6434784", "0.6411411", "0.63592553", "0.63226014", "0.615126", "0.6083326", "0.6025144", "0.5995887", "0.5928087", "0.5898666", "0.5896905", "0.5855258", "0.58229005", "0.5804296", "0.58037984", "0.5797453", "0.57598305...
0.8211432
0
Return a double dictionary with the number of reads for each pair of regions
def get_regions_counts(fname, seglen, mincounts): counts = defaultdict(int) seglen=int(seglen) with open(fname) as fin: infile = csv.DictReader(fin, delimiter='\t') for line in infile: if int(line['interactions']) < mincounts: continue t_reg = ( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_n_share(contig_paths: List[str]) -> dict:\n\n n_share_dict = {}\n seq_dict = {}\n\n for contig_path in contig_paths:\n with open(contig_path, \"r\") as handle:\n for line in handle.read().splitlines():\n if line.startswith(\">\"):\n key = line.re...
[ "0.632933", "0.6255554", "0.61483485", "0.61362094", "0.6062347", "0.59422404", "0.5929661", "0.58705467", "0.58041614", "0.57988745", "0.5791153", "0.57727957", "0.57727957", "0.57667905", "0.5766186", "0.57374346", "0.57015103", "0.5694955", "0.5689084", "0.566954", "0.5656...
0.68843025
0
Adds a result to the results object.
def _AddResult(self): if not self._results: result = analyzer_result.AnalyzerResult() result.attribute_name = 'test_result' result.attribute_value = 'is_vegetable' self._results.append(result)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_to_results(self, result_id: str, result):\n\n self.results[result_id] = result", "def add_result(self, result):\n if len(self.results) == self.max_size:\n del self.results[0]\n self.results.append(result)", "def addResults(self, results):\n if results is None or l...
[ "0.82676303", "0.80789965", "0.776224", "0.7389418", "0.7286105", "0.72735333", "0.72097397", "0.7164482", "0.70959634", "0.7078722", "0.70300174", "0.69971156", "0.6995321", "0.6989447", "0.6980752", "0.69654363", "0.693965", "0.69370097", "0.69370097", "0.69172275", "0.6898...
0.82591605
1
Tests the registration and deregistration of analyzers.
def testAnalyzerRegistration(self): number_of_analyzers = len(manager.AnalyzersManager._analyzer_classes) manager.AnalyzersManager.RegisterAnalyzer(TestAnalyzer) self.assertEqual( number_of_analyzers + 1, len( manager.AnalyzersManager._analyzer_classes)) with self.assertRaises(KeyEr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_register_analyzer(self):\n self.assertRaises(\n KeyError, manager.AnalysisManager.register_analyzer, MockAnalyzer)", "def testGetAnalyzerInstances(self):\n analyzer_names = manager.AnalyzersManager.GetAnalyzerNames()\n analyzers = manager.AnalyzersManager.GetAnalyzerInstances(ana...
[ "0.7373507", "0.70845586", "0.7022208", "0.685584", "0.67594475", "0.6706744", "0.62167376", "0.61626637", "0.61060005", "0.5934989", "0.5880337", "0.5711961", "0.5669396", "0.5663849", "0.5646134", "0.5627842", "0.5585728", "0.55854744", "0.5578922", "0.55115", "0.5453961", ...
0.8087296
0
Tests the GetAnalyzerInstance function.
def testGetAnalyzerInstance(self): manager.AnalyzersManager.RegisterAnalyzer(TestAnalyzer) analyzer = manager.AnalyzersManager.GetAnalyzerInstance('testanalyze') self.assertIsNotNone(analyzer) self.assertEqual(analyzer.NAME, 'testanalyze') analyzer = manager.AnalyzersManager.GetAnalyzerInstance('te...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_analyzer(self):\n analyzer_class = manager.AnalysisManager.get_analyzer('mockanalyzer')\n self.assertEqual(analyzer_class, MockAnalyzer)", "def testGetAnalyzerInstances(self):\n analyzer_names = manager.AnalyzersManager.GetAnalyzerNames()\n analyzers = manager.AnalyzersManager.Ge...
[ "0.80171525", "0.76180494", "0.7057732", "0.6810286", "0.6476879", "0.6398443", "0.6288276", "0.61865485", "0.59524167", "0.58333296", "0.5806387", "0.57735896", "0.5771596", "0.5654388", "0.5653568", "0.565343", "0.5536332", "0.5536332", "0.5513665", "0.5501179", "0.54971796...
0.82207566
0
Tests getting analyzer objects by name.
def testGetAnalyzerInstances(self): analyzer_names = manager.AnalyzersManager.GetAnalyzerNames() analyzers = manager.AnalyzersManager.GetAnalyzerInstances(analyzer_names) self.assertEqual(len(analyzer_names), len(analyzers)) for analyzer in analyzers: self.assertIsInstance(analyzer, interface.Base...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_analyzers(self):\n analyzers = manager.AnalysisManager.get_analyzers()\n analyzer_list = [x for x in analyzers]\n first_analyzer_tuple = analyzer_list[0]\n analyzer_name, analyzer_class = first_analyzer_tuple\n self.assertIsInstance(analyzer_list, list)\n self...
[ "0.7208907", "0.69770277", "0.65336835", "0.64145607", "0.6330625", "0.6327933", "0.6008307", "0.5808541", "0.5760881", "0.56872725", "0.5645954", "0.56354207", "0.55923325", "0.55923325", "0.55743915", "0.5514111", "0.5506084", "0.5491655", "0.54806364", "0.5449415", "0.5449...
0.7133427
1
Callback for /locate_board Service.
def locate_board_callback(self, data): self.home_count = 0 self.is_home = True while self.home_count < self.home_count_thresh or not self.board_position: try: for d in self.tag_vals.detections: if d.id == (0,): self.board_po...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def place_worker(self, cur_board):\n pass", "def get_board(self):\n pass", "def _print_board(board):\r\n pass", "def location_callback(self,msg):\n self.location = msg.data", "def set_board(board):", "def get_board():\r\n try:\r\n get_board_property('BOARD')\r\n e...
[ "0.5576795", "0.5408619", "0.53536355", "0.53412855", "0.5340257", "0.53296137", "0.53147477", "0.530635", "0.52870226", "0.5270642", "0.52604204", "0.5252158", "0.5248234", "0.51757497", "0.51191926", "0.5094407", "0.5053982", "0.50522447", "0.50514036", "0.4995317", "0.4986...
0.6389068
0
Callback for /locate_recent_bag Service. Returns pose of last bag thrown from sawyer's team Returns pose 0 0 0, 0 0 0 0 if no new bag found (presumably because it's in the hole)
def locate_recent_bag_callback(self, data): raw_input('Press enter when turn complete.') if not self.team or self.team == 'None': resp = self.team_call.call(TriggerRequest()) self.team = resp.message self.home_count = 0 self.is_home = True new_bags = [] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pose_cb(self, msg): # This is being called at 50 Hz\n\n # Update time and count information about received poses\n now = time.time()\n delta_t = 0 if self.previous_pose_cb_time is None else now-self.previous_pose_cb_time\n if self.previous_pose_cb_time is None:\n self.pr...
[ "0.49695644", "0.47184888", "0.467841", "0.46535853", "0.46489266", "0.462121", "0.4592204", "0.45895195", "0.4574726", "0.45483667", "0.4540706", "0.45284283", "0.45263594", "0.45208174", "0.45063573", "0.44986695", "0.44900858", "0.44900858", "0.44866437", "0.4482163", "0.4...
0.6867505
0
Callback for /tag_detections Subscriber topic from AprilTagDetection Retrives data published by apriltags node
def sub_callback(self, data): if self.is_home: self.home_count += 1 self.tag_vals = data try: for d in self.tag_vals.detections: id_ = d.id[0] if id_ == 0: self.board_position = d.pose.pose.pose ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def image_callback(self, data):\n\n # Import raw image and convert to cv2 format\n frame = self.bridge.imgmsg_to_cv2(data, \"bgr8\")\n # Convert to grayscale (AprilTag detector prefers this)\n gray = cv2.cvtColor(frame, cv2.COLOR_RGB2GRAY)\n detections = self.detector.detect(gray...
[ "0.6862646", "0.54178375", "0.54178375", "0.5391706", "0.53797746", "0.5250182", "0.5200609", "0.51873934", "0.51825523", "0.5136482", "0.5091197", "0.5071162", "0.5064441", "0.50582516", "0.4995051", "0.49891853", "0.49234438", "0.491651", "0.4899227", "0.48907363", "0.48885...
0.5643067
1
Parses the sum of status code according to the `SENSOR_STATUSES` using an algorithm defined in `_get_sum_terms` method.
def _decode_sensor_status(self, status: str) -> str: k = int(status) return self.SENSOR_STATUSES[k]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum_status_code(status_code, expect_sum):\n sum_value = 0\n for digit in str(status_code):\n sum_value += int(digit)\n\n assert sum_value == expect_sum", "def _parse_status(self, status):\n if status in (STATUS_FINISHED, 'FINISHED'):\n return STATUS_FINISHED\n elif st...
[ "0.63981986", "0.5593446", "0.5469002", "0.53886276", "0.5228831", "0.51986086", "0.5179028", "0.5131319", "0.51191187", "0.5004896", "0.4969866", "0.49619862", "0.49401355", "0.4919777", "0.49104297", "0.4904046", "0.48933774", "0.48696056", "0.48462716", "0.48360673", "0.48...
0.5803912
1
Test basis function dynamics
def test_basis_dynamics(self): # note: all prints here go to the output item in the json file trajectories_fit = self.notebook_locals["trajectories_fit"] last_x = trajectories_fit[0][-1][0] last_z = trajectories_fit[0][-1][1] last_th = trajectories_fit[0][-1][2] self.asse...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_basis(self):\n\t\tbasis = schrodinger.create_basis(3)\n\t\ta = basis[0](0).numpy()\n\t\tb = math.cos(0)\n\t\tself.assertEqual(a, b)\n\t\tc = basis[1](math.pi/2).numpy()\n\t\td = math.sin(math.pi/2)\n\t\tself.assertEqual(c, d)", "def test_functions(self):\n\n # exp\n\n e_ref = 2.7182...
[ "0.7037025", "0.64591604", "0.6450193", "0.6375816", "0.6332824", "0.6330011", "0.63154596", "0.6301098", "0.62944186", "0.6207383", "0.6184947", "0.6148907", "0.61414164", "0.6137422", "0.61223775", "0.61119306", "0.6089774", "0.6066447", "0.6066447", "0.6059656", "0.6043144...
0.67493594
1
factors = multiples of the numbers in factors will be included in the sum upper_bound = maximum (not inclusive) of list of natural numbers to be filtered and summed >>> sumListInputs(upper_bound=10) 23
def sumListInputs(factors=[3, 5], upper_bound=1000): t0 = time.time() multiples = [] for num in range(1, upper_bound): for factor in factors: # add num to multiples if it is a multiple of any of the factors and has not already been added (in case it is a multiple of more than one factor)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum(inputList):\n sum=0#the sum of the list starts from 0\n for num in inputList:\n sum=sum+num#add all number in the list\n print(\"the sum is\",sum)", "def sum_list_elements(input_list):\n print(f\"Sumatorio de los elementos dela lista: {sum(input_list)}\")", "def add_list_numbers(inco...
[ "0.6177166", "0.601284", "0.59875673", "0.5935279", "0.5935279", "0.5918097", "0.58215314", "0.5782528", "0.5746898", "0.56856215", "0.5676497", "0.5606412", "0.55857295", "0.5521328", "0.55015075", "0.5459295", "0.54283065", "0.5425039", "0.5413835", "0.5401056", "0.5251739"...
0.8479472
0
Log out times for emcc stages
def log_time(name): if DEBUG: now = time.time() logging.debug('emcc step "%s" took %.2f seconds', name, now - TimeLogger.last) TimeLogger.update()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_timelog():", "def logout(args):\n\t## ATTR='...' ATTRVALUE='...'\n\t## ENAME='...' ELEVEL='1~5' ...\n\ttimestamp = time.strftime('%b %d %H:%M:%S')\n\toutstr = (\"%s %s %s 0[%s]: \"%(timestamp, cfg.HOSTNAME, cfg.WORK_DIR, cfg.PID))\n\n\tif len(args) == 2:\n\t\toutstr = outstr + cfg.FLAG_BLANK.join(args)...
[ "0.57123667", "0.5585217", "0.5500778", "0.5471607", "0.5447728", "0.5325751", "0.53040123", "0.53003323", "0.52434963", "0.5231928", "0.52316684", "0.52073574", "0.5199207", "0.51972914", "0.51715153", "0.5145553", "0.51213783", "0.511899", "0.5103127", "0.5095843", "0.50914...
0.5974571
0
minifies the code. this is also when we do certain optimizations that must be done right before or after minification
def do_minify(self): if shared.Settings.SPLIT_MEMORY: # must be done before minification self.queue += ['splitMemory', 'simplifyExpressions'] if self.opt_level >= 2: if self.debug_level < 2 and not self.use_closure_compiler == 2: self.queue += ['minifyNames'] if self.debug_level...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _optimise(self):\n pass", "def _optimized(self):\n return False", "def propose_optimize():\n pass", "def _minify_operation(self, sources, output):\n try:\n input_file = sources.pop()\n if len(sources) > 1:\n combined_filename = self._create_tem...
[ "0.7127141", "0.64530885", "0.6285993", "0.60698473", "0.5984362", "0.591829", "0.5872338", "0.5872338", "0.58560723", "0.58181226", "0.58181226", "0.58181226", "0.5741464", "0.5720913", "0.57194436", "0.5683981", "0.5655169", "0.56536233", "0.5651568", "0.5607951", "0.558845...
0.7613378
0
Separate out the asm.js code, if asked. Or, if necessary for another option
def separate_asm_js(final, asm_target): logging.debug('separating asm') subprocess.check_call([shared.PYTHON, shared.path_from_root('tools', 'separate_asm.py'), final, asm_target, final]) # extra only-my-code logic if shared.Settings.ONLY_MY_CODE: temp = asm_target + '.only.js' print jsrun.run_js(share...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def code():", "def assembler(self, assembler: osbuild.Stage):", "def compile_asm(self, src, dst):\n cmd = [self.get_command(), \"-S\", src, \"-o\", dst] + self.__compiler_flags + self.__compiler_flags_extra + self.__definitions + self.__include_directories\n (so, se) = run_command(cmd)\n if 0 < len(se...
[ "0.63794976", "0.6000411", "0.5954799", "0.58940333", "0.5661657", "0.5610237", "0.55737257", "0.5567804", "0.5508609", "0.5492729", "0.54671407", "0.54392135", "0.5309119", "0.5221394", "0.52167594", "0.52008104", "0.51678777", "0.51453644", "0.5133282", "0.51205635", "0.510...
0.7870142
0
Use this if you want to modify the script and need it to be inline.
def un_src(self): if self.src is None: return self.inline = ''' var script = document.createElement('script'); script.src = "%s"; document.body.appendChild(script); ''' % self.src self.src = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replacement(self):\n assert (self.src or self.inline) and not (self.src and self.inline)\n if self.src:\n return '<script async type=\"text/javascript\" src=\"%s\"></script>' % urllib.quote(self.src)\n else:\n return '<script>\\n%s\\n</script>' % self.inline", "def include_admin_script(scr...
[ "0.67974", "0.62553865", "0.62187916", "0.61329406", "0.6047571", "0.6046451", "0.5850994", "0.577932", "0.57474846", "0.5687332", "0.5670961", "0.565639", "0.5641603", "0.5625467", "0.5610962", "0.5583196", "0.55702055", "0.5568461", "0.55411124", "0.5499593", "0.5487867", ...
0.6647625
1
Returns the script tag to replace the {{{ SCRIPT }}} tag in the target
def replacement(self): assert (self.src or self.inline) and not (self.src and self.inline) if self.src: return '<script async type="text/javascript" src="%s"></script>' % urllib.quote(self.src) else: return '<script>\n%s\n</script>' % self.inline
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def code(self):\n return '{}\\n<script>{}</script>'.format(self.html, self.js)", "def condense_script(html): # May look silly but Emmet does this and is wrong.\n log.debug(\"Condensing HTML Script JS tags.\")\n return html.replace('<script type=\"text/javascript\">', '<script>').replace(\n \...
[ "0.61823165", "0.6143142", "0.5896", "0.5548083", "0.55468273", "0.5446094", "0.54224455", "0.54219383", "0.5404139", "0.5387289", "0.53775066", "0.5371678", "0.5285252", "0.5281609", "0.5265579", "0.52409405", "0.5237738", "0.5237738", "0.5226472", "0.5183044", "0.5166485", ...
0.6721346
0
Return the PID of this game server process.
def pid(self): return self._process.pid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pid(self):\n return self._get_process_id()", "def pid(self):\n\n return getpid() if self.__process is None else self.__process.pid", "def pid(self):\n return self._query_status()['pid']", "def pid(self):\n if self.proc is None:\n return 0\n return self._pid()...
[ "0.81782925", "0.8074784", "0.7675668", "0.76341367", "0.7545737", "0.7545737", "0.7545737", "0.7531053", "0.750411", "0.7400946", "0.7367087", "0.7367087", "0.7361654", "0.7355931", "0.73553956", "0.72651285", "0.7229046", "0.69683224", "0.688014", "0.6803807", "0.67972726",...
0.8135618
1
Return the exit code of this process.
def exit_code(self): return self._process.exitcode
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exitcode(self):\n\n return self._exitcode", "def exit_code(self) -> int:\n _args: list[Arg] = []\n _ctx = self._select(\"exitCode\", _args)\n return _ctx.execute_sync(int)", "def exitCode(self):\n return self._ExitCode", "def return_code(self):\n return self.__pr...
[ "0.82694227", "0.82471144", "0.80596036", "0.8051159", "0.78995156", "0.78139234", "0.75587374", "0.7550261", "0.7412833", "0.737794", "0.7245144", "0.71133924", "0.704437", "0.69374865", "0.6724409", "0.6627906", "0.64743733", "0.6393877", "0.63425815", "0.6293263", "0.60959...
0.9032673
0
Return whether this process is alive.
def alive(self): return self._process.is_alive()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_alive(self) -> bool:\n\n if self._on:\n return True\n\n try:\n os.kill(self.proc.pid, 0)\n except (OSError, ProcessLookupError):\n return False\n\n return True", "def is_alive(self):\n ret = subprocess.call(\n shlex.split(\"ping -c 1 -W 2 %s\" % self.ip_addres...
[ "0.84737486", "0.8328811", "0.8248477", "0.8230041", "0.821737", "0.81858194", "0.81359184", "0.8123009", "0.8041454", "0.8009332", "0.79721266", "0.79721266", "0.7946373", "0.7937435", "0.793713", "0.7923901", "0.79053706", "0.79053706", "0.78856033", "0.78751487", "0.786936...
0.9165324
0
Start the nanny process and listen for sockets.
def start_nanny(): global listener log.info("%s %s.", settings.MUD_NAME_FULL, __version__) listener = TelnetServer(address=settings.BIND_ADDRESS, port=settings.BIND_PORT, timeout=0, create_client=False) channels.subscrib...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start(self):\n\n self.socket.bind((self.ip, self.port))\n self.socket.listen(self.listenNumber)\n self.printLine()\n print(\"start for listening \")", "def start_listening(self):\n assert not self.listening\n assert not self.connected\n ctx = zmq.Context.insta...
[ "0.67830026", "0.6690589", "0.6568435", "0.65238893", "0.6461289", "0.64555985", "0.6422365", "0.64169127", "0.6403408", "0.63393456", "0.6333892", "0.62388116", "0.62190527", "0.6212862", "0.6204454", "0.6194475", "0.6193611", "0.61843073", "0.61524516", "0.61390346", "0.613...
0.8103562
0
Given a list of elevator versions represented as strings, returns the same list sorted in ascending order by major, minor, and revision number.
def solution(l): # Convert version strings to lists of version numbers (e.g. "1.2.0" -> [1, 2, 0]), # then just let python sort the list according to lexicographical ordering. return sorted(l, key=lambda version: [int(n) for n in version.split(".")])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_versions(version_list, reverse=True):\n # first chop off any starting 'v'\n version_list = [x.replace('v', '') for x in version_list]\n\n # sort by 3rd index first (descending), then minor release num then major\n sorted_list = sorted(version_list, key=lambda x: int(x.split('.')[2]), reverse=r...
[ "0.7525713", "0.6946097", "0.6916364", "0.67521995", "0.6534902", "0.63780254", "0.6317698", "0.6316285", "0.62224394", "0.62112033", "0.6152008", "0.6088659", "0.597466", "0.58906114", "0.58770764", "0.58196455", "0.5793788", "0.57577276", "0.5673674", "0.5577518", "0.557188...
0.78405595
0
Finds the digraph points of the subject extracted data.
def ret_digraph_points(sed, digraph): ret = [d['points'] for d in sed['data'] if d['digraph'] == digraph] if ret == []: # print '**Warning: No digraph points found in ret_digraph_points, digraph:' + digraph _foo = 1 else: ret = ret[0] return ret
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_points(self):\n\n points = [\n (self.inner_radius, 0, \"straight\"),\n (self.inner_radius, self.height / 2, \"straight\"),\n (self.outer_radius, self.height / 2, \"straight\"),\n (self.outer_radius, self.arc_height / 2, \"circle\"),\n (self.mid...
[ "0.58446443", "0.5531327", "0.5508787", "0.54759103", "0.5424596", "0.5424596", "0.542411", "0.53456396", "0.5336959", "0.5307741", "0.52801853", "0.52484953", "0.5235901", "0.5201309", "0.5187383", "0.5186015", "0.51843375", "0.51822335", "0.51720357", "0.5154134", "0.515413...
0.6739195
0
Removes missing values from events. For example if a keyUp is missing or keyDown etc
def remove_missing_values(events): ret = deepcopy(events) srchd, key_events = [], [] for evt in events: _tmp = [(j, e) for j, e in enumerate(events) if e['key'] == evt['key'] and not e['key'] in srchd] if _tmp != []: key_events.append(_tmp) srchd.append(ev...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(self):\n for k,v in self.events.items():\n self.events[k] = None", "def _check_keyup_events(self, event):\t\n\t\tif event.key == pygame.K_RIGHT:\n\t\t\tself.pigeon.moving_right = False\n\t\telif event.key == pygame.K_LEFT:\n\t\t\tself.pigeon.moving_left = False", "def _check_keyup_e...
[ "0.61869496", "0.60695666", "0.606818", "0.59896034", "0.5923793", "0.58741933", "0.58351374", "0.5801385", "0.5792761", "0.57293624", "0.5659571", "0.5650073", "0.5644898", "0.56393194", "0.56388825", "0.5631973", "0.55672765", "0.55672765", "0.551431", "0.5500902", "0.54915...
0.7130707
0
Adds a 2d hyperplane to the plot.
def svm_add_2d_hyperplane(model, ax, plotted_points): X_MIN = np.min(plotted_points[:, 0]) X_MAX = np.max(plotted_points[:, 0]) Y_MIN = np.min(plotted_points[:, 1]) Y_MAX = np.max(plotted_points[:, 1]) # plot the line, the points, and the nearest vectors to the plane xx, yy = np.mgrid[X_MIN:X_MA...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_plot_plane_2d(axis=(1.0, 1.0), origin=(0.0,0.0), size=(2.0,2.0)):\n ft = ImageFont.truetype (FONT_RESOURCES_DIR+\"/courier.ttf\", 12)\n gl_font = GlFont('', ft)\n gl_font.color = [0.0, 0, 0, 1.0]\n gl_plot = PlotPlane2d(gl_font)\n gl_plot.i_axis = axis\n gl_plot.i_origin = origin\n ...
[ "0.6514396", "0.63326645", "0.62112325", "0.6085226", "0.5877827", "0.5857163", "0.58278286", "0.5679308", "0.5671866", "0.5636929", "0.56198674", "0.5507169", "0.54996055", "0.5486061", "0.5434514", "0.54325706", "0.53982323", "0.5380442", "0.53677654", "0.5310569", "0.53055...
0.7703165
0
Adds a 3d hyperplane to plot
def svm_add_3d_hyperplane(model, ax, plotted_points): SPACE_SAMPLING_POINTS = 70 X_MIN = np.min(plotted_points[:, 0]) X_MAX = np.max(plotted_points[:, 0]) Y_MIN = np.min(plotted_points[:, 1]) Y_MAX = np.max(plotted_points[:, 1]) Z_MIN = np.min(plotted_points[:, 2]) Z_MAX = np.max(plotted_poi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot3d(self):\n plot_rupture_wire3d(self)", "def plot_3d_plot(self, features, headers, labels):\n self.master_plot.scatter(features[:, 0], features[:, 1], features[:, 2], c=labels)\n self.master_plot.set_xlabel(headers[0])\n self.master_plot.set_ylabel(headers[1])\n self.ma...
[ "0.7152768", "0.7124425", "0.6859061", "0.683599", "0.6778506", "0.6750584", "0.66774154", "0.65980196", "0.65299135", "0.6519744", "0.6501602", "0.6479949", "0.644964", "0.64455837", "0.6351462", "0.63193595", "0.63081276", "0.6296681", "0.6280989", "0.6263939", "0.62559927"...
0.7950049
0
Plots the GMM components with ellipses
def gmm_make_ellipses(gmm, ax): COLORS = ['darkred', 'red', '#f66767'] # third is lightred for i in range(len(gmm.weights_)): if gmm.covariance_type == 'full': covariances = gmm.covariances_[i][:2, :2] elif gmm.covariance_type == 'tied': covariances = gmm.covariances_[:2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_plot_emg(nb_emg, muscle_names=()):\n app = pg.mkQApp()\n remote = []\n layout = pg.LayoutWidget()\n layout.resize(800, 800)\n label = QtGui.QLabel()\n box = []\n rplt = []\n row_count = 0\n col_span = 4 if nb_emg > 8 else 8\n for emg in range(nb_emg):\n remote.append(r...
[ "0.64071804", "0.62752944", "0.60646236", "0.60326445", "0.598025", "0.5948595", "0.59107554", "0.5907934", "0.58853906", "0.5844159", "0.5813572", "0.58025086", "0.57726383", "0.57702565", "0.5693261", "0.5683439", "0.5647916", "0.5644836", "0.5630614", "0.5625641", "0.56223...
0.6493749
0
Tests digraph test_points against digraph ref_points. \n Performs novelty detection with templates the ref_points and the test data the test_points
def digraph_test(ref_points, test_points, algorithm, algo_params={}, visualize_results=False, plt_title_info={}): # If tester is actually the referrer, remove the test points from train ref_data # to make prediction more fair. # if plt_title_info['referrer'] == plt_title_info['tester']: # _tmp = np....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def digraph_test_GMM(ref_points, test_points, algo_params={}, visualize_results=False, plt_title_info={}):\n N_COMPONENTS = algo_params['n_components']\n DELTA = algo_params['delta']\n\n # Construct the cluster(s)\n gmm_model = GaussianMixture(n_components=N_COMPONENTS)\n gmm_model.fit(ref_points)\...
[ "0.58795327", "0.5834069", "0.57409585", "0.564829", "0.5521026", "0.55128527", "0.5495284", "0.5482112", "0.54048526", "0.54033804", "0.5399085", "0.53978735", "0.53692263", "0.53644294", "0.5360778", "0.5359651", "0.53578705", "0.53472984", "0.534433", "0.53255224", "0.5322...
0.6999703
0
Experiment for anomaly detection test.\n Specifically, it picks randomly (or not), two subjects from the sed_list. One will be the trained_template and the other will be the tester_template. Then for each digraph in digraphs pool it performs test.
def experiment(sed_list, test_words, trials=100, testing_threshold=0.5, apply_PCA=False, visualize_results=False, algorithm='OneClassSVM', algo_params={}, print_results=True, dataset='MIXED', clean_referrer_with_algo=True, write_to_txt=True, results_filename_txt='anomaly-results'): if print_results is True: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_all_plots_working(self):\n optimizer = \"RandomSearch\"\n name = \"test_init_experiment\"\n param_defs = {\n \"x\": MinMaxNumericParamDef(0, 1),\n \"name\": NominalParamDef([\"A\", \"B\", \"C\"])\n }\n minimization = True\n\n LAss = PrettyLab...
[ "0.5833492", "0.56779206", "0.562595", "0.5582072", "0.55552953", "0.5551661", "0.55146855", "0.54046565", "0.5397899", "0.53823024", "0.53734183", "0.5357187", "0.53549284", "0.5339525", "0.5319223", "0.5318631", "0.5315688", "0.5309551", "0.5279072", "0.52758986", "0.527099...
0.65003777
0
Stream exported job results to the client (does not buffer the whole result in memory)
def streamJobExport(job, kwargs): ns = job.eaiacl['app'] owner = job.eaiacl['owner'] uri = en.buildEndpoint('search/jobs/export', namespace=ns, owner=owner) request = {} request['output_mode'] = kwargs['output_mode'] try: count = int(kwargs.get('count')) if count>0: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stream(self, batch):\n response = self.post(batch)\n try:\n for i, result_data in grouped(response):\n result = JobResult.hydrate(assembled(result_data), batch)\n log.info(\"< %s\", result)\n yield result\n finally:\n respo...
[ "0.6832195", "0.6063872", "0.60448664", "0.59493214", "0.58982533", "0.58863217", "0.5840283", "0.5839913", "0.58131635", "0.5805937", "0.57870716", "0.57103664", "0.5709239", "0.5708117", "0.57062936", "0.5684138", "0.56652355", "0.5609632", "0.55998653", "0.55633515", "0.55...
0.69476247
0
Now the user has to click to get the needle tips. We click twice, one for the left and one for the right, and return the camera coordinates.
def get_tip_needle(arm, d, idx, rot_targ): global CENTERS, image pos, rot = U.pos_rot_arm(arm, nparrays=True) old_len = len(CENTERS) # Left camera image. w = "{}-th rot_targ: {}, left camera. Drag boxes on needle tip, then SPACE.".format( idx, rot_targ) image = np.copy(d.left['raw']...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mousePosition(self):", "def mouseResponse(event, x, y, flags, param):\n global uppLeft, lowLeft, uppRight\n if event == cv2.EVENT_LBUTTONDOWN:\n cv2.circle(workImg, (x, y), 5, (0, 255, 255), -1)\n if uppLeft is None:\n uppLeft = [x, y]\n print(\"x = \", x, \"y = \", ...
[ "0.60795385", "0.60782766", "0.5884672", "0.5862305", "0.5832749", "0.57808644", "0.57808644", "0.5702125", "0.5692037", "0.5647316", "0.5644807", "0.5635855", "0.5589352", "0.5587211", "0.55520535", "0.5534397", "0.5529879", "0.5527711", "0.5517743", "0.5497027", "0.5494248"...
0.6759156
0
Collects data points on the needle tips. We want to be at rotation [0, 0, 180] (equivalently, 180 for the last part, the `roll`) so that we can assume we know the rotation matrix. Assumes that the roll belongs to the zaxis. Due to imperfections, we won't be exact. The goal here is to determine as best an estimate of th...
def collect_tip_data(arm, R_real, R_desired, wrist_map_c2l, d): data = defaultdict(list) home_pos = np.copy(HOME_POS_ARM1) home_rot = np.copy(HOME_ROT_ARM1) assert (home_rot[0] == 0 and home_rot[1] == 0 and home_rot[2] == 180) idx = 0 # Slightly adjust position to get different data points in x...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tip_needle(arm, d, idx, rot_targ):\n global CENTERS, image\n pos, rot = U.pos_rot_arm(arm, nparrays=True)\n old_len = len(CENTERS)\n\n # Left camera image.\n w = \"{}-th rot_targ: {}, left camera. Drag boxes on needle tip, then SPACE.\".format(\n idx, rot_targ)\n image = np.cop...
[ "0.599702", "0.5437963", "0.52499646", "0.52281576", "0.5183332", "0.51497996", "0.5146893", "0.5134593", "0.5083221", "0.50609183", "0.5029775", "0.5027382", "0.5022816", "0.50177914", "0.50133705", "0.5004394", "0.49958402", "0.49946278", "0.4956535", "0.49414933", "0.49227...
0.63152564
0
Determines the rotation matrix based on data from `collect_data()`. We use the same `n_t` computed from earlier for all data points, and evaluate based on L2 norm. For the translation vector and the rotations, we use what is derived form code, which is slightly different from the value we commanded the dVRK to go to (o...
def determine_rotation(arm, d, tip_data, rot_data): n_t = np.zeros(3) for this_n_t in tip_data['pos_ntip_wrt_r']: n_t += this_n_t n_t /= len(tip_data['pos_ntip_wrt_r']) print("Our n_t to use in this stage: {}".format(n_t)) K = len(rot_data['pos_ntip_wrt_s']) errors_zyz = [] errors_z...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_to_rotation(self):\r\n q = np.array([-1, 1, 3, 2])\r\n q = q / np.linalg.norm(q)\r\n R_gt = np.array([\r\n [-1/3., -14/15., -2/15.],\r\n [2/3., -1/3., 2/3.],\r\n [-2/3., 2/15., 11/15.]]).T\r\n R = to_rotation(q)\r\n\r\n zero_matrix = R - ...
[ "0.60339767", "0.5893163", "0.58641285", "0.58641285", "0.58219963", "0.5819913", "0.5807401", "0.5743187", "0.56988007", "0.5684522", "0.5639859", "0.5608758", "0.5576253", "0.55618155", "0.5528734", "0.5473237", "0.546827", "0.5454905", "0.5432379", "0.5413109", "0.54109055...
0.6972922
0
Constructor. msg_id the message identifier (must be >= 0 negative IDs are reserved) msg_data the optional message data (defaults to None) msg_priority the optional message priority (defaults to Message.MSG_DEFAULT_PRIORITY) msg_is_waitable if set to True, the msg is processed synchronously (waiter notified once msg pro...
def __init__(self, msg_id, msg_data=None, msg_priority=MSG_DEFAULT_PRIORITY, msg_is_waitable=False): self._id = int(msg_id) self._data = msg_data self._processed = False self._error = None self._condition = threading.Condition() if msg_is_waitable else None if msg_priori...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, msg_type=UNKNOWN, data=None):\r\n\r\n # The message class represents that class of message, i.e., STATUS, CONFIG, DEBUG, ACTION\r\n self.msg_class = self.UNKNOWN\r\n # The message type represents the sub-class of message, i.e., ODOMETRY, MOVE, etc. Note: the same message\r\...
[ "0.6918681", "0.6742979", "0.61345404", "0.5938003", "0.5937661", "0.58310163", "0.5729022", "0.57144713", "0.5693312", "0.5641432", "0.56330854", "0.5604893", "0.5602714", "0.55262417", "0.5525858", "0.55175763", "0.55142856", "0.54763424", "0.5463786", "0.5460163", "0.54452...
0.9059667
0
Marks the message's as "processed". For message, also notify the waiters.
def processed(self): if self.is_waitable(): with self._condition: self._processed = True self._condition.notify_all() else: self._processed = True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_messages(self):\n pass", "def wait_processed(self, timeout=3.0):\n if not self.is_waitable():\n raise MessageIsNotWaitable()\n with self._condition:\n # it seems that <Condition.wait> doesn't raise any exception!\n # so we do it manually by test...
[ "0.64053625", "0.6340839", "0.6292677", "0.6291715", "0.6273841", "0.6152548", "0.6147801", "0.6112896", "0.6087935", "0.60789007", "0.5994957", "0.59820366", "0.59494066", "0.5880186", "0.5863818", "0.5823573", "0.58067214", "0.5746351", "0.57212305", "0.57000744", "0.567754...
0.67622805
0
Returns True if this message has been processed, returns False otherwise.
def has_been_processed(self): return self._processed
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def msg_ready(self):\n if self._in_queue.qsize() == 0:\n return False\n else:\n return True", "def msg_ready(self):\n if self._in_queue.qsize() == 0:\n return False\n else:\n return True", "def is_waiting_for_message(self):\r\n retu...
[ "0.732081", "0.732081", "0.7244191", "0.70842487", "0.70484966", "0.7030087", "0.69369006", "0.69044316", "0.689003", "0.6830172", "0.6814359", "0.67732537", "0.67570394", "0.675667", "0.66622275", "0.6639134", "0.6612335", "0.6606321", "0.6588514", "0.6551359", "0.6520519", ...
0.7423645
0
Is the message a Task control message?
def is_ctrl_message(self): return self._id < 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CanHandleMessage(self, status_message):\n if isinstance(status_message, (\n SeekAheadMessage,\n ProducerThreadMessage,\n FileMessage,\n ProgressMessage,\n FinalMessage,\n RetryableErrorMessage,\n PerformanceSummaryMessage,\n )):\n return True\n ret...
[ "0.6229211", "0.62060237", "0.6092197", "0.59982973", "0.5944802", "0.5936226", "0.5913205", "0.5820611", "0.57445407", "0.5713959", "0.571292", "0.57002825", "0.56813514", "0.56658363", "0.55991745", "0.55880404", "0.55858845", "0.5549381", "0.5536487", "0.5534372", "0.55092...
0.6716326
0
Is the message 'waitable'?
def is_waitable(self): return self._condition is not None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_waiting_for_message(self):\r\n return self.waiting_for_message", "def wait(self):\n return (self.status == self.STATUS_WAIT)", "def __bool__(self):\n return self.wait(0)", "def is_call_waiting(self) -> bool:", "def waiting(self) -> bool: # pylint: disable=W0221\n return...
[ "0.8058378", "0.76708627", "0.75877243", "0.7207532", "0.71901983", "0.7052957", "0.698944", "0.69699854", "0.6921326", "0.68933225", "0.68580306", "0.68272024", "0.68272024", "0.6797035", "0.6757446", "0.6606231", "0.6602362", "0.65860724", "0.65856594", "0.6517965", "0.6476...
0.794116
1
Makes the message 'waitable'.
def make_waitable(self): if not self.is_waitable(): self._condition = threading.Condition()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_wait(self):\n pass", "def is_waiting_for_message(self):\r\n return self.waiting_for_message", "def wait(self):\n\t\traise NotImplementedError(\"must be redeclared\")", "def is_waitable(self):\n return self._condition is not None", "def wait():\n pass", "def __bool__(self):\n ...
[ "0.6805855", "0.6790669", "0.67671925", "0.6766999", "0.6659982", "0.6526041", "0.64869046", "0.6451544", "0.6422674", "0.6422674", "0.6394656", "0.6379127", "0.63226473", "0.6318591", "0.63060194", "0.62702096", "0.62233317", "0.62023544", "0.6201639", "0.6201045", "0.616385...
0.74004257
0
Waits for the message to be processed (synchronous message processing). timeout The amount of time the caller accepts to wait for the message to be processed (in seconds).
def wait_processed(self, timeout=3.0): if not self.is_waitable(): raise MessageIsNotWaitable() with self._condition: # it seems that <Condition.wait> doesn't raise any exception! # so we do it manually by testing the <Message._processed> flag... if not s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait_for_any_message(self, timeout=None):\n self._wait_in_process_loop(lambda: (True,None),timeout=timeout)", "def wait_for_message(self, tag, timeout=None):\n def done_check():\n if self._message_queue.setdefault(tag,[]):\n value=heapq.heappop(self._message_queue[tag]...
[ "0.7560969", "0.67892534", "0.6581278", "0.64255625", "0.640064", "0.6265416", "0.62175053", "0.6144393", "0.61338866", "0.6060451", "0.6047663", "0.6042654", "0.6008614", "0.6008614", "0.6003766", "0.5948815", "0.59435445", "0.59198517", "0.59108984", "0.5907251", "0.5891727...
0.7361695
1
we need to remove duplicates from bc_type dictonary to avoid deleting possible same set of nodes having
def recover_bc_dictonary_with_unique_values(bc_type): bc_typ = bc_type.keys() bc_type_new = {} for bct in bc_typ: bc_loc = bc_type[bct] if bc_loc not in bc_type_new.values(): bc_type_new[bct] = bc_loc return bc_type_new
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _filter_by_types(cost_trees, types):\n cost_trees_ = deepcopy(cost_trees)\n types_ = [t.symbol for t in types]\n for date_, parent_cost in cost_trees_.iteritems():\n for type_ in parent_cost.keys():\n if type_ not in types_:\n del parent_cost[type_]\n return cost_tr...
[ "0.6030728", "0.59979314", "0.5520233", "0.54735774", "0.546516", "0.53071916", "0.529102", "0.52371854", "0.52251685", "0.52251685", "0.51907384", "0.5176534", "0.5168577", "0.5160426", "0.5157436", "0.51467067", "0.51300836", "0.51268697", "0.511641", "0.51107615", "0.51107...
0.7541205
0
Parse bbox and mask annotation.
def _parse_ann_info(self, ann_info, with_mask=True): gt_bboxes = [] gt_labels = [] gt_bboxes_ignore = [] # Two formats are provided. # 1. mask: a binary map of the same size of the image. # 2. polys: each mask consists of one or several polys, each poly is a # lis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_ann_info(self, ann_info, with_mask=True):\n gt_bboxes = []\n gt_labels = []\n gt_bboxes_ignore = []\n gt_instance = []\n # Two formats are provided.\n # 1. mask: a binary map of the same size of the image.\n # 2. polys: each mask consists of one or severa...
[ "0.68612725", "0.67883056", "0.67153376", "0.66559166", "0.66121995", "0.64522046", "0.64091134", "0.6221324", "0.6203171", "0.6104087", "0.59503067", "0.5942907", "0.59294534", "0.5915088", "0.58995", "0.58405674", "0.5838403", "0.5831141", "0.58238906", "0.5817796", "0.5799...
0.6944652
0
Reads a UMLS json release and return it as a list of concepts. Each concept is a dictionary.
def load_umls_kb(umls_path: str) -> List[Dict]: with open(umls_path) as f: print(f'Loading umls concepts from {umls_path}') umls_concept_list = json.load(f) print(f'Number of umls concepts: {len(umls_concept_list)}') return umls_concept_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_json():\n try:\n rospack = rospkg.RosPack()\n file_path = rospack.get_path('autonomous') + \"/src/data.txt\"\n with open(file_path) as json_file:\n json_data = json.load(json_file)\n \n new_data = []\n for d in json_data:\n ...
[ "0.5251681", "0.5094251", "0.502685", "0.5004457", "0.4965563", "0.49318257", "0.49318257", "0.4924405", "0.49044302", "0.4898682", "0.48434275", "0.48371914", "0.4832784", "0.48015398", "0.47803015", "0.47679347", "0.47671247", "0.4738977", "0.47287777", "0.4667174", "0.4634...
0.6298153
0
ann_index.knnQueryBatch crashes if any of the vectors is all zeros.
def nmslis_knn_with_zero_vectors(vectors: np.ndarray, k: int, ann_index: FloatIndex) -> List[List]: empty_vectors_boolean_flags = np.array(vectors.sum(axis=1) != 0).reshape(-1,) empty_vectors_count = vectors.shape[0] - sum(empty_vectors_boolean_flags) print(f'Number of empty vectors: {empty_vectors_count}')...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ks_test_empty_indices():\n out = compute_indices_ks_test([], 1000, mode=\"D+\")\n assert all(o is None for o in out)", "def testUnknownIndices(self):\n params = constant_op.constant(((0, 1, 2),))\n indices = array_ops.placeholder(dtypes.int32)\n gather_nd_t = array_ops.gather_nd(params, i...
[ "0.6213326", "0.56436527", "0.55338526", "0.53411335", "0.5277041", "0.5261451", "0.52350354", "0.5225315", "0.5204073", "0.51965517", "0.5190978", "0.51837176", "0.5137692", "0.5136994", "0.5130649", "0.51243305", "0.510337", "0.5094048", "0.5082259", "0.50790346", "0.507123...
0.67079216
0
Given a list of mention texts, returns a list of candidate neighbors
def generate_candidates(mention_texts: List[str], k: int, tfidf_vectorizer: TfidfVectorizer, ann_index: FloatIndex, ann_concept_id_list: List[int]) -> List[List[int]]: print(f'Generating candidates for {len(mention_texts)} mentions') tfidfs = tfidf_vectorizer.transform(mention_texts) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def neighbors(pattern, d):\n\n if d == 0:\n return [pattern]\n if len(pattern) == 1:\n return ['A', 'C', 'G', 'T']\n neighborhood = []\n suffix_pattern = pattern[1:]\n suffix_neighbors = neighbors(suffix_pattern, d)\n for text in suffix_neighbors:\n hdist = compute_hamming_di...
[ "0.62678033", "0.61191565", "0.6051535", "0.6023977", "0.5912237", "0.57457286", "0.5690333", "0.56663907", "0.5659504", "0.56478775", "0.5635395", "0.5628851", "0.56224537", "0.5588343", "0.55799204", "0.55785304", "0.5575754", "0.55664146", "0.5549003", "0.5537471", "0.5530...
0.70043164
0
Build or load tfidf vectorizer and ann index
def create_load_tfidf_ann_index(ann_index_path: str, tfidf_vectorizer_path: str, umls_concept_list: List) -> Tuple[List[int], TfidfVectorizer, FloatIndex]: uml_concept_ids = [] uml_concept_aliases = [] print('Collecting aliases ... ') for i, concept in enumerate(umls_conc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_word_vectors(self,docs):\n \n \n #may need to remove interpunction too?\n print('Building tfidf vectorizer')\n \n self.tfidf = TfidfVectorizer(**self.tfidf_params)\n \n self.tfidf.fit(docs) \n \n if self.savename is not None:\n ...
[ "0.71303296", "0.67038393", "0.65297806", "0.6505874", "0.6490469", "0.6472529", "0.63855565", "0.63716245", "0.63709426", "0.63199055", "0.62574995", "0.623844", "0.6229279", "0.62278616", "0.6149996", "0.6128449", "0.61177945", "0.61156005", "0.60949004", "0.60733575", "0.6...
0.7717564
0
Creates a MonitoredSession for training the model. This monitored session automatically saves and restores from checkpoints, saves variable summaries for visualization in TensorBoard, and logs basic info to the terminal. This is useful for monitoring models during long training sessions, and ensuring that they can be s...
def create_training_session(model_config: cnn.config.ModelConfig, loss, global_step): if model_config.phase != 'train': raise ValueError( "Only use create_training_session for training phase.") # Allow soft placement for operations to be placed on proper device ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_testing_session(model_config: cnn.config.ModelConfig, saver):\n if model_config.phase not in ['valid', 'test']:\n raise ValueError(\n \"Only use create_testing_session for validation or testing phase.\")\n\n scaffold = tf.train.Scaffold(saver=saver)\n session_creator = tf.trai...
[ "0.6682761", "0.6511361", "0.6497392", "0.64582217", "0.63924503", "0.6346651", "0.6293058", "0.6256906", "0.62370956", "0.6214028", "0.61664075", "0.6143507", "0.6117075", "0.6111966", "0.60893905", "0.60816073", "0.6078062", "0.60620797", "0.60599977", "0.6050847", "0.60336...
0.7226551
0
Creates a MonitoredSession for testing the model. This monitored session allows a Saver argument for custom restores (e.g. from moving variable averages), but contains no hooks for saving summaries/checkpoints to avoid conflicts with training summaries and prevent training on the testing/validation sets. Should be used...
def create_testing_session(model_config: cnn.config.ModelConfig, saver): if model_config.phase not in ['valid', 'test']: raise ValueError( "Only use create_testing_session for validation or testing phase.") scaffold = tf.train.Scaffold(saver=saver) session_creator = tf.train.ChiefSessio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_training_session(model_config: cnn.config.ModelConfig,\n loss, global_step):\n if model_config.phase != 'train':\n raise ValueError(\n \"Only use create_training_session for training phase.\")\n # Allow soft placement for operations to be placed on prop...
[ "0.6909469", "0.61308676", "0.60341275", "0.58963907", "0.5852314", "0.5791459", "0.5780164", "0.57307506", "0.5714866", "0.5713237", "0.5684241", "0.5677207", "0.56707054", "0.56444424", "0.56095165", "0.5585186", "0.5558197", "0.55407584", "0.5535498", "0.5529235", "0.55129...
0.8055052
0
Downloads a single image data is (url, image_id, target_path)
def download_single(data): url = data[0] image_id = data[1] target_path = data[2] if os.path.exists(target_path): return try: response = requests.get(url, timeout=30) response.raise_for_status() except: LOGGER.warning('Failed to fetch url %s (id=%d)', url, image...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_image(filename):\n return ImageApiHandler.image_handler.get(filename)", "def image_downloader(url, file_path, file_name):\n response = requests.get(url, stream=True)\n with open(file_path + \"/\" + file_name, 'wb') as out_file:\n shutil.copyfileobj(response.raw, out_file)", "de...
[ "0.71391636", "0.6889321", "0.68687314", "0.68459874", "0.68292755", "0.6829245", "0.6825442", "0.6798488", "0.6777108", "0.6774642", "0.6764667", "0.6758211", "0.6752763", "0.67475814", "0.6743195", "0.6734419", "0.6682625", "0.66636944", "0.6628485", "0.66243595", "0.660711...
0.8401975
0
rename file content from [src] to [dst] recurively
def rename_file_content(topdir, src, dst): print 'begin rename file content from %s to %s' % (src, dst) backup_file_ext = 'xxx_sed_backup_file_001' os.popen('find %s -type file | xargs sed -i %s -e "s/%s/%s/g"' % (topdir, backup_file_ext, src, dst)).read() #mac OSX does not support sed without backup ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hmove(src_path, res_path):\n os.rename(src_path, res_path)", "def rename_dir(top_dir, src, dst):\n\n print 'begin rename dir from %s to %s' % (src, dst)\n def rename_filename(dirname, filename, src, dst):\n newfilename = filename.replace(src, dst)\n if newfilename != filename:\n ...
[ "0.64917046", "0.64108866", "0.63785034", "0.6280408", "0.6238793", "0.62178844", "0.6127286", "0.61250407", "0.61007726", "0.608937", "0.60808116", "0.60010797", "0.5971691", "0.59524834", "0.5952316", "0.5941403", "0.5921947", "0.5864", "0.58626187", "0.57955885", "0.576841...
0.71933603
0
rename dir from [src] to [dst] with top_dir as base dir recursively
def rename_dir(top_dir, src, dst): print 'begin rename dir from %s to %s' % (src, dst) def rename_filename(dirname, filename, src, dst): newfilename = filename.replace(src, dst) if newfilename != filename: abs_old_filename = os.path.join(dirname, filename) abs_new_filena...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_recursively(src, dst, overwrite=False, changed_only=True):\n if os.path.isdir(src):\n movetree(src, dst, overwrite, changed_only)\n else:\n movefile(src, dst, overwrite, changed_only)", "def copy_dir(src: Text, dst: Text) -> None:\n\n if tf.io.gfile.exists(dst):\n tf.io.gfile.rmt...
[ "0.6346191", "0.5870936", "0.58638346", "0.5847841", "0.5846037", "0.5804263", "0.5804097", "0.5770174", "0.5761442", "0.5758698", "0.57553095", "0.57118124", "0.5703733", "0.56590664", "0.5635563", "0.56160563", "0.5576906", "0.5573678", "0.5572881", "0.55721563", "0.5566769...
0.81619817
0
Setter method for interface_id, mapped from YANG variable /qos/interfaces/interface/config/interface_id (string)
def _set_interface_id(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="interface-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/qos',...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_interface_id(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name=\"interface-id\", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.n...
[ "0.81899124", "0.81899124", "0.81899124", "0.7132861", "0.7132861", "0.7132861", "0.6028613", "0.6023209", "0.6004262", "0.5931792", "0.57908577", "0.57908577", "0.57908577", "0.57908577", "0.57908577", "0.57908577", "0.57818705", "0.57818705", "0.57818705", "0.57818705", "0....
0.8190834
1
Setter method for interface_id, mapped from YANG variable /qos/interfaces/interface/state/interface_id (string)
def _set_interface_id(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="interface-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/qos',...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_interface_id(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name=\"interface-id\", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.n...
[ "0.7782438", "0.7782438", "0.7782438", "0.6774489", "0.6774489", "0.6774489", "0.5807226", "0.5768262", "0.57586175", "0.56652474", "0.56652474", "0.56652474", "0.56652474", "0.56652474", "0.56652474", "0.5657688", "0.5652167", "0.5652167", "0.5652167", "0.5652167", "0.565216...
0.77902234
1
Setter method for config, mapped from YANG variable /qos/interfaces/interface/interface_ref/config (container)
def _set_config(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=yc_config_openconfig_qos__qos_interfaces_interface_interface_ref_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_config(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=yc_config_openconfig_qos_interfaces__qos_interfaces_interface_interface_ref_config, is_container='container', yang_name=\"config\", parent=self, path_helper=self._path_helper, extme...
[ "0.8146012", "0.8117423", "0.7953249", "0.7907186", "0.78786486", "0.73867154", "0.72686774", "0.72409487", "0.6881878", "0.6877423", "0.68684834", "0.6847415", "0.68434215", "0.6832938", "0.6687303", "0.65838116", "0.65828574", "0.6532064", "0.6504658", "0.6457596", "0.63441...
0.8143564
1
Setter method for state, mapped from YANG variable /qos/interfaces/interface/interface_ref/state (container)
def _set_state(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=yc_state_openconfig_qos__qos_interfaces_interface_interface_ref_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, regi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_state(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=yc_state_openconfig_qos_interfaces__qos_interfaces_interface_interface_ref_state, is_container='container', yang_name=\"state\", parent=self, path_helper=self._path_helper, extmethod...
[ "0.8244119", "0.8192795", "0.79402775", "0.7865672", "0.7860058", "0.75255936", "0.73983353", "0.7377222", "0.6818446", "0.6709193", "0.6694411", "0.6682363", "0.6600724", "0.6589574", "0.6549542", "0.6528595", "0.6457562", "0.64349616", "0.6412104", "0.6384799", "0.63736576"...
0.8197211
1
Setter method for config, mapped from YANG variable /qos/interfaces/interface/input/classifers/classifier/terms/term/config (container)
def _set_config(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=yc_config_openconfig_qos__qos_interfaces_interface_input_classifers_classifier_terms_term_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_config(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=yc_config_openconfig_qos_elements__qos_interfaces_interface_input_classifers_classifier_terms_term_config, is_container='container', yang_name=\"config\", parent=self, path_helper=s...
[ "0.7606052", "0.7591687", "0.7561325", "0.7548229", "0.7475935", "0.74502414", "0.7425491", "0.7415674", "0.6984064", "0.6963671", "0.6878659", "0.6628707", "0.66189444", "0.6523294", "0.63235956", "0.62884647", "0.6185324", "0.598463", "0.5982395", "0.5965562", "0.5936933", ...
0.76611096
0
Setter method for state, mapped from YANG variable /qos/interfaces/interface/input/classifers/classifier/terms/term/state (container)
def _set_state(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=yc_state_openconfig_qos__qos_interfaces_interface_input_classifers_classifier_terms_term_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmetho...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_state(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=yc_state_openconfig_qos_interfaces__qos_interfaces_interface_input_classifers_classifier_terms_term_state, is_container='container', yang_name=\"state\", parent=self, path_helper=sel...
[ "0.78869766", "0.78682524", "0.78574216", "0.7814068", "0.7725069", "0.77229714", "0.7707321", "0.769102", "0.74881786", "0.7439152", "0.73580116", "0.7076026", "0.7050621", "0.69328153", "0.6664951", "0.66450274", "0.65069026", "0.6405532", "0.63984424", "0.63759774", "0.629...
0.7909483
0
Setter method for term, mapped from YANG variable /qos/interfaces/interface/input/classifers/classifier/terms/term (list)
def _set_term(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=YANGListType("id",yc_term_openconfig_qos__qos_interfaces_interface_input_classifers_classifier_terms_term, yang_name="term", parent=self, is_container='list', user_ordered=False, path_helper=sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_term(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=YANGListType(\"id\",yc_term_openconfig_qos_interfaces__qos_interfaces_interface_input_classifers_classifier_terms_term, yang_name=\"term\", parent=self, is_container='list', user_orde...
[ "0.8374298", "0.83437955", "0.82650393", "0.82489085", "0.82488185", "0.8226012", "0.8219954", "0.8155127", "0.66154754", "0.66125315", "0.6609212", "0.6439823", "0.6438093", "0.6432275", "0.6432027", "0.6428845", "0.6414285", "0.6362249", "0.61389464", "0.57834643", "0.56155...
0.83951336
0
Setter method for type, mapped from YANG variable /qos/interfaces/interface/input/classifers/classifier/type (leafref)
def _set_type(self, v, load=False): parent = getattr(self, "_parent", None) if parent is not None and load is False: raise AttributeError("Cannot set keys directly when" + " within an instantiated list") if hasattr(v, "_utype"): v = v._utype(v) try: t = YA...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetType(self, ct_type):\r\n\r\n self._type = ct_type", "def _set_classifier(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=YANGListType(\"type\",yc_classifier_openconfig_qos_interfaces__qos_interfaces_interface_input_classifers_cla...
[ "0.57758385", "0.57692015", "0.5754082", "0.5747449", "0.5721117", "0.5658423", "0.5636442", "0.56276214", "0.56276214", "0.56276214", "0.5608933", "0.5551589", "0.5547764", "0.5515171", "0.54010576", "0.54010576", "0.53105253", "0.53105253", "0.53105253", "0.52948874", "0.52...
0.69743407
0
Setter method for config, mapped from YANG variable /qos/interfaces/interface/input/classifers/classifier/config (container)
def _set_config(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=yc_config_openconfig_qos__qos_interfaces_interface_input_classifers_classifier_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_config(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=yc_config_openconfig_qos_interfaces__qos_interfaces_interface_input_classifers_classifier_config, is_container='container', yang_name=\"config\", parent=self, path_helper=self._path...
[ "0.8145628", "0.809792", "0.79226816", "0.791101", "0.78818464", "0.7638528", "0.7476497", "0.7442925", "0.7424228", "0.7408714", "0.73673475", "0.7268389", "0.7236966", "0.7205969", "0.6777764", "0.6619697", "0.6574061", "0.65522754", "0.6492285", "0.64859265", "0.64172995",...
0.8127788
1
Setter method for state, mapped from YANG variable /qos/interfaces/interface/input/classifers/classifier/state (container)
def _set_state(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=yc_state_openconfig_qos__qos_interfaces_interface_input_classifers_classifier_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._ex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_state(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=yc_state_openconfig_qos_interfaces__qos_interfaces_interface_input_classifers_classifier_state, is_container='container', yang_name=\"state\", parent=self, path_helper=self._path_hel...
[ "0.8306941", "0.82454526", "0.80452716", "0.80269146", "0.7996698", "0.7942272", "0.7838756", "0.7770802", "0.77588135", "0.7724778", "0.76856166", "0.75645226", "0.75358456", "0.75073624", "0.7225943", "0.71405953", "0.70932406", "0.706191", "0.7046025", "0.7013806", "0.6970...
0.82861716
1
Setter method for terms, mapped from YANG variable /qos/interfaces/interface/input/classifers/classifier/terms (container)
def _set_terms(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=yc_terms_openconfig_qos__qos_interfaces_interface_input_classifers_classifier_terms, is_container='container', yang_name="terms", parent=self, path_helper=self._path_helper, extmethods=self._ex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_terms(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=yc_terms_openconfig_qos_interfaces__qos_interfaces_interface_input_classifers_classifier_terms, is_container='container', yang_name=\"terms\", parent=self, path_helper=self._path_hel...
[ "0.8533379", "0.85098344", "0.832434", "0.83225614", "0.83097535", "0.8246773", "0.8212973", "0.8140858", "0.73020494", "0.7287533", "0.72802967", "0.7185096", "0.7172012", "0.71675533", "0.6929113", "0.6920191", "0.68693167", "0.6594656", "0.59487295", "0.5674005", "0.565381...
0.85322285
1
Setter method for classifier, mapped from YANG variable /qos/interfaces/interface/input/classifers/classifier (list)
def _set_classifier(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=YANGListType("type",yc_classifier_openconfig_qos__qos_interfaces_interface_input_classifers_classifier, yang_name="classifier", parent=self, is_container='list', user_ordered=False, path_h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_classifier(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=YANGListType(\"type\",yc_classifier_openconfig_qos_interfaces__qos_interfaces_interface_input_classifers_classifier, yang_name=\"classifier\", parent=self, is_container='list', ...
[ "0.8287829", "0.8238964", "0.8052655", "0.8030958", "0.8011114", "0.78372765", "0.76806813", "0.76200706", "0.6130982", "0.60247415", "0.593112", "0.588135", "0.5880471", "0.5865616", "0.5856412", "0.584326", "0.58242977", "0.5824165", "0.5742278", "0.5726974", "0.5726974", ...
0.8259629
1
Setter method for config, mapped from YANG variable /qos/interfaces/interface/input/queues/queue/config (container)
def _set_config(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=yc_config_openconfig_qos__qos_interfaces_interface_input_queues_queue_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmeth...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_config(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=yc_config_openconfig_qos_interfaces__qos_interfaces_interface_input_queues_queue_config, is_container='container', yang_name=\"config\", parent=self, path_helper=self._path_helper, ...
[ "0.85493946", "0.85262656", "0.8500836", "0.8441009", "0.84041727", "0.83886164", "0.83562607", "0.8350517", "0.7915482", "0.780932", "0.7755462", "0.70047677", "0.6975069", "0.6974222", "0.69704825", "0.6967435", "0.69445616", "0.6840074", "0.6824799", "0.68040514", "0.68007...
0.85683334
0
Setter method for state, mapped from YANG variable /qos/interfaces/interface/input/queues/queue/state (container)
def _set_state(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=yc_state_openconfig_qos__qos_interfaces_interface_input_queues_queue_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_state(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=yc_state_openconfig_qos_interfaces__qos_queues_queue_state, is_container='container', yang_name=\"state\", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, re...
[ "0.8598562", "0.8544639", "0.8544324", "0.85001516", "0.848391", "0.8263619", "0.8260857", "0.8232529", "0.7937532", "0.7864681", "0.78576434", "0.7141913", "0.7135628", "0.7129301", "0.69494706", "0.69312835", "0.69303346", "0.69251883", "0.69057214", "0.68994606", "0.685972...
0.8546665
1