query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
It's a method to move the object.
def move_me(self): #self.start_pos = self.rect.center if self.goal_pos is not None: print(f'goal_pos: {self.goal_pos}, start_pos: {self.start_pos}') dx = self.goal_pos[0] - self.start_pos[0] dy = self.goal_pos[1] - self.start_pos[1] distance = math.sqrt(dx*dx + dy*dy) self.shift += self.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move(self):\n pass", "def move(self):\n raise NotImplementedError", "def move(self, move):\n raise NotImplementedError()", "def move(): #py:move\n RUR._move_()", "def move(self, direction):\n # replace with your code\n pass", "def move(self, direction):\n ...
[ "0.858327", "0.8339233", "0.7708627", "0.7516622", "0.7507448", "0.7507448", "0.74020606", "0.7386842", "0.7380838", "0.7377471", "0.7373789", "0.72534597", "0.72252834", "0.7198612", "0.7166816", "0.71584934", "0.71465313", "0.71347594", "0.71096295", "0.7097371", "0.7082709...
0.0
-1
It's a method to move the object.
def move_me_on_spawn(self): if self.points_to_go: self.start_pos = self.points_to_go[0] for point in self.points_to_go[1:]: for i in range(len(self.points_to_go[1:])): self.goal_pos = self.points_to_go[i] self.move_me() #self.start_pos = #print(self.goal_pos) #if se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move(self):\n pass", "def move(self):\n raise NotImplementedError", "def move(self, move):\n raise NotImplementedError()", "def move(): #py:move\n RUR._move_()", "def move(self, direction):\n # replace with your code\n pass", "def move(self, direction):\n ...
[ "0.85842174", "0.8340159", "0.7709202", "0.7517611", "0.7507434", "0.7507434", "0.7402334", "0.7387477", "0.7381314", "0.73774827", "0.7374565", "0.7253425", "0.72251827", "0.7198465", "0.71662813", "0.71597916", "0.7146346", "0.7134991", "0.71090806", "0.7097772", "0.7082437...
0.0
-1
It's a method to draw the object on the screen.
def draw_me(self): self.image.fill((100, 200, 100)) if self.active: pg.draw.rect(self.image, (100, 100, 200), self.frame, 3) #if active => draw frame around selected entity width 3 self.display_surface.blit(self.image, self.rect)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw(self, screen):", "def __draw(self, screen):\n\n pygame.draw.rect(screen, (200, 255, 200), (self.x, self.y, self.width, self.height))", "def draw(self, screen):\n screen.blit(self.surface, self.rect)", "def draw(self):\n self.screen.fill(BACKGROUND_COLOR)\n self.cannon.dra...
[ "0.8639596", "0.8463629", "0.84310234", "0.8336981", "0.820263", "0.8195842", "0.8181905", "0.8128786", "0.8048422", "0.8048422", "0.8048422", "0.8048422", "0.79957294", "0.7939785", "0.7935518", "0.79080766", "0.78791046", "0.7865038", "0.7848005", "0.78259814", "0.78093797"...
0.78702897
17
It's a method to draw the object on the screen.
def draw_a50(self): pg.draw.rect(self.image, (100, 200, 100), self.rect) #self.display_surface.blit(self.image, self.rect)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw(self, screen):", "def __draw(self, screen):\n\n pygame.draw.rect(screen, (200, 255, 200), (self.x, self.y, self.width, self.height))", "def draw(self, screen):\n screen.blit(self.surface, self.rect)", "def draw(self):\n self.screen.fill(BACKGROUND_COLOR)\n self.cannon.dra...
[ "0.8639686", "0.84641725", "0.84318274", "0.83380365", "0.82032436", "0.81964034", "0.8182908", "0.8129538", "0.8049066", "0.8049066", "0.8049066", "0.8049066", "0.799628", "0.7940632", "0.79363257", "0.79091257", "0.78803986", "0.78708935", "0.7866067", "0.78481585", "0.7827...
0.0
-1
It's a method to select the object with a mouse LEFT click.
def deselect_me(self): self.active = False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mouse_left_down(self):\n pass", "def LeftClick(self):\n self._PressLeftButton()\n self._ReleaseAllButtons()", "def on_left_mouse_click(self, event: Event) -> None:\n\t\tself.mouse_state.set_click(event.x, event.y)", "def leftButtonDown(self):\n\t\tautopy.mouse.toggle(True,autopy.mouse.LEFT_B...
[ "0.7849615", "0.7681661", "0.7543148", "0.7468128", "0.7089086", "0.7034825", "0.69766486", "0.6889817", "0.67133605", "0.66693765", "0.6659412", "0.6632614", "0.6627473", "0.6620587", "0.66194576", "0.66029096", "0.6590843", "0.65843195", "0.6572333", "0.6533226", "0.6508757...
0.0
-1
Gets two positive integer numbers m and n (m > n). Returns True if they are coprime, otherwise, returns False.
def coprime(m,n): # The function uses the Euclid's algorithm for finding the greatest common divisor. The algorithm is recursive. # If the GCD is 1, when the numbers are coprime. If it is greater than 1, when the numbers aren't coprime. if n == 0 and m > 1: return False elif n == 0 and m ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def coprime(a: int, b: int):\n\n return euclid(a, b) == 1", "def coprime(a, b):\n return gcd(a, b) == 1", "def coprime(self,x,y):\r\n return x == 1 or y == 1 or not bool(self.cofactors(x,y))", "def is_relatively_prime(n, m):\n result = True\n larger = n\n if m > n:\n larger = m\n...
[ "0.79076767", "0.7667604", "0.72574323", "0.6289784", "0.59262717", "0.5853223", "0.5806163", "0.5744549", "0.5737769", "0.5737769", "0.5732557", "0.5720091", "0.56966656", "0.56965023", "0.568913", "0.5660022", "0.5632094", "0.5599034", "0.5597036", "0.55894285", "0.5589392"...
0.7949466
0
Gets the range of possible integer perimeters. Generates a set of all possible perimeters of rightangled triangles with integer sides. Also generates a set of perimeters of rightangled triangles with integer sides which can be formed using more than one set of values of the sides.
def perimeters(L,counter=0): for m in range(2, int(L ** (1/2)) + 1): for n in range(1, m): limit = m * (m + n) if limit > 750000: break if coprime(m,n) and ((m - n) % 2 > 0): for k in range(1, 750000 // limit + 1): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yield_right_scalene_triangles(cls):\n for n in range(1, 10):\n m = n + 1\n while True:\n a, b, c = 2 * m * n, m * m - n * n, m * m + n * n\n if a <= 200 and b <= 200 and c <= 200:\n yield a, b, c\n m += 1\n ...
[ "0.593584", "0.5841993", "0.574564", "0.5671036", "0.5518445", "0.54776615", "0.54388785", "0.54362965", "0.52928966", "0.52676713", "0.5253598", "0.5241637", "0.52206737", "0.5196224", "0.51582533", "0.51150614", "0.50665206", "0.50629294", "0.49804005", "0.49755204", "0.497...
0.0
-1
Create a shift from a datetime.
def from_datetime(cls, position, datetime): return cls( position = position, date = datetime.date(), name = position.shiftForTime(datetime.time()), )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timeshift(self, shift='random'):\n\n if shift == 'random':\n one_month = pd.Timedelta('30 days').value\n two_years = pd.Timedelta('730 days').value\n random_timedelta = - pd.Timedelta(random.uniform(one_month, two_years)).round('min')\n self.timeshift(random_t...
[ "0.6044403", "0.5398259", "0.5287457", "0.51769984", "0.5132189", "0.50019145", "0.49231648", "0.4896712", "0.48872542", "0.48718226", "0.47676012", "0.4703589", "0.46973696", "0.46934074", "0.4664867", "0.46602306", "0.46434352", "0.46422106", "0.46262237", "0.46083966", "0....
0.62300646
0
One or both of C{time} and C{name} are required. If both are provided, they must match (meaning C{time == name.value}).
def __init__(self, position, date, time=None, name=None): if time is None: if name is None: raise ValueError("Both time and name may not be None.") else: time = name.value if name is None: name = position.lookupByValue(time) el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_is_valid(request, day, time, name):\n\n\tif ((day != '0' and day != '6') and time.hour == 21) or time.minute != 0:\n\t\treturn False\n\n\t# George's time\n\tif name != \"George Yeh\" and day == '6' and time.hour >= 9 and time.hour < 12:\n\t\treturn False\n\n\treturn True", "def _parse_name_time(self, na...
[ "0.6640484", "0.64786184", "0.63629127", "0.5910048", "0.57977873", "0.5792878", "0.57901675", "0.5783988", "0.57561564", "0.5652514", "0.56190234", "0.56104416", "0.5609141", "0.54952973", "0.5492782", "0.54883355", "0.54883355", "0.5479089", "0.5475929", "0.54683834", "0.54...
0.6205939
3
Unidirectional conditional encoding model
def get_model_conditional(batch_size, max_seq_length, input_size, hidden_size, target_size, vocab_size, pretrain, tanhOrSoftmax, dropout): # batch_size x max_seq_length inputs = tf.placeholder(tf.int32, [batch_size, max_seq_length]) inputs_cond = tf.placeholder(tf.int32, [batch_si...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fit_transform(self):\n if self.enc_types == \"label\":\n return self._label_encoding()\n elif self.enc_types == \"ohe\":\n return self._one_hot_encoder()\n elif self.enc_types == \"binary\":\n return self._binarization()\n else:\n raise Ex...
[ "0.63260204", "0.63030267", "0.6075851", "0.5967848", "0.5965372", "0.58790743", "0.5874796", "0.57890356", "0.57799464", "0.5722842", "0.57191926", "0.57162666", "0.5694521", "0.56495357", "0.55867964", "0.55455726", "0.55426574", "0.5501296", "0.5484576", "0.54778284", "0.5...
0.0
-1
LSTM over target and over tweet, concatenated
def get_model_concat(batch_size, max_seq_length, input_size, hidden_size, target_size, vocab_size, pretrain, tanhOrSoftmax, dropout): # batch_size x max_seq_length inputs = tf.placeholder(tf.int32, [batch_size, max_seq_length]) inputs_cond = tf.placeholder(tf.int32, [batch_size, max_se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def LSTM_train(X_train, Y_train, X_dev, Y_dev, R_train, R_dev, hyperparams):", "def __init__(self):\n super(biLSTM, self).__init__()\n \n # Words\n self.embedding = nn.Embedding(config.VOCAB, config.EMBED_DIM) \n self.embedding.shape = torch.Tensor(config.BATCH_SIZE, 5*config.E...
[ "0.67408913", "0.6457854", "0.64562833", "0.63649803", "0.63074315", "0.6204652", "0.62009096", "0.61928713", "0.6126765", "0.6115002", "0.61127365", "0.6061078", "0.6044729", "0.6038946", "0.5991248", "0.5983274", "0.5976194", "0.5951641", "0.59376055", "0.59331805", "0.5918...
0.60012954
14
LSTM over tweet only
def get_model_tweetonly(batch_size, max_seq_length, input_size, hidden_size, target_size, vocab_size, pretrain, tanhOrSoftmax, dropout): # batch_size x max_seq_length inputs = tf.placeholder(tf.int32, [batch_size, max_seq_length]) cont_train = True if pretrain == "pre": ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def LSTM_train(X_train, Y_train, X_dev, Y_dev, R_train, R_dev, hyperparams):", "def lstm_infer_vector(lstm_model, txt, stopwords,word_indices, maxlen=10, taillemax=300) :\n \n txt_prep = gensim.utils.simple_preprocess(txt, deacc=True)\n txt_wo_uw = remove_unknown_words(txt_prep, word_indices)\n txt_w...
[ "0.69259703", "0.6396579", "0.63238174", "0.6247593", "0.6204757", "0.62018347", "0.62017447", "0.6161664", "0.61093134", "0.6070913", "0.6062975", "0.60444057", "0.6001166", "0.5980393", "0.59802103", "0.5965758", "0.5951675", "0.5950302", "0.5941786", "0.5909258", "0.589360...
0.65407586
1
Experimental, feed target during tweet processing
def get_model_conditional_target_feed(batch_size, max_seq_length, input_size, hidden_size, target_size, vocab_size, pretrain, tanhOrSoftmax, dropout): # batch_size x max_seq_length inputs = tf.placeholder(tf.int32, [batch_size, max_seq_length]) inputs_cond = tf.placehol...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_tweet(self, tweet):\n pass", "def handler(event,context):\n tweet = setup_and_get_tweet()\n send_tweet(tweet)", "def main():\r\n \r\n from TweetProcessor import TweetProcessor\r\n \r\n consumer_key = ''\r\n consumer_secret = ''\r\n tweepy_base_filter = \"Filter:links -Filt...
[ "0.7313502", "0.69035405", "0.6865521", "0.68484783", "0.6787863", "0.6676291", "0.6539487", "0.65331274", "0.65195614", "0.6417536", "0.63775533", "0.6372511", "0.6360895", "0.63496524", "0.63423645", "0.632423", "0.631834", "0.62835366", "0.6275059", "0.62618613", "0.622733...
0.0
-1
Bidirectional conditional encoding with separate embeddings matrices for tweets and targets lookup
def get_model_bicond_sepembed(batch_size, max_seq_length, input_size, hidden_size, target_size, vocab_size, pretrain, tanhOrSoftmax, dropout): # batch_size x max_seq_length inputs = tf.placeholder(tf.int32, [batch_size, max_seq_length]) inputs_cond = tf.placeholder(tf.int32, [...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode_decode_TD(self, n_step, idx_list_previous, log_probs_previous, entropies_previous, mask_previous, query1_previous, query2_previous, query3_previous, idx_ ):\r\n\r\n actor_embedding = embed_seq(input_seq=self.input_, from_=self.dimension, to_= self.input_embed, is_training=self.is_training, BN=Tru...
[ "0.62304574", "0.61581886", "0.60888433", "0.6022857", "0.6010236", "0.59635216", "0.59596765", "0.59439564", "0.5934304", "0.592322", "0.5922254", "0.5914548", "0.59115756", "0.586454", "0.5857956", "0.581915", "0.5815731", "0.57856417", "0.5763882", "0.57341534", "0.5730271...
0.555872
45
Method for creating the different models and training them
def test_trainer(testsetting, w2vmodel, tweets, targets, labels, ids, tweets_test, targets_test, labels_test, ids_test, hidden_size, max_epochs, tanhOrSoftmax, dropout, modeltype="conditional", targetInTweet={}, testid = "test-1", pretrain = "pre_cont", acc_thresh=0.9, sep = False): # parameters learning_rate ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_models(self):\n scores = {}\n for name, clf in self.__clfs.items():\n print('=' * 80)\n print(name)\n scores[name] = self.__benchmark(clf)\n best = self.__get_best_score(scores)\n best_params = self.optimize(self.__clfs[best])\n simple_s...
[ "0.76776975", "0.76045287", "0.7354052", "0.7263279", "0.7256921", "0.7252735", "0.72468996", "0.724567", "0.7220866", "0.72174674", "0.72167915", "0.7209326", "0.7187799", "0.7158652", "0.71488", "0.7124282", "0.7107402", "0.70929474", "0.70569545", "0.70513165", "0.70222586...
0.0
-1
Reading input files, calling the trainer for training the model, evaluate with official script
def readInputAndEval(testSetting, outfile, hidden_size, max_epochs, tanhOrSoftmax, dropout, stopwords="most", testid="test1", modeltype="bicond", word2vecmodel="small", postprocess=True, shortenTargets=False, useAutoTrump=False, useClinton=True, acc_thresh=1.0, pretrain="pre_cont", usePhrases=False): if word2vecm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n data = load_data()\n analyze_features(data['full_features'])\n model = train(data)\n\n with open('model.pickle', 'wb') as f:\n pickle.dump(model, f)\n evaluate(model, data)", "def train(self, trainfile):", "def main():\r\n # Read dataset.\r\n reader = DatasetReader\r\n tr...
[ "0.7480094", "0.7215712", "0.7188897", "0.7166654", "0.7165199", "0.7164453", "0.6992235", "0.6970149", "0.6936405", "0.6928871", "0.6909906", "0.6889421", "0.68563586", "0.685357", "0.6827311", "0.68212926", "0.6818569", "0.68144375", "0.68039346", "0.67896914", "0.6782234",...
0.64902997
56
Get the current user.
def get_me(self): return self._api_call('get', '/me')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_current_user(self):\n return self.current_user", "def get_current_user(self):\n return self.get_secure_cookie(\"user\")", "def current_user(self):\n user_dict = self.auth.get_user_by_session()\n return self.auth.store.user_model.get_by_id(user_dict['user_id'])", "def current_user(...
[ "0.8836685", "0.87018216", "0.86910814", "0.8619504", "0.85802186", "0.8505428", "0.8505428", "0.8505428", "0.8500047", "0.8500047", "0.84839404", "0.8483425", "0.84567", "0.838958", "0.8296931", "0.8281396", "0.82328916", "0.815139", "0.8126627", "0.8124535", "0.81106335", ...
0.0
-1
Get teams owned by the account.
def get_teams(self, account_id): endpoint = '/accounts/{}/teams'.format(account_id) return self._api_call('get', endpoint)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_teams(self):\n url = 'teams'\n result = self.get(url)\n return result.get('teams', result)", "def get_teams(self, *args, **kwargs):\n\n teams_data = api.get_teams(\n *args,\n api_key=self.__creds.api_key_v2,\n **kwargs)\n return [en.Team...
[ "0.7548286", "0.7198719", "0.7053132", "0.70429367", "0.70303184", "0.6919348", "0.6908395", "0.6904372", "0.68936974", "0.6875712", "0.6783006", "0.67675626", "0.67675245", "0.6744305", "0.6626937", "0.66002136", "0.65531397", "0.64464307", "0.6432558", "0.6408208", "0.63947...
0.7758869
0
Get projects owned by the team.
def get_projects(self, team_id): endpoint = '/teams/{}/projects'.format(team_id) return self._api_call('get', endpoint)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_projects(self):\n return self._gitlab.owned_projects(per_page=1000)", "def get_projects(self):\n return self.http_call(\"get\", url=f\"{self.base_url}/projects\").json()", "def get_projects(self):\n projects = []\n page = 1\n while not len(projects) % 100:\n ...
[ "0.8055631", "0.71431756", "0.6982873", "0.6950596", "0.69087213", "0.68157524", "0.6773247", "0.6765266", "0.67424154", "0.66995823", "0.66808534", "0.6675837", "0.66692793", "0.6655742", "0.66494966", "0.6611001", "0.66000354", "0.6599352", "0.6567951", "0.65166676", "0.651...
0.720342
1
Get a project by id.
def get_project(self, project_id): endpoint = '/projects/{}'.format(project_id) return self._api_call('get', endpoint)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_project(self, id):\n for project in self.projects:\n if project.id == int(id):\n ret_val = project\n break\n else:\n ret_val = None\n\n return ret_val", "def get_project(project_id):\n return Project.objects.get(id=project_id)", ...
[ "0.85450214", "0.848927", "0.8266412", "0.80974513", "0.80609334", "0.8044354", "0.8024351", "0.78656834", "0.773265", "0.7671528", "0.7634889", "0.74409455", "0.7180909", "0.7140296", "0.7125609", "0.709435", "0.7068609", "0.69485366", "0.68705076", "0.6820544", "0.668665", ...
0.83762926
2
Get an asset by id.
def get_asset(self, asset_id): endpoint = '/assets/{}'.format(asset_id) return self._api_call('get', endpoint)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_asset(self, asset_id):\n text, code = ApiClient(self._config, 'assets/' + asset_id).get()\n return Asset.deserialize(text)", "def get_asset(self, asset_id, asset_type):\n return self.asset(asset_id, asset_type=asset_type)", "def asset(self, asset_id):\n headers, items = self...
[ "0.8605014", "0.8052259", "0.7977259", "0.78436553", "0.7251006", "0.7176857", "0.69656426", "0.6938977", "0.6917505", "0.66144365", "0.65986526", "0.6570589", "0.6543234", "0.6528059", "0.64717233", "0.6465809", "0.6415963", "0.6392111", "0.638581", "0.6384934", "0.6381671",...
0.8775442
0
Get an asset's children.
def get_asset_children(self, asset_id): endpoint = '/assets/{}/children'.format(asset_id) return self._api_call('get', endpoint)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def children(self) -> \"AssetList\":\n return self._cognite_client.assets.list(parent_ids=[self.id], limit=None)", "def get_children(self):\r\n\r\n if not self.has_children:\r\n return []\r\n\r\n if getattr(self, '_child_instances', None) is None:\r\n self._child_instan...
[ "0.80006397", "0.691222", "0.6860828", "0.68368614", "0.68368614", "0.68368614", "0.68265384", "0.6793676", "0.6740953", "0.6736009", "0.6700646", "0.6693795", "0.6691179", "0.6656253", "0.66030985", "0.6577579", "0.655715", "0.655715", "0.6483371", "0.64426744", "0.64426744"...
0.8664441
0
Upload an asset. The method will exit once the file is uploaded.
def upload(self, asset, file): uploader = FrameioUploader(asset, file) uploader.upload()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upload_asset(ctx, asset, release):\n\n try:\n\n gh = ctx.obj.github\n\n log.echo('Uploading {} to release {}...'\n .format(os.path.basename(asset), release), break_line=False)\n asset_url = gh.upload_asset(asset=asset, release=release)\n log.checkmark()\n l...
[ "0.7121886", "0.6898182", "0.67980725", "0.6593342", "0.6541552", "0.6339619", "0.6255667", "0.6252402", "0.62079424", "0.6194437", "0.6188706", "0.61695176", "0.6163366", "0.61349344", "0.61055654", "0.6055838", "0.6012874", "0.5993593", "0.5967045", "0.59558564", "0.5932348...
0.7988663
0
Get an asset's comments.
def get_comments(self, asset_id): endpoint = '/assets/{}/comments'.format(asset_id) return self._api_call('get', endpoint)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_comments(self):\n\t\treturn self._client.get_comments(self)", "def comments(self):\n comments_url = self.data['comments_url']\n return json.load(urllib2.urlopen(comments_url))", "def comments(self):\n return self.container['comments']", "def get(self, id):\n return get_com...
[ "0.7266864", "0.6898062", "0.67627263", "0.66801363", "0.66657114", "0.66657114", "0.6650718", "0.6621939", "0.65967107", "0.65728563", "0.6548351", "0.6507441", "0.6507441", "0.6507441", "0.63552064", "0.63516146", "0.6345878", "0.6339328", "0.6319697", "0.63146293", "0.6279...
0.87023836
0
Get the review links of a project
def get_review_links(self, project_id): endpoint = '/projects/{}/review_links'.format(project_id) return self._api_call('get', endpoint)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grab_project_links(soup):\n project_urls = []\n valid_project_url = \"/?archive/?gsoc/\\d+[0-9]/orgs/[a-zA-Z]+/[a-zA-Z]+/[a-zA-Z]+.html\"\n try:\n # Grab links to all the projects\n all_link = soup.find_all(\"a\")\n for link in all_link:\n if re.match(valid_project_url,...
[ "0.6268083", "0.62558377", "0.6122463", "0.6031433", "0.60285616", "0.59528255", "0.5925954", "0.58337975", "0.57853", "0.57034177", "0.5673401", "0.56721526", "0.563363", "0.56289285", "0.56215906", "0.5591778", "0.5589715", "0.5549578", "0.5547254", "0.55213386", "0.5512712...
0.7728808
0
Create a review link.
def create_review_link(self, project_id, **kwargs): endpoint = '/projects/{}/review_links'.format(project_id) return self._api_call('post', endpoint, payload=kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def review_link(self, review_link):\n\n self._review_link = review_link", "def createLink(context, title, link, exclude_from_nav=False):\n oid = idnormalizer.normalize(title, 'es')\n if not hasattr(context, oid):\n context.invokeFactory('Link', id=oid, title=title, remoteUrl=link)\n li...
[ "0.67446196", "0.59985214", "0.58935666", "0.5819669", "0.57771635", "0.57548815", "0.56993616", "0.5654442", "0.5638429", "0.5629432", "0.56153315", "0.56034595", "0.5595337", "0.5588098", "0.558482", "0.55711055", "0.5541868", "0.55295026", "0.5524608", "0.5522368", "0.5497...
0.77476805
0
Get a single review link
def get_review_link(self, link_id, **kwargs): endpoint = '/review_links/{}'.format(link_id) return self._api_call('get', endpoint, payload=kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_review_page(review_link):\n\n session = r.Session()\n response = session.get(BASE_URL + '/music/albumreviews/' + review_link,\n headers=HEADERS)\n return response", "def get_review(review_id):\n return get(cls, review_id)", "def get_content_object_url(self):\n ...
[ "0.6831752", "0.64643896", "0.6345438", "0.6279402", "0.6228978", "0.61699647", "0.61587733", "0.612717", "0.6065012", "0.60605973", "0.603731", "0.5991732", "0.5958937", "0.5925658", "0.58885676", "0.576672", "0.57320416", "0.57320416", "0.57136726", "0.5682893", "0.5650391"...
0.6617292
1
Add or update assets for a review link.
def update_review_link_assets(self, link_id, **kwargs): endpoint = '/review_links/{}/assets'.format(link_id) return self._api_call('post', endpoint, payload=kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def review_link(self, review_link):\n\n self._review_link = review_link", "def linkAssets(des, Xrc):\n with open(des, 'r') as f:\n body = f.read()\n f.close()\n with open(des, 'w') as f:\n body = body.replace(\"custom.css\", \"\\\\\" + Xrc[\"gh_repo_name\"] + \"/Assets\" + \"/cs...
[ "0.59623325", "0.5327148", "0.51797146", "0.5134346", "0.49140236", "0.48908433", "0.4881912", "0.48579592", "0.4842742", "0.48399702", "0.4804743", "0.47892767", "0.47684696", "0.47508633", "0.4741797", "0.47353303", "0.47250083", "0.46850595", "0.46558216", "0.4654844", "0....
0.74828833
0
Get items from a single review link.
def get_review_link_items(self, link_id): endpoint = '/review_links/{}/items'.format(link_id) return self._api_call('get', endpoint)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_review_page(review_link):\n\n session = r.Session()\n response = session.get(BASE_URL + '/music/albumreviews/' + review_link,\n headers=HEADERS)\n return response", "def get_reviews(item_id, shop_id, review_num=10) -> list:\n get_url = f\"{_shopee_base_url}/api/v2/it...
[ "0.6445965", "0.6111887", "0.59627175", "0.59522223", "0.5802556", "0.5668858", "0.56402814", "0.56334907", "0.5598594", "0.5478629", "0.5376781", "0.5351566", "0.5350795", "0.534827", "0.53360826", "0.5320217", "0.52967834", "0.5288006", "0.52783906", "0.52698594", "0.525339...
0.70730585
0
Returns mean for all elements past current (including current) for every point
def expanding_mean(arr): total_len = arr.shape[0] return ((arr / total_len).cumsum() / np.arange(1, total_len + 1)) * total_len
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mean(points):\r\n\t\treturn sum(points)/len(points)", "def point_avg(points):\n if len(points)==1:\n new_center= np.mean(points)\n else:\n new_center= [np.mean([x[y] for x in points]) for y in range(len(points[0]))]\n return new_center", "def current_mean(self):\r\n values = s...
[ "0.7258874", "0.7101988", "0.70291924", "0.6934186", "0.6857672", "0.6841803", "0.67217815", "0.6639915", "0.66098267", "0.65969443", "0.65851164", "0.6567137", "0.65645444", "0.6561704", "0.6561704", "0.6561704", "0.6561704", "0.6561704", "0.6561704", "0.6542912", "0.6536134...
0.0
-1
Given an imaging server fqdn, get its ID; raises NotFound if not found.
def get_id(self, fqdn): res = self.db.execute(sqlalchemy.select([ model.imaging_servers.c.id ], whereclause=(model.imaging_servers.c.fqdn==fqdn))) return self.singleton(res)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def id(self):\n if self.cloudserver:\n return self.cloudserver.id\n else:\n return None", "def get_dnid_by_dnname(self, dnname):\r\n for dn in self.dns:\r\n if dn.name == dnname:\r\n return dn.id\r\n return None", "def fqdn_identifier(...
[ "0.60768455", "0.5970655", "0.5924284", "0.5919874", "0.58456326", "0.5822033", "0.5815973", "0.580934", "0.5719458", "0.56800956", "0.56767", "0.566704", "0.5608655", "0.55602825", "0.5556568", "0.55522054", "0.5534244", "0.55294096", "0.5518612", "0.5512121", "0.5504768", ...
0.7955763
0
Return a list of the fqdn's of all imaging servers
def list(self): res = self.db.execute(select([model.imaging_servers.c.fqdn])) return self.column(res)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ns_list(self):\n return sorted(self.get_ns_name(ns) for ns in self.profile.authoritative_servers)", "def ip_addresses(self):\n try:\n return socket.gethostbyaddr(self.fqdn)[-1]\n except socket.error as _:\n return ['127.0.0.1']", "def list_distributed_cameras(ns_h...
[ "0.6587762", "0.65380913", "0.6459177", "0.6459177", "0.6430747", "0.6372296", "0.6362174", "0.633885", "0.6327382", "0.6309077", "0.6303938", "0.62505966", "0.62255406", "0.6212317", "0.6186019", "0.6185925", "0.6149783", "0.6135975", "0.61257327", "0.60628873", "0.60275596"...
0.77899426
0
Place various obstacles. E.g. put in rectangles which block the line of site of the towers.
def place_obstacles(): #Randomly generate different sized rectangles #Soem may overlap, which gives more variety in shape of obstacles xvals = np.random.randint(0,self.map_dimensions[1],size=self.N_obstacles) yvals = np.random.randint(0,self.map_dimensions[0],size=self.N_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_obstacles(self):\n for obstacle in self.obstacles:\n obstacle.draw(self.window, Colors.BLACK.value)", "def draw_obstacles():\n for obstacle in obstacles:\n plt.gca().add_patch(obstacle)", "def spawn_obstacles(self):\n self.obstacle_sprites.empty()\n number_of_...
[ "0.7180668", "0.6907903", "0.66251636", "0.65257436", "0.6507786", "0.6495422", "0.64418054", "0.63769335", "0.6216832", "0.6200093", "0.6169618", "0.6096015", "0.6086622", "0.60711867", "0.601048", "0.60011566", "0.59804374", "0.59804374", "0.59792244", "0.5943572", "0.59333...
0.79376906
0
Place the target locations
def place_targets(): coords = [] while len(coords)<self.N_targets: x = np.random.randint(self.BORDER_MARGIN,self.map_dimensions[1]+1-self.BORDER_MARGIN,size=1)[0] y = np.random.randint(self.BORDER_MARGIN,self.map_dimensions[0]+1-self.BORDER_MARGIN,si...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_targets(self):\n for ga_main, ga_targ in zip(self.ga.variables, self.ga_.variables):\n ga_targ.assign(ga_main)\n if self.use_lyapunov:\n for lc_main, lc_targ in zip(self.lc.variables, self.lc_.variables):\n lc_targ.assign(lc_main)\n else:\n ...
[ "0.6060867", "0.5983119", "0.59704787", "0.5942067", "0.5901007", "0.588003", "0.58684736", "0.58369666", "0.58147174", "0.58143884", "0.5814113", "0.5796882", "0.5793904", "0.57164675", "0.5716242", "0.57001746", "0.56815624", "0.56712925", "0.5663553", "0.5660132", "0.56310...
0.71361285
0
Place the potential tower locations. These are the locations where towers can potentially be placed. Not every location is necesarily used (only when N_tower_sites = N_towers). THe optimization problem is to determine which of these possible locations to use.
def place_allowed_tower_sites(): self.coordinates__tower_sites = [] for tk in xrange(self.N_tower_kinds): #Each kind of tower will have the correct number of sites placed coords = [] while len(coords)<self.N_tower_sites[tk]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solve_environment(self):\n \n #The first problem formulation\n #K kinds of towers\n #See more details about problem formulation in the writeup \n \n #Get a full matrix of the concatenated coverage matrices for \n #each tower type. THis new matrix has...
[ "0.58460766", "0.57772356", "0.5284448", "0.52179706", "0.5182957", "0.5147743", "0.5096863", "0.50870997", "0.50867623", "0.5045977", "0.502303", "0.49666467", "0.49650604", "0.49317968", "0.49126053", "0.49000195", "0.48980615", "0.48955286", "0.4892086", "0.48821265", "0.4...
0.79918706
0
return True if r1 r2 line of sight is obstrucetd; oherwise False
def check_obstructed(r1,r2): if r1==r2: return False #Densely sample line connecting r1 and r2. #If any of those sampled points is inside the rectangle, then the #line of sight intersects the rectangle and the tower's...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_ok_two_lines(line1, line2):\n card1 = line1[0]\n card2 = line1[1]\n card3 = line1[2]\n card4 = line2[0]\n card5 = line2[1]\n card6 = line2[2]\n idents1 = [card.ident for card in line1]\n idents2 = [card.ident for card in line2]\n intersection = list(set(idents1) & set(idents2))\n ...
[ "0.6848249", "0.64294106", "0.63830334", "0.6372023", "0.6302667", "0.6286635", "0.627175", "0.62661767", "0.62325734", "0.6230347", "0.61978024", "0.6182168", "0.6139048", "0.6096409", "0.60867286", "0.6068303", "0.60645324", "0.60228837", "0.60018134", "0.5998949", "0.59936...
0.7739377
0
Visualize the map environment and solved tower locations. env_state = 'solved', 'initial'
def visualize_environment(self,env_state): fig=plt.figure(figsize=self.figsize) ax=plt.subplot(111) #Plot the targets plt.plot([i[0] for i in self.coordinates__targets],\ [i[1] for i in self.coordinates__targets],\ marker='x',markersize=15,linestyle='Non...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def visualize_world(self, brain):\n state_str = ' || '.join([str(self.sensors),\n str(self.actions),\n str(self.reward),\n str(self.size),\n str(self.color),\n ...
[ "0.6409097", "0.6119604", "0.5912742", "0.586634", "0.58319414", "0.57472837", "0.5705525", "0.5673055", "0.5668513", "0.5658401", "0.56487894", "0.56268203", "0.5603009", "0.55793464", "0.55743", "0.55685604", "0.5551185", "0.5547571", "0.54791296", "0.547258", "0.54570925",...
0.8492099
0
The placement problem is a combinatorial optimization problem, so in general will be NP hard. But we can use convex relaxation to reformulate it as a convex optimization problem. Then we can use the Iterated Weighted L1 Heuristic to encourage sparse solutions and recover a viable solution to the placement problem.
def solve_environment(self): #The first problem formulation #K kinds of towers #See more details about problem formulation in the writeup #Get a full matrix of the concatenated coverage matrices for #each tower type. THis new matrix has dimensions:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solve(num_wizards, num_constraints, wizards, constraints): \n global wiz_const\n wiz_const = mapConstraints(wizards, constraints)\n partial_soltns = []\n\n # counter for priority queue since it doesn't allow \n # identical priorities\n k = 0\n\n # list of wizards sorted by lowest to highes...
[ "0.6252057", "0.6099802", "0.6056199", "0.5994748", "0.59845185", "0.59784395", "0.5769586", "0.574486", "0.5744253", "0.57309437", "0.5724893", "0.5709498", "0.5692334", "0.56834733", "0.56792754", "0.5677139", "0.5663982", "0.565795", "0.56319666", "0.56297445", "0.56293243...
0.58186674
6
Run the whole scenario. Initialize map, solve placement, visualize everything.
def run_scenario(self): self.initialize_random_map() self.visualize_environment('initial') self.get_tower_target_coverages() self.solve_environment() self.visualize_environment('solved')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n # Return needed Data Frames to analyze\n data_frame, seasons, col, labels, stats, kaggle = load_frames()\n\n # Create the maps now\n create_shot_maps(data_frame,seasons)\n create_scenario_map()\n \n # Create the Plots\n plot_season_graphs(stats)\n plot_pie_charts(kaggle)\n ...
[ "0.7093898", "0.6963387", "0.67339575", "0.6569679", "0.61990684", "0.61964035", "0.61749303", "0.6154679", "0.61539835", "0.6101129", "0.60104483", "0.5999573", "0.5993726", "0.5986674", "0.59698826", "0.5956886", "0.5940285", "0.5927748", "0.5921149", "0.5909592", "0.590016...
0.8375138
0
Converting from python list to c array
def c_array(ctype, values): arr = (ctype*len(values))() arr[:] = values return arr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _make_array(self, c):\n return (c * ctypes.py_object)()", "def _cast_strlist_to_C(py_strlist):\n c_strarr = (str_t * len(py_strlist))()\n c_strarr[:] = py_strlist\n return c_strarr", "def decode(lst, typecode ):\n a = array.array( typecode )\n for n,c in lst: \n a.extend( array...
[ "0.77845", "0.7144514", "0.6911046", "0.63947684", "0.63339645", "0.6281343", "0.62734985", "0.6220384", "0.620282", "0.61711013", "0.61647403", "0.61425847", "0.61346316", "0.6129619", "0.6120571", "0.61136305", "0.61050606", "0.60756564", "0.60618967", "0.6021413", "0.60184...
0.7057583
2
getting yolo results return dict
def get_detect_result(self): resultdict = {'class_index' : self.class_index, 'obj_name' : self.obj_name, 'score' : self.score, 'bounding_box' : { 'x_min' : self.x_min, 'y_min' : self.y_min, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yolo_show(image_path_list, batch_list):\n font = cv2.FONT_HERSHEY_SIMPLEX\n for img_path, batch in zip(image_path_list, batch_list):\n result_list = batch.tolist()\n img = cv2.imread(img_path)\n for result in result_list:\n cls = int(result[0])\n bbox = result[1...
[ "0.6200471", "0.61258125", "0.60596544", "0.60579133", "0.6020937", "0.58768976", "0.5827106", "0.58051485", "0.57187974", "0.5619059", "0.5576724", "0.54857856", "0.5460958", "0.54230195", "0.5414441", "0.5305155", "0.52727157", "0.52549005", "0.5240237", "0.5231136", "0.520...
0.5629328
9
converting from cv2 image class to yolo image class
def _convert_to_yolo_img(self, img): img = img / 255.0 h, w, c = img.shape img = img.transpose(2, 0, 1) outimg = make_image(w, h, c) img = img.reshape((w*h*c)) data = c_array(c_float, img) outimg.data = data rgbgr_image(outimg) return outimg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yolo_detection(raw_image):\n class_ids = []\n confidences = []\n boxes = []\n height , width ,c= raw_image.shape\n blob = cv2.dnn.blobFromImage(raw_image, 0.00392, (416,416), (0,0,0), True, crop=False)\n net.setInput(blob)\n outs = net.forward(output_layers)\n\n for out in outs:\n ...
[ "0.69979674", "0.6875691", "0.6409599", "0.6264038", "0.6263965", "0.62305474", "0.6210611", "0.61554116", "0.6152523", "0.61343765", "0.6091251", "0.60643476", "0.6000393", "0.59585893", "0.59381723", "0.59326524", "0.5932447", "0.591459", "0.58689374", "0.5849591", "0.58300...
0.73024845
0
Getting color based on yolo src
def _get_color(self, c, x, max_num): ratio = 5*(float(x)/max_num) i = int(math.floor(ratio)) j = int(math.ceil(ratio)) ratio -= i r = (1 - ratio) * self._colors[i][c] + ratio*self._colors[j][c] return int(255*r)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def colorsrc(self):\n return self['colorsrc']", "def get_color(im_obj):\n #im = Image.open(path, 'r')\n x, y = im_obj.size\n\n r, g, b = 0, 0, 0\n for i in xrange(x):\n for j in xrange(y):\n color_px = im_obj.getpixel((i, j))\n #print color_px\n r += col...
[ "0.6382341", "0.63190573", "0.628886", "0.6217046", "0.60708547", "0.605908", "0.6039326", "0.595254", "0.59011966", "0.58598113", "0.58473456", "0.5846212", "0.5841965", "0.5841965", "0.5841965", "0.5841965", "0.5837148", "0.582855", "0.5776561", "0.5775572", "0.57513714", ...
0.52407795
97
drawing result of yolo
def draw_detections(self, img, yolo_results): _, height, _ = img.shape for yolo_result in yolo_results: class_index = yolo_result.class_index obj_name = yolo_result.obj_name x = yolo_result.x_min y = yolo_result.y_min w = yolo_result.width ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw():", "def yolo_show(image_path_list, batch_list):\n font = cv2.FONT_HERSHEY_SIMPLEX\n for img_path, batch in zip(image_path_list, batch_list):\n result_list = batch.tolist()\n img = cv2.imread(img_path)\n for result in result_list:\n cls = int(result[0])\n ...
[ "0.6624572", "0.6562952", "0.6472424", "0.6423379", "0.6327614", "0.62627614", "0.60913956", "0.6042178", "0.5875701", "0.5875701", "0.5875701", "0.5875701", "0.5867414", "0.58438444", "0.584261", "0.5831161", "0.58155954", "0.5793131", "0.5755186", "0.56922597", "0.5644086",...
0.6384654
4
Predicting from cv2 format
def predict_from_cv2(yolo, inputfilepath): print("call func of predict_from_cv2") img = cv2.imread(inputfilepath) yolo_results = yolo.predict(img) for yolo_result in yolo_results: print(yolo_result.get_detect_result())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict(self, img_path):\n\n img = cv2.imread(img_path)\n img0 = img.copy()\n \n #This happens inside datasets\n # Convert\n img = letterbox(img, new_shape=self.img_size)[0]\n\n # Convert\n img = img[:, :, ::-1].transpose(2, 0, 1) # BGR to RGB, to 3x416x...
[ "0.769187", "0.7126001", "0.7057096", "0.7030363", "0.70179856", "0.7012954", "0.6988399", "0.696144", "0.696144", "0.6959898", "0.69489837", "0.6909902", "0.6900875", "0.68756694", "0.6821238", "0.6792172", "0.6742851", "0.67373735", "0.6706675", "0.668598", "0.6666994", "...
0.72321135
1
Predicting from PIL format
def predict_from_pil(yolo, inputfilepath): print("call func of predict_from_pil") img = np.array(Image.open(inputfilepath)) yolo_results = yolo.predict(img) for yolo_result in yolo_results: print(yolo_result.get_detect_result())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict_image(pic_style):\n classes = [\"BAROQUE\", \"EARLY-RENAISSANCE\", \"HIGH-RENAISSANCE\", \"IMPRESSIONISM\", \"MANNERISM\",\n \"MEDIEVAL\", \"MINIMALISM\", \"NEOCLASSICISM\", \"REALISM\", \"ROCOCO\",\n \"ROMANTICISM\", \"SURREALISM\"\n ]\n\n if pic_style....
[ "0.6664149", "0.6654456", "0.65723336", "0.6510777", "0.6439882", "0.6420322", "0.6417145", "0.6387115", "0.6382623", "0.63690084", "0.6353849", "0.6336394", "0.63333225", "0.63284427", "0.63270974", "0.6322199", "0.63044155", "0.6290391", "0.62887764", "0.6276978", "0.624016...
0.6737026
0
Fetch a single user's data if a user_id is specified. Otherwise fetch the list of all users. Returned info contains user_id, name, group name,email, admin status, and date_created.
def get(self, user_id): if user_id: return get_from_user_id(user_id) else: # No user_id given; this is a GET all users request. if not current_user.is_admin: error(403, "Logged in user not admin ") user_db_data = user_db_util.fetchall(g.da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def fetch_user(self, id: str):\n user = await self.http.get_user(id)\n return User(state=self.http, data=user)", "def get(self, id):\n\t\ttry:\n\t\t\tflask_app.logger.debug('We are getting the user: %d', id)\n\t\t\treturn user_service.get(id)\n\t\texcept AssertionError as e:\n\t\t\tuser_space...
[ "0.72157097", "0.7131999", "0.70872533", "0.7083722", "0.7074586", "0.7070638", "0.7040221", "0.70230114", "0.6946631", "0.69372654", "0.6927964", "0.6918322", "0.69075227", "0.68962216", "0.68914783", "0.688945", "0.6877585", "0.6864886", "0.6854097", "0.68460727", "0.681894...
0.7235378
0
Create a new user with provided email, password, and admin flag. If required fields are missing in the request, return 400 Password must be 8 or more characters long. Otherwise return 422 Email must not already be in use by an existing user. Otherwise return 422 If success, return 201 with the new user's email, admin f...
def post(self): data = request.get_json() if data is None: error(400, "No json data in request body") check_data_fields(data, ["email", "name", "group_name", "password", "admin"]) if len(data["password"]) < 8: error(422, "New password is less than 8 characters...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_user():\n record = request.get_json()\n if record is None:\n return {\"Error\": \"No data Supplied.\"}, 400\n\n schema = user_schema.load(record)\n\n if UserModel.objects(email=schema['email']):\n return {\"Error\": \"User Data already exists.\"}, 400\n user = UserModel(**s...
[ "0.7782959", "0.76835763", "0.7680565", "0.7676472", "0.76109964", "0.7539318", "0.753589", "0.75105494", "0.75042003", "0.74783903", "0.7470725", "0.7454548", "0.7424451", "0.7331659", "0.73239493", "0.7322408", "0.73050135", "0.72956514", "0.7292638", "0.7289475", "0.728914...
0.7710605
1
Creates a new Match object based on arbitrary arguments which constitute a match pattern. Each argument matches an element of the original event. Arguments are matched based
def __init__(self, *args): self.args = args self.matchers = [] for a in args: if a is _: a = lambda k: True elif isinstance(a, basestring): a = a.__eq__ elif isinstance(a, (list, tuple, set)): a = (lambda ary: (l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_re_match(cls, match):\n kwargs = match.groupdict()\n player_location = kwargs['player_location'].split()\n kwargs['player_location'] = (int(player_location[0]),\n int(player_location[1]),\n int(player_location[2])...
[ "0.63041854", "0.62884766", "0.60881954", "0.5861523", "0.58473384", "0.555869", "0.55210406", "0.5483552", "0.54075843", "0.5347497", "0.52940315", "0.5262951", "0.5244793", "0.5229378", "0.5206262", "0.51890385", "0.51735175", "0.51612294", "0.5146798", "0.5131269", "0.5126...
0.58726645
3
Returns true if this object matches an arbitrary string when split on ascii spaces.
def match(self, string): ary = string.split(' ', len(self.matchers)) if all(m(a) for m, a in zip(self.matchers, ary)): return ary
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_string(self, s):\n\n data = s.split(' ')\n\n origin = ' '.join(data[0:-1])\n if not origin:\n return False\n \n origin_hashed = self.hash_with_salt(origin)\n\n return origin_hashed == s", "def isspace(self) -> bool:\n pass", "def has_whitespa...
[ "0.6801843", "0.67221856", "0.66555274", "0.6536783", "0.63486564", "0.63276196", "0.63195336", "0.629289", "0.62802047", "0.62746346", "0.6175623", "0.6119683", "0.61172634", "0.6080486", "0.6064205", "0.60596126", "0.6014171", "0.6013115", "0.5970804", "0.59225404", "0.5912...
0.60266405
16
Given an iterator which returns (key, value) pairs, returns a new iterator of (k, value) pairs such that every list or tuplevalued key in the original sequence yields an individual pair.
def flatten(items): for k, v in items: if isinstance(k, (list, tuple)): for key in k: yield key, v else: yield k, v
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iter_pairs(iterable):\n if isinstance(iterable, Mapping):\n iterable = iterable.items()\n return iter(iterable)", "def pairs(iterable):\n previous = None\n for item in iterable:\n current = item\n if previous is not None:\n yield previous, current\n previous...
[ "0.691934", "0.64335775", "0.6234379", "0.62247425", "0.6090052", "0.6072828", "0.6056752", "0.6033201", "0.60265905", "0.59873533", "0.59600586", "0.5856685", "0.58540154", "0.5830519", "0.58234537", "0.57890534", "0.5769367", "0.57635", "0.57286495", "0.5683447", "0.5672941...
0.513164
94
Initializes the event handler
def __init__(self): self.events = {} self.eventmatchers = {} self.alive = True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, handler):\n\n self.event_handler = handler", "def _handler_init(self):\r\n\t\tself._handlers[\"player-join\"] = FunctionDelegate()\r\n\t\tself._handlers[\"player-quit\"] = FunctionDelegate()\r\n\t\tself._handlers[\"game-start\"] = FunctionDelegate()\r\n\t\tself._handlers[\"game-stop\"] ...
[ "0.79752", "0.75133544", "0.71794784", "0.7137807", "0.7092915", "0.70223916", "0.7013044", "0.6823782", "0.6721383", "0.6712158", "0.67117155", "0.67050976", "0.67050976", "0.67050976", "0.67050976", "0.6701303", "0.6639678", "0.6624493", "0.6624023", "0.6623807", "0.6576109...
0.6113804
56
Distatches an event to any matching event handlers. The handler which specifically matches the event name will be called first, followed by any handlers with a 'match' method which matches the event name concatenated to the args string.
def dispatch(self, event, args=''): try: if event in self.events: self.events[event](args) for matcher, action in self.eventmatchers.iteritems(): ary = matcher.match(' '.join((event, args))) if ary is not None: action(*a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_handlers(self, event, method=EVENT_CAPTURE):\n if event not in self.events:\n return None\n for handler in self.events[str(event)].with_method(method):\n handler(event)", "def onEvent(self, event):\n if event is None:\n return\n\n target_class ...
[ "0.6142079", "0.6090708", "0.58892405", "0.57285976", "0.56782824", "0.56358707", "0.56105155", "0.5587811", "0.5533092", "0.55268854", "0.54496866", "0.541662", "0.5377691", "0.53475493", "0.53425974", "0.5300932", "0.52983147", "0.5238735", "0.5219943", "0.52198094", "0.515...
0.73175037
0
Enters the event loop, reading lines from wmii's '/event' and dispatching them, via dispatch, to event handlers. Continues so long as alive is True.
def loop(self): keys.mode = 'main' for line in client.readlines('/event'): if not self.alive: break self.dispatch(*line.split(' ', 1)) self.alive = False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run():\n\n while True:\n\n # get event, blah\n event_name, event_data = revent.get_event(block=True, timeout=5)\n\n if event_name is not None:\n print 'received: %s' % event_name\n\n if event_name.endswith('_oembed_details'):\n handle_new_oembed_deta...
[ "0.6532273", "0.64159447", "0.61325336", "0.6103995", "0.6085888", "0.60446244", "0.60411006", "0.600487", "0.59969455", "0.5978081", "0.5910201", "0.5910201", "0.59055114", "0.5898839", "0.5848962", "0.5841019", "0.5816226", "0.5811897", "0.580067", "0.5787875", "0.57788646"...
0.7531345
0
Binds a number of event handlers for wmii events. Keyword arguments other than 'items' are added to the 'items' dict. Handlers are called by loop when a matching line is read from '/event'. Each handler is called with, as its sole argument, the string read from /event with its first token stripped.
def bind(self, items={}, **kwargs): kwargs.update(items) for k, v in flatten(kwargs.iteritems()): if hasattr(k, 'match'): self.eventmatchers[k] = v else: self.events[k] = v
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _register_handlers(self):\n self.jm.register_handler(\"move_node\", self.move_node)\n self.jm.register_handler(\"copy_node\", self.copy_node)\n self.jm.register_handler(\"push_to_vospace\", self.push_to_vospace)\n self.jm.register_handler(\"push_from_vospace\", self.push_from_vospace)\n self.jm....
[ "0.55518967", "0.5541481", "0.55277866", "0.5482645", "0.54119766", "0.538342", "0.5349072", "0.5295835", "0.5283326", "0.5205757", "0.51651305", "0.5116842", "0.5108721", "0.5076696", "0.5072107", "0.5070965", "0.5070048", "0.5055877", "0.5042442", "0.5040995", "0.50364155",...
0.66373867
0
A decorator which binds its wrapped function, as via bind, for the event which matches its name.
def event(self, fn): self.bind({fn.__name__: fn})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def binds(**binds):\n def decorate(func):\n function = to_function(func)\n setattr(function, BINDS, binds)\n return function\n return decorate", "def bindEvent(obj, name, method):\n setattr(obj, name,\n types.MethodType(method, obj, obj.__class__))", "def _event_bridge(...
[ "0.66477215", "0.66141915", "0.6544321", "0.64554435", "0.643344", "0.6340396", "0.6323057", "0.6308433", "0.61923933", "0.6147095", "0.6073753", "0.601856", "0.60135686", "0.59841114", "0.5885072", "0.58757806", "0.5850867", "0.577973", "0.577973", "0.577973", "0.577973", ...
0.6808041
0
Initializes the class and binds an event handler for the Key event, as via pygmi.event.events.bind. Takes no arguments.
def __init__(self): self.modes = {} self.modelist = [] self.mode = 'main' self.defs = {} events.bind(Key=self.dispatch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.key_handler = None", "def __init__(self, graphics_controller):\n super(KeyHandler, self).__init__()\n self._key_handler = window.key.KeyStateHandler()\n self._key_release_mappings = {}\n self._key_press_mappings = {}\n self._key_down_mappings =...
[ "0.7799291", "0.76643276", "0.7037556", "0.6991816", "0.6635645", "0.64325315", "0.641163", "0.63868123", "0.63638663", "0.6272472", "0.6267949", "0.6232856", "0.6226452", "0.6212436", "0.6197106", "0.6122265", "0.6109509", "0.60778034", "0.6074329", "0.6068947", "0.6043387",...
0.5398831
98
Binds a series of keys for the given 'mode'. Keys may be specified as a dict or as a sequence of tuple values and strings. In the latter case, documentation may be interspersed with key bindings. Any value in the sequence which is not a tuple begins a new key group, with that value as a description. A tuple with two va...
def bind(self, mode='main', keys=(), import_={}): self._add_mode(mode) mode = self.modes[mode] group = None def add_desc(key, desc): if group not in mode['desc']: mode['desc'][group] = [] mode['groups'].append(group) if key not in m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bind_modifiers(widget, event:Callable, button='Button-1',\n modes=frozendict({'Shift': KeyModes.SHIFT, 'Control': KeyModes.CONTROL, 'Alt': KeyModes.ALT, })):\n widget.bind(button, event)\n for modifier, keymode in modes.items():\n # We must provide 'keymode' as a default argument...
[ "0.58895165", "0.58841205", "0.5588694", "0.52264315", "0.48822513", "0.4842393", "0.48337808", "0.48153064", "0.4735098", "0.4661002", "0.45969185", "0.45763007", "0.45294526", "0.4502729", "0.45009285", "0.4483334", "0.44517758", "0.44213554", "0.44187143", "0.4397471", "0....
0.7402634
0
Dispatches a key event for the current mode.
def dispatch(self, key): mode = self.modes[self.mode] if key in self._keys: return self._keys[key](key)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def key_event(self, key: Any, action: Any):\n pass", "def on_key_event(self, key):\n pass", "def keyevent(self, keyname):\n self.adb.key_events(keyname)", "def _on_key_press(self, event):", "def key_press_event(self, event):\n pass", "def keyevent(self, keycode: Union[str, int...
[ "0.7376395", "0.7147326", "0.70135456", "0.69450104", "0.6931355", "0.67966765", "0.67913014", "0.674432", "0.67261076", "0.670082", "0.66877836", "0.6589483", "0.6579696", "0.65288365", "0.63956237", "0.63932157", "0.6381464", "0.63638973", "0.6341006", "0.63334644", "0.6283...
0.63129103
20
Calls a method named for the first token of 'args', with the rest of the string as its first argument. If the method doesn't exist, a trailing underscore is appended.
def _call(self, args): a = args.split(' ', 1) if a: getattr(self, a[0])(*a[1:])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _func_named(self, arg):\n result = None\n target = 'do_' + arg\n if target in dir(self):\n result = target\n else:\n if self.abbrev: # accept shortened versions of commands\n funcs = [func for func in self.keywords if func.startswith(arg) and fu...
[ "0.61590546", "0.61256295", "0.60179985", "0.5816926", "0.5688947", "0.5648416", "0.5534845", "0.5470439", "0.53763974", "0.53491557", "0.5341609", "0.5332069", "0.5326649", "0.53201157", "0.53159", "0.5265616", "0.52220535", "0.5211293", "0.5182447", "0.5174981", "0.5169188"...
0.75629675
0
Be sure to set_api_access_keys() before instantiating.
def __init__(self): super().__init__() self._api_url = API_BASE_URL self._api_params = API_BASE_PARAMS.copy()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.api = Api(consumer_key=credentials[\"consumer_key\"],\n consumer_secret=credentials[\"consumer_secret\"],\n access_token_key=credentials[\"access_token_key\"],\n access_token_secret=credentials[\"access_token_secret...
[ "0.77924526", "0.7500983", "0.7340485", "0.73025846", "0.72502905", "0.71982646", "0.7098907", "0.7096858", "0.70858496", "0.70240563", "0.7018257", "0.69951254", "0.69625777", "0.6959681", "0.6918534", "0.6896694", "0.68868685", "0.6880991", "0.6843295", "0.68017286", "0.678...
0.6549042
30
Set the access key as key=your_googlemaps_key. This must be called prior to contacting the API.
def set_api_access_keys(**kwargs): API_BASE_PARAMS['key'] = kwargs['key']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetAPIKey(self, api_key):\n self._api_key = api_key", "def SetAPIKey(self, api_key):\n self._api_key = api_key", "def SetAPIKey(self, api_key):\n self._analyzer.SetAPIKey(api_key)", "def update_key(self, key):\n self._api_key = key", "def api_key(self, api_key):\n\n self._api_key...
[ "0.6702951", "0.6702951", "0.64656013", "0.63789594", "0.63458663", "0.63154477", "0.62301403", "0.62292933", "0.62059003", "0.61881185", "0.60916674", "0.60765517", "0.5990251", "0.5933332", "0.58120465", "0.5781521", "0.57431203", "0.57308316", "0.5702196", "0.56874853", "0...
0.6750033
0
API endpoint for this authority.
def api_url(self): return self._api_url
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authorization_url(self): # pragma: no cover\n raise NotImplementedError()", "def GET(self, uri):\n content_type = negotiated_content_type(self.supported_types, self.default_content_type)\n def body(conn, cur):\n self.enforce_right('enumerate', uri)\n return web.ctx...
[ "0.62671196", "0.6057594", "0.60088485", "0.59507054", "0.5881676", "0.58631366", "0.58126146", "0.5806165", "0.5777628", "0.57215625", "0.57129526", "0.5697795", "0.56665105", "0.56434846", "0.56295764", "0.561666", "0.5612907", "0.5591394", "0.5573596", "0.5548972", "0.5542...
0.0
-1
GET params for querying this authority.
def api_params(self): return self._api_params
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query_params(self):\n return self.request._request.GET", "def query_params(self):\n path = self._get_id_path('query_params')\n \n response = self._GET(path)\n self._set_attrs_to_values({'query_params': response})\n return response", "def get_query_parameters(self):...
[ "0.75401735", "0.73343045", "0.66216785", "0.64343256", "0.6397734", "0.6369969", "0.636452", "0.62071246", "0.6189369", "0.6189369", "0.6173704", "0.61640465", "0.6163428", "0.6163428", "0.6163428", "0.6111815", "0.6105756", "0.6103935", "0.6103162", "0.61027837", "0.6080298...
0.6037017
25
Prepare params for request processing.
def prep_latlng_params(self, lat, lng): self._api_params['latlng'] = '{},{}'.format(lat, lng)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _prepare_param_dict(self, params_dict):\n return params_dict", "def prepare_request_params(\n request_params: Dict, model_id: Text, model_data: Dict\n) -> Dict:\n request_params = correct_types(request_params, model_data[\"columns_data\"])\n if model_data[\"hashed_indexes\"]:\n request...
[ "0.7291471", "0.7015459", "0.68069166", "0.6802409", "0.6752121", "0.67507726", "0.6709695", "0.66218567", "0.6613305", "0.65984374", "0.6551313", "0.6478149", "0.64343166", "0.6366063", "0.6338962", "0.63367856", "0.6329537", "0.62906367", "0.62503916", "0.61877495", "0.6136...
0.57774526
62
Process response from authority API and return a list of humanreadable addresses for any matches. Raise GeoAuthorityError with an appropriate message otherwise.
def parse_location_response(self, location_json): street_addresses = [] try: if location_json['status'] == 'ZERO_RESULTS': return [] elif location_json['status'] != 'OK': self.logger.error("Unexpected response status: %s", location_json['status']) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addresses(self):\n if 'Ward Matters' in self.topics or 'City Matters' in self.topics:\n stname_pattern = \"(\\S*[a-z]\\S*\\s){1,4}?\"\n sttype_pattern = \"(ave|blvd|cres|ct|dr|hwy|ln|pkwy|pl|plz|rd|row|sq|st|ter|way)\"\n st_pattern = stname_pattern + sttype_pattern\n\n ...
[ "0.5419127", "0.52974874", "0.5250207", "0.5239093", "0.520853", "0.5162842", "0.51276225", "0.5108789", "0.5096379", "0.50797266", "0.5039929", "0.50187445", "0.5002884", "0.49940777", "0.4963809", "0.49536124", "0.4948754", "0.4948175", "0.49268144", "0.49164474", "0.491495...
0.6365182
0
Create a standard user from API data.
def test_ParseAlice(self): user = User.parse_raw(ALICE) # self.assertEqual(type(user), Person) self.assertEqual(user.name, "Alice")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(self, data):\n # ensure 'create()' calls the specific 'create_user()' method\n # note that the 'data' gets validated\n user = get_user_model().objects.create_user(**data)\n return user", "def build_user(data: Dict[Any, Any]) -> User:\n return User(**data)", "def new_us...
[ "0.7272184", "0.7248692", "0.7137372", "0.71049374", "0.70871747", "0.70839095", "0.7054846", "0.70189977", "0.69869274", "0.698114", "0.6975453", "0.6963538", "0.6960373", "0.69428647", "0.6922325", "0.6921075", "0.69137937", "0.6906702", "0.69002455", "0.6899626", "0.687958...
0.0
-1
Create a bot user from API data.
def test_ParseBob(self): user = User.parse_raw(BOB) # self.assertEqual(type(user), Bot) self.assertEqual(user.name, "Bob") self.assertIsNone(user.avatar_url)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(self, data):\n data.pop('password_confirmation')\n try:\n availability = data.pop(\"availability\")\n babysitter = data.pop(\"user_bbs\")\n user = User.objects.create_user(**data, is_verified=False)\n if babysitter:\n bbs = Babysit...
[ "0.69522387", "0.6850721", "0.68193614", "0.67524874", "0.67413753", "0.67329466", "0.6725897", "0.6702241", "0.66996366", "0.66741824", "0.6669265", "0.6663651", "0.665581", "0.66362035", "0.6635299", "0.6624163", "0.66120404", "0.6574128", "0.6566255", "0.6560375", "0.65508...
0.0
-1
Save filtered sequences according the config file.
def initFilters(CONFIG): #### String containing all the preLibraries file name preLibraries = findFile("classification_result/prelibraries/TE", "*.fasta") #### String containing all the preLibraries file name noCatLibrarie = findFile("classification_result/prelibraries/", "noCat.fasta") listPrelibraries = [] ##...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def autoSaveFilter(filename):", "def save_seqs_to_file(self):\n if self.blast_type == 'local':\n self.seq_file = os.path.join(self.cwd,\n 'db',\n \"{0}_seqs.fas\".format(self.gene_code))\n queryset = Sequ...
[ "0.64152855", "0.6286579", "0.5894759", "0.56407", "0.5635714", "0.55958396", "0.5578768", "0.55047834", "0.5474374", "0.54623854", "0.5290035", "0.5289094", "0.5287275", "0.5285117", "0.5277353", "0.5270988", "0.5270139", "0.524332", "0.5242166", "0.5229969", "0.5229448", ...
0.0
-1
Find files according a patern. Return a list with the absolute path of all the files name matching with the pattern.
def findFile(PATH, PATTERN): #### find all the file located in the PATH corresponding to the PATTERN findPattern = subprocess.Popen('find {path} -name "{pattern}" 2> /dev/null'.format(path=PATH, pattern=PATTERN), shell=True, stdout=subprocess.PIPE); #### String containing all the path toward the file's name matching...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _recursive_file_search(self, path, pattern):\n matches = []\n for root, dirnames, filenames in os.walk(path):\n for filename in fnmatch.filter(filenames, pattern):\n matches.append(os.path.join(root, filename))\n\n return matches", "def filesInDir(self, path=Non...
[ "0.8233165", "0.81035763", "0.8085928", "0.7977863", "0.7956181", "0.7890348", "0.78722256", "0.7811613", "0.7773806", "0.77685827", "0.776343", "0.77626514", "0.77465606", "0.7745978", "0.7734364", "0.7721344", "0.7684481", "0.76727057", "0.76706004", "0.7608046", "0.7600679...
0.6989657
75
Creates the three final Libraries.
def createIntermediateLibraries(LISTPRELIBRARIES, DICOLIBRARIES, CONFIG, DICOFINALCLASSIF): #### Parse all the intermediate libraries files for preLibrary in LISTPRELIBRARIES: #### Retrieve the final classification name of the ET from the file name finalClassification = os.path.basename(preLibrary).split(".fasta"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createFinalLibraries(INTERMEDIATELIBRARIES, DICOLIBRARIES):\n\t#### Parse all the intermediate libraries files\n\tfor file in INTERMEDIATELIBRARIES:\n\t\tfileName = os.path.basename(file).split(\".fasta\")[0]\n\t\t#### Read and store the fasta sequences of the prelibraries\n\t\tsequences=readInput.readFasta(fi...
[ "0.7787591", "0.61216825", "0.59788126", "0.5914733", "0.5853105", "0.5761492", "0.5729343", "0.57070595", "0.5634071", "0.5578847", "0.5557914", "0.55127", "0.5486333", "0.5457092", "0.5417137", "0.54008245", "0.5397091", "0.53696746", "0.53682125", "0.5365185", "0.53581166"...
0.6650628
1
Apply filters from the CONFIG file to creates the final libraries.
def applyFiltersForIntermediate(ID, SEQUENCES, FINALCLASSIFICATION, CONFIG, DICOLIBRARIES): #### First we check if tools used to detect the TE are from the removedTool or the onlySelectedtools of the CONFIG file #### Parse the dictionnary containing CONFIG information for sortedOutput in CONFIG: #### Look for te f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initFilters(CONFIG):\n\t#### String containing all the preLibraries file name\n\tpreLibraries = findFile(\"classification_result/prelibraries/TE\", \"*.fasta\")\n\n\t#### String containing all the preLibraries file name\n\tnoCatLibrarie = findFile(\"classification_result/prelibraries/\", \"noCat.fasta\")\n\n\t...
[ "0.7448421", "0.6242831", "0.61883074", "0.59563917", "0.59024584", "0.586367", "0.5610522", "0.55952257", "0.55162007", "0.55046", "0.5463773", "0.54559755", "0.5417708", "0.5369826", "0.535978", "0.5357048", "0.5344488", "0.53367615", "0.5319207", "0.5308367", "0.53061336",...
0.5215383
32
Apply the cdhitest on all the intermediate Libraries.
def applyCDHIT(INTERMEDIATELIBRARIES): #### Apply cd-hit-est for all the intermediate library for file in INTERMEDIATELIBRARIES: fileName = os.path.basename(file).split(".fasta")[0] os.chdir("classification_result/intermediateLibraries/") subprocess.call('cdhit-est -aS 0.9 -c 0.9 -g 1 -r 1 -i {input}.fasta -o {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_c_extensions_import():\n import storm_analysis.dbscan.dbscan_c\n \n import storm_analysis.fista.fista_fft_c\n \n import storm_analysis.frc.frc_c\n \n import storm_analysis.L1H.homotopy_imagea_c\n\n import storm_analysis.rolling_ball_bgr.rolling_ball_lib_c\n\n import stor...
[ "0.5385712", "0.53443336", "0.51123476", "0.51066065", "0.5053206", "0.504615", "0.5035862", "0.50291365", "0.50230294", "0.50175893", "0.4983539", "0.49827704", "0.4977544", "0.49708322", "0.49618056", "0.49440145", "0.4931897", "0.49209505", "0.49121943", "0.48950914", "0.4...
0.72149426
0
Add the id of the sequences onto the DICOLIBRARIES in order to know for which library a sequence will be saved.
def retriveFinalLibrarieSequences(INTERMEDIATELIBRARIES, CONFIG, DICOFINALCLASSIF, DICOLIBRARIES): for file in INTERMEDIATELIBRARIES: fileName = os.path.basename(file).split(".fasta")[0] #### Read and store the fasta sequences of the prelibraries sequences=readInput.readFasta(file) for id in sequences: if f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_libraries(self, a, lib):\n logging.debug(\"in save libraries\")\n self.libraries.append(lib)\n self.produce(\"library\", lib)", "def unify_ids(pdbmodels, verbose=False):\n seq_dict = dict() # Dictionary where sequences are keys and ids are values\n if verbose:\n print(...
[ "0.5920078", "0.55056554", "0.5498205", "0.54516554", "0.54133874", "0.53987515", "0.5365269", "0.53635937", "0.535374", "0.53380966", "0.53376156", "0.5309192", "0.5291356", "0.52258646", "0.52134526", "0.51988417", "0.51759744", "0.5173731", "0.5173344", "0.51603353", "0.51...
0.48564407
51
Apply filters from the CONFIG file to creates the final libraries.
def applyFiltersForFinales(ID, SEQUENCES, FINALCLASSIFICATION, CONFIG, SORTEDOUTPUT, DICOLIBRARIES): #### First we check if tools used to detect the TE are from the removedTool or the onlySelectedtools of the CONFIG file #### Look for te finalClassification corresponding to the sequence if CONFIG[SORTEDOUTPUT]["fina...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initFilters(CONFIG):\n\t#### String containing all the preLibraries file name\n\tpreLibraries = findFile(\"classification_result/prelibraries/TE\", \"*.fasta\")\n\n\t#### String containing all the preLibraries file name\n\tnoCatLibrarie = findFile(\"classification_result/prelibraries/\", \"noCat.fasta\")\n\n\t...
[ "0.7449922", "0.62407774", "0.61889404", "0.59549785", "0.59027463", "0.58631474", "0.5609206", "0.5593095", "0.55149376", "0.55030483", "0.5462658", "0.5454153", "0.5419757", "0.5368659", "0.53600055", "0.5356726", "0.5343718", "0.5336285", "0.5318649", "0.5306495", "0.53061...
0.0
-1
Creates the three final Libraries.
def createFinalLibraries(INTERMEDIATELIBRARIES, DICOLIBRARIES): #### Parse all the intermediate libraries files for file in INTERMEDIATELIBRARIES: fileName = os.path.basename(file).split(".fasta")[0] #### Read and store the fasta sequences of the prelibraries sequences=readInput.readFasta(file) #### Save the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createIntermediateLibraries(LISTPRELIBRARIES, DICOLIBRARIES, CONFIG, DICOFINALCLASSIF):\n\t#### Parse all the intermediate libraries files\n\tfor preLibrary in LISTPRELIBRARIES:\n\t\t#### Retrieve the final classification name of the ET from the file name\n\t\tfinalClassification = os.path.basename(preLibrary)...
[ "0.6650628", "0.61216825", "0.59788126", "0.5914733", "0.5853105", "0.5761492", "0.5729343", "0.57070595", "0.5634071", "0.5578847", "0.5557914", "0.55127", "0.5486333", "0.5457092", "0.5417137", "0.54008245", "0.5397091", "0.53696746", "0.53682125", "0.5365185", "0.53581166"...
0.7787591
0
A new hash string should be 152 bytes long
def test_new(self): self.assertEqual(len(p.new('foo')), 168)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_hash(self, long_url: str, hash_length: int):\n hasher = hashlib.md5(long_url.encode())\n bytes_hash = base64.urlsafe_b64encode(hasher.digest())[:hash_length]\n str_hash = bytes_hash.decode()\n return str_hash", "def hash(plainString):\n result = plainString\n for i in r...
[ "0.740472", "0.7184337", "0.71324676", "0.70474213", "0.703812", "0.70344573", "0.6992879", "0.6978821", "0.69644725", "0.6943878", "0.6927374", "0.6871", "0.6799098", "0.67813987", "0.672294", "0.67222166", "0.6721005", "0.6701401", "0.669934", "0.669934", "0.6693836", "0....
0.0
-1
Gets sys.argv and expecting a = format. Prints usage on error or request.
def parse_args(default=defaults,extra_usage='',required=['root']): vars = default if len(sys.argv)<2: usage("Error: You must at least pass the following arguments!\n%s\n%s"%(str(required),extra_usage)) #Some things someone may type to get help if sys.argv[1] in ['-h','--help','hel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_usage(arg_processor):\n min_width = max(map(lambda x : len(x),\\\n arg_processor.program_arg_order + arg_processor.program_flag_order))\n print \"Usage: python {} \".format(sys.argv[0])\n print \"The following flags and arguments can be supplied:\"\n print \"Flags:\"\n for flag in a...
[ "0.6791781", "0.6728012", "0.6684721", "0.66259867", "0.65740335", "0.65634924", "0.651287", "0.6476925", "0.64419854", "0.6423106", "0.64119226", "0.6408889", "0.6356593", "0.6337435", "0.6331671", "0.63285047", "0.6319351", "0.6319351", "0.63117146", "0.62988", "0.62978756"...
0.0
-1
Return df with all enteries which df.query(pattern) match with removed
def remove(df, pattern): return df[~df.index.isin(df.query(pattern).index)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prune(df, regex_list):\n for regex_pattern in regex_list:\n df = df[~df.case_action.str.contains(regex_pattern)]\n return df", "def clean(df):", "def filter_same_helix(df):\n helixpattern = re.compile(r\"\"\"^(..)\\w+\\s+\\1\"\"\")#For detecting same-helix contacts, the ones like 1.22x22 1....
[ "0.67580104", "0.61284876", "0.59954125", "0.5946802", "0.5877959", "0.5857522", "0.5824286", "0.57481945", "0.57481945", "0.5692505", "0.56695396", "0.5544663", "0.55146563", "0.5502974", "0.54838765", "0.54560864", "0.54314256", "0.5424039", "0.5391558", "0.53590816", "0.53...
0.7941567
0
get data for just one gene (assay) to closer inspect data
def get_detailed_ddct_data(self, assay): df = self.ddct.query("Assay == '{}'".format(assay)).reset_index(drop=True) return pandas.pivot_table(df, values=0, columns='time', index=['cell_line', 'treatment', 'replicate'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gene(self, idx):\r\n return self.genes[idx]", "async def test_get_gene_from_ac(test_db):\n resp = await test_db.get_gene_from_ac(\"NC_000007.13\", 140453136, None)\n assert resp == [\"BRAF\"]\n\n resp = await test_db.get_gene_from_ac(\"NC_000007.14\", 140753336, None)\n assert resp == [\"B...
[ "0.6190661", "0.60675555", "0.60619366", "0.58405983", "0.5830618", "0.5788245", "0.5680454", "0.568016", "0.56783557", "0.56729907", "0.56712174", "0.5638997", "0.56313276", "0.5628834", "0.5569161", "0.5562359", "0.5537546", "0.55343705", "0.55274814", "0.55243385", "0.5518...
0.0
-1
Get fold change averaged data for gene. This is useful as it formats data for input into copasi
def get_data_copasi_style_d3ct(self, gene, cell_line='A', plot=False, new_name=None, filename=None, indep_dct=None): if gene not in self.genes: raise ValueError('{} is not in list of genes "{}"'.format(gene, self.genes)) df = self.d3ct.query('cell_line == "{}" and Assay == "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_average(self):\n return _favg(self.load_samples)", "def get_mean(self):\n mean = np.array(np.zeros((4,8)))\n for i,c in enumerate(self.cellLines):\n for j,l in enumerate(self.ligands):\n mean[i][j] = self.aucs[c][l]['mean']\n return mean", "def mea...
[ "0.56925446", "0.5640803", "0.54428434", "0.5386881", "0.53427356", "0.5342548", "0.5336942", "0.53117526", "0.528858", "0.5283458", "0.5280344", "0.5261843", "0.52486813", "0.5230886", "0.5226844", "0.52136445", "0.51920736", "0.51852506", "0.5177504", "0.51448035", "0.51356...
0.52104104
16
Get fold change averaged data for gene. This is useful as it formats data for input into copasi
def get_data_copasi_style_dct(self, gene, cell_line='A', plot=False, new_name=None, filename=None, indep_dct=None): if gene not in self.genes: raise ValueError('{} is not in list of genes "{}"'.format(gene, self.genes)) treat = self.treatment_data.query('ce...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_average(self):\n return _favg(self.load_samples)", "def get_mean(self):\n mean = np.array(np.zeros((4,8)))\n for i,c in enumerate(self.cellLines):\n for j,l in enumerate(self.ligands):\n mean[i][j] = self.aucs[c][l]['mean']\n return mean", "def mea...
[ "0.5692266", "0.5642145", "0.5442966", "0.5387502", "0.53431314", "0.5342711", "0.5338354", "0.53111", "0.5289658", "0.5284847", "0.52795583", "0.5262822", "0.5248242", "0.52306324", "0.5225943", "0.52127075", "0.52108794", "0.519317", "0.51858854", "0.5179068", "0.51451385",...
0.0
-1
Split design by subexperiment (1, 2, 3) and create SubExperiment objects
def create_subexperiments(self): subexperiments = {} for label, df in self.design.groupby(level=0): subexperiments[label] = SubExperiment(label, df.loc[label], self.root) return subexperiments
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_expand_experiments():\n template_script = get_template_script()\n experiment_systems = utils.CombinatorialLeaf(['explicit-system', 'implicit-system', 'hydration-system'])\n template_script['experiments']['system'] = experiment_systems\n\n exp_builder = ExperimentBuilder(script=template_script,...
[ "0.573789", "0.57144195", "0.56194884", "0.5434938", "0.5363377", "0.53393525", "0.529092", "0.5277947", "0.5253223", "0.5229658", "0.5225851", "0.5225829", "0.5144398", "0.51441", "0.5116659", "0.5102679", "0.5095015", "0.5081049", "0.5081003", "0.50729406", "0.5070303", "...
0.7028728
0
For the time being this is TGF/baseline and control/baseline The choice of 0 or 96 will make a difference
def calculate_ddct(self, baseline_time=0): if baseline_time == 0: baseline = self.baseline_data['dct'][0] elif baseline_time == 96: baseline = self.baseline_data['dct'][96] elif baseline_time == 'average': baseline = (self.baseline_data['dct'][0] + self.bas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getBaselineThresh(self):\n print('Calculating 10% baseline')\n self.baseline = obrienBaseline.obrienBaseline(\n self.d['dos1rate'], timeWidth=5.0, \n cadence=0.1)\n self.peak_std = ( (self.d['dos1rate'][self.peakInd]/10 - \n ...
[ "0.6402152", "0.63455784", "0.6005763", "0.6003944", "0.5723235", "0.5581667", "0.5507382", "0.5504862", "0.5464299", "0.546274", "0.5449123", "0.53767866", "0.5366525", "0.53509873", "0.5350085", "0.53294504", "0.5323279", "0.53189623", "0.5305675", "0.5283922", "0.5271367",...
0.50264245
61
calculate time course ddct divided by treated ddct
def calculate_d3ct(self): data = deepcopy(self.ddct) data = data.set_index(['cell_line', 'replicate', 'Assay', 'time', 'treatment']) control = data.query('treatment == "Control"')#.reset_index(drop=True) tgfb = data.query('treatment == "TGFb"')#.reset_index(drop=True) control.ind...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_ddct(self, baseline_time=0):\n\n if baseline_time == 0:\n baseline = self.baseline_data['dct'][0]\n\n elif baseline_time == 96:\n baseline = self.baseline_data['dct'][96]\n\n elif baseline_time == 'average':\n baseline = (self.baseline_data['dct']...
[ "0.59847087", "0.58669096", "0.57550395", "0.57550395", "0.5598215", "0.5565188", "0.5560319", "0.5546098", "0.55023235", "0.5496921", "0.5495189", "0.5454725", "0.5453212", "0.53904337", "0.53737885", "0.5367238", "0.5349814", "0.53281", "0.53280526", "0.5322929", "0.5310778...
0.5310874
20
calculate time course ddct divided by treated ddct
def calculate_d4ct(self, pairs_dct=None): #a, b, c, d, e, f, g, h, i if pairs_dct is None: pairs_dct={ 'D': 'A', 'G': 'A', 'E': 'B', 'H': 'B', 'F': 'C', 'I': 'C', } data = deep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_ddct(self, baseline_time=0):\n\n if baseline_time == 0:\n baseline = self.baseline_data['dct'][0]\n\n elif baseline_time == 96:\n baseline = self.baseline_data['dct'][96]\n\n elif baseline_time == 'average':\n baseline = (self.baseline_data['dct']...
[ "0.59870166", "0.58656496", "0.57553", "0.57553", "0.55991685", "0.5563111", "0.5560583", "0.5544466", "0.55035794", "0.54969424", "0.54954", "0.54544187", "0.54526633", "0.5389543", "0.5374481", "0.53677905", "0.535153", "0.5330187", "0.53280985", "0.5323999", "0.53121424", ...
0.0
-1
get all the data, design plus raw plus normalized for subexperiment
def data(self): return pandas.concat([i.data for i in list(self.plates.values())])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def datasets(self):\n pass", "def getData(trainSize):\r\n return splitData([getReal(), getFake()], trainSize=trainSize)", "def get_raw(data_folder, dataset_id, subject, stim_type=\"distress\"):\r\n\r\n if dataset_id in [\"raw_clean_32\"]: #two conditions experiments\r\n raw_0, raw_1, events...
[ "0.62828743", "0.626822", "0.6251617", "0.62077177", "0.6118616", "0.608259", "0.60632056", "0.6046632", "0.6015187", "0.6005819", "0.6002392", "0.5981022", "0.5975537", "0.594545", "0.59365", "0.5932329", "0.5926135", "0.592105", "0.5919021", "0.58763653", "0.58556014", "0...
0.56952274
46
Get a subset of the design. A nice method but not actually used elsewhere.
def get(self, query): if not isinstance(query, dict): raise ValueError('Query should be a python dict') ##set default query containing all values default_query = { 'cell_id': self.cell_id, 'treatment': self.treatments, 'time_point': self.time_poi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_designs(self):", "def subset(\n self, \n include: Union[Sequence[Any], Any] = None, \n exclude: Union[Sequence[Any], Any] = None) -> Bunch:\n pass", "def default_subset(self):\n\t\treturn [slice(0,dim.length) for dim in self.variable.dimensions]", "def get_subset(self, nam...
[ "0.64185005", "0.6416632", "0.62816876", "0.60458934", "0.60294616", "0.59579057", "0.5831714", "0.5782122", "0.57754046", "0.5741057", "0.5671157", "0.56486607", "0.56307197", "0.5624579", "0.56143534", "0.56012255", "0.555921", "0.55588406", "0.54997003", "0.54997003", "0.5...
0.0
-1
Organize chip into readings per sample
def samples(self): sample = {} for label, df in self.data.groupby(by='Sample'): sample[label] = Sample(label, df) return sample
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def samples(self):\n pass", "def _read_cardiochip(self):\n cur_leadstatus = 0\n sample_count =0\n while self.connected:\n sample_count+=1\n #check for sync bytes\n readbyte = ord(self.ser.read(1))\n #print readbyte, SYNC_BYTE\n if...
[ "0.6005613", "0.5774641", "0.5711628", "0.5686355", "0.56711054", "0.56303364", "0.5627739", "0.56075263", "0.55885583", "0.55885583", "0.55640453", "0.5494687", "0.54919183", "0.54767716", "0.5444199", "0.5424295", "0.5424295", "0.5423679", "0.54222864", "0.5411638", "0.5382...
0.0
-1
Get baseline data without treatment time courses
def baseline(self): return self.data[self.data['treatment'] == 'Baseline']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def emissions_baseline(self):\n baseline = DataFrame(columns=[\"CO2\", \"NOx\", \"PM10\", \"PM2.5\", \"SO2\"])\n baseline = baseline.append(year_1(self.plant.emissions()))\n baseline = baseline.append(year_1(self.plant.fuel_reseller().emissions()))\n baseline = baseline.append(year_1(se...
[ "0.661995", "0.5938596", "0.5920818", "0.5673383", "0.56499016", "0.5554714", "0.5551037", "0.5503436", "0.5422899", "0.5406511", "0.53813374", "0.53646106", "0.5344754", "0.53437316", "0.533326", "0.5273145", "0.52495307", "0.5244175", "0.5234559", "0.5222947", "0.5214892", ...
0.61777115
1
Get treatment time courses without baseline data
def treatments(self): return self.data[self.data['treatment'] != 'Baseline']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_timecourses(self):\n # load the timecourses file\n tcsf = fetch_one_file(self.ica_dir, self._tcs_fname)\n tcs = niimg.load_img(tcsf).get_data()\n return tcs", "def _load_timecourses(self):\n # load the timecourses file\n tcsf = fetch_one_file(self.ica_dir, self...
[ "0.6250547", "0.62290126", "0.61140645", "0.59820795", "0.59133375", "0.5577022", "0.54320115", "0.5422249", "0.5395153", "0.5357361", "0.53467005", "0.5322102", "0.53120166", "0.5310064", "0.526714", "0.5255139", "0.5216506", "0.51582277", "0.5101761", "0.5069965", "0.505666...
0.4884956
33
verify integrity of user input
def do_checks(self): # ## get valid experiment variables all_subexperiments = [1, 2, 3] all_plates = list(range(1, 19)) all_cell_ids = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'] all_samples = list(self.experiment.design['Sample']) all_genes = self.experiment.subexperim...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_validity(self):", "def isInputValid(self, input):\r\n pass", "def validate():", "def validate_input(self, *args):\n return", "def verify():", "def validate_user_input(user_input):\n responses = ['t', 'r', 'q']\n return user_input in responses", "def test_valid_user_input(s...
[ "0.7332497", "0.7278962", "0.7278766", "0.71752334", "0.68487245", "0.6826624", "0.68062013", "0.6788392", "0.6787829", "0.66582745", "0.6449319", "0.64325076", "0.6425667", "0.63953435", "0.6345437", "0.632387", "0.6322956", "0.6319321", "0.6303776", "0.62568563", "0.6250406...
0.0
-1
Creates a millisecond based timestamp of UTC now.
def get_utc_now_timestamp() -> int: return int(datetime.datetime.now(datetime.timezone.utc).timestamp() * 1000)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Now():\n ut = (datetime.datetime.utcnow() - _EPOCH).total_seconds() / 86400.0\n return Time(ut)", "def now() -> datetime:\n now = datetime.now(tz=timezone.utc)\n return now.replace(microsecond=now.microsecond - now.microsecond % 1000)", "def now_timestamp(unit: TimeUnit = TimeUn...
[ "0.7358585", "0.73144686", "0.73085713", "0.7295754", "0.72463673", "0.719578", "0.71388984", "0.71132016", "0.71132016", "0.7087358", "0.70538455", "0.70202845", "0.69747436", "0.69600034", "0.6942168", "0.6916312", "0.69006324", "0.68955755", "0.68503773", "0.68242997", "0....
0.7725665
0
Convert to the string in whiltespaceseparated tokens Addhoc addition.
def convert_pr_wvi_to_string(pr_wvi, nlu_t, nlu_wp_t, wp_to_wh_index, nlu): pr_wv_str_wp = [] # word-piece version pr_wv_str = [] for b, pr_wvi1 in enumerate(pr_wvi): pr_wv_str_wp1 = [] pr_wv_str1 = [] wp_to_wh_index1 = wp_to_wh_index[b] nlu_wp_t1 = nlu_wp_t[b] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_spaces(text):\n return \" \".join(text)", "def _remove_extra_whitespaces(self, text: str) -> str:\n return re.sub(\" +\", \" \", text)", "def wrapspace(text, token):\n\n # Wildcards have no whitespace. Need special case since * is also multiply which does have whitespace.\n if t...
[ "0.6040225", "0.5965436", "0.565226", "0.55917454", "0.5590612", "0.5502032", "0.54759145", "0.54269254", "0.5407506", "0.537984", "0.5370962", "0.5360763", "0.53585404", "0.53528565", "0.5322174", "0.53027683", "0.52994215", "0.5293425", "0.5283788", "0.52749795", "0.5263112...
0.0
-1
Almost copied of SQLNet. The main purpose is pad blank line while combining tokens.
def merge_wv_t1_eng(where_str_tokens, NLq): nlq = NLq.lower() where_str_tokens = [tok.lower() for tok in where_str_tokens] alphabet = 'abcdefghijklmnopqrstuvwxyz0123456789$' special = {'-LRB-': '(', '-RRB-': ')', '-LSB-': '[', '-RSB-': ']', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _output_padding_line(self):\n for i in range(self.num_new_columns):\n self._write_column(self.new_columns[i], '|')\n self.buf += ' '\n\n self._pad_horizontally(self.num_new_columns * 2)", "def rehydrate_blank_line(cls, next_token):\n return next_token.extracted_whit...
[ "0.6392049", "0.6164877", "0.60053855", "0.5916133", "0.5909493", "0.5903229", "0.57719034", "0.5734293", "0.57243377", "0.56752753", "0.5638436", "0.5602468", "0.5591528", "0.55746096", "0.5573323", "0.55722106", "0.55722106", "0.55722106", "0.5568011", "0.549426", "0.549023...
0.0
-1
usalbe only when g_wc was used to find pr_wv
def get_cnt_sw_list(g_sc, g_sa, g_wn, g_wc, g_wo, g_wvi, pr_sc, pr_sa, pr_wn, pr_wc, pr_wo, pr_wvi, g_sql_i, pr_sql_i, mode): cnt_sc = get_cnt_sc_list(g_sc, pr_sc) cnt_sa = get_cnt_sc_list(g_sa, pr_sa) cnt_wn = get_cnt_sc_list(g_wn, pr_wn) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cnt_wv_list(g_wn, g_wc, g_sql_i, pr_sql_i, mode):\r\n cnt_list =[]\r\n for b, g_wc1 in enumerate(g_wc):\r\n pr_wn1 = len(pr_sql_i[b][\"conds\"])\r\n g_wn1 = g_wn[b]\r\n\r\n # Now sorting.\r\n # Sort based wc sequence.\r\n if mode == 'test':\r\n idx1 = arg...
[ "0.5783301", "0.5585813", "0.54354393", "0.5363023", "0.5359201", "0.5240661", "0.52019274", "0.5175359", "0.5097325", "0.5092165", "0.5047512", "0.5047512", "0.5047512", "0.5030539", "0.50301886", "0.50111204", "0.5002621", "0.4978421", "0.49574295", "0.49345815", "0.4929732...
0.49491084
19
pr's are all sorted as pr_wc are sorted in increasing order (in column idx) However, g's are not sorted. Sort g's in increasing order (in column idx)
def get_cnt_wo_list(g_wn, g_wc, g_wo, pr_wc, pr_wo, mode): cnt_list=[] for b, g_wo1 in enumerate(g_wo): g_wc1 = g_wc[b] pr_wc1 = pr_wc[b] pr_wo1 = pr_wo[b] pr_wn1 = len(pr_wo1) g_wn1 = g_wn[b] if g_wn1 != pr_wn1: cnt_list.append(0) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _sort(self):\n self.rows.sort(key=lambda x: (x['PERC1'], x['EQ'], x['PASS'], x['W2']),\n reverse=True)\n\n rank = 0\n prev_perc = 0\n prev_rank = 0\n for row in self.rows:\n if row[\"NR\"] == 0:\n # Something has already populat...
[ "0.6440761", "0.6183674", "0.58891386", "0.5887252", "0.5864489", "0.5768664", "0.5755941", "0.5731223", "0.5588322", "0.55396104", "0.5513205", "0.54945284", "0.5487258", "0.54705155", "0.54693717", "0.5463505", "0.5420143", "0.5404942", "0.5398548", "0.538597", "0.53687453"...
0.0
-1
usalbe only when g_wc was used to find pr_wv
def get_cnt_wvi_list(g_wn, g_wc, g_wvi, pr_wvi, mode): cnt_list =[] for b, g_wvi1 in enumerate(g_wvi): g_wc1 = g_wc[b] pr_wvi1 = pr_wvi[b] pr_wn1 = len(pr_wvi1) g_wn1 = g_wn[b] # Now sorting. # Sort based wc sequence. if mode == 'test': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cnt_wv_list(g_wn, g_wc, g_sql_i, pr_sql_i, mode):\r\n cnt_list =[]\r\n for b, g_wc1 in enumerate(g_wc):\r\n pr_wn1 = len(pr_sql_i[b][\"conds\"])\r\n g_wn1 = g_wn[b]\r\n\r\n # Now sorting.\r\n # Sort based wc sequence.\r\n if mode == 'test':\r\n idx1 = arg...
[ "0.57836646", "0.5585155", "0.5435751", "0.53624374", "0.53587824", "0.5239644", "0.5201019", "0.517548", "0.50928926", "0.5047328", "0.5047328", "0.5047328", "0.50309426", "0.5029931", "0.5010414", "0.50012654", "0.4978423", "0.49580443", "0.4950043", "0.49334282", "0.492841...
0.50977534
8
usalbe only when g_wc was used to find pr_wv
def get_cnt_wv_list(g_wn, g_wc, g_sql_i, pr_sql_i, mode): cnt_list =[] for b, g_wc1 in enumerate(g_wc): pr_wn1 = len(pr_sql_i[b]["conds"]) g_wn1 = g_wn[b] # Now sorting. # Sort based wc sequence. if mode == 'test': idx1 = argsort(array(g_wc1)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compute_wo(self):\n self.uom_id = self.wo_id.uom_id.id\n self.final_product_id = self.wo_id.final_product_id.id\n if not self.supplier_id:\n self.service_ids = [x.product_id.id for x in self.wo_id.consumed_service_ids if x.product_id]\n else:\n service_ids = [...
[ "0.5585714", "0.54342604", "0.5361827", "0.5358429", "0.5239973", "0.51996017", "0.51747024", "0.50968176", "0.50909096", "0.5046365", "0.5046365", "0.5046365", "0.5030739", "0.50290895", "0.50091815", "0.5000712", "0.49765882", "0.49565095", "0.4948263", "0.4933547", "0.4929...
0.57827145
0
master monitor is running or not
def is_running(ssh): if get_status(ssh) == "running": return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self):\n status = self.os.popen('circusctl status monitor').read().strip()\n\n if status == 'active':\n return True\n elif status == 'stopped':\n return False", "def is_master(self):\n return MPControl.is_master", "def slave_status():\n run_mysq...
[ "0.76096", "0.71582156", "0.69318926", "0.68682814", "0.67281044", "0.6716801", "0.669943", "0.6669908", "0.66140735", "0.66064215", "0.6597562", "0.659302", "0.6580973", "0.6576386", "0.6575719", "0.6559207", "0.65534914", "0.65473324", "0.6541179", "0.651523", "0.64646703",...
0.61071116
59