query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Parse a "list" file of one string per line.
def read_list(fname): with open(fname) as handle: items = [line.strip() for line in handle] return items
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_list(list_file):\r\n return [line.strip('\\n').strip('\\r') for line in open(list_file)]", "def make_list(list_file):\n return [line.strip('\\n').strip('\\r') for line in open(list_file)]", "def loadList(file_name):\n with open(file_name) as f:\n l = [line.strip() for line in f]\n r...
[ "0.69963896", "0.68782794", "0.6861088", "0.6839188", "0.66005546", "0.6537189", "0.65259945", "0.6492868", "0.6488287", "0.6471783", "0.6462429", "0.6400951", "0.63790214", "0.6368196", "0.6365775", "0.6330416", "0.6322876", "0.62156916", "0.6214151", "0.6209701", "0.6205681...
0.7194156
0
Calculate genelevel mutational statistics from a table of mutations.
def make_lof_table(data_table, my_genes, my_samples, summary_func): table_header = ["Gene"] + my_samples + [ "Missense:Benign", "Missense:Possibly", "Missense:Probably", "MissenseNA", "Indel", "Nonsense", "Frameshift", "Splice-site", "Synonymous"] table_records = [] gs_lookup = grou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lof_sig_scores(table, samples, verbose=True):\n mut_probdam = 'Missense:Probably'\n mut_syn = 'Synonymous'\n mut_trunc = ['Nonsense', 'Frameshift', 'Splice-site']\n mut_other = ['Missense:Benign', 'Missense:Possibly', 'MissenseNA', 'Indel']\n mut_all = [mut_probdam, mut_syn] + mut_trunc + mut_ot...
[ "0.6945782", "0.6008008", "0.5820681", "0.5612364", "0.55751467", "0.5568729", "0.549523", "0.54935354", "0.54413706", "0.54271424", "0.54271424", "0.5424441", "0.5419872", "0.53814006", "0.5376937", "0.5286594", "0.52795094", "0.5250566", "0.5243011", "0.5235514", "0.5218825...
0.60777515
1
Group relevant fields in a data table by gene and sample.
def group_data_by_gs(data_table): gene_data = collections.defaultdict(lambda: collections.defaultdict(list)) for _idx, row in data_table.iterrows(): samp = row['sample'] gene = row['gene'] gene_data[gene][samp].append({ 'muttype': row['type'].strip(), 'normalized'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_group_by_fields(self):\r\n t = [\r\n ['#sample', 'loc', 'age', 'mal'],\r\n ['a', 'US', '5', 'n'],\r\n ['b', 'US', '10', 'n'],\r\n ['c', 'Mal', '5', 'y'],\r\n ['d', 'Mal', '10', 'n'],\r\n ['e', 'Mal', '5', 'y'],\r\n ]\r\n ...
[ "0.6889335", "0.6642011", "0.6135452", "0.5961623", "0.579755", "0.57506627", "0.5543378", "0.5529391", "0.5485283", "0.5476625", "0.54219085", "0.5396323", "0.5325102", "0.528583", "0.5267025", "0.5252489", "0.52244204", "0.5223278", "0.5223278", "0.52127755", "0.5201003", ...
0.7125095
0
Calculate LOF mutation burden scores for genes in the processed table.
def lof_sig_scores(table, samples, verbose=True): mut_probdam = 'Missense:Probably' mut_syn = 'Synonymous' mut_trunc = ['Nonsense', 'Frameshift', 'Splice-site'] mut_other = ['Missense:Benign', 'Missense:Possibly', 'MissenseNA', 'Indel'] mut_all = [mut_probdam, mut_syn] + mut_trunc + mut_other #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simulate_lof_scores(table, n_permutations, genes, samples, summary_func):\n perm_scores = []\n print(\"Permuting mutation data\", n_permutations, \"times:\", end=' ',\n file=sys.stderr)\n for idx in range(n_permutations):\n print(idx + 1, end=' ', file=sys.stderr)\n permute_ta...
[ "0.6047063", "0.59909374", "0.5804685", "0.56599253", "0.5659575", "0.5527499", "0.548951", "0.54735863", "0.54634756", "0.54460317", "0.54291904", "0.540414", "0.5401155", "0.53553945", "0.5350826", "0.53347117", "0.52987546", "0.5297021", "0.5296505", "0.5296421", "0.528999...
0.69348997
0
Permute a mutation data table's gene, sample and NMAF columns.
def permute_table(dtable): shuffle_field(dtable, 'gene') shuffle_field(dtable, 'sample') shuffle_field(dtable, 'Normalized') if 'Filler' in dtable: del dtable['Filler']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shuffle_columns(gene):\n import numpy as np\n return np.random.permutation(gene.tolist())", "def permutation(self):\n perm = np.random.permutation(self.n_samples)\n self.data = self.data.iloc[perm]\n self.labels = self.labels.iloc[perm]\n self.labels_onehot = self.labels_one...
[ "0.61698025", "0.59699166", "0.5903071", "0.5723355", "0.5637398", "0.5528464", "0.5499227", "0.543115", "0.5423258", "0.54104346", "0.5405247", "0.5401473", "0.5346968", "0.53442794", "0.5332014", "0.5327549", "0.5315308", "0.53120166", "0.5284594", "0.52702045", "0.5233921"...
0.6967431
0
Shuffle a column of a pandas DataFrame inplace.
def shuffle_field(dframe, field): column = list(dframe[field]) random.shuffle(column) dframe[field] = column
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def randomize(df):\n df=df.iloc[np.random.permutation(df.index)].reset_index(drop=True)\n return df", "def shuffle(self, random_state=None):\n if random_state is not None:\n self.df = self.df.sample(frac=1, random_state=random_state)\n else:\n self.df = self.df.sample(fr...
[ "0.7303201", "0.6808159", "0.6485229", "0.5754562", "0.55631775", "0.5551179", "0.54870254", "0.54748476", "0.5472007", "0.5454964", "0.5445012", "0.544049", "0.5428695", "0.5414353", "0.5402308", "0.5398768", "0.53584075", "0.53349566", "0.53082585", "0.52712715", "0.5269317...
0.6957683
1
Check working and education age, as well as agebased death rates
def age_check(self): # check working status if 15 <= float(self.age) < 59: if self.work_status == 0: self.work_status = 1 num_labor_list[self.hh_id] += 1 labor_list.append(self.unique_id) if self.work_status == 1 and self.uni...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_age_medicals(self, medicament):\n age = self.get_age()\n if age:\n if age > medicament.maximum_age and medicament.maximum_age:\n return {\"valid\": False, \"message\": _(f\"The patient is {age} years old, and {medicament.name} could not be taken for ages above {me...
[ "0.67515427", "0.66453856", "0.6644906", "0.6641186", "0.66046834", "0.656711", "0.6545751", "0.64939374", "0.62668896", "0.623874", "0.6225378", "0.618982", "0.6133155", "0.61256105", "0.6117547", "0.6111712", "0.6107974", "0.6078686", "0.6067841", "0.6061602", "0.6046506", ...
0.823224
0
Small chance of giving birth every step if female, married, and under 55
def birth_check(self): if random.random() < 0.00017: # 0.0121, or 1.21%, is the yearly birth rate. birth_flag_list.append(1) # This makes the birth rate for every 5 days (73 'checks' a year) 0.00017%, # because 1 - 0.0121 = 0.9879; 98.79% is the chance of not giving birt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def age_check(self):\r\n # check working status\r\n if 15 <= float(self.age) < 59:\r\n if self.work_status == 0:\r\n self.work_status = 1\r\n num_labor_list[self.hh_id] += 1\r\n labor_list.append(self.unique_id)\r\n if self.work_statu...
[ "0.6415288", "0.62871087", "0.6209691", "0.6133053", "0.6105533", "0.6062069", "0.6030811", "0.60277516", "0.5984295", "0.59721744", "0.59610784", "0.59555507", "0.59335494", "0.5922349", "0.59116745", "0.5904699", "0.58801943", "0.58515966", "0.58484405", "0.5847972", "0.583...
0.7247911
0
Describes remigration process and probability following outmigration
def re_migration_check(self): if self.hh_id == 'Migrated': self.mig_years += 1/73 prob = math.exp(-1.2 + 0.06 * float(self.age) - 0.08 * self.mig_years) re_mig_prob = prob / (prob + 1) if random.random() < re_mig_prob: # re-migration occurs ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_downgrades():\n pass", "def data_downgrades():\n pass", "def reason(op_idx, details):\n\n return '%d %s'%(op_idx, details)", "def final(self, state):\n\n deltaReward = state.getScore() - self.pre_state.getScore()\n self.observeTransition(self.pre_state, self.action, state, del...
[ "0.5102387", "0.5102387", "0.493133", "0.49081475", "0.49050757", "0.48658085", "0.48292056", "0.48261008", "0.4822867", "0.48022726", "0.47727752", "0.47590077", "0.4743672", "0.47371507", "0.47249058", "0.47138816", "0.47119746", "0.46988693", "0.46717596", "0.46700364", "0...
0.61376023
0
Moves human agent to assigned point according to frequency
def move_to_point(self, destination, frequency): # index 0 represents x, index 1 represents y if frequency > 1: x_towards = int(round((destination[0] - current_position[0]) / frequency)) if x_towards > 1: x_towards -= 1 y_towards = int(round((des...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward_character():\r\n set_point(point()+1)", "def frequencyMove(self, target, ms_duration):\n # newval\n if target < 0.001:\n target = 0.001\n newval = \"\" + str(target) + \"Hz:\" + str(int(ms_duration))\n return self.set_pwmTransition(newval)", "def step(self):\...
[ "0.5756338", "0.57246095", "0.561575", "0.5583545", "0.5553407", "0.5538043", "0.5529117", "0.55048907", "0.55018187", "0.54887056", "0.5480496", "0.5480281", "0.54783565", "0.5467773", "0.54671395", "0.54649484", "0.545763", "0.5419727", "0.5400481", "0.53905404", "0.5386202...
0.7122551
0
Method that updates the db's tables (SpreadsheetsWorksheetsFeed)
def refresh_tables(self): if self.key is None: raise AttributeError('Can not refresh tables on uninitialised db') self.tables = self.client.ssclient.GetWorksheetsFeed(self.key)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_database(self):\r\n \r\n self.initgta()\r\n \r\n credentials = self.get_credentials()\r\n http = credentials.authorize(httplib2.Http())\r\n discoveryUrl = ('https://sheets.googleapis.com/$discovery/rest?'\r\n 'version=v4')\r\n servic...
[ "0.6511545", "0.6200733", "0.6094718", "0.60367894", "0.5857259", "0.5846549", "0.5835323", "0.5746336", "0.5643205", "0.5643205", "0.56354195", "0.56198394", "0.56123966", "0.55641884", "0.5516536", "0.5516536", "0.5516536", "0.5516234", "0.5507988", "0.550778", "0.5494619",...
0.7123582
0
Create a new spreadsheetdatabase identified by name, containing data from file ob/string
def create(self, name, data=',,,'): if not name or not isinstance(name, basestring): raise ValueError('Require textual, non-zero-length name') if not isinstance(data, file): from cStringIO import StringIO data = StringIO(data) clen = len(data.read()) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_xlsx_database(dbname, infile, size):\n tmp = tempfile.NamedTemporaryFile(suffix=\".xlsx\")\n tmp.write(infile.read())\n tmp.seek(0)\n try:\n wb = openpyxl.load_workbook(tmp.name)\n check_quota(size=size)\n with DbSaver() as saver:\n dbname = saver.set_name(dbname...
[ "0.6630303", "0.64529586", "0.6203902", "0.59785604", "0.5955347", "0.59182864", "0.5892711", "0.5882368", "0.58427125", "0.5836892", "0.58275765", "0.5794275", "0.5778513", "0.5758216", "0.5726067", "0.5693445", "0.56878895", "0.5682965", "0.56608045", "0.56591177", "0.56432...
0.66946393
0
Returns the product identifier for the given review Returns null if there is no review with the given identifier
def getProductId(self, reviewId): res = self.get_metadata_item_by_review_id(reviewId, self.prod_index) if res is None: return -1 return res
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def product_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"product_id\")", "def one_review(review_id=None):\n if review_id:\n for item in storage.all(Review).values():\n if review_id == item.id:\n return (jsonify(item.to_dict()))\n abort(404...
[ "0.66061646", "0.63681", "0.63630843", "0.63446856", "0.62323004", "0.62063235", "0.61904657", "0.6104891", "0.60771453", "0.60144347", "0.59619343", "0.59493744", "0.5910496", "0.5909585", "0.5903269", "0.58682257", "0.58635205", "0.5754114", "0.5741011", "0.5737781", "0.573...
0.7509579
0
Returns the score for a given review Returns 1 if there is no review with the given identifier
def getReviewScore(self, reviewId): res = self.get_metadata_item_by_review_id(reviewId, self.score_index) if res is None: return -1 return res
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_review(reviews, userId, BusinessId):\n reviews = reviews[(reviews['business_id'] == BusinessId) & (reviews['user_id'] == userId)]\n\n if reviews.empty:\n return np.nan\n elif len(reviews) > 1:\n return float(reviews['stars'].max())\n else:\n return float(reviews['stars'])",...
[ "0.6201799", "0.6199192", "0.6183983", "0.60592645", "0.60532284", "0.5974433", "0.5950267", "0.5945879", "0.5890353", "0.58580697", "0.58472925", "0.581598", "0.58078945", "0.57990956", "0.57932633", "0.57251036", "0.5703422", "0.57010114", "0.56840485", "0.56757194", "0.566...
0.7393501
0
Returns the numerator for the helpfulness of a given review Returns 1 if there is no review with the given identifier
def getReviewHelpfulnessNumerator(self, reviewId): res = self.get_metadata_item_by_review_id(reviewId, self.helpfulness_index) if res is None: return -1 return res.split('/')[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getReviewHelpfulnessDenominator(self, reviewId):\n res = self.get_metadata_item_by_review_id(reviewId, self.helpfulness_index)\n if res is None:\n return -1\n return res.split('/')[1]", "def getReviewScore(self, reviewId):\n res = self.get_metadata_item_by_review_id(rev...
[ "0.6324895", "0.59119046", "0.5731218", "0.5728787", "0.57048965", "0.5673352", "0.5628536", "0.558706", "0.54499036", "0.54318726", "0.54300654", "0.5427268", "0.53934306", "0.53267545", "0.5324107", "0.5291316", "0.5269823", "0.5265127", "0.52554893", "0.5228793", "0.522214...
0.70530784
0
Returns the denominator for the helpfulness of a given review Returns 1 if there is no review with the given identifier
def getReviewHelpfulnessDenominator(self, reviewId): res = self.get_metadata_item_by_review_id(reviewId, self.helpfulness_index) if res is None: return -1 return res.split('/')[1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getReviewHelpfulnessNumerator(self, reviewId):\n res = self.get_metadata_item_by_review_id(reviewId, self.helpfulness_index)\n if res is None:\n return -1\n return res.split('/')[0]", "def get_review(reviews, userId, BusinessId):\n reviews = reviews[(reviews['business_id'] ...
[ "0.6944185", "0.60010123", "0.5958065", "0.5850019", "0.5839875", "0.5792741", "0.57166505", "0.55522615", "0.5541988", "0.5498478", "0.5468714", "0.5367294", "0.53503984", "0.5346373", "0.5343605", "0.5333439", "0.52890116", "0.5282272", "0.5264872", "0.5237203", "0.5236578"...
0.71286285
0
Returns a series of integers of the form id1, freq1, id2, freq2, ... such that idn is the nth review containing the given token and freqn is the number of times that the token appears in review idn Note that the integers should be sorted by id Returns an empty Tuple if there are no reviews containing this token
def getReviewsWithToken(self, token): wordid = self.find_word_in_dictionary(token) # word is not in the dictionary if wordid == -1: print("Token is not in the dictionary") return 0 with open(self.doc_to_words_path, 'rb') as bin: tup = [] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getTokenSizeOfReviews(self):\n res = 0\n with open(self.word_to_docs_path, 'rb') as bin:\n while bin.tell() != os.fstat(bin.fileno()).st_size:\n # get wordid:\n int.from_bytes(bin.read(4), 'big')\n # get frequency:\n frequency...
[ "0.58870304", "0.5872376", "0.57925576", "0.5762311", "0.57522726", "0.5650889", "0.5605051", "0.5602011", "0.556829", "0.5556432", "0.5480733", "0.5478207", "0.5436882", "0.5426632", "0.542246", "0.5421361", "0.53432894", "0.53128296", "0.5310089", "0.5306142", "0.52982074",...
0.7127659
0
Return the ids of the reviews for a given product identifier Note that the integers returned should be sorted by id Returns an empty Tuple if there are no reviews for this product
def getProductReviews(self, productId): res = self.get_metadata_item_by_product_id(productId, self.review_id_index) if res is None: return () return tuple(sorted(res))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_reviews(item_id, shop_id, review_num=10) -> list:\n get_url = f\"{_shopee_base_url}/api/v2/item/get_ratings?filter=0&flag=1&itemid={item_id}&limit={review_num}&offset=0&shopid={shop_id}\"\n r = requests.get(get_url, headers=_user_agent_header, proxies=proxy_dict)\n ratings = r.json()['data']['rati...
[ "0.5803101", "0.5799752", "0.5747708", "0.57132083", "0.56284815", "0.55349267", "0.549816", "0.54834235", "0.5410697", "0.5398244", "0.5343484", "0.5325006", "0.53191805", "0.53081715", "0.5306031", "0.52948093", "0.52824235", "0.5277215", "0.5267356", "0.52470785", "0.52279...
0.7520901
0
Try encoding a value that was not present during fitting
def test_labelencoder_unseen(): df = cudf.Series(np.random.choice(10, (10,))) le = LabelEncoder().fit(df) assert le._fitted with pytest.raises(KeyError): le.transform(cudf.Series([-1]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_labelencoder_unfitted():\n df = cudf.Series(np.random.choice(10, (10,)))\n le = LabelEncoder()\n assert not le._fitted\n\n with pytest.raises(NotFittedError):\n le.transform(df)", "def _check_is_fitted(self):\n check_is_fitted(self, ['w', 'b'])", "def fit_transform(self):\n ...
[ "0.63432735", "0.5584575", "0.55314666", "0.55217403", "0.55110896", "0.5438144", "0.53956467", "0.5382773", "0.537759", "0.53276515", "0.5287101", "0.5267183", "0.5265064", "0.52437276", "0.5224555", "0.5219182", "0.51630604", "0.5150083", "0.5142134", "0.5139662", "0.513203...
0.61706185
1
Generate the set of instructions to install the runtime specific components from a build in a previous stage. Examples ```python o = openmpi(...) Stage0 += o Stage1 += o.runtime() ```
def runtime(self, _from='0'): instructions = [] instructions.append(comment('OpenMPI')) instructions.append(packages(ospackages=self.__runtime_ospackages)) instructions.append(copy(_from=_from, src=self.prefix, dest=self.prefix)) if self.ldconfig:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def runtime(self, _from='0'):\n self.rt += comment('UCX')\n self.rt += packages(ospackages=self.__runtime_ospackages)\n self.rt += self.__bb.runtime(_from=_from)\n return str(self.rt)", "def test_runtime(self):\n s0 = Stage()\n s0 += gnu()\n s0 += shell(commands=[...
[ "0.63812894", "0.6220772", "0.5972768", "0.57417834", "0.56730807", "0.56473535", "0.5568905", "0.5483507", "0.54011726", "0.539773", "0.53675365", "0.5299979", "0.52857697", "0.52605176", "0.5241663", "0.5217782", "0.5197936", "0.5190252", "0.51438904", "0.514096", "0.512636...
0.6863331
0
Remplis la liste dans l'ordre d'un parcours en largeur.
def parcour_largeur(self, liste=[]): if self not in liste: liste.append(self) for successeur in self.tache.successeur: liste = successeur.sommet.parcour_largeur(liste) return liste
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Lluiteu(self) -> IResultList:\n\n if len(self._Lluitadors) != 2:\n print(\"ERROR. Falten lluitadors\")\n exit\n\n elQuePica = randint(0, 1)\n\n while self._Lluitadors[0].es_Ko() == False and self._Lluitadors[1].es_Ko() == False:\n elQueRep = (elQuePica+1) %...
[ "0.6159855", "0.59618866", "0.58957595", "0.58539045", "0.58525014", "0.5830363", "0.5830363", "0.57955384", "0.57359904", "0.57069314", "0.5695612", "0.5588971", "0.5586956", "0.5586579", "0.5566826", "0.5544616", "0.5504588", "0.5479305", "0.5470674", "0.5460505", "0.543772...
0.7076027
0
Create input parameter matrix (nrows,npars) for nrows simulations and npars parameters with bounds bl and bu Input nrows of simulations bl (npars) lower bounds of parameters bu (npars) upper bounds of parameters Optional Input distname initial sampling ditribution (not implemented yet, takes uniform distribution) Outpu...
def _SampleInputMatrix(nrows, bl, bu, distname='randomUniform'): npars = len(bl) x = np.zeros((nrows,npars)) bound = bu-bl for i in range(nrows): # x[i,:]= bl + DistSelector([0.0,1.0,npars],distname='randomUniform')*bound # only used in full Vhoeys-framework x[i,:]= bl + np.random.rand(1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Get_params(numparams, dt, D):\n # bounds from table 1 Kowalek et al 2020\n Nmin, Nmax = 30, 600\n Bmin, Bmax = 1, 6\n Rmin, Rmax = 1, 17\n alphamin, alphamax = 0.3, 0.7\n Qmin, Qmax = 1, 9\n\n # Gen parameters\n Q = np.random.uniform(Qmin, Qmax, size=numparams)\n Q1, Q2 = Q, Q\n\n ...
[ "0.60949314", "0.5986902", "0.551213", "0.54551274", "0.54435855", "0.542718", "0.53588706", "0.5313321", "0.5305968", "0.5304221", "0.5300704", "0.52952546", "0.5245525", "0.52326334", "0.52322286", "0.5215029", "0.5200597", "0.5192048", "0.5168894", "0.51601005", "0.5155108...
0.6843093
0
Generate a new point in a simplex Input func function to minimize s 2Darray, the sorted simplex in order of increasing function values sf 1Darray, function values in increasing order bl (npars) lower bounds of parameters bu (npars) upper bounds of parameters mask (npars) mask to include (1) or exclude (0) parameter fro...
def _cce(func, s, sf, bl, bu, mask, icall, maxn, alpha, beta, maxit, printit): """ List of local variables sb(.) = the best point of the simplex sw(.) = the worst point of the simplex w2(.) = the second worst point of the simplex fw = function value of the worst point ce(.) = the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parallel_nelder_mead_worker(obj_func, simplex, f_vals, j, P, opt_params):\n # Unpack the input parameters\n alpha = opt_params[0] # reflection parameter\n beta = opt_params[1] # contraction parameter\n gamma = opt_params[2] # expansion parameter\n my_point = simplex[j, :] # vertex to update\...
[ "0.60385126", "0.5934125", "0.5925909", "0.5889379", "0.5879459", "0.58054495", "0.5770362", "0.57192504", "0.5679547", "0.56777143", "0.56689835", "0.5644742", "0.5602882", "0.5601654", "0.5600193", "0.55295295", "0.5489717", "0.5485098", "0.54787546", "0.5467505", "0.546483...
0.7183282
0
Initialize a revocation registry instance from a definition.
def from_definition( cls, revoc_reg_def: dict, public_def: bool ) -> "RevocationRegistry": rev_reg = None reg_id = revoc_reg_def["id"] tails_location = revoc_reg_def["value"]["tailsLocation"] issuer_did_match = re.match(r"^.*?([^:]*):3:CL:.*", revoc_reg_def["credDefId"]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, definition=None, do_validate=False):\n\n if not definition:\n definition = {}\n self._definition = definition\n\n if 'version' not in self._definition:\n self._definition['version'] = DEFAULT_VERSION\n\n if self._definition['version'] != DEFAULT_...
[ "0.6365758", "0.5975766", "0.55071837", "0.54514474", "0.5385088", "0.53106856", "0.5284195", "0.52683705", "0.5255345", "0.519412", "0.51128095", "0.5101054", "0.50727415", "0.5066627", "0.50653875", "0.5056175", "0.50140285", "0.49651614", "0.4943011", "0.49326223", "0.4923...
0.7864564
0
Accessor for the credential definition ID.
def cred_def_id(self) -> str: return self._cred_def_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def credential_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"credential_id\")", "async def get_cred_def_id(controller, credential_def):\n\n # TODO Determine what is funky here?!\n cred_def_id = credential_def[\"credential_definition_id\"]\n if not cred_def_id:\n raise HTTPExc...
[ "0.7703763", "0.7545976", "0.7423022", "0.6607697", "0.6599685", "0.65436137", "0.64952046", "0.64952046", "0.64940614", "0.6489127", "0.6480111", "0.6474915", "0.6473348", "0.64332443", "0.64332443", "0.63909", "0.63635904", "0.6306746", "0.62994355", "0.62826365", "0.627631...
0.78050387
0
Accessor for the issuer DID.
def issuer_did(self) -> str: return self._issuer_did
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def issuer(self) -> str:\n return self._issuer", "def getIssuer(self):\n\n return X501DN.from_POW(self.get_POW().getIssuer())", "def getIssuer(self):\n\n return X501DN.from_POW(self.get_POW().getIssuer())", "def certificate_issuer_id(self):\n return self._certificate_issuer_id", ...
[ "0.63686556", "0.629895", "0.629895", "0.6298509", "0.62595916", "0.61917484", "0.5921824", "0.5908792", "0.589522", "0.57897574", "0.5781878", "0.5740381", "0.5692223", "0.56738335", "0.56544834", "0.5609349", "0.5450722", "0.54210263", "0.5385624", "0.5385624", "0.52576756"...
0.76917386
0
Accessor for the maximum number of issued credentials.
def max_creds(self) -> int: return self._max_creds
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_count(self):\n return self.config.get('max_count', 500)", "def maxTimes(self)->int:\n return self._lic.params['maxAccessTimes'].value", "def attempt_limit(self) -> int:\n return self._attempt_limit", "def maxclients(self) -> Optional[int]:\n return pulumi.get(self, \"maxcl...
[ "0.66411006", "0.6601515", "0.65705186", "0.6561411", "0.65395725", "0.6536631", "0.65011877", "0.64279604", "0.63409424", "0.63365984", "0.63256127", "0.63256127", "0.6293164", "0.6249128", "0.6249128", "0.62489957", "0.62489957", "0.62489957", "0.62489957", "0.62489957", "0...
0.82493174
0
Accessor for the revocation registry ID.
def registry_id(self) -> str: return self._registry_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _rId(self):\n return self.__rId", "def get_id(self, refobj):\n return cmds.getAttr(\"%s.identifier\" % refobj)", "def get_id(self) -> str:\n return self._register_id", "def reviewer_id(self) -> int:\n return self._reviewer_id", "def revision_id(self) -> pulumi.Output[str]:\n...
[ "0.68818575", "0.6489039", "0.63768697", "0.6345289", "0.63359684", "0.63274115", "0.6303052", "0.62223303", "0.6192809", "0.61785716", "0.6176881", "0.6118495", "0.6079419", "0.6076094", "0.6070641", "0.6011463", "0.6011463", "0.6011463", "0.6011463", "0.6011463", "0.6011463...
0.74190855
0
Accessor for the tails file local path.
def tails_local_path(self) -> str: return self._tails_local_path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_receiving_tails_local_path(self):\n if self._tails_local_path:\n return self._tails_local_path\n\n tails_dir = indy_client_dir(join(\"tails\", self.registry_id), create=False)\n return join(tails_dir, self._tails_hash)", "def local_path(self):\n return self._data.ge...
[ "0.7361944", "0.73559666", "0.73426396", "0.72724926", "0.71549064", "0.7074206", "0.69760764", "0.6890982", "0.6848232", "0.68328875", "0.68020326", "0.6785656", "0.67743486", "0.6767759", "0.6750774", "0.6750774", "0.67472744", "0.67431635", "0.67203677", "0.67099667", "0.6...
0.83814985
0
Setter for the tails file local path.
def tails_local_path(self, new_path: str): self._tails_local_path = new_path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tails_local_path(self) -> str:\n return self._tails_local_path", "def set_local_path(self):\n return HERE", "def __set_full_path_of_file(self, value):\n self.full_path_of_file = value", "def get_receiving_tails_local_path(self):\n if self._tails_local_path:\n return...
[ "0.73882735", "0.69088036", "0.6654991", "0.62319344", "0.59626657", "0.58788776", "0.5873488", "0.57962286", "0.57670593", "0.576256", "0.57535195", "0.5704101", "0.5697797", "0.568221", "0.5679186", "0.56650066", "0.5628503", "0.55995935", "0.5597539", "0.5586708", "0.55821...
0.759834
0
Accessor for the tails file public URI.
def tails_public_uri(self) -> str: return self._tails_public_uri
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_url(self):\n try:\n return self._file.url\n except AttributeError:\n raise NotImplementedError(\"Underlying file does not have a URL.\")", "def get_uri(self):\n return self.__uri", "def get_uri(self):\r\n return self.uri", "def url(self):\n if ...
[ "0.73939973", "0.7238372", "0.72170705", "0.72044635", "0.7186612", "0.7160879", "0.7150565", "0.7150565", "0.7150565", "0.7150565", "0.7150565", "0.7150565", "0.7079242", "0.702986", "0.688064", "0.6838737", "0.680961", "0.6780631", "0.6780389", "0.67608947", "0.6707028", ...
0.80025434
0
Setter for the tails file public URI.
def tails_public_uri(self, new_uri: str): self._tails_public_uri = new_uri
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tails_public_uri(self) -> str:\n return self._tails_public_uri", "def set_uri(self, uri):\r\n self.uri = uri", "def set_uri(self, uri):\n self.__uri = uri", "def uri(self, uri):\n self._uri = uri", "def uri(self, uri):\n self._uri = uri", "def url(self):\n if...
[ "0.6992037", "0.6649637", "0.65161926", "0.64215595", "0.64215595", "0.62572867", "0.6217056", "0.6217056", "0.61789614", "0.6056066", "0.60459447", "0.60445434", "0.5995598", "0.5985835", "0.5982786", "0.59488785", "0.59331167", "0.59251237", "0.5923124", "0.5891555", "0.589...
0.70854425
0
Test if the tails file exists locally.
def has_local_tails_file(self) -> bool: tails_file_path = Path(self.get_receiving_tails_local_path()) return tails_file_path.is_file()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_file_exists(self):\n pass", "def file_exist() -> bool:\n pass", "def check_file_exist(self):\n return False", "def check_file_existence(self, filename):\n try:\n for sample in TimeoutingSampler(\n config.GAHOOKS_TIMEOUT, 1, self.machine.fs.exists,\...
[ "0.745606", "0.7331722", "0.73091817", "0.7153428", "0.7124189", "0.707734", "0.69596857", "0.6911545", "0.68538797", "0.6835131", "0.6831116", "0.683041", "0.68172604", "0.6813483", "0.6777769", "0.6767774", "0.67475665", "0.6747344", "0.67412597", "0.67396986", "0.67273676"...
0.80128205
0
Fetch the tails file from the public URI.
async def retrieve_tails(self): if not self._tails_public_uri: raise RevocationError("Tails file public URI is empty") LOGGER.info( "Downloading the tails file for the revocation registry: %s", self.registry_id, ) tails_file_path = Path(self.get_rece...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def get_or_fetch_local_tails_path(self):\n tails_file_path = self.get_receiving_tails_local_path()\n if Path(tails_file_path).is_file():\n return tails_file_path\n return await self.retrieve_tails()", "def fetch(self, url) -> bytes:\n buffer = self.download(url)\n ...
[ "0.65143895", "0.64818", "0.63829696", "0.62146026", "0.6201777", "0.6175602", "0.61430174", "0.6141575", "0.6134061", "0.6124747", "0.6107553", "0.60981643", "0.60825396", "0.60232246", "0.6009201", "0.5998062", "0.5989562", "0.5978132", "0.5976732", "0.59597915", "0.5942507...
0.67065966
0
Get the local tails path, retrieving from the remote if necessary.
async def get_or_fetch_local_tails_path(self): tails_file_path = self.get_receiving_tails_local_path() if Path(tails_file_path).is_file(): return tails_file_path return await self.retrieve_tails()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tails_local_path(self) -> str:\n return self._tails_local_path", "def get_receiving_tails_local_path(self):\n if self._tails_local_path:\n return self._tails_local_path\n\n tails_dir = indy_client_dir(join(\"tails\", self.registry_id), create=False)\n return join(tails_...
[ "0.80348897", "0.76883364", "0.7126396", "0.6791376", "0.6559629", "0.6558711", "0.6388076", "0.63707346", "0.62777233", "0.61495477", "0.6113895", "0.6113817", "0.6106196", "0.60939664", "0.6049094", "0.600913", "0.58544475", "0.5822516", "0.57869804", "0.5732327", "0.572581...
0.80444866
0
Plot a histogram of the envelope delays for all stations combined.
def plot_hist(delays): fig = plt.figure() ax = fig.add_subplot(111) alldelays = [] for _s in delays.keys(): alldelays += delays[_s] if len(alldelays) > 0: n, bins, patches = ax.hist(alldelays, bins=np.arange(0, 30, 0.5), color='green', histtype='bar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_spectrums_overlapping(\n self, energies_dict: dict, title:str,\n figsize: tuple = (16,12)\n ) -> None:\n \n plt.figure(figsize=figsize)\n plt.title(title)\n for key in energies_dict.keys():\n spectre, bins = np.histogram(energies_dict[key],range = (0...
[ "0.6014032", "0.6012786", "0.5984103", "0.59256524", "0.5846438", "0.5844005", "0.57922244", "0.57795936", "0.576851", "0.574713", "0.57314426", "0.5656888", "0.5621318", "0.56128407", "0.5601162", "0.55484176", "0.5535783", "0.55001086", "0.54999", "0.5484467", "0.54826164",...
0.649759
0
Initialize the playlist when user open new playlist. Clear container stored old playlist.
def init_container(self): self.current_playlist = []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_playlist_command(self):\n self.parent.song_object_list.clear()\n self.display_data(self.parent.song_object_list)\n self.playlist_select.set(\"Working Playlist\")", "def clear_playlist(self, playlist_name):\n print(\"clears_playlist needs implementation\")", "def set_playlist...
[ "0.68930304", "0.6653205", "0.6501291", "0.6421835", "0.6365484", "0.6107308", "0.5939515", "0.5929152", "0.5911668", "0.58953536", "0.58416694", "0.5839501", "0.5835443", "0.58337986", "0.5828597", "0.580987", "0.57928884", "0.56693053", "0.5668342", "0.56461513", "0.5610128...
0.82654196
0
The playlist is preprocessed, the song is converted to a specified ID, and if the id does not exist, the dictionary is updated.
def playlist_processing(self, playlist): with open(self.vocab2id_file, 'rb') as f: vocab = cPickle.load(f) vocabulary_size = len(vocab) self.stable_size = 14130 word2id = dict(zip(vocab.keys(), vocab.values())) for i in playlist: self.current_playlist.app...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def song(song_id):\n return process_input(song_id) #jsonify(recomendations)", "def get_playlist_songs(self, playlist_id):\n values = {'action' : 'playlist_songs',\n 'filter' : playlist_id,\n }\n root = self.__call_api(values)\n songs = root.getElementsByTagName('song')...
[ "0.63545996", "0.61921567", "0.6143479", "0.59543717", "0.594414", "0.5942761", "0.5920997", "0.5910605", "0.5899105", "0.5865399", "0.5832982", "0.58116937", "0.5805803", "0.57335186", "0.56880456", "0.5665373", "0.5615729", "0.56059074", "0.5560593", "0.5544271", "0.5503531...
0.6725309
0
Reshape a batch by using current sequence of playlist. The elements of playlist much be lager than (self.task_size+2)
def fetch_batch(self, playlist): y_output = [] y_out = [] x_out = [] x_array = np.arange(self.seq_length, dtype=float).reshape(1, self.seq_length) data = self.playlist_processing(playlist) playlist = self.standardization(data) # manage a batch table for next step...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reshape_output_batch(self, number, output):\n #tt = cutotime('reshape')\n #tt.start()\n output = output.reshape(self.output_shapes[number]) # batch, h, w, 3, (5 + 80)\n #tt.stop()\n return output", "def rearrange_batch(batch):\n return list(zip(*batch))", "def reshap...
[ "0.6468407", "0.6240593", "0.6096135", "0.6036245", "0.6019479", "0.59601533", "0.59008753", "0.58866954", "0.58866954", "0.5857637", "0.5718999", "0.56953937", "0.56657815", "0.5655742", "0.56523097", "0.56378835", "0.56317556", "0.56093645", "0.5588064", "0.5579988", "0.557...
0.6971018
0
Compute the stationary distribution Returns
def compute_stationary_distribution(self): return self.mc.stationary_distributions
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stationary_distribution(self):\n P = self.markov_transition()\n N = len(P)\n I = np.identity(N)\n A = P.T - I # get right-kernel\n pi = null_space(A)\n pi = pi / sum(pi)\n pi = [float(item) for item in pi]\n return pi", "def twr_ret(self) -> float:\n ...
[ "0.7359955", "0.67069596", "0.63173574", "0.62742853", "0.60729533", "0.60489726", "0.60022783", "0.5965991", "0.59374565", "0.59329593", "0.5901953", "0.5899095", "0.588677", "0.58687305", "0.58478904", "0.5844981", "0.58257616", "0.5796536", "0.5770032", "0.57691383", "0.57...
0.7526897
0
method which blocks execution until the lens completes its move
def wait_focus_move(self): import time T0 = time.time() finished = False aborted = False while not finished: T1 = time.time() the_status = self.status if not the_status['F_move'] or the_status['FD_endStop']: finished = True...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __wait_for_move(self, verbose=False):\r\n res = self.__wait_for([(2, 1), (2, 2), (2, 3)], verbose=verbose)\r\n if res[1] == 2 and verbose:\r\n # message id 2 : Stopped\r\n self.print_msg(\"The motor has been stopped.\")\r\n if res[1] == 3:\r\n # message id ...
[ "0.62840587", "0.6202503", "0.61108303", "0.6050686", "0.60435677", "0.60326666", "0.6016843", "0.59028417", "0.5902083", "0.5856362", "0.58537793", "0.58444", "0.5814171", "0.5799818", "0.578337", "0.5767757", "0.57589823", "0.57537836", "0.5739174", "0.5734531", "0.5719648"...
0.6303028
0
try to connect over the serial port to the device at self.addr. If this is None it will try to guess the address
def connect(self): import serial if self.addr == None: self.addr = self.get_EFu_addr() self.ser = serial.Serial(self.addr, 115200, timeout=1) if self.ser.isOpen(): print('Opened port: {}'.format(self.addr)) else: raise RuntimeError('Failed t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect(self):\n # open serial port\n try:\n #device = self.get_device_name(self.serial_number)\n device = \"/dev/ttyAMA0\"\n self.serial.port = device\n # Set RTS line to low logic level\n self.serial.rts = False\n self.serial.ope...
[ "0.69454587", "0.67889047", "0.67115384", "0.6692218", "0.66655385", "0.6482997", "0.64638066", "0.64450824", "0.6386709", "0.6361775", "0.6324444", "0.63238347", "0.62772804", "0.6268832", "0.6248226", "0.62417406", "0.62376326", "0.62370926", "0.623523", "0.6234886", "0.623...
0.7432071
0
go to the lens' min focus distance
def go_minFD(self): response = self.send_lens_cmd(['06', '00', '00', '00'], fast_mode=True) self.wait_focus_move()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def refocus(opt_model):\n osp = opt_model['optical_spec']\n\n fld = osp['fov'].fields[0] # assumed to be the axial field\n wvl = osp['wvls'].central_wvl\n\n df_ray, ray_op, wvl = trace_safe(opt_model, [0., 1.], fld, wvl, \n output_filter=None, rayerr_filter='ful...
[ "0.6352142", "0.6188631", "0.6105131", "0.60845727", "0.58412695", "0.56798255", "0.5614706", "0.55925125", "0.55880666", "0.55541176", "0.5492351", "0.54446816", "0.5431491", "0.54205614", "0.54157627", "0.5407402", "0.5374698", "0.5361339", "0.5315512", "0.5314407", "0.5311...
0.6684844
0
Initialize an instance of the class 'UpperClass'. 'UpperClass' then creates instances of all nested functions, including all controls, data, limits, and time states. For more details, see structure of 'UpperClass' within pyign.functions.classes.
def _init_upper_class(*args): upper_class = ucl() return upper_class
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_class(self):\n\n class SubFLRW(FLRW):\n def w(self, z):\n return super().w(z)\n\n self.cls = SubFLRW\n # H0, Om0, Ode0\n self.cls_args = (70 * u.km / u.s / u.Mpc, 0.27 * u.one, 0.689 * u.one)\n self.cls_kwargs = dict(Tcmb0=3.0 * u.K, name=self....
[ "0.6469038", "0.58283985", "0.5648945", "0.5589883", "0.5526122", "0.5477647", "0.54384494", "0.534532", "0.52895707", "0.52712715", "0.5238917", "0.52216107", "0.52095556", "0.51963586", "0.518527", "0.51755416", "0.5172725", "0.51613057", "0.51519966", "0.51377374", "0.5135...
0.69853264
0
Access protected class data and edit the element lengths of time_delay.
def __set_time_elements(*args): args[0].TimeState.delay_elements = args[1] args[0].TimeState.set_delay_elements()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, t):\n\t\tself.delay = math.ceil(t / config.time_resolution)", "def __init__(self, length):\r\n self.length = length\r\n self.start_time = int(time.time())", "def update_stay_time(self):\n # It would not be better to simply self.stay_time = self.get_length() ??\n s...
[ "0.6088691", "0.59130174", "0.5893721", "0.5874906", "0.584337", "0.58238727", "0.57651335", "0.5753957", "0.57314014", "0.5693747", "0.5631355", "0.5597452", "0.558548", "0.558548", "0.55663913", "0.5476332", "0.5470588", "0.5446856", "0.54260933", "0.54006857", "0.5384095",...
0.6158915
0
Access protected class data of the system Abort State. This approach is a secure method to access saved system state values. If an abort is tripped, the test stand control system will automatically enter 'Safe' mode and valve configuration Arguments
def getAbortState(*args): return args[0].Controls.AbortState.abort_state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_abort(*args):\n if getAbortState(args[0]) == 1:\n args[0].Controls.ValveState.valve_state = [0] * args[0].Controls.valve_number\n args[0].Controls.IgnitorState.ignitor_state = 0\n return args[0].Controls.ValveState.valve_state, args[0].Controls.IgnitorState.ignitor_state", "def setA...
[ "0.6760634", "0.6111283", "0.5918962", "0.58701843", "0.5709547", "0.55562437", "0.54767984", "0.5443226", "0.5370313", "0.53647673", "0.5333537", "0.5308639", "0.52833456", "0.52833456", "0.52254784", "0.5172646", "0.5167443", "0.5166163", "0.5150555", "0.5117594", "0.506258...
0.6534719
1
Access protected class data to evaluate the delays in an automated firing sequence. The returned value representation is an array ranging containing real time delays. This approach is a secure method to access saved system state values. Arguments
def getTimeDelay(*args): return args[0].TimeState.TimeDelay.time_delay
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Time_Delay():\n Delay=[1]\n return Delay", "def getProcedureDelays(self, *values):", "def getDelay(self, *args):\n return _libsbml.Event_getDelay(self, *args)", "def net_delay_data(self):\n return self._net_delay_data", "def drift(self) -> Array:\n return self._drift", "def...
[ "0.6262345", "0.6186965", "0.58272976", "0.5784843", "0.5734248", "0.5699624", "0.55224675", "0.5499862", "0.54612947", "0.54612947", "0.54612947", "0.5459292", "0.5420487", "0.5413706", "0.5407644", "0.53791", "0.53545827", "0.5348719", "0.5335695", "0.5323909", "0.5313419",...
0.63342017
0
Check if any sensor is out of limit range, if out of bounds is detected, abort is tripped and system enters 'Safe' mode. Arguments
def check_limits(*args): if getNanny(args[0]) == 1: if np.sum(pt_index(args[0])) != 0: setAbortState(args[0], 1) elif np.sum(tc_index(args[0])) != 0: setAbortState(args[0], 1) elif np.sum(lc_index(args[0])) != 0: setAbortState(args[0], 1) return args[0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_limits(self):\n\n #Find the relative position of each leg vs. its \"zero\" position\n relpos = self.fixed_plate - self.fixed_plate_zero\n\n for leg in range(3):\n #Check that the leg is within allowable \"safe zone\"\n #Use the position of the leg (relative to 0...
[ "0.6770596", "0.654159", "0.62366986", "0.6200703", "0.61639", "0.6084621", "0.60703343", "0.60066104", "0.6003697", "0.6001165", "0.59801334", "0.5967212", "0.5960566", "0.59435976", "0.59202987", "0.59021884", "0.5895557", "0.58831173", "0.5853203", "0.5848584", "0.58466583...
0.6864247
0
Check Abort State, if abort has been tripped, all valves and the ignitor are set to 'Safe' state until system is restarted. Arguments
def check_abort(*args): if getAbortState(args[0]) == 1: args[0].Controls.ValveState.valve_state = [0] * args[0].Controls.valve_number args[0].Controls.IgnitorState.ignitor_state = 0 return args[0].Controls.ValveState.valve_state, args[0].Controls.IgnitorState.ignitor_state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_abort_flag(self):\r\n self.abort_flag = True", "def set_abort_flag(self):\r\n self.abort_flag = True", "def setAbortState(*args):\n args[0].Controls.AbortState.abort_state = args[1]", "def abort(self):\n try:\n self.acqRunning = False\n except:\n p...
[ "0.62349504", "0.62349504", "0.6215905", "0.6176467", "0.6142251", "0.61209154", "0.61043084", "0.6031883", "0.59754926", "0.5807621", "0.58030546", "0.5725754", "0.5686565", "0.55359054", "0.5450164", "0.5397553", "0.5359814", "0.5313396", "0.5261124", "0.52588546", "0.52561...
0.8031163
0
Check GO State. If all three panels are NOT a 'GO', ignitor state is set to 'Safe' mode. Arguments
def check_go(*args): if np.sum(getGOState(args[0]))!= 3: args[0].Controls.IgnitorState.ignitor_state = 0 return args[0].Controls.IgnitorState.ignitor_state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_state(self):\n pass", "def preliminary_check_controls(self):\n\n # is the program still in a binding state?\n if self.is_binding:\n self.error_msg['text'] = 'You are still binding'\n self.display_object_on_canvas(\n self.error_msg,\n ...
[ "0.58088785", "0.5800331", "0.56853163", "0.5606529", "0.5573311", "0.5570173", "0.55235136", "0.551424", "0.5456828", "0.5444285", "0.5430013", "0.541981", "0.541929", "0.54159546", "0.5408308", "0.5399268", "0.5353979", "0.5343648", "0.5326778", "0.53055364", "0.52544284", ...
0.7918938
0
Check if the manual switch circuit is active to determine Time Regime. If the switch panel is active, this sets the Time Regime to a '0' or 'Initialize Regime'. Arguments
def check_manual_circuit(*args): if args[0] == 0: setTimeRegime(1) elif args[0] == 1: setTimeRegime(0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setTimeRegime(*args):\n\n args[0].TimeState.TimeRegime.time_regime = args[1]", "def on_system_time_textChanged(self, p0):\n # Updated 12/28/16\n time_start = time.time()\n \n self.Init_prog.setValue( percentCheck(self.current_Init_Time.text(), self.Init_tot.text()) ) \n ...
[ "0.57335913", "0.56603175", "0.56519896", "0.5624243", "0.5399231", "0.53451455", "0.52724075", "0.5241249", "0.5229926", "0.5229374", "0.51163673", "0.5104843", "0.51036", "0.5069811", "0.50318426", "0.5022424", "0.50019664", "0.50002193", "0.500011", "0.49954054", "0.498967...
0.6686538
0
Load a renderer by name. First look by name among builtin renderers, then among renderers provided by plugins, and then try interpreting rname as a path.
def load_renderer(rname: str, config: ConfigManager) -> Renderer: try: return getattr(importlib.import_module('plasTeX.Renderers.'+rname), 'Renderer')() except ImportError: pass for plugin in config['general']['plugins'] or []: try: return getattr(importlib.import_module...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def importRenderer(rdrname):\n\n try:\n return importlib.import_module(\"renderers.\" + rdrname)\n except ImportError:\n errmsg = translate(\"Render\",\"Error importing renderer '{}'\\n\").format(rdrname)\n FreeCAD.Console.PrintError(errmsg)\n return None", "def renderer(self, c...
[ "0.73853004", "0.58451027", "0.558662", "0.5243704", "0.5140972", "0.5134852", "0.5115549", "0.5107618", "0.5091121", "0.5088885", "0.50720346", "0.5054252", "0.5024464", "0.49994725", "0.49855545", "0.4937933", "0.49291664", "0.48779446", "0.48484144", "0.48349017", "0.48249...
0.8108585
0
The Register of Surveys
def surveys(): # lists the views and mimetypes available for a Survey Register (a generic Register) views_mimetypes = model_classes_functions.get_classes_views_mimetypes() \ .get('http://purl.org/linked-data/registry#Register') try: view, mime_format = LDAPI.get_valid_view_and_mimetype( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_survey(self, **kwargs):", "def signup():", "def start_survey():\n title=satisfaction_survey.title\n instructions = satisfaction_survey.instructions\n # session['responses'] =[]\n return render_template(\"instructions.html\", survey_title=title, instructions=instructions)", "def fin...
[ "0.6113588", "0.6103179", "0.5896686", "0.58351845", "0.5785286", "0.57483184", "0.5724621", "0.56492555", "0.5646439", "0.5643721", "0.5627348", "0.56101686", "0.55935544", "0.55808115", "0.55763346", "0.54497224", "0.5443218", "0.5423709", "0.54016244", "0.5398529", "0.5387...
0.71375966
0
Will return a list of sequences and structures with the most common structure first in the list. (rest or list unordered!) Don't care which of the sequences for the "winning" sequence that is reported since the are not ranked amongst them self.
def common(structs): frequency = {} v = 0 indx = 0 result = [] tmp_list = [] #lookup the seq for the structures,dont care which winner seq key = [] for block in structs: tmp_list.extend(block) p = tuple(block[-1]) if frequency.__contains__(p): #everytime struct ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_most_common(self, lst):\n data = Counter(lst)\n mc = data.most_common(2) \n #if len(mc) == 1 or (mc[0][1] != (mc[1][1])):\n # return mc[0][0]\n #return \"AMB\"\n return data.most_common(1)[0][0]", "def most_common(self):\n # Example ouput : ['so', 6]\n return list(sorted(...
[ "0.62333995", "0.6112997", "0.57661676", "0.56727326", "0.55042654", "0.53281903", "0.5300685", "0.5298694", "0.5296782", "0.5288475", "0.5227579", "0.5196403", "0.51809996", "0.5120854", "0.5111778", "0.50057286", "0.49906874", "0.49702325", "0.49534172", "0.49140376", "0.48...
0.7195737
0
Parses a structure block into a block containing the sequens and structures lines.
def structParser(lines): blc = 0 #blank line counter bc = 0 #block counter struct = [] record = False for line in lines: if len(line) == 1: blc +=1 record = False if blc == 2: blc = 0 bc +=1 record = True if record ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def blockParser(block):\n struct = []\n first = True\n record = False\n for line in block:\n if line.startswith('Structure #'):\n record = True\n if not first:\n yield struct\n struct = []\n first = False\n if record:\n ...
[ "0.8220502", "0.6176337", "0.6159992", "0.6144094", "0.61179936", "0.5995611", "0.5912761", "0.5877715", "0.5823805", "0.58081156", "0.58050597", "0.579685", "0.5790939", "0.5766781", "0.56867117", "0.5686182", "0.56843513", "0.56682813", "0.56639993", "0.56393385", "0.562791...
0.75295395
1
__age_categorize converts integer age to categorical label [14]
def __age_categorize(self, age): # Baby age category - most at risk, highest categorical denomination if age <= 4: self.__age = 4 # Youth age category - second most at risk elif 5 <= age <= 14: self.__age = 3 # Adult age category - least at risk ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def age_to_cat(data):\n\n data['age'] = data.apply(assign_cats, axis=1)\n return data", "def adience_resolve_class_label(age):\n if age == '(0, 2)' or age == '2':\n age_id = 0\n elif age == '(4, 6)' or age == '3':\n age_id = 1\n elif age == '(8...
[ "0.65863025", "0.6134778", "0.5594359", "0.5567215", "0.5548215", "0.55342036", "0.5530622", "0.55137557", "0.54577214", "0.5396883", "0.52983737", "0.5265402", "0.52587944", "0.5237866", "0.52305365", "0.52297807", "0.5214186", "0.52091664", "0.5202443", "0.5168244", "0.5168...
0.79217803
0
This functions requires RNAplot from the Vienna RNA Package It takes the input sequence and bracketed sequence to genenrate the graph in svg format.
def graphRep(input_seq, bracket_str): proc = subprocess.Popen(['RNAplot', '-o', 'svg'], stdin=subprocess.PIPE,) input_str = input_seq + '\n' + bracket_str; proc.communicate(input_str) file = open('rna.svg', 'r') graph_svg = markdown(file.read()) return graph_svg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output_svg(lines, regressions, requested_width, requested_height):\n \n (global_min_x, _), (global_max_x, global_max_y) = bounds(lines)\n max_up_slope, min_down_slope = bounds_slope(regressions)\n \n #output\n global_min_y = 0\n x = global_min_x\n y = global_min_y\n w = global_max_x ...
[ "0.6276968", "0.61470777", "0.6076386", "0.602863", "0.5823153", "0.5819216", "0.5685886", "0.56794846", "0.56412166", "0.5640082", "0.5550133", "0.55071896", "0.5504255", "0.54762304", "0.54711044", "0.5469401", "0.539439", "0.53837824", "0.535971", "0.53370565", "0.5328663"...
0.76379836
0
Concept = Run of particle time
def run(self): self.tick = self.tick + 1 print 'Particle tick=:', self.tick
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate(self, time) -> float:\n ...", "def time_step(self):\n\n rho_rel = np.abs(self.rho_dt / self.rho)\n rho_rel_max = np.max(rho_rel)\n e_rel = np.abs(self.e_dt / self.e)\n e_rel_max = np.max(e_rel)\n x_rel = np.abs(self.u / self.dx)\n x_rel_max = np.max(x...
[ "0.621091", "0.61330277", "0.59966195", "0.59839183", "0.59578794", "0.5923446", "0.58288765", "0.57963467", "0.579499", "0.5755361", "0.57446986", "0.5726134", "0.5709614", "0.5708639", "0.57028395", "0.56926674", "0.5689406", "0.5687743", "0.56855357", "0.56822544", "0.5680...
0.65141714
0
used to test an array of requirements
def meetsreqs(request, requirements): for requirement in requirements: if requirement(request) == False: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_prerequisites(self, prequisites):\n for prereq in prequisites:\n # check for origin requirements\n if prereq.origin: \n if prereq.origin not in self.origins:\n print(f\"ORIGIN WRONG\")\n return False\n # check fo...
[ "0.64356154", "0.64080465", "0.6196205", "0.61877984", "0.6183836", "0.61625487", "0.61469597", "0.61170787", "0.6057898", "0.60380864", "0.6031557", "0.60084325", "0.60044444", "0.5954684", "0.5945977", "0.5940263", "0.5930212", "0.5922339", "0.58939075", "0.5874343", "0.586...
0.6579372
0
Creates a filter for requests by domain name
def filter_domain(name): def wrapped(request): """ Function used to filter request """ if request.environ.get('HTTP_HOST'): url = request.environ['HTTP_HOST'] else: url = request.environ['SERVER_NAME'] if url.lower() == name.lower(): return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def domain_filter(self, url):\n return url_is_from_any_domain(url, self._domain)", "def _get_filter(self, args):\n\n # Create the filters list\n filter_list = []\n \n # If we want to record all requests, add the file logger filter\n if args.record:\n filter_list.a...
[ "0.60737574", "0.58803385", "0.5744134", "0.5709297", "0.56603974", "0.5636545", "0.5617802", "0.5598398", "0.5555184", "0.550615", "0.5497377", "0.54751694", "0.53891224", "0.52918273", "0.52907366", "0.52900827", "0.5286786", "0.52790344", "0.5264849", "0.5247048", "0.51950...
0.78285366
0
NOOP function. Does nothing!
def noop(*args, **kwargs): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def noop():", "def __noop(self, *args, **kwargs):\n return None", "def nothing():\n pass", "def nop(*args, **kwargs):\n pass", "def noop(*argv):\n pass", "def nothing(nothing):\n pass", "def nothing(self, x):\n pass", "def none(self):", "def dummy_fn(self):\n\t\tpass", "def ...
[ "0.8783013", "0.8081931", "0.7991097", "0.77324647", "0.75583017", "0.753168", "0.74028265", "0.7354654", "0.732386", "0.72998303", "0.72137064", "0.71119606", "0.708488", "0.70150435", "0.6946873", "0.6877048", "0.6876734", "0.6844432", "0.68100893", "0.68015844", "0.6713583...
0.8163604
1
specify the error handler
def error(self, func): self.error_handler = func return func
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error(self, handler):\n pass", "def _set_error_handler(self):\n if self.on_error:\n error_step = self.context.root.path_to_step(self.on_error)\n self._on_error_handler = error_step.run", "def handle_err(self):\n pass", "def error_handler(self):\n return s...
[ "0.8725671", "0.7718206", "0.7657", "0.75719863", "0.74093735", "0.7384228", "0.7327607", "0.7306311", "0.7283553", "0.72499895", "0.7236473", "0.7221846", "0.72026527", "0.71280897", "0.7080884", "0.7078503", "0.7078503", "0.7070793", "0.7068163", "0.6968732", "0.69639295", ...
0.78834885
1
decorate the function and bind the route to it
def wrapped(func): self.routes.append((path, { 'regex': re.compile('^' + re.sub(self._part_matcher,'(.*?)',path) + '$'), 'function':func, 'reqs':req, 'kwargs':kwargs, 'parts':parts_info, 'generate':generate ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decorate(func):\n from aha.dispatch.router import get_router\n r = get_router()\n r.connect(None, path, controller = func, **params)\n return func", "def route(self, path, **params):\n\n def decorate(func):\n \"\"\"\n A function returne...
[ "0.79207623", "0.7537334", "0.7469362", "0.74424934", "0.7351416", "0.7057561", "0.68981445", "0.680523", "0.6793152", "0.67900866", "0.6789484", "0.67194337", "0.6707344", "0.6663238", "0.66282237", "0.65580136", "0.6548357", "0.6459901", "0.6446784", "0.64391977", "0.635137...
0.7645408
1
wrapper around route to simplify specifying a POST method
def post(self, path, req = None, **kwargs): req = req or [] return self.route(path, req=req+[filter_method(['POST'])], **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def http_method_post():\n return 'POST'", "def post(self, url_pattern):\n return self.route(url_pattern, methods=['POST'])", "def post(self, pattern, handler):\n return self.route(Router.POST, pattern, handler)", "def post(path, *params, **kwparams):\n def method(f):\n return c...
[ "0.7466594", "0.7464732", "0.71564", "0.6983206", "0.68843967", "0.67942744", "0.6749919", "0.66610956", "0.6518377", "0.63940334", "0.6362049", "0.6353046", "0.6347149", "0.6316776", "0.62976885", "0.629424", "0.62412244", "0.62390095", "0.6235388", "0.62321585", "0.62135905...
0.7744171
0
wrapper around route to simplify specifying a GET method
def get(self, path, req = None, **kwargs): req = req or [] return self.route(path, req=req+[filter_method(['GET'])], **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def http_method_get():\n return 'GET'", "def route(self, path: str, **args: t.Any) -> t.Callable:\n def decorator(f: t.Callable) -> None:\n RouteMap.add_route(Route(path, f, args.get('methods', ['GET'])))\n return decorator", "def get(self, url_pattern):\n return self.rou...
[ "0.7585986", "0.6923013", "0.69071895", "0.6866216", "0.68313766", "0.6815127", "0.68019503", "0.6794707", "0.6775643", "0.67280823", "0.6635145", "0.66241866", "0.65551066", "0.654744", "0.65207714", "0.6515748", "0.6498413", "0.6456323", "0.6432484", "0.64135665", "0.641323...
0.76480097
0
generates the list of generatable content
def genlist(self): out = [] def responder(): """empty responder object used to find the template name""" pass responder.view = static_view_finder for path, route in self.routes: if route['generate']: mako_template = route['function'](re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate(self):\n return []", "def list_templates(self):\n raise NotImplementedError()", "def list(self):", "def generate(self, section):\n\t\t\n\t\tlist = []\n\t\t\n\t\tf = getattr(self, 'generate_%s' % section )\n\t\tlist += f()\n\t\treturn list", "def generate(self):", "def synonymic...
[ "0.6724087", "0.6645123", "0.62943095", "0.62456673", "0.6241737", "0.6234704", "0.6194769", "0.6070392", "0.6070392", "0.6047425", "0.6016182", "0.5978708", "0.5963537", "0.5946715", "0.59436655", "0.592105", "0.58891994", "0.5875533", "0.5874405", "0.5854494", "0.583361", ...
0.668453
1
empty responder object used to find the template name
def responder(): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def template_name(self):\n\t\traise NotImplementedError('template_name must be defined')", "def template(self):\n template_names = self.get_template_names()\n if template_names:\n return template_names[0]\n return None", "def __init__(self, template):\n\n self.template = ...
[ "0.5936188", "0.56618536", "0.5599609", "0.55979955", "0.55137706", "0.5499585", "0.54667854", "0.5461094", "0.54506403", "0.5439588", "0.54063535", "0.53732514", "0.53621966", "0.53532135", "0.53532135", "0.53532135", "0.53373337", "0.5327806", "0.531942", "0.53186053", "0.5...
0.5832691
1
Find enum for the goal type The goal.action_type field contains the index of the action to take. This finds the enum that represents the action based on the goal.action_type oa
def _get_action_from_goal(self, goal): # assume the goal msg has attribute ActionEnum which is an int32 try: type_enum = self._action_type_enum(goal.action_type.type) #rospy.loginfo("Action server requested action {}".format(type_enum)) return type_enum except...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_goal(self) -> GoalType:\n return self.goal", "def action_type(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"action_type\")", "def action_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"action_type\")", "def find_action(self, env):\n best_ac...
[ "0.60196", "0.5695987", "0.5631605", "0.5608103", "0.5577976", "0.5570502", "0.55433017", "0.54728824", "0.54292613", "0.540806", "0.54054856", "0.5376661", "0.5366136", "0.53495884", "0.53465235", "0.53428036", "0.5333229", "0.5325333", "0.53090227", "0.5264729", "0.5259357"...
0.78977334
0
Use actionserver API to obtain current goal msg
def get_goal_msg(self): goal_handle = self._as.current_goal goal = goal_handle.get_goal() return goal
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query(self):\n return self.msg", "def message(self):\n return self.args[0]", "def do_something(incoming_msg):\n return \"i did what you said - {}\".format(incoming_msg.text)", "def msg(self):\n\t\treturn self.message", "def get_message(self):\n return self.msg", "def message(s...
[ "0.64812785", "0.6291104", "0.6230681", "0.622652", "0.6198423", "0.6114265", "0.6087266", "0.60801274", "0.6069133", "0.6048402", "0.6012083", "0.5981943", "0.5975176", "0.59721017", "0.5968051", "0.5931889", "0.59014153", "0.5896082", "0.5887542", "0.5860451", "0.5853312", ...
0.7434118
0
revert state to previous
def revert_state(self): if self.previous_states > 0: # checks for empty self.update_status(self.previous_states.pop())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pre_revert(self):", "def revert(self, *args, **kwargs):", "def restore_state(self, state):\n state_ref = self.ale.decodeState(state)\n self.ale.restoreState(state_ref)\n self.ale.deleteState(state_ref)", "def revert(self):\n\n if len(self.stack) == 0 or not self.revertable:\n ...
[ "0.7617157", "0.7598059", "0.73347276", "0.7316808", "0.7289563", "0.72739744", "0.72582453", "0.718048", "0.71754295", "0.71717536", "0.7129588", "0.7102892", "0.7074888", "0.70556575", "0.70329833", "0.70275724", "0.7026885", "0.7016923", "0.70034415", "0.6995634", "0.69598...
0.86437696
0
print stack of prior states
def print_prior_states(self): rospy.logdebug("Prior States:") for state in self.previous_states: enum = self._state_enums(state) rospy.logdebug(enum)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_stack(self) -> None:\n print(\"Show stack: \")\n ok = 1\n for i in reversed(self.items):\n print(i)\n ok = 0\n if ok:\n print(\"The stack is empty!\")\n print(\"\\n\")", "def visualizar(self):\n print(self.stack)", "def _debug_...
[ "0.6872584", "0.68181235", "0.6607305", "0.6538157", "0.64937884", "0.64842486", "0.6478548", "0.63657314", "0.6295706", "0.6261098", "0.6208233", "0.61952525", "0.61898285", "0.615732", "0.6139123", "0.6139123", "0.6139123", "0.6139123", "0.61252326", "0.6123777", "0.6093845...
0.7393488
0
Get valid operation transitions for 'state'
def get_valid_op_transitions(self, state): #assert( isinstance(state, self.STATES) ) if state in self._tns.keys(): out = self._tns[state] else: out = None return out
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state_transitions(self, state):\n return self.states(\"ANY PreviousStates.identifier = '%s'\" % _obj_id(state))", "def transitions(self, state):\n if len(set(state)) < len(state):\n yield self.STOP_STATE\n return\n for hidx in xrange(self.num_players):\n ...
[ "0.7499513", "0.67500013", "0.66104215", "0.6555124", "0.6540525", "0.6449192", "0.6445847", "0.6406374", "0.6391548", "0.62251216", "0.6084329", "0.6083975", "0.607909", "0.60760677", "0.6061412", "0.6022075", "0.59961957", "0.5970838", "0.59537923", "0.59151065", "0.5906996...
0.80586046
0
return if the FSM has been preempted. Assumes incoming action is 'valid' and not 'pause' nor 'continue'
def fsm_is_preempted(self): return self._fsm_recent_goal_preempted
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_play_state():\r\n\toption = input('Choose P/p to Play, or Q/q to Quit: ').lower()\r\n\tif option == 'q':\r\n\t\treturn False\r\n\telif option == 'p':\r\n\t\treturn True\r\n\r\n\tprint('Invalid entry. Try again.')\r\n\r\n\treturn get_play_state() # Run function again until valid user input\r", "def check_...
[ "0.687658", "0.66574603", "0.6546301", "0.64997154", "0.63892114", "0.6266916", "0.62533164", "0.62418985", "0.61880374", "0.6149819", "0.61090684", "0.6092503", "0.60714036", "0.6065291", "0.60380584", "0.6031428", "0.60201186", "0.6009432", "0.5998008", "0.5993712", "0.5964...
0.70066047
0
Register the valid transitions for operations in the FSM
def fsm_register_op_transitions(self, mapping): assert isinstance(mapping, dict) # mapping must be a dictionary mapping_key_list = list(mapping.keys()) self._tns = {} for key in mapping_key_list: val = mapping[key] if val is not None: if not isins...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fsm_register_state_functions(self, fxns):\n assert isinstance(fxns, dict) # cbs must be a dictionary\n fxns_key_list = list(fxns.keys())\n\n self._fxns = {}\n for key in fxns_key_list: # check syntax\n print(\"Registered function for state {}\".format(key))\n s...
[ "0.59189004", "0.586094", "0.586094", "0.57842225", "0.5710956", "0.57072747", "0.56175554", "0.55920196", "0.5559722", "0.5545334", "0.55240065", "0.5502501", "0.5463345", "0.546151", "0.5453605", "0.54377836", "0.5422045", "0.54183", "0.538542", "0.5344262", "0.5325958", ...
0.63744044
0
Register the mapping from operations to state changes. Keys are ActionType.type, Values are status_msg.status Assumes 1 state transition per operation Convert state changes to "callbacks" in order to interface with register_callbacks function naturally
def fsm_register_status_changes(self, mapping): assert isinstance(mapping, dict) # mapping must be a dictionary mapping_key_list = list(mapping.keys()) self._status_mapping = mapping def fcn_maker(key): def fcn(goal): state_values = self.get_status_change_fro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fsm_register_op_transitions(self, mapping):\n assert isinstance(mapping, dict) # mapping must be a dictionary\n mapping_key_list = list(mapping.keys())\n\n self._tns = {}\n for key in mapping_key_list:\n val = mapping[key]\n if val is not None:\n ...
[ "0.7231106", "0.6918902", "0.6296912", "0.57984567", "0.57530093", "0.5654377", "0.54368836", "0.5425602", "0.5217801", "0.5120021", "0.50986123", "0.5087925", "0.5080552", "0.5063019", "0.50458765", "0.5042547", "0.5032909", "0.5017168", "0.5016956", "0.50106436", "0.5009293...
0.7196801
1
Registers one function per state to be called in the FSMloop
def fsm_register_state_functions(self, fxns): assert isinstance(fxns, dict) # cbs must be a dictionary fxns_key_list = list(fxns.keys()) self._fxns = {} for key in fxns_key_list: # check syntax print("Registered function for state {}".format(key)) self._fxns[key]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_step(step_function: StepFunction) -> None:\n global _step_function\n _step_function = step_function", "def __init__(self,startState,func,emitState):\n self.startState = startState\n self.func = func\n self.stateToSet = emitState", "def register(self, funcs):\...
[ "0.6052082", "0.60315496", "0.60179865", "0.5956556", "0.5858302", "0.5820865", "0.5820865", "0.57073295", "0.5694058", "0.5692112", "0.56733954", "0.56569195", "0.5627773", "0.5622307", "0.55789167", "0.5569063", "0.5551086", "0.55458724", "0.5531195", "0.5516528", "0.549706...
0.7355456
0
Clean the "efficiency" column of the core DataFrame. Replace unacceptable values with the mean acceptable value for all recipes.
def clean_efficiency(series, acceptable_min=0.5, acceptable_max=1.0): acceptable, unacceptable = split_series_on_range( series, acceptable_min, acceptable_max ) mean_acceptable = acceptable.groupby(acceptable.index).first().mean() efficiency_cleaned = acceptable.append( pd.Series(index=u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_data(df):\n # Copy dataframe to local dataframe\n df_clean = df\n # Split category into subcategories\n categories = df.categories.str.split(\";\", expand=True)\n # Label columns according to new label\n categories.columns = categories.iloc[0].str[:-2]\n # Make columns numeric, i.e. ...
[ "0.58538204", "0.5805122", "0.57298917", "0.56449634", "0.5640181", "0.5634791", "0.5600337", "0.5546408", "0.54946196", "0.5483941", "0.545862", "0.54306334", "0.5426154", "0.54227746", "0.541179", "0.5411344", "0.54084826", "0.5405733", "0.5396214", "0.53825486", "0.5378157...
0.6676042
0
Clean the "ferm_yield" column of the core DataFrame. Replace unacceptable values with the mean acceptable value for that fermentable's "ferm_type". Do not replace values for fermentables whose "ferm_name" is in the list of exceptions.
def clean_ferm_yield(df, ferm_yield_cutoff=0.03, exceptions=None): if exceptions is None: exceptions = ["rice hulls"] acceptable_mask, unacceptable_mask = split_series_on_range( df["ferm_yield"], ferm_yield_cutoff, 1, return_mask=True ) exceptions_mask = df["ferm_name"].isin(exceptions)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace_invalids(data, threshold = 50, print_vals = False, med=True):\n \n # prints a description of the features if print_vals True\n means, stds, medians, mins, maxs = summarize_features(data, print_vals=print_vals)\n \n if(print_vals):\n print(\"Number of invalid values: \" + str(len(d...
[ "0.52814806", "0.52377963", "0.520854", "0.5111959", "0.503656", "0.5024192", "0.50163877", "0.49769673", "0.49284658", "0.49167803", "0.49106422", "0.48846367", "0.48807472", "0.48682734", "0.48604667", "0.48104823", "0.4805979", "0.4800024", "0.47863942", "0.4776485", "0.47...
0.8194866
0
Applies nonlinear fit and returns parameters and Rsq. Plots it. By default, it applies minimumsquare fit. If dY is specified, it applies weighted minimumsquare fit.
def nonlinear_fit(X, Y, fitfunction, initial_guess=None, dY=None, showplot=True, plot_some_errors=(False, 20), **kwargs): if not isinstance(X, np.ndarray): raise TypeError("X should be a np.array") if not isinstance(Y, np.ndarray): raise TypeError("Y sh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fitgeneral(xdata, ydata, fitfunc, fitparams, domain=None, showfit=False, showstartfit=False, showdata=True,\n label=\"\", mark_data='bo', mark_fit='r-'):\n\n # sort data\n order = np.argsort(xdata)\n xdata = xdata[order]\n ydata = ydata[order]\n\n if domain is not None:\n fi...
[ "0.6445788", "0.6065387", "0.60351515", "0.5988817", "0.5902242", "0.58328307", "0.5825604", "0.57763094", "0.5763422", "0.5763422", "0.5763422", "0.5763422", "0.5763422", "0.5763422", "0.5763422", "0.5763422", "0.5763422", "0.5763422", "0.57129544", "0.56746066", "0.562982",...
0.72015506
0
Assert that financing statement excluded registration type validation works as expected.
def test_validate_excluded_type(session, desc, valid, reg_type): # setup json_data = copy.deepcopy(FINANCING) json_data['type'] = reg_type error_msg = validator.validate(json_data) if valid: assert error_msg == '' else: # print(error_msg) assert error_msg != '' as...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_check_reject_by_annotation():\n reject_by_annotation = _check_reject_by_annotation(True)\n assert reject_by_annotation == \"omit\"\n reject_by_annotation = _check_reject_by_annotation(False)\n assert reject_by_annotation is None\n reject_by_annotation = _check_reject_by_annotation(None)\n ...
[ "0.6017079", "0.58390003", "0.5796406", "0.57696676", "0.57662976", "0.5737532", "0.5719872", "0.5664541", "0.5659036", "0.5652945", "0.564465", "0.56336826", "0.5632206", "0.561848", "0.5613535", "0.5613535", "0.56071335", "0.5602484", "0.5601488", "0.55983293", "0.55952036"...
0.731116
0
Assert that financing statement ppsa class registration type validation works as expected.
def test_validate_ppsa(session, desc, valid, message_content): # setup for reg_type in PPSATypes: if reg_type.value != 'RL': json_data = copy.deepcopy(FINANCING) json_data['type'] = reg_type.value del json_data['trustIndenture'] if desc == DESC_INCLUDES_OT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_validation(protocol_registry):\n\n # pylint: disable=abstract-class-instantiated,function-redefined\n\n class InputsGenerator(protocol_registry, RelaxInputsGenerator):\n\n _calc_types = None\n _relax_types = None\n\n with pytest.raises(TypeError):\n InputsGenerator()\n\n c...
[ "0.5858289", "0.5855153", "0.5848892", "0.58339894", "0.5763812", "0.5698543", "0.5685632", "0.5685577", "0.567914", "0.56420666", "0.5618723", "0.56099254", "0.55961007", "0.55636775", "0.5550738", "0.55266476", "0.5516155", "0.5514431", "0.5498741", "0.54836166", "0.5482397...
0.61451
0
Assert that financing statement crown charge class registration type validation works as expected.
def test_validate_crown(session, desc, valid, message_content): # setup for reg_type in CrownChargeTypes: if validator.validate_allowed_type(reg_type.value) != '': continue json_data = copy.deepcopy(FINANCING) json_data['type'] = reg_type.value del json_data['trustIn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_payment_term_type_credit(self):\n self.payment_term_credit = self.env.ref(\n 'payment_term_type.payment_term_credit')\n self.assertEqual(\n self.payment_term_credit.payment_type, 'credit',\n 'Payment term should be in credit')", "def test_invalid_type_cr_na...
[ "0.63057756", "0.62873244", "0.62342995", "0.62265575", "0.6093054", "0.60824454", "0.6077051", "0.59999615", "0.5937259", "0.5863364", "0.5848222", "0.58201563", "0.5785519", "0.577018", "0.57630944", "0.5751983", "0.57468355", "0.5703373", "0.5698615", "0.5650929", "0.56349...
0.6850338
0
Assert that financing statement authorization received validation works as expected.
def test_validate_authorization(session, desc, valid, message_content): # setup json_data = copy.deepcopy(FINANCING) if desc == DESC_MISSING_AC: del json_data['authorizationReceived'] elif desc == DESC_INVALID_AC: json_data['authorizationReceived'] = False # test error_msg = val...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_authorize(self):\n account = self._get_hosting_account()\n service = account.service\n\n self.assertFalse(service.is_authorized())\n\n service.authorize('myuser', 'abc123', None)\n\n self.assertIn('password', account.data)\n self.assertNotEqual(account.data['passw...
[ "0.6006923", "0.5995328", "0.59817857", "0.59651005", "0.5946999", "0.58936596", "0.5878886", "0.5857898", "0.581741", "0.581741", "0.5803852", "0.57966226", "0.5790457", "0.57735777", "0.57610834", "0.5726127", "0.57257056", "0.5718622", "0.571644", "0.571644", "0.57143795",...
0.69572604
0
Assert that financing statement serial collateral AP type validation works as expected.
def test_validate_sc_ap(session): # setup json_data = copy.deepcopy(FINANCING) json_data['vehicleCollateral'][0]['type'] = 'AP' error_msg = validator.validate(json_data) # print(error_msg) assert error_msg != '' assert error_msg.find(validator.VC_AP_NOT_ALLOWED) != -1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_data_type(self):\n self.assertTrue(self.tester.data_type(), \"18S\")", "def test_batch_condition_is_column_from_obs(self):\n\n self.validator.adata.uns[\"batch_condition\"] = [\"NO_COLUMN\"]\n self.validator.validate_adata()\n self.assertEqual(\n self.validator.err...
[ "0.5802322", "0.57792544", "0.5692598", "0.56567425", "0.5638801", "0.5636985", "0.5575348", "0.55348665", "0.5519237", "0.55095935", "0.5495687", "0.5477004", "0.5467177", "0.5462422", "0.5461734", "0.54553884", "0.5454877", "0.5453654", "0.54458314", "0.5416901", "0.54038",...
0.66447246
0
Takes a relative filepath and returns the correct execution path regaurdless of where the containing file is run from
def exepath(filename): return os.path.abspath(os.path.join(os.path.dirname(sys._getframe(1).f_code.co_filename), filename))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execution_path(self, filename):\n return os.path.join(os.path.dirname(inspect.getfile(sys._getframe(0))), filename)", "def relative_path(__file__, path):\n return os.path.abspath(os.path.join(os.path.dirname(__file__), path))", "def script_path(filename):\n import os\n\n filepath = os.path....
[ "0.78359544", "0.7364391", "0.72925454", "0.7157018", "0.71059424", "0.70861536", "0.69844985", "0.6931191", "0.6924658", "0.692244", "0.68566006", "0.68398184", "0.6796556", "0.67877066", "0.6782576", "0.67627543", "0.67522347", "0.6722421", "0.6697694", "0.6697694", "0.6683...
0.7585861
1
Converts a human readable label to a valid method name
def methodize_label(label): method_name = label.lower() method_name = re.sub(RE_METHODIZE_FLATTEN, '_', method_name) method_name = re.sub(RE_METHODIZE_CLEAN, '', method_name) method_name = re.sub(RE_METHODIZE_COMPRESS, '_', method_name) return method_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def labelify(op):\n return re.sub(r'[\\/\\.]', '_', op)", "def normalisesym(self, label):\n return label", "def label_given_method_str(method):\n # get label\n label = ''\n if method.split('_')[0] == 'True':\n label += 'adaptive'\n else:\n assert method.split('_')[0] == 'False...
[ "0.6608763", "0.63294894", "0.6286159", "0.61445105", "0.61340606", "0.60954225", "0.60523003", "0.5972117", "0.595054", "0.59168303", "0.58889025", "0.5815129", "0.5799753", "0.57241225", "0.57220227", "0.56934816", "0.5652864", "0.5617667", "0.5594284", "0.5569899", "0.5542...
0.82136875
0
Adds a reference to ref on obj using a methodized version of label
def append_reference(obj, label, ref): method_name = methodize_label(label) i=0 while method_name in obj.__dict__: method_name = '%s_%s' % (method_name, i) i += 1 obj.__dict__[method_name] = ref
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addLabel(*args):", "def fl_set_object_label(ptr_flobject, label):\n _fl_set_object_label = library.cfuncproto(\n library.load_so_libforms(), \"fl_set_object_label\", \\\n None, [cty.POINTER(xfdata.FL_OBJECT), xfdata.STRING], \\\n \"\"\"void fl_set_object_label(FL_OBJECT * ob, const ch...
[ "0.6473299", "0.6357689", "0.62309986", "0.6187528", "0.6171569", "0.61030304", "0.60696876", "0.5949814", "0.5937695", "0.5793624", "0.5762512", "0.5740574", "0.57069945", "0.5684585", "0.5681956", "0.56754225", "0.5673044", "0.56729627", "0.5647832", "0.56459504", "0.563785...
0.8911857
0
Given a value of an unknown type, this method will return a tuple containing an appropriately type casted number (t[0]) and it's unit (t[1]) if one existed.
def val_to_type_unit(s): s = ('%s' % s) sre = re.search(VAL_TO_TYPE_UNIT, s) if sre == None: val, unit = s, None else: unit = sre.group(3) if sre.group(3) != '' else None if sre.group(2)==None: val = int(sre.group(1)) else: val = float(sr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_value(\n values: Dict[str, Any], key: str\n ) -> Union[None, Tuple[float, Any], str]:\n value = values.get(key)\n if value is None:\n return None\n if isinstance(value, dict):\n sub_value = value.get(\"value\")\n if sub_value is None:\n ...
[ "0.5973473", "0.59618515", "0.59258085", "0.5917067", "0.5884256", "0.5879622", "0.5863253", "0.58625734", "0.58078283", "0.58023846", "0.5758632", "0.57463366", "0.5736137", "0.5725652", "0.5603667", "0.5580455", "0.5556759", "0.5550852", "0.55269206", "0.5521867", "0.550961...
0.66220605
0
Converts a binary string to an integer by applying int(bit_string, radix = 2)
def bin_to_int(bit_string): return int(''.join(bit_string), 2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _binary_string_to_int(bitstring, big_endian=True):\n if not big_endian:\n bitstring = str(reversed(bitstring))\n val = 0\n nbits = len(bitstring)\n for (n, bit) in enumerate(bitstring):\n if bit == \"1\":\n val += 2**(nbits - n - 1)\n retu...
[ "0.8618083", "0.86138165", "0.84033966", "0.8320627", "0.76785606", "0.7592719", "0.7566548", "0.71659184", "0.7092487", "0.7091608", "0.7074952", "0.70156133", "0.6918008", "0.6907853", "0.68702567", "0.6862469", "0.68254036", "0.68149924", "0.6813423", "0.67798173", "0.6777...
0.89299315
0
Converts a hex string to an integer by applying int(hex_string, radix = 16)
def hex_to_int(hex_string): return int(hex_string, 16)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hex2int(hex_str):\n return int(hex_str, 16)", "def __hex2int(_hex_str):\n return int(\"0x\"+_hex_str, 16)", "def Hex2Int(hexString):\n answer = hexString[0]\n log.debug(f\"Hex {hexString} decoded to {answer}\")\n\n return answer", "def hex2int(r: str) -> int:", "def bytes_to_int(s):\...
[ "0.8983687", "0.8825148", "0.8165413", "0.809543", "0.7785146", "0.771284", "0.7653839", "0.7356596", "0.7110201", "0.7042945", "0.69643396", "0.68953633", "0.6868629", "0.68174434", "0.6775171", "0.6684517", "0.6619084", "0.6585549", "0.6526326", "0.652229", "0.64770657", ...
0.9242251
0
Return the hexadecimal string representation of integer n
def int_to_hex(n): #return "0x%X" % n return hex(n)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def int2hex(n: int) -> str:", "def dump( n ):\n\n s = '%x' % n\n if len(s) & 1:\n s = '0' + s\n return s.decode('hex')", "def hex_string(s, n=32):\n # take first n characters, reverse them and get ascii codes with ord()\n return 'X\"{0:>0{1}}\"'.format(''.join(['{0:x}'.format(ord(c)) for ...
[ "0.89213526", "0.7999283", "0.73147583", "0.72691756", "0.7181652", "0.70239675", "0.6962989", "0.6912562", "0.6841847", "0.6748261", "0.6731575", "0.67154413", "0.6714837", "0.6688148", "0.66580504", "0.66331506", "0.65440786", "0.6528737", "0.6502993", "0.64826554", "0.6470...
0.8578212
1
Returns a gnosis.xml.objectify instance derived from the xml seed. The xml_seed can be, raw xml, a filepath to an xml document, or an object created by gnosis.xml.objectify.
def xml_as_obj(xml_seed): if hasattr(xml_seed,'PCDATA'): return xml_seed else: # gnosis.xml.objectify._XO_manufacturer = AutoPCDATA return gnosis.xml.objectify.XML_Objectify(xml_seed).make_instance()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new(cls, xml):\n return oxml.parse_xml(xml)", "def xml2obj(self, src):\n\n\t\tclass DataNode(object):\n\t\t\tdef __init__(self):\n\t\t\t\tself._attrs = {} # XML attributes and child elements\n\t\t\t\tself.data = None # child text data\n\n\t\t\tdef __len__(self):\n\t\t\t\t# treat single element a...
[ "0.58442855", "0.5739626", "0.56409806", "0.56409806", "0.56409806", "0.56169295", "0.5604855", "0.5604855", "0.5604855", "0.5597507", "0.5577719", "0.5574437", "0.55607176", "0.55607176", "0.55607176", "0.55607176", "0.55607176", "0.55607176", "0.55607176", "0.5544579", "0.5...
0.79889387
0
Returns the current state of the object instance's class __properties__ as a dictionary
def current_instance_state(self): cur = {} for prop in self.__class__.entity_atts: cur[prop] = getattr(self, prop) return cur
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getstate__(self):\n result_dict = {}\n for pickle_attr in self.pickle_attrs:\n result_dict[pickle_attr] = self.__dict__[pickle_attr]\n return result_dict", "def json(self):\n rv = {\n prop: getattr(self, prop)\n for prop in self.__properties__\n ...
[ "0.76650983", "0.7440151", "0.7413553", "0.7384305", "0.7361673", "0.7361673", "0.7314111", "0.7228214", "0.7204391", "0.7204391", "0.71994585", "0.7084851", "0.70775723", "0.7021596", "0.69956005", "0.69805497", "0.6966025", "0.6957522", "0.6957522", "0.694698", "0.69425136"...
0.7709188
0
XML representation of the object instance to_xml(output = 'str', indent = True)
def to_xml(self, doc = None, output = None, indent = False): # Determine what format to return the values as if output != None and output.lower() != 'str' and output.lower() != 'dom': # Check to see if it's a filepath if output.lower().split('.')[-1] == 'xml': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n result = xml.dom.minidom.parseString(\n xml.etree.ElementTree.tostring(\n self.ToXMLElement(), encoding='utf-8')).toprettyxml(indent=' ')\n\n return result", "def toXML( self, indent = '', **kwargs ) :\n\n return( '\\n'.join( self.toXMLList( **kwargs ) ) )", ...
[ "0.76520276", "0.7107576", "0.70356894", "0.6863668", "0.6847286", "0.67376965", "0.6684036", "0.6638724", "0.65995055", "0.6579292", "0.65003926", "0.6474157", "0.6455936", "0.64376587", "0.64317685", "0.6371814", "0.6349065", "0.6349058", "0.63232625", "0.6306738", "0.62770...
0.7169864
1
Builds a rnn point estimate model based on the architecture defined in the configs The input received is already padded from the data processing module for variable sequence length. Making is used to keep track of padded elements in the tensor. Keras layers such as Cropping1D and Concatenate do not use masking, hence c...
def _build_model(self): outputs = [] # Masking information is only used by certain layers such as LSTM. Hence two copies of inputs are used, one for # propagating the mask and second for storing inputs which are used in operations such as Cropping1D and # concatenate. inputs = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_CNN_LSTM_model(feats2d, shapes, model_settings, is_training):\n\n if is_training:\n dropout_prob = model_settings['dropout_prob']\n\n # Input Layer\n shape = tf.shape(feats2d) # features are of shape [max seq length for batch, 40]\n input_layer = tf.reshape(feats2d,[-1, shape[1], mode...
[ "0.62534446", "0.6123532", "0.60896814", "0.6051431", "0.60324025", "0.602328", "0.5975605", "0.59606373", "0.59502655", "0.594651", "0.5946146", "0.5934568", "0.5903107", "0.5862634", "0.58303934", "0.58290887", "0.58017135", "0.5798901", "0.57957214", "0.57913715", "0.57902...
0.7029392
0
Return first item in sequence where f(item) == True.
def find(f, seq): for item in seq: if f(item): return item
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def finditem(func, seq):\n return next((item for item in seq if func(item)))", "def first_true(iterable, default=False, pred=None):\n return next(filter(pred, iterable), default)", "def _first(self, \n iterable, \n condition=lambda x: True):\n try:\n return n...
[ "0.7381083", "0.69793993", "0.68005335", "0.67570746", "0.67258066", "0.6664692", "0.66255635", "0.6597727", "0.64589864", "0.64407694", "0.6315168", "0.6314598", "0.63102686", "0.6286507", "0.6251015", "0.6169875", "0.6169091", "0.6152609", "0.6152609", "0.6064589", "0.60064...
0.7370345
1
Check last activity of each client and delete them if it's too old.
def _keep_alive_handler(self): now = time.time() to_be_deleted = [] for key in self.clients: delta_last_activity = now - self.clients[key].last_activity if delta_last_activity >= 5: to_be_deleted.append(key) for i in to_be_deleted: se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def housekeeping(self):\n now = datetime.now()\n if (now - self.lastClean).seconds > CLIENT_EXPIRE:\n # Clean up no heartbeat clients\n logging.info(\"Session [%d] do housekeeping...\" % (self.meta.sessionid))\n for cli in copy.deepcopy(self.clients):\n ...
[ "0.63426864", "0.6262991", "0.6225532", "0.6122553", "0.59732985", "0.5955758", "0.5894947", "0.58849895", "0.58551997", "0.5807213", "0.579942", "0.57927537", "0.57684374", "0.576593", "0.5729617", "0.5726862", "0.5712019", "0.5699266", "0.56909144", "0.56489766", "0.5641429...
0.78282577
0
Get client id from context
def _get_client_id(self, context): for key, value in context.invocation_metadata(): if key == 'client_id': return value raise Exception('client id not found')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def client_id(self):\n return self.__client_id", "def client_id(self) -> str:\n return pulumi.get(self, \"client_id\")", "def client_id(self) -> str:\n return pulumi.get(self, \"client_id\")", "def client_id(self) -> str:\n return pulumi.get(self, \"client_id\")", "def client_id...
[ "0.7874417", "0.78503335", "0.78503335", "0.78503335", "0.7768982", "0.7675216", "0.7596776", "0.7596776", "0.7569019", "0.7569019", "0.7569019", "0.7569019", "0.7569019", "0.7569019", "0.7569019", "0.7569019", "0.7569019", "0.7569019", "0.7569019", "0.7529456", "0.7367694", ...
0.86267674
0
Tries to import the given file. This is our own format used for party results. Supports per party panachage data. Stores the panachage results from the blank list with a blank name.
def import_party_results(election, file, mimetype): errors = [] parties = {} party_results = {} party_totals = {} panachage_results = {} panachage_headers = None # The party results file has one party per year per line (but only # panachage results in the year of the election) if f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def import_file(self, p):\n if not os.path.isfile(p):\n return\n\n bs = []\n with open(p, 'r') as rfile:\n while 1:\n try:\n bs.append(self._import_analysis(rfile))\n except EOFError:\n pass\n ...
[ "0.5633176", "0.55968875", "0.5553049", "0.5529567", "0.54632235", "0.5460349", "0.54348826", "0.5426475", "0.54073083", "0.5394314", "0.5353244", "0.53217316", "0.53028065", "0.52994424", "0.5296687", "0.5229877", "0.52286464", "0.52094454", "0.51965183", "0.5161073", "0.513...
0.6767119
0
Test that report has been properly defined
def test_report_definition(self): self.model = self.scan.model self.model.save() new_model = pycotools3.tasks.CopasiMLParser(self.copasi_file).xml reports = new_model.find('{http://www.copasi.org/static/schema}ListOfReports') check = False for report in reports: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_test_report(self):\n self.__opener.contents = '''<Report><Doc><Summary failed=\"1\" passed=\"2\"/></Doc></Report>'''\n self.assertEqual(1, self.__uft.failed_tests('url'))\n self.assertEqual(2, self.__uft.passed_tests('url'))\n self.assertEqual(0, self.__uft.skipped_tests('url')...
[ "0.74468744", "0.7437672", "0.73840517", "0.72293633", "0.70844525", "0.70771164", "0.7066499", "0.6876801", "0.6867785", "0.6748424", "0.67347", "0.6733445", "0.6698269", "0.6621294", "0.6619172", "0.66071326", "0.6605833", "0.652698", "0.65249646", "0.65130895", "0.64898014...
0.7469605
0