query_id
stringlengths
32
32
query
stringlengths
9
4.01k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
5c2d9f1fda55127723a3f0c6cfae90fe
Wrap only RA values into 02pi (using mod).
[ { "docid": "660be432713cdf21713be305e718a483", "score": "0.8059379", "text": "def wrapRA(ra):\n ra = ra % (2.0 * np.pi)\n return ra", "title": "" } ]
[ { "docid": "d75e38f81b0fdf8586733ca2cabbad7a", "score": "0.7120562", "text": "def wrapRADec(ra, dec):\n # Wrap dec.\n low = np.where(dec < -np.pi / 2.0)[0]\n dec[low] = -1 * (np.pi + dec[low])\n ra[low] = ra[low] - np.pi\n high = np.where(dec > np.pi / 2.0)[0]\n dec[high] = np.pi - dec...
3f0a1346fb8bb373c8c5262b87589d11
Parses the command line for arguments. A few different potential arguments. One indicates if it is the second tweet of the day (assumes that is not the case). Another marks whether we should be tweeting in a particular language.
[ { "docid": "3c02e8494598f6ccc01def7632eed796", "score": "0.71433055", "text": "def parse_args(argv=None):\n argv = sys.argv[1:] if argv is None else argv\n parser = argparse.ArgumentParser(description=__doc__)\n\n parser.add_argument('-t', '--two', dest='day_two', action='store',\n ...
[ { "docid": "876e2006fc429b6aafb42e4b55c625f5", "score": "0.6255365", "text": "def parse_arguments():\n parser = argparse.ArgumentParser()\n parser.add_argument(\"-s\", \"--search_query\", help=\"Search Query\",\n type=str, required=True)\n parser.add_argument(\"-n\", \"--...
6639be396edb40a5fa5ca95801fe78fc
Append layer and layer.param (if exists) to self.layer and self._parameters, respectively.
[ { "docid": "82b0ab34a1c5afdfbf2b726314c1205a", "score": "0.7053847", "text": "def add(self, layer):\n self.layers.append(layer)\n\n # FCLayer object has Parameter object stored as layer.param\n try:\n self._parameters.extend(layer.param)\n # no parameters in Activa...
[ { "docid": "d2e3bfc8f30468dfb3748ac981d3f522", "score": "0.66861075", "text": "def make_param_list(self):\n self.params, self.bn_layers = {}, {}\n\n for key in list(self.layers.keys()):\n self.params[key] = []\n self.bn_layers[key] = []\n for layer in self....
fc522dc6bf113654f13dd2beef05993a
show a blocking warning
[ { "docid": "bfa4a64a0e3ef5e421b2f4c4a1e6e76c", "score": "0.0", "text": "def _notify_error(self, message: str):\n warn_msg = [\"Errors were encountered while running the playbook:\"]\n messages = remove_ansi(message).splitlines()\n messages[-1] += \"...\"\n warn_msg.extend(mes...
[ { "docid": "e83198fc2dfe50eb93366a8f8d7b4a26", "score": "0.7087826", "text": "def warning(msg):\n if not QUIET:\n print(f\"WARNING [gldserver {datetime.datetime.now()}]: {msg}\",file=sys.stderr,flush=True)", "title": "" }, { "docid": "40e62695e960695e3148dd3bef51cee6", "score":...
f556f8b23192e8efb675129f7cb130ab
Calculate the constant part of LogDistance Path Loss equation. We assume a fixed carrier frequency for all communications in our simulation. This means that only the distance and antenna gain parts of the LogDistance PL equation will be changing, so we can memoize the freq + speed of light part to save computation.
[ { "docid": "03d0bd3ffe512d39d0459c9475acdff4", "score": "0.631338", "text": "def pl_constant_dB(carrier_freq_GHz: float, ple: float) -> float:\n return 10 * ple * log10(carrier_freq_GHz * 1e9) + 10 * ple * log10((4 * pi) / SPEED_OF_LIGHT)", "title": "" } ]
[ { "docid": "0d20475941b77e0e4f3887cbbfdaad5e", "score": "0.63087827", "text": "def _L(w):\n return 1 / w * log(1 + w)", "title": "" }, { "docid": "acabf88daa46c5a515d4c32f0140e8ff", "score": "0.6266826", "text": "def loglike(self, params):\n nobs2 = self.nobs / ...
9caa817a98f6542e2746de1fc6224521
u"""Size of the file, in bytes.
[ { "docid": "bcef0da332db7373fff8c9912efa1be2", "score": "0.78664887", "text": "def size(self):\n return os.path.getsize(self)", "title": "" } ]
[ { "docid": "f121bac4c8a59e36ec4142002fdac271", "score": "0.8228751", "text": "def get_file_size(self):\n return self.file_size", "title": "" }, { "docid": "a99dd2cfc8551833e5dee35c244a59f7", "score": "0.8152326", "text": "def size_in_bytes(fname):\n return os.stat(fname).st...
6e49063aaba15bf4fb06655800b296ed
Validates that the old_password field is correct.
[ { "docid": "8f7c2d5d80ecb0cf5e24a3c21e424134", "score": "0.68561393", "text": "def clean_old_password(self):\n if not self.isEmployeePwd():\n super(PasswordChangeForm1, self).clean_old_password()", "title": "" } ]
[ { "docid": "489cfc3f2b388198b9ee89b3fdd47df4", "score": "0.8666899", "text": "def clean_old_password(self):\r\n old_password = self.cleaned_data[\"old_password\"]\r\n if not self.user.check_password(old_password):\r\n raise forms.ValidationError(\r\n self.error_me...
dc26b21abe31760b535bc59c39a92288
removes member from register (and all associated register entries)
[ { "docid": "73761206adc87a7fb837840e648aa7c3", "score": "0.0", "text": "def supprimer_membre(self, m):\n if m in self.membres:\n self.membres.remove(m)\n for c in self.certificats:\n del self.registre[m, c]\n duplicates = []\n for n in se...
[ { "docid": "63d785cc7c2908fe2d4820a5b1fffb0f", "score": "0.71147346", "text": "def removeMember(self, member):\n self.members.pop([member])", "title": "" }, { "docid": "e60878bb2479cca35ad45053306660ef", "score": "0.70818776", "text": "def unregister(registration):", "titl...
586ac2d04d6274f7a9502b4c31836148
Append games to the season list.
[ { "docid": "d21ce55288c877629f8af68999b49530", "score": "0.8398314", "text": "def add_to_season(self, *games):\n for item in games:\n item = item.convert_dict()\n self.season.append(item)\n self._gather_stats()", "title": "" } ]
[ { "docid": "056b89b377ba104102bc06499e37d152", "score": "0.6881717", "text": "def games(self):\n games = []\n for season in self.seasons:\n games += season.games\n return games", "title": "" }, { "docid": "c781ae5ff97616fb91bbb35c2bf4a767", "score": "0.636...
9723809074f89660f17a631d91fb74c0
Gets the identity matching the given identity id.
[ { "docid": "f56995282bcbdc0b0ebf2e2d7cfcd7b0", "score": "0.7341148", "text": "def get_identity(self, identity_id, identity_to_retrieve=None):\n response = self.api_client.get_identity(\n identity_id,\n identity_to_retrieve if identity_to_retrieve else identity_id)\n\n ...
[ { "docid": "bbda155689deac87303c3837ccae62a0", "score": "0.70973593", "text": "def get_identity(self, identity_to_retrieve=None):\n return self.parent.get_identity(self.identity_id, identity_to_retrieve)", "title": "" }, { "docid": "d22f73dd8b7edee0b69c688e377e4b21", "score": "0.6...
028730c2d50419c63bd52b91e89fccc0
Return the number of items in the control.
[ { "docid": "fb21f40f2b6bfc76f132942b00a6c4ad", "score": "0.72718483", "text": "def GetCount(self):\n return len(self.__buttons)", "title": "" } ]
[ { "docid": "fbf9eeb7487493aa082c1c6ee5763ee0", "score": "0.8328919", "text": "def getNumItems(self):\n\n return self.item_list.getSize()", "title": "" }, { "docid": "fbf9eeb7487493aa082c1c6ee5763ee0", "score": "0.8328919", "text": "def getNumItems(self):\n\n return self.item_li...
f2394ca0b91b86f4d4f82589fef6d772
Return whether the queue is full or all data has been read.
[ { "docid": "66c090d50ff9f7ec4a3eab241ea62c94", "score": "0.0", "text": "def is_ready(self):\n\n return self.__is_ready.is_set()", "title": "" } ]
[ { "docid": "f6130d575c952183de83d49dc9df8901", "score": "0.82898295", "text": "def isFull(self):\n return len(self.queue) == self.size", "title": "" }, { "docid": "c6d682e8bc53b83c6706adcc0e357585", "score": "0.8242448", "text": "def isFull(self):\n for i in self.queue:...
d0c4765c05bfe01cddc61f5e9265a156
r""" Returns a dictionary in a format compatible with that of the suffix trie transition function.
[ { "docid": "178fc0d596485577bf265886aa8fd866", "score": "0.736864", "text": "def trie_type_dict(self):\n d = {}\n new_node = len(self._transition_function)\n for (u, dd) in iteritems(self._transition_function):\n for (sl, v) in iteritems(dd):\n w = self._wo...
[ { "docid": "be82dd23635531b7ffeb67a8908c0505", "score": "0.61743563", "text": "def transition_function_dictionary(self):\n d = {}\n for (u,v,(i,j)) in self.edge_iterator():\n d.setdefault(u, {})[v] = (i,j)\n return d", "title": "" }, { "docid": "e03170e774abc3...
3e494b74512ea70aba76d57ec72e4c7a
gzip encodes a given stream of data.
[ { "docid": "5df9e4e191d338372114aba38cafa637", "score": "0.62311316", "text": "def gzip_media(self, filedata):\n gzip_data = StringIO()\n gzf = GzipFile(fileobj=gzip_data, mode='wb')\n gzf.write(filedata)\n gzf.close()\n return gzip_data.getvalue()", "title": "" ...
[ { "docid": "009faba2db9d1af7503d42b7b4f6b98e", "score": "0.67226607", "text": "def compress_gzip(foo: bytes) -> bytes:\n c = zlib.compressobj(wbits=zlib.MAX_WBITS + 16)\n return c.compress(foo) + c.flush()", "title": "" }, { "docid": "122d29aa625e68324f6eaf6882315e87", "score": "0....
ffec06ba450c5873d6158be16b23598a
ID of the node.
[ { "docid": "b7dd188ffe33cf43b36f7ec18b01d0a2", "score": "0.0", "text": "def id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"id\")", "title": "" } ]
[ { "docid": "bfeb088ae137488a8657dc480af877ba", "score": "0.8696809", "text": "def node_id(self):\n return self._node_id", "title": "" }, { "docid": "af4cdb945ea4d59ec0983cfce7870708", "score": "0.8684843", "text": "def nodeid(self) :\n\t\ttry :\n\t\t\treturn self._nodeid\n\t\t...
7e500c63b119ab4dee6e8bf57086809c
Returns the JaaSJwtBuilder with the id claim set.
[ { "docid": "29e62392b294cb2c58d33106396db73f", "score": "0.4470215", "text": "def withUserId(self, userId):\n self.userClaims['id'] = userId\n return self", "title": "" } ]
[ { "docid": "7d529b031159cdcfd2a3bc4658d59ba2", "score": "0.48859382", "text": "def _generate_jwt(iat, exp, key_file_path, kms_project_id, key_ring, crypto_key, target_audience):\n\n key_content = gcs_ext.get_gcs_encrypted_file_as_string(\n key_file_path, kms_project_id, key_ring, crypt...
fc04656f3f0d17081f07c74c64c9b2b8
The threshold for the type of the warning.
[ { "docid": "cca26f537659a9a75eb14e218e17d12d", "score": "0.0", "text": "def value(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"value\")", "title": "" } ]
[ { "docid": "7d0c13f9191020955b9b5dbe5396dcbe", "score": "0.7387244", "text": "def _get_threshold_type(self):\n return self.__threshold_type", "title": "" }, { "docid": "7d0c13f9191020955b9b5dbe5396dcbe", "score": "0.7387244", "text": "def _get_threshold_type(self):\n return sel...
621d64470b8b17674af88ea7e53257da
Reads the config from file
[ { "docid": "face8b430c2a812140a37a1b19d99c2c", "score": "0.7190561", "text": "def read_config(config):\n conf_file = pathlib.Path(config)\n contents = conf_file.read_text(encoding='utf-8')\n print(\"Config read successfully!\")\n return yaml.safe_load(contents)", "title":...
[ { "docid": "70096a34b46229d5eee21d62d532536c", "score": "0.84541", "text": "def readconfig(file):\n if not os.path.isfile(file):\n print(\"WARNING: Could not load config file '%s'\" % file)\n return\n config.read(file)", "title": "" }, { "docid": "87bc93f528e4a9a33087ece1...
4602a83890fcac8d593b358b8baa1855
See base class for details.
[ { "docid": "39c5a89cfbd4fcbffafcc95d9e21c232", "score": "0.0", "text": "def _flatten(self, x):\n if x and not isinstance(x, (dict, FeaturesDict)):\n raise ValueError(\n 'Error while flattening dict: FeaturesDict received a non dict item: '\n '{}'.f...
[ { "docid": "944fb2df87fb227ccee6471df3301cdd", "score": "0.7688483", "text": "def __call__(self):\n raise NotImplementedError", "title": "" }, { "docid": "9674a53f41c819786d78160c50d1decc", "score": "0.74180526", "text": "def __call__(self):\n raise NotImplementedError(...
830dd5a397bc6f2367506d0bd68cb134
Q Learning Algorithm with epsilon greedy
[ { "docid": "9768e62d5bff19a3f1b6225cb034f01c", "score": "0.0", "text": "def Q_learning_train_gamma(env, alpha, gamma, episodes, dataset_name, epsilons=0.1, plot=True):\n\n \"\"\"Training the agent\"\"\"\n\n # For plotting metrics\n metrics = {}\n epsilon_decay = 0.99\n ...
[ { "docid": "bfb6f7425cb806d95696eea8510ae30f", "score": "0.74683756", "text": "def epsilonGreedy(self, Q, state, nA, eps):\n if random.random() > eps :\n return np.argmax(Q[state])\n else:\n return random.choice(np.arange(self.env.action_space.n))", "title": "" ...
b7b7d6c6a0ad03360d2371d941d8ff4f
Buildpacks in the buildpack group
[ { "docid": "09483f5db9e24e2f6790a05c68457916", "score": "0.67055935", "text": "def buildpacks(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['BuildpackPropertiesArgs']]]]:\n return pulumi.get(self, \"buildpacks\")", "title": "" } ]
[ { "docid": "4c03b68da59eb6dec5c38d6587aba15c", "score": "0.5979639", "text": "def getBuildSets():", "title": "" }, { "docid": "d9420e6f100d7dd0bb86c6d33ad5bb33", "score": "0.54672205", "text": "def gather() -> None:\n # pylint: disable=too-many-locals\n\n # First off, clear out...
7a908d5d1a54d2fc0324eeb01d0c9658
Overwritten method Calls super().end_state() and stops listening to keyboard input
[ { "docid": "705a2b164ecce56f390e244860e9ca81", "score": "0.5866146", "text": "def end_state(self):\n super().end_state()\n self.game_objects = []", "title": "" } ]
[ { "docid": "eda64dfefdf5a138b9a895a3d5043f79", "score": "0.6791873", "text": "def end(self):\n curses.nocbreak()\n self.screen.keypad(0)\n curses.echo()\n curses.endwin()", "title": "" }, { "docid": "da2e99d8b27cec68fadf7ad0d67b0f2a", "score": "0.661081", ...
19073137a0624bd0a26fd62d59db54b8
Create service with some type, port and protocol.
[ { "docid": "9ba208b0d60fe4b5ac8a92ca5e2c0302", "score": "0.76180995", "text": "def create_service(self, name, namespace, port, protocol, type,\n labels=None):\n manifest = {\n \"apiVersion\": \"v1\",\n \"kind\": \"Service\",\n \"metadata\": {...
[ { "docid": "48c34a1cf7181fc3d55af8733cec73fa", "score": "0.73876977", "text": "def create_service(self, name):", "title": "" }, { "docid": "917ec64a492b8e95019f0245dc3597b1", "score": "0.6845694", "text": "def create_service(kube_host, kube_port, namespace, service_name, pod_name,\n ...
6604067e06569c15bc31c6a79add24dc
Yield the neighbor vertices of `vertex`.
[ { "docid": "34ac0938b785041db790bb5e3dbcecb8", "score": "0.770574", "text": "def _get_neighbors(self, vertex, vertex_edges):\n\n for edge in vertex_edges:\n neighbor_id = (\n edge.get_vertex1_id()\n if vertex.get_id() != edge.get_vertex1_id()\n ...
[ { "docid": "9b86843226fdbca52b066c870e0185fe", "score": "0.75119525", "text": "def neighbors_for_vertex(self, vertex):\n return self.neighbors_for_index(self.index_of(vertex))", "title": "" }, { "docid": "f8a2e858c9076cff7f30cd63001347af", "score": "0.71118885", "text": "def g...
f0e5fd2b46ed8f94bda08f6aeae66bb9
Filter recruitments based on the event (online/inperson) status.
[ { "docid": "77c9760a05b23b12e95dc8f64affb005", "score": "0.69496536", "text": "def filter_status(self, queryset: QuerySet, name: str, value: str) -> QuerySet:\n if value == \"online\":\n return queryset.filter(event__tags__name=\"online\")\n elif value == \"inperson\":\n ...
[ { "docid": "2802b1c73bdf561e22b75ed88fc1cf80", "score": "0.5941553", "text": "def filter_events(self, **kwargs) -> list:\n raise NotImplementedError()", "title": "" }, { "docid": "8410484cd809fc2c529e62b466cafd9b", "score": "0.58687305", "text": "def filter_by_status():\n a...
0aff7249fa642f7cdf0aae4a0e36e5a9
Outputs a plot of the predicted and realized carbon intensities for a given date.
[ { "docid": "2201bd47b6015d8a7e192576ee9f71e9", "score": "0.6886646", "text": "def plot_carbon(date=get_current_day()):\n\n data_dict = query_carbon(date)\n t = np.linspace(0, 24, num=len(data_dict['data']), endpoint=False)\n actual = []\n forecast = []\n\n for i in range(len(data_dict['da...
[ { "docid": "8701f8c218d75b294e8383deb96a9905", "score": "0.63622636", "text": "def show_prediction(self, test_day_id, predictor, columns=None):\n x, y = self.get_test_day_feature_vectors(test_day_id, columns)\n y_pred = self.predict_day_from_features(x, predictor)\n fig = plt.figure...
4efbd3d16acd0dbf2db7b94b532a587d
Sets the domain name of the given dnssec_name structure.
[ { "docid": "5ccb377ebfff79f9f312cc011ddd6221", "score": "0.76919276", "text": "def set_name(self,dname):\n _ldns.ldns_dnssec_name_set_name(self,dname)", "title": "" } ]
[ { "docid": "27744b65159e841ab281b289653e8674", "score": "0.7482131", "text": "def domain_name(self, value):\n self._domain_name = value", "title": "" }, { "docid": "82a4901269714c116b62d81fd72a380b", "score": "0.674498", "text": "def user_domain_name(self, value):\n sel...
6966f4f326edbcede2735d03ebac20a2
Create and return new C++ Triangulation object
[ { "docid": "d5c51257fe762369c93a541775abb2fa", "score": "0.71772313", "text": "def Triangulation(*args, **kwargs): # real signature unknown\n pass", "title": "" } ]
[ { "docid": "bf4994234014c47bcf4212439e3a09a2", "score": "0.62678784", "text": "def get_triangulation(self):\n return self.__triangulation", "title": "" }, { "docid": "7167e37bce34a2803ad9c85551ed8149", "score": "0.5697933", "text": "def New(*args, **kargs):\n obj = itkT...
1dec5831a0a5d1991be74a4d4edd8dae
Convert a data item of any type into a string such that we can deserialize it later.
[ { "docid": "08851705468b3dfe57f5ffe685cc9516", "score": "0.6217311", "text": "def serialize_serializedata(data):\n\n # this is essentially one huge case statement...\n\n # None\n if type(data) == type(None):\n return 'N'\n\n # Boolean\n elif type(data) == type(True):\n if data == True:\n ...
[ { "docid": "fd54bee57d5fd73584804963147052ac", "score": "0.75119156", "text": "def itemstostr(data):\n if data is False:\n return 'False'\n\n if not isinstance(data, numbers.Number):\n if not data:\n return 'None'\n\n msg = ''\n if isinstance(data, dict):\n fo...
efccf0b7ac25f1ad6fc528e9f037b850
Initialize a LocationSet Object If only a single location is given, a set is still created
[ { "docid": "d17b8fcabfff0be6f2a9be261e0c426d", "score": "0.6724767", "text": "def __init__(self, locations, srs=4326, _skip_check=False):\n if not _skip_check:\n if isinstance(locations, ogr.Geometry) or isinstance(locations, Location):\n self._locations = np.array(\n ...
[ { "docid": "25268a877307d3d8599f57bc0619e3c3", "score": "0.6706208", "text": "def location_set(self):\n location_list = []\n for location in self.location.all():\n location_list.append(location)\n location_set = set(location_list)\n return location_set", "title...
eeb1271439bdf9ce826a91f948de1899
a nice thing for "modify 'random' field instead of the 'next' field in the copied list" is that the original list's next structure is never changed, so you can write a helper generator to visit the original list with a nice for loop encapsulating
[ { "docid": "e847fdf694f0668a5899c76644e2d1b5", "score": "0.73104393", "text": "def copyRandomList(self, head: 'Node') -> 'Node':\n def nodes():\n node = head\n while node:\n yield node\n node = node.next\n\n # create new nodes\n fo...
[ { "docid": "d3f31e4a4b05f7dbafadd393ed49c8a9", "score": "0.70639145", "text": "def copy_random_list(head):\n pstep = qstep = head\n new_nodes = {}\n while pstep:\n new_nodes[pstep] = RandomListNode(pstep.label)\n pstep = pstep.next\n while qstep:\n new_node = new_nodes[q...
1f70d7ea39e8ac5e252f91c8377606cf
return yahoo option chain given maturity
[ { "docid": "e02e080d2a4d270ee4aa4c56241627e9", "score": "0.56962997", "text": "def fromYahoo(sym, maturity, time, rate):\n #print \"Downloading Data ... \"\n year = maturity.strftime(\"%Y\")\n month = maturity.strftime(\"%m\")\n day = maturity.strftime(\"%d\")\n url = \"http://finance.yah...
[ { "docid": "f0746a83c3928ae60345943b469a9c13", "score": "0.6662822", "text": "def get_option_chain(symbol: str, expiry: str):\n\n yf_ticker = yf.Ticker(symbol)\n try:\n chain = yf_ticker.option_chain(expiry)\n except Exception:\n console.print(f\"[red]Error: Expiration {expiry} ca...
e4726b3c6cb0743db7ba8d2ffffaa906
Sets the reasoner_id of this Result.
[ { "docid": "5940c71f7421141dadd11ba6da532904", "score": "0.850189", "text": "def reasoner_id(self, reasoner_id):\n\n self._reasoner_id = reasoner_id", "title": "" } ]
[ { "docid": "34f1dbea12f0b0bd947fab04ac4a25b0", "score": "0.74012935", "text": "def reasoner_id(self):\n return self._reasoner_id", "title": "" }, { "docid": "34f1dbea12f0b0bd947fab04ac4a25b0", "score": "0.74012935", "text": "def reasoner_id(self):\n return self._reasone...
d00999fdadb6b51a7fcb626139b8f8bc
Init the backbone using clip.
[ { "docid": "596cbed0660c6eff651be5bcdb30e484", "score": "0.6292251", "text": "def __init__(self, model_name: str, vis_mode: bool = False):\n super().__init__()\n self.vis_mode = vis_mode\n self.model, _ = clip.load(name=model_name, jit=not vis_mode)", "title": "" } ]
[ { "docid": "9575e2b7120f2d4976342070423f53e4", "score": "0.6526476", "text": "def setClip(self, clip):\n\n self._clip = clip\n\n ## @todo Check the below comment is still the goal, as we're not doing it\n ## right now...\n # If this clip has an entityRefrence instead of a path, we need to re...
8a7594f645da73cebc353b2ff1467ee4
A simple function that does all the default stuff
[ { "docid": "a82b578b7207c650484c89d239a9e0e7", "score": "0.0", "text": "def download_all_separate(urls, name=None):\n\n for url in urls:\n if name == None:\n name = get_min_page_title(url)\n \n print('Fetching list of urls...')\n suburls = get_pdf_urls_rec(url)\n\n ...
[ { "docid": "b2779071b59a5faf77ac8454d83306a0", "score": "0.79775506", "text": "def default():", "title": "" }, { "docid": "58363b93134f33109676d3efd90e9d70", "score": "0.6877584", "text": "def _helper_function(self):\n pass", "title": "" }, { "docid": "a41334c5822a...
30163eae35a86014433d7a8a699735ef
Get a Trusted pyodbc connection to the SQL Server database on server. Try several connection strings.
[ { "docid": "c2c65b3f5394edcf16f8e26629907525", "score": "0.6705438", "text": "def get_connection_or_die(server, database):\n drivers = [\n \"{ODBC Driver 17 for SQL Server}\", # supports SQL Server 2008 through 2017\n \"{ODBC Driver 13.1 for SQL Server}\", # supports SQL Server 2008 t...
[ { "docid": "62fbed0138fad3ba0554c892c4b35462", "score": "0.76228654", "text": "def getSqldatabaseODBCconn(databasename : str, servername : str) -> pyodbc.connect:\r\n\r\n odbcconnstring = getsqldatabaseconnectionstring(databasename=databasename, client='odbc', servername=servername)\r\n \r\n \"...
b4e70fd34a2744dd2216fe0b46fb77a8
Ensure that the specified user cannot update his or her own profile with invalid data
[ { "docid": "27df4f58b7fb421387ea7a3d58a810eb", "score": "0.68820053", "text": "def test_user_invalid_update_user(self):\n\n invalid_payload = {\n 'uid': 'invalid_uid',\n }\n\n self.client.force_authenticate(self.user)\n response = self.client.put(self.user_url, dat...
[ { "docid": "e9d1bc7b7e12c15b021f15f4bac13f1a", "score": "0.7023483", "text": "def test_users_can_not_update_profiles(self):\n url = reverse('profile-update-view', kwargs={'pk': self.user.profile.pk})\n response = self.client.get(url)\n self.assertEqual(response.status_code, 403)", ...
63c34b2c518eb225d89c8f7693dc8400
Returns custom_profile field of FullUser object by Peer object
[ { "docid": "2f39e32aa6c3af37ab882a42c15bddf0", "score": "0.75907224", "text": "def get_user_custom_profile_by_peer(self, peer):\n outpeer = self.manager.get_outpeer(peer)\n\n full_profile = self.internal.users.LoadFullUsers(\n users_pb2.RequestLoadFullUsers(\n use...
[ { "docid": "22d617ffdf6ac975494caaca64b9a99f", "score": "0.67983615", "text": "def get_user_custom_profile_by_nick(self, nick):\n full_profile = self.get_user_full_profile_by_nick(nick)\n\n if hasattr(full_profile, 'custom_profile'):\n return str(full_profile.custom_profile)", ...
b1147b9bb84787bc2b3b5126079ce8f0
displays letters on mdt coordinator form
[ { "docid": "c02d6c2992950278d49b5fcd49d90d67", "score": "0.6999842", "text": "def letters_for_mdt(self,button_no):\n\n self.root10 = Toplevel(self.master)\n self.root10.title(\"Letters\")\n self.letter_for_mdt = PopupLetter(self.root10)\n self.letter_for_mdt.setvariables(self...
[ { "docid": "4d8a5a5beb909e56a6262a10b106609b", "score": "0.6428827", "text": "def clinic_letter(self):\n self.root3 = Toplevel(self.master)\n self.root3.title(\"Clinic letter\")\n self.clinic_letter = ClinicLetter(self.root3)", "title": "" }, { "docid": "d95c2c2d5cef2cdf...
2828a3d15f4a1fe1c18cedb903fa30db
return entire catalog data set in JSON format
[ { "docid": "fad07c3d745ad89f5c953d48ca838c7f", "score": "0.67597187", "text": "def api_catalog():\n catalog = []\n for cat in list_category():\n category = {'category': cat.serialize, 'subcategories': [], 'items': []}\n for sub_cat in list_subcategory(cat):\n sub_cat_items...
[ { "docid": "9affbef7981af7ff998262a2635cdd73", "score": "0.78417176", "text": "def jsonCatalog():\n output = {}\n # Get all the categories from the database\n categories = session.query(CatalogCategory).all()\n for category in categories:\n # Get all items from the category\n i...
f806af227faf183fed349f2dc85d0766
return H0 in m/s/Mpc
[ { "docid": "f84acf596d86d3df53f1292bd2fde37e", "score": "0.72144634", "text": "def H0_def(h):\n return H0_over_h*h", "title": "" } ]
[ { "docid": "4cb2dbcb92095d087dd3edd03e44efe7", "score": "0.66041595", "text": "def Hubble_convert(H_0):\r\n result = H_0*1000.0*3.1536*10**13/(3.09*10**16)/10**6 #This formula convert the Hubble parameter from\r\n #km/s/Mpc to Myr^-1 in order to match the unit convention in this program\r\n ret...
5c20a8e0547bb340204ea5a71ab668a0
Construct error message and append to redirect url
[ { "docid": "4bc1ce0780e53187319db83df141416b", "score": "0.7947118", "text": "def create_error_url(error_number, message, request):\n values = [('error', str(error_number)), ('message', message)]\n query = six.moves.urllib.parse.urlencode(values)\n return request.form['redirect'] + '?' + query"...
[ { "docid": "c9f42fde6177f8384dc6429d7c8ee809", "score": "0.7033951", "text": "def error(message, url=None):\n flash_error(message)\n return flask.redirect(url or referrer_or_home())", "title": "" }, { "docid": "85652d7d86f1f0b34e624aa0ee28da25", "score": "0.69093055", "text": "...
31a441f6568cb17b7ee308f1652aea69
Plot the schedule. Implements the .loc accessor on the series object.
[ { "docid": "5f5f31221ad69873dd07e7afe4f49fdf", "score": "0.63736933", "text": "def plot(self, **kwargs):\n return self.series.plot(**kwargs)", "title": "" } ]
[ { "docid": "7212461e919a1cd33045f3afe4e7ee51", "score": "0.6391678", "text": "def plot_row(self, loc):\n # Print data informations\n print(self.data_names, self.columns)\n if len(self.data_names) == 1:\n self.axes = (self.axes,)\n # Plot all plots\n for ind1...
0b639d9f0a7fa07b672f55ff5afd1133
Returns distance between two nodes and first step to go from source to destination
[ { "docid": "95786797b20cf69827e472958313cf11", "score": "0.67382646", "text": "def get_path_between(self, source_name, destination_name):\n node1 = self.__graph[source_name]\n return node1.distance_vectors[destination_name]", "title": "" } ]
[ { "docid": "3b3b6720761679f51722429445644824", "score": "0.7749197", "text": "def node_distance(self, node1, node2):\n if node1 == node2:\n return 0.0\n for i, (n1, n2) in enumerate(zip(self.paths[node1], self.paths[node2])):\n if n1 != n2:\n break\n ...
f352adeebc77029d897aa03c00285628
Compute classic statistical analysis on series
[ { "docid": "25aa946e4412dba0d2208b26bb3df64b", "score": "0.5817848", "text": "def compute_stats_by_categories(series):\r\n n = float(series.shape[0])\r\n counts = series.value_counts()\r\n\r\n nb_unique = np.float(counts.count())\r\n high_freq = np.float(counts[0] / n)\r\n ...
[ { "docid": "95e11421f31a566c07b9394fac79b018", "score": "0.66061056", "text": "def stata(series):\r\n if series == -1:\r\n return 0\r\n else:\r\n return 1", "title": "" }, { "docid": "108d8cb0bc174afcaf87178ce3e0f4f8", "score": "0.64251745", "text": "def ensemble_...
c82eec161ed334cab973605365dadc31
Get a dictionary of a standard 1D or 2D topology, such as a line or square lattice. Pass boundary_conditions as a kwarg to specifiy the boundary condition of the standard topology.
[ { "docid": "6e2ac803a0f63bdd2ba12054d96b3470", "score": "0.69452333", "text": "def standard_topologies(L, topology: str, **kwargs) -> dict:\n assert topology in ['line', 'rect_lattice'], \"topology must be 'line', 'rect_lattice', received {}\".format(\n topology)\n top = {}\n M = kwargs....
[ { "docid": "aeb2a3b546b375b810521669116d544b", "score": "0.60054445", "text": "def generate_boundary_conditions(boundary_conditions, schematised):\n bcdct = {}\n\n for bndcnd in boundary_conditions.itertuples():\n\n # Find nearest branch for geometry\n # extended_line = geometry.exte...
619c64831216fbcf72d85962ac5164f8
Integrate a system of ordinary differential equations using Euler's 2ndorder method. x_next = euler_integration(xdot,x,h)
[ { "docid": "4d7f46e4872f719f5099495c9734dc52", "score": "0.8602326", "text": "def euler_integration(xdot,x,h):\r\n a = np.array(x)\r\n b = np.array(xdot)\r\n return a + (h*b)", "title": "" } ]
[ { "docid": "9e7275c2be8a969e53e3d494052527ae", "score": "0.65760505", "text": "def heun_integrate_loop(\n dynamics, x0,\n ts):\n x = x0\n xs = []\n for t1, t2 in tqdm(zip(ts[:-1], ts[1:])):\n xdot = dynamics(x, t1)\n xp = x + (t2 - t1) * xdot\n x = x + (t2 - t1) * (dynamics(xp, t2) + x...
f2b86c969a4696a0164ffec80b0e5621
Display a list of the products which have sold the most
[ { "docid": "c5daf769df655ca7eaf290de7838cb96", "score": "0.6261755", "text": "def display_bestsellers(request, count=0, template='product/best_sellers.html'):\n if count == 0:\n count = config_value('PRODUCT','NUM_PAGINATED')\n \n ctx = RequestContext(request, {\n 'products' : bes...
[ { "docid": "2576064d6203b67c608d5e62b15464e4", "score": "0.72025245", "text": "def product_bestseller_view(request, id):\n bestsellers = Product.objects.annotate(\n count_ordered=Count('orderlineitem')).order_by('-count_ordered')[:4]\n\n return render(request, \"product_detail.html\", {\"be...
39efd8ff6b848d3b1328abd0051783e8
Default console logger for simple usage
[ { "docid": "8af795098dfa4d63914b541f324f4b54", "score": "0.69834226", "text": "def get_default_logger():\r\n\r\n _formatter = logging.Formatter(\r\n \"%(asctime)s [%(levelname)s] %(message)s\")\r\n\r\n _ch = logging.StreamHandler()\r\n _ch.setLevel(logging.DEBUG)\r\n _ch.setFormatter(...
[ { "docid": "133798773bb61379d57dad966dc72b20", "score": "0.6992316", "text": "def get_logger():", "title": "" }, { "docid": "8a655a85729cd0d8ff18911030603041", "score": "0.69453794", "text": "def define_logging():\n logging.basicConfig(filename=\"my_program.log\", level=logging.DE...
a95a18dbab5770da45b02ac0a15a2d72
Returns the other player on the same team as this player
[ { "docid": "b9a51946966823c44e7a466f8406dc6d", "score": "0.6965718", "text": "def teammate(game_info, player):\n colour_to_match = game_info['team colours'][game_info['players'].index(player)]\n for second_player, colour in zip(game_info['players'], game_info['team colours']):\n if colour_t...
[ { "docid": "d1af0b45767943b841a97ce27fa7ac37", "score": "0.78770065", "text": "def get_other_player(self):\n pass", "title": "" }, { "docid": "c8147f3750d3fed225a9123b365a5d6d", "score": "0.74182016", "text": "def get_opponent(self, player: str) -> str:\n if player == s...
d6bcfeec3a3c0beed1f5cf9c4156f613
Adds one junction in table net["junction"]. Junctions are the nodes of the network that all other elements connect to.
[ { "docid": "5773062c0ad3dc6162e3175f9e37670c", "score": "0.63616616", "text": "def create_junction(net, pn_bar, tfluid_k, height_m=0, name=None, index=None, in_service=True,\n type=\"junction\", geodata=None, **kwargs):\n add_new_component(net, Junction)\n\n if index and index i...
[ { "docid": "d73e1c16d7d1852b40da56a9280208b8", "score": "0.6284319", "text": "def junctions(self):\n for name, node in self._junctions.items():\n yield name, node", "title": "" }, { "docid": "1caaf9e0c50d08b2eb189e935764c45e", "score": "0.6082226", "text": "def add_...
ddccab44f01cfd1272c3e1d3b1d74a2f
Returns a creds dictionary filled with parsed from env Keystone API version used is 3; v2 was deprecated in 2014 (Icehouse). Along with this deprecation, environment variable 'OS_TENANT_NAME' is replaced by 'OS_PROJECT_NAME'.
[ { "docid": "930d77d9271154908bc8ceb0d75f9d39", "score": "0.7885217", "text": "def get_credentials():\n creds = {'username': os.environ.get('OS_USERNAME'),\n 'password': os.environ.get('OS_PASSWORD'),\n 'auth_url': os.environ.get('OS_AUTH_URL'),\n 'project_name': os...
[ { "docid": "bed505a02aaa58a3b3f4c21e66231637", "score": "0.82458955", "text": "def get_keystone_creds():\n d = {}\n d['username'] = environ['OS_USERNAME']\n d['password'] = environ['OS_PASSWORD']\n d['auth_url'] = environ['OS_AUTH_URL']\n d['tenant_name'] = environ['OS_TENANT_NAME']\n ...
8570cead08dbc65508c2b57b69d9fc70
Return the filepath with the written walks \ [from_tag, to_tag, weight] = (str, str, int)
[ { "docid": "b2655a6d2d49e6bc8748e5279a736a92", "score": "0.49370837", "text": "def tag_walker(params, info, pre_res, **kwargs):\n \n res = params_handler(params,info,pre_res)\n\n prefix = \"simrank_iter(%d)_eps(%d)_r(%d)\" % (params[\"max_iter\"], params[\"eps\"],params[\"r\"])\n res[\"walk_...
[ { "docid": "b96c9655ee19bc5d85c4a9b6f306179c", "score": "0.57588494", "text": "def get_weighted_file(self, term_char):\n if term_char in self.char_range(\"a\",\"f\"):\n return (\"models/mergedWeighted/a-f.txt\", (\"a\", \"f\"))\n elif term_char in self.char_range(\"g\",\"p\"):\n...
b97fa14019e5127d89808594d6b98a51
Function to read the username
[ { "docid": "3b48750a894c6313f3f93a7b4cd12694", "score": "0.0", "text": "def get_user(self, username):\n\n\t\tself.username = username", "title": "" } ]
[ { "docid": "c9ba6875370818c1d0ced1bfcad2af80", "score": "0.8053713", "text": "def getUserName() -> unicode:\n ...", "title": "" }, { "docid": "5a84c606cbc209a3b0f8b6682b7e7ee9", "score": "0.7873471", "text": "def get_username():\n username = input(\"Username: \")\n retur...
22f0ff35d9ea8f9da35203356dd04f0f
Function that calculates the last person location of the josephus problem
[ { "docid": "cfbac83164862aa9ecb785fd65188313", "score": "0.0", "text": "def josephus(n, k):\n # special case, k = 1\n if k == 1:\n return n - 1\n # base case, if only one person left, they win\n elif n <= 1:\n return 0\n if k <= n:\n num_dead = n / k\n else:\n ...
[ { "docid": "584fe4eb5bc1473944b252949263b46a", "score": "0.56745833", "text": "def last_location(self, user_id):\n user_ref = self.get(user_id)\n return user_ref.last_location", "title": "" }, { "docid": "30fff688eaa73a699831d0961728c923", "score": "0.56577885", "text": "def ge...
4747fb4c562a3f8a407485fb9c766a41
Return dictionary of phase angles for all EVSEs in the network.
[ { "docid": "525ceb20148896a6f3672097518e9f27", "score": "0.74022955", "text": "def phase_angles(self) -> Dict[str, float]:\n return {\n self.station_ids[i]: self._phase_angles[i]\n for i in range(len(self._phase_angles))\n }", "title": "" } ]
[ { "docid": "776da258a9c29fe5afb1e90ee8672a47", "score": "0.5651817", "text": "def get_degree(self):\n u_degree = {}\n for edge_tp in config.edge_type:\n u_degree[edge_tp] = {}\n node_list = self.node_type[edge_tp[0]]\n for u in node_list:\n u...
3f787ca4a821fd432142397a8795ba06
Read a publisher by its href.
[ { "docid": "41de1becc31fd486b203d8fdaf0dc7f5", "score": "0.6052781", "text": "def test_02_read_publisher(self):\n publisher = self.client.get(self.publisher['_href'])\n for key, val in self.publisher.items():\n with self.subTest(key=key):\n self.assertEqual(publis...
[ { "docid": "a7f1e55f5aeb78cb808fb3b652ebcdc4", "score": "0.67622393", "text": "def read(self, href):\n return self._read(href)", "title": "" }, { "docid": "a7f1e55f5aeb78cb808fb3b652ebcdc4", "score": "0.67622393", "text": "def read(self, href):\n return self._read(href)...
b3eb43241168d6d93da0694621b098c1
Get number of stars given from GitHub users to repositories created by this user
[ { "docid": "37a09208876bd7a9925f5f9a43726e11", "score": "0.5487575", "text": "def getStars(self):\n return self._stars", "title": "" } ]
[ { "docid": "d22cbb26a191059849243c4fc9e0d882", "score": "0.638393", "text": "def rankContributors(list_contributor_logins):\n token_from_user = input('token :')\n connection_string = {'Authorization': 'token ' + token_from_user}\n baseUrl = 'https://api.github.com'\n average_star_ranking = [...
e4a891cf8eed1800dc1d44c125870cc1
Split a dataset into train, validation and test sets
[ { "docid": "b0f701fd35dce87a92a1f8f81cd26d34", "score": "0.0", "text": "def train_val_test_split(\n reframed, n_hours, n_features, target_var=\"temp\", ascending_sampling=False\n):\n\n n_train_hours = int(reframed.shape[0] * 0.6)\n n_val_hours = int(reframed.shape[0] * 0.2)\n\n if ascending_...
[ { "docid": "c80892f3a5b6d0c68e2fae68d7dd7c2f", "score": "0.8654461", "text": "def __split_dataset(self):\n self.train, self.valid, _, _ = train_test_split(self.data, self.data, test_size=0.2)\n self.valid, self.test, _, _ = train_test_split(self.valid, self.valid, test_size=0.5)", "tit...
f9d5746b3e0e7fa99c8bd158eef3fb12
>>> lnk = Link(1, Link(1, Link(1, Link(5)))) >>> unique = remove_duplicates(lnk) >>> len(unique) 2 >>> len(lnk) 2
[ { "docid": "9a46b7d1b94081f5f4118fff7b3d3919", "score": "0.7803838", "text": "def remove_duplicates(lnk):\n\tif lnk is Link.empty or lnk.rest is Link.empty:\n\t\treturn lnk \n\tif lnk.first == lnk.second:\n\t\tlnk.rest = lnk.rest.rest\n\t\tremove_duplicates(lnk) \n\t\treturn lnk \n\tremove_duplicates(ln...
[ { "docid": "18466a6c14eb2387e8dc585a041098c1", "score": "0.7703053", "text": "def remove_duplicates(lnk):\r\n\tif lnk is Link.empty or lnk.rest is Link.empty:\r\n\t\treturn lnk\r\n\telif lnk.first == lnk.rest.first:\r\n\t\tlnk.rest = lnk.rest.rest\r\n\t\tremove_duplicates(lnk)\r\n\t\treturn lnk\r\n\tels...
ce60256e482d643823f4598155fe8c52
Fuzzy AND operator is minimum of two numbers.
[ { "docid": "8964abb2e36534b12ef3e0f4f939f44a", "score": "0.81514597", "text": "def FuzzyAND(aNumber, bNumber):\n if IsNumber(aNumber) and IsNumber(bNumber):\n return min(aNumber, bNumber)\n\n else:\n return None # return None if errors", "title": "" } ]
[ { "docid": "a778de176172150762eb45800c58ec0b", "score": "0.66924685", "text": "def min_and(a, b, c, d, w):\n m = 1 << (w - 1)\n while m != 0:\n if (~a & ~c & m) != 0:\n temp = (a | m) & -m\n if temp <= b:\n a = temp\n ...
dcc35b007b0168e36cccb1ebb33e1236
Use an existing TCA decomposition to fit trials from disengaged and sated days. Compare ratio of trials disengaged vs engaged using a ramp index.
[ { "docid": "4f987da9e3070edce8658ed69d46ea60", "score": "0.4711248", "text": "def fit_disengaged_sated(\n mouse,\n trace_type='zscore_day',\n method='mncp_hals',\n cs='',\n warp=False,\n word=None,\n group_by='all',\n nan_thresh=0.85,\n scor...
[ { "docid": "bd17fa02a4dbdbc1712c5f672969e866", "score": "0.5465664", "text": "def calibrateTAC(self,data):\n # scan through data and get mean peak positions in a fairly crude search\n peakpos=[]\n N=len(data)\n x=np.arange(N)\n i=2\n while i<N-6:\n if...
7f9d5418820abd5a3fb1eeb16d43f7e5
calculates geometric mean longitude of the sun
[ { "docid": "4b5b203e8fb4d48ba68d05372223bb63", "score": "0.0", "text": "def get_geomean_long(ajc: FlexNum):\n\n geomean_long = (280.46646 + ajc * (36000.76983 + ajc * 0.0003032)) % 360\n return geomean_long", "title": "" } ]
[ { "docid": "f4bee6dfdd1c5255c98874e24413ec49", "score": "0.6482157", "text": "def area(lat,lon):\n lat_r = np.radians(lat)\n lon_r = np.radians(lon)\n f=2*omega*np.sin(lat_r)\n grad_lon=lon_r.copy()\n grad_lon.data=np.gradient(lon_r)\n\n dx=grad_lon*earth_radius*np.cos(lat_r)\n dy=n...
429176e432616849a696358c7ab89eec
import data domain on different dc during the operation restart vdsm
[ { "docid": "bbda6735a49e3ea4a6f969b35f1e4e48", "score": "0.73865354", "text": "def test_restart_vdsm_during_import_domain(self):\n self._restart_component(\n test_utils.restartVdsmd, config.HOSTS[0], config.HOSTS_PW\n )", "title": "" } ]
[ { "docid": "ff2d46360f0b78ddce8577fd44178d94", "score": "0.61138797", "text": "def test_restart_engine_during_import_domain(self):\n self._restart_component(\n test_utils.restart_engine, config.ENGINE, 10, 300\n )", "title": "" }, { "docid": "769d079ef98b133b3b0fa6bd...
e40aaf68aab09718ffdf709621911853
Returns Kusto data type string equivalent of python object
[ { "docid": "46a4950c3c3147c40727eb3871eb97e8", "score": "0.5660054", "text": "def GetColumnType(self,item):\n if isinstance(item, str):\n return \"string\"\n elif isinstance(item, bool):\n return \"bool\"\n elif isinstance(item, datetime):\n return \...
[ { "docid": "3c802d2918cfa947df478be773cad2df", "score": "0.6989038", "text": "def value_type_str(self):\r\n return self._vkrecord.data_type_str()", "title": "" }, { "docid": "6dc7ff1670080c39bb4a26ecef2c5299", "score": "0.6857374", "text": "def dataType(self):\n return io.d...
7182873bb7fa9aeaedc833522527959a
Start process for periodical metrics publishing.
[ { "docid": "9dc9198b33cbaeaac343fa91ee46e10e", "score": "0.6862031", "text": "def run(self):\n print(f\"Start publishing metrics each {self.check_timeout} seconds\")\n try:\n while True:\n self._step()\n time.sleep(self.check_timeout)\n excep...
[ { "docid": "f447ae54301e15a0407b756c5941b2e1", "score": "0.62567204", "text": "def start_publishing(self):\r\n self.LOGGER.info(\"Issuing consumer related RPC commands\")\r\n self.enable_delivery_confirmations()\r\n self.schedule_next_message()", "title": "" }, { "docid"...
11d22fe9a3cc442fd63806cfe92823a9
Inferences DeepLab model and visualizes result.
[ { "docid": "b2b6c84a58a39de71fb3f094ecbdb6e1", "score": "0.0", "text": "def run_visualization(SAMPLE_IMAGE, MODEL):\n original_im = Image.open(SAMPLE_IMAGE)\n seg_map = MODEL.run(original_im)\n vis_segmentation(original_im, seg_map)", "title": "" } ]
[ { "docid": "1439180aba664f6d439d7964ba78802a", "score": "0.6432368", "text": "def Inference(self):\n p = self.params\n subgraphs = {}\n with tf.name_scope('inference'):\n input_placeholders = self._Placeholders()\n predictions = self.ComputePredictions(self.theta, input_placeholders)\...
c8306e2273058966a234d835b7e1a3bc
Called when a connection is retrieved from the Pool.
[ { "docid": "5681a542d64da8c118b62e792bcbcb8b", "score": "0.0", "text": "def connection_checked_out(self, dic):", "title": "" } ]
[ { "docid": "30b14013ba3808f88d7851d47d0eca76", "score": "0.7331757", "text": "def handle_establishing_connection(self):\r\n pass", "title": "" }, { "docid": "5aa9447772e95aecfb8117b137e3462f", "score": "0.69465435", "text": "def return_connection_to_pool(pool, conn):\n\n\tpool...
430c32fd50beaf87187b11238c48ff2e
Compress a directory history into a new one with at most 20 entries. Return a new list made from the first and last 10 elements of dhist after removal of duplicates.
[ { "docid": "8fdb423663e59bdafa76039572b781d1", "score": "0.7217732", "text": "def compress_dhist(dh):\n head, tail = dh[:-10], dh[-10:]\n\n newhead = []\n done = set()\n for h in head:\n if h in done:\n continue\n newhead.append(h)\n done.add(h)\n\n return ...
[ { "docid": "bec98a3ef0a4d69b35bd258fae83c107", "score": "0.5557128", "text": "def make_history(self):\n hist.create_history()", "title": "" }, { "docid": "ddafa5286413b46971343bdc88582d91", "score": "0.5521702", "text": "def sorted_histogram(d):\n\n\tlisted_histogram = dictionary_...
a4e03b79f4bca472bc5d55a46f02d91a
Calculate the maximum of (self.y, self.left.max, self.right.max)
[ { "docid": "cb6643a0cbd1f47373fee401e0f44e63", "score": "0.84987015", "text": "def maximum(self):\n t1 = self.y\n t2 = self.left.max if self.left is not None else 0\n t3 = self.right.max if self.right is not None else 0\n if t2 > t1:\n t1 = t2\n if t3 > t1:\...
[ { "docid": "8645674f1401514dff619e4bd5cd2d62", "score": "0.76793355", "text": "def get_max(self):\n current = self\n while current.right is not None:\n current = current.right\n return current.val", "title": "" }, { "docid": "9e0226fd16b1e0e69bc62a65761ac880",...
fe15ac4f58fda9fc416b73632a43a992
Load a benchmarking dataset.
[ { "docid": "9dbfb2ad6a3d33a44ec1a3dd2a278eeb", "score": "0.63846135", "text": "def load_dataset(name, version):\n dataset_dir = os.path.join(DATA_DIR, name)\n dataset_ver_dir = os.path.join(dataset_dir, version)\n\n if not os.path.isdir(dataset_dir):\n raise FileNotFoundError(\"Dataset d...
[ { "docid": "7cfee186bf8f388df2bc0aed803dbe78", "score": "0.6830046", "text": "def load_dataset():\n\n\n train_dd_loader = DailyDialogLoader(PATH_TO_TRAIN_DATA, load=False)\n train_dataloader = DataLoader(train_dd_loader, batch_size=16, shuffle=True, num_workers=0,\n coll...
95db07da0ed40d43a308444d43d99a7b
Push the current branch to upstream.
[ { "docid": "8c862767a70a436fa1af6befe0354bf3", "score": "0.7993709", "text": "def push_upstream(self, remote_branch):\n raise NotImplementedError", "title": "" } ]
[ { "docid": "e11013d3cd4286379a7ffac73991c3fc", "score": "0.7736781", "text": "def push_branch(self, branch: str) -> None:\n self.git(\"push\", \"origin\", branch)", "title": "" }, { "docid": "bb11a6094d9e5e453461617be6de1d1c", "score": "0.7610119", "text": "def push(self):\n ...
9e8dd24d36b31110b38f0807a9141d3d
Test if self and `other` are equivalent.
[ { "docid": "5b117e18d148dcdd3502a5108507265c", "score": "0.0", "text": "def is_equivalent(self, other, name, logger, tolerance=0.):\r\n if not isinstance(other, Vector):\r\n logger.debug('other is not a Vector object.')\r\n return False\r\n for component in ('x', 'y',...
[ { "docid": "a2616b8d27fad6adfe1fba7498c9baef", "score": "0.86753935", "text": "def equivalent(self, other):\n if not isinstance(other, type(self)):\n return False\n\n return self.value == other.value", "title": "" }, { "docid": "5603ab4689d39104367b5bb58c292f37", "score...
0923e54fbef2198369ff49b9b46e4e07
Writes the KPC log file from the buffer of operations self.operationList According to self.writeMode, will append to existing log file or overwrite it. Returns True if anything was OK, false in case of problem in writing, undefined kpc path or empty operations buffer. File format KPC logs are tsv (comma separated value...
[ { "docid": "a80052cac2dc7cb8d8b37d040ef5640a", "score": "0.762399", "text": "def writeKpc ( self ) :\r\n\r\n # no kpc file\r\n \r\n if self.isEmpty( self.kpcPath ) : return False\r\n\r\n # builds the log of KPC operations in memory\r\n\r\n ok = self.buildKpc()\r\n\r\n ...
[ { "docid": "1b9584388ed2797e3ac4493b47c5e194", "score": "0.5652837", "text": "def write_log(self, log):\n # Write the logged data.\n print 'Writing logged data from operation:', self.name, '...'\n\n # Create sub-group.\n oplog = log.create_group(self.name)\n\n # Make s...
2f55ef1f4fca4ad91ec1ff63856ee00c
The names of compiler plugins to use when compiling this target with javac.
[ { "docid": "4607f0ad0d24f053e4feb607762f548f", "score": "0.762797", "text": "def javac_plugins(self):\n return self.payload.javac_plugins", "title": "" } ]
[ { "docid": "4d9b710546bd7b1d9c92e1e084820ad8", "score": "0.68274903", "text": "def javac_plugin_args(self):\n return self.payload.javac_plugin_args", "title": "" }, { "docid": "9cb35a40dadcbcd80804765b9d7d0e98", "score": "0.6647237", "text": "def scalac_plugins(self):\n return ...
8e0cc9102fb9d52e13b29eef1560b904
Target is a Dataset object
[ { "docid": "bea4b49d375501378354a28312b06e60", "score": "0.6221573", "text": "def test_migration_target_dataset_dataset(self, Create):\n Create.side_effect = fake_migration_create\n\n source = self.client.Dataset(1)\n target = self.client.Dataset(2)\n migration = source.migra...
[ { "docid": "cbefba46a5381909814bc503a7964e60", "score": "0.7230855", "text": "def dataset(self):\n raise NotImplementedError", "title": "" }, { "docid": "26031e4d686dcb61088a13967b562361", "score": "0.6850486", "text": "def get_dataset(self):\n \n return self.d...
01b1f2664d447a7c59a1bff41407a3fb
Deinterlace all frames rather than just the frames identified as interlaced. The default is `false`.
[ { "docid": "05394e7df54450c959e3f4feef784be2", "score": "0.8239616", "text": "def deinterlace_all_frames(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"deinterlace_all_frames\")", "title": "" } ]
[ { "docid": "3f58a6e2dd8475dc3c90e5e374d5eb26", "score": "0.6910056", "text": "def deinterlace(self) -> Optional[pulumi.Input['DeinterlaceArgs']]:\n return pulumi.get(self, \"deinterlace\")", "title": "" }, { "docid": "d7b29547aae938a385937022cd3b51da", "score": "0.6562976", "t...
be52a3ae4258344a6cd99b72a6d1dccd
Using challenge id and user_id from the session, get all attributes that matched for that user to complete the challenge
[ { "docid": "0de95ad9ee49b4d82546a66c4d033dbf", "score": "0.565714", "text": "def matched_attributes():\n user_challenge_id = request.args.get('user_challenge_id')\n categories = UserChallengeCategory.query.filter(UserChallengeCategory.user_challenge_id==user_challenge_id).all()\n winning_tags_t...
[ { "docid": "2a68dcc3efe7a2dbc0131b7093d361ce", "score": "0.5634904", "text": "def example_data():\n import datetime\n\n # Amazing. A dimension where all proper nouns begin with \"Schmla\":\n u1 = User(username='Shmlony', password='123', email='shmlony@email.com', \n phone='111-22...
ed0eee55e45052cf7e06916c07afd9bc
Helps to list all specified files in package including files in directories since `package_data` ignores directories.
[ { "docid": "09bad0013a0dd4d825a9a8815b823eca", "score": "0.822155", "text": "def get_package_data_files(package, data, package_dir=None):\n if package_dir is None:\n package_dir = os.path.join(*package.split('.'))\n all_files = []\n for f in data:\n path = os.path.join(package_dir...
[ { "docid": "9b9c693e91e50e7f0a9168a1f2600086", "score": "0.76190716", "text": "def find_package_data(data_root, package_root):\n files = []\n for root, dirnames, filenames in os.walk(data_root):\n for fn in filenames:\n files.append(relpath(join(root, fn), package_root))\n ret...
a4f43756e38427187545affc135b545a
Scripted pipeline to process FluoXAS data
[ { "docid": "f548e1d390f916c338f7efeac824c7ee", "score": "0.0", "text": "def tasks(**parameters):\n tasks = []\n\n # Common parameters\n commonparams = task_parameters(parameters, \"common\")\n sinstrument = require_pop(commonparams, \"instrument\")\n coutputparent = commonparams.pop(\"out...
[ { "docid": "229a4bdd48a9e744c6b38a6794e0beb5", "score": "0.7169673", "text": "def pipeline():\n indexTargetsProcesses()\n #Start the mapping operations\n mappingProcesses()\n extractingProcesses()\n graphingProcesses()\n formatOutput()", "title": "" }, { "docid": "20e842fa3...
46a7ecaa379a016942a993503469a8bd
Sets up _client as a test emulation of DynamoDB. Creates the full database schema, a test user, and two devices (one for mobile, one for webapplication).
[ { "docid": "b8c6dbd3d74a7ed974009238bb7c1f6d", "score": "0.0", "text": "def setUp(self):\n super(LocalClientTestCase, self).setUp()\n options.options.localdb_dir = ''\n self._client = LocalClient(test_SCHEMA)\n test_SCHEMA.VerifyOrCreate(self._client, self.stop)\n self.wait()", "title...
[ { "docid": "215dfd1ba1c84a029e7042c351b19542", "score": "0.7453459", "text": "def setUp(self):\r\n super(DynamoDBClientTestCase, self).setUp()\r\n options.options.domain = 'goviewfinder.com'\r\n secrets.InitSecretsForTest()\r\n self._client = dynamodb_client.DynamoDBClient(schema=vf_schema.S...
e5f2f01e2cb575c68541ea2684aa4630
Performs wavelet analysis on a dataset
[ { "docid": "9374964ad45102ff7b307bf9cb0a8173", "score": "0.646736", "text": "def analyze(data, wavelet=DEFAULT_WAVELET, scales=None, dt=1., dj=0.125, \n mask_coi=False, frequency=False, axis=-1):\n n = data.shape[axis]\n if scales is None:\n s0 = find_s0(wavelet, dt)\n scales = fi...
[ { "docid": "9ac1013ef45a01eb02ad55a7f60cad55", "score": "0.65809494", "text": "def model_data(self,wav,dt,t0,minf,maxf,vel,ref,jf=1,nrmax=3,eps=0.,dtmax=5e-05,time=True,\n ntx=0,nty=0,px=0,py=0,nthrds=1,sverb=True,wverb=False) -> np.ndarray:\n # Save wavelet temporal parameters\n n...
3730c0df8cc293579f9a43739d4d8bd5
The schedule revision is a hash of all information pertaining to scheduling. Information unrelated to scheduling, such as the content being sent at each event, is excluded. This is mainly used to determine when a TimedScheduleInstance should recalculate its schedule.
[ { "docid": "00de47933eb7aa28f72bfee4adb6acfc", "score": "0.67214155", "text": "def memoized_schedule_revision(self):\n schedule_info = json.dumps([\n self.schedule_length,\n self.total_iterations,\n self.start_offset,\n self.start_day_of_week,\n ...
[ { "docid": "377bccb579075d99456edaf07e00a004", "score": "0.5524533", "text": "def getSchedule(self):\n self.lock.acquire()\n a = copy.deepcopy(self.db['schedule'])\n self.lock.release()\n return a", "title": "" }, { "docid": "f30551ea8dab794a14118979c8ffc5da", ...
7732ef5dc803d85b05c82625d85d48f2
prepare OR context and execute expression
[ { "docid": "6361845e59c9b253bf001a7d73df29d2", "score": "0.0", "text": "def eval_expression(row, position, exp, context=None, names=None):\n if names is None:\n names = [str(i) for i in range(len(row))]\n\n context = context or {}\n if exp.startswith(\"jython:\"):\n grow = PythonR...
[ { "docid": "48f23340b21889fa9170acc5a7849bab", "score": "0.648527", "text": "def or_op():\n pass", "title": "" }, { "docid": "304ac77c9b814aabb7da3a229df37c6c", "score": "0.59999174", "text": "def OrOp(query1, query2):\n return or_(query1, query2)", "title": "" }, { ...
e454e8481461c2be828dba7a7a98f306
Stemming removes morphological affixes from words, leaving only the word stem.
[ { "docid": "567150460c8a9ff3eecc454545e03755", "score": "0.0", "text": "def stemming_list(text, lang='en', static=False, file_name='stemming'):\n input_check.input_check_list(text)\n # stemmed word list\n stem_words = []\n # original word list which is affected\n org_words = []\n # aff...
[ { "docid": "6eb9d5543e2474464062b5a21ffa97f7", "score": "0.73459184", "text": "def stemmatize(self,word):\n lemma = self.lemmatizer.lemmatize(word)\n stem = (SnowballStemmer(self.language).stem(lemma))\n return stem", "title": "" }, { "docid": "5aaa75487e993bb8da339404ce...
27e06f08a255f180d74f118ba04c4cff
Construct a set from an optional iterable.
[ { "docid": "169e10ec180b8373d94d59cbe9025b7e", "score": "0.0", "text": "def __init__(self, iterable=None):\n self._data = {}", "title": "" } ]
[ { "docid": "e895aaf55199175e96e8bcf24c88bfc8", "score": "0.58696115", "text": "def _set_converter(itr):\n if isinstance(itr, (list, tuple, set)):\n itr = FiniteSet(*itr)\n if not isinstance(itr, Set):\n raise TypeError(\"%s is not an instance of list/tuple/set.\"%(itr))\n return i...
2512f4358d650d9a6b61cfdee9732344
Sets self.shows[sid] to a new Show instance, or sets the data
[ { "docid": "f4ab11d734e8689914c9c62d1598b696", "score": "0.7529713", "text": "def _setShowData(self, sid, key, value):\n if sid not in self.shows:\n self.shows[sid] = Show()\n self.shows[sid].data[key] = value", "title": "" } ]
[ { "docid": "93f78bc096cb794dcae5cf286618c245", "score": "0.7073067", "text": "def _setItem(self, sid, seas, ep, attrib, value):\n if sid not in self.shows:\n self.shows[sid] = Show()\n if seas not in self.shows[sid]:\n self.shows[sid][seas] = Season(show=self.shows[si...
ededc25806c7e733b395325eb53820d9
Return the annotation identifier of a voxel
[ { "docid": "4502f434a8b56ae53b07b3473d7b6610", "score": "0.753712", "text": "def annId ( imageargs, dbcfg, proj ):\n\n # Perform argument processing\n (resolution, voxel) = restargs.voxel ( imageargs, dbcfg )\n\n # Get the identifier\n db = emcadb.EMCADB ( dbcfg, proj )\n return db.getVoxel ( resol...
[ { "docid": "9fde52d6bec0b855d2448c514c6d2fda", "score": "0.7325891", "text": "def annotation_id():", "title": "" }, { "docid": "128cf272ffe0aac6ae2b2d999125c768", "score": "0.6396383", "text": "def get_idx(self, idx):\n return self._annotations[idx]", "title": "" }, { ...
610f4e95b64e6e0bd1051cb22ac0bad4
Updates qtable entries using the temporal difference formula. This allows the AI to learn from its experiences
[ { "docid": "9946043d3d89ddc6196c7da07911d7ff", "score": "0.0", "text": "def update(qtable, state, next_state, next_turn):\n\n # Calculate unique index for the given state\n state_idx = state_idx_calc(state)\n size = state.shape[0]\n\n # Given the two input states, calculates what action was ...
[ { "docid": "62aaf30d5e9e5dc5a7234e336139c895", "score": "0.6334579", "text": "def updateQTableFromTerminatingState( self, reward ):\n \n # retrieve the old action value from the Q-table (indexed by the previous state and the previous action)\n old_q = self.q_table[self.prev_s][self....
957d25b4cc0857853323e278b3053c9d
Get determinant coefficient with appropriate Fermi anticommutation factor
[ { "docid": "d5354811821ddff15942473cad0e8efa", "score": "0.6345779", "text": "def get_det_coeff(self, det):\n\t\tif det in self.det_coeffs:\n\t\t\treturn self.det_coeffs[det] * self.dets[det].parity(det)\n\t\treturn 0", "title": "" } ]
[ { "docid": "413fc5941756b2ca7da1865bf4e82869", "score": "0.7301002", "text": "def __determinant(a, b, c, d, e, f, g, h, i):\n return (a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g)", "title": "" }, { "docid": "c318f71da8bb3c2e134b577fed78eed9", "score": "0.7147...
76d126eea30c50235a8ef21afcddc67d
Generate patch files from git
[ { "docid": "75757dfcc998005c155116c28200b707", "score": "0.69303894", "text": "def generate_patches(repo, start, end, outdir, options):\n gbp.log.info(\"Generating patches from git (%s..%s)\" % (start, end))\n patches = []\n commands = {}\n for treeish in [start, end]:\n if not repo.h...
[ { "docid": "13e1bf6c03a59fdbfb8b61d2bcf63c17", "score": "0.64661807", "text": "def main_git():\n proc = subprocess.Popen([\"git\", \"diff\", \"scala\"], stdout=subprocess.PIPE)\n out = proc.communicate()[0].decode()\n\n RE = re.compile(\"([-+])Subproject commit (.*)\")\n frm = None\n to =...
e18251726218e5936eb8605f9f04d110
give me a user_id in the form of 'uXXXX'
[ { "docid": "ec4e0b8244530275a791e03288448b60", "score": "0.0", "text": "def get_userinfo(uid):\n \n eid = uid2eid[uid]\n e = employees[eid]\n print e", "title": "" } ]
[ { "docid": "4f71559f237c6bd50f41ad164cdfc301", "score": "0.7902427", "text": "def get_id(self):\n return unichr(self.user_id)", "title": "" }, { "docid": "5e2591c6a2c9484be5577e4c7b5c3b36", "score": "0.7891965", "text": "def get_id(self):\n\n if self.user_id is None:\n ...
877bc523dd420b983205c4724c8c77cc
[Lib] [Execution] End special bonfire_ignition
[ { "docid": "f7310469a480ff478ee01856da1f055a", "score": "0.0", "text": "def event_m10_14_x34(z132=10141800, z133=100461):\n \"\"\"State 0,6: Bonfire light action\"\"\"\n PlayerActionRequest(5)\n assert PlayerIsInEventAction(5) != 0\n \"\"\"State 7: Wait for action to finish\"\"\"\n Compar...
[ { "docid": "09fa8d184abc69524635a80b17e528e2", "score": "0.7245591", "text": "def end(self):", "title": "" }, { "docid": "09fa8d184abc69524635a80b17e528e2", "score": "0.7245591", "text": "def end(self):", "title": "" }, { "docid": "09fa8d184abc69524635a80b17e528e2", "...
3e349e869d2d23310c3da45b57fb9122
Guarda la ruta provista en un archivo
[ { "docid": "ae18d5c30da4ea6513ccecd13d3e7907", "score": "0.69561684", "text": "def guardar_ruta(archivo, texto):\n with open(archivo, \"w\") as ruta:\n ruta.write(f'{texto}')", "title": "" } ]
[ { "docid": "a0db7e7417ae67d4ecf2a8d426768e28", "score": "0.67659104", "text": "def save(self, path):", "title": "" }, { "docid": "ee03039bec37e652f2d5f497ae526009", "score": "0.62812024", "text": "def guardar(self):\n self.imagen_actual.save(\"imagen_nueva.png\")", "title"...
5f1819f5b4ebc4f2621b3a11660cf2bf
Show a count of blogs in this category
[ { "docid": "8fb1cdd1839cf8a11498e093eaf91fb3", "score": "0.0", "text": "def post_count(self, obj):\n\n # Note: This is purposefully not optimized\n return obj.post_set.count()", "title": "" } ]
[ { "docid": "4b2c11de80b88c2e074f7ce853f05876", "score": "0.6901813", "text": "def get_count(self) -> int:\n return self.category_stats[\"count\"]", "title": "" }, { "docid": "d279e5aabcf4bd97da404d7b701cf755", "score": "0.65567595", "text": "def get_category_count(self):\n...
4b405ac332f6951a2c37f3ee664e8eb7
Should provide a temp file that's cleared on exit.
[ { "docid": "233240173585dcf5e01fbf13e8ccc91d", "score": "0.6800151", "text": "def test_get_temp_file(self):\n with get_temp_file() as temp_file:\n self.assertTrue(os.path.exists(temp_file))\n self.assertTrue(os.path.isfile(temp_file))\n self.assertFalse(os.path.exists...
[ { "docid": "1087f27ba0104a5b15f7422f68647085", "score": "0.76812315", "text": "def __reset_file(self):\n portable.remove(self.test_fn)\n self.test_fh, self.test_fn = tempfile.mkstemp(\n dir=self.test_path)", "title": "" }, { "docid": "06f7b7f9...
70b836134d58047b1b9f8f729a58ab4a
See examples/listusers for example usage.
[ { "docid": "98fb1c0d9c35be01ffde49e865713388", "score": "0.0", "text": "def get_users(self, request: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:\n return self.call_endpoint(\n url=\"users\",\n method=\"GET\",\n request=request,\n )", "title": ""...
[ { "docid": "628df88ba64f2c1e56b7ec98c4ae02e3", "score": "0.8584034", "text": "def get_users():\n api.list_users()", "title": "" }, { "docid": "810984be17a4b999aff0f666e87351b7", "score": "0.8257032", "text": "def list_users():\n users = User.query.all()\n\n return render_tem...
d3f45a02137a2a5293cd77ddd7b22297
This function can be used to verify that .npy file contains the right labels, by regenerating the semantic segmentation array from the .npy file.
[ { "docid": "bcc81de761596d5852d5140baa0784cd", "score": "0.0", "text": "def regen_img_from_npy(path_npy, path_img='/home/js/PycharmProjects/gym-duckietown-generate-fp/sample/test4.png'):\n\n color_map = {'white': np.array([255, 255, 255]), 'yellow': np.array([255, 255, 0]), 'left': np.array([255, 0, ...
[ { "docid": "181990efde8f09ae8a740812134a80ed", "score": "0.65193164", "text": "def test_segmentation_save_load(self):\n\n segmentation = Segmentation('test.annot', [1, 1, 2, 2])\n segmentation.add_label(0, Label('no label', (0, 0, 0, 255)))\n segmentation.add_label(1, Label('label 0...
72193bd1b65736259484f9f7739c5321
Automatically removes code blocks from the code.
[ { "docid": "a2cd6552c0b31eb32886d54a47d3c8c7", "score": "0.6670364", "text": "def cleanup_code(self, content):\n # remove ```py\\n```\n if content.startswith('```') and content.endswith('```'):\n return '\\n'.join(content.split('\\n')[1:-1])\n\n # remove `foo`\n re...
[ { "docid": "f6761198124dad601935ec29835a76c1", "score": "0.66694766", "text": "def cleanup_code(self, content):\n # remove ```py\\n```\n if content.startswith('```') and content.endswith('```'):\n return '\\n'.join(content.split('\\n')[1:-1])\n # remove `foo`\n ret...
16a46ab61728cbb4b559837c838ffb03
Check if all direct descendents are terminal.
[ { "docid": "46ef1e20bf80b2309cf7fc7348befd97", "score": "0.6559002", "text": "def is_preterminal(self):\n if self.root.is_terminal():\n return False\n for clade in self.root.clades:\n if not clade.is_terminal():\n return False\n return True", ...
[ { "docid": "b4fc0b37e187cf20daa0bbb2097879ed", "score": "0.71356946", "text": "def is_terminal(self):\n return len(self.children) == 0", "title": "" }, { "docid": "063bf8fb9e98b51b606c0a21d8fb4539", "score": "0.69620866", "text": "def is_terminal(self):\n return not boo...