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
function that searches the supplied topLevelDirectory and all subdirectories for a file with the supplied filename. The function returns a list of these subdirectories.
def _recursivelyFindFile(self, topLevelDirectory, filename): print ('finding ' + filename + '...\n') tempSubDirs = {} #initialize temporary dictionary of sbudirectories for dirpath, dirnames, filenames in os.walk(topLevelDirectory): #print '---dirpath---' #pri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _findFiles(self, topLevelDirectory, extension=\".py\", foundFiles=None):\n \n #mutable default arguments in Python are evaluated once when the function is defined, not each time the function is called.\n if foundFiles == None:\n foundFiles = []\n \n for dirpath, di...
[ "0.7550634", "0.7520081", "0.73978925", "0.69347054", "0.6927968", "0.68867254", "0.6837273", "0.68335086", "0.67266303", "0.6659477", "0.6631752", "0.66199803", "0.661585", "0.66086143", "0.66044605", "0.6580518", "0.6526532", "0.6522982", "0.6518398", "0.64452434", "0.64362...
0.8207156
0
TestDataFiles list of test data files as full path strings sourceDirectory top level directory containing .py files (all sub directories will be searched) soruceFilename specifies the name of the .py file to search and execute. Set to "" or None to search/execute all .py files in the sourceDirectory. OutputFile destina...
def processFiles(self, testDataFiles, sourceDirectory, sourceFilename, outputFile, language, IncludeSourceInOutput, maxRunTime, interpreter, maxOutputLines, AutoGraderVersion): print ("***Start***") self.sourceDirectory = sourceDirectory #self.TopLevelFilesFound = [] #self.subdi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def runTests(tests_dir, output_dir):\n\n runtime = 0\n os.makedirs(tests_dir, exist_ok=True)\n for test_case in os.listdir(tests_dir):\n print()\n print(\"Running test: \" + str(test_case))\n\n with open(tests_dir + test_case, \"r\") as f:\n tar, n = list(map(int, f.readlin...
[ "0.5858334", "0.58548945", "0.56210285", "0.5557268", "0.5499517", "0.5497129", "0.54950607", "0.5486466", "0.5460872", "0.54320055", "0.5418663", "0.53570765", "0.5352966", "0.5345375", "0.5329319", "0.53110206", "0.5285972", "0.5258661", "0.5232224", "0.5217235", "0.5173087...
0.653266
0
Parse the returned assertion and extract the authorized roles
def get_roles(assertion): awsroles = [] root = ET.fromstring(base64.b64decode(assertion)) for attr in root.iter('{urn:oasis:names:tc:SAML:2.0:assertion}Attribute'): if attr.get('Name') == 'https://aws.amazon.com/SAML/Attributes/Role': for value in attr.iter('{urn:oasis:names:tc:SAML:2.0:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_enumerate_saml_roles(self):\n responses.add(responses.POST, 'https://signin.aws.amazon.com/saml', status=200, body=self.aws_signinpage)\n result = self.resolver._enumerate_saml_roles(self.saml, 'https://signin.aws.amazon.com/saml')\n assert_equals(result[0], self.roles[0])", "def ge...
[ "0.6089463", "0.5919039", "0.5906962", "0.5859451", "0.5767848", "0.5765459", "0.5764582", "0.57421106", "0.57277083", "0.56197065", "0.5550386", "0.55443215", "0.55231065", "0.5503732", "0.55013984", "0.549983", "0.54659164", "0.5463822", "0.54215574", "0.5383732", "0.538077...
0.6972362
0
From given row id, return url that associated with it
def get_url_name(self, row_id): return self.con.execute( "SELECT url FROM urllist WHERE rowid={}".format(row_id) ).fetchone()[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_url_link(row):\n return f'https://twitter.com/-/status/{row[\"id\"]}'", "def make_urls(row):\n mapping = {\n 'base': self.course.moodle.base_url,\n 'cmid': row['cmid'],\n 'subid': row['subid'],\n }\n ...
[ "0.6720539", "0.66282815", "0.63539386", "0.6328725", "0.6227631", "0.618922", "0.617464", "0.617406", "0.6084576", "0.60750395", "0.6059901", "0.59597117", "0.5957162", "0.5860708", "0.5853214", "0.57583296", "0.5711941", "0.56992674", "0.56815934", "0.5676933", "0.5672446",...
0.74011767
0
Explode a path into all its little giblets. _path_ should ideally be normalized first
def explode(self, path): log(6, "explode") gibs = [] head = path while True: if head == "/": gibs.insert(0, head) break head, tail = os.path.split(head) gibs.insert(0, tail) return gibs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_path(path):\n\n if type(path) != str:\n return []\n\n # replace multiple occurrences of \"/\" with just one,\n # i.e. \"page1//page2///page3\" -> \"page1/page2/page3\"\n path = re.sub('/+', '/', path)\n path = path.split(\"/\") # form a list of path steps\n ...
[ "0.76698107", "0.76123106", "0.7573121", "0.74729407", "0.7438995", "0.7427464", "0.72871464", "0.7274829", "0.7265844", "0.72539324", "0.720128", "0.70462716", "0.70108306", "0.6986025", "0.6976125", "0.697396", "0.6894155", "0.6888861", "0.6847659", "0.6845327", "0.68289995...
0.81297004
0
The fuse filesystem is being destroyed. This means we need to unmount everything
def fsdestroy(self): log(6, "fsdestroy") try: self.unmount_all() log(1, "Finished unmounting all objects") except Exception, ex: log(1, "Exception while unmounting all: %s" % str(ex)) log(0, "AutoMounterManager stopped")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unmount(self, mount_point):\n self.fs.remove_nfs_share()\n self.fs.status()\n if self.fs.state == service_states.RUNNING or self.fs.state == service_states.SHUTTING_DOWN:\n log.debug(\"Unmounting volume-based FS from {0}\".format(mount_point))\n if self.fs._is_mounted...
[ "0.68718374", "0.6606354", "0.65473104", "0.65127116", "0.6441814", "0.6437536", "0.6429004", "0.6355785", "0.63284475", "0.6321656", "0.6245772", "0.6219842", "0.62187827", "0.62113124", "0.6202025", "0.6201772", "0.61679333", "0.6135869", "0.61234444", "0.6116619", "0.60814...
0.81425273
0
Records the status after checking if the status is still valid because we might have manually changed it. If the status is "aborted" this will raise an exception
def _set_status(self): result = self._get_status() if result and result[0]['state'] == 'aborted': raise Exception("Aborted because the status flag is set to 'aborted' in dynamodb") # record the status self.status['timestamp'] = time.strftime("%Y-%m-%dT%H:%M:%SZ") sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_status(self, status):\n with self.status_lock:\n if (status in _ENDING_STATUSES) or (not self.status in _ENDING_STATUSES):\n self.status = status", "def mark_succeed(self):\n self.status = self.SUCCEED\n self.traceback = None\n self.save(update_field...
[ "0.7085548", "0.7073398", "0.70725644", "0.68476814", "0.68151516", "0.68151516", "0.68151516", "0.68151516", "0.68151516", "0.68151516", "0.68151516", "0.6758377", "0.671451", "0.6618298", "0.66138417", "0.6605756", "0.6605756", "0.6605756", "0.6605756", "0.6605756", "0.6605...
0.8045362
0
Checks if a resource has changed. The resource is considered changed if the modified_at value is newer than what's found in the tS catalog.
def _has_resource_changed(self, pid, lid, rid, modified_at): # Check the language first # TODO: this is dangerous, because it could accidentally hide resources that have # been updated, but are not the most recent within the language or project. # This would occur if content is created...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _has_project_changed(self, pid, modified_at):\n # look up the existing project entry\n if not self.ts_projects_cache:\n self.ts_projects_cache = self.get_url('https://cdn.door43.org/v2/ts/catalog.json', True)\n\n if not self.ts_projects_cache:\n # The cache could not ...
[ "0.70762604", "0.6878215", "0.6717764", "0.6656025", "0.663378", "0.6578437", "0.6560282", "0.6530706", "0.65098447", "0.65085274", "0.64920926", "0.63653755", "0.6364937", "0.6336979", "0.62775284", "0.6244652", "0.6197715", "0.61543787", "0.610363", "0.61030805", "0.6069613...
0.8119211
0
Checks if a language has changed. The project is considered changed if the modified_at value is newer than what's found in the tS catalog.
def _has_language_changed(self, pid, lid, modified_at): if not self._has_project_changed(pid, modified_at): return False # look up the existing language entry cache_key = pid if cache_key in self.ts_languages_cache: ts_languages = self.ts_languages_cache[cache_ke...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _has_project_changed(self, pid, modified_at):\n # look up the existing project entry\n if not self.ts_projects_cache:\n self.ts_projects_cache = self.get_url('https://cdn.door43.org/v2/ts/catalog.json', True)\n\n if not self.ts_projects_cache:\n # The cache could not ...
[ "0.7401941", "0.61818945", "0.6128782", "0.60022056", "0.5931347", "0.5921455", "0.5861007", "0.58519375", "0.5762258", "0.57601434", "0.561789", "0.56158644", "0.5609738", "0.558821", "0.5580303", "0.5558286", "0.5552089", "0.5543604", "0.5516076", "0.546871", "0.5409004", ...
0.8285521
0
Checks if a project has changed. The project is considered changed if the modified_at value is newer than what's found in the tS catalog.
def _has_project_changed(self, pid, modified_at): # look up the existing project entry if not self.ts_projects_cache: self.ts_projects_cache = self.get_url('https://cdn.door43.org/v2/ts/catalog.json', True) if not self.ts_projects_cache: # The cache could not be built, s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _has_language_changed(self, pid, lid, modified_at):\n if not self._has_project_changed(pid, modified_at):\n return False\n\n # look up the existing language entry\n cache_key = pid\n if cache_key in self.ts_languages_cache:\n ts_languages = self.ts_languages_ca...
[ "0.6608448", "0.62485075", "0.6246239", "0.62146497", "0.6209279", "0.6057223", "0.6039296", "0.59752095", "0.59424555", "0.5919339", "0.5877836", "0.5823839", "0.5823673", "0.5816495", "0.58046544", "0.5760127", "0.5745426", "0.5737631", "0.5680471", "0.5646746", "0.5628336"...
0.8611912
0
Retrieves the catalog status from AWS or generates a new status object
def _get_status(self): status_results = self.db_handler.query_items({ 'api_version': { 'condition': 'is_in', 'value': ['3', TsV2CatalogHandler.api_version] } }) source_status = None status = None for s in status_results: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _publish_status(self, state='complete'):\n self.logger.debug('Recording catalog status: \"{}\"'.format(state))\n self.status_table.update_item(\n {'api_version': self.api_version},\n {\n 'state': state,\n 'timestamp': time.strftime(\"%Y-%m-%dT%H...
[ "0.5842416", "0.5779533", "0.5716072", "0.57152647", "0.5710317", "0.56629914", "0.5654295", "0.56030715", "0.55755556", "0.55243444", "0.54945457", "0.5469161", "0.545362", "0.5453588", "0.5452727", "0.54168135", "0.539727", "0.53720915", "0.53701717", "0.5365849", "0.535000...
0.68775237
0
Converts a tsv tN to json This will write a bunch of files and return a list of files to be uploaded. Chunk definitions will be used to validate the note organization.
def _tn_tsv_to_json_file(self, lid, rid, resource, format, temp_dir): rc_dir = None tn_uploads = {} for project in resource['projects']: pid = Handler.sanitize_identifier(project['identifier']) # skip re-processing notes that have not changed if not self._ha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tsv_to_json(tsv_file, json_file):\n import csv\n import json\n\n try:\n with open(tsv_file, 'r') as tsvFile:\n file_reader = csv.DictReader(tsvFile, dialect='excel-tab')\n row_list = list(file_reader)\n with open(json_file, 'w+') as jsonFile:\n jsonFile.w...
[ "0.6287887", "0.5828308", "0.5657119", "0.5509568", "0.5450657", "0.54097766", "0.5404596", "0.53840286", "0.5382275", "0.5370569", "0.53396285", "0.5337632", "0.5293686", "0.5287006", "0.5282376", "0.52487564", "0.52240163", "0.52133644", "0.52116126", "0.5199401", "0.518998...
0.7024923
0
Converts a markdown tN to json This will write a bunch of files and return a list of files to be uploaded. Chunk definitions will be used to validate the note organization.
def _tn_md_to_json_file(self, lid, rid, resource, format, temp_dir): rc_dir = None # dc = manifest['dublin_core'] note_general_re = re.compile('^([^#]+)', re.UNICODE) note_re = re.compile('^#+([^#\n]+)#*([^#]*)', re.UNICODE | re.MULTILINE | re.DOTALL) tn_uploads = {} for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _tn_tsv_to_json_file(self, lid, rid, resource, format, temp_dir):\n rc_dir = None\n tn_uploads = {}\n\n for project in resource['projects']:\n pid = Handler.sanitize_identifier(project['identifier'])\n\n # skip re-processing notes that have not changed\n if...
[ "0.6344763", "0.56117034", "0.55882", "0.55590117", "0.54166687", "0.5309596", "0.5284161", "0.52304375", "0.5217077", "0.5205072", "0.5193745", "0.51805896", "0.51759696", "0.51520085", "0.513744", "0.5126709", "0.5115319", "0.51060015", "0.5102363", "0.5081005", "0.50793624...
0.68411016
0
Uploads an array or object of uploads
def _upload_all(self, uploads): for upload in uploads: if isinstance(upload, dict): self._upload(upload) elif upload in uploads and isinstance(uploads[upload], dict): self._upload(uploads[upload]) else: raise Exception('invalid ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upload(self, upload_request):\n raise NotImplementedError", "def _push_one(self, f, **kwargs):\n\n d = self.UploaderClass(f, **kwargs)\n\n # Submit the data to the database\n d.submit(self.session)\n self.uploaded += 1", "def upload():\n form = request.form\n\n # Cr...
[ "0.66418415", "0.63498193", "0.6319431", "0.6243183", "0.61784554", "0.613065", "0.61166734", "0.6068921", "0.60282904", "0.60089517", "0.59934026", "0.5990462", "0.5968611", "0.59029204", "0.589653", "0.588855", "0.5871534", "0.58557636", "0.58421385", "0.58269334", "0.57936...
0.7359937
0
Adds supplementary helps to the catalog nodes
def _add_supplement(self, catalog, language, resource, project, modified, rc_type): lid = TsV2CatalogHandler.sanitize_identifier(language['identifier'], lower=False) if rc_type == 'help': pid = TsV2CatalogHandler.sanitize_identifier(project['identifier']) # tricky some language...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_help(text):\n global default_text\n default_text += text", "def help_topics():\n pass", "def help(self):\n\t\treturn", "def register_adhocs(self):\n aboutform = self.plugin['xep_0004'].makeForm('form', \"About SleekBot\")\n aboutform.addField('about', 'fixed', value= self.__doc...
[ "0.54287606", "0.5400425", "0.5341948", "0.53206855", "0.52837545", "0.52723825", "0.5252786", "0.5245184", "0.5245184", "0.5211561", "0.5211561", "0.5193121", "0.51425326", "0.5129569", "0.5126871", "0.5126871", "0.5119559", "0.51122063", "0.51097953", "0.5090103", "0.506821...
0.626978
0
Initializes a node in the catalog.
def _init_catalog_node(catalog, pid, lid=None, rid=None): if pid not in catalog: catalog[pid] = {'_langs': {}} if lid is not None: if lid not in catalog[pid]['_langs']: catalog[pid]['_langs'][lid] = {'_res': {}, 'language': {}} if lid is not None and rid is not None: if r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(self, node: MComputeNode):\n raise Exception(\"Subclass responsibility\")", "def __init__(self, node: Dict):\n self._node = node", "def __init__(self):\n self.root = Node(None)", "def __init__(self):\n self.root = self.Node(None)", "def __init__(self, init=None):\...
[ "0.7146868", "0.6976427", "0.6618559", "0.65859544", "0.6558311", "0.6545779", "0.6532684", "0.64925367", "0.64925367", "0.64806145", "0.6475264", "0.6399967", "0.6398857", "0.6378174", "0.6364687", "0.6352918", "0.6352091", "0.63366604", "0.6326704", "0.6310116", "0.6310116"...
0.71477777
0
Removes the last ratelimit rest time file
def _remove_last_reset(self): if os.path.exists(Flag._PATH): logger.id(logger.debug, self, 'Removing ratelimit reset time file \'{path}\' ...', path=Flag._PATH, ) try: os.remove(Flag._PATH) except (IOError,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rest_rate_limit(r):\n\n try:\n #limit = int(r.headers[\"X-Rate-Limit-Limit\"])\n remain = int(r.headers[\"X-Rate-Limit-Remaining\"])\n reset = int(r.headers[\"X-Rate-Limit-Reset\"])\n curtime = times.to_unix(times.parse(r.headers[\"date\"]))\n ...
[ "0.6226642", "0.6022472", "0.5696924", "0.55945194", "0.5580119", "0.5545274", "0.5543366", "0.54976726", "0.54873484", "0.54704624", "0.5469926", "0.5389245", "0.53607106", "0.5343382", "0.53394014", "0.5334385", "0.53272206", "0.5320837", "0.52874607", "0.5230414", "0.52289...
0.6559461
0
If the reset_time is a positive value > 0, then this will set the internal event flag and assign the given value. If the reset_time is negative or zero then this will assign the value to 0.0 and clear the flag.
def value(self, reset_time): # XXX: I'm not 100% sure locking is necessary. I suppose logging could # become a bit confusing if 2+ processes raced in setting the value # without it. with self.__lock: if ( isinstance(reset_time, integer_types + (float,)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_timer():\n resetTimer = time.time()\n target_time.clear()\n target_time.append(resetTimer)", "def OnResetPress(self, event):\n\t\tself.oldmax = 0.0001\n\t\tself.oldmin = -0.0001\n\t\tself.maxBox.SetValue(str(self.oldmax).encode('utf-8'))\n\t\tself.minBox.SetValue(str(self.oldmin).e...
[ "0.57198554", "0.57192475", "0.5715199", "0.56856936", "0.5583326", "0.5541438", "0.55366665", "0.55353844", "0.54860395", "0.54803854", "0.5450156", "0.5444533", "0.5394179", "0.53627306", "0.531604", "0.5291318", "0.5291318", "0.5272735", "0.5266598", "0.5262755", "0.526115...
0.69975996
0
Waits the remaining ratelimit time, if any. event ({threading,multiprocessing}.Event, optional) The object to use to wait out the remaining time (with the object's .wait attribute). If this is not specified, waiting will take place with time.sleep (meaning processes will become unresponsive during the wait period).
def wait_out_ratelimit(self, event=None): delay = self.remaining if delay > 0: if not (event or hasattr(event, 'wait')): logger.id(logger.debug, self, 'No \'wait\' method found for event=\'{event}\'!' ' Using time.sleep ...', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rate_limit(wait_time=60):\n \n if \"prev_time\" not in globals():\n global prev_time\n prev_time = time.time() - wait_time\n \n current_time = time.time()\n delta = current_time - prev_time\n \n if delta < wait_time:\n time.sleep(wait_time - delta)\n \n prev_time...
[ "0.711963", "0.6526425", "0.62215054", "0.6094687", "0.6041686", "0.5953783", "0.59283924", "0.59021276", "0.5891033", "0.58445835", "0.5833507", "0.57827", "0.574459", "0.56988645", "0.56965595", "0.5686715", "0.56674105", "0.5667251", "0.56511384", "0.564738", "0.5633822", ...
0.8368478
0
Handles a reddit ratelimit queued private massage Returns True if the pm was attempted
def _handle_pm(self, to, subject, body): logger.id(logger.info, self, 'Sending pm \'{subject}\' to {color_to} ...', subject=subject, color_to=to, ) success = self._reddit.do_send_pm(to, subject, body, self._killed) if success or success is...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_limit(self, track):\n print ('Got Rate limit Message', str(track))\n return True # Don't kill the stream", "def handle_rate_limit(rate_limit):\n remaining = rate_limit['remaining']\n limit = rate_limit['limit']\n percent_remaining = remaining / limit\n reset_at = rate_limit['rese...
[ "0.6339348", "0.60866237", "0.59187907", "0.5832401", "0.5820157", "0.5815185", "0.57580453", "0.57412684", "0.5729509", "0.56530505", "0.5651352", "0.5651352", "0.5651352", "0.55641353", "0.5563259", "0.55512303", "0.55252403", "0.54568434", "0.5452692", "0.5438209", "0.5410...
0.66714287
0
Handles a reddit ratelimit queued reply Returns True if a reply was attempted for the thing
def _handle_reply(self, fullname, body): handled = False thing = self._reddit.get_thing_from_fullname(fullname) if thing: logger.id(logger.info, self, 'Processing {color_thing} ...', color_thing=reddit.display_id(thing), ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_refill_questionnaire_response(self, sender, message, response):\n\t\tnow = datetime.datetime.now()\n\t\tmessage.datetime_responded = now\n\t\tmessage.save()\n\n\t\tdef process_response(return_message_type):\n\t\t\tfor feedback in message.feedbacks.all():\n\t\t\t\tfeedback.note = Message.REFILL_QUESTION...
[ "0.61913306", "0.6163918", "0.5997073", "0.59931546", "0.58691007", "0.5846038", "0.5695308", "0.5693497", "0.5690743", "0.566868", "0.5644028", "0.56277746", "0.56277746", "0.56258667", "0.55768", "0.5575846", "0.55531144", "0.55476016", "0.5543178", "0.5529905", "0.55045235...
0.74959105
0
Handles a reddit ratelimit queued submit Returns True if a submit was attempted
def _handle_submit(self, display_name, title, selftext, url): logger.id(logger.info, self, 'Posting \'{title}\' to {subname} ...', title=title, subname=display_name, ) if selftext: logger.id(logger.debug, self, 'self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkSubmissions(limit=submission_read_limit):\n submissions = subreddit.get_new(limit=limit)\n internal_count = 0\n\n print(\"\\n---\\n%s - Checking latest submissions...\" % (datetime.now()))\n for submission in submissions:\n if submission.id in already_processed:\n print(\"%s - Skipping previou...
[ "0.65003824", "0.6483795", "0.6280299", "0.5913259", "0.59128916", "0.5876423", "0.5873963", "0.57745117", "0.57587105", "0.5666587", "0.56645757", "0.56128764", "0.5571391", "0.5549526", "0.5486038", "0.54852647", "0.5472903", "0.54694796", "0.54634714", "0.5454834", "0.5454...
0.7490214
0
Add movie validation func
def add_movie_validation(movie): if len(movie['title']) < 7: raise ValueError('title must contain more than 7 characters') if len(movie['year']) != 4: raise ValueError('invalid year') return AddMovie(movie['title'], movie['year']).add_movie_to_db()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate():", "def check(self):\n #\n # *****************\n # *****************\n # TODO: Check really if video is valid\n # *****************\n # *****************\n return True", "def validare(film):\n\n erori = []\n if not film.get_fid():\n erori.append(\"Tr...
[ "0.63304836", "0.5918251", "0.58101463", "0.57390463", "0.5687817", "0.56617826", "0.56617826", "0.56306386", "0.55565196", "0.55416703", "0.55413604", "0.55250627", "0.5421916", "0.5408238", "0.53783095", "0.53781193", "0.53556925", "0.53260714", "0.53187644", "0.53076124", ...
0.759818
0
Generates two concentric circular clusters.
def concentric_clusters(N = 1000, r1 = 1, r2 = 5, w1 = 0.8, w2 = 1.0/3, arms = 64): #Number of samples in each cluster N1 = int(np.floor(1.0*N/2)) N2 = N - N1 phi1 = np.random.rand(N1,1) * 2 * np.pi; dist1 = r1 + 1.0*(np.random.randint(0,5,size =(N1,1)))/5*w1*r1 d1x = dist1* np.cos(phi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_clusters(img, p1, p2, k, label, thres, padding):\n for i in range(k):\n color = np.random.uniform(low=0, high=255, size=3)\n index = np.where(label == i)[0]\n if len(index) <= thres:\n continue\n\n # plot for one cluster\n start = p1[index]\n end = p...
[ "0.61204505", "0.59343404", "0.5933312", "0.5890063", "0.58305556", "0.5800319", "0.5773677", "0.57617295", "0.57443833", "0.5687551", "0.5668759", "0.562352", "0.56228197", "0.5612006", "0.5607324", "0.5604141", "0.5598415", "0.55674887", "0.5566646", "0.5534982", "0.5519715...
0.753204
0
Create a file for a solid image of color
def generate_image_file(color): img = generate_image(color) img.save(IMAGE_FILE) return IMAGE_FILE
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_image_file(\n file_format: str,\n color_space: str,\n width: int,\n height: int,\n) -> io.BytesIO:\n image_buffer = io.BytesIO()\n image = Image.new(color_space, (width, height))\n # If this assertion ever fails, see\n # https://github.com/VWS-Python/vws-test-fixtures for what to d...
[ "0.6825712", "0.6646357", "0.662008", "0.6607348", "0.65337026", "0.6445385", "0.63997656", "0.63832796", "0.6350531", "0.6315154", "0.62894493", "0.6285264", "0.6272988", "0.620853", "0.61948115", "0.6174886", "0.6170848", "0.614884", "0.6141745", "0.6115158", "0.6081208", ...
0.7431677
0
Get color to start with on boot
def get_initial_color(): if os.path.isfile(DATA_FILE): with open(DATA_FILE, 'r') as f: data = f.readline() print data return int(data, base=16) else: return INITIAL_COLOR
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_color(self):\n return self._io.last_state['color']['front-center']", "def getInitialColor(self):\n return self.__initial_color__", "def color(self):\n return self.container['color']", "def _get_color(self):\n return self.__color", "def _get_color(self):\n return self.__co...
[ "0.7112875", "0.70664465", "0.6934621", "0.68973875", "0.68973875", "0.68973875", "0.68973875", "0.68102574", "0.67677927", "0.67656684", "0.66816574", "0.6667481", "0.66659665", "0.6665176", "0.6644466", "0.66428465", "0.6640031", "0.66022485", "0.65955687", "0.65675217", "0...
0.711943
0
Subroutine to extract bond label, site indices, and length from a LOBSTER header line. The site indices are zerobased, so they can be easily used with a Structure object.
def _get_bond_data(line): orb_labs = ["s", "p_y", "p_z", "p_x", "d_xy", "d_yz", "d_z^2", "d_xz", "d_x^2-y^2", "f_y(3x^2-y^2)", "f_xyz", "f_yz^2", "f_z^3", "f_xz^2", "f_z(x^2-y^2)", "f_x(x^2-3y^2)"] line = line.rsplit("(", 1) # bondnumber = line[0].replac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_header(stream: IO[bytes]) -> Tuple[int, int]:\n type_id = stream.read(4)\n if type_id != b\"DIRC\":\n raise AssertionError(\"Invalid index file header: %r\" % type_id)\n unpacked = cast(Tuple[int, int], unpack(\">LL\", stream.read(4 * 2)))\n version, num_entries = unpacked\n\n # TODO...
[ "0.56756777", "0.56250983", "0.56105626", "0.5607831", "0.55378056", "0.5531221", "0.55022323", "0.5480444", "0.54433537", "0.5376723", "0.5372415", "0.5318277", "0.52993816", "0.52694535", "0.52580434", "0.52561694", "0.52406824", "0.52056736", "0.51974547", "0.51712704", "0...
0.61227655
0
get a Structure with Mulliken and Loewdin charges as site properties
def get_structure_with_charges(self, structure_filename): struct = Structure.from_file(structure_filename) Mulliken = self.Mulliken Loewdin = self.Loewdin site_properties = {"Mulliken Charges": Mulliken, "Loewdin Charges": Loewdin} new_struct = struct.copy(site_properties=site_p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data_lettings(self):\n return {\n 'search_type': SearchForm.SEARCH_TYPE_LETTING,\n 'min_price': '100',\n 'max_price': '200',\n 'location':'Test, Test',\n 'min_bedrooms': '5',\n 'property_type': str(PropertyTypeFactory().slug)\n ...
[ "0.5586091", "0.5558136", "0.5553086", "0.54046535", "0.53845775", "0.5368961", "0.52480817", "0.5234329", "0.52110684", "0.5201036", "0.51969266", "0.51390004", "0.512777", "0.51253015", "0.5111007", "0.5083894", "0.5081463", "0.50757927", "0.5063948", "0.5013934", "0.500072...
0.58572996
0
Return limit for query
def get_limit(self): return self.limit
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def limit(self, limit):\n\n return self._get(\"limit\", limit, Table)", "def limit(self, limit):\n\n # Return between 1 and 250 results, defaults to 10\n return max(1, min(250, int(limit) if limit else 10))", "def get_limit(self):\n return self._limit", "def get_limit(self):\n ...
[ "0.81352514", "0.77939844", "0.76763755", "0.76763755", "0.7626401", "0.7626401", "0.741227", "0.7350668", "0.7303903", "0.7247242", "0.724548", "0.70365584", "0.6975084", "0.69560474", "0.69087255", "0.6908423", "0.68746424", "0.6867595", "0.6838494", "0.6702438", "0.6676086...
0.7910961
1
Returns the current pager's max record limit.
def get_max_record_limit(self): return self.max_record_limit
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_limit(self):\n return self.limit", "def get_limit(self):\n return self._limit", "def get_limit(self):\n return self._limit", "def limit(self):\n return self._limit", "def limit(self):\n return self._limit", "def get_max_per_page(self):\n return self.max_p...
[ "0.79489917", "0.7935458", "0.7935458", "0.76866376", "0.76866376", "0.7611077", "0.74051446", "0.73823917", "0.72391516", "0.71339834", "0.7114713", "0.7088168", "0.70171744", "0.6955063", "0.6900978", "0.68910086", "0.68852997", "0.68765527", "0.6857013", "0.6851564", "0.68...
0.87542504
0
Sets the current pager's max record limit.
def set_max_record_limit(self, limit): self.max_record_limit = limit
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def limit(self, limit):\n self._limit = limit", "def limit(self, limit):\n\n self._limit = limit", "def limit(self, limit):\n\n self._limit = limit", "def limit(self, limit):\n\n self._limit = limit", "def limit(self, limit):\n self._limit = limit\n return self", ...
[ "0.7553853", "0.7453811", "0.7453811", "0.7453811", "0.73704815", "0.73585373", "0.72966903", "0.72817314", "0.72808117", "0.7088113", "0.70641845", "0.7023995", "0.6950664", "0.6950664", "0.6940453", "0.68355906", "0.6828216", "0.68182147", "0.6778329", "0.6778268", "0.67564...
0.86914104
0
Returns the current pager's max link
def get_current_max_link(self): return self.current_max_link
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_num_links(self):\n return self._max_num_links", "def get_latest(self):\n self.cprint(\"##\\tGetting max page number...\\n\", log=True)\n return 1", "def _get_max_pagenum(self, pagetree):\n browse_links = [x.get('href') for x in\n pagetree.findall('body/t...
[ "0.7442582", "0.7362153", "0.72352827", "0.7100136", "0.6990577", "0.68222857", "0.6790856", "0.67256737", "0.67067933", "0.66805714", "0.6649659", "0.65908897", "0.6553207", "0.6353793", "0.63469964", "0.63403815", "0.6323697", "0.63049996", "0.62853974", "0.6251444", "0.623...
0.85469484
0
Returns an array of page numbers to use in pagination links. nb_links The maximum number of page numbers to return
def get_links(self, nb_links=5): page = self.page last_page = self.last_page links = [] tmp = page - floor(nb_links / 2) check = last_page - nb_links + 1 if check > 0: limit = check else: limit = 1 if tmp > 0: if tmp > ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAllPageNumbers(self):\n\t\tfor subpage in self.subpages:\n\t\t\thtmlcontent = self.HttpHandler.getHtmlContentFromLink(subpage.link)\n\t\t\tsoupPage = BeautifulSoup(htmlcontent, \"html.parser\")\n\t\t\tsubpage.setNbrPages( self.getNbrPages(soupPage) )", "def generatePageLinks(link, pagesTotal):\n return...
[ "0.67767614", "0.66668475", "0.6581526", "0.6544281", "0.6473654", "0.6430942", "0.6334195", "0.6287547", "0.62116545", "0.6198174", "0.61610657", "0.6151517", "0.61213887", "0.6094009", "0.6094009", "0.608988", "0.6084914", "0.60665625", "0.6037432", "0.60239434", "0.6021384...
0.798261
0
Returns true if the current query requires pagination.
def have_to_paginate(self): if self.get_max_per_page() and self.get_nb_results() > self.get_max_per_page(): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _should_paginate(self) -> bool:\n pagination_keys = [\n self.paginator.page_query_param,\n self.paginator.page_size_query_param,\n ]\n query_param_keys = self.request.query_params\n return any(k in query_param_keys for k in pagination_keys)", "def _has_next_p...
[ "0.8175899", "0.73145914", "0.70417434", "0.70417434", "0.70417434", "0.70417434", "0.70417434", "0.70417434", "0.70417434", "0.70417434", "0.70417434", "0.70417434", "0.70417434", "0.70417434", "0.70417434", "0.70417434", "0.70417434", "0.70417434", "0.70417434", "0.69554883",...
0.7965159
1
Returns the first index on the current page.
def get_first_indice(self): if self.page == 0: return 1 else: return (self.page - 1) * self.max_per_page + 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_index(self):\r\n return (self.per_page * (self.page_number - 1)) + 1", "def get_first_page(self):\n return 1", "def start_index(self):\n # Special case, return zero if no items.\n if self.paginator.count == 0:\n return 0\n return (self.paginator.per_page ...
[ "0.7768804", "0.7615722", "0.73565614", "0.7356181", "0.7296621", "0.71976024", "0.7141875", "0.7104297", "0.6906977", "0.6890257", "0.68523365", "0.6821842", "0.6767048", "0.6731489", "0.67240673", "0.6714828", "0.66942763", "0.6632632", "0.65763175", "0.6571891", "0.6565705...
0.800285
0
Returns the number of results.
def get_nb_results(self): return self.nb_results
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_count(results):\n return len(results)", "def _count(self):\n if self._count_valid:\n return self._total_results\n\n result = self._cb.get_object(self._doc_class.urlobject.format(self._cb.credentials.org_key))\n results = result.get(\"results\", [])\n\n self....
[ "0.8872957", "0.8155524", "0.7989299", "0.79066825", "0.7897011", "0.7864037", "0.7813669", "0.7787369", "0.7787369", "0.7786581", "0.7718128", "0.77066046", "0.7700788", "0.7695585", "0.7695585", "0.7695585", "0.7695585", "0.7632214", "0.7632199", "0.7553458", "0.75449497", ...
0.8176379
1
Sets the number of results.
def set_nb_results(self, nb): self.nb_results = nb
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def number_results(self):\n pass", "def setCount(self, num):\n self.count=num", "def nextNumberOfResults(self, N=10):\n self.start += self.N\n self.N = N", "def setIterationCount(self, newIterationCount):\n \n pass", "def number_of_results(self, number_of_results):\n ...
[ "0.7870212", "0.7435778", "0.7331038", "0.6942989", "0.69175357", "0.68804634", "0.67802674", "0.6683464", "0.6683464", "0.65732276", "0.64857334", "0.646335", "0.64513004", "0.6440836", "0.6440836", "0.64106405", "0.63947785", "0.63795024", "0.63475966", "0.63353086", "0.633...
0.78018475
1
Returns the first page number.
def get_first_page(self): return 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_first_indice(self):\n if self.page == 0:\n return 1\n else:\n return (self.page - 1) * self.max_per_page + 1", "def page_from(self):\n return 0 if self.page_size == 0 else self.page_slice[0] + 1", "def current_page(self):\n if self.limit > 0 and self.of...
[ "0.8168604", "0.75857526", "0.73652774", "0.72121525", "0.71576184", "0.7095323", "0.70897746", "0.70810604", "0.7051025", "0.69954103", "0.69954103", "0.6956509", "0.6942694", "0.68520117", "0.68420076", "0.67872316", "0.67859066", "0.6734301", "0.66398805", "0.66287076", "0...
0.82806826
0
Returns the last page number.
def get_last_page(self): return self.last_page
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last_page_num(page):\n start_link = page.find('<div class=\"pagenav\"')\n if start_link == -1:\n return None\n start_quote = page.find('>Page', start_link)\n end_quote = page.find('</td>', start_quote)\n end_num = long(page[start_quote + 11:end_quote])\n return end_num", "def get...
[ "0.85164773", "0.81294745", "0.7778617", "0.73953813", "0.7363314", "0.73325825", "0.72085506", "0.71928555", "0.70221066", "0.701898", "0.7014715", "0.69991237", "0.69630224", "0.6945348", "0.69283116", "0.69283116", "0.68939614", "0.68690485", "0.6837882", "0.67876756", "0....
0.8651399
0
Sets the last page number.
def set_last_page(self, page): self.last_page = page if self.get_page() > page: self.set_page(page)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_page(self, last_page):\n\n self._last_page = last_page", "def __goToLastPage(self):\n try:\n self.currenturi = self.__baseuri + self.soup.find('li', \\\n 'lia-component-pagesnumbered').findAll('a', text=re.compile\\\n ('^\\d+$'))...
[ "0.8215517", "0.69604975", "0.6901287", "0.68505317", "0.6722965", "0.6489288", "0.6430108", "0.64163125", "0.6392034", "0.6353783", "0.6248091", "0.6230042", "0.619774", "0.6163872", "0.60937995", "0.60519964", "0.6001332", "0.59572214", "0.5896831", "0.57978165", "0.5753367...
0.8244133
0
Returns the previous page.
def get_previous_page(self): return max((self.get_page() - 1), self.get_first_page)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def previous_page(self):\r\n if self.page.has_previous():\r\n previous = self.page.previous_page_number()\r\n if previous == 1:\r\n if 'page' in self.query_dict:\r\n del self.query_dict['page']\r\n else:\r\n self.query_dict['p...
[ "0.8749151", "0.8388934", "0.8380303", "0.823262", "0.808367", "0.80098003", "0.7963638", "0.7884085", "0.76949674", "0.7668201", "0.7658989", "0.7594885", "0.754657", "0.7489929", "0.7489792", "0.7475683", "0.74149054", "0.7411161", "0.7359965", "0.73284125", "0.7317398", ...
0.8824343
0
Returns the maximum number of results per page.
def get_max_per_page(self): return self.max_per_page
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last_indice(self):\n if self.page == 0:\n return self.nb_results\n else:\n if (self.page * self.max_per_page) >= self.nb_results:\n return self.nb_results\n else:\n return self.page * self.max_per_page", "def pagecount(self):\r\...
[ "0.8006906", "0.7954271", "0.7800238", "0.76228964", "0.75923413", "0.75734687", "0.75641793", "0.75478643", "0.7543484", "0.7373653", "0.7333974", "0.7324944", "0.72309303", "0.7211038", "0.7211038", "0.71453214", "0.71294796", "0.7101028", "0.70472026", "0.70350814", "0.702...
0.795954
1
Sets the maximum number of results per page.
def set_max_per_page(self, max_per_page): if max_per_page > 0: self.max_per_page = max_per_page if self.page == 0: self.page = 1 elif max_per_page == 0: self.max_per_page = 0 self.page = 0 else: self.max_per_page = 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_results(self, max_results: float):\n\n self._max_results = max_results", "def paging_results(self):\n\n return 30", "def max_num_links(self, max_num_links):\n self._max_num_links = max_num_links", "def referencesearchservlet_max_pages(self, referencesearchservlet_max_pages):\n\n ...
[ "0.71293044", "0.7025348", "0.6938397", "0.6830816", "0.6801889", "0.67935455", "0.6776358", "0.6746384", "0.67307943", "0.663617", "0.6603123", "0.6603123", "0.6603123", "0.65810364", "0.6514217", "0.64977545", "0.6493299", "0.6493219", "0.6486678", "0.647359", "0.6461834", ...
0.78552073
0
Returns true if on the first page.
def is_first_page(self): return 1 == self.page
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_first_page(self):\n return 1", "def first_page(self):\n if self._start == 0:\n raise ValueError('Already at the first page.')\n self._start = 0", "def has_next_page(self):\n if self.page_number == 0:\n return True\n\n return self.next_page_token ...
[ "0.7817008", "0.7547642", "0.6959636", "0.6921293", "0.679793", "0.6703214", "0.6696315", "0.6503117", "0.648972", "0.648972", "0.648972", "0.63901395", "0.63025033", "0.6257853", "0.6228082", "0.6219849", "0.6212617", "0.61974776", "0.61801976", "0.61707497", "0.61435103", ...
0.93354875
0
Returns true if on the last page.
def is_last_page(self): return self.page == self.last_page
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_last_page(soup):\n meta = soup.find(\"meta\", {\"property\": \"og:url\"})\n if meta.has_attr(\"content\"):\n page_number = re.search(r\".*/(\\d+)_p/\", meta.attrs[\"content\"])\n if page_number:\n return page_number.group(1) == \"20\"\n if re.search(r\"/rentals/$\", met...
[ "0.8109478", "0.78920317", "0.76813203", "0.7673365", "0.76597255", "0.75160456", "0.7422407", "0.73678666", "0.73678666", "0.73678666", "0.73592925", "0.7141075", "0.71383584", "0.7104878", "0.6989957", "0.68946505", "0.6821887", "0.6781267", "0.6764464", "0.66658896", "0.66...
0.9281548
0
Executes quicksort on inputList.
def quicksort(inputList): if not inputList: return [] else: return quicksort(filter(lambda x: x < inputList[len(inputList)/2], inputList))+[inputList[len(inputList)/2]]+quicksort(filter(lambda x: x > inputList[len(inputList)/2], inputList))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quick_sort(mylist):\n _inplace_quick_sort(mylist, 0, len(mylist)-1)", "def QuickSort(ulist):\n __QuickSortHelper(ulist, 0, len(ulist)-1)", "def qsort(my_list):\n\n comparisions = quickSortHelper(my_list,0,len(my_list)-1)\n return (my_list, comparisions)", "def quicksort(in_list: List, pivot_...
[ "0.76848584", "0.7678752", "0.7622072", "0.75071037", "0.748489", "0.7467531", "0.7251108", "0.72012806", "0.70893925", "0.70879626", "0.7083599", "0.70389503", "0.7028224", "0.7013019", "0.7008503", "0.6986552", "0.6975758", "0.6968539", "0.68882895", "0.6842368", "0.6819460...
0.8110972
0
Parallel equivalent of make. Uses multiprocessing.Process as a backend and a Python queue to communicate with the workers.
def parmake(job_list, context, cq, n=DefaultsToConfig('max_parallel_jobs'), recurse=DefaultsToConfig('recurse'), new_process=DefaultsToConfig('new_process'), echo=DefaultsToConfig('echo')): publish(context, 'parmake-status', status='Obtaining job list') job_list ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, mk_func, *args,\n processes = 1,\n verbose = False,\n queue = SimpleQueue,\n pass_pid = False):\n # Create basic queues:\n todo, done = SimpleQueue (), SimpleQueue ()\n \n pool_size = processes if processes > 0 else max (1, cpu_co...
[ "0.6979401", "0.6387887", "0.63392293", "0.633868", "0.62394094", "0.619568", "0.619568", "0.61446136", "0.61238134", "0.6120578", "0.6113924", "0.60769945", "0.60741514", "0.60654545", "0.6046439", "0.6001655", "0.5988738", "0.5988237", "0.59847414", "0.5981137", "0.59801245...
0.6523212
1
Parallel equivalent of "remake".
def parremake(non_empty_job_list, context, cq, n=DefaultsToConfig('max_parallel_jobs'), recurse=DefaultsToConfig('recurse'), new_process=DefaultsToConfig('new_process'), echo=DefaultsToConfig('echo')): # TODO: test this db = context.get_compmake_db() non_emp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rparmake(job_list, context, cq,\n n=DefaultsToConfig('max_parallel_jobs'),\n new_process=DefaultsToConfig('new_process'),\n echo=DefaultsToConfig('echo')):\n return parmake(job_list=job_list, context=context,\n cq=cq, n=n, new_process=new_process, echo=echo...
[ "0.5994915", "0.5646618", "0.5564523", "0.54265505", "0.5381849", "0.52669936", "0.52580404", "0.525772", "0.52371174", "0.5141005", "0.5046068", "0.5043012", "0.5009399", "0.4987529", "0.49820653", "0.49780262", "0.49424002", "0.493208", "0.49066493", "0.48672193", "0.486245...
0.58437234
1
Shortcut to parmake with default recurse = True.
def rparmake(job_list, context, cq, n=DefaultsToConfig('max_parallel_jobs'), new_process=DefaultsToConfig('new_process'), echo=DefaultsToConfig('echo')): return parmake(job_list=job_list, context=context, cq=cq, n=n, new_process=new_process, echo=echo, recurse=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recursive():\n with Local() as tun:\n tun.call(recursive)", "def parremake(non_empty_job_list, context, cq,\n n=DefaultsToConfig('max_parallel_jobs'),\n recurse=DefaultsToConfig('recurse'),\n new_process=DefaultsToConfig('new_process'),\n echo=DefaultsT...
[ "0.5338253", "0.52692133", "0.5163247", "0.49135223", "0.48438224", "0.48012954", "0.47809696", "0.47231972", "0.4680891", "0.4674986", "0.459419", "0.45825505", "0.4577747", "0.45571458", "0.45117876", "0.44909117", "0.4479494", "0.44598782", "0.44421014", "0.44282016", "0.4...
0.54608476
0
Receives list of emails and user args. Fetchs API keys from config file using user_args path and cli keys. For each target, launch target.methods() associated to found config artifacts. Handles the hunter.io chase logic with counters from enumerate()
def target_factory(targets, user_args): finished = [] if user_args.config_file is not None or user_args.cli_apikeys is not None: api_keys = get_config_from_file(user_args) else: api_keys = None init_targets_len = len(targets) for counter, t in enumerate(targets): c.info_news...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle_args(args: Namespace) -> list:\n # If no targets provided, assume were finding them on network.\n # Once we have targets, if no test given, port/service scan them.\n if not args.target:\n low(\"Target not supplied, running host scan.\")\n hosts = get_hosts(verify_subnet(args.subne...
[ "0.5818296", "0.5668295", "0.5602967", "0.5476489", "0.5466608", "0.5456721", "0.5428727", "0.54159033", "0.53894025", "0.53739095", "0.53501296", "0.5318112", "0.53161204", "0.5297752", "0.527671", "0.5266958", "0.5241994", "0.5215466", "0.52080727", "0.5207851", "0.5204711"...
0.5704268
1
Adapts the specified list of features removing the features matching the specified tags Returns the adapted features list.
def adapt_features_list(self, features_list): result = [] for features in features_list: if features[1].lower() not in self.__tagList: result.append(features) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_features(self, features):\n # feature_values is a multi-dimensional list\n # 1st dimension: Feature (class)\n # 2nd dimension: token\n # 3rd dimension: values (for this token and feature, usually just one value, sometimes more,\n # e.g. \"w2vc=975...
[ "0.5511423", "0.5389407", "0.5388894", "0.5326449", "0.5197866", "0.51871955", "0.51775366", "0.51683754", "0.51480925", "0.5127465", "0.5100365", "0.5098289", "0.50811267", "0.5070767", "0.5062308", "0.50597745", "0.5053017", "0.5052753", "0.5015037", "0.50011545", "0.499522...
0.7186072
0
Returns an activities completed domain object given a activities completed model loaded from the datastore.
def get_completed_activities_from_model(completed_activities_model): return user_domain.CompletedActivities( completed_activities_model.id, completed_activities_model.exploration_ids, completed_activities_model.collection_ids)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_incomplete_activities_from_model(incomplete_activities_model):\n return user_domain.IncompleteActivities(\n incomplete_activities_model.id,\n incomplete_activities_model.exploration_ids,\n incomplete_activities_model.collection_ids)", "def save_completed_activities(activities_comp...
[ "0.62228644", "0.5769096", "0.5127787", "0.5006279", "0.49841896", "0.4978849", "0.4954679", "0.48732555", "0.48401913", "0.47946966", "0.47572014", "0.4753562", "0.475293", "0.47515097", "0.47498572", "0.47466645", "0.47466645", "0.47466645", "0.47466645", "0.47301635", "0.4...
0.7576376
0
Returns an incomplete activities domain object given an incomplete activities model loaded from the datastore.
def get_incomplete_activities_from_model(incomplete_activities_model): return user_domain.IncompleteActivities( incomplete_activities_model.id, incomplete_activities_model.exploration_ids, incomplete_activities_model.collection_ids)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_incomplete_activities(incomplete_activities):\n incomplete_activities_model = user_models.IncompleteActivitiesModel(\n id=incomplete_activities.id,\n exploration_ids=(\n incomplete_activities.exploration_ids),\n collection_ids=(\n incomplete_activities.collect...
[ "0.61822015", "0.6015121", "0.529695", "0.51278603", "0.51037383", "0.50442296", "0.50291485", "0.5007602", "0.49159268", "0.48821375", "0.48406228", "0.48406228", "0.48406228", "0.48406228", "0.48272583", "0.47838998", "0.4765604", "0.47464484", "0.4737847", "0.46908435", "0...
0.77276915
0
Returns an ExpUserLastPlaythrough domain object given an ExpUserLastPlaythroughModel loaded from the datastore.
def get_last_playthrough_information(last_playthrough_model): return user_domain.ExpUserLastPlaythrough( last_playthrough_model.user_id, last_playthrough_model.exploration_id, last_playthrough_model.last_played_exp_version, last_playthrough_model.last_updated, last_playthroug...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_last_playthrough_information(last_playthrough_information):\n last_playthrough_information_model = (\n user_models.ExpUserLastPlaythroughModel(\n id=last_playthrough_information.id,\n user_id=last_playthrough_information.user_id,\n exploration_id=last_playthrough...
[ "0.6114415", "0.5247595", "0.515967", "0.4883792", "0.48731354", "0.4857871", "0.4835355", "0.48091578", "0.48020718", "0.475728", "0.47538674", "0.4676165", "0.46555308", "0.46250343", "0.4602909", "0.45962125", "0.45651177", "0.45483202", "0.45032454", "0.44917822", "0.4487...
0.7840123
0
Save an activities completed domain object as an CompletedActivitiesModel entity in the datastore.
def save_completed_activities(activities_completed): completed_activities_model = user_models.CompletedActivitiesModel( id=activities_completed.id, exploration_ids=( activities_completed.exploration_ids), collection_ids=activities_completed.collection_ids) completed_activiti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_incomplete_activities(incomplete_activities):\n incomplete_activities_model = user_models.IncompleteActivitiesModel(\n id=incomplete_activities.id,\n exploration_ids=(\n incomplete_activities.exploration_ids),\n collection_ids=(\n incomplete_activities.collect...
[ "0.6340037", "0.6266681", "0.5585976", "0.5565634", "0.512854", "0.50020564", "0.4990897", "0.49807826", "0.49425742", "0.49275327", "0.4893211", "0.4893211", "0.4893211", "0.4884492", "0.48834848", "0.48744094", "0.48353598", "0.48353598", "0.48353598", "0.48237532", "0.4802...
0.7898393
0
Save an incomplete activities domain object as an IncompleteActivitiesModel entity in the datastore.
def save_incomplete_activities(incomplete_activities): incomplete_activities_model = user_models.IncompleteActivitiesModel( id=incomplete_activities.id, exploration_ids=( incomplete_activities.exploration_ids), collection_ids=( incomplete_activities.collection_ids)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_incomplete_activities_from_model(incomplete_activities_model):\n return user_domain.IncompleteActivities(\n incomplete_activities_model.id,\n incomplete_activities_model.exploration_ids,\n incomplete_activities_model.collection_ids)", "def save_completed_activities(activities_comp...
[ "0.6256619", "0.6059848", "0.5096222", "0.5025345", "0.5012477", "0.4970576", "0.4967306", "0.48335496", "0.4788404", "0.47641632", "0.47297475", "0.46777546", "0.46111006", "0.45878646", "0.45000252", "0.44918084", "0.44853702", "0.44706258", "0.44139895", "0.43859914", "0.4...
0.790432
0
Save an ExpUserLastPlaythrough domain object as an ExpUserLastPlaythroughModel entity in the datastore.
def save_last_playthrough_information(last_playthrough_information): last_playthrough_information_model = ( user_models.ExpUserLastPlaythroughModel( id=last_playthrough_information.id, user_id=last_playthrough_information.user_id, exploration_id=last_playthrough_informati...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last_playthrough_information(last_playthrough_model):\n return user_domain.ExpUserLastPlaythrough(\n last_playthrough_model.user_id,\n last_playthrough_model.exploration_id,\n last_playthrough_model.last_played_exp_version,\n last_playthrough_model.last_updated,\n last...
[ "0.64397043", "0.537348", "0.5144084", "0.50885314", "0.50646186", "0.4918285", "0.48596153", "0.48199818", "0.4782511", "0.47665057", "0.47221223", "0.47194007", "0.47182798", "0.47021323", "0.46784562", "0.4675816", "0.46751174", "0.46751174", "0.46751174", "0.46751174", "0...
0.70526683
0
Adds the exploration id to the completed list of the user unless the exploration has already been completed or has been created/edited by the user. It is also removed from the incomplete list (if present).
def mark_exploration_as_completed(user_id, exp_id): completed_activities_model = ( user_models.CompletedActivitiesModel.get( user_id, strict=False)) if not completed_activities_model: completed_activities_model = ( user_models.CompletedActivitiesModel(id=user_id)) # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_exp_from_completed_list(user_id, exploration_id):\n completed_activities_model = (\n user_models.CompletedActivitiesModel.get(\n user_id, strict=False))\n\n if completed_activities_model:\n activities_completed = get_completed_activities_from_model(\n completed_...
[ "0.7333753", "0.66623384", "0.6598759", "0.5861844", "0.565674", "0.5651382", "0.5556462", "0.5447262", "0.5357707", "0.53224295", "0.53173083", "0.5286072", "0.5278848", "0.5245753", "0.5241597", "0.5221283", "0.51721656", "0.5139793", "0.5133175", "0.50919086", "0.5083206",...
0.7376035
0
Adds the collection id to the list of collections completed by the user unless the collection has already been completed or has been created/edited by the user. It is also removed from the incomplete list (if present).
def mark_collection_as_completed(user_id, collection_id): completed_activities_model = ( user_models.CompletedActivitiesModel.get( user_id, strict=False)) if not completed_activities_model: completed_activities_model = ( user_models.CompletedActivitiesModel(id=user_id)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_collection_from_completed_list(user_id, collection_id):\n completed_activities_model = (\n user_models.CompletedActivitiesModel.get(\n user_id, strict=False))\n\n if completed_activities_model:\n activities_completed = get_completed_activities_from_model(\n comp...
[ "0.73265505", "0.71735066", "0.67688286", "0.6077272", "0.58246684", "0.5710341", "0.5605133", "0.55354524", "0.5512389", "0.5483253", "0.54399943", "0.5375389", "0.53730804", "0.53215057", "0.529251", "0.5259994", "0.52576315", "0.5242654", "0.51943487", "0.51522434", "0.515...
0.7669941
0
Adds the exploration id to the incomplete list of the user unless the exploration has been already completed or has been created/edited by the user. If the exploration is already present in the incomplete list, just the details associated with it are updated.
def mark_exploration_as_incomplete( user_id, exploration_id, state_name, exploration_version): incomplete_activities_model = ( user_models.IncompleteActivitiesModel.get( user_id, strict=False)) if not incomplete_activities_model: incomplete_activities_model = ( us...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_exp_from_incomplete_list(user_id, exploration_id):\n incomplete_activities_model = (\n user_models.IncompleteActivitiesModel.get(user_id, strict=False))\n\n if incomplete_activities_model:\n incomplete_activities = get_incomplete_activities_from_model(\n incomplete_activit...
[ "0.6630041", "0.6283019", "0.62723505", "0.5562743", "0.51461846", "0.51307076", "0.50566655", "0.5055318", "0.5002242", "0.49815267", "0.4870814", "0.48210636", "0.48189753", "0.47752497", "0.47030744", "0.4672586", "0.46602765", "0.4652315", "0.4620311", "0.46121192", "0.46...
0.69356936
0
Adds the collection id to the list of collections partially completed by the user unless the collection has already been completed or has been created/edited by the user or is already present in the incomplete list.
def mark_collection_as_incomplete(user_id, collection_id): incomplete_activities_model = ( user_models.IncompleteActivitiesModel.get(user_id, strict=False)) if not incomplete_activities_model: incomplete_activities_model = ( user_models.IncompleteActivitiesModel(id=user_id)) col...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mark_collection_as_completed(user_id, collection_id):\n completed_activities_model = (\n user_models.CompletedActivitiesModel.get(\n user_id, strict=False))\n if not completed_activities_model:\n completed_activities_model = (\n user_models.CompletedActivitiesModel(id=...
[ "0.7078194", "0.6736062", "0.66381717", "0.59500515", "0.5890194", "0.56136304", "0.55309975", "0.5443219", "0.54389465", "0.54147583", "0.52895445", "0.52288115", "0.5224747", "0.521387", "0.5190239", "0.51880044", "0.51667863", "0.5122123", "0.50826657", "0.5069935", "0.505...
0.7270366
0
Removes the exploration from the completed list of the user (if present).
def remove_exp_from_completed_list(user_id, exploration_id): completed_activities_model = ( user_models.CompletedActivitiesModel.get( user_id, strict=False)) if completed_activities_model: activities_completed = get_completed_activities_from_model( completed_activities_m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_exp_from_incomplete_list(user_id, exploration_id):\n incomplete_activities_model = (\n user_models.IncompleteActivitiesModel.get(user_id, strict=False))\n\n if incomplete_activities_model:\n incomplete_activities = get_incomplete_activities_from_model(\n incomplete_activit...
[ "0.7610628", "0.63290167", "0.6067997", "0.6054156", "0.58659834", "0.58210796", "0.5811075", "0.57468563", "0.57250834", "0.5721403", "0.5681918", "0.5636305", "0.5633294", "0.5627307", "0.56237924", "0.5606922", "0.5603712", "0.559115", "0.55897284", "0.5561899", "0.5561899...
0.8136673
0
Removes the collection id from the list of completed collections (if present).
def remove_collection_from_completed_list(user_id, collection_id): completed_activities_model = ( user_models.CompletedActivitiesModel.get( user_id, strict=False)) if completed_activities_model: activities_completed = get_completed_activities_from_model( completed_activi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_collection_from_incomplete_list(user_id, collection_id):\n incomplete_activities_model = (\n user_models.IncompleteActivitiesModel.get(user_id, strict=False))\n\n if incomplete_activities_model:\n incomplete_activities = get_incomplete_activities_from_model(\n incomplete_a...
[ "0.75698406", "0.6615805", "0.64947903", "0.6416157", "0.64019793", "0.63235426", "0.62844485", "0.6255601", "0.6192878", "0.61737555", "0.60254145", "0.6024757", "0.5956828", "0.5898209", "0.5894958", "0.588613", "0.5855707", "0.5841356", "0.5820896", "0.57982224", "0.576966...
0.81212145
0
Removes the exploration from the incomplete list of the user (if present).
def remove_exp_from_incomplete_list(user_id, exploration_id): incomplete_activities_model = ( user_models.IncompleteActivitiesModel.get(user_id, strict=False)) if incomplete_activities_model: incomplete_activities = get_incomplete_activities_from_model( incomplete_activities_model) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_exp_from_completed_list(user_id, exploration_id):\n completed_activities_model = (\n user_models.CompletedActivitiesModel.get(\n user_id, strict=False))\n\n if completed_activities_model:\n activities_completed = get_completed_activities_from_model(\n completed_...
[ "0.71654975", "0.58342683", "0.5796703", "0.57578075", "0.57307965", "0.5690449", "0.56672806", "0.5666664", "0.5655515", "0.5649491", "0.5629475", "0.5575647", "0.55151355", "0.5489033", "0.54864323", "0.54864323", "0.54864323", "0.54839975", "0.5463358", "0.54605055", "0.54...
0.7586848
0
Removes the collection id from the list of incomplete collections (if present).
def remove_collection_from_incomplete_list(user_id, collection_id): incomplete_activities_model = ( user_models.IncompleteActivitiesModel.get(user_id, strict=False)) if incomplete_activities_model: incomplete_activities = get_incomplete_activities_from_model( incomplete_activities_m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_collection_from_completed_list(user_id, collection_id):\n completed_activities_model = (\n user_models.CompletedActivitiesModel.get(\n user_id, strict=False))\n\n if completed_activities_model:\n activities_completed = get_completed_activities_from_model(\n comp...
[ "0.7031155", "0.65280473", "0.64333564", "0.62558746", "0.6222193", "0.6214222", "0.6212548", "0.6143344", "0.61332214", "0.61263835", "0.59929144", "0.5976242", "0.59602195", "0.59322447", "0.59294", "0.59194714", "0.5853322", "0.5848645", "0.5831045", "0.57610106", "0.57337...
0.76158595
0
Returns a list with the ids of all the explorations completed by the user.
def get_all_completed_exp_ids(user_id): completed_activities_model = ( user_models.CompletedActivitiesModel.get( user_id, strict=False)) if completed_activities_model: activities_completed = get_completed_activities_from_model( completed_activities_model) return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_incomplete_exp_ids(user_id):\n incomplete_activities_model = (\n user_models.IncompleteActivitiesModel.get(\n user_id, strict=False))\n\n if incomplete_activities_model:\n incomplete_activities = get_incomplete_activities_from_model(\n incomplete_activities_mod...
[ "0.6990428", "0.66336375", "0.63268137", "0.6096011", "0.608757", "0.60630727", "0.60186946", "0.592166", "0.5826232", "0.5797884", "0.5789642", "0.5706042", "0.56982017", "0.56835073", "0.56757104", "0.56402946", "0.5596674", "0.5592844", "0.5584414", "0.55808264", "0.557688...
0.7671137
0
Returns a list of summaries of the completed exploration ids and the number of explorations deleted from the list as they are no longer present.
def get_completed_exp_summaries(user_id): completed_exploration_ids = get_all_completed_exp_ids(user_id) number_deleted = 0 for exploration_id in completed_exploration_ids: if not exp_services.does_exploration_exists(exploration_id): number_deleted = number_deleted + 1 remov...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_incomplete_exp_summaries(user_id):\n incomplete_exploration_ids = get_all_incomplete_exp_ids(user_id)\n\n number_deleted = 0\n for exploration_id in incomplete_exploration_ids:\n if not exp_services.does_exploration_exists(exploration_id):\n number_deleted = number_deleted + 1\n ...
[ "0.7121779", "0.6451899", "0.55469704", "0.5485683", "0.54781973", "0.5407528", "0.5371683", "0.53436005", "0.5333747", "0.533249", "0.53203034", "0.52994657", "0.5280745", "0.5252676", "0.52158546", "0.5174102", "0.5160362", "0.5134577", "0.5133452", "0.5126054", "0.51057625...
0.7269388
0
Returns a list with the ids of all the collections completed by the user.
def get_all_completed_collection_ids(user_id): completed_activities_model = ( user_models.CompletedActivitiesModel.get( user_id, strict=False)) if completed_activities_model: activities_completed = get_completed_activities_from_model( completed_activities_model) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_incomplete_collection_ids(user_id):\n incomplete_activities_model = (\n user_models.IncompleteActivitiesModel.get(user_id, strict=False))\n\n if incomplete_activities_model:\n incomplete_activities = get_incomplete_activities_from_model(\n incomplete_activities_model)\n\n...
[ "0.68447274", "0.6573399", "0.63725257", "0.61559606", "0.6146322", "0.6127734", "0.60664064", "0.6035243", "0.59665245", "0.5915297", "0.5854325", "0.5847973", "0.58409876", "0.5794997", "0.5772559", "0.5757579", "0.5716404", "0.56252676", "0.55838454", "0.5528037", "0.55272...
0.7887092
0
Returns a list of summaries of the completed collection ids, the number of collections deleted from the list as they are no longer present and the number of collections being shifted to the incomplete section on account of new addition of explorations.
def get_completed_collection_summaries(user_id): completed_collection_ids = get_all_completed_collection_ids(user_id) number_deleted = 0 completed_to_incomplete_collections = [] for collection_id in completed_collection_ids: if not collection_services.does_collection_exists(collection_id): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_incomplete_collection_summaries(user_id):\n incomplete_collection_ids = get_all_incomplete_collection_ids(user_id)\n\n number_deleted = 0\n for collection_id in incomplete_collection_ids:\n if not collection_services.does_collection_exists(collection_id):\n number_deleted = numbe...
[ "0.6893559", "0.58609456", "0.5605966", "0.556146", "0.55260867", "0.5467624", "0.5451897", "0.5408344", "0.53899777", "0.5363638", "0.5363408", "0.5345571", "0.5342385", "0.53340423", "0.5234466", "0.51770806", "0.51420003", "0.5129144", "0.510106", "0.5099787", "0.5077144",...
0.70263696
0
Returns a list with the ids of all the explorations partially completed by the user.
def get_all_incomplete_exp_ids(user_id): incomplete_activities_model = ( user_models.IncompleteActivitiesModel.get( user_id, strict=False)) if incomplete_activities_model: incomplete_activities = get_incomplete_activities_from_model( incomplete_activities_model) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_completed_exp_ids(user_id):\n completed_activities_model = (\n user_models.CompletedActivitiesModel.get(\n user_id, strict=False))\n\n if completed_activities_model:\n activities_completed = get_completed_activities_from_model(\n completed_activities_model)\n\n...
[ "0.7028878", "0.6100011", "0.5867102", "0.58654964", "0.58485883", "0.5804849", "0.57690644", "0.57013136", "0.56557477", "0.56432635", "0.55685663", "0.5562574", "0.5482277", "0.5442134", "0.541327", "0.53985935", "0.53937215", "0.5384552", "0.53794485", "0.5366167", "0.5361...
0.6955515
1
Returns a list of summaries of the incomplete exploration ids and the number of explorations deleted from the list as they are no longer present.
def get_incomplete_exp_summaries(user_id): incomplete_exploration_ids = get_all_incomplete_exp_ids(user_id) number_deleted = 0 for exploration_id in incomplete_exploration_ids: if not exp_services.does_exploration_exists(exploration_id): number_deleted = number_deleted + 1 r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_completed_exp_summaries(user_id):\n completed_exploration_ids = get_all_completed_exp_ids(user_id)\n\n number_deleted = 0\n for exploration_id in completed_exploration_ids:\n if not exp_services.does_exploration_exists(exploration_id):\n number_deleted = number_deleted + 1\n ...
[ "0.65761715", "0.628951", "0.58002746", "0.57235044", "0.5433392", "0.541945", "0.5401837", "0.536997", "0.5349369", "0.5266526", "0.52554405", "0.5248007", "0.52343345", "0.52081347", "0.51959604", "0.518835", "0.5148608", "0.5129314", "0.5122818", "0.50970685", "0.5082576",...
0.74116236
0
Returns a list with the ids of all the collections partially completed by the user.
def get_all_incomplete_collection_ids(user_id): incomplete_activities_model = ( user_models.IncompleteActivitiesModel.get(user_id, strict=False)) if incomplete_activities_model: incomplete_activities = get_incomplete_activities_from_model( incomplete_activities_model) retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_completed_collection_ids(user_id):\n completed_activities_model = (\n user_models.CompletedActivitiesModel.get(\n user_id, strict=False))\n\n if completed_activities_model:\n activities_completed = get_completed_activities_from_model(\n completed_activities_mod...
[ "0.74050117", "0.6434028", "0.63677293", "0.63307387", "0.6230893", "0.61925364", "0.61860067", "0.5809239", "0.57903516", "0.56774145", "0.5640357", "0.55779546", "0.55750656", "0.55429167", "0.5523032", "0.5498987", "0.5497441", "0.5487496", "0.5457397", "0.5439295", "0.541...
0.7129079
1
Returns a list of summaries of the incomplete collection ids and the number of collections deleted from the list as they are no longer present.
def get_incomplete_collection_summaries(user_id): incomplete_collection_ids = get_all_incomplete_collection_ids(user_id) number_deleted = 0 for collection_id in incomplete_collection_ids: if not collection_services.does_collection_exists(collection_id): number_deleted = number_deleted +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_completed_collection_summaries(user_id):\n completed_collection_ids = get_all_completed_collection_ids(user_id)\n\n number_deleted = 0\n completed_to_incomplete_collections = []\n for collection_id in completed_collection_ids:\n if not collection_services.does_collection_exists(collectio...
[ "0.64764214", "0.5628188", "0.56098574", "0.55685467", "0.55374163", "0.5495725", "0.5491201", "0.5459467", "0.54306704", "0.54020077", "0.53913397", "0.53282905", "0.5318962", "0.5281222", "0.5237208", "0.52012056", "0.5194746", "0.5181341", "0.5142916", "0.51323473", "0.512...
0.75293946
0
Returns a displayable summary dict of the the collection summaries given to it.
def get_collection_summary_dicts(collection_summaries): summary_dicts = [] for collection_summary in collection_summaries: summary_dicts.append({ 'id': collection_summary.id, 'title': collection_summary.title, 'category': collection_summary.category, 'obje...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def summary(self):\n if hasattr(self,\"_summary\"):\n return self._summary\n else:\n return {}", "def summaries(self):\n return self._summaries", "def get_all_summaries() -> Dict[str, CBSummary]:\n return _SUMMARIES", "def to_summary_dict(self) -> dict:\n ...
[ "0.7378151", "0.71806705", "0.7058219", "0.69519037", "0.6853538", "0.66938996", "0.6660244", "0.6604239", "0.6602926", "0.65897083", "0.6585834", "0.65487266", "0.65487266", "0.65487266", "0.65487266", "0.65487266", "0.65487266", "0.65487266", "0.65341884", "0.6502738", "0.6...
0.729244
1
GRE gre input nodes not registerd unless configured
def test_gre_input_node(self): pkt = ( Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) / IP(src=self.pg0.remote_ip4, dst=self.pg0.local_ip4) / GRE() ) self.pg0.add_stream(pkt) self.pg_start() # no tunnel created, gre-input not registere...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def input_nodes(self):\n pass", "def add_nodes(self):\n for node_id in self.nodes:\n x = self.nodes[node_id][0]\n y = self.nodes[node_id][1]\n if node_id == 0:\n self.G.add_node(\"Source\", x=x, y=y, demand=0)\n self.G.add_node(\"Sink\"...
[ "0.6233901", "0.550212", "0.54704326", "0.5269358", "0.5268955", "0.52649343", "0.5232681", "0.5182836", "0.5179592", "0.5142239", "0.5139874", "0.5131918", "0.511782", "0.51030797", "0.5091775", "0.507513", "0.507513", "0.5066332", "0.5052606", "0.503446", "0.5015304", "0....
0.72250384
0
GRE IPv4 tunnel Tests
def test_gre(self): # # Create an L3 GRE tunnel. # - set it admin up # - assign an IP Addres # - Add a route via the tunnel # gre_if = VppGreInterface(self, self.pg0.local_ip4, "1.1.1.2") gre_if.add_vpp_config() # # The double create (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_gre_vrf(self):\n\n e = VppEnum.vl_api_tunnel_encap_decap_flags_t\n\n #\n # Create an L3 GRE tunnel whose destination is in the non-default\n # table. The underlay is thus non-default - the overlay is still\n # the default.\n # - set it admin up\n # - assi...
[ "0.7040903", "0.70102435", "0.69857115", "0.6939613", "0.690872", "0.6890797", "0.6792508", "0.658909", "0.65685487", "0.6533727", "0.6334514", "0.61938894", "0.6111214", "0.6085397", "0.60737616", "0.5890097", "0.5858331", "0.5844861", "0.58409685", "0.58269256", "0.5806118"...
0.74055123
0
GRE IPv6 tunnel Tests
def test_gre6(self): self.pg1.config_ip6() self.pg1.resolve_ndp() # # Create an L3 GRE tunnel. # - set it admin up # - assign an IP Address # - Add a route via the tunnel # gre_if = VppGreInterface(self, self.pg2.local_ip6, "1002::1") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_mgre6(self):\n\n self.pg0.config_ip6()\n self.pg0.resolve_ndp()\n\n e = VppEnum.vl_api_tunnel_encap_decap_flags_t\n\n for itf in self.pg_interfaces[3:]:\n #\n # one underlay nh for each overlay/tunnel peer\n #\n itf.config_ip6()\n ...
[ "0.79014456", "0.7865132", "0.7596451", "0.7451929", "0.72432387", "0.6996507", "0.6974262", "0.6868673", "0.6781165", "0.6780385", "0.6766645", "0.6744755", "0.67087394", "0.6610248", "0.658546", "0.65412396", "0.6472175", "0.64608616", "0.635435", "0.6344195", "0.6284904", ...
0.8132988
0
GRE tunnel VRF Tests
def test_gre_vrf(self): e = VppEnum.vl_api_tunnel_encap_decap_flags_t # # Create an L3 GRE tunnel whose destination is in the non-default # table. The underlay is thus non-default - the overlay is still # the default. # - set it admin up # - assign an IP Addre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_gre(self):\n\n #\n # Create an L3 GRE tunnel.\n # - set it admin up\n # - assign an IP Addres\n # - Add a route via the tunnel\n #\n gre_if = VppGreInterface(self, self.pg0.local_ip4, \"1.1.1.2\")\n gre_if.add_vpp_config()\n\n #\n # ...
[ "0.73431396", "0.7017393", "0.69103485", "0.68895483", "0.6634449", "0.6523895", "0.63398623", "0.6278481", "0.6209366", "0.61187935", "0.61119044", "0.6032866", "0.59457785", "0.59202164", "0.59181285", "0.58792037", "0.5876425", "0.5871428", "0.5831165", "0.58223486", "0.58...
0.7683448
0
GRE tunnel L2 Tests
def test_gre_l2(self): # # Add routes to resolve the tunnel destinations # route_tun1_dst = VppIpRoute( self, "2.2.2.2", 32, [VppRoutePath(self.pg0.remote_ip4, self.pg0.sw_if_index)], ) route_tun2_dst = VppIpRoute( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_gre(self):\n\n #\n # Create an L3 GRE tunnel.\n # - set it admin up\n # - assign an IP Addres\n # - Add a route via the tunnel\n #\n gre_if = VppGreInterface(self, self.pg0.local_ip4, \"1.1.1.2\")\n gre_if.add_vpp_config()\n\n #\n # ...
[ "0.76082015", "0.74018204", "0.7187994", "0.70264864", "0.69563526", "0.6744743", "0.6454984", "0.6452651", "0.6301046", "0.62277186", "0.61906385", "0.6164236", "0.6139048", "0.6133537", "0.60154885", "0.6007223", "0.5908299", "0.5794021", "0.5767013", "0.57659173", "0.57066...
0.8350407
0
GRE tunnel loop Tests
def test_gre_loop(self): # # Create an L3 GRE tunnel. # - set it admin up # - assign an IP Addres # gre_if = VppGreInterface(self, self.pg0.local_ip4, "1.1.1.2") gre_if.add_vpp_config() gre_if.admin_up() gre_if.config_ip4() # # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_gre(self):\n\n #\n # Create an L3 GRE tunnel.\n # - set it admin up\n # - assign an IP Addres\n # - Add a route via the tunnel\n #\n gre_if = VppGreInterface(self, self.pg0.local_ip4, \"1.1.1.2\")\n gre_if.add_vpp_config()\n\n #\n # ...
[ "0.7134006", "0.7096133", "0.6707601", "0.6563596", "0.6539993", "0.651046", "0.6350937", "0.6327917", "0.61891365", "0.61459893", "0.61275846", "0.6100734", "0.5925589", "0.5883176", "0.58828765", "0.585319", "0.5850184", "0.58496827", "0.5804605", "0.5772576", "0.5764842", ...
0.8243571
0
mGRE IPv4 tunnel Tests
def test_mgre(self): for itf in self.pg_interfaces[3:]: # # one underlay nh for each overlay/tunnel peer # itf.generate_remote_hosts(4) itf.configure_ipv4_neighbors() # # Create an L3 GRE tunnel. # - set it admin ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_gre(self):\n\n #\n # Create an L3 GRE tunnel.\n # - set it admin up\n # - assign an IP Addres\n # - Add a route via the tunnel\n #\n gre_if = VppGreInterface(self, self.pg0.local_ip4, \"1.1.1.2\")\n gre_if.add_vpp_config()\n\n #\n # ...
[ "0.7277259", "0.70172364", "0.69193166", "0.68587923", "0.6815148", "0.67424494", "0.67279685", "0.67046237", "0.6525055", "0.6354908", "0.62246865", "0.6192586", "0.60702956", "0.59766877", "0.59461623", "0.5896636", "0.5870435", "0.5868728", "0.5801774", "0.57892966", "0.57...
0.72709
1
mGRE IPv6 tunnel Tests
def test_mgre6(self): self.pg0.config_ip6() self.pg0.resolve_ndp() e = VppEnum.vl_api_tunnel_encap_decap_flags_t for itf in self.pg_interfaces[3:]: # # one underlay nh for each overlay/tunnel peer # itf.config_ip6() itf.gener...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_gre6(self):\n\n self.pg1.config_ip6()\n self.pg1.resolve_ndp()\n\n #\n # Create an L3 GRE tunnel.\n # - set it admin up\n # - assign an IP Address\n # - Add a route via the tunnel\n #\n gre_if = VppGreInterface(self, self.pg2.local_ip6, \"1...
[ "0.8015364", "0.7773822", "0.75069994", "0.7362021", "0.7186222", "0.71196765", "0.7051329", "0.6891024", "0.6749138", "0.66874135", "0.66701674", "0.6651415", "0.65704644", "0.6506517", "0.6492735", "0.64707035", "0.6425133", "0.64129156", "0.6404166", "0.6402007", "0.631397...
0.8250885
0
Compress a FASTQ file using fastore
def convert_fastq_to_fastore(fwd_reads, rev_reads, output_prefix, num_threads=multiprocessing.cpu_count()): if output_prefix is None: output_prefix = os.path.basename(fwd_reads) output_prefix = re.sub(FASTQ_PATTERN, '', output_prefix) cmd = [ 'fastore_compress.sh', '--lossless', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scarf_to_fastq(infile=sys.stdin, outfile=sys.stdout):\n infile = open_gzipped(infile)\n outfile = open_gzipped(outfile, 'wt')\n for line in infile:\n fields = line.rstrip().split(':')\n qual = fields.pop()\n seq = fields.pop()\n outfile.write('{0}\\n{1}\\n+\\n{2}\\n'.form...
[ "0.6475294", "0.6404124", "0.63344985", "0.62695235", "0.61447346", "0.6135422", "0.6091798", "0.6091798", "0.60809386", "0.5990563", "0.5938992", "0.5938343", "0.59092295", "0.5894788", "0.5883531", "0.5868887", "0.58567744", "0.58549106", "0.5849947", "0.5839616", "0.581899...
0.71300817
0
Compress a FASTQ file using fqzcomp
def convert_fastq_to_fqzcomp(reads, output_prefix): if output_prefix is None: output_prefix = os.path.basename(reads) output_prefix = re.sub(FASTQ_PATTERN, '', output_prefix) # Recommended parameters for Illumina data as provided by: # https://github.com/jkbonfield/fqzcomp output_filenam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vcf_compress(fn):\n ret = cmd_exe(f\"vcf-sort {fn} | bgzip > {fn}.gz && tabix {fn}.gz\")", "def convert_fastq_to_fastore(fwd_reads, rev_reads, output_prefix, num_threads=multiprocessing.cpu_count()):\n if output_prefix is None:\n output_prefix = os.path.basename(fwd_reads)\n output_prefix...
[ "0.71149033", "0.6764938", "0.6471185", "0.6341693", "0.6307038", "0.62937605", "0.62541556", "0.6213447", "0.6163693", "0.61407375", "0.61407375", "0.61067796", "0.60958624", "0.6090572", "0.59585476", "0.59585476", "0.59388447", "0.5918123", "0.5849606", "0.57924145", "0.57...
0.71293026
0
Sets the callback that will handle updated audio samples. Unlike core.EmulatedSNES.set_audio_sample_cb, the callback passed to this
def set_audio_sample_cb(core, callback=pygame.mixer.Sound.play): maxlog = 512*2*2 # 512 stereo samples of 16-bits each sndstruct = struct.Struct('<hh') def wrapper(left, right): global sndlog sndlog += sndstruct.pack(left, right) if len(sndlog) >= maxlog: sndarr = numpy.fromstring(sndlog[:maxlog], dtype=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_audio_sample_cb(core, callback=pygame.mixer.Sound.play):\n\n\t# init pygame sound. snes freq is 32000, 16bit unsigned stereo.\n\tpygame.mixer.init(\n\t\tfrequency=SNES_OUTPUT_FREQUENCY,\n\t\tsize=16, channels=2, buffer=512\n\t)\n\n\tsnd = pygame.sndarray.make_sound(\n\t\t\tnumpy.zeros( (512, 2), dtype='in...
[ "0.76416826", "0.6816434", "0.61702645", "0.588259", "0.5871366", "0.5783367", "0.5779378", "0.562768", "0.5568765", "0.55300826", "0.54514617", "0.543422", "0.5429383", "0.5302752", "0.5284238", "0.52808213", "0.5234366", "0.5230961", "0.52237624", "0.52133197", "0.51324743"...
0.7547823
1
returns a dict of link, headers, and proxies
def get_dict(self): self.headers = self.hm.getRequestHeaders() self.proxies = self.hm.getRandomProxyDict(self.num) return {'link':self.link, 'headers':headers, 'proxies':proxies, 't0':datetime.now(), 't1':None, 'resp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def links(self):\n links = {}\n data = self.data['links']\n for key in data:\n links[key] = data[key]['url']\n return links", "def _proxies_dict(proxy):\r\n if not proxy:\r\n return None\r\n return {'http': proxy, 'https': proxy}", "def get_headers() -> dict:...
[ "0.6392226", "0.6355956", "0.6331789", "0.6243836", "0.62344444", "0.6065883", "0.60645163", "0.5935102", "0.59115076", "0.5851547", "0.58446586", "0.57974946", "0.5734146", "0.57323176", "0.565084", "0.565084", "0.565084", "0.5650149", "0.5640212", "0.56283724", "0.5624032",...
0.7513135
0
Sets processes the contents of req_dict
def set_dict(self, req_dict): self.delta = (req_dict['t1'] - req_dict['t0']).total_seconds() resp = req_dict['response'] if resp == None or resp.status==400: self.status = 400 else: self.status = resp.status self.raw_html = resp.raw_html s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_request(self, req):\n req.context = self.make_context(req)", "def __update_request(self, request_dict, namespace, apikey):\n request_dict['namespace'] = namespace if namespace else self.namespace\n request_dict['apikey'] = apikey if apikey else self.apikey", "def process_reques...
[ "0.6756112", "0.6488219", "0.6156623", "0.5849773", "0.5813574", "0.5764923", "0.5759493", "0.57356197", "0.5637538", "0.5582668", "0.55359286", "0.5443397", "0.54157734", "0.5400735", "0.5393618", "0.5369144", "0.53677654", "0.5344432", "0.5317117", "0.52821016", "0.52571756...
0.65431195
1
A helper method to return True if the given argument appears to be iterable (like a list) but not able to be converted to a Range. In particular, checks for whether python would consider the argument to be iterable (it has either __iter__() or __getattr__() defined), and then checks that it isn't a string (in which cas...
def _is_iterable_non_string(arg): return (hasattr(arg, "__iter__") or hasattr(arg, "__getattr__")) and not isinstance(arg, str)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_iterable(arg):\n return (\n isinstance(arg, collections.Iterable)\n and not isinstance(arg, str)\n )", "def iterable(arg):\n return isinstance(arg, collections.Iterable) and not isinstance(arg, six.string_types)", "def is_nonstring_iterable(x):\n if isinstance(x, pr...
[ "0.7729543", "0.7702169", "0.7327167", "0.7220826", "0.7122214", "0.711425", "0.70671326", "0.7053373", "0.70232004", "0.6995468", "0.6989004", "0.6979167", "0.69648576", "0.6930698", "0.69182634", "0.68677145", "0.6867176", "0.68479127", "0.6806878", "0.67804617", "0.6775035...
0.7752146
0
Constructs a new Linked List based on the given iterable
def __init__(self, iterable=None): if iterable is None: iterable = [] self._length = 0 if len(iterable) == 0: self.first = None self.last = None else: # iterate through iterable it = iter(iterable) # first element of...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, iterable=None):\n self.linked_list = LinkedList()\n if iterable:\n for item in iterable:\n self.push(item)", "def __init__(self, iterable=None):\n # Initialize a new linked list to store the items\n self.list = LinkedList()\n if iter...
[ "0.7641155", "0.75613105", "0.74956274", "0.72894627", "0.7267957", "0.70669657", "0.6932279", "0.6866506", "0.6858477", "0.6794988", "0.6518912", "0.6430323", "0.6292348", "0.6204693", "0.60814905", "0.6045794", "0.600377", "0.5993867", "0.59703386", "0.59454674", "0.5863477...
0.7562368
1
Helper function which calculates and returns the collective thrust and the moment about the X axis
def get_thrust_and_moment(self): f1 = self.k_f * self.omega_1 ** 2 f2 = self.k_f * self.omega_2 ** 2 # c is often used to indicate "collective" thrust c = f1 + f2 M_x = (f1 - f2) * self.l return c, M_x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_speed_x(self):\r\n return self.__X_speed", "def get_ytm_function(self,x: float):\n ytm = Bootstrapping.get_ytm_dict(self)\n if x<1:\n return ytm[1]\n if x>=1 and x<=4:\n return ytm[1]+((ytm[4]-ytm[1])/(4-1))*(x-1)\n elif x>4 and x<=6:\n ...
[ "0.60838336", "0.5928813", "0.58897114", "0.58549994", "0.5813506", "0.57268107", "0.556206", "0.5533554", "0.55107033", "0.5493827", "0.5470806", "0.54671556", "0.5457219", "0.54165864", "0.54040587", "0.53887755", "0.53887165", "0.5374721", "0.53696114", "0.5364478", "0.535...
0.69220454
0
Calculates vertical (z) acceleration of drone.
def z_dot_dot(self): # TODO 1 # Calculate the vertical component of the acceleration # You might find get_thrust_and_moment helpful c, M_x = self.get_thrust_and_moment() phi = self.X[2] zdd = (self.g - c * np.cos(phi)) / self.m print (zdd) retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAngVelZ(self):\n return self.angvel.getZ()", "def getVelZ(self):\n return self.posvel.getZ()", "def calc_vertical_velocity(self):\n # Note: again we make use of the automatically added 'grid' attribute, and the stored coef_w attribute.\n # Here we arbitrarily set the vertical...
[ "0.6356424", "0.6245218", "0.6242624", "0.6193167", "0.6136546", "0.61020046", "0.60854024", "0.60746443", "0.60497254", "0.5962692", "0.5945629", "0.58685344", "0.58629066", "0.58574307", "0.58556175", "0.58161336", "0.5802175", "0.57529724", "0.5745642", "0.5740741", "0.569...
0.67445016
0
Create a new RateLimitExceededResponse with either a body or json_body.
def __init__(self, status='429 Too Many Requests', status_code=429, headerlist=None, body=None, json_body=None, environ=None): super(RateLimitExceededResponse, self).__init__(headerlist=headerlist, charset="UTF-8") self.status_code = status_code self.status = status sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, message, details, retry_time):\n hdrs = RateLimitFault._retry_after(retry_time)\n self.wrapped_exc = webob.exc.HTTPTooManyRequests(headers=hdrs)\n self.content = {\n \"overLimit\": {\n \"code\": self.wrapped_exc.status_int,\n \"messag...
[ "0.6098914", "0.5905501", "0.5676667", "0.5556727", "0.54436296", "0.5438186", "0.5395934", "0.53916144", "0.5321462", "0.5206814", "0.51327455", "0.5109983", "0.50726634", "0.50726634", "0.5052899", "0.50337666", "0.503288", "0.50313205", "0.5016104", "0.49825332", "0.497274...
0.741112
0
Set the environ of the request triggering this response.
def set_environ(self, environ): self.environ = environ
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def env_init(self, environ) -> None:\n environ.update(self._env)", "def set_envvars(self):\n # self.logger.trace(\"update os.environ with %s\", self.environ)\n for key in os.environ:\n current = self.environ.get(key)\n if current is None:\n del os.environ...
[ "0.69291943", "0.66078955", "0.6505824", "0.6459778", "0.6249135", "0.62357193", "0.6230504", "0.6230504", "0.62264794", "0.62237424", "0.619744", "0.6105031", "0.5998158", "0.59800553", "0.59800553", "0.5948229", "0.59357274", "0.5934522", "0.5926105", "0.59215724", "0.58910...
0.8057197
1
Create a new BlacklistResponse with either a body or json_body.
def __init__(self, status='497 Blacklisted', status_code=497, headerlist=None, body=None, json_body=None, environ=None): super(BlacklistResponse, self).__init__(headerlist=headerlist, charset="UTF-8") self.status_code = status_code self.status = status self.environ = en...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_with_http_info(self, filter_entry, **kwargs):\n\n all_params = ['filter_entry']\n all_params.append('callback')\n all_params.append('_return_http_data_only')\n\n params = locals()\n for key, val in iteritems(params['kwargs']):\n if key not in all_params:\n ...
[ "0.575137", "0.53134924", "0.52803606", "0.5176579", "0.51452744", "0.5115806", "0.50867957", "0.5079796", "0.5067445", "0.5061682", "0.50484353", "0.50473523", "0.4978225", "0.49749443", "0.49746588", "0.49502128", "0.4920608", "0.49162033", "0.48863688", "0.4859111", "0.483...
0.751583
0
Set the environ of the request triggering this response.
def set_environ(self, environ): self.environ = environ
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def env_init(self, environ) -> None:\n environ.update(self._env)", "def set_envvars(self):\n # self.logger.trace(\"update os.environ with %s\", self.environ)\n for key in os.environ:\n current = self.environ.get(key)\n if current is None:\n del os.environ...
[ "0.6929595", "0.660895", "0.65047944", "0.6458034", "0.6250374", "0.6234367", "0.62306094", "0.62306094", "0.6227232", "0.6222029", "0.6194317", "0.6105789", "0.59983236", "0.5980308", "0.5980308", "0.594749", "0.59353787", "0.593209", "0.59221506", "0.5921211", "0.58909875",...
0.80573213
0
computes mean squared displacement and saves corresponding plots. DT is the tim1e between two spiral tip observations in milliseconds. file is a string locating in a folder with files ending in _unwrap.csv n_tips is the number of tips
def gen_msd_figs(file,n_tips=1,**kwargs):#,V_thresh): return generate_msd_figures_routine(file,n_tips,**kwargs)#, V_thresh=None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_1():\n p_files = []\n filename = \"energy_data_2D_80\"\n for file in sorted(os.listdir(folder)):\n if file.startswith(filename):\n p_files.append(os.path.join(folder,file))\n T_list = []\n fig, ax = plt.subplots()\n for p_file in p_files[3::3]:\n T = (os.path.spl...
[ "0.56980664", "0.55052394", "0.54952806", "0.5364844", "0.5354079", "0.526569", "0.5255868", "0.5222692", "0.5180448", "0.516492", "0.5157794", "0.5152653", "0.51514626", "0.51469636", "0.5118411", "0.5112639", "0.5085919", "0.50780743", "0.50565106", "0.50398004", "0.5023944...
0.58859473
0
Disable globally progress bars used in `huggingface_hub` except if `HF_HUB_DISABLE_PROGRESS_BARS` environment variable has been set. Use [`~utils.enable_progress_bars`] to reenable them.
def disable_progress_bars() -> None: if HF_HUB_DISABLE_PROGRESS_BARS is False: warnings.warn( "Cannot disable progress bars: environment variable `HF_HUB_DISABLE_PROGRESS_BARS=0` is set and has" " priority." ) return global _hf_hub_progress_bars_disabled _hf_h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enable_progress_bars() -> None:\n if HF_HUB_DISABLE_PROGRESS_BARS is True:\n warnings.warn(\n \"Cannot enable progress bars: environment variable `HF_HUB_DISABLE_PROGRESS_BARS=1` is set and has\"\n \" priority.\"\n )\n return\n global _hf_hub_progress_bars_disab...
[ "0.8467439", "0.7472372", "0.7233874", "0.5821702", "0.57950515", "0.5779846", "0.5628066", "0.5628066", "0.56158644", "0.5582428", "0.54845506", "0.5359941", "0.5345642", "0.5336011", "0.5152476", "0.5006065", "0.49779066", "0.49605027", "0.49030176", "0.48896208", "0.487899...
0.9079927
0
Enable globally progress bars used in `huggingface_hub` except if `HF_HUB_DISABLE_PROGRESS_BARS` environment variable has been set. Use [`~utils.disable_progress_bars`] to disable them.
def enable_progress_bars() -> None: if HF_HUB_DISABLE_PROGRESS_BARS is True: warnings.warn( "Cannot enable progress bars: environment variable `HF_HUB_DISABLE_PROGRESS_BARS=1` is set and has" " priority." ) return global _hf_hub_progress_bars_disabled _hf_hub_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disable_progress_bars() -> None:\n if HF_HUB_DISABLE_PROGRESS_BARS is False:\n warnings.warn(\n \"Cannot disable progress bars: environment variable `HF_HUB_DISABLE_PROGRESS_BARS=0` is set and has\"\n \" priority.\"\n )\n return\n global _hf_hub_progress_bars_di...
[ "0.8631671", "0.71230966", "0.67262864", "0.5604459", "0.5546143", "0.54779994", "0.5450848", "0.5324412", "0.5323793", "0.5268212", "0.5187058", "0.5183304", "0.51629955", "0.5147131", "0.512834", "0.5121453", "0.509923", "0.5097283", "0.50888777", "0.50648963", "0.50533587"...
0.8963131
0
Return whether progress bars are globally disabled or not. Progress bars used in `huggingface_hub` can be enable or disabled globally using [`~utils.enable_progress_bars`] and [`~utils.disable_progress_bars`] or by setting `HF_HUB_DISABLE_PROGRESS_BARS` as environment variable.
def are_progress_bars_disabled() -> bool: global _hf_hub_progress_bars_disabled return _hf_hub_progress_bars_disabled
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disable_progress_bars() -> None:\n if HF_HUB_DISABLE_PROGRESS_BARS is False:\n warnings.warn(\n \"Cannot disable progress bars: environment variable `HF_HUB_DISABLE_PROGRESS_BARS=0` is set and has\"\n \" priority.\"\n )\n return\n global _hf_hub_progress_bars_di...
[ "0.80954826", "0.78224474", "0.6812388", "0.6743026", "0.59798837", "0.58661014", "0.58661014", "0.5833561", "0.55916744", "0.55784994", "0.54817325", "0.5473092", "0.5446248", "0.5437637", "0.5380249", "0.531148", "0.53078437", "0.53021574", "0.53021574", "0.52922225", "0.52...
0.880397
0
Surcharge de l'init pour accepter le label_singulier et les formats
def __init__(self, instance=None, data=empty, label_singulier=None, formats=None, **kwargs): self.label_singulier = label_singulier self.formats = formats or {} super().__init__(instance, data, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initFormat(self):\n pass", "def __init__(self, label):\n self.label = label", "def __init__(self, label: str):\n pass", "def __init__(self, Label=\"\", Sequence=\"\"):\n self.Label = Label\n self.Sequence = Sequence", "def __init__(self,sequence,label=\"\"):\n\n ...
[ "0.7155558", "0.6586551", "0.6467683", "0.6365193", "0.62127995", "0.61951834", "0.6193627", "0.6152432", "0.61123085", "0.60789335", "0.59764105", "0.59764105", "0.5970284", "0.58662844", "0.5855147", "0.58437043", "0.58263767", "0.5810533", "0.5810533", "0.5810533", "0.5810...
0.71038246
1