query_id
stringlengths
32
32
query
stringlengths
9
4.01k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
9695fbdbc8e399815b3b3229b643c2c6
Echo a warning message to console.
[ { "docid": "3086f7df6260724218b9470d875f0a2c", "score": "0.6666118", "text": "def echo_warn(msg: t.Optional[t.Union[str, t.List[str]]] = None, **kwargs):\n kwargs.setdefault(\"style_args\", WARN_ARGS)\n kwargs.setdefault(\"style_tmpl\", WARN_TMPL)\n kwargs.setdefault(\"log_level\", \"warning\")...
[ { "docid": "a5d77f60dd51d6d5f2614e0427ef364a", "score": "0.7996388", "text": "def warning(self, msg):\n print(\"WARNING: {}\".format(msg), file=sys.stderr)", "title": "" }, { "docid": "aa237f783b470fa0c85b9f1c127fc144", "score": "0.78742915", "text": "def warning(self, message...
43251de341669b93f4748b5d4d414d28
Make synchronous request to graphQL server.
[ { "docid": "9bfef96901988038a1ec1964b8ca7aaf", "score": "0.0", "text": "def exec(\n self,\n query: str,\n variables: dict = None,\n operation_name: str = None,\n headers: dict = None,\n proxy: str = ''\n ):\n request_body = self.__request_body(\n ...
[ { "docid": "c002e9f4a2cbc4b0f05a0ca421db354a", "score": "0.60619205", "text": "def graphql(url, query, session, variables):\n return session.post(\n url,\n data={\n \"query\": query,\n \"variables\": json.dumps(variables),\n },\n ).json()", "title": "...
5d3691362c706b7919a98494168f5373
Test case for api_v1_games_game_id_put
[ { "docid": "7a000586ecc17af94dae1c8fc9058699", "score": "0.87574315", "text": "def test_api_v1_games_game_id_put(self):\n game = Game()\n response = self.client.open('/api/v1/games/{game_id}'.format(game_id='game_id_example'),\n method='PUT',\n ...
[ { "docid": "6fc6582b4af8cbd983f3b5585752b17b", "score": "0.7226943", "text": "def test_teams_id_put(self):\n pass", "title": "" }, { "docid": "b1b184fe62f4c5dd12b0d1812187e229", "score": "0.71786773", "text": "def test_api_v1_games_game_id_get(self):\n response = self.c...
7a51eecc211c4c3bde919d0bc29977a2
Returns values for parameters of disease model sampled from prior distributions based off Radev et al. Note that we discard delta = number of days for transmission to have full effect from parameters, because the effect is negligible in long term data.
[ { "docid": "c5323bb9f922c86f73ee4dcf2ed90dd6", "score": "0.5451721", "text": "def prior(T: int, num_interventions: int = 15):\n alpha_f = (0.7**2) * ((1-0.7)/(0.17**2) - (1-0.7))\n beta_f = alpha_f * (1/0.7 - 1)\n \n # Bounds for transmission rates\n value_bounds_low = [1.] + [0.05] * num...
[ { "docid": "b496ffd475ff0661029e75c618a6b249", "score": "0.60731524", "text": "def __find_d_parameter(self, D):\n\n # set the starting number of differences\n d = 0\n differentiated_data = self.series_train_data.copy()\n\n # if model has a seasonal component then apply season...
a0ef83a662c764c3ae8780a45abc7b04
Returns an OAuth2 access token for a service account. If 'service_account_key' is specified, will use it to generate access token for corresponding .gserviceaccount.com account. Otherwise will invoke app_identity.get_access_token(...) to use app's .gserviceaccount.com account. If 'act_as' is specified, will return an a...
[ { "docid": "213a9e2f9ae8d5f5c15993037ac6cfb4", "score": "0.717205", "text": "def get_access_token_async(\n scopes, service_account_key=None, act_as=None, min_lifetime_sec=5*60):\n # Limit min_lifetime_sec, since requesting very long-lived tokens reduces\n # efficiency of the cache (we need to const...
[ { "docid": "c796434c994a21c46d076506c4394c99", "score": "0.64293814", "text": "def get_access_token():\n\n scopes = [\n 'https://www.googleapis.com/auth/cloud-platform', 'email', 'profile'\n ]\n\n credentials, _ = default()\n credentials = auth.delegated_credentials(credentials, scope...
47938fdbbb52b9e9ed3ce0fc6a2e1c14
Enable Confidential Nodes for this cluster.
[ { "docid": "8b7f9b5071a1577ec845863ad1fdb178", "score": "0.0", "text": "def enabled(self) -> bool:\n return pulumi.get(self, \"enabled\")", "title": "" } ]
[ { "docid": "6af95cf4b3c6da616e84c68dfa6b027f", "score": "0.5698958", "text": "def enable(node):\n node.ensure_valid()\n reconfigure(node)\n node.autoregister()\n sys.exit(node.spawnctl('enable'))", "title": "" }, { "docid": "02f15ba10f094e441c684e379a07d35f", "score": "0.5350...
272fa3322cb2b944b3932f297b6c9695
Test we can handle a basic task execute
[ { "docid": "dc626c2fdb080e2c2066de99eba4bad3", "score": "0.7398577", "text": "def test_task_initial(self):\n parser = build_hivemind_parser()\n additional_args = [\n 'create_node',\n 'FooBarTask',\n '-c',\n 'hivemind_tasks.TaskNode'\n ]\n ...
[ { "docid": "0b1e6b183c55ea68720fda01b0477366", "score": "0.79583627", "text": "def task_test(options):\n print 'testing'", "title": "" }, { "docid": "09b9b1a565d8789da8b1fd858eb0854b", "score": "0.7589941", "text": "def test_submit_clue_task(self):\n pass", "title": "" ...
8cb9bcdcfb0648969fb60e199dcb314d
Gets Regon API status code and status message Returns tuple
[ { "docid": "c3ac2c2e439e5f41d25cf2325878991b", "score": "0.5941965", "text": "def get_service_status(self):\n response = self.service.GetValue(pNazwaParametru=\"StatusUslugi\")\n ret = response, t(\"ServiceStatus\", response)\n logger.debug(ret)\n return ret", "title": ""...
[ { "docid": "5c447ec9bd7647138977e65b63224df6", "score": "0.7345084", "text": "def get_status():\n return give_message(\"get_status\", {})", "title": "" }, { "docid": "3ef01c7c66b66e558e3a2927a533b094", "score": "0.727843", "text": "def status():\n return ({\"status\": \"OK\"})"...
55bbb3282cc129d6b333433c05f2ef4d
Initialize an instance of the MultinomialPosterior class.
[ { "docid": "a50fa2719f6abad531e78fa0f89c800e", "score": "0.0", "text": "def __init__(self, alphabet):\n self.alphabet = [str(i) for i in alphabet]\n self._distribution_parameter_names = \\\n [str('p_{}'.format(i)) for i in self.alphabet]\n\n self._distribution_parameter_s...
[ { "docid": "9d43f3dfba63014cb0fd268ef1abe2c6", "score": "0.63679075", "text": "def __init__(self, bandits: List[Bandit]):\n self.bandits = bandits\n # mu_pri and var_pri are hypermaterers for prior distribution\n self.mu_pri = np.zeros(len(self.bandits)) # 5 for each\n self.v...
da3b9c3395ab2a3ec3f17f245f69b02f
Test DefenderDefender include_option is a boolean, when False only required params are included, when True both required and optional params are included
[ { "docid": "175125a75b1118352d5b9d46c4c57fef", "score": "0.47491163", "text": "def make_instance(self, include_optional):\n # model = openapi_client.models.defender_defender.DefenderDefender() # noqa: E501\n if include_optional :\n return DefenderDefender(\n cate...
[ { "docid": "a1354cd9d9f53450d8f17d2703c20bc6", "score": "0.5683065", "text": "def include_optional(self, include_optional):\n\n self._include_optional = include_optional", "title": "" }, { "docid": "e465f0884e4fcd99f1402e3c2871b177", "score": "0.5449698", "text": "def _addMand...
802e3d7d8c053c8fe055125220b1786a
Get the parameters of the posterior over the topics, also referred to as "the topics". Returns numpy.ndarray Parameters of the posterior probability over topics.
[ { "docid": "eba56bd03dd280cf9da315a7d9576a2b", "score": "0.0", "text": "def get_lambda(self):\n return self.eta + self.sstats", "title": "" } ]
[ { "docid": "b65b17dc191c50755b93d7e438d3b499", "score": "0.67156535", "text": "def posterior_parameters(self, suff_stats):\n # extract sufficient statistics\n n, mu, ssq = suff_stats[0:3]\n\n # update kappa and nu\n kappaN = self.kappa0 + n\n nuN = self.nu0 + n\n\n ...
2c60c6e92708fac14140e0a6fef77bbe
Gas FVF calculated in other units
[ { "docid": "287d5c1de9370cafcceac1555b27f4a9", "score": "0.7354404", "text": "def gas_fvf2(unit='unit1', z=0.8, temp=186, pressure=2000):\n if unit == 'unit1':\n return(0.00503676 * z * temp / pressure) \n if unit == 'unit2':\n return(0.350958 * z * temp / pressure)", "title": "" } ]
[ { "docid": "74b43d41f419db9fdc40a87b2793ccb9", "score": "0.73810804", "text": "def gas_fvf(P, T, grav):\n #P pressure, psia\n #T temperature,°F\n #grav gas specific gravity\n Tr = (T + 460) / Tc(grav)\n Pr = P / Pc(grav)\n Z = zfact(Tr, Pr)\n return 0.0283 *...
4135b2da3e6d74d23591ea7edced30cf
\ returns the gravityScore as an integer from this node
[ { "docid": "1056d67a461f21b4a8dbe7c4856bd6b1", "score": "0.778533", "text": "def get_score(self, node):\r\n return self.get_node_gravity_score(node) or 0", "title": "" } ]
[ { "docid": "636be2e9557c4e6f80f0662453d13234", "score": "0.77913153", "text": "def getScore(self, node):\n return self.getGravityScoreFromNode(node) or 0", "title": "" }, { "docid": "a6224c4bfafa946e2eea6a7dc93c2972", "score": "0.775516", "text": "def get_score(self, node):\n ...
6b7647cc0c2eecff9d84e8a27d2dbf91
Test the log_config_updated event.
[ { "docid": "2d763b5fd3eb27d366ddf189d0497646", "score": "0.7828317", "text": "async def test_log_config_updated(driver):\n # Modify current log config in an update and assert that it changed\n assert driver.log_config.level != LogLevel.SILLY\n log_config = driver.log_config.to_dict()\n log_c...
[ { "docid": "5b7cbefe3a8ddd524299235e84151231", "score": "0.71186805", "text": "def _on_config_changed(self, _):\n # TODO\n # Set debug logging and restart services\n pass", "title": "" }, { "docid": "e5ad8a1f2e6d7b1bc8e23a42e09f7ce3", "score": "0.67582893", "text...
de106e8dacf765b6f9e7044c768bb008
Retorna a matriz A concatenada da B como em [ A ] [ B ] O numero de colunas em ambas matrizes deve ser o mesmo.
[ { "docid": "4ca1bca658aae9a0748fae236b830524", "score": "0.6976433", "text": "def concat(self, other):\n\n if isinstance(other, Vetor):\n other = type(self)([other])\n\n m, n = self.m, self.n\n om, on = other.m, other.n\n\n assert n == on, \"O numero de colunas das...
[ { "docid": "2548b7bb8a093e50673889355a5d2ba5", "score": "0.67496264", "text": "def matrixes_add(a, b):\r\n assert len(a) == len(b) and len(a[0]) == len(b[0])\r\n \r\n c = []\r\n \r\n for i in range(len(a)):\r\n c.append([])\r\n for j in range(len(a[0])):\r\n c[i]....
767623d589babdd9fd09b815f28477a9
Generate jsonl data for object detection or instance segmentation
[ { "docid": "6581e9f6b04a6adab7723595de73898e", "score": "0.6267898", "text": "def convert(self):\n json_line_sample = {\n \"image_url\": self.base_url,\n \"image_details\": {\"format\": None, \"width\": None, \"height\": None},\n \"label\": [],\n }\n\n ...
[ { "docid": "b4a9e52d334e1fd4871151b0110743ee", "score": "0.64919776", "text": "def field_to_dict(image_dir,gt_dir):\n from shapely.geometry import Polygon\n\n dataset_dicts=[]\n image_id=0\n for image_file in glob.glob(os.path.join(image_dir, \"*.jpg\")):\n suffix=\".jpg\"\n as...
83d61973588145278732e26cb54762d4
Return environment name fixture.
[ { "docid": "d81b0095fef1ad5649a1d50fc3733288", "score": "0.0", "text": "def expected_common_name():\n return \"certbot-runner-test.presidio.pxsys.net\"", "title": "" } ]
[ { "docid": "46c8af039122b93997bdc21543e6fa0a", "score": "0.7394099", "text": "def get_environment_name(self):\n name = osp.basename(self._prefix)\n\n if not (name and self.api.environment_exists(name=name)):\n name = self._prefix\n\n return name", "title": "" }, {...
e4979486f795e0cf241b484d1c49873d
Takes a binary file and converts it into a hexencoded string, in the format used by PostreSQL.
[ { "docid": "0772bbd7961c0f3d29c70ce5fa85028e", "score": "0.6617502", "text": "def encode_hex(f):\n output = \"\\\\x\"\n while (byte := f.read(1)) :\n hex_byte = hex(ord(byte))[2:]\n if len(hex_byte) % 2 == 1:\n hex_byte = \"0\" + hex_byte\n output += hex_byte\n r...
[ { "docid": "783eafa7858619d192940238eee0992f", "score": "0.679857", "text": "def filename_to_hex(filename):\r\n # grab the last (up to) two path components\r\n names = filename.rsplit(os.path.sep, 2)[-2:]\r\n errmsg = \"Invalid object filename: %s\" % filename\r\n assert len(names) == 2, err...
f17a1e40c277e482307136c58e241695
Clicks last 30 days button in the calendar
[ { "docid": "9681229c12c4c20959536ef97139a864", "score": "0.8381066", "text": "def click_last_30days_button(self):\n return self", "title": "" } ]
[ { "docid": "7b70502d5997aeb3947fa67f0bdb1ff4", "score": "0.7712211", "text": "def click_last_30days_button(self):\n self._wait.until(ec.element_to_be_clickable(self._last_30days_button)).click()\n self._wait.until(ec.visibility_of_element_located(self._clear_all_filters_button))", "tit...
f473ac7bff7ce367c01061c42a13555b
Reads a json file passed in as a parameter, fills in defaults where appropriate, then returns a standard dictionary structure that can be used further to run various operations on EMR clusters, like launch the cluster, add steps to it, etc.
[ { "docid": "bb1720fbae26cc2b732e5dcf3354dcbe", "score": "0.57953733", "text": "def get_emr_cluster_settings(user_inputs: dict, config_file: str, metadata_file: str, role: str, cluster_name: str):\n\n # Read emr config file\n with open(config_file, 'r') as emr_conf_file:\n emr_config = json....
[ { "docid": "ece144246f5fe9c50c8a6b8b202701b1", "score": "0.61768204", "text": "def read_data(file_path: str = None) -> dict:\n if file_path is None:\n return {}\n\n with open(file_path, \"r+\", encoding=\"utf-8\") as json_file:\n req_data = json.load(json_file)\n return req_da...
66b42be79b45a97d6ef9deacbb25a8f1
Test if the constraint is b >= 0 or [a, b] >= 0 with b < 0.
[ { "docid": "8370bd94fed33d3cd1bf87b2f85e9fc8", "score": "0.0", "text": "def elina_lincons0_is_unsat(lincons):\n\n result = None\n try:\n elina_lincons0_is_unsat_c = elina_auxiliary_api.elina_lincons0_is_unsat\n elina_lincons0_is_unsat_c.restype = c_bool\n elina_lincons0_is_uns...
[ { "docid": "3eab992995f27e55f8bee358da6fb0b5", "score": "0.6964691", "text": "def isFeasible(self,b):\n for i in b.flatten():\n if i<0.:\n return False\n return True", "title": "" }, { "docid": "cee142fa01d544489ce059baa5f9a0f7", "score": "0.676206...
686553203bc1a24a8b272cf752b900f7
loads .pts file. returns distance limit and points.
[ { "docid": "c7a70498a5e5d3bcfa2f60215b415ddb", "score": "0.6102229", "text": "def load_instance(filename):\n with open(filename, \"r\") as instance_file:\n lines = iter(instance_file)\n distance = float(next(lines))\n points = [Point([float(f) for f in l.split(\",\")]) for l in l...
[ { "docid": "bfb7c0c405a7229afb374c62a2b4ea63", "score": "0.71540225", "text": "def test_load_pts_file(self):\n\t\tpath = \"sample_point_cloud.pts\"\n\t\tpoints = load(path)\n\t\texpected_y_coord = 302.270092\n\t\tself.assertEqual(expected_y_coord, points[3][1])", "title": "" }, { "docid": "0...
0d84a0e8375d99b0127d85b2f42b86fd
Retrieves CanonicalIdentity objects by associated service identities.
[ { "docid": "b2db611b7e36ead979ba8e96b70c05b4", "score": "0.46572497", "text": "def filter_by_identity(self,identity):\n return self.filter(pk__in=[claim.pk for claim in IdentityClaim.objects.filter(identity=identity)])", "title": "" } ]
[ { "docid": "4b58deec283ab80627d8781d4937d878", "score": "0.5722831", "text": "def identities(self):\n return self.properties.get('identities', ClientValueCollection(ObjectIdentity))", "title": "" }, { "docid": "f870637eef42b5d88052bd186720dee0", "score": "0.5511099", "text": "...
e54da0d186f71a917c51092434bf9fb1
Attempts to log the user in
[ { "docid": "ce79c4cd3598cd71cbd6ab30d9ef18d4", "score": "0.6492791", "text": "def login():\r\n\r\n from werkzeug.security import check_password_hash\r\n\r\n username = request.form['user']\r\n password = request.form['password']\r\n\r\n if not is_valid_username(username):\r\n return r...
[ { "docid": "52c0e168e036eb9e06587f81ac96ad7e", "score": "0.750958", "text": "def log_in(self):\n\n value = db.loginUser(self.user.get(), self.password.get())\n if value == \"yes\":\n self.password = \"\"\n self.passwordStorageWindow()\n elif value == \"no\":\n ...
65a76de0264cae1f25c9b706ab55b9b7
Secondprice auction on each good; see which is most preferred by the seller.
[ { "docid": "679cc35bd5a768765131cf59576d2f76", "score": "0.82362276", "text": "def best_second_price( self, iteration_count, seller, bids ):\n\n seller_planet = self.galaxy.planets[seller.planet]\n \n preferred_bids = []\n for g, order_book in bids.items():\n order...
[ { "docid": "cba748335e08191669fa02af05ed040d", "score": "0.6125903", "text": "def get_best_bid_ask(self, ticker):\n if ticker in self.tickers:\n bid = self.tickers[ticker][\"bid\"]\n ask = self.tickers[ticker][\"ask\"]\n return bid, ask\n else:\n ...
1f21579c3c9ae1936c4d09e8e8556a58
Implements the forward pass of the Descriptor Decoder RNN.
[ { "docid": "befccd849a6dcdada4906fb0e0147b8e", "score": "0.0", "text": "def forward(self, token_idx, hidden=None, image_embeddings=None):\n batch_size = token_idx.size(0)\n # init the hidden state (and cell state) with\n # the latent representation of the input image\n if ima...
[ { "docid": "d6c68107782e7d4e687103268efb5af0", "score": "0.6384827", "text": "def forward_pass(data_original, exp, model_name, in_channel=1, inputFeatDim=36): \n data_feat_unpack = data_original\n len_in = data_feat_unpack.shape[0]\n f=data_feat_unpack.shape[0]//800\n trim=800*f \n\n untrim = num...
8f8906b4c60ff3d6915cc0b9526a2385
Set the development mode. Defaults to True.
[ { "docid": "dd5cab1426ef4e29d809c13c1aea4e4e", "score": "0.74898833", "text": "def enable_development_mode(self, is_enabled=True):\n self.is_enabled = is_enabled", "title": "" } ]
[ { "docid": "8973c1a2bc819beee9cfd35fa79ab348", "score": "0.7660416", "text": "def isDebugMode(self):\n return DevelopmentMode", "title": "" }, { "docid": "1d28ff785bcb0834a516b72372bbb1c1", "score": "0.70030004", "text": "def dev():\n env.COMPOSE_FILE = 'dev.yml'\n env.D...
edc8851b312ebabd948303a98b07a44c
return the number of seats associated with the b2b order
[ { "docid": "495d9db558a6ed71174bcd85261792d1", "score": "0.5926627", "text": "def get_quantity(self, instance):\n return instance.num_seats", "title": "" } ]
[ { "docid": "90672be88a1a022057578c01e489cde7", "score": "0.61112374", "text": "def buy_count(trades: pandas.DataFrame) -> int:\n return len(buys(trades))", "title": "" }, { "docid": "0ba6e8a504d9701cb55d20b739dde904", "score": "0.5931142", "text": "def number_of_reserved_seats(sel...
710e5beef62a74d3ef797a5ca570b756
Select devices that match at least one of the given selectors. >>> or_(tag('sports'), tag('business'))
[ { "docid": "09a3da9328549ac3e5a84190635b3304", "score": "0.5255297", "text": "def or_(*children):\n return {'or': [child for child in children]}", "title": "" } ]
[ { "docid": "ea0aa4b6243b9d20bff21f4b0886de7d", "score": "0.60431856", "text": "def _match_or(self):\n for search_op in self.args['search_key']:\n if search_op.match(self.ctx):\n return True\n return False", "title": "" }, { "docid": "27efed65212ce90a50...
1da3dcd89d143eed7218501446902874
return function dictionary with all the feature extractions functions
[ { "docid": "b7d556094034007c5d85ba5a1e4b9af1", "score": "0.6962744", "text": "def get_functions_dictionary():\n return {\n 'clustering_coefficient': extract_clustering_coefficient,\n 'degree': extract_degree_centrality,\n 'betweenness': extract_betweenness_centrality,\n 'c...
[ { "docid": "be9dd55a76cf5fe60f0825b4368f458b", "score": "0.6833436", "text": "def get_feature_functions(token, ref, feature_id_list):\n pass", "title": "" }, { "docid": "e7f8f9288d40667f609375e7a9d489d6", "score": "0.66487414", "text": "def derive_features(self):\n dict_fea...
06c2f2fca317803d4318970d88c6b90d
Adds a word into the data structure.
[ { "docid": "a3614399f8b6535aa9e6ebcd7fed7e12", "score": "0.7730911", "text": "def addWord(self, word: str) -> None:\n curr_node = self.root\n for i, c in enumerate(word):\n if not curr_node.get(c):\n curr_node[c] = {}\n if i == len(word) - 1:\n ...
[ { "docid": "a8dd03c84492a17cf9569ad442eaa85e", "score": "0.87670594", "text": "def add_word(self, word):\n self.words.append(word)", "title": "" }, { "docid": "ea47150b3ebb2169b73059650a7b839d", "score": "0.8736371", "text": "def addWord(self, word: str):\n self.WordDic...
3f21ec6ebc308a88c3d49a9b601aeef6
Given a date trajectory, find the corresponding day name.
[ { "docid": "3b933e2f045a14e59fa151c1745bce25", "score": "0.52409637", "text": "def day_add(string,t1):\n \n d = (day_num(string) + t1) % 7\n return day_name(d)", "title": "" } ]
[ { "docid": "8022b2787df79af9c4e2fb29a39d59ec", "score": "0.69907445", "text": "def getWeekdayName(day):\n pass", "title": "" }, { "docid": "7b8c2d2a979a57c728ba77beaac18668", "score": "0.6698994", "text": "def _get_dayname(day):\n try:\n dt = datetime.datetime.strptime(day...
c18c8abddaa3a536879cce89b7b799cf
This function creates a GTK menu.
[ { "docid": "456a1c4c5ef19b9e4b2f42f382c7a66a", "score": "0.7486232", "text": "def create_menu(indi,*args):\n \n menu = gtk.Menu()\n \n menu_item = gtk.MenuItem(\"Refresh\")\n menu_item.connect(\"activate\",create_menu,ind)\n menu.append(menu_item)\n menu_item.show()\n \n # IPv4 public\n...
[ { "docid": "a395384f896b349094e16ef48aad532f", "score": "0.78669643", "text": "def create_menu(self):\n self.menu = gtk.Menu()\n\n self.women_menu_item = gtk.MenuItem(self.women_toilet.to_string())\n self.menu.append(self.women_menu_item)\n self.women_menu_item.show()\n\n ...
42e947d61d10964bcd61de12b6bbfd96
Constructs a new decodable object from input features. Input can be just a feature matrix or a tuple of a feature matrix and an ivector or a tuple of a feature matrix and an online ivector matrix.
[ { "docid": "5e3a72a21bf44b71b60a7bb76cdb0140", "score": "0.7723934", "text": "def _make_decodable(self, features):\n ivector, online_ivectors = None, None\n if isinstance(features, tuple):\n features, ivector_features = features\n if isinstance(ivector_features, _kald...
[ { "docid": "1bc67112f8b6351b0c34d8ed961c31cf", "score": "0.61783695", "text": "def _make_decodable(self, features):\n if features.num_rows == 0:\n raise ValueError(\"Empty feature matrix.\")\n\n nnet_computer = _nnet3.DecodableNnetSimple(\n self.decodable_opts, self.m...
ac488bbec4b8ead2299cc50e51f4eb31
Scrape the contents of a set of pdf documents and assemble the data into a global dataframe.
[ { "docid": "819dc3887982018261c8a924a3707097", "score": "0.62664145", "text": "def scrape(self):\n\n\t\tself.getFilesFromPath()\n\t\tfilename = str(self.filenames[1])\n\t\tdocument = self.openFileFromPath(filename)\n\t\tfields = self.resolveFields(document)\n\t\tdf = self.getColumnsFromFields(fields)\n\...
[ { "docid": "d9bfb74d7492bb83d4c22aff7ddcc40e", "score": "0.77720034", "text": "def build_pdf_df(file_name): \n fp = open(file_name, 'rb')\n parser = PDFParser(fp)\n document = PDFDocument(parser)\n print('\\n\\n\\tProcessing file ', file_name)\n annot_dict, content_dict, data_d...
bff2986f680be72654afa106971ff567
The instance state to which you want to attach the lifecycle hook.
[ { "docid": "e583747e42afc4f7501ae9250badbc1e", "score": "0.0", "text": "def lifecycle_transition(self) -> Optional[str]:\n return pulumi.get(self, \"lifecycle_transition\")", "title": "" } ]
[ { "docid": "b9f1055d0e51fee5201378b8a0ed8005", "score": "0.71542156", "text": "def trunkLifecycleState():", "title": "" }, { "docid": "b9f1055d0e51fee5201378b8a0ed8005", "score": "0.71542156", "text": "def trunkLifecycleState():", "title": "" }, { "docid": "4aea713b456d63...
76624e4fcdefa2c604d5dd412474c225
It should raise an error if try to aspirate more than possible.
[ { "docid": "0ec4a8e347e69392467b786dfac1f2e7", "score": "0.0", "text": "def test_aspirate_too_much(subject: AbstractInstrument,\n labware: AbstractLabware) -> None:\n subject.home()\n subject.pick_up_tip(well=labware.get_wells()[0], tip_length=1, presses=None,\n ...
[ { "docid": "ce1a49b2db26c5a0618505fa4a5238eb", "score": "0.6180764", "text": "def fail_D209():", "title": "" }, { "docid": "4eb6b8851688d9643ee3689a24c96196", "score": "0.6035638", "text": "def mayRaiseExceptionOperation(self):", "title": "" }, { "docid": "4eb6b8851688d96...
c6296565db19fa8b486e93b3d28f479d
corrects plural noun grammatical errors
[ { "docid": "73f957c2531f17306684bf2e66b6f408", "score": "0.5533731", "text": "def plural_to_singular_edit(canonical, resources=None):\n\n for resource in resources:\n rname = resource.name\n if resource.resource_type != SINGLETON:\n continue\n\n canonical = canonical.r...
[ { "docid": "ce2d6f46ea07360a0e00d535f6b417f8", "score": "0.67823726", "text": "def plural_name(noun, language='en'):\n for applyRule in rules(language):\n result = applyRule(noun)\n if result:\n return result", "title": "" }, { "docid": "8a5c15a505e60d24280ebbde76...
bbbcfca8d52218b6ff75189d3d90b947
Add two infinite streams (elementwise).
[ { "docid": "012fa013abe99eec963e3ecb6563715b", "score": "0.61956424", "text": "def adds(s1, s2):\n return map(add, s1, s2)", "title": "" } ]
[ { "docid": "f98753baa0059155ab60bef1783dfa0e", "score": "0.6734333", "text": "def __add__(self,otherstream):\r\n overlapdates = self.overlap([otherstream])\r\n stream1returns = self.datereturns(overlapdates)\r\n stream2returns = otherstream.datereturns(overlapdates)\r\n retur...
17eb931e7fb56669dd79d009ee54d0ed
Perform a BFGS update.
[ { "docid": "e7f1390146b0007321e5dbb5a5decec4", "score": "0.6545723", "text": "def _bfgs_update(value_and_gradients_function,\n current_position,\n current_objective,\n current_gradient,\n search_direction,\n current_inverse_...
[ { "docid": "7863bb3e6ecd9e84edde23b0f1d1cad2", "score": "0.643692", "text": "def update(self):\n status = self.gso.GRBupdatemodel(self.model_c)\n if status != 0:\n raise Exception(\"Error updating model: {}\".format(status))", "title": "" }, { "docid": "2097834a5b5da57492bb...
dfb458409f0030dfa26c64cb2c04218d
Requesting a nonexisting child branch results in a KeyError.
[ { "docid": "2eac68145caff9195c4dadd1603c010f", "score": "0.7184823", "text": "def test_keyerror_for_nonexisting_branch(root):\n with pytest.raises(KeyError):\n root['nonexistant']", "title": "" } ]
[ { "docid": "b724bd5b7e5b671ca87f89c2c92ffa49", "score": "0.68065286", "text": "def test_branch_load_nonexisting(root):\n with pytest.raises(KeyError):\n root['people']['zenu']", "title": "" }, { "docid": "7cc1465b4a31462fd2dce25048790396", "score": "0.6238675", "text": "def...
3529c3e38866a2a5eaf4be4f5ed19e0d
Make alias for computed column, which results in ``fname_col_wname_by_suffix``. If any of these elements is empty or ``None``, this empty element would be ignored in alias.
[ { "docid": "966dea93a2d21da8f99243ac34b668b7", "score": "0.75428605", "text": "def _make_alias(self, fname, col, wname, suffix):\n\n alias = DELIMITER.join(\n [item for item in [fname, col, wname, 'by', suffix] if len(item) > 0]\n )\n\n return alias", "title":...
[ { "docid": "936754c4d40d08c509a015180f6fac45", "score": "0.58686614", "text": "def add_alias(column_name, table_alias):\n\tcolumn_name = column_name.replace('\"', '')\n\tif '.' in column_name:\n\t\ttable_alias, separator, column_name = column_name.partition('.')\n\tcolumn_name = f'{q(table_alias)}.{q(co...
74839b5ce2276c213bf01e0f8966499f
If True packets also contain conntrack information Defaults to false.
[ { "docid": "e36f5089f37010d0dd7374ad0089fda4", "score": "0.70113397", "text": "def conntrack(self) -> bool:\n return self._get_flag(lib.NFQA_CFG_F_CONNTRACK)", "title": "" } ]
[ { "docid": "7be3401a587cb213f29122056c8d5d92", "score": "0.6801527", "text": "def packets_may_arrive(self):\n return True", "title": "" }, { "docid": "e26d7fbe12f439d05a8ac29838c574dd", "score": "0.5779524", "text": "def read_packet(self) -> bool:\n return True", "t...
38d7c5c357227a74bb32d86d32782579
Create an array of TECHNICIAN Objects from a row in the dataframe that represent the READABLECSV created by the key.py file
[ { "docid": "42b18881adbb3d82091aaaff726c629f", "score": "0.0", "text": "def create_technicians(row, propertyToHeader_technician, schema):\n charsplit = '/'\n skills = []\n try:\n for skill in row[propertyToHeader_technician['technician']['skills']].split(charsplit):\n ...
[ { "docid": "6af07d40462c1251df72594e5a040efa", "score": "0.580087", "text": "def getDataSet(self): \n\t\twith open(self.filename, 'rb') as f:\n\t\t\treader = unicodecsv.DictReader(f)\n\t\t\tdataSet = list(reader)\n\t\t\treturn dataSet", "title": "" }, { "docid": "4371f47f9c31acf94e3b532d850b...
a174bdfcc14d96ef67c152526b233a01
Generates token to prevent CSRF attacks, used in forms that submit using POST
[ { "docid": "1a46cea94aead35ce22a57c06ac8e387", "score": "0.7956658", "text": "def generate_csrf_token():\n if \"_csrf_token\" not in login_session:\n login_session[\"_csrf_token\"] = hashlib.sha256(\n os.urandom(1024)).hexdigest()\n return login_session[\"_csrf_token\"]", "ti...
[ { "docid": "f95065617a3e57d02dc86ca527ff6875", "score": "0.82124776", "text": "def generate_form_token():\n if '_form_token' not in session:\n form_token = ''.join(\n [random.choice(ascii_letters+digits) for i in range(32)])\n session['_form_token'] = form_token\n return s...
b8203ddb3eeecbd313b08f6eed9a130d
Creates a new deny list or allow list entry for a scanner
[ { "docid": "9fc33b5c8e27c4139bc02d90e5d811c2", "score": "0.63732636", "text": "def add_new_deny_or_allow_list_entry(self, channel_type_id, channel_type_name, channel_vulnerability_id, channel_vulnerability_name):\n params = {}\n if channel_type_id:\n params['channelTypeId'] = ch...
[ { "docid": "6c4223725ccd82eef2b30dfde8cbb03a", "score": "0.5305605", "text": "def create(self, trans, tool_id, **kwd):\n if tool_id not in trans.app.config.sanitize_allowlist:\n trans.app.config.sanitize_allowlist.append(tool_id)\n self._save_allowlist(trans)\n return...
1834ad470086af37862763dbdc8e5c80
Invoke tcServer's instance creation script.
[ { "docid": "bb2172206a4a0e837dc0f672cdeb3097", "score": "0.8158045", "text": "def create_instance(tcserver_dir, instance_name=\"instance1\"):\n print(\"Creating an instance of tcServer in %s\" % tcserver_dir)\n\n pushdir(tcserver_dir)\n subprocess.call([\"./tcruntime-instance.sh\", \"create\", ...
[ { "docid": "ea2e8f58873e76d4aa31f973dd7f3219", "score": "0.7507731", "text": "def start_instance(tcserver_dir, instance_name=\"instance1\"):\n print(\"Starting up a tcServer instance...\")\n\n pushdir(tcserver_dir)\n subprocess.call([\"./tcruntime-ctl.sh\", instance_name, \"start\"])\n popdir()"...
c889c77138fb01685639d1498b34157e
Parse cmdline args. It expects 's '. Otherwise it'll exit out with a help message.
[ { "docid": "bb25518ae1d596a3846b13cca6abd86d", "score": "0.68446225", "text": "def parse_command_line(self, argv: list):\n function_name = inspect.currentframe().f_code.co_name\n message = f'In {function_name}(), ARGV: {argv}'\n if self.debug > 1:\n print(message)\n\n ...
[ { "docid": "4fe6828e709c35c7bdf68f69351e88c1", "score": "0.6996857", "text": "def parse_args():\n description = \"\"\"This Script creates a list of n random cluster coordinates and\n the the indexes of surrounding coordinates with distances 1-3 from a HiSeq 4000 or HiSeqX s.locs file.\n \"\"\"\...
b029b2f122b634fee3ae831f92d95c34
Convert UTM to lat, lon (WGS84) Defaults to Zone 18N
[ { "docid": "c2f5da1e73c91853b19152f0818fdc87", "score": "0.67119277", "text": "def UTM2LatLon(easting, northing, initepsg='epsg:26918'):\n outProj = Proj(init='epsg:4326')\n inProj = Proj(init=initepsg)\n lon,lat = transform(inProj,outProj,easting,northing)\n return lon, lat", "title": "...
[ { "docid": "9f3380bfd5e2484b491601d5e9098437", "score": "0.73258734", "text": "def LatLon2UTM(lat,lon,init_epsg='epsg:26918'):\n inProj = Proj(init='epsg:4326')\n outProj = Proj(init=init_epsg)\n outx,outy = transform(inProj,outProj,lon,lat)\n return outx, outy", "title": "" }, { ...
8375bf56525d3b5d735606cfc348ae45
Extracts the diagram ID from a URI >>> tests = [ \
[ { "docid": "b23375993c317a3c20aea36d235d3a02", "score": "0.607165", "text": "def extractIdFromURI(uri):\n for p in _patterns:\n g = p.search( uri )\n try: id = g.group(1)\n except: id = None\n if (id is not None):\n return id\n return None", "title": "...
[ { "docid": "9a04ac5c1cb8df59ee05816432fd625a", "score": "0.6347979", "text": "def uri_id(url):\n ident = urlparse(url)\n uid = base64.urlsafe_b64encode(ident.path.lstrip('/'))\n return uid.rstrip('=')", "title": "" }, { "docid": "59a63ec55b8d9fadcafea01195d170d5", "score": "0.63...
7020ebfce2286932ab8964d2ac60aaec
Method to change the name of the variable
[ { "docid": "f90bcba57bf918eb66035999bdf78192", "score": "0.7124402", "text": "def change_name(self, new_name):\n self.name = new_name", "title": "" } ]
[ { "docid": "3cc5c1c3aca821275ae6e61806040383", "score": "0.7880457", "text": "def __set_name__(self, owner: Prefixable, name: str):\n self.name = name\n self.var_name = f\"{owner.prefix.upper()}_{name.upper()}\"", "title": "" }, { "docid": "8f8a26d1f0afc5c5a4a2e734b38b78d1", ...
e95f56338dde5e3568ef3f643a17ada2
Jv = jacobev(q) is the spatial velocity Jacobian, at joint configuration q, which relates the velocity in the base frame to the velocity in the endeffector frame. Jv = jacobev() as above except uses the stored q value of the robot object.
[ { "docid": "ec2bb05532592538a77ff47d902b411f", "score": "0.71177065", "text": "def jacobev(\n self, q=None, from_link=None, to_link=None,\n offset=None, T=None):\n\n if from_link is None:\n from_link = self.base_link\n\n if to_link is None:\n to_...
[ { "docid": "b39bf65c589be61960371809848e61e1", "score": "0.7463", "text": "def jacob0v(self, q=None):\n\n r = (self.base.inv() * self.fkine(q)).R\n\n Jv = np.zeros((6, 6))\n Jv[:3, :3] = r\n Jv[3:, 3:] = r\n\n return Jv", "title": "" }, { "docid": "8cd0d839...
319a93db64c358f3b8f4d59091a0bbb1
for nurbs curves only. get the parameter length.
[ { "docid": "decccc0b33a2317b0a3c73a3bdb6f94c", "score": "0.72856337", "text": "def get_param_length(curve_name):\n shape_fn = object_utils.get_shape_fn(curve_name)[0]\n return shape_fn.findParamFromLength(shape_fn.length())", "title": "" } ]
[ { "docid": "6ecc3b99369b3877d9768b6a75ecaa74", "score": "0.7094655", "text": "def length(self) -> float:\r\n ...", "title": "" }, { "docid": "84008ccadc6e930ac45f2670648e4539", "score": "0.6656993", "text": "def num_params(self):\n return len(self.data)", "title": "...
53bf06816ad671070b6bb4e78ee2b1c2
critical_point_current_density should return astropy.units.Quantity
[ { "docid": "03693be428578f65e1627168749e09f0", "score": "0.84548855", "text": "def test_critical_point_current_density(self):\n self.assertIsInstance(self.t.critical_point_current_density(), units.Quantity)", "title": "" } ]
[ { "docid": "b2586560530a8ba0c8f4e63a1980e072", "score": "0.8172111", "text": "def test_critical_point_current_density(self):\n self.assertEqual(self.t.critical_point_current_density().unit, units.Unit(\"A cm-2\"))", "title": "" }, { "docid": "c6e08590b2b80ce3db30145faa3fff51", "sc...
24ef81b3baf8549e0629e2880eb810c5
Parse `dynamic_args` and generate valid `qsrs_for`. It parses the `dynamic_args` to see if the user has specified `qsrs_for` and then validates them, or uses default `qsrs_for` generation if user has not specified anything.
[ { "docid": "fe6199ab3ec603391f7080e8ea5691b0", "score": "0.5931462", "text": "def _process_qsrs_for(self, objects_names_of_world_state, dynamic_args, **kwargs):\n if isinstance(objects_names_of_world_state[0], str):\n try:\n return self.__check_qsrs_for_data_exist_at_wor...
[ { "docid": "7ec957fd86e117f5729ed622076bfd85", "score": "0.6195913", "text": "def EvaluateDynamicPipelineOptions(dynamic_options):\n filledOptions = []\n for optionDescriptor in dynamic_options:\n fillType = optionDescriptor['type']\n optionName = optionDescriptor['name']\n valueFormat = opti...
8c6913812ad017e7f64cd2b898399714
Renders the form to add a tool.
[ { "docid": "c57b72713de60feb1fcde0fce5325a9d", "score": "0.6707833", "text": "def addToolForm(request, id=None):\n if request.user.is_authenticated():\n first_shed_list = Shed.objects.filter(zipcode=request.user.zipcode)\n shed_list = []\n for shed in first_shed_list:\n ...
[ { "docid": "439ba179417374cef7f5a9dddd4a5cc0", "score": "0.6686587", "text": "def display(self, tool):\n self._tools.append(tool)\n self._justDisplay(tool)", "title": "" }, { "docid": "b84d46d196222f1913aa79b6494c94a8", "score": "0.64594257", "text": "def addTool(reques...
b6338c1cc000ae18792c67b88490d6cb
factory function of mock handler
[ { "docid": "131d4224dac18dff4f7cb24dbc64339a", "score": "0.77851194", "text": "def mock_handler_function_wrapper(ret):\n def mock_handler_function(http_response, response):\n \"\"\"\n mock handler\n :param http_response:\n :param response:\n :return:\n \"\"\"...
[ { "docid": "22fdcea395e63509c0ca1f516f60a4d9", "score": "0.7107924", "text": "def test_dispatch(self):\n\n content = '<b>hi sup</b>'\n\n\n class SubHandler(handler.Handler):\n\n \"\"\" I am an example handler \"\"\"\n\n get_was_called = False\n\n def GET(self):\n\n \"\"\" I a...
886c077299e596df809ddb5260a537cb
This function call the showFram function which means whenever this function is called the edit page will be visible to the user as this function will be called by the "Edit Page" button. And secondly this function reinitalizes the edit shapes frame so everything looks realtime.
[ { "docid": "9a29ffa078e68dbbebcf6c363ba44ec2", "score": "0.69142205", "text": "def editButtomCommand(self):\n self.showFrame(self.frameEditShapes)\n self.frameEditShape()", "title": "" } ]
[ { "docid": "4bfa662221ec5604523614d4b3b8abd8", "score": "0.6618589", "text": "def frameEditShape(self):\n self.refresh_board()\n for widgets in self.frameEditShapes.winfo_children():\n widgets.destroy()\n self.canvas.unbind(\"<Button-1>\")\n self.canvas.bind('<Butt...
69b2d8b9a0a9d6030dcaa35d8a5275b9
Retrieving the continuum window Returns _ The collection of continuum points
[ { "docid": "6aa363c5771e9c175fb8e600710a5f3c", "score": "0.7036397", "text": "def getcontwindow(self) -> Optional[Tuple[List[u.Quantity], List[u.Quantity]]]:\n if not self.__checkcontpoints__():\n return None\n return [self.c1, self.c2], [self.c3, self.c4]", "title": "" } ...
[ { "docid": "87ae90f6b39e4fedf2ca05405912bbc6", "score": "0.69538367", "text": "def get_window(self):\n return np.ones(self.stop_idx - self.start_idx)", "title": "" }, { "docid": "258efb027830d85e0f513fe7360b1184", "score": "0.6198811", "text": "def window(self):\r\n cur...
ef99b902f2326d3c76911f48982a1025
Values for the dependent variable
[ { "docid": "17b3d0717db4b6d80ac1777faff4f743", "score": "0.7510663", "text": "def dependent(self):\n return self.y", "title": "" } ]
[ { "docid": "ef8a66714a96635ac01f85a3163b6f30", "score": "0.6807894", "text": "def independent_variables(self):\n return self._independent_variables", "title": "" }, { "docid": "2579622b8647521182270d7b8101874e", "score": "0.66313666", "text": "def get_variables(self) -> np.arr...
caafc7f534987283953d04b1b210fa36
Sequence mustMatch should return True when no possible mismatches
[ { "docid": "c69f2cbb842d84641d4840f3ce6849b1", "score": "0.5766759", "text": "def test_mustMatch(self):\n assert self.RNA('').mustMatch('')\n assert not self.RNA('N').mustMatch('N')\n assert not self.RNA('R').mustMatch('R')\n assert not self.RNA('N').mustMatch('r')\n a...
[ { "docid": "12dc9dea663d8ed3fbc32a8402baaaf6", "score": "0.65546477", "text": "def test_invalid_match():\r\n match1 = fr.match_input_with_pickle(linhPickleData, alexInputEncodings)\r\n match2 = fr.match_input_with_pickle(alexPickleData, linhInputEncodings)\r\n\r\n assert match1 == False\r\n ...
42fcac8dbf57218509a51c02ac3ba4e4
Given a mapping from each sample to its set of annotated terms and a target term, return the set of all samples annoated with the target term and those that are not.
[ { "docid": "1e73b5bfc995ef65b66f7856bfabb4ca", "score": "0.5485493", "text": "def term_to_samples(sample_to_terms, term_id_to_name, term):\n # If the user supplied a term ID, then map it back to a term\n # name\n if 'UBERON:' in term or 'CL:' in term or 'CVCL:' in term \\\n or 'DOID:' in...
[ { "docid": "c51be798d75d1eb7cde223be15f9ba21", "score": "0.5797579", "text": "def null_intersection(x_train, y_train, target_words, word_index):\n x_train_new, y_train_new = [], []\n\n for i, x_t in enumerate(x_train):\n intersection = len(set(x_t).intersection([word_index[word] for word in...
5e635a0f138de6481944d8bf1025acec
Wprawia stworzenie w ruch w kierunku danego pola.
[ { "docid": "0503fd08951da7b4917877d1c9a70007", "score": "0.0", "text": "def move(self, _vec):\n\n\t\t_dest = self._grid[0] + _vec[0], self._grid[1] + _vec[1], self._grid[2] + _vec[2]\n\t\tif _vec[2]: # jeśli ruszamy się w z to znaczy że wchodzimy po schodach\n\t\t\tself._map.getLayer('Fields').get(self....
[ { "docid": "303b090737f11b28a9174d4b53496fe9", "score": "0.68418884", "text": "def mezclar_bolsa(self):", "title": "" }, { "docid": "991e0245df134584bbc6b3bcd6de3c7b", "score": "0.67294735", "text": "def preberi_pot(ukazi):", "title": "" }, { "docid": "991e0245df134584bbc...
8b2c117b9c1f0790cbd981625802d8cc
Test SSP computation on epochs.
[ { "docid": "73736b819cee7ab83c86312c7c11d916", "score": "0.0", "text": "def test_compute_proj_epochs(tmp_path):\n event_id, tmin, tmax = 1, -0.2, 0.3\n\n raw = read_raw_fif(raw_fname, preload=True)\n events = read_events(event_fname)\n bad_ch = \"MEG 2443\"\n picks = pick_types(raw.info, ...
[ { "docid": "bb77ae2848be3b277eb1f6ebc241cbbb", "score": "0.6580616", "text": "def _run_ensemble_funcs(self, ens, xpts):\n\n pdfs = ens.pdf(xpts)\n cdfs = ens.cdf(xpts)\n logpdfs = ens.logpdf(xpts)\n logcdfs = ens.logcdf(xpts)\n\n if hasattr(ens.gen_obj, 'npdf'):\n ...
1fa7188ccf9d129ff7c6b38b4bbb5a62
New values for the corrections have been submitted. A new call to update suffieces to redo the calculations, since _accurate_E always gets called by update() because this ensures that any changes the user makes to thresholds or plotoptions will not undo the accurate fret.
[ { "docid": "533318194971572b788ef4c724048f56", "score": "0.69895715", "text": "def apply_corrections(self):\n self.update()", "title": "" } ]
[ { "docid": "a0781ceb4905da8bd4e566aecf6f1310", "score": "0.7248283", "text": "def _accurate_E(self):\n print 'Calculating accurate FRET'\n # First we must correct the signal for background. The 1000 is because bkg_XX is in counts /ms\n DA_bkg_corr = self.data['F_Dexc_Aem'] - self.co...
e1d7405469a47e95c9cd2d77a13c4c28
show chart of answers per day
[ { "docid": "df19d3268f88a2afa60ff6a29bb17c4a", "score": "0.0", "text": "def changelist_view(self, request, extra_context=None):\n if request.POST.get(\"run_generate_daily_stats_script\", False):\n management.call_command(\"generate_daily_stats\")\n\n # custom form\n curre...
[ { "docid": "c4a83b66b494e8cb1bb15e0aa0cb3030", "score": "0.6323107", "text": "def daily_diagram(login):\n height, bars, date = day(login)\n barWidth = 0.25\n y_pos = np.arange(len(bars))\n plt.bar(y_pos, height, color='#EB984E', width=barWidth, edgecolor='white', label='var1')\n plt.xtick...
af894739e47bd0295ba02752666c07f3
Convert df to dictionary.
[ { "docid": "7d071e87558c9c26afe02ab55a83a8bb", "score": "0.0", "text": "def data_dict(self):\n mydict = lambda: defaultdict(mydict)\n meta_data_dict = mydict()\n\n for cord_uid, abstract, title, sha in zip(self.meta_data['cord_uid'], self.meta_data['abstract'], self.meta_data['title...
[ { "docid": "f6f44705836dfa968ae5c7c879794576", "score": "0.8157039", "text": "def _data_df2dict(df):\n data = {\"A\": np.array(df.A),\n \"DA\": np.array(df.DA),\n \"B\": np.array(df.B),\n \"DB\": np.array(df.DB),\n \"R\": np.array(df.R)}\n return data", ...
d7928fa7fbf48603cb94dd9d10f89bde
Load the model from the checkpoint by filtering out the unnecessary parameters
[ { "docid": "7693094ad117d96666c397a863239660", "score": "0.7148552", "text": "def load_model_from_dict(self, checkpoint):\n model_dict = self.state_dict()\n # filter out unnecessary keys in the imported model\n pretrained_dict = {k:v for k, v in checkpoint['model_state_dict'].items(...
[ { "docid": "c44e217a0849ba1cdb31e90246b6a6cc", "score": "0.73850775", "text": "def load_model(self):\n self.actor.load_checkpoint()\n self.critic.load_checkpoint()\n self.target_actor.load_checkpoint()\n self.target_critic.load_checkpoint()", "title": "" }, { "doc...
5e7197bb410052648fb4f548a1adef3d
Define forward propagation for the attention network.
[ { "docid": "fa7ffdba1e9919bf82541570ac2f87cc", "score": "0.0", "text": "def forward(self, decoder_states, encoder_output, x_padding_masks):\n # Concatenate h and c to get s_t and expand the dim of s_t.\n h_dec, c_dec = decoder_states\n # (1, batch_size, 2*hidden_units)\n s_t ...
[ { "docid": "fe8251443026d7dea3f5b693314535c9", "score": "0.7427378", "text": "def set_forward_propagation(self):\n self.fw_propagating = True", "title": "" }, { "docid": "70b74ff3d86423e5c86d527b473b1985", "score": "0.7089231", "text": "def forward_propagation(self):\n ...
34d4fbb727c589de5b4b74852239253a
Set up a dictionary of detector locations and responses. Either put indigo in bangalore or a different site
[ { "docid": "5f4cf003357f387e7e0eec0ecd1bf6f3", "score": "0.6552748", "text": "def detectors(ifos, india=\"bangalore\", south_africa=\"sutherland\", orientation_angle_1=0, orientation_angle_2=0):\n location = {}\n response = {}\n # Use cached detectors for known sites:\n lho = lal.lal.CachedDetectors...
[ { "docid": "0c9b2ddd67a5f8406f04a3fad9f26998", "score": "0.5627128", "text": "def main(self):\n question = Parser(self.question)\n latitude = 0\n longitude = 0\n address = \"Bonjour, je vais bien merci !\"\n history = self._get_papy_sentence()\n article_title = ...
e19e19a14bfc966eae94ad450fc44e4f
Converts a 2bytes (16 bits) string to an unsigned integer.
[ { "docid": "83afc3af95d13c0bedfb515508a19cb9", "score": "0.0", "text": "def i16le(c, o=0):\n return unpack_from(\"<H\", c, o)[0]", "title": "" } ]
[ { "docid": "9f859d9adcda3009a3cdc34da345ba49", "score": "0.7961217", "text": "def decode_unsigned_int(string):\n return int(string,16)", "title": "" }, { "docid": "2aabe2c3ca74d37f7e02ec543618cbfe", "score": "0.69533163", "text": "def bytesToUShortInt(bytestring):\n return _doC...
3263d45e1d156fba8277ca49663bad50
Method to accept cash payments.
[ { "docid": "c818168a2a06ac72d9d073384c352350", "score": "0.56980604", "text": "def receive(self, amount: float):\n self.cash += amount\n self.profits_losses += amount", "title": "" } ]
[ { "docid": "8023b7cee48abb4260b3576db1ce9337", "score": "0.6500569", "text": "def pay(self, order: OnlineOrder):\n total = order.get_total()\n if self.cards:\n for card in self.cards:\n if card.ballance >= total:\n card.charge(total)\n ...
08afafda08458bd52dae1eb95fd8d3e9
Function creates dictionary that holds all the unique phone numbers and tallies the seconds
[ { "docid": "952fee6521258ba7d8eefb1c5f272bea", "score": "0.6745791", "text": "def phone_durations(num_list):\n # create empty defaultdict object\n num_dict = defaultdict(int)\n\n for num in num_list:\n num_dict[num[0]] += int(num[3])\n num_dict[num[1]] += int(num[3])\n\n return...
[ { "docid": "55c94d4782fdf07b3ac0226e249ef640", "score": "0.614255", "text": "def get_phonemes(num_phones):\n phonemes = {}\n\n if num_phones == int(48):\n logging.debug(\"Using 48 phones for modeling!\")\n # This dictionary is used to convert the 60 phoneme set into the 48 one.\n ...
53a853bf9167e8ae9890c42544faa1e5
User provides details about game.
[ { "docid": "2c75fbee56d835a92c806c6821d72d1f", "score": "0.0", "text": "def handle_multiplication_tables_response(self, message):\n self.remove_context('InitTablesContext')\n self.handle_utterance(message, True)", "title": "" } ]
[ { "docid": "5312250a42ecce58372cf20831568a8d", "score": "0.6623642", "text": "def game_info(self):\n return self._game_info", "title": "" }, { "docid": "909feeb00eaf9d733de3ec54844ff715", "score": "0.6586223", "text": "def game_detailed(request, game):\n try:\n g = Game....
6d17a86977aa5e07fc3bf30cc70cec9c
Callback for /twitter command.
[ { "docid": "9a39d4f42305095043641d4083530278", "score": "0.71408504", "text": "def twitter_cmd(data, buffer, args):\n if args != \"\":\n twitter_get(args)\n else:\n twitter_get(\"last\")\n return w.WEECHAT_RC_OK", "title": "" } ]
[ { "docid": "7455b2d3bd5471f490b37626590d06ad", "score": "0.72913617", "text": "def do_twitter(self, s):\n if \"login\" in s:\n try:\n driver = twitter_login(self)\n twitter_end(self, driver)\n except ConnectionError:\n print(CONNE...
b840234fa9d8f1681256cc2189f82323
r"""Call the update phrase matcher method over HTTP.
[ { "docid": "fcdc30237ae20d3245c69c5b7c8cd8ff", "score": "0.62303835", "text": "def __call__(\n self,\n request: contact_center_insights.UpdatePhraseMatcherRequest,\n *,\n retry: OptionalRetry = gapic_v1.method.DEFAULT,\n timeout: Optional[float] = N...
[ { "docid": "2e2b4ff5679148e0a86d475b255aa123", "score": "0.70168084", "text": "def post_update_phrase_matcher(\n self, response: resources.PhraseMatcher\n ) -> resources.PhraseMatcher:\n return response", "title": "" }, { "docid": "c4882d357b086afe3205dc8133d5987a", "sco...
1776f4905487abaf8b63ef81db24fc00
Returns a wrapper that enforces the presence of certain fields in a JSON body, if a body is present. Passes the JSON body as the first argument to the inner, or None if there is no body. If a field is missing or has the wrong type, returns 400.
[ { "docid": "27c1831cfc5dd7f74980b5cf54a01a5e", "score": "0.5529812", "text": "def maybe_json(**jkwargs):\n\n def wrapper(func):\n @functools.wraps(func)\n def inner(*args, **kwargs):\n if request.content_length == 0:\n return func(None, *args, **kwargs)\n ...
[ { "docid": "1f56a068edabb5c94c2214a769dcb306", "score": "0.7296733", "text": "def expect_json(*, strict=False, optional=None, **fields):\n if optional is None:\n optional = set()\n\n def wrapper(func):\n @functools.wraps(func)\n def inner(*args, **kwargs):\n # ensur...
70e692868094504e23935c6af3f3608a
Getter method for state, mapped from YANG variable /qos/classifiers/classifier/terms/term/state (container)
[ { "docid": "f22d788da20f7c4a9213740db7ac7129", "score": "0.0", "text": "def _get_state(self):\n return self.__state", "title": "" } ]
[ { "docid": "f7f34e144872a5afcae6730f3513d2d6", "score": "0.7400615", "text": "def _set_state(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=yc_state_openconfig_qos_interfaces__qos_classifiers_classifier_terms_term_state, is_container...
495b060afd563a3b0a6691f036e37e95
Takes a feature and plots a primitive's time for completion (assumed to be successful) with respect to initial feature condition
[ { "docid": "dba72e07488e66f6febbedec16134cdc", "score": "0.7870494", "text": "def analyze_feature_to_time(self, feature, primitive):\n time = np.array(self.time[primitive])\n s = self.success_start[primitive]\n s = s[:, features[feature]].ravel()\n \n plt.scatter(s, time)\...
[ { "docid": "0d4c94955098393f2b1123cd9107e53a", "score": "0.590543", "text": "def plotting_time_feat(df, features, start, stop, scaler=False):\n \n df1 = df[features]\n df2 = df1[start:stop]\n \n if scaler:\n from sklearn.preprocessing import StandardScaler\n scaler = Standar...
acd20aee05a7edf794a69b3f3aa3bf3c
decompose the vector field (u,v) into potential (up,vp) and solenoidal (us,vs) fields using 2D FT a la Smith JPO 2008
[ { "docid": "f7f32f5f034ff0911e688bdd88cc3cd3", "score": "0.64122146", "text": "def ps(u,v,dx,dy):\n\n ix,jx,kx = u.shape\n dl = 1./(ix*dy)\n dk = 1./(jx*dx)\n kNy = 1./(2*dx)\n lNy = 1./(2*dy)\n k = np.arange(-kNy,kNy,dk)\n k = np.fft.fftshift(k)\n l = np.arange(-lNy,lNy,dl)\n ...
[ { "docid": "3e69e3b72302484e63106a940fe1501a", "score": "0.68711233", "text": "def vectorfield(w, t, p):\n x1, y1, x2, y2 = w\n t1, t2, m, l = p\n\n # Create f = (x1',y1',x2',y2'):\n f = [y1,\n ((2./3.)*((t1/(0.5*m*l**2)+(np.sin(x2)*y2*(2*y1+y2))))-(((2./3.)+(np.cos(x2))*((t2/0.5*m*l...
53a18a58bf82ca82cde3df84f4b10779
This method unbinds the skin for all the meshes in the given list, if any.
[ { "docid": "57e74bb8b7ccaf11d9be63c75b70cbbf", "score": "0.69904643", "text": "def detachSkinFromMesh(meshes):\n\n pass", "title": "" } ]
[ { "docid": "ab9be50819a072e20e9f8437cb740c4d", "score": "0.63012815", "text": "def unregister_layers(self, names, out):\n skinstool = getToolByName(self, 'portal_skins')\n\n # remove this layer from all known skins\n for skinName in skinstool.getSkinSelections():\n path = skinstool.getSk...
675c230b3f4344b7d3447c81c8c65558
Send valid get request to github_callback and receive no access_token.
[ { "docid": "a69334d39c6abec677166da4651c9076", "score": "0.7379556", "text": "def test_github_callback_incomplete_get(self, mock_post, mock_g, mock_user_model):\n mock_post.return_value.json.return_value = {}\n\n with self.app.test_client() as client:\n response = client.get(\"/...
[ { "docid": "bc74d9d65ec4b98ac2716efa2f8a1873", "score": "0.6934215", "text": "def test_github_callback_empty_get(self, mock_post):\n with self.app.test_client() as client:\n response = client.get(\"/account/github_callback\")\n\n self.assertEqual(response.status_code, 400)\n ...
6f9db51ad2eab65a0c229c057a3eef2d
Add gaussian heatmap for character bbox to the image
[ { "docid": "507a93ec78ea3d50b2bc339483425447", "score": "0.6403565", "text": "def add_character(image, bbox):\n\n\tif not Polygon(bbox.reshape([4, 2]).astype(np.int32)).is_valid:\n\t\treturn image\n\n\ttop_left = np.array([np.min(bbox[:, 0]), np.min(bbox[:, 1])]).astype(np.int32)\n\ttop_right = np.array...
[ { "docid": "f243def6ba73436b53aeb3f0168fde06", "score": "0.63595766", "text": "def process_image(img):\n avg_heat = np.zeros_like(image[:, :, 0]).astype(np.float)\n out_img, out_boxes, heat_map = find_cars(img, scale)\n\n # -----\n heat = np.zeros_like(image[:, :, 0]).astype(np.float)\n #...
adc3c746496e5167389997c4151ae2f6
Convenience method for making a table
[ { "docid": "81e610a25bbd00c09f72427cdfeb2245", "score": "0.698341", "text": "def make_table(self):\n hash_key = DynamoKey('id')\n self.dynamo.create_table('foobar', hash_key=hash_key)", "title": "" } ]
[ { "docid": "917e9f127e58b7bf071b3275c62bd88c", "score": "0.8010181", "text": "def makeTable(self):\n\tcols = [Column(name=k, **v) for k,v in self.col_dict.items()]\n\treturn Table(cols)", "title": "" }, { "docid": "0f41e7f18a334779321cd1b0d029b69d", "score": "0.7826398", "text": "def...
ab89c7636396ac096d9f684b45b0325c
Check atom types for matched atoms are the same in both molecules. If not the same report to user and ask if they wish to continue and ends if not.
[ { "docid": "3b8703a5cc93018b33404a9fa433f656", "score": "0.72817165", "text": "def check_atom_type_match(matched_idx_map, initial_mol_info, final_mol_info):\n\n init_names = initial_mol_info.struct.name()\n final_names = final_mol_info.struct.name()\n\n type_match_error = False\n\n for init_...
[ { "docid": "acc86706fa2928bf1f4e37aa6956f931", "score": "0.6576755", "text": "def match_molecules(molecule1, molecule2, logger, onlyH):\r\n\r\n if logger.use_groups: # If group charges are to be used\r\n\r\n chg1, chg2 = molecule1.chg_grp, molecule2.chg_grp\r\n\r\n else:\r\n\r\n chg...
2e0aef6d6ccd975462cef39574e85761
Helper function to compute our content and style feature representations. This function will simply load and preprocess both the content and style images from their path. Then it will feed them through the network to obtain the outputs of the intermediate layers.
[ { "docid": "d4208e32afe57cbe7499df2e38a92d0c", "score": "0.69074523", "text": "def feature_representations(\n self, content_img: np.array, style_img: np.array\n ) -> Tuple[tf.Tensor, tf.Tensor]:\n\n content_img = self._process_img(content_img)\n style_img = self._process_img(styl...
[ { "docid": "f3f5bf2fac38a5d95359f7beb6529362", "score": "0.64880633", "text": "def stylize(network, initial, content, styles, iterations,\n content_weight, style_weight, style_blend_weights, tv_weight,\n learning_rate, print_iterations=None, checkpoint_iterations=None):\n shape ...
b7db9c4c6c9fb6dd1d332e25a176ebb7
Lookup quote starting position using google diff_match_patch (levenshtein) algorithm
[ { "docid": "d44958809665a563a50dc4b7074aa5b5", "score": "0.7858059", "text": "def quote_start_position(self):\n\n quote_locate = diff_match_patch()\n quote_locate.Diff_Timeout = 5.0 \t# Tweak this?\n quote_locate.Match_Threshold = 0.5 # Tweak this?\n\n # Guess a big distance...
[ { "docid": "6199483675f4357c9c9a305fcdc5b449", "score": "0.65813494", "text": "def findClosestMatchingQuote(self, quote, threshold=.9):\n quotelen = len(quote.split(\" \"))\n chaptersubstrings = []\n lst_of_substrings = []\n for chapter in self.chapter_lists:\n for i in range(...
2fd056d69913ba40d9b0321433b46e94
Check package identifier is valid before querying results. Check package identifier is valid before querying results. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response.
[ { "docid": "384efe157aa2adbca036f6da249728a2", "score": "0.0", "text": "def vulnerabilities_list1_with_http_info(self, owner, repo, package, **kwargs):\n\n all_params = ['owner', 'repo', 'package', 'page', 'page_size']\n all_params.append('callback')\n all_params.append('_return_htt...
[ { "docid": "aec3eda9c5ef29ed467555c6c8f7127c", "score": "0.6192965", "text": "def is_package_id_valid(package_id: str) -> None:\n pattern = re.compile(r\"^pkg_[1-9a-zA-Z]+$\")\n\n if not package_id.startswith(\"pkg_\"):\n raise ValidationError(\n message=f\"[{package_id[0:4]}] is...
ca766eae32d3138b488dc464fd2fc166
Structured SVM loss function, naive implementation (with loops). Inputs have dimension D, there are C classes, and we operate on minibatches of N examples.
[ { "docid": "f73b08783021763c99cd131751eff8fa", "score": "0.63592327", "text": "def svm_loss_naive(W, X, y, reg):\n dW = np.zeros(W.shape) # initialize the gradient as zero\n # compute the loss and the gradient\n num_classes = W.shape[1]\n num_train = X.shape[0]\n loss = 0.0\n \n # Iterate throu...
[ { "docid": "67adf20f38500772f8f93f199913c491", "score": "0.6719385", "text": "def svm_loss_vectorized(W, X, y, reg):\n #############################################################################\n # TODO: #\n # Implement a vectoriz...
9703f40fa9ce030515a496a9cc3d4b6d
Create quiz providing basic fields with LIVE_STATUS and two categories.
[ { "docid": "c578e483defc8bf217d15cee61fb9ec1", "score": "0.6504106", "text": "def testCreateQuizLiveWithCategories(self):\n status = Quiz.LIVE_STATUS\n quiz = Quiz(title=self.title, body=self.body, slug=self.slug, author=self.editor, status=status)\n quiz.save()\n c1 = Catego...
[ { "docid": "23ea909a4f70cd48b86b9e7215fd7a4e", "score": "0.6298574", "text": "def test_quiz_question_categorized(self):\n url = '/api/quizzes'\n previous_questions = []\n\n data = {\n 'previous_questions': previous_questions,\n 'quiz_category': self.science.id\...
79266c27c0f35444c6f2b5e7f0b20869
Reads a GeoJSON and gives the results in GeoJSON format Speed = 0.091ms/feature
[ { "docid": "8e4266a2a809483dca42fc8c9b0f2bea", "score": "0.6681749", "text": "def read_geojson(self, infile, **kwargs):\n\n logging.info('Reading GeoJSON: %s' % infile)\n if isinstance(infile, dict):\n geojson = infile\n else:\n with open(infile) as f:\n ...
[ { "docid": "3038df70905acd2489ae82ffca63ed98", "score": "0.6661169", "text": "def read_geojson(geojson_file):\n # example in order to see the polygon_vertices_pixels\n #data['features'][0]['properties']['polygon_vertices_pixels']\n d = dict()\n \n # get all the solar panel coordinates in ...
05bc8e2304577295887424b010ed7a87
generated source for method getFuelLevel
[ { "docid": "9d9088df5fd780e9da59f78ed407a612", "score": "0.8427119", "text": "def getFuelLevel(self):\n return self.brewingStand.getProperty(1)", "title": "" } ]
[ { "docid": "51fc8d466defad910e1ff2f03bb998fd", "score": "0.7995947", "text": "def fuel_level(self):\n return self.tank.fuel_level", "title": "" }, { "docid": "508a0b2ef68dbfac6b1842802129002d", "score": "0.6756143", "text": "def load_fuel_base(self):\n values = self.val...
d4cd93f5d748fce6278f88010ec3b46b
SetConfidenceImage(itkN4BiasFieldCorrectionImageFilterISS2IUC2IF2 self, itkImageF2 _arg)
[ { "docid": "cca36d4a0abdb64086ef7638f38fbaf0", "score": "0.91615874", "text": "def SetConfidenceImage(self, _arg: 'itkImageF2') -> \"void\":\n return _itkN4BiasFieldCorrectionImageFilterPython.itkN4BiasFieldCorrectionImageFilterISS2IUC2IF2_SetConfidenceImage(self, _arg)", "title": "" } ]
[ { "docid": "415a1a1b5d335a108c6dd621714243da", "score": "0.9181978", "text": "def SetConfidenceImage(self, _arg: 'itkImageF2') -> \"void\":\n return _itkN4BiasFieldCorrectionImageFilterPython.itkN4BiasFieldCorrectionImageFilterIUC2IUC2ISS2_SetConfidenceImage(self, _arg)", "title": "" }, {...
4c403227b17588c8a00c52a5dbe76c27
A context manager that will lock on the device given, if configured to do so.
[ { "docid": "4769ef3c47052963d0e455f3bd3b1be3", "score": "0.62667316", "text": "def replication_lock(self, device):\r\n if self.replication_one_per_device:\r\n dev_path = self.get_dev_path(device)\r\n with lock_path(\r\n dev_path,\r\n tim...
[ { "docid": "dccae90a973f8f2e76e03f36ca6969a1", "score": "0.69568276", "text": "def lock_context(self, timeout='default', requested_key='exclusive'):\n if requested_key == 'exclusive':\n self.lock_excl(timeout)\n access_key = None\n else:\n access_key = self...
cd1077eda04f8edc8caf84074f701a3e
Provide customable on number of hidden units in layer 1/2 As well as drop out size in connection between layer 1 and 2
[ { "docid": "15ea1ce1012f8e94460b7fe955c465df", "score": "0.0", "text": "def nn_3layers(nb_input, nb_output,hn1=210,hn2=100,hn3=50,dp1=0.4,dp2=0.2, **kwargs):\n # create model\n model = Sequential()\n model.add(Dense(hn1, input_dim= nb_input, init='glorot_uniform', activation='relu')...
[ { "docid": "b9350cd5058fd91107fba622e285d446", "score": "0.7422406", "text": "def hidden_unit(Layer): \n\tfan_in = Layer.weight.data.size()[0]\n\tlim = 1. / np.sqrt(fan_in)\n\treturn (-lim, lim)", "title": "" }, { "docid": "6d850db14618078b77e68af232c24387", "score": "0.6618541", "te...
b12647070c6dcd54d4825e5d189045c2
Waits for a resource to be deleted.
[ { "docid": "e40d0d8b09095126878bc7e9ee57c02a", "score": "0.7592842", "text": "def wait_for_resource_deletion(self, resource_type, id, client=None):\n start_time = int(time.time())\n while True:\n if self.is_resource_deleted(resource_type, id, client=client):\n ret...
[ { "docid": "0c6e8cc1c7e01252177fd073373b8eb1", "score": "0.7432982", "text": "def wait_for_delete(self, res, interval=2, wait=120):\n return resource.wait_for_delete(self, res, interval, wait)", "title": "" }, { "docid": "761c304c769b4e71ef4f2a3648ec7efa", "score": "0.7096719", ...
f69d765571a2ea175f00782c38791dc6
Function for the creation of a double ring neighborhood structure.
[ { "docid": "9a2858696789e36b454db246991d9721", "score": "0.6618666", "text": "def create_neighborhood_structure_ring(alist):\n for i in range(len(alist)):\n if i == 0:\n alist[i].neighborhood.append(alist[-1])\n alist[i].neighborhood.append(alist[-2])\n alist[-...
[ { "docid": "09f8ba82c9d6d9128d3ee2916ff6e64a", "score": "0.66190475", "text": "def _create_neighbourhood(self):\n pass", "title": "" }, { "docid": "307bffa20031a4c7d3f4fbe0f06371e7", "score": "0.61556005", "text": "def make_neighbor(self, n1, n2):\n pass", "title": ...
1ec8569229ebed58baaf8b1c58f72297
The show action, which shows details for a particular DocumentFile.
[ { "docid": "c792bc572b8fe5fd7484420aadc30173", "score": "0.7743916", "text": "def document_show(project_id, document_file_id):\n #TODO: good spot for a helper\n #document = helpers.get_object_or_exception(Unit,\n # Unit.id == document_id, exceptions.DocumentNotFoundException)\n try:\n ...
[ { "docid": "7c868d3aaf579912e3baafb242d610b6", "score": "0.67580366", "text": "def show(self, name, docid=None, **options):\n path = _path_from_name(name, '_show')\n if docid:\n path.append(docid)\n status, headers, body = self.resource(*path).get(**options)\n retu...
ccec0f53b7fad21155536c7de925e1d0
initialize the weights for the neural network
[ { "docid": "5e9a76e48f7387150da17591d768fe14", "score": "0.0", "text": "def neural_net_weights(num_inputs, num_hidden_layers, num_nodes, num_outputs):\n \n network = []\n output_layer = []\n \n # no hidden layer\n if num_hidden_layers == 0: \n for n in range(num_outputs):\n ...
[ { "docid": "2f539308a4530e0d61a67321a3fd828a", "score": "0.86598444", "text": "def init_weights(self):\n pass", "title": "" }, { "docid": "be8dec4d41250f35e3f156604e893851", "score": "0.84111565", "text": "def weight_init(self):\n self.weights = [np.random.randn(y, x)/n...
0cc1dc4e58cdb02cae12456159fa0e11
Returns the width of the given text.
[ { "docid": "53c08eaa07f61457d07ef1b8774b6149", "score": "0.75393206", "text": "def textwidth(txt, **kwargs):\n if not isinstance(txt, Text) or len(kwargs) > 0:\n kwargs[\"draw\"] = False\n txt = text(txt, 0, 0, **kwargs)\n return txt.metrics[0]", "title": "" } ]
[ { "docid": "1a5cd4da9031018ff6c5e964e1cc0038", "score": "0.8688428", "text": "def TextCalcWidth(Text) -> int:\n pass", "title": "" }, { "docid": "35e93582b8c7ca034278968e8c51c1e6", "score": "0.8660079", "text": "def _get_text_width(self, text: str) -> int:\n return self._bu...