query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Add engineered features to features dict.
def add_engineered(features): features["londiff"] = features["dropofflon"] - features["pickuplon"] features["latdiff"] = features["dropofflat"] - features["pickuplat"] features["euclidean"] = tf.math.sqrt( features["londiff"]**2 + features["latdiff"]**2) return features
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def features(self, features):\n\n self._features = features", "def __call__(self, *args, **kwargs):\n self.features = dict((k, v()) for k, v in self.features.items())\n return self.features", "def load_features(self, features):\n pass\n # self.features = features", "def _de...
[ "0.64477503", "0.6440563", "0.64119697", "0.61569864", "0.6112001", "0.6101296", "0.60949934", "0.6077937", "0.6022143", "0.5984989", "0.59786856", "0.5972495", "0.59672904", "0.5910809", "0.59081984", "0.5877332", "0.58647245", "0.5860706", "0.58225346", "0.58163923", "0.581...
0.6726443
0
Build tf.estimator.DNNRegressor and call train_and_evaluate loop.
def train_and_evaluate(args): feat_cols = [ tf.feature_column.numeric_column('dayofweek'), tf.feature_column.numeric_column('hourofday'), tf.feature_column.numeric_column('pickuplat'), tf.feature_column.numeric_column('pickuplon'), tf.feature_column.numeric_column('dropofflat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_nn_regression_model(\n optimizer,\n steps,\n batch_size,\n hidden_units,\n training_examples,\n training_targets,\n validation_examples,\n validation_targets):\n\n periods = 10\n steps_per_period = steps / periods\n\n # Create the input functions.\n feature_columns = set([tf.c...
[ "0.6932515", "0.6868513", "0.6683517", "0.6611022", "0.63978523", "0.6266433", "0.624062", "0.62243056", "0.62151706", "0.61533993", "0.6094991", "0.6083925", "0.60591084", "0.60548323", "0.60199255", "0.59901935", "0.5986955", "0.5979149", "0.5974354", "0.59577286", "0.59536...
0.8276498
0
Download the url to dest if necessary, optionally checking file integrity.
def maybe_download(url, dest): if not os.path.exists(dest): logger.info('Downloading %s to %s', url, dest) download(url, dest)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download(self, url: str, dest: PathLike, force: bool = False):", "def filedownload(source, destination):\n\n # Initiate the download\n urllib.request.urlretrieve(source, destination)", "def download_file(url, dest=None, force=False, trusted=False):\n url, filename = get_save_path(url, dest, force)...
[ "0.78225726", "0.72188073", "0.71579295", "0.7063505", "0.7053051", "0.69777334", "0.6964265", "0.6952167", "0.693545", "0.6925848", "0.69205797", "0.69181913", "0.69086397", "0.69033253", "0.6896963", "0.68764836", "0.68229926", "0.6812515", "0.67698634", "0.67698205", "0.67...
0.7906762
1
Returns None unless a UID was successfully parsed. Otherwise returns a positive integer.
def ParseSyntaxForUID(candidate): if candidate.lower().startswith('uid=') and candidate.count('=') == 1: (_, rhs) = candidate.split('=') try: an_integer = int(rhs, 10) if an_integer <= 0: raise ValueError('reraise') return an_integer except ValueError: raise UIDSyntaxError(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_uid(self):\n nfc_reader.MFRC522_Request(nfc_reader.PICC_REQIDL)\n reader_status, reader_uid = nfc_reader.MFRC522_Anticoll()\n if reader_status == nfc_reader.MI_OK:\n return '-'.join(map(str, reader_uid))\n return None", "def getUIDValidity(self):\n return 42...
[ "0.65925086", "0.65688443", "0.6565384", "0.650677", "0.6498679", "0.61602277", "0.61602277", "0.61602277", "0.60386515", "0.5974511", "0.5890625", "0.58426636", "0.58346", "0.5825587", "0.58140534", "0.5760595", "0.57290554", "0.565291", "0.56486964", "0.5646492", "0.5638116...
0.7521533
0
Given a string, returns a vector of strings, argv. Don't set posix False. Quote characters are removed by POSIX (see unittest), and we therefore do not play well with nonPOSIX.
def SplitCommandLineIntoArgv(space_delimited_argv, posix=True): try: return map(lambda s: s.decode('utf-8'), shlex.split(space_delimited_argv.encode('utf-8'), comments=FLAGS.pyatdl_allow_command_line_comments, posix=posix)) except ValueError a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_arguments(s, windows=IS_WINDOWS):\n # from http://stackoverflow.com/a/35900070\n if windows:\n RE_CMD_LEX = r'''\"((?:\"\"|\\\\[\"\\\\]|[^\"])*)\"?()|(\\\\\\\\(?=\\\\*\")|\\\\\")'\n r'|(&&?|\\|\\|?|\\d?>|[<])|([^\\s\"&|<>]+)|(\\s+)|(.)'''\n else:\n RE_CMD_LEX = ...
[ "0.6969268", "0.63608015", "0.62438244", "0.61279273", "0.60509396", "0.6008524", "0.5999177", "0.59391564", "0.5923128", "0.5826659", "0.5789827", "0.5760734", "0.57023686", "0.5609963", "0.5571165", "0.5547084", "0.551098", "0.55034995", "0.5492475", "0.54697275", "0.543767...
0.6764141
1
This function calculates the thrust coefficient as a function of induction factor 'a' 'glauert' defines if the Glauert correction for heavily loaded rotors should be used; default value is false
def CTfunction(a, glauert = False): CT = np.zeros(np.shape(a)) CT = 4*a*(1-a) if glauert: CT1=1.816; a1=1-np.sqrt(CT1)/2 if a>a1: CT = CT1-4*(np.sqrt(CT1)-1)*(1-a) return CT
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def correction(self):\r\n \r\n # empirical coefficients:\r\n k3, k2, k1, k0 = 0.0892, 0.0544, 0.2511, -0.0017\r\n \r\n # thrust as a function of the azimuth angle and the loads:\r\n thrust = self.qn*np.sin(Turbine.t) + self.qt*np.cos(Turbine.t)\r\n \r\n # int...
[ "0.58363867", "0.5711937", "0.54352224", "0.53664815", "0.5337465", "0.53327286", "0.52701294", "0.5261316", "0.5231679", "0.51432496", "0.51237327", "0.5115946", "0.5104627", "0.5102555", "0.5096551", "0.5091456", "0.5086365", "0.5068426", "0.50680804", "0.50588924", "0.5053...
0.6336001
0
This function calcualte steh combined tip and root Prandtl correction at agiven radial position 'r_R' (nondimensioned by rotor radius), given a root and tip radius (also nondimensioned), a tip speed ratio TSR, the number lf blades NBlades and the axial induction factor
def PrandtlTipRootCorrection(r_R, rootradius_R, tipradius_R, TSR, NBlades, axial_induction): temp1 = -NBlades/2*(tipradius_R-r_R)/r_R*np.sqrt( 1+ ((TSR*r_R)**2)/((1+axial_induction)**2)) Ftip = np.array(2/np.pi*np.arccos(np.exp(temp1))) Ftip[np.isnan(Ftip)] = 0 temp1 = NBlades/2*(rootradius_R-r_R)/r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ers(self, qL, qR, A, xt):\n hL, hR, uL, uR, cL, cR = self.get_param(qL, qR)\n fL = self.flux(qL)\n fR = self.flux(qR)\n # Find starting value for Newton-Rhapson iterative method\n hS = self.start_exact(hL, hR, cL, cR, uL, uR)\n h0 = hS\n # Start iteration\n ...
[ "0.54735804", "0.5436133", "0.5405628", "0.53660256", "0.5353389", "0.5195356", "0.5194372", "0.5179527", "0.51655126", "0.5129584", "0.5126523", "0.51239127", "0.5109613", "0.5094666", "0.5077448", "0.5076421", "0.50749207", "0.5071346", "0.5060494", "0.50272167", "0.5015936...
0.8307774
0
Gets the keys from the configuration file of the blog.
def get_keys(): config = ConfigParser.ConfigParser() config.read('config.ini') cfg = {} cfg['access_token'] = config.get('Twitter', 'AccessToken') cfg['access_token_secret'] = config.get('Twitter', 'AccessTokenSecret') cfg['consumer_key'] = config.get('Twitter', 'ConsumerKey') cfg['consumer_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keys(self):\n return self.config.keys()", "def keys(self):\n return self.config.keys()", "def get_keys(self) -> Dict[str, str]:\n return self.http.get(self.config.paths.keys)", "def get_config_keys():\n global _allowed_config_keys\n return _allowed_config_keys.copy()", "def a...
[ "0.6719508", "0.6719508", "0.65328974", "0.6465938", "0.64221555", "0.6281572", "0.6174131", "0.61392176", "0.6037525", "0.596592", "0.5936455", "0.5896151", "0.58949304", "0.5796801", "0.5796801", "0.5791612", "0.57912165", "0.57886237", "0.57510895", "0.5719784", "0.5716066...
0.70035803
0
Posts a thread of tweets based on the text of a post.
def send_tweet(data): # Fill in the values noted in previous step here cfg = get_keys() # grab keys api = get_api(cfg) # setup API in_reply_to = None twitter_url = 'https://twitter.com' if data['in_reply_to'] is not None: # if post is reply ... for reply i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_to_tweets(data, url):\n\n print(\"here,\", url)\n\n albums = find_all_images(data['content'])\n text = strip_text(data['content'])\n\n \"\"\"Where applicable, the images are associated with the text. This means, that to make an appropriate thread the\n conversion from a post to tweets shoul...
[ "0.73425776", "0.63875675", "0.63214403", "0.6178167", "0.6166628", "0.6138186", "0.61113405", "0.61091673", "0.6098637", "0.6091472", "0.6091472", "0.6091472", "0.6055011", "0.6019875", "0.60170734", "0.59870404", "0.5978987", "0.596139", "0.5929983", "0.5914204", "0.5886613...
0.70435405
1
Turn off the robot.
def turn_off(self): self.robot.stop_simulation()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_off(self, **kwargs):\n self.robot.pause_cleaning()\n time.sleep(1)\n self.robot.send_to_base()", "def turn_off(self, **kwargs: Any) -> None:\n with self._wemo_call_wrapper(\"turn off\"):\n self.wemo.off()", "def turn_off(self, **kwargs):\n set_sonoff_state...
[ "0.8336145", "0.8030745", "0.79974264", "0.78690785", "0.7825072", "0.7775521", "0.77530354", "0.7712926", "0.770361", "0.76866096", "0.767366", "0.76457965", "0.7621102", "0.7618385", "0.7584204", "0.7565604", "0.7558122", "0.75331867", "0.7519106", "0.75005126", "0.74990374...
0.87365395
0
Start the navigation thread, that will guide the robot towards the goal set using the goto function.
def start_navigation(self): # starting the navigation thread if it is not running if not self.navigation_status: print("Starting navigation thread") try: self.navigation_stop = False navigation_thread = thread.Thread(target=self.navigation) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nav(self):\n print(\"-----------! NAVIGATION ACTIVATED !------------\\n\")\n print(\"-------- [ Press CTRL + C to stop me ] --------\\n\")\n print(\"-----------! NAVIGATION ACTIVATED !------------\\n\")\n #print(\"Wait a second. \\nI can't navigate the maze at all. Please give my pr...
[ "0.7061483", "0.6943756", "0.68180054", "0.6584084", "0.61308944", "0.5932921", "0.58845675", "0.58592", "0.58142394", "0.57781565", "0.57468885", "0.57467866", "0.5718214", "0.57148343", "0.5690608", "0.5684575", "0.56760263", "0.56682557", "0.56044203", "0.56043166", "0.559...
0.6999155
1
Stop the navigation thread.
def stop_navigation(self): print("Stopping the navigation thread") self.navigation_stop = True self.locomotion_stop = True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop(self):\n self._state.transit(sitcpy.THREAD_STOPPING)", "def stop(self):\n self._state.transit(sitcpy.THREAD_STOPPING)", "def stop(self):\n\n self.stop_thread = True", "def stop(self):\n self._Thread__stop()", "def stop(self):\n self.thread.join()", "def stop(self...
[ "0.7302044", "0.7302044", "0.7283365", "0.72091466", "0.7076916", "0.6910898", "0.68521047", "0.68444526", "0.68253547", "0.6794829", "0.6793175", "0.6739685", "0.67362314", "0.66931236", "0.66874415", "0.66874415", "0.6680153", "0.6680153", "0.66609913", "0.6657695", "0.6649...
0.87497926
0
Openloop navigation towards a selected goal.
def goto(self, goal: Pose): self.navigation_lock.acquire() self.navigation_goal = goal self.navigation_lock.release()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def goToMyGoal(state):\n return goTo(state, state.my_goal)", "def step():\n \n step = models.Step(action=u\"goto\", target=u\"http://www.joesfunerals.com\")", "def _rviz_nav_goal_cb(self, msg):\n goal = Pose2D(x=msg.pose.position.x, y=msg.pose.position.y)\n tolerance = 0.0\n\n sel...
[ "0.66995054", "0.6549997", "0.6401554", "0.6304438", "0.6192513", "0.6108626", "0.6000416", "0.59722394", "0.5947292", "0.59229386", "0.5892038", "0.5876165", "0.5865942", "0.58655065", "0.58619714", "0.58407855", "0.58162016", "0.57871723", "0.5773965", "0.57584894", "0.5740...
0.7098961
0
Drops the current goal and (almost) stops the movement.
def stop(self): self.move(None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop(self):\n self._current_mc_goal = None\n self._mc_goals = []\n self._position_control_client.cancel_all_goals()\n action = Stop()\n self._velocity_control_client(pickle.dumps(action))", "def stop(self):\n self.move(0, 0)", "def stop(self):\n self.stopAng...
[ "0.70070034", "0.6939729", "0.68706554", "0.67096746", "0.65591013", "0.64908636", "0.63843083", "0.6376639", "0.6339811", "0.63276875", "0.6299046", "0.6287512", "0.62787086", "0.6250674", "0.623799", "0.621587", "0.62082934", "0.61787057", "0.6174812", "0.6139649", "0.61377...
0.7154708
0
Logs in a trainer using their email address
def post(self): try: email = request.json["email"] return TrainerService.login(email).json() except ResourceNotFound as r: return r.message, 404
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def login(self, email, password):\r\n self.provide_info(email, password)\r\n self.submit()", "def login(email, password):\n rino.login.login(email, password)", "def login(email, password):\n rino.login.login(email, password)", "def einloggen(self):\n \n self.c.login(self.use...
[ "0.6231356", "0.6186771", "0.6186771", "0.61387473", "0.6078526", "0.60472184", "0.60057425", "0.59856814", "0.5976234", "0.59298414", "0.5862211", "0.5831993", "0.5827794", "0.5804283", "0.5803094", "0.57739425", "0.5731095", "0.5699084", "0.56938934", "0.56938934", "0.56735...
0.66284305
0
Retrieve trainer information using their ID
def get(self, trainer_id): try: return TrainerService.get_trainer_by_id(int(trainer_id)).json() except ValueError: return INVALID_ID_ERROR, 400 # Bad Request except ResourceNotFound as r: return r.message, 404
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trainer(self):\n return self._trainer", "async def trainer(ctx, trainer=None):\n # gets the total number of unique pokemon caught\n if trainer:\n trainer = str(ctx.message.mentions[0])\n else:\n trainer = ctx.message.author\n return await get_trainer_info(ctx, trainer)", "def g...
[ "0.6692878", "0.655598", "0.6391126", "0.60579395", "0.5897589", "0.57685375", "0.5569842", "0.55271757", "0.55269176", "0.54980695", "0.5416051", "0.53988266", "0.53871983", "0.53435636", "0.53112185", "0.5291813", "0.5287078", "0.52411026", "0.5238435", "0.5237178", "0.5234...
0.7364399
0
Retrieves all trainers associated in the batch with given ID
def get(self, batch_id): try: trainers = TrainerService.get_trainers_in_batch(int(batch_id)) except ValueError: return INVALID_ID_ERROR, 400 # Bad Request except ResourceNotFound as r: return r.message, 404 trainers_as_json...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_friend_training_set(api, id, num = 5):\n result = []\n for status in tweepy.Cursor(api.user_timeline,id).items(num):\n result.append(status.text)\n return result", "def get_train_iterator(self) -> Iterable[Batch]:\n if self._train_name not in self._datasets:\n raise Val...
[ "0.5966372", "0.5772478", "0.5372898", "0.53540754", "0.52865833", "0.52831405", "0.5269333", "0.52370983", "0.52250075", "0.52245545", "0.514053", "0.5137699", "0.51028657", "0.5088596", "0.50728333", "0.5064497", "0.5057934", "0.50060415", "0.49905878", "0.49543902", "0.493...
0.7817866
0
Gets the number of active years for the trainer with ID in argument
def get(self): trainer_id = request.args.get("trainerId") if trainer_id is not None: try: return TrainerService.get_years_for_trainer(int(trainer_id)) except ValueError: return INVALID_ID_ERROR, 400 # Bad Request ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def year(self) -> int:\n return self.arxiv_id.year", "def num_years():\n years = movies['Year']\n return ('num_years', years.nunique())", "def year(self):\n return self._years", "def get_add_years(course):\n # Add 1 year if verification happens during fall, 0 if during spring.\n ...
[ "0.6045799", "0.595452", "0.5834855", "0.58284134", "0.58261347", "0.5779115", "0.5779115", "0.5695147", "0.56696", "0.56387305", "0.56294125", "0.5617614", "0.56164545", "0.55953044", "0.5574758", "0.55654645", "0.55577713", "0.5541235", "0.5507758", "0.54951704", "0.5449801...
0.69648635
0
Increase speed settings and alien point values
def increase_speed(self): self.ship_speed += self.speedup_scale self.bullet_speed += self.speedup_scale self.alien_speed += self.speedup_scale self.alien_points = int(self.alien_points * self.score_scale)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def increase_speed(self):\n self.ship_speed*=self.speedup_scale\n self.bullet_speed*=self.speedup_scale\n self.alien_speed*=self.speedup_scale\n self.alien_points=int(self.alien_points*self.score_scale)\n print(self.alien_points)", "def increase_speed(self):\n self.ship_...
[ "0.7795996", "0.744905", "0.7440732", "0.7435015", "0.7041275", "0.6882547", "0.68421924", "0.67859405", "0.67154586", "0.67154586", "0.67154586", "0.66978663", "0.66974163", "0.669362", "0.6577174", "0.657017", "0.6567379", "0.651208", "0.6411437", "0.6411256", "0.64064056",...
0.75285256
1
Creates a cache HTTP adapter that is based on an HAR file.
def __init__( self, cache_path: Union[str, os.PathLike], mode: str = 'r', is_active: bool = True, is_offline: bool = False, is_passive: bool = True, delete_after_hit: bool = False, match_headers: bool = True, mat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load(cls, host):\n\n return cls(host)", "def __init__(self, host=None, port=None):\n\n self._mh = MasterHead.get_head()\n\n cfg = self._mh.cfg['Extensions']['Security']['zap']\n self._path = cfg['path']\n self._host = cfg['host'] if (host == None) else host\n self._p...
[ "0.52153873", "0.5195794", "0.511849", "0.511273", "0.49947166", "0.48670897", "0.4835957", "0.4829714", "0.48049283", "0.4769282", "0.47304696", "0.47250324", "0.47057673", "0.4686407", "0.46752235", "0.46411264", "0.46192932", "0.46022767", "0.46016216", "0.4598756", "0.457...
0.58262473
0
Reads graph metadata GRAPH_DIR/FILENAME.GRAPH_EXT Draws a graph image IMG_DIR/FILENAME.IMG_EXT
def draw_graph( filename: str, graph_ext: str = DOT_EXT, graph_dir: str = DOT_DIR, img_dir: str = IMG_DIR, img_ext: str = SVG_EXT ) -> None: filepath = "{}/{}".format(graph_dir, filename) graph = G(filepath) graph.layout() img_filename = filename.replace(g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def graph_with_images(image_path: str):\n\n def createNode(graph, image_path, ID):\n graph.node(ID, image=f'{image_path}')\n\n def makeTable(title, image_path):\n return f\"\"\"<TABLE BORDER=\"2\" CELLPADDING=\"0\" CELLSPACING=\"0\">\n <TR>\n <TD CELLPADDING=\"10\" CELLSPACING=\"0\" ALIGN=\"T...
[ "0.6249172", "0.58847487", "0.5872001", "0.5869556", "0.5830559", "0.5796846", "0.57176507", "0.56744033", "0.56541145", "0.5589815", "0.55115", "0.5497556", "0.5492238", "0.5490873", "0.5476429", "0.547519", "0.5428933", "0.54229593", "0.5415645", "0.5386893", "0.5373247", ...
0.6508949
0
Loops through a directory Draws graphs from all the graph metadata files
def loop_dir(dir_name: str, graph_ext: str) -> None: directory = fsencode(dir_name) for file in listdir(directory): filename = fsdecode(file) if filename.endswith(graph_ext): draw_graph(filename)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subgraphs(date):\n dateDir = \"graph/%s\" % date\n if not os.path.isdir(dateDir):\n return\n for name in os.listdir(dateDir):\n filename = \"graph/%s/%s\" % (date, name)\n if filename.endswith('.uri'):\n continue\n uri, label = open(filename + \".uri\").read().sp...
[ "0.6527672", "0.63166535", "0.62097687", "0.61828446", "0.6130444", "0.59899056", "0.59682596", "0.5917099", "0.5901584", "0.588406", "0.5880315", "0.5862465", "0.5847799", "0.5836595", "0.57969713", "0.57790244", "0.57752573", "0.57674325", "0.57225347", "0.5695134", "0.5659...
0.7576234
0
To play the game, we first select the secret word for the player to guess and then play the game using that secret word.
def main(): secret_word = get_word() print(secret_word) play_game(secret_word)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n secret_word = get_word()\n play_game(secret_word)", "def play_game(secret_word):\n word=secret_word\n hidden='-'\n inp=''\n no_guesses = 8\n list_word=list(word)\n \n for i in range(len(word)-1):\n hidden=hidden+'-'\n hidden_word=list(hidden)\n #print('Hidden...
[ "0.7794129", "0.7394776", "0.7201228", "0.7153742", "0.6933171", "0.6933171", "0.69328105", "0.69291526", "0.687647", "0.67876947", "0.6776523", "0.6764541", "0.67090416", "0.6696489", "0.6678802", "0.6652404", "0.66247773", "0.66151136", "0.6546788", "0.65360326", "0.6523234...
0.7608112
1
Get all valid reset days
def get_reset_days(cashflows): reset_dates = [cash_flow.Resets()[-1].Day() for cash_flow in cashflows if cash_flow.CashFlowType() == 'Float Rate'] return reset_dates
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAllDays(self):\n start = str(self.current[0:10])\n end = str(self.dueDate[0:10])\n daysRange = pd.date_range(start = start, end = end).tolist()\n daysRange = daysRange[1:len(daysRange)-1]\n days = []\n for i in daysRange:\n day = str(i)\n day =...
[ "0.66494983", "0.6245223", "0.6206405", "0.6135902", "0.6115153", "0.60514444", "0.5926243", "0.58362526", "0.57562333", "0.5669549", "0.56620973", "0.5645171", "0.56212366", "0.5583514", "0.5550563", "0.55325645", "0.55268604", "0.55183864", "0.5505934", "0.54803777", "0.547...
0.7174913
0
Given a brick path, split and return the components Returns a dict with the host component, the rest of the path, the zfs pool the ondisk storage format assumes that the dataset name is of the form // where ondisk_storage_format is either normal or compressed or deduplicated brick The brick path
def get_components(brick): d = None try: if not brick: raise Exception('Brick path not provided') l = brick.split(':') if not l or len(l) == 1: raise Exception('Invalid brick path : %s' % brick) d = {} d["host"] = l[0] d["path"] = l[1] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split(self, path):\n if not self.is_managed_path(path):\n return os.path.split(path)\n client, _ = self._get_storage(path)\n prefix, rel_path = self.parse_managed_path(path)\n return (\"%s:\" % prefix,) + client.split(rel_path)", "def create_brick_volfile(storage_unit_v...
[ "0.5704681", "0.5624806", "0.56203717", "0.5469933", "0.543681", "0.5357805", "0.5348332", "0.5303579", "0.52651185", "0.5170299", "0.51556987", "0.5155113", "0.5143921", "0.50866973", "0.5083599", "0.5064876", "0.5060843", "0.50229025", "0.5012086", "0.49778295", "0.4963876"...
0.6958729
0
Returns the basic information about all the volumes except the integralview admin volume The return value is a list of dicts where each dict has all the info of one volume
def get_basic_volume_info_all(): vl = None try: d, err = xml_parse.run_gluster_command( '/usr/sbin/gluster volume info all --xml') if err: raise Exception(err) root = d["root"] # Get the admin vol name so it can be excluded from the list admin_vo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_volume_info(volumes):\n if type(volumes) is not list:\n volumes = [volumes]\n volume_info_list = []\n for volume in volumes:\n command = 'cinder show %s' % volume['id']\n volume_info = parse_output(Popen(command.split(), stdout=STDOUT,\n ...
[ "0.7235197", "0.7223473", "0.71868163", "0.70021546", "0.69025296", "0.6888668", "0.68431604", "0.6842097", "0.68007433", "0.66706747", "0.66706747", "0.66706747", "0.66669995", "0.66221446", "0.6601158", "0.6599885", "0.6587434", "0.6573133", "0.65234816", "0.6506573", "0.64...
0.7761151
0
Returns the volume process status for a particular volume The return value is a dict which has a flag to say if all the processes are ok or not and for each brick, it has the appropriate process status vol_name The name of the volume for which the status details is required. vol_info_dict The dict returned from get_vol...
def get_volume_process_status(vol_name, vol_info_dict=None, vol_status_dict=None): return_dict = {} try: if not vol_info_dict: vol_info_dict, err = get_basic_volume_info(vol_name) if err: raise Exception(err) if not vol_status_dict: vol_statu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_volume_status(vol_name, vol_info_dict=None):\n return_dict = {}\n try:\n if not vol_info_dict:\n vol_info_dict, err = get_basic_volume_info(vol_name)\n if err:\n raise Exception(err)\n\n if vol_info_dict[\"status\"] != 1:\n # Not running s...
[ "0.7904729", "0.681238", "0.66287595", "0.65038776", "0.6185098", "0.5883956", "0.5784797", "0.57640254", "0.5694365", "0.5645313", "0.5540767", "0.5504675", "0.55007184", "0.547942", "0.5422642", "0.5391202", "0.5361384", "0.53436047", "0.53402054", "0.533444", "0.52710897",...
0.8123422
0
Returns the volume quota information for a particular volume The return value is a dict which has the quota vol_name The name of the volume for which the status details is required. vol_info_dict The dict returned from get_volume_info for that volume we can get it if None
def get_volume_quota(vol_name, vol_info_dict=None): return_dict = {} try: if not vol_info_dict: vol_info_dict, err = get_basic_volume_info(vol_name) if err: raise Exception(err) no_quotas_set = False if "options" in vol_info_dict: for o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_complete_volume_info(vol_name, vol_info_dict=None):\n return_dict = {}\n try:\n if not vol_info_dict:\n vol_info_dict, err = get_basic_volume_info(vol_name)\n if err:\n raise Exception(err)\n\n return_dict = vol_info_dict\n\n vol_status_dict =...
[ "0.73806137", "0.68691874", "0.64879006", "0.61494184", "0.6136046", "0.58457935", "0.58457935", "0.58457935", "0.582161", "0.57437617", "0.57295704", "0.562506", "0.5583006", "0.554735", "0.54928994", "0.54611117", "0.5437197", "0.5420428", "0.5409848", "0.5409607", "0.53931...
0.84127074
0
Returns all the information and status about a specific volume The return value is a dict which has all the info and status of the volume. This should be called carefully as it results in multiple underlying gluster calls. vol_name The name of the volume for which info is needed. vol_info_dict The basic volume info dic...
def get_complete_volume_info(vol_name, vol_info_dict=None): return_dict = {} try: if not vol_info_dict: vol_info_dict, err = get_basic_volume_info(vol_name) if err: raise Exception(err) return_dict = vol_info_dict vol_status_dict = {} if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_basic_volume_info(vol_name, vl=None):\n return_dict = None\n try:\n vl, err = get_basic_volume_info_all()\n for v in vl:\n if v['name'] == vol_name:\n return_dict = v\n break\n except Exception, e:\n return None, 'Error getting basic vo...
[ "0.77180165", "0.73823625", "0.70932996", "0.662914", "0.6587713", "0.6423537", "0.6355304", "0.62605864", "0.62271106", "0.6193469", "0.6042014", "0.5847191", "0.57936054", "0.57878655", "0.57878655", "0.57878655", "0.57783616", "0.5768807", "0.5762768", "0.5753512", "0.5737...
0.79154825
0
Given a volume info list and a volume name, determine if a volume of that name already exists. Returns True if it exists and False if not or if an error occurred vil A list of dicts of currently existing volumes if already generated. If None, then we generate the list here. vol_name The name of the volume that we need ...
def volume_exists(vil, vol_name): exists = False try: if not vil: vil, err = get_basic_volume_info_all() if err: raise Exception(err) if vil: for v in vil: if v["name"] == vol_name: exists = True except ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exists(self, name):\n full_path = self.path(name)\n return self.__volume.exists(full_path)", "def volume_present(\n name,\n bricks,\n stripe=False,\n replica=False,\n device_vg=False,\n transport=\"tcp\",\n start=False,\n force=False,\n arbiter=False,\n):\n ret = {...
[ "0.608211", "0.6022691", "0.5564121", "0.5557068", "0.54342055", "0.542218", "0.53319806", "0.52963185", "0.5202633", "0.5112275", "0.50923055", "0.508161", "0.50683856", "0.50465715", "0.50311685", "0.5016047", "0.4990314", "0.4981092", "0.4979604", "0.49711096", "0.49661055...
0.7499249
0
Given a volume info dict, return all the hostnames on which the bricks reside. Returns a list of the hostnames on which the volume bricks reside. vol_info_dict The volume info dict of required volume.
def get_brick_hostname_list(vol_info_dict): l = [] try: if not vol_info_dict: raise Exception('Required parameter not passed') if 'bricks' in vol_info_dict: for brick in vol_info_dict["bricks"]: for ib in brick: h, b = ib.split(':') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_volumes_on_node(hostname, vil):\n # Returns a list of volume names on a node for display\n\n vol_list = []\n try:\n if not hostname:\n raise Exception('No GRIDCell name passed')\n\n if not vil:\n vil, err = get_basic_volume_info_all()\n if err:\n ...
[ "0.61179435", "0.5330367", "0.52984947", "0.52966315", "0.5205462", "0.51441056", "0.5111836", "0.504662", "0.49664763", "0.49344337", "0.49344337", "0.49331132", "0.4933029", "0.49230012", "0.48385543", "0.4837961", "0.48278454", "0.48167405", "0.48153275", "0.47963232", "0....
0.8469792
0
Returns a list of volume names on a node for display Returns a list of volume dicts of volumes that have a brick on that hostname. vil A list of vol_info_dicts of currently existing volumes if already generated. If None, then we generate the list here. hostname The hostname to check on..
def get_volumes_on_node(hostname, vil): # Returns a list of volume names on a node for display vol_list = [] try: if not hostname: raise Exception('No GRIDCell name passed') if not vil: vil, err = get_basic_volume_info_all() if err: raise...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_brick_hostname_list(vol_info_dict):\n\n l = []\n try:\n if not vol_info_dict:\n raise Exception('Required parameter not passed')\n if 'bricks' in vol_info_dict:\n for brick in vol_info_dict[\"bricks\"]:\n for ib in brick:\n h, b = ...
[ "0.7243202", "0.6316245", "0.62509626", "0.6244724", "0.6034914", "0.5968722", "0.5959122", "0.58692515", "0.58319426", "0.5618848", "0.5612224", "0.5602871", "0.55675536", "0.55648094", "0.55520815", "0.55441123", "0.55140615", "0.5506715", "0.5506715", "0.54693246", "0.5456...
0.78498405
0
Get all the created snapshots for the specified volume name. Returns a list of all the snapshots if any. vol_name The name of the volume that we need to check on.
def get_snapshots(vol_name): l = None try: cmd = 'gluster snapshot info volume %s --xml' % vol_name d, err = xml_parse.run_gluster_command(cmd) if err: raise Exception(err) if d: if d["op_status"]["op_ret"] == 0: l, err = xml_parse.get_sn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_volume_snapshots(self, volume):\n LOG.debug('get_volume_snapshot starts')\n pool_name = self.configuration.rbd_pool\n volume_name = 'volume-%s' % encodeutils.safe_encode(volume[\"id\"])\n snaps_on_vol = self._get_volume_snapshots(pool_name, volume_name)\n snapshots = list...
[ "0.71182066", "0.644417", "0.64089763", "0.6305755", "0.62562126", "0.61841196", "0.6123662", "0.6033468", "0.5965777", "0.5829263", "0.5790481", "0.57812643", "0.57589024", "0.56857044", "0.55079883", "0.5434595", "0.5433715", "0.5421135", "0.54077375", "0.5382114", "0.53817...
0.8005072
0
Given a dict with the volume name and all the options that need to be set on that volume, this function will do the needful.. Returns a list of results from each option setting operation. cd A dict with the volume name and all the options that needs to be set.
def set_volume_options(cd): try: vol_name = cd["vol_name"] auth_allow = cd["auth_allow"] auth_reject = cd["auth_reject"] if "nfs_disable" in cd: nfs_disable = cd["nfs_disable"] else: nfs_disable = False if "enable_worm" in cd: enab...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_volumes_complex(self):\n with open(\".scuba.yml\", \"w\") as f:\n f.write(\n r\"\"\"\n image: na\n volumes:\n /foo: /host/foo\n /bar:\n hostpath: /host/bar\n /snap:\n ...
[ "0.55340415", "0.53568345", "0.53116184", "0.5283568", "0.5194128", "0.5103997", "0.50134283", "0.49966472", "0.49703082", "0.4947513", "0.49392778", "0.49061793", "0.48921204", "0.4873899", "0.48645207", "0.48614198", "0.48471624", "0.4826376", "0.48169267", "0.47980618", "0...
0.7963662
0
Given a volume name, an option name and an option value, it will do the actual work of setting that option. Returns the gluster return codes after executing that operation. vol_name The name of the volume that we need to operate on. option The option that needs to be set. value The value for the selected option that ne...
def _set_volume_option(vol_name, option, value): d = None try: cmd = 'gluster volume set %s %s %s --xml' % (vol_name, option, value) d, err = xml_parse.run_gluster_command(cmd) if err: raise Exception(err) except Exception, e: return None, 'Error setting specific ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setOption(self, name, value):\n petsc.optionsSetValue(name, value)\n return", "def set_volume_options(cd):\n\n try:\n vol_name = cd[\"vol_name\"]\n auth_allow = cd[\"auth_allow\"]\n auth_reject = cd[\"auth_reject\"]\n if \"nfs_disable\" in cd:\n nfs_disable = c...
[ "0.65798765", "0.64870024", "0.62125784", "0.6008818", "0.59390366", "0.58975303", "0.58975303", "0.58686876", "0.5848584", "0.5839887", "0.58278304", "0.5777139", "0.5666369", "0.562048", "0.5566674", "0.5537766", "0.5516297", "0.55100334", "0.5500473", "0.5495619", "0.54608...
0.8144194
0
Determine on which nodes and bricks the volume expansion/creation should happen onto and create the appropriate command to make it happen. Returns a dict with the command, the node list, the dataset list and a count that will be used by the caller to create the appropriate datasets, etc.. cmd The initial part of the co...
def build_create_or_expand_volume_command(cmd, si, anl, vol_type, ondisk_storage, repl_count, vol_name): return_dict = {} try: node_list = [] if (not si) or (not vol_type) or (not ondisk_storage) or (not vol_name): raise Exception('Required parameter not passed') if (vol_t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_create_volume_command(vol_name, vol_type, ondisk_storage, repl_count, transport, si):\n\n return_dict = None\n try:\n # Now build the command based on parameters provided\n cmd = 'gluster volume create %s ' % vol_name\n if 'replicate' in vol_type.lower():\n cmd = cmd...
[ "0.68374085", "0.62998426", "0.519228", "0.51740867", "0.5075835", "0.50645846", "0.5027328", "0.49704632", "0.4967747", "0.49454704", "0.4932453", "0.4867513", "0.4830824", "0.48259452", "0.475986", "0.4757237", "0.47280693", "0.4709603", "0.46869075", "0.46637273", "0.46610...
0.7926111
0
Determine which nodes can be used to expand or create a volume based on the system state. Returns a dict with the the allowable node list vol_name If we are checking for an existing volume, then we need its name si The system info dict that has all the information about the current state of the grid.
def _get_allowable_node_list(si, vol_name=None): anl = [] try: for hostname in si.keys(): # Volumes can only be placed on nodes that are ok and are part of # the storage pool if si[hostname]["node_status"] != 0 or si[hostname]["in_cluster"] == False: c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_volume_process_status(vol_name, vol_info_dict=None, vol_status_dict=None):\n return_dict = {}\n try:\n\n if not vol_info_dict:\n vol_info_dict, err = get_basic_volume_info(vol_name)\n if err:\n raise Exception(err)\n\n if not vol_status_dict:\n ...
[ "0.5968779", "0.5774853", "0.56573075", "0.5584254", "0.5537103", "0.5394632", "0.53767186", "0.53507185", "0.53368723", "0.529285", "0.52914566", "0.5277406", "0.5238762", "0.5190456", "0.5174489", "0.5170557", "0.51377106", "0.51191", "0.51009595", "0.5074813", "0.50449586"...
0.68700117
0
Build a command to expand an existing volume based on its type and the current system state. Uses build_create_or_expand_volume_command to do most of the work. Returns a dict with the command, the node list, the dataset list and a count that will be used by the caller to create the appropriate datasets, etc.. vol_info_...
def build_expand_volume_command(vol_info_dict, si): return_dict = None try: # First get all the node/disk combinations where the volume is not # present anl = [] num_nodes = 0 ondisk_storage = "normal" if "compressed" in vol_info_dict['bricks'][0]: o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_create_or_expand_volume_command(cmd, si, anl, vol_type, ondisk_storage, repl_count, vol_name):\n\n return_dict = {}\n try:\n node_list = []\n\n if (not si) or (not vol_type) or (not ondisk_storage) or (not vol_name):\n raise Exception('Required parameter not passed')\n\n ...
[ "0.74710476", "0.64081824", "0.5642944", "0.54808795", "0.5195407", "0.5081804", "0.4877312", "0.48448828", "0.4769358", "0.47599566", "0.47191527", "0.47055516", "0.46944204", "0.46862316", "0.4673578", "0.46630982", "0.45865816", "0.45793757", "0.45498046", "0.45476112", "0...
0.776548
0
Build a command to create a new volume based on the required type and the current system state. Uses build_create_or_expand_volume_command to do most of the work. Returns a dict with the command, the node list, the dataset list and a count that will be used by the caller to create the appropriate datasets, etc.. vol_in...
def build_create_volume_command(vol_name, vol_type, ondisk_storage, repl_count, transport, si): return_dict = None try: # Now build the command based on parameters provided cmd = 'gluster volume create %s ' % vol_name if 'replicate' in vol_type.lower(): cmd = cmd + ' replica...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_create_or_expand_volume_command(cmd, si, anl, vol_type, ondisk_storage, repl_count, vol_name):\n\n return_dict = {}\n try:\n node_list = []\n\n if (not si) or (not vol_type) or (not ondisk_storage) or (not vol_name):\n raise Exception('Required parameter not passed')\n\n ...
[ "0.7631894", "0.73216933", "0.59480876", "0.5826977", "0.57593644", "0.5595516", "0.5562846", "0.5514683", "0.5460886", "0.543616", "0.53506166", "0.5303461", "0.53003514", "0.52983034", "0.5293898", "0.5291016", "0.52276766", "0.52057874", "0.5179853", "0.51597756", "0.51472...
0.76456755
0
Start or stop a gluster volume. Returns a dict with the result and the xml root. vol_name The name of the volume op Either 'start' or 'stop'
def volume_stop_or_start(vol_name, op): return_dict = None try: cmd = 'gluster --mode=script volume %s %s --xml' % (op, vol_name) return_dict, err = xml_parse.run_gluster_command(cmd) if err: raise Exception(err) except Exception, e: return None, 'Error stopping/...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def started(name):\n ret = {\"name\": name, \"changes\": {}, \"comment\": \"\", \"result\": False}\n\n volinfo = __salt__[\"glusterfs.info\"]()\n if name not in volinfo:\n ret[\"result\"] = False\n ret[\"comment\"] = \"Volume {} does not exist\".format(name)\n return ret\n\n if int...
[ "0.7081753", "0.6118507", "0.5886451", "0.57128924", "0.56615317", "0.5641304", "0.559396", "0.5547529", "0.5454569", "0.5443983", "0.53954875", "0.5335822", "0.5296687", "0.5271856", "0.5244893", "0.5219859", "0.51940864", "0.51766926", "0.5123777", "0.5102718", "0.5097295",...
0.8168539
0
Testing defined partial syn from Mariadb to Snowflake
def test_defined_partial_sync_mariadb_to_sf(self): from_value_weight = 5 from_value_address = 400 # run-tap command assertions.assert_run_tap_success( self.tap_id, self.target_id, ['fastsync', 'singer'] ) # partial sync source_records_weight = self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_sql(cursor):\n np = parser(get_test_file(\"NLDN/example.bin\", fponly=True))\n np.sql(cursor)", "def load_staging_tables_docstring(cur, conn):", "def test_hello_world(self):\n testing.db.execute(\"insert into test_table_syn (id, data) \"\n \"values (1, 'some dat...
[ "0.6020322", "0.58599937", "0.5811381", "0.5728925", "0.5564034", "0.5559703", "0.54731846", "0.5442219", "0.5406907", "0.5402005", "0.5333193", "0.53063124", "0.5191074", "0.5181126", "0.51746374", "0.51467425", "0.5145882", "0.512783", "0.5112486", "0.51088554", "0.50949085...
0.588245
1
save story post to database check for duplicates
def save(self, *args, **kwargs): if not self.post_id: self.created = timezone.now() dup = StoryPost.objects.filter(title=self.title) if len(dup) > 0: # objects with the same slug exist -> duplicate! nos = str(len(dup)) # append ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_post(self, post):\n return self.collection.insert_one(post.serialize())", "def save_posts(self):\n logger.info(\"Savings posts to database\")\n records = self.df.to_dict(\"records\")\n\n for record in records:\n Company.objects.get_or_create(name=record[\"company\"...
[ "0.6507637", "0.62380385", "0.59755063", "0.59341407", "0.5890479", "0.58646065", "0.58646065", "0.5840086", "0.5837047", "0.5804448", "0.58035356", "0.5798259", "0.5798034", "0.57518643", "0.57442987", "0.57043606", "0.56961316", "0.5649095", "0.5639441", "0.5629521", "0.560...
0.7532954
0
Converts old classifier in Classifiers dir to the 6.0.0 classifier convention. Splits the classifier of 5_9_9 to 6_0_0 classifier and 6_0_0 mapper if exists.
def convert_dir(self) -> int: old_classifiers: List[Classifier] = self.get_entities_by_entity_type( self.pack.classifiers, FileType.OLD_CLASSIFIER ) intersection_fields = self.get_classifiers_schema_intersection_fields() for old_classifier in old_classifiers: self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_classifier_from_old_classifier(\n self, old_classifier: Classifier, intersection_fields: Set[str]\n ) -> None:\n classifier_name_and_id = self.extract_classifier_name(old_classifier)\n if not classifier_name_and_id:\n return\n new_classifier = {\n k: ...
[ "0.5630559", "0.54266787", "0.54034466", "0.5341847", "0.5322823", "0.523025", "0.5136913", "0.5057118", "0.50565654", "0.5039764", "0.50202715", "0.5011196", "0.5006437", "0.49946398", "0.49709865", "0.49332815", "0.49143526", "0.49066266", "0.48643714", "0.48518556", "0.483...
0.61859685
0
Receives classifier of format 5_9_9. Builds mapper of format 6_0_0 and above, if mapping exists in the old classifier.
def create_mapper_from_old_classifier(self, old_classifier: Classifier) -> None: classifier_name_and_id = self.extract_classifier_name(old_classifier) mapping = old_classifier.get("mapping") if not classifier_name_and_id or not mapping: return mapper = dict( id=f"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_mapper(self, classification_dict):\n d = {class_code: class_index for class_index, class_code in enumerate(classification_dict.keys())}\n # Here we update the dict so that code 65 remains unchanged.\n # Indeed, 65 is reserved for noise/artefacts points, that will be deleted by transfo...
[ "0.6033039", "0.57451266", "0.55869347", "0.54215556", "0.5373635", "0.5304646", "0.52426374", "0.5206462", "0.51846135", "0.5174", "0.51459277", "0.5138542", "0.5123493", "0.5094577", "0.50734943", "0.5070956", "0.5060026", "0.5036247", "0.49988058", "0.4984412", "0.49756825...
0.71432686
0
Calculates the new path for mapper or classifier of 6_0_0 format
def calculate_new_path(self, old_classifier_brand: str, is_mapper: bool) -> str: fixed_brand_name = self.entity_separators_to_underscore(old_classifier_brand) if is_mapper: fixed_brand_name = f"mapper-incoming-{fixed_brand_name}" new_path_suffix = f"classifier-{fixed_brand_name}.json...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculateNewPath(self):\r\n\r\n\t\tnodeDict = self.simulationHandle.getMap().getNodeDict()\r\n\t\tdistDict = self.simulationHandle.getMap().getDistDict()\r\n\r\n\t\tself.pathToGoal = pathfinder.findPath(self.currentNode, self.goalNode, nodeDict, distDict)", "def calculate_path(self):\n\n mid_states = ...
[ "0.633226", "0.60474163", "0.5946504", "0.56327635", "0.5606586", "0.5580502", "0.5533409", "0.5502727", "0.5501239", "0.54937977", "0.54921687", "0.5489867", "0.54583395", "0.5449037", "0.5437878", "0.5392063", "0.5379911", "0.5334364", "0.53276527", "0.53258884", "0.5309327...
0.6523504
0
get raw text message , use rgx exp to match date formate and retun the date time
def getTransactionDate(self,message): #matches date time example (2016-04-11:10:14:29) formate date = re.findall(Analyzer.rgxDateTime,message.lower()) if len(date)>0: date = datetime.datetime.strptime(date[0], "%Y-%m-%d:%H:%M") return date.strftime('%Y-%b-%d %H:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_date_from_msg(msg):\n date = re.findall(r\"(\\d+/\\d+/\\d+, \\d+:\\d+) -\", msg)\n\n if date:\n return time.mktime(datetime.strptime(date[0], r\"%m/%d/%y, %H:%M\").timetuple())\n else:\n return 0", "def parse_date(line):\n line = line.replace(\" \", \"\")\n ...
[ "0.65641487", "0.6335901", "0.62362117", "0.62330616", "0.62234235", "0.6222178", "0.6198007", "0.61597484", "0.6155618", "0.6076213", "0.6037337", "0.6027059", "0.59837776", "0.5946511", "0.5884521", "0.5879566", "0.5863503", "0.58437204", "0.5819487", "0.5790037", "0.578024...
0.6633735
0
get raw text message , use rgx exp to match card formate and retun the creadit card details
def getCardNumber(self,message): card = re.findall(Analyzer.rgxCard,message.lower()) return card[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getTextForCards(card_db, cards):\n comment_text = ''\n for card in cards:\n log.info('getting text for %s', card)\n # Find cards containing the match\n for name, cardText in card_db.items():\n if len(card) > 2 and name.startswith(card):\n comment_text += car...
[ "0.6071487", "0.5624728", "0.56077695", "0.5495614", "0.5391737", "0.5357956", "0.53489506", "0.5335523", "0.5303632", "0.52981555", "0.5225356", "0.51929516", "0.5133588", "0.5097494", "0.5094368", "0.5050012", "0.50434184", "0.5043074", "0.5032314", "0.50150055", "0.5000781...
0.6293232
0
get raw text message , use rgx exp to match amount formate and retun the transaction amount involved in (spent/recived/payment)
def getTransactionAmount(self,message): amount = re.findall(Analyzer.rgxAmount,message.lower()) return amount[0].capitalize()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_text_message(self, update, context):\n chat_id = update.effective_chat.id\n log.info(\"Msg from:%s `%s`\", chat_id, update.effective_message.text)\n\n if context.user_data[\"state\"] == c.State.EXPECTING_AMOUNT:\n log.info(\"Vol:%s spent %s MDL on this request\", chat_id, upd...
[ "0.5996502", "0.5922988", "0.5576426", "0.54886925", "0.546111", "0.54307246", "0.54117864", "0.5355423", "0.5314626", "0.5292755", "0.5248586", "0.5222277", "0.5217991", "0.5210428", "0.5159444", "0.51569396", "0.51449794", "0.51265234", "0.5114394", "0.5110695", "0.51095766...
0.6767109
0
return sms recived time
def getSmsRecivedDate(self,timestamp): #convert millisec to sec timestamp = timestamp/1000 date = datetime.datetime.fromtimestamp(timestamp).strftime('%Y-%b-%d %H:%M %p') return date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getTime(self, request, context):\n\t\t\n date = re.split(\"\\s\", datetime.utcnow().strftime(\"%Y %m %d %H %M %S\"))\n\n return droneconnect_pb2.Time(year = int(date[0]), month = int(date[1]), day = int(date[2]), hour = int(date[3]), minute = int(date[4]), second = int(date[5]))", "def get_time...
[ "0.65966994", "0.6593268", "0.656062", "0.6535433", "0.6514749", "0.64928573", "0.64534503", "0.643763", "0.64019775", "0.6398992", "0.63851357", "0.63639313", "0.63570875", "0.6333871", "0.631595", "0.6311384", "0.63042766", "0.63024795", "0.62929374", "0.62873673", "0.62749...
0.7041934
0
Main execution scheduler. A thread pool handles concurrent monitoring of the targets specified in the `config` attribute. The thread pool allocates as many workers as targets in the `config` attribute, rounded to the next ten. Each thread monitors a single target.
def run(self): self.logger.info("Starting execution loop...") with ThreadPoolExecutor( max_workers=len(self.config) + 10 - (len(self.config) % 10) ) as executor: for target in self.config: executor.submit(self.monitor, target) executor.shutdown...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pooling(lconf, poolsize=10):\n pool = Pool(poolsize)\n pool.map(worker, lconf)", "def __init__(self, pool, params = None):\n\n # initialize thread\n Thread.__init__(self)\n\n # store link to threads pool\n self.pool = pool\n\n # set control parameteres\n self.t...
[ "0.6129839", "0.576635", "0.56305224", "0.56216407", "0.5585919", "0.55854297", "0.55526876", "0.5550458", "0.552272", "0.5518598", "0.54655826", "0.544792", "0.54425204", "0.54304606", "0.54080427", "0.53294516", "0.52878016", "0.5286612", "0.5274366", "0.5272041", "0.526809...
0.67737037
0
Busy monitoring loop. Implements an infinite loop to monitor a target. During each iteration of the run loop a target gets queried and the result is published to the kafka topic specified in the `topic` attribute. A busy wait loop pauses execution in 1 second intervals until the next scheduled check time. The nature of...
def monitor(self, target): while self.RUNNING: check_time = datetime.now() next_check = check_time + timedelta(seconds=target["frequency"]) try: self.produce( get(target["url"], timeout=target["frequency"] - 0.5), targe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def monitor(\n config: TextIO,\n period: float,\n timeout: float,\n brokers: str,\n security_protocol: str,\n ssl_cafile: Optional[str],\n ssl_certfile: Optional[str],\n ssl_keyfile: Optional[str],\n topic: str,\n):\n logging.basicConfig(level=logging.INFO)\n\n targets = [Target.fr...
[ "0.5902339", "0.58885413", "0.575003", "0.5728945", "0.5496083", "0.54576224", "0.54416424", "0.54416424", "0.54308736", "0.5429214", "0.5400883", "0.5382127", "0.5374598", "0.53490657", "0.53335357", "0.53321594", "0.53210837", "0.53199905", "0.53106666", "0.53096336", "0.53...
0.67463195
0
cache_man from .cacheManager import RedisPandas as RedisPandasCacheManager
def __init__(self, cache_man=None): # manager of redis-pandas caching self.cache_man = cache_man super().__init__()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dynCache(*args, **kwargs)->None:\n pass", "def pymod_cache():\n pymod.cache.cache = Singleton(pymod.cache.factory)", "def _cache(self):\n return self._class(self.client_servers, **self._options)", "def enable_cache(self, **kwargs: Dict[str, Any]) -> None:\n pass", "def __init__(self...
[ "0.61008185", "0.5852885", "0.5846122", "0.5749667", "0.5716132", "0.561787", "0.560689", "0.5515818", "0.5514327", "0.5503253", "0.54831594", "0.5477698", "0.5466682", "0.5424442", "0.54148114", "0.5401022", "0.54007477", "0.536242", "0.53278464", "0.531406", "0.5306222", ...
0.76886517
0
Get lending history from Poloniex. If begin or end is not specified, its most extreme value is assumed.
def getLendingHistory(self, begin = None, end = None): # TODO: implement a local cache raw = handleBeginEndCall(begin, end, self.api.returnLendingHistory) return ensure.listOf(raw=raw, path="lendingHistory", ensurer=partial(ensure.dictOf, ensureRest=ensure...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def return_trade_history(\n self,\n start: Timestamp,\n end: Timestamp,\n ) -> list[dict[str, Any]]:\n limit = 100\n data: list[dict[str, Any]] = []\n start_ms = start * 1000\n end_ms = end * 1000\n while True:\n new_data = self.api_...
[ "0.6166453", "0.6067733", "0.5763016", "0.5711478", "0.5711478", "0.56834674", "0.5679602", "0.5616543", "0.5599327", "0.55915034", "0.55753577", "0.5565598", "0.5534948", "0.5534948", "0.5438004", "0.54300654", "0.5405952", "0.54046893", "0.5392884", "0.53381467", "0.5327400...
0.79686886
0
Get active loans on Poloniex. If begin or end is not specified, its most extreme value is assumed. Returns a dict where the key "provided" has all the loans the user has provided and the key "used" has all the loans that the user is using on margin.
def getActiveLoans(self, begin = None, end = None): raw = handleBeginEndCall(begin, end, self.api.returnActiveLoans) typeActiveLoanList = partial(ensure.listOf, ensurer=partial(ensure.dictOf, ensureRest=ensure.fail, ensurers={ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_provided_loans(self):\n assert self.is_valid(), \"MortechScenario is invalid.\"\n\n return list(self.instance.rate_quote_requests.first().rate_quote_lenders.values(\n 'amortization_type', 'term').order_by('-amortization_type', 'term'))", "def get_db_loans(self):\n if not s...
[ "0.5495479", "0.5185972", "0.5144908", "0.5060369", "0.5053483", "0.50387776", "0.4886945", "0.4859212", "0.48108947", "0.4794146", "0.4704759", "0.47033975", "0.47007096", "0.46696705", "0.46048933", "0.4588117", "0.4582222", "0.453084", "0.45289302", "0.4482744", "0.4471106...
0.76838017
0
That custom action allows an admin (or an automated task) to notify a users who will attend the retreat with an existing automated email preconfigured (AutomaticEmail).
def execute_automatic_email(self, request, pk=None): try: retreat = Retreat.objects.get(pk=pk) except Exception: response_data = { 'detail': "Retreat not found" } return Response(response_data, status=status.HTTP_400_BAD_REQUEST) t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def task_send_reminder_email():\n send_reminder_email()\n logger.info(\"Sent reminder email\")", "def execute(self):\n return LOGGER.info(f\"{datetime.datetime.now()} - Sending EMail to the configured email list\")", "def send_created_email(self):\n if settings.NOTIFY_NEW_REG:\n ...
[ "0.70443213", "0.6942522", "0.68597895", "0.6715661", "0.6678235", "0.6592738", "0.6571212", "0.65063936", "0.64056146", "0.63531345", "0.6343027", "0.6257857", "0.6238844", "0.6211769", "0.6198119", "0.6190949", "0.6187726", "0.61771655", "0.61745304", "0.6147426", "0.612517...
0.71214974
0
That custom action allows an admin (or automated task) to notify users who has attended the retreat.
def recap(self, request, pk=None): retreat = self.get_object() # This is a hard-coded limitation to allow anonymous users to call # the function. time_limit = retreat.end_time - timedelta(days=1) if timezone.now() < time_limit: response_data = { 'detai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_reminder(self):\n pass", "def task_rescheduled_notify(name, attempts, last_error, date_time, task_name, task_params):\n body = loader.render_to_string(\n 'notification/email/notify_rescheduled_task.html', {\n 'name': name,\n 'attempts': attempts,\n 'last...
[ "0.6148691", "0.6102189", "0.60351086", "0.595893", "0.59520566", "0.5929308", "0.58195484", "0.58165395", "0.581323", "0.57769185", "0.575366", "0.5751757", "0.5739794", "0.5717994", "0.5706541", "0.5668807", "0.56387633", "0.56247973", "0.55528677", "0.55506504", "0.5531511...
0.6143004
1
This viewset should return the request user's wait_queue except if the currently authenticated user is an admin (is_staff).
def get_queryset(self): if self.request.user.is_staff: return WaitQueue.objects.all() return WaitQueue.objects.filter(user=self.request.user)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_on_waiting_list(self):\n if self.user is None:\n return False\n if unicode(self.user._id) in self.barcamp.event.waiting_list:\n return True\n return False", "def get_queryset(self):\n qs = Job.objects.filter(user=self.request.user)\n return qs", "...
[ "0.6125385", "0.5814197", "0.5709915", "0.5621444", "0.5583731", "0.55745983", "0.5551286", "0.55330896", "0.5509355", "0.55080956", "0.5506051", "0.5451261", "0.5443944", "0.54077107", "0.5389822", "0.5386254", "0.53803307", "0.53722817", "0.5372129", "0.53720546", "0.537012...
0.76176137
0
In larger samples, older tweets have a slight advantage. Is there a way to incorporate age into score bearing in mind that tweets receive most engagement directly proximate to the time they are posted?
def alt_score(objects): scores = {} for tweet in objects: data = tweet._json raw_time = datetime.strptime( data['created_at'], '%a %b %d %H:%M:%S +0000 %Y' ) age = ((datetime.utcnow() - raw_time).seconds / 60) + 1 rt = data[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def statistics(all_new_tweets, all_retweets, all_quote_tweets):\n length_all_quote_tweets = len(all_quote_tweets)\n length_all_retweets = len(all_retweets)\n length_all_tweets = len(all_new_tweets)\n\n # print(db_twitter.collections.stats())\n total_tweets = length_all_quote_tweets + length_all_retw...
[ "0.5936378", "0.5731952", "0.5720582", "0.57109797", "0.5594547", "0.54951376", "0.54837483", "0.5438032", "0.5414227", "0.5393685", "0.5375611", "0.53599745", "0.5359586", "0.53584766", "0.5351381", "0.5322623", "0.5321799", "0.53207713", "0.5315565", "0.5312345", "0.528349"...
0.63945764
0
Return sorted merged list of list 1 and list 2.
def merge(list1: list, list2: list) -> list: result = [] i = 0 j = 0 # Iterate through each element and append the smaller element of each list to the resulting list. while i < len(list1) and j < len(list2): if list1[i] < list2[j]: result.append(list1[i]) i +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge ( list1, list2 ):\n new_list = []\n while len(list1)>0 and len(list2)>0:\n if list1[0] < list2[0]:\n new_list.append (list1[0])\n del list1[0]\n else:\n new_list.append (list2[0])\n del list2[0]\n return new_list + list1 + list2", "def merge_sort(in_list1...
[ "0.81458104", "0.8071997", "0.8070964", "0.80674607", "0.8054604", "0.7999209", "0.7991678", "0.7963324", "0.7960254", "0.7954852", "0.7936754", "0.78965044", "0.7882416", "0.78804654", "0.78603756", "0.78375834", "0.7828495", "0.7810021", "0.7797237", "0.77964824", "0.776256...
0.8098357
1
Return sorted list 'l' using the merge sort method.
def merge_sort(l: list) -> list: # Trap for lists with one or fewer elements. if len(l) <= 1: return l[:] # Divide the list into 2 mid = len(l) // 2 first = l[mid:] second = l[:mid] # Recursively sort smaller lists and merge the two resulting lists. left = merge_sort(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge_sort(L):\n n = len(L)\n if n < 2:\n return L\n mid = n // 2\n left = L[:mid]\n right = L[mid:]\n merge_sort(left)\n merge_sort(right)\n merge(L, left, right)", "def merge_sort(li):\n if not li or len(li) == 1:\n return li\n if len(li) == 2:\n return [l...
[ "0.7653446", "0.7545769", "0.7453274", "0.73444694", "0.7336814", "0.71839064", "0.7159206", "0.7144828", "0.7137397", "0.7104736", "0.70955265", "0.7093474", "0.7065845", "0.69580597", "0.695109", "0.6936721", "0.69060755", "0.69006824", "0.6871662", "0.68302464", "0.6825865...
0.849049
0
Splits a list of contours up, in order to break erroneous connections
def splitContours(contours): split_contours = [] for contour in contours: c = contour.reshape(-1, 2) line_segments = splitLine(c) for seg in line_segments: # Turn it back to its original shape, so we can add it back to contours new_contour = seg.reshape(-1,1,2) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __filter_contours(input_contours, min_area, min_perimeter, min_width, max_width,\n min_height, max_height, solidity, max_vertex_count, min_vertex_count,\n min_ratio, max_ratio):\n output = []\n for contour in input_contours:\n x,y,w,h = cv2...
[ "0.65520024", "0.65293825", "0.63966143", "0.6212063", "0.5906493", "0.5883211", "0.5851136", "0.5776912", "0.5771616", "0.5739246", "0.57271856", "0.5711884", "0.5679898", "0.56679344", "0.5664758", "0.56382406", "0.5612798", "0.5598358", "0.55936086", "0.558226", "0.5550980...
0.8130297
0
Splits a line on horizontal or vertical segments
def splitLine(line): # Find a point where our line changes direction l = np.copy(line) change = l[2:] - l[:-2] # Create breaks where derivative equals 0 break_indicies = np.unique(np.where(change == 0)[0]) line_segments = [] while break_indicies.size > 0: i = break_indicies[0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_line(self, start, end, increment):\n\n # Determine the number of splits of the line\n num_splits = int(np.linalg.norm(end - start)/increment)\n return (\n np.linspace(start[0], end[0], num_splits),\n np.linspace(start[1], end[1], num_splits)\n ...
[ "0.7124649", "0.6998856", "0.6508695", "0.6341831", "0.6314455", "0.6314035", "0.62689936", "0.6227574", "0.62108076", "0.6144152", "0.6136089", "0.61176264", "0.6100554", "0.6095854", "0.6090961", "0.60480887", "0.60312134", "0.6004024", "0.5987652", "0.5987652", "0.5987652"...
0.7234831
0
Create a blob generator.
def blob_generator(self): for blob in self.data: yield blob
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_buffers(self):", "def CreateBlob(self, blob_key, blob):\n self._blobs[blobstore.BlobKey(unicode(blob_key))] = blob", "def make_blob(self, format=None):\n if format is not None:\n with self.convert(format) as converted:\n return converted.make_blob()\n libra...
[ "0.60091376", "0.5996832", "0.597007", "0.5943549", "0.58784413", "0.5807868", "0.57830435", "0.5756485", "0.56838185", "0.56160134", "0.55723584", "0.5553558", "0.5541709", "0.5527996", "0.5492829", "0.54868263", "0.5446602", "0.54146886", "0.54030657", "0.539622", "0.534915...
0.65368706
0
Load Panoptic CMU dataset calibrations from HD cameras, convert in to a is_msgs.camera_pb2.CameraCalibration protobuf.
def load_calibrations_pb(calibrations_file, referencial=9999, cameras=None): with open(calibrations_file, 'r') as f: calibrations = json.load(f)['cameras'] calibrations = list(filter(lambda d: d['type'] == 'hd', calibrations)) calibrations_pb = {} for calibration in calibrations: calib...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _read_calibration_params(self) -> np.ndarray:\n print('Loading calibration parameters...')\n cameras_data = []\n\n for c in range(self.num_cameras):\n camera = 'camera' + str(c).zfill(2) + '.json'\n print(' ', camera+'...')\n with open(os.path.join(self....
[ "0.58565867", "0.5808471", "0.5624357", "0.55827814", "0.5529193", "0.5349439", "0.53183925", "0.520689", "0.51068753", "0.509323", "0.5081582", "0.5078472", "0.50341135", "0.5029009", "0.50247097", "0.50007606", "0.49819723", "0.49460095", "0.49164572", "0.49079505", "0.4905...
0.6427963
0
Sample a `task_state` from the set of `n_tasks` tasks. `task_state` contains all the information that the environment needs to switch to any other task. The subclasses, extending this class, should ensure that the task seed is set (by calling `seed(int)`) before invoking this method (for reproducibility). It can be don...
def sample_task_state(self) -> TaskStateType: self.assert_task_seed_is_set() if not self._are_tasks_set: self.tasks = [self.env.sample_task_state() for _ in range(self.n_tasks)] self._are_tasks_set = True # The assert statement (at the start of the function) ensures that...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample_task(train_steps_per_task, args):\n sample_task_ids = []\n for task_id in range(len(args.tasks)):\n sample_task_ids += [task_id] * train_steps_per_task[task_id]\n sample_task_ids = np.random.choice(sample_task_ids, len(sample_task_ids), replace = False)\n return sample_task_ids", "d...
[ "0.6509063", "0.6321272", "0.606501", "0.5921897", "0.5916533", "0.5866668", "0.57333434", "0.5661045", "0.5640622", "0.5639599", "0.56183374", "0.55878544", "0.55499834", "0.5540597", "0.55245495", "0.5504675", "0.5495197", "0.5441948", "0.5435278", "0.5432545", "0.5411352",...
0.8234007
0
Sample a new task_state from the set of `n_tasks` tasks and set the environment to that `task_state`.
def reset_task_state(self) -> None: self.set_task_state(task_state=self.sample_task_state())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample_task_state(self) -> TaskStateType:\n self.assert_task_seed_is_set()\n if not self._are_tasks_set:\n self.tasks = [self.env.sample_task_state() for _ in range(self.n_tasks)]\n self._are_tasks_set = True\n\n # The assert statement (at the start of the function) e...
[ "0.6834481", "0.64314014", "0.62267506", "0.6132887", "0.60530394", "0.6046136", "0.5907816", "0.5832524", "0.5668584", "0.56342", "0.5589515", "0.55429584", "0.5518941", "0.5468032", "0.5432866", "0.5358191", "0.5351617", "0.53382146", "0.53057265", "0.52824444", "0.52814126...
0.6531516
1
Test StudyEventRecord include_option is a boolean, when False only required params are included, when True both required and optional params are included
def make_instance(self, include_optional): # model = rcc.models.study_event_record.StudyEventRecord() # noqa: E501 if include_optional : return StudyEventRecord( participant_id = '0', participant_screening_number = '0', participant_status = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_request_with_include(self):\n request = StudySubjectsRequest(self.project_name, self.environment, include=\"inactive\")\n self.assertTrue(\"include=inactive\" in request.url_path())\n request = StudySubjectsRequest(self.project_name, self.environment,\n ...
[ "0.54336905", "0.5022755", "0.49850667", "0.49718994", "0.49210805", "0.49035513", "0.48337457", "0.48128986", "0.4803448", "0.47748813", "0.47576723", "0.47553274", "0.4741714", "0.47406778", "0.47356173", "0.47267687", "0.47252598", "0.47216046", "0.46823388", "0.46793014", ...
0.50786775
1
Verify the escalate cronjob escalates the right questions.
def test_escalate_questions_cron(self, submit_ticket): questions_to_escalate = [ # Questions over 24 hours old without an answer. question( created=datetime.now() - timedelta(hours=24, minutes=10), save=True), question( created...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def escalated(self) -> bool:\n return pulumi.get(self, \"escalated\")", "def test_check_opt_crashed(self):\n self.assertEqual(check_opt(self.jobset2.job), 'ocrashed')", "def test_escalate(client):\n g.test_authorized_for = []\n res = client.get(\"/v0/escalate\" + get_request_args)\n asse...
[ "0.6098535", "0.5954253", "0.5770075", "0.56778836", "0.5653189", "0.5613711", "0.5534219", "0.5519261", "0.551744", "0.54976624", "0.5427872", "0.5415168", "0.54062545", "0.54032886", "0.5389374", "0.5351821", "0.53251755", "0.53152156", "0.5294017", "0.5284026", "0.52837247...
0.7731972
0
Convert GARMIN GPX extensions to DaimlerGPXExtensions
def _convert_wpt_extension(ext_el, wpt_out, ns, link_href, map_category, map_icon, ignore_tags): gpxx = "{%s}" % (ns["gpxx"],) gpxd = "{%s}" % (ns["gpxd"],) gxx_wp_ext = ext_el.find(gpxx + "WaypointExtension") if gxx_wp_ext is None: logging.warning("gpx:wpt has no GA...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extension_to_format(self, extension):", "def format_to_extension(self, format):", "def test_10_to_11_conversion(self) -> None:\n original_gpx = mod_gpx.GPX()\n original_gpx.creator = 'cr'\n original_gpx.name = 'q'\n original_gpx.description = 'w'\n original_gpx.time = mod...
[ "0.62534976", "0.5970687", "0.5683381", "0.5591768", "0.5466497", "0.5272536", "0.5040245", "0.5025681", "0.49907473", "0.4969336", "0.49216676", "0.491505", "0.4871239", "0.48646033", "0.48522973", "0.48386762", "0.4815776", "0.47955176", "0.4742832", "0.47366953", "0.472019...
0.6889003
0
Recursive copy tags in GPX namespace, trims text elements
def _copy_gpx_tags(el, out): if not el.tag.startswith("{http://www.topografix.com/GPX/1/1}"): return out_el = ET.Element(el.tag, attrib=el.attrib) if el.text: t = el.text.strip() if t: out_el.text = t for c in el: _copy_gpx_tags(c, out_el) if el.tail: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _fix_treetags(self, tree):\n for element in tree:\n element.tag = element.tag.split('}')[1]\n if len(element.getchildren()) > 0:\n self._fix_treetags(element)\n return tree", "def cleanup(self):\n for element in self.root.iter():\n element....
[ "0.58033663", "0.56753886", "0.54115343", "0.53362423", "0.5299279", "0.52074224", "0.5201477", "0.5159873", "0.5110361", "0.5104303", "0.5103083", "0.50583404", "0.504787", "0.49944812", "0.49744618", "0.49732855", "0.49573326", "0.49491706", "0.4942649", "0.49129963", "0.48...
0.73163474
0
Convert PoI from GARMIN to MercedesBenz GPX extensions.
def convert_poi(input, output, map_category=(), map_icon=(), ignore_tags=()): # some tools write v2, others v3. Use RegExp to find which rx = re.compile("xmlns:([^= ]+) *=['\"]([^'\"]+/GpxExtensions/[^'\"]+)") m = None for line in input: m = rx.search(line) if m: break ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _convert_wpt_extension(ext_el, wpt_out, ns, link_href,\n map_category, map_icon, ignore_tags):\n\n gpxx = \"{%s}\" % (ns[\"gpxx\"],)\n gpxd = \"{%s}\" % (ns[\"gpxd\"],)\n\n gxx_wp_ext = ext_el.find(gpxx + \"WaypointExtension\")\n if gxx_wp_ext is None:\n logging.war...
[ "0.5783975", "0.50240463", "0.49627876", "0.49498352", "0.4949454", "0.4905467", "0.48546258", "0.47976312", "0.47859144", "0.47515818", "0.47103024", "0.47103024", "0.47103024", "0.47103024", "0.47103024", "0.47103024", "0.45977882", "0.4589827", "0.4589827", "0.4589827", "0...
0.5642554
1
Derive the desired score numbers from summarized COCOeval.
def _derive_coco_results(self, coco_eval, iou_type, class_names=None): metrics = { "bbox": ["AP", "AP50", "AP75", "APs", "APm", "APl"], "segm": ["AP", "AP50", "AP75", "APs", "APm", "APl"], "keypoints": ["AP", "AP50", "AP75", "APm", "APl"], }[iou_type] if coc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_score(n, prob_vals, cat_cols, list_cols):\n score = 0\n for c in cat_cols:\n if n[c] is not None:\n score += prob_vals[n[c]]\n for c in list_cols:\n for d in n[c]:\n score += prob_vals[d]\n score *= n[\"Nc\"]\n score *= n[\"Ec\"]\n return score", "de...
[ "0.648103", "0.6470733", "0.6412945", "0.6402254", "0.63825125", "0.63553005", "0.62739587", "0.62516236", "0.6226133", "0.6198514", "0.6193239", "0.61892873", "0.6183285", "0.61569417", "0.6150895", "0.6127805", "0.6115141", "0.61097616", "0.6106848", "0.6098736", "0.6096362...
0.65436095
0
Create a small table using the keys of small_dict as headers. This is only suitable for small dictionaries.
def create_small_table(small_dict): keys, values = tuple(zip(*small_dict.items())) table = tabulate( [values], headers=keys, tablefmt="pipe", floatfmt=".3f", stralign="center", numalign="center", ) return table
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_table_with_header(header_dict, headers=[\"category\", \"AP\"], min_cols=6):\n assert min_cols % len(headers) == 0, \"bad table format\"\n num_cols = min(min_cols, len(header_dict) * len(headers))\n result_pair = [x for pair in header_dict.items() for x in pair]\n row_pair = itertools.zip_lon...
[ "0.638909", "0.60119313", "0.59595156", "0.59311914", "0.5880076", "0.5851694", "0.5764492", "0.56591946", "0.5609821", "0.55930716", "0.55549663", "0.54851717", "0.546311", "0.5443825", "0.54374933", "0.54262483", "0.54227966", "0.5403215", "0.5359692", "0.5349228", "0.53306...
0.8619385
1
Run a function func for all i in a iterator list.
def process_list(_func, iterator, *args, **kwargs): return [_func(i, *args, **kwargs) for i in iterator]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def each(self, func):\n\n for i in self._:\n func(i)\n return self", "def foreach(func, iterable):\n\n\tfor x in iterable:\n\t\tfunc(x)", "def iterate(func: Callable[..., T], x: T, *args, index: Index = None):\n func = to_callable(func)\n index = to_index_seq(index)\n\n if ind...
[ "0.7419226", "0.7195103", "0.69579923", "0.68458927", "0.68011767", "0.67925817", "0.6455656", "0.6398441", "0.63082886", "0.63078785", "0.6304939", "0.6289067", "0.6268418", "0.6252544", "0.61896396", "0.61752886", "0.6161366", "0.61296254", "0.6128117", "0.6104134", "0.6072...
0.7234022
1
Scan and replace {key} values in a dictionary by dictionary['key'] value.
def batch_key_replace(dictionary, key=None): if key is None: for i in dictionary.keys(): batch_key_replace(dictionary, i) return if isinstance(dictionary[key], (six.string_types)): for i in dictionary.keys(): if '{'+i+'}' in dictionary[key]: logge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replacer(s,replace_dict):\n for k,v in replace_dict.items(): s = s.replace(k,v)\n return s", "def recursiveSearchReplace(x, s, r):\n for k, v in x.items():\n if type(v) is dict:\n recursiveSearchReplace(v, s, r)\n else:\n if v == s:\n x[k] = r", "...
[ "0.6652023", "0.6559494", "0.65160686", "0.6507819", "0.64775777", "0.63402003", "0.6291863", "0.62852573", "0.6272136", "0.6248845", "0.6182274", "0.6068545", "0.6062039", "0.6027335", "0.5958833", "0.58965504", "0.58614916", "0.57977337", "0.57971907", "0.5782543", "0.57820...
0.6770044
0
Daily prices are correctly returned.
def test_list_daily_prices(self): from grand_exchanger.resources.graph import Graph price_history = Graph( daily={ datetime(2020, 7, 26, 0, 0): 120, datetime(2020, 7, 25, 0, 0): 110, datetime(2020, 7, 27, 0, 0): 100, }, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def daily_price():\n for item in data:\n if valid_date(item):\n yield data[item]['daily_value']", "def get_prices(self):\n pass", "def check_price(self):\n return self.day*self.price", "def get_simple_price(self, content, date = None):\n\...
[ "0.7889206", "0.71602726", "0.68108416", "0.6652942", "0.6549395", "0.6513589", "0.6488553", "0.64740074", "0.6420494", "0.6379489", "0.63699085", "0.6366427", "0.6342553", "0.6289854", "0.6279439", "0.6228092", "0.6221857", "0.62032604", "0.6202428", "0.61435574", "0.6121479...
0.74128586
1
Daily average prices are correctly returned.
def test_list_average_prices(self): from grand_exchanger.resources.graph import Graph price_history = Graph( daily={}, average={ datetime(2020, 7, 26, 0, 0): 100, datetime(2020, 7, 27, 0, 0): 104, datetime(2020, 7, 25, 0, 0): 110, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def daily_price():\n for item in data:\n if valid_date(item):\n yield data[item]['daily_value']", "def aveVolumeCalc(ins, date):\n cal = ins.Currency().Calendar()\n enddate = cal.AdjustBankingDays(date, 0)\n startdate = cal.AdjustBankingDays(date,...
[ "0.68519443", "0.6844614", "0.6771448", "0.6729235", "0.6658336", "0.6622681", "0.66097325", "0.65468365", "0.6511063", "0.64953476", "0.6464222", "0.63316655", "0.6264362", "0.6255493", "0.6183782", "0.61707854", "0.6168207", "0.6126438", "0.6105181", "0.60951585", "0.608910...
0.7206603
0
Test renaming columns in a data frame with duplicate column names.
def test_rename_columns(dupcols): # Rename the first column d1 = rename(dupcols, columns='Name', names='Person') assert d1.columns[0] == 'Person' assert dupcols.columns[0] == 'Name' assert d1.columns[1] == 'A' assert d1.columns[2] == 'A' for col in d1.columns: assert isinstance(col, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_duplicated_column_names(suffix: str) -> None:\n path = rsc / duplicated_column_names_file\n df = read_ods(path.with_suffix(suffix), 1)\n\n assert isinstance(df, pd.DataFrame)\n assert len(df.columns) == 4\n assert \"website.1\" in df.columns", "def text_rename_column_errors(dupcols):\n ...
[ "0.7377957", "0.72185993", "0.713909", "0.6914577", "0.6852343", "0.67460626", "0.6673696", "0.665487", "0.6567712", "0.6522969", "0.647519", "0.645901", "0.6456079", "0.64481306", "0.64196503", "0.63319165", "0.6326535", "0.632065", "0.6305097", "0.62651145", "0.6187215", ...
0.7988582
0
based on multiclass column stratify_column return stratified df
def simple_stratify(df, statify_column, seed=0, ratios=None, verbose=False): if ratios == "original": return df else: np.random.seed(seed) vc = df[statify_column].value_counts() masks = [(df[statify_column] == v) for v in vc.index] sizes = list(vc) if not isinstan...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stratify_dataset(input_filepath, output_filepath):\n logger = logging.getLogger(__name__)\n logger.info(f'stratifying file {input_filepath}')\n\n df = pd.read_feather(Path.cwd().joinpath(input_filepath))\n\n # Splitting\n strat_cols = ['hospital_death']\n logger.info(f'stratifying on cols: {s...
[ "0.63780504", "0.6142104", "0.6085888", "0.59189284", "0.5893226", "0.57741255", "0.56523603", "0.5641864", "0.5622481", "0.5598705", "0.5577722", "0.5561399", "0.55272675", "0.55267155", "0.5507569", "0.54556173", "0.5453896", "0.5447879", "0.5431113", "0.538737", "0.5384462...
0.6322125
1
Finds the first iterated number greater than cap
def advent_3b(cap): for x in iter_nums(): if x > cap: return x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lower_bound(stock):\n counter=0\n for i in stock_price(stock):\n if i <= support(stock):\n counter+=1\n return counter", "def le(value, limit):\n return value <= limit", "def nextMin(value,lista):\n for i in lista:\n if i<value:\n return i\n raise NameE...
[ "0.6351483", "0.6168543", "0.61084723", "0.6101938", "0.6082835", "0.6043279", "0.6039842", "0.5966022", "0.59469485", "0.59140044", "0.5901743", "0.5868859", "0.58653957", "0.5860607", "0.5852442", "0.58481956", "0.58087164", "0.57851624", "0.5770347", "0.576802", "0.5763773...
0.7898799
0
Get the value at (x, y) in the cache, or return 0
def get_or_zero(x, y): coord = (x, y) if coord in saved: return saved[coord] else: return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def retrieve_from_cache(self, x, y):\n return False", "def get(self, x, y):\n i = self.map[y][x]\n return self.get(i)", "def _get(self, (y, x)):\n return self[y][x]", "def get_at(self,x,y):\n\t\tif ( not self._validate(x,y )):\n\t\t\treturn\n\n\t\tif (self.Grid[y] & (1 << x)) != 0...
[ "0.7230015", "0.713275", "0.6867837", "0.6827668", "0.6683974", "0.6588269", "0.64383924", "0.63684833", "0.632808", "0.62731206", "0.6246557", "0.621092", "0.6204634", "0.62017787", "0.61367697", "0.6070151", "0.604608", "0.60243165", "0.6018572", "0.60132456", "0.60131377",...
0.7924737
0
Defines a generator which goes through and outputs all coordinates in order
def iter_coords(): yield (0, 0) incr = 0 x = 1 y = 0 while True: incr += 2 top = y + incr - 1 bot = y - 1 left = x - incr right = x yield (x, y) while y < top: y += 1 yield (x, y) while x > left: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iter__(self):\n for label, coord_seq in self.coords.items():\n for coordinate in coord_seq:\n yield (label, tuple(coordinate),)", "def __iter__(self):\n pt = (self.x, self.y)\n for i in pt:\n yield i", "def __iter__(self):\n for coord i...
[ "0.70693576", "0.70180815", "0.6968817", "0.69436073", "0.68629885", "0.6743751", "0.67031896", "0.6669693", "0.6666168", "0.66145986", "0.6597919", "0.6557781", "0.6551774", "0.6535513", "0.64855766", "0.64724666", "0.6430375", "0.63692117", "0.636663", "0.63533825", "0.6312...
0.70703125
0
Check all the known values for coordinates to see if the function works
def test_get_coords(self): known_values = { 1: (0, 0), 2: (1, 0), 3: (1, 1), 4: (0, 1), 5: (-1, 1), 6: (-1, 0), 7: (-1, -1), 8: (0, -1), 9: (1, -1), 10: (2, -1), 11: (2, 0), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_coords():\n x = np.array([8, 67, 79, 10, 52, 53, 98, 34, 15, 58], dtype=float)\n y = np.array([24, 87, 48, 94, 98, 66, 14, 24, 60, 16], dtype=float)\n\n return x, y", "def test_coord_preceding_fs(self):", "def test_validate_coord(c, ans):\n result = _validate_coord(c)\n np.testing.asser...
[ "0.7136465", "0.7038727", "0.6966961", "0.6854041", "0.6832338", "0.6783662", "0.67153215", "0.6652027", "0.6640126", "0.661962", "0.6586066", "0.65586877", "0.65100974", "0.6484857", "0.64741474", "0.64303166", "0.64178216", "0.64039254", "0.6334708", "0.63271356", "0.632040...
0.73629725
0
Test we're traversing things in the right order
def test_traversal(self): expected = [ (0, 0), (1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1), (2, -1), (2, 0), (2, 1), (2, 2), (1, 2), (0, 2), (-1, 2), (-2, 2), (-2, 1), (-2, 0), (-2, -1), (-2, -2), (-1, -2), (0, -2), (1, -2), (2, -2), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_pre_order_traversal(our_bsts):\n bpo = []\n for i in our_bsts[0].pre_order():\n bpo.append(i)\n assert bpo == our_bsts[4]", "def check():\r\n for a in l:\r\n for b in l:\r\n assert not(b in comes_after[a] and a in comes_after[b])", "def test_in_order_tr...
[ "0.6352901", "0.63276374", "0.6201018", "0.6180664", "0.61806107", "0.6171108", "0.6043457", "0.60309047", "0.5991851", "0.592162", "0.59191626", "0.5893606", "0.5835151", "0.5785652", "0.5762728", "0.5753571", "0.5713894", "0.56921405", "0.5688332", "0.56389415", "0.56172585...
0.64554596
0
Insert data in MongoDB and then check if MongoDB Oplog origin captures changes in data from MongoDB correctly.
def test_mongodb_oplog_origin(sdc_builder, sdc_executor, mongodb): pipeline_builder = sdc_builder.get_pipeline_builder() pipeline_builder.add_error_stage('Discard') time_now = int(time.time()) mongodb_oplog = pipeline_builder.add_stage('MongoDB Oplog') database_name = get_random_string(ascii_letter...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_dump_collection(self):\n\n test_oplog, primary_conn, search_ts = self.get_oplog_thread()\n solr = DocManager()\n test_oplog.doc_manager = solr\n\n #with documents\n primary_conn['test']['test'].insert({'name': 'paulie'})\n search_ts = test_oplog.get_last_oplog_tim...
[ "0.6429376", "0.60449505", "0.5981277", "0.5936174", "0.58905137", "0.5889982", "0.5888583", "0.5883359", "0.5859019", "0.5817696", "0.5790354", "0.5765433", "0.57403356", "0.57361704", "0.57341456", "0.572462", "0.5723983", "0.57150495", "0.57117057", "0.5703996", "0.5691165...
0.6801271
0
Create 3 simple documents consists with BSON Binary data type in MongoDB and confirm that MongoDB origin reads them.
def test_mongodb_origin_simple_with_BSONBinary(sdc_builder, sdc_executor, mongodb): ORIG_BINARY_DOCS = [ {'data': binary.Binary(b'Binary Data Flute')}, {'data': binary.Binary(b'Binary Data Oboe')}, {'data': binary.Binary(b'Binary Data Violin')} ] pipeline_builder = sdc_builder.get_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_create_one(database) -> None:\n # Use a specific collection\n col = database[\"test_create_one\"]\n # Clean collection\n await col.delete_many()\n assert await col.read_one() is None\n # Define some document\n document = {\"key1\": \"value1\", \"key2\": 2}\n # Create it\n ...
[ "0.6070193", "0.60316694", "0.5850651", "0.580097", "0.5770713", "0.5768167", "0.57400936", "0.5737715", "0.57312566", "0.57232314", "0.5708691", "0.5689501", "0.568436", "0.5682678", "0.5681692", "0.56426793", "0.5627072", "0.56140417", "0.5606065", "0.55834246", "0.5549807"...
0.700149
0
Send simple text into MongoDB destination from Dev Raw Data Source and confirm that MongoDB correctly received them using PyMongo.
def test_mongodb_destination(sdc_builder, sdc_executor, mongodb): pipeline_builder = sdc_builder.get_pipeline_builder() pipeline_builder.add_error_stage('Discard') dev_raw_data_source = pipeline_builder.add_stage('Dev Raw Data Source') dev_raw_data_source.set_attributes(data_format='TEXT', raw_data='\n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def MongoSave(message):\n client = pymongo.MongoClient(\"localhost\",27017)\n db = client.PortfolioTracker\n db.AllPortfolios.save(message)#this must be a dictionary for proper insertion http://docs.python.org/2/tutorial/datastructures.html#dictionaries", "def test_mongodb_origin_simple_with_BSONBinary(...
[ "0.6143543", "0.6044195", "0.58246434", "0.54334843", "0.53539765", "0.5237164", "0.521712", "0.5154699", "0.5103526", "0.5098149", "0.5097453", "0.50923645", "0.5044057", "0.49933583", "0.4970485", "0.49630824", "0.4924834", "0.49241394", "0.49106723", "0.49081203", "0.48980...
0.6135984
1
returns a imgLoader object initiated with the ra dec above
def L_radec(): return sdssimgLoader(ra=ra , dec=dec, dir_obj=dir_obj, img_width=img_width, img_height=img_height)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, images, loader):\n super().__init__()\n self._images = images\n self._loader = loader", "def get_loader(config, image_path, crop_size, batch_size,sampler, num_workers=2, mode='train', augmentation_prob=0.4):\r\n\r\n dataset = ImageFolder(config)\r\n data_loader = dat...
[ "0.6472878", "0.6436833", "0.6369275", "0.6361225", "0.61508703", "0.59633315", "0.5946812", "0.5922818", "0.5854391", "0.58503664", "0.58443534", "0.5820545", "0.58049935", "0.5789614", "0.5731421", "0.57122487", "0.5698557", "0.56604964", "0.5659908", "0.56177664", "0.56150...
0.7199871
0
returns a imgLoader object initiated with the ra dec above of img size 6464
def L_radec_64pix(): return sdssimgLoader(ra=ra , dec=dec, dir_obj=dir_obj, img_width=64, img_height=64)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def L_radec():\n\treturn sdssimgLoader(ra=ra , dec=dec, dir_obj=dir_obj, img_width=img_width, img_height=img_height)", "def get_loader(config, image_path, crop_size, batch_size,sampler, num_workers=2, mode='train', augmentation_prob=0.4):\r\n\r\n dataset = ImageFolder(config)\r\n data_loader = data.DataLoa...
[ "0.65220857", "0.64532083", "0.6366242", "0.6233682", "0.6084506", "0.5980899", "0.58826625", "0.5874689", "0.5843059", "0.5761539", "0.57205886", "0.5719049", "0.5691309", "0.568681", "0.5685802", "0.5679067", "0.5654638", "0.5644806", "0.56220955", "0.55961686", "0.5575605"...
0.7360007
0
test that when overwrite=True make_stamp() always call download_stamp() whether file exists or not
def test_make_stamps_overwriteTrue(L_radec): L = L_radec band = 'r' overwrite = True file = dir_obj+'stamp-{0}.fits'.format(band) if os.path.isfile(file): os.remove(file) # when file does not exist it creates stamp assert not os.path.isfile(file) L.make_stamps(overwrite=overwrite) assert os.path.isfile(f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_make_stamps_overwriteFalse(L_radec):\n\tL = L_radec\n\n\toverwrite = False\n\n \tfor band in L.bands:\n\t\tfile = dir_obj+'stamp-{0}.fits'.format(band)\n\n\t\tif os.path.isfile(file):\n\t\t\tos.remove(file)\n\t\topen(file, 'w').close()\n\t\tassert os.stat(file).st_size == 0\n\n\t# when file exists it shou...
[ "0.7399189", "0.6597974", "0.6499633", "0.62193793", "0.6162205", "0.6148563", "0.6112164", "0.60769916", "0.6062992", "0.6025994", "0.5989608", "0.5962711", "0.59513324", "0.59443", "0.59376466", "0.59351194", "0.5914633", "0.5873572", "0.5824833", "0.5815026", "0.580245", ...
0.7414792
0
test that when overwrite=False make_stamp() does not update file
def test_make_stamps_overwriteFalse(L_radec): L = L_radec overwrite = False for band in L.bands: file = dir_obj+'stamp-{0}.fits'.format(band) if os.path.isfile(file): os.remove(file) open(file, 'w').close() assert os.stat(file).st_size == 0 # when file exists it should not update file L.make_stamps...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_make_stamps_overwriteTrue(L_radec):\n\tL = L_radec\n\n\tband = 'r'\n\toverwrite = True\n\n\tfile = dir_obj+'stamp-{0}.fits'.format(band)\n\n\tif os.path.isfile(file):\n\t\tos.remove(file)\n\n\t# when file does not exist it creates stamp\n\tassert not os.path.isfile(file)\n\tL.make_stamps(overwrite=overwri...
[ "0.75799686", "0.66520697", "0.6449606", "0.64144886", "0.63828194", "0.63772327", "0.62688875", "0.6259776", "0.6248918", "0.6247444", "0.61805695", "0.6136362", "0.6135897", "0.6135897", "0.61129737", "0.6099764", "0.6089184", "0.6081821", "0.6079067", "0.603795", "0.601740...
0.77902514
0
Instantiates the pipeline service client.
def __init__( self, *, credentials: ga_credentials.Credentials = None, transport: Union[str, PipelineServiceTransport] = "grpc_asyncio", client_options: ClientOptions = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: self._...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_client(self) -> None:\n self._client = discovery.build('ml', 'v1')", "def client_setup(self):\n self.client = Client()", "def create_client(self) -> None:\n self._client = gapic.JobServiceClient(\n client_options=dict(api_endpoint=self._region + _UCAIP_ENDPOINT_SUFFIX))", "def ...
[ "0.65503174", "0.6373078", "0.62561184", "0.62188065", "0.6110675", "0.6100939", "0.6095674", "0.6040076", "0.5994687", "0.59937936", "0.59884375", "0.59681916", "0.59681916", "0.59206957", "0.58703256", "0.58517784", "0.583898", "0.5828848", "0.5808268", "0.58069915", "0.579...
0.6936598
0
r"""Lists TrainingPipelines in a Location.
async def list_training_pipelines( self, request: pipeline_service.ListTrainingPipelinesRequest = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTrai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_by_location(self, location):\n # Validation\n TrainerManager._str_validator(location)\n\n # Database Query\n all_trainers = self.get_all()\n all_trainers_in_location = []\n\n for trainer in all_trainers:\n if trainer.location == location:\n ...
[ "0.5622672", "0.5342222", "0.5196207", "0.5094158", "0.5073623", "0.5053762", "0.49956638", "0.4979675", "0.49556702", "0.4955278", "0.4925946", "0.49225718", "0.4920852", "0.4920852", "0.48674428", "0.48623905", "0.48506626", "0.48444697", "0.48249447", "0.48094842", "0.4809...
0.5666498
0
r"""Cancels a TrainingPipeline. Starts asynchronous cancellation on the TrainingPipeline. The server makes a best effort to cancel the pipeline, but success is not guaranteed. Clients can use [PipelineService.GetTrainingPipeline][google.cloud.aiplatform.v1beta1.PipelineService.GetTrainingPipeline] or other methods to c...
async def cancel_training_pipeline( self, request: pipeline_service.CancelTrainingPipelineRequest = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def cancel_pipeline_job(\n self,\n request: pipeline_service.CancelPipelineJobRequest = None,\n *,\n name: str = None,\n retry: retries.Retry = gapic_v1.method.DEFAULT,\n timeout: float = None,\n metadata: Sequence[Tuple[str, str]] = (),\n ) -> None:\n ...
[ "0.6872929", "0.6247216", "0.59390426", "0.583348", "0.5759132", "0.57532334", "0.5536531", "0.5454818", "0.5425489", "0.5364538", "0.5356281", "0.53136146", "0.53129214", "0.5297026", "0.52966297", "0.52950233", "0.52797616", "0.5260809", "0.5252691", "0.5252691", "0.5200449...
0.7892723
0
r"""Cancels a PipelineJob. Starts asynchronous cancellation on the PipelineJob. The server makes a best effort to cancel the pipeline, but success is not guaranteed. Clients can use [PipelineService.GetPipelineJob][google.cloud.aiplatform.v1beta1.PipelineService.GetPipelineJob] or other methods to check whether the can...
async def cancel_pipeline_job( self, request: pipeline_service.CancelPipelineJobRequest = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: # Create or...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cancel(self):\n if not self.parent_node.is_job:\n return\n\n # First perform clean operation\n self.clean()\n\n self.winstance.send_event('Cancelling job..')\n result = self.winstance.execute_operation('hpc.interfaces.'\n ...
[ "0.7340772", "0.71799594", "0.7149951", "0.7072554", "0.6805268", "0.6786892", "0.66732264", "0.6672568", "0.666681", "0.6633535", "0.6589706", "0.63760483", "0.63253033", "0.6315184", "0.6117449", "0.6107631", "0.6102521", "0.5975806", "0.5965093", "0.5962704", "0.58684254",...
0.7345048
0
Returns a textual coverage report of all covergroups
def get_coverage_report(details=False)->str: model = get_coverage_report_model() out = StringIO() formatter = TextCoverageReportFormatter(model, out) formatter.details = details formatter.report() return out.getvalue()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cov():\n cov = coverage.coverage(branch=True, include='project/*')\n cov.start()\n tests = unittest.TestLoader().discover('tests')\n unittest.TextTestRunner(verbosity=2).run(tests)\n cov.stop()\n cov.save()\n print('Coverage Summary:')\n cov.report()\n basedir = os.path.abspath(os.pa...
[ "0.6355515", "0.6328133", "0.62495124", "0.6136668", "0.6125084", "0.611166", "0.61093825", "0.60763854", "0.6061684", "0.6022216", "0.6012662", "0.59900796", "0.5952007", "0.59419674", "0.58457464", "0.58388036", "0.5812645", "0.5777064", "0.571918", "0.5706274", "0.5655894"...
0.6546166
0
Returns a coverage report model of all covergroups
def get_coverage_report_model()->CoverageReport: covergroups = CoverageRegistry.inst().covergroup_types() db = MemFactory.create() save_visitor = CoverageSaveVisitor(db) now = datetime.now save_visitor.save(TestData( UCIS_TESTSTATUS_OK, "UCIS:simulator", ucis.ucis_Ti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_project_test_coverage(self) -> None:\n print_statistics = {}\n total_number_columns = 0\n number_columns_without_tests = 0\n\n for model_name in self.dbt_tests.keys():\n columns = self.dbt_tests[model_name]\n\n model_number_columns = 0\n model_co...
[ "0.60682124", "0.5819383", "0.5755508", "0.5700413", "0.5633477", "0.55800486", "0.5578231", "0.5566542", "0.55206233", "0.54492384", "0.5437326", "0.54263806", "0.54257256", "0.5377272", "0.5361254", "0.53459567", "0.53128195", "0.53065526", "0.5285197", "0.5280085", "0.5255...
0.7377359
0
Writes a coverage report to the console
def report_coverage(fp=None, details=False): if fp is None: fp = sys.stdout fp.write(get_coverage_report(details))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def coverage(session):\n session.install(\"coverage[toml]\", \"codecov\")\n session.run(\"coverage\", \"xml\", \"--fail-under=0\")\n session.run(\"codecov\", *session.posargs)", "def generate_report():\n if os.path.isdir(\"build/coverage\"):\n shutil.rmtree(\"build/coverage\")\n commands = ...
[ "0.7272686", "0.72519153", "0.7235525", "0.7152518", "0.71510553", "0.7097996", "0.70856905", "0.7064803", "0.6981722", "0.69354504", "0.6919918", "0.69075966", "0.6880611", "0.68495256", "0.67926127", "0.6749997", "0.67436403", "0.67228085", "0.65869343", "0.6558952", "0.655...
0.77198756
0
Writes a dataframe with tags to influx, with time_precision=s.
def write_to_influx(df, tags, host, port, user, password, db_name, batch_size=10000, time_precision='s'): logger.debug("Write DataFrame with Tags {}, with length: {}".format(tags, len(df))) client = DataFrameClient(host, port, user, password, db_name) if not client.write_points(df, db_name, tags, time_preci...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepare_for_influxdb(df):\n df = df.drop(columns=\"landkreis\", errors=\"ignore\") # prevent name collision in get_ags()\n df = get_ags(df)\n df[\"time\"] = df.apply(lambda x: 1000000000*int(datetime.timestamp((pd.to_datetime(x[\"timestamp\"])))), 1)\n df[\"measurement\"] = \"hystreet\"\n df[\"...
[ "0.6349245", "0.5547508", "0.5435894", "0.5435085", "0.54086506", "0.5372274", "0.53284645", "0.52702487", "0.52207017", "0.5210912", "0.51814514", "0.5160649", "0.51491827", "0.5143955", "0.5135507", "0.5113904", "0.5109738", "0.5095427", "0.50881255", "0.50704306", "0.50392...
0.7484296
0
Sets the signature of this CancelClaimRequest.
def signature(self, signature: object): self._signature = signature
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def signature(self, signature):\n\n self._signature = signature", "def signature(self, signature):\n\n self._signature = signature", "def __init__(self, signature: object=None, claim_id: str=None, participant: AllOfCancelClaimRequestParticipant=None, reason: ConfirmClaimRequestpropertiesReason=No...
[ "0.6114562", "0.6114562", "0.60749125", "0.55958617", "0.546195", "0.5417356", "0.528371", "0.5159854", "0.5159685", "0.5132778", "0.5073395", "0.50044507", "0.497432", "0.4832487", "0.4832487", "0.47977144", "0.4747129", "0.47315794", "0.47188556", "0.4714105", "0.46284205",...
0.61430365
1