query_id
stringlengths
32
32
query
stringlengths
9
4.01k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
f1afdeee4b2f9d6f24abcb35c1b901dc
Load a vacation collection for a given vacation.
[ { "docid": "85660bba0ac6441d7e79bb25855aa99c", "score": "0.63729554", "text": "async def load_by_parent(self, parent_ref_id: EntityId) -> VacationCollection:\n query_stmt = select(self._vacation_collection_table).where(\n self._vacation_collection_table.c.workspace_ref_id\n ...
[ { "docid": "2dcc34d62d7e088ee7f7d98983583dd4", "score": "0.5612025", "text": "def fetch_data(self) -> Collection[Vacancy]:\n try:\n self._data_source.connect()\n except Exception as err:\n logging.error(str(err))\n sys.exit()\n\n fetched_data: Collec...
78b5383d6095e742657dbe3eb54e9c4d
Create subdirectory inside the top directory.
[ { "docid": "78efd7c6aeb57dabd0d69e2a2d5e2163", "score": "0.7553697", "text": "def create_subdirectory(self, path: str, reset_if_exist: bool = False):\n if not self.top_directory_ready:\n # create subdirectory first\n self.create_top_directory()\n\n # Create subdirecto...
[ { "docid": "c2decc66b4b8d56fd53d553fc7f7010b", "score": "0.7763871", "text": "def create_sub_folder(self):\n self.sub_dir = self.dir + 'subpage/'\n if not(os.path.isdir(self.sub_dir)):\n os.makedirs(os.path.join(self.sub_dir))", "title": "" }, { "docid": "574f0b27338b163cf2818df...
9fbdaee9817b0c7325aa89a7bd3b0e9f
Clones a bunch of openstack repos.
[ { "docid": "bb202350474cfb8881b37437d3274d42", "score": "0.58093774", "text": "def clone_repos(save_dir, projects):\n repos = {}\n for project, short_project in tqdm(\n projects, unit='repo', desc='Cloning %s repos' % len(projects)):\n gitutils.clone_repo(save_dir, project)\n ...
[ { "docid": "5e6275aec9d2b50b8b07475ea2bec5c0", "score": "0.76600814", "text": "def git_clones():\n print('Cloning git repos')\n git_repos = [ # (from url, to folder),\n ('gmarik/Vundle.vim.git', '~/.vim/bundle/Vundle.vim'),\n ]\n\n for repo, to_folder in git_repos:\n if to_fol...
927be685086fc91ec64d021a4dcc49da
build a report of donors and their donations
[ { "docid": "8f78a8dc99783894f3021e2b091eb737", "score": "0.6960833", "text": "def build_report(client, database):\n\n print(\"\\n\")\n print(\"Donor Name | Total Given | Num Gifts | Average Gift\")\n\n all_donors = database.distinct('donor')\n\n for donor in all_donors:\n t...
[ { "docid": "420f1a4991bc744761545236f692c377", "score": "0.78948355", "text": "def generate_report():\n print(donors.generate_report())", "title": "" }, { "docid": "d0adbb10c6b494889604d590e32db293", "score": "0.7708783", "text": "def create_a_report():\n donors_donation_list =...
cb0ddeca3dc7638e06e9b469917ee008
Returns the string representation of the model
[ { "docid": "73b4fec9cb4bae4ece4b5ca8a3a6d67c", "score": "0.0", "text": "def to_str(self):\n return pformat(self.to_dict())", "title": "" } ]
[ { "docid": "ade3a9362342e8a6cfb9797910bc27b2", "score": "0.7877549", "text": "def __str__(self):\n return str(self.save())", "title": "" }, { "docid": "e0d6e19cf000b176b8a683aeabfa4bc6", "score": "0.7860356", "text": "def __str__(self) -> str:\n return f\"{self.model} {...
d6997f1f0563d134172dee4a49d8596e
Return PageRank values for each page by iteratively updating PageRank values until convergence. Return a dictionary where keys are page names, and values are their estimated PageRank value (a value between 0 and 1). All PageRank values should sum to 1.
[ { "docid": "d5c1f5601f0faa0f285833afd9e1ae5a", "score": "0.67862046", "text": "def iterate_pagerank(corpus, damping_factor):\n # Initialize page ranks as equal\n pageRanks = {}\n initialPageRank = 1 / len(corpus)\n for page in corpus:\n pageRanks[page] = initialPageRank\n # Initial...
[ { "docid": "3048db3d40c19b77dfac17b6256cf0d0", "score": "0.714354", "text": "def iter_rank(corpus, damping_factor):\n # createempty dict to fill later\n iterate_PR = {}\n # safe the number of pages in variable\n num_pages = len(corpus)\n # iterate over all corpus pages and initially assig...
8b3af98327fbe27b5c9a4fdd0c21a9e3
Move all selected `Card`s.
[ { "docid": "d7fcd12cc4c7bf6edc400fc2ab01dda2", "score": "0.758956", "text": "def MoveSelected(self, dx, dy):\n for c in self.GetSelection():\n self.GetParent().MoveCard(c, dx, dy)", "title": "" } ]
[ { "docid": "4514bd20bcdeb882e2fe16e8b46f3956", "score": "0.70516664", "text": "def move_all_cards(self, destination_list):\n\n self.client.fetch_json(\n '/lists/' + self.id + '/moveAllCards',\n http_method='POST',\n post_args = {\n \"idBoard\": dest...
644710bdb60e77cb43fc0da10f6caa4e
The maturity, termination, or end date of the reportable SB swap transaction.
[ { "docid": "841df26a2b32646bd8c5e37e2a45a443", "score": "0.5082271", "text": "def end_date(self) -> datetime.date:\n return self.__end_date", "title": "" } ]
[ { "docid": "9fead2249493cff7f801f24ee2578851", "score": "0.6179479", "text": "def settlement_date(self) -> datetime.date:\n return self.__settlement_date", "title": "" }, { "docid": "664ab6507f766b82f69941e9169e6bb0", "score": "0.6054682", "text": "def sell_settle_date(self) -...
942f51a34946decb8ec3299f2e99ae07
Convert unit type/unit name dictionaries to dataframes.
[ { "docid": "a14718a37e5bef727a39017b00423150", "score": "0.5903174", "text": "def equip_dict_to_df(eq_dict):\n eq_df = pd.DataFrame.from_dict(\n eq_dict, orient='index'\n ).reset_index()\n\n eq_df = pd.melt(\n eq_df, id_vars=...
[ { "docid": "e927cb57e8243474a257b46261088027", "score": "0.60803866", "text": "def to_dataframe(self, filename, unit_in_name=False):\n data, t, items = self.__read(filename=filename)\n\n if unit_in_name:\n names = [f\"{item.name} ({item.unit.name})\" for item in items]\n ...
48c474ddd0ddd9b7692df1c5de671eeb
Produces the correct results when all pairs given.
[ { "docid": "a20ac071a6db1af125736dc812dbee3f", "score": "0.56504786", "text": "def test_all_pairs_lowest_common_ancestor2(self):\n all_pairs = list(product(self.DG.nodes(), self.DG.nodes()))\n ans = all_pairs_lca(self.DG, pairs=all_pairs)\n self.assert_lca_dicts_same(dict(ans), self...
[ { "docid": "a9f13bdf52c9ee5451771617b15d6d93", "score": "0.68829733", "text": "def swissPairings():", "title": "" }, { "docid": "11649affe0005a65af7a487a76cf9e3f", "score": "0.6846344", "text": "def test_get_pairs(europarl):\n expected = [\n (\n \"Madam President...
a910746d592fcbddf45883ed699e6f7e
This starts the proxy and creates the dump file.
[ { "docid": "fa78f2588c524ea80ce8d6325fee4118", "score": "0.7243998", "text": "def start_proxy_dump(self, filters=None):\n filters = filters or ''\n date = datetime.now().strftime('%y-%m-%d_%H-%M-%S')\n dirname = os.path.dirname(self.path)\n basename = os.path.basename(self.pa...
[ { "docid": "122028d80abf75134450ed43f8d67951", "score": "0.62544495", "text": "def setup_reverse_proxy():\n from deployments.reverse_proxy.backup import BackupReverseProxy\n bring_up_service_at(reverse_proxy_path)\n run_tests_at(reverse_proxy_path)\n try:\n run(\n \"docke...
fe61d0c539cb04a1f7676efb838fe4d0
Dump SQL Server Table to dat file(csv format).
[ { "docid": "dab1ca17e1bedadafcbfd27a52894c91", "score": "0.0", "text": "def usage():", "title": "" } ]
[ { "docid": "ba7e8a551a836ac335d1b49fb8511fc6", "score": "0.68503034", "text": "def save_table(table, filename):\n\n LOGGER.info(\"Saving output table to file %s\", filename)\n \n table.to_csv(filename, sep=\";\")\n LOGGER.info(\"Saved output table.\")", "title": "" }, { "docid": ...
faa168dc342a422408b106105912764e
Just make sure it contains no dodgy characters
[ { "docid": "d69e1627af922e0513ee4dd1ecb0f421", "score": "0.0", "text": "def safeId(id, nospaces=0):\r\n lowercase = 'abcdefghijklmnopqrstuvwxyz'\r\n digits = '0123456789'\r\n specials = '_-.'\r\n allowed = lowercase + lowercase.upper() + digits + specials\r\n if not nospaces:\r\n a...
[ { "docid": "326394741baadb708199f0b15c9f11ba", "score": "0.70018435", "text": "def test_remove_invalid_chars():\n raise NotImplementedError()", "title": "" }, { "docid": "8ed81153b1dddca4aa75da28f61daddf", "score": "0.68707514", "text": "def test_ignorable(self):\n self.ass...
a93a8ef699749e6b2fbe25bb0c49f74f
Load a program into memory.
[ { "docid": "f9548bb6e8a528802b5f5293b739d253", "score": "0.63188136", "text": "def load(self, filename=None):\n\n address = 0\n\n # For now, we've just hardcoded a program:\n cur_dir = dirname(realpath(__file__))\n files = [\n join(cur_dir, 'examples/stackoverflow....
[ { "docid": "dcc4d9b85d451400c4577561ba4cac93", "score": "0.75949234", "text": "def load(self):\n\t\tprogram_filename = sys.argv[1]\n\t\t\n\t\t# Making sure the file is the right type\n\t\tif program_filename[-4:] == '.ls8':\n\t\t\t# Just a counter to keep track of where we're writing the program\n\t\t\t...
c393f76985e8d182fd8dc8e84c7e08cf
Return the filtered velocity fields with Gaussian filter. Use a series of 1D Gaussian filtering filters for the
[ { "docid": "c5c6d17113ba0eca8ad93a2ee7251208", "score": "0.68930113", "text": "def gaussian_filter(self, width):\n\n gamma = 6.0\n sigma = width / np.sqrt(2 * gamma)\n Ufh = [\n spn.fourier_gaussian(self.Uf[0], sigma, n=self.N[0]),\n spn.fourier_gaussian(self.U...
[ { "docid": "ded8d65993da7ee8904d0ad73b8d5fd2", "score": "0.68064284", "text": "def gaussian_filt(self):\n ndimage.gaussian_filter(self.im, sigma=np.random.rand(), output=self.im)", "title": "" }, { "docid": "bd9ecfb02c9df225b5c035a4143ed5a2", "score": "0.6735361", "text": "def...
d9fdb9eb82dae7ded48d2e6a106abf81
Print a todo section out
[ { "docid": "44ab5bb39d531f4591cd9ec679b6bddc", "score": "0.5477549", "text": "def get_next_todo(todo_items):\n\n return '\\n'.join([\n str(item) for item in todo_items\n if isinstance(item, TodoItem) and not item.completed\n ])", "title": "" } ]
[ { "docid": "80527e3445f17ecd69f252cc036a11e0", "score": "0.749889", "text": "def showTodo():\n\tif len(todo):\n\t\tprint(\"Here are your todos:\")\n\t\tfor item in todo:\n\t\t print(item)\n\telse:\n\t\tprint(\"You have nothing in your todo list!\")", "title": "" }, { "docid": "4f1d8917521...
9c87842ac85e4526743e3f842bc422e5
Return whether or not `user` can make changes to the test_case.
[ { "docid": "a1eb7ffe1198777232e3a041fff9654d", "score": "0.76742005", "text": "def can_edit(self, user):\n return self.testable.project.can_edit(user)", "title": "" } ]
[ { "docid": "0066bbf933f56ee1de39bee789c10729", "score": "0.731527", "text": "def can_be_modified(self, user):\n return self == user or user.is_admin", "title": "" }, { "docid": "1f6cdafa2d5eadcccf84f6e00675ca7e", "score": "0.727605", "text": "def can_user_modify(self, user):\n...
0e68618b3578b6018b49781dc9048702
TMscore superposition between densest clusters for reference and variant addTmsupdd(id='') This is a reference to the field c.vars[var]['conreg'][i][j]['tmsup'] where 'i' is ID of densest cluster for variant and 'j' is ID of densest cluster for reference.
[ { "docid": "fca03411d4a5cb41dabab81594f45d80", "score": "0.49816653", "text": "def addTmsupcc(id=''):\n \n if id:\n c=cl.loadCAN(id)\n if c.addTmsupcc()!=False: c.pickleDump()\n else:\n cl.cycleOverList('addTmsupcc')", "title": "" } ]
[ { "docid": "0db64ad0a8bcf688b2759dac76a2f6f9", "score": "0.79602724", "text": "def addTmsupdd(self,cc=False):\n\n\n if not self.vars['00']['spk']['outfile']: return\n spkref=self.vars['00']['spk']['spkobj']\n dref=''\n if spkref:\n if cc: dref=spkref.rankIDsByCscor...
5b326c7e8130a0b45a6a8520dd709589
ListFiles returns a list of all files in a SourceContext. The. information about each file includes its path and its hash. The result is ordered by path. Pagination is supported.
[ { "docid": "36159b456f3fca52ddc60d64df27ce66", "score": "0.65616167", "text": "def ListFiles(self, request, global_params=None):\n config = self.GetMethodConfig('ListFiles')\n return self._RunMethod(\n config, request, global_params=global_params)", "title": "" } ]
[ { "docid": "759b058c723a1f7b7f4c2a446ab032e3", "score": "0.6895244", "text": "def list_files(source_directory, fnmatch_list=None):\n if not fnmatch_list:\n cfignore_filename = os.path.join(source_directory, '.cfignore')\n fnmatch_list = parse_ignore_file(cfignore_filename, include_star=...
c541be8386fc0e02f711ffd4e3220819
Create a Keras Sequential model with layers.
[ { "docid": "85dc3f8d4375fbbea2fac3435330474f", "score": "0.0", "text": "def model_fn(learning_rate, lam, dropout):\n input = Input(shape=(60,60,3))\n\n # 1 block\n model = Dropout(0.2, input_shape=(60, 60, 3))(input)\n model = Conv2D(20, (5, 5), strides=(1, 1), padding='valid',\n ...
[ { "docid": "ebfdbe83725ef7866f439a166505388d", "score": "0.7731051", "text": "def createModel():\r\n\tmodel = Sequential()\r\n\t\r\n\t# Normalization layer\r\n\tmodel.add(Lambda(lambda x: (x / 255.0) - 0.5, input_shape=(160,320,3)))\r\n\t\r\n\t# Additional cropping layer to speed up training and testing...
3d7894374246ac18f98737dfccaa69f7
Message sent on DISCARD action, e.g.
[ { "docid": "c415b5706dbdef0cc8897751937646f5", "score": "0.0", "text": "def format_discard(index, suit, rank, order):\n return '{{\"type\":\"discard\",\"failed\":false,\"which\":{{\"index\":{},\"suit\":{},\"rank\":{},\"order\":{}}}}}'.format(\n index,\n suit,\n rank,\n ord...
[ { "docid": "e3704e98d4f4215bd3ef675ee0c77b04", "score": "0.6684795", "text": "def on_disconnect(self, raw_msg, server, port, **kwargs):", "title": "" }, { "docid": "d9ae247043c9ad63b5b37dcc64651072", "score": "0.65165585", "text": "def discard_cmd(self, var, wrapper, message):\n\n ...
4697db0d385c7d65fd4825f4173c7040
Asks user to specify a city, month, and day to analyze.
[ { "docid": "5a208cf47b642c844236effef09698f1", "score": "0.0", "text": "def get_filters():\n print('Hello! Let\\'s explore some US bikeshare data!')\n # get user input for city (chicago, new york city, washington). HINT: Use a while loop to handle invalid inputs\n city = ''\n while(True):\n ...
[ { "docid": "e4f3b0f25f0820149c931407b8598148", "score": "0.6613673", "text": "def get_filters():\n print('Hello! Let\\'s explore some US bikeshare data!')\n# TO DO: get user input for city (chicago, new york city, washington).\n# HINT: Use a while loop to handle invalid inputs\n \n input_city =...
fa52ef09e41034b571df8a663fd1a71c
Given a list of partitions and its two partitions, combine these two partitions into a new one appending to the partitions and remove the previous two partitions from the list of partitions
[ { "docid": "db0cfc36ba57fae707db20e7ebcb0123", "score": "0.7283396", "text": "def combine_two_partitions(\n partition_0: Partition,\n partition_1: Partition,\n partitions: List[Partition]\n) -> None:\n partition = Partition(len(partitions))\n partition.nodes = partition_0.nodes.union(part...
[ { "docid": "3092602c6698cfea60c099575ddd9d72", "score": "0.6489745", "text": "def _concat_partitions(partition_index_list, partition_index):\n if not partition_index_list:\n partition_index_list.append(partition_index)\n else:\n i = 0\n has_concat = False\n while i < le...
766a8ed5893561946ee8338f5e9ec661
Trigger spray area spray effectiveness notification.
[ { "docid": "37e35c83b5a5830963758b9903cb41ec", "score": "0.6021749", "text": "def daily_spray_effectiveness(request):\n flow_uuid = getattr(settings, \"RAPIDPRO_DAILY_SPRAY_SUCCESS_FLOW_ID\")\n spray_date = request._request.GET.get(\"spray_date\", now().date())\n daily_spray_effectiveness_task....
[ { "docid": "d3a2ec55252627fde8057e7f18ba109f", "score": "0.56746113", "text": "def _notification(self, context, method, payload):\n # By now, we have no scheduling feature, so we fanout\n # to all of the DHCP agents\n self._notification_fanout(context, method, payload)", "title"...
5d596ca5aff2bc658db87e37ec9a5831
Update OSQP problem arguments
[ { "docid": "85fd0ca03a6211f36d7c64479c40479e", "score": "0.49582827", "text": "def update(self, q=None, l=None, u=None,\n Px=None, Px_idx=np.array([]), Ax=None, Ax_idx=np.array([])):\n\n # get problem dimensions\n (n, m) = self._model.dimensions()\n\n # check consisten...
[ { "docid": "67ab6d33bb00e354b1eead3d2bb42f3d", "score": "0.6087764", "text": "def update(self, arguments):\n puts_err(colored.red(\"Not implemented!\"))", "title": "" }, { "docid": "93198cf31cb832ee9023f2884620d955", "score": "0.58223057", "text": "def update(self, args):\n ...
0bfbfa9a8de563a66e2b485023da259f
Can the vehicle disarm when requested
[ { "docid": "47444b30c731aeba5cbf6b05bcd85b83", "score": "0.63557", "text": "def SetDisarmable(self, request, context):\n context.set_code(grpc.StatusCode.UNIMPLEMENTED)\n context.set_details('Method not implemented!')\n raise NotImplementedError('Method not implemented!')", "tit...
[ { "docid": "c26b3438d02bbfaa13c01e9f26999d36", "score": "0.6797184", "text": "def disarming_transition(self):\n self.flight_state = States.DISARMING\n print(\"disarm transition\")\n self.disarm()\n self.release_control()", "title": "" }, { "docid": "025caa5111898b...
65f6545c811aa7d7bbf897f34d994365
Amount of times outcome was classified incorrectly
[ { "docid": "824226f15e76141065a3c840a11b04e0", "score": "0.5682221", "text": "def incorrect(self):\n return self.false_negative + self.false_positive", "title": "" } ]
[ { "docid": "b2898d842bea3619a255c764bbe01d3b", "score": "0.6302869", "text": "def correctly_processed(classified,actual,percentage):\n correct=0\n for i in range(0,classified.shape[0]):\n if (classified[i]==actual[i]):\n correct+=1\n return int(correct/(0.01*classified.shape[0...
6a039a186cc7f8731d7a4aef82bf9b0e
Add rule to inference engine. This function adds a rule to the inference engine's rule
[ { "docid": "fbf3f5d55f7654ece06cf5362b6e8685", "score": "0.7260785", "text": "def add_rule(self, name, rule, weight=0):\n self.rules.append((name, rule, weight))", "title": "" } ]
[ { "docid": "91d0fffa1b9c2aed4bd25dbbf11734a1", "score": "0.7664341", "text": "def addRule(self, rule):\n self.rules.append(rule)", "title": "" }, { "docid": "f62592a92b48eadd92eb4660cb02ab40", "score": "0.7472987", "text": "def add_rule(self, rule):\n self.append(rule)"...
d0ca24271bdb6995caef5341535fc1c7
Runs the map/reduce pipeline of the AnswerMigrationJob locally, with optional retrying capabilities. If fail_predicate is provided, it will be called everytime insert_submitted_answers is called in the migration job. The predicate function is passed the exploration ID, state_name, and submitted answer dict list being s...
[ { "docid": "ee6cb46b4126c33760a7cf0dd2590e73", "score": "0.72241515", "text": "def _run_migration_job_internal(self, fail_predicate=None, retry_count=0):\n orig_insert_submitted_answers = (\n stats_models.StateAnswersModel.insert_submitted_answers)\n def proxy_insert_submitted_a...
[ { "docid": "5add337bcc8849dd884986b1c112dc4a", "score": "0.5465001", "text": "def test_migration_job_should_migrate_100_answers(self):\n state_name = self.text_input_state_name\n\n rule_spec_str = 'Contains(ate)'\n html_answer = 'Plate'\n self._record_old_answer(\n ...
cd790f26c6d80542d5884ed580b671dd
Test case for get_user_data_for_search
[ { "docid": "84c765ec801a9ce9392971fa2b8d3a99", "score": "0.93368226", "text": "def test_get_user_data_for_search(self):\n pass", "title": "" } ]
[ { "docid": "a42516521631d8436291877f200a11c6", "score": "0.7881401", "text": "def test_search_user_by_userid():", "title": "" }, { "docid": "0e6558664382dfc46b13da586e74b181", "score": "0.7840525", "text": "def test_user_data_get(self):\n pass", "title": "" }, { "d...
844971ebe7e4e1ff04562b7717e192d7
Plots cumulative conversation volume. Inputs
[ { "docid": "0cf4e290322051ea49fb697263f4fa57", "score": "0.5487842", "text": "def plot_cumulative_volume(date_lists, count_lists,\n ax=None, labels=None, styles=ALL_STYLES):\n if ax is None:\n ax = plt.figure().gca()\n\n if labels is None:\n labels = [None] ...
[ { "docid": "a703f001d21e5cfb5df58def37f60f05", "score": "0.61506516", "text": "def show_compositions( self ):\n from matplotlib import pyplot as plt\n fig = plt.figure()\n ax = fig.add_subplot(1,1,1)\n for key in self.comps.keys():\n cumulative = np.cumsum(self.com...
8e0ca203a0401157052fafc596401782
Setter method for output_power_c_band, mapped from YANG variable /optical_amplifier/amplifiers/amplifier/state/output_power_c_band (container)
[ { "docid": "f7b8231afb127ad25e552c2dbd5f4574", "score": "0.9030513", "text": "def _set_output_power_c_band(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=yc_output_power_c_band_openconfig_optical_amplifier__optical_amplifier_amplifie...
[ { "docid": "6fc5538fe9c7f2e03e0a0f2674d4fad2", "score": "0.79875803", "text": "def _set_input_power_c_band(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=yc_input_power_c_band_openconfig_optical_amplifier__optical_amplifier_amplifier...
d0f1acc5760468aa2d7d14eeab6b8077
Translate a package/path specification into a real file system pathname.
[ { "docid": "dcc68419c7223e5a0222285f0c51cf91", "score": "0.57839155", "text": "def package_to_directory(package_path: str) -> str:\n pkgname, subpath = package_path.split('/', 1) if '/' in package_path else (package_path, '')\n module = import_module(pkgname)\n path = Path(module.__spec__.origi...
[ { "docid": "0cf0a32315ec4f5c8931f5f75f03d0c9", "score": "0.6578487", "text": "def abspath(self, spec, current_package, current_directory):\n return spec", "title": "" }, { "docid": "03b9f49071db0b631155ca087358bdc1", "score": "0.65406543", "text": "def resolve_path(somepath):\...
d8be451c29765bdb311de831c5688955
Function to remove the item.
[ { "docid": "0859e250316204cdc8befe292896312b", "score": "0.0", "text": "def remove_item(item_id):\n try:\n # Delete the item\n delete_item = collection.delete_one({\"id\": int(item_id)})\n\n if delete_item.deleted_count > 0 :\n # Prepare the response\n retur...
[ { "docid": "7d69d8ee32b7d32fecfe39b8263daef1", "score": "0.87598383", "text": "def remove(self, item):\n pass", "title": "" }, { "docid": "9e8babe5e0473f3e866e22e16da97497", "score": "0.8442763", "text": "def remove_item(self, item):\n self.items.remove(item)", "title":...
c3701aa3a35cc17482957bafa88bd3ed
Retorna una lista (sin ningun orden en especifico) de todos los correos con notas validas. Con el proposito no enviar notificacion a los alumnos que no hicieron examen.
[ { "docid": "8e5f6f89e5fbf338849ed6d1214bc8ee", "score": "0.7157397", "text": "def correos_validos(self,examen,**kwargs):\n #SI EXAMEN ES NONE RETORNE LA LISTA COMPLETA DE TODOS LOS \n #CORRREOS SIN NINGUNA VALIDACION\n\n campos = kwargs.get('campos', None)\n salida = []\n ...
[ { "docid": "ad80dc83c79d5f8857f153bf37a56f0b", "score": "0.6151421", "text": "def Mujicanos(self):\n\n #Obtener lista de usuarios\n query = \"\"\"SELECT usuario FROM transacciones WHERE nota='Bono Inicial'\"\"\"\n\n self.cursor.row_factory = lambda cursor, row: row[0]\n\n res...
d4af32e4ade14e75f4df812e056c89b4
Empty the block queue, appending valid blocks
[ { "docid": "6fbdd6ccb9b599c1a5f41d79a3ad4d7f", "score": "0.67230886", "text": "def handle_blocks(self):\n while self.block_queue:\n chain = self.block_queue.pop()\n valid = verify_blockchain(chain)\n if valid:\n if valid > len(self.blockchain):\n ...
[ { "docid": "a18544eade4f97602067a54d682b7a76", "score": "0.7343603", "text": "def clear_queue(self):\n self.queue = []", "title": "" }, { "docid": "8d6d69644c1c81fc54adfce51a3d53c9", "score": "0.72773266", "text": "def clear(self):\n\n self.queue = []", "title": "" ...
f1a969c5811c19c6d83737e5a49392ff
Returns the input sequences ready to feed to the model.
[ { "docid": "ce8f9f3ea31d3c63fb699fc2d55948b5", "score": "0.0", "text": "def get_input_sequences(queue, interaction_group, win_size = win_size):\n seq = []\n for row in interaction_group.itertuples():\n str_uid = str(row.user_id)\n if str_uid in queue:\n user_queue = queue[...
[ { "docid": "1ebeaad2705ccbc5053f5118e3e2bbfa", "score": "0.71023315", "text": "def get_all_sequences(self):\n return self._data", "title": "" }, { "docid": "1ebeaad2705ccbc5053f5118e3e2bbfa", "score": "0.71023315", "text": "def get_all_sequences(self):\n return self._da...
f81939cd80877f12bbdc863d961d356f
Subclasses should override this to return a tuple (attribute_model, keyword_args), where attribute_model is a model class and keyword_args is a dict of args to pass to attribute_model.objects.get() to get an instance of the given attribute on this object.
[ { "docid": "7ac88cb163adbd5854d85d11134298a7", "score": "0.7411711", "text": "def _get_attribute_model_and_args(self, attribute):\r\n raise NotImplementedError", "title": "" } ]
[ { "docid": "9265517073b45928e1459bb4bf1079bc", "score": "0.67041254", "text": "def get_attribute(\n self, key=None, category=None, value=None, strvalue=None, obj=None, attrtype=None, **kwargs\n ):\n dbmodel = self.model.__dbclass__.__name__.lower()\n query = [(\"attribute__db_att...
215688abfb9e533a2e3c162c5e0037ff
Discretise the evaluations of the field over the reciprocal space in the cube [pi/LN, pi/LN]^d = [pi/delta_L, pi/delta_L]^d where delta_L = L/N and N is the number of voxels along each axis This transforming G linearly such that [pi/delta_L, pi/delta_L]^d is mapped to [0, N]^d. Then it the resulting vectors are rounded...
[ { "docid": "12a63d6493bd68bf516f4d21d52c8122", "score": "0.54301816", "text": "def make_voxel_grid(G, SG, L, N, rot=None):\n \n d, n = G.shape\n absSG = np.abs(SG)\n voxel_width = 2*np.pi / L\n grid_width = voxel_width * N # = 2*pi/delta_L\n \n if rot is None:\n rot = np.eye(...
[ { "docid": "27a886d3e40bb8d40d0a4fa5674a7df9", "score": "0.62240213", "text": "def shell_Green_grid_Nmn_vec_mp(n,k, rsqrgrid,rdiffgrid, RgBgrid,RgPgrid, ImBgrid,ImPgrid, vecBgrid,vecPgrid):\n #rsqrgrid = rgrid**2\n #rdiffgrid = np.diff(rgrid)\n \n RgNvecNrsqr_grid = (RgBgrid*vecBgrid+RgPgrid...
a42e24db4d41be9d57a2da0e98801c4c
Multiply this fractional operand to another fractional operand. a_b/c multiply d_e/f = ((c a + b) (d f + e)) / (c f)
[ { "docid": "b760acb6b5453b73ab2176946c36ef31", "score": "0.55668175", "text": "def multiply(self, operand2):\n self.makeIrregularFraction()\n operand2.makeIrregularFraction()\n isResultNegative = self.isNegative != operand2.isNegative\n self.numerator *= operand2.numerator\n ...
[ { "docid": "f5fbb124c279ae869835889d24601e6f", "score": "0.69394886", "text": "def __mul__(self, frac):\n new_numerator = self.numerator * frac.numerator\n new_denominator = self.denominator * frac.denominator\n return Fraction(new_numerator, new_denominator)", "title": "" }, ...
f448a2968c600d37dce93bf997441498
This method links a Category to a list of Group
[ { "docid": "eede6ce81939bfbe1959381b93ac746a", "score": "0.7888721", "text": "def _link_cat_group(self, cat, cat_obj, group_list):\n cat_obj_list = list()\n try:\n # Category.groups.add\n cat_obj.groups.add(*group_list)\n # save\n cat_obj.save()\...
[ { "docid": "dc07fb5791871e78f48da84cdfa1a3df", "score": "0.64206755", "text": "def _api_category_to_group(self, entropy, category):\n spm_class = entropy.Spm_class()\n groups = spm_class.get_package_groups()\n for group, g_data in groups.items():\n for cat in g_data['cate...
f2d83f40b6357c0ca0aac647c671560a
Should get the start and end of each offset.
[ { "docid": "90b9e75305135641634abe74bceeb5b8", "score": "0.0", "text": "def test_next_subpart_offsets(text, expected):\n assert reg_text.next_subpart_offsets(text) == expected", "title": "" } ]
[ { "docid": "7401ab83408dcd1b7fb745a88aaff7e5", "score": "0.7382333", "text": "def get_offset(self):", "title": "" }, { "docid": "437dd14916c2fa17b6ec1235a2555499", "score": "0.7259288", "text": "def get_doc_offsets(self, doc):\n\n start = self.source.get_offset(doc.location)\n ...
57be657a4d09eecd5e0fed332fe96af9
Return the entity reference that corresponds to code
[ { "docid": "8cb7f31221bab232aa84a5805aa6852b", "score": "0.8832552", "text": "def entity_reference_for(self, code: str) -> Optional[EntityReference]:", "title": "" } ]
[ { "docid": "807c490e8a8d52d2472e371fec59ac73", "score": "0.6120491", "text": "def get_reference(self):\t\t\n\t\treturn self._reference", "title": "" }, { "docid": "7a5d6d8ad8993b466605566d66559b08", "score": "0.60175407", "text": "def ReturnCodeObject(self,code):\n\n if code i...
e4b168585c64da48116edd182e4474db
The same logic as for font_refine.
[ { "docid": "3cc440947cb24b5d69238fa0709d5508", "score": "0.0", "text": "def height_refine(self, texts):\n height_freq = nltk.FreqDist(text.get('height') for text in texts)\n height_target = int(height_freq.most_common(1)[0][0])\n height_refined_list = [pos for pos, text in enumerate...
[ { "docid": "e5aafa17e3cd27f10d29e4a465aec290", "score": "0.71339905", "text": "def font_refine(self, texts):\n font_freq = nltk.FreqDist(text.get('font') for text in texts)\n font_target = font_freq.most_common(1)[0][0]\n font_refined_list = [pos for pos, text in enumerate(texts) if...
fa15aafbafc9c886d9e75e75f4558262
testGetAllAlbums Ensures all albums are returned
[ { "docid": "2773cfcfdd3cca7300991f7987b267f2", "score": "0.90769607", "text": "def testGetAllAlbums(self):\n result = self.musiclibrary.get_all_albums()\n for i in result:\n self.assertTrue(isinstance(i, Album))\n self.assertEqual(len(result), 2)", "title": "" } ]
[ { "docid": "febe3ac780c2a1b610564fafaa7267aa", "score": "0.794768", "text": "def test_list_albums(self):\n response = self.client.get('/api/albums/')\n\n self.assertEqual(response.status_code, 200)\n self.assertEqual(response.data[0]['name'], 'A Love Supreme')\n self.assertEq...
803e18208a2933bfdcf3c062afc2fd57
Fail the current test case unless stdout contains these strings.
[ { "docid": "78e699e59f04d2a473a0a5749a4d38b2", "score": "0.75157183", "text": "def failUnlessStdOutContains(self, *strings):\n self.failUnlessFileContains(self._get_std_out_file_path(), *strings)", "title": "" } ]
[ { "docid": "3f5950c753466f7067e29ceaf7b32730", "score": "0.7515792", "text": "def failIfStdOutContains(self, *strings):\n self.failIfFileContains(self._get_std_out_file_path(), *strings)", "title": "" }, { "docid": "5d0310fe70521192fdc21e9b5b829600", "score": "0.71225023", "te...
85ec884276afd7f9873afbd2d7d50e7c
Verify Unpacker component behavior when run as a script. Test to make sure running the Unpacker as a script does the async setup work that we expect and then launches the unpacker service.
[ { "docid": "d84feecbb8f3b12f18a1534c64684729", "score": "0.68615866", "text": "async def test_script_main(config: TestConfig,\n mocker: MockerFixture,\n monkeypatch: MonkeyPatch,\n path_map_mock: MagicMock) -> None:\n logge...
[ { "docid": "91d5e1ffe2fea93dfbe4295d2bfbd760", "score": "0.67049116", "text": "async def test_unpacker_run(config: TestConfig, mocker: MockerFixture, path_map_mock: MagicMock) -> None:\n logger_mock = mocker.MagicMock()\n p = Unpacker(config, logger_mock)\n p._do_work = AsyncMock() # type: ign...
0ba32729d4e607f28a3b97350e739912
Abstract classes can override this to customize issubclass(). This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
[ { "docid": "af451e6cbe8b5cad490094662b26436f", "score": "0.0", "text": "def __subclasshook__(self, *args, **kwargs): # real signature unknown\n pass", "title": "" } ]
[ { "docid": "72d481b44f2f757d89c6d3ae6d69e1d4", "score": "0.68862", "text": "def __sublcasscheck__(self, subclass):\n return True", "title": "" }, { "docid": "fa76d0451cde61e8f4b0638f59e42be2", "score": "0.6714018", "text": "def IsSubclass(self):", "title": "" }, { ...
ed37ca3ea6a892f90d435affc14d6375
Normalize inputs and reshape into 1d vector
[ { "docid": "58c664560df240c01f46ed27135cf05b", "score": "0.0", "text": "def preprocess_mnist_data_test(X, y, max_X, min_X):\n new_X = ((X - min_X) / (max_X - min_X)).reshape(X.shape[0], X.shape[1] * X.shape[2])\n new_y = y\n return new_X, new_y", "title": "" } ]
[ { "docid": "42da61e6a09edc364e97d04c5f5a3421", "score": "0.7477076", "text": "def normalize(x: np.ndarray):\n return x/np.linalg.norm(x, ord=2, axis=0, keepdims=True)", "title": "" }, { "docid": "8e9096b1b7c5ecb04066feacafa4353a", "score": "0.73763716", "text": "def normalize_inpu...
8a3e2d7d8ac79b58a23548c4d9a3f56c
Do not include CtrlNet in link messages describing this session.
[ { "docid": "38d6897cfe95cbb9b5a71d7bff33ab7e", "score": "0.0", "text": "def all_link_data(self, flags):\n return []", "title": "" } ]
[ { "docid": "9a85a0587df89835fc8d53e39a092f2e", "score": "0.52527857", "text": "def on_privmsg(self, bot, source, target, message, network, **kwargs):\n\t\tpass", "title": "" }, { "docid": "d86095bd563251b57030e764a2e1298b", "score": "0.51981294", "text": "def DisableConnectionStatusM...
a67f8dfd9f00af424c4b5eb9c3b70773
This function takes an S3 bucket name and prefix (flat directory path) and returns a list of GeoTiffs. This function utilizes boto3's continuation token to iterate over an unlimited number of records. BUCKETNAME A bucket on S3 containing GeoTiffs of interest PREFIXNAME A S3 prefix. NAMESELECTOR A string used for select...
[ { "docid": "71f74ac9049ac615ff22dabbc62b266c", "score": "0.71820045", "text": "def s3List(bucketName, prefixName, nameSelector, fileformat):\r\n # Set the Boto3 client\r\n s3_client = boto3.client('s3')\r\n # Get a list of objects (keys) within a specific bucket and prefix on S3\r\n...
[ { "docid": "b048d500640d188e494a2c7bc7f77874", "score": "0.6359494", "text": "def list_of_bucket_files(inp:str, prefix='/', delimiter='/',\n include_prefix=False):\n if inp[0:2] == 's3':\n parsed_s3 = urlparse(inp)\n bucket_name = parsed_s3.netloc\n prefix...
737d257fb52c537ba1d558bdecfe5d06
Check if the archive at the given path, if present, is suitable for providing the simulation data necessary to perform the analysis specified by this data point. Simulation duration and number of stimulus patterns need to be greater in the archive than in the analysis settings, while the number of trials that can be ex...
[ { "docid": "5ab1a005ca5dedd83dfe5741230b9c03", "score": "0.71677554", "text": "def is_spike_archive_compatible(self, path):\n path_sdur = float(path.rstrip('.hdf5').partition('sdur')[2])\n path_n_trials = float(path.rpartition('_t')[2].partition('_sdur')[0]) * (1 + max(0, (path_sdur - self...
[ { "docid": "4a519fd0648d595e4f083b3d64be836a", "score": "0.5734603", "text": "def zipfile_ok( path_to_archive ):\n basename = os.path.realpath( os.path.dirname( path_to_archive ) )\n zip_archive = zipfile.ZipFile( path_to_archive )\n for member in zip_archive.namelist():\n member_path = ...
f72da818333b04e8ed1cb8df88d6a471
This tests that the output for angles is in degrees, and angles must be between (inclusively) 0 and 90 degrees.
[ { "docid": "5120335bf2c6a9dcb637cc7f2a25e75b", "score": "0.64520794", "text": "def test_solve_atmospheric_entry_angle_check(planet, input_data):\r\n frame = planet.solve_atmospheric_entry(**input_data)\r\n assert frame['angle'].min()>= 0 and frame['angle'].max()<= 90", "title": "" } ]
[ { "docid": "62064195b3460b005c4129e23e67aef3", "score": "0.7224768", "text": "def check_angle_units(self):\n\t\tif self.degrees_var.get():\n\t\t\tself.degrees = True\n\t\t\tself.angle_unit = 'degrees'\n\t\telse:\n\t\t\tself.degrees = False\n\t\t\tself.angle_unit = 'radians'", "title": "" }, { ...
3f582cc9fc2111a6593a61a3f9554967
Sets bidask flag to ask
[ { "docid": "1a529871bd0eeb77af2acd81cd5d796e", "score": "0.8801817", "text": "def settoask(self):\n self.bidask = 'ask'\n return", "title": "" } ]
[ { "docid": "8401524260e2e8a345c92c117cd435c3", "score": "0.8016198", "text": "def settobid(self):\n self.bidask = 'bid'\n return", "title": "" }, { "docid": "8401524260e2e8a345c92c117cd435c3", "score": "0.8016198", "text": "def settobid(self):\n self.bidask = 'bi...
dc399628be6866fc4fec335cb68facd6
Returns a string, suitable to be printed on the command line, that contains a record of the repos and commits that are about to be modified. If no ref info is passed in, return None.
[ { "docid": "5e20dd6cb9fa5c9d8237673a629aedcb", "score": "0.6277848", "text": "def todo_list(ref_info):\n if not ref_info:\n return None\n\n entries = []\n for repo, commit_info in ref_info.items():\n when = datetime.datetime.strptime(commit_info['committer']['date'], \"%Y-%m-%dT%H...
[ { "docid": "d6ec6c1c1f20e3b56b72dc2b29202232", "score": "0.68548274", "text": "def _get_git_devstr():\n from os import path\n from subprocess import Popen, PIPE\n\n currdir = path.abspath(path.split(__file__)[0])\n\n p = Popen(['git', 'rev-list', 'HEAD'], cwd=currdir,\n stdout=P...
4a917e74a71847fe3ac5875c20a236a2
Return the typecode as Numeric would
[ { "docid": "c7dcf52b76450dd3554d2aad8cd6395a", "score": "0.858498", "text": "def typecode (self) :\n return self.numeric_typecode", "title": "" } ]
[ { "docid": "002d821b322dc801f58b021a7ad5f06f", "score": "0.7552601", "text": "def numericType(*args, **kwargs):\n \n pass", "title": "" }, { "docid": "002d821b322dc801f58b021a7ad5f06f", "score": "0.7552601", "text": "def numericType(*args, **kwargs):\n \n pass", ...
69d24f3777f5162334d860172da1770f
Performs WhitePatch to the image
[ { "docid": "08fdb7af102bc64c6545aefd89e8179b", "score": "0.71088153", "text": "def preprocess_whitePatch(im):\n\tbmax, gmax, rmax = np.amax(np.amax(im,axis=0),axis=0)\n\n\talpha = gmax/rmax\n\tbeta = gmax/bmax\n\n\tred = im[:,:,2]\n\tred = alpha * red\n\tred[red > 255] = 255\n\tim[:,:,2] = red\n\n\tblue...
[ { "docid": "d8ef3bddadc3a4389f28ae8b7fe424ce", "score": "0.70620036", "text": "def make_white(self):\n pixel_values = self.get_pixel_list()\n for i in range(len(pixel_values)):\n pixel_values[i] = (255,255,255)\n self.img.putdata(pixel_values)\n return None", "...
b0f814314e3cc76797644ae25ab03afe
Stop the timer and return the time since the timer was started.
[ { "docid": "11cb95140a051401fa310bafae79d06c", "score": "0.766232", "text": "def stop(self):\n timeNow = time.time()\n return (timeNow - self.__startTime)", "title": "" } ]
[ { "docid": "abb5e2efe8b4fc6df91392ed90285c2c", "score": "0.8665982", "text": "def stop_timer(self):\n\n end_time = time.time()\n return end_time - self.start_time", "title": "" }, { "docid": "88f0dc969dfc0aa2fde845afc5d122b1", "score": "0.7649472", "text": "def stop(sel...
119882ab97b19f78c60d13fce2c82f65
r"""Returns the BPM (beats per minutes) of a list of beats, assuming the list is complete and accurate.
[ { "docid": "592f458b77b2d0adc510f0f41daee559", "score": "0.69709456", "text": "def ground_truth_bpm(beats):\n\n bpm = 60 / (beats[1:] - beats[:-1]).mean()\n\n return bpm", "title": "" } ]
[ { "docid": "d54d03f51d099aa21181ae32d5e769ca", "score": "0.6421484", "text": "def milliseconds(BPM, duration):\t\n\tif duration == None: \n\t\tduration = 1\n\t#Divide BPM by 60s to get beats per second\n\t#Divide by 1000ms to get milliseconds per beat\n\t#Multiply by fractional duration to get total mil...
8bc0e5129267125afb0c3e5f0947ebaf
Delete the given IAM ARN from the KMS key policy.
[ { "docid": "9da9d7c99c157c44a23c702a00e9eddf", "score": "0.6872568", "text": "def cloudformation_delete(event, context):\n if DEBUG_MODE is True:\n print(\"Delete Option: Attempting to remove IAM ARN from KMS key policy\")\n original_policy_document = get_kms_key_policy(event, context)\n ...
[ { "docid": "a12c55925ad0ccb847242cecccbbc109", "score": "0.6743698", "text": "def delete_old_access_key(key_to_delete):\n iam_client = boto3.client('iam')\n iam_client.delete_access_key(AccessKeyId=key_to_delete)\n print('Old access key deleted from IAM')\n return True", "title": "" },...
3a862f5cfff57b8de066b6f30c9a98b2
1. Cleanup A sample dataset of request logs is given in data/DataSample.csv. We consider records that have identical geoinfo and timest as suspicious. Please clean up the sample dataset by filtering out those suspicious request records.
[ { "docid": "6335b04ed831ca4cb7949ca1fd767921", "score": "0.0", "text": "def main(data_file, poi_list_file, output_file):\n # _ID, TimeSt,Country,Province,City,Latitude,Longitude\n df = get_clean_df(data_file, ['TimeSt', 'Latitude', 'Longitude'])\n\n \"\"\"\n 2. Label\n Assign each request...
[ { "docid": "75a4f3cedefe50cd0d8aa5ff969fb08e", "score": "0.63649476", "text": "def clean():\n try:\n data_mining.clean_data(adult_data_test)\n except Exception as e:\n raise e", "title": "" }, { "docid": "2255c8d3ff02585a1ef548fa2a757b33", "score": "0.62893784", "...
0c21c3aa64ea60a0322f8d5c32cfb4ae
Method used to destroy a database
[ { "docid": "39da3f35b7a57f0914b8b981896ebe3b", "score": "0.73417217", "text": "def teardown_db():\n DBSession.rollback()\n DBSession.remove()\n engine = config['pylons.app_globals'].sa_engine\n model.metadata.drop_all(engine)\n print \"TEARDOWN DB\"\n\n #transaction.doom()", "title...
[ { "docid": "485663d4dd82036f50bfe78448227ad2", "score": "0.8324287", "text": "def destroy():\n\tif db:\n\t\tdb.close()\n\n\trelease_local(local)", "title": "" }, { "docid": "b6cde607122211416d61546f50e65669", "score": "0.81100446", "text": "def destroy():\n\tdb.drop_tables()", "t...
4f29c4e79331b1b7e2a2d5ad66f74405
Test scale virtual machine under useraccount
[ { "docid": "cc8dbe8949a2e0f61bf17786ac092c7e", "score": "0.79915226", "text": "def test_04_scale_vm_with_user_account(self):\n # Validate the following\n # Create a user Account and create a VM in it.\n # Scale up the vm and see if it scales to the new svc offering\n\n # Crea...
[ { "docid": "a1b60e7b5bdf8ff8b895fd3e192e9be7", "score": "0.70089865", "text": "def test_01_scale_vm(self):\n # Validate the following\n # Scale up the vm and see if it scales to the new svc offering and is\n # finally in running state\n\n # VirtualMachine should be upd...
601ad08ca2b8fc896799d6e5961d8229
turn 90 degree counterclockwise
[ { "docid": "2748b958352a2102af5bcd2b3f2bd4fd", "score": "0.0", "text": "def turn_left(self):\r\n ###### add the connection to EV3 here!!\r\n self.current_direction = (self.current_direction + 1) % 4\r\n self.turn_count += 1\r\n if self.algo == \"dfs\":\r\n self.dif...
[ { "docid": "ef247b04cc2412111a1afce9d44cb88c", "score": "0.7279652", "text": "def counterclockwise(self):\n\n self.current_frame -= 1\n if self.current_frame < 0: \n self.current_frame = len(self.frames) - 1", "title": "" }, { "docid": "4df79113cd85186c2b9a4a2cfcf300...
39a308cdc700abad40d5c0b3ae2e734e
Split password output by newline, extract user and name (1st and 5th columns), strip trailing commas from name, replace multiple commas in name with a single space return dict of keys = user, values = name.
[ { "docid": "b2f724e328de9a078cfa3a1d2390356e", "score": "0.7304084", "text": "def get_users(passwd: str) -> dict:\n output = {}\n for row in passwd.strip().splitlines():\n fields = row.split(':')\n username = fields[0]\n name = re.sub(r',+', r' ', fields[4].strip(',')) or 'unk...
[ { "docid": "a6573ab85894ae51cc1a1c7f22042722", "score": "0.6514482", "text": "def parse_passport_fields(passport: str) -> Dict[str, str]:\n fields = [f.split(\":\") for f in passport.replace(\"\\n\", \" \").split(\" \")]\n return {k: v for k, v in fields}", "title": "" }, { "docid": "c...
400e82e3319afc16e891b92f2f5025f8
This program loads an image and applies the narok filter to it by setting "bright" pixels to grayscale values.
[ { "docid": "553d12c6a59be2318aa810742e2de8e7", "score": "0.7051816", "text": "def main():\n image = SimpleImage('images/simba-sq.jpg')\n\n # visit every pixel (for loop)\n for pixel in image:\n # find the average\n average = (pixel.red + pixel.green + pixel.blue) // 3\n # i...
[ { "docid": "aaff04cfdc2cf4e68577283169eb7f6d", "score": "0.64812326", "text": "def main():\n image = SimpleImage('images/girl.jpeg')\n\n for pixel in image:\n if should_be_black(pixel):\n pixel.red = 255\n pixel.green = 255\n pixel.blue = 255\n else:\...
3025508deddeea3b3da3e3544ebf574f
Function that plots the predictions's distribution of the generated SMILES strings, obtained by the unbiased and biased generators.
[ { "docid": "310efd8be6cc05366413082477410959", "score": "0.6883328", "text": "def plot_hist_both(prediction_unb,prediction_b, n_to_generate,valid_unb,valid_b,property_identifier):\r\n prediction_unb = np.array(prediction_unb)\r\n prediction_b = np.array(prediction_b)\r\n \r\n legend_unb = ''...
[ { "docid": "a0e8f36e4c8ac676c433979230d45dde", "score": "0.72062135", "text": "def plot_hist(prediction, n_to_generate,valid,property_identifier):\r\n prediction = np.array(prediction)\r\n x_label = ''\r\n plot_title = '' \r\n \r\n print(\"Proportion of valid SMILES:\", valid/n_to_generat...
c95ad2851b4b88758091bdb9b28f0a00
Refine classified proposals and filter overlaps and return final detections.
[ { "docid": "1e09d1cd9b53b578bde145b240202520", "score": "0.549406", "text": "def detections(rois, probs, deltas, image_meta, config):\n window = image_utils.unmold_meta(image_meta)[\"window\"]\n\n # Class IDs per ROI\n _, class_ids = torch.max(probs, dim=1)\n\n # Class probability of the top...
[ { "docid": "f4ac702ac1652ea8b9c97ef26a274eef", "score": "0.67093545", "text": "def filter_region_proposals(self):\n for i, datum in enumerate(self.data):\n H, W = datum['h'], datum['w']\n scale = self.target_image_size / max(H, W)\n\n scale /= 8\n okay ...
997b40ed375c4758b625122b5db3683f
This method will be called after `connect` is called. After this method finishes, the writer will be drained. Subclasses should make use of this if they need to send data to Telegram to indicate which connection mode will be used.
[ { "docid": "7601b8873ffa5e67c8ece4089717af6f", "score": "0.54554355", "text": "def _init_conn(self):\n if self._codec.tag:\n self._writer.write(self._codec.tag)", "title": "" } ]
[ { "docid": "38bb38c729d480f310e2383f029b560b", "score": "0.6488908", "text": "def writer(self):\n while self.alive:\n try:\n data = self.socket.recv(1024)\n if not data:\n break\n self.log.info(\"<-- %s\", list(self.rfc221...
b8bd007d7f453e89f2351907b7a4429b
Implements the predicate by determining if value == operand.
[ { "docid": "deb7e0aa559f80739b46afe69143c166", "score": "0.5602225", "text": "def __call__(self, context, value):\n if isinstance(value, basestring):\n return self.__check_operand_and_call(context, basestring, value, STR_EQ)\n if isinstance(value, dict):\n return self.__check_operand_and...
[ { "docid": "11a75fcbb4e743ecc5c8b98a89b568f8", "score": "0.6947697", "text": "def __eq__(self, value):\n\t\treturn self.value == value", "title": "" }, { "docid": "931edb90b66dae2fb0daf56159d740ba", "score": "0.6722959", "text": "def __contains__(self, value):\n\n return self....
d5a70aa3d0079f848917f115d0b46540
Get the currently applied filters with their readable values. Looks up the humanfriendly value for fields with choices and calculates the url to remove each filter.
[ { "docid": "7fa5890a2804d20117836bbd1bcbfb4a", "score": "0.6289799", "text": "def get_readable_filters(self, with_remove_links=False):\n filters = {}\n\n for name, value in self.get_raw_filters().items():\n value = copy.copy(value)\n key = self.get_filter_key(name)\n ...
[ { "docid": "303fa0458ac682ca8979e0fa2166fdc4", "score": "0.65556693", "text": "def get_filters(self):\r\n return self.__filters", "title": "" }, { "docid": "8e795a969cb39f4fbbad82ed8a31d14d", "score": "0.6443963", "text": "def get_filter(self):\n return self.__filters[s...
9c8cd9ef14c8648c41dbce6c4d7aaf41
Will be deprecated in favor of Simulation.initialize(). Replace in code, will be removed at or before v1.0.0
[ { "docid": "501d6281c92d3fe97c4124f65fc3dce0", "score": "0.8208679", "text": "def initialize_simulation(self):\n\n warnings.warn(\n \"Simulation.initialize_simulation() is replaced by Simulation.initialize() and will be deprecated at or before defSim v1.0.0\",\n category=Fut...
[ { "docid": "469c26f0edd3c0dded13ebf120d8c8b2", "score": "0.68212414", "text": "def _setup_sim(self):\n raise NotImplementedError", "title": "" }, { "docid": "ddcb531260db5f74dbf20d2a6c653f02", "score": "0.6753155", "text": "def init_sim():\n\n print(\"Creating population\")...
e832510024261fa3c983fe9e7e7854e3
Delete a new BridgeDomain.
[ { "docid": "4b6866a437046c6754ad6e6ff7cc6f3a", "score": "0.0", "text": "def delete(self, node_type, node_id):\n url = self._url('node', node_type, node_id)\n self._delete(url)", "title": "" } ]
[ { "docid": "216d0d7b993759eb24ef3fbae02bc061", "score": "0.7052366", "text": "def delete_domain(self, domain_spec, delete_dependencies=False):\n pass", "title": "" }, { "docid": "f324136af1685db477ea2804a46409e7", "score": "0.69567776", "text": "def delete_domain(self, domain_...
61d3b6d8df4e0289ea1bd7a1758748b7
Counts the total number of bags contained in the bag
[ { "docid": "f2ba0b2855248ddcd7616a456eabd28b", "score": "0.7824124", "text": "def inside_bag_count(self):\n if not self.containees:\n return 0\n\n count = 0\n for number, name in self.containees:\n count += number * (1 + Bag.collection[name].inside_bag_count)\n...
[ { "docid": "3b7d03054db7468d5c2144763718f1ec", "score": "0.8159138", "text": "def num_bags(bag_type: str) -> int:\n\n result = 1\n\n for key, value in rules[bag_type].items():\n # We add 1 to num_bags(key) so that we count the actual bag with type key.\n result += value * (num_bags(k...
dbfd34aebb1c0ddd81638ddcf1da768c
Get Passive total data
[ { "docid": "4cf6299277031da97255163e759e2785", "score": "0.0", "text": "def getPT(self):\n if not self.ptapi:\n return False\n command = \"curl -m 25 --insecure -s -u \" + self.ptuser + \":\" + self.ptkey + \" 'https://api.riskiq.net/pt/v2/dns/passive?query=\" + self.ip + \"'\"\...
[ { "docid": "231da07473aef7149cd6581d0b1881bc", "score": "0.7550525", "text": "def patrimony_total(self):\n pass", "title": "" }, { "docid": "f15ad4868023119d2906fb1a4dddec28", "score": "0.71757656", "text": "def total(self):\n\t\treturn self._total", "title": "" }, { ...
37e7d438ef02abdf6317338e042de9cd
Test the `config.commands.search.context` setting.
[ { "docid": "5df43a952d6d15b82c678129969031a8", "score": "0.73624146", "text": "def test_context_configuration(self, setup: Any) -> None:\n config.commands.search.context = 2\n\n cmd = SearchCommand(\n \"einstein\",\n \"-i\",\n \"-c\",\n \"2\",\n ...
[ { "docid": "e10689036335fbbb48a0cd39ef5563c5", "score": "0.62758994", "text": "def test_contexts_search(self):\n from .mockers import create_context, create_contextA, create_contextB\n\n self.create_context(create_context)\n self.create_context(create_contextA)\n self.create_...
5156c7a834bb7a3488e6720c34c7a1d2
Pops next token value
[ { "docid": "716e5a5cb8b66a74e098e1bb9a782765", "score": "0.7025629", "text": "def next(tokens):\n return tokens.next_pair()[1]", "title": "" } ]
[ { "docid": "1c44fe9e59a741515ad58d732a600e80", "score": "0.77126354", "text": "def _pop_token(self):\n return self._tokens.pop(0)", "title": "" }, { "docid": "e5f3e681cbe93e988efa84ffc58ddd7a", "score": "0.7448798", "text": "def pop_next():", "title": "" }, { "doci...
13e3bf1628847f08c6bbeb374b7ecc03
r"""__init__(GreaterImageFilter self) > GreaterImageFilter
[ { "docid": "3a6e3a1b8ec12a640b671ba41e2e245f", "score": "0.812999", "text": "def __init__(self):\n _SimpleITK.GreaterImageFilter_swiginit(self, _SimpleITK.new_GreaterImageFilter())", "title": "" } ]
[ { "docid": "3516fce8e9fb3bf328b4cc48fdf578fd", "score": "0.7975903", "text": "def __init__(self):\n _SimpleITK.GreaterEqualImageFilter_swiginit(self, _SimpleITK.new_GreaterEqualImageFilter())", "title": "" }, { "docid": "f164024e19dfe04953f63af16a9ffdb8", "score": "0.71127456", ...
847ca392c243018c190d6237ec0e2352
list all the G(r) plotted on the figure now
[ { "docid": "242e919f2ea08f56bc288b869e8ee391", "score": "0.6194304", "text": "def get_current_grs(self):\n return list(self._grDict.keys())", "title": "" } ]
[ { "docid": "065bd8f9420f9d7fe78a71dd623e2dcf", "score": "0.69316924", "text": "def plot(self):\n return []", "title": "" }, { "docid": "62de181701f8f7af09e91c98fc09444f", "score": "0.63560665", "text": "def show_plots():", "title": "" }, { "docid": "62de181701f8f7a...
31f6c1ca506d156c73e219cee470ccee
Generate a point in a circle, or can think of it as a vector pointing a random direction with a random magnitude <= radius
[ { "docid": "d4835c19c0b6821c9b1897a49c1ba71c", "score": "0.81278366", "text": "def rand_in_circle(center: Vec2d, radius: float) -> Vec2d:\n # random angle\n angle = 2 * math.pi * random.random()\n # random radius\n r = radius * random.random()\n # calculating coordinates\n return Vec2d...
[ { "docid": "5d91a770b378eed66a786ea00913c8e5", "score": "0.7678962", "text": "def generate_random_circle():\n\n exp_range = numpy.random.exponential(scale=0.1, size=100)\n d = cumsum(exp_range[exp_range > 0.05])\n t = d[d < 2*pi]\n\n x = sin(t)\n y = cos(t)\n\n return t, x, y", "ti...
06680ac87d9b16ae182ac51377a8d556
Test the accuracy of a model on some labelled test dataset.
[ { "docid": "074b10b233659b2c8690b8d1868318ee", "score": "0.0", "text": "def test(model, dataloader):\n # Switch the model to eval mode.\n model.eval()\n device = model.device\n\n time_start = time.time()\n batch_time = 0.0\n accuracy = 0.0\n\n # Deactivate autograd for evaluation.\n...
[ { "docid": "948ec61063e23c45cf71c53a41bbcd25", "score": "0.7570441", "text": "def test(self, dataset):\n self.model.eval() \n with torch.no_grad():\n total_samples, corrects = 0, 0\n pred_class, label_class = [], []\n for images, labels in dataset:\n ...
7486922858b721cc978be76d5a1a6712
Verify that the filepath argument is a valid file.
[ { "docid": "6f18d6f3c6e04367161933d692e6fbb5", "score": "0.7751014", "text": "def verify_filepath(filepath: str) -> str:\n filepath = os.path.abspath(os.path.expandvars(os.path.expanduser(filepath)))\n if not os.path.isfile(filepath):\n raise ValueError(f\"'{filepath}' is not a valid filepa...
[ { "docid": "7b3f148a410921b24e902a0a56697f98", "score": "0.81745076", "text": "def valid_file(filepath):\n return os.path.isfile(filepath)", "title": "" }, { "docid": "8c15f7c1c876f4b72d4f5a952f1150be", "score": "0.7708852", "text": "def chkfile(path):\n if not os.path.isfile(p...
e4689a2a4bb3d8dde2e8fd0626a3ea9f
Execute a serverside transaction
[ { "docid": "4a1b857f9e5292ec65e493069ace3cef", "score": "0.0", "text": "def transaction(self, collections, action, wait_for_sync = False, lock_timeout = None, params = None):\n payload = {\n \"collections\": collections,\n \"action\": action,\n \"wait_...
[ { "docid": "b2f4adf30873647179657713cd0f4368", "score": "0.7078037", "text": "def transaction(self, *args, **kwargs):\n return self._operate(Connection.transaction, args, kwargs)", "title": "" }, { "docid": "ba488214cac0d5aab92031b2d45241dc", "score": "0.65641505", "text": "de...
13466d15f5f4824688018c31f9057ed5
Fetch messages up to the maximum, return email.Message objects.
[ { "docid": "5942301071fd7181362ee182b6626593", "score": "0.7981605", "text": "def fetch_messages(self, max_messages=15):\n # Connect to the IMAP4 mailbox\n mailbox = imaplib.IMAP4(self.host, int(self.port))\n mailbox.login(self.user, self.passwd)\n mailbox.select()\n \...
[ { "docid": "3388dfd7de27679aac6ba6880a661420", "score": "0.79869056", "text": "def fetch_messages(self, max_messages=15):\n # Connect to the POP3 mailbox\n mailbox = poplib.POP3(self.host, self.port)\n mailbox.user(self.user)\n mailbox.pass_(self.passwd)\n\n # Look up ...
09b5d53d36a23680222292030a612cd8
This function goes through all the points in the data set and returns the indices of the samples to put into the training set. X is the data set to split while k is the number of points that should be put into the training set.
[ { "docid": "58b0f5ab32ed2344cfb887e83fa446e4", "score": "0.6394534", "text": "def fft_idx(X, k):\n\n # Creating the matrix of the distances\n dist_mat_glob = np.zeros(shape=(X.shape[0], X.shape[0]))\n\n for i in range(X.shape[0] - 1):\n for j in range(i + 1, X.shape[0]):\n dis...
[ { "docid": "88ab12ff6a2547a51bc03c813ace4c65", "score": "0.7543154", "text": "def k_split(dataset, k):\n\n\n index = np.random.permutation(dataset[0].shape[0])\n fold_index= np.split(index, k)\n\n return fold_index", "title": "" }, { "docid": "cdd15b0fabbd27eecfdfd8f7ba95f9cd", ...
4dbccca105258ecee5465e2cf45445a6
EfficientNetB1 AdvProp. Tensorflow compatible variant
[ { "docid": "2683435426b061f5b465f905f5964349", "score": "0.6500853", "text": "def tf_efficientnet_b1_ap(pretrained=False, **kwargs):\n kwargs[\"bn_eps\"] = BN_EPS_TF_DEFAULT\n kwargs[\"pad_type\"] = \"same\"\n model = _gen_efficientnet(\"tf_efficientnet_b1_ap\",\n c...
[ { "docid": "61f985ccd4b9affc2bdd78c1c09e8bfd", "score": "0.5862529", "text": "def task_metalearn(inp, reuse=True):\n inputa, inputb, labela, labelb = inp # input = (NK,latent_dim) label = (NK, num of au, N), N = num of class\n #inputa = tf.reshape(inputa, [int(inputa.shap...
66654227fe48409f5632140195afb885
Simulate the given `move' on the current game to see if it is worth making. This does not modify the game passed in, it returns a modified copy.
[ { "docid": "a544d23f0e32584a8c635fe1f84a69c4", "score": "0.75738066", "text": "def simulate(game, move):\n\n def play_one_move(game, current_player, memory, user_args):\n return move\n\n # Make a copy\n new_game = deepcopy(game)\n new_game = play_one_turn(new_game,\n ...
[ { "docid": "5e4c62077b64c1a05e5257a263e86b6b", "score": "0.71304905", "text": "def make_move(self, game):\n cell_map = game.field.get_cell_mapping()\n\n # if random.random() < 0.5:\n return self.make_random_birth_move(game, cell_map)\n\n # return self.make_random_kill_move(ga...
9b4661bdc794e3f86f83595908714d28
Get MySQL config via config file or command line.
[ { "docid": "1828b595138a6ad40c43e966d3bdd3d4", "score": "0.75491196", "text": "def get_config(args):\n config = {\n 'mysql_host': '127.0.0.1',\n 'mysql_port': 3306,\n 'mysql_user': 'root',\n 'mysql_password': '',\n 'tcpproxy_mgmt_port': args.tcpproxy_mgmt_port,\n ...
[ { "docid": "d874b506a34823a8e1687f474869fe88", "score": "0.68761575", "text": "def load_mysql_config(mysql_config_path, config):\n\n parser = SafeConfigParser()\n try:\n parser.read(mysql_config_path)\n except Exception as e:\n logger.warning(\"cannot read config from %s: %s\", my...
e86cabd8a25cb1c663355bfcf3083d53
Run the optimization algorithm.
[ { "docid": "498e1f0984a2bba66c03fc845c00e36d", "score": "0.5889775", "text": "def optimize(self, fw_spec, manager_id):\n x = list(fw_spec[\"_x\"])\n y = fw_spec[\"_y\"]\n if isinstance(y, (list, tuple)):\n if len(y) == 1:\n y = y[0]\n self.n_objs...
[ { "docid": "2e4784ec13198e30e578db97a463bfa4", "score": "0.7996382", "text": "def run(self):\n # set up logging, write params\n self.setup_optimization()\n\n # set up pool of workers\n self.setup_pool()\n\n with self.open_data('w'):\n # run optimization\n ...
dfc568703883c3f5c67fc15a44cb52d9
Implement me! Returns the probability of word given label (i.e., P(word|label)) according to this NB model.
[ { "docid": "313e08f48361dc9c32b17ec7c150e237", "score": "0.84249485", "text": "def p_word_given_label(self, word, label):\r\n count_word=self.class_word_counts[label][word]\r\n total_class_wordcount = self.class_total_word_counts[label]\r\n prob_wgl= count_word/total_class_wordcount...
[ { "docid": "d187e09e9d2bae1d2e9304a857550a75", "score": "0.81052285", "text": "def p_word_given_label(vocab, training_data, label):\n \n ''' the formula for computing prob of a word with given label is found on piazza '''\n smooth = 1 # smoothing factor\n word_prob = {}\n vocab_with_label...
d7792d0e3f08f27f49da89a5874a6e0d
Predicts from a model and writes out predictions to a csv.
[ { "docid": "a75b79bfbc8af2d55b570c2c6d4c4896", "score": "0.0", "text": "def predict_model(\n predict_config: PredictConfig,\n video_loader_config: VideoLoaderConfig = None,\n):\n # get default VLC for model if not specified\n if video_loader_config is None:\n video_loader_config = Mod...
[ { "docid": "498bc8b339d0c559f2a53fd8dc4fa77e", "score": "0.7373088", "text": "def model_prediction(file_path, model_file, save_file) :\n model = load(os.path.join(cf.OUTPUTS_MODELS_DIR, model_file)) \n\n def probability_predictions(model, data, raw_data) :\n new_X = raw_data.copy()\n ...
3610c59c09342df8d90687334c5c0136
addSpeciesType(Model self, SpeciesType st) > int Adds a copy of the given SpeciesType object to this Model. Parameter 'st' is the SpeciesType object to add. Returns integer value indicating success/failure of the function.
[ { "docid": "050ab371dc3ef3d31b4a907fadbd7500", "score": "0.7829603", "text": "def addSpeciesType(self, *args):\n return _libsbml.Model_addSpeciesType(self, *args)", "title": "" } ]
[ { "docid": "7d42d78767cc72ea43d1d585ff3ea5cd", "score": "0.67754364", "text": "def addSpecies(self, *args):\n return _libsbml.Model_addSpecies(self, *args)", "title": "" }, { "docid": "7f2e0c31b7a71caa3c025d8f64b13c9d", "score": "0.6621497", "text": "def addSpeciesTypeInstance...
c1fb9aa873b120f39122ceb96f8db1b6
Create instance object with output path.
[ { "docid": "45e9ab49e0ca8ee32110fd94438539a7", "score": "0.7741643", "text": "def __init__(self, out_path):\n self.outPath = out_path", "title": "" } ]
[ { "docid": "617798d336acf639edf2f5e43857c80e", "score": "0.7930995", "text": "def __init__(self, output_path):\n self.output_path = output_path", "title": "" }, { "docid": "862151cf8491febec26fe8d244e68d0f", "score": "0.7642023", "text": "def __init__(self, output_path):\r\n ...
47c5c3b342c8110430cd9c4b54133708
Creates a point C in (ab) direction so that \\|aC\\| = L
[ { "docid": "5eed3aac87a36900c48ad1ea7b85b842", "score": "0.5909008", "text": "def extend(point_a: Tuple[float, float], point_b: Tuple[float, float],\n L: float) -> Tuple[float, float]:\n\n xa, ya = point_a\n xb, yb = point_b\n u_vec = [xb - xa, yb - ya]\n u_vec /= np.linalg.norm(u_...
[ { "docid": "89d197710005889193a344a3915b0ba2", "score": "0.5912336", "text": "def tangent(A,B,C):\n AB=pointplan.len_deux_coord(A,B)\n AC=pointplan.len_deux_coord(A,C)\n BC=pointplan.len_deux_coord(B,C)\n longeur=-AB+AC+BC\n cercleC=cercle.create(C,longeur/2)\n cercle.draw_circle(cercl...
45cdf2c4e620f0dc0d1d7b188af964b8
max_output_buffer(multiply_const_vff_sptr self, int i) > long
[ { "docid": "4abd98a7eb6a5530fbc26f8e30a4a042", "score": "0.8243991", "text": "def max_output_buffer(self, *args, **kwargs):\n return _blocks_swig3.multiply_const_vff_sptr_max_output_buffer(self, *args, **kwargs)", "title": "" } ]
[ { "docid": "d1807baede23d2ee26625f9e60539d6a", "score": "0.81873864", "text": "def max_output_buffer(self, i):\n return _howto_swig.suma_ff_sptr_max_output_buffer(self, i)", "title": "" }, { "docid": "33ca18b8c3a6f11fa3d85dadf64bf841", "score": "0.81466925", "text": "def max_o...
9624bf2ef681ef113225db87904e272c
r"""svn_client_conflict_option_set_merged_propval(svn_client_conflict_option_t option, svn_string_t const merged_propval)
[ { "docid": "916a9dd4ce41cb29b672dfb56689247e", "score": "0.9387135", "text": "def svn_client_conflict_option_set_merged_propval(option: \"svn_client_conflict_option_t\", merged_propval: \"svn_string_t const *\") -> \"void\":\n return _client.svn_client_conflict_option_set_merged_propval(option, merge...
[ { "docid": "7a9333759aa8c8c2519ef7f00daab0e9", "score": "0.5422297", "text": "def svn_client_conflict_option_set_moved_to_repos_relpath(*args) -> \"svn_error_t *\":\n return _client.svn_client_conflict_option_set_moved_to_repos_relpath(*args)", "title": "" }, { "docid": "f30d3319c2e878ae5...
80d65ada762dd0277d9b7c795d0b6a29
It should apply strict validation to the metadata and requirements dicts. It should reject protocols with questionable metadata and requirements dicts, even though these protocols may be accepted by other parts of the system.
[ { "docid": "89db704406804ea5572fd250cd8532ff", "score": "0.691029", "text": "def test_strict_metatada_requirements_validation(tmp_path: Path) -> None:\n protocol_source = textwrap.dedent(\n \"\"\"\n # apiLevel in both metadata and requirements\n metadata = {\"apiLevel\": \"2.15\"...
[ { "docid": "820a3eeeabd346ddabb8917309ff21c3", "score": "0.64846337", "text": "def _check_requirements(self):", "title": "" }, { "docid": "7eb573492516fe12f09ad7ec6dae1277", "score": "0.64280707", "text": "def verify_model_typing(self):\n for k, v in self.requirements.items():...
de2fbfe2e08ded1a0e9d9495536a4140
Convert sysctl configuration dict to text with each property value pair separated on new line
[ { "docid": "fec04bc0ed396013d09614a8396f6414", "score": "0.75843936", "text": "def __convert_sysctl_dict_to_text():\n import params\n sysctl_file_content = \"### HAWQ System Parameters ###########\\n\"\n for key, value in params.hawq_sysctl.iteritems():\n if not __valid_input(value):\n raise ...
[ { "docid": "6cce26b37701ab14f49d551619616a99", "score": "0.6548037", "text": "def dict_to_conf_str(obj):\n config_list = []\n for key in sorted(obj.keys()):\n value = obj[key]\n config_list.append(\"%s=%s\" % (key, obj[key]))\n return '\\n'.join(config_list)", "title": "" },...
5a170df1f6f4046749fb8246b5d863cb
Run all tasks with the given action.
[ { "docid": "2768e253d9a9feb8ff2c752474a9baf9", "score": "0.0", "text": "def run(self, path):\r\n self._has_run = True\r\n result = None\r\n errors = []\r\n for task in self._tasks:\r\n if not errors or not task.may_run_user_code():\r\n try:\r\n ...
[ { "docid": "741c76fa42f3f650741d4694317cd0bb", "score": "0.70779276", "text": "def do_action(self, action: Action):\n for manager in self.managers:\n manager.on_action(self, action)", "title": "" }, { "docid": "3ab12bb7530d4844d428ed9a7da185d5", "score": "0.69594294", ...
66b0d1302ed03c32c185e08cd405c3a2
A function to generate package version desc
[ { "docid": "b96b6bd4310f475a4d836afbb3e9dac3", "score": "0.6709719", "text": "def gen_package_desc(pkgs, host):\n desc = \"<table>\"\n for pkg in pkgs:\n try:\n pkg_str = str(package.Package.from_name(pkg, host=host))\n except package.PackageNotExistsError:\n pk...
[ { "docid": "c794c2a1887c60a516bf706705a90cd9", "score": "0.7154892", "text": "def version(self) -> str:", "title": "" }, { "docid": "7b9bce8f2f1ee8c453738d801bdc065e", "score": "0.7082373", "text": "def version_desc(self):\n return self._version_desc", "title": "" }, {...