query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Force ongoing live migration to complete
def live_migrate_force_complete(self, server, migration): body = {'force_complete': None} resp, body = self.api.client.post( '/servers/%s/migrations/%s/action' % (base.getid(server), base.getid(migration)), body=body) retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def migration():", "def migrate(self):\n\tpass", "def post_migrations(self):", "def model_post_migrate(*args, **kwargs):\n global IN_MIGRATIONS\n IN_MIGRATIONS = False", "def run_migration(self):\n step = \"Migrating Database\"\n try:\n self.slacker.send_thread_reply(step)\n ...
[ "0.7204588", "0.7060435", "0.7018086", "0.67843336", "0.6716327", "0.6643194", "0.65348613", "0.63825476", "0.6346392", "0.63234293", "0.6320481", "0.63142586", "0.63106877", "0.63106877", "0.6302978", "0.62963974", "0.6280855", "0.62656957", "0.62344575", "0.6208175", "0.620...
0.6850961
3
Get a migration of a specified server
def get(self, server, migration): return self._get('/servers/%s/migrations/%s' % (base.getid(server), base.getid(migration)), 'migration')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list(self, server):\n return self._list(\n '/servers/%s/migrations' % (base.getid(server)), \"migrations\")", "def get_migration(self, _id: int) -> Optional[Migration]:\n for migration in self.migrations:\n if migration.id == _id:\n return migration\n ...
[ "0.65762854", "0.5903064", "0.57015634", "0.5498266", "0.5447161", "0.53921473", "0.5252999", "0.51654613", "0.5109671", "0.5014758", "0.49973872", "0.49665922", "0.4944251", "0.4910747", "0.4888143", "0.48865587", "0.48741516", "0.4832848", "0.48080567", "0.48019844", "0.478...
0.8369567
0
Get a migrations list of a specified server
def list(self, server): return self._list( '/servers/%s/migrations' % (base.getid(server)), "migrations")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_applied_migrations(self):\n with self.internal_db.begin() as conn:\n sql = \"SELECT name from migration;\"\n migrations = conn.execute(sql).fetchall()\n return [m[0] for m in migrations]", "def get(self, server, migration):\n return self._get('/servers/%s/migrat...
[ "0.6635136", "0.6470522", "0.63409764", "0.59359926", "0.5868745", "0.5838271", "0.57854855", "0.57466656", "0.56155324", "0.5562354", "0.5559403", "0.5559026", "0.55545276", "0.5531459", "0.5406119", "0.53998864", "0.5366492", "0.53645813", "0.5352012", "0.53041464", "0.5299...
0.86654884
0
Cancel an ongoing live migration
def live_migration_abort(self, server, migration): return self._delete( '/servers/%s/migrations/%s' % (base.getid(server), base.getid(migration)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def migrate_cancel(self):\n\t\treturn Job(SDK.PrlVm_MigrateCancel(self.handle)[0])", "def cancel(self):\n self.session.rollback()", "def cancel(self) -> None:\n c = self.pgconn.get_cancel()\n c.cancel()", "def cancel(self):\n pass", "def cancel():", "def cancel(self):", "def...
[ "0.764301", "0.6904926", "0.65942436", "0.6392075", "0.6307264", "0.6264627", "0.6264627", "0.6264627", "0.62033683", "0.6092558", "0.6092558", "0.60868293", "0.6083494", "0.6041118", "0.5979406", "0.59677255", "0.59653294", "0.596301", "0.59626913", "0.5956265", "0.59348416"...
0.72220004
1
Backs up a folder to a zip file This function takes the contents (recursively) of a folder and backs them up to a zip file.
def backupToZip(folder): folder = os.path.abspath(folder) #Ensure we're using the absolute path number = 1 while True: zipFilename = os.path.basename(folder) + '_' + str(number) + '.zip' if not os.path.exists(zipFilename): break number += 1 #Create the zip file ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_zip_backup(folder_path):\n\n # checking that parameter contains absolute path\n if not os.path.isabs(folder_path):\n print(\"Required an absolute path to generate a zip backup\")\n return\n\n # checking that folder exists before backuping\n if not os.path.isdir(folder_path):\n ...
[ "0.7182938", "0.70816165", "0.66951454", "0.6578646", "0.6496767", "0.64625716", "0.64222264", "0.63613576", "0.62886965", "0.6280407", "0.6269397", "0.6232583", "0.6067449", "0.60649943", "0.6032387", "0.60246265", "0.60167176", "0.5995485", "0.5989524", "0.59724647", "0.596...
0.80446476
0
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`.
def plot_confusion_matrix(cm, classes, normalize=False, title='Confusion matrix', cmap=plt.cm.Blues): if normalize: cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis] print("Normalized confusion matrix") else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n...
[ "0.8194862", "0.80949175", "0.8029915", "0.8019153", "0.79941195", "0.7991258", "0.7980955", "0.7976606", "0.79610753", "0.79590565", "0.79378676", "0.7934962", "0.7934504", "0.79313844", "0.7926313", "0.7924577", "0.79241234", "0.7923211", "0.7923023", "0.7921931", "0.791787...
0.7845746
48
Unregisters and registers with new custom admin panels
def reg_admin(): for model in models.get_models(): if _check_name(model): admin.site.unregister(model) admin.site.register(model, LocationAuditAdmin)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_module():\n\n # Course Dashboard\n tabs.Registry.register(\n base.OfflineAssignmentBase.DASHBOARD_NAV,\n base.OfflineAssignmentBase.DASHBOARD_TAB,\n base.OfflineAssignmentBase.DESCRIPTION,\n off_ass_dashboard.OfflineAssignmentDashboardHandler)\n\n dashboard.Dashboa...
[ "0.60133576", "0.5804296", "0.55303526", "0.5491801", "0.54885453", "0.54811734", "0.5326041", "0.5307102", "0.52954674", "0.5272991", "0.5260019", "0.5254747", "0.52482134", "0.5233564", "0.5233559", "0.5215448", "0.52059233", "0.5200994", "0.5189056", "0.5153242", "0.514729...
0.6133607
0
Returns the direction the detect objects (contours) are compared to the center of the image, this is returned in normalized screen space 1 to 1 (1 meaning the most left compared to the center, and 1 the most right compared to the center and 0 meaning perfectly centered xy_center_directions returns x and y center direct...
def xy_center_directions(contours, image: ndarray): return contours_.calculate_normalized_screen_space(contours, image)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def center_directions(contours, image: ndarray):\n return contours_.contour_average_center(contours)", "def _centered_coords(self):\n\n array = self.detection_base.height_model.array\n height, width = self.detection_base.height_model.cell_size_x * array.shape[0], \\\n self...
[ "0.6688183", "0.5997663", "0.59733456", "0.5901859", "0.5878864", "0.58696026", "0.5829185", "0.57540023", "0.5694345", "0.56603926", "0.5657609", "0.5637801", "0.5630213", "0.5619939", "0.5613608", "0.5605313", "0.55993795", "0.55470574", "0.55371344", "0.5507005", "0.549903...
0.72629136
0
Returns the average center of the contours or list of contours that are the final targets This is the default directions function since it doesnt calculate any directions, only finds the center
def center_directions(contours, image: ndarray): return contours_.contour_average_center(contours)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_center( contours ):\r\n ret = []\r\n\r\n for x in contours:\r\n M = cv2.moments( x )\r\n pt = Point()\r\n pt.x = int( M['m10']/M['m00'] )\r\n pt.y = int( M['m01']/M['m00'] )\r\n\r\n ret.append( pt )\r\n\r\n return( ret );", "def xy_center_directions(contours, ...
[ "0.6287653", "0.6173183", "0.61626303", "0.5972788", "0.5970468", "0.57259196", "0.5716139", "0.57096714", "0.5702477", "0.57018715", "0.5674532", "0.5667665", "0.563917", "0.5589692", "0.55148965", "0.54906875", "0.5481084", "0.5470445", "0.5454891", "0.5452313", "0.5449522"...
0.735926
0
Counts the amount of successful object detections.
def target_amount_directions(contours, image: ndarray): return len(contours)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resultCounter(detections):\n counter = 0\n for attribute, value in classIterator(detections):\n if 'crease' in attribute:\n counter += len(value)\n return counter", "def obstacle_count(self):\n #scan area in front of robot\n self.scan()\n #Figure ot how many ob...
[ "0.7270498", "0.70085955", "0.6897006", "0.68248814", "0.65556407", "0.6474854", "0.63986397", "0.63715106", "0.62562704", "0.6249045", "0.6217766", "0.621775", "0.6177267", "0.61656386", "0.61498624", "0.6131666", "0.61292815", "0.61159194", "0.6108707", "0.60941064", "0.609...
0.0
-1
Retime a generic OpenRAVE trajectory into a timed for OWD. First, try to retime the trajectory into a MacTrajectory using OWD's MacRetimer. If MacRetimer is not available, then fall back on the default OpenRAVE retimer. traj input trajectory max_jerk maximum jerk allowed during retiming synchronize enable synchronizati...
def RetimeTrajectory(self, traj, max_jerk=30.0, synchronize=False, stop_on_stall=True, stop_on_ft=False, force_direction=None, force_magnitude=None, torque=None, **kw_args): # Fall back on the standard OpenRAVE retimer if MacTrajectory is not # available...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ExecuteTrajectory(self, traj, timeout=None, blend=True, retime=True, limit_tolerance=1e-3, synchronize=True, **kw_args):\n # Query the active manipulators based on which DOF indices are\n # included in the trajectory.\n active_manipulators = self.GetTrajectoryManipulators(traj)\n ne...
[ "0.64776725", "0.57618105", "0.5051099", "0.50354636", "0.4887224", "0.48129752", "0.47852176", "0.47836939", "0.47655028", "0.4751602", "0.4736376", "0.47340217", "0.46570545", "0.46272182", "0.4611437", "0.46056557", "0.45990774", "0.45985407", "0.45913064", "0.45853823", "...
0.75501573
0
Blend a trajectory for execution in OWD. Blending a trajectory allows the MacRetimer to smoothly accelerate through waypoints. If a blend radius is not specified, it defaults to zero and the controller must come to a stop at each waypoint. This adds the \tt blend_radius group to the input trajectory. traj input traject...
def BlendTrajectory(self, traj, maxsmoothiter=None, resolution=None, blend_radius=0.2, blend_attempts=4, blend_step_size=0.05, linearity_threshold=0.1, ignore_collisions=None, **kw_args): with self: return self.trajectory_module.blendtrajectory(traj=tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def blendTangent(self, blend):\n if blend and self._patches:\n self._prevPatchStartIndex = self._patches[-1].startIndex()\n else:\n self._prevPatchStartIndex = 1e10", "def set_blend_radius(print_organizer, d_fillet=10, buffer=0.3):\n\n logger.info(\"Setting blend radius\")\...
[ "0.6246105", "0.58287215", "0.5367136", "0.5344815", "0.5186415", "0.51465267", "0.51189536", "0.50626063", "0.5061908", "0.5035875", "0.50047594", "0.49633598", "0.49114856", "0.49037868", "0.4902819", "0.48953748", "0.48922417", "0.48837733", "0.4830077", "0.48256335", "0.4...
0.7580831
0
Execute a trajectory. By default, this function retimes, blends, and adds the stop_on_stall flag to all trajectories. This behavior can be overriden using the \tt blend and \tt retime flags or by passing the appropriate \tt kw_args arguments to the blender and retimer. By default, this function blocks until trajectory ...
def ExecuteTrajectory(self, traj, timeout=None, blend=True, retime=True, limit_tolerance=1e-3, synchronize=True, **kw_args): # Query the active manipulators based on which DOF indices are # included in the trajectory. active_manipulators = self.GetTrajectoryManipulators(traj) needs_synch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_hybrid_control_trajectory(self, trajectory, model, max_force_torque, timeout=5.0,\n stop_on_target_force=False, termination_criteria=None,\n displacement_epsilon=0.002, check_displacement_time=2.0,\n ...
[ "0.5539077", "0.5405223", "0.5195004", "0.51543003", "0.51397663", "0.49278358", "0.47854707", "0.46823263", "0.46326283", "0.4627261", "0.45890072", "0.4556019", "0.45381248", "0.44984668", "0.44904834", "0.4479847", "0.44633135", "0.44597632", "0.44556123", "0.44518995", "0...
0.67021406
0
This function takes in a list of any type and reverse it
def recursive_list_reverse(ls: list)->list: if ls: return recursive_list_reverse(ls[1:]) + [ls[0]] else: return []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reverse(*, list : Union[List[Any], ConduitVariable]) -> None:\n list.reverse()", "def reverse_list(items):\n\n return items[::-1]", "def reverse_list(self,list_):\r\n list_.reverse()", "def reverse_list(s_list):\n require_type(isa(s_list, List), 'parameter of reverse must be a list')\...
[ "0.8506192", "0.8255569", "0.7932985", "0.77202743", "0.7693257", "0.74789643", "0.7452501", "0.74197346", "0.72985035", "0.7250638", "0.72166467", "0.71269745", "0.7125287", "0.7038873", "0.70346695", "0.7029365", "0.7028975", "0.7001069", "0.6975123", "0.69476056", "0.69147...
0.69460106
20
function returns n combination r from pascals triangle
def pascal_triangle(n: int, r: int): if n==0 return 1 elif r ==0: return 1 elif n==r: return 1 else return pascal_triangle(n-1,r) + pascal_triangle(n-1, r-1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def r_combinations(n,r):\n return r_permutations(n,r) / math.factorial(r)", "def triangleNumber(n):\n return sum(range(n+1))", "def get_triangle_numbers(n):\n r = []\n for i in xrange(1, n + 1):\n t = ((i * (i + 1)) / 2)\n r.append(t)\n return r", "def permutations(n, r):\n re...
[ "0.75085384", "0.7400091", "0.7251817", "0.7202176", "0.7190689", "0.71306235", "0.7108646", "0.7101338", "0.7094721", "0.70332265", "0.70266634", "0.7013671", "0.6937788", "0.69373167", "0.6901856", "0.68888044", "0.68879896", "0.68220484", "0.6811778", "0.6787959", "0.67834...
0.74600625
1
function outputs console interface and responds user input
def update(self): # pragma: no cover print(_choices) while True: try: user_input = int(input()) if user_input < 1 or user_input > 5: raise ValueError # this will send it to the # print message and b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def console():\n value = input(' -> ' + bc.FAIL + 'wmd' + bc.ENDC + '@' + bc.FAIL + 'changeme:' + bc.ENDC + ' ')\n userinput = value.split()\n # Show options\n if 'so' in userinput[:1]:\n sop.show_opt()\n # Show all info\n elif 'sa' in userinput[:1]:\n sop.show_all()\n # Run mo...
[ "0.7256005", "0.72226304", "0.6916377", "0.68207747", "0.67782474", "0.6772474", "0.67112774", "0.66950375", "0.66484797", "0.66417015", "0.6631729", "0.6603269", "0.6589633", "0.657715", "0.6575872", "0.6519431", "0.6506439", "0.6503734", "0.6501386", "0.65011364", "0.645839...
0.0
-1
function implements interface that outputs all records
def show_recs(self): if len(self.storage.records) == 0: return "Records not found!" else: string_of_records = "" for record in self.storage.records: string_of_records += record.to_string() return string_of_records
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def records(self):\r\n raise NotImplementedError()", "def get_all_records(self, data: dict, execution_context: dict):", "async def get_all_record():\n # X_new = item.to_df()\n # item_str = item.to_string()\n # project_code = int(item_str[item_str.find('=')+1:])\n pg = PostgreSQL()\n retur...
[ "0.71311724", "0.6898564", "0.6442363", "0.6388859", "0.6324791", "0.6284191", "0.62724614", "0.6192477", "0.6160231", "0.61510426", "0.611075", "0.6085744", "0.6068864", "0.60219085", "0.6000698", "0.59966624", "0.599375", "0.5986212", "0.5984351", "0.59460783", "0.594217", ...
0.6081127
12
>>> temp = io_helper.set_new("12\\nname\\naddr\\n") >>> val= ConsoleInterface(MemoryRecordStorage([])).add_rec() >>> io_helper.set_former(temp) >>> val 'Record added successfully' function implements interface that adds record
def add_rec(self): print("Write phone number:") add_phone_number_input = input() print("Write name of the record:") add_name_input = input() print("Write address:") add_address_input = input() return self.storage.add( add_phone_number_input, add_name_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_record(self, record):\n pass", "def test_record_add():\n\n display = Display()\n display.add('first')\n display.add('second')\n\n assert len(display.display_output) == 2", "def _add_recorder(self, variable):\n raise NotImplementedError", "def FILE_RTRV_record(self):\n eor...
[ "0.5955477", "0.5844077", "0.54942876", "0.54797316", "0.54465395", "0.52920324", "0.5285212", "0.5279746", "0.52550757", "0.5236633", "0.52354974", "0.52162975", "0.5192673", "0.51570594", "0.51551163", "0.51312655", "0.51297307", "0.51247436", "0.51221544", "0.50602716", "0...
0.5862049
1
>>> temp = io_helper.set_new("12\\n") >>> res= ConsoleInterface(MemoryRecordStorage()).remove_rec() >>> io_helper.set_former(temp) >>> res 'Record not found' function implements interface that removes record
def remove_rec(self): print("Write phone number:") remove_phone_number_input = input() return self.storage.remove(remove_phone_number_input)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pop_write(self):\n ...", "def undo(self):\r\n previous = self.memory.pop()\r\n if not isinstance(previous, task2.ListADT):\r\n raise TypeError(\"Did not expect any other object in memory\")\r\n if previous[0] == \"d\":\r\n index = previous[1]\r\n f...
[ "0.53218615", "0.5136622", "0.51338655", "0.51264924", "0.5107625", "0.5001114", "0.49959147", "0.4910786", "0.49040174", "0.4860867", "0.47833407", "0.47785375", "0.47783056", "0.47436464", "0.47293022", "0.47262895", "0.47256777", "0.4703999", "0.46816048", "0.46761337", "0...
0.5560903
0
>>> [ConsoleInterface(MemoryRecordStorage()).remove_all_recs()] ['All records have been erased'] function implements interface that removes all records
def remove_all_recs(self): return self.storage.clear()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_records(self) -> None:\n for container in self.record_containers:\n container.clear_records()", "def clear_all():\n bpy.ops.object.select_all(action='SELECT')\n bpy.ops.object.delete()", "def remove_all():\n storage = FileStorage()\n objects = storage.all()\n ...
[ "0.66904634", "0.6276651", "0.6266155", "0.61560607", "0.6145792", "0.6092948", "0.60891646", "0.6065167", "0.60158616", "0.6007153", "0.59672874", "0.5888242", "0.58739835", "0.5846741", "0.5836213", "0.58347726", "0.5826493", "0.5804345", "0.5804345", "0.5804345", "0.580434...
0.72792065
0
>>> temp = io_helper.set_new("12\\nname\\naddr\\n") >>> res= ConsoleInterface(MemoryRecordStorage()).update_rec() >>> io_helper.set_former(temp) >>> res 'Record not found' function implements interface that updates record
def update_rec(self): print("Write phone number:") update_phone_number_input = input() print("Write new name of the record:") update_name_input = input() print("Write new address:") update_address_input = input() return self.storage.update( update_phon...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self, read, info: ModificationInfo):", "def update(self, line):", "def test_patch_record(self):\n pass", "def _set_packed_record(self, i, s):\n\n raise NotImplementedError()", "def _add_to_ref(self, rec_curr, line):\n # Examples of record lines containing ':' include:\n ...
[ "0.5850617", "0.5622828", "0.5558996", "0.54402775", "0.5307458", "0.5306181", "0.5289004", "0.5260318", "0.5247207", "0.5246717", "0.52426815", "0.513985", "0.5122304", "0.5113792", "0.51074845", "0.50957656", "0.5067799", "0.50669193", "0.5039942", "0.5013815", "0.49793434"...
0.5651579
1
function runs loop for infinite menu output
def run(self): # pragma: no cover while True: self.update()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def STARTMENU_LOOP():\n pass", "def main(self):\n while self.leave_main_menu:\n print(fr.FR[4], fr.FR[5], fr.FR[6], fr.FR[7])\n self.choice_menu = input(fr.FR[8])\n self.main_menu_input()", "def run(self):\n while True:\n self.menu()\n ...
[ "0.80929637", "0.75484467", "0.7233137", "0.7231741", "0.71407855", "0.7124997", "0.71035296", "0.6959605", "0.6957553", "0.69392127", "0.68988335", "0.6896735", "0.68822074", "0.6853966", "0.6853966", "0.6811423", "0.6788544", "0.67814904", "0.6769244", "0.6754431", "0.67349...
0.0
-1
Calculates truncated mean for a given numpy array
def trunc_mean(arr, n = 0.1): if type(arr) is not np.ndarray: logging.error('arr type must be numpy array') return flat_arr = list((arr.flatten())) flat_arr.sort() trunc_indices = ceil(flat_arr.__len__() * n) if n<=0 or trunc_indices <1 or (2 * trunc_indices +1) >= len(flat_arr) : ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wo_mean(arr):\n\n return np.array(arr) - np.mean(arr, axis=0)", "def har_mean(array):\n return ((sum([1/x for x in array]))**(-1))*len(array)", "def expanding_mean(arr):\n total_len = arr.shape[0]\n return ((arr / total_len).cumsum() / np.arange(1, total_len + 1)) * total_len", "def mean(arr)...
[ "0.74097645", "0.73743963", "0.7330628", "0.7146221", "0.7097715", "0.70954114", "0.7085901", "0.7041643", "0.7021862", "0.6990255", "0.69567066", "0.688763", "0.6884273", "0.6852552", "0.6774491", "0.67742735", "0.6767213", "0.6758347", "0.67554206", "0.673708", "0.6720732",...
0.72338575
3
run the functions that build up the figure
def plot_combined_spectrum(SSC, band): def get_spectrum(SSC, band): spectrum = spectra[str(SSC['no'])][band] frequency = spectrum['frequency'].to(u.GHz) intensity = spectrum['spectrum'].to(u.K) # shift spectrum to rest frequency velshift = SSC['velshift'] frequency...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n self.simulate_test_data()\n self.pipeline_test_data()\n self.plot_jump_flags_image()\n self.plot_groupdq_flags(pixel=[884, 550])\n self.plot_ramps_pre_post_correction(pixel=[884, 550])", "def main():\n save = False\n show = True\n\n #hd_parameter_plots...
[ "0.7163796", "0.7062575", "0.697541", "0.6972975", "0.6890155", "0.6872394", "0.68260795", "0.6725831", "0.6690253", "0.6663527", "0.6623025", "0.6621096", "0.65647256", "0.6552204", "0.65331537", "0.652853", "0.65193284", "0.6517966", "0.64880514", "0.64584625", "0.64567554"...
0.0
-1
run the functions that build up the figure
def plot_combined_variation(nums, SSC, band, rms): def get_spectra(nums, SSC, band, rms): spectrum = spectra[str(SSC['no'])][band] frequency = spectrum['frequency'].to(u.GHz) intensity = spectrum['spectrum'].to(u.K) # shift spectrum to rest frequency velshift = SSC['velshi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n self.simulate_test_data()\n self.pipeline_test_data()\n self.plot_jump_flags_image()\n self.plot_groupdq_flags(pixel=[884, 550])\n self.plot_ramps_pre_post_correction(pixel=[884, 550])", "def main():\n save = False\n show = True\n\n #hd_parameter_plots...
[ "0.7162297", "0.70622724", "0.6975863", "0.6972957", "0.68895304", "0.68720037", "0.6826052", "0.6725763", "0.66909343", "0.6662281", "0.6623937", "0.6622064", "0.6564176", "0.6550949", "0.65335256", "0.65297765", "0.65166265", "0.6515648", "0.6489751", "0.6458146", "0.645487...
0.0
-1
CreateAdsByInventoryReferenceRequest a model defined in Swagger
def __init__(self, bid_percentage=None, inventory_reference_id=None, inventory_reference_type=None): # noqa: E501 # noqa: E501 self._bid_percentage = None self._inventory_reference_id = None self._inventory_reference_type = None self.discriminator = None if bid_percentage is no...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def add_inventory_endpoint(request):\n hotel_id = request.args[\"hotel_id\"][0]\n room_type = request.args[\"room_type\"][0]\n room_inventory = request.args[\"room_inventory\"][0]\n model.add_inventory(hotel_id, room_type, room_inventory)\n return json({\"success\": True})", "def post(self, ...
[ "0.5723244", "0.5313022", "0.5303699", "0.514045", "0.5070321", "0.5009573", "0.49610618", "0.49405542", "0.48937926", "0.48861742", "0.4851349", "0.4851349", "0.4839163", "0.48369145", "0.48202556", "0.4809839", "0.47778898", "0.47728783", "0.47679877", "0.47573525", "0.4740...
0.43879133
59
Sets the bid_percentage of this CreateAdsByInventoryReferenceRequest.
def bid_percentage(self, bid_percentage): self._bid_percentage = bid_percentage
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def percent_b(self, percent_b: float):\n\n self._percent_b = percent_b", "def __init__(self, bid_percentage=None, inventory_reference_id=None, inventory_reference_type=None): # noqa: E501 # noqa: E501\n self._bid_percentage = None\n self._inventory_reference_id = None\n self._invent...
[ "0.61821496", "0.59257495", "0.5638984", "0.5638984", "0.5638984", "0.5638984", "0.5567468", "0.5258507", "0.5230827", "0.514761", "0.5127867", "0.5127867", "0.5078384", "0.5002187", "0.49656045", "0.4949226", "0.49074405", "0.484597", "0.4835447", "0.4820097", "0.47924873", ...
0.770684
0
Sets the inventory_reference_id of this CreateAdsByInventoryReferenceRequest.
def inventory_reference_id(self, inventory_reference_id): self._inventory_reference_id = inventory_reference_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inventory_id(self, inventory_id):\n\n self._inventory_id = inventory_id", "def inventory_reference_type(self, inventory_reference_type):\n\n self._inventory_reference_type = inventory_reference_type", "def inventory_id(self, inventory_id):\n if inventory_id is None:\n raise ...
[ "0.69871175", "0.6377572", "0.62650263", "0.5741707", "0.5696567", "0.5647767", "0.54511845", "0.51018476", "0.5013131", "0.4810151", "0.46328503", "0.45902228", "0.45902228", "0.4568547", "0.45499918", "0.4547038", "0.4534739", "0.45183787", "0.449545", "0.44950244", "0.4469...
0.82257956
0
Sets the inventory_reference_type of this CreateAdsByInventoryReferenceRequest.
def inventory_reference_type(self, inventory_reference_type): self._inventory_reference_type = inventory_reference_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inventory_reference_id(self, inventory_reference_id):\n\n self._inventory_reference_id = inventory_reference_id", "def inventory_id(self, inventory_id):\n\n self._inventory_id = inventory_id", "def inventory(self, inventory):\n\n self._inventory = inventory", "def inventory_items(sel...
[ "0.64331234", "0.5246117", "0.5223081", "0.49133226", "0.47064462", "0.4672102", "0.46364635", "0.46090922", "0.46090922", "0.46090922", "0.46090922", "0.45791408", "0.45752478", "0.45637342", "0.45555532", "0.45555532", "0.45555532", "0.4546563", "0.45451772", "0.45405617", ...
0.8307037
0
Returns the model properties as a dict
def to_dict(self): result = {} for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dict(self):\n return self.properties", "def to_dict(self):\n return self.properties", "def get_properties(self):\n return self.properties", "def asdict(self):\n return self._prop_dict", "def json(self):\n rv = {\n prop: getattr(self, prop)\n f...
[ "0.7751993", "0.7751993", "0.73391134", "0.7334895", "0.7297356", "0.727818", "0.7159078", "0.71578115", "0.71494967", "0.71494967", "0.71283495", "0.71275014", "0.7122587", "0.71079814", "0.7060394", "0.7043251", "0.7034103", "0.70233124", "0.69635814", "0.69586295", "0.6900...
0.0
-1
Returns the string representation of the model
def to_str(self): return pprint.pformat(self.to_dict())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __str__(self) -> str:\n # noinspection PyUnresolvedReferences\n opts = self._meta\n if self.name_field:\n result = str(opts.get_field(self.name_field).value_from_object(self))\n else:\n ...
[ "0.85856134", "0.7814518", "0.77898884", "0.7751367", "0.7751367", "0.7712228", "0.76981676", "0.76700574", "0.7651133", "0.7597206", "0.75800353", "0.7568254", "0.7538184", "0.75228703", "0.7515832", "0.7498764", "0.74850684", "0.74850684", "0.7467648", "0.74488163", "0.7442...
0.0
-1
For `print` and `pprint`
def __repr__(self): return self.to_str()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pprint(*args, **kwargs):\n if PRINTING:\n print(*args, **kwargs)", "def print_out():\n pass", "def custom_print(*objects):\n print(*objects, sep=OFS, end=ORS)", "def _print(self, *args):\n return _ida_hexrays.vd_printer_t__print(self, *args)", "def _printable(self):\n ...
[ "0.7557706", "0.7337767", "0.6987629", "0.69846016", "0.6944986", "0.6925048", "0.68990684", "0.6898436", "0.68151766", "0.68065625", "0.67522526", "0.675026", "0.67451936", "0.6699574", "0.6690892", "0.66747624", "0.66579586", "0.6609691", "0.660799", "0.66019386", "0.656303...
0.0
-1
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, CreateAdsByInventoryReferenceRequest): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Uses dump for pre2019 data to populate ConferenceTag instances for CFP
def create_tags(): INPUT = """ "Python general",Python R,"Other Programming Languages" Java,"Other Programming Languages" C-Languages,"Other Programming Languages" Analytics,"Data Science" Visualization,"Data Science" "Big Data","Data Science" Predictions,"Data Science" MongoDB,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collect(self, vcfname, tag):\n pass", "def __init__(self, dump):\n self._dump_data = dump\n # Check no unknown fields exist in the dump and ensure all fields have data.\n for field_name in self._dump_data:\n if field_name not in self._valid_field_names:\n raise ValueError('Dump fi...
[ "0.50682575", "0.49429226", "0.49007678", "0.48292905", "0.48242414", "0.48074657", "0.47828174", "0.47429", "0.47213793", "0.46713915", "0.46609476", "0.463727", "0.46369687", "0.45982248", "0.45883623", "0.45852312", "0.4574048", "0.45722643", "0.4564186", "0.4552899", "0.4...
0.0
-1
Lists all the blobs in the bucket.
def list_blobs(bucket_name): # bucket_name = "your-bucket-name" storage_client = storage.Client() print(storage_client.current_batch) # Note: Client.list_blobs requires at least package version 1.17.0. blobs = storage_client.list_blobs(bucket_name) # print(len([1 for blob in blobs])) for b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_blobs(bucket_name):\n storage_client = storage.Client()\n\n # Note: Client.list_blobs requires at least package version 1.17.0.\n blobs = storage_client.list_blobs(bucket_name)\n\n return blobs", "def list_blobs(bucket):\n bucket = default_bucket if bucket is None else bucket\n bucket_...
[ "0.8128892", "0.8061956", "0.80099964", "0.79986364", "0.7891933", "0.7788305", "0.7717934", "0.7613284", "0.75719094", "0.75032365", "0.7491481", "0.7415898", "0.73129493", "0.7272844", "0.7269232", "0.72229993", "0.72042584", "0.7180795", "0.7155484", "0.7136133", "0.711413...
0.80805486
1
Build HTML result page
def perf_result_page(): #  Get all fields from form module = request.forms.getall('module') version = request.forms.getall('version') script = request.forms.getall('script') tag = request.forms.getall('tag') value_inf = request.forms.get('value_inf') value_sup = request.forms.get('value_sup'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeHTMLIndexFile(self):\n part1 = \"\"\"<html>\n <body>\n <title>Index</title>\n <div id=\"pg_body\">\n <div id=\"testSuitesTitle\">TestSuites</div>\n <div id=\"resultsTitle\">Results</div>\n <div id=\"testSuites\">\n \"\"\"\n part2 = self.makeLin...
[ "0.6912458", "0.68431294", "0.6782403", "0.674924", "0.6621079", "0.6546005", "0.65375614", "0.6429424", "0.6403509", "0.6390029", "0.6368403", "0.63596076", "0.63516057", "0.63152206", "0.6310715", "0.63027006", "0.62803817", "0.62691236", "0.62274295", "0.6199864", "0.61743...
0.65072876
7
Build SQL result request
def do_mainfield_request(mainfield=None): # Connect to database cur_db = connect_db("172.20.38.50", "mvelay", "user", "darkman") cursor = cur_db.cursor() conditions = [] # Connect to Mantis mantis_c = mantis.Mantis('jenkins_auto', '1234') mantis_project_name = None # Build condition wi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_query(self):", "def generate_query(self):\n return", "def sql(self, q):\r\n params = base.get_params(None, locals())\r\n url = '{0}/{1}'.format(self.get_url(), 'sql')\r\n\r\n return http.Request('POST', url, params), parsers.parse_json", "def _assemble(self):\n ...
[ "0.6871569", "0.68138105", "0.67725784", "0.67435104", "0.63741964", "0.6372604", "0.63518035", "0.63267565", "0.6279376", "0.6224934", "0.61656916", "0.6161468", "0.6151943", "0.614902", "0.6058082", "0.6050952", "0.6040173", "0.60174376", "0.598038", "0.5969553", "0.5960548...
0.0
-1
Build HTML result page
def tunedfields_result_page(): #  Get all fields from form mainfield = request.forms.getall('mainfields') # Build html result = do_mainfield_request(mainfield=mainfield) # Build template page with open("./header.html") as header, open('./mainfields.tpl') as mainfield, open('./footer.html') as ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeHTMLIndexFile(self):\n part1 = \"\"\"<html>\n <body>\n <title>Index</title>\n <div id=\"pg_body\">\n <div id=\"testSuitesTitle\">TestSuites</div>\n <div id=\"resultsTitle\">Results</div>\n <div id=\"testSuites\">\n \"\"\"\n part2 = self.makeLin...
[ "0.6912458", "0.68431294", "0.6782403", "0.674924", "0.6621079", "0.6546005", "0.65375614", "0.65072876", "0.6429424", "0.6403509", "0.6390029", "0.6368403", "0.63596076", "0.63516057", "0.63152206", "0.6310715", "0.63027006", "0.62803817", "0.62274295", "0.6199864", "0.61743...
0.62691236
18
Build HTML result page
def features_result_page(): #  Get all fields from form module = request.forms.getall('module') version = request.forms.getall('version') software = request.forms.getall('sw') # Build html module, version, software, result = do_features_request(module_type=module, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeHTMLIndexFile(self):\n part1 = \"\"\"<html>\n <body>\n <title>Index</title>\n <div id=\"pg_body\">\n <div id=\"testSuitesTitle\">TestSuites</div>\n <div id=\"resultsTitle\">Results</div>\n <div id=\"testSuites\">\n \"\"\"\n part2 = self.makeLin...
[ "0.6913193", "0.6843428", "0.678298", "0.6750879", "0.66206425", "0.65455514", "0.6538131", "0.6508302", "0.64291865", "0.64034504", "0.63896877", "0.6359272", "0.6352542", "0.63158554", "0.6310258", "0.6302473", "0.62805283", "0.6269891", "0.62276226", "0.6200185", "0.617381...
0.63690805
11
Build HTML result page
def features_2_result_page(): #  Get all fields from form features = request.forms.getall('features') # Build html features_2, result = do_features_request_2(features=features) # Build template page with open("./header.html") as header, open('./features_2.tpl') as features, open('./footer.html...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeHTMLIndexFile(self):\n part1 = \"\"\"<html>\n <body>\n <title>Index</title>\n <div id=\"pg_body\">\n <div id=\"testSuitesTitle\">TestSuites</div>\n <div id=\"resultsTitle\">Results</div>\n <div id=\"testSuites\">\n \"\"\"\n part2 = self.makeLin...
[ "0.6912458", "0.68431294", "0.6782403", "0.674924", "0.6621079", "0.6546005", "0.65375614", "0.65072876", "0.6429424", "0.6403509", "0.6390029", "0.6368403", "0.63596076", "0.63516057", "0.63152206", "0.6310715", "0.63027006", "0.62803817", "0.62691236", "0.62274295", "0.6199...
0.57894194
73
Fill config diff form page
def config_diff_form_page(): #  connect to database cur_db = connect_db("172.20.38.50", "mvelay", "user", "sandbox") cursor = cur_db.cursor() modules_query = """SELECT DISTINCT module from t_ck5050_ini ORDER BY module ASC""" versions_query = """SELECT DISTINCT version from t_ck5050_ini ORDER BY ver...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perform_diff_config_result_page():\n #  Get all fields from form\n module = request.forms.getall('module')\n client = request.forms.getall('client')\n version1 = request.forms.getall('version1')\n version2 = request.forms.getall('version2')\n\n # Build html\n modif = do_ck5050_ini_diff_req...
[ "0.745162", "0.59874326", "0.5777113", "0.5688203", "0.56571525", "0.5592918", "0.5590933", "0.5562555", "0.5546954", "0.55440426", "0.55340624", "0.55173373", "0.551184", "0.55098534", "0.5509276", "0.5473541", "0.5454012", "0.54499644", "0.54456383", "0.53727114", "0.537029...
0.7766916
0
Display diff config result page
def perform_diff_config_result_page(): #  Get all fields from form module = request.forms.getall('module') client = request.forms.getall('client') version1 = request.forms.getall('version1') version2 = request.forms.getall('version2') # Build html modif = do_ck5050_ini_diff_request(module, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config_diff_form_page():\n #  connect to database\n cur_db = connect_db(\"172.20.38.50\", \"mvelay\", \"user\", \"sandbox\")\n cursor = cur_db.cursor()\n\n modules_query = \"\"\"SELECT DISTINCT module from t_ck5050_ini ORDER BY module ASC\"\"\"\n versions_query = \"\"\"SELECT DISTINCT version fr...
[ "0.7269731", "0.66847414", "0.6483663", "0.6056483", "0.6012005", "0.598935", "0.59349424", "0.5911885", "0.5906873", "0.58858836", "0.5866859", "0.57950294", "0.5726039", "0.56618685", "0.5660241", "0.5645076", "0.56382066", "0.5587175", "0.5567943", "0.55608356", "0.5559825...
0.80938596
0
Connect to SQL Database
def connect_db(host=None, user=None, pwd=None, db_name=None): db_c = MySQLdb.connect(host, user, pwd, db_name) return db_c
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect_db(self):\n try:\n self.connection = self.engine.connect()\n except Exception:\n self.print_std_error()", "def connect(self):\n\t\t# PostgreSQL PyPgSQL\n\t#\tcp = adbapi.ConnectionPool(\"pyPgSQL.PgSQL\", database=\"test\")\n\t\t# MySQL\n\t\tself.dbpool = adbapi.Con...
[ "0.7861086", "0.7743409", "0.769158", "0.76131725", "0.76085055", "0.7591533", "0.7557377", "0.754005", "0.7533083", "0.7524052", "0.7456639", "0.74528986", "0.745074", "0.7404313", "0.73811084", "0.7376988", "0.7365427", "0.7359007", "0.73517257", "0.73480254", "0.7337972", ...
0.0
-1
perform request on t_performance table
def do_perf_request(script_name=None, module_type=None, tag=None, version=None, value_sup=None, value_inf=None): #  connect to database cur_db = connect_db("172.20.38.50", "mvelay", "user", "sandbox") cursor = cur_db.cursor() conditions = [] if script_name and script_name[0] !...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def performance(self, id):", "def _run_query(self):", "def test_fetch_traffic(self):\n assert isinstance(_tabular.fetch_traffic_data(), \n pd.DataFrame)", "def get_chartdata():\n callback = bottle.request.query.get('callback')\n y_axis = bottle.request.query.get('y_axis'...
[ "0.631114", "0.58254516", "0.5335217", "0.53163964", "0.5313429", "0.5274424", "0.5222381", "0.5192167", "0.5174108", "0.5169717", "0.5151157", "0.5150998", "0.51382655", "0.51242495", "0.51175666", "0.5111949", "0.5109519", "0.51076305", "0.5089668", "0.50836945", "0.5045464...
0.6207883
1
perform request on t_feature table
def do_features_request(module_type=None, version=None, software=None): #  connect to database cur_db = connect_db("172.20.38.50", "mvelay", "user", "sandbox") cursor = cur_db.cursor() # build whole query cur_query = """ SELECT feature, supported FROM t_feature WHERE module="%s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_features_request_2(features=None):\n\n #  connect to database\n cur_db = connect_db(\"172.20.38.50\", \"mvelay\", \"user\", \"sandbox\")\n cursor = cur_db.cursor()\n\n # build whole query\n cur_query = \"\"\" SELECT module, sw, version FROM t_feature\n WHERE feature=\"%s\" ...
[ "0.6873913", "0.628006", "0.6004172", "0.59714735", "0.58861274", "0.5775854", "0.5727609", "0.5681115", "0.5681115", "0.5681115", "0.5641183", "0.5640868", "0.5630228", "0.5585226", "0.5566278", "0.5546612", "0.5524076", "0.55190283", "0.5511565", "0.5466498", "0.54205346", ...
0.6668402
1
perform request on t_feature table
def do_features_request_2(features=None): #  connect to database cur_db = connect_db("172.20.38.50", "mvelay", "user", "sandbox") cursor = cur_db.cursor() # build whole query cur_query = """ SELECT module, sw, version FROM t_feature WHERE feature="%s" AND supported=1;""" % (fea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_features_request(module_type=None, version=None, software=None):\n\n #  connect to database\n cur_db = connect_db(\"172.20.38.50\", \"mvelay\", \"user\", \"sandbox\")\n cursor = cur_db.cursor()\n\n # build whole query\n cur_query = \"\"\" SELECT feature, supported FROM t_feature\n ...
[ "0.6668402", "0.628006", "0.6004172", "0.59714735", "0.58861274", "0.5775854", "0.5727609", "0.5681115", "0.5681115", "0.5681115", "0.5641183", "0.5640868", "0.5630228", "0.5585226", "0.5566278", "0.5546612", "0.5524076", "0.55190283", "0.5511565", "0.5466498", "0.54205346", ...
0.6873913
0
perform diff request between ck5050_ini files
def do_ck5050_ini_diff_request(module, client, version1, version2): #  connect to database cur_db = connect_db("172.20.38.50", "mvelay", "user", "sandbox") cursor = cur_db.cursor() # build whole query cur_query_1 = """SELECT ck5050 FROM t_ck5050_ini WHERE module='%s' AND client=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config_diff(context, target, file1, file2):\n\n result = context.get_operation('get_config_diff')\n return result", "def perform_diff_config_result_page():\n #  Get all fields from form\n module = request.forms.getall('module')\n client = request.forms.getall('client')\n version1 = requ...
[ "0.63707644", "0.58933586", "0.58889127", "0.56575066", "0.5535803", "0.5533335", "0.5454924", "0.5425166", "0.54007334", "0.5384806", "0.52225465", "0.5211675", "0.5190184", "0.5159502", "0.514443", "0.51250166", "0.512453", "0.5076124", "0.50507396", "0.5043625", "0.5035158...
0.6821847
0
Get from DBPhone test_to_redo stats
def get_test_to_redo_stats(url): import os import requests from lxml import etree from collections import OrderedDict categories = [('avrcp',), ('usb',), ('wifi',), ('upnp',), ('mtp',), ('ipod',), ('3way',), ('map',), ('pan',), ('dun',), ('pandora',), ('hdmi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testRedo(self):\n raw_data = TEST_DATA.copy()\n raw_data['redo'] = 'true'\n uma_data = UMASamplingProfilerData(\n raw_data, ChromeDependencyFetcher(self.GetMockRepoFactory()))\n self.assertTrue(uma_data.redo)", "def rrd_out(db):\n stats = basic_stats(db)\n print(\"rp:%d l:%d u:%d\" %...
[ "0.5556036", "0.54881424", "0.5412877", "0.5391689", "0.53793645", "0.5367809", "0.5247977", "0.5117082", "0.5116823", "0.50810045", "0.50738573", "0.5022342", "0.5014269", "0.49937323", "0.49274036", "0.49090567", "0.48934725", "0.48873225", "0.48542276", "0.4847499", "0.484...
0.5758006
0
Build test_to_redo stats (IOP matrix cleaning)
def test_to_redo(): from collections import OrderedDict import matplotlib.pyplot as plt from matplotlib.ticker import MultipleLocator, FormatStrFormatter url_base = 'http://172.20.38.50/iop/test_to_redo/dbphone_test_to_redo_' year = 2016 week = 8 url = '{0}{1}_w{2}.xml'.format(url_base, yea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testRedo(self):\n raw_data = TEST_DATA.copy()\n raw_data['redo'] = 'true'\n uma_data = UMASamplingProfilerData(\n raw_data, ChromeDependencyFetcher(self.GetMockRepoFactory()))\n self.assertTrue(uma_data.redo)", "def get_test_to_redo_stats(url):\n import os\n import requests\n from...
[ "0.6436193", "0.6130628", "0.55359256", "0.5484914", "0.5428168", "0.54097044", "0.5357657", "0.53089625", "0.5300388", "0.5237696", "0.52300584", "0.5196022", "0.51856256", "0.5130158", "0.51227814", "0.5117561", "0.5113459", "0.51080984", "0.50900793", "0.50900495", "0.5078...
0.5701659
2
Enable static image directory
def server_static_img(filename): return static_file(filename, root='static/img')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def images(name):\n return static_file(name, root=os.path.join(BASEDIR, \"images\"))", "def include_static_files(app):\n file_path = sphinx_prolog.get_static_path(STATIC_FILE)\n if file_path not in app.config.html_static_path:\n app.config.html_static_path.append(file_path)", "def path_static()...
[ "0.67881405", "0.63470244", "0.6251868", "0.61576533", "0.60136217", "0.5939546", "0.58997166", "0.58471245", "0.58220434", "0.57930964", "0.57122254", "0.5705205", "0.56905645", "0.56310606", "0.5624631", "0.56046736", "0.5533824", "0.5532665", "0.5532572", "0.55227333", "0....
0.6483689
1
Enable static stats directory
def server_static(filename): return static_file(filename, root='static/stats')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collectstatic():\n puts(yellow(\"Collect statics\"))\n django_manage('collectstatic', '-l', '--noinput')", "def glr_path_static():\n return os.path.join(base_path, \"static\")", "def monitor_page(path):\n return send_from_directory(os.path.join(os.path.dirname(__file__), \"..\", \"static\"), pa...
[ "0.5921597", "0.59045035", "0.58725524", "0.58487236", "0.5800601", "0.5593384", "0.55906385", "0.555093", "0.55357283", "0.5500581", "0.5452615", "0.54239327", "0.5393831", "0.53820044", "0.5364286", "0.53436893", "0.5338043", "0.5338043", "0.5316681", "0.5310895", "0.530017...
0.6684303
0
Arguments management using docopt
def set_options(): help_f = """%s Usage: %s -h <host> -p <port> Options: -i, --help -h, --host=<host> -p, --port=<port> """ % (sys.argv[0], sys.argv[0]) arguments = docopt(help_f) return arguments
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def args():\n\n useDB = docopt(__doc__)['--from-db']\n snapFile = docopt(__doc__)['-i']\n # csvFile = docopt(__doc__)['-o']\n # utils.askErase(csvFile)\n\n return [snapFile, useDB]", "def main():\n try:\n arguments = docopt(__doc__)\n house = arguments['--house']\n characte...
[ "0.7370341", "0.724578", "0.69119036", "0.6884974", "0.6628971", "0.65835416", "0.65466535", "0.65455437", "0.65455437", "0.65455437", "0.6514039", "0.6508138", "0.6506362", "0.6479136", "0.6383206", "0.6371003", "0.6343701", "0.6282645", "0.62716925", "0.6248091", "0.6227129...
0.6611413
5
Change IP adress in header
def change_header(host="172.20.22.104", port=8081): # Read header template with open("./header_template.html", "r") as header: content = header.read() content_modified = re.sub("172.20.22.104:8081", "%s:%s" % (host, port), content) # Modify header with host:port with open("./header.html",...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change_ip(self, address: int) -> None:\n self.regs[\"ip\"].write(address)", "def set_host_ip(self, host, host_ip):\n host.setIP(str(host_ip.ip), prefixLen=self.NETPREFIX)", "def change_IP(self,server_IP,MAC):\n content = {'server_IP':server_IP,'MAC_address':MAC}\n content = json...
[ "0.69159824", "0.6746876", "0.6670021", "0.66584", "0.6627055", "0.6463176", "0.6415992", "0.6415992", "0.63854414", "0.6344735", "0.6266228", "0.6223221", "0.62148654", "0.61933804", "0.6174796", "0.6165831", "0.61656237", "0.616364", "0.61261654", "0.6106321", "0.60913247",...
0.6824174
1
Number of polynomial spline parts for system variables.
def n_parts_x(self): return self._parameters['n_parts_x']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_polys(self):\n ret_val = self._num_polys()\n return ret_val", "def numpoints(self):\n return len(self.pars) + 1 # so dof is 1", "def raise_spline_parts(self, n_spline_parts=None):\n if n_spline_parts is None:\n # usual case\n self._parameters['n_parts_...
[ "0.6299914", "0.60816807", "0.5986085", "0.5851045", "0.5821581", "0.57989854", "0.5776984", "0.5741229", "0.5738567", "0.57093143", "0.56891906", "0.5685901", "0.5649587", "0.557969", "0.55761206", "0.5537348", "0.55140233", "0.54845166", "0.5477328", "0.5477328", "0.5477328...
0.6224824
1
Number of polynomial spline parts for input variables.
def n_parts_u(self): return self._parameters['n_parts_u']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def numpoints(self):\n return len(self.pars) + 1 # so dof is 1", "def num_polys(self):\n ret_val = self._num_polys()\n return ret_val", "def get_n_params(var_list):\n return int(np.sum([np.product(\n [x.value for x in var.get_shape()]) for var in var_list]))", "def n_p...
[ "0.6210782", "0.6193465", "0.5968699", "0.5953926", "0.59362495", "0.5929375", "0.5834807", "0.5790079", "0.5732091", "0.57164407", "0.57035553", "0.57000434", "0.56722885", "0.55485725", "0.5526276", "0.5495534", "0.54802024", "0.545291", "0.5443216", "0.5416969", "0.5408439...
0.0
-1
Increase the number of spline parts for x and u
def raise_spline_parts(self, n_spline_parts=None): if n_spline_parts is None: # usual case self._parameters['n_parts_x'] *= self._parameters['kx'] # TODO: introduce parameter `ku` and handle it here # (and in CollocationSystem.get_guess()) npu = self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spline(self):\n self.rho = np.linspace(0,1,self.nrho)\n self.te = self._spline(self.rho_in, self.te_in, self.rho)\n self.ne = self._spline(self.rho_in, self.ne_in, self.rho)\n self.ti = self._spline(self.rho_in, self.ti_in, self.rho)\n for i in range(self.nion):\n ...
[ "0.5930492", "0.5872698", "0.5811447", "0.5805595", "0.57756674", "0.5772047", "0.57542145", "0.5682267", "0.5679739", "0.5632267", "0.56161326", "0.55766064", "0.5569022", "0.55506045", "0.5523128", "0.55127037", "0.5496371", "0.5459261", "0.54565656", "0.5441901", "0.542766...
0.5769493
6
Returns the current system state.
def x(self, t): if not self.sys.a <= t <= self.sys.b: self.log_warning("Time point 't' has to be in (a,b)") arr = None else: arr = np.array([self.x_fnc[xx](t) for xx in self.sys.states]) return arr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_state(self):\n return self._env.get_state()", "def get_status(self):\n\n return self._system", "def get_state(self):\n return self.env.sim.get_state()", "def get_current_state(self):\n return self._current_state", "def get_current_state(self):\n return self.game.g...
[ "0.76328963", "0.7534503", "0.7286605", "0.7277567", "0.71321005", "0.7082457", "0.7079524", "0.7063459", "0.704008", "0.70301354", "0.7001373", "0.6990143", "0.69871753", "0.698439", "0.6970327", "0.6945167", "0.6934378", "0.6932589", "0.6868393", "0.6841767", "0.68383986", ...
0.0
-1
Returns the state of the input variables.
def u(self, t): if not self.sys.a <= t <= self.sys.b: #self.log_warning("Time point 't' has to be in (a,b)") arr = np.array([self.u_fnc[uu](self.sys.b) for uu in self.sys.inputs]) ##:: self.u_fnc= {'u1':method Spline ddf} (because of chain 'x1'->'x2'->'u1') e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_state(self, var_list):\n raise NotImplementedError()", "def getstate(self):\r\n return GPBase.getstate(self) + [self.Z,\r\n self.num_inducing,\r\n self.has_uncertain_inputs,\r\n self.X_variance]", "def state(self):\n return self.var_state", ...
[ "0.7368604", "0.73394525", "0.72396487", "0.7100198", "0.6878418", "0.6844417", "0.6844417", "0.6834125", "0.68242306", "0.6695256", "0.6669782", "0.661551", "0.6603236", "0.6530937", "0.648801", "0.64731807", "0.6460762", "0.64099735", "0.6406625", "0.63900465", "0.6319406",...
0.0
-1
Returns the state of the 1st derivatives of the system variables.
def dx(self, t): if not self.sys.a <= t <= self.sys.b: self.log_warning("Time point 't' has to be in (a,b)") arr = None else: arr = np.array([self.dx_fnc[xx](t) for xx in self.sys.states]) return arr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def firstderiv(state, time, press):\n dy = np.zeros_like(state)\n pyjacob.py_dydt(time, press, state, dy)\n return dy", "def d1(self):\n f = (self.rf + (self.sigma ** (2)) / 2 ) * self.t\n return (1/(self.sigma * (self.t ** (0.5)))) *(math.log(self.s/self.x) + f)", "def f( self , x , u ...
[ "0.6555936", "0.64141256", "0.6148635", "0.6125782", "0.61236674", "0.60813224", "0.60553426", "0.6053837", "0.5920227", "0.5911331", "0.590697", "0.5901537", "0.5696103", "0.566551", "0.5641059", "0.5590327", "0.5579554", "0.55714095", "0.55708796", "0.5567455", "0.5526526",...
0.0
-1
This method is used to create the necessary spline function objects.
def init_splines(self, export=False): self.log_debug("Initialise Splines") # store the old splines to calculate the guess later if not export: # self.old_splines = auxiliary.copy_splines(self.splines) self.old_splines = copy.deepcopy(self.splines) if sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spline(self):\n self.rho = np.linspace(0,1,self.nrho)\n self.te = self._spline(self.rho_in, self.te_in, self.rho)\n self.ne = self._spline(self.rho_in, self.ne_in, self.rho)\n self.ti = self._spline(self.rho_in, self.ti_in, self.rho)\n for i in range(self.nion):\n ...
[ "0.6794472", "0.67718244", "0.6634991", "0.6493209", "0.64013946", "0.6399138", "0.6325015", "0.6313537", "0.6291308", "0.6267896", "0.62008584", "0.6166823", "0.6108051", "0.60902315", "0.6086035", "0.60783106", "0.60377806", "0.60334915", "0.60260427", "0.59802824", "0.5972...
0.70828134
0
Set found numerical values for the independent parameters of each spline. This method is used to get the actual splines by using the numerical solutions to set up the coefficients of the polynomial spline parts of every created spline.
def set_coeffs(self, sol): # TODO: look for bugs here! self.log_debug("Set spline coefficients") # task: find which of the free parameters (coeffs) belong to which spline object sol_bak = sol.copy() subs = dict() # iterate over the OrderedDict {'x1': [cx1_..., ...], 'u1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spline(self):\n self.rho = np.linspace(0,1,self.nrho)\n self.te = self._spline(self.rho_in, self.te_in, self.rho)\n self.ne = self._spline(self.rho_in, self.ne_in, self.rho)\n self.ti = self._spline(self.rho_in, self.ti_in, self.rho)\n for i in range(self.nion):\n ...
[ "0.64004993", "0.62710917", "0.6152649", "0.6054342", "0.6014449", "0.58256006", "0.58093613", "0.5761664", "0.57538545", "0.5709607", "0.57025075", "0.5696033", "0.56923354", "0.5628855", "0.56229633", "0.56144243", "0.56101274", "0.56101274", "0.55588293", "0.55523896", "0....
0.75014144
0
Retrieve the URL and optionally return back part of it using BeautifulSoup
def process_url(url, **kwargs): try: html = urlopen(url).read() except URLError, e: print "Couldn't get %s due to %s" % (url, e) soup = BeautifulSoup(html) metadata = {} for tag in soup.head.contents: if hasattr(tag, 'name'): if tag.name == 'title': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_url(url):\n try:\n soup = bs(urlopen(url).read(), 'html.parser')\n return soup\n except:\n print \"Couldnot download the content from the URL\", url\n return \"\"", "def scrape_google(html_content):\n soup = BeautifulSoup(html_content)\n tag = soup.a\n company...
[ "0.6535775", "0.6307371", "0.6303186", "0.62825453", "0.62294763", "0.6190701", "0.61806387", "0.61523235", "0.6148764", "0.60803145", "0.6080223", "0.6072506", "0.60498226", "0.6029667", "0.59885395", "0.59877825", "0.59875077", "0.59841347", "0.59476507", "0.59468186", "0.5...
0.5542465
85
Sort a list of app,modellist pairs into a single list of models. The single list of models is sorted so that any model with a natural key is serialized before a normal model, and any model with a natural key dependency has it's dependencies serialized first.
def sort_dependencies(app_list): from django.db.models import get_model, get_models # Process the list of models, and get the list of dependencies model_dependencies = [] models = set() for app, model_list in app_list: if model_list is None: model_list = get_models(app) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort(self):\n self.model_list.sort()\n for model in self.model_list:\n model.sort()", "def sort_models(data_dir, list_models):\n list_new_models = [] # Only left fields in CSV file.\n\n try:\n os.chdir(data_dir)\n except OSError, err:\n sys.stderr.write(\"Erro...
[ "0.7140047", "0.70637834", "0.6867462", "0.677511", "0.6625849", "0.6170446", "0.6126853", "0.6093717", "0.60831183", "0.6028849", "0.59897244", "0.5664581", "0.56470007", "0.56270397", "0.5605686", "0.55841184", "0.54990226", "0.54917353", "0.5478782", "0.5476888", "0.532848...
0.8072792
0
make sure we can guess an optics type from metadata
def test_guess_optics(): from ctapipe.instrument import guess_telescope answer = guess_telescope(1855, 28.0 * u.m) od = OpticsDescription.from_name(answer.name) assert od.equivalent_focal_length.to_value(u.m) == 28 assert od.num_mirrors == 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __determine_config_type():", "def opt_type(self) -> type:\n return type(self.opt)", "def target_type(self):", "def get_type_check(self, arg, option):\n pass", "def test_model_metadata_type(self):\n self.assertTrue(type(self.meta) is dict)", "def get_meta_file_type(metaDictionary,...
[ "0.5926501", "0.57973546", "0.57791114", "0.5742786", "0.5710126", "0.561327", "0.5490631", "0.5486793", "0.5471962", "0.5450088", "0.5391304", "0.5389152", "0.5387912", "0.53406745", "0.52706194", "0.52626455", "0.52626175", "0.5226716", "0.52167726", "0.5206645", "0.5198141...
0.5165573
24
create an OpticsDescription and make sure it fails if units are missing
def test_construct_optics(): OpticsDescription( name="test", num_mirrors=1, num_mirror_tiles=100, mirror_area=u.Quantity(550, u.m ** 2), equivalent_focal_length=u.Quantity(10, u.m), ) with pytest.raises(TypeError): OpticsDescription( name="test", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_construct_optics():\n OpticsDescription(\n name=\"test\",\n size_type=SizeType.LST,\n reflector_shape=ReflectorShape.PARABOLIC,\n n_mirrors=1,\n n_mirror_tiles=100,\n mirror_area=u.Quantity(550, u.m**2),\n equivalent_focal_length=u.Quantity(10, u.m),\n ...
[ "0.78008306", "0.56905293", "0.55807394", "0.5456513", "0.5392586", "0.538737", "0.53750855", "0.5374919", "0.5374841", "0.53741705", "0.5371181", "0.5356631", "0.5356039", "0.5303193", "0.5301167", "0.52871114", "0.5274415", "0.52718306", "0.5246364", "0.52147675", "0.519935...
0.7196217
1
try constructing all by name
def test_optics_from_name(optics_name): optics = OpticsDescription.from_name(optics_name) assert optics.equivalent_focal_length > 0 # make sure the string rep gives back the name: assert str(optics) == optics_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_result_constructor(self, names):\r\n raise NotImplementedError", "def named_build(klass, name):\n k = Factory.build(klass)\n k.name = name\n return k", "def test_constructors(self, name, obj):\n assert getattr(forge, name) == obj", "def test_constructors(self, name, obj):\n ...
[ "0.5995789", "0.5829204", "0.5643517", "0.5643517", "0.5604099", "0.5503408", "0.5494718", "0.5494718", "0.54667276", "0.54620194", "0.5419465", "0.54167676", "0.5412567", "0.5388942", "0.537572", "0.537572", "0.537572", "0.537572", "0.537572", "0.537572", "0.537572", "0.53...
0.0
-1
Takes the file and sends it to the endpoint.
def ask_endpoint(file, endpoint) -> dict: # define headers with the content type headers = { "Content-Type": "application/json", "Accept": "application/json", } data = None if isinstance(file, str): data = pd.read_csv(file).to_dict(orient="records") elif isinstance(file...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_file(self, file_path) -> object:\n try:\n self.payload = {'file': open(file_path, 'rb')}\n except FileNotFoundError as fl_er:\n print(fl_er)\n exit(1)\n try:\n return requests.post(url = self.__webhooks, files = self.payload)\n except...
[ "0.76177657", "0.7581571", "0.741669", "0.7285191", "0.71710384", "0.7149347", "0.7077242", "0.7058303", "0.69783664", "0.6898794", "0.68531007", "0.68401706", "0.6838323", "0.6822907", "0.6806711", "0.6760568", "0.6707573", "0.6676297", "0.66599524", "0.66599524", "0.6659952...
0.0
-1
Checks that the endpoint is ready to receive incoming messages.
def _is_ready(self): current_wait_time = 0 start_time = time.time() while current_wait_time < self.max_wait_time_ready: try: response = requests.get(os.path.join(self.url, "ready"), timeout=1) if response.status_code == 200: break ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_ready(self):\n current_wait_time = 0\n start_time = time.time()\n while current_wait_time < self.max_wait_time_ready:\n try:\n response = requests.get(os.path.join(self.url, \"ready\"))\n if response.status_code == 200:\n brea...
[ "0.69959426", "0.65242666", "0.6468929", "0.6468929", "0.6450049", "0.637877", "0.635823", "0.63148576", "0.6309489", "0.6287994", "0.62630296", "0.6251497", "0.62316585", "0.6223134", "0.6218407", "0.6216059", "0.6203177", "0.6190777", "0.6145414", "0.61205196", "0.6097501",...
0.69550943
1
Queries the endpoint with all the files specified in 'in_dir' folder. This method goes over the list of files, sends every of them to the specified endpoint and put all the results into one DataFrame. Each column of the dataframe corresponds to the firstlevel key in the response json. If the json dict is nested then th...
def query(self, n_jobs=1) -> str: def get_one_answer(file): try: ans = ask_endpoint(file, os.path.join(self.url, "predict")) except KeyboardInterrupt: raise KeyboardInterrupt except: ans = {} return json.dumps(ans) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data(directory):\n dictlist = []\n cols = ['title', 'text', 'authors', 'num_images', 'domain', 'url']\n\n folders = glob.glob(directory + '/*')\n for index, subdir in enumerate(folders):\n\n file_path = glob.glob(subdir + '/*')\n\n #check if glob returned a valid file path (non-em...
[ "0.58557445", "0.5841202", "0.57185346", "0.5678337", "0.5617907", "0.5616196", "0.5553351", "0.55467594", "0.550163", "0.5499053", "0.54974854", "0.54938287", "0.54541194", "0.5434235", "0.5411787", "0.5370609", "0.5369148", "0.53324836", "0.5332005", "0.53307456", "0.532360...
0.52002525
37
Tracks a position through the duration of the loaded video
def track(self, frame, init_pos, frame_ctr=1): distance_list = [] self.tracker.init(frame, tuple(init_pos)) init_center_pos = int((init_pos[3] / 2) + init_pos[1]) if self.debug_mode: # Created window to display video cv2.namedWindow('Barbell_Tracker', cv2.WINDOW_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def seek(self,event):\r\n if self.app.controlLock.locked():\r\n return\r\n self.app.controlLock.acquire()\r\n x = event.x\r\n scalex,_ = self.getScale()\r\n scalex_secs = [scalex[0]/self.samplerate,scalex[1]/self.samplerate]# Get x scale in seconds\r\n seekTo = ...
[ "0.6350717", "0.599357", "0.59822786", "0.59489673", "0.5899728", "0.58592576", "0.5791302", "0.5753723", "0.570756", "0.5707165", "0.5696297", "0.5657556", "0.56508243", "0.56491834", "0.5642732", "0.562807", "0.5619208", "0.56147677", "0.5613509", "0.56129265", "0.55933154"...
0.5986019
2
Detects a barbell's position in a frame
def detect_barbell_pos(self, classifier): self._check_vid_open() retval, frame = self.video.read() if not retval: raise IOError('Could not read frame from video') barbell_pos = classifier.detectMultiScale(frame, 1.1, 25) if not barbell_pos.any(): raise Ex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def buff_region(self, x, y):\n if x>120 and x<220 and y>275 and y<375:\n return 1\n elif x>580 and x<680 and y>125 and y<225:\n return 2\n return 0", "def track(self, frame):\n mask = self.get_arrow_mask(frame)\n label = skimage.measure.label(mask)\n ...
[ "0.60581046", "0.59345615", "0.57604194", "0.5743953", "0.5729966", "0.571696", "0.570723", "0.5651073", "0.5620212", "0.5571446", "0.55702275", "0.5536488", "0.5536488", "0.5512448", "0.54974544", "0.54932207", "0.5444628", "0.5442565", "0.5442322", "0.5441738", "0.5436839",...
0.71624565
0
Converts pixels in a barbell's diameter to centimeters
def _get_cm_per_pixel(self, diameter): CM_PER_INCH = 2.54 pixels_per_inch = 2 / diameter cm_per_pixel = CM_PER_INCH * pixels_per_inch return cm_per_pixel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __conv_inch(length_mm):\n return length_mm / 25.4", "def get_diameter(self) -> float:\r\n \r\n return (self.box[3] - self.box[1] + self.box[2] - self.box[0]) / 2", "def bin_edges_to_centres(edges):\r\n if edges.ndim == 1:\r\n steps = (edges[1:] - edges[:-1]) / 2\r\n retur...
[ "0.5748787", "0.57177395", "0.5671113", "0.5644989", "0.5644989", "0.5644989", "0.56154454", "0.5552707", "0.54947394", "0.5494285", "0.5480687", "0.5467712", "0.5456314", "0.54467314", "0.5419826", "0.5408947", "0.5400958", "0.5398737", "0.53467226", "0.53363895", "0.5334988...
0.6118975
0
Gets Frames Per Second of loaded video
def get_video_fps(self): fps = self.video.get(cv2.CAP_PROP_FPS) logging.info('Video FPS: {}'.format(fps)) return fps
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fps(self):\n return self._num_frames / (datetime.now() - self._start).total_seconds()", "def get_video_frame_rate(filename):\n clip = VideoFileClip(filename)\n frame_rate = clip.fps\n clip.close()\n return frame_rate", "def duration():\r\n elapsed_time, duration = video_time()\r\n...
[ "0.74567306", "0.7410015", "0.7227333", "0.71586215", "0.7142597", "0.7126073", "0.71154517", "0.71066225", "0.70365375", "0.70240074", "0.7009666", "0.6964138", "0.68664753", "0.6860731", "0.6837427", "0.67995274", "0.6797968", "0.6792723", "0.67588943", "0.6752216", "0.6705...
0.7280317
2
Loads a video. Returns 1 on success
def load_video(self, vid_path): self.video = cv2.VideoCapture(vid_path) self._check_vid_open() logging.info('Loaded video at: {}'.format(vid_path)) return 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __loadVideo(self):\n # Check if movie file exists ...\n #\n if not(os.path.isfile(self.fNameVideo)):\n return stm.StimErrC.videoFileNotFound\n\n try: \n # Load video\n #\n self.video = mpe.VideoFileClip(self.fNameVideo)\n \n except IOError: \n return stm.StimErrC.i...
[ "0.7726525", "0.70660406", "0.69042337", "0.68983585", "0.6861589", "0.6831531", "0.67470115", "0.6746388", "0.65393686", "0.64091796", "0.6401286", "0.6394237", "0.634081", "0.62345356", "0.621533", "0.6213619", "0.6195335", "0.6193793", "0.6168615", "0.6168126", "0.61294425...
0.7348447
1
Raises an error if a video is not opened. Else return 1
def _check_vid_open(self): if not self.video.isOpened(): raise IOError('Video is not open') return 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def videostart_failed(self):\n # type: () -> bool\n return self._videostart_failed", "def check(self):\n #\n # *****************\n # *****************\n # TODO: Check really if video is valid\n # *****************\n # *****************\n return True", "def openVideo(self):\n ...
[ "0.6829495", "0.6795602", "0.67080617", "0.6603272", "0.6496463", "0.64905244", "0.6287083", "0.62592316", "0.62456816", "0.612378", "0.61099005", "0.6035323", "0.6004216", "0.6001032", "0.5871629", "0.5861267", "0.582632", "0.57916695", "0.5785687", "0.5746918", "0.5741277",...
0.8533003
0
Create a "bounding box" that is bounded on the left and the right by using the gradients and below by using the ambient estimate.
def remove_dc_from_spad_edge(spad, ambient, grad_th=1e3, n_std=1.): # Detect edges: assert len(spad.shape) == 1 edges = np.abs(np.diff(spad)) > grad_th first = np.nonzero(edges)[0][1] + 1 # Want the right side of the first edge last = np.nonzero(edges)[0][-1] # Want the left side of the second...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def paint_box(top=0, bottom=DISPLAY_HEIGHT-1, left=0, right=DISPLAY_WIDTH-1):\n def filter_box(col, row):\n \"\"\"For a given pixel position, turn it on if it's with the bounds\n \"\"\"\n # remember rows count from 0 at the top!\n correct_vertical = top <= row <= bottom\n corr...
[ "0.5981826", "0.58952916", "0.5884403", "0.5581767", "0.55763274", "0.5549178", "0.5539936", "0.5526793", "0.5501055", "0.54238534", "0.541401", "0.54067093", "0.5399093", "0.53788334", "0.5367486", "0.5344063", "0.53401744", "0.5332257", "0.529883", "0.52931905", "0.5287063"...
0.0
-1
Identify if given doc_no is a supported document type. Retrieve the candidate list of materials that will be returned.
def return_candidates(cls, doc_no): # Retrieve documents based on what it is given if isinstance(doc_no, Doc): doc = doc_no else: doc = Docs.of_doc_no(doc_no) # Case StoreAuxTask if isinstance(doc, prod_doc.StoreAuxTask): if doc.status <= prod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def return_materials(cls, user, doc_no, mode, return_list):\n\n # Retrieve documents based on what it is given\n doc = Docs.of_doc_no(doc_no)\n\n # Validate input,\n # Extract source to compare\n current_list = []\n ref_doc = None\n from_ref_doc = None\n if m...
[ "0.55780417", "0.514967", "0.49377292", "0.4870183", "0.47371918", "0.47266638", "0.47241977", "0.46641853", "0.4619189", "0.46141052", "0.45978752", "0.45675355", "0.4562565", "0.45569354", "0.45257613", "0.45226312", "0.45016974", "0.45015574", "0.44937566", "0.44864237", "...
0.5849427
0
Returning Materials please see return_candidates for more information.
def return_materials(cls, user, doc_no, mode, return_list): # Retrieve documents based on what it is given doc = Docs.of_doc_no(doc_no) # Validate input, # Extract source to compare current_list = [] ref_doc = None from_ref_doc = None if mode in [cls.TYP...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def info_materials_raw_get():\n materials = _material_by_group(427) # 427 == intermediate group\n return materials, 200", "def info_materials_get():\n materials = _material_by_group() # empty means all groups\n return materials, 200", "def GetMaterial(self, *args):\n return _XCAFDoc.XCAFDoc_...
[ "0.6908583", "0.6790556", "0.6723287", "0.6699483", "0.66595334", "0.6358154", "0.6162048", "0.611894", "0.60959214", "0.59961724", "0.58494353", "0.58435357", "0.5802915", "0.5775458", "0.5744499", "0.5669334", "0.56455684", "0.563473", "0.562491", "0.56161094", "0.56081563"...
0.66234
5
Replace tags in the given path template and return either Windows or Linux formatted path.
def get_path_from_template(path_template: str, path_type: PathType = PathType.AUTO) -> str: # automatically select path type depending on running OS if path_type == PathType.AUTO: if platform.system() == "Windows": path_type = PathType.WINDOWS elif platform.system() == "Linux": ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_template_from_path(path: str) -> str:\r\n path = path.replace(\"\\\\\", \"/\")\r\n return path", "def system_path(path):\n if is_windows(): return path.replace('/', '\\\\')\n else: return path.replace('\\\\', '/')", "def replace_template_tags(lines, file_provider):\n ret = []\n for li...
[ "0.6149726", "0.5994707", "0.5957013", "0.58530486", "0.56230843", "0.55114543", "0.54932165", "0.5389428", "0.5368151", "0.5365089", "0.52960074", "0.52290237", "0.521562", "0.5209126", "0.5170885", "0.51437145", "0.51309836", "0.5099991", "0.5087957", "0.50286967", "0.49951...
0.5748834
4
Convert a normal path back to its template representation.
def get_template_from_path(path: str) -> str: path = path.replace("\\", "/") return path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_path(path: str, path_type: PathType = PathType.AUTO) -> str:\r\n path_template = get_template_from_path(path)\r\n path = get_path_from_template(path_template, path_type)\r\n return path", "def convert(kls, path, configuration=None, converters=None, ignore_converters=None, joined=None):\n ...
[ "0.67283267", "0.59157676", "0.57542336", "0.56610835", "0.5517831", "0.55112505", "0.5508051", "0.5501356", "0.53947884", "0.5389098", "0.53607225", "0.53306615", "0.5308158", "0.5299064", "0.52649087", "0.5254318", "0.5234345", "0.52052474", "0.51929563", "0.51626086", "0.5...
0.5877729
2
Convert a normal path to template and the convert it back to a normal path with given path type.
def convert_path(path: str, path_type: PathType = PathType.AUTO) -> str: path_template = get_template_from_path(path) path = get_path_from_template(path_template, path_type) return path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_path_from_template(path_template: str, path_type: PathType = PathType.AUTO) -> str:\r\n # automatically select path type depending on running OS\r\n if path_type == PathType.AUTO:\r\n if platform.system() == \"Windows\":\r\n path_type = PathType.WINDOWS\r\n elif platform.syst...
[ "0.64579725", "0.5781432", "0.5625563", "0.54816496", "0.5473164", "0.5293687", "0.51608443", "0.50819355", "0.4978549", "0.4844417", "0.47959632", "0.47708523", "0.4746237", "0.4732008", "0.47292966", "0.47214973", "0.4701345", "0.46961728", "0.46805945", "0.4661857", "0.466...
0.7523337
0
Set the global username override value.
def set_user_name_override(name: str) -> None: global _user_name_override _user_name_override = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_username(self, value):\n self.username = value", "def change_username(self, name):\n self.username = name", "def set_username(self, value):\n raise NotImplementedError('set_username')", "def set_uname(self, username):\n Server.t_usernames[threading.get_ident()] = username\...
[ "0.7747169", "0.7630484", "0.75716734", "0.7008054", "0.6820638", "0.6784135", "0.6745073", "0.6725287", "0.6669901", "0.6605668", "0.6576479", "0.6576479", "0.6576479", "0.6576479", "0.6576479", "0.6576479", "0.6576479", "0.6576479", "0.6576479", "0.6568546", "0.6558229", ...
0.825879
0
Get the current user name.
def get_user_name(): if _user_name_override is not None: return _user_name_override elif platform.system() == "Windows": return os.getlogin() elif platform.system() == "Linux": try: import pwd return pwd.getpwuid(os.geteuid()).pw_name except: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_name(self) -> str:\n return pulumi.get(self, \"user_name\")", "def get_current_user_full_name(self):\n user_service = self.runtime.service(self, 'user')\n xb_user = user_service.get_current_user()\n\n return xb_user.full_name", "def user_name(self) -> pulumi.Output[str]:\n ...
[ "0.8741144", "0.86486804", "0.846932", "0.844218", "0.83565015", "0.8267635", "0.8187839", "0.81661373", "0.80497915", "0.8037324", "0.80079746", "0.7956374", "0.7941207", "0.7941207", "0.7937398", "0.7918738", "0.7918738", "0.7918738", "0.7903354", "0.78959924", "0.78748775"...
0.7600616
41
Create a new run dir with increasing ID number at the start.
def _create_run_dir_local(run_dir_root, run_desc) -> str: run_dir_root = get_path_from_template(run_dir_root, PathType.AUTO) if not os.path.exists(run_dir_root): os.makedirs(run_dir_root) run_id = _get_next_run_id_local(run_dir_root) run_name = "{0:05d}-{1}".format(run_id, run_desc) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_run_dir(self):\n task_name = 'task_'+str(self.setting['task_id'])\n run_name = '_'.join(['run', \n str(self.setting['run_idx']), \n str(self.setting['_id'])])\n \n run_dir = op.join(Job_Requestor.run_center, task_name, run_...
[ "0.6758753", "0.66561", "0.6593291", "0.63309443", "0.6312094", "0.6216086", "0.61310786", "0.6109647", "0.60766464", "0.6072097", "0.6067855", "0.6009013", "0.590007", "0.58960336", "0.5868165", "0.5814761", "0.57576287", "0.57141966", "0.56943786", "0.5688185", "0.56827813"...
0.6336431
3
Reads all directory names in a given directory (nonrecursive) and returns the next (increasing) run id. Assumes IDs are numbers at the start of the directory names.
def _get_next_run_id_local(run_dir_root: str) -> int: dir_names = [d for d in os.listdir(run_dir_root) if os.path.isdir(os.path.join(run_dir_root, d))] r = re.compile("^\\d+") # match one or more digits at the start of the string run_id = 0 for dir_name in dir_names: m = r.match(dir_name...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_id_dir(id_dir: Path) -> (int, Path):\n\n lockfile_path = id_dir/'.lockfile'\n with lockfile.LockFile(lockfile_path, timeout=1):\n next_fn = id_dir/PKEY_FN\n\n next_valid = True\n\n if next_fn.exists():\n try:\n with next_fn.open() as next_file:\n ...
[ "0.6369533", "0.6025362", "0.5927364", "0.57674915", "0.57419837", "0.5673672", "0.5648966", "0.55251485", "0.5444188", "0.54296756", "0.5414394", "0.54062897", "0.5385693", "0.5360778", "0.53512573", "0.53074497", "0.5295442", "0.5287889", "0.52728975", "0.52728975", "0.5272...
0.74510384
0
Takes in a list of tuples of (src, dst) paths and copies files. Will create all necessary directories.
def copy_files_and_create_dirs(files) -> None: for file in files: target_dir_name = os.path.dirname(file[1]) # will create all intermediate-level directories if not os.path.exists(target_dir_name): os.makedirs(target_dir_name) shutil.copyfile(file[0], file[1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _copy_files(src_paths,dst_dir,class_numbers):\n\n class_dirs=[os.path.join(dst_dir,class_name+\"/\")for class_name in self.class_names]\n\n for dir in class_dirs:\n if not os.path.exists(dir):\n os.makedirs(dir)\n\n for src,cls in zip(src_paths...
[ "0.77486277", "0.75265586", "0.73959345", "0.7387594", "0.7377672", "0.7329959", "0.72826844", "0.7268612", "0.72428185", "0.7232209", "0.72291964", "0.711112", "0.70853853", "0.70581484", "0.6992751", "0.6919675", "0.69122905", "0.68667597", "0.67933685", "0.6778472", "0.670...
0.7675131
1
Produces embedding of text
def embed_text(self, data: List[str]) -> List[Optional[torch.Tensor]]: raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_text_embeds(self, text):\n\n # tokenize the text\n text_input = self.tokenizer(text,\n padding='max_length',\n max_length=tokenizer.model_max_length,\n truncation=True,\n ...
[ "0.7674286", "0.7428457", "0.73705107", "0.68461746", "0.6826775", "0.68188214", "0.67891675", "0.6650634", "0.6640539", "0.64986724", "0.64498174", "0.6358982", "0.63555664", "0.6302846", "0.6266722", "0.6235843", "0.6210677", "0.61844516", "0.6173967", "0.6062287", "0.60553...
0.6253844
15
Returns the manifold that this GraphEmbedder embeds nodes into. Defaults to Euclidean if this method is not overwritten
def get_manifold(self) -> RiemannianManifold: return ManifoldConfig().get_manifold_instance()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_kernel_norms(self):\n return self.adjacency", "def shared_element_norm(self):\n elements = self.shared_elements\n v1 = self.nodes[elements[:, 1], :] - self.nodes[elements[:, 0], :]\n v2 = self.nodes[elements[:, 2], :] - self.nodes[elements[:, 0], :]\n return np.cross(v1...
[ "0.57701725", "0.57140815", "0.565746", "0.558986", "0.5530351", "0.55212075", "0.54947764", "0.53900594", "0.5290139", "0.5283337", "0.52715415", "0.51860607", "0.51778406", "0.5176604", "0.5165664", "0.51596206", "0.51595855", "0.51545715", "0.51545715", "0.51331407", "0.51...
0.64672875
0
return the footer information
def get(self): app_info = { 'developedBy': 'This app was developed by the Melbourne eResearch Group (www.eresearch.unimelb.edu.au) within the School of Computing and Information Systems (https://cis.unimelb.edu.au) at The University of Melbourne (www.unimelb.edu.au). ', 'description': 'T...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFooter():\n return _FOOTER", "def footer(self):\n return self._footer", "def footer(self):\n pass", "def footer(self):\n pass", "def footer(self, **args):\n return self.pageConfig['footer'] % self.pageConfig", "def _get_footer(self, footer):\n if footer is Non...
[ "0.8154624", "0.8108119", "0.7856543", "0.7856543", "0.7828535", "0.7746664", "0.7719649", "0.76299804", "0.7477003", "0.74707055", "0.73991615", "0.7395591", "0.72634256", "0.72634256", "0.7204311", "0.718627", "0.7012529", "0.6940873", "0.69106513", "0.68723094", "0.6851129...
0.0
-1
return the statistical information query across feedback and prediction model
def get(self): from models.prediction import Prediction from models.feedback import Feedback prediction_collection = Prediction._get_collection() feedback_collection = Feedback._get_collection() statistical_data = copy.deepcopy(CONSTANTS['STATISTICAL_DATA']) # initial s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_statistics(self):", "def prediction():\n # retweets_only = request.args.get('retweets_only')\n # api.set_retweet_checking(strtobool(retweets_only.lower()))\n # with_sentiment = request.args.get('with_sentiment')\n # api.set_with_sentiment(strtobool(with_sentiment.lower()))\n # query = ...
[ "0.63750684", "0.6304389", "0.624345", "0.62196577", "0.6172109", "0.6098883", "0.6085545", "0.6072154", "0.6068451", "0.60035133", "0.59794176", "0.5978775", "0.5976125", "0.5952715", "0.5937861", "0.591812", "0.59040034", "0.5885989", "0.5883272", "0.58799636", "0.5878831",...
0.64818
0
Gracefully close the SSH connection
async def disconnect(self): self._logger.info("Host {}: SSH: Disconnecting".format(self._host)) self._logger.info("Host {}: SSH: Disconnecting".format(self._host)) await self._cleanup() self._conn.close() await self._conn.wait_closed()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_ssh_connection(self):\n if self.__ssh_client:\n self.__ssh_client.close()", "def closeConnection(self): \r\n \r\n try:\r\n ssh.close()\r\n feedback= '***Connection Closed***'\r\n return feedback\r\n except Exception as e:\r\...
[ "0.8305926", "0.79801464", "0.7943686", "0.7920637", "0.77663314", "0.7744283", "0.7734058", "0.7681489", "0.7674849", "0.7389304", "0.73721665", "0.73077106", "0.7301349", "0.7294421", "0.72725135", "0.72713614", "0.72451586", "0.72230047", "0.72170174", "0.70945966", "0.704...
0.7459658
9
check session was opened
def __check_session(self): if not self._stdin: raise RuntimeError("SSH session not started")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_open(self):\n\t\treturn self._session is not None", "def is_open(self):\n return self._session is not None", "def _check_open_session(self, guest_obj):\n session = guest_obj.open_session()\n self.assertIs('GuestSessionLinux', session.__class__.__name__)", "def sessionValid(self):\...
[ "0.82529193", "0.8016455", "0.699788", "0.6899404", "0.6878535", "0.6878535", "0.68676883", "0.68601865", "0.6826742", "0.6791624", "0.67632437", "0.6713392", "0.6696932", "0.6672162", "0.66605437", "0.6652152", "0.6649548", "0.66456234", "0.66192186", "0.6615233", "0.6611942...
0.6141397
58
Trains the classifier with the given filenames
def train(self, trainFilenames): startIndex = len(self.documents) endIndex = startIndex + len(trainFilenames) self.documents += trainFilenames X = [[i] for i in range(startIndex, endIndex)] Y = [isAroused(f) for f in trainFilenames] self.knn.fit(np.array(X), np.array(Y))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train(self, trainfile):", "def train_for(labels, filenames):\n stt = stt_google\n csvfiles = []\n writers = []\n for index, filename in enumerate(filenames):\n currfile = open(filename, 'ab')\n csvfiles.append(currfile)\n writers.append(csv.writer(currfile))\n # record ins...
[ "0.71127045", "0.6847688", "0.67817926", "0.67200977", "0.6696759", "0.6646218", "0.6621507", "0.6604409", "0.65844727", "0.6558893", "0.64029044", "0.63676393", "0.6323149", "0.62984276", "0.62698185", "0.62642264", "0.6254352", "0.6238679", "0.6231274", "0.6210927", "0.6206...
0.69635355
1
Tokenizes the questions. This will add q_token in each entry of the dataset. 1 represent nil, and should be treated as padding_idx in embedding
def tokenize(self, max_length=14): for entry in self.entries: tokens = self.dictionary.tokenize(entry['question'], False) tokens = tokens[:max_length] if len(tokens) < max_length: # Note here we pad in front of the sentence padding = [self.dict...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preprocess_dataset(dataset, tokenizer):\n eos = torch.tensor([tokenizer.eos_token_id], dtype=torch.long)\n q_start = torch.tensor(tokenizer.encode('question:'), dtype=torch.long)\n q_end = torch.tensor(tokenizer.encode(':question'), dtype=torch.long)\n\n tensors = [[] for i in range(3)]\n for i ...
[ "0.7129758", "0.7047955", "0.7026456", "0.6816859", "0.6816859", "0.6816859", "0.6816859", "0.676679", "0.6257971", "0.61061835", "0.6054662", "0.60403764", "0.5969531", "0.5852405", "0.57931036", "0.5778398", "0.5752423", "0.5728716", "0.5722207", "0.5704012", "0.5679085", ...
0.6808701
7
la idea es que escanee la zona deseada (desde cero) y guarde la imagen
def saveimage(self): if self.saveimageButton.isChecked(): self.save = True self.channelsOpen() self.movetoStart() self.saveimageButton.setText('Abort') self.guarda = np.zeros((self.numberofPixels, self.numberofPixels)) self.liveviewStart() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def foetus_pics(self):\n pic = 0\n if 0.0 not in self.allele:\n self.contamination = 2\n pic = 3\n elif 0.0 == self.allele[1]:\n pic = 1\n else:\n pic = 2\n return pic", "def ventanaprincipal():\r\n titulo_principal=pygame.imag...
[ "0.6379464", "0.6296582", "0.62169796", "0.6204397", "0.61585575", "0.6110433", "0.60860527", "0.60647374", "0.5987925", "0.5917548", "0.5876961", "0.58695006", "0.58384454", "0.58236486", "0.5822561", "0.58053076", "0.5804754", "0.57964826", "0.57868594", "0.57860816", "0.57...
0.0
-1
Image live view when not recording
def liveview(self): if self.liveviewButton.isChecked(): self.save = False self.channelsOpen() self.liveviewStart() else: self.liveviewStop()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def capture_image(self):\n ext = self.image_save_type.lower()\n\n if self.calibrating:\n print('calibrating')\n\n if ext == 'fits':\n self.save_fits()\n self._image_counter += 1\n else:\n img = self.original_image\n path = os.path.j...
[ "0.6853264", "0.67230445", "0.66627806", "0.6596117", "0.6586887", "0.64478475", "0.6418577", "0.6359291", "0.6324905", "0.6324905", "0.62345564", "0.6223029", "0.62202823", "0.6213966", "0.6185097", "0.6172923", "0.6171413", "0.6119024", "0.61056674", "0.6095103", "0.6094443...
0.5790726
48
Choose a random valid move that preserves our own eyes.
def select_action(self, game_state): super().select_action(game_state) dim = (game_state.board.num_rows, game_state.board.num_cols) if dim != self.dim: self._update_cache(dim) idx = np.arange(len(self.point_cache)) np.random.shuffle(idx) for i in idx: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_legal_move():\n return random.choice(legal_moves())", "def get_random_move(self, valid_moves):\n return random.choice(valid_moves)", "def make_random_move(state: State) -> State:\n return random.choice(state.get_possible_states())", "def make_random_move(self):\n #completel...
[ "0.83302236", "0.80104834", "0.78741527", "0.78018403", "0.77883136", "0.77592164", "0.7737336", "0.7699141", "0.7628713", "0.7599985", "0.7595064", "0.7374902", "0.7326639", "0.7277232", "0.7267337", "0.723386", "0.7232803", "0.72240585", "0.72192174", "0.72055054", "0.71364...
0.0
-1
generates a 20,000th hash in iterative sha256 chain..derived from private SEED
def _calc_hashchain( seed_private, epoch, blocks_per_epoch): hc_seed = getHashChainSeed(seed_private, epoch, config.dev.hashchain_nums) hc = [[hash_chain] for hash_chain in hc_seed] hc_terminator = [] for hash_chain in hc[:-1]: # skip last element as it is reveal hash ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SHA256(self) -> _n_0_t_3[_n_0_t_9]:", "def h_python(key, N):\n return hash(key) % N", "def hash_gen(n):\n domain = \"abcdefghijklmnopqrstuvwxyz\"\n temp = \"\"\n for i in range(0, n):\n temp += domain[random.randrange(0, 26)]\n return temp", "def compute_hash(self):\n '''\n ...
[ "0.68605787", "0.6531151", "0.64920217", "0.6357423", "0.6346101", "0.63296044", "0.6322797", "0.63040954", "0.628679", "0.6218963", "0.6196641", "0.61853266", "0.6156555", "0.6146982", "0.6143425", "0.6101353", "0.60864455", "0.6079242", "0.6064988", "0.6041602", "0.59878373...
0.58618045
39
>>> isinstance(hashchain(hstr2bin('32eee808dc7c5dfe26fd4859b415e5a713bd764036bbeefd7a541da9a1cc7b9fcaf17da039a62756b63835de1769e05e')), HashChainBundle) True
def hashchain(seed_private, epoch=0, blocks_per_epoch=config.dev.blocks_per_epoch): # type: (int) -> HashChainBundle return HashChainBundle(*_calc_hashchain(seed_private, epoch, blocks_per_epoch))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_hash_sha256(self):\n block = self.blockchain.new_block(self.proof, self.previous_hash)\n hash_ = self.blockchain.hash(block)\n\n self.assertIsInstance(hash_, str)\n self.assertEqual(hashlib.sha256(json.dumps(block, sort_keys=True).encode()).hexdigest(), hash_)", "def _get_cha...
[ "0.61252147", "0.59626085", "0.58439803", "0.5742523", "0.56958115", "0.56938916", "0.5665251", "0.5566981", "0.5560363", "0.5549851", "0.5532766", "0.5531971", "0.55154383", "0.5513594", "0.54947066", "0.54275084", "0.5408093", "0.5398602", "0.53863704", "0.53802854", "0.537...
0.0
-1