query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Whether or not the default pressure levels are used.
def DefaultPressureLevels(self): return self.P is None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pressure_options():\n pressure_settings = {\n \"use_log\": \"off\",\n \"time\": \"0\",\n \"records\": \"0\",\n \"ad2val\": get_now_measure(),\n \"status\": checker_pressure.status,\n }\n try:\n with open(\"./data/pressure_sensor.json\", \"r\") as f: # Rea...
[ "0.60208404", "0.5642839", "0.55783033", "0.5568597", "0.55158865", "0.55103517", "0.55045354", "0.5478146", "0.5433145", "0.53766733", "0.5376101", "0.5376101", "0.5373544", "0.5360759", "0.5349518", "0.53435576", "0.53372455", "0.5308957", "0.5294845", "0.5285473", "0.52843...
0.87345874
0
Number of profiles in this Profiles object.
def Nprofiles(self): return self._nprofiles
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def people_count(self):\n return len(self.__users)", "def profiles(self):\n if not self._profiles:\n self.GetAllProfiles()\n return self._profiles", "def profiles(self):\n return self._profiles", "def profiles(self):\n return self._profiles", "def get_num_processes(profileDi...
[ "0.7029895", "0.6642839", "0.6615187", "0.6615187", "0.6601933", "0.6480705", "0.62588745", "0.62426597", "0.62356067", "0.6223385", "0.61923814", "0.6177046", "0.6174073", "0.61656374", "0.6163472", "0.6158623", "0.6132954", "0.6132809", "0.6125924", "0.61203516", "0.6095080...
0.8791688
0
Number of gases in the gases array.
def Ngases(self): if self._gases_manual: return self._gases.shape[0] else: self._buildGasIdArray() return len(self._gas_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_grna(self) -> int:\n return len(self.gRNAs)", "def n(self):\n return len(self.genotypes)", "def numPhases(self):\n return self._phaseSpecMax + 1", "def numIncrementals(self) -> int:\n return len(self._dataArrays)", "def sample_count(self):\n assert len(self.decay_...
[ "0.67483014", "0.64543843", "0.64240694", "0.63182235", "0.6292739", "0.62759465", "0.6272683", "0.6223839", "0.62058425", "0.6199831", "0.61866426", "0.616197", "0.6107322", "0.6107066", "0.6055959", "0.60462546", "0.6027305", "0.6023097", "0.6012418", "0.6006874", "0.593971...
0.7894229
0
Print the gases array content on the standard output.
def printGases(self, pfunction=print): if self.T is None: return pfunction(">> Gases Ids and Names:") if self.DefaultPressureLevels: head = '{:10s} {:6s} '.format('Level', 'T') fmt = '{:10d} {:6.2f} ' + ('{:10.4e} ' * self.Ngases) else: hea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_array(self):\n for item in self.items:\n print(item)", "def show(self):\n m = [xo_convert(int(x)) for x in np.nditer(self.arr)]\n print(\"{} | {} | {}\".format(*m[:3]))\n print(\"--+---+--\")\n print(\"{} | {} | {}\".format(*m[3:6]))\n print(\"--+---...
[ "0.64073086", "0.6135355", "0.60062695", "0.5936886", "0.5853372", "0.5748726", "0.5737809", "0.5732686", "0.5713901", "0.5711214", "0.56841564", "0.5665033", "0.5651653", "0.55899185", "0.5542435", "0.55319285", "0.5518122", "0.54992396", "0.54801184", "0.5466994", "0.541264...
0.7085598
0
Returns a dict containing an id and name identifying the brand. Useful when displaying logos next to accounts in templates. For most providers, these are identical to the provider. For OpenID however, the brand can derived from the OpenID identity url.
def get_brand(self): provider = self.account.get_provider() return dict(id=provider.id, name=provider.name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def brand(self) -> str:\n return self._config_entry.data.get(CONF_BRAND, DEFAULT_BRAND)", "def brand(self) -> object:\n return self._brand", "def brand_from_request(self, request):\n if b\"brand\" in request.args:\n return request.args[b\"brand\"][0].decode(\"utf-8\")\n r...
[ "0.74547386", "0.7400217", "0.72723806", "0.70809495", "0.6838912", "0.6788304", "0.63546604", "0.62073046", "0.6105659", "0.5877203", "0.58657223", "0.5843112", "0.5818814", "0.5807949", "0.5733384", "0.57126707", "0.57126707", "0.57126707", "0.5594731", "0.5567401", "0.5443...
0.8752921
0
Quits the connection to the smtp client.
def _logout(self): if self.connected: try: self._smtp.quit() except smtplib.SMTPServerDisconnected: pass self._connected = False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_mail_connection(self):\n self._mailconn.close()", "def abortConnection():\n pass", "def disconnect(self):\n\n try:\n\n if (not self._is_connected):\n self._mh.demsg('htk_on_warning', self._mh._trn.msg(\n 'htk_email_not_connected'), sel...
[ "0.65936095", "0.6045707", "0.6022915", "0.5909621", "0.5871605", "0.5788257", "0.5780617", "0.5780617", "0.57091546", "0.57090497", "0.57027775", "0.5686884", "0.5678893", "0.56776667", "0.5676847", "0.5674768", "0.56486285", "0.56292635", "0.5628238", "0.56220114", "0.56196...
0.6958159
0
Uses the class attribute Emailer._config to connect to SMTP client.
def _login(self): self._smtp = smtplib.SMTP(host=self._config.host, port=self._config.port) # send 'hello' to SMTP server self._smtp.ehlo() # start TLS encryption self._smtp.starttls() self._smtp.login(self._config.sender_email, self._con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_smtp():\n print(\"INFO: Setting up SMTP variables...\")\n conf = ConfigParser()\n conf.read(os.path.join(os.path.abspath(\n os.path.dirname(__file__)), '.', 'smtp.conf'))\n smtp = {\n \"server\": conf.get('smtp', 'smtp_server'),\n \"login\": conf.get('smtp', 'smtp_login')...
[ "0.7072876", "0.69906664", "0.67638105", "0.6386244", "0.6318851", "0.6307825", "0.62603664", "0.6239821", "0.6209453", "0.59868085", "0.59112954", "0.582289", "0.57935023", "0.5718859", "0.56930685", "0.5673814", "0.56400454", "0.5622428", "0.5608501", "0.5579572", "0.553708...
0.59974766
9
Send an email message through the SMTP client. The message may either be a string containing characters in the ASCII range, or an `auto_emailer.emailer.Message` object. If the message is a string, the smtplib delivery method will use `smtplib.sendmail`. If the message is an `auto_emailer.emailer.Message` object, the sm...
def send_email(self, message, from_addr=None, to_addrs=None, delay_send=0): if not isinstance(message, Message) and isinstance(message, str): smtp_meth = 'sendmail' if (from_addr is None) or (to_addrs is None): raise ValueError('If sending string email,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send(self, to_addrs, subject, message, from_addr=None):\n if not from_addr: from_addr = self.user\n data = \"From: %s\\nTo: %s\\nSubject: %s\\n\\n%s\" \\\n % (from_addr, to_addrs, subject, message)\n try:\n server = smtplib.SMTP(self.host)\n server.ehlo(...
[ "0.7210467", "0.71080345", "0.69839424", "0.69092715", "0.62347573", "0.61362433", "0.60756147", "0.60519797", "0.6046977", "0.5946594", "0.58917576", "0.5874191", "0.58718705", "0.58680665", "0.5815829", "0.5798782", "0.5779696", "0.57670623", "0.5698961", "0.5690675", "0.56...
0.7735995
0
Override __str__ method to return message as string
def __str__(self): return self.message.as_string()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return self.msg", "def __str__(self):\n return self.msg", "def __str__(self):\n return self.message", "def __str__(self):\n return self.message", "def __str__(self):\n return self.message", "def __str__(self) -> str:\n\n return self.msg.forma...
[ "0.85540706", "0.85540706", "0.8550617", "0.8550617", "0.8550617", "0.8503952", "0.8461334", "0.8461334", "0.8461334", "0.8461334", "0.8461334", "0.8461334", "0.8461334", "0.8461334", "0.8406618", "0.8332677", "0.8263306", "0.81944585", "0.81258136", "0.810776", "0.77951294",...
0.8684215
0
Opens, reads, and returns the given template text file path as a string.
def body_template(template_path): try: template_text = Path(template_path).read_text() except FileNotFoundError: raise FileNotFoundError('File path not found: {}' .format(template_path)) return template_text
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_template(file_name):\n infile = open(file_name, 'r')\n return infile.read()", "def load(template):\n with open(template) as f:\n return f.read()", "def read_template(template_name: str) -> str:\n with open(os.path.join(DHPARSER_DIR, 'templates', template_name), 'r', encoding='utf-8'...
[ "0.7895426", "0.7804906", "0.769002", "0.75420105", "0.7407459", "0.7265912", "0.71268505", "0.7037583", "0.7035", "0.70177144", "0.6970333", "0.6950923", "0.68803984", "0.6862236", "0.68356156", "0.6832265", "0.6772635", "0.6718438", "0.6630333", "0.66285455", "0.6618097", ...
0.74128014
4
Create, or draft, the `self.message` instance attribute with string text or text file templates. Return self from the instance to allow method chaining of `auto_emailer.emailer.Message.attach`.
def draft_message(self, text=None, template_path=None, template_args=None): self.message['From'] = self.sender self.message['To'] = '; '.join(self.destinations) self.message['BCC'] = '; '.join(self.bcc) self.message['CC'] = '; '.join(self.cc) self.message['Subject'] = self.subjec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_message(self, **kwargs):\n message = Mail()\n if \"from_email\" in kwargs:\n sender = Email()\n message_content = kwargs.get(\"message_content\", \"\")\n sender.name = message_content.get(\"sender\", emailconf.DEFAULT_SENDER)\n sender.email = kwargs...
[ "0.65304", "0.6519613", "0.64167404", "0.6236499", "0.6189904", "0.61803824", "0.6118347", "0.61061835", "0.60972834", "0.60905147", "0.6075854", "0.6031078", "0.600757", "0.59929657", "0.5979075", "0.59775925", "0.59711695", "0.5967846", "0.5961782", "0.58773917", "0.5811507...
0.72739553
0
Add a sequence of files as attachments to the email message.
def attach(self, attach_files=None): # iterate through files to attach for path in attach_files or []: part = MIMEBase('application', "octet-stream") with open(path, 'rb') as file: part.set_payload(file.read()) # encode file in ASCII characters to sen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_mms_attachments(db, mms, backup_dir, thread_dir):\n qry = db.execute(\n \"SELECT _id, ct, unique_id, voice_note, width, height, quote \"\n \"FROM part WHERE mid=?\",\n (mms._id,),\n )\n for _id, ct, unique_id, voice_note, width, height, quote in qry:\n a = Attachment(\n...
[ "0.68068653", "0.656057", "0.64226186", "0.6417332", "0.63074434", "0.62571245", "0.62518847", "0.6211922", "0.619396", "0.6171993", "0.6164975", "0.6077357", "0.6073232", "0.60652393", "0.60565156", "0.6028875", "0.6017958", "0.60116714", "0.600287", "0.5975613", "0.59385246...
0.7169905
0
Constructor to create RuntimeNicInfoSchema object
def __init__(self, py_dict=None): super(RuntimeNicInfoSchema, self).__init__() self.set_data_type('xml') self.index = None self.label = None self.network = NetworkSchema() if py_dict is not None: self.get_object_from_py_dict(py_dict)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_vnic(options, index):\n vnic_schema = VnicSchema()\n address_group = AddressGroupSchema()\n address_group.primaryAddress = get_primary_ip(options, index)\n address_group.subnetMask = '255.255.0.0'\n vnic_schema.addressGroups = [address_group]\n vnic_schema.type = \"Internal\"\n vnic_s...
[ "0.6293053", "0.5554286", "0.54747784", "0.542624", "0.53388363", "0.53220224", "0.5319815", "0.53042895", "0.53042895", "0.5243218", "0.52410567", "0.52341026", "0.52291805", "0.52094626", "0.51490927", "0.5125273", "0.50775564", "0.50301373", "0.50165135", "0.5012711", "0.5...
0.7714954
0
Add a key with the given value to the trie, or reassign the associated value if it is already present in the trie. Assume that key is an immutable ordered sequence. Raise a TypeError if the given key is of the wrong type.
def __setitem__(self, key, value): if self.type is None: self.type = type(key) if type(key) != self.type: raise TypeError # e.g 'bat' first_char = key[:1] # 'b' others = key[1:] # 'at' # if hit last character of key if len(first_char...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def put(self, key, value):\n\n node = self._get_node(key) # Get the node with the key (if it exists)\n\n if node is None:\n index = self._get_index(key)\n self._buckets[index].add_front(key, value) # Key was not found (add it to the front of the list)\n self.siz...
[ "0.7430001", "0.7145464", "0.71036255", "0.70978844", "0.7004739", "0.69816715", "0.6964943", "0.6964338", "0.696078", "0.686979", "0.6844193", "0.6830074", "0.68191063", "0.68123823", "0.68006235", "0.67746335", "0.6753683", "0.67468774", "0.67124134", "0.6696639", "0.666820...
0.7367367
1
Return the value for the specified prefix. If the given key is not in the trie, raise a KeyError. If the given key is of the wrong type, raise a TypeError.
def __getitem__(self, key): if type(key) != self.type: raise TypeError first_char = key[:1] others = key[1:] if first_char not in self.children: print("FIRST_CHAR", first_char) print("self.children", self.children) raise KeyError ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find(self, prefix):\n node = self.root\n for char in prefix:\n if char not in node.keys():\n return None\n node = node[char]\n\n return node", "def get(self, key):\r\n if not isinstance(key, str):\r\n raise TypeError(\"Key must be a ...
[ "0.65028954", "0.6178536", "0.61475515", "0.6029087", "0.5981573", "0.5924109", "0.5881826", "0.58788633", "0.58506775", "0.5812456", "0.5808007", "0.5803161", "0.57658315", "0.56860644", "0.56860644", "0.5679785", "0.567018", "0.5659694", "0.56588537", "0.5653402", "0.565040...
0.62148166
1
Delete the given key from the trie if it exists. If the given key is not in the trie, raise a KeyError. If the given key is of the wrong type, raise a TypeError.
def __delitem__(self, key): if type(key) != self.type: raise TypeError first_char = key[:1] others = key[1:] if first_char not in self.children: raise KeyError if len(first_char) != 0 and len(others) == 0: node = self.children[first_char] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self, key: T) -> None:\n\n idx: int = self.hash_fn(key) # get an index location for 'key'\n if self.table[idx] is None: # 'key' doesn't exists in hash table\n raise Exception(\"Key doesn't exist in hashtable\")\n else:\n self.table[self.find(key)] = None # dele...
[ "0.717994", "0.7124825", "0.7091768", "0.7077653", "0.7036257", "0.69996", "0.6875046", "0.6864665", "0.6857603", "0.6830721", "0.6822555", "0.6822555", "0.68094456", "0.67888933", "0.6727768", "0.6670288", "0.66280127", "0.6612043", "0.65968156", "0.65968156", "0.65788853", ...
0.66155875
17
Is key a key in the trie? return True or False.
def __contains__(self, key): if type(key) != self.type: return False first_char = key[:1] others = key[1:] if first_char not in self.children: return False if len(first_char) != 0 and len(others) == 0: node = self.children[first_char] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_key_in_trie(self, key):\n return key in self._record_trie", "def search(self, key): \n \n current_node = self.root \n length = len(key) \n for level in range(length): \n index = self._charToIndex(key[level]) \n if not current_node.children[index]: \n ...
[ "0.8172406", "0.7377082", "0.7063299", "0.704825", "0.7019003", "0.69513655", "0.691084", "0.6905663", "0.6883814", "0.68376094", "0.68258333", "0.678873", "0.677487", "0.676038", "0.6737833", "0.6717868", "0.67103463", "0.6696794", "0.6660457", "0.6637827", "0.6632102", "0...
0.7192336
2
Generator of (key, value) pairs for all keys/values in this trie and its children. Must be a generator!
def __iter__(self): def inner(stack, node): if node.value is not None and stack != '' and stack != (): yield (stack, node.value) for key, child in node.children.items(): for char, value in inner(stack + key, child): yield (char, value...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iterentries(self):\n for key in self.iterkeys():\n yield self.get(key)", "def __iter__(self):\n if self.empty():\n return\n for node in self.root:\n yield node.key", "def __iter__(self):\n if self:\n if self.hasLeftChild():\n ...
[ "0.70657593", "0.7047053", "0.70308393", "0.70288134", "0.69442195", "0.6917498", "0.68971944", "0.68858236", "0.685708", "0.68484807", "0.6795768", "0.6774155", "0.67165965", "0.6680294", "0.6678713", "0.66142756", "0.65924895", "0.6584136", "0.65547055", "0.65438515", "0.65...
0.64323753
31
Given a piece of text as a single string, create a Trie whose keys are the words in the text, and whose values are the number of times the associated word appears in the text
def make_word_trie(text): trie = Trie() sentences = tokenize_sentences(text) for sentence in sentences: words = sentence.split() add_freq_trie(words, trie) return trie
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_phrase_trie(text):\n trie = Trie()\n\n sentences = tokenize_sentences(text)\n tuples = [tuple(sentence.split()) for sentence in sentences]\n\n add_freq_trie(tuples, trie)\n\n return trie", "def build_trie(text):\n\ttrie = Trie()\n\tnumbers, words = read_file(text)\n\tfor i in range(len(wo...
[ "0.72603476", "0.68620133", "0.6780543", "0.6610787", "0.65924776", "0.6590841", "0.6572384", "0.6505223", "0.6489996", "0.64869916", "0.6485799", "0.6436819", "0.64261985", "0.64073884", "0.63924384", "0.63846225", "0.63788104", "0.63670194", "0.6350208", "0.63377", "0.62977...
0.75299674
0
Given a piece of text as a single string, create a Trie whose keys are the sentences in the text (as tuples of individual words) and whose values are the number of times the associated sentence appears in the text.
def make_phrase_trie(text): trie = Trie() sentences = tokenize_sentences(text) tuples = [tuple(sentence.split()) for sentence in sentences] add_freq_trie(tuples, trie) return trie
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_word_trie(text):\n trie = Trie()\n\n sentences = tokenize_sentences(text)\n\n for sentence in sentences:\n words = sentence.split()\n add_freq_trie(words, trie)\n\n return trie", "def word_count(phrase):\n return collections.Counter(phrase.split())", "def build_trie(text):...
[ "0.74071217", "0.664657", "0.649828", "0.64425504", "0.63978606", "0.6303166", "0.6289099", "0.62707394", "0.62681466", "0.6255028", "0.623129", "0.6202899", "0.61852074", "0.61834705", "0.61547536", "0.6101801", "0.6101782", "0.60688937", "0.6060573", "0.6004803", "0.5999802...
0.7635392
0
Return the list of the mostfrequently occurring elements that start with the given prefix. Include only the top max_count elements if max_count is specified, otherwise return all. Raise a TypeError if the given prefix is of an inappropriate type for the trie.
def autocomplete(trie, prefix, max_count=None): if type(prefix) != trie.type: raise TypeError result = [] if max_count == 0: return result if prefix in trie: result.append((prefix, trie[prefix])) for i, elt in enumerate(prefix): if isinstance(prefix, tuple): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def autoComplete(prefix, Trie, top):\n\ttemp_node = Trie.search(prefix)\n\tsuggest_list = []\n\tword_list = []\n\tPqueue = PriorityQueue()\n\tfor child in temp_node.children.keys():\n\t\tnode = temp_node.children[child]\n\t\tPqueue.insert((child,node), node.weight)\n\tfor i in range(top):\n\t\tword_list.append(pre...
[ "0.57476366", "0.5700212", "0.55830884", "0.5507561", "0.54692626", "0.5456513", "0.539818", "0.53828704", "0.53653115", "0.5350605", "0.5345782", "0.53417176", "0.5315787", "0.52896094", "0.52867097", "0.5285394", "0.5264384", "0.5259577", "0.52426916", "0.5212763", "0.52113...
0.708108
0
Return the list of the mostfrequent words that start with prefix or that are valid words that differ from prefix by a small edit. Include up to max_count elements from the autocompletion. If autocompletion produces fewer than max_count elements, include the mostfrequentlyoccurring valid edits of the given word as well,...
def autocorrect(trie, prefix, max_count=None): autocompleted = autocomplete(trie, prefix, max_count) edits = get_valid_edits(trie, prefix) edits_items = [(key, trie[key]) for key in edits] sorted_edits_items = sorted(edits_items, key=lambda x: x[1], reverse=True) result = [word for word, _ in sor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def common_words_min(filename, min_chars):\n wordPattern = re.compile('[a-zA-Z]{' + str(min_chars) + ',}')\n occurance = dict()\n with open(filename, 'r') as f:\n contents = f.read()\n words = wordPattern.finditer(contents)\n for wordMatch in words:\n word = wordMatch.group(0).lower()\...
[ "0.6312419", "0.62253517", "0.6169425", "0.6160476", "0.61408204", "0.6136414", "0.6126492", "0.61255515", "0.6079376", "0.6054825", "0.60519606", "0.60519606", "0.603212", "0.5963704", "0.5960438", "0.59575546", "0.5951123", "0.5950231", "0.59225315", "0.5896468", "0.5876894...
0.61963695
2
Return list of (word, freq) for all words in trie that match pattern.
def word_filter(trie, pattern): def inner(trie, pattern, stack='', result=set()): if pattern == '': if trie.value is not None: result.add((stack, trie.value)) return result if pattern[0] == '*': result |= inner(trie, pattern[1:], stack, result)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_words(self, prefix):\n cur_node = self.root\n for char in prefix:\n if char not in cur_node.next:\n return []\n cur_node = cur_node.next[char]\n ans = []\n if cur_node.is_word:\n ans.append(prefix)\n for key in cur_node.nex...
[ "0.65513164", "0.64810103", "0.62651813", "0.6259721", "0.6254486", "0.6244982", "0.6231928", "0.6224338", "0.6167212", "0.6119921", "0.61172175", "0.60913765", "0.60840946", "0.60560155", "0.60364175", "0.59813875", "0.597326", "0.5928174", "0.5924605", "0.5911627", "0.59033...
0.64046925
2
Check that dimensions are set in header and return True
def check_has_dims(hdr): try: return (hdr['startX'], hdr['startY']) except KeyError: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_dimensions(self, workspace_to_check):\n for i in range(self._raw_ws.getNumDims()):\n if self._raw_ws.getDimension(i).getNBins() != workspace_to_check._raw_ws.getDimension(i).getNBins():\n return False\n return True", "def _check_dimensions(self) -> None:\n dims = (self.y...
[ "0.66215515", "0.65447414", "0.65282685", "0.6517261", "0.64698523", "0.6452294", "0.6431242", "0.63369185", "0.63355386", "0.624769", "0.62034816", "0.61909574", "0.6181983", "0.6154107", "0.60746735", "0.6071028", "0.606051", "0.60562056", "0.60302603", "0.6026588", "0.5979...
0.8026182
0
Set up dimensions in header in one place so we can easily change it
def set_dims_in_hdr(hdr, startx, starty, cols, rows): hdr['startX'] = (startx, 'Starting CCD pixel column') hdr['endX'] = (startx + cols, 'Ending CCD pixel column+1') hdr['startY'] = (starty, 'Starting CCD pixel row') hdr['endY'] = (starty + rows, 'Ending CCD pixel row+1')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_dimensions_for_frame(self):\n if not self.h or not self.w:\n (self.h, self.w) = self.frame.shape[:2]", "def header(self):\n print 'dimensions',self.data.shape\n print 'llcorner', self.xllcorner, self.yllcorner\n print 'cell size', self.cellsize", "def set_size(sel...
[ "0.64560467", "0.6388229", "0.6202352", "0.61627424", "0.61625296", "0.6013623", "0.5956187", "0.5949125", "0.588959", "0.58506715", "0.58451533", "0.582908", "0.5828663", "0.58207756", "0.5794755", "0.5776514", "0.5772067", "0.5768669", "0.5768049", "0.5746226", "0.57460886"...
0.69880044
0
Get offsets from database and return truth value if successful
def get_offsets(self, dbcurs): if self.obsind == 0: return False dbcurs.execute("SELECT rowoffset,coloffset FROM obsinf WHERE obsind={:d}".format(self.obsind)) rows = dbcurs.fetchall() if len(rows) != 1: warnings.warn("Unknown obsind {:d} in get_offsets".format(s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_offsets(self):\r\n\r\n #### Begin functionality here\r\n\r\n return()", "def Offset(self) -> int:", "def Offset(self) -> int:", "def Offset(self) -> int:", "def _getoffsets(isMountoffset):\n mplist = list()\n for i in range(23) :\n a = i+1\n mp = device.Carma(a...
[ "0.6453612", "0.56991845", "0.56991845", "0.56991845", "0.5665536", "0.5644195", "0.5534057", "0.5505202", "0.5501241", "0.54907715", "0.5437832", "0.54335827", "0.5384319", "0.5376516", "0.52712965", "0.5246323", "0.5237893", "0.52349037", "0.5154971", "0.5127712", "0.512691...
0.7203021
0
Set offsets in database
def set_offsets(self, dbcurs, rowoffset, coloffset): try: self.rowoffset += rowoffset self.coloffset += coloffset except TypeError: self.rowoffset = rowoffset self.coloffset = coloffset dbcurs.execute("UPDATE obsinf SET rowoffset={:.4f},coloffset={...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_offsets(self):\n\n for offset in self.offsets:\n self.db_file.write(struct.pack(\"<I\", offset))", "def set_offset(self, offset):\n self.offset = offset", "def set_offset(self, offset):\n self.offset = offset", "def set_offset(self, offset):\r\n for b in self.buf:...
[ "0.6813555", "0.65244156", "0.65244156", "0.6489408", "0.6325635", "0.6325635", "0.6325635", "0.6325635", "0.6268662", "0.62669045", "0.61497146", "0.6045562", "0.6045562", "0.6045562", "0.6028015", "0.6023278", "0.5989835", "0.5932461", "0.5899893", "0.58794636", "0.5838905"...
0.7481261
0
Quickly return dimensions as tuple
def dims(self): return (self.startx, self.starty, self.endx, self.endy)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dim(self) -> Tuple[Tuple[int, int], Tuple[int, int]]:", "def dim(self):\n return tuple(self._dim)", "def dims(self):\n return tuple(d for d in (v.states for v in self.__vars)) if len(self.__vars) else (1,)", "def dim(self) -> tuple:\n if self.has_tensor(): return self.as_tensor().dim()\n ...
[ "0.827965", "0.76133096", "0.7277834", "0.70804465", "0.70804346", "0.70566404", "0.70361495", "0.698778", "0.6963848", "0.69431365", "0.68668354", "0.68497163", "0.67484605", "0.6672545", "0.66367555", "0.66195816", "0.6564189", "0.65458006", "0.6530459", "0.65292627", "0.65...
0.6278881
32
Quickly return dimensions as tuple with columns and rows for quick compare
def dimscr(self): return (self.startx, self.starty, self.endx - self.startx, self.endy - self.starty)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dim(self) -> Tuple[Tuple[int, int], Tuple[int, int]]:", "def dim(self):\n return tuple(self._dim)", "def dimensions():", "def dims(self):\n return tuple(d for d in (v.states for v in self.__vars)) if len(self.__vars) else (1,)", "def dimensions(m):\n n = len(m)\n assert n > 0\n p = l...
[ "0.79226696", "0.6947648", "0.67823577", "0.6747319", "0.66964114", "0.66841763", "0.66107273", "0.65791786", "0.65453047", "0.6508361", "0.6491104", "0.646914", "0.64617735", "0.63838714", "0.6311656", "0.6304293", "0.62835497", "0.62835497", "0.6273463", "0.62363863", "0.62...
0.0
-1
Initialise fields from header
def init_from_header(self, hdr, nofn=False): global filtfn, fmtch, ftypes self.hdr = hdr getwcs = False try: self.target = hdr['OBJECT'] except KeyError: pass for d in ('DATE-OBS', 'DATE', '_ATE'): try: self.date = T...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _initFields(self):\n pass", "def __init__(self, headerBytes=None):\n if headerBytes is None:\n self.setVals()\n self.is_set = False\n else:\n self.unpack(headerBytes)", "def __init__(self):\n self.headers = HeaderContainer()", "def __init__(sel...
[ "0.7139495", "0.6948127", "0.6941781", "0.6941781", "0.68987757", "0.6870386", "0.68573266", "0.6852985", "0.6758746", "0.668408", "0.6579449", "0.65571445", "0.6525467", "0.65197295", "0.6488663", "0.64645654", "0.64330965", "0.63747436", "0.63153803", "0.63066167", "0.62796...
0.6268832
22
Initialise from data given
def init_from_data(self, data): self.data = data self.norm_data()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_data(self, data):\n assert type(data) is dict, \"dict expected: %r\" % type(data)\n assert len(data) is 1, \"size of dict should be 1: %r\" % len(data)\n self._name = data.keys()[0]\n self._data = np.asarray(data[self._name])\n self._set = True", "def __init__(self, d...
[ "0.75727504", "0.7437997", "0.7274602", "0.7270957", "0.7270957", "0.7270957", "0.7270957", "0.72454816", "0.7181052", "0.7178244", "0.71053904", "0.7033943", "0.70117384", "0.6991514", "0.6878409", "0.6867555", "0.68070924", "0.6784933", "0.6779148", "0.67779654", "0.6777307...
0.7391965
2
Set data to standard format
def norm_data(self): if (self.nrows, self.ncolumns) < self.data.shape: self.data = self.data[0:self.nrows, 0:self.ncolumns] if self.data.dtype != np.float64: self.data = self.data.astype(np.float64) self.meanval = self.data.mean() self.stdval = self.data.std()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_data(self, data):", "def format(self, data):", "def data_format(self, data_format):\n self._data_format = data_format", "def set_data(self, data):\n\n pass", "def setData(self,data):\n self.data = struct.pack(\"!f\",data)", "def set_data(self, data):\n self.data = d...
[ "0.7792184", "0.7509909", "0.7028005", "0.6783887", "0.6744736", "0.6544286", "0.6518715", "0.64781123", "0.64781123", "0.6440978", "0.64255124", "0.64237607", "0.6411243", "0.63822025", "0.638025", "0.6285724", "0.6281526", "0.62647545", "0.62647545", "0.6202571", "0.6202571...
0.0
-1
Calculate sky level (or recalculate with different value
def calc_skylevel(self, skylevstdp = DEFAULT_SKYLEVELSTD): if self.data is None or self.skylevstd == skylevstdp: return fimagedata = self.data.flatten() skymask = fimagedata - self.meanval <= skylevstdp * self.stdval fimagedata = fimagedata[skymask] if len(fimagedata)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculateUSky(self):\n skyline = []\n for p in self.pruned:\n pastart = [self.drange[0] for i in range(self.dim)]\n pamax = p.getLocationMax()\n pdom = list(self.index.intersection(tuple(pastart+pamax),objects=True))\n if len(pdom) == 1 and pdom[0].obje...
[ "0.5875459", "0.57996327", "0.5757148", "0.57421726", "0.5703255", "0.5670127", "0.55782783", "0.5566234", "0.55049795", "0.5457449", "0.5418364", "0.5414675", "0.54124326", "0.54110247", "0.53901476", "0.5388771", "0.53877604", "0.53847855", "0.5370543", "0.53638023", "0.536...
0.5857981
1
Get pix offsets field if it exists and adjust
def get_pixoffsets(self, dbcurs): # print("In get_pixoffsets obsind is ", self.from_obsind, file=sys.stderr) if dbcurs is None or self.from_obsind == 0 or self.wcs is None: # print("Aborting pixoffsets", file=sys.stderr) return self if self.pixoff is not None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def layer_offsets(self):\n ...", "def pixel_offset(self, x, y):\n return y * self.width + x", "def roi_y_offset():\n def r(x):\n return x & 0xFFF\n\n def w(x):\n return min(x, 0xFFF)\n return r, w", "def get_offsets(i):\n x = (i % 3) * (100 + PICTURE_...
[ "0.616975", "0.6088553", "0.58255404", "0.5682758", "0.56558484", "0.5540699", "0.55353326", "0.5520837", "0.547344", "0.5435697", "0.5412606", "0.5406133", "0.53971285", "0.5356343", "0.5345178", "0.53374934", "0.53186464", "0.5318213", "0.5286428", "0.5286035", "0.5263692",...
0.6417464
0
Load and fill up from specified file
def load_from_fits(self, fname): try: ff = fits.open(miscutils.replacesuffix(fname, 'fits.gz')) except OSError as e: if e.strerror is None: raise RemFitsErr(fname + " is not a valid FITS file") raise RemFitsErr("Open of " + fname + " (" + e.filename + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load(self):\r\n self.read(self.filename)", "def load(self, filename):\n raise NotImplementedError", "def load(self, filename):\n pass", "def load(cls, from_file):\n raise NotImplementedError", "def init_from_file(self):\n self.src.load('start.00') \n self.oe1.loa...
[ "0.75309783", "0.73495275", "0.7339073", "0.72101754", "0.716424", "0.71505773", "0.7145436", "0.704175", "0.704175", "0.69784784", "0.6889595", "0.6872984", "0.6862758", "0.6856784", "0.6809845", "0.68080086", "0.68058205", "0.6787888", "0.6783282", "0.67780674", "0.6742521"...
0.0
-1
Load and fill up from obsind
def load_from_obsind(self, dbcurs, obsind): try: ffmem = remget.get_obs_fits(dbcurs, obsind) except remget.RemGetError as e: raise RemFitsErr(e.args[0]) hdr, data = fitsops.mem_get(ffmem) if hdr is None or data is None: raise RemFitsErr("Could not fetc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_iemaccess(obs):\n icursor = IEM.cursor()\n for sid in obs:\n ob = obs[sid]\n iemob = Observation(sid, \"IA_RWIS\", ob['valid'])\n for varname in ['tmpf', 'dwpf', 'drct', 'sknt', 'gust', 'vsby',\n 'pday', 'tsf0', 'tsf1', 'tsf2', 'tsf3', 'scond0',\n ...
[ "0.6071452", "0.5643542", "0.54639316", "0.54413605", "0.53061116", "0.530248", "0.52960014", "0.5284563", "0.52474374", "0.5213094", "0.52029383", "0.5201828", "0.51739895", "0.5158542", "0.51445955", "0.5135886", "0.51066643", "0.5096415", "0.5080148", "0.5060177", "0.50400...
0.75179243
0
Load and fill up from iforbind
def load_from_iforbind(self, dbcurs, iforbind): try: ffmem = remget.get_iforb_fits(dbcurs, iforbind) except remget.RemGetError as e: raise RemFitsErr(e.args[0]) hdr, data = fitsops.mem_get(ffmem) if hdr is None or data is None: raise RemFitsErr("Could ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _import_bh_(self):", "def load(self):", "def load_data(self):", "def load_data(self) -> None:", "def onload(self):\n\t\tload_address_and_contact(self)", "def load(self):\n pass", "def load(self):\n pass", "def load(self):\n pass", "def load(self):\n pass", "def loa...
[ "0.6427387", "0.59581035", "0.59105223", "0.5891308", "0.5858824", "0.58477366", "0.58477366", "0.58477366", "0.58477366", "0.5708192", "0.567104", "0.56639886", "0.56420785", "0.56352353", "0.5608008", "0.55482864", "0.55381465", "0.5521994", "0.55185765", "0.54817885", "0.5...
0.73830223
0
Parse a file or ID string given. Should be of given type or don't care May expand this later to load up library files. Currently name is a file name if it isn't numeric, in which case it's supposed to be a FITS file. If it numeric, load from given obsid if type is None or from flat or bias file id if type is 'F' or 'B'...
def parse_filearg(name, dbcurs, typef=None): fobs = 0 if isinstance(name, int): try: if typef is None or typef == 'I': ffmem = remget.get_obs_fits(dbcurs, name) fobs = name elif typef == 'Z': ffmem = remget.get_saved_fits(dbcurs, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filename_type(filename):\n import re\n\n nii_re = re.compile(\".+(nii.gz)$|.+(nii)$\")\n npy_re = re.compile(\".+(npy)$|.+(npz)$\")\n\n\n if len(nii_re.findall(filename)):\n return 'nii'\n elif len(npy_re.findall(filename)):\n return 'npy'\n return None", "def getTypeFromFileN...
[ "0.58233434", "0.58141863", "0.5731429", "0.5408266", "0.5365787", "0.5331441", "0.52130616", "0.51932985", "0.5163812", "0.5148657", "0.51243335", "0.50863683", "0.50155354", "0.4994403", "0.498581", "0.49854007", "0.49764878", "0.49730483", "0.4951259", "0.4940682", "0.4925...
0.607072
0
Applies the Grayscale transform This will return an image with only one color channel
def grayscale(img): return cv2.cvtColor(img, cv2.COLOR_RGB2GRAY) # Or use BGR2GRAY if you read an image with cv2.imread() # return cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_grayscale(self):\n if len(self.img.shape) in (3, 4):\n gray = opencv.cvtColor(self.img, opencv.COLOR_BGR2GRAY)\n return Image(gray)\n else:\n assert len(self.img.shape) == 2\n return Image(self.img)", "def convert_grayscale(self):\n return s...
[ "0.7331833", "0.73211", "0.72184324", "0.69605756", "0.6953751", "0.68311745", "0.68041646", "0.678372", "0.674778", "0.67098874", "0.669716", "0.6661324", "0.66350925", "0.66271317", "0.66218376", "0.66123956", "0.6606681", "0.6605831", "0.65756476", "0.65756476", "0.6574278...
0.0
-1
Applies the Canny transform
def canny(img, low_threshold, high_threshold): return cv2.Canny(img, low_threshold, high_threshold)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def applyCanny( self, img):\n img = togray( img )\n res = cv2.Canny( img ,480,500)\n return res", "def process(self):\n self.output_image = cv.Canny(\n self.input_image,\n self.MIN_THRESHOLD,\n self.MAX_THRESHOLD,\n )\n return self.output...
[ "0.6851794", "0.6696897", "0.64693344", "0.6365952", "0.6241131", "0.6146549", "0.581067", "0.5793773", "0.57376987", "0.5682216", "0.5682216", "0.55317026", "0.5519554", "0.5489251", "0.54842466", "0.54228175", "0.54112726", "0.53895", "0.53755456", "0.5364231", "0.5355731",...
0.63083106
17
Applies a Gaussian Noise kernel
def gaussian_blur(img, kernel_size): return cv2.GaussianBlur(img, (kernel_size, kernel_size), 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeGaussianKernel(sigma: float) -> np.ndarray:\n\n # Your code here.\n kernel_size = 8*sigma+1\n kernel = np.zeros([kernel_size,kernel_size], dtype=float)\n center = kernel_size//2\n \n \n s = 2*(sigma**2)\n sum_val = 0\n for i in range(0,kernel_size):\n for j in range(0,kern...
[ "0.72501665", "0.7238673", "0.7133608", "0.70733476", "0.7032118", "0.70059544", "0.6962647", "0.6922447", "0.69143754", "0.68922627", "0.6847318", "0.68443054", "0.6800559", "0.6747172", "0.67408603", "0.6682682", "0.664223", "0.66227716", "0.65993124", "0.65962404", "0.6553...
0.0
-1
Applies an image mask. Only keeps the region of the image defined by the polygon formed from `vertices`. The rest of the image is set to black.
def region_of_interest(img, vertices): # defining a blank mask to start with mask = np.zeros_like(img) # defining a 3 channel or 1 channel color to fill the mask with depending on the input image if len(img.shape) > 2: channel_count = img.shape[2] # i.e. 3 or 4 depending on your image ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __mask_region(self, img, vertices):\n\n mask = np.zeros_like(img) \n if len(img.shape) > 2:\n channel_count = img.shape[2] # i.e. 3 or 4 depending on your image\n ignore_mask_color = (255,) * channel_count\n else:\n ignore_mask_color = 255\n cv2.f...
[ "0.829376", "0.78395873", "0.7791126", "0.7482095", "0.7380898", "0.7357217", "0.73339796", "0.733068", "0.733068", "0.733068", "0.733068", "0.733068", "0.733068", "0.733068", "0.7327671", "0.7284704", "0.7281517", "0.7281517", "0.7281517", "0.7281517", "0.7094407", "0.7048...
0.73199767
19
`img` should be the output of a Canny transform. Returns an image with hough lines drawn.
def hough_lines(img, rho, theta, threshold, min_line_len, max_line_gap): lines = cv2.HoughLinesP(img, rho, theta, threshold, np.array([]), minLineLength=min_line_len, maxLineGap=max_line_gap) line_img = np.zeros((img.shape[0], img.shape[1], 3), dtype=np.uint8) draw_lines(line_img...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hough_lines(image):\n #30 20 20\n\n #best 40, 20, 300\n #fin test 40, 20, 50\n return cv2.HoughLinesP(image, rho=1, theta=np.pi / 90, threshold=40, minLineLength=20, maxLineGap=50)", "def get_hough_lines(image):\n return cv2.HoughLinesP(image, rho=1, theta=np.pi / 180, threshold=20,\n ...
[ "0.7541656", "0.74147946", "0.73591125", "0.7277715", "0.7244032", "0.7201011", "0.71521544", "0.71501654", "0.71430725", "0.71430725", "0.71430725", "0.71430725", "0.7117644", "0.71108854", "0.7071296", "0.7062496", "0.70558906", "0.7043405", "0.7029732", "0.7012249", "0.700...
0.71035784
15
Filter the image to include only yellow and white pixels
def filter_colors(image): # Filter white pixels white_threshold = 200 lower_white = np.array([white_threshold, white_threshold, white_threshold]) upper_white = np.array([255, 255, 255]) white_mask = cv2.inRange(image, lower_white, upper_white) white_image = cv2.bitwise_and(image, image, mask=whi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def color_filter(self, image):\n converted = hls_scale(image)\n\n # white color mask\n white_lower_bnd, white_upper_bnd = self.color_filter_params[\"white_bounds\"]\n white_mask = cv2.inRange(converted, white_lower_bnd, white_upper_bnd)\n\n # yellow color mask\n yellow_low...
[ "0.76847804", "0.7375192", "0.7259556", "0.71312225", "0.7113475", "0.69528234", "0.69173133", "0.68364596", "0.6796155", "0.67922866", "0.6783323", "0.67643285", "0.6745479", "0.6682935", "0.6654411", "0.6609564", "0.65907264", "0.6586901", "0.6575922", "0.6571457", "0.65653...
0.7700582
0
Makes sure computations are done in the correct order. e.g. z = Ax + b > Ax is done first, and then Ax + b
def traverse_postorder(operation): nodes_postorder = [] def recurse(node): if isinstance(node, Operation): for input_node in node.input_nodes: recurse(input_node) nodes_postorder.append(node) recurse(operation) return nodes_postorder
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reorderComputation(self, value):\n\t\tif (((not isinstance(value, interfaces.IComputation)) or value.hasAnnotation(u'parens')) or value.hasAnnotation(u'reordered')):\n\t\t\treturn value\n\t\top1=value.getOperator()\n\t\ta=value.getLeftOperand()\n\t\tb=value.getRightOperand()\n\t\tif value.isUnary():\n\t\t\tif...
[ "0.59228754", "0.5645785", "0.5601566", "0.55472517", "0.5545743", "0.55454886", "0.5513974", "0.5509951", "0.55086297", "0.55058837", "0.547616", "0.54687166", "0.5447244", "0.5437423", "0.5436649", "0.54004204", "0.53970134", "0.53913313", "0.5373925", "0.53675914", "0.5359...
0.0
-1
string enumeration, no constraints on the value, but can be a more than one architecture with the same value
def get_serie(probability_of_using_same_serie=0.1): if random() < probability_of_using_same_serie and GraphParameters.SERIE: return choice(list(GraphParameters.SERIE)) serie = "Alpha-" + ''.join(choice('0123456789ABCDEF-') for i in range(8)).strip("-") GraphParameters.SERIE.add(serie...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_cpu_architecture_type(self):\n \n cpu_architecture = get_cpu_information()[0]\n \n # Check to make sure the returned value is a string\n self.assertEqual(type(cpu_architecture), str)", "def data_type_str(self):\n data_type = self.data_type()\n if data_typ...
[ "0.61918795", "0.5912114", "0.58973724", "0.5766614", "0.5678855", "0.56624985", "0.5650607", "0.5644302", "0.5622878", "0.5622878", "0.55702", "0.5542782", "0.5533287", "0.5533287", "0.5513626", "0.5510988", "0.547226", "0.5470509", "0.54422176", "0.5432155", "0.54258496", ...
0.0
-1
targetMarket { Europe | Asia | South America }
def get_target_market(): return choice(GraphParameters.TARGET_MARKETS)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_for_contracts(self, market=None, buy_sell=None, type_=None, contracts=\"All\"):\n if not contracts:\n contracts = []\n if not type_:\n pass\n elif type_.lower() in ['yes', 'long'] and buy_sell == 'buy':\n type_ = {'long': 'BestBuyYesCost'}\n e...
[ "0.57462746", "0.56122434", "0.53708637", "0.5205027", "0.51902217", "0.5009565", "0.492107", "0.49086607", "0.48434213", "0.48400208", "0.48024845", "0.478029", "0.47573486", "0.47528923", "0.47457224", "0.47294596", "0.47148532", "0.471476", "0.46918187", "0.4688385", "0.46...
0.605438
0
double in the range of 1 to 350
def get_price(): return uniform(1.0, 350.0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def approximate(val):\r\n if val >=2 or val == 3:\r\n return 250\r\n elif val >=1:\r\n return 150\r\n elif val >=0:\r\n return 50", "def sweep50T(self):\n return 35.6", "def sweep50W(self):\n return 25.9", "def rad(x) :#en mm!\r\n return topdia(x)/2.0", "def do...
[ "0.62738985", "0.6211129", "0.6177974", "0.6153779", "0.6136418", "0.6136418", "0.6050506", "0.6023709", "0.6017821", "0.6010199", "0.5968694", "0.5917861", "0.59174", "0.58664536", "0.5853007", "0.5850547", "0.58496016", "0.58488184", "0.5822002", "0.58215356", "0.57960254",...
0.6865591
0
double in the range of 20 to 50
def get_mpg(): return uniform(20.0, 50.0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_price():\n return uniform(1.0, 350.0)", "def how_many_20s(self, amount):\n return amount // 20", "def learning_rate_range():\n # Lower and upper bounds\n #######\n lower_bound = 0.1 \n upper_bound = 1e-6\n #######\n return lower_bound, upper_bound", "def sweep50W(self)...
[ "0.63229877", "0.62370175", "0.61711633", "0.6114251", "0.6056698", "0.6056698", "0.6033771", "0.6000559", "0.5986408", "0.5884385", "0.58580065", "0.58557", "0.5853926", "0.5850388", "0.58477825", "0.5832393", "0.58318615", "0.580973", "0.58080363", "0.58015215", "0.57664907...
0.5330456
59
mimicks range() function but for doubles/floats.
def double_range(start, stop, step): r = start while r < stop: yield r r += step
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def float_range(start, stop, step=1): \n while start < stop:\n yield start\n start += step", "def float_range(start, stop, step):\n while start < stop:\n yield float(start)\n start += decimal.Decimal(step)", "def range(series):\n return min(series), max(series)", "def r...
[ "0.7256529", "0.7124728", "0.6878003", "0.68109035", "0.6734122", "0.6672506", "0.66207373", "0.65901047", "0.6399975", "0.6376316", "0.63717145", "0.63616467", "0.6335002", "0.6301018", "0.62825763", "0.6268307", "0.6253221", "0.62285256", "0.618896", "0.6128928", "0.6127611...
0.5956077
37
double between 1.2 and 4.0
def get_engine_size(): possibilities = [d for d in GraphParameters.double_range(1.2, 4.2, 0.2)] return choice(possibilities)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def double(value):\n return value * 2", "def double(value):\n return value * 2", "def double(value):\n return 2 * value", "def getDouble(self, int: int, int2: int) -> float:\n ...", "def nextDouble(self) -> \"double\":\n raise NotImplementedError", "def double(self):\n retur...
[ "0.6898058", "0.6898058", "0.68385124", "0.6593201", "0.6247384", "0.6214277", "0.61923575", "0.61731607", "0.6138854", "0.6134926", "0.6088282", "0.60680723", "0.60122544", "0.5962432", "0.59155124", "0.5897675", "0.58881336", "0.58881336", "0.5845269", "0.57372487", "0.5725...
0.0
-1
Return files that start with start_str
def get_files(start_str = "sim_"): n = len(start_str) file_list = [f for f in os.listdir(in_path) if f[0:n] == start_str] return file_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def search_files_starting_with(user_id: UserID, startswith: str = \"\"):", "def get_filenames_containing(substr, path='.'):\n files = []\n for file_name in os.listdir(path):\n if substr in file_name: files.append(file_name)\n\n return files", "def startswith(a, prefix, start=0, end=None):...
[ "0.7615643", "0.6830341", "0.6474506", "0.6389351", "0.6341631", "0.62231886", "0.61254793", "0.6120444", "0.6091747", "0.606094", "0.59563726", "0.5911721", "0.5900385", "0.58944684", "0.58868766", "0.586614", "0.5851371", "0.5851371", "0.58499634", "0.5833049", "0.5824467",...
0.8144655
0
Simple initialization of class.
def __init__(self, data, startLat, startLon, delta, numX, numY): self.data = data self.startLat = startLat self.startLon = startLon self.delta = delta self.xCells = numX self.yCells = numY
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(cls):", "def init(self) -> None:", "def init(self, *args, **kwds):\n pass", "def __init__(self, *args, **kwargs) -> None:\n pass", "def __init__(self, *args, **kwargs) -> None:\n pass", "def __init__ (self):\n pass", "def __call__(cls, *args, **kwargs):\n ...
[ "0.8146848", "0.7417829", "0.73805517", "0.7361189", "0.7361189", "0.7336216", "0.7324109", "0.73122483", "0.73035717", "0.7303108", "0.72682786", "0.721855", "0.7181645", "0.7150422", "0.7150422", "0.7150422", "0.7150422", "0.7150422", "0.7150422", "0.7150422", "0.7150422", ...
0.0
-1
Create an index of trajectory points.
def gridData(trajs, simpTrajs, delta): simpTraj = simpTrajs[0] trID = simpTraj.trajID p = trajs.get_group(trID).iloc[simpTraj.indices[0]] xMin, yMin = p.lon, p.lat xMax, yMax = xMin, yMin for simpTraj in simpTrajs: trID = simpTraj.trajID for index in simpTraj.indices: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_index(self, points: [Point]):\n\n self.root = self.partition(points, 0, None)\n # self.print(self.root)", "def create_index():", "def index_points(points, idx):\n device = points.device\n B = points.shape[0]\n view_shape = list(idx.shape)\n view_shape[1:] = [1] * (len(view_s...
[ "0.7064664", "0.61460865", "0.6125682", "0.61177784", "0.60093945", "0.6003102", "0.5978925", "0.5924444", "0.58988357", "0.5884294", "0.5858351", "0.58458185", "0.5838355", "0.5809144", "0.5805857", "0.579149", "0.5741717", "0.5735704", "0.5723498", "0.5721928", "0.5706675",...
0.0
-1
Given a file path to an excel file, load and return an openpyxl readonly workbook object.
def get_workbook(path): wb = openpyxl.load_workbook(path, read_only=True) return wb
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_workbook(self, workbook):\n mylog.debug('Opening workbook %s' % workbook)\n workbook = openpyxl.load_workbook(filename = workbook)\n return workbook", "def open_xlsx_file(filepath, mode=\"rb\"):\n archive = XslxFile(filepath)\n archive.open()\n return archive", "def _load...
[ "0.7368432", "0.7060973", "0.6922139", "0.6796353", "0.65540737", "0.6519225", "0.62310666", "0.60859585", "0.5946056", "0.58495164", "0.5846661", "0.5751223", "0.56671757", "0.56429374", "0.5634577", "0.56330353", "0.560512", "0.55682737", "0.5515254", "0.55118674", "0.55113...
0.84446806
0
Format data and prepare features for use in model. One hot encodes categorical data and remove columns for features are not used.
def extract_features(X): X = X.drop("PassengerId", axis=1) X = X.drop("Ticket", axis=1) X = X.drop("Cabin", axis=1) # Adding polynomial features X["Age2"] = X["Age"] ** 2 #X["Fare2"] = X["Fare"] ** 2 #X["Pclass2"] = X["Pclass"] ** 2 male_titles = set(["Mr", "Don", "Sir"]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preprocess_feature(df):", "def pre_process_data(df):\n\n # one-hot encode categorical values\n df = pd.get_dummies(df)\n\n return df", "def onehot_features(data):\n\n# Binary Features\n columns = ['Weekend', 'Revenue']\n for col in columns:\n data[col] = data[col].apply(lambda x: fl...
[ "0.7540816", "0.7463317", "0.7386785", "0.73689556", "0.71285003", "0.70198", "0.69367", "0.68478185", "0.68428034", "0.668031", "0.6660982", "0.6634657", "0.662265", "0.65885335", "0.65838057", "0.65788764", "0.65181595", "0.6514698", "0.6506632", "0.6490261", "0.6480171", ...
0.0
-1
Generate a simple plot of the test and training learning curve.
def plot_learning_curve(estimator, title, X, y, ylim=None, cv=None, n_jobs=1, train_sizes=np.linspace(.1, 1.0, 5)): plt.figure() plt.title(title) if ylim is not None: plt.ylim(*ylim) plt.xlabel("Training examples") plt.ylabel("Score") train_sizes, train_scores, te...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_learning_curve(model, X_train, X_test, y_train, y_test):\n\n m, train_scores, valid_scores = learning_curve(estimator = model, \n X = X_train, y = y_train.ravel(), train_sizes = np.linspace(0.1,1.0, 80))\n\n train_cv_err = np.mean(train_scores, axis=...
[ "0.77525973", "0.765816", "0.75102395", "0.7416209", "0.7408866", "0.7352092", "0.7336836", "0.71406", "0.70817316", "0.70733446", "0.70598775", "0.7038602", "0.7025372", "0.70210844", "0.70116454", "0.6983374", "0.693645", "0.69301355", "0.6926825", "0.6920689", "0.69122547"...
0.65282047
62
Set up demo component.
async def setup_comp(opp): opp.config.units = IMPERIAL_SYSTEM assert await async_setup_component( opp, water_heater.DOMAIN, {"water_heater": {"platform": "demo"}} ) await opp.async_block_till_done()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_component(self):\n self.conf, self.context = self._init_component()\n self.initialize()", "def test_Demo(self):\n self._run(self._example_scenarios, \"Demo\")", "def setup(self):\n pass", "def setup(self):\n pass", "def setup(self):\r\n pass", "def setu...
[ "0.7093276", "0.6918465", "0.6717493", "0.6703075", "0.6687205", "0.6665716", "0.6665716", "0.6665716", "0.6665716", "0.6665716", "0.6665716", "0.6665716", "0.6665716", "0.6665716", "0.6665716", "0.6665716", "0.6665716", "0.66643405", "0.66617626", "0.6627368", "0.6627368", ...
0.0
-1
Test the initial parameters.
async def test_setup_params(opp): state = opp.states.get(ENTITY_WATER_HEATER) assert state.attributes.get("temperature") == 119 assert state.attributes.get("away_mode") == "off" assert state.attributes.get("operation_mode") == "eco"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n\t\tprint(\"\\n-------------------------------------\\nIn Test_ValidParams:\", self._testMethodName)", "def test_01_Init(self):\n pass", "def setUp(self):\n self.params_1 = {\"S\":100,\"K\":100,\"Vol\":0.2,\"R\":0.05,\"T\":1}\n self.params_2 = {\"S\":100,\"K\":100,\"Vol\"...
[ "0.73700863", "0.7154518", "0.709898", "0.7039714", "0.70320123", "0.7001577", "0.69893885", "0.69797814", "0.6978556", "0.6906631", "0.68911487", "0.68638223", "0.6844669", "0.6826321", "0.6803611", "0.6773656", "0.67716944", "0.676276", "0.6754196", "0.67467755", "0.6736064...
0.0
-1
Test the setup with default parameters.
async def test_default_setup_params(opp): state = opp.states.get(ENTITY_WATER_HEATER) assert state.attributes.get("min_temp") == 110 assert state.attributes.get("max_temp") == 140
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\r\n # nothing to do, all tests use different things\r\n pass", "def test_init_default(self):\n self._test_init_default()", "def setUp(self):\n setUp()", "def setUp(self):\n pass #because we dont have anything to setup.", "def setUp(self):\n test_en...
[ "0.7622389", "0.7508864", "0.7459986", "0.7455701", "0.7443748", "0.74377924", "0.74375165", "0.74153537", "0.74153537", "0.7399985", "0.739964", "0.73963904", "0.73947966", "0.7389834", "0.7389834", "0.7383788", "0.7383788", "0.7383788", "0.7383788", "0.7383788", "0.7383788"...
0.0
-1
Test setting the target temperature without required attribute.
async def test_set_only_target_temp_bad_attr(opp): state = opp.states.get(ENTITY_WATER_HEATER) assert state.attributes.get("temperature") == 119 with pytest.raises(vol.Invalid): await common.async_set_temperature(opp, None, ENTITY_WATER_HEATER) assert state.attributes.get("temperature") == 119
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_set_only_target_temp(opp):\n state = opp.states.get(ENTITY_WATER_HEATER)\n assert state.attributes.get(\"temperature\") == 119\n await common.async_set_temperature(opp, 110, ENTITY_WATER_HEATER)\n state = opp.states.get(ENTITY_WATER_HEATER)\n assert state.attributes.get(\"temperature\...
[ "0.8027909", "0.79105926", "0.769426", "0.7580324", "0.74087405", "0.72200274", "0.71733814", "0.70905495", "0.70461076", "0.70403665", "0.7028701", "0.70047265", "0.69735044", "0.696505", "0.69063497", "0.6892376", "0.6885662", "0.68727285", "0.6785096", "0.67664456", "0.676...
0.7845447
2
Test the setting of the target temperature.
async def test_set_only_target_temp(opp): state = opp.states.get(ENTITY_WATER_HEATER) assert state.attributes.get("temperature") == 119 await common.async_set_temperature(opp, 110, ENTITY_WATER_HEATER) state = opp.states.get(ENTITY_WATER_HEATER) assert state.attributes.get("temperature") == 110
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_temperature(self):\n if (self._device.mode == self._device.MODE_HEAT) or (\n self._device.mode == self._device.MODE_HEAT_EMERGENCY):\n return self._device.setpoint_heat\n if self._device.mode == self._device.MODE_COOL:\n return self._device.setpoint_cool\n ...
[ "0.752928", "0.7521583", "0.74530584", "0.7288676", "0.72487295", "0.7138381", "0.7137618", "0.7123813", "0.7027435", "0.700687", "0.69732", "0.6971851", "0.69647145", "0.69607794", "0.6916602", "0.69082516", "0.68830884", "0.6873596", "0.68711144", "0.68623066", "0.6850366",...
0.7560652
0
Test setting operation mode without required attribute. Also check the state.
async def test_set_operation_bad_attr_and_state(opp): state = opp.states.get(ENTITY_WATER_HEATER) assert state.attributes.get("operation_mode") == "eco" assert state.state == "eco" with pytest.raises(vol.Invalid): await common.async_set_operation_mode(opp, None, ENTITY_WATER_HEATER) state = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_set_operation(opp):\n state = opp.states.get(ENTITY_WATER_HEATER)\n assert state.attributes.get(\"operation_mode\") == \"eco\"\n assert state.state == \"eco\"\n await common.async_set_operation_mode(opp, \"electric\", ENTITY_WATER_HEATER)\n state = opp.states.get(ENTITY_WATER_HEATER)\...
[ "0.7044802", "0.6830595", "0.67805827", "0.672449", "0.66483605", "0.6632744", "0.6616226", "0.6484543", "0.6455349", "0.64516705", "0.6368438", "0.6276806", "0.62333524", "0.62178135", "0.62123823", "0.617815", "0.6159418", "0.61503863", "0.6148324", "0.6131021", "0.61238754...
0.7208718
0
Test setting of new operation mode.
async def test_set_operation(opp): state = opp.states.get(ENTITY_WATER_HEATER) assert state.attributes.get("operation_mode") == "eco" assert state.state == "eco" await common.async_set_operation_mode(opp, "electric", ENTITY_WATER_HEATER) state = opp.states.get(ENTITY_WATER_HEATER) assert state.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetOperateMode(self):\n handler = self.get_command_object(\"SetOperateMode\")\n handler()", "def _set_operation_mode(self, operation_mode: HVACMode):\n if operation_mode == HVACMode.HEAT:\n success = self._client.set_mode(self._client.MODE_HEAT)\n elif operation_mode ==...
[ "0.7180476", "0.7161364", "0.71027154", "0.6890383", "0.68392074", "0.66424024", "0.6628153", "0.6612539", "0.6580201", "0.6560963", "0.6465273", "0.6460798", "0.640803", "0.64078206", "0.63398135", "0.63228106", "0.6297737", "0.6239032", "0.6175793", "0.6170697", "0.616249",...
0.67086774
5
Test setting the away mode without required attribute.
async def test_set_away_mode_bad_attr(opp): state = opp.states.get(ENTITY_WATER_HEATER) assert state.attributes.get("away_mode") == "off" with pytest.raises(vol.Invalid): await common.async_set_away_mode(opp, None, ENTITY_WATER_HEATER) assert state.attributes.get("away_mode") == "off"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_set_away_mode_off(opp):\n await common.async_set_away_mode(opp, False, ENTITY_WATER_HEATER_CELSIUS)\n state = opp.states.get(ENTITY_WATER_HEATER_CELSIUS)\n assert state.attributes.get(\"away_mode\") == \"off\"", "async def test_set_away_mode_on(opp):\n await common.async_set_away_mode(...
[ "0.7378384", "0.713406", "0.64238816", "0.62875086", "0.6212701", "0.61619836", "0.6124875", "0.59361404", "0.5883761", "0.5818602", "0.57394147", "0.5729822", "0.57261974", "0.5719309", "0.57163227", "0.5715907", "0.56904936", "0.5661714", "0.5616527", "0.56012005", "0.55724...
0.7482605
0
Test setting the away mode on/true.
async def test_set_away_mode_on(opp): await common.async_set_away_mode(opp, True, ENTITY_WATER_HEATER) state = opp.states.get(ENTITY_WATER_HEATER) assert state.attributes.get("away_mode") == "on"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_set_away_mode_off(opp):\n await common.async_set_away_mode(opp, False, ENTITY_WATER_HEATER_CELSIUS)\n state = opp.states.get(ENTITY_WATER_HEATER_CELSIUS)\n assert state.attributes.get(\"away_mode\") == \"off\"", "def is_away_mode_on(self):\n return self._away", "def turn_away_mod...
[ "0.7670136", "0.7290108", "0.7080147", "0.6730108", "0.6638462", "0.6435057", "0.62459266", "0.6187724", "0.6054229", "0.6043155", "0.6014375", "0.5969935", "0.5905401", "0.5894503", "0.5867881", "0.58605886", "0.5832053", "0.5816296", "0.5755829", "0.5748471", "0.5742686", ...
0.7855596
0
Test setting the away mode off/false.
async def test_set_away_mode_off(opp): await common.async_set_away_mode(opp, False, ENTITY_WATER_HEATER_CELSIUS) state = opp.states.get(ENTITY_WATER_HEATER_CELSIUS) assert state.attributes.get("away_mode") == "off"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_set_away_mode_on(opp):\n await common.async_set_away_mode(opp, True, ENTITY_WATER_HEATER)\n state = opp.states.get(ENTITY_WATER_HEATER)\n assert state.attributes.get(\"away_mode\") == \"on\"", "def turn_away_mode_off(self):\n self._away = 0\n self._api._awaymode = self.away\...
[ "0.7333799", "0.721697", "0.69039184", "0.67879134", "0.67871475", "0.6761423", "0.67269874", "0.66250473", "0.6546024", "0.6375222", "0.63553953", "0.6330588", "0.62832606", "0.6265553", "0.6236148", "0.6234184", "0.623073", "0.62036973", "0.6197417", "0.6178961", "0.6157971...
0.7992974
0
Test the setting of the target temperature.
async def test_set_only_target_temp_with_convert(opp): state = opp.states.get(ENTITY_WATER_HEATER_CELSIUS) assert state.attributes.get("temperature") == 113 await common.async_set_temperature(opp, 114, ENTITY_WATER_HEATER_CELSIUS) state = opp.states.get(ENTITY_WATER_HEATER_CELSIUS) assert state.attr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_set_only_target_temp(opp):\n state = opp.states.get(ENTITY_WATER_HEATER)\n assert state.attributes.get(\"temperature\") == 119\n await common.async_set_temperature(opp, 110, ENTITY_WATER_HEATER)\n state = opp.states.get(ENTITY_WATER_HEATER)\n assert state.attributes.get(\"temperature\...
[ "0.7560652", "0.752928", "0.7521583", "0.7288676", "0.72487295", "0.7138381", "0.7137618", "0.7123813", "0.7027435", "0.700687", "0.69732", "0.6971851", "0.69647145", "0.69607794", "0.6916602", "0.69082516", "0.68830884", "0.6873596", "0.68711144", "0.68623066", "0.6850366", ...
0.74530584
3
Displays the template validator form, which finds and displays template syntax errors.
def template_validator(request): # get a dict of {site_id : settings_module} for the validator settings_modules = {} for mod in settings.ADMIN_FOR: settings_module = import_module(mod) settings_modules[settings_module.SITE_ID] = settings_module site_list = Site.objects.in_bulk(settings_m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n VALIDATE_TEMPLATE(TEMPLATES)", "def main():\n VALIDATE_TEMPLATE(TEMPLATES)", "def error():\n return render_template(\"error.html\", **locals())", "def __display_form(self, template, message=None):\r\n # page = memcache.get(str(language_code) + key, namespace='Pages')\r\n ...
[ "0.7101959", "0.7101959", "0.640813", "0.6305738", "0.6230856", "0.615779", "0.60361665", "0.5919322", "0.58960176", "0.5835799", "0.5803729", "0.57881266", "0.5744281", "0.56511295", "0.56417954", "0.5625868", "0.56173974", "0.56111276", "0.5609739", "0.55656195", "0.5563375...
0.69872093
2
Generate a neatly formatted full name.
def get_formatted_name(first,last,middle = ''): if middle: full_name = first + ' ' + middle + ' ' + last else: full_name = first + ' ' + last return full_name.title()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_name(self):\n\t\tself.full_name = self.first + \" \" + self.last", "def full_name(self) -> str:\r\n\t\tname = f'{self.last_name} {self.first_name}'\r\n\t\tif self.middle_name:\r\n\t\t\tname += ' ' + self.middle_name\r\n\t\treturn name", "def get_formatted_name(first, last):\n full_name = f'{first...
[ "0.84015906", "0.8262383", "0.8231049", "0.8229208", "0.8199836", "0.8191048", "0.8168978", "0.81436765", "0.8132338", "0.81308675", "0.8123386", "0.80716896", "0.80716896", "0.80716896", "0.80230886", "0.80207074", "0.8016316", "0.79988605", "0.79969", "0.79969", "0.79969", ...
0.76526946
87
Check timeout on all responses. (Internal)
def run(self): for req, resp in self.servings: resp.check_timeout()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkTimeout(self):\n if TIMEOUT <= (datetime.now() - self.clockCheckStop).total_seconds():\n print('Didn\\'t received messages for 1 minute - Program ends')\n exit(0)", "async def check_timeout(self) -> None:\n async with self.lock:\n # Looping through the keys...
[ "0.7058286", "0.7047105", "0.6976976", "0.6956466", "0.6903624", "0.6869933", "0.67265135", "0.67265135", "0.66661", "0.65805197", "0.6533125", "0.652901", "0.6524272", "0.6524272", "0.65208507", "0.6500781", "0.64605254", "0.6445319", "0.64041847", "0.63812697", "0.6341507",...
0.7151977
0
Add the handlers based on the platform
def subscribe(self): if hasattr(self.bus, "signal_handler"): self.bus.signal_handler.subscribe() if hasattr(self.bus, "console_control_handler"): self.bus.console_control_handler.subscribe()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_handlers(self, host_pattern, host_handlers):\n pass", "def _handlers(self):\n settings = self.get_settings(prefix='tangled.app.handler.')\n # System handler chain\n handlers = [settings['exc']]\n if self.has_any('static_directory'):\n # Only enable static fil...
[ "0.6459096", "0.6346671", "0.61831176", "0.61233884", "0.610435", "0.6082184", "0.60800916", "0.6060946", "0.60346335", "0.60325074", "0.5927236", "0.5927098", "0.5900461", "0.5875382", "0.5869099", "0.5772936", "0.5706122", "0.56997824", "0.56821257", "0.5635602", "0.5630908...
0.0
-1
Mount the given root, start the builtin server (and engine), then block.
def quickstart(root=None, script_name="", config=None): if config: _global_conf_alias.update(config) tree.mount(root, script_name, config) engine.signals.subscribe() engine.start() engine.block()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_cherrypy(server, cp_root_config, host, port):\n LOGGER.debug(\"Starting BibleMunger's CherryPy HTTP server\")\n cherrypy.config.update({\n 'server.socket_host': host,\n 'server.socket_port': port,\n })\n cherrypy.tree.mount(server, '/', cp_root_config)\n cherrypy.engine.signa...
[ "0.62113804", "0.5996418", "0.59840506", "0.58499175", "0.5848936", "0.577345", "0.5736323", "0.5716487", "0.56979954", "0.56430525", "0.56052136", "0.5594576", "0.5594576", "0.5591513", "0.55816275", "0.5576859", "0.5571833", "0.5566873", "0.55232877", "0.55101705", "0.54842...
0.6634261
0
Remove all attributes of self.
def clear(self): self.__dict__.clear()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_attrs(self):\n self._attributes.clear()", "def unload(self) -> None:\n for attr in self._attrs:\n setattr(self, attr, None)", "def clear_attributes(self):\n self.attrs = etad.AttributeContainer()", "def pop_attributes(self):\n attrs = self.attrs\n self.clea...
[ "0.8491966", "0.8351149", "0.83035016", "0.78218764", "0.77265173", "0.77183187", "0.75926304", "0.73327106", "0.71943885", "0.7067317", "0.7046804", "0.7044822", "0.7044008", "0.702816", "0.6971798", "0.6951487", "0.68935674", "0.6893545", "0.6847193", "0.6822977", "0.680945...
0.7490776
7
Given an object or a path to an object, get the object and its name.
def _cherrypy_pydoc_resolve(thing, forceload=0): if isinstance(thing, _ThreadLocalProxy): thing = getattr(serving, thing.__attrname__) return _pydoc._builtin_resolve(thing, forceload)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_object(self, path):\n if path == \"/\":\n return self.target\n\n parts = path[1:].split(\"/\")\n last = self.target\n for part in parts:\n if type(last) == dict:\n last = last[part]\n else:\n last = getattr(last, \"...
[ "0.69559675", "0.691009", "0.6760387", "0.67347", "0.6676811", "0.6668472", "0.6662165", "0.6553244", "0.65314436", "0.651679", "0.651506", "0.6498734", "0.64879876", "0.64736205", "0.64598316", "0.6455439", "0.6406439", "0.63877434", "0.6379155", "0.6347765", "0.6314566", ...
0.0
-1
Log the given message to the app.log or global log as appropriate.
def __call__(self, *args, **kwargs): # Do NOT use try/except here. See # https://bitbucket.org/cherrypy/cherrypy/issue/945 if hasattr(request, 'app') and hasattr(request.app, 'log'): log = request.app.log else: log = self return log.error(*args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log(self, message):\n self._logger.write(message)", "def log_message(self, msg):\n\t\tself.logView.log_message(msg)", "def log(self, message: str):", "def _log(self, message):\n pass", "def log(self, message):", "def log(message):\n logger.debug(message)\n logger.info(message)\n ...
[ "0.7761639", "0.7621362", "0.7605709", "0.7584394", "0.75042945", "0.74220085", "0.73879296", "0.7357544", "0.7256182", "0.72472423", "0.72376764", "0.71750337", "0.715496", "0.7152786", "0.7123877", "0.7093945", "0.70770323", "0.70700806", "0.7044104", "0.7023449", "0.700504...
0.0
-1
Log an access message to the app.log or global log as appropriate.
def access(self): try: return request.app.log.access() except AttributeError: return _cplogging.LogManager.access(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def access(self, resp, req, environ, request_time):\n if not (self.cfg.accesslog or self.cfg.logconfig or self.cfg.syslog):\n return\n\n msg = self.make_access_message(resp, req, environ, request_time)\n try:\n self.access_log.info(msg)\n except:\n self....
[ "0.7185651", "0.6523197", "0.64772236", "0.64573336", "0.6434097", "0.6287813", "0.6273701", "0.6230247", "0.60883826", "0.60856247", "0.608382", "0.6074772", "0.60715365", "0.60612786", "0.6053758", "0.60466224", "0.6027029", "0.6008827", "0.6003419", "0.5962097", "0.5894058...
0.664811
1
Expose the function, optionally providing an alias or set of aliases.
def expose(func=None, alias=None): def expose_(func): func.exposed = True if alias is not None: if isinstance(alias, basestring): parents[alias.replace(".", "_")] = func else: for a in alias: parents[a.replace(".", "_")] = f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expose(func=None, alias=None):\n def expose_(func):\n func.exposed = True\n return func\n\n return expose_", "def alias(command_name):\n def decorator(func):\n func.alias = command_name\n return func\n return decorator", "def get_alias_output(function_name: Optional[...
[ "0.7673283", "0.7128352", "0.6637989", "0.6424419", "0.6424419", "0.6424419", "0.6361283", "0.6340898", "0.6146636", "0.6117641", "0.60302657", "0.6021969", "0.60218155", "0.5970032", "0.5950877", "0.5935909", "0.5916922", "0.5893474", "0.5874196", "0.5868669", "0.58553696", ...
0.7323877
1
A decorator for _cp_dispatch (cherrypy.dispatch.Dispatcher.dispatch_method_name).
def popargs(*args, **kwargs): # Since keyword arg comes after *args, we have to process it ourselves # for lower versions of python. handler = None handler_call = False for k, v in kwargs.items(): if k == 'handler': handler = v else: raise TypeError( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def DispatcherOperation(*args, **kwargs): # real signature unknown\r\n pass", "def dispatch(self):\n return self._wrapper(self._dispatch_fun)", "def methdispatch(func): \n dispatcher = singledispatch(func)\n def wrapper(*args, **kw):\n return dispatcher.dispatch(args[1].__class__)(*ar...
[ "0.6471334", "0.6093481", "0.60875237", "0.5816719", "0.5806957", "0.57933307", "0.57482004", "0.5734852", "0.5734852", "0.5688783", "0.5607051", "0.5605491", "0.55859804", "0.5582217", "0.5570543", "0.5565516", "0.5548415", "0.55269355", "0.54993445", "0.54993445", "0.549934...
0.5124419
45
Create an absolute URL for the given path. If 'path' starts with a slash ('/'), this will return (base + script_name + path + qs). If it does not start with a slash, this returns (base + script_name [+ request.path_info] + path + qs). If script_name is None, cherrypy.request will be used to find a script_name, if avail...
def url(path="", qs="", script_name=None, base=None, relative=None): if isinstance(qs, (tuple, list, dict)): qs = _urlencode(qs) if qs: qs = '?' + qs if request.app: if not path.startswith("/"): # Append/remove trailing slash from path_info as needed # (this ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def base_uri(relative_path=''):\n base_path = get_app_root()\n if not os.path.exists(base_path):\n raise ValueError('Path %s does not exist' % base_path)\n\n return 'file://%s' % os.path.join(base_path, relative_path)", "def build_absolute_url(self, path_or_url):\n return urllib.parse.urlj...
[ "0.6238953", "0.618595", "0.610934", "0.6081608", "0.60263693", "0.60063034", "0.59969616", "0.5966333", "0.5895924", "0.58950174", "0.58721554", "0.5836391", "0.58252335", "0.5688763", "0.56713015", "0.5667372", "0.56341165", "0.5604614", "0.5574834", "0.5554429", "0.5540535...
0.7533173
0
Get the status from the rsync thread and put it in the progress file
def status(self): status = self.thread.status() # print_array(status) message = ["------ RSYNC PROGRESS ------ "] if self.log_message: message.append(self.log_message) message.append("Current file: %s" % status['current_file']) message.append("\tBytes Copied: %s" % status['bytes_copied']) message.append...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transfer_progress(self, stats):", "def invoke_rsync(self):\n completed_process = subprocess.run(self.rsync_command,\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE)\n logging.debug(completed_process)\n ...
[ "0.6777564", "0.6394757", "0.61871463", "0.609681", "0.6096022", "0.6055591", "0.60302174", "0.5995028", "0.5973515", "0.59674454", "0.59263337", "0.59085476", "0.59085476", "0.5875658", "0.5855492", "0.58342963", "0.58338475", "0.5822388", "0.58222246", "0.58195615", "0.5804...
0.8530146
0
Make sure we can create and write to the logfile
def init_logfile(self): if os.path.exists(self.logfile): # move the logfile aside and compress it bz_file = bz2.BZ2File("%s.bz2" % self.logfile,'w') log = open(self.logfile,'r') bz_file.writelines(log.readlines()) log.close() bz_file.close() #print "Logging output to %s" % self.logfile date = da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _createlog(self):\n\t\tif self.toemail and self.fromemail and self.smtphost:\n\t\t\t# Use the email logger as the first logger, so that when sending the email (in :meth:`EmailLogger.close`) fails, it will still be logged to the log file/stdout/stderr\n\t\t\tself._loggers.append(EmailLogger(self))\n\t\tif self....
[ "0.74432623", "0.74330425", "0.7122266", "0.6985715", "0.6850406", "0.67636234", "0.67317724", "0.6727542", "0.6714958", "0.6711773", "0.66778713", "0.66537964", "0.6643447", "0.663516", "0.6626179", "0.6569834", "0.6547289", "0.6542611", "0.654088", "0.65071476", "0.6487591"...
0.6473984
21
transform the indexlist based input to some data that can be fed into the text_CNN_GRU class
def index_to_input(X, maxlen_sent, maxlen_doc): X = [pad_sequences(i, maxlen=maxlen_sent, padding='post') for i in X] X = pad_2Dsequences(X, maxlen=maxlen_doc) return X
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reconstruct_input(self, ix):", "def newsgroup_featurize(data_list):\n # TODO: Implement featurization of input.\n all_text = data_list[\"train\"][\"input\"] + data_list[\"test\"][\"input\"] + data_list[\"dev\"][\"input\"]\n word_dict = word_count(all_text)\n bow_noun_features = bow_noun(word_dict...
[ "0.62193716", "0.62182826", "0.6153804", "0.6070244", "0.5895866", "0.58787155", "0.58728063", "0.5836504", "0.5795648", "0.57929426", "0.5776618", "0.5754024", "0.5725142", "0.5699933", "0.5678135", "0.5661687", "0.56300557", "0.5617113", "0.56122434", "0.5609133", "0.560096...
0.55809236
24
Assign labels to the foreground pixels of a given frame
def add_labels(self, frame_nums, labels): assert all([self._frame_labels[t] is None for t in frame_nums]) for t, labels_t in zip(frame_nums, labels): self._frame_labels[t] = labels_t if labels_t.numel() > 0: self._highest_instance_id = max(self._highest_instance_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_label(self, foreground_labels):\n # Find the unique (nonnegative) foreground_labels, map them to {0, ..., K-1}\n unique_nonnegative_indices = np.unique(foreground_labels)\n mapped_labels = foreground_labels.copy()\n for k in range(unique_nonnegative_indices.shape[0]):\n ...
[ "0.63771665", "0.62744766", "0.6252945", "0.62246346", "0.6200802", "0.61367935", "0.6130762", "0.603238", "0.5855012", "0.5841786", "0.5775731", "0.575476", "0.57406974", "0.5729451", "0.57212615", "0.57204556", "0.56699353", "0.56662065", "0.56208855", "0.56195366", "0.5615...
0.0
-1
Returns true if track labels have already been assigned to a given frame
def labels_exist(self, frame_num): return self._frame_labels[frame_num] is not None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_label(self, label):\n return label in self.get_labels()", "def has_label(self, label):\n\t\treturn label in self.labels", "def has_label(self, label):\n\t\t\treturn label in self.labels", "def has_label(self, label):\n return label == self.label", "def has_label(self, label):\n ret...
[ "0.6462645", "0.64227855", "0.6422614", "0.6338353", "0.62672585", "0.61824983", "0.60186857", "0.5974276", "0.5969538", "0.58716065", "0.58103716", "0.57967025", "0.5790005", "0.5789058", "0.5760368", "0.5760037", "0.5759478", "0.5759478", "0.5738486", "0.5736193", "0.571848...
0.69120014
0
Similar to add_labels, but is meant to be used when updating the labels for a given frame (e.g. using a longrange association measure). This method makes sure that the number of points in the previous and updated labels are the same.
def update_labels(self, frame_num, labels): assert self.labels_exist(frame_num) assert not self._is_frozen[frame_num] assert self._frame_labels[frame_num].shape == self._frame_labels[frame_num].shape self._frame_labels[frame_num] = labels if labels.numel() > 0: self._...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def UpdateLabel(self) -> _n_6_t_0:", "def update_frame_label(self):\n count = len(self.main_frame_list)\n\n for idx in range(count): #Start, count) \n s1 = \"\"\n for i in range(16): #self.main_frame_nibble_list: # 16\n s = \"\"\n ...
[ "0.7086552", "0.68638706", "0.6534343", "0.6482007", "0.6184477", "0.6168908", "0.6103208", "0.60646325", "0.60601974", "0.60497373", "0.6028361", "0.59803355", "0.59591025", "0.59314024", "0.5846374", "0.5845976", "0.58170295", "0.58104277", "0.58036655", "0.58036387", "0.57...
0.64954364
3
Returns 3 dicts. The first contains final list of track as a dict with keys being the frame numbers and values being tensors containing the track ID for each foreground pixel. Note that this is just a flattened list of labels and not the final masks. The second dict contains the number of pixels belonging to each track...
def get_track_mask_idxes(self): instance_id_num_pts = defaultdict(lambda: 0) instance_id_lifetimes = defaultdict(lambda: [10000, -1]) for frame_num, labels_per_frame in enumerate(self._frame_labels): for id in labels_per_frame.unique().tolist(): instance_id_num_pts[i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def computeTrackmap(imagelist):\n tracks = {}\n for i in imagelist:\n for t in i._tracks:\n if not tracks.has_key(t):\n tracks[ t ] = []\n tracks[ t ].append(i)\n return tracks", "def get_cstr_for_video(\n video_name,\n path_info='/sequoia/data2/...
[ "0.6047102", "0.56389713", "0.5587176", "0.53966856", "0.53693813", "0.53398895", "0.5310672", "0.5262479", "0.5234222", "0.52311134", "0.5161346", "0.5151894", "0.5128668", "0.5123341", "0.5115165", "0.51096714", "0.5103857", "0.50867206", "0.5045372", "0.5042487", "0.504056...
0.6396873
0
Performs clustering/stitching of tracklets for a video containing T frames.
def process(self, masks, subsequences, return_fg_embeddings=False): num_frames = masks.shape[0] # convert masks into a list of foreground indices mask_idxes = masks_to_coord_list(masks) # store labels for each sub-sequence in a list: this will be used for generating visualizations ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_tubelets(dname, gpu=-1, redo=False):\n d = GetDataset(dname)\n\n if gpu >= 0:\n caffe.set_mode_gpu()\n caffe.set_device(gpu)\n\n model_dir = os.path.join(os.path.dirname(__file__), '../models/ACT-detector/', dname)\n output_dir = os.path.join(os.path.dirname(__file__), '../res...
[ "0.62410384", "0.5987691", "0.5958347", "0.5761506", "0.56551886", "0.5579116", "0.55694836", "0.55388576", "0.55317354", "0.5417133", "0.5367054", "0.53306943", "0.5280498", "0.528045", "0.5251225", "0.5242524", "0.5237903", "0.52166075", "0.51735", "0.51642627", "0.5128952"...
0.0
-1
Performs clustering within a subsequence
def cluster_subsequence(self, mask_idxes, embeddings, bandwidths, seediness, label_start, return_fg_embeddings): assert len(mask_idxes) == embeddings.shape[1] # extract foreground embeddings embeddings = embeddings.permute(1, 2, 3, 0).unbind(0) # list(T, tensor(H, W, E)) bandwidths = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self,\n seq_fasta_fn,\n subst_matrix_fn,\n cost_gap_open,\n clustering):", "def test_first_sequence_placed_in_first_cluster(self):\n seq_len = 20\n num_seqs = 20\n bases = list(standard_bases)\n # Function has different behaviour at ...
[ "0.64124066", "0.6250099", "0.6202888", "0.6154626", "0.5908853", "0.58887273", "0.58326495", "0.5812277", "0.57981443", "0.57825345", "0.5729109", "0.57207227", "0.5707352", "0.569779", "0.5696792", "0.5693362", "0.5686149", "0.56815404", "0.567314", "0.5648872", "0.5640961"...
0.6534881
0
Associates clusters and resolves inconsistencies for a pair of labels for a given frame.
def associate_clusters(self, labels_1, labels_2): if not torch.is_tensor(labels_1): labels_1 = torch.cat(labels_1).cuda() if not torch.is_tensor(labels_2): labels_2 = torch.cat(labels_2).cuda() assert labels_1.shape == labels_2.shape, "Shape mismatch: {}, {}".format(lab...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cluster_in_strain(labels_first, labels_second):\n count_data = {}\n labels_first = np.asarray(labels_first)\n labels_second = np.asarray(labels_second)\n for label_2 in np.unique(labels_second):\n label_2_index = labels_second == label_2\n label_1_sub = labels_first[label_2_index]\n ...
[ "0.5888262", "0.5430708", "0.5366825", "0.53241193", "0.5261441", "0.5216448", "0.5203264", "0.5197972", "0.5193561", "0.5150947", "0.5047554", "0.50402206", "0.5018021", "0.50129044", "0.4987262", "0.49855828", "0.4972752", "0.49726838", "0.49714983", "0.4958701", "0.4948464...
0.6399165
0
Convert a mapping into the MariaDB dynamic columns format
def pack(dicty: dict[str, Any]) -> bytes: column_count = 0 column_directory = [] directory_offset = 0 name_offset = 0 names = [] data_offset = 0 data = [] total_encname_length = 0 dicty_names_encoded = {key.encode("utf-8"): value for key, value in dicty.items()} for encname in ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __get_column_mapping(self):\n\n s1 = list(Sample(\"FL\", \"M1.0@265_Primary_ar115_s2010-08-06T06_36_00_e2010-08-06T18_24_00.csv\").get_data().columns)[:25]\n column_mapping = {}\n for i in range(len(s1)):\n column_mapping[i] = s1[i]\n\n return column_mapping", "def _tra...
[ "0.637489", "0.63693553", "0.61467266", "0.6078091", "0.59148407", "0.5908164", "0.5869827", "0.58684886", "0.58368295", "0.5775969", "0.5741456", "0.57183146", "0.570985", "0.56733435", "0.56428117", "0.56385976", "0.5609826", "0.5608541", "0.5606896", "0.55741376", "0.55549...
0.0
-1
Convert MariaDB dynamic columns data in a byte string into a dict
def unpack(buf: bytes) -> dict[str, Any]: flags: int column_count: int len_names: int flags, column_count, len_names = struct_unpack_from("<BHH", buf) data_offset_code, coldata_size, data_offset_mask = decode_data_size(flags) if (flags & 0xFC) != 4: raise DynColValueError("Unknown dynami...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mmtf_bytes_to_mmtf_dict(bytestring):\n\n raw = msgpack.unpackb(bytestring)\n return decode_dict(raw)", "def rawtodictonary(rawstring):\n\n if is_python3():\n rawstring = bytes(rawstring).decode('utf-8') \n \n raw = rawstring.split(NULL)[:-2]\n\n data = {}\n for i in range(0,len(r...
[ "0.6225917", "0.60612905", "0.5960494", "0.59214944", "0.5856121", "0.57844216", "0.57782954", "0.571592", "0.5661566", "0.5632245", "0.55446476", "0.551958", "0.5484435", "0.54693854", "0.54421115", "0.5412926", "0.5399616", "0.53867096", "0.5329256", "0.52692723", "0.525615...
0.65447694
0
Creates name/player num/batting averages lists for an example team.
def build_player_data(): names = ["Gunther O'Brian", 'Workman Gloom', 'Esme Ramsey', 'Cornelius Games', 'Kline Greenlemon', 'Hotbox Sato', 'Famous Owens', 'Jenkins Good'] nums = [77, 31, 37, 6, 14, 53, 7, 64] avgs = [...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getStats(population, masterList):\n for team in population:\n for i in range(13): #13 are the number of roster spots?\n team.totHr += masterList[team.roster[i]].hr\n team.totAvg += masterList[team.roster[i]].avg\n team.totRuns += masterList[team.roster[i]].runs\n ...
[ "0.6307435", "0.61158663", "0.5994403", "0.5912429", "0.5905684", "0.58455443", "0.58227724", "0.57905746", "0.57655394", "0.5711466", "0.5707383", "0.5696947", "0.56850535", "0.56670207", "0.56519645", "0.5632154", "0.56263906", "0.5602424", "0.55969036", "0.55899966", "0.55...
0.64472055
0
prints batting averages for the example team
def print_avg():
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def PM_averages(self,num):\n self.write(self.headStr('PM')+'AVG %d'%num)", "def showAverageStats(self) :\n Scenario.messageAverageStats()\n self.showAverageGainWon()\n self.showAverageBetUsed()\n self.showAverageNbAttemptsByLevels()", "def display_hall_of_fame(self) -> None:\...
[ "0.6329005", "0.6317431", "0.6299118", "0.6253293", "0.62418795", "0.6199458", "0.6118419", "0.6117253", "0.6104908", "0.60712403", "0.6058508", "0.6018945", "0.5972491", "0.5965435", "0.5953858", "0.59346896", "0.59285134", "0.5892162", "0.58633775", "0.585565", "0.58317703"...
0.74231094
0
This function calculates qn values by constructing a list of q values starting from q0 up to qn, and returning the last one
def prob_list(n, p): ... #pn is the probability of seeing a pair of aces two hands in a row in n hands. #qn = 1 - pn #thus qn is the probability of NOT seeing a par of aces two hands in a row in n hands. list = [] qn_a = 1 qn_b = 1 list.append(qn_a) list.append(qn_b) for i in range(n-2): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reverse_quad(q):\n return [q[1], q[0], q[3], q[2]]", "def find_z(q):\n z = np.zeros(len(q) - 1, int)\n for i in range(len(q) - 1):\n z[i] = np.ceil(q[i]/2 + q[i+1]/2) # formula from class\n return np.concatenate([[0], z, [BITS-1]])", "def _interpolate_Q(Q, dQ, n):\n if n > 0:\n ...
[ "0.66430557", "0.6498868", "0.6292246", "0.62038547", "0.61917627", "0.60583544", "0.60085726", "0.5942998", "0.59386873", "0.5937982", "0.59218794", "0.5878637", "0.58481634", "0.5837961", "0.5837881", "0.58155376", "0.58154905", "0.5802288", "0.5796448", "0.57915133", "0.57...
0.60844547
5
returns the move taken by the computer, given a list of previous moves.
def cpu_move(moves_list): move = randint(0,3) return move
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_move(self, last_result):\n return self.moves.pop()", "def get_move(moves):\n pass", "def get_move(self, board, possible_moves, player_1_or_2):\n\n # Given a Tic-Tac-Toe 3x3 board position where 1 => current player's square,\n # -1 => opponent's square, 0 => blank square,\n ...
[ "0.6714415", "0.6704953", "0.64064866", "0.6399448", "0.6344681", "0.6277229", "0.62568855", "0.6246137", "0.6235963", "0.6234417", "0.61767673", "0.61511475", "0.61426175", "0.6130053", "0.6109668", "0.6101191", "0.60499066", "0.6041381", "0.60190207", "0.5993879", "0.598858...
0.5655471
86
plays games of rockpaper scissors, then summarizes the results.
def rps(): # do stuff to initialize moves_list = [] result = [] play = True while play: human = int(input("Enter Your Move (0 for rocks, 1 for paper, 2 for scissors): ")) while human not in [0,1,2]: human = int(input("Enter a valid input (0 for rocks, 1 for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def playGames(self, num, sonete,secuence,mcts,verbose=False):\n eps_time = AverageMeter()\n bar = Bar('Arena.playGames', max=num)\n end = time.time()\n eps = 0\n maxeps = int(num)\n finalScore1=0\n finalScore2=0\n\n num = int(num/2)\n oneWon = 0\n ...
[ "0.65188205", "0.64907044", "0.6449025", "0.6405023", "0.63012624", "0.62684613", "0.6260163", "0.62391734", "0.6220819", "0.61666495", "0.61610836", "0.6098098", "0.607146", "0.60660064", "0.6055843", "0.60509557", "0.6043713", "0.60243666", "0.6018364", "0.6016521", "0.5976...
0.5657286
59
Gets the relevant data from the page
def page_data(): return scrape()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data(self):", "def get_data_from_web():\n pass", "def get_data():\n pass", "def _get_new_data(self, page_url, soup):\n data = {}\n data['url'] = page_url\n title = soup.find('dd', class_='lemmaWgt-lemmaTitle-title').find('h1')\n data['title'] = title.get_text()\n...
[ "0.6730114", "0.6618766", "0.6600513", "0.6547922", "0.65046227", "0.6493531", "0.6475723", "0.6469656", "0.64514273", "0.6447151", "0.6422951", "0.6407426", "0.6378092", "0.63685703", "0.6319855", "0.63064635", "0.6302634", "0.6302634", "0.62835723", "0.6277931", "0.6271495"...
0.7586842
0
Returns a list of available routes to hit for this scraper.
def routes_available(): return json.dumps( ["%s" % rule for rule in app.url_map.iter_rules()], indent=4, separators=(",", ": "), )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getRoutes(self):\n pass", "def routes(self):\n return self._routes", "def routes():\n routeList = []\n for profile in globalProfile():\n routeList.append(profile.route)\n return routeList", "def list_routes():\n import urllib\n output = []\n for rule in app.url_map.iter_rules...
[ "0.77080035", "0.7676648", "0.7439491", "0.7172235", "0.7116953", "0.7067988", "0.7066477", "0.7009398", "0.6810401", "0.68101865", "0.67954373", "0.6693072", "0.66887784", "0.66226894", "0.66207767", "0.66207767", "0.6619082", "0.6619082", "0.6602359", "0.65691066", "0.65492...
0.68693405
8
Return requested registered discrete trajectory by key
def registered_dtrajs(request): key = request.node.funcargs.get("registered_key") return examples.registered[key]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, key):\n return self.points.__getitem__(key)", "def find_series(self, key):\n # TODO: this could be more efficient if we pushed it down into Java\n return self.filter(lambda x: x[0] == key).first()[1]", "def __getitem__(self, key):\n return self.xg[key]", "def...
[ "0.60901046", "0.6006764", "0.5978444", "0.59641314", "0.5940013", "0.59151363", "0.5898085", "0.58594894", "0.5847373", "0.5846153", "0.57806826", "0.57643783", "0.5762443", "0.57606256", "0.5747918", "0.5747918", "0.57363623", "0.5732648", "0.57308215", "0.57036227", "0.566...
0.0
-1