query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Move axis at 1 cm/s toward the home limit. Arguments
def home(self, max_dist=150, reset_pos=True): while not self.lim_cw: self.move_cm(True, max_dist, velocity=1) if reset_pos: self.step_position = 0 self.homed = True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def MoveCurrentSpace(self):\n if self.facing == 0:\n self.y -= 1\n elif self.facing == 1:\n self.x += 1\n elif self.facing == 2:\n self.y += 1\n elif self.facing == 3:\n self.x -= 1", "def move(self):\n # using a formula of axis coord...
[ "0.6669156", "0.66568214", "0.6652612", "0.6434596", "0.6368672", "0.6364193", "0.63368684", "0.62955475", "0.62590903", "0.6251184", "0.62486625", "0.6205641", "0.61666965", "0.6163508", "0.6161978", "0.61492234", "0.60844374", "0.60782045", "0.6076241", "0.6057359", "0.6049...
0.7008464
0
Side bar filters save
def get_sidebar_filter_save(self): return [ dbc.FormGroup( children=[ dbc.Label("Filter name", className="mr-2"), dbc.Input( type="text", placeholder="filter name", id="fil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sidebar_saved_filter_names(self):\n radio_options = [\n {\"label\": f\"{x['name']}\", \"value\": f\"{x['name']}\"} for x in self._filters\n ]\n radio_options.insert(0, {\"label\": \"None\", \"value\": \"None\"})\n return [\n dbc.FormGroup(\n ...
[ "0.62121964", "0.59033906", "0.59033334", "0.5833415", "0.5794496", "0.57652444", "0.57609284", "0.56757194", "0.5628985", "0.55978185", "0.5584421", "0.55016786", "0.5458459", "0.5440057", "0.54385895", "0.5419648", "0.5398401", "0.5397696", "0.5377833", "0.53766775", "0.537...
0.6955818
0
Show already saved filter names
def get_sidebar_saved_filter_names(self): radio_options = [ {"label": f"{x['name']}", "value": f"{x['name']}"} for x in self._filters ] radio_options.insert(0, {"label": "None", "value": "None"}) return [ dbc.FormGroup( children=[ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filters_show():\n log = slog()\n log.title_set('Filters applied')\n if self.args['table3D']: log.render3D()\n log('Input directory: %s\\n' % self.str_inputDir)\n log('Output directory: %s\\n' % self.str_outputDir)\n for filter...
[ "0.71085685", "0.70320976", "0.69871324", "0.66590345", "0.64224684", "0.6354147", "0.6320096", "0.62890303", "0.6220894", "0.6129932", "0.6068602", "0.60480523", "0.6030515", "0.6027471", "0.5986284", "0.598386", "0.59584016", "0.59466904", "0.5935269", "0.5929233", "0.59248...
0.7092052
1
Side bar layout for filters
def get_sidebar_layout(self): return [ dbc.Card(children=self.get_sidebar_filters(), body=True), dbc.Card(children=self.get_sidebar_filter_save(), body=True, className="mt-2"), dbc.Card(children=self.get_sidebar_saved_filter_names(), body=True, className="mt-2") ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _sidepanel(self):\n global curdir\n global sidepanel_layout\n global root\n\n #Create the sidepanel layout.\n sidepanel_layout = BoxLayout(orientation=\"vertical\", pos_hint={\"x\": 0.0, \"top\": 0.92}, size_hint=(0.1, 0.92))\n\n #If \"curdir\" contains folders, a butt...
[ "0.57546294", "0.5731716", "0.5637215", "0.559524", "0.557028", "0.55135465", "0.5497005", "0.54967964", "0.5491379", "0.54597825", "0.53883183", "0.5318895", "0.5315119", "0.5306592", "0.53015405", "0.52860516", "0.5277476", "0.5262624", "0.5243462", "0.5242694", "0.5235329"...
0.71362525
0
Show or hide the year options
def show_hide_year_options(n_clicks, is_open): if n_clicks: return not is_open return is_open
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def showNextYear(self):\n pass", "def showPreviousYear(self):\n pass", "def yearShown(self):\n return self.currentYear", "def set_start_year(self, year):\n return self.form.set_value(\"output period \\\"year from\\\"\", str(year))", "def set_finish_year(self, year):\n ret...
[ "0.7216386", "0.69942015", "0.68948454", "0.66959953", "0.6335009", "0.62713736", "0.6058751", "0.6049613", "0.5990289", "0.59684384", "0.5784383", "0.5756418", "0.5752636", "0.57259893", "0.57104576", "0.56524354", "0.5639774", "0.5611967", "0.55707246", "0.5566504", "0.5557...
0.7122568
1
Filter potential deals table data
def filter_potential_deal_table(apply_n_clicks, potential_deal_table_data, selected_year, selected_make, selected_model, min_odometer, max_odometer, min_price, max_price, min_offer_price, max_offer_price): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter():\n return get_filter_data(db, MyTable)", "def filter_data(self):\n self.data = filter_pandas(self.data, self.filters)", "def filter(self, request):\n try:\n columns = dict(request.data.iterlists())['columns']\n except AttributeError:\n columns = request...
[ "0.6677565", "0.62179226", "0.598901", "0.5956792", "0.5906819", "0.5906819", "0.5897435", "0.5872041", "0.58595276", "0.5857066", "0.5853016", "0.583921", "0.58145785", "0.5764974", "0.5754901", "0.57372177", "0.5735005", "0.57341355", "0.5691577", "0.56417745", "0.5599155",...
0.6573248
1
Verify the data by read from mindrecord If in 1.x.x version, use old version to receive that iteration
def verify_data(transformer, reader): if tf.__version__ < '2.0.0': tf_iter = transformer.tfrecord_iterator_oldversion() else: tf_iter = transformer.tfrecord_iterator() mr_iter = reader.get_next() count = 0 for tf_item, mr_item in zip(tf_iter, mr_iter): count = count + 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _read_data(self):", "def test_large_import(self):\n # the original file (from the IDD) is a previous version of the file from\n # the data server for the gp03flmb platform\n self.create_sample_data_set_dir('node59p1_orig.dat', TELEM_DIR, 'node59p1.dat')\n self.assert_initialize()\...
[ "0.579019", "0.5692056", "0.5681277", "0.56329477", "0.56093305", "0.5603792", "0.55614936", "0.5524081", "0.550736", "0.5495473", "0.5462074", "0.54548323", "0.5403062", "0.54028434", "0.5353642", "0.5353455", "0.5352201", "0.53452027", "0.5332335", "0.5320928", "0.53192216"...
0.60038924
0
test transform tfrecord to mindrecord.
def test_tfrecord_to_mindrecord(): if not tf or tf.__version__ < SupportedTensorFlowVersion: # skip the test logger.warning("Module tensorflow is not found or version wrong, \ please use pip install it / reinstall version >= {}.".format(SupportedTensorFlowVersion)) return fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_tfrecord_to_mindrecord_with_special_field_name():\n if not tf or tf.__version__ < SupportedTensorFlowVersion:\n # skip the test\n logger.warning(\"Module tensorflow is not found or version wrong, \\\n please use pip install it / reinstall version >= {}.\".format(SupportedTensor...
[ "0.78257513", "0.7703615", "0.75074255", "0.74040395", "0.7382626", "0.7302151", "0.70126456", "0.69004285", "0.6876922", "0.6874114", "0.6617609", "0.6492051", "0.62472", "0.62433034", "0.61853445", "0.6175238", "0.61399996", "0.61361605", "0.612582", "0.61172026", "0.610922...
0.81299514
0
test transform tfrecord to mindrecord.
def test_tfrecord_to_mindrecord_with_special_field_name(): if not tf or tf.__version__ < SupportedTensorFlowVersion: # skip the test logger.warning("Module tensorflow is not found or version wrong, \ please use pip install it / reinstall version >= {}.".format(SupportedTensorFlowVersion)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_tfrecord_to_mindrecord():\n if not tf or tf.__version__ < SupportedTensorFlowVersion:\n # skip the test\n logger.warning(\"Module tensorflow is not found or version wrong, \\\n please use pip install it / reinstall version >= {}.\".format(SupportedTensorFlowVersion))\n r...
[ "0.81299514", "0.7703615", "0.75074255", "0.74040395", "0.7382626", "0.7302151", "0.70126456", "0.69004285", "0.6876922", "0.6874114", "0.6617609", "0.6492051", "0.62472", "0.62433034", "0.61853445", "0.6175238", "0.61399996", "0.61361605", "0.612582", "0.61172026", "0.610922...
0.78257513
1
Start on the device the application specified in the desired capabilities.
def launch_app(self): os.system ("adb shell am start -n com.tencent.mm/com.tencent.mm.ui.LauncherUI/") time.sleep (5)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_app(package, activity=None):\n G.DEVICE.start_app(package, activity)", "def open_app(device, package_name):\n\n device.shell('am start -n ' + package_name + '/' + package_name + \".modules.overview.screen\" +\n '.OverviewActivity')", "def do_start(self, str_arg):\n try:\n...
[ "0.65996116", "0.63382894", "0.6139064", "0.6133311", "0.60826725", "0.6039608", "0.6038808", "0.6037298", "0.60028964", "0.6001215", "0.5899556", "0.58368593", "0.58152825", "0.5748541", "0.57284635", "0.57220066", "0.56858903", "0.5602673", "0.560133", "0.5596297", "0.55808...
0.63466936
1
Close on the device the application specified in the desired capabilities.
def close_app(self): os.system ('adb shell am force-stop com.tencent.mm')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_driver(self):\n package_dict = self.config['PACKAGE']\n try:\n self.driver.terminate_app(package_dict[self.app_name]) # Kill app\n self.driver.quit() # Kill drivers\n except WebDriverException:\n pass\n finally:\n LOGGER.info(\"Clo...
[ "0.6453666", "0.62666434", "0.61842597", "0.60333866", "0.5937128", "0.59004086", "0.57046753", "0.56933147", "0.56853473", "0.56837916", "0.5639223", "0.5618019", "0.5550715", "0.55470854", "0.5519714", "0.5507927", "0.5479511", "0.5476117", "0.54675114", "0.5467089", "0.546...
0.6479777
0
Add sample (stddev,corrcoeff) to the Taylor diagram. args and kwargs are directly propagated to the Figure.plot command.
def add_sample(self, stddev, corrcoef, *args, **kwargs): l, = self.ax.plot(NP.arccos(corrcoef), stddev, *args, **kwargs) # (theta,radius) self.samplePoints.append(l) return l
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_sample(self, stddev, corrcoef, *args, **kwargs):\n\n l, = self.ax.plot(np.arccos(corrcoef), stddev,\n *args, **kwargs) # (theta,radius)\n self.samplePoints.append(l)\n\n return l", "def add_sample(self, stddev, corrcoef, *args, **kwargs):\n sc = self....
[ "0.68203187", "0.6584434", "0.6584434", "0.56933784", "0.5513716", "0.55114293", "0.5470531", "0.54655284", "0.54416597", "0.5427777", "0.54091555", "0.54057515", "0.5370115", "0.53489417", "0.534793", "0.5321224", "0.53060305", "0.5294038", "0.52902836", "0.52767956", "0.526...
0.67588586
1
Set core to run perf app on
def set_core(self, core): self.core = core mask = 1 << core self.cmd += ' --cores {}'.format(str(hex(mask)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetPerfProfilingMode(self):\n self._ForceAllCpusOnline(True)\n self._SetScalingGovernorInternal('performance')\n if not self._AllCpusAreOnline():\n if not self._device.old_interface.IsRootEnabled():\n raise RuntimeError('Need root to force CPUs online.')\n raise RuntimeError('Failed t...
[ "0.67921257", "0.6633553", "0.63984597", "0.6266211", "0.6198395", "0.6145375", "0.6079073", "0.6079073", "0.60010844", "0.59957874", "0.5809768", "0.57959527", "0.57881993", "0.5740873", "0.5722343", "0.57212377", "0.57163876", "0.5715619", "0.5691098", "0.5683014", "0.56640...
0.7535006
0
get system and app info from perf app output
def get_info(): global PERF_APP archs = None best_arch = None cipher_algos = None hash_algos = None aead_algos = None cmd = PERF_APP + ' --print-info' try: res = subprocess.run(cmd, stdout=subprocess.PIPE, \ stderr=subprocess.STDOUT, \ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def sysinfo(self, ctx: Context):\n\t\tstart = time.perf_counter()\n\t\tend = time.perf_counter()\n\t\tduration = (end - start) * 1000\n\t\tcpuavg = psutil.cpu_percent(interval=None)\n\t\tmem = psutil.virtual_memory()[2]\n\t\tdurround = round(duration, 3)\n\t\tosun = os.uname()\n\t\tawait self.send(f\"System ...
[ "0.6739439", "0.6220913", "0.6201884", "0.61002964", "0.60289216", "0.597581", "0.596412", "0.5958381", "0.59300274", "0.5920837", "0.5899668", "0.5898604", "0.58971804", "0.5886893", "0.5879394", "0.586327", "0.5856037", "0.58533746", "0.58521926", "0.5818039", "0.5800719", ...
0.8066921
0
Parse core list passed through command line
def parse_cores(core_str): num_cores = os.cpu_count() cores = [] # remove spaces core_str.replace(" ", "") # check if not a range if '-' not in core_str: cores = list(map(int, core_str.strip().split(','))) else: # parse range e.g. 2-8 core_str = core_str.strip().spl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_core_membind_info():\n args = [\"lscpu\", \"--parse=CPU,Core,Socket,Node\"]\n process_lscpu = subprocess.check_output(args, universal_newlines=True).split(\"\\n\")\n\n # Get information about core, node, socket and cpu. On a machine with no NUMA nodes, the last column is empty\n ...
[ "0.6069423", "0.5897656", "0.5859458", "0.5742508", "0.5656301", "0.562768", "0.5606057", "0.5580318", "0.55620253", "0.55149585", "0.5479413", "0.5464949", "0.54646057", "0.5428162", "0.53806525", "0.5378273", "0.5359413", "0.53410476", "0.53373075", "0.53348327", "0.5328958...
0.65306914
0
Parse output of perf app for variant
def parse_results(variants): out = [] # set header lines = variants[0].get_output().split('\n') for line in lines[:-1]: out.append(line.split('\t')[0]) # append output for all variants to single list for var in variants: lines = var.get_output().split('\n') for i in ran...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_results(self):\n for line in self.file_dic['output'].splitlines():\n if line.startswith(' * GAMESS VERSION = '):\n temp = line.split('=')[1]\n temp = temp.split('*')[0]\n self.version = temp.strip()\n\n if line[1...
[ "0.5633313", "0.55575144", "0.5556055", "0.55414426", "0.5524926", "0.5487195", "0.5474465", "0.5472874", "0.546253", "0.5427893", "0.53696656", "0.5368545", "0.5367944", "0.536712", "0.5348081", "0.5298589", "0.5279425", "0.52779716", "0.52752876", "0.5261285", "0.5254374", ...
0.6180472
0
Get learning rate scheduler.
def get_lr_scheduler(self): try: scheduler_name = self.configs.OPTIM.LR_SCHEDULER.SCHEDULER_NAME except AttributeError: scheduler_name = None if scheduler_name is None: lr_scheduler = None elif scheduler_name == 'plateau': factor = self.c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_scheduler(optimizer, opt):\n \n epochs_no_decay = opt.epochs - opt.lr_linear\n lr_policy = opt.lr_policy\n \n if lr_policy == 'linear':\n def lr_lambda(epoch):\n return 1. - max(0, epoch - epochs_no_decay) / float(opt.lr_linear + 1)\n scheduler = lr_scheduler.LambdaL...
[ "0.7635437", "0.75883573", "0.75060844", "0.7453083", "0.73677176", "0.7187605", "0.7152048", "0.71470124", "0.7139361", "0.70922357", "0.7084877", "0.7058236", "0.70532143", "0.70265824", "0.70135325", "0.70125854", "0.69860375", "0.6956636", "0.6950861", "0.6934655", "0.692...
0.7616563
1
Deploy computation graph on devices.
def deploy_to_device(self): if self.device_ids is not None and len(self.device_ids) > 1: if not isinstance(self.model, torch.nn.DataParallel): self.model = torch.nn.DataParallel(self.model, self.device_ids) self.model = self.model.to(self.device) self.criterion = sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle_computation_graph(self):\n # Get model\n self.model = self.get_model()\n\n # Save model summary\n self.model_summary = self.get_model_summary()\n\n # Get loss criterion\n self.criterion = self.get_criterion()\n\n # Deploy computation graph to devices, and...
[ "0.65187424", "0.600022", "0.586219", "0.574019", "0.563917", "0.5622718", "0.5622072", "0.55991215", "0.5594823", "0.55491304", "0.5548588", "0.5532403", "0.5485378", "0.541944", "0.54138917", "0.5403254", "0.5386523", "0.537935", "0.53785974", "0.53785974", "0.53650767", ...
0.6944387
0
Bifurcation diagram plot for BPsystem.
def bifurcation_diagram(args, Bpbmin, Bpbmax, ylim=(-1, 0.6)): xs = [] Bpb_list = np.linspace(Bpbmin, Bpbmax, 100) Iext, G, Ein, Eex, eps, a, b, A, Bpb, Bbp, vsl = args sol, t = calcODE(args, -1.5, -1.5, 0.5, 0.5, 0.5, 0.5, ts=4000, nt=2 ** 25) sol = sol[-len(sol) // 2:, :] t = t[-len(t) // 2:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_bifurcation(self):\n beta = [1/t for t in self.temperatures]\n check_is_fitted(self, [\"bifurcation_tree\"])\n\n clusters = [[] for _ in range(len(np.unique(self.n_eff_clusters)))]\n leaves = self.bifurcation_tree.leaves()\n\n # add distance lists to clusters array\n ...
[ "0.67209876", "0.63063556", "0.60933197", "0.58796126", "0.57732105", "0.5763807", "0.57327", "0.57250524", "0.572065", "0.5677664", "0.5649825", "0.5637113", "0.56204885", "0.5619319", "0.55994904", "0.5589275", "0.5588503", "0.5582574", "0.5569868", "0.5520807", "0.5470009"...
0.7031106
0
Posts the dispatcher name to redis every 20 seconds.
def post(host): redis.setex('dispatcher',host,60) timer = threading.Timer(20.0, post, args=[host]) timer.daemon = True timer.start()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def restart():\n logging.warning (\"[FLASKWEB] Shutting down K3 Dispatcher....\")\n shutdown_dispatcher()\n return 'Dispatcher is restarting.....Give me a millisec'", "def publish_metric(name, value, type):\n t = time.time()\n m = json.dumps({'monitor':name, type:value, 'time':t})\n r = redis.StrictR...
[ "0.5255156", "0.5164797", "0.5124283", "0.5021926", "0.4942751", "0.48707128", "0.48402488", "0.48025864", "0.48025864", "0.48015472", "0.47870946", "0.4768888", "0.4733355", "0.4727042", "0.46991056", "0.46960187", "0.46918035", "0.46909732", "0.46739873", "0.4666901", "0.46...
0.75734216
0
Connects to a dispatcher at ip address `host` and pushes the records to a ZMQ socket.
def push(host): dispatcher = Dispatch(host) post(host) context = zmq.Context() zmq_socket = context.socket(zmq.PUSH) zmq_socket.bind('tcp://127.0.0.1:5560') for record in dispatcher: zmq_socket.send_pyobj((int(time.time()),record.raw))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setupHostConnection(self, host_ip):\n if host_ip != self.ip and host_ip != '':\n host_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n indicator = host_socket.connect_ex((host_ip, 9090))\n if indicator != 0:\n return False\n else:\n ...
[ "0.5856241", "0.5574473", "0.5520431", "0.538436", "0.53754216", "0.5201506", "0.5189392", "0.5188128", "0.5172387", "0.5132312", "0.51198834", "0.5100022", "0.50615776", "0.50261086", "0.5024684", "0.5011112", "0.49964434", "0.49761385", "0.4976091", "0.4964339", "0.49537674...
0.7418633
0
When attempting to correct without the id When there's only 1 correction available under this session
def test_missing_id_one_suggestion(self): errors = self.response.data["errors"] errors[0]["correction"] = "שתיתי" self.response2 = self.client.post( reverse("correct"), {"errors": errors}, format="json" ) self.assertEqual( self.response2.data, "You need to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_missing_one_correction(self):\n errors = self.response.data[\"errors\"]\n errors[0][\"correction\"] = []\n self.response2 = self.client.post(\n reverse(\"correct\"), {\"id\": 1, \"errors\": errors}, format=\"json\"\n )\n\n self.assertEqual(\n self.r...
[ "0.62753034", "0.6183789", "0.6090873", "0.59328485", "0.5857655", "0.57733464", "0.57722664", "0.5655561", "0.5611208", "0.5471392", "0.5419967", "0.53450525", "0.5319807", "0.5257717", "0.5237597", "0.5196309", "0.5163197", "0.51585466", "0.5157981", "0.51523864", "0.513535...
0.664261
0
When one correction is missing
def test_missing_one_correction(self): errors = self.response.data["errors"] errors[0]["correction"] = [] self.response2 = self.client.post( reverse("correct"), {"id": 1, "errors": errors}, format="json" ) self.assertEqual( self.response2.data, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _calculate_correction(self, telid):\n return 1", "def _calculate_correction(self, telid):", "def test_correction_dont_exist(self):\n errors = self.response.data[\"errors\"]\n errors[0][\"correction\"] = \"שתיתי\"\n self.response2 = self.client.post(\n reverse(\"correc...
[ "0.6132251", "0.60287166", "0.5926968", "0.584622", "0.5780836", "0.5669082", "0.5667202", "0.5663717", "0.5627353", "0.5602648", "0.5592581", "0.55780506", "0.5560611", "0.5512134", "0.54523873", "0.5442267", "0.54360425", "0.5421627", "0.54077417", "0.5396361", "0.5391113",...
0.6256826
0
Convert string to valid identifier
def to_identifier(val: Any): val = str(val).strip() # Replaces spaces, dashes, and slashes to underscores val = re.sub(r"[\s\-/\\]", "_", val) # Remove remaining invalid characters val = re.sub(r"[^0-9a-zA-Z_]", "", val) # Identifier can't start with digits val = re.sub(r"^[^a-zA-Z_]+", "", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_identifier(s):\n if s.startswith('GPS'):\n s = 'Gps' + s[3:]\n return ''.join([i.capitalize() for i in s.split('_')]) if '_' in s else s", "def make_python_identifier(string):\n # Todo: check for variable uniqueness\n # perhaps maintain a list of current variables and their translations??\n ...
[ "0.7280084", "0.7092439", "0.70243603", "0.7006618", "0.6885484", "0.67836046", "0.6751766", "0.67183036", "0.6717753", "0.661987", "0.65996075", "0.65909207", "0.6569859", "0.6566802", "0.6565226", "0.65343857", "0.6517435", "0.648727", "0.64816076", "0.64804447", "0.6474503...
0.7847523
0
Return default if value is None.
def if_none(value: Any, default: Any): return value if value is not None else default
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _defaulted(cls, value, default):\n return default if value is None else value", "def get(value, default=\"\"):\n if value is None:\n return default\n\n return value", "def default_value(self):\n if self.default:\n return copy.deepcopy(self.default)\n else:\n ...
[ "0.89480907", "0.77986026", "0.77825695", "0.7732172", "0.7722747", "0.76419085", "0.748972", "0.7482642", "0.7417169", "0.7368954", "0.7235925", "0.72205067", "0.72138035", "0.7212847", "0.71723425", "0.7149909", "0.7128778", "0.6986576", "0.6961376", "0.6954355", "0.6954355...
0.8249546
1
Initialize table with another table.
def _init_table(self, table: "Table"): if not self.columns: self.columns = table.columns self._data = table.data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_table_obj(self):\n # Check the existence of original table\n if not self.table_exists(self.table_name):\n raise OSCError(\n \"TABLE_NOT_EXIST\", {\"db\": self._current_db, \"table\": self.table_name}\n )\n self._old_table = self.fetch_table_schema(...
[ "0.6733562", "0.6722552", "0.65995735", "0.65825826", "0.64608437", "0.64608437", "0.64496976", "0.63567406", "0.63455373", "0.61692065", "0.6149491", "0.6124297", "0.6120678", "0.6098294", "0.60497725", "0.5999451", "0.599277", "0.59840375", "0.59809333", "0.59750503", "0.59...
0.74731725
0
Validate that given column names can be used.
def _validate_columns(self, names): if not is_list_like(names): raise ValueError("Columns should be list-like") if len(set(names)) != len(names): raise ValueError("Duplicate column names") if self._data and len(names) != len(self._data[0]): raise ValueError(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_columns(df: pd.DataFrame, names: typing.Sequence[str]) -> None:\n for expected in names:\n if expected not in df.columns:\n raise ValueError(f\"'{expected}' column not found in input\")\n return", "def _validate_columns(data, ip_column, lat_column, long_column, other_columns):\...
[ "0.8195807", "0.7515005", "0.74477583", "0.73584527", "0.72443414", "0.72358197", "0.7166061", "0.7122262", "0.7121349", "0.711966", "0.7089864", "0.708901", "0.69831634", "0.6980481", "0.6958175", "0.6949049", "0.692618", "0.6905489", "0.6900764", "0.6798847", "0.6783542", ...
0.8290189
0
Create callable that returns column names for given obj types.
def _column_name_getter(self, obj): if is_namedtuple(obj): # Use namedtuple fields as columns def get(obj): return list(obj._fields) elif is_dict_like(obj): # Use dictionary keys as columns def get(obj): return list(obj.key...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_columns(headers: List, annot_types: List):\n new_column_names: List[Tuple] = []\n for annotation, annot_type in zip(headers, annot_types):\n new_column_names.append((annotation, annot_type))\n return new_column_names", "def _column_picker(attr, objects):\n getter = a...
[ "0.62360036", "0.60943687", "0.58751285", "0.58495367", "0.56971186", "0.5463392", "0.54478693", "0.543725", "0.53849363", "0.53755784", "0.53721935", "0.53403187", "0.53364384", "0.5276896", "0.5264252", "0.5253", "0.5243096", "0.51878905", "0.51844746", "0.5181573", "0.5179...
0.6790804
0
Sort columns to match given order.
def _sort_columns(self, order): unknown = set(self._columns) - set(order) if unknown: names = ", ".join(str(name) for name in unknown) raise ValueError(f"Unknown columns: {names}") cols = [self.column_location(column) for column in order] self._columns = [self._...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cols_sorted(self, cmp=None, key=None, reverse=False):\n return self.select(*sorted(self.names, cmp, key, reverse))", "def sort_columns(self):\n extra_cols = []\n for col in self.data.columns:\n if col not in self._required_columns:\n extra_cols.append(col)\n ...
[ "0.731365", "0.7106469", "0.70860016", "0.700497", "0.6996314", "0.69938815", "0.6942031", "0.6884622", "0.68844193", "0.67425513", "0.66910976", "0.6621654", "0.6604833", "0.6596324", "0.6589373", "0.65596944", "0.6501443", "0.64963406", "0.64694107", "0.64513993", "0.642646...
0.827135
0
Find location for column value.
def column_location(self, value): # Try to use as-is try: return self._columns.index(value) except ValueError: pass # Try as integer index try: value = int(value) if value in self._columns: location = self._column...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _col_match(sheet, row, value):\r\n for cell in sheet[row]:\r\n if cell.value == value:\r\n return cell.column", "def _value_column(self, field):\n for field_dict in self.schema['idx_fields']:\n if field_dict['field_name'] == field:\n return field_dict['co...
[ "0.6948674", "0.6942318", "0.68900645", "0.6643696", "0.6632486", "0.6617296", "0.66054964", "0.6541255", "0.65210915", "0.65178216", "0.64717984", "0.64717984", "0.64595383", "0.63534844", "0.63455355", "0.6333555", "0.6323215", "0.63208455", "0.63208455", "0.63208455", "0.6...
0.81713206
0
Create list of index values from slice object.
def _slice_index(self, slicer): start = self.index_location(slicer.start) if slicer.start is not None else 0 end = self.index_location(slicer.stop) if slicer.stop is not None else self.size return list(range(start, end))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def indices(self):\n return tuple([slice(*r) for r in self.location])", "def _conv_slice_to_list(slice_obj, start_def=0, stop_def=100, step_def=1):\n if slice_obj.start is None:\n start = start_def\n else:\n start = slice_obj.start\n if slice_obj.stop is None:\n stop = stop_d...
[ "0.6825447", "0.6810096", "0.67738503", "0.65580356", "0.63751525", "0.63135886", "0.6246938", "0.6242252", "0.6211246", "0.6116855", "0.6059768", "0.60452837", "0.6025668", "0.5995599", "0.5986486", "0.58954096", "0.58826286", "0.58600235", "0.5830191", "0.5787364", "0.57873...
0.7034283
0
Return last n rows of table.
def tail(self, rows, as_list=False): indexes = self.index[-int(rows) :] return self.get_table(indexes, as_list=as_list)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tail(self, n: int = 5) -> 'DataFrame':\n return self[-n:, :] # type: ignore", "def tail(self, n=10):\n nend = self.len()\n nstart = nend - n\n if nstart < 0:\n nstart = 0\n return self.contents(nstart, nend)", "def get_last_n_observation(self, n: int=1) -> Lis...
[ "0.72962797", "0.674941", "0.66638565", "0.66618073", "0.6444477", "0.6364305", "0.6323589", "0.63173974", "0.6289606", "0.62712055", "0.6206655", "0.6117005", "0.6048003", "0.5992855", "0.59855705", "0.5958222", "0.59573185", "0.5948825", "0.59344596", "0.5927075", "0.590676...
0.6829409
1
Get a new table from all cells matching indexes and columns.
def get_table(self, indexes=None, columns=None, as_list=False): indexes = if_none(indexes, self.index) columns = if_none(columns, self._columns) if indexes == self.index and columns == self._columns: return self.copy() idxs = [self.index_location(index) for index in indexes...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_tables(*args):\n import pandas\n tables = {}\n for locus in args[0].index:\n tables[locus] = get_table(*args, locus)\n return tables", "def select(self, labels):\n indexs = []\n \n for i in range(len(labels)):\n indexs.append(self.column_labels.index(...
[ "0.60347825", "0.60087705", "0.5970888", "0.56931293", "0.563357", "0.5487562", "0.54334235", "0.5424005", "0.5335838", "0.5329208", "0.53034216", "0.5289268", "0.52775276", "0.52463776", "0.52416366", "0.52361655", "0.5228273", "0.5222938", "0.5216148", "0.5214291", "0.52075...
0.6308737
0
Get a new table from rows between start and end index.
def get_slice(self, start: Optional[Index] = None, end: Optional[Index] = None): index = self._slice_index(slice(start, end)) return self.get_table(index, self._columns)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_table_slice(\n self, table: Table, start: Optional[Index] = None, end: Optional[Index] = None\n ) -> Union[Table, List[List]]:\n self._requires_table(table)\n return table.get_slice(start, end)", "def scan_rows_range(\n table_instance: happybase.Table, start: str, stop: str, se...
[ "0.6651683", "0.6319132", "0.5973722", "0.585144", "0.58342904", "0.58123094", "0.57607895", "0.57049155", "0.56603616", "0.5652457", "0.56339955", "0.5618775", "0.56176096", "0.56166697", "0.5601285", "0.55898756", "0.5575854", "0.54927915", "0.5472137", "0.5445899", "0.5444...
0.7032743
0
Sets multiple cell values at a time. Both `indexes` and `columns` can be scalar or listlike, which enables setting individual cells, rows/columns, or regions. If `values` is scalar, all matching cells will be set to that value. Otherwise the length should match the cell count defined by the other parameters.
def set(self, indexes=None, columns=None, values=None): indexes = to_list(if_none(indexes, self.index)) columns = to_list(if_none(columns, self._columns)) size = len(indexes) + len(columns) values = to_list(values, size=size) if not len(values) == size: raise ValueEr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_values(self, values=None, *args, **kwargs):\n valueList = []\n valueDict = {}\n if values is not None:\n # check type of {\\sf values} to get correctly the values\n if isinstance(values, list) or isinstance(values, tuple):\n valueList.extend(values)...
[ "0.7203372", "0.64923775", "0.6454018", "0.617483", "0.6159862", "0.6124584", "0.6048112", "0.6008846", "0.5971057", "0.5971057", "0.59606504", "0.59371686", "0.5937108", "0.5895688", "0.5884265", "0.5883241", "0.58671665", "0.5866049", "0.58607906", "0.5854316", "0.5854316",...
0.8392054
0
Set individual cell value. If either index or column is missing, they are created.
def set_cell(self, index, column, value): try: idx = self.index_location(index) except (IndexError, ValueError): idx = self._add_row(index) try: col = self.column_location(column) except (IndexError, ValueError): col = self._add_column(col...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setCell(self, row = None, column = None, value = None, *, cell = None):\n\n\t\t\t\tif (cell is None):\n\t\t\t\t\tcell = self.getCell(row = row, column = column)\n\n\t\t\t\tif (value is None):\n\t\t\t\t\tvalue = \"\"\n\n\t\t\t\t#Write Value\n\t\t\t\tfor _cell in self.ensure_container(cell):\n\t\t\t\t\t_cell.val...
[ "0.776556", "0.75395095", "0.75395095", "0.7416515", "0.72951037", "0.72768915", "0.7189657", "0.7189419", "0.71257675", "0.71244943", "0.71200806", "0.71103746", "0.7095155", "0.7090685", "0.6998754", "0.69609755", "0.6906513", "0.6830686", "0.6799909", "0.6786136", "0.67835...
0.8009083
0
Set values in row. If index is missing, it is created.
def set_row(self, index, values): try: idx = self.index_location(index) except (IndexError, ValueError): idx = self._add_row(index) column_values = self._column_value_getter(values) row = [column_values(values, column) for column in self._columns] self._...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __setitem__(self, idx, val):\n self.rows[idx[0]][idx[1]] = val", "def updateRow(self, index: int) -> None:\n ...", "def __setitem__(self, index, value):\n # check whether the indexed element does exist\n # raise an error if not\n if index > self._nrows-1:\n err...
[ "0.71771914", "0.70842654", "0.68783075", "0.68665355", "0.6801786", "0.6775541", "0.6732169", "0.6720369", "0.6702868", "0.6664071", "0.662349", "0.6594444", "0.6582222", "0.6562698", "0.6542743", "0.6512231", "0.6498107", "0.647571", "0.6474417", "0.63445824", "0.6309347", ...
0.74020875
0
Set values in column. If column is missing, it is created.
def set_column(self, column, values): values = to_list(values, size=self.size) if len(values) != self.size: raise ValueError( f"Values length ({len(values)}) should match data length ({self.size})" ) if column not in self._columns: self._add_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setColumn(self,item,column,value):\n raise UncodedError", "def _set_column(self, column_name, column):\n self._dirty = True\n\n if column.ndim != 1:\n raise ValueError(\"Can only add one-dimensional columns.\")\n if column.dtype.hasobject:\n # Attempting to c...
[ "0.72772044", "0.7008916", "0.68221676", "0.67574555", "0.67276305", "0.6720104", "0.6631093", "0.65324146", "0.65064204", "0.64829427", "0.647654", "0.6468659", "0.64640224", "0.6424859", "0.6390727", "0.6390698", "0.6259309", "0.624906", "0.6221586", "0.6210146", "0.6146917...
0.71581537
1
Append multiple rows to table.
def append_rows(self, rows): for row in rows: self.append_row(row)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_rows(self):\n for row in self.rows:\n self.table.add_row(row)", "def append_row(self, values):\n self.range(self._op.max_row + 1, 1, len(values)).values = values", "def append_table(lines, table):\n tabulate(table)\n for row in table:\n lines.append('|' + '|'.join(...
[ "0.8056808", "0.7212632", "0.7002069", "0.6947073", "0.68610173", "0.6813562", "0.6789191", "0.66408974", "0.662562", "0.6614649", "0.66074425", "0.6582469", "0.6551273", "0.65011823", "0.64807016", "0.6465733", "0.6465733", "0.6465733", "0.6465733", "0.6465733", "0.6465733",...
0.8321242
0
Remove rows with matching indexes.
def delete_rows(self, indexes: Union[Index, List[Index]]): indexes = [self.index_location(idx) for idx in to_list(indexes)] unknown = set(indexes) - set(self.index) if unknown: names = ", ".join(str(name) for name in unknown) raise ValueError(f"Unable to remove unknown r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_indexes(self, indexes):\n # Create a set of the rows (as int) to delete\n selected_rows = set()\n for index in indexes:\n selected_rows.add(index.row())\n\n # Delete all of them one by one (easy but maybe not the best performance-wise)\n for index, row in en...
[ "0.75362426", "0.6611531", "0.65299886", "0.6285756", "0.61251855", "0.60856557", "0.60207874", "0.5996634", "0.59949094", "0.5956962", "0.58849806", "0.58783525", "0.5856566", "0.58463866", "0.5821346", "0.5820045", "0.5811615", "0.57980585", "0.5791523", "0.5791523", "0.576...
0.6912513
1
Append data from table to current data.
def append_table(self, table): if not table: return indexes = [] for idx in table.index: index = self.size + idx indexes.append(index) self.set(indexes=indexes, columns=table.columns, values=table.data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append_data(self, table_name, df):\n\t\tself.__check_colnames(table_name, df)\n\t\tif self.__dbfile is not None:\n\t\t\tdf.to_sql(table_name, self._conn, index=False, if_exists=\"append\")", "def append_data(self, data):\n self.results.append(data)", "def add_data(self, df):\n # TODO: improve...
[ "0.696404", "0.6861513", "0.6829968", "0.6789549", "0.67066246", "0.6697359", "0.66813946", "0.66778374", "0.65167874", "0.64594144", "0.6437521", "0.6421187", "0.6419069", "0.6418953", "0.63657373", "0.63249725", "0.6308272", "0.63041484", "0.6269882", "0.625746", "0.6247409...
0.7606198
0
Group rows by column value and return as list of tables.
def group_by_column(self, column): ref = self.copy() ref.sort_by_column(column) col = self.column_location(column) groups = groupby(ref.data, itemgetter(col)) result = [] ref.clear() for _, group in groups: table = ref.copy() table.append...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def group_table_by_column(self, table: Table, column: Column) -> List[Table]:\n self._requires_table(table)\n groups = table.group_by_column(column)\n self.logger.info(\"Found %s groups\", len(groups))\n return groups", "def groupRows(rows, column):\n filteredRows = filterRows(lamb...
[ "0.668953", "0.6274992", "0.58129585", "0.5783631", "0.5754732", "0.57515454", "0.57327884", "0.5712955", "0.560059", "0.5587885", "0.5585685", "0.55202794", "0.55056596", "0.5485401", "0.54653186", "0.5411633", "0.53961796", "0.53930426", "0.53633994", "0.53533554", "0.53477...
0.71942514
0
Remove rows by evaluating `condition` for every row. The filtering will be done inplace and all the rows evaluating as falsy through the provided condition will be removed.
def filter_all(self, condition: RowCondition): def _check_row(index: int) -> bool: row = self.get_row(index) return condition(row) self._filter(_check_row)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self, condition: conditions.Condition = None):\n if not condition:\n del self.rows[:]\n\n for i, row in enumerate(self.rows):\n if condition.evaluate(self, row):\n del self.rows[i]", "def delete(self, predicate: WhereClause = lambda row: True) -> None...
[ "0.7429801", "0.6358919", "0.6285064", "0.61315286", "0.60809714", "0.6050911", "0.5781825", "0.57598364", "0.5594821", "0.5538622", "0.548341", "0.5463195", "0.5461748", "0.54475933", "0.5325685", "0.52962", "0.5262897", "0.5212997", "0.5153299", "0.5127275", "0.5024701", ...
0.6827544
1
Remove rows by evaluating `condition` for cells in `column`. The filtering will be done inplace and all the rows where it evaluates to falsy are removed.
def filter_by_column(self, column: Column, condition: CellCondition): def _check_cell(index: int) -> bool: cell = self.get_cell(index, column) return condition(cell) self._filter(_check_cell)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self, condition: conditions.Condition = None):\n if not condition:\n del self.rows[:]\n\n for i, row in enumerate(self.rows):\n if condition.evaluate(self, row):\n del self.rows[i]", "def _remove_column(self, column: str) -> None:\n dtype, loc,...
[ "0.64482737", "0.5592173", "0.5536182", "0.5496021", "0.543281", "0.54259133", "0.5416538", "0.5411316", "0.53982836", "0.5314119", "0.5304949", "0.5287098", "0.52473515", "0.5234279", "0.520345", "0.518898", "0.5139475", "0.5076935", "0.50596356", "0.5057784", "0.5054955", ...
0.73680466
0
Make a copy of a table object.
def copy_table(self, table: Table) -> Table: self._requires_table(table) return table.copy()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Copy(self, copy):\n return _table.Table_Copy(self, copy)", "def copy_table(document, table, cut=False):\n if cut:\n document._body._element._insert_tbl(table._tbl)\n else:\n document._body._element._insert_tbl(copy.deepcopy(table)._tbl)\n return document.tables[-1]", "def get_...
[ "0.7873896", "0.73177564", "0.7193371", "0.70958126", "0.68949413", "0.6873994", "0.6796997", "0.67776376", "0.6735857", "0.6723426", "0.65702933", "0.6547794", "0.6443065", "0.643459", "0.63615656", "0.62517005", "0.6251334", "0.6249006", "0.609277", "0.60588694", "0.6029746...
0.8422398
0
Merge tables by appending columns and rows.
def _merge_by_append(self, tables: Tuple[Table, ...]): columns = uniq(column for table in tables for column in table.columns) merged = Table(columns=columns) for table in tables: merged.append_rows(table) return merged
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge_tables(tables):\n base = tables[0]\n for table in tables[1:]:\n for row_index, row in enumerate(table):\n # Chop off duplicate leftmost column\n base[row_index] += row[1:]\n return base", "def merge_tables(self):\r\n\r\n table_params = pd.read_json(os.path.j...
[ "0.72351795", "0.68682784", "0.66211224", "0.64697164", "0.6282124", "0.6266638", "0.6174013", "0.617287", "0.6067397", "0.60592175", "0.5994897", "0.5990032", "0.59438926", "0.5915363", "0.5879549", "0.5877892", "0.58722717", "0.58536845", "0.5830412", "0.57777274", "0.57504...
0.78619844
0
Find index for row, if key already exists.
def find_index(row): value = row[index] if value in seen: return seen[value] for row_ in merged.iter_dicts(True): if row_[index] == value: seen[value] = row_["index"] return row_["index"] return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_row_index(self, row: Row) -> int:\n row_index = -1\n for index, table_row in enumerate(self.table_data):\n if table_row.values == row.values:\n row_index = index\n break\n return row_index", "def _select_index_from_item(item):\n for in...
[ "0.7209541", "0.70532125", "0.68006116", "0.67722076", "0.675662", "0.6658177", "0.66343707", "0.66189426", "0.66063106", "0.653279", "0.6476507", "0.639836", "0.63648957", "0.6358891", "0.6331012", "0.6296319", "0.6276916", "0.6270747", "0.6258578", "0.6226203", "0.616034", ...
0.80374485
0
Return table dimensions, as (rows, columns).
def get_table_dimensions(self, table: Table) -> Tuple[int, int]: self._requires_table(table) notebook_print(text=table.dimensions) return table.dimensions
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dimensions():", "def get_dims(self):\n row_lbl, col_lbl = self.get_idxvals()\n return len(row_lbl), len(col_lbl)", "def getDimensions():", "def size(self):\n cols = self.max_col + 1 - self.min_col\n rows = self.max_row + 1 - self.min_row\n return {'columns':cols, 'rows'...
[ "0.73103446", "0.70894235", "0.7055698", "0.7003654", "0.6929393", "0.68902147", "0.682463", "0.6740063", "0.672392", "0.67124575", "0.67093986", "0.668757", "0.6677027", "0.6677027", "0.6630404", "0.6627159", "0.65844375", "0.6564942", "0.6551782", "0.6526273", "0.6522425", ...
0.8126503
0
Renames columns in the Table with given values. Columns with name as ``None`` will use the previous value.
def rename_table_columns( self, table: Table, names: List[Union[str, None]], strict: bool = False ): self._requires_table(table) before = table.columns if strict and len(before) != len(names): raise ValueError("Column lengths do not match") after = [] fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rename_column(self, table_name, old, new):\r\n self._remake_table(table_name, renames={old: new})", "def _remap_column_names(self, frame):\n\n frame[TransactionColumns.BANK.name] = self.INSTITUTION\n frame[TransactionColumns.ACCOUNT.name] = self.account\n frame.rename(columns=self...
[ "0.6565011", "0.6268488", "0.6168447", "0.6141639", "0.61229825", "0.5936397", "0.59340596", "0.58363074", "0.57888657", "0.57888657", "0.57729256", "0.5765294", "0.5711808", "0.5707234", "0.56740695", "0.5653019", "0.5652126", "0.5592933", "0.5522609", "0.55150324", "0.55146...
0.70746547
0
Assign values to a row in the table.
def set_table_row(self, table: Table, row: Index, values: Any): self._requires_table(table) table.set_row(row, values)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setRow(self, row): \n self.row = row", "def setRow(self, row):\n # Row of the database where the values of the variables are found\n self._row = row\n for e in self.children:\n e.setRow(row)", "def set_row( self, row, ):\n self.ix_row = row", "def set...
[ "0.7216534", "0.717446", "0.702964", "0.68703943", "0.68315667", "0.6806795", "0.67249465", "0.6589283", "0.6574198", "0.6540844", "0.6476541", "0.6380461", "0.63301975", "0.62463117", "0.6242876", "0.61939245", "0.61214983", "0.61166424", "0.6104722", "0.60639304", "0.604233...
0.7491057
0
Assign values to a column in the table.
def set_table_column(self, table: Table, column: Column, values: Any): self._requires_table(table) table.set_column(column, values)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setColumn(self,item,column,value):\n raise UncodedError", "def set_column(self, column, values):\n values = to_list(values, size=self.size)\n\n if len(values) != self.size:\n raise ValueError(\n f\"Values length ({len(values)}) should match data length ({self.si...
[ "0.7248893", "0.7118867", "0.6937033", "0.68706644", "0.6746585", "0.66878724", "0.6671414", "0.66482836", "0.66082066", "0.6532953", "0.6515963", "0.64774776", "0.6443268", "0.6407785", "0.6401016", "0.639326", "0.6357932", "0.6357486", "0.6331498", "0.6321763", "0.63086313"...
0.72128916
1
Set existing row as names for columns.
def set_row_as_column_names(self, table: Table, row: Index): values = self.pop_table_row(table, row, as_list=True) table.columns = values
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setFieldNames(self, model, lyr): \n #get the fields\n fields = lyr.pendingFields()\n position = 0\n \n #set column names\n for field in fields:\n model.setHorizontalHeaderItem(position, QStandardItem(field.name()))\n position+=1", "def set_col...
[ "0.65162766", "0.6237886", "0.6237886", "0.62350297", "0.6106884", "0.607684", "0.6037991", "0.603777", "0.600717", "0.59654635", "0.5955323", "0.5953562", "0.5918157", "0.58940566", "0.5893364", "0.5818786", "0.5801642", "0.5793248", "0.57920194", "0.5791041", "0.57854533", ...
0.78300816
0
Return first ``count`` rows from a table.
def table_head( self, table: Table, count: int = 5, as_list: bool = False ) -> Union[Table, List[List]]: self._requires_table(table) return table.head(count, as_list)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def take_first(count):\n def _take_first(iterable):\n return islice(iterable, count)\n return pipe | set_name('take_first(%s)' % count, _take_first)", "def head(self, limit, columns=None):\n return self.table.head(limit, partition=self.partition_spec, columns=columns)", "def get_table_nfirs...
[ "0.63007617", "0.6261714", "0.61827385", "0.61801857", "0.5963615", "0.57307893", "0.569493", "0.56924576", "0.56500095", "0.5618518", "0.55160475", "0.549067", "0.5473075", "0.5388332", "0.5385612", "0.5380792", "0.5367527", "0.5363873", "0.5358783", "0.5327128", "0.5285658"...
0.6621105
0
Return last ``count`` rows from a table.
def table_tail( self, table: Table, count: int = 5, as_list: bool = False ) -> Union[Table, List[List]]: self._requires_table(table) return table.tail(count, as_list)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last(self, count):", "def get_last_messages(self, count):\n return self.buffer.get_last(count)", "def fetch_last(self, tablename):\n query = 'select * from ' + tablename\n try:\n self.__cur.execute(query)\n except Exception as e:\n self.__conn.rollback(...
[ "0.722884", "0.6470306", "0.61996204", "0.610139", "0.59177303", "0.58204263", "0.5804548", "0.5791227", "0.57861066", "0.5713984", "0.5713984", "0.5692873", "0.5690206", "0.5639305", "0.55878776", "0.55854654", "0.5503625", "0.5492718", "0.5490945", "0.54613364", "0.5455295"...
0.67821074
1
Set a cell value in a table.
def set_table_cell(self, table: Table, row: Index, column: Column, value: Any): self._requires_table(table) table.set_cell(row, column, value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setCell(self, row = None, column = None, value = None, *, cell = None):\n\n\t\t\t\tif (cell is None):\n\t\t\t\t\tcell = self.getCell(row = row, column = column)\n\n\t\t\t\tif (value is None):\n\t\t\t\t\tvalue = \"\"\n\n\t\t\t\t#Write Value\n\t\t\t\tfor _cell in self.ensure_container(cell):\n\t\t\t\t\t_cell.val...
[ "0.76911867", "0.76116747", "0.76116747", "0.7513694", "0.7477073", "0.73363674", "0.73060185", "0.7149292", "0.7140113", "0.7130762", "0.710844", "0.7084144", "0.70795774", "0.6931963", "0.69175714", "0.6899028", "0.6840131", "0.68192595", "0.6770217", "0.67293966", "0.66468...
0.85586256
0
Find all the rows in a table which match a condition for a given column.
def find_table_rows(self, table: Table, column: Column, operator: str, value: Any): self._requires_table(table) condition = to_condition(operator, value) matches = [] for index in table.index: cell = table.get_cell(index, column) if condition(cell): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_column_with_constraint(db, table, column, condition_col, condition_val):\n condition = condition_col + \" = '\" + str(condition_val) + \"'\"\n result = select_columns(db, table, column, condition=condition)\n\n return result", "def select_rows(self, table: str, column: str, where_like: tuple ...
[ "0.6925316", "0.64124686", "0.63502294", "0.6240452", "0.6062734", "0.6055822", "0.59907174", "0.5985847", "0.5950616", "0.5803734", "0.5755852", "0.57545376", "0.57457376", "0.5716693", "0.5694454", "0.5684835", "0.566829", "0.5641616", "0.5622469", "0.55663604", "0.55506104...
0.68429446
1
Sort a table inplace according to ``column``.
def sort_table_by_column( self, table: Table, column: Column, ascending: bool = True ): self._requires_table(table) table.sort_by_column(column, ascending=ascending)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort(self, column: int, order: Qt.SortOrder = ...) -> None:\n col = self._dataframe.columns[column]\n # Temporary column with display value of column\n self._dataframe['_FOR_SORT'] = self._dataframe.apply(\n lambda row: self._get_cell_value(self._dataframe.index.get_loc(row.name...
[ "0.7009111", "0.68689597", "0.6673256", "0.66401833", "0.6596779", "0.6506555", "0.6474628", "0.6446604", "0.6422233", "0.61254597", "0.60510707", "0.5997924", "0.5994053", "0.59777087", "0.5926712", "0.58714414", "0.5870359", "0.58514553", "0.58365184", "0.5728713", "0.57253...
0.7366645
0
Group a table by ``column`` and return a list of grouped Tables.
def group_table_by_column(self, table: Table, column: Column) -> List[Table]: self._requires_table(table) groups = table.group_by_column(column) self.logger.info("Found %s groups", len(groups)) return groups
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def group_by_column(self, column):\n ref = self.copy()\n ref.sort_by_column(column)\n\n col = self.column_location(column)\n groups = groupby(ref.data, itemgetter(col))\n\n result = []\n ref.clear()\n for _, group in groups:\n table = ref.copy()\n ...
[ "0.85513383", "0.6532524", "0.6312355", "0.61600953", "0.6026099", "0.5568698", "0.53542984", "0.5292979", "0.5158976", "0.5114148", "0.50809896", "0.5067889", "0.5056088", "0.50313807", "0.5024239", "0.50111103", "0.49159738", "0.49159738", "0.48787895", "0.48526627", "0.482...
0.8990111
0
Run a keyword for each row of a table, then remove all rows where the called keyword returns a falsy value. Can be used to create custom RF keyword based filters.
def filter_table_with_keyword(self, table: Table, name: str, *args): self._requires_table(table) def condition(row: Row) -> bool: return BuiltIn().run_keyword(name, row, *args) before = len(table) table.filter_all(condition) after = len(table) self.logger.i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_queryUnkeywordFlag(self):\n self._keywordFilteringTest(\"unkeyword\")", "def delete(self, predicate=lambda row: True):\n self.rows = [row for row in self.rows if not predicate(row)]", "def delete(self, predicate: WhereClause = lambda row: True) -> None:\n self.rows = [row for row ...
[ "0.60954833", "0.5989575", "0.59770995", "0.5785286", "0.57307386", "0.546666", "0.5428105", "0.5362649", "0.53234386", "0.5256711", "0.521115", "0.5072622", "0.50691193", "0.50688195", "0.5065629", "0.5063569", "0.5061991", "0.50292706", "0.49837416", "0.4949193", "0.4945442...
0.68050015
0
Run a keyword for each cell in a given column, and replace its content with the return value. Can be used to easily convert column types or values inplace.
def map_column_values(self, table: Table, column: Column, name: str, *args): self._requires_table(table) values = [] for index in table.index: cell = table.get_cell(index, column) output = BuiltIn().run_keyword(name, cell, *args) values.append(output) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _convert_column(self, col, function):\n col_new = []\n for x in self[col]:\n if x == \"\":\n col_new.append(None)\n else:\n col_new.append(function(x))\n self.df[col] = col_new", "def spellcheck(df, column):\n for i in df.index:\n ...
[ "0.591799", "0.57188034", "0.5534441", "0.5531227", "0.5465207", "0.5406796", "0.5356294", "0.5300999", "0.5298976", "0.5273646", "0.51940584", "0.5162493", "0.5121754", "0.50462806", "0.5012482", "0.4998779", "0.49872717", "0.4976669", "0.49432942", "0.49295598", "0.4904368"...
0.6324153
0
Remove all rows from a table which have only ``None`` values.
def filter_empty_rows(self, table: Table): self._requires_table(table) empty = [] for idx, row in table.iter_lists(): if all(value is None for value in row): empty.append(idx) table.delete_rows(empty)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trim_empty_rows(self, table: Table):\n self._requires_table(table)\n\n empty = []\n for idx in reversed(table.index):\n row = table[idx]\n if any(value is not None for value in row):\n break\n empty.append(idx)\n\n table.delete_rows(em...
[ "0.78526706", "0.65610045", "0.6503689", "0.64150983", "0.6410111", "0.6358219", "0.629917", "0.6294147", "0.6225571", "0.6208026", "0.5998382", "0.598361", "0.594039", "0.5921602", "0.5906316", "0.58945847", "0.5880637", "0.58771354", "0.5853974", "0.5847558", "0.5808685", ...
0.818738
0
Remove all rows from the end of a table which have only ``None`` as values.
def trim_empty_rows(self, table: Table): self._requires_table(table) empty = [] for idx in reversed(table.index): row = table[idx] if any(value is not None for value in row): break empty.append(idx) table.delete_rows(empty)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_empty_rows(self, table: Table):\n self._requires_table(table)\n\n empty = []\n for idx, row in table.iter_lists():\n if all(value is None for value in row):\n empty.append(idx)\n\n table.delete_rows(empty)", "def filter(self):\n self.data = ...
[ "0.7964169", "0.62886345", "0.6188555", "0.60982853", "0.6042587", "0.59561265", "0.5938961", "0.5919667", "0.5919299", "0.59012693", "0.58940977", "0.58505476", "0.5836177", "0.58201474", "0.57514447", "0.56925017", "0.5658195", "0.5619252", "0.5596895", "0.55947787", "0.556...
0.8001879
0
Remove all extraneous whitespace from column names.
def trim_column_names(self, table: Table): self._requires_table(table) table.columns = [ column.strip() if isinstance(column, str) else column for column in table.columns ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_spaces_from_columns_names(file_path):\n cprint(f\"### Function Name:-> {inspect.stack()[0][3]} ###\", 'yellow', 'on_grey', attrs=['bold'])\n try:\n path_obj = Path(file_path)\n df = get_df_from_data_file(file_path)\n df.columns = df.columns.str.strip()\n delete_data_fi...
[ "0.7290008", "0.7156638", "0.7053977", "0.6772457", "0.654471", "0.6538224", "0.65244913", "0.65141475", "0.63998187", "0.63263005", "0.6311282", "0.6262816", "0.6220851", "0.6197208", "0.6164755", "0.6043932", "0.60374135", "0.5997232", "0.5997232", "0.593938", "0.5916725", ...
0.7512996
0
Returns True or False depending on whether or not the key is in the cache
def __contains__(self, key): return key in self.cache
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cached(self, key):\n return key in self._cache", "def contains(self, key) -> bool:\n if key not in self._cache:\n return False\n value, expiration = self._cache[key]\n if self._clock() <= expiration:\n return True\n else:\n del self._cache[k...
[ "0.8669352", "0.8374385", "0.8276235", "0.79428226", "0.7832975", "0.7569225", "0.7561919", "0.75263333", "0.75076485", "0.75055176", "0.7493853", "0.7453887", "0.7437174", "0.7426952", "0.74103117", "0.7391145", "0.7386873", "0.7382659", "0.7371743", "0.73630464", "0.7362502...
0.8537391
1
Return current keys existing in cache
def print_keys_existing(self): for key in self.cache: print(key)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_keys(self):\r\n return self._keys", "def get_keys(self):\r\n\t\tlogger.debug(\"Getting the keys\")\r\n\t\t\r\n\t\treturn db.get_items('keys')", "def get_all_keys(self):\n r = []\n with self.lock:\n for key in self.keys():\n if self.get(key):\n ...
[ "0.70534223", "0.69748926", "0.6967446", "0.68217856", "0.6759036", "0.66815174", "0.66612965", "0.6608315", "0.6581854", "0.65788716", "0.6578267", "0.65546936", "0.65432703", "0.6535758", "0.6515689", "0.6506785", "0.65002906", "0.64974004", "0.64974004", "0.6495731", "0.64...
0.71716154
0
Take n next results. By default returns per_page results.
def take(self, n: int = -1) -> List[T]: if n == -1: n = self._per_page if not isinstance(n, int) or n < 0: raise ArgumentError( f"argument n={n} is invalid; n must be an int and n >= 1" ) it = iter(self) return list(itertools.islice(i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nextNumberOfResults(self, N=10):\n self.start += self.N\n self.N = N", "def paging_results(self):\n\n return 30", "def GetNextBatchOfResults(self) -> typing.List[Repository.Repository]:\n while True:\n try:\n logging.debug('Requesting page %d', self.next_page_num)\n ...
[ "0.75766057", "0.7059284", "0.6771589", "0.66413516", "0.6640998", "0.65484047", "0.6521383", "0.6518871", "0.64722687", "0.6385806", "0.6385806", "0.6382475", "0.63733125", "0.63733125", "0.6363928", "0.6341928", "0.6326922", "0.62926024", "0.627447", "0.6228437", "0.621768"...
0.7081955
1
Create new untitled notebook at 'path' Server base URL is 'url' Returns name of the new notebook file.
def newnb(url, path, copy=None): # See IPython/html/services/notebooks/handlers.py for API details. # Compare directory contents before and after new notebook creation. names = [nb['name'] for nb in get_nblist(url, path) if nb['type'] == 'notebook'] arg = path if isinstance(arg, unicode): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_untitled(self, path=\"\", model_type=\"\", ext=\"\"):\n path = path.strip(\"/\")\n if not self.dir_exists(path):\n raise HTTPError(404, \"No such directory: %s\" % path)\n\n model = {}\n if model_type:\n model[\"type\"] = model_type\n\n if ext == \"....
[ "0.6608155", "0.60415953", "0.5997468", "0.5932369", "0.5903256", "0.58528847", "0.5790085", "0.5648391", "0.55989397", "0.5560958", "0.55255204", "0.55201197", "0.54570735", "0.5451196", "0.54240686", "0.54012394", "0.5374578", "0.53085756", "0.53085756", "0.52815825", "0.51...
0.81313026
0
Calculate an MD5checksum (128 bits) of the given object. The types of the object and it's elements (in case of a container)
def checksum(*objects): hasher = hashlib.md5() _checksum(hasher, objects) return hasher.hexdigest()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def md5(obj):\n import hashlib\n # print \"self.conf\", str(self.conf)\n # if type(obj) is not str:\n # obj = str(obj)\n # print('type(obj)', type(obj))\n m = hashlib.md5(obj.encode())\n return m", "def MD5(self) -> _n_0_t_3[_n_0_t_9]:", "def _md5sum(data):\n hash = hashlib.md5()\n ...
[ "0.6903288", "0.6890338", "0.6528383", "0.6525763", "0.64919096", "0.64868903", "0.63358665", "0.61436075", "0.60991764", "0.60471624", "0.60352516", "0.59941894", "0.59608716", "0.59186715", "0.5884191", "0.58351564", "0.58208543", "0.5804905", "0.57969284", "0.5752275", "0....
0.78246653
0
returns the value of the nth bit of reg.
def get_bit(reg,n_bit): return reg >> n_bit & 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bit(self, register: str, n_bit: int):\n byte = self.get_byte(register)\n return byte[::-1][n_bit]", "def bit_get(val, idx):\n return (val >> idx) & 1", "def __getitem__(self, index):\n nth_int, nth_bit = divmod(index, BitArray._UNSIGNED_INT)\n return self.bits[nth_int...
[ "0.7644259", "0.76204294", "0.72173315", "0.71775544", "0.71065515", "0.70355976", "0.6929072", "0.6882902", "0.6837333", "0.6822467", "0.6778432", "0.67532986", "0.6703428", "0.6597937", "0.65763915", "0.6525626", "0.64827925", "0.6412594", "0.6200245", "0.6117511", "0.61125...
0.8381005
0
Writes the ndata (int) data bytes of data (int) into regiter reg of the device. Error is raised if data is longer than ndata. If the chip has only one register and therefore it has no register address, set data=0 and ndata=0, and give the intended register value to the "reg" argument.
def write(self, reg, data, ndata): assert 0<=reg<=0xff, f"Invalid register addres: f{hex(reg)}. Valid range is (0x00, 0xff)" if self.emulate: pass else: l_tx = [(self.addr << 1), reg ] l_data = [] if ndata > 0: l_data = self.int_to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _write_reg(self, register, data):\n logger.debug(\"Writing to register {0}: {1}\".format(register, data))\n if isinstance(register, str):\n w_data = [self.registers[register]]\n elif isinstance(register, int):\n w_data = [register]\n else:\n raise (V...
[ "0.69175893", "0.6539832", "0.6500169", "0.6500169", "0.63733625", "0.6219187", "0.6205554", "0.6095358", "0.595762", "0.59405", "0.56768644", "0.56520563", "0.564323", "0.5455349", "0.54519403", "0.541282", "0.5394733", "0.5349481", "0.53382474", "0.5324121", "0.5308249", ...
0.788327
0
Getter for the version string. If no version was provided upon creation (e.g. via a command line flag), we will attempt to auto generate a version string using the username and the current date.
def version(self): if self._version is None: self.version = '{user}-{date}'.format( user=getpass.getuser().strip().lower(), date=datetime.datetime.strftime(datetime.datetime.now(), '%Y-%m-%d')) return self._version
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_version():\n return \"0.0.1 (prerelease prototype)\"", "def get_version(self) -> str:\n return versioning.get_version()", "def get_version(cls):\n if Config.ENV_TYPE == PRD:\n return Config.version + \"/\" + Config.build\n return Config.version + \"/\" + Config.build ...
[ "0.73386735", "0.7327966", "0.7120923", "0.70829433", "0.70649695", "0.70640445", "0.7044906", "0.7037088", "0.7035089", "0.70321494", "0.69947344", "0.69947344", "0.69947344", "0.69947344", "0.69947344", "0.6994028", "0.6943077", "0.692443", "0.686148", "0.6860623", "0.68180...
0.82244396
0
Setter for the version string.
def version(self, version): self._version = utils.VersionParser().parse(version)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setVersion(self, *args):\n\n self._version = '.'.join( [str(arg) for arg in args] )", "def version(self, version: str):\n\n self._version = version", "def version(self, version: str):\n\n self._version = version", "def set_version(self, version: str) -> None:\n if self.current_ver...
[ "0.71828425", "0.70698994", "0.70698994", "0.70292515", "0.69416314", "0.6862625", "0.67540497", "0.6727578", "0.6727372", "0.6716955", "0.6716955", "0.66946614", "0.66901606", "0.6629916", "0.65302753", "0.65302753", "0.65302753", "0.65302753", "0.65302753", "0.65302753", "0...
0.71129894
1
Runs the Grab n Go manager.
def run(self): try: while True: utils.clear_screen() utils.write('Which of the following actions would you like to take?\n') for opt in self._options.values(): utils.write('Action: {!r}\nDescription: {}\n'.format( opt.name, opt.description)) action = uti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n self.cmdloop()", "def run():\n board = SimpleGoBoard(7)\n con = GtpConnection(Gomoku4(), board)\n con.start_connection()", "def run():\n main()", "def run():\n board = GoBoard(7)\n con = GtpConnection(Gomoku(), board)\n con.start_connection()", "def main(self):\...
[ "0.6190317", "0.6159027", "0.61256284", "0.6026458", "0.60154086", "0.6006619", "0.5996472", "0.59546375", "0.58861333", "0.5877691", "0.58712816", "0.58432376", "0.57572323", "0.57402545", "0.5726323", "0.5723736", "0.5723036", "0.56901985", "0.56901985", "0.56901985", "0.56...
0.61801946
1
Changes the project configuration being managed.
def _change_project(self): project_key = utils.prompt_string( 'You are currently managing Google Cloud Project {!r}.\n' 'This project is currently saved as {!r}.\n' 'All of the currently configured projects include: {}.\n' 'Which project would you like to switch to?'.format( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configure_project():\n pass", "def __gitEditRepoConfig(self):\n self.vcs.gitEditConfig(self.project.getProjectPath())", "def test_config_set(self):\n test_name = sys._getframe().f_code.co_name\n rv, output = self._execute('config set project name \"Test project\"')\n self.ass...
[ "0.69391847", "0.6228357", "0.61323196", "0.60269165", "0.6015702", "0.59945333", "0.59599996", "0.5922282", "0.5922267", "0.5922267", "0.5922267", "0.5825002", "0.58096814", "0.57972693", "0.5788478", "0.5788478", "0.576016", "0.57313913", "0.57288647", "0.5711862", "0.56962...
0.6295994
1
Prompts the user for project wide constants.
def _configure(self): opts = sorted(self._constants.keys()) opts.append(_QUIT) try: while True: utils.clear_screen() utils.write('Here are the project wide constants for {!r}:\n'.format( self._config.project)) configured, unconfigured = [], [] for name in so...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prompt_project(arguments):\r\n projects = Project.all()\r\n\r\n # Do not prompt -- and auto select the one project if a account only has one project\r\n if len(projects) == 1:\r\n return projects[0]\r\n\r\n if arguments['--project-index'] is not None:\r\n try:\r\n idx = int...
[ "0.5853284", "0.58324236", "0.5536379", "0.51959765", "0.5192797", "0.51909417", "0.5164687", "0.50676614", "0.5062178", "0.50402737", "0.5032655", "0.49999672", "0.49907392", "0.49782276", "0.4962392", "0.49477777", "0.49444494", "0.4935392", "0.49272212", "0.4921987", "0.49...
0.6731846
0
Writes constants to the configured Google Cloud Storage Bucket.
def _save_constants(self): try: self._storage_api.insert_blob( self._config.constants_storage_path, {name: const.value for name, const in six.iteritems(self._constants)}, bucket_name=self._config.bucket, ) except storage.NotFoundError as err: logging.error('Failed...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_config(config):\n\n LOGGER.info(f\"Writing config to bucket {BUCKET} with key {CONFIG_S3_KEY}.\") \n save_json(BUCKET, CONFIG_S3_KEY, config)", "def write_to_s3(df, bucket, path):\n pass", "def save_to_gcs(df, file, bucket=settings.ASSETS.BUCKET):\n output_file = NamedTemporaryFile().name\...
[ "0.6207074", "0.59552526", "0.58622605", "0.5832919", "0.5636553", "0.5564152", "0.5513886", "0.5488769", "0.5457858", "0.5448018", "0.54297674", "0.5380489", "0.5358681", "0.53451306", "0.53223854", "0.5254249", "0.52466226", "0.52187246", "0.5213198", "0.519783", "0.5192349...
0.75169843
0
Attempts to load constants from Google Cloud Storage.
def load_constants_from_storage(self): try: constants = self._storage_api.get_blob( self._config.constants_storage_path, self._config.bucket, ) except storage.NotFoundError as err: logging.error('Constants were not found in storage: %s', err) else: for name in sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _gcs_load(path):\n return Command(\"gsutil cat {}\".format(path)).output", "def load(path):\n if path.startswith('gs://'):\n return _gcs_load(path)\n if path.startswith('file://'):\n return _file_load(path)\n raise ValueError('Unknown URI: {}'.format(path))", "def _save_constants(self):\n try:...
[ "0.6290354", "0.6204312", "0.57078964", "0.5440258", "0.5271559", "0.5159946", "0.51182526", "0.50567794", "0.5039487", "0.5025344", "0.49567404", "0.49487445", "0.4945089", "0.49406844", "0.4905531", "0.49023527", "0.48969352", "0.48910224", "0.4890587", "0.48482084", "0.484...
0.7845701
0
This function is called when a new robot is created. It adds it to the drop down menu.
def add_robot(self, robot): # ALTHOUGH THE DOCUMENTATION SAYS THAT MENU CHOICES CAN BE UPDATED, # THE PACKAGE DOES NOT ALLOW IT. # THUS THIS 'HACK' MUST BE DONE TO REFRESH THE UI WITH AN UPDATED LIST # Save the list of robot names new_list = [] for name in self.__ui_cont...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, parent=None):\n super(RobotSelection, self).__init__(parent)\n self.parent = parent\n self.initUI()", "def __del_robot(self):\n if len(self.__robots) == 0:\n # Alert the user and return\n self.scene.append_to_caption(\n '<script ...
[ "0.62869436", "0.6181151", "0.58686167", "0.5854445", "0.5854211", "0.56947535", "0.56485", "0.56466997", "0.5614035", "0.5614035", "0.5614035", "0.5601101", "0.5554141", "0.55281717", "0.5523155", "0.5505839", "0.5490727", "0.5476622", "0.5472777", "0.54602236", "0.5437866",...
0.78764915
0
This function is called when a new robot is to be deleted from the scene.
def delete_robot(self, robot): if len(self.__robots) == 0 or robot not in self.__robots: return robot_index = self.__robots.index(robot) # Clear the robot visuals self.__robots[robot_index].set_reference_visibility(False) self.__robots[robot_index].set_robot_visibil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __del_robot(self):\n if len(self.__robots) == 0:\n # Alert the user and return\n self.scene.append_to_caption(\n '<script type=\"text/javascript\">alert'\n '(\"No robot to delete\");</script>')\n return\n\n # Clear the robot visuals\n...
[ "0.76657116", "0.6653174", "0.62923485", "0.61894155", "0.6127705", "0.6042159", "0.5978297", "0.5964973", "0.59485656", "0.5880043", "0.58706224", "0.58536595", "0.58352643", "0.58352643", "0.5830409", "0.580608", "0.57957554", "0.57861567", "0.5745515", "0.5744185", "0.5713...
0.6874707
1
Checks whether the given robot is in the canvas
def is_robot_in_canvas(self, robot): return robot in self.__robots
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isOnCanvas(self, x, y):\n return 0 <= x < self.width and 0 <= y < self.height", "def _isInCamera(self, pos):\n return self._isInScreen(self._posToScreenCoords(pos))", "def check_in_screen(self):\n if self.rect.colliderect(screen_rect) and not self.moving:\n return True\n ...
[ "0.68882334", "0.6631653", "0.6426436", "0.63145614", "0.6275921", "0.62233526", "0.6173037", "0.6156534", "0.6094962", "0.6093316", "0.6090268", "0.60836077", "0.59432834", "0.5939587", "0.59386283", "0.59252256", "0.5924728", "0.5914386", "0.5901055", "0.589383", "0.5886157...
0.86865
0
Adds a button to the UI that toggles the UI mode
def __add_mode_button(self): btn_text = self.__toggle_button_text_dict.get( self.__ui_mode, "Unknown Mode Set") btn_text = "<span style='font-size:20px;'>" + btn_text + "</span>" btn_toggle = button(bind=self.__toggle_mode, text=btn_text) self.__ui_controls.btn_toggle = btn_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toggle(self):\n if bool(self.show.get()):\n self.sub_frame.pack(fill=\"x\", expand=1)\n self.toggle_button.configure(text='-')\n else:\n self.sub_frame.forget()\n self.toggle_button.configure(text='+')", "def toggle(self) -> None:\n ...", "de...
[ "0.68114895", "0.67256504", "0.6696958", "0.66871804", "0.66871804", "0.66863286", "0.66854876", "0.66345", "0.662208", "0.65575784", "0.6472867", "0.64301527", "0.6358187", "0.63281345", "0.623516", "0.6221111", "0.61330897", "0.6109674", "0.61041623", "0.6102995", "0.607713...
0.76841366
0
Remove a robot from the scene and the UI controls
def __del_robot(self): if len(self.__robots) == 0: # Alert the user and return self.scene.append_to_caption( '<script type="text/javascript">alert' '("No robot to delete");</script>') return # Clear the robot visuals self.__rob...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_scene(self):\n # Set all robots variables as invisible\n for robot in self.__robots:\n robot.set_reference_visibility(False)\n robot.set_robot_visibility(False)\n\n self.scene.waitfor(\"draw_complete\")\n\n new_list = []\n for name in self.__ui_con...
[ "0.7497505", "0.7254134", "0.70794034", "0.6838198", "0.6837848", "0.6697455", "0.6592775", "0.6457964", "0.6447312", "0.64358747", "0.64127225", "0.6410478", "0.6355047", "0.63444734", "0.63207054", "0.6307051", "0.6284181", "0.62454534", "0.62360775", "0.6214704", "0.621470...
0.7927757
0
Reload the UI with the new list of robot names
def __reload_caption(self, new_list): # Remove all UI elements for item in self.__ui_controls: if self.__ui_controls.get(item) is None: continue self.__ui_controls.get(item).delete() for item in self.__teachpanel_sliders: item.delete() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_reload_button_cicked_(self):\n self.pause_subscriber = True\n\n self._load_robot_description()\n controllers = self.get_current_controllers()\n\n self.joints = self._create_joints(controllers)\n\n self.synergy = self._create_synergy(controllers)\n\n self.delete_old_...
[ "0.625003", "0.60700357", "0.59651536", "0.59651536", "0.5886973", "0.5858853", "0.5842581", "0.58169675", "0.5801026", "0.5769075", "0.5766605", "0.5764891", "0.57345253", "0.5733229", "0.5730712", "0.5690706", "0.5667874", "0.5648969", "0.56404096", "0.5629161", "0.56128085...
0.61708254
1
Load the UI menu depending on the current mode
def __load_mode_ui(self, new_list): self.__add_mode_button() if self.__ui_mode == UImode.CANVASCONTROL: self.__setup_ui_controls(new_list) elif self.__ui_mode == UImode.TEACHPANEL: self.__setup_joint_sliders() else: self.scene.append_to_caption("UNKNOW...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setMenuMode(*args, **kwargs)->AnyStr:\n pass", "def mode_menu(self):\n menu = QtWidgets.QMenu()\n for mode in 'edit', 'view', 'split':\n act = QAction(mode.title(), self)\n\n def cb(checked, self=self, mode=mode):\n self.set_mode(mode)\n\n act....
[ "0.6743336", "0.6722501", "0.657809", "0.6534426", "0.65298307", "0.6415814", "0.6396097", "0.63824123", "0.6369821", "0.6356726", "0.6195557", "0.61819506", "0.61795926", "0.6177031", "0.61673325", "0.6135904", "0.6122496", "0.612054", "0.6056741", "0.6056095", "0.5989347", ...
0.7514776
0
Reset the camera to a default position and orientation
def __reset_camera(self): # Reset Camera self.scene.up = z_axis_vector self.scene.camera.pos = vector(10, 10, 10) self.scene.camera.axis = -self.scene.camera.pos # Update grid self.__graphics_grid.update_grid()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_camera(base):\n\tbase.camera.setPos(0, -4, 2)\n\tbase.camera.lookAt(0, 0, 1)", "def __reset_camera(self):\n # Reset Camera\n self.scene.camera.pos = vector(5, 5, 12) # Hover above (5, 5, 0)\n # Ever so slightly off focus, to ensure grid is rendered in the right\n # region\n...
[ "0.8195087", "0.77423704", "0.7145447", "0.7143691", "0.70689076", "0.70435846", "0.68307257", "0.6676145", "0.66623414", "0.66519225", "0.66415", "0.65649575", "0.65642416", "0.65255094", "0.64114535", "0.63914514", "0.63391054", "0.63302684", "0.632665", "0.63093376", "0.62...
0.78458524
1
When a menu item is chosen, update the relevant checkboxes/options
def __menu_item_chosen(self, m): # Get selected item self.__selected_robot = m.index # Update the checkboxes/sliders for the selected robot self.__ui_controls.get('chkbox_ref').checked = \ self.__robots[self.__selected_robot].ref_shown self.__ui_controls.get('chkbox...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def onItemChanged(item=None):\n if item:\n selector.blockSignals(True)\n if item.data(50) == \"Unchecked\":\n item.setCheckState(QtCore.Qt.CheckState(1))\n item.setData(50, \"Partially\")\n elif item.data(50) == \"Partially\":\n i...
[ "0.6222214", "0.6028687", "0.6003961", "0.5970665", "0.59504414", "0.5899114", "0.5850222", "0.5819152", "0.5797638", "0.5788271", "0.5779012", "0.5778623", "0.5747386", "0.573788", "0.5727352", "0.5686499", "0.5655022", "0.5648376", "0.5648376", "0.5644085", "0.5641594", "...
0.6735673
0
When a checkbox is changed for the reference frame option, update the graphics
def __reference_frame_checkbox(self, c): if len(self.__robots) > 0: self.__robots[self.__selected_robot].set_reference_visibility( c.checked)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change(self):\r\n\r\n # If checkboxes are available, check status and set boat speed reference line visibility accordingly.\r\n if self.cb:\r\n if self.cb_bt.checkState() == QtCore.Qt.Checked:\r\n for item in self.bt:\r\n item.set_visible(True)\r\n ...
[ "0.7227284", "0.6487598", "0.61740834", "0.616694", "0.602045", "0.5853284", "0.58474535", "0.584232", "0.57759", "0.5743919", "0.57322645", "0.57310146", "0.57310146", "0.57310134", "0.57218957", "0.56747526", "0.56743133", "0.5668101", "0.5663723", "0.56549454", "0.56195104...
0.6964501
1
When a checkbox is changed for the robot visibility, update the graphics
def __robot_visibility_checkbox(self, c): if len(self.__robots) > 0: self.__robots[self.__selected_robot].set_robot_visibility( c.checked)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change(self):\r\n\r\n # If checkboxes are available, check status and set boat speed reference line visibility accordingly.\r\n if self.cb:\r\n if self.cb_bt.checkState() == QtCore.Qt.Checked:\r\n for item in self.bt:\r\n item.set_visible(True)\r\n ...
[ "0.75882745", "0.6785632", "0.6315251", "0.62793726", "0.62793726", "0.6269725", "0.6264089", "0.6258231", "0.6189676", "0.6171755", "0.61623913", "0.6115437", "0.6074988", "0.6067028", "0.6053873", "0.6046459", "0.60182774", "0.59802586", "0.5975778", "0.59665847", "0.596194...
0.7353905
1
When a checkbox is changed for the grid visibility, update the graphics
def __grid_visibility_checkbox(self, c): self.grid_visibility(c.checked) self.__grid_visibility = c.checked
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change(self):\r\n\r\n # If checkboxes are available, check status and set boat speed reference line visibility accordingly.\r\n if self.cb:\r\n if self.cb_bt.checkState() == QtCore.Qt.Checked:\r\n for item in self.bt:\r\n item.set_visible(True)\r\n ...
[ "0.75040025", "0.69058573", "0.6828744", "0.66530764", "0.66530764", "0.64356697", "0.6314622", "0.62764555", "0.6235229", "0.6209224", "0.6169964", "0.6162502", "0.6134667", "0.61129284", "0.6089437", "0.60276186", "0.6021101", "0.6021101", "0.6021101", "0.6021101", "0.60211...
0.7443993
1
When a checkbox is changed for the camera lock, update the camera
def __camera_lock_checkbox(self, c): # Update parameters # True = locked self.__camera_lock = c.checked # True = enabled self.scene.userspin = not c.checked self.scene.userzoom = not c.checked
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cameraTB1Checked(self, state):\n if state == QtCore.Qt.Checked:\n print('Show Camera TB1 Selected')\n # release video capture\n self.cap = cv2.VideoCapture(0)\n # # read image in BGR format\n # ret, img = self.cap.read()\n # image = QtGui...
[ "0.66683006", "0.6224386", "0.60449547", "0.5935851", "0.5924883", "0.5905647", "0.5891225", "0.5883119", "0.58705497", "0.5866305", "0.58539414", "0.58307326", "0.57700306", "0.5741055", "0.5712702", "0.57089245", "0.56954664", "0.5678163", "0.56769186", "0.56524384", "0.564...
0.77414125
0
Update the opacity slider depending on the slider value
def __opacity_slider(self, s): if len(self.__robots) > 0: self.__robots[self.__selected_robot].set_transparency(s.value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ct_slider_value_changed(self):\n for (x, slider) in enumerate(self.sliders):\n # for x in range(0, len(self.sliders)):\n # slider = self.sliders[x]\n slider_value = float(slider.value()) / float(slider.maximum())\n # Use an square function for easier opacity adjus...
[ "0.8227108", "0.725043", "0.6778745", "0.6735348", "0.664751", "0.65674496", "0.63208723", "0.6293356", "0.6253469", "0.6171676", "0.6097005", "0.60420287", "0.59434915", "0.5904361", "0.5892542", "0.58869785", "0.5870938", "0.5855927", "0.5852442", "0.5834236", "0.57946247",...
0.7768824
1
Clear the scene of all objects, keeping the grid visible if set on
def clear_scene(self): # Save grid visibility restore = self.__grid_visibility # Set invis if restore: self.__graphics_grid.set_visibility(False) # Set all objects invis for obj in self.scene.objects: obj.visible = False # Restore grid (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_all(self):\n self.scene.clear()\n self.image.fill(Qt.color0)", "def clear_scene(self, event):\n self.shapes = []\n self.redraw()", "def clear_scene(self):\n # Set all robots variables as invisible\n for robot in self.__robots:\n robot.set_reference...
[ "0.78548795", "0.7749951", "0.7495516", "0.734869", "0.7339493", "0.7291171", "0.71484864", "0.7083649", "0.703834", "0.701891", "0.70093375", "0.6999681", "0.6910702", "0.68960553", "0.68751466", "0.6862746", "0.6800285", "0.6795455", "0.6775802", "0.6763939", "0.6678968", ...
0.8987051
0
Update the grid visibility in the scene
def grid_visibility(self, is_visible): self.__graphics_grid.set_visibility(is_visible)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def displayGrid(self, toggled):\n self.scene.setGridVisible(visible=toggled)", "def gridDisplay(self):\n\n if self.griddButton.isCheckable():\n self.photo_grid.setVisible(False)\n self.griddButton.setCheckable(False)\n self.griddButton.setDown(False)\n se...
[ "0.808445", "0.7337714", "0.71891654", "0.6623515", "0.66017085", "0.6523569", "0.64933866", "0.64256746", "0.6368317", "0.6368317", "0.62416834", "0.62404394", "0.6212442", "0.62035084", "0.62035084", "0.62035084", "0.62035084", "0.62035084", "0.62035084", "0.62035084", "0.6...
0.77747107
1
When a checkbox is changed for the camera lock, update the camera
def __camera_lock_checkbox(self, c): # Update parameters # True = locked self.__camera_lock = c.checked # True = enabled self.scene.userspin = not c.checked self.scene.userzoom = not c.checked
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cameraTB1Checked(self, state):\n if state == QtCore.Qt.Checked:\n print('Show Camera TB1 Selected')\n # release video capture\n self.cap = cv2.VideoCapture(0)\n # # read image in BGR format\n # ret, img = self.cap.read()\n # image = QtGui...
[ "0.66696256", "0.622465", "0.6046611", "0.5936965", "0.5924785", "0.5906641", "0.5891815", "0.5883454", "0.587103", "0.5866383", "0.5854208", "0.5831567", "0.5769574", "0.57413495", "0.5711933", "0.57092273", "0.5696426", "0.56800485", "0.56769913", "0.5653126", "0.5642524", ...
0.7741319
1
Set Serial/Lot number in pack operations to mark the pack operation done.
def set_so_pack_operation_lot(self, picking): StockProductionLot = self.env['stock.production.lot'] sale_line_obj = self.env['sale.order.line'] has_wrong_lots = False for del_move in picking.move_lines: del_move.move_line_ids.unlink() for move in picking.move_lines: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetToolPacking(self, packing):\r\n\r\n self._tool_packing = packing", "def action_done_from_ui(self, cr, uid, picking_id, context=None):\n # write qty_done into field product_qty for every package_operation before doing the transfer\n pack_op_obj = self.pool.get('stock.pack.operation')\n...
[ "0.56984675", "0.54412544", "0.54163635", "0.5311041", "0.526487", "0.50970215", "0.50609833", "0.5050278", "0.5015765", "0.500128", "0.49930054", "0.49830386", "0.49590728", "0.49529406", "0.4943841", "0.49404514", "0.490726", "0.4901238", "0.48982102", "0.48681688", "0.4862...
0.6007929
0
check java script log for errors (only `severe` level)
def check_js_log(self): js_log = self.get_log("browser") clean_log = [] total_chars = 0 idx = 0 for entry in js_log: if entry['level'] in ['SEVERE']: idx += 1 clean_log.append(entry) total_chars += len(entry['message']) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def js_has_errors(self):\n # TODO: not finished.\n log = self.driver.get_log('browser')\n for record in log:\n return record.level == 'SEVERE'", "def log_error(e):\n\tprint(e)", "def log_error(e):\n\tprint(e)", "def check_log():\r\n errors = 0\r\n warnings = 0\r\n log...
[ "0.7115686", "0.6247167", "0.6247167", "0.62320936", "0.6193636", "0.6193636", "0.6147998", "0.61424726", "0.6129736", "0.612062", "0.6068972", "0.6057604", "0.6040735", "0.6011453", "0.6011453", "0.6011453", "0.6011453", "0.6011453", "0.6011453", "0.6011453", "0.6011453", ...
0.7508653
0
Create an exception, using the string msg as message
def create_exception(self, msg: str):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def e(msg):\n raise Exception(repr(msg))", "def error(msg):\n\n raise Exception(msg)", "def error(msg, ex=None):\n log_error(msg, ex)\n if ex == None:\n exMsg = \"\"\n else:\n exMsg = \" \\n \" + repr(ex)\n if ex == None:\n raise Exception(exMsg)\n else:\n raise ex...
[ "0.71244764", "0.69564986", "0.67445487", "0.6655278", "0.6311514", "0.62211716", "0.6186573", "0.60674125", "0.59696764", "0.593748", "0.5936748", "0.59077483", "0.58942074", "0.588474", "0.58822185", "0.5878411", "0.5807873", "0.58052266", "0.5796369", "0.5747108", "0.56993...
0.8589633
0
Save a contour plot to a file for pgfplots Additional arguments are passed to iter_segements Important, simplify = True will remove invisible points
def save_contour(fname, cs, fmt = 'matlab', simplify = 1e-3, **kwargs): def write_path_matlab(fout, x_vec, y_vec, z): # Now dump this data back out # Header is level followed by number of rows fout.write('%15.15e\t%15d\n' % (z, len(x_vec))) for x, y in zip(x_vec, y_vec): fout.write("%15.15e\t%15.15e\n" % (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_to(self, filename):\n ncontour = self.get_contours_number\n npoints = self.get_points_number\n\n with open(filename, 'w') as f:\n f.write(str(ncontour) + '\\n')\n for i in range(0, ncontour):\n\n logger.debug(\"Sub-contour no. {0} has {1} points\"...
[ "0.6354949", "0.6249677", "0.6207637", "0.6075146", "0.5811788", "0.5785731", "0.5737707", "0.5712283", "0.5652205", "0.5651755", "0.5619929", "0.5619606", "0.56019557", "0.55962414", "0.5584492", "0.55695915", "0.55578434", "0.5557257", "0.555077", "0.5530777", "0.5514309", ...
0.6978715
0
Fill NaN with zero.
def fill_zero(df): df = df.fillna(0) return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fill_with_neg_inf(t):\r\n return t.float().fill_(float(\"-inf\")).type_as(t)", "def convert_fill_zeros_like(g, op, block):\n\n x = g.get_node(op.input(\"X\")[0])\n dtype = op.attr(\"dtype\")\n dtype = _convert_dtype_value(dtype)\n value = _expr.const(0, dtype=dtype)\n out = _op.transform.fu...
[ "0.69296664", "0.68928945", "0.6783993", "0.6768336", "0.673804", "0.66560954", "0.6619058", "0.6479309", "0.6471661", "0.638369", "0.6302883", "0.6270129", "0.62374", "0.6225682", "0.6204576", "0.619489", "0.61801636", "0.61632276", "0.6141827", "0.60993683", "0.6081503", ...
0.78565556
0
Fill NaN with previous values.
def fill_forward(df): df = df.fillna(method='ffill') df = df.fillna(method='bfill').fillna(0) return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ffill_nans(df):\n return df.fillna(method='ffill', axis=0)", "def fill_nan(A):\n\tinds = np.arange(A.shape[0])\n\tgood = np.where(np.isfinite(A))\n\tA[np.isnan(A)] = np.interp(inds[np.isnan(A)], inds[good], A[good])\n\treturn A", "def fillna(\n self,\n value=None,\n meth...
[ "0.74325144", "0.72073084", "0.6924598", "0.6811489", "0.6752172", "0.6750189", "0.6748046", "0.6673897", "0.66647804", "0.66059715", "0.65565443", "0.6540866", "0.6376292", "0.6331262", "0.63224936", "0.6284117", "0.6249076", "0.62287915", "0.6224946", "0.61513656", "0.61431...
0.7278524
1