query_id
stringlengths
32
32
query
stringlengths
9
4.01k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
34c8e706e99e08935d6f7c512a7f359d
Queries all rankings for all golf tournaments.
[ { "docid": "54e180015bba8793ef146b17c5e7362c", "score": "0.538462", "text": "def golf():\n # http://stackoverflow.com/questions/5334531/python-documentation-standard-for-docstring#5339352\n out = rankings_helper(\n url=RANKINGS_URL + \"golf/final.asp\",\n parser_func=parse_golf_soup\...
[ { "docid": "4aac33a95c1acdbc792b4b0d0321c420", "score": "0.6398167", "text": "def rankings(self):\n return self.open_dota.get_ranking(self.steam_id)", "title": "" }, { "docid": "988f313be5519410eea044d004294ba2", "score": "0.6312738", "text": "def get_user_rankings(self, reque...
ac6a21266fb96ac5ad47efee748fa5e5
NullableClass a model defined in OpenAPI
[ { "docid": "f00ff4e2b66758efffaa904e06fd6438", "score": "0.53666735", "text": "def __init__(self, integer_prop=None, number_prop=None, boolean_prop=None, string_prop=None, date_prop=None, datetime_prop=None, array_nullable_prop=None, array_and_items_nullable_prop=None, array_items_nullable=None, object_...
[ { "docid": "c27eaa285624d6ab8e5767d4f5c3c135", "score": "0.583286", "text": "def __init__(self): # noqa: E501\n self.openapi_types = {\n }\n\n self.attribute_map = {\n }", "title": "" }, { "docid": "31278bb08ce1cbc89e9a444d3a7c6917", "score": "0.5685518", ...
a2fc8bb2a5c3260073f5a26b999f3b9f
monsave A command that will save an entry to the Mongo database.
[ { "docid": "af5ecabe2c9fd3c02de25af0a5cb7cb0", "score": "0.6818327", "text": "async def monsave(self, ctx, *, entry):\r\n\r\n self.connect()\r\n discord_id = str(ctx.message.author.id)\r\n\r\n self.database.entries.insert_one({\r\n \"discord_id\": discord_id,\r\n ...
[ { "docid": "a49ddbc0248dc4afd13e1a51f9c01563", "score": "0.6202329", "text": "def MongoSave(message):\n client = pymongo.MongoClient(\"localhost\",27017)\n db = client.PortfolioTracker\n db.AllPortfolios.save(message)#this must be a dictionary for proper insertion http://docs.python.org/2/tutor...
54155040dec3cd5fe89af8c936b46bdd
Make seperate lists of conditions and conditional effects that will actually be encoded. (Problem) > None
[ { "docid": "c80aee50170f2ae480783f949c58e2a5", "score": "0.74035025", "text": "def make_cond_and_cond_eff_lists(self):\n for cond in list(self.code_conds.values()):\n if cond in self.encode_conds:\n if isinstance(cond, ConditionalEffect):\n self.condit...
[ { "docid": "3370b023fee9fb74b904e8c60608dd8f", "score": "0.64567184", "text": "def assign_cond_codes(self):\n cond_index = [0]\n self.goal.assign_cond_code(cond_index, self.code_conds)\n for action in list(self.actions.values()):\n if action.precondition:\n ...
eaab0e91847e2a5c0cf6b28cf5470489
Parse a single path segment. If the segment is an identifier or wildcard, it's constraint is also derived.
[ { "docid": "f6897198e51df02893b19104052aa780", "score": "0.7384426", "text": "def _parse_path_segment(acc, segment):\n match = _token_re.match(segment)\n if match is not None:\n # XXX: Is it a problem that we're using strings for parameters and\n # strings for literal parts?\n ...
[ { "docid": "ecfb2be83212ae44fb20a2e0a31bb3c2", "score": "0.58996576", "text": "def segment_path(self, segment_path):\n # type: (string_types) -> None\n\n if segment_path is not None:\n if not isinstance(segment_path, string_types):\n raise TypeError(\"Invalid type...
aa6430fa7dd7fb2fdc1c4f5d95ee8312
Given a color, estimate if it's better to show block or white text on top of it.
[ { "docid": "bc8d5f0f579b04c9e661417afb9da33e", "score": "0.5743493", "text": "def text_color(color):\n\n r = int(color[0:2], base=16)\n g = int(color[2:4], base=16)\n b = int(color[4:6], base=16)\n yiq = 0.299 * r + 0.587 * g + 0.114 * b\n\n return \"000000\" if yiq > 128 else \"FFFFFF\""...
[ { "docid": "d80767e8caf5a51d397c8f43aec7cc63", "score": "0.6462235", "text": "def is_colorized(self):", "title": "" }, { "docid": "62050a6599742bd17e5b293dc01bc4c1", "score": "0.6453103", "text": "def detects_color(self, color):\n diff_c, diff_r, diff_g, diff_b = self.get_perc...
b0c37801e07c8ddfbb03159eae153208
Returns an int64_list from a bool / enum / int / uint.
[ { "docid": "59ed2bfd6211f1674fb31803eedb4032", "score": "0.5494831", "text": "def _int64_feature(value):\n return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))", "title": "" } ]
[ { "docid": "e2f053683e59ade4f7ff10d232477d03", "score": "0.6754303", "text": "def _int64_feature_list(values):\n return tf.train.FeatureList(feature=[wrap_int64(v) for v in values])", "title": "" }, { "docid": "67a83f99ad929027279d8d5a45495c01", "score": "0.6549031", "text": "def ...
15fcdd1674220f6c1a7549f66fa99fa5
DW doesn't understand async functions well enough to make it a runtime test, but it was causing a compiletime failure at one point
[ { "docid": "3816fc3f02b6a44307fff4ec73656d71", "score": "0.5690496", "text": "async def async_func():\n if variable := 1:\n pass", "title": "" } ]
[ { "docid": "58029603e6c527c84c592ec631d8eed4", "score": "0.6563841", "text": "async def test_sync_in_async():\n test_sync()", "title": "" }, { "docid": "712e5f910546efee674330bf9b5c1859", "score": "0.65307885", "text": "def test_call_async(rroot_async, loop):\n async def test()...
f6dc744b3fcabf54d68abc32dc3f5c8c
An optional description of this resource. Provide this property when you create the resource.
[ { "docid": "a8491c0b84893def7353ab2232d185e5", "score": "0.0", "text": "def description(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"description\")", "title": "" } ]
[ { "docid": "32e07fb05930562371948b451032b2e5", "score": "0.7329538", "text": "def description(self):\n if self._description is None:\n self.__init()\n return self._description", "title": "" }, { "docid": "32e07fb05930562371948b451032b2e5", "score": "0.7329538", ...
2e2dfcb37d6f2ad121fabf1ae5071834
given a sklearn confusion matrix (cm), make a nice plot Arguments
[ { "docid": "bcf8df7f3366eec53b591dd621ace859", "score": "0.0", "text": "def plot_confusion_matrix(cm,\n target_names,\n title='Confusion matrix',\n cmap=None,\n normalize=True,saveFileName='foo'):\n im...
[ { "docid": "bdbf58d6563642a82a4f39f44f2446d3", "score": "0.8023947", "text": "def plot_confusion_matrix(cm, classes,\n normalize=False,\n title='Confusion matrix',\n cmap=plt.cm.Purples):\n if normalize:\n cm = cm.astyp...
84dcd4dfcc9f039666e733a8f8a8ef68
Getter on the catalogue business Parameter associated to self
[ { "docid": "44a479c6c1bb9d1dd776fdeff10a0abc", "score": "0.6820848", "text": "def get_parameter(self):\n return self._parameter", "title": "" } ]
[ { "docid": "77f619a468509205824a233ffa1649aa", "score": "0.71139556", "text": "def __get_parameter(self):\n return self.__parameter", "title": "" }, { "docid": "840ab197a58dd11c295570b21fd03a6d", "score": "0.7003249", "text": "def get_parameter(self):\n return self._my_...
8069f575c1b1e5fa08d0b225ce32d317
this function generates training_set, also for testing
[ { "docid": "a5cb49956ffef56ac1b73786fcc5df00", "score": "0.0", "text": "def sample_generater(descriptors):\n response = np.arange(MODEL_NUM)\n response = np.tile(response, TRAINING_SIZE / MODEL_NUM)\n \n training_set = np.empty(\n [TRAINING_SIZE, MIN_DESCRIPTOR], dtype=np.float32)\n ...
[ { "docid": "e72bc7fbcfdcd80b61c7ce9328ba8157", "score": "0.7856855", "text": "def train_set(self):", "title": "" }, { "docid": "61f1aa1ee27ee49679f3287c44430de8", "score": "0.7494893", "text": "def create_training_test_sets(self):\n # load input data\n input_data = np.a...
5fda6dbd99524ecdfb1b915809eb59b0
Convert Peptide sequences to unified format. This conversion simplifies the alphabet of the amino acids, removes special characters, replaces digits to written numbers, removes nterminal modifications, rewrites Xmod modifications to modX format and splits the amino acid string into a list.
[ { "docid": "11caafd96e2f50778648de05dfbac5c9", "score": "0.4715476", "text": "def prepare_seqs(psms_df, seq_cols=[\"Peptide1\", \"Peptide2\"]):\n # for all sequence columns in the dataframe perform the processing\n # if linear only a single column, if cross-linked two columns are processed\n fo...
[ { "docid": "4a73a617e9e89e678a0f5abc48d44b79", "score": "0.6161142", "text": "def generate_sequences(long_peptide,aa_type=\"natural\"):\n \n # List of the amino acids that can be included\n natural=[\"A\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"K\",\"L\",\"M\",\"N\",\"P\",\"Q\",\"R\",\"S\",...
46be3fe4bfe7e117f4651abbdd084af3
An iterative matcher tries to match different patterns that appear in the filename. The 'filetype' argument indicates which type of file you want to match. If it is 'autodetect', the matcher will try to see whether it can guess that the file corresponds to an episode, or otherwise will assume it is a movie.
[ { "docid": "27c7d0b44a115b1318ab90815e059075", "score": "0.70966053", "text": "def __init__(self, filename, filetype='autodetect', opts=None):\n\n valid_filetypes = ('autodetect', 'subtitle', 'video',\n 'movie', 'moviesubtitle',\n 'episode', 'ep...
[ { "docid": "14820715cc730d0ccbb4099b1fd063c7", "score": "0.57484794", "text": "def examine_file (file):\n fileType = \"\"\n\n for ext in fileExtensions.keys ():\n\tif get_ext_re (ext).search (file):\n\t fileType = ext\n\t break\n else:\n\treturn UNKNOWN\n\n return fileType", "title...
3035ce5453e942559fa2b977fedc4834
Integrates the density over the area of this cell. Let (width,height) be the shape of the density array. The bounding box of the voronoi cells is assumed to be [0,width]x[0,height].
[ { "docid": "713118aa93c7d81544c4680c26a17bec", "score": "0.65445966", "text": "def integrate(self, density):\n\n # Note: the vertices in the cell are ordered clockwise\n\n width, height = density.shape\n # compute bounds of the cell\n min_x = width-1\n min_y = height-1...
[ { "docid": "177abe6c70cc77093307027bd04c32bc", "score": "0.57263225", "text": "def section_integral(v, xmin, xmax):\n minind, maxind = utils.get_indrange(v.x, xmin, xmax)\n if v.surface_field:\n dx = v.cell_widths_as_data[:,minind:maxind]\n return np.sum(v.data[:,minind:maxind] * dx,...
b63692932d6fab64feff4df5e1a783b8
Add command 'fends' arguments to parser.
[ { "docid": "c1e46a029dc10961db7725ed5971e0fe", "score": "0.7020121", "text": "def add_fends_subparser(subparsers):\n parser = subparsers.add_parser(\"fends\", help=\"HiFive Fend Creation Function: Read RE fragment data from either a BED file or a HiCPipe-style tabular fend file and create a HiFive 'F...
[ { "docid": "00db2eb8473f3a94138906a5d8a50a58", "score": "0.56442916", "text": "def add_args(self, parser):", "title": "" }, { "docid": "79bacc3f2766a5e4be3aeb5abc86601a", "score": "0.56194735", "text": "def add_arguments(self, parser):", "title": "" }, { "docid": "4f29259...
fdf6f694cb1e3838bfa48135ff0402ad
Train the network for one epoch
[ { "docid": "3e94aa52367775bbf34fd544089347d2", "score": "0.0", "text": "def train(self):\n self.module.resetDerivatives()\n errors = 0\n ponderation = 0\n for seq in self.ds._provideSequences():\n e, p = self._calcDerivs(seq)\n errors += e\n p...
[ { "docid": "ddf480db659d1c346cc742bf9a9fae48", "score": "0.83493596", "text": "def train(self):\n self.learner.fit_one_cycle(self.config.EPOCHS)", "title": "" }, { "docid": "71e6ccaf184a0e11175e8c89f61e3700", "score": "0.8324999", "text": "def train_one_epoch(self):\n r...
b6c07ecfe56842e17f2af75a281e3e9e
Replace all occurencens of 'old' with 'new' starting at the right hand side of the string. If occurences is specified, the number of replacements is limited to occurences.
[ { "docid": "28acc5f001264aefd78d9c3a856a6ec1", "score": "0.7681911", "text": "def rreplace(s, old, new, occurences=-1):\n li = s.rsplit(old, occurences)\n return new.join(li)", "title": "" } ]
[ { "docid": "1cdce6d8002ba96e113559604122a8ad", "score": "0.71731454", "text": "def rreplace(s, old, new, occurrence):\n li = s.rsplit(old, occurrence)\n return new.join(li)", "title": "" }, { "docid": "1cdce6d8002ba96e113559604122a8ad", "score": "0.71731454", "text": "def rrepl...
509ce9754367019a20dfcbf8f803723c
Publish payment response to async nats.
[ { "docid": "e670274aab61864312b95abba7d841a9", "score": "0.68084496", "text": "def publish_response(payload):\n asyncio.run(publish(payload=payload))", "title": "" } ]
[ { "docid": "eccc54ce5aa83f776edf36cb0d731c93", "score": "0.62804866", "text": "def on_post(self, req, res):\n account_addr = str(req.body['account_addr']).lower()\n session_id = str(req.body['session_id'])\n token = str(req.body['token'])\n signature = {\n 'hash': ...
b5f907abb27800eaf3cd53c43f25771f
Take in a hex string and convert it to a list of bytes. (This should effectively "undo" the question 3.)
[ { "docid": "311f04eab1a5b9a6b7848352c5e32e4b", "score": "0.83116025", "text": "def hex_string_to_bytes(the_input):\n # for fun:\n # list(map(lambda i, j: int(i+j, 16), the_input[::2], the_input[1::2]))\n return [int(str(the_input[i:i+2]), 16) for i in range(0, len(the_input), 2)]", "title":...
[ { "docid": "1374219d9d3d8d9e3c5c85e01f39a532", "score": "0.7718656", "text": "def hexify(hexStr):\n bytes = []\n hexStr = ''.join( hexStr.split() )\n for i in range(0, len(hexStr), 2):\n bytes.append( signed1( int (hexStr[i:i+2], 16 ) ) )\n return bytes", "title": "" }, { ...
eb9332be39b92465995c1480da3d3495
SM electrolyte with LFP homog, sep + cathode, significant elyte polarization
[ { "docid": "b242848edc3e7f0aa794661c72e99956", "score": "0.0", "text": "def test019(testDir, dirDict, pflag):\n shutil.copy(osp.join(dirDict[\"baseConfig\"], \"params_system.cfg\"), testDir)\n shutil.copy(osp.join(dirDict[\"baseConfig\"], \"params_c.cfg\"), testDir)\n psys = osp.join(testDir, \...
[ { "docid": "1fc9acad187035ee7206d7755133a958", "score": "0.6152157", "text": "def test_el_below_lcl():\n p = [902.1554, 897.9034, 893.6506, 889.4047, 883.063, 874.6284, 866.2387, 857.887,\n 849.5506, 841.2686, 833.0042, 824.7891, 812.5049, 796.2104, 776.0027, 751.9025,\n 727.9612, 704...
a9ebaff0390576dcd5be733f835b19d2
Create a ``treq``alike which can dispatch to a local issuer.
[ { "docid": "4f3b3bcb1187d356bbb30b82a85bbcd1", "score": "0.6673055", "text": "def treq_for_loopback_ristretto(local_issuer: IResource) -> StubTreq:\n v1 = Resource()\n v1.putChild(b\"redeem\", local_issuer)\n root = Resource()\n root.putChild(b\"v1\", v1)\n return StubTreq(root)", "ti...
[ { "docid": "42ffe4f487c54996648cbf0aaf99c69c", "score": "0.55943376", "text": "def req_handler(args):\n key = _get_key(args)\n subject = get_subject_arguments()\n req = create_certificate_request(key, subject=subject, file_name=args.req_out)\n if not args.req_out:\n print(print_certif...
9c4a351aac4a8bfa8404f4f18c3c2921
Migrate an old config entry.
[ { "docid": "4b2a0d08ad7d29ca59dfd48cfd0a492b", "score": "0.68754864", "text": "async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:\n version = config_entry.version\n\n # 1-> 2->3: Migration format\n # Add CONF_TIMEOUT, CONF_LEAGUE_ID, CONF_SPORT_PATH, and CONF...
[ { "docid": "d1f2111e9a6b30aa09557d5b50434252", "score": "0.63393617", "text": "async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:\n version = entry.version\n data = {**entry.data}\n\n LOGGER.debug(\"Migrating from version %s\", version)\n\n # 1 -> 2: Remove unuse...
818278552afa8400e375ae6427463bdd
Is the size correct?
[ { "docid": "f603ef4dcb43e25fae1d811c14bf6e2d", "score": "0.0", "text": "def test_bg_size(self):\n\n bg = driver.find_element_by_class_name(\"container\")\n size = bg.size\n print('\\n') # adds line break\n print \"size of the background is:\"\n print (size)\n\n ...
[ { "docid": "a4d15465befda3068197d7c325a8ca0e", "score": "0.82047963", "text": "def size(self):", "title": "" }, { "docid": "422172fa4cbc7b0f9a71e3309d0a0772", "score": "0.80646", "text": "def size(self) -> int:", "title": "" }, { "docid": "3768dfa33ac8c793669943652ba74f50...
d5276c7c98001128c4f6b4241c6e74fa
Runs policy using a single state as input z estimate of the hidden parameter, used only if self.z_input = True eta scalar representing uncertainty in estimated z, used only if self.eta_input==True
[ { "docid": "2e412d908d33c47a5962c0e86c2a232a", "score": "0.6730271", "text": "def run_actor(self, state, z, sess, epsilon=0, eta=None):\n if np.random.rand(1) < epsilon:\n action = np.random.randint(0,self.l_action)\n else:\n feed = {self.state : np.array([state])}\n ...
[ { "docid": "78f8fa2fbca74918f47d0736b568fa9f", "score": "0.6601634", "text": "def policy(self, state):\n if np.random.rand() > self.epsilon:\n action = np.argmax(self.function_approximator(state))\n else:\n action = np.random.choice([0,1], p=[0.5, 0.5])\n self.epsilon *= 0.99\n ret...
2a59a9d84493973ad6577758a14d0e21
Checks for nodes who are built with Plantower boards and are sending data, but are missing Plantower measurements.
[ { "docid": "5a3f63269c583f87fb928d58c046e46c", "score": "0.73408353", "text": "def check_plantower(node_info: Dict[str, dict], node_status: Dict[str, dict], measurements: List[dict]) -> Tuple[Iterable[str], str]:\n logging.info('running check_plantower')\n\n plan_regex = re.compile('.*\\[.*P.*\\]....
[ { "docid": "5776637f267f5b72594d3a684eed5450", "score": "0.62628645", "text": "def check_nodes(self):\n with self.rlock:\n try:\n self.logger.info('Checking if new nodes are needed')\n api = self.driver_class(self.args.api_server, self.logger)\n ...
9934a9be178a36d0f216f5ef6d3dc133
Updates local database with its remote counterpart. Use it with only one server.
[ { "docid": "a75cbee02b0a3c86574fb0ec95a3fa82", "score": "0.5777243", "text": "def pull_down_remote_db():\n with cd('{tmp_dir}'):\n run('pg_dump -U {pg_user} {db_name} > {db_name}.sql')\n print(\"Dumping database on remote...\")\n get('{db_name}.sql', '{tmp_dir}')\n print(\...
[ { "docid": "19bf0c3ec0588a84e1722966ddbaa744", "score": "0.65133363", "text": "def update_db():\n fetchHosts(NEWHOSTS_FILES)", "title": "" }, { "docid": "3a59f3d4f14084f9ccc8e936e5e1d7f6", "score": "0.6444025", "text": "def sync(self):\n self.database = self.read()", "t...
397365f0b60d43389fc0a3083940d283
Returns orientation list given layup string following convention. Separate angles with /. Use '_n' to repeat an angle n times. prefix angle with 'p' or 'm' for plusmins or minusplus respectively. Append with s (no extra /) for symmetric
[ { "docid": "aeb7a35a9c2432ceaefc0d3ab4c20640", "score": "0.7460502", "text": "def parse_layup(layup_input):\n\n\tlayup = layup_input\n\torientation=[]\n\tsymmetric = False\n\tif layup.endswith('s'):\n\t\tlayup=layup[:-1]\n\t\tif 's' in layup:\n\t\t\tprint \"s must be added at the very end. You wrote : %...
[ { "docid": "1011fabee140dd00a76db1a74ff26ca0", "score": "0.5986028", "text": "def orientation_from_string(string_ornt):\r\n orientation_dict = dict(r=(0,1), l=(0,-1), a=(1,1), \r\n p=(1,-1), s=(2,1), i=(2,-1))\r\n ornt = tuple(orientation_dict[ii] for ii in string_ornt.l...
a350e691f2f969f4861b5090778a1997
Handle an event from the SSH interface. If a zone level was changed either by external means such as a Pico remote or by a command sent from us, the new level will appear on the SSH shell and the response is handled by this function.
[ { "docid": "41c092491dde9b5da9b03970916dacf8", "score": "0.55854744", "text": "def _handle_response(self, resp_json):\n comm_type = resp_json['CommuniqueType']\n if comm_type == 'ReadResponse':\n body = resp_json['Body']\n zone = body['ZoneStatus']['Zone']['href']\n ...
[ { "docid": "61b1eb16840ef04d0784d29758dbe4c1", "score": "0.52538294", "text": "def zones_updated_callback(data):\n _LOGGER.info(\"Envisalink sent a zone update event. Updating zones...\")\n dispatcher.send(signal=SIGNAL_ZONE_UPDATE,\n sender=None,\n ...
bcc59fb2fa950aa77a2770f8384c186f
returns the marginal distribution y given an x using the parameters of the model
[ { "docid": "f93c5e59196b3ddda4c2cbf81a2334a8", "score": "0.0", "text": "def marg(self, x, e, c):\n tmp = exp(dot(x, self.W) + dot(e, self.E) + dot(c, self.S) + self.b)\n marg = tmp / (1 + tmp)\n return marg", "title": "" } ]
[ { "docid": "b6d7b9ec7bdbdc43490eac454453d849", "score": "0.6826737", "text": "def marginal(self):\n\t\tif self.is_fitted:\n\t\t\thalfn = self.n / 2\n\t\t\tprec = 1. / self.sigma_\n\t\t\t# calculate error function on posterior mean\n\t\t\tE_mn = (prec / 2.) * self._sse + (self.alpha_ / 2.) * np.dot(self....
60d6b87fe250c98400da8be052fbac0f
Returns true if this is an AFNI path.
[ { "docid": "108a02aee98f71fa2cf3f2bb2d15eb3c", "score": "0.69678634", "text": "def is_afni(self) -> bool:\n is_afni = False\n\n stem = self.path.stem\n if re.search(pattern=r\"(\\+tlrc|\\+orig)$\", string=stem):\n is_afni = True\n\n return is_afni", "title": ""...
[ { "docid": "98f112d383097e0e6d966f14f749df3e", "score": "0.71940494", "text": "def is_ancillary_path(self, path: str) -> Tuple[str, bool]:", "title": "" }, { "docid": "ab67b9d514a1c0ed396adb9a3f7a04b5", "score": "0.6779986", "text": "def is_ancillary_path(self, path: str) -> Tuple[st...
9db5e56fe5d27d593ca82ede04b49076
Add an item to the queue.
[ { "docid": "15b679b40caf0fd17afa3055453c4f17", "score": "0.75617635", "text": "def enqueue(self, item):\n self.body += [item]", "title": "" } ]
[ { "docid": "50f0ecee0b858f34de792c0e50772c79", "score": "0.9292446", "text": "def add(self, item):\n self._queue.append(item)", "title": "" }, { "docid": "1a359aa66aabc2b86fae23a7005dd7d7", "score": "0.8446879", "text": "def enqueue(self, item):\n self._queue.insert(0, ...
36ceea0c3184531e646edfbbb1aabc7e
Define a function to convert xtime character array to numeric time values using local arithmetic
[ { "docid": "7440ae67beaffbd28ee6a21a967a6962", "score": "0.7542322", "text": "def xtime2numtimeMy(xtime):\n # First parse the xtime character array into a string\n xtimestr = netCDF4.chartostring(xtime) # convert from the character array to an array of strings using the netCDF4 module's function\n\n ...
[ { "docid": "efc25bdf6ce8c6198c6f257baabf7d61", "score": "0.7195972", "text": "def xtime2numtime(xtime):\n # First parse the xtime character array into a string\n xtimestr = netCDF4.chartostring(xtime) # convert from the character array to an array of strings using the netCDF4 module's function\n\n dt...
f63ce0fd6ed9fd8505329ba6eb1f4e48
GetV(TFlt Val1) > TFltV
[ { "docid": "0db23296c3b9b0ad1d77b442aa1ee576", "score": "0.6113632", "text": "def TFltV_GetV(*args):\n return _SnapTime.TFltV_GetV(*args)", "title": "" } ]
[ { "docid": "b16df4f230f18dbf6d3d81c2de0bc905", "score": "0.64146775", "text": "def GetVal(self, *args):\n return _snap.TFltV_GetVal(self, *args)", "title": "" }, { "docid": "bee369ed864dee0b28dc5d58b1ada427", "score": "0.63197136", "text": "def __gt__(self, *args):\n re...
d79de72826c32a9f0086cfd0daf776a1
Submit ensemble NAMD equilibrationsimulation jobs to the SuperMUC or similar machines. The job results will be stored with a name pattern as defined in the environment, e.g. cylinderabcd1234legion256
[ { "docid": "2239c90fbf8d86b8ed518fe6b326fba6", "score": "0.61851496", "text": "def bac_namd_supermuclike(config,**args):\n if not args.get('cores'):\n args[\"cores\"] = 7000\n\n update_environment(args)\n if not env.get('replicas'):\n env.replicas=25\n calc_nodes()\n env.nodes_new = \"%s\" % ...
[ { "docid": "ef33669e73836de24bb3fe9b5665ac62", "score": "0.656956", "text": "def bac_nm_remote_archerlike(**args):\n if not args.get('cores'):\n args[\"cores\"] = 1200\n\n update_environment(args)\n with_config('')\n #execute(put_configs,config)\n #print \"$results_path\"\n job(dict(config='',s...
39b1a8b6359cec35cfdd12e8572f759f
Sets the synapse config bits and the bias currents
[ { "docid": "83cc760821ed4ea0d544b79863ba2c63", "score": "0.5745245", "text": "def set_analog():\n HAL.driver.SetDACCount(CORE, bd.bdpars.BDHornEP.DAC_SYN_PD, SYN_PD_PU)\n HAL.driver.SetDACCount(CORE, bd.bdpars.BDHornEP.DAC_SYN_PU, SYN_PD_PU)\n for n_idx in range(NRN_N):\n HAL.driver.SetS...
[ { "docid": "fec66140165a77668a9fb4dcf03a43c1", "score": "0.66797674", "text": "def set_bias(self, bias_obj):\n configs_list = self.setup_configs_list(\n self.ext_input_has_generator,\n use_bias_simple=\"bias_simple\" in bias_obj,\n bias_simple_key=bias_obj[\"bias_...
808793aeb9e4f96068c1e83f973ecad6
Test case for get
[ { "docid": "890ec65f81a1817d580ad777a43a9f28", "score": "0.0", "text": "def test_get404(self):\n with self.assertRaises(Exception) as context:\n self.api.get(\"tmpl_fake\")\n self.assertTrue(\"template not found\" in context.exception.__str__())", "title": "" } ]
[ { "docid": "0447207dd4d65759fd7650c47ffbff4c", "score": "0.847384", "text": "def test_get(self):\n pass", "title": "" }, { "docid": "8b1ef8345fdadfe8b8084c72c011341f", "score": "0.7856544", "text": "def test_get2(self):\n pass", "title": "" }, { "docid": "f9...
f53646582a2086f5ed8346845c83a272
redirecting nonauthorized users to their respective pages
[ { "docid": "859dbcfe0790fcfefbb504b0fa3227a1", "score": "0.0", "text": "def index(request):\n try:\n user_obj = get_object_or_404(UserProfile, pk = request.user.id, user=request.user)\n if user_obj.isMech:\n return redirect('/mechanic')\n except:\n return redirect('...
[ { "docid": "a286dd94c20c4f864d26a9a9d45019ba", "score": "0.7639997", "text": "def unauthorized():\n return redirect(url_for('home', err=\"login_required\"))", "title": "" }, { "docid": "9b6798a1b2e77df9443685205d091bc1", "score": "0.75805795", "text": "def unauthorized():\n fla...
9d4cb1534d08f86e356143a51004df1c
Writes |data| to a file.
[ { "docid": "a9acd8b2935095b1c6c94b4cdb1a72fc", "score": "0.65376437", "text": "def write_file(path, data):\n assert isinstance(path, (list, tuple))\n with open(os.path.join(*path), 'w') as f:\n f.write(data)", "title": "" } ]
[ { "docid": "c410593128a2c54d41702c4ed0ce71ec", "score": "0.8281608", "text": "def write_data(self, data, data_file):\n utils.save(data, data_file)", "title": "" }, { "docid": "339e035583a92a5816d850372d6d6e6c", "score": "0.81348616", "text": "def write_data_file(data_file):\r\...
0978e03778f7d773885f4468cc045d83
(str) > Dictionary Return Dictionary created of the same json file
[ { "docid": "647e1cdffd867aa0f89b46077ae1708c", "score": "0.6001661", "text": "def json_to_dict(path):\n with open(path, 'r', encoding = 'utf-8') as f:\n result = json.load(f)\n return into_atd(result)", "title": "" } ]
[ { "docid": "78045d247a465f96af76a92c5cae741f", "score": "0.69984156", "text": "def __load_json(cls, file_name):\n\n with open(file_name, 'r') as f:\n data = json.load(f)\n dic = json.loads(data)\n k = dic.keys()\n v = dic.values()\n k1 = [eva...
e700043439a253b7a119b58ca110299d
Return a json dictionary representing this model.
[ { "docid": "772c4ddfaf7a2dec87230514f27a693a", "score": "0.0", "text": "def _to_dict(self):\n return self.to_dict()", "title": "" } ]
[ { "docid": "be154a4c630562a4de9ae9a448baad12", "score": "0.84946454", "text": "def to_json(self):\r\n return self.__dict__", "title": "" }, { "docid": "8792761ecb900f1b0615ea64606e576d", "score": "0.8432328", "text": "def to_json(self):\n return self.__dict__", "tit...
1238ee88955f2c73d239159725b1cc1a
Returns whether the given port is connected.
[ { "docid": "2f3ab98e0b22a25f077f7fa4b5782da1", "score": "0.8949384", "text": "def is_connected(self, port: str) -> bool:\n return self._communicator.get_port(port).is_connected()", "title": "" } ]
[ { "docid": "70ed07ea59a14f0b69c58b15a181124b", "score": "0.8899737", "text": "def isPortConnected(port):\n ports = port.getConnectedPorts()\n if ports:\n return True\n else:\n return False", "title": "" }, { "docid": "d580bd622ded52669633599cdd400e8e", "score": "0....
067093619e96fe096e7999cda74e8c81
This function calculates the the leaveoneoutCrossValidation
[ { "docid": "151900294cff39a180031f32c6316c14", "score": "0.0", "text": "def looCV(clim, predic, fnc):\n\n err = 0\n for lo_index in range(len(clim)):\n\n clim_mask = np.ma.array(clim, mask=False)\n clim_mask.mask[lo_index] = True\n clim_lo = clim_mask.compressed()\n\n p...
[ { "docid": "5d77341b4346ef17ec87fd8df452c313", "score": "0.6955173", "text": "def cross_validate(self):\n pass", "title": "" }, { "docid": "a64b7ce38a2ca42f0d31564275b6edfb", "score": "0.6743403", "text": "def cross_validation():", "title": "" }, { "docid": "0894c7...
031d153fe45bee57412bf040f537c673
Load config file at either `dotenv_path`, env var `PF_CONFIG_DOTENV_PATH`.
[ { "docid": "ab88c124f7879ba066e35c1e4ee84e26", "score": "0.76902", "text": "def load_dotenv_config(dotenv_path=None, verbose=False, **kwargs):\n return dotenv_values(dotenv_path=dotenv_path, verbose=verbose, **kwargs)", "title": "" } ]
[ { "docid": "445f334816909b633d2274341346842c", "score": "0.74384344", "text": "def load():\r\n\r\n BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\r\n\r\n stage_config = {\r\n \"local\": \".env\",\r\n \"dev\": \"configmap-dev.env\"\r\n }\r\n\r\n dotenv_co...
9bdae45b4ce85ff01a0648a83a7b723f
Find the account for a user or all users in a channel.
[ { "docid": "87b7d043566bbbe86a8495aa2be33552", "score": "0.0", "text": "def identify(self, target):\n tag, query = self._WHO_IDENTIFY\n self.sendLine('WHO {} {}t,{}'.format(target, query, tag))\n pass", "title": "" } ]
[ { "docid": "a7d48507829e3b9f081f36dad934ab1b", "score": "0.65918094", "text": "def find_by_account_name(cls,account_name):\n\n for user in cls.user_list:\n if user.account_name == account_name:\n return user", "title": "" }, { "docid": "928e682a79a84fc16830d8...
73f7f94b1edbd641ccb38cd2ac670864
Use a device configuration and custom SSL auth for simplicity
[ { "docid": "b7ce69e66456374ac172f683c45be484", "score": "0.5207255", "text": "async def session(custom_ssl_context):\n async with IoTHubSession(\n hostname=FAKE_HOSTNAME, device_id=FAKE_DEVICE_ID, ssl_context=custom_ssl_context\n ) as session:\n yield session", "title": "" } ]
[ { "docid": "a6b2bc6d7d2b664bb1ec12ca0917094a", "score": "0.59794635", "text": "def __init__(self, uri, user, password, ssl_verify=False):\n self.query_url = uri + '/api/device/'\n self.uri = uri\n self.user = user\n self.upass = password\n self.verify = ssl_verify\n ...
e41de01a9df8ef78235eb79adeeb467b
r"""Normalizes the whitespace in a string; \s+ becomes one space.
[ { "docid": "82ff702a3a430d6a341ff352427a9993", "score": "0.7673004", "text": "def _normalizeWhitespace(s, removeNewline=True, newLineChar=\" \"):\n if not s:\n return str(s) # not the same reference\n s = html.unescape(s)\n try:\n s = _strip_tags(s)\n except:\n pass\n ...
[ { "docid": "fea5ffb7e8cc661fdf41853043a9bf6a", "score": "0.8499005", "text": "def normalize_spaces(s):\n if not s:\n return ''\n return ' '.join(s.split())", "title": "" }, { "docid": "62a1653f48059089205ff46608160063", "score": "0.81921566", "text": "def normalize_white...
4fb7b84c2981a5eefa2b109a23681879
the effective end date of the task. for a non repeating task, this is the end date of the task. for a repeating task, this is calculated as t.end_date t.start_date + t.repeat_end
[ { "docid": "05c3d6c25c8c302cd4b0e75658cd9945", "score": "0.8365589", "text": "def effective_end_date(self):\n if self.repeat_state > 0:\n return self.end_date - self.start_date + self.repeat_end\n else:\n return self.end_date", "title": "" } ]
[ { "docid": "b9f7083b9184346d7c75c91d484a0854", "score": "0.63661", "text": "def end_date(self): \n return self._end_date", "title": "" }, { "docid": "cb3392aa308b792764cd2fd8673a329c", "score": "0.63541704", "text": "def end_date(self) -> date:\n return self._end_date"...
9f0604fef134c76cf13f57e22f40be5f
Loads data from the data repo to database.
[ { "docid": "306119030f495c007a37c9bf10055f4a", "score": "0.6502804", "text": "def load_data(no_pull=False):\n from data_loader.arangoload import run\n\n run(no_pull=no_pull)", "title": "" } ]
[ { "docid": "a1baffcf78d5245b01860ad904ee45f5", "score": "0.6960813", "text": "def load_data(self):\n pass", "title": "" }, { "docid": "a1baffcf78d5245b01860ad904ee45f5", "score": "0.6960813", "text": "def load_data(self):\n pass", "title": "" }, { "docid": "...
f26f0d694f4becc7de930f28494a4e72
Return the mirroring mode this ROM uses.
[ { "docid": "e45cf69ff1cda9bf339e7d60dd898f6d", "score": "0.0", "text": "def is_vertical_mirroring(self):\n return bool(int(self.flags_6[7]))", "title": "" } ]
[ { "docid": "86508fbb39de895baf91c71f28171df0", "score": "0.8158034", "text": "def getMirrorMode(node):\n return mirrorData.getMirrorData(node, 'mirrorMode')", "title": "" }, { "docid": "bdcb99b616a0745ab70115904696d696", "score": "0.7072534", "text": "def get_mode(self):\n ...
720f2c6f6fcd6a7c2b60b4b69d9c1812
Download necessary information from Kegg Database for parsing.
[ { "docid": "4ec508dd8350908757f415e10ef746e3", "score": "0.55843097", "text": "def downloadKegg(args):\n\n urllib.urlretrieve(\"http://rest.kegg.jp/list/\" + args.specie, args.gen2keggs)\n urllib.urlretrieve(\"http://rest.kegg.jp/link/pathway/\" + args.specie, args.kgen2pathways)\n urllib.urlre...
[ { "docid": "f0ab19c936c4d5adaee06c4eb0393119", "score": "0.6366967", "text": "def _download_data(self) -> None:\n # Download info\n data_dir = f\"{self._data_dir}GENE_INFO/Mammalia/\"\n fn = f\"ncbi_info_{self._date_today}.tsv\"\n data_fn = \"Homo_sapiens.gene_info.gz\"\n ...
86391a6f19ae2fe7ebbeed2c35e898e8
This function parses a given code and return the root node.
[ { "docid": "f040cb4341fa90482fc771c575958fe1", "score": "0.7506941", "text": "def parse_code(\n self,\n code: Union[str, bytes]\n ) -> tree_sitter.Node:\n if isinstance(code, bytes):\n tree = self.parser.parse(code)\n elif isinstance(code, str):\n ...
[ { "docid": "6bbc418bb14f0854bffe5cc29f594cfb", "score": "0.81535655", "text": "def parse(code):\n\n code = canonicalize_code(code)\n py_ast = ast.parse(code)\n\n tree = python_ast_to_parse_tree(py_ast.body[0])\n\n tree = add_root(tree)\n\n return tree", "title": "" }, { "docid...
44b3d2e5bb7c4ede38b9b07e60548c49
Checks the word can be reduced.
[ { "docid": "15c1269d4739156bf6a91df47c035723", "score": "0.7008527", "text": "def is_reducible(word, words) -> bool:\n\n if word == 'a' or word == 'i' or word == '':\n return True\n\n if word not in words:\n return False\n\n for i in range(len(word)):\n if is_reducible(word...
[ { "docid": "478549a57316c9f060c35860f6d34cbc", "score": "0.71950686", "text": "def is_reducible(word, word_dict):\r\n # if the word has already been checked return whether it reduces\r\n if word_dict[word][0] is not None:\r\n return word_dict[word][0]\r\n # otherwise check all possib...
ad5643f3cf577e09e1f9b7d73d2d64de
Fetch data (messages + members) from one guild
[ { "docid": "a28e1862062da57b0b27630a41a38110", "score": "0.5994161", "text": "async def save_guild_data(self, guild: discord.Guild) -> None:\n\n logger.info('Fetching members, message and activities from channels of guild %s',\n guild.name)\n\n await self.bot.db.save_gui...
[ { "docid": "3ce218971aaa4b71925095f00b42261e", "score": "0.7467778", "text": "async def guild_members(self, ctx, *, guild: str):\n user = ctx.message.author\n color = self.getColor(user)\n guild = guild.replace(' ', '%20')\n scopes = [\"guilds\"]\n endpoint_id = \"guil...
95d7665b460f01efb39084d1470c0625
Get coordinates of grid nodes in the x direction.
[ { "docid": "8be1729b7a7b85e60ed55480c85c37ab", "score": "0.78737", "text": "def get_grid_x(self, grid: int, x: np.ndarray) -> np.ndarray:\n ...", "title": "" } ]
[ { "docid": "cd12c890313162a7fb71ddbd7c1ae534", "score": "0.764228", "text": "def grid_xdimension(self):\n return ((self.number_of_node_columns - 1) * self._dx)", "title": "" }, { "docid": "cce369820dc04d9da19dfdb84ed7d51b", "score": "0.71676946", "text": "def _get_coordinates(...
5b47f601cf476ab3802221037dcf0a8d
Builds an expense using input from the command line
[ { "docid": "004b742f4285f8f335900daca8364cc6", "score": "0.6994802", "text": "def build_expense():\n name = input(\"What is this expense called?\\n> \")\n \n amnt = float(input(\"How much is the expense?\\n> $\"))\n \n while True:\n raw_freq = input(msgs.freq)\n\n if raw_fre...
[ { "docid": "6bb81049769d7b6ecf7000ab1d8dcd0e", "score": "0.6160386", "text": "def addExpenseCommand(expensesList, params, undoList):\n if len(params) != 2:\n print(\"Invalid parameters list\")\n else:\n if not readInt(params[0]):\n print(\"Please input positive integer val...
ab857517844a01614aa76a5dafe39c8e
a generator over documents tree
[ { "docid": "a46c7fb576199651ac45aea666b94d05", "score": "0.64883244", "text": "def __parse_docs(self, tree):\n\n # iter over original-translation pairs\n for para in tree:\n cells = para.getchildren()\n\n _text = str()\n _transl = str()\n _idx = ...
[ { "docid": "b718d683bed68545db5457b73578c87d", "score": "0.7002977", "text": "def generate_doc(self, recursive=False):", "title": "" }, { "docid": "3a324803edac78751a7c0a4501a910eb", "score": "0.6489271", "text": "def getTreeDoc(self):\r\n raise NotImplementedError", "titl...
9e42fa5e303b22d8ed9f731c217c2f56
Try to get a page by key, returns the data or False for a miss
[ { "docid": "443690144e72d61a8689769f29a8a1be", "score": "0.74597764", "text": "def get(self, key: str):\n if key in self.pages:\n self.buffer_operation(OP_UPDATE, key)\n return self.pages[key]\n return False", "title": "" } ]
[ { "docid": "1c1ad86a9c8aff263c1133a9669d363b", "score": "0.6815208", "text": "def get(self, key: str):\n page = self.database.get(key)\n\n if page is None:\n self.dbg(\"datastore_event\", \"Page for {} was empty\", [key])\n return None\n return page.data", ...
479d58be037a028ec322fe9821da342c
Initialize a new Game object.
[ { "docid": "5aa7f184e2fabcb8b811afb12eccee01", "score": "0.0", "text": "def __init__(self, board_size, ships):\r\n self.__board_size = board_size\r\n self.__ships = ships\r\n self.bombs = {}\r\n self.__game_status = self.GAME_STATUS_ONGOING\r\n self.intact_cells = []\r...
[ { "docid": "adca8e88971d5eb9a515579168d68516", "score": "0.8526202", "text": "def newGame(self):\n self.__init__()", "title": "" }, { "docid": "8219e98b176a823ccca676e644e5cee1", "score": "0.79667807", "text": "def initGame(self):\n\n # Populate everything\n self...
e09d19f2f450b884fbe9ebd108492b27
Check that necessary tools, gcloud, gsutil, and kubectl are available if necessary. If execution of one of these tools is unsuccessful it will throw UserReportError exception.
[ { "docid": "ff85da58e2983378dbabddb6fb56fcbc", "score": "0.7900791", "text": "def check_prerequisites() -> None:\n try:\n p = safe_exec('gcloud --version')\n except SafeExecError as e:\n message = f\"Required pre-requisite 'gcloud' doesn't work, check installation of GCP SDK.\\nDetai...
[ { "docid": "2849f7b05fd7fadae20b904004e7c9d7", "score": "0.6719025", "text": "def check_prerequisites():\n # Check 1: Is there a usercert ?\n for key_name in (\"USERCERT\", \"USERKEY\"):\n key_path = PARAMETERS[key_name]\n if not os.access(key_path, os.R_OK):\n print(\"ERROR: Can't access t...
d2b82ad838c3f125dd615ac7d143f25d
Ensures that given function is a generator function, i.e. a function that returns a generator. This way all properties can be checked in the same manner, regardless of whether they use `yield` internally or not.
[ { "docid": "109a19b07570110808eefd63110f528e", "score": "0.70348686", "text": "def __coerce_to_generator_func(self, func):\r\n if inspect.isgeneratorfunction(func):\r\n return func\r\n\r\n @functools.wraps(func)\r\n def generator_func(*args, **kwargs):\r\n func...
[ { "docid": "aed8ff0f80b8a06145dbb3bdc0bbf85e", "score": "0.7716181", "text": "def check_not_generatorfunction(func):\n if inspect.isgeneratorfunction(func):\n raise RuntimeError(\"{}: must not be decorated, is a generator test\"\n .format(func.__name__))", "title"...
ddfdc4641f0ebd7551e79f22d8d89603
Return boolean representing if given candidate is a valid biological sex.
[ { "docid": "78ce336c7923fb2a22c4f12843f89f07", "score": "0.5236249", "text": "def validate(self, candidate, **kwargs) -> bool:\n return super().validate(candidate, **kwargs) and self._predictor.validate(candidate)", "title": "" } ]
[ { "docid": "af7154605773eac2768871b8d44de057", "score": "0.5943835", "text": "def is_valid_candidate_single(self, candidate):\n # idx_array = np.meshgrid(*[list(range(0, n)) for n in candidates.shape[:-2]], indexing='ij')\n # idx_array = np.column_stack([idx.reshape(-1, 1) for idx in idx_a...
1b3efb1048e2d750918594a39aabf842
fig, ax = marginal_scalar_pdf(Est, ind) plots the marginal scalar pdf
[ { "docid": "422ef32a41eebff39a968dac03e4e673", "score": "0.8348277", "text": "def plot_marginal_scalar_pdf(Est, ind,\n addto=None, \n color='blue',\n linestyle='-',\n labelprefix='',\n ...
[ { "docid": "94239d1b19943ff5247ffeec4f4c9350", "score": "0.8333177", "text": "def marginal_scalar_pdf(Est, ind, lims=None):\n \n # extract the needed parameters from the estimation result dictionary\n # extract the needed parameters from the estimation result dictionary\n if 'x_est' in Est:\...
6993effc9868ea8809c4197f0e6dc138
Create instance of Custom field type
[ { "docid": "c0cb51e2f1ad9dd0e229fd0825c02630", "score": "0.0", "text": "def __init__(self, base, func):\n\n if not hasattr(func, '__call__'):\n raise TypeError('`func` must be a function')\n \n self.base = base\n self.func = func", "title": "" } ]
[ { "docid": "a2cff9f42106817703bba40c006e3f46", "score": "0.7500207", "text": "def _instanciate(self, field_data):\n attrs = self._instanciate_attrs(field_data)\n if attrs:\n return fields.Field.by_type[field_data['ttype']](**attrs)", "title": "" }, { "docid": "e8463d...
ee0bf73415e63b462d088fbb19440dc0
Numpy implementation of the Frechet Distance. The Frechet distance between two multivariate Gaussians X_1 ~ N(mu_1, C_1) and X_2 ~ N(mu_2, C_2) is d^2 = ||mu_1 mu_2||^2 + Tr(C_1 + C_2 2sqrt(C_1C_2)). Stable version by Dougal J. Sutherland.
[ { "docid": "90aaf7f26878246676a06c122c5aa5ad", "score": "0.765344", "text": "def calculate_frechet_distance(mu1, sigma1, mu2, sigma2, eps=1e-6):\n\n mu1 = np.atleast_1d(mu1)\n mu2 = np.atleast_1d(mu2)\n\n sigma1 = np.atleast_2d(sigma1)\n sigma2 = np.atleast_2d(sigma2)\n\n assert mu1.shape...
[ { "docid": "d22e400f08af653bc3ad334e28fee177", "score": "0.76049113", "text": "def calculate_frechet_distance(mu1, sigma1, mu2, sigma2, eps=1e-6):\r\n\r\n mu1 = np.atleast_1d(mu1)\r\n mu2 = np.atleast_1d(mu2)\r\n\r\n sigma1 = np.atleast_2d(sigma1)\r\n sigma2 = np.atleast_2d(sigma2)\r\n\r\n ...
407f4af27bf17bc2e6944d8f49e5e536
Returns some post data to create an article against this view
[ { "docid": "62fab48fa8b454dc7f8810bfb7da2116", "score": "0.61425453", "text": "def _art_data(self):\n return {'title': 'Test article', 'contents': 'Test content'}", "title": "" } ]
[ { "docid": "f8a87bd3b74b8d1c8c488e9ab7d65941", "score": "0.7187008", "text": "def create_article(self):\n token = self.user2.token()\n self.client.credentials(\n HTTP_AUTHORIZATION='Bearer ' + token)\n return self.client.post(self.article_url,\n ...
2b54202fc563b893b8ab5c691c731dfa
Return only the children that represent tags (i.e. exclude any DataParsers)
[ { "docid": "43b7ca08b47f2144e4f77d6071d9a1a5", "score": "0.7936607", "text": "def tag_children(self):\n return [t for t in self.children if t.tag is not None]", "title": "" } ]
[ { "docid": "f852add60a2c6e09ac8c7504d3fc1c47", "score": "0.72802025", "text": "def children(self):\n\n return (obj for obj in self._content if isinstance(obj, Tag))", "title": "" }, { "docid": "0b1e84c3599f7e293b159cd549106813", "score": "0.7091907", "text": "def get_child_tag...
3c7f78b13116465cd7ea04b23b33136d
Takes all of the .ta1 files and "shelves" them into tiny directories, the timespan of which is regulated by the user
[ { "docid": "769f0b823045916036640d6d11d17cbf", "score": "0.6171974", "text": "def shelf(location, **ts):\n\tlocation += '/' # needs to be marked as a directory\n\n\n\thours = ts.pop(\"hours\",0)\n\tminutes = ts.pop(\"minutes\",0)\n\tseconds = ts.pop(\"seconds\",0)\n\tif hours==minutes==seconds==0:\n\t\t...
[ { "docid": "0c394496a1614d300291a321b56ab237", "score": "0.5822624", "text": "def makeFinalFiles():\n from ROOT import TChain, TFile, TTree, TNamed, MGTWaveform\n\n # here is where you might put some last minute cuts\n tCut = \"tOffset < 4000\"\n\n cutType = \"frb%d\" % pctTot\n # outType...
676fa315d8a1f7d5fa3ef30c0c723d9c
pulls soup list from front part of mangapanda url and selector
[ { "docid": "84b78c04950d8c926831dec8d0a56e06", "score": "0.79778224", "text": "def pullSoup(front_url, selector):\n\t#add base url to front url to get complete url for page to be opened\n\tfull_url = \"http://www.mangapanda.com\" + front_url\n\t#open up page\n\tresPage = requests.get(full_url)\n\t#check...
[ { "docid": "dc6c271d50837bf478ff6000fb86f793", "score": "0.6672189", "text": "def getChapters(manga_url):\n\t#gets the list of soup elements from url (first input) using the selector (second input)\n\tsoupList = pullSoup(manga_url,'#listing a')\n\t#reshape so that it is a list of front link+title elemen...
81fcd009c74629703007d9aca88f642a
This method returns the function's output when the class is called.
[ { "docid": "2644af6d3a882a635aa0db6234a6a4bf", "score": "0.0", "text": "def __call__(self, x):\n\n # Calculating the Ridge's function\n f = x[1:] ** 2\n\n return x[0] + np.sum(f) ** 0.5", "title": "" } ]
[ { "docid": "0a91a476fa8777f5c58ab3058d9b7111", "score": "0.7639285", "text": "def getOutput(self):\n pass", "title": "" }, { "docid": "befa74be37040eadded7efa0be3a8454", "score": "0.75097024", "text": "def __call__(self):\n return self.out", "title": "" }, { ...
6df2705c11d30eb8209ecb0748477d75
Function that returns the view page for a blog.
[ { "docid": "2367d1a9b749a62cc21e21d01adfa256", "score": "0.7342799", "text": "def view_blog(blog_id):\n\n blog = Blog.query.filter_by(id=blog_id).first()\n comments = Comment.get_comments(blog_id)\n \n title = \"View Blog\"\n \n return render_template('view.html', title=title, blog=blo...
[ { "docid": "4d9aca7b2e1de6d48570604a588a6461", "score": "0.7157125", "text": "def blog_post(request, url):\n\n blog = get_object_or_404(Post, url=url)\n\n context = {\n \"blog\": blog,\n }\n\n return render(request, \"blog/blog_post.html\", context)", "title": "" }, { "doc...
be3b167740ad91196d1c07de6ce0dc5d
Raw Github should be up to download stuff from it.
[ { "docid": "05695d218b9fc640233c8404cbd1b1c2", "score": "0.0", "text": "def test_is_raw_gh_online(self):\n is_online = ONLINE_CHECKER.is_gh_raw_online()\n\n self.assertTrue(is_online)", "title": "" } ]
[ { "docid": "edab69dbea84f039aa1f2d2090f0d221", "score": "0.67514336", "text": "def test_repo_get_raw_file(self):\n pass", "title": "" }, { "docid": "6bf6846ba20a0a34fbadfa4a08855a71", "score": "0.6747231", "text": "def test_raw(self):\n\t\thtml = http.page_text(\"https://raw.g...
b20c42a9fbbc7c21fa416b7ee9fb2ad1
List viewable contentish and folderish subobjects.
[ { "docid": "0eba71dcef16c58921abf110ab3d2a89", "score": "0.56333256", "text": "def listFolderContents(self, contentFilter=None):\n fc_list = []\n for id, obj in self.contentItems(contentFilter):\n # validate() can either raise Unauthorized or return 0 to\n # mean unau...
[ { "docid": "e8c114717b6787b3dbe00695cf0581b5", "score": "0.6454088", "text": "def children(self, obj):\n return obj.subfolders()", "title": "" }, { "docid": "04aee46d33afd7c0f8c16422f831928d", "score": "0.6329941", "text": "def get_objs(request, my_item_container, allow_copy):...
381cb68d20b0a9c53d9d956a7e5dc3be
Tests that updates are atomic; when part of an update is not allowed, the entire update does not happen. Try to make the bikeshed twice as large and change its color. Both will fail, since the useful operation blocks the entire change.
[ { "docid": "11861073c42597eec5cec495d4aa107e", "score": "0.0", "text": "def test_partiallyUpdatableAttributes(self):\n self.headers.setRawHeaders(\"Content-Type\", [\"application/json\"])\n self.body = dict(disallowedUpdateState, **allowedUpdateState)\n return self._testUpdate(http....
[ { "docid": "ba96f00006c63359a37bb8c6b94ea478", "score": "0.5960921", "text": "def _test_staledata_error_on_concurrent_object_update(self, model, dbid):\n lock = functools.partial(lockutils.lock, uuidutils.generate_uuid())\n self._blocked_on_lock = False\n\n def _lock_blocked_name_up...
3a9a13fe2dfdd04567227bf7a5c59ed4
Sets the launch_date_utc of this Roadster.
[ { "docid": "fc4e976a06f01a0fa403acf4f1bc5702", "score": "0.8859175", "text": "def launch_date_utc(self, launch_date_utc):\n\n\n self._launch_date_utc = launch_date_utc", "title": "" } ]
[ { "docid": "4d38cc69dc6b63af9664399878087caa", "score": "0.68396974", "text": "def set_utc_date(self, date_utc):\n self.date_utc = utils.to_datetime(date_utc)\n self.date_localized = utils.to_datetime(date_utc, self._config['__tzinfo__'])", "title": "" }, { "docid": "6ae675e5d0...
705c5590fb9aa8ff7593df29d2fe4f51
Expose containers externally via secured routes
[ { "docid": "5ce9fcc8aa8ba80fc79d0c172d9fe9c4", "score": "0.0", "text": "def create(self, name: str, route_type: \"Types\" = Types.EDGE, **kwargs):\n cmd_args = [f\"--{k}={v}\" for k, v in kwargs.items()]\n self._client.do_action(\"create\", [\"route\", route_type.value, name, cmd_args])", ...
[ { "docid": "352d9f89089989cc330798ccbba9a78e", "score": "0.57136905", "text": "def runpublic():\n app.run(host='0.0.0.0')", "title": "" }, { "docid": "82e3d8128d7d5e40b4e4b8eb9e5c7c9c", "score": "0.5393183", "text": "def expose_endpoint(self, exec_endpoint: str, path: Optional[str...
c7f65ee6fe54c5b3c1cbe41880875758
Parses the contour file name
[ { "docid": "326eb45f8cd05476a05715f7cff2d048", "score": "0.69574046", "text": "def parse_name(cls, fn_contour: str):\n\n matches = re.match('IM-[\\d]+-([\\d]+)-[a-z]contour-manual.txt', fn_contour)\n if matches is not None:\n slice_num = matches.groups()[0]\n slice_nu...
[ { "docid": "0cb71a9653db83d5d3b061704811f9a0", "score": "0.5983463", "text": "def parse_calib_file_name(fname) :\n fnfields = os.path.splitext(fname) # '123-end.data' -> ('123-end', 'data') \n if len(fnfields) != 2 : return None # check that file name like '123-end.data' has splited exten...
79690304e21762f3fdc554260faa7dea
Return all terms of a type (``s``, ``p``, or ``o``) in the store.
[ { "docid": "b7cab220e8d1f97a27d2ca1e4037bc13", "score": "0.7552455", "text": "def all_terms(self, term_type):\n if term_type == 's':\n idx_label = 's:po'\n elif term_type == 'p':\n idx_label = 'p:so'\n elif term_type == 'o':\n idx_label = 'o:sp'\n ...
[ { "docid": "ea3a4c7357c27467aa72934cc79bc3c6", "score": "0.6069078", "text": "def terms(self):\n return []", "title": "" }, { "docid": "228c8943f7f273ea3eb8a925309b356d", "score": "0.6005916", "text": "def terms(self) -> Set[Term]:", "title": "" }, { "docid": "3bd7...
797140e4a92b3e65ae68a8b07ea7704a
itkIntensityWindowingImageFilterID3ID3_Superclass_cast(itkLightObject obj) > itkIntensityWindowingImageFilterID3ID3_Superclass
[ { "docid": "b319a8b048c55a305bd49d2cfc34c65c", "score": "0.88690996", "text": "def itkIntensityWindowingImageFilterID3ID3_Superclass_cast(*args):\n return _itkIntensityWindowingImageFilterPython.itkIntensityWindowingImageFilterID3ID3_Superclass_cast(*args)", "title": "" } ]
[ { "docid": "f12da4b506e1d9a13378f3eff1c90259", "score": "0.88566303", "text": "def itkIntensityWindowingImageFilterIF3ID3_Superclass_cast(*args):\n return _itkIntensityWindowingImageFilterPython.itkIntensityWindowingImageFilterIF3ID3_Superclass_cast(*args)", "title": "" }, { "docid": "02cc0...
b0685b59a1a8c19bded0b78253b1a4e5
NTSTATUS NtUnloadDriver( PUNICODE_STRING DriverServiceName )
[ { "docid": "d95d989b5badc51e4b44659759f8de6d", "score": "0.8218995", "text": "def ntdll_NtUnloadDriver(jitter):\n ret_ad, args = jitter.func_args_stdcall([\"DriverServiceName\"])\n raise RuntimeError('API not implemented')\n jitter.func_ret_stdcall(ret_ad, ret_value)", "title": "" } ]
[ { "docid": "b6361d2362e8373d980c4b2cbddfac6c", "score": "0.5760336", "text": "def ntdll_NtLoadDriver(jitter):\n ret_ad, args = jitter.func_args_stdcall([\"DriverServiceName\"])\n raise RuntimeError('API not implemented')\n jitter.func_ret_stdcall(ret_ad, ret_value)", "title": "" }, { ...
3ee24e0c0f2e5a6987f2da134b1c9cd3
Forward message to a specific node.
[ { "docid": "fbad94a39b5cad96916cd8b5c3a9d74b", "score": "0.6388381", "text": "def forward(message, socket):\n try:\n time.sleep(1)\n dest = message[MSG_FIELD.DESTINATION]\n worker = socket_handler.get(dest)\n if worker:\n content = message[MSG_FIELD.CONTENT]\n ...
[ { "docid": "6bd3382d4ecd4e07e411a9bc93d58ae9", "score": "0.67194664", "text": "def send_message(self, request, node):\n\n request.set(\"src\", self.node)\n node.process_request(request)", "title": "" }, { "docid": "fe13c38927d4d74f9291554d03f3cfb4", "score": "0.66790444", ...
8006ac81663c8ab8f5fef2bcd6b06a80
fitness(target) will return the fitness value of permutation named "target". Higher scores are better and are equal to the total value (Benefit/ profit) of items in the permutation. If total_weight is higher than the capacity, return 0 because the permutation cannot be used.
[ { "docid": "2e3e16c6025faf95d5530088c9e2daa3", "score": "0.75124675", "text": "def fitness(target):\r\n total_value = 0\r\n total_weight = 0\r\n index = 0\r\n for i in target: \r\n if index >= len(ITEMS):\r\n break\r\n if (i == 1):\r\n total_value +...
[ { "docid": "06ec5d66c638fd314e2e509c2bef6eb2", "score": "0.64524364", "text": "def fitness(self, target):\n target = list(target)\n counter = 0\n\n for i in range(len(self.dna)):\n if self.dna[i] == target[i]:\n counter += 1\n self.score = counter / ...
09357b88590bf7b1fa9eab0cd18851ed
Extracts the name of the month from the given filename/path (assumes /path/to/file/name_yearmonth.txt).
[ { "docid": "cfee2b92a61ea058ac742355226f2e33", "score": "0.82106656", "text": "def getMonthName (filename):\n #\n m = re.search('-([0-9]+).txt', filename)\n if m != None:\n return m.group(1)\n else:\n return \"current\"", "title": "" } ]
[ { "docid": "2893cf73a9bdea5d2db1fb4382594252", "score": "0.80404526", "text": "def get_month_info(filename):\n\n pass", "title": "" }, { "docid": "e8e9e2b2121ec1bc1f0e5a3fbb8f6a2c", "score": "0.6470807", "text": "def getYear (filename):\n m = re.search('_([0-9]+)-', filename)\n ...
6f6d9a1e725ce0f4ef8522cd99bf1a2c
State machine to pop data out of the PIFO upon request
[ { "docid": "5dd07dc1fdf8fabcca914cb97b2bd203", "score": "0.6355643", "text": "def pop_sm(self):\n while True:\n # wait to receive a read request\n req = yield self.r_in_pipe.get()\n # model read latency\n yield self.wait_sys_clks(self.read_latency)\n ...
[ { "docid": "e30a400a9997ad8e4203002e5c1eb6ec", "score": "0.67517585", "text": "def PopState(self):", "title": "" }, { "docid": "dc63bf5591eac12daa4bf1eadab9c6df", "score": "0.6186308", "text": "def pop_state(self, *_):\n self.next_state = (StateOperations.POP, None)", "tit...
b9cf588c58336fdc1b9c6583123cb0f6
Get the servo's angle
[ { "docid": "0d1484fbf00fcb6d4ac7f5bebc16412c", "score": "0.71814936", "text": "def angle(self):\n return int(self.pos() * 180)", "title": "" } ]
[ { "docid": "c8dd4df30d5c0ddd61b456737131d079", "score": "0.8747807", "text": "def getAngle(self):\n a = self.servo.duty()\n a -= 64\n a *= SERVO_ANGLE / (SERVO_MAX - SERVO_MIN)\n a -= (SERVO_ANGLE / 2)\n return a", "title": "" }, { "docid": "8dee146df205737500fe028fb4a8c074", ...
b4e4a98c0bb277e3fced207af52e5038
returns the window of AA's around the Cterm of an epitope, given defined upstream and downstream window sizes and a row from a pandas df with ending position and full origin sequence of the epitope.
[ { "docid": "591ed3df5d9c1747a1df54ec0071ae3b", "score": "0.62344474", "text": "def get_peptide_window(sequence, starting_position, ending_position, upstream=6,\n downstream=6, c_terminal=True):\n # set cleavage site index based on function flag\n if c_terminal:\n cleav...
[ { "docid": "7b3624355498b38ef47c40a368055fa7", "score": "0.5745897", "text": "def _get_window(start, end):\n window = 1 - np.r_[hann(4)[:2], np.ones(np.abs(end - start) - 4), hann(4)[-2:]].T\n return window", "title": "" }, { "docid": "3e6e2fb9cb52192f65c76b59f681e9e1", "score": "0...
06aff972765844d6171c4bea536cf1d3
Gets reference row. This is the row that contains the names of the intersecting columns, allowing fetching of cells in this row via passage of a reference string
[ { "docid": "16be2a035dc6ea6c68d226582881e787", "score": "0.7425297", "text": "def reference_row(self) -> 'Row':\n return self.sheet.reference_row", "title": "" } ]
[ { "docid": "17e80d7b4aa4487e8671cc28a483a5f8", "score": "0.6681498", "text": "def reference_row_index(self) -> int:\n return self._reference_row_index", "title": "" }, { "docid": "43cff7c6a2da37b232d6ddf915a04635", "score": "0.60901815", "text": "def getRow(self, row):\r\n\t\t...
1df76c97edfb3f851e3fe52c7227b956
Inline progress bar implementation.
[ { "docid": "6be4c47277503cd9c3f51d77398d3cd5", "score": "0.0", "text": "def progress(count, total, suffix=''):\n\n bar_len = 60\n filled_len = int(round(bar_len * count / float(total)))\n percents = round(100.0 * count / float(total), 1)\n bar = '=' * filled_len + '-' * (bar_len - filled_len...
[ { "docid": "9933aeb88ac3e6df00a8f820b8f7ead5", "score": "0.7358753", "text": "def update_progress(self, progress):\n barLength = 20\n status = \"\"\n if isinstance(progress, int):\n progress = float(progress)\n\n block = int(round(barLength * progress))\n te...
4710b2e29726e9d10bc8a2453f410619
Initialize class data from input file.
[ { "docid": "d48e294bf82fbfb6008b8dd04a824560", "score": "0.0", "text": "def init_from_file(filename, verbose=False):\n FuelPrice._data.clear()\n\n if verbose:\n omega_log.logwrite('\\nInitializing database from %s...' % filename)\n\n # don't forget to update the module do...
[ { "docid": "21043b5751e1a501c0fcddd9d86c1228", "score": "0.780452", "text": "def __init__(self, input_file):\n self.data = []\n self.data_file = input_file #open(file_name, 'r')", "title": "" }, { "docid": "6712e933ef0ba97c90073c986a49206d", "score": "0.7547976", "text"...
81be948beb5b7c253fda04cf4fa33cd4
Set up the whirlwind AP with provided network info.
[ { "docid": "23d3808e96ea08c1b69423e883cd8f32", "score": "0.70799476", "text": "def ap_setup(ap, network, bandwidth=80):\n log = logging.getLogger()\n bss_settings = []\n ssid = network[wutils.WifiEnums.SSID_KEY]\n if \"password\" in network.keys():\n password = network[\"password\"]\n...
[ { "docid": "ba63a9cd6fd3b985f72e362db7c83127", "score": "0.63868827", "text": "def setup_network(cfg):\n display_msg(\"Init Network...\", msg2=\"Looking for WiFI\",\n msg3=cfg.cfg_json['WIFI_SSID'])\n\n # wait 2 seconds to see if the network comes up\n time.sleep(2)\n\n sta_if...
ed849fdc0a449e95110b4776d88c6cf0
Strips featured artists from the artist title according to Billboard Hot 100 formatting.
[ { "docid": "014f37cfdd10332cf25d9d9b2e75247c", "score": "0.5266041", "text": "def stripFeat(s):\n if \" Featuring\" in s:\n return s[: s.index(\" Featuring\")]\n elif \" x \" in s:\n return s[: s.index(\" x \")]\n else:\n return s", "title": "" } ]
[ { "docid": "1b1b36d7b110cab664480b03386f60c9", "score": "0.6408811", "text": "def ft_in_title(item, drop_feat):\r\n artist = item.artist.strip()\r\n albumartist = item.albumartist.strip()\r\n\r\n # Check whether there is a featured artist on this track and the\r\n # artist field does not exa...
86d422850502985ed56e7163dde3b78d
Converts Pascal bounding box from (x, y, w, h) into (top, left, bottom, right) format, and switch x/y coordinates to make a converted array indexes consistent with Numpy.
[ { "docid": "24d3fd752b23b30dc0ec8f6dc6236ef5", "score": "0.63246226", "text": "def from_voc(bbox):\n x, y, w, h = bbox\n new_box = [y, x, y + h - 1, x + w - 1]\n return np.array(new_box)", "title": "" } ]
[ { "docid": "e3ca31e55f39475243fc71f65d0b1a93", "score": "0.65984535", "text": "def bbox_xywh_to_xyxy(self, boxes):\n w, h = boxes[:, 2], boxes[:, 3]\n boxes[:, 0] -= w / 2.0 # x1 = center_x - width/2\n boxes[:, 1] -= h / 2.0 # y1 = center_y - height/2\n boxes[:, 2] = boxes[...
8ac1622dac757385eda28bbed5586a8a
Take the required arguments and publish the given command.
[ { "docid": "5a3433795b72113360cfeb450d179318", "score": "0.5254576", "text": "def pub(\n self,\n tgt,\n fun,\n arg=(),\n tgt_type=\"glob\",\n ret=\"\",\n jid=\"\",\n timeout=5,\n listen=False,\n **kwargs\n ):\n # Make sure t...
[ { "docid": "50a2eb172754fe6beac7e71b4cda7d1c", "score": "0.688723", "text": "def _publish_task(publish_args: str = '') -> DoitTask:\n return debug_task([\n Interactive('poetry run nox --session build_dist build_check'),\n f'poetry publish {publish_args}',\n ])", "title": "" }, ...
d113d1c69349f622deed5b357a9170df
Checks that the value conforms to the LanguageID
[ { "docid": "f66b4f0de21fc3bd0a8ee041d82e2728", "score": "0.6371621", "text": "def checkLanguageID(lang):\n ret = libxml2mod.xmlCheckLanguageID(lang)\n return ret", "title": "" } ]
[ { "docid": "9589b0955ee39d7c15634647a6924963", "score": "0.6502951", "text": "def validate_lang(lang):\n if lang in LANGUAGE_OPTIONS.keys():\n return True", "title": "" }, { "docid": "1a3cba627ecaba3ecbd81c3dc38e4493", "score": "0.64360905", "text": "def validate_language(l...
4e42cacc035c23b0856ffd1be1d2e98c
Upgrades alpha beta values of the parent node.
[ { "docid": "0a798d6e7655c15903d7fbeb1a1f259e", "score": "0.7142382", "text": "def updateAB(self, root, nodeNEW):\n if root.max == 1 and root.beta > nodeNEW.score:\n root.beta = nodeNEW.score\n elif root.max == 0 and root.alpha < nodeNEW.score:\n root.alpha = nodeNEW.s...
[ { "docid": "22c9877fad8bf4bb48f144db7fb7bb9c", "score": "0.73812336", "text": "def update_before(self):\n if self.node_type == MAX_NODE:\n # get the beta from parent\n if self.parent:\n self.beta = self.parent.beta\n else:\n ...
fb5b30afd0e5c179978936780110729e
Upload muscles and the neurons that connect to them
[ { "docid": "6f3054becbc9fe63dc97044698ece539", "score": "0.67196697", "text": "def upload_muscles():\n try:\n with open(CELL_NAMES_SOURCE) as csvfile:\n csvreader = csv.reader(csvfile)\n\n ev = P.Evidence(key=\"wormbase\", title=\"C. elegans Cell List - WormBase.csv\")\n ...
[ { "docid": "aad469f7cdda8f21594f47b702bbf18b", "score": "0.63252246", "text": "def upload_tracks():\n auto_upload_tracks()", "title": "" }, { "docid": "061181d642add61974fefd7bcd56de38", "score": "0.6084998", "text": "def upload(self):", "title": "" }, { "docid": "0611...
65fbb237ba48a42183e928e84ee4eb93
returns some edges, randomly selected
[ { "docid": "0f4b0aa3bdb80a832900079ee0262c18", "score": "0.7515471", "text": "def random_edges(how_many,only_alive=True): # FIXME: more elegant than parametrized?? Boh!\n pool = None\n if only_alive:\n pool = alive_edges()\n else:\n pool = edges()\n\n how_many = min(how_many,le...
[ { "docid": "2c464bb991f2dfc77bb0900780b7b411", "score": "0.78476745", "text": "def pick_random_edge(self):\r\n return random.choice(self.get_edges())", "title": "" }, { "docid": "372f819474a5905adfa5a9d50320c43c", "score": "0.7839612", "text": "def random_edge(self):\n ...
87488fa0f3f8495b51a11ee8ae28a308
This event is triggered when any FlatNotebook page is deleted. When a FlatNotebook page is deleted we remove the associated page object (a TextCtrl) from the pages list. At the same time we give the operator a chance to save modifications.
[ { "docid": "8a6345ace9f008266cd1e82075967ffa", "score": "0.0", "text": "def closing_file_event(self, event):\n\n page = self.notebook.GetCurrentPage()\n filename = page.filename\n\n self.show_notebook_if_not_shown()\n\n if page.GetModify() == True:\n message = 'Dis...
[ { "docid": "84272713bfa0b104465c28ac77305ef6", "score": "0.67369455", "text": "def on_close_page(self, event):\r\n page = event.EventObject\r\n page.Show(False)\r\n # Remove page from MainWindow data structures\r\n if isinstance(page, DatabasePage):\r\n del self.db...
55f1402bb4366390c6c9b5f6ce663a83
Restart the services in the self.restart_map{} attribute if any of the files identified by the keys changes for the wrapped call.
[ { "docid": "b2e1cce208f93ac248afb91bf797ba85", "score": "0.59367985", "text": "def restart_on_change(self):\n return ch_core.host.restart_on_change(\n self.full_restart_map,\n stopstart=True,\n restart_functions=getattr(self, 'restart_functions', None),\n ...
[ { "docid": "6f1df8eff29503c62e0f02bf5cc83958", "score": "0.74130356", "text": "def restart_on_change(self):\n checksums = {path: ch_host.path_hash(path)\n for path in self.full_restart_map.keys()}\n yield\n restarts = []\n for path in self.full_restart_map...
e5c0ce3678f425329a83576e15dd2772
This method finds the the forces and moments calculated from the near field.
[ { "docid": "05ede3869caeb37b83413ef8d2cc596c", "score": "0.66304636", "text": "def calculate_near_field_forces_and_moments(self):\n\n # Initialize a variable to hold the global panel position as the panel's are\n # iterate through.\n global_panel_position = 0\n\n # Initialize...
[ { "docid": "e462cf8d09116c9d6ae444287f7f8205", "score": "0.7421039", "text": "def calculate_near_field_forces_and_moments(self):\n # Calculate the velocities induced at every panel's bound vortex center.\n induced_velocities = aerodynamics.collapsed_velocities_from_horseshoe_vortices(\n ...