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
`check_for_fit` wraps a method that validates if `self._is_fitted` is `True`. It raises an exception if `False` and calls and returns the wrapped method if `True`.
def check_for_fit(cls, method): @wraps(method) def _check_for_fit(self, X=None, y=None): klass = type(self).__name__ if not self._is_fitted and self.needs_fitting: raise ComponentNotYetFittedError( f"This {klass} is not fitted yet. You must fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_for_fit(cls, method):\n\n @wraps(method)\n def _check_for_fit(self, *args, **kwargs):\n klass = type(self).__name__\n if not self._is_fitted:\n raise PipelineNotYetFittedError(\n f\"This {klass} is not fitted yet. You must fit {klass} ...
[ "0.768455", "0.6352288", "0.62810916", "0.60455644", "0.60128045", "0.5980315", "0.59594214", "0.5826365", "0.5740475", "0.56470776", "0.5631925", "0.56311876", "0.5618889", "0.5577201", "0.55751395", "0.5490103", "0.54883724", "0.53121126", "0.52988595", "0.5286061", "0.5270...
0.7850691
0
Obtains max statelevel fuel price
def get_max_fp(state_abbr, fuel_type="NG", year=False): if(not year): year = UpdateParams.today.year if fuel_type.upper() == "NG": series_ID = "NG.N3035" + state_abbr + "3.A" elif fuel_type.upper() == "COAL": series_ID = "COAL.COST." + state_abbr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state_max(self) -> float:\n raise NotImplementedError", "def max_price(self):\n return self._max_price", "def get_greatest_stock_price():\n greatest_stock_price = 0\n // your code here", "def __find_max_price(self):\n prices_map = map(\n lambda iceberg: utils.get_act...
[ "0.7232872", "0.71579266", "0.695551", "0.68795824", "0.6802058", "0.66905564", "0.64502335", "0.6434176", "0.6378356", "0.63419753", "0.63411105", "0.6247193", "0.62242603", "0.622073", "0.62158287", "0.6194649", "0.6172671", "0.61604536", "0.6157182", "0.61291057", "0.61053...
0.7498042
0
Grabs fuel esc from EERC
def get_esc(state_abbr, fuel_type="NG"): temp_dict = {"NG": "Natural Gas", "COAL" : "Coal", "PETRO": "Residual"} return UpdateParams.eerc_esc.loc[state_abbr, temp_dict[fuel_type]]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_energy(self, zpe_scale_factor=1.):\n e_elect = None\n with open(self.path, 'r') as f:\n for line in f:\n if 'FINAL SINGLE POINT ENERGY' in line: # for all methods in Orca\n e_elect = float(line.split()[-1])\n if e_elect is None:\n ...
[ "0.614474", "0.61137724", "0.61131305", "0.58843523", "0.5829121", "0.576634", "0.5709528", "0.5694991", "0.5688178", "0.564943", "0.56155294", "0.5608964", "0.55574423", "0.554091", "0.55266964", "0.55205625", "0.5486249", "0.54649156", "0.53992087", "0.53921926", "0.5388455...
0.6570786
0
return date of next car, according to given schedule. Schedule is considered as a list of Horaire objects, that represent when a car (or tram) arrives to a stop. travel_time input must be a Horaire object. Returned value is the index of next car in schedule. (so, access to schedule[returned_value] give the Horaire obje...
def next_car(schedule, travel_time): #travel_time = datetime.datetime.strptime(datetime.datetime.strptime(travel_time, '%Y-%m-%d %H:%M:%S').strftime('%H:%M:%S'), '%H:%M:%S') next_time = None for index, time in enumerate(schedule): if time.is_after(travel_time): next_time = index ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_next(self,day,link,current_time,route): \n if day not in self.data:\n print('missing day')\n return None\n if link not in self.data[day]:\n print([l for l in self.data[day]])\n print('missing link')\n return None\n if route ...
[ "0.56140107", "0.5598898", "0.5507337", "0.5356615", "0.5313905", "0.5231977", "0.5178537", "0.51480544", "0.5140548", "0.5081775", "0.49440774", "0.4889892", "0.48250175", "0.47803727", "0.4715545", "0.47006294", "0.463806", "0.46155107", "0.4605269", "0.46029308", "0.458380...
0.80938816
0
return the dir url
def get_dirurl(self, dirpath): paths = dirpath.split("/") return "/".join(paths[paths.index("static"):])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Directory(self) -> str:", "def _get_dir_url(endpoint, path, **kwargs):\n if not path:\n return url_for(endpoint)\n else:\n #if self._on_windows:\n # path = path.replace('\\\\', '/')\n\n kwargs['path'] = path\n\n return url_for(endpoint, **kwargs)", "def dir(self)...
[ "0.7273775", "0.7153738", "0.6965254", "0.6904788", "0.68993217", "0.6853848", "0.6754187", "0.6738337", "0.6738171", "0.6716691", "0.6685926", "0.6655906", "0.66186196", "0.65818834", "0.6554798", "0.65474826", "0.6482278", "0.64310545", "0.64290816", "0.64277285", "0.641262...
0.7773397
0
filter to return font files only
def filter_fontfiles(self, filenames, d=dict()): for f in filenames: n, ext = os.path.splitext(f) # skip for the files that are not supported if not ext in SUPPORTED_FONTS: continue d[n] = d[n] + [ext] if d.get(n) else [ext] return d
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _GetFontFiles(path):\n return [f for f in listdir(path)\n if os.path.splitext(f)[1] in ('.ttf', '.otf')]", "def load_all_fonts(directory, accept=(\".ttf\",)):\n return load_all_music(directory, accept)", "def load_all_fonts(directory, accept=(\".ttf\",)):\n return load_all_music(directory, ...
[ "0.73781276", "0.6627336", "0.6627336", "0.6314944", "0.62431806", "0.6171882", "0.610995", "0.6020973", "0.59870565", "0.5923361", "0.5881843", "0.58167106", "0.5775011", "0.5754809", "0.57511044", "0.57511044", "0.57372826", "0.57291114", "0.5669524", "0.56519204", "0.56480...
0.70424294
1
Tests the home page.
def test_home(self): response = self.client.get('/') self.assertContains(response, 'Home Page', 1, 200)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_home(self):\n\t\tresponse = self.client.get('/')\n\t\tself.assertContains(response, 'Home Page', 1, 200)", "def test_home_page(self):\r\n url = reverse('home')\r\n response = self.client.get(url)\r\n\r\n self.assertEqual(response.status_code, 200)", "def test_home_page(self):\n\n ...
[ "0.86721593", "0.83283335", "0.8285781", "0.82591826", "0.82452273", "0.82392025", "0.82392025", "0.8199806", "0.8114395", "0.8091571", "0.8031986", "0.7946267", "0.79409236", "0.79266375", "0.7866116", "0.7856337", "0.7807612", "0.7719456", "0.7685034", "0.7626273", "0.75936...
0.85700876
1
Return callback for LoadLibraryA
def LoadLibraryA_rtn_handler(exec_ctx): logging.info("kernel32.dll.LoadLibraryA returned 0x%08x" % \ exec_ctx.regs.EAX) # TODO: check / update list of hooks also pybox.MODULES.update() return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_library():\n # return the handle to the shared object\n if os.name == \"nt\":\n pass\n # libc = load_windows_dll()\n else:\n libc = load_linux_so()\n return libc", "def _load_libs():\n if sys.platform == \"darwin\":\n lib_name = \"libtiledbvcf.dylib\"\n ...
[ "0.5989056", "0.5868301", "0.57031065", "0.5582317", "0.5524115", "0.5515501", "0.55016947", "0.5461312", "0.5367845", "0.5367845", "0.53560525", "0.53560525", "0.5341005", "0.53404593", "0.53178525", "0.5310855", "0.530366", "0.52396536", "0.5220809", "0.52202785", "0.519940...
0.7665019
0
Search for the provided account address in KV 'History of Accounts' table.
def kv_seek_account_history(account_address: str, block_number: int, target: str = DEFAULT_TARGET): account_history_key = kv_metadata.encode_account_history_key(account_address, block_number) print('REQ1 account_address:', account_address, '(key: ' + str(account_history_key.hex()) + ')') print('RSP1 accou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_by_address(self, address):\n assert len(address) == 20\n accounts = [account for account in self.accounts if account.address == address]\n if len(accounts) == 0:\n raise KeyError('account with address {} not found'.format(encode_hex(address)))\n elif len(accounts) > 1...
[ "0.6519464", "0.6338236", "0.6017004", "0.5988657", "0.5958928", "0.59446615", "0.58395207", "0.5836881", "0.5755204", "0.5747608", "0.56816727", "0.56154644", "0.56109655", "0.55488646", "0.55431986", "0.55253816", "0.55104375", "0.550851", "0.5498978", "0.5483937", "0.54425...
0.63830864
1
Checks if "console.getData()" JS command returns some error. If so, the test will fail.
def _checkJSErrors(self): js_error = False console_data = [] try: console_data = self.driver.execute_script("return console.getData()") except: pass if console_data: for item in console_data: if item["type"] == "error": ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_data(clear, data):\r\n cmd = ShdlcCmdGetErrorState(clear=clear)\r\n assert type(cmd.data) is bytes\r\n assert cmd.data == data", "def test_get_data_fail(self):\n self.assertIsNone(get_data('this_must_fail', 5, 0))", "def test_command(self):\n out = io.StringIO()\n managem...
[ "0.65767086", "0.63340867", "0.6225417", "0.6032751", "0.6028203", "0.59820247", "0.58227086", "0.57617176", "0.57090616", "0.5661298", "0.56505835", "0.5646934", "0.5640983", "0.5589693", "0.5580483", "0.55710274", "0.5570266", "0.5546296", "0.55458724", "0.5529029", "0.5522...
0.63554543
1
Some special settings for IE to make the browser more stable.
def _finetuneIE(self): # start IE in private mode to prevent storing cookies self._browser_capabilities["ie.forceCreateProcessApi"] = 1 self._browser_capabilities["ie.browserCommandLineSwitches"] = "-private" # seems not reliable. More testing needed. #self._browser_capabilitie...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def internet_explorer():\n driver = Driver()\n driver.browser = 'ie'\n return IE(driver)", "def test_msieParser(self):\n agent = UserAgent.fromHeaderValue(\n 'Mozilla/4.0 (compatible; MSIE 4.5; Windows 98; Win 9x 4.8410008)')\n self.assertEqual(agent.browser, browsers.INTERNET_E...
[ "0.6183956", "0.58615327", "0.5657646", "0.5383154", "0.5360376", "0.53398156", "0.5253256", "0.51662785", "0.51662785", "0.51662785", "0.51662785", "0.51662785", "0.51662785", "0.51662785", "0.51662785", "0.51662785", "0.51662785", "0.51662785", "0.51662785", "0.51662785", "...
0.6713149
0
Creates indices for a mini_batch, given an iteration state and number of data points in a batch.
def BatchCreator(self, j, n_batch): j_start = (j-1)*n_batch + 1 j_end = j*n_batch + 1 ind = np.arange(start= j_start, stop=j_end, step=1) return ind
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_batch_indices(batch_size: int, beam_size: int) ->torch.LongTensor:\n batch_pos = torch.arange(batch_size)\n batch_pos = batch_pos.view(-1, 1).expand(batch_size, beam_size)\n return batch_pos", "def batch_indices(self):\n b = self.batch_size\n return [np.arange(i*b, i*b+b) for i...
[ "0.6666846", "0.65015984", "0.636911", "0.61453336", "0.6103114", "0.6084373", "0.60636634", "0.5974345", "0.591578", "0.5906937", "0.58807844", "0.58341247", "0.5826688", "0.58113354", "0.5802759", "0.5725827", "0.57240266", "0.5720992", "0.56954914", "0.567487", "0.5674246"...
0.67924124
0
Returns the version of the userandjobstate service.
def ver(self, context=None): return self._client.call_method( 'UserAndJobState.ver', [], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_version(self):\n return self.http_call(\"get\", url=f\"{self.base_url}/version\").json()", "def get_version(self):\n\n r = self._create_operation_request(self, method=\"GET\")\n root_info = send_session_request(self._session, r).json()\n return root_info[\"currentVersion\"]", ...
[ "0.6818767", "0.6731788", "0.67285407", "0.66809475", "0.66694766", "0.6649794", "0.6561813", "0.65589726", "0.6523883", "0.6504586", "0.6461285", "0.6447625", "0.64336187", "0.64096856", "0.63993865", "0.63934135", "0.6366004", "0.6366004", "0.6359067", "0.6342099", "0.63420...
0.7967833
0
Set the state of a key for a service without service authentication.
def set_state(self, service, key, value, context=None): return self._client.call_method( 'UserAndJobState.set_state', [service, key, value], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def set_appservice_state(\n self, service: ApplicationService, state: ApplicationServiceState\n ) -> None:\n await self.db_pool.simple_upsert(\n \"application_services_state\", {\"as_id\": service.id}, {\"state\": state.value}\n )", "def set_key(self, key):\n self....
[ "0.6455193", "0.6354306", "0.6153753", "0.5945854", "0.59108603", "0.59108603", "0.59096426", "0.59096426", "0.58875173", "0.5881037", "0.5849215", "0.58078116", "0.58078116", "0.5740302", "0.5738482", "0.5725617", "0.57177335", "0.5695139", "0.5683244", "0.5679103", "0.56657...
0.7107616
0
Set the state of a key for a service with service authentication.
def set_state_auth(self, token, key, value, context=None): return self._client.call_method( 'UserAndJobState.set_state_auth', [token, key, value], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_state(self, service, key, value, context=None):\n return self._client.call_method(\n 'UserAndJobState.set_state',\n [service, key, value], self._service_ver, context)", "async def set_appservice_state(\n self, service: ApplicationService, state: ApplicationServiceState...
[ "0.74339426", "0.65713215", "0.63565004", "0.60883474", "0.59891087", "0.59891087", "0.59362435", "0.59221303", "0.591146", "0.59027886", "0.5892569", "0.58422506", "0.5821213", "0.58127016", "0.58119357", "0.58119357", "0.5793126", "0.5768279", "0.5768279", "0.5765366", "0.5...
0.69348943
1
Create a new job status report. create_job2
def create_job(self, context=None): return self._client.call_method( 'UserAndJobState.create_job', [], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_job2(self, params, context=None):\n return self._client.call_method(\n 'UserAndJobState.create_job2',\n [params], self._service_ver, context)", "def create_report(self, report_job: dict):\n try:\n # Run the report and wait for it to finish\n re...
[ "0.64179003", "0.6149524", "0.61436284", "0.60143", "0.59219", "0.59107804", "0.58727473", "0.5780395", "0.5730901", "0.5729058", "0.5695275", "0.5693628", "0.5683138", "0.56777763", "0.5668688", "0.56442016", "0.5640068", "0.5640025", "0.5622313", "0.55997634", "0.55959255",...
0.6266893
1
Update the status and progress for a job.
def update_job_progress(self, job, token, status, prog, est_complete, context=None): return self._client.call_method( 'UserAndJobState.update_job_progress', [job, token, status, prog, est_complete], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self) -> None:\n self.previous_status = self.status\n\n jobs = self._client.describe_jobs(jobs = [ self.id ])[\"jobs\"]\n\n try:\n self.state = jobs[0]\n except IndexError:\n raise ValueError(\"Invalid or unknown job id %s\" % self.id) from None", "def...
[ "0.7460748", "0.7383144", "0.7383144", "0.7323013", "0.7220424", "0.71709543", "0.7023524", "0.69934624", "0.69273424", "0.6905885", "0.6831107", "0.6815869", "0.6808671", "0.6808671", "0.6808671", "0.6808671", "0.67737204", "0.6665827", "0.6663416", "0.66358966", "0.66191095...
0.7565707
0
Get the description of a job.
def get_job_description(self, job, context=None): return self._client.call_method( 'UserAndJobState.get_job_description', [job], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def describe_job(self):\n # GET /jobs/{job_id}\n pass", "def describe_text_translation_job(JobId=None):\n pass", "def get_job(self) -> Dict[Text, Text]:\n request = self._client.projects().jobs().get(name=self._job_name)\n return request.execute()", "def describe_labeling_job(LabelingJ...
[ "0.7607637", "0.7192499", "0.67830104", "0.6780596", "0.6714741", "0.6707569", "0.6679356", "0.66656226", "0.66656226", "0.66567254", "0.66285944", "0.65982926", "0.65800416", "0.65800416", "0.65800416", "0.65800416", "0.65800416", "0.65800416", "0.65800416", "0.65800416", "0...
0.83598095
0
Get the status of a job.
def get_job_status(self, job, context=None): return self._client.call_method( 'UserAndJobState.get_job_status', [job], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_status(self):\n\t\treturn call_sdk_function('PrlJob_GetStatus', self.handle)", "def job_status(self, job_id):\n\n response = self.batch_client.describe_jobs(jobs=[job_id])\n return response[\"jobs\"][0][\"status\"]", "def get_status(self, job_id):\n\n result = self.redis.get('job_s...
[ "0.8510526", "0.83282834", "0.82505345", "0.8214032", "0.81855243", "0.81431603", "0.7931362", "0.7918316", "0.79022324", "0.7844217", "0.77791566", "0.77310485", "0.767955", "0.76423264", "0.76233286", "0.75556815", "0.7536898", "0.7514438", "0.74993336", "0.74988097", "0.74...
0.83676547
1
List jobs. Leave 'services' empty or null to list jobs from all services. list_jobs2
def list_jobs(self, services, filter, context=None): return self._client.call_method( 'UserAndJobState.list_jobs', [services, filter], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_job_services(self, context=None):\n return self._client.call_method(\n 'UserAndJobState.list_job_services',\n [], self._service_ver, context)", "def get_jobs_list(self, response):\n pass", "def list(self):\n return self.rpc.call(MsfRpcMethod.JobList)", "def...
[ "0.7235027", "0.70179933", "0.67329496", "0.6717925", "0.66287684", "0.65007955", "0.6481365", "0.6462476", "0.64445263", "0.64408475", "0.64227414", "0.64020425", "0.64020425", "0.63735825", "0.6372562", "0.6354887", "0.6321302", "0.6251158", "0.6241478", "0.6236662", "0.621...
0.72507447
0
List all job services. Note that only services with jobs owned by the user or shared with the user via the default auth strategy will be listed.
def list_job_services(self, context=None): return self._client.call_method( 'UserAndJobState.list_job_services', [], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list(self):\n\n for job_name in self.upstart.get_all_jobs():\n yield self.get_service(job_name)", "def list_services(ctx):\n pass", "def list_service(request):\n builder = http.ResponseBuilder()\n master_addr = request.GET.get('master',None)\n if not master_addr:\n retu...
[ "0.7430709", "0.71067923", "0.6972616", "0.6830034", "0.67643577", "0.6763751", "0.6646712", "0.66330963", "0.64929277", "0.64823115", "0.64704317", "0.6468045", "0.6444789", "0.63784015", "0.63213545", "0.6298812", "0.62907916", "0.6273339", "0.62273616", "0.6216419", "0.621...
0.8118722
0
Share a job. Sharing a job to the same user twice or with the job owner has no effect. Attempting to share a job not using the default auth strategy will fail.
def share_job(self, job, users, context=None): return self._client.call_method( 'UserAndJobState.share_job', [job, users], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_job(self, job_id):\n ujs = self.__ujs_client()\n ujs.share_job(job_id, [self.nar_user])", "def share(job):\n client = get_dropbox_client()\n\n try:\n return client.share(\n '/Video Automation Platform/jobs/{job}/{job}.mov'.format(job=job))\n\n except ErrorRes...
[ "0.6442974", "0.6359261", "0.5961956", "0.5836367", "0.5836367", "0.5754939", "0.5666393", "0.5660614", "0.5620277", "0.56136906", "0.55980754", "0.55236447", "0.5424858", "0.5424858", "0.5423828", "0.5413373", "0.5408935", "0.53822124", "0.5368407", "0.53632206", "0.5328321"...
0.76312286
0
Stop sharing a job. Removing sharing from a user that the job is not shared with or the job owner has no effect. Attemping to unshare a job not using the default auth strategy will fail.
def unshare_job(self, job, users, context=None): return self._client.call_method( 'UserAndJobState.unshare_job', [job, users], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unregister_job(self, job_id):\n ujs = self.__ujs_client()\n ujs.unshare_job(job_id, [self.nar_user])", "def stopSharingNote(self, authenticationToken, guid):\r\n pass", "def stopSharingNote(self, authenticationToken, guid):\r\n self.send_stopSharingNote(authenticationToken, guid)\r\n ...
[ "0.68657285", "0.6582266", "0.61853975", "0.6103804", "0.59372395", "0.5798973", "0.57962316", "0.5777436", "0.57301474", "0.5667062", "0.5658682", "0.56567", "0.56214386", "0.5581508", "0.5578251", "0.552801", "0.5428903", "0.5402245", "0.5379686", "0.5358543", "0.53576696",...
0.7299188
0
Get the owner of a job.
def get_job_owner(self, job, context=None): return self._client.call_method( 'UserAndJobState.get_job_owner', [job], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def owner(self) -> None:\n return self.bot.get_user(self.bot.config.owner_ids[0])", "def get_owner(self):\n return self.__owner", "def get_owner(self, obj):\n return obj.user.username", "def owner(self):\n answer = self._call('owner')\n return answer.owner", "def get_owne...
[ "0.7093864", "0.705176", "0.6957282", "0.69351876", "0.692269", "0.6863196", "0.68565017", "0.68523395", "0.68463093", "0.68463093", "0.682809", "0.680491", "0.67452174", "0.67452174", "0.671068", "0.669592", "0.6671211", "0.666671", "0.666671", "0.6664125", "0.6561198", "0...
0.8874359
0
Delete a job. Will fail if the job is not complete. Only the job owner can delete a job.
def delete_job(self, job, context=None): return self._client.call_method( 'UserAndJobState.delete_job', [job], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_job(self, job):\n subprocess.call(self.cli + [PlatformJenkinsJavaCLI.DELETE_JOB, job.name])", "def DeleteJob(self, job_urn, token=None):\n aff4.FACTORY.Delete(job_urn, token=token)", "def delete(\n address: Optional[str],\n job_id: str,\n headers: Optional[str],\n verify: Union...
[ "0.7845254", "0.78164786", "0.77987504", "0.77536505", "0.7749422", "0.7680496", "0.76609457", "0.7616329", "0.7511488", "0.7430227", "0.7350586", "0.72614837", "0.7252624", "0.7240872", "0.71866345", "0.71839607", "0.7164222", "0.71450466", "0.70545286", "0.6984639", "0.6868...
0.78505033
0
Force delete a job will succeed unless the job has not been started. In that case, the service must start the job and then delete it, since a job is not "owned" by any service until it is started. Only the job owner can delete a job.
def force_delete_job(self, token, job, context=None): return self._client.call_method( 'UserAndJobState.force_delete_job', [token, job], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _delete_job(self, job):", "def _delete_job(self, job):\n with self.db_lock:\n return self.rcon.zrem(job)", "def delete_job(self, job):\n subprocess.call(self.cli + [PlatformJenkinsJavaCLI.DELETE_JOB, job.name])", "def DeleteJob(self, job_urn, token=None):\n aff4.FACTORY.Delete...
[ "0.74902743", "0.67161715", "0.6704146", "0.6626484", "0.6573256", "0.6544934", "0.6502887", "0.6476197", "0.6469996", "0.64464337", "0.64464337", "0.6444198", "0.642586", "0.6412675", "0.6338228", "0.63190943", "0.6295222", "0.6279184", "0.60903525", "0.602891", "0.6018014",...
0.77460086
0
Returns a UserConfig object from an environment variable.
def load_from_env_var(cls, env_var): return cls.load_from_filename(os.environ.get(env_var))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_env():\n app_env = os.getenv(\"APP_ENV\", \"TEST\")\n return ConfigurationFactory.get_config(app_env)", "def config(env=DEFAULT_ENV, default=None, engine=None):\r\n\r\n config = {}\r\n\r\n s = os.environ.get(env, default)\r\n\r\n if s:\r\n config = parse(s, engine)\r\n\r\n ...
[ "0.6596632", "0.6080266", "0.60578686", "0.60304", "0.5918862", "0.58581537", "0.58541805", "0.57985073", "0.5791923", "0.5786983", "0.5778541", "0.56761557", "0.56284994", "0.562235", "0.56174785", "0.5572147", "0.55627424", "0.5561496", "0.55554324", "0.5537923", "0.5531441...
0.62398374
1
Parse some extra information out of the bibtex database so that we can include it in the webpage.
def extra_bibparse(db): for key,entry in db.entries.items(): for auth in entry.persons["author"]: if ("Harrison" not in auth.first_names or "Chapman" not in auth.last_names): entry.add_person(auth, "otherauthor")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _extract_core_biblio(self, bib):\n try:\n pubnumber = bib_scalar(bib, 'pubnumber')\n pubdate = datetime.strptime(bib_scalar(bib, 'pubdate'), '%Y%m%d')\n fam_raw = bib_scalar(bib, 'family_id')\n family_id = int(fam_raw) if fam_raw != None else fam_raw\n ...
[ "0.6140276", "0.6118735", "0.59877324", "0.5980667", "0.58826834", "0.5873166", "0.5846001", "0.58183736", "0.5650632", "0.56477314", "0.5636212", "0.5559242", "0.5546218", "0.54933405", "0.54741406", "0.5439656", "0.54392403", "0.54090035", "0.53947794", "0.53875345", "0.537...
0.661685
0
calculate sane rectangular coordinates inside the axis limits
def sane_rect_coord(ax, xperc=[0.1, 0.4], yperc=[0.1, 0.9]): xlim = ax.get_xlim() ylim = ax.get_ylim() xdist = xlim[1] - xlim[0] ydist = ylim[1] - ylim[0] xs = [xlim[0] + xperc[0] * xdist, xlim[0] + xperc[0] * xdist, xlim[0] + xperc[1] * xdist, xlim[0] + xperc[1] * xdist] ys = [ylim[0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def internal_bounds(self) -> tuple[float, float, float, float]:\n xres, yres = self.res\n w, s, e, n = self.bounds\n y0, y1 = (n, s) if yres < 0 else (s, n)\n x0, x1 = (e, w) if xres < 0 else (w, e)\n return x0, y0, x1, y1", "def check_extent(self):\n if self.lower_left....
[ "0.6719406", "0.6697193", "0.6582746", "0.65794367", "0.65285176", "0.6497397", "0.6487475", "0.6420139", "0.64024025", "0.6376628", "0.63295823", "0.6329149", "0.63160974", "0.63096553", "0.6262491", "0.62613326", "0.62605053", "0.62529624", "0.6250592", "0.6241038", "0.6239...
0.68368167
0
Returns string rep of directions (capital X is pos x, lowercase x is neg x)
def __str__(self): prev_directions = "" if self.prev_step: prev_directions = str(self.prev_step) + ' ' direction = '?' for scale, name in zip(self.direction, 'xyz'): if scale == 0: continue if scale == 1: direction = name.upper() else: direction = name ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n direction_symbol = constants._direction_number_to_direction_symbol[\n mathtools.sign(self.number)]\n return '{}{}'.format(direction_symbol, abs(self.number))", "def get_directions():\n return [(1, 0), (0, 1), (-1, 0), (0, -1)]", "def get_direction_letters(d):\n ...
[ "0.66820127", "0.6573184", "0.6548901", "0.64026684", "0.61723566", "0.6157513", "0.6071772", "0.60612214", "0.593492", "0.59305704", "0.5926606", "0.5891758", "0.58892643", "0.58686227", "0.58390796", "0.58159703", "0.5814856", "0.5676596", "0.5657164", "0.5651279", "0.56476...
0.71011275
0
create and save species dict for convenience
def create_species_encode(): data = pd.read_csv("../train.csv") species = sorted(data.species.unique()) species_dict = {species: index for index, species in enumerate(species)} return species_dict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_dict(self):\n species_dict = dict()\n species_dict['force_field'] = self.force_field\n species_dict['is_ts'] = self.is_ts\n if self.e_elect is not None:\n species_dict['e_elect'] = self.e_elect\n if self.e0 is not None:\n species_dict['e0'] = self.e0\...
[ "0.71935356", "0.61733454", "0.59725386", "0.59544873", "0.5883405", "0.5852764", "0.57449347", "0.5722406", "0.56899935", "0.5646143", "0.5622566", "0.56088024", "0.5546671", "0.5531829", "0.55188143", "0.5500924", "0.54891515", "0.54876214", "0.54754686", "0.5445157", "0.54...
0.675943
1
Export samplesheets for Bioanalyzer machine.
def export_bioanalyzer(args): clarity_epp.export.bioanalyzer.samplesheet(lims, args.process_id, args.output_file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_generate_sample_sheet(self):\n pass", "def export_tapestation(args):\n clarity_epp.export.tapestation.samplesheet(lims, args.process_id, args.output_file)", "def start_output(self):\r\n self.create_output_file()\r\n\r\n for elem in range(len(self.output_zakladki)):\r\n ...
[ "0.65062565", "0.63379425", "0.60326344", "0.60011256", "0.5988671", "0.59117097", "0.5885265", "0.5811275", "0.5783409", "0.5748259", "0.56417507", "0.56232613", "0.5588807", "0.55753165", "0.5526767", "0.5514415", "0.5438754", "0.5429626", "0.54096013", "0.53891826", "0.537...
0.7096843
0
Export samplesheets for caliper machine.
def export_caliper(args): if args.type == 'normalise': clarity_epp.export.caliper.samplesheet_normalise(lims, args.process_id, args.output_file) elif args.type == 'dilute': clarity_epp.export.caliper.samplesheet_dilute(lims, args.process_id, args.output_file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_generate_sample_sheet(self):\n pass", "def export_tapestation(args):\n clarity_epp.export.tapestation.samplesheet(lims, args.process_id, args.output_file)", "def test_export_spreadsheet(self):\r\n client = self.getClient()\r\n if client:\r\n exp = [['#SampleID', 'DOB...
[ "0.6811611", "0.6408173", "0.62680244", "0.59886086", "0.57728636", "0.5712114", "0.56356823", "0.5596462", "0.55854857", "0.55714446", "0.5538315", "0.5358879", "0.5353194", "0.5345031", "0.5332525", "0.53291404", "0.5324864", "0.5318297", "0.53180987", "0.5310183", "0.53096...
0.6603783
1
Export samplesheets for hamilton machine.
def export_hamilton(args): if args.type == 'filling_out': clarity_epp.export.hamilton.samplesheet_filling_out(lims, args.process_id, args.output_file) elif args.type == 'purify': clarity_epp.export.hamilton.samplesheet_purify(lims, args.process_id, args.output_file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_tapestation(args):\n clarity_epp.export.tapestation.samplesheet(lims, args.process_id, args.output_file)", "def test_generate_sample_sheet(self):\n pass", "def start_output(self):\r\n self.create_output_file()\r\n\r\n for elem in range(len(self.output_zakladki)):\r\n ...
[ "0.6590058", "0.6386988", "0.59298795", "0.58624107", "0.5822092", "0.58134943", "0.5705406", "0.56998646", "0.56144476", "0.549566", "0.54687804", "0.5456929", "0.5437227", "0.54209745", "0.5414605", "0.5351281", "0.5350195", "0.5331751", "0.52800256", "0.52799267", "0.52738...
0.7419353
0
Export (updated) illumina samplesheet.
def export_illumina(args): clarity_epp.export.illumina.update_samplesheet(lims, args.process_id, args.artifact_id, args.output_file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_generate_sample_sheet(self):\n pass", "def make_custom_sample_sheet(input_sample_sheet,output_sample_sheet=None,\n lanes=None,fmt=None):\n # Load the sample sheet data\n sample_sheet = IlluminaData.SampleSheet(input_sample_sheet)\n # Determine the column names...
[ "0.6868604", "0.6461967", "0.5999006", "0.59804803", "0.586817", "0.582595", "0.5779311", "0.5733163", "0.57305694", "0.55586296", "0.5525661", "0.5509233", "0.5470714", "0.54577184", "0.5450282", "0.54479027", "0.54193574", "0.5349859", "0.52579254", "0.524692", "0.52374053"...
0.7068607
0
Export removed samples table.
def export_removed_samples(args): clarity_epp.export.sample.removed_samples(lims, args.output_file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepare_cohorts_for_metadata_export(all_samples, blacklist=[]):\n # Prepare for FC export format\n data = all_samples.rename(columns={'cohort_code': 'membership:sample_set_id', 'entity:sample_id': 'sample_id'})\n data_clean = data[['membership:sample_set_id', 'sample_id']]\n\n # Remove blacklist\n ...
[ "0.5847827", "0.5772176", "0.57479125", "0.5740398", "0.5681225", "0.5638062", "0.5614595", "0.5612168", "0.5602861", "0.5550865", "0.5547393", "0.5537967", "0.55224085", "0.5499635", "0.54904026", "0.5487787", "0.54560983", "0.5452331", "0.5449576", "0.5392043", "0.5377981",...
0.6860491
0
Export related MIP samples
def export_sample_related_mip(args): clarity_epp.export.sample.sample_related_mip(lims, args.process_id, args.output_file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_removed_samples(args):\n clarity_epp.export.sample.removed_samples(lims, args.output_file)", "def export_sample_indications(args):\n clarity_epp.export.sample.sample_indications(\n lims, args.output_file, args.artifact_name, args.sequencing_run, args.sequencing_run_project\n )", "def...
[ "0.6802774", "0.6612924", "0.6183057", "0.61627895", "0.59162635", "0.58976537", "0.5858253", "0.5856455", "0.57867974", "0.577075", "0.5770604", "0.57578796", "0.57270014", "0.5626266", "0.5575579", "0.5557229", "0.5542678", "0.549388", "0.5487541", "0.54692966", "0.546072",...
0.7658022
0
Export samplesheets for Tapestation machine.
def export_tapestation(args): clarity_epp.export.tapestation.samplesheet(lims, args.process_id, args.output_file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_tecan(args):\n clarity_epp.export.tecan.samplesheet(lims, args.process_id, args.type, args.output_file)", "def test_generate_sample_sheet(self):\n pass", "def test_export_spreadsheet(self):\r\n client = self.getClient()\r\n if client:\r\n exp = [['#SampleID', 'DOB'...
[ "0.63185227", "0.62939477", "0.5897288", "0.57337177", "0.5581582", "0.55671644", "0.5473567", "0.5473567", "0.53622097", "0.534652", "0.52113193", "0.51882476", "0.5183746", "0.51815856", "0.51769376", "0.51543266", "0.51492745", "0.51251966", "0.51034665", "0.5092538", "0.5...
0.7652788
0
Export samplesheets for tecan machine.
def export_tecan(args): clarity_epp.export.tecan.samplesheet(lims, args.process_id, args.type, args.output_file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_tapestation(args):\n clarity_epp.export.tapestation.samplesheet(lims, args.process_id, args.output_file)", "def test_generate_sample_sheet(self):\n pass", "def write_clinical_samples_tsv(sheets):\n\n # Header lines, first item must start with #\n # attribute Display Names\n NAMES ...
[ "0.7105065", "0.65541244", "0.6157658", "0.5867363", "0.57439923", "0.5577072", "0.5558953", "0.5527643", "0.5488577", "0.5479095", "0.54620737", "0.5350241", "0.53132707", "0.52870476", "0.5283209", "0.52702224", "0.52511656", "0.5249359", "0.523218", "0.51937866", "0.518715...
0.70902795
1
Export workflow overview files.
def export_workflow(args): if args.type == 'magnis': clarity_epp.export.workflow.helix_magnis(lims, args.process_id, args.output_file) elif args.type == 'mip': clarity_epp.export.workflow.helix_mip(lims, args.process_id, args.output_file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_overview(self, outpath=None):\n orderby = self.orderby.get()\n currentregion = self.region.get()\n if not outpath:\n outpath = tkinter.filedialog.askdirectory()\n if outpath:\n export.export_overview(\n self.tabs.window.aistrac...
[ "0.649091", "0.5712518", "0.56824404", "0.5679802", "0.5617292", "0.557171", "0.55455595", "0.54952663", "0.5478947", "0.54045343", "0.536965", "0.5348399", "0.5322129", "0.5303039", "0.52954066", "0.5293154", "0.5290681", "0.5270537", "0.52693564", "0.52677786", "0.52497315"...
0.6118105
1
Upload samples from helix output file.
def upload_samples(args): clarity_epp.upload.samples.from_helix(lims, config.email, args.input_file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upload_samples():\n # Retrieve a list of all files and paths within the target\n paths = Path(Config.target_dir).glob(Config.target_pattern)\n # Inform the user as to what we're doing\n logger.info(\"Assembling %s volume for submission\", Config.target_dir)\n # Loop through each identified file ...
[ "0.6146297", "0.6064363", "0.60513383", "0.5952946", "0.59492606", "0.593849", "0.58671814", "0.5859735", "0.57725275", "0.5753233", "0.57029307", "0.56819546", "0.561137", "0.5601123", "0.5592826", "0.55898684", "0.5573676", "0.55560964", "0.55062276", "0.5494329", "0.547171...
0.77155775
0
Set QC status based on fragment length measurement.
def qc_fragment_length(args): clarity_epp.qc.fragment_length.set_qc_flag(lims, args.process_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_length(self, length):\n if length < 0:\n raise AttributeError('length should be positive')\n self.progress_char_length = length", "def test_one_contig_threshold(self):\n # Make sure the error code is not set before running command\n assert_false(hasattr(self,\"c\"))...
[ "0.5374626", "0.5257471", "0.5234235", "0.5224763", "0.51419026", "0.5140727", "0.5005431", "0.49226668", "0.4871184", "0.48435473", "0.47917712", "0.46944144", "0.46696663", "0.46632966", "0.46603596", "0.4644813", "0.4607283", "0.45766616", "0.4563704", "0.4546243", "0.4531...
0.64125764
0
Set QC status based on qubit measurement.
def qc_qubit(args): clarity_epp.qc.qubit.set_qc_flag(lims, args.process_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setMyStatus(self):\n self.clearMyStatus()\n for id, myComponent in self.components.iteritems():\n self.currentComps += 1\n if myComponent.type != '':\n compData = self.componentdata[myComponent.type]\n if myComponent.currentHP == myComponent.myC...
[ "0.5476707", "0.5449999", "0.541398", "0.5391995", "0.5284747", "0.5284747", "0.5279951", "0.5277346", "0.527465", "0.52394056", "0.5238075", "0.52378446", "0.5227095", "0.51985204", "0.5135898", "0.51245904", "0.51070684", "0.50971496", "0.50670874", "0.5066934", "0.50367576...
0.652974
0
Change artifact name to sequence name.
def placement_artifact_set_name(args): if args.type == 'sequence_name': clarity_epp.placement.artifact.set_sequence_name(lims, args.process_id) elif args.type == 'run_id': clarity_epp.placement.artifact.set_runid_name(lims, args.process_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_sequence_name___fix():\n # do not consider referenced shot nodes\n shots = pm.ls(type=\"shot\")\n shot = None\n for s in shots:\n if s.referenceFile() is None:\n shot = s\n break\n\n sequencers = shot.outputs(type=\"sequencer\")\n if not sequencers:\n ...
[ "0.6110718", "0.59574616", "0.5672568", "0.5635998", "0.55507517", "0.55112606", "0.54902583", "0.5469872", "0.5467294", "0.5377182", "0.532746", "0.5306472", "0.5283382", "0.52668834", "0.52513534", "0.52153516", "0.5213098", "0.5209305", "0.51679504", "0.5163752", "0.516101...
0.6644251
0
Route artifacts to a workflow
def placement_route_artifact(args): clarity_epp.placement.artifact.route_to_workflow(lims, args.process_id, args.workflow)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_workflow(args):\n if args.type == 'magnis':\n clarity_epp.export.workflow.helix_magnis(lims, args.process_id, args.output_file)\n elif args.type == 'mip':\n clarity_epp.export.workflow.helix_mip(lims, args.process_id, args.output_file)", "def deploy():", "def test_deploy_workflow...
[ "0.56289124", "0.5347213", "0.53341836", "0.5324889", "0.52798414", "0.52773035", "0.52421165", "0.5202736", "0.5156403", "0.5149803", "0.5113915", "0.5069018", "0.5048605", "0.5044188", "0.50245404", "0.49843836", "0.4972901", "0.49722424", "0.49616715", "0.4956883", "0.4941...
0.73709744
0
Complete protocol step (Dx Mark protocol complete).
def placement_complete_step(args): clarity_epp.placement.step.finish_protocol_complete(lims, args.process_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def declareDone(self, cmd):\n pass", "def complete(self):\n pass", "def end(self):\n self.my_print(\"\\t[DONE]\", msg_types.INFO)\n self.in_progress = False", "def processCompleteMessage(self, msg):\r\n self._connection.receivedMessage(msg)", "def completion() -> None:", ...
[ "0.660435", "0.6354931", "0.621701", "0.60923034", "0.60668945", "0.6024917", "0.5988484", "0.5959301", "0.5930279", "0.5911042", "0.59010434", "0.5883401", "0.5859091", "0.58490753", "0.58020234", "0.58004105", "0.57969505", "0.57882637", "0.5739414", "0.57338345", "0.573383...
0.7127411
0
Placement tecan process, distribute artifacts over two containers
def placement_tecan(args): clarity_epp.placement.tecan.place_artifacts(lims, args.process_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transformation_catalog():\n tc = TransformationCatalog()\n\n # Add docker container\n #crisis_container = Container(\n # 'crisis_container',\n # Container.DOCKER,\n # image = \"docker://slnagark/crisis_wf:latest\",\n # arguments=\"--runtime=nvidi...
[ "0.617238", "0.58995914", "0.5847137", "0.58073807", "0.55927074", "0.5573862", "0.5552047", "0.5548372", "0.55465376", "0.5510823", "0.5471285", "0.54646164", "0.5461811", "0.54609716", "0.54609716", "0.54609716", "0.5436042", "0.5430517", "0.54251856", "0.542289", "0.541161...
0.6592639
0
Function to retrieve a person from the database to store in client model
def get_person(self, id): PERSON = """SELECT name FROM Person WHERE id = %s""" ret = None try: self.db_cursor.execute("""SELECT name, id FROM Person WHERE id = %s""", (id,)) self.db_cursor.execute(PERSON, (id,)) self.db_connection.commit()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_person():\r\n body = request.get_json()\r\n\r\n try:\r\n SELECT_PERSON_SCHEMA.validate(body)\r\n except SchemaError as err:\r\n raise ServiceBodyError(str(err))\r\n\r\n with sqlite_client:\r\n message = get_person(sqlite_client, body.get('id'))\r\n\r\n return jsonify(...
[ "0.71754307", "0.68746483", "0.6805197", "0.68045425", "0.6589222", "0.6520086", "0.6469705", "0.63906187", "0.63485867", "0.62637526", "0.6231145", "0.6229764", "0.61607337", "0.6155425", "0.6108049", "0.60942554", "0.6072058", "0.5982313", "0.5974648", "0.5969352", "0.59544...
0.69603175
1
Function to determine if the list of courses is in the general courses table
def validate_new_curriculum_courses(self, curriculum_courses): for cur in curriculum_courses: # check to make sure its in the general courses table self.db_cursor.execute("""SELECT COUNT(*) FROM Course WHERE name = %s""", (cur,)) ct = self.db_cursor.fetchone() ct...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_course_exists(self):\n db = Course._file.read_db()\n courses = db[\"courses\"]\n for crs in courses:\n if crs[\"course_name\"] == self._course_name:\n return True\n break\n return False", "def course_in_courses(self, mnemo, courses):\n ...
[ "0.63712996", "0.6357452", "0.6347225", "0.6346391", "0.62091684", "0.60255164", "0.5831977", "0.57686985", "0.5721567", "0.56778044", "0.56285805", "0.561697", "0.5616078", "0.56133604", "0.5596482", "0.5576949", "0.55759954", "0.5570297", "0.556247", "0.5550211", "0.5531584...
0.63618577
1
Funtion to determine if a person with the same id as a new person already exists in the database
def validate_new_person(self, person_id): self.db_cursor.execute("""SELECT COUNT(*) FROM Person WHERE id == %s""", (person_id,)) ct = self.db_cursor.fetchone() ct = ct[0] if ct == 0: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def case_duplicate(item):\n\n data = item.data\n case_number = data.get(\"case_number\")\n person_id = data.get(\"person_id\")\n\n table = item.table\n if case_number:\n query = (table.case_number == case_number) & \\\n (table.deleted != True)\n ...
[ "0.6410337", "0.6204078", "0.6095712", "0.60917", "0.6081425", "0.60685897", "0.60517544", "0.6018271", "0.5990265", "0.59788346", "0.59537405", "0.5939683", "0.58824253", "0.58821607", "0.5877335", "0.58575386", "0.584312", "0.5832143", "0.5791309", "0.5790564", "0.5783818",...
0.74958897
0
Function to determine if a topic with the same id as the new topic already exists in the database
def validate_new_topic(self, topic_id): self.db_cursor.execute("""SELECT COUNT(*) FROM Topic WHERE id == %s""", (topic_id,)) ct = self.db_cursor.fetchone() ct = ct[0] if ct == 0: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_new_curriculum_topics(self, curriculum_topics):\n\n for cur in curriculum_topics:\n # check to make sure its in the general topics table\n self.db_cursor.execute(\"\"\"SELECT COUNT(*) FROM Topic WHERE name = %s\"\"\", (cur,))\n ct = self.db_cursor.fetchone()\n ...
[ "0.68671364", "0.68062276", "0.6378161", "0.6126449", "0.5916333", "0.5914549", "0.5872192", "0.57884616", "0.5726345", "0.5713697", "0.5695193", "0.5675286", "0.56705123", "0.56675947", "0.565931", "0.5653919", "0.5647924", "0.5600276", "0.5597816", "0.55932456", "0.5590022"...
0.78769946
0
Function to add a brand new topic to the database
def add_new_topic_to_db(self, topic_obj): # todo: don't need this anymore self.db_cursor.execute("""INSERT INTO Topic (id, name) VALUES (%s, %s)""", (topic_obj.id, topic_obj.name)) self.db_connection.commit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert_topic(self,text,addition,year,user):\r\n topic = Topic(date=date.today(),text=text,year=year,user=user)\r\n topic.addition = addition\r\n \r\n session = self.persistence.get_session()\r\n session.add(topic)\r\n session.commit()", "def new_topic(request):\n ...
[ "0.77887875", "0.74170333", "0.72958183", "0.72625315", "0.6993564", "0.6992848", "0.69752526", "0.6846889", "0.68312746", "0.68089825", "0.6718152", "0.666205", "0.66021574", "0.6561286", "0.6547", "0.6530548", "0.6456005", "0.6446164", "0.64442694", "0.64338785", "0.6417663...
0.7786357
1
Function to retrieve a topic from the database to store in client model
def get_topic(self, id): TOPIC = """SELECT COUNT(*) FROM Topic WHERE id = %s""" ret = None try: self.db_cursor.execute("""SELECT name, id FROM Topic WHERE id = %s""", (id,)) t = self.db_cursor.fetchall() ret = Topic() ret.name = t[0][0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(cls, topic_info):\n try: #to treat topic info as topic.id\n return Topic.query.get(int(topic_info))\n except Exception: #treat topic info as topic.name\n return Topic.query.filter_by(name=topic_info).first()", "def get_topic(topic_id):\n topic = db_session.query(Top...
[ "0.7341961", "0.719212", "0.7157874", "0.69891924", "0.69395", "0.68769634", "0.6867653", "0.67888474", "0.6777278", "0.665143", "0.6563236", "0.65536606", "0.6545432", "0.6540096", "0.64925075", "0.645844", "0.644433", "0.6385114", "0.6378959", "0.6343912", "0.63417065", "...
0.71923053
1
Function to retrieve course from the database
def get_course(self, name): GET_TOPIC_IDS = """SELECT topic_id FROM CourseTopics WHERE course_name = %s""" GET_GOAL_IDS = """SELECT goal_id FROM CourseGoals WHERE course_name = %s""" ret = None try: self.db_cursor.execute("""SELECT subject_code, credit_hours, description FR...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_course(self):\n db = Course._file.read_db()\n courses = db[\"courses\"]\n for crs in courses:\n if crs[\"course_name\"] == self._course_name:\n return Course(**crs)\n break", "def select_course(self, subject, course_num):\n conn = sqlit...
[ "0.77193254", "0.7518302", "0.7269233", "0.72150934", "0.7173703", "0.7170874", "0.7087158", "0.70306355", "0.6874583", "0.6817401", "0.6806821", "0.67756855", "0.66746914", "0.66484475", "0.66312397", "0.6618067", "0.66042495", "0.65964794", "0.65766454", "0.6574305", "0.655...
0.76162946
1
Fucntion to set the course in the db
def set_course(self, new_course, updating=False): COURSE_QUERY = """UPDATE Course SET subject_code = %s, credit_hours = %s, description = %s WHERE name = %s""" if updating \ else """INSERT INTO Course (subject_code, credit_hours, description, name) VALUES (%s, %s, %s, %s)""" self.db_cursor....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_course(self):\r\n self.course.save()\r\n self.store.update_item(self.course, self.user.id)", "def edit_course(self, course):\n EDIT_COURSE = \"\"\"UPDATE Course SET subject_code = %s, credit_hours = %s, description = %s WHERE name = %s\"\"\"\n\n self.db_cursor.execute(EDIT_CO...
[ "0.76697034", "0.69201535", "0.69193166", "0.6838468", "0.682473", "0.6684611", "0.66294444", "0.6570262", "0.6566537", "0.65445465", "0.6534536", "0.64993685", "0.6451552", "0.64059365", "0.6341957", "0.6327892", "0.6260288", "0.62347114", "0.61435986", "0.6129142", "0.61188...
0.69831127
1
Function to retrieve section from the db
def get_section(self, new_section): SECTION = """SELECT COUNT(*) FROM Section WHERE id = %s""" ret = None #try: self.db_cursor.execute("""SELECT num_students, comment1, comment2 FROM Section WHERE course_name = %s AND semester = %s AND section_id = %s""", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sections(self,):\n self.logger.info(\"\\t[+] get_sections [+]\")\n try:\n return self.sections.select().execute()\n except Exception as e:\n self.logger.critical(\"\\t[-] Exception occured [-]\")\n self.logger.critical(\"\\t\" + str(e))\n sel...
[ "0.68347156", "0.6583898", "0.6583898", "0.6450547", "0.6379913", "0.63227254", "0.62380296", "0.6147309", "0.61408764", "0.6059794", "0.6054953", "0.6021507", "0.5988981", "0.59255385", "0.5904555", "0.58982235", "0.57892066", "0.57753503", "0.57172996", "0.5716366", "0.5697...
0.6672911
1
Function for adding curriculum to the db
def set_curriculum(self, new_curriculum, updating=False): if not updating: #Add Curriculum to database: self.db_cursor.execute("""INSERT INTO Curriculum (name, min_credit_hours, id_in_charge) VALUES (%s, %s, %s)""", (new_curriculum.name, new_curriculum....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_curricula(apps, schema_editor):\n Curriculum = apps.get_model('workshops', 'Curriculum')\n data = {\n 'swc-python': dict(\n name='Software Carpentry (shell, git, Python)',\n active=True,\n unknown=False,\n ),\n 'swc-r': dict(\n name='So...
[ "0.63018584", "0.6080083", "0.5960781", "0.56396157", "0.5505915", "0.542898", "0.5381422", "0.53558385", "0.5339416", "0.5280498", "0.52722335", "0.5269664", "0.52507955", "0.5232106", "0.52166164", "0.52114844", "0.5197261", "0.5188744", "0.51863056", "0.5172717", "0.508443...
0.6972953
0
Retrieves all descriptions of a Goal, potentially across the context of multiple curricula and returns a description
def fetch_goal_context_description(self, goalId): GET_ALL_CONTEXTS = """SELECT curriculum_name, description FROM Goal WHERE id = %s """ try: self.db_cursor.execute(GET_ALL_CONTEXTS,(goalId,)) descriptions = self.db_cursor.fetchall() if len(descriptions) <= 0: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_description(self):", "def cal_desc(self):\n desc = \"\"\n desc += \"Requested by \"\n orgs = self.org.all()\n if len(orgs) > 0:\n for org in orgs:\n desc += org.name + \", \"\n desc = desc[:-2] + \".\\n\" # removes trailing comma\n ...
[ "0.6394918", "0.6280152", "0.6215949", "0.61783165", "0.6024815", "0.59987986", "0.5982599", "0.5982384", "0.5935226", "0.5835749", "0.5835749", "0.58047986", "0.58000565", "0.5788512", "0.57825905", "0.5774149", "0.5764935", "0.5763493", "0.57389426", "0.5721243", "0.5686074...
0.62975013
1
Function to retrieve goal from the db
def get_goal(self, new_goal): GOAL = """SELECT COUNT(*) FROM Section WHERE id = %s""" ret = None try: self.db_cursor.execute( """SELECT description FROM Goal WHERE id = %s AND curriculum_name = %s""", (new_goal.id, new_goal.curriculum_name,)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_goal(self):\n pass", "def retrieve_from_db(self):\n pass", "def query(self):", "def get_test_goal(context, **kw):\n obj_cls = objects.Goal\n db_data = db_utils.get_test_goal(**kw)\n obj_data = _load_related_objects(context, obj_cls, db_data)\n\n return _load_test_obj(co...
[ "0.6538818", "0.6132327", "0.60861653", "0.6083641", "0.5853879", "0.57920897", "0.5776673", "0.57731026", "0.57363534", "0.5716141", "0.56374633", "0.5637404", "0.5626346", "0.56118083", "0.5597107", "0.5588083", "0.5571267", "0.5556646", "0.5503777", "0.5475083", "0.5452245...
0.66596687
0
Function to write course goal to the db
def set_course_goal(self, goal_id, course_name): self.db_cursor.execute( """INSERT INTO CourseGoals (course_name, goal_id) VALUES (%s, %s)""", (course_name, goal_id)) self.db_connection.commit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_course(self, course: Course) -> None:\n self.collection.insert_one(course.dict())", "def update_db():\n \n with open(\"courses_2016.json\") as data:\n data = data.read()\n\n courses = json.loads(data)\n\n for course in courses:\n try:\n [dept, ...
[ "0.6199046", "0.60579056", "0.60428387", "0.59549844", "0.59167856", "0.5892669", "0.5788649", "0.56852055", "0.5645917", "0.56355464", "0.56051177", "0.56049925", "0.55996007", "0.55829275", "0.55780876", "0.5575448", "0.5556891", "0.5539692", "0.55377734", "0.54941165", "0....
0.6796742
0
Function to write course topic to the db
def set_course_topic(self, topic_id,course_name): self.db_cursor.execute( """INSERT INTO CourseTopics (course_name, topic_id) VALUES (%s, %s)""", (course_name, topic_id)) self.db_connection.commit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_course_topics(user, token, course):\n\n # save topics' data\n GOOGLE_API_TOPICS = 'https://classroom.googleapis.com/v1/courses/%s/topics' % course.id\n headers = {\n 'content-type': 'application/json',\n }\n\n response = requests.get(\n GOOGLE_API_TOPICS,\n params={'acc...
[ "0.72414744", "0.65759945", "0.64926547", "0.6254328", "0.6082379", "0.59410554", "0.5932748", "0.5922048", "0.58537835", "0.58148694", "0.5754014", "0.5738365", "0.5724344", "0.5625807", "0.56163025", "0.56147015", "0.56041497", "0.55994385", "0.5586847", "0.5568423", "0.556...
0.7521758
0
Function to get a course topic from the db
def get_course_topic(self, topic_id, course_name): ret = None try: self.db_cursor.execute( """SELECT course_name, topic_id FROM CourseTopics WHERE course_name = %s AND topic_id = %s""", (course_name, topic_id)) ct = self.db_cursor.fetchall() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_single_topic_courses(self):\r\n course_id = None # Change me!!\r\n topic_id = None # Change me!!\r\n\r\n r = self.client.get_single_topic_courses(topic_id, course_id)", "def get_topic(self, id):\n TOPIC = \"\"\"SELECT COUNT(*) FROM Topic WHERE id = %s\"\"\"\n\n r...
[ "0.7381407", "0.7054905", "0.68542206", "0.67677593", "0.6664088", "0.66496855", "0.6643712", "0.6638423", "0.655389", "0.6544459", "0.6510627", "0.6470915", "0.6435634", "0.6431833", "0.64089453", "0.6306468", "0.6267252", "0.62563705", "0.62313986", "0.62202626", "0.6210956...
0.7823914
0
Function to retrieve curriculum topic from the db
def get_curriculum_topic(self, curriculum_name, curriculum_topic): ret = None try: self.db_cursor.execute( """SELECT level, subject_area, time_unit FROM CurriculumTopics WHERE curriculum_name = %s AND topic_id = %s""", (curriculum_name, curriculum_topic)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_topic_of_question(question):\n dynamodb = boto3.resource(\"dynamodb\", region_name=\"eu-central-1\")\n topic_table = dynamodb.Table(\"Topics\")\n\n topic_id = question.get(\"TopicId\")\n # query topic_id of the question\n try:\n response = topic_table.get_item(...
[ "0.67491347", "0.6399607", "0.6361938", "0.6343837", "0.6279825", "0.62598395", "0.6189485", "0.6166207", "0.6124295", "0.60379887", "0.60332173", "0.60299146", "0.59698087", "0.59110564", "0.59022534", "0.5839776", "0.58006823", "0.57999027", "0.577406", "0.5755427", "0.5752...
0.7505171
0
Function to retrieve a list of curriculum goals from the db
def curriculum_goal_list(self, curriculum_name): ret = [] try: self.db_cursor.execute( """SELECT id, description FROM Goal WHERE curriculum_name = %s""", (curriculum_name,)) goals = self.db_cursor.fetchall() if goals: g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_goals(self):\r\n\t\twith self.conn:\r\n\t\t\tself.c.execute(\"\"\"SELECT * FROM goals\"\"\")\r\n\t\t\ttup_list = self.c.fetchall()\r\n\t\treturn self._convert_tup_list_to_dict_list(tup_list)", "def goals(self):\r\n return goals.Goals(self)", "def get_goal(self, new_goal):\n\n GOAL = \...
[ "0.6867574", "0.59022593", "0.57518893", "0.5690444", "0.5685245", "0.56651735", "0.5651523", "0.5633112", "0.56032073", "0.55862516", "0.55823267", "0.5527885", "0.5467755", "0.5417775", "0.5395148", "0.531531", "0.53115666", "0.5295306", "0.52783984", "0.52678376", "0.52555...
0.79522294
0
Function to retrieve the section grades from the db and return them as a list (this works for SectionGrades table and SectionGoalGrades table)
def get_section_grades(self, section, section_goal=False): if not section_goal: SECTION_GRADES = """SELECT count_ap, count_a, count_am, count_bp, count_b, count_bm, count_cp, count_c, count_cm, count_dp, count_d, count_dm, count_f,count_i, count_w FROM SectionGrades WHERE course = %s AND semester = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_student_grade(class_id):\n grades = []\n quiz_grade = query_db(\n \"SELECT quizzes.name, grade FROM quiz_grades JOIN quizzes \"\n \"ON quiz_grades.quiz_id=quizzes.id JOIN topics \"\n \"ON quizzes.topic_id=topics.id JOIN classes \"\n \"ON topics.class_id=classes.id \"\n ...
[ "0.7101856", "0.67804635", "0.6752108", "0.6615757", "0.6474653", "0.6421206", "0.63589877", "0.631259", "0.6258068", "0.62427837", "0.62184596", "0.61503845", "0.6106861", "0.6070258", "0.6044991", "0.60328126", "0.60154426", "0.6001862", "0.5941723", "0.59187573", "0.590876...
0.7776043
0
Function to retrieve a list of sections based off of a course
def get_sections_of_a_course(self, course_name, year, semester_name): if semester_name not in SEMESTER_NAME_MAP.keys(): logging.warning("DBAdapter: Error- invalid semester name.") return None semester = SEMESTER_NAME_MAP[semester_name] return_list = [] GET_SECTIO...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_all_sections(self, course_id):\n conn = sqlite3.connect(self.db_path)\n cursor = conn.cursor()\n with conn:\n cursor.execute(\n \"\"\"SELECT * FROM course_sections \n WHERE course_id = ?\"\"\",\n (course_id,),\n ...
[ "0.7577065", "0.7576953", "0.7424162", "0.7382828", "0.7236566", "0.7176602", "0.7086361", "0.7010396", "0.69594324", "0.66986996", "0.6623919", "0.6595404", "0.654556", "0.6525249", "0.65070343", "0.650297", "0.64985454", "0.6495903", "0.648368", "0.6476749", "0.64632314", ...
0.7686416
0
Function to remove curriculum goals from the db
def remove_curriculum_goals(self, curriculum): DELETE_CURRICULUM_GOALS = """DELETE FROM Goal WHERE curriculum_name = %s""" try: self.db_cursor.execute(DELETE_CURRICULUM_GOALS, (curriculum.name,)) self.db_connection.commit() except: logging.warning("DBAdapter:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_course_goals(self, course):\n DELETE_COURSE_GOALS = \"\"\"DELETE FROM CourseGoals WHERE course_name = %s\"\"\"\n\n self.db_cursor.execute(DELETE_COURSE_GOALS, (course.name,))\n self.db_connection.commit()", "def remove_curriculum(self, curriculum):\n DELETE_CURRICULUM = \"\...
[ "0.7025989", "0.66307485", "0.6243633", "0.62221265", "0.61730474", "0.6141893", "0.6110971", "0.6082119", "0.6014006", "0.597867", "0.5966083", "0.5900256", "0.58493364", "0.58166784", "0.5808444", "0.5784192", "0.57757366", "0.5770922", "0.57061917", "0.5692397", "0.5661966...
0.831663
0
Function to remove curriculum topics from the db
def remove_curriculum_topics(self, curriculum): DELETE_FROM_CURRICULUM_TOPICS = """DELETE FROM CurriculumTopics WHERE curriculum_name = %s""" try: self.db_cursor.execute(DELETE_FROM_CURRICULUM_TOPICS, (curriculum.name,)) self.db_connection.commit() except: lo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_course_topics(self, course):\n DELETE_COURSE_TOPICS = \"\"\"DELETE FROM CourseTopics WHERE course_name = %s\"\"\"\n\n self.db_cursor.execute(DELETE_COURSE_TOPICS, (course.name,))\n self.db_connection.commit()", "def remove_topic ( topics , level = ROOT.RooFit.INFO , stream = -1 )...
[ "0.6923057", "0.67551494", "0.6577512", "0.6558305", "0.61510783", "0.61396134", "0.60660744", "0.6024087", "0.59879607", "0.5971833", "0.5942124", "0.58776575", "0.5843289", "0.58229035", "0.5818467", "0.58093405", "0.5767144", "0.57314086", "0.5695167", "0.5674001", "0.5664...
0.82465684
0
Function to remove curriculum courses from the db
def remove_curriculum_courses(self, curriculum): DELETE_FROM_CURRICULUM_LISTINGS = """DELETE FROM CurriculumListings WHERE curriculum_name = %s""" try: self.db_cursor.execute(DELETE_FROM_CURRICULUM_LISTINGS, (curriculum.name,)) self.db_connection.commit() except: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_course_in_curriculum_listings(self, course):\n DELETE_CURRICULUM_COURSES = \"\"\"DELETE FROM CurriculumListings WHERE course_name = %s\"\"\"\n\n self.db_cursor.execute(DELETE_CURRICULUM_COURSES, (course.name,))\n self.db_connection.commit()", "def remove_curriculum(self, curriculu...
[ "0.7996696", "0.7515396", "0.736457", "0.728052", "0.68510836", "0.6823539", "0.6731365", "0.66936284", "0.6648279", "0.66253513", "0.66170394", "0.6479724", "0.6462396", "0.6457004", "0.63306725", "0.6330107", "0.6312556", "0.63116014", "0.62037617", "0.61183065", "0.6117102...
0.83684266
0
Function to remove curriculum from the db
def remove_curriculum(self, curriculum): DELETE_CURRICULUM = """DELETE FROM Curriculum WHERE name = %s""" try: self.db_cursor.execute(DELETE_CURRICULUM, (curriculum.name,)) self.db_connection.commit() except: logging.warning("DBAdapter: Error- Could not delet...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_curriculum_courses(self, curriculum):\n DELETE_FROM_CURRICULUM_LISTINGS = \"\"\"DELETE FROM CurriculumListings WHERE curriculum_name = %s\"\"\"\n\n try:\n self.db_cursor.execute(DELETE_FROM_CURRICULUM_LISTINGS, (curriculum.name,))\n self.db_connection.commit()\n ...
[ "0.7520537", "0.7123004", "0.69520813", "0.64106256", "0.6309485", "0.60888255", "0.5906614", "0.58402205", "0.5753388", "0.56972307", "0.5633587", "0.55964035", "0.559353", "0.55837995", "0.55369216", "0.5527404", "0.549224", "0.54792136", "0.5443087", "0.53939295", "0.53831...
0.84933627
0
Function to edit a course in the db
def edit_course(self, course): EDIT_COURSE = """UPDATE Course SET subject_code = %s, credit_hours = %s, description = %s WHERE name = %s""" self.db_cursor.execute(EDIT_COURSE, ( course.subject_code, course.credit_hours, course.description, course.name)) self.db_connection.commit() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(request):\n\tcourse_id = request.GET.get('course_id')\n\tif request.method == 'POST':\n\t\tcourse_title = request.POST['course_title']\n\t\tinstitute_name = request.POST['institute_name']\n\t\tcourse_desc = request.POST['course_desc']\n\t\tcurrent_data = Course.objects.get(course_id = course_id)\n\t\tcu...
[ "0.75889885", "0.6766243", "0.66960055", "0.6695456", "0.66872954", "0.6605374", "0.6586517", "0.6531737", "0.6449789", "0.6433642", "0.64253557", "0.6294824", "0.6264496", "0.62369275", "0.6212748", "0.6182824", "0.616313", "0.61455786", "0.61435974", "0.6114365", "0.6085732...
0.80736226
0
Fuction to remove course goals from the db
def remove_course_goals(self, course): DELETE_COURSE_GOALS = """DELETE FROM CourseGoals WHERE course_name = %s""" self.db_cursor.execute(DELETE_COURSE_GOALS, (course.name,)) self.db_connection.commit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_course_in_section_goal_grades(self, course):\n DELETE_COURSE_SECTION_GOAL_GRADES = \"\"\"DELETE FROM SectionGoalGrades WHERE course = %s\"\"\"\n\n self.db_cursor.execute(DELETE_COURSE_SECTION_GOAL_GRADES, (course.name,))\n self.db_connection.commit()", "def remove_curriculum_goals...
[ "0.73404795", "0.6837276", "0.6595358", "0.64684933", "0.64334375", "0.641285", "0.63084304", "0.61660075", "0.6162019", "0.6108261", "0.60963815", "0.6087424", "0.6062167", "0.606025", "0.59971017", "0.59696966", "0.5940118", "0.5929227", "0.59132004", "0.59087265", "0.58900...
0.8100842
0
Function to remove course topics from the db
def remove_course_topics(self, course): DELETE_COURSE_TOPICS = """DELETE FROM CourseTopics WHERE course_name = %s""" self.db_cursor.execute(DELETE_COURSE_TOPICS, (course.name,)) self.db_connection.commit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_topic_courses(self):\r\n course_id = None # Change me!!\r\n topic_id = None # Change me!!\r\n\r\n r = self.client.delete_topic_courses(topic_id, course_id)", "def remove_curriculum_topics(self, curriculum):\n DELETE_FROM_CURRICULUM_TOPICS = \"\"\"DELETE FROM Curricul...
[ "0.7267308", "0.7162471", "0.6669879", "0.6615398", "0.65995437", "0.65227175", "0.64070475", "0.63127166", "0.6255931", "0.6247505", "0.622795", "0.61358047", "0.6098038", "0.60880136", "0.6079159", "0.5982441", "0.5974049", "0.5922804", "0.5904841", "0.5893492", "0.5891639"...
0.826377
0
Function to remove courses from a curriculum in the db
def remove_course_in_curriculum_listings(self, course): DELETE_CURRICULUM_COURSES = """DELETE FROM CurriculumListings WHERE course_name = %s""" self.db_cursor.execute(DELETE_CURRICULUM_COURSES, (course.name,)) self.db_connection.commit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_curriculum_courses(self, curriculum):\n DELETE_FROM_CURRICULUM_LISTINGS = \"\"\"DELETE FROM CurriculumListings WHERE curriculum_name = %s\"\"\"\n\n try:\n self.db_cursor.execute(DELETE_FROM_CURRICULUM_LISTINGS, (curriculum.name,))\n self.db_connection.commit()\n ...
[ "0.82798076", "0.74495906", "0.7176098", "0.7132954", "0.69807893", "0.69125354", "0.67496634", "0.6682265", "0.6664997", "0.6659029", "0.65438765", "0.65389067", "0.6500221", "0.6454423", "0.64459604", "0.6284018", "0.6217394", "0.61738217", "0.6137372", "0.6113713", "0.6107...
0.8008807
1
Function to remove all sections of a course in the db
def remove_course_in_section(self, course): DELETE_COURSE_SECTIONS = """DELETE FROM Section WHERE course_name = %s""" self.db_cursor.execute(DELETE_COURSE_SECTIONS, (course.name,)) self.db_connection.commit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_course_in_section_grades(self, course):\n DELETE_COURSE_SECTION_GRADES = \"\"\"DELETE FROM SectionGrades WHERE course = %s\"\"\"\n\n self.db_cursor.execute(DELETE_COURSE_SECTION_GRADES, (course.name,))\n self.db_connection.commit()", "def remove_empty_courses(self):\n pass"...
[ "0.7411444", "0.678805", "0.6720206", "0.6509268", "0.64289224", "0.63652366", "0.6362051", "0.63241756", "0.6254571", "0.62334865", "0.62213874", "0.62109655", "0.6164397", "0.60369295", "0.6029878", "0.59812313", "0.5970608", "0.5964486", "0.5936933", "0.5905548", "0.588991...
0.79037875
0
Function to remove occurances of course in section grades in the db
def remove_course_in_section_grades(self, course): DELETE_COURSE_SECTION_GRADES = """DELETE FROM SectionGrades WHERE course = %s""" self.db_cursor.execute(DELETE_COURSE_SECTION_GRADES, (course.name,)) self.db_connection.commit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_course_in_section_goal_grades(self, course):\n DELETE_COURSE_SECTION_GOAL_GRADES = \"\"\"DELETE FROM SectionGoalGrades WHERE course = %s\"\"\"\n\n self.db_cursor.execute(DELETE_COURSE_SECTION_GOAL_GRADES, (course.name,))\n self.db_connection.commit()", "def remove_course_in_sectio...
[ "0.73677933", "0.6780969", "0.65231955", "0.6249915", "0.6122453", "0.60941887", "0.60487217", "0.6046306", "0.58382064", "0.5802625", "0.5710555", "0.5664911", "0.5640699", "0.56190586", "0.5608399", "0.5597606", "0.55732626", "0.5532856", "0.5515773", "0.54833287", "0.53617...
0.776278
0
Function to remove occurances of course in section grades in the db
def remove_course_in_section_goal_grades(self, course): DELETE_COURSE_SECTION_GOAL_GRADES = """DELETE FROM SectionGoalGrades WHERE course = %s""" self.db_cursor.execute(DELETE_COURSE_SECTION_GOAL_GRADES, (course.name,)) self.db_connection.commit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_course_in_section_grades(self, course):\n DELETE_COURSE_SECTION_GRADES = \"\"\"DELETE FROM SectionGrades WHERE course = %s\"\"\"\n\n self.db_cursor.execute(DELETE_COURSE_SECTION_GRADES, (course.name,))\n self.db_connection.commit()", "def remove_course_in_section(self, course):\n ...
[ "0.776278", "0.6780969", "0.65231955", "0.6249915", "0.6122453", "0.60941887", "0.60487217", "0.6046306", "0.58382064", "0.5802625", "0.5710555", "0.5664911", "0.5640699", "0.56190586", "0.5608399", "0.5597606", "0.55732626", "0.5532856", "0.5515773", "0.54833287", "0.5361792...
0.73677933
1
Function to remove course from the db
def remove_course(self, course): DELETE_COURSE = """DELETE FROM Course WHERE name = %s""" self.db_cursor.execute(DELETE_COURSE, (course.name,)) self.db_connection.commit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete():\n Course.print_all_crs()\n course_name = input(\"Please, type course name >\")\n c = Course(course_name)\n if c.is_course_exists():\n db = Course._file.read_db()\n for crs_i in range(len(db[\"courses\"])):\n if db[\"courses\"][crs_i][\"...
[ "0.79385114", "0.7593171", "0.74404275", "0.7331626", "0.7117368", "0.70794225", "0.69154245", "0.6879456", "0.68416655", "0.6762682", "0.67380595", "0.669831", "0.6666423", "0.6628351", "0.66240865", "0.65819556", "0.6554197", "0.652338", "0.6522206", "0.6491164", "0.6485401...
0.8314269
0
Stores the old gradient table for recalibration purposes.
def store_old_table(self): for group in self.param_groups: for p in group['params']: gk = p.grad.data param_state = self.state[p] gktbl = param_state['gktbl'] gavg = param_state['gavg'] param_state['gktbl_old'] = gkt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _UpdateGradient(self):\n self.mol.GetGradient('analytic')", "def gradients(self):\n return {}", "def post_gradient_application(self, sess: tf.Session) -> None:\n pass", "def save_and_step(self):\n self.last_grads = [param.grad for param in self.agent.model.parameters()]\n s...
[ "0.5903432", "0.57772994", "0.574436", "0.5678036", "0.55876976", "0.55809575", "0.55665493", "0.55653405", "0.55429", "0.552062", "0.55082816", "0.5454636", "0.54110724", "0.5403632", "0.5389521", "0.53057986", "0.526381", "0.526381", "0.5259402", "0.52561975", "0.52488196",...
0.69276756
0
Returns a named plate type 96 or 384 according to num_wells
def create_plate(num_wells, name): rows, cols = calc.rows_columns(int(num_wells)) new_plate = plate.Plate(rows, cols, name) return new_plate
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def return_agar_plates(wells=6):\n if wells == 6:\n plates = {\"lb_miller_50ug_ml_kan\": \"ki17rs7j799zc2\",\n \"lb_miller_100ug_ml_amp\": \"ki17sbb845ssx9\",\n \"lb_miller_100ug_ml_specto\": \"ki17sbb9r7jf98\",\n \"lb_miller_100ug_ml_cm\": \"ki17urn3gg8...
[ "0.65725857", "0.5870212", "0.5793835", "0.5738888", "0.56977445", "0.555273", "0.55162096", "0.5514364", "0.5499766", "0.537909", "0.5353239", "0.5325758", "0.5300923", "0.5287215", "0.5242675", "0.52093667", "0.5150269", "0.51234543", "0.51130295", "0.50905144", "0.5077052"...
0.73173416
0
Cubic interpolation. Compute the coefficients of the polynomial interpolating the points (xi[i],yi[i]) for i = 0,1,2,3. Returns c, an array containing the coefficients of p(x) = c[0] + c[1]x + c[2]x2 + c[3]x3.
def cubic_interp(xi,yi): # check inputs and print error message if not valid: error_message = "xi and yi should have type numpy.ndarray" assert (type(xi) is np.ndarray) and (type(yi) is np.ndarray), error_message error_message = "xi and yi should have length 3" assert len(xi)==4 and len(yi)==4, e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cubic_interp(x,y,xi) :\n \n f = interp1d(x,y,kind='cubic')\n yi = f(xi)\n \n return yi", "def cubic_interpol(X_P, Y_P):\r\n y_derivs = derivatives( X_P, Y_P ).flatten() # flatten as FB_sub returns 2d array\r\n \r\n for j in np.arange( X_P.shape[0] - 1 ): # for every x[i] and x[i+1] pa...
[ "0.75038683", "0.73429656", "0.70901597", "0.6669274", "0.64942664", "0.64865476", "0.64687324", "0.64412856", "0.64355713", "0.63988495", "0.6367994", "0.6366493", "0.6226454", "0.61955345", "0.61307824", "0.600796", "0.59882486", "0.59307075", "0.58748794", "0.58747196", "0...
0.8025091
0
Score conversions and redirect as specified by url params Expects a 'continue' url parameter for the destination, and a 'conversion_name' url parameter for each conversion to score.
def get(self): cont = self.request.get('continue', default_value='/') # Check whether redirecting to an absolute or relative url netloc = urlparse.urlsplit(cont).netloc if netloc: # Disallow absolute urls to prevent arbitrary open redirects raise custom_exception...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_conversion(queries, query, src, dst, val, currencies, wf):\n ####################################################################################################\n # Make the currency case insensitive\n ###########################################################################################...
[ "0.53658974", "0.49933642", "0.46277124", "0.45726877", "0.4496522", "0.44600248", "0.44595665", "0.43833953", "0.4374575", "0.43299955", "0.43068346", "0.42801183", "0.42527068", "0.42434984", "0.42205715", "0.42046285", "0.41844088", "0.41649348", "0.41626805", "0.4157128", ...
0.5252377
1
Fires on broadcast messages
def process_broadcast(data): logger.info(f"Broadcast: {data}")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_broadcast_message(self):\n\n typhoonae.websocket.broadcast_message('My broadcast message.')", "def broadcast(self, message):\n self._send('broadcast', message)", "def broadcast():\n # global receiving_message\n # if not receiving_message:\n router.broadcast(clients.copy(), json....
[ "0.71514267", "0.6888148", "0.688351", "0.6738276", "0.66956115", "0.6646559", "0.663535", "0.6584327", "0.65600497", "0.6499609", "0.6485581", "0.64688635", "0.6445526", "0.64237297", "0.64032906", "0.63955146", "0.63819927", "0.63773906", "0.63745636", "0.6364013", "0.63237...
0.70121545
1
A function to get necessary labels for the waiting times of different thresholds
def get_plot_for_different_thresholds_labels(measurement_type): if measurement_type == "w": title = "Waiting times over different thresholds" y_axis_label = "Waiting Time" elif measurement_type == "b": title = "Blocking times over different thresholds" y_axis_label = "Blocking Ti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def label(self, t):\n if self.labels is None:\n return None\n prev_label = None\n for l in self.labels:\n if l.time > t:\n break\n prev_label = l\n if prev_label is None:\n return None\n return prev_label.name", "def as...
[ "0.6164587", "0.6123731", "0.60513777", "0.60192835", "0.58672625", "0.5849063", "0.5819105", "0.58170956", "0.5804545", "0.57796496", "0.57647556", "0.57647556", "0.57647556", "0.57298756", "0.57082045", "0.56462866", "0.5634969", "0.562641", "0.561223", "0.5570678", "0.5561...
0.6326991
0
Get the proportion waiting times within the target for a given trial of a threshold
def get_target_proportions_of_current_trial(individuals, target): ambulance_waits, ambulance_target_waits = 0, 0 other_waits, other_target_waits = 0, 0 for individual in individuals: ind_class = len(individual.data_records) - 1 rec = individual.data_records[-1] if rec.node == 2 and i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _probe_wait_time(self):\n r = self.probe_cycle_time / float(len(self.servers)) #self.probe_cycle_time=5\n r = max(.25, r) # Cap it at four per second\n return r", "def precision_threshold(predictions, targets, threshold=0.7):\n number_of_examples_meeting_threshold = 0\n\n ...
[ "0.6077163", "0.6067749", "0.60207504", "0.5824031", "0.57592654", "0.570491", "0.5646278", "0.5642472", "0.56416166", "0.5618799", "0.5616272", "0.5580728", "0.5558966", "0.55399644", "0.552939", "0.5522275", "0.55195254", "0.5507266", "0.54815686", "0.5480748", "0.5465179",...
0.729661
0
Calculates the mean proportion of times that satisfy the target of all trials for the current threshold iteration Returns float, float, float The mean waiting times for ambulance patients, other patients and all patients for a given threshold
def get_mean_waits_of_current_threshold( lambda_2, lambda_1, mu, num_of_servers, threshold, seed_num, num_of_trials, runtime, target, ): current_ambulance_proportions = [] current_other_proportions = [] current_combined_proportions = [] if seed_num == None: s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_target_proportions_of_current_trial(individuals, target):\n ambulance_waits, ambulance_target_waits = 0, 0\n other_waits, other_target_waits = 0, 0\n for individual in individuals:\n ind_class = len(individual.data_records) - 1\n rec = individual.data_records[-1]\n if rec.node...
[ "0.6751316", "0.59683293", "0.59454405", "0.59434617", "0.5935533", "0.593354", "0.59295374", "0.5865449", "0.58428824", "0.5830085", "0.58298254", "0.57752395", "0.5756599", "0.57528955", "0.57528955", "0.57528955", "0.5750205", "0.5748908", "0.573746", "0.57284045", "0.5714...
0.6575508
1
Builds a plot that shows the proportion of individuals that satisfy the desired waiting time target. The plot shows the proportions of ambulance patients, other patients and the combined proportion of the two, that satisfy the target.
def make_plot_for_proportion_within_target( lambda_2, lambda_1, mu, num_of_servers, num_of_trials, seed_num, target, runtime=1440, max_threshold=None, ): ambulance_proportions = [] other_proportions = [] all_proportions = [] if max_threshold == None: max_thres...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def comp_time_plot(p1=database['K+'], p2=database['pi+'], pmax=80, plot=True):\r\n dt = []\r\n p_range = np.linspace(10, pmax, 1000)\r\n m1 = p1.mass\r\n m2 = p2.mass\r\n for p in p_range:\r\n t1_per_m = 76.273/(beta(p, m1)*gamma(p, m1)*c)\r\n t2_per_m = 76.273/(beta(p, m2)*gamma(p, m2...
[ "0.6007617", "0.5770197", "0.5752358", "0.5692155", "0.5691918", "0.5655623", "0.56300396", "0.55511606", "0.5392734", "0.53024817", "0.5274552", "0.5269573", "0.52643716", "0.5222119", "0.52014303", "0.5184559", "0.51777875", "0.5176976", "0.5171472", "0.5152258", "0.5135096...
0.6680112
0
A function to get necessary labels for the two hospitals plot
def get_two_hospital_plot_labels(measurement_type): if measurement_type == "w": title = "Waiting times of two hospitals over different distribution of patients" y_axis_label = "Waiting Time" else: title = ( "Blocking times of two hospitals over different distribution of patie...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_labels(x_label, y_label, title, xlabel_str):\n if x_label is None:\n x_label = xlabel_str\n\n if y_label is None:\n y_label = \"Degree of membership\"\n\n if title is None:\n title = \"Degrees of membership of the samples to each cluster\"\n\n return x_label, y_label, titl...
[ "0.62116903", "0.6029856", "0.6003597", "0.59680206", "0.5843733", "0.5718131", "0.56721735", "0.5667398", "0.5667398", "0.56606805", "0.5659642", "0.5647714", "0.56390446", "0.5638669", "0.5621482", "0.56093115", "0.55882025", "0.5574133", "0.55654013", "0.555358", "0.555055...
0.7466757
0
Make a plot of the waiting/blocking time between two hospitals that have a joint arrival rate of ambulance patients. In other words plots the waiting / blocking times of patients based on how the ambulance patients are distributed among hospitals
def make_plot_two_hospitals_arrival_split( lambda_2, lambda_1_1, lambda_1_2, mu_1, mu_2, num_of_servers_1, num_of_servers_2, threshold_1, threshold_2, measurement_type="b", seed_num_1=None, seed_num_2=None, warm_up_time=100, trials=1, accuracy=10, runtime=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def comp_time_plot(p1=database['K+'], p2=database['pi+'], pmax=80, plot=True):\r\n dt = []\r\n p_range = np.linspace(10, pmax, 1000)\r\n m1 = p1.mass\r\n m2 = p2.mass\r\n for p in p_range:\r\n t1_per_m = 76.273/(beta(p, m1)*gamma(p, m1)*c)\r\n t2_per_m = 76.273/(beta(p, m2)*gamma(p, m2...
[ "0.61512375", "0.5727072", "0.55952674", "0.54958403", "0.54581094", "0.5438808", "0.54312366", "0.5414995", "0.53700393", "0.5358794", "0.5342512", "0.5331552", "0.5290692", "0.52683496", "0.524381", "0.5241239", "0.522444", "0.5208598", "0.5199821", "0.51853096", "0.5183255...
0.6441067
0
Navigate and extract data about avalanche status
def navigate_and_extract_avalanche_data(self): self.browser.get(self.url) avalanche_status = {} try: avalanche_level = self.browser.find_element_by_xpath( '//*[@id="law-master"]/div[1]/div[1]/span/span') avalanche_status['avalanche_level'] = avalanche_leve...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_avalanche_status():\n avalanche = AvalancheWarningScraper(\"http://lawiny.topr.pl/\")\n avalanche_status = avalanche.navigate_and_extract_avalanche_data()\n return avalanche_status", "def status(self):", "def getStatus():", "def get_status(self):\n r = requests.get(self.base_url + '/s...
[ "0.7122475", "0.6711828", "0.66904646", "0.64496374", "0.63534707", "0.6331564", "0.6314084", "0.6237637", "0.6213105", "0.61849993", "0.61831856", "0.61782026", "0.6148291", "0.6140133", "0.61341983", "0.61112785", "0.60923004", "0.60923004", "0.60893565", "0.6074108", "0.60...
0.7464375
0
Function for getting a current avalanche status in Tatra Mountain
def get_avalanche_status(): avalanche = AvalancheWarningScraper("http://lawiny.topr.pl/") avalanche_status = avalanche.navigate_and_extract_avalanche_data() return avalanche_status
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getStatus():", "def get_status(self):\n r = requests.get(self.base_url + '/status')\n return r.json()", "def _do_get_status(self):\n logging.info(__name__ + ' : Get status of the device.')\n result = self._execute('X')\n usage = {\n 0: \"Channel not in use\",\n...
[ "0.73289245", "0.6945706", "0.6903834", "0.6889021", "0.68693817", "0.68224365", "0.68129367", "0.67844456", "0.6728177", "0.67269623", "0.6716174", "0.6674203", "0.6642291", "0.66047305", "0.65939426", "0.657994", "0.6577985", "0.65665865", "0.6546385", "0.6546385", "0.65463...
0.731255
1
Return disk usage statistics about the given path.
def disk_usage(path): st = os.statvfs(path) free = (st.f_bavail * st.f_frsize)/ 1024 total = st.f_blocks * st.f_frsize used = (st.f_blocks - st.f_bfree) * st.f_frsize return DiskUsage(total, used, free)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disk_usage(path):\n fs.disk_usage(path)", "def get_diskusage(path):\n st = os.statvfs(path)\n free = st.f_bavail * st.f_frsize\n total = st.f_blocks * st.f_frsize\n used = (st.f_blocks - st.f_bfree) * st.f_frsize\n return float(used)/total", "def disk_usage(path):\n if PY3 and isinstance(path, b...
[ "0.8543308", "0.80476993", "0.801462", "0.7993059", "0.7968749", "0.79601806", "0.7927285", "0.784554", "0.77313477", "0.77012545", "0.7633376", "0.74749327", "0.7420647", "0.7416214", "0.72969544", "0.72623026", "0.7055897", "0.703122", "0.693726", "0.69074285", "0.6878247",...
0.8119913
1
Explain everything available for the given metric.
def explain(self, disp: bool=True) -> Union[None, str]: # Find intersecting methods/attributes between MetricTextExplainer and provided metric. inter = set(dir(self)).intersection(set(dir(self.metric))) # Ignore private and dunder methods metric_methods = [getattr(self,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def explainerdashboard_cli(ctx):", "def fetch_metrics(self):\n\n self.explain_all_indices()", "def explain(self):", "def help_explain(self):\n print(EXPLAIN)", "def describe(self, metric):\n\n return self.fmt_metric.format(\n count=metric.value,\n name=metric.name...
[ "0.648503", "0.6382337", "0.6231688", "0.6109485", "0.60351574", "0.601566", "0.59919626", "0.59380907", "0.58609015", "0.5851201", "0.57744217", "0.5731696", "0.5674738", "0.5631782", "0.56174207", "0.5617261", "0.5616795", "0.5559729", "0.55428743", "0.55428743", "0.5522389...
0.6511468
0
Populates `object` with `attributes` from a mapping.
def set_attributes(object, attributes): for name, attribute in attributes.items(): setattr(object, name, attribute)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_attributes_from_dict(self, dict):\n for key in dict:\n val = dict[key]\n if hasattr(self, key):\n setattr(self, key, val)", "def update(self, f):\n\n for p in self.__mapper__.attrs:\n\n if p.key == 'oid':\n continue\n ...
[ "0.65004426", "0.62904537", "0.62904537", "0.62468666", "0.62062573", "0.6180569", "0.61680084", "0.61148757", "0.6112813", "0.6051751", "0.6012942", "0.5996072", "0.59575933", "0.59540755", "0.5932773", "0.5913263", "0.58975583", "0.5868232", "0.5862673", "0.5854236", "0.582...
0.6646748
0
Populates `object` with attributes from `kwargs` as defined by the default mapping `defaults`. If an item is contained in `kwargs` that is not defined
def set_attributes_from_kwargs(object, kwargs, defaults): set_attributes( object, dict((key, kwargs.pop(key, value)) for key, value in defaults.items()) ) if kwargs: raise TypeError( "set_attributes_from_kwargs() got an unexpected keyword argument " "%r" % kwa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initDefaults(self, kwargs):\n \n for k,v in self.defaults.iteritems():\n if k in kwargs: # use assigned values\n setattr(self, k, kwargs[k])\n else: # use default values\n setattr(self, k, v)\n \n for k,v in kwargs.iteritems():\n ...
[ "0.7175331", "0.6747151", "0.6592914", "0.6470292", "0.64214796", "0.6388719", "0.6304692", "0.6216469", "0.610586", "0.6088044", "0.6087905", "0.60436976", "0.601557", "0.6001094", "0.59770507", "0.59549373", "0.59283787", "0.5908451", "0.59080917", "0.5891961", "0.5891961",...
0.827948
0
Returns ``list(object)`` or a list containing object.
def force_list(object): try: return list(object) except TypeError: return [object]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_list(obj):\n return obj if isinstance(obj, list) else [obj]", "def carries_object(obj=None): #py:carries_object\n if obj is not None:\n ans = RUR._carries_object_(obj)\n else:\n ans = RUR._carries_object_()\n return list(ans)", "def _to_list(obj):\n if not isinstance(obj, l...
[ "0.7728477", "0.7434849", "0.7419359", "0.7394744", "0.7351581", "0.7202986", "0.71388775", "0.7117519", "0.70312494", "0.70102775", "0.70102775", "0.70102775", "0.6860107", "0.6844003", "0.6799226", "0.6786213", "0.66601646", "0.6570251", "0.6544676", "0.6526964", "0.6492086...
0.79207885
0
Splits the given length `n` into a larger and a smaller part using the golden ratio to determine a "perfect" split.
def golden_split(n): large = n / GOLDEN_RATIO small = n - large large = int(round(large)) small = int(round(small)) return large, small
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split(a, n):\n k, m = divmod(len(a), n)\n ret = [a[i*k+min(i, m):(i+1)*k+min(i+1, m)] for i in range(n)]\n return ret", "def split(a, n):\n n = min(n, len(a))\n k, m = divmod(len(a), n)\n return [a[i * k + min(i, m) : (i + 1) * k + min(i + 1, m)] for i in range(n)]", "def splitInBlocks (l...
[ "0.68365747", "0.6783161", "0.6657712", "0.63748825", "0.6367787", "0.6341123", "0.6298543", "0.6281955", "0.6213982", "0.6207446", "0.6180709", "0.6173117", "0.6164623", "0.6087013", "0.6043045", "0.6024858", "0.59773743", "0.5975298", "0.59608966", "0.5950952", "0.59455067"...
0.8150969
0
Raises a CommandDictSanityError exception if the command dictionary is not considered "sane".
def assert_sanity(self): # Maybe in the future: Check whether commands can be found in path # For now, let the OS handle this # Check whether command dictionary has a correct structure. Namely, # that: # # 1. Toplevel children may only be called "commands" or "paths". ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_command_dict(self, command):\n\n if not isinstance(command, dict):\n self.fail(\"Command must be a dictionary\")\n\n # NOTE(pboldin): Here we check for the values not for presence of the\n # keys due to template-driven configuration generation that can leave\n # key...
[ "0.6877361", "0.6581146", "0.6167865", "0.6011121", "0.5824068", "0.5806398", "0.5696506", "0.5690803", "0.5660363", "0.56550825", "0.56041145", "0.5590976", "0.5538971", "0.55288416", "0.5444495", "0.5408569", "0.5354845", "0.5340966", "0.53407615", "0.53329164", "0.531246",...
0.6656696
1
Returns whether the given string matches any of the commands' names regex patterns.
def match(self, string): matched = False cmd = None if string in self.commands.keys(): matched = True cmd = string else: for command in self.commands.keys(): if "regex" in self.commands[command].keys() \ and re.match(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_name_matching(string, matches: bool):\n assert (re.fullmatch(pattern, string) is not None) == matches", "def _is_regex_match(s, pat):\n\n pat = pat.rstrip()\n m = re.search(Settings._REPAT, pat)\n if m:\n flags_combined = 0\n if m.group('flag'):\n char_to_fla...
[ "0.6867948", "0.6496885", "0.6373055", "0.6343486", "0.62946117", "0.627003", "0.62478054", "0.6186492", "0.6147709", "0.6064243", "0.6061243", "0.6040784", "0.60394794", "0.6034066", "0.600563", "0.5999523", "0.5939395", "0.5923962", "0.59091336", "0.589685", "0.589685", "...
0.731758
0
Return the help string of the given command.
def get_help(self,command): if "help" in self.commands[command]: return self.commands[command]["help"] else: return "No help defined for this command."
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def help_for_command(command):\n help_text = pydoc.text.document(command)\n # remove backspaces\n return re.subn('.\\\\x08', '', help_text)[0]", "def help(command=None):\n if command is None: \n # print first line of docstring\n for cmd in commands:\n ds = com...
[ "0.8413381", "0.78988314", "0.7859746", "0.7836614", "0.77694803", "0.7740121", "0.76692426", "0.7644076", "0.76437217", "0.7596462", "0.7582023", "0.7548597", "0.75207776", "0.75028855", "0.74989355", "0.74042505", "0.7392222", "0.7373897", "0.7336396", "0.7305406", "0.72749...
0.8688453
0