query
stringlengths
9
9.05k
document
stringlengths
10
222k
negatives
listlengths
19
20
metadata
dict
Détermine si une position est valide sur le plateau
def is_valid_pos(self, pos): return 0 <= pos.row < self.size and 0 <= pos.col < self.size
[ "def _checkPosition(self,position) :\n #if( 0 <= position[0] and position[0] < self._lineMax \n #and 0 <= position[1] and position[1] < self._columnMax) :\n # return True\n #else : \n # return False\n \n #Si le robot ne rencontre pas de mur, le deplacement est autorise.\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Détermine si une case est accessible depuis une reine en une autre position sur la même diagonale
def _is_accessible_diag(self, pos1, pos2, ignore): return self._is_accessible_direction(pos1, pos2, NORTH_EAST if pos1.row < pos2.row else SOUTH_WEST, ignore)
[ "def check_edge_case_reflection(self, row, column, direction):\n # For all the following, if there is not a hit but there is an atom directly diagonal\n # of the initial position of the ray then return True\n if direction == 'right':\n if (self._game_board[row][column + 1] != 'A' and...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Détermine si une case est accessible depuis une reine en une autre position en suivant une certaine direction
def _is_accessible_direction(self, pos1, pos2, direction, ignore=None): pos = pos1 + direction if pos == pos2: return True while pos != pos2: if self.at(pos) != EMPTY and (ignore is None or pos != ignore): return False pos += direction ...
[ "def __isDirection__(self, word):\n self.directions = ('north', 'south', 'east', 'west', 'down', 'up', 'left', 'right', 'back')\n for direction in self.directions:\n if direction == word:\n return ('direction', word), True\n return None, False", "def check(self, word...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a cuboid from min coordinates and max coordinates, scales it by a scale factor. min and max ara opposite corners of the final cuboid
def __cuboid(cls, min: np.ndarray, max: np.ndarray, scale: float = 1.) -> np.ndarray: max = max.flatten() min = min.flatten() avg = (max + min) / 2 cube = np.zeros((8, 3), dtype=float) cube[0] = (np.array([max[0], max[1], max[2]], dtype=float) - avg) * scale + avg cube[1]...
[ "def testScale():\n \n cuboid = shape.Cuboid((100,100,10), (20,30,40))\n cuboid.outputNodes()\n\n print (\"\\n> Scale cuboid by 2, centred at (100,150,200)\")\n cuboid.transform(wf.scaleMatrix(2, 100, 150, 200))\n cuboid.outputNodes()", "def scale(self, from_min, from_max, to_min, to_max):\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Match this set of Nodes to target set of nodes based on their coordinates (distance) if nodeID is supplied, find the closest nodes to this node or a list of nodes Returns the node ids from target that are closest to this set of nodes and the distance of the found nodes if selected
def match(self, nodes, nodeID: int | list = None, distances: bool = False) -> list: if nodeID is None: source = self.toarray() source_keys = self.keys() elif type(nodeID) is int: source = self[nodeID].coors.reshape(1, 3) source_keys = [nodeID] elif...
[ "def findClosestNodes(self, target: hash.hash.Hash):\n # TODO: make more efficient\n # See: http://stackoverflow.com/questions/30654398/implementing-find-node-on-torrent-kademlia-routing-table\n \n nodes = []\n \n for bucket in self.buckets:\n nodes = nodes + buc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a permutation matrix for node ordering using a Reverse CuthillMcKee algorithm
def reverse_cuthill_mckee(self, permutation: bool = True) -> [np.ndarray, np.ndarray]: # 1. get the connectivity matrix nodeids, C = self.node_connectivity_matrix() # 2. compute the new node order perm = scipy.sparse.csgraph.reverse_cuthill_mckee(C, False) # 3. create a diction...
[ "def rcm_perm(adj_mat):\n _adj_mat = _preprocess(adj_mat)\n graph = csr_matrix(_adj_mat)\n idx = reverse_cuthill_mckee(graph, symmetric_mode=True)\n return reorder(adj_mat, idx)", "def permutation_matrix(order):\n matrix = np.zeros([order,order])\n matrix[-1,0] = 1\n matrix[0:-1,1::] = np.ide...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if fetched series is really in series dict.
def test_seriesdict(self): series = self.tvdb.get_series('seinfeld') assert self.tvdb.sid_series[series['id']] == series
[ "def seriesExists(self, series):\n series = [x for x in self._time_series_data if series in x[\"equipment\"]]\n logging.info(series)\n\n if series:\n return True\n\n return False", "def is_series(self, sid):\n\t\tcur = self._query(\"select count(id) from series where id=%s\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a trained sklearn pipeline of [csp, lda]
def get_trained_CSP_LDA(data, labels, window_size=None, preprocessing=LowpassWrapper(), step_size=None): # slide window over trial data to generate many more data points if step_size and window_size and window_size < data.shape[-1]: data, labels = get_windows(data, labels, window_size, step_size) ...
[ "def create(pdef):\n from sklearn.pipeline import Pipeline\n return [Pipeline(p) for p in pdef]", "def create_pipelines(seed, verbose=1):\n\n models = [\n ('LR', LogisticRegression()),\n ('LDA', LinearDiscriminantAnalysis()),\n ('KNN', KNeighborsClassifier()),\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
takes the output form a WindowInlet and returns the probability (according to the csp+lda classifier) that the right hand was imagined
def predict_proba(self, window: np.array): data = np.transpose(np.array(window))[self.data_channels] print('data shape in wrapped:', data.shape) proba = self.clf.predict_proba(data) return proba[0][1] # proba = [[prob_left, prob_right]]
[ "def _window_hitprobability(self, x, y):\n hm_count = np.zeros_like(y).astype(float)\n hm = np.zeros_like(y).astype(float)\n #skf = StratifiedShuffleSplit(n_splits=self.n_iter, test_size=self.shuffle_test_split, random_state=self.random_state)\n skf = StratifiedShuffleSplit(n_splits=self...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
calls fit(data, labels) on the csp+lda classifier
def fit(self, data, labels): self.clf.fit(data, labels)
[ "def get_trained_CSP_LDA(data, labels, window_size=None, preprocessing=LowpassWrapper(), step_size=None):\n\n # slide window over trial data to generate many more data points\n if step_size and window_size and window_size < data.shape[-1]:\n data, labels = get_windows(data, labels, window_size, step_si...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validate the number of arguments and call a delegate handler.
def processcmd(command, args, expected_nargs, delegate): if len(args) != expected_nargs: raise FormatError("Wrong number of arguments for '" + command + "', expected " + str(expected_nargs) + " but got " + str(len(args))) delegate(userdata, *args)
[ "def __call__(self, *args):\n assert len(args) == 2 + self.expectedIDs\n id1 = wx.ID_ANY\n id2 = wx.ID_ANY\n target = args[0]\n if self.expectedIDs == 0:\n func = args[1]\n elif self.expectedIDs == 1:\n id1 = args[1]\n func = args[2]\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Transform the raw devlist into a human readable list.
def devlist_handler(userdata, *args): for (dev, connected) in database.devlist(userdata["cursor"]): if dev == "devmaster": continue if connected: print(shlex.quote("+" + dev), end=" ") else: print(shlex.quote("-" + dev), end=" ") print()
[ "def _format_device_list_item(self, conf_device_data):\n\n device_info = (f\"{conf_device_data[CONF_IC3_DEVICENAME]}{RARROW}\")\n\n if conf_device_data[CONF_TRACKING_MODE] == MONITOR_DEVICE:\n device_info += \"MONITOR, \"\n elif conf_device_data[CONF_TRACKING_MODE] == INACTIVE_DEVIC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Transform the raw guestlist into a human readable list.
def guestlist_handler(userdata, *args): for guest in userdata["guestlist"]: print(shlex.quote(guest), end=" ") print()
[ "def list_to_text(ingridients_list):\n to_return = \"List\\n\"\n for (ingridient, quantity) in ingridients_list:\n to_return = f\"{to_return}{ingridient.name} {quantity}\\n\"\n return to_return", "def _data_normalization(data: list) -> list:\n\n return [ \n [\n d[0...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
retrieve information about organization
def fetch_organization(organization): return fetch_json(organization_url, organization)
[ "def test_retrieve_l_organization(self):\n pass", "def test_get_organization(self):\n pass", "def org_info(self):\n\n response = self.postman.request('info')\n\n if (response.status_code == requests.codes.ok):\n data = response.json()\n\n self.repos = data['publ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
retrieve information about funding round
def fetch_funding_round(uuid): return fetch_json(funding_round_url, uuid)
[ "def get_funds():\n\n return fs.get_funds()", "def _GetBondInfo(self):\n data = {\n 'RedemptionDate': self.redemption_date,\n 'Series': self.series,\n 'Denomination': '1000',\n 'IssueDate': self.issue_date,\n 'btnAdd.x': 'CAL...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
retrieve org logo url location
def fetch_logo_url(organization): return fetch_json(image_url, organization)
[ "def logo_url(self):\n return self.get_url(\"logo\", \"images/logo.png\")", "def logo_uri(self) -> str:\n return pulumi.get(self, \"logo_uri\")", "def logo_url(self):\n return self.logo.url if self.logo\\\n else \"/static/images/college-tile-default-img.jpg\"", "def og_logo(sel...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
r"""Calculates and stores range stats with forward values. Args
def _calculate_range_stats(self, x_copy): # get the min, max values of the data min_val_cur, max_val_cur = torch.aminmax(x_copy) # calculate new epoch range values epoch_min_val = torch.min(self.epoch_activation_min, min_val_cur) epoch_max_val = torch.max(self.epoch_activation_m...
[ "def getRange(self):\n \n pass", "def _init_range(self):\n if self.CONTINUOUS:\n self.val_min = min(self.vals)\n self.val_max = max(self.vals)\n buffer_width = (self.val_max - self.val_min) / 10\n\n self.range_min = self.val_min - buffer_width\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
r"""Calculates and stores the per_channel min, max stats with forward values.
def _calculate_min_max_stats(self, x_copy): # get the current min and max vals min_val = self.min_val max_val = self.max_val x_dim = x_copy.size() new_axis_list = [i for i in range(len(x_dim))] # noqa: C416 new_axis_list[self.ch_axis] = 0 new_axis_list[0] = self...
[ "def _calculate_percentile_stats(self, x_copy):\n # get the dimension of the copy\n x_dim = x_copy.size()\n\n new_axis_list = [i for i in range(len(x_dim))] # noqa: C416\n new_axis_list[self.ch_axis] = 0\n new_axis_list[0] = self.ch_axis\n y = x_copy.permute(new_axis_list)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests a progress value source cannot refer to the current section or the current block
def test_invalid_current_location_progress(): schema_path = ( "schemas/invalid/test_invalid_progress_value_source_current_location.json" ) questionnaire_validator = QuestionnaireValidator( _open_and_load_schema_file(schema_path) ) questionnaire_validator.validate() expected_erro...
[ "def test_invalid_block_in_repeating_section():\n schema_path = \"schemas/invalid/test_invalid_progress_value_source_block_in_past_repeating_section.json\"\n questionnaire_validator = QuestionnaireValidator(\n _open_and_load_schema_file(schema_path)\n )\n questionnaire_validator.validate()\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests a progress value source cannot refer to a block in a repeating section except if it is the parent seciont of the value source Nor to a repeating section
def test_invalid_block_in_repeating_section(): schema_path = "schemas/invalid/test_invalid_progress_value_source_block_in_past_repeating_section.json" questionnaire_validator = QuestionnaireValidator( _open_and_load_schema_file(schema_path) ) questionnaire_validator.validate() expected_erro...
[ "def test_value_source_dependency_enable_section_by_progress_hub_flow(self):\n\n self.launchSurvey(\"test_progress_value_source_section_enabled_hub\")\n\n self.assertInBody(\"Choose another section to complete\")\n self.assertInBody(\"Section 1\")\n self.assertNotInBody(\"Section 2\")\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is the function which is called when playing Pokemon is selected In terms of variables, anything prefixed with u is supposed to mean your and anything prefixed with o is supposed to mean opponents
def pokemon_function(pokemon, oppo_pokemon, uhp=100, ohp=100): print(Figlet(font='barbwire', width=200).renderText("HP : " + str(ohp) + "/100")) print(Figlet(font='banner3', width=200).renderText(oppo_pokemon)) print(Figlet(font='barbwire', width=200).renderText("HP : " + str(uhp) + "/100")) print(Figl...
[ "def choosePokemon(self):\n pass", "def pokemon_selector(account_name):\r\n print('-' * 10 + ' Selector Menu ' + '-' * 10)\r\n # opens the user's file to access all of their pokemon\r\n pokemonFile = open('{}'.format(account_name), 'r')\r\n pokemon_reader = csv.reader(pokemonFile, delimiter=','...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is the rock paper scissor function.
def rps_function(): randNumber = random.randint(1,3) companswer = "Scissor" if randNumber == 1: companswer = "Rock" elif randNumber == 2: companswer = "Paper" answer = q.select("Select Rock, Paper or Scissors", choices=["Rock", "Paper", "Scissor"]).ask() print(answer, companswe...
[ "def rock_p_scissor(user_input, comp_choice):\r\n if user_input.lower() == comp_choice:\r\n compare = results[2]\r\n score_update(scoreboard, compare)\r\n banner_text(\"*\")\r\n banner_text(\"Tie! We both chose {0}\".format(user_input))\r\n banner_text(\"*\")\r\n print(s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
takes username and password, confirms password matches db password, returns True or False
def verify_password(self, username, password): try: self.c.execute('SELECT password FROM profiles WHERE name=(?)', (username,)) db_pw = self.c.fetchone()[0] print(password) return db_pw == password except TypeError: return False
[ "def username_password_match(self, username: str, password: str) -> bool:\n\n if (self.username_taken(username) and\n\n self.database.read_database()[username] == password):\n\n return True\n\n return False", "def check_auth(self, username, password):\n return usern...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests that ``Serializer`` can be enabled and disabled correctly.
def test_serializer(): my_serializer = Serializer() assert my_serializer.serialize("test") == "test" my_serializer.serialize = Mock() my_serializer.disable() assert my_serializer("test") == "test" my_serializer.serialize.assert_not_called() my_serializer.enable() my_serializer("test"...
[ "def test_boolean_in_serializer() -> None:\n assert cv.custom_serializer(cv.boolean) == {\n \"type\": \"boolean\",\n }", "def test_write_with_reader_serializer(self):\n transaction = TransactionFactory.build()\n serialized_data = TransactionSerializer(transaction).data\n serializ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests that ``SerializerMapping`` correctly passes its inputs to the underlying serializers. Also checks that state is retrieved / loaded correctly.
def test_serializer_mapping(): serializer1 = Serializer() serializer1.serialize = Mock(return_value="test1") class Serializer1State(ProcessState): pass serializer2 = Serializer() serializer2.serialize = Mock(return_value="test2") class Serializer2State(ProcessState): pass ...
[ "def test_map_serialization(self):\n game_map = Map(CONFIG.MAP_NAME)\n train = Train(idx=1, line_idx=game_map.line[1].idx, position=0)\n game_map.add_train(train)\n\n str_json = game_map.layer_to_json_str(0)\n data = json.loads(str_json)\n self.assertIn('name', data)\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function to save pytorch tensor as jpg image.
def save_tensor(tensor, path, title="NONAME"): image = to_image(tensor) image.save(os.path.join(path, "{}.jpg".format(title)))
[ "def save_tensor_image(fn, x):\n\n if ( 3 == len( x.size() ) ):\n x = x.permute((1, 2, 0))\n \n # Get the CPU NumPy version.\n x = torch.clamp(x, 0, 255)\n x = x.cpu().numpy().astype(np.uint8)\n\n # Save the iamge.\n cv2.imwrite(fn, x, [cv2.IMWRITE_PNG_COMPRESSION, 0])", "def save_imag...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Imports all controllers and register pages
def init_controllers(app): for controller in os.listdir(os.getcwd() + "/controllers"): module_name, ext = os.path.splitext(controller) if module_name.endswith('_controller') and ext == '.py': module = __import__("controllers.%s" % module_name) PYSTHClient....
[ "def load_components(self):\r\n\r\n # retrieves the MVC utils plugin\r\n mvc_utils_plugin = self.plugin.mvc_utils_plugin\r\n\r\n # creates the controllers and assigns them to the current instance\r\n # allowing them to start being used in the current workflow\r\n mvc_utils_plugin....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Call the bootstrap function
def bootstrap(): Bootstrap()
[ "def bootstrap(self):\n None", "def boot(self):\n\n pass", "def boot(self):\n pass", "def _inject_and_run_bootstrap(self):\n self._log.info(\"injecting bootstrap\")\n\n with open(os.path.join(os.path.dirname(__file__), \"bootstrap.py\"), \"r\") as f:\n bootstrap_c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return a list of launchctl jobs
def jobs(): result = [] out = subprocess.check_output(["/bin/launchctl", "list"]).decode() for row in out.splitlines()[1:]: result.append(Job(row)) return result
[ "def jobs():\n labels = list(map(lambda f: read(f).get(\"Label\", None), files()))\n return list(filter(lambda j: j.label in labels, launchctl.jobs()))", "def list_jobs(self) -> list:\n return self.conn.get_jobs()", "def get_jobs(self):\r\n\r\n # TODO: add jobs as well..\r\n return li...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return launchctl Job by label
def job(label): args = ["/bin/launchctl", "list", label] try: out = subprocess.check_output(args, stderr=subprocess.PIPE).decode() except subprocess.CalledProcessError: return {} result = dict() for l in out.splitlines(): if '" =' in l: key = l.split('"')[1] ...
[ "def find_job_by_label(self, scheduler_label):\n jobs = self.scheduler.get_jobs()\n\n for job in jobs:\n if job.id.lower() == scheduler_label.lower():\n return job\n\n return None", "def describe_labeling_job(LabelingJobName=None):\n pass", "def get_job(self, jo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
`launchctl load args ...`
def load(args): subprocess.check_call(["/bin/launchctl", "load"] + values.get(args))
[ "def run_load_daemon_command(args: argparse.Namespace):\n load_daemon(args.config)", "def load(config, args):\n if not confirm(\"WARNING: This isn't considered production ready just yet. Continue?\"):\n return\n if not args.no_backup:\n timestamp = args.project.dump(args.node)\n prin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
`launchctl unload args ...`
def unload(args): subprocess.check_call(["/bin/launchctl", "unload"] + values.get(args))
[ "def run_unload_daemon_command(_args):\n unload_daemon()", "def unload_daemon():\n plist = get_launch_agents_dir() / LAUNCHD_PLIST_NAME\n subprocess.run(\n [\"launchctl\", \"unload\", \"-w\", plist],\n stdout=subprocess.DEVNULL,\n stderr=subprocess.DEVNULL,\n check=True,\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Print Structured Attributes List
def ListAttributes(self): print("\n") print("Attributes List of: " + repr(self.__dict__["name"]) + " - " + self.__class__.__name__ + " Instance\n") self_keys = self.__dict__.keys() self_keys.sort() for key in self_keys: if key != "name": print(str(key) + " : " + repr(self.__dict...
[ "def listAttributes(self):\n for attr in sorted(self.__dict__.keys()):\n print(\"-\", attr, \":\\n\", self.__dict__[attr], \"\\n\\n\")", "def display_attributes(self) -> str:\n return pprint.pformat(self.attributes())", "def print_extattribute(extattributes):\n for extattribute in ex...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Merge breweries whose names end in common endings
def merge_common_ending_breweries(apps, schema_editor): mfg_model = apps.get_model("beers.Manufacturer") mfgs = mfg_model.objects.all().prefetch_related("beers").order_by("name") if not mfgs.exists(): return mfg_dict = {} for mfg in mfgs: key = ENDINGS_REGEX.sub("", mfg.name.strip())...
[ "def condense_exterminators(self):\n #newext = set()\n hitlist = set()\n for ext1 in self.exterminators:\n for ext2 in self.exterminators:\n if ext1 == ext2:\n continue\n if ext2 not in hitlist and ext1 not in hitlist and any (alias in...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the value with its absolute value capped at max_abs_val. Particularly useful in passing values to trignometric functions where numerical errors may result in an argument > 1 being passed in.
def _abs_cap(val, max_abs_val=1): return max(min(val, max_abs_val), -max_abs_val)
[ "def val_abs ( c ):\n if c >= 0 : return (c)\n else : return (-1*c)", "def absmax(x):\n return np.max(np.abs(x))", "def abs_val(num):\n return -num if num < 0 else num", "def __getAbsMax(data):\n maxIndex = np.argmax(np.abs(data))\n absMax = data[maxIndex]\n return absMax", "def absolut...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Construct cubic Lattice from lattice parameter information.
def cubic(cls, a): return cls.from_parameters(a, a, a, 90, 90, 90)
[ "def createFccLattice(nx, ny, nz, lat, atoms):\n nb = 4 # number of atoms in this basis\n\n basis = [ (0.25, 0.25, 0.25),\n (0.25, 0.75, 0.75),\n (0.75, 0.25, 0.75),\n (0.75, 0.75, 0.25)\n ]\n\n idx = 0\n # loop over ix,iy,iz\n for ix in range(nx...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return reciprocal Lattice without 2 pi.
def reciprocal_lattice_crystallographic(self): return Latt(self.reciprocal_lattice().lattice / (2 * np.pi))
[ "def reciprocal_lattice(self):\n return self._lattice.reciprocal_lattice", "def calculate_reciprocal(self):\n (self.recip_a, self.recip_b, self.recip_c) = \\\n crystal_calc.make_reciprocal_lattice(self.lattice_lengths, self.lattice_angles)\n #Also make the matrix\n self.reci...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
__init__(itkMapContainerULLQEMPF2GQEULLULLBBT self) > itkMapContainerULLQEMPF2GQEULLULLBBT
def __init__(self, *args): _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_swiginit(self, _itkQuadEdgeCellTraitsInfoPython.new_itkMapContainerULLQEMPF2GQEULLULLBBT(*args))
[ "def __init__(self, *args):\n _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_swiginit(self, _itkQuadEdgeCellTraitsInfoPython.new_itkMapContainerULLQEMPF3GQEULLULLBBT(*args))", "def __init__(self):\n self.map = dict()\n self.ids = list()", "def New(*args, **kargs):\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clone(itkMapContainerULLQEMPF2GQEULLULLBBT self) > itkMapContainerULLQEMPF2GQEULLULLBBT_Pointer
def Clone(self) -> "itkMapContainerULLQEMPF2GQEULLULLBBT_Pointer": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_Clone(self)
[ "def Clone(self) -> \"itkMapContainerULLQEMPF3GQEULLULLBBT_Pointer\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_Clone(self)", "def copy(self):\n return self.__class__(*self.maps[:-1], self.maps[-1].copy())", "def Clone(self) -> \"itkShapeRelabelLabelMapFilterLM...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ElementAt(itkMapContainerULLQEMPF2GQEULLULLBBT self, unsigned long long arg0) > itkQuadEdgeMeshPointF2GQEULLULLBBT ElementAt(itkMapContainerULLQEMPF2GQEULLULLBBT self, unsigned long long arg0) > itkQuadEdgeMeshPointF2GQEULLULLBBT
def ElementAt(self, *args) -> "itkQuadEdgeMeshPointF2GQEULLULLBBT const &": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_ElementAt(self, *args)
[ "def ElementAt(self, *args) -> \"itkQuadEdgeMeshPointF3GQEULLULLBBT const &\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_ElementAt(self, *args)", "def GetElement(self, arg0: 'unsigned long long') -> \"itkQuadEdgeMeshPointF2GQEULLULLBBT\":\n return _itkQuadEdgeCel...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CreateElementAt(itkMapContainerULLQEMPF2GQEULLULLBBT self, unsigned long long arg0) > itkQuadEdgeMeshPointF2GQEULLULLBBT
def CreateElementAt(self, arg0: 'unsigned long long') -> "itkQuadEdgeMeshPointF2GQEULLULLBBT &": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_CreateElementAt(self, arg0)
[ "def CreateElementAt(self, arg0: 'unsigned long long') -> \"itkQuadEdgeMeshPointF3GQEULLULLBBT &\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_CreateElementAt(self, arg0)", "def ElementAt(self, *args) -> \"itkQuadEdgeMeshPointF2GQEULLULLBBT const &\":\n return _it...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GetElement(itkMapContainerULLQEMPF2GQEULLULLBBT self, unsigned long long arg0) > itkQuadEdgeMeshPointF2GQEULLULLBBT
def GetElement(self, arg0: 'unsigned long long') -> "itkQuadEdgeMeshPointF2GQEULLULLBBT": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_GetElement(self, arg0)
[ "def GetElement(self, arg0: 'unsigned long long') -> \"itkQuadEdgeMeshPointF3GQEULLULLBBT\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_GetElement(self, arg0)", "def ElementAt(self, *args) -> \"itkQuadEdgeMeshPointF2GQEULLULLBBT const &\":\n return _itkQuadEdgeCel...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
SetElement(itkMapContainerULLQEMPF2GQEULLULLBBT self, unsigned long long arg0, itkQuadEdgeMeshPointF2GQEULLULLBBT arg1)
def SetElement(self, arg0: 'unsigned long long', arg1: 'itkQuadEdgeMeshPointF2GQEULLULLBBT') -> "void": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_SetElement(self, arg0, arg1)
[ "def SetElement(self, arg0: 'unsigned long long', arg1: 'itkQuadEdgeMeshPointF3GQEULLULLBBT') -> \"void\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_SetElement(self, arg0, arg1)", "def ElementAt(self, *args) -> \"itkQuadEdgeMeshPointF2GQEULLULLBBT const &\":\n re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
InsertElement(itkMapContainerULLQEMPF2GQEULLULLBBT self, unsigned long long arg0, itkQuadEdgeMeshPointF2GQEULLULLBBT arg1)
def InsertElement(self, arg0: 'unsigned long long', arg1: 'itkQuadEdgeMeshPointF2GQEULLULLBBT') -> "void": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_InsertElement(self, arg0, arg1)
[ "def InsertElement(self, arg0: 'unsigned long long', arg1: 'itkQuadEdgeMeshPointF3GQEULLULLBBT') -> \"void\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_InsertElement(self, arg0, arg1)", "def CreateElementAt(self, arg0: 'unsigned long long') -> \"itkQuadEdgeMeshPointF2GQ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
IndexExists(itkMapContainerULLQEMPF2GQEULLULLBBT self, unsigned long long arg0) > bool
def IndexExists(self, arg0: 'unsigned long long') -> "bool": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_IndexExists(self, arg0)
[ "def IndexExists(self, arg0: 'unsigned long long') -> \"bool\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_IndexExists(self, arg0)", "def GetElementIfIndexExists(self, arg0: 'unsigned long long', arg1: 'itkQuadEdgeMeshPointF2GQEULLULLBBT') -> \"bool\":\n return _i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GetElementIfIndexExists(itkMapContainerULLQEMPF2GQEULLULLBBT self, unsigned long long arg0, itkQuadEdgeMeshPointF2GQEULLULLBBT arg1) > bool
def GetElementIfIndexExists(self, arg0: 'unsigned long long', arg1: 'itkQuadEdgeMeshPointF2GQEULLULLBBT') -> "bool": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_GetElementIfIndexExists(self, arg0, arg1)
[ "def GetElementIfIndexExists(self, arg0: 'unsigned long long', arg1: 'itkQuadEdgeMeshPointF3GQEULLULLBBT') -> \"bool\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_GetElementIfIndexExists(self, arg0, arg1)", "def IndexExists(self, arg0: 'unsigned long long') -> \"bool\":\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CreateIndex(itkMapContainerULLQEMPF2GQEULLULLBBT self, unsigned long long arg0)
def CreateIndex(self, arg0: 'unsigned long long') -> "void": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_CreateIndex(self, arg0)
[ "def CreateIndex(self, arg0: 'unsigned long long') -> \"void\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_CreateIndex(self, arg0)", "def build_index():\n pass", "def create_index():", "def create_index(args, client):\n policy = {}\n client.index_geo2dsphere...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
DeleteIndex(itkMapContainerULLQEMPF2GQEULLULLBBT self, unsigned long long arg0)
def DeleteIndex(self, arg0: 'unsigned long long') -> "void": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_DeleteIndex(self, arg0)
[ "def DeleteIndex(self, arg0: 'unsigned long long') -> \"void\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_DeleteIndex(self, arg0)", "def CreateIndex(self, arg0: 'unsigned long long') -> \"void\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2G...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Size(itkMapContainerULLQEMPF2GQEULLULLBBT self) > unsigned long long
def Size(self) -> "unsigned long long": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_Size(self)
[ "def Size(self) -> \"unsigned long long\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_Size(self)", "def size(self):", "def Size(self) -> int:", "def __len__(self):\n return sum(len(v) for v in self._byte_map.values())", "def DictionaryKeyLength(self) -> int:...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reserve(itkMapContainerULLQEMPF2GQEULLULLBBT self, unsigned long long arg0)
def Reserve(self, arg0: 'unsigned long long') -> "void": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_Reserve(self, arg0)
[ "def Reserve(self, arg0: 'unsigned long long') -> \"void\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_Reserve(self, arg0)", "def reserve(self, reserve):\n \n self._reserve = reserve", "def reserve(self, context, reservation, resource, usage, delta):\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
cast(itkLightObject obj) > itkMapContainerULLQEMPF2GQEULLULLBBT
def cast(obj: 'itkLightObject') -> "itkMapContainerULLQEMPF2GQEULLULLBBT *": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_cast(obj)
[ "def cast(obj: 'itkLightObject') -> \"itkMapContainerULLQEMPF3GQEULLULLBBT *\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_cast(obj)", "def itkMapContainerULLQEMPF2GQEULLULLBBT_cast(obj: 'itkLightObject') -> \"itkMapContainerULLQEMPF2GQEULLULLBBT *\":\n return _itkQua...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
New() > itkMapContainerULLQEMPF2GQEULLULLBBT Create a new object of the class itkMapContainerULLQEMPF2GQEULLULLBBT and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named pa...
def New(*args, **kargs): obj = itkMapContainerULLQEMPF2GQEULLULLBBT.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
[ "def New(*args, **kargs):\n obj = itkMapContainerULLQEMPF3GQEULLULLBBT.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkLabelMap3.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
itkMapContainerULLQEMPF2GQEULLULLBBT_cast(itkLightObject obj) > itkMapContainerULLQEMPF2GQEULLULLBBT
def itkMapContainerULLQEMPF2GQEULLULLBBT_cast(obj: 'itkLightObject') -> "itkMapContainerULLQEMPF2GQEULLULLBBT *": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_cast(obj)
[ "def itkMapContainerULLQEMPF3GQEULLULLBBT_cast(obj: 'itkLightObject') -> \"itkMapContainerULLQEMPF3GQEULLULLBBT *\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkMapContainerULLQEMPF2GQEULLULLBBT *\":\n return _itkQua...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
__init__(itkMapContainerULLQEMPF3GQEULLULLBBT self) > itkMapContainerULLQEMPF3GQEULLULLBBT
def __init__(self, *args): _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_swiginit(self, _itkQuadEdgeCellTraitsInfoPython.new_itkMapContainerULLQEMPF3GQEULLULLBBT(*args))
[ "def __init__(self, *args):\n _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_swiginit(self, _itkQuadEdgeCellTraitsInfoPython.new_itkMapContainerULLQEMPF2GQEULLULLBBT(*args))", "def __init__(self):\n self.map = dict()\n self.ids = list()", "def New(*args, **kargs):\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clone(itkMapContainerULLQEMPF3GQEULLULLBBT self) > itkMapContainerULLQEMPF3GQEULLULLBBT_Pointer
def Clone(self) -> "itkMapContainerULLQEMPF3GQEULLULLBBT_Pointer": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_Clone(self)
[ "def Clone(self) -> \"itkMapContainerULLQEMPF2GQEULLULLBBT_Pointer\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_Clone(self)", "def copy(self):\n return self.__class__(*self.maps[:-1], self.maps[-1].copy())", "def Clone(self) -> \"itkShapeRelabelLabelMapFilterLM...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ElementAt(itkMapContainerULLQEMPF3GQEULLULLBBT self, unsigned long long arg0) > itkQuadEdgeMeshPointF3GQEULLULLBBT ElementAt(itkMapContainerULLQEMPF3GQEULLULLBBT self, unsigned long long arg0) > itkQuadEdgeMeshPointF3GQEULLULLBBT
def ElementAt(self, *args) -> "itkQuadEdgeMeshPointF3GQEULLULLBBT const &": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_ElementAt(self, *args)
[ "def ElementAt(self, *args) -> \"itkQuadEdgeMeshPointF2GQEULLULLBBT const &\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_ElementAt(self, *args)", "def GetElement(self, arg0: 'unsigned long long') -> \"itkQuadEdgeMeshPointF2GQEULLULLBBT\":\n return _itkQuadEdgeCel...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CreateElementAt(itkMapContainerULLQEMPF3GQEULLULLBBT self, unsigned long long arg0) > itkQuadEdgeMeshPointF3GQEULLULLBBT
def CreateElementAt(self, arg0: 'unsigned long long') -> "itkQuadEdgeMeshPointF3GQEULLULLBBT &": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_CreateElementAt(self, arg0)
[ "def CreateElementAt(self, arg0: 'unsigned long long') -> \"itkQuadEdgeMeshPointF2GQEULLULLBBT &\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_CreateElementAt(self, arg0)", "def ElementAt(self, *args) -> \"itkQuadEdgeMeshPointF2GQEULLULLBBT const &\":\n return _it...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GetElement(itkMapContainerULLQEMPF3GQEULLULLBBT self, unsigned long long arg0) > itkQuadEdgeMeshPointF3GQEULLULLBBT
def GetElement(self, arg0: 'unsigned long long') -> "itkQuadEdgeMeshPointF3GQEULLULLBBT": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_GetElement(self, arg0)
[ "def GetElement(self, arg0: 'unsigned long long') -> \"itkQuadEdgeMeshPointF2GQEULLULLBBT\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_GetElement(self, arg0)", "def ElementAt(self, *args) -> \"itkQuadEdgeMeshPointF2GQEULLULLBBT const &\":\n return _itkQuadEdgeCel...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
SetElement(itkMapContainerULLQEMPF3GQEULLULLBBT self, unsigned long long arg0, itkQuadEdgeMeshPointF3GQEULLULLBBT arg1)
def SetElement(self, arg0: 'unsigned long long', arg1: 'itkQuadEdgeMeshPointF3GQEULLULLBBT') -> "void": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_SetElement(self, arg0, arg1)
[ "def SetElement(self, arg0: 'unsigned long long', arg1: 'itkQuadEdgeMeshPointF2GQEULLULLBBT') -> \"void\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_SetElement(self, arg0, arg1)", "def ElementAt(self, *args) -> \"itkQuadEdgeMeshPointF2GQEULLULLBBT const &\":\n re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
InsertElement(itkMapContainerULLQEMPF3GQEULLULLBBT self, unsigned long long arg0, itkQuadEdgeMeshPointF3GQEULLULLBBT arg1)
def InsertElement(self, arg0: 'unsigned long long', arg1: 'itkQuadEdgeMeshPointF3GQEULLULLBBT') -> "void": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_InsertElement(self, arg0, arg1)
[ "def InsertElement(self, arg0: 'unsigned long long', arg1: 'itkQuadEdgeMeshPointF2GQEULLULLBBT') -> \"void\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_InsertElement(self, arg0, arg1)", "def CreateElementAt(self, arg0: 'unsigned long long') -> \"itkQuadEdgeMeshPointF3GQ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
IndexExists(itkMapContainerULLQEMPF3GQEULLULLBBT self, unsigned long long arg0) > bool
def IndexExists(self, arg0: 'unsigned long long') -> "bool": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_IndexExists(self, arg0)
[ "def IndexExists(self, arg0: 'unsigned long long') -> \"bool\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_IndexExists(self, arg0)", "def GetElementIfIndexExists(self, arg0: 'unsigned long long', arg1: 'itkQuadEdgeMeshPointF2GQEULLULLBBT') -> \"bool\":\n return _i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GetElementIfIndexExists(itkMapContainerULLQEMPF3GQEULLULLBBT self, unsigned long long arg0, itkQuadEdgeMeshPointF3GQEULLULLBBT arg1) > bool
def GetElementIfIndexExists(self, arg0: 'unsigned long long', arg1: 'itkQuadEdgeMeshPointF3GQEULLULLBBT') -> "bool": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_GetElementIfIndexExists(self, arg0, arg1)
[ "def GetElementIfIndexExists(self, arg0: 'unsigned long long', arg1: 'itkQuadEdgeMeshPointF2GQEULLULLBBT') -> \"bool\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_GetElementIfIndexExists(self, arg0, arg1)", "def IndexExists(self, arg0: 'unsigned long long') -> \"bool\":\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CreateIndex(itkMapContainerULLQEMPF3GQEULLULLBBT self, unsigned long long arg0)
def CreateIndex(self, arg0: 'unsigned long long') -> "void": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_CreateIndex(self, arg0)
[ "def CreateIndex(self, arg0: 'unsigned long long') -> \"void\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_CreateIndex(self, arg0)", "def build_index():\n pass", "def create_index():", "def create_index(args, client):\n policy = {}\n client.index_geo2dsphere...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
DeleteIndex(itkMapContainerULLQEMPF3GQEULLULLBBT self, unsigned long long arg0)
def DeleteIndex(self, arg0: 'unsigned long long') -> "void": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_DeleteIndex(self, arg0)
[ "def DeleteIndex(self, arg0: 'unsigned long long') -> \"void\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_DeleteIndex(self, arg0)", "def CreateIndex(self, arg0: 'unsigned long long') -> \"void\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3G...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Size(itkMapContainerULLQEMPF3GQEULLULLBBT self) > unsigned long long
def Size(self) -> "unsigned long long": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_Size(self)
[ "def Size(self) -> \"unsigned long long\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_Size(self)", "def Size(self) -> int:", "def size(self):", "def __len__(self):\n return sum(len(v) for v in self._byte_map.values())", "def DictionaryKeyLength(self) -> int:...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reserve(itkMapContainerULLQEMPF3GQEULLULLBBT self, unsigned long long arg0)
def Reserve(self, arg0: 'unsigned long long') -> "void": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_Reserve(self, arg0)
[ "def Reserve(self, arg0: 'unsigned long long') -> \"void\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_Reserve(self, arg0)", "def reserve(self, reserve):\n \n self._reserve = reserve", "def reserve(self, context, reservation, resource, usage, delta):\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
cast(itkLightObject obj) > itkMapContainerULLQEMPF3GQEULLULLBBT
def cast(obj: 'itkLightObject') -> "itkMapContainerULLQEMPF3GQEULLULLBBT *": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_cast(obj)
[ "def cast(obj: 'itkLightObject') -> \"itkMapContainerULLQEMPF2GQEULLULLBBT *\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_cast(obj)", "def itkMapContainerULLQEMPF2GQEULLULLBBT_cast(obj: 'itkLightObject') -> \"itkMapContainerULLQEMPF2GQEULLULLBBT *\":\n return _itkQua...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
New() > itkMapContainerULLQEMPF3GQEULLULLBBT Create a new object of the class itkMapContainerULLQEMPF3GQEULLULLBBT and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named pa...
def New(*args, **kargs): obj = itkMapContainerULLQEMPF3GQEULLULLBBT.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
[ "def New(*args, **kargs):\n obj = itkMapContainerULLQEMPF2GQEULLULLBBT.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkLabelMap3.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
itkMapContainerULLQEMPF3GQEULLULLBBT_cast(itkLightObject obj) > itkMapContainerULLQEMPF3GQEULLULLBBT
def itkMapContainerULLQEMPF3GQEULLULLBBT_cast(obj: 'itkLightObject') -> "itkMapContainerULLQEMPF3GQEULLULLBBT *": return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF3GQEULLULLBBT_cast(obj)
[ "def itkMapContainerULLQEMPF2GQEULLULLBBT_cast(obj: 'itkLightObject') -> \"itkMapContainerULLQEMPF2GQEULLULLBBT *\":\n return _itkQuadEdgeCellTraitsInfoPython.itkMapContainerULLQEMPF2GQEULLULLBBT_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkMapContainerULLQEMPF3GQEULLULLBBT *\":\n return _itkQua...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
__init__(itkQuadEdgeMeshCellTraitsInfo2FFULLULLUCQEMPGQEULLQEMPF2GQEULLULLBBTGQE self) > itkQuadEdgeMeshCellTraitsInfo2FFULLULLUCQEMPGQEULLQEMPF2GQEULLULLBBTGQE __init__(itkQuadEdgeMeshCellTraitsInfo2FFULLULLUCQEMPGQEULLQEMPF2GQEULLULLBBTGQE self, itkQuadEdgeMeshCellTraitsInfo2FFULLULLUCQEMPGQEULLQEMPF2GQEULLULLBBTGQE ...
def __init__(self, *args): _itkQuadEdgeCellTraitsInfoPython.itkQuadEdgeMeshCellTraitsInfo2FFULLULLUCQEMPGQEULLQEMPF2GQEULLULLBBTGQE_swiginit(self, _itkQuadEdgeCellTraitsInfoPython.new_itkQuadEdgeMeshCellTraitsInfo2FFULLULLUCQEMPGQEULLQEMPF2GQEULLULLBBTGQE(*args))
[ "def __init__(self, *args):\n _itkQuadEdgeCellTraitsInfoPython.itkQuadEdgeMeshCellTraitsInfo3FFULLULLUCQEMPGQEULLQEMPF3GQEULLULLBBTGQE_swiginit(self, _itkQuadEdgeCellTraitsInfoPython.new_itkQuadEdgeMeshCellTraitsInfo3FFULLULLUCQEMPGQEULLQEMPF3GQEULLULLBBTGQE(*args))", "def __init__(self, *args):\n _...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
__init__(itkQuadEdgeMeshCellTraitsInfo3FFULLULLUCQEMPGQEULLQEMPF3GQEULLULLBBTGQE self) > itkQuadEdgeMeshCellTraitsInfo3FFULLULLUCQEMPGQEULLQEMPF3GQEULLULLBBTGQE __init__(itkQuadEdgeMeshCellTraitsInfo3FFULLULLUCQEMPGQEULLQEMPF3GQEULLULLBBTGQE self, itkQuadEdgeMeshCellTraitsInfo3FFULLULLUCQEMPGQEULLQEMPF3GQEULLULLBBTGQE ...
def __init__(self, *args): _itkQuadEdgeCellTraitsInfoPython.itkQuadEdgeMeshCellTraitsInfo3FFULLULLUCQEMPGQEULLQEMPF3GQEULLULLBBTGQE_swiginit(self, _itkQuadEdgeCellTraitsInfoPython.new_itkQuadEdgeMeshCellTraitsInfo3FFULLULLUCQEMPGQEULLQEMPF3GQEULLULLBBTGQE(*args))
[ "def __init__(self, *args):\n _itkQuadEdgeCellTraitsInfoPython.itkQuadEdgeMeshCellTraitsInfo2FFULLULLUCQEMPGQEULLQEMPF2GQEULLULLBBTGQE_swiginit(self, _itkQuadEdgeCellTraitsInfoPython.new_itkQuadEdgeMeshCellTraitsInfo2FFULLULLUCQEMPGQEULLQEMPF2GQEULLULLBBTGQE(*args))", "def __init__(self, *args):\n _...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Read a stream of linedelimited json objects from a filelike object.
def read_objects(f): for line in f: j = json.loads(line) yield j['id'], line.strip()
[ "def read_json_stream(filename_or_stream, offsets=False):\n if hasattr(filename_or_stream, 'read'):\n stream = filename_or_stream\n else:\n stream = open(filename_or_stream, 'rb')\n\n offset = 0\n for bline in stream:\n line = bline.decode('utf-8').strip()\n if line:\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to get the information from RIPE. Sends an IP Address and gets Company name behind it. Also gets an address and country of origin. Later we only allow companies from Germany, Switzerland, Austria and Netherlands.
def get_whois(ip_address): # search the RIPE Database for the given IP res = IPWhois(ip_address).lookup_rdap(rate_limit_timeout=30) # get the country of the IP Address countries = get_countries() net = res['network'] country = countries[net['country']] company_name = net['name'] # get ...
[ "def countryIP():\r\n url = 'http://ipinfo.io/json'\r\n response = urlopen(url)\r\n data = json.load(response)\r\n \r\n IP=data['ip']\r\n org=data['org']\r\n city = data['city']\r\n country=data['country']\r\n region=data['region']\r\n \r\n return IP, country", "def main():\n i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return only public taxonomies if the user is not the target author
def get_queryset(self): target_author = get_object_or_404(CustomUser, username=self.kwargs.get('username', None)) if self.request.user == target_author: return Taxonomy.objects.filter(author=target_author) else: return Taxonomy.objects.filter(author=target_author).filter(...
[ "def test_permissions(self):\n taxonomy = self.get_taxonomy()\n return True if self.request.user == taxonomy.author else taxonomy.public", "def get_queryset (self, request):\n qs = super(BibliographyItemAdmin, self).get_queryset(request)\n current_user = request.user\n profile =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ensure the taxonomy is public
def test_permissions(self): taxonomy = self.get_taxonomy() return True if self.request.user == taxonomy.author else taxonomy.public
[ "def is_public(self) -> bool:\n return True", "def _force_visibility(self, visibility_field):\r\n authorized_project = acl.get_limited_to_project(pecan.request.headers)\r\n is_admin = authorized_project is None\r\n if not is_admin:\r\n self._restrict_to_project(authorized_pr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the target taxonomy from the url
def get_taxonomy(self, **kwargs): slug_taxonomy = self.kwargs.get('slug_taxonomy', None) if slug_taxonomy is not None: taxonomy = get_object_or_404(Taxonomy, slug=slug_taxonomy) return taxonomy
[ "def _get_taxonomy(self, fragment):\r\n\r\n # Pass the temporary file to the taxon assigner, and get the\r\n # taxonomy and quality score back\r\n r = self._taxon_assigner(seqs=[('fragment', fragment)])['fragment']\r\n taxonomy, quality_score = r[0], r[1]\r\n\r\n # Return the taxo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the verb categories of a taxonomy ordered by level of abstraction
def get_ordered_verb_categories(self, taxonomy, **kwargs): return [verb_cat for verb_cat in taxonomy.verb_categories.all().order_by('level')]
[ "def basic_level_categories():\n try_import('nltk'); import nltk\n nltkdir = remkdir(os.path.join(os.environ['VIPY_CACHE'], 'nltk')) if 'VIPY_CACHE' in os.environ else tempfile.gettempdir()\n os.environ['NLTK_DATA'] = nltkdir\n print('[vipy.annotation.basic_level_categories]: Downloading wordnet to \"%s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update the world by processing the move command, stepping the world and checking for final time failure.
def update_world(mv_command): global bot_position, scan MoveRobot(mv_command) # ws.stepPhysics(steps=1) if checkAtFinalTime(): return None scan_data = scan.getLeftCenterRightScanState() return scan_data
[ "def update(self):\n self.world.update()\n time.sleep(self.delay)", "def _move_and_update(self, move):\n unlocked_before_move = self.game_state.is_current_level_unlocked()\n self.rule_checker.is_valid_move(self.current_turn.entity, move, self.game_state.current_level)\n self.gam...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Log the bot position over time for later log tracking.
def log_bot_position(id): pass #global bot_position #with open("/user/moore112/bot_logging.dat","a") as f: # for b in bot_position: # f.write(str(id)+","+str(b[0])+","+str(b[1])+","+str(b[2])+"\n")
[ "def log(self):\n\n\t\t# Only every 1/10 second (or so) to avoid flooding networktables\n\t\tif not self.log_timer.running or not self.log_timer.hasPeriodPassed(self.log_timer_delay):\n\t\t\treturn\n\n\t\twpilib.SmartDashboard.putString('Pressure', '{0:.2f}'.format(self.get_pressure()))\n\t\twpilib.SmartDashboard.p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Subscriber to /clock This callback is responsible for getting the current simulation time in seconds.
def clock_callback(data): global current_second current_second = data.clock.secs
[ "def clock_callback(self, data):\n global current_second\n current_second = data.clock.secs", "def clock(self):\n return self._clock", "def timing_clock(self):\n self.send([TIMING_CLOCK])", "def get_clock(self):\n return self.clock", "def clock(self):\r\n pass", "def ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
1. 在(193,193)的hp_cls_up全局中找到最大值的点(max_r_up_hp, max_c_up_hp) 青色 (Cyan),不是最终预测bbox!! 2. 反缩小到(25,25),找到最大值点(max_r, max_c)对应的bbox 青色框 3. 将该青色bbox旋转后得到黄色bbox 4. 在score_up不再是hp_cls_up黄色bbox区域内的,局部求出最终的最大值点 粗定位是求在hp_cls_up的最大值点 精定位是求在考虑cen_up cen_up的黄色区域的局部最大值点.
def coarse_location(self, hp_cls_up, score_up, scale_score, lrtbs, img=None): upsize = (cfg.TRACK.SCORE_SIZE - 1) * cfg.TRACK.STRIDE + 1 max_r_up_hp, max_c_up_hp = np.unravel_index(hp_cls_up.argmax(), hp_cls_up.shape) # (max_y, max_x) # cv2.circle(img, (max_c_up_hp + 31, max_r_up_hp + 31), 2, (...
[ "def find_max_score_location(grid, shape):", "def find_bbox(self):\n lower_wal = (17, 250, 241) # (25, 22, 19) (22, 255, 246)\n upper_wal = (27, 256, 251) # (25, 22, 19)\n lower_bp = (99, 211, 241) # (98, 90, 77) (104, 216, 246)\n upper_bp = (109, 221, 251) # (98, 90, 77)\n lowe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates mosaic art from target image
def make_mosaic(target_im, saved_file_name): BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) color_data_file = os.path.join(BASE_DIR, 'static/images/data/average_color.csv') color_data = materials_list_from_file(color_data_file) target_file = os.path.join(BASE_DIR, 'static/images...
[ "def create_mosaic(self):\n\n mosaic = self.create_trimmed_mosaic_base()\n s_img_p = SourceImageProcessor(self.directory, (25, 25))\n\n # Calling in source image thumbnails via JSON dictionary\n json_data = s_img_p.read_source_avg_colors()[0]\n\n json_index = self.get_index(json_d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Extracts file name from file path (not including extension)
def extract_file_name(file_path): # ファイルパスからファイル名(拡張子含む)を取り出す file_name = file_path.split('/')[-1] # 拡張子を取り除く return file_name.split('.')[0]
[ "def get_filename(path):\n\n filename = path.split('/')[-1].split('.')[0]\n return filename", "def get_file_name(path):\n return os.path.basename(path)", "def get_file_name(path):\n split_path = path.split(\"/\")\n file_name = split_path[len(split_path) - 1]\n return file_name", "def filenam...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns current time as '%Y%m%d%H%M%S' string
def now_datetime(): now = datetime.datetime.now() return now.strftime('%Y%m%d%H%M%S')
[ "def str_current_time():\n return strftime(\"%Y_%m_%d_%H_%M_%S_%Z\", gmtime())", "def current_time() -> str:\n return strftime(\"%H:%M:%S\", localtime())", "def get_current_time_string() -> str:\n return datetime.datetime.now().isoformat()", "def currentDateString():\n now = datetime.now()\n re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns name of file similar to average color Find the image with average color closest to `average_color` from `color_data`
def similar_color_filename(average_color, color_data): distance = MAX_COLOR_DISTANCE filename = '' # 色の差が最小になるファイルを決定(距離に見立てている) for color in color_data: sample_color = (color[POS_RED], color[POS_GREEN], color[POS_BLUE]) d = color_distance(average_color, sample_color) if d < dist...
[ "def pythagoras_nearest_rgb(target_rgb, source_images_mean_rgbs):\n best_match_name = None\n best_match_color_difference = None\n for path, source_rgb in source_images_mean_rgbs.items():\n color_difference = pythagoras_color_difference(target_rgb, source_rgb)\n if best_match_color_difference ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validates the unique ID of an Emprestimo, with respect to type and value.
def validate_emprestimo_identifier(emprestimo_id: int): if not isinstance(emprestimo_id, int): raise InvalidFieldType(code=400) if emprestimo_id <= 0: raise InvalidFieldValue(code=400) return
[ "def validate_id_pf_esic(self):\n if self.identification_id:\n if len(self.identification_id) > 16:\n raise ValidationError(\"Aadhar Number should not exceed 16 digits\")\n if self.identification_id.isdigit() == False:\n raise ValidationError(\"Aadhar Numbe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validates the JSON dictionary sent by the user when creating a Pagamento.
def validate_pagamento_post_body(request_body: dict): required_fields = [ 'identificador_emprestimo', 'valor_pagamento' ] request_fields = request_body.keys() for current_required_field in required_fields: if current_required_field not in request_fields: raise Missin...
[ "def _validate(self):\n REQUIRED_KEYS = [ 'name', 'description', 'founded_year' ]\n\n missing_keys = get_missing_keys(self.request.data, REQUIRED_KEYS)\n if len(missing_keys) > 0:\n return f\"Request body is missing the following required properties: {', '.join(missing_keys)}.\""...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validates that the debit balance of a given Emprestimo has a valid amount.
def validate_saldo_devedor(retrieved_emprestimo: Emprestimo): saldo_devedor = Decimal(retrieved_emprestimo.saldo_devedor) if saldo_devedor <= 0: raise EmprestimoAlreadyPaid(code=400) return
[ "def test_clean_amount_insufficient_balance(self):\n # This test returns a user who have a credit of 100.00, so we will try\n # here to pass that.\n self.test_data['amount'] = 200.0\n self.form.cleaned_data = self.test_data\n\n self.assertRaisesMessage(\n forms.Validati...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
将网络输出的[tx, ty, th, tw]转化成预测框的坐标[x1, y1, x2, y2],也就是 [左上角坐标,右上角坐标] 格式 pred:网络输出,tensor anchors: 是一个list。表示锚框的大小。 YOLOv2官方配置文件中,anchors = [0.57273, 0.677385, 1.87446, 2.06253, 3.33843, 5.47434, 7.88282, 3.52778, 9.77052, 9.16828], 表示有5个锚框,第一个锚框大小[w, h]是[0.57273, 0.677385],第5个锚框大小是[9.77052, 9.16828] 锚框的大小都是表示在特征图13x13中的大小...
def get_yolo_box_xxyy(pred, anchors, num_classes): num_rows = pred.shape[-2] num_cols = pred.shape[-1] num_anchors = len(anchors) // 2 # pred的形状是[batchsize, C, H, W],其中C = num_anchors * (5 + num_classes) # 对pred进行reshape pred = pred.reshape([-1, num_anchors, 5 + num_classes, num_rows, nu...
[ "def decode(yolo_output, num_of_anchor_bbox, classes, strides, anchors, index):\n \"\"\" takes in tensor of shape (batch_size, gridsize_x, gridsize_y, number of anchor boxes, number of classes) \"\"\"\n \"\"\" returns tesnor of shape (batch_size, gridsize_x, gridsize_y, number of anchor boxes, number of class...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Read and return the entire body from an incoming ASGI message.
async def read_body(receive): body = b'' more_body = True while more_body: message = await receive() body += message.get('body', b'') more_body = message.get('more_body', False) return body
[ "def read_body(self) -> bytes:\n request_headers = self.headers\n length = int(request_headers.get('content-length', 0))\n return self.rfile.read(length)", "def read_message(self):\n\n while True:\n try:\n return sirf.from_bytes(self._read_binary_sirf_msg())\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a valid protocol message, with length field
def create_msg(data): length = str(len(str(data))).zfill(LENGTH_FIELD_SIZE) return length + str(data)
[ "def create_msg(data):\n length = str(len(str(data))).zfill(LENGTH_FIELD_SIZE)\n return length + data", "def length_prefix_message(msg):\n return struct.pack('>i', len(msg)) + msg", "def _msg_length(self) -> int:\n pass", "def encode_length(msg):\n header = str(len(msg)).encode(FORMAT)\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function is responsible for releasing the blocked IP by the set time.
def freeBlackList(): try: while True: sleep(FREE_BLACK_LIST) t = datetime.now() black_list_mutex.acquire() black_list_copy = dict(black_list) black_list_mutex.release() for blackIp in black_list_copy: if (t - black_list_...
[ "def freeIP(self,ip):\n\tself.lock.acquire()\n\ttry:\n\t try:\n\t\tself.used.remove(ip)\n\t except ValueError:\n\t\ttoLog(\"Trying to free ip %s from pool %s while it's not in used list!\"%(self.getIPpoolName(),ip),LOG_ERROR)\n\t\traise GeneralException(errorText(\"IPPOOL\",\"IP_NOT_IN_USED_POOL\")%(ip,self.g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Build search index for all documents
def build(self): self.documents = self.get_items_to_index() self.build_index()
[ "def build_index(self):\n\t\tix = self.create_index()\n\t\twriter = AsyncWriter(ix)\n\n\t\tfor i, document in enumerate(self.documents):\n\t\t\tif document:\n\t\t\t\twriter.add_document(**document)\n\t\t\tupdate_progress_bar(\"Building Index\", i, len(self.documents))\n\n\t\twriter.commit(optimize=True)", "def bu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Wraps `update_index` method, gets the document from name and updates the index. This function changes the current user and should only be run as administrator or in a background job.
def update_index_by_name(self, doc_name): document = self.get_document_to_index(doc_name) if document: self.update_index(document)
[ "def document_update(index_name, doc_type, doc_id, doc=None, new=None):\n if doc:\n resp = es.index(index=index_name, doc_type=doc_type,\n id=doc_id, body=doc)\n print(resp)\n else:\n resp = es.update(index=index_name, doc_type=doc_type,\n id...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove document from search index
def remove_document_from_index(self, doc_name): if not doc_name: return ix = self.get_index() with ix.searcher(): writer = AsyncWriter(ix) writer.delete_by_term(self.id, doc_name) writer.commit(optimize=True)
[ "async def remove_doc(self, *args, **kwargs):\n pass", "def unindex_doc(self, docid):\n _assertint(docid)\n for index in self.values():\n index.unindex_doc(docid)\n try:\n self.objectids.remove(docid)\n except KeyError:\n pass", "def delete_doc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update search index for a document
def update_index(self, document): ix = self.get_index() with ix.searcher(): writer = AsyncWriter(ix) writer.delete_by_term(self.id, document[self.id]) writer.add_document(**document) writer.commit(optimize=True)
[ "def document_update(index_name, doc_type, doc_id, doc=None, new=None):\n if doc:\n resp = es.index(index=index_name, doc_type=doc_type,\n id=doc_id, body=doc)\n print(resp)\n else:\n resp = es.update(index=index_name, doc_type=doc_type,\n id...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Build index for all parsed documents
def build_index(self): ix = self.create_index() writer = AsyncWriter(ix) for i, document in enumerate(self.documents): if document: writer.add_document(**document) update_progress_bar("Building Index", i, len(self.documents)) writer.commit(optimize=True)
[ "def build(self):\n\t\tself.documents = self.get_items_to_index()\n\t\tself.build_index()", "def build_index():\n pass", "def generate_index(self):\r\n # Reset the index as we are regenerating it from scratch\r\n self.document_index.drop_collection()\r\n # Add an index entry for each doc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Runs south schemamigration on all apps returned by "get_apps_to_migrate". Each schema migration is run with "auto" flag
def create_automatic_migration(): with cd(env.SRC_PATH): apps = run('%s fabfiles/django_scripts/get_apps_to_migrate.py' % env.PYTHON_BIN).split('\n') with settings(hide('warnings'), warn_only=True): for app in apps: output = sudo('%s manage.py schemamig...
[ "def schema(initial=False):\n if south:\n if initial:\n _local('django-admin.py schemamigration {} --initial'.format(APP_NAME))\n else:\n _local('django-admin.py schemamigration {} --auto'.format(APP_NAME))\n else:\n _local('django-admin.py makemigrations')", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets a list of apps that doesn't yet have migration from "get_apps_without_migration" script and then initializes migration for each.
def migrate_new_apps(): new_apps = run('%s %s/fabfiles/django_scripts/get_apps_without_migration.py' % (env.PYTHON_BIN, env.SRC_PATH)) # The script denotes the start of its output by "{% output %}" tag so we # only take whatever's after that new_apps = new_apps.split('{% output %}')[1...
[ "def setup_before_migration(self, apps):", "def _get_unapplied_migrations(self, loader):\n unapplied = []\n graph = loader.graph\n plan = []\n seen = set()\n\n # Generate the plan, in the order that migrations have been/should be applied.\n for target in graph.leaf_nodes(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a CHECLabPy mapping dataframe from a TargetCalib Mapping class, along with the metadata
def get_clp_mapping_from_tc_mapping(tc_mapping): df = tc_mapping.as_dataframe() with warnings.catch_warnings(): warnings.simplefilter('ignore', UserWarning) df.metadata = dict( cfgfile=tc_mapping.GetCfgPath(), is_single_module=tc_mapping.IsSingleModule(), n_pi...
[ "def map(self):\n self.df_primary_col = self.df.columns\n #print(len(self.df.columns))\n array1 = self.meta.index# sample id of metadata\n array2 = self.df.index # sample id of feature-table\n mapped_dict ={'metadata':[],'feature_table':[]}\n for i in range(len(array1)):\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }