nwo
stringlengths
5
106
sha
stringlengths
40
40
path
stringlengths
4
174
language
stringclasses
1 value
identifier
stringlengths
1
140
parameters
stringlengths
0
87.7k
argument_list
stringclasses
1 value
return_statement
stringlengths
0
426k
docstring
stringlengths
0
64.3k
docstring_summary
stringlengths
0
26.3k
docstring_tokens
list
function
stringlengths
18
4.83M
function_tokens
list
url
stringlengths
83
304
holoviz/holoviews
cc6b27f01710402fdfee2aeef1507425ca78c91f
holoviews/util/parser.py
python
Parser.collect_tokens
(cls, parseresult, mode)
return tokens
Collect the tokens from a (potentially) nested parse result.
Collect the tokens from a (potentially) nested parse result.
[ "Collect", "the", "tokens", "from", "a", "(", "potentially", ")", "nested", "parse", "result", "." ]
def collect_tokens(cls, parseresult, mode): """ Collect the tokens from a (potentially) nested parse result. """ inner = '(%s)' if mode=='parens' else '[%s]' if parseresult is None: return [] tokens = [] for token in parseresult.asList(): # If value is...
[ "def", "collect_tokens", "(", "cls", ",", "parseresult", ",", "mode", ")", ":", "inner", "=", "'(%s)'", "if", "mode", "==", "'parens'", "else", "'[%s]'", "if", "parseresult", "is", "None", ":", "return", "[", "]", "tokens", "=", "[", "]", "for", "token...
https://github.com/holoviz/holoviews/blob/cc6b27f01710402fdfee2aeef1507425ca78c91f/holoviews/util/parser.py#L63-L78
buildbot/buildbot
b9c558217c72e4c2463eedc7ec6d56736f7b01a8
master/buildbot/process/buildrequestdistributor.py
python
BuildRequestDistributor.maybeStartBuildsOn
(self, new_builders)
Try to start any builds that can be started right now. This function returns immediately, and promises to trigger those builders eventually. @param new_builders: names of new builders that should be given the opportunity to check for new requests.
Try to start any builds that can be started right now. This function returns immediately, and promises to trigger those builders eventually.
[ "Try", "to", "start", "any", "builds", "that", "can", "be", "started", "right", "now", ".", "This", "function", "returns", "immediately", "and", "promises", "to", "trigger", "those", "builders", "eventually", "." ]
def maybeStartBuildsOn(self, new_builders): """ Try to start any builds that can be started right now. This function returns immediately, and promises to trigger those builders eventually. @param new_builders: names of new builders that should be given the opportunity t...
[ "def", "maybeStartBuildsOn", "(", "self", ",", "new_builders", ")", ":", "if", "not", "self", ".", "running", ":", "return", "try", ":", "yield", "self", ".", "_deferwaiter", ".", "add", "(", "self", ".", "_maybeStartBuildsOn", "(", "new_builders", ")", ")...
https://github.com/buildbot/buildbot/blob/b9c558217c72e4c2463eedc7ec6d56736f7b01a8/master/buildbot/process/buildrequestdistributor.py#L317-L332
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_flaskbb/lib/python2.7/site-packages/click/core.py
python
Group.get_command
(self, ctx, cmd_name)
return self.commands.get(cmd_name)
[]
def get_command(self, ctx, cmd_name): return self.commands.get(cmd_name)
[ "def", "get_command", "(", "self", ",", "ctx", ",", "cmd_name", ")", ":", "return", "self", ".", "commands", ".", "get", "(", "cmd_name", ")" ]
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_flaskbb/lib/python2.7/site-packages/click/core.py#L1180-L1181
googledatalab/pydatalab
1c86e26a0d24e3bc8097895ddeab4d0607be4c40
solutionbox/ml_workbench/xgboost/trainer/task.py
python
read_json_file
(file_path)
return json.loads(file_io.read_file_to_string(file_path).decode())
[]
def read_json_file(file_path): if not file_io.file_exists(file_path): raise ValueError('File not found: %s' % file_path) return json.loads(file_io.read_file_to_string(file_path).decode())
[ "def", "read_json_file", "(", "file_path", ")", ":", "if", "not", "file_io", ".", "file_exists", "(", "file_path", ")", ":", "raise", "ValueError", "(", "'File not found: %s'", "%", "file_path", ")", "return", "json", ".", "loads", "(", "file_io", ".", "read...
https://github.com/googledatalab/pydatalab/blob/1c86e26a0d24e3bc8097895ddeab4d0607be4c40/solutionbox/ml_workbench/xgboost/trainer/task.py#L670-L673
unknown-horizons/unknown-horizons
7397fb333006d26c3d9fe796c7bd9cb8c3b43a49
horizons/spsession.py
python
SPSession.autosave
(self)
Called automatically in an interval
Called automatically in an interval
[ "Called", "automatically", "in", "an", "interval" ]
def autosave(self): """Called automatically in an interval""" self.log.debug("Session: autosaving") success = self._do_save(SavegameManager.create_autosave_filename()) if success: SavegameManager.delete_dispensable_savegames(autosaves=True) self.ingame_gui.message_widget.add('AUTOSAVE')
[ "def", "autosave", "(", "self", ")", ":", "self", ".", "log", ".", "debug", "(", "\"Session: autosaving\"", ")", "success", "=", "self", ".", "_do_save", "(", "SavegameManager", ".", "create_autosave_filename", "(", ")", ")", "if", "success", ":", "SavegameM...
https://github.com/unknown-horizons/unknown-horizons/blob/7397fb333006d26c3d9fe796c7bd9cb8c3b43a49/horizons/spsession.py#L49-L55
travisgoodspeed/goodfet
1750cc1e8588af5470385e52fa098ca7364c2863
contrib/reCAN/tkHyperlinkManager.py
python
HyperlinkManager.add
(self, action, id)
return "hyper", tag
Add a new hyper link @param action: method that will be called for this hyperlink @param id: the arbitration id that we are associating this action.
Add a new hyper link
[ "Add", "a", "new", "hyper", "link" ]
def add(self, action, id): """ Add a new hyper link @param action: method that will be called for this hyperlink @param id: the arbitration id that we are associating this action. """ # add an action to the manager. returns tags to use in # associated t...
[ "def", "add", "(", "self", ",", "action", ",", "id", ")", ":", "# add an action to the manager. returns tags to use in", "# associated text widget", "tag", "=", "\"hyper-%d\"", "%", "len", "(", "self", ".", "links", ")", "self", ".", "links", "[", "tag", "]", ...
https://github.com/travisgoodspeed/goodfet/blob/1750cc1e8588af5470385e52fa098ca7364c2863/contrib/reCAN/tkHyperlinkManager.py#L52-L63
linxid/Machine_Learning_Study_Path
558e82d13237114bbb8152483977806fc0c222af
Machine Learning In Action/Chapter5-LogisticRegression/venv/Lib/importlib/_bootstrap_external.py
python
cache_from_source
(path, debug_override=None, *, optimization=None)
return _path_join(head, _PYCACHE, almost_filename + BYTECODE_SUFFIXES[0])
Given the path to a .py file, return the path to its .pyc file. The .py file does not need to exist; this simply returns the path to the .pyc file calculated as if the .py file were imported. The 'optimization' parameter controls the presumed optimization level of the bytecode file. If 'optimization' ...
Given the path to a .py file, return the path to its .pyc file.
[ "Given", "the", "path", "to", "a", ".", "py", "file", "return", "the", "path", "to", "its", ".", "pyc", "file", "." ]
def cache_from_source(path, debug_override=None, *, optimization=None): """Given the path to a .py file, return the path to its .pyc file. The .py file does not need to exist; this simply returns the path to the .pyc file calculated as if the .py file were imported. The 'optimization' parameter contro...
[ "def", "cache_from_source", "(", "path", ",", "debug_override", "=", "None", ",", "*", ",", "optimization", "=", "None", ")", ":", "if", "debug_override", "is", "not", "None", ":", "_warnings", ".", "warn", "(", "'the debug_override parameter is deprecated; use '"...
https://github.com/linxid/Machine_Learning_Study_Path/blob/558e82d13237114bbb8152483977806fc0c222af/Machine Learning In Action/Chapter5-LogisticRegression/venv/Lib/importlib/_bootstrap_external.py#L263-L305
tortoise/tortoise-orm
5bf910a3dcd1e729106b7f0dee16aae362d35f46
tortoise/contrib/pydantic/base.py
python
_get_fetch_fields
( pydantic_class: "Type[PydanticModel]", model_class: "Type[Model]" )
return fetch_fields
Recursively collect fields needed to fetch :param pydantic_class: The pydantic model class :param model_class: The tortoise model class :return: The list of fields to be fetched
Recursively collect fields needed to fetch :param pydantic_class: The pydantic model class :param model_class: The tortoise model class :return: The list of fields to be fetched
[ "Recursively", "collect", "fields", "needed", "to", "fetch", ":", "param", "pydantic_class", ":", "The", "pydantic", "model", "class", ":", "param", "model_class", ":", "The", "tortoise", "model", "class", ":", "return", ":", "The", "list", "of", "fields", "...
def _get_fetch_fields( pydantic_class: "Type[PydanticModel]", model_class: "Type[Model]" ) -> List[str]: """ Recursively collect fields needed to fetch :param pydantic_class: The pydantic model class :param model_class: The tortoise model class :return: The list of fields to be fetched """ ...
[ "def", "_get_fetch_fields", "(", "pydantic_class", ":", "\"Type[PydanticModel]\"", ",", "model_class", ":", "\"Type[Model]\"", ")", "->", "List", "[", "str", "]", ":", "fetch_fields", "=", "[", "]", "for", "field_name", ",", "field_type", "in", "pydantic_class", ...
https://github.com/tortoise/tortoise-orm/blob/5bf910a3dcd1e729106b7f0dee16aae362d35f46/tortoise/contrib/pydantic/base.py#L13-L37
peterbrittain/asciimatics
9a490faddf484ee5b9b845316f921f5888b23b18
asciimatics/event.py
python
KeyboardEvent.__repr__
(self)
return "KeyboardEvent: {}".format(self.key_code)
:returns: a string representation of the keyboard event.
:returns: a string representation of the keyboard event.
[ ":", "returns", ":", "a", "string", "representation", "of", "the", "keyboard", "event", "." ]
def __repr__(self): """ :returns: a string representation of the keyboard event. """ return "KeyboardEvent: {}".format(self.key_code)
[ "def", "__repr__", "(", "self", ")", ":", "return", "\"KeyboardEvent: {}\"", ".", "format", "(", "self", ".", "key_code", ")" ]
https://github.com/peterbrittain/asciimatics/blob/9a490faddf484ee5b9b845316f921f5888b23b18/asciimatics/event.py#L30-L34
mozillazg/pypy
2ff5cd960c075c991389f842c6d59e71cf0cb7d0
rpython/jit/codewriter/jtransform.py
python
Transformer._rewrite_symmetric
(self, op)
Rewrite 'c1+v2' into 'v2+c1' in an attempt to avoid generating too many variants of the bytecode.
Rewrite 'c1+v2' into 'v2+c1' in an attempt to avoid generating too many variants of the bytecode.
[ "Rewrite", "c1", "+", "v2", "into", "v2", "+", "c1", "in", "an", "attempt", "to", "avoid", "generating", "too", "many", "variants", "of", "the", "bytecode", "." ]
def _rewrite_symmetric(self, op): """Rewrite 'c1+v2' into 'v2+c1' in an attempt to avoid generating too many variants of the bytecode.""" if (isinstance(op.args[0], Constant) and isinstance(op.args[1], Variable)): reversename = {'int_lt': 'int_gt', ...
[ "def", "_rewrite_symmetric", "(", "self", ",", "op", ")", ":", "if", "(", "isinstance", "(", "op", ".", "args", "[", "0", "]", ",", "Constant", ")", "and", "isinstance", "(", "op", ".", "args", "[", "1", "]", ",", "Variable", ")", ")", ":", "reve...
https://github.com/mozillazg/pypy/blob/2ff5cd960c075c991389f842c6d59e71cf0cb7d0/rpython/jit/codewriter/jtransform.py#L304-L326
matplotlib/matplotlib
8d7a2b9d2a38f01ee0d6802dd4f9e98aec812322
lib/mpl_toolkits/axes_grid1/axes_divider.py
python
AxesDivider.append_axes
(self, position, size, pad=None, add_to_figure=True, *, axes_class=None, **kwargs)
return ax
Add a new axes on a given side of the main axes. Parameters ---------- position : {"left", "right", "bottom", "top"} Where the new axes is positioned relative to the main axes. size : :mod:`~mpl_toolkits.axes_grid1.axes_size` or float or str The axes width or hei...
Add a new axes on a given side of the main axes.
[ "Add", "a", "new", "axes", "on", "a", "given", "side", "of", "the", "main", "axes", "." ]
def append_axes(self, position, size, pad=None, add_to_figure=True, *, axes_class=None, **kwargs): """ Add a new axes on a given side of the main axes. Parameters ---------- position : {"left", "right", "bottom", "top"} Where the new axes is posit...
[ "def", "append_axes", "(", "self", ",", "position", ",", "size", ",", "pad", "=", "None", ",", "add_to_figure", "=", "True", ",", "*", ",", "axes_class", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "position", "==", "\"left\"", ":", "ax", ...
https://github.com/matplotlib/matplotlib/blob/8d7a2b9d2a38f01ee0d6802dd4f9e98aec812322/lib/mpl_toolkits/axes_grid1/axes_divider.py#L483-L523
firedrakeproject/firedrake
06ab4975c14c0d4dcb79be55821f8b9e41554125
firedrake/slate/slate.py
python
Inverse.__init__
(self, A)
Constructor for the Inverse class.
Constructor for the Inverse class.
[ "Constructor", "for", "the", "Inverse", "class", "." ]
def __init__(self, A): """Constructor for the Inverse class.""" assert A.rank == 2, "The tensor must be rank 2." assert A.shape[0] == A.shape[1], ( "The inverse can only be computed on square tensors." ) self.diagonal = A.diagonal if A.shape > (4, 4) and not ...
[ "def", "__init__", "(", "self", ",", "A", ")", ":", "assert", "A", ".", "rank", "==", "2", ",", "\"The tensor must be rank 2.\"", "assert", "A", ".", "shape", "[", "0", "]", "==", "A", ".", "shape", "[", "1", "]", ",", "(", "\"The inverse can only be c...
https://github.com/firedrakeproject/firedrake/blob/06ab4975c14c0d4dcb79be55821f8b9e41554125/firedrake/slate/slate.py#L990-L1001
google-research/lag
e62ef8d32e45dc02315a894e5b223f9427939de0
libml/layers.py
python
upscale2d
(x, n=2, order=NCHW)
return x
Box upscaling (also called nearest neighbors). Args: x: 4D tensor in NCHW format. n: integer scale (must be a power of 2). Returns: 4D tensor up scaled by a factor n.
Box upscaling (also called nearest neighbors).
[ "Box", "upscaling", "(", "also", "called", "nearest", "neighbors", ")", "." ]
def upscale2d(x, n=2, order=NCHW): """Box upscaling (also called nearest neighbors). Args: x: 4D tensor in NCHW format. n: integer scale (must be a power of 2). Returns: 4D tensor up scaled by a factor n. """ if n == 1: return x s, ts = x.shape, tf.shape(x) if order == ...
[ "def", "upscale2d", "(", "x", ",", "n", "=", "2", ",", "order", "=", "NCHW", ")", ":", "if", "n", "==", "1", ":", "return", "x", "s", ",", "ts", "=", "x", ".", "shape", ",", "tf", ".", "shape", "(", "x", ")", "if", "order", "==", "NCHW", ...
https://github.com/google-research/lag/blob/e62ef8d32e45dc02315a894e5b223f9427939de0/libml/layers.py#L75-L96
apache/libcloud
90971e17bfd7b6bb97b2489986472c531cc8e140
libcloud/compute/drivers/openstack.py
python
OpenStackNodeDriver.create_volume
( self, size, name, location=None, snapshot=None, ex_volume_type=None )
return self._to_volume(resp.object)
Create a new volume. :param size: Size of volume in gigabytes (required) :type size: ``int`` :param name: Name of the volume to be created :type name: ``str`` :param location: Which data center to create a volume in. If empty, undefined behavior ...
Create a new volume.
[ "Create", "a", "new", "volume", "." ]
def create_volume( self, size, name, location=None, snapshot=None, ex_volume_type=None ): """ Create a new volume. :param size: Size of volume in gigabytes (required) :type size: ``int`` :param name: Name of the volume to be created :type name: ``str`` ...
[ "def", "create_volume", "(", "self", ",", "size", ",", "name", ",", "location", "=", "None", ",", "snapshot", "=", "None", ",", "ex_volume_type", "=", "None", ")", ":", "volume", "=", "{", "\"display_name\"", ":", "name", ",", "\"display_description\"", ":...
https://github.com/apache/libcloud/blob/90971e17bfd7b6bb97b2489986472c531cc8e140/libcloud/compute/drivers/openstack.py#L339-L388
google/prettytensor
75daa0b11252590f548da5647addc0ea610c4c45
prettytensor/replay_queue.py
python
ReplayableQueue.refill
(self, sess)
Clears the current queue and then refills it with new data.
Clears the current queue and then refills it with new data.
[ "Clears", "the", "current", "queue", "and", "then", "refills", "it", "with", "new", "data", "." ]
def refill(self, sess): """Clears the current queue and then refills it with new data.""" sess.run(self._clear_queue) # Run until full. while sess.run(self._fill_queue): pass
[ "def", "refill", "(", "self", ",", "sess", ")", ":", "sess", ".", "run", "(", "self", ".", "_clear_queue", ")", "# Run until full.", "while", "sess", ".", "run", "(", "self", ".", "_fill_queue", ")", ":", "pass" ]
https://github.com/google/prettytensor/blob/75daa0b11252590f548da5647addc0ea610c4c45/prettytensor/replay_queue.py#L220-L225
sunnyxiaohu/R-C3D.pytorch
e8731af7b95f1dc934f6604f9c09e3c4ead74db5
lib/tf_model_zoo/models/lm_1b/data_utils.py
python
LM1BDataset._load_shard
(self, shard_name)
return zip(ids, chars_ids, global_word_ids)
Read one file and convert to ids. Args: shard_name: file path. Returns: list of (id, char_id, global_word_id) tuples.
Read one file and convert to ids.
[ "Read", "one", "file", "and", "convert", "to", "ids", "." ]
def _load_shard(self, shard_name): """Read one file and convert to ids. Args: shard_name: file path. Returns: list of (id, char_id, global_word_id) tuples. """ tf.logging.info('Loading data from: %s', shard_name) with tf.gfile.Open(shard_name) as f: sentences = f.readlines() ...
[ "def", "_load_shard", "(", "self", ",", "shard_name", ")", ":", "tf", ".", "logging", ".", "info", "(", "'Loading data from: %s'", ",", "shard_name", ")", "with", "tf", ".", "gfile", ".", "Open", "(", "shard_name", ")", "as", "f", ":", "sentences", "=", ...
https://github.com/sunnyxiaohu/R-C3D.pytorch/blob/e8731af7b95f1dc934f6604f9c09e3c4ead74db5/lib/tf_model_zoo/models/lm_1b/data_utils.py#L238-L263
galaxyproject/galaxy
4c03520f05062e0f4a1b3655dc0b7452fda69943
lib/galaxy/model/__init__.py
python
DatasetInstance.is_pending
(self)
return self.state in (self.states.NEW, self.states.UPLOAD, self.states.QUEUED, self.states.RUNNING, self.states.SETTING_METADATA)
Return true if the dataset is neither ready nor in error
Return true if the dataset is neither ready nor in error
[ "Return", "true", "if", "the", "dataset", "is", "neither", "ready", "nor", "in", "error" ]
def is_pending(self): """ Return true if the dataset is neither ready nor in error """ return self.state in (self.states.NEW, self.states.UPLOAD, self.states.QUEUED, self.states.RUNNING, self.states.SETTING_METADATA)
[ "def", "is_pending", "(", "self", ")", ":", "return", "self", ".", "state", "in", "(", "self", ".", "states", ".", "NEW", ",", "self", ".", "states", ".", "UPLOAD", ",", "self", ".", "states", ".", "QUEUED", ",", "self", ".", "states", ".", "RUNNIN...
https://github.com/galaxyproject/galaxy/blob/4c03520f05062e0f4a1b3655dc0b7452fda69943/lib/galaxy/model/__init__.py#L3885-L3891
alan-turing-institute/sktime
79cc513346b1257a6f3fa8e4ed855b5a2a7de716
sktime/alignment/dtw_python.py
python
AlignerDTWfromDist._get_distance_matrix
(self)
return distmat
Return distance matrix of alignment. Behaviour: returns pairwise distance matrix of alignment distances not all aligners will return or implement this (optional) Returns ------- distmat: a (2 x 2) np.array of floats [i,j]-th entry is alignment distance between X...
Return distance matrix of alignment.
[ "Return", "distance", "matrix", "of", "alignment", "." ]
def _get_distance_matrix(self): """Return distance matrix of alignment. Behaviour: returns pairwise distance matrix of alignment distances not all aligners will return or implement this (optional) Returns ------- distmat: a (2 x 2) np.array of floats [i,...
[ "def", "_get_distance_matrix", "(", "self", ")", ":", "# since dtw does only pairwise alignments, this is always", "distmat", "=", "np", ".", "zeros", "(", "(", "2", ",", "2", ")", ",", "dtype", "=", "\"float\"", ")", "distmat", "[", "0", ",", "1", "]", "=",...
https://github.com/alan-turing-institute/sktime/blob/79cc513346b1257a6f3fa8e4ed855b5a2a7de716/sktime/alignment/dtw_python.py#L317-L333
lovelylain/pyctp
fd304de4b50c4ddc31a4190b1caaeb5dec66bc5d
example/pyctp2/trader/trade_command_queue.py
python
BaseTradeCommandQueue.query_depth_market_data
(self, command)
return self._spi.fetch_depth_market_data(command.instrument_id)
[]
def query_depth_market_data(self, command): return self._spi.fetch_depth_market_data(command.instrument_id)
[ "def", "query_depth_market_data", "(", "self", ",", "command", ")", ":", "return", "self", ".", "_spi", ".", "fetch_depth_market_data", "(", "command", ".", "instrument_id", ")" ]
https://github.com/lovelylain/pyctp/blob/fd304de4b50c4ddc31a4190b1caaeb5dec66bc5d/example/pyctp2/trader/trade_command_queue.py#L145-L146
tweecode/twine
45e6350a2b813ec4282440b78f901cf377ead1a9
storypanel.py
python
StoryPanel.includedPassageExists
(self, title)
return title in self.includedPassages
Add a title to the set of external passages
Add a title to the set of external passages
[ "Add", "a", "title", "to", "the", "set", "of", "external", "passages" ]
def includedPassageExists(self, title): """Add a title to the set of external passages""" return title in self.includedPassages
[ "def", "includedPassageExists", "(", "self", ",", "title", ")", ":", "return", "title", "in", "self", ".", "includedPassages" ]
https://github.com/tweecode/twine/blob/45e6350a2b813ec4282440b78f901cf377ead1a9/storypanel.py#L736-L738
clips/pattern
d25511f9ca7ed9356b801d8663b8b5168464e68f
pattern/text/en/wordnet/__init__.py
python
Synset.antonym
(self)
return len(p) > 0 and p or None
Yields the semantically opposite synset, for example: synsets("death")[0].antonym => Synset("birth").
Yields the semantically opposite synset, for example: synsets("death")[0].antonym => Synset("birth").
[ "Yields", "the", "semantically", "opposite", "synset", "for", "example", ":", "synsets", "(", "death", ")", "[", "0", "]", ".", "antonym", "=", ">", "Synset", "(", "birth", ")", "." ]
def antonym(self): """ Yields the semantically opposite synset, for example: synsets("death")[0].antonym => Synset("birth"). """ p = [Synset(a.synset()) for l in self._wnsynset.lemmas() for a in l.antonyms()] return len(p) > 0 and p or None
[ "def", "antonym", "(", "self", ")", ":", "p", "=", "[", "Synset", "(", "a", ".", "synset", "(", ")", ")", "for", "l", "in", "self", ".", "_wnsynset", ".", "lemmas", "(", ")", "for", "a", "in", "l", ".", "antonyms", "(", ")", "]", "return", "l...
https://github.com/clips/pattern/blob/d25511f9ca7ed9356b801d8663b8b5168464e68f/pattern/text/en/wordnet/__init__.py#L242-L247
scikit-hep/awkward-0.x
dd885bef15814f588b58944d2505296df4aaae0e
awkward0/pandas.py
python
AwkwardSeries.ObjectArray
(self)
return mixin(self._findclass(type(self)).ObjectArray.fget(self))
[]
def ObjectArray(self): return mixin(self._findclass(type(self)).ObjectArray.fget(self))
[ "def", "ObjectArray", "(", "self", ")", ":", "return", "mixin", "(", "self", ".", "_findclass", "(", "type", "(", "self", ")", ")", ".", "ObjectArray", ".", "fget", "(", "self", ")", ")" ]
https://github.com/scikit-hep/awkward-0.x/blob/dd885bef15814f588b58944d2505296df4aaae0e/awkward0/pandas.py#L137-L138
sourmash-bio/sourmash
73aeb155befd7c94042ddb8ca277a69986f25a55
src/sourmash/compare.py
python
compare_serial_max_containment
(siglist, downsample=False)
return containments
Compare all combinations of signatures and return a matrix of max_containments. Processes combinations serially on a single process. Best to only use when there are few signatures. :param list siglist: list of signatures to compare :param boolean downsample by scaled if True :return: np.array simil...
Compare all combinations of signatures and return a matrix of max_containments. Processes combinations serially on a single process. Best to only use when there are few signatures.
[ "Compare", "all", "combinations", "of", "signatures", "and", "return", "a", "matrix", "of", "max_containments", ".", "Processes", "combinations", "serially", "on", "a", "single", "process", ".", "Best", "to", "only", "use", "when", "there", "are", "few", "sign...
def compare_serial_max_containment(siglist, downsample=False): """Compare all combinations of signatures and return a matrix of max_containments. Processes combinations serially on a single process. Best to only use when there are few signatures. :param list siglist: list of signatures to compare :...
[ "def", "compare_serial_max_containment", "(", "siglist", ",", "downsample", "=", "False", ")", ":", "import", "numpy", "as", "np", "n", "=", "len", "(", "siglist", ")", "containments", "=", "np", ".", "ones", "(", "(", "n", ",", "n", ")", ")", "for", ...
https://github.com/sourmash-bio/sourmash/blob/73aeb155befd7c94042ddb8ca277a69986f25a55/src/sourmash/compare.py#L64-L83
HewlettPackard/dlcookbook-dlbs
863ac1d7e72ad2fcafc78d8a13f67d35bc00c235
python/mxnet_benchmarks/models/resnet.py
python
ResNet.resnet
(self, units, num_stages, filter_list, bottle_neck=True, bn_mom=0.9, workspace=256, memonger=False, cudnn_bn_off=False, fuse_bn_relu=False, fuse_bn_add_relu=False)
return v
Return ResNet symbol of Parameters ---------- units : list Number of units in each stage num_stages : int Number of stage filter_list : list Channel size of each stage num_classes : int Ouput size of symbol dataset :...
Return ResNet symbol of Parameters ---------- units : list Number of units in each stage num_stages : int Number of stage filter_list : list Channel size of each stage num_classes : int Ouput size of symbol dataset :...
[ "Return", "ResNet", "symbol", "of", "Parameters", "----------", "units", ":", "list", "Number", "of", "units", "in", "each", "stage", "num_stages", ":", "int", "Number", "of", "stage", "filter_list", ":", "list", "Channel", "size", "of", "each", "stage", "nu...
def resnet(self, units, num_stages, filter_list, bottle_neck=True, bn_mom=0.9, workspace=256, memonger=False, cudnn_bn_off=False, fuse_bn_relu=False, fuse_bn_add_relu=False): """Return ResNet symbol of Parameters ---------- units : list Number of units in each ...
[ "def", "resnet", "(", "self", ",", "units", ",", "num_stages", ",", "filter_list", ",", "bottle_neck", "=", "True", ",", "bn_mom", "=", "0.9", ",", "workspace", "=", "256", ",", "memonger", "=", "False", ",", "cudnn_bn_off", "=", "False", ",", "fuse_bn_r...
https://github.com/HewlettPackard/dlcookbook-dlbs/blob/863ac1d7e72ad2fcafc78d8a13f67d35bc00c235/python/mxnet_benchmarks/models/resnet.py#L132-L181
cloudera/impyla
0c736af4cad2bade9b8e313badc08ec50e81c948
impala/_thrift_gen/hive_metastore/ThriftHiveMetastore.py
python
get_table_statistics_req_args.write
(self, oprot)
[]
def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_table_statistics_req_args') if self.request is not None: ...
[ "def", "write", "(", "self", ",", "oprot", ")", ":", "if", "oprot", ".", "_fast_encode", "is", "not", "None", "and", "self", ".", "thrift_spec", "is", "not", "None", ":", "oprot", ".", "trans", ".", "write", "(", "oprot", ".", "_fast_encode", "(", "s...
https://github.com/cloudera/impyla/blob/0c736af4cad2bade9b8e313badc08ec50e81c948/impala/_thrift_gen/hive_metastore/ThriftHiveMetastore.py#L26374-L26384
Asana/python-asana
9b54ab99423208bd6aa87dbfaa628c069430b127
asana/resources/tasks.py
python
Tasks.find_by_user_task_list
(self, user_task_list, params={}, **options)
return self.client.get_collection(path, params, **options)
Returns the compact list of tasks in a user's My Tasks list. The returned tasks will be in order within each assignee status group of `Inbox`, `Today`, and `Upcoming`. **Note:** tasks in `Later` have a different ordering in the Asana web app than the other assignee status groups; this e...
Returns the compact list of tasks in a user's My Tasks list. The returned tasks will be in order within each assignee status group of `Inbox`, `Today`, and `Upcoming`.
[ "Returns", "the", "compact", "list", "of", "tasks", "in", "a", "user", "s", "My", "Tasks", "list", ".", "The", "returned", "tasks", "will", "be", "in", "order", "within", "each", "assignee", "status", "group", "of", "Inbox", "Today", "and", "Upcoming", "...
def find_by_user_task_list(self, user_task_list, params={}, **options): """Returns the compact list of tasks in a user's My Tasks list. The returned tasks will be in order within each assignee status group of `Inbox`, `Today`, and `Upcoming`. **Note:** tasks in `Later` have a different ...
[ "def", "find_by_user_task_list", "(", "self", ",", "user_task_list", ",", "params", "=", "{", "}", ",", "*", "*", "options", ")", ":", "path", "=", "\"/user_task_lists/%s/tasks\"", "%", "(", "user_task_list", ")", "return", "self", ".", "client", ".", "get_c...
https://github.com/Asana/python-asana/blob/9b54ab99423208bd6aa87dbfaa628c069430b127/asana/resources/tasks.py#L147-L174
ales-tsurko/cells
4cf7e395cd433762bea70cdc863a346f3a6fe1d0
packaging/macos/python/lib/python3.7/nntplib.py
python
_NNTPBase.body
(self, message_spec=None, *, file=None)
return self._artcmd(cmd, file)
Process a BODY command. Argument: - message_spec: article number or message id - file: filename string or file object to store the body in Returns: - resp: server response if successful - ArticleInfo: (article number, message id, list of body lines)
Process a BODY command. Argument: - message_spec: article number or message id - file: filename string or file object to store the body in Returns: - resp: server response if successful - ArticleInfo: (article number, message id, list of body lines)
[ "Process", "a", "BODY", "command", ".", "Argument", ":", "-", "message_spec", ":", "article", "number", "or", "message", "id", "-", "file", ":", "filename", "string", "or", "file", "object", "to", "store", "the", "body", "in", "Returns", ":", "-", "resp"...
def body(self, message_spec=None, *, file=None): """Process a BODY command. Argument: - message_spec: article number or message id - file: filename string or file object to store the body in Returns: - resp: server response if successful - ArticleInfo: (article number, m...
[ "def", "body", "(", "self", ",", "message_spec", "=", "None", ",", "*", ",", "file", "=", "None", ")", ":", "if", "message_spec", "is", "not", "None", ":", "cmd", "=", "'BODY {0}'", ".", "format", "(", "message_spec", ")", "else", ":", "cmd", "=", ...
https://github.com/ales-tsurko/cells/blob/4cf7e395cd433762bea70cdc863a346f3a6fe1d0/packaging/macos/python/lib/python3.7/nntplib.py#L744-L756
itailang/SampleNet
442459abc54f9e14f0966a169a094a98febd32eb
reconstruction/src/samplenet_pointnet_ae.py
python
SampleNetPointNetAE.train
(self, train_data, configuration, log_file=None, held_out_data=None)
return stats
[]
def train(self, train_data, configuration, log_file=None, held_out_data=None): c = configuration stats = [] if c.saver_step is not None: create_dir(c.train_dir) for _ in range(c.training_epochs): ( loss, loss_ae, l...
[ "def", "train", "(", "self", ",", "train_data", ",", "configuration", ",", "log_file", "=", "None", ",", "held_out_data", "=", "None", ")", ":", "c", "=", "configuration", "stats", "=", "[", "]", "if", "c", ".", "saver_step", "is", "not", "None", ":", ...
https://github.com/itailang/SampleNet/blob/442459abc54f9e14f0966a169a094a98febd32eb/reconstruction/src/samplenet_pointnet_ae.py#L355-L457
faucetsdn/ryu
537f35f4b2bc634ef05e3f28373eb5e24609f989
ryu/services/protocols/zebra/db/route.py
python
ip_route_delete
(session, destination, **kwargs)
return routes
Deletes route record(s) from Zebra protocol service database. The arguments are similar to "ip route delete" command of iproute2. :param session: Session instance connecting to database. :param destination: Destination prefix. :param kwargs: Filtering rules to query. :return: Records which are del...
Deletes route record(s) from Zebra protocol service database.
[ "Deletes", "route", "record", "(", "s", ")", "from", "Zebra", "protocol", "service", "database", "." ]
def ip_route_delete(session, destination, **kwargs): """ Deletes route record(s) from Zebra protocol service database. The arguments are similar to "ip route delete" command of iproute2. :param session: Session instance connecting to database. :param destination: Destination prefix. :param kwa...
[ "def", "ip_route_delete", "(", "session", ",", "destination", ",", "*", "*", "kwargs", ")", ":", "routes", "=", "ip_route_show_all", "(", "session", ",", "destination", "=", "destination", ",", "*", "*", "kwargs", ")", "for", "route", "in", "routes", ":", ...
https://github.com/faucetsdn/ryu/blob/537f35f4b2bc634ef05e3f28373eb5e24609f989/ryu/services/protocols/zebra/db/route.py#L186-L201
smart-mobile-software/gitstack
d9fee8f414f202143eb6e620529e8e5539a2af56
python/Lib/mailbox.py
python
MH.has_key
(self, key)
return os.path.exists(os.path.join(self._path, str(key)))
Return True if the keyed message exists, False otherwise.
Return True if the keyed message exists, False otherwise.
[ "Return", "True", "if", "the", "keyed", "message", "exists", "False", "otherwise", "." ]
def has_key(self, key): """Return True if the keyed message exists, False otherwise.""" return os.path.exists(os.path.join(self._path, str(key)))
[ "def", "has_key", "(", "self", ",", "key", ")", ":", "return", "os", ".", "path", ".", "exists", "(", "os", ".", "path", ".", "join", "(", "self", ".", "_path", ",", "str", "(", "key", ")", ")", ")" ]
https://github.com/smart-mobile-software/gitstack/blob/d9fee8f414f202143eb6e620529e8e5539a2af56/python/Lib/mailbox.py#L1010-L1012
biolab/orange3
41685e1c7b1d1babe680113685a2d44bcc9fec0b
Orange/evaluation/performance_curves.py
python
Curves.tpr
(self)
return self.sensitivity()
TPR curve
TPR curve
[ "TPR", "curve" ]
def tpr(self): """TPR curve""" return self.sensitivity()
[ "def", "tpr", "(", "self", ")", ":", "return", "self", ".", "sensitivity", "(", ")" ]
https://github.com/biolab/orange3/blob/41685e1c7b1d1babe680113685a2d44bcc9fec0b/Orange/evaluation/performance_curves.py#L148-L150
brython-dev/brython
9cba5fb7f43a9b52fff13e89b403e02a1dfaa5f3
www/src/Lib/importlib/abc.py
python
ResourceLoader.get_data
(self, path)
Abstract method which when implemented should return the bytes for the specified path. The path must be a str.
Abstract method which when implemented should return the bytes for the specified path. The path must be a str.
[ "Abstract", "method", "which", "when", "implemented", "should", "return", "the", "bytes", "for", "the", "specified", "path", ".", "The", "path", "must", "be", "a", "str", "." ]
def get_data(self, path): """Abstract method which when implemented should return the bytes for the specified path. The path must be a str.""" raise OSError
[ "def", "get_data", "(", "self", ",", "path", ")", ":", "raise", "OSError" ]
https://github.com/brython-dev/brython/blob/9cba5fb7f43a9b52fff13e89b403e02a1dfaa5f3/www/src/Lib/importlib/abc.py#L160-L163
falconry/falcon
ee97769eab6a951864876202474133446aa50297
falcon/asgi/reader.py
python
BufferedReader.fileno
(self)
Raise an instance of OSError since a file descriptor is not used.
Raise an instance of OSError since a file descriptor is not used.
[ "Raise", "an", "instance", "of", "OSError", "since", "a", "file", "descriptor", "is", "not", "used", "." ]
def fileno(self): """Raise an instance of OSError since a file descriptor is not used.""" raise OSError('This IO object does not use a file descriptor')
[ "def", "fileno", "(", "self", ")", ":", "raise", "OSError", "(", "'This IO object does not use a file descriptor'", ")" ]
https://github.com/falconry/falcon/blob/ee97769eab6a951864876202474133446aa50297/falcon/asgi/reader.py#L313-L315
ajinabraham/OWASP-Xenotix-XSS-Exploit-Framework
cb692f527e4e819b6c228187c5702d990a180043
external/Scripting Engine/Xenotix Python Scripting Engine/packages/IronPython.StdLib.2.7.4/content/Lib/cookielib.py
python
CookiePolicy.domain_return_ok
(self, domain, request)
return True
Return false if cookies should not be returned, given cookie domain.
Return false if cookies should not be returned, given cookie domain.
[ "Return", "false", "if", "cookies", "should", "not", "be", "returned", "given", "cookie", "domain", "." ]
def domain_return_ok(self, domain, request): """Return false if cookies should not be returned, given cookie domain. """ return True
[ "def", "domain_return_ok", "(", "self", ",", "domain", ",", "request", ")", ":", "return", "True" ]
https://github.com/ajinabraham/OWASP-Xenotix-XSS-Exploit-Framework/blob/cb692f527e4e819b6c228187c5702d990a180043/external/Scripting Engine/Xenotix Python Scripting Engine/packages/IronPython.StdLib.2.7.4/content/Lib/cookielib.py#L827-L830
niosus/EasyClangComplete
3b16eb17735aaa3f56bb295fc5481b269ee9f2ef
external/bazel-compilation-database/.ycm_extra_conf.py
python
get_aspects_filepath
(label, bazel_bin)
return os.path.join(bazel_bin, *relative_file_path.split('/'))
Gets the file path for the generated aspects file that contains the compile commands json entries.
Gets the file path for the generated aspects file that contains the compile commands json entries.
[ "Gets", "the", "file", "path", "for", "the", "generated", "aspects", "file", "that", "contains", "the", "compile", "commands", "json", "entries", "." ]
def get_aspects_filepath(label, bazel_bin): """Gets the file path for the generated aspects file that contains the compile commands json entries. """ target_path = re.sub(':', '/', label) target_path = re.sub('^@(.*)//', 'external/\\1/', target_path) target_path = re.sub('^/*', '', target_path)...
[ "def", "get_aspects_filepath", "(", "label", ",", "bazel_bin", ")", ":", "target_path", "=", "re", ".", "sub", "(", "':'", ",", "'/'", ",", "label", ")", "target_path", "=", "re", ".", "sub", "(", "'^@(.*)//'", ",", "'external/\\\\1/'", ",", "target_path",...
https://github.com/niosus/EasyClangComplete/blob/3b16eb17735aaa3f56bb295fc5481b269ee9f2ef/external/bazel-compilation-database/.ycm_extra_conf.py#L109-L118
plotly/plotly.py
cfad7862594b35965c0e000813bd7805e8494a5b
packages/python/plotly/plotly/graph_objs/scattercarpet/selected/_textfont.py
python
Textfont.__init__
(self, arg=None, color=None, **kwargs)
Construct a new Textfont object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.scattercarpet. selected.Textfont` color Sets the text font color of selected ...
Construct a new Textfont object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.scattercarpet. selected.Textfont` color Sets the text font color of selected ...
[ "Construct", "a", "new", "Textfont", "object", "Parameters", "----------", "arg", "dict", "of", "properties", "compatible", "with", "this", "constructor", "or", "an", "instance", "of", ":", "class", ":", "plotly", ".", "graph_objs", ".", "scattercarpet", ".", ...
def __init__(self, arg=None, color=None, **kwargs): """ Construct a new Textfont object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.scattercarpet. selected.T...
[ "def", "__init__", "(", "self", ",", "arg", "=", "None", ",", "color", "=", "None", ",", "*", "*", "kwargs", ")", ":", "super", "(", "Textfont", ",", "self", ")", ".", "__init__", "(", "\"textfont\"", ")", "if", "\"_parent\"", "in", "kwargs", ":", ...
https://github.com/plotly/plotly.py/blob/cfad7862594b35965c0e000813bd7805e8494a5b/packages/python/plotly/plotly/graph_objs/scattercarpet/selected/_textfont.py#L81-L138
openshift/openshift-tools
1188778e728a6e4781acf728123e5b356380fe6f
openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/lib_vendored_deps/library/oc_clusterrole.py
python
Yedit.process_edits
(edits, yamlfile)
return {'changed': len(results) > 0, 'results': results}
run through a list of edits and process them one-by-one
run through a list of edits and process them one-by-one
[ "run", "through", "a", "list", "of", "edits", "and", "process", "them", "one", "-", "by", "-", "one" ]
def process_edits(edits, yamlfile): '''run through a list of edits and process them one-by-one''' results = [] for edit in edits: value = Yedit.parse_value(edit['value'], edit.get('value_type', '')) if edit.get('action') == 'update': # pylint: disable=line...
[ "def", "process_edits", "(", "edits", ",", "yamlfile", ")", ":", "results", "=", "[", "]", "for", "edit", "in", "edits", ":", "value", "=", "Yedit", ".", "parse_value", "(", "edit", "[", "'value'", "]", ",", "edit", ".", "get", "(", "'value_type'", "...
https://github.com/openshift/openshift-tools/blob/1188778e728a6e4781acf728123e5b356380fe6f/openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/lib_vendored_deps/library/oc_clusterrole.py#L698-L723
IJDykeman/wangTiles
7c1ee2095ebdf7f72bce07d94c6484915d5cae8b
experimental_code/tiles_3d/venv_mac_py3/lib/python2.7/site-packages/pip/_vendor/distro.py
python
lsb_release_attr
(attribute)
return _distro.lsb_release_attr(attribute)
Return a single named information item from the lsb_release command output data source of the current OS distribution. Parameters: * ``attribute`` (string): Key of the information item. Returns: * (string): Value of the information item, if the item exists. The empty string, if the item do...
Return a single named information item from the lsb_release command output data source of the current OS distribution.
[ "Return", "a", "single", "named", "information", "item", "from", "the", "lsb_release", "command", "output", "data", "source", "of", "the", "current", "OS", "distribution", "." ]
def lsb_release_attr(attribute): """ Return a single named information item from the lsb_release command output data source of the current OS distribution. Parameters: * ``attribute`` (string): Key of the information item. Returns: * (string): Value of the information item, if the item e...
[ "def", "lsb_release_attr", "(", "attribute", ")", ":", "return", "_distro", ".", "lsb_release_attr", "(", "attribute", ")" ]
https://github.com/IJDykeman/wangTiles/blob/7c1ee2095ebdf7f72bce07d94c6484915d5cae8b/experimental_code/tiles_3d/venv_mac_py3/lib/python2.7/site-packages/pip/_vendor/distro.py#L483-L500
google/clusterfuzz
f358af24f414daa17a3649b143e71ea71871ef59
src/appengine/libs/issue_management/jira/issue_tracker_manager.py
python
IssueTrackerManager.__init__
(self, project_name)
Construct an issue tracker manager instance based on parameters.
Construct an issue tracker manager instance based on parameters.
[ "Construct", "an", "issue", "tracker", "manager", "instance", "based", "on", "parameters", "." ]
def __init__(self, project_name): """"Construct an issue tracker manager instance based on parameters.""" self._client = None self.project_name = project_name
[ "def", "__init__", "(", "self", ",", "project_name", ")", ":", "self", ".", "_client", "=", "None", "self", ".", "project_name", "=", "project_name" ]
https://github.com/google/clusterfuzz/blob/f358af24f414daa17a3649b143e71ea71871ef59/src/appengine/libs/issue_management/jira/issue_tracker_manager.py#L26-L29
rhydlewis/search-omnifocus
8e872073be51b867440c4fa124f82433813fa73a
workflow/workflow.py
python
Workflow.cachedir
(self)
return self._create(dirpath)
Path to workflow's cache directory. The cache directory is a subdirectory of Alfred's own cache directory in ``~/Library/Caches``. The full path is in Alfred 4+ is: ``~/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/<bundle id>`` For earlier versions: ``~/Library/...
Path to workflow's cache directory.
[ "Path", "to", "workflow", "s", "cache", "directory", "." ]
def cachedir(self): """Path to workflow's cache directory. The cache directory is a subdirectory of Alfred's own cache directory in ``~/Library/Caches``. The full path is in Alfred 4+ is: ``~/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/<bundle id>`` For earlier ...
[ "def", "cachedir", "(", "self", ")", ":", "if", "self", ".", "alfred_env", ".", "get", "(", "'workflow_cache'", ")", ":", "dirpath", "=", "self", ".", "alfred_env", ".", "get", "(", "'workflow_cache'", ")", "else", ":", "dirpath", "=", "self", ".", "_d...
https://github.com/rhydlewis/search-omnifocus/blob/8e872073be51b867440c4fa124f82433813fa73a/workflow/workflow.py#L1220-L1244
jensl/critic
c2d962b909ff7ef2f09bccbeb636333920b3659e
src/api/batch.py
python
InvalidBatchId.__init__
(self, batch_id)
Constructor
Constructor
[ "Constructor" ]
def __init__(self, batch_id): """Constructor""" super(InvalidBatchId, self).__init__("Invalid batch id: %d" % batch_id)
[ "def", "__init__", "(", "self", ",", "batch_id", ")", ":", "super", "(", "InvalidBatchId", ",", "self", ")", ".", "__init__", "(", "\"Invalid batch id: %d\"", "%", "batch_id", ")" ]
https://github.com/jensl/critic/blob/c2d962b909ff7ef2f09bccbeb636333920b3659e/src/api/batch.py#L25-L27
TarrySingh/Artificial-Intelligence-Deep-Learning-Machine-Learning-Tutorials
5bb97d7e3ffd913abddb4cfa7d78a1b4c868890e
tensorflow_dl_models/research/inception/inception/dataset.py
python
Dataset.reader
(self)
return tf.TFRecordReader()
Return a reader for a single entry from the data set. See io_ops.py for details of Reader class. Returns: Reader object that reads the data set.
Return a reader for a single entry from the data set.
[ "Return", "a", "reader", "for", "a", "single", "entry", "from", "the", "data", "set", "." ]
def reader(self): """Return a reader for a single entry from the data set. See io_ops.py for details of Reader class. Returns: Reader object that reads the data set. """ return tf.TFRecordReader()
[ "def", "reader", "(", "self", ")", ":", "return", "tf", ".", "TFRecordReader", "(", ")" ]
https://github.com/TarrySingh/Artificial-Intelligence-Deep-Learning-Machine-Learning-Tutorials/blob/5bb97d7e3ffd913abddb4cfa7d78a1b4c868890e/tensorflow_dl_models/research/inception/inception/dataset.py#L95-L103
googleads/google-ads-python
2a1d6062221f6aad1992a6bcca0e7e4a93d2db86
google/ads/googleads/v9/services/services/conversion_upload_service/client.py
python
ConversionUploadServiceClient.from_service_account_file
(cls, filename: str, *args, **kwargs)
return cls(*args, **kwargs)
Creates an instance of this client using the provided credentials file. Args: filename (str): The path to the service account private key json file. args: Additional arguments to pass to the constructor. kwargs: Additional arguments to pass to the con...
Creates an instance of this client using the provided credentials file.
[ "Creates", "an", "instance", "of", "this", "client", "using", "the", "provided", "credentials", "file", "." ]
def from_service_account_file(cls, filename: str, *args, **kwargs): """Creates an instance of this client using the provided credentials file. Args: filename (str): The path to the service account private key json file. args: Additional arguments to pass ...
[ "def", "from_service_account_file", "(", "cls", ",", "filename", ":", "str", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "credentials", "=", "service_account", ".", "Credentials", ".", "from_service_account_file", "(", "filename", ")", "kwargs", "[", ...
https://github.com/googleads/google-ads-python/blob/2a1d6062221f6aad1992a6bcca0e7e4a93d2db86/google/ads/googleads/v9/services/services/conversion_upload_service/client.py#L136-L153
cloudera/hue
23f02102d4547c17c32bd5ea0eb24e9eadd657a4
desktop/core/ext-py/celery-4.2.1/celery/app/log.py
python
Logging.setup_logger
(self, name='celery', *args, **kwargs)
return logging.root
Deprecated: No longer used.
Deprecated: No longer used.
[ "Deprecated", ":", "No", "longer", "used", "." ]
def setup_logger(self, name='celery', *args, **kwargs): """Deprecated: No longer used.""" self.setup_logging_subsystem(*args, **kwargs) return logging.root
[ "def", "setup_logger", "(", "self", ",", "name", "=", "'celery'", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "self", ".", "setup_logging_subsystem", "(", "*", "args", ",", "*", "*", "kwargs", ")", "return", "logging", ".", "root" ]
https://github.com/cloudera/hue/blob/23f02102d4547c17c32bd5ea0eb24e9eadd657a4/desktop/core/ext-py/celery-4.2.1/celery/app/log.py#L240-L243
omz/PythonistaAppTemplate
f560f93f8876d82a21d108977f90583df08d55af
PythonistaAppTemplate/PythonistaKit.framework/pylib/site-packages/pygments/lexers/__init__.py
python
get_all_lexers
()
Return a generator of tuples in the form ``(name, aliases, filenames, mimetypes)`` of all know lexers.
Return a generator of tuples in the form ``(name, aliases, filenames, mimetypes)`` of all know lexers.
[ "Return", "a", "generator", "of", "tuples", "in", "the", "form", "(", "name", "aliases", "filenames", "mimetypes", ")", "of", "all", "know", "lexers", "." ]
def get_all_lexers(): """ Return a generator of tuples in the form ``(name, aliases, filenames, mimetypes)`` of all know lexers. """ for item in LEXERS.itervalues(): yield item[1:] for lexer in find_plugin_lexers(): yield lexer.name, lexer.aliases, lexer.filenames, lexer.mimetype...
[ "def", "get_all_lexers", "(", ")", ":", "for", "item", "in", "LEXERS", ".", "itervalues", "(", ")", ":", "yield", "item", "[", "1", ":", "]", "for", "lexer", "in", "find_plugin_lexers", "(", ")", ":", "yield", "lexer", ".", "name", ",", "lexer", ".",...
https://github.com/omz/PythonistaAppTemplate/blob/f560f93f8876d82a21d108977f90583df08d55af/PythonistaAppTemplate/PythonistaKit.framework/pylib/site-packages/pygments/lexers/__init__.py#L38-L46
LCAV/pyroomacoustics
15a86425b68969b2109860ca3614f0cbf92b1bd0
pyroomacoustics/utilities.py
python
highpass
(signal, Fs, fc=None, plot=False)
return signal
Filter out the really low frequencies, default is below 50Hz
Filter out the really low frequencies, default is below 50Hz
[ "Filter", "out", "the", "really", "low", "frequencies", "default", "is", "below", "50Hz" ]
def highpass(signal, Fs, fc=None, plot=False): """Filter out the really low frequencies, default is below 50Hz""" if fc is None: fc = constants.get("fc_hp") # have some predefined parameters rp = 5 # minimum ripple in dB in pass-band rs = 60 # minimum attenuation in dB in stop-band n...
[ "def", "highpass", "(", "signal", ",", "Fs", ",", "fc", "=", "None", ",", "plot", "=", "False", ")", ":", "if", "fc", "is", "None", ":", "fc", "=", "constants", ".", "get", "(", "\"fc_hp\"", ")", "# have some predefined parameters", "rp", "=", "5", "...
https://github.com/LCAV/pyroomacoustics/blob/15a86425b68969b2109860ca3614f0cbf92b1bd0/pyroomacoustics/utilities.py#L216-L259
saleor/saleor
2221bdf61b037c660ffc2d1efa484d8efe8172f5
saleor/payment/gateways/stripe/deprecated/utils.py
python
get_currency_for_stripe
(currency)
return currency.lower()
Convert Saleor's currency format to Stripe's currency format. Stripe's currency is using lowercase while Saleor is using uppercase.
Convert Saleor's currency format to Stripe's currency format.
[ "Convert", "Saleor", "s", "currency", "format", "to", "Stripe", "s", "currency", "format", "." ]
def get_currency_for_stripe(currency): """Convert Saleor's currency format to Stripe's currency format. Stripe's currency is using lowercase while Saleor is using uppercase. """ return currency.lower()
[ "def", "get_currency_for_stripe", "(", "currency", ")", ":", "return", "currency", ".", "lower", "(", ")" ]
https://github.com/saleor/saleor/blob/2221bdf61b037c660ffc2d1efa484d8efe8172f5/saleor/payment/gateways/stripe/deprecated/utils.py#L62-L67
lektor/lektor-archive
d2ab208c756b1e7092b2056108571719abd8d6cd
lektor/uilink.py
python
get_user_path
()
return subprocess.Popen( ['bash', '--login', '-c', 'echo $PATH'], stdout=subprocess.PIPE).communicate()[0].split(':')
Returns the PATH variable as a user would see it spawning a fresh login. Primarily this is only useful for OS X when lektor is run from within a bundle where the PATH variables are not available if they are set from the shell profile. On Windows this always returns the current path.
Returns the PATH variable as a user would see it spawning a fresh login. Primarily this is only useful for OS X when lektor is run from within a bundle where the PATH variables are not available if they are set from the shell profile.
[ "Returns", "the", "PATH", "variable", "as", "a", "user", "would", "see", "it", "spawning", "a", "fresh", "login", ".", "Primarily", "this", "is", "only", "useful", "for", "OS", "X", "when", "lektor", "is", "run", "from", "within", "a", "bundle", "where",...
def get_user_path(): """Returns the PATH variable as a user would see it spawning a fresh login. Primarily this is only useful for OS X when lektor is run from within a bundle where the PATH variables are not available if they are set from the shell profile. On Windows this always returns the curr...
[ "def", "get_user_path", "(", ")", ":", "if", "os", ".", "name", "==", "'nt'", ":", "return", "os", ".", "environ", "[", "'PATH'", "]", ".", "split", "(", "';'", ")", "return", "subprocess", ".", "Popen", "(", "[", "'bash'", ",", "'--login'", ",", "...
https://github.com/lektor/lektor-archive/blob/d2ab208c756b1e7092b2056108571719abd8d6cd/lektor/uilink.py#L20-L32
readthedocs/readthedocs.org
0852d7c10d725d954d3e9a93513171baa1116d9f
readthedocs/analytics/proxied_api.py
python
BaseAnalyticsView.increase_page_view_count
(self, request, project, version, absolute_uri)
Increase the page view count for the given project.
Increase the page view count for the given project.
[ "Increase", "the", "page", "view", "count", "for", "the", "given", "project", "." ]
def increase_page_view_count(self, request, project, version, absolute_uri): """Increase the page view count for the given project.""" unresolved = unresolve_from_request(request, absolute_uri) if not unresolved: return path = unresolved.filename fields = dict( ...
[ "def", "increase_page_view_count", "(", "self", ",", "request", ",", "project", ",", "version", ",", "absolute_uri", ")", ":", "unresolved", "=", "unresolve_from_request", "(", "request", ",", "absolute_uri", ")", "if", "not", "unresolved", ":", "return", "path"...
https://github.com/readthedocs/readthedocs.org/blob/0852d7c10d725d954d3e9a93513171baa1116d9f/readthedocs/analytics/proxied_api.py#L63-L83
eBay/accelerator
218d9a5e4451ac72b9e65df6c5b32e37d25136c8
accelerator/extras.py
python
_unicode_as_utf8bytes
(obj)
[]
def _unicode_as_utf8bytes(obj): if isinstance(obj, unicode): return obj.encode('utf-8') elif isinstance(obj, dict): return DotDict((_unicode_as_utf8bytes(k), _unicode_as_utf8bytes(v)) for k, v in iteritems(obj)) elif isinstance(obj, list): return [_unicode_as_utf8bytes(v) for v in obj] else: return obj
[ "def", "_unicode_as_utf8bytes", "(", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "unicode", ")", ":", "return", "obj", ".", "encode", "(", "'utf-8'", ")", "elif", "isinstance", "(", "obj", ",", "dict", ")", ":", "return", "DotDict", "(", "(",...
https://github.com/eBay/accelerator/blob/218d9a5e4451ac72b9e65df6c5b32e37d25136c8/accelerator/extras.py#L141-L149
twilio/twilio-python
6e1e811ea57a1edfadd5161ace87397c563f6915
twilio/rest/api/v2010/account/__init__.py
python
AccountContext.connect_apps
(self)
return self._connect_apps
Access the connect_apps :returns: twilio.rest.api.v2010.account.connect_app.ConnectAppList :rtype: twilio.rest.api.v2010.account.connect_app.ConnectAppList
Access the connect_apps
[ "Access", "the", "connect_apps" ]
def connect_apps(self): """ Access the connect_apps :returns: twilio.rest.api.v2010.account.connect_app.ConnectAppList :rtype: twilio.rest.api.v2010.account.connect_app.ConnectAppList """ if self._connect_apps is None: self._connect_apps = ConnectAppList(self...
[ "def", "connect_apps", "(", "self", ")", ":", "if", "self", ".", "_connect_apps", "is", "None", ":", "self", ".", "_connect_apps", "=", "ConnectAppList", "(", "self", ".", "_version", ",", "account_sid", "=", "self", ".", "_solution", "[", "'sid'", "]", ...
https://github.com/twilio/twilio-python/blob/6e1e811ea57a1edfadd5161ace87397c563f6915/twilio/rest/api/v2010/account/__init__.py#L402-L411
holzschu/Carnets
44effb10ddfc6aa5c8b0687582a724ba82c6b547
Library/lib/python3.7/site-packages/matplotlib-3.0.3-py3.7-macosx-10.9-x86_64.egg/mpl_toolkits/mplot3d/axes3d.py
python
Axes3D.set_zscale
(self, value, **kwargs)
Set the scaling of the z-axis: %(scale)s ACCEPTS: [%(scale)s] Different kwargs are accepted, depending on the scale: %(scale_docs)s .. note :: Currently, Axes3D objects only supports linear scales. Other scales may or may not work, and support for these ...
Set the scaling of the z-axis: %(scale)s
[ "Set", "the", "scaling", "of", "the", "z", "-", "axis", ":", "%", "(", "scale", ")", "s" ]
def set_zscale(self, value, **kwargs): """ Set the scaling of the z-axis: %(scale)s ACCEPTS: [%(scale)s] Different kwargs are accepted, depending on the scale: %(scale_docs)s .. note :: Currently, Axes3D objects only supports linear scales. Othe...
[ "def", "set_zscale", "(", "self", ",", "value", ",", "*", "*", "kwargs", ")", ":", "self", ".", "zaxis", ".", "_set_scale", "(", "value", ",", "*", "*", "kwargs", ")", "self", ".", "autoscale_view", "(", "scalex", "=", "False", ",", "scaley", "=", ...
https://github.com/holzschu/Carnets/blob/44effb10ddfc6aa5c8b0687582a724ba82c6b547/Library/lib/python3.7/site-packages/matplotlib-3.0.3-py3.7-macosx-10.9-x86_64.egg/mpl_toolkits/mplot3d/axes3d.py#L835-L855
minerllabs/minerl
0123527c334c96ebb3f0cf313df1552fa4302691
minerl/herobraine/hero/handlers/translation.py
python
TranslationHandlerGroup.to_hero
(self, x: typing.Dict[str, Any])
return "\n".join( [self.handler_dict[s].to_hero(x[s]) for s in self.handler_dict])
Produces a string from an object X contained in self.space into a string by calling all of the corresponding to_hero methods and joining them with new lines
Produces a string from an object X contained in self.space into a string by calling all of the corresponding to_hero methods and joining them with new lines
[ "Produces", "a", "string", "from", "an", "object", "X", "contained", "in", "self", ".", "space", "into", "a", "string", "by", "calling", "all", "of", "the", "corresponding", "to_hero", "methods", "and", "joining", "them", "with", "new", "lines" ]
def to_hero(self, x: typing.Dict[str, Any]) -> str: """Produces a string from an object X contained in self.space into a string by calling all of the corresponding to_hero methods and joining them with new lines """ return "\n".join( [self.handler_dict[s].to_hero(x[s...
[ "def", "to_hero", "(", "self", ",", "x", ":", "typing", ".", "Dict", "[", "str", ",", "Any", "]", ")", "->", "str", ":", "return", "\"\\n\"", ".", "join", "(", "[", "self", ".", "handler_dict", "[", "s", "]", ".", "to_hero", "(", "x", "[", "s",...
https://github.com/minerllabs/minerl/blob/0123527c334c96ebb3f0cf313df1552fa4302691/minerl/herobraine/hero/handlers/translation.py#L119-L126
kvazis/homeassistant
aca227a780f806d861342e3611025a52a3bb4366
custom_components/xiaomi_miot_raw/light.py
python
MiotSubLight.effect_list
(self)
return list(self._ctrl_params['mode'].keys())
Return the list of supported effects.
Return the list of supported effects.
[ "Return", "the", "list", "of", "supported", "effects", "." ]
def effect_list(self): """Return the list of supported effects.""" return list(self._ctrl_params['mode'].keys())
[ "def", "effect_list", "(", "self", ")", ":", "return", "list", "(", "self", ".", "_ctrl_params", "[", "'mode'", "]", ".", "keys", "(", ")", ")" ]
https://github.com/kvazis/homeassistant/blob/aca227a780f806d861342e3611025a52a3bb4366/custom_components/xiaomi_miot_raw/light.py#L354-L356
wxWidgets/Phoenix
b2199e299a6ca6d866aa6f3d0888499136ead9d6
wx/lib/agw/aui/framemanager.py
python
AuiManager.OnLeftUp_ClickButton
(self, event)
Sub-handler for the :meth:`OnLeftUp` event. :param `event`: a :class:`MouseEvent` to be processed.
Sub-handler for the :meth:`OnLeftUp` event.
[ "Sub", "-", "handler", "for", "the", ":", "meth", ":", "OnLeftUp", "event", "." ]
def OnLeftUp_ClickButton(self, event): """ Sub-handler for the :meth:`OnLeftUp` event. :param `event`: a :class:`MouseEvent` to be processed. """ self._hover_button = None if self._action_part: self.RefreshButton(self._action_part) # make sure ...
[ "def", "OnLeftUp_ClickButton", "(", "self", ",", "event", ")", ":", "self", ".", "_hover_button", "=", "None", "if", "self", ".", "_action_part", ":", "self", ".", "RefreshButton", "(", "self", ".", "_action_part", ")", "# make sure we're still over the item that ...
https://github.com/wxWidgets/Phoenix/blob/b2199e299a6ca6d866aa6f3d0888499136ead9d6/wx/lib/agw/aui/framemanager.py#L9252-L9271
oilshell/oil
94388e7d44a9ad879b12615f6203b38596b5a2d3
Python-2.7.13/Lib/bsddb/dbshelve.py
python
DBShelfCursor.current
(self, flags=0)
return self.get_1(flags|db.DB_CURRENT)
[]
def current(self, flags=0): return self.get_1(flags|db.DB_CURRENT)
[ "def", "current", "(", "self", ",", "flags", "=", "0", ")", ":", "return", "self", ".", "get_1", "(", "flags", "|", "db", ".", "DB_CURRENT", ")" ]
https://github.com/oilshell/oil/blob/94388e7d44a9ad879b12615f6203b38596b5a2d3/Python-2.7.13/Lib/bsddb/dbshelve.py#L333-L333
numba/numba
bf480b9e0da858a65508c2b17759a72ee6a44c51
numba/cuda/cudaimpl.py
python
_get_target_data
(context)
return ll.create_target_data(nvvm.data_layout[context.address_size])
[]
def _get_target_data(context): return ll.create_target_data(nvvm.data_layout[context.address_size])
[ "def", "_get_target_data", "(", "context", ")", ":", "return", "ll", ".", "create_target_data", "(", "nvvm", ".", "data_layout", "[", "context", ".", "address_size", "]", ")" ]
https://github.com/numba/numba/blob/bf480b9e0da858a65508c2b17759a72ee6a44c51/numba/cuda/cudaimpl.py#L975-L976
twilio/twilio-python
6e1e811ea57a1edfadd5161ace87397c563f6915
twilio/rest/wireless/v1/__init__.py
python
V1.__repr__
(self)
return '<Twilio.Wireless.V1>'
Provide a friendly representation :returns: Machine friendly representation :rtype: str
Provide a friendly representation
[ "Provide", "a", "friendly", "representation" ]
def __repr__(self): """ Provide a friendly representation :returns: Machine friendly representation :rtype: str """ return '<Twilio.Wireless.V1>'
[ "def", "__repr__", "(", "self", ")", ":", "return", "'<Twilio.Wireless.V1>'" ]
https://github.com/twilio/twilio-python/blob/6e1e811ea57a1edfadd5161ace87397c563f6915/twilio/rest/wireless/v1/__init__.py#L68-L75
openshift/openshift-tools
1188778e728a6e4781acf728123e5b356380fe6f
openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/lib_openshift/src/ansible/oc_edit.py
python
main
()
ansible oc module for editing objects
ansible oc module for editing objects
[ "ansible", "oc", "module", "for", "editing", "objects" ]
def main(): ''' ansible oc module for editing objects ''' module = AnsibleModule( argument_spec=dict( kubeconfig=dict(default='/etc/origin/master/admin.kubeconfig', type='str'), state=dict(default='present', type='str', choices=['present']), ...
[ "def", "main", "(", ")", ":", "module", "=", "AnsibleModule", "(", "argument_spec", "=", "dict", "(", "kubeconfig", "=", "dict", "(", "default", "=", "'/etc/origin/master/admin.kubeconfig'", ",", "type", "=", "'str'", ")", ",", "state", "=", "dict", "(", "...
https://github.com/openshift/openshift-tools/blob/1188778e728a6e4781acf728123e5b356380fe6f/openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/lib_openshift/src/ansible/oc_edit.py#L5-L35
biolab/orange3
41685e1c7b1d1babe680113685a2d44bcc9fec0b
Orange/widgets/evaluate/owpredictions.py
python
OWPredictions._reset_order
(self)
[]
def _reset_order(self): datamodel = self.dataview.model() predmodel = self.predictionsview.model() if datamodel is not None: datamodel.setSortIndices(None) datamodel.sort(-1) if predmodel is not None: predmodel.setSortIndices(None) predmode...
[ "def", "_reset_order", "(", "self", ")", ":", "datamodel", "=", "self", ".", "dataview", ".", "model", "(", ")", "predmodel", "=", "self", ".", "predictionsview", ".", "model", "(", ")", "if", "datamodel", "is", "not", "None", ":", "datamodel", ".", "s...
https://github.com/biolab/orange3/blob/41685e1c7b1d1babe680113685a2d44bcc9fec0b/Orange/widgets/evaluate/owpredictions.py#L427-L437
krintoxi/NoobSec-Toolkit
38738541cbc03cedb9a3b3ed13b629f781ad64f6
NoobSecToolkit /tools/inject/thirdparty/pagerank/pagerank.py
python
check_hash
(hash_int)
return '7' + str(check_byte) + hash_str
[]
def check_hash(hash_int): hash_str = '%u' % (hash_int) flag = 0 check_byte = 0 i = len(hash_str) - 1 while i >= 0: byte = int(hash_str[i]) if 1 == (flag % 2): byte *= 2; byte = byte / 10 + byte % 10 check_byte += byte flag += 1 i -= 1 ...
[ "def", "check_hash", "(", "hash_int", ")", ":", "hash_str", "=", "'%u'", "%", "(", "hash_int", ")", "flag", "=", "0", "check_byte", "=", "0", "i", "=", "len", "(", "hash_str", ")", "-", "1", "while", "i", ">=", "0", ":", "byte", "=", "int", "(", ...
https://github.com/krintoxi/NoobSec-Toolkit/blob/38738541cbc03cedb9a3b3ed13b629f781ad64f6/NoobSecToolkit /tools/inject/thirdparty/pagerank/pagerank.py#L56-L79
mesalock-linux/mesapy
ed546d59a21b36feb93e2309d5c6b75aa0ad95c9
rpython/rlib/jit.py
python
enter_portal_frame
(unique_id)
call this when starting to interpret a function. calling this is not necessary for almost all interpreters. The only exception is stackless interpreters where the portal never calls itself.
call this when starting to interpret a function. calling this is not necessary for almost all interpreters. The only exception is stackless interpreters where the portal never calls itself.
[ "call", "this", "when", "starting", "to", "interpret", "a", "function", ".", "calling", "this", "is", "not", "necessary", "for", "almost", "all", "interpreters", ".", "The", "only", "exception", "is", "stackless", "interpreters", "where", "the", "portal", "nev...
def enter_portal_frame(unique_id): """call this when starting to interpret a function. calling this is not necessary for almost all interpreters. The only exception is stackless interpreters where the portal never calls itself. """ from rpython.rtyper.lltypesystem import lltype from rpython.rtyp...
[ "def", "enter_portal_frame", "(", "unique_id", ")", ":", "from", "rpython", ".", "rtyper", ".", "lltypesystem", "import", "lltype", "from", "rpython", ".", "rtyper", ".", "lltypesystem", ".", "lloperation", "import", "llop", "llop", ".", "jit_enter_portal_frame", ...
https://github.com/mesalock-linux/mesapy/blob/ed546d59a21b36feb93e2309d5c6b75aa0ad95c9/rpython/rlib/jit.py#L1291-L1298
tf-encrypted/tf-encrypted
8b7cfb32c426e9a6f56769a1b47626bd1be03a66
tf_encrypted/protocol/pond/pond.py
python
Pond.concat
(self, xs: List["PondTensor"], axis)
See tf.concat.
See tf.concat.
[ "See", "tf", ".", "concat", "." ]
def concat(self, xs: List["PondTensor"], axis): """See tf.concat.""" if all(isinstance(x, PondPublicTensor) for x in xs): return _concat_public(self, xs, axis=axis) if all(isinstance(x, PondPrivateTensor) for x in xs): return _concat_private(self, xs, axis=axis) ...
[ "def", "concat", "(", "self", ",", "xs", ":", "List", "[", "\"PondTensor\"", "]", ",", "axis", ")", ":", "if", "all", "(", "isinstance", "(", "x", ",", "PondPublicTensor", ")", "for", "x", "in", "xs", ")", ":", "return", "_concat_public", "(", "self"...
https://github.com/tf-encrypted/tf-encrypted/blob/8b7cfb32c426e9a6f56769a1b47626bd1be03a66/tf_encrypted/protocol/pond/pond.py#L1200-L1212
oracle/oci-python-sdk
3c1604e4e212008fb6718e2f68cdb5ef71fd5793
src/oci/bastion/bastion_client.py
python
BastionClient.list_work_requests
(self, compartment_id, **kwargs)
Lists the work requests in a compartment. :param str compartment_id: (required) The unique identifier (OCID) of the compartment in which to list resources. :param str opc_request_id: (optional) The client request ID for tracing. :param str page: (optional) ...
Lists the work requests in a compartment.
[ "Lists", "the", "work", "requests", "in", "a", "compartment", "." ]
def list_work_requests(self, compartment_id, **kwargs): """ Lists the work requests in a compartment. :param str compartment_id: (required) The unique identifier (OCID) of the compartment in which to list resources. :param str opc_request_id: (optional) The cli...
[ "def", "list_work_requests", "(", "self", ",", "compartment_id", ",", "*", "*", "kwargs", ")", ":", "resource_path", "=", "\"/workRequests\"", "method", "=", "\"GET\"", "# Don't accept unknown kwargs", "expected_kwargs", "=", "[", "\"retry_strategy\"", ",", "\"opc_req...
https://github.com/oracle/oci-python-sdk/blob/3c1604e4e212008fb6718e2f68cdb5ef71fd5793/src/oci/bastion/bastion_client.py#L1221-L1303
chribsen/simple-machine-learning-examples
dc94e52a4cebdc8bb959ff88b81ff8cfeca25022
venv/lib/python2.7/site-packages/pandas/computation/pytables.py
python
ConditionBinOp.format
(self)
return self.condition
return the actual ne format
return the actual ne format
[ "return", "the", "actual", "ne", "format" ]
def format(self): """ return the actual ne format """ return self.condition
[ "def", "format", "(", "self", ")", ":", "return", "self", ".", "condition" ]
https://github.com/chribsen/simple-machine-learning-examples/blob/dc94e52a4cebdc8bb959ff88b81ff8cfeca25022/venv/lib/python2.7/site-packages/pandas/computation/pytables.py#L317-L319
sideeffects/SideFXLabs
956bc1eef6710882ae8d3a31b4a33dd631a56d5f
scripts/python/pyper/vendor/Qt.py
python
_install
()
[]
def _install(): # Default order (customize order and content via QT_PREFERRED_BINDING) default_order = ("PySide2", "PyQt5", "PySide", "PyQt4") preferred_order = None if QT_PREFERRED_BINDING_JSON: # A per-vendor preferred binding customization was defined # This should be a dictionary of ...
[ "def", "_install", "(", ")", ":", "# Default order (customize order and content via QT_PREFERRED_BINDING)", "default_order", "=", "(", "\"PySide2\"", ",", "\"PyQt5\"", ",", "\"PySide\"", ",", "\"PyQt4\"", ")", "preferred_order", "=", "None", "if", "QT_PREFERRED_BINDING_JSON...
https://github.com/sideeffects/SideFXLabs/blob/956bc1eef6710882ae8d3a31b4a33dd631a56d5f/scripts/python/pyper/vendor/Qt.py#L1812-L1925
enthought/mayavi
2103a273568b8f0bd62328801aafbd6252543ae8
mayavi/tools/engine_manager.py
python
check_backend
()
Check if either we are in test mode, or if there is a suitable traits backend installed.
Check if either we are in test mode, or if there is a suitable traits backend installed.
[ "Check", "if", "either", "we", "are", "in", "test", "mode", "or", "if", "there", "is", "a", "suitable", "traits", "backend", "installed", "." ]
def check_backend(): """ Check if either we are in test mode, or if there is a suitable traits backend installed. """ from traitsui.toolkit import toolkit from traits.etsconfig.api import ETSConfig from mayavi.tools.engine_manager import options toolkit() # This forces the selection of...
[ "def", "check_backend", "(", ")", ":", "from", "traitsui", ".", "toolkit", "import", "toolkit", "from", "traits", ".", "etsconfig", ".", "api", "import", "ETSConfig", "from", "mayavi", ".", "tools", ".", "engine_manager", "import", "options", "toolkit", "(", ...
https://github.com/enthought/mayavi/blob/2103a273568b8f0bd62328801aafbd6252543ae8/mayavi/tools/engine_manager.py#L26-L40
kroger/pyknon
945e1f92a5dfab524a416278169972d21455a1d8
pyknon/music.py
python
Note.__note_octave
(self, octave)
return self.value + ((self.octave - octave) * 12)
Return a note value in terms of a given octave octave n = Note(11, 4) __note_octave(n, 5) = -1
Return a note value in terms of a given octave octave
[ "Return", "a", "note", "value", "in", "terms", "of", "a", "given", "octave", "octave" ]
def __note_octave(self, octave): """Return a note value in terms of a given octave octave n = Note(11, 4) __note_octave(n, 5) = -1 """ return self.value + ((self.octave - octave) * 12)
[ "def", "__note_octave", "(", "self", ",", "octave", ")", ":", "return", "self", ".", "value", "+", "(", "(", "self", ".", "octave", "-", "octave", ")", "*", "12", ")" ]
https://github.com/kroger/pyknon/blob/945e1f92a5dfab524a416278169972d21455a1d8/pyknon/music.py#L71-L78
raveberry/raveberry
df0186c94b238b57de86d3fd5c595dcd08a7c708
backend/core/settings/settings.py
python
control
( func: Callable[[WSGIRequest], Optional[HttpResponse]] )
return wraps(func)(_decorator)
A decorator that makes sure that only the admin changes a setting.
A decorator that makes sure that only the admin changes a setting.
[ "A", "decorator", "that", "makes", "sure", "that", "only", "the", "admin", "changes", "a", "setting", "." ]
def control( func: Callable[[WSGIRequest], Optional[HttpResponse]] ) -> Callable[[WSGIRequest], HttpResponse]: """A decorator that makes sure that only the admin changes a setting.""" def _decorator(request: WSGIRequest) -> HttpResponse: if not user_manager.is_admin(request.user): retur...
[ "def", "control", "(", "func", ":", "Callable", "[", "[", "WSGIRequest", "]", ",", "Optional", "[", "HttpResponse", "]", "]", ")", "->", "Callable", "[", "[", "WSGIRequest", "]", ",", "HttpResponse", "]", ":", "def", "_decorator", "(", "request", ":", ...
https://github.com/raveberry/raveberry/blob/df0186c94b238b57de86d3fd5c595dcd08a7c708/backend/core/settings/settings.py#L25-L39
openedx/edx-platform
68dd185a0ab45862a2a61e0f803d7e03d2be71b5
cms/djangoapps/contentstore/views/course.py
python
library_listing
(request)
return render_to_response('index.html', data)
List all Libraries available to the logged in user
List all Libraries available to the logged in user
[ "List", "all", "Libraries", "available", "to", "the", "logged", "in", "user" ]
def library_listing(request): """ List all Libraries available to the logged in user """ libraries = _accessible_libraries_iter(request.user) if LIBRARIES_ENABLED else [] data = { 'in_process_course_actions': [], 'courses': [], 'libraries_enabled': LIBRARIES_ENABLED, ...
[ "def", "library_listing", "(", "request", ")", ":", "libraries", "=", "_accessible_libraries_iter", "(", "request", ".", "user", ")", "if", "LIBRARIES_ENABLED", "else", "[", "]", "data", "=", "{", "'in_process_course_actions'", ":", "[", "]", ",", "'courses'", ...
https://github.com/openedx/edx-platform/blob/68dd185a0ab45862a2a61e0f803d7e03d2be71b5/cms/djangoapps/contentstore/views/course.py#L579-L600
jgagneastro/coffeegrindsize
22661ebd21831dba4cf32bfc6ba59fe3d49f879c
App/dist/coffeegrindsize.app/Contents/Resources/lib/python3.7/pandas/core/resample.py
python
Resampler.std
(self, ddof=1, *args, **kwargs)
return self._downsample('std', ddof=ddof)
Compute standard deviation of groups, excluding missing values. Parameters ---------- ddof : integer, default 1 degrees of freedom
Compute standard deviation of groups, excluding missing values.
[ "Compute", "standard", "deviation", "of", "groups", "excluding", "missing", "values", "." ]
def std(self, ddof=1, *args, **kwargs): """ Compute standard deviation of groups, excluding missing values. Parameters ---------- ddof : integer, default 1 degrees of freedom """ nv.validate_resampler_func('std', args, kwargs) return self._downsam...
[ "def", "std", "(", "self", ",", "ddof", "=", "1", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "nv", ".", "validate_resampler_func", "(", "'std'", ",", "args", ",", "kwargs", ")", "return", "self", ".", "_downsample", "(", "'std'", ",", "dd...
https://github.com/jgagneastro/coffeegrindsize/blob/22661ebd21831dba4cf32bfc6ba59fe3d49f879c/App/dist/coffeegrindsize.app/Contents/Resources/lib/python3.7/pandas/core/resample.py#L797-L807
biolab/orange3
41685e1c7b1d1babe680113685a2d44bcc9fec0b
Orange/widgets/data/owimpute.py
python
AsDefault.__getattr__
(self, item)
return getattr(self.method, item)
[]
def __getattr__(self, item): return getattr(self.method, item)
[ "def", "__getattr__", "(", "self", ",", "item", ")", ":", "return", "getattr", "(", "self", ".", "method", ",", "item", ")" ]
https://github.com/biolab/orange3/blob/41685e1c7b1d1babe680113685a2d44bcc9fec0b/Orange/widgets/data/owimpute.py#L60-L61
openhatch/oh-mainline
ce29352a034e1223141dcc2f317030bbc3359a51
vendor/packages/PyYaml/lib3/yaml/__init__.py
python
add_multi_representer
(data_type, multi_representer, Dumper=Dumper)
Add a representer for the given type. Multi-representer is a function accepting a Dumper instance and an instance of the given data type or subtype and producing the corresponding representation node.
Add a representer for the given type. Multi-representer is a function accepting a Dumper instance and an instance of the given data type or subtype and producing the corresponding representation node.
[ "Add", "a", "representer", "for", "the", "given", "type", ".", "Multi", "-", "representer", "is", "a", "function", "accepting", "a", "Dumper", "instance", "and", "an", "instance", "of", "the", "given", "data", "type", "or", "subtype", "and", "producing", "...
def add_multi_representer(data_type, multi_representer, Dumper=Dumper): """ Add a representer for the given type. Multi-representer is a function accepting a Dumper instance and an instance of the given data type or subtype and producing the corresponding representation node. """ Dumper.add_...
[ "def", "add_multi_representer", "(", "data_type", ",", "multi_representer", ",", "Dumper", "=", "Dumper", ")", ":", "Dumper", ".", "add_multi_representer", "(", "data_type", ",", "multi_representer", ")" ]
https://github.com/openhatch/oh-mainline/blob/ce29352a034e1223141dcc2f317030bbc3359a51/vendor/packages/PyYaml/lib3/yaml/__init__.py#L265-L272
tendenci/tendenci
0f2c348cc0e7d41bc56f50b00ce05544b083bf1d
tendenci/apps/corporate_memberships/forms.py
python
CorpMembershipUploadForm.clean_upload_file
(self)
return upload_file
[]
def clean_upload_file(self): key = self.cleaned_data['key'] upload_file = self.cleaned_data['upload_file'] if not key: raise forms.ValidationError(_('Please specify the key to identify duplicates')) file_content = upload_file.read() encoding = chardet.detect(file_con...
[ "def", "clean_upload_file", "(", "self", ")", ":", "key", "=", "self", ".", "cleaned_data", "[", "'key'", "]", "upload_file", "=", "self", ".", "cleaned_data", "[", "'upload_file'", "]", "if", "not", "key", ":", "raise", "forms", ".", "ValidationError", "(...
https://github.com/tendenci/tendenci/blob/0f2c348cc0e7d41bc56f50b00ce05544b083bf1d/tendenci/apps/corporate_memberships/forms.py#L952-L973
PaddlePaddle/Research
2da0bd6c72d60e9df403aff23a7802779561c4a1
KG/DuEE_baseline/bin/optimization.py
python
optimization
(loss, warmup_steps, num_train_steps, learning_rate, train_program, startup_prog, weight_decay, scheduler='linear_warmup_decay', use_fp16=False, use_dynamic_loss_scali...
return scheduled_lr, loss_scaling
optimization
optimization
[ "optimization" ]
def optimization(loss, warmup_steps, num_train_steps, learning_rate, train_program, startup_prog, weight_decay, scheduler='linear_warmup_decay', use_fp16=False, use_dy...
[ "def", "optimization", "(", "loss", ",", "warmup_steps", ",", "num_train_steps", ",", "learning_rate", ",", "train_program", ",", "startup_prog", ",", "weight_decay", ",", "scheduler", "=", "'linear_warmup_decay'", ",", "use_fp16", "=", "False", ",", "use_dynamic_lo...
https://github.com/PaddlePaddle/Research/blob/2da0bd6c72d60e9df403aff23a7802779561c4a1/KG/DuEE_baseline/bin/optimization.py#L58-L167
pykaldi/pykaldi
b4e7a15a31286e57c01259edfda54d113b5ceb0e
kaldi/util/table.py
python
_RandomAccessReaderBase.value
(self, key)
return super(_RandomAccessReaderBase, self).value(key)
Returns the value associated with the key. This method is provided for compatibility with the C++ API only; most users should use the Pythonic API. Args: key (str): The key. Returns: The value associated with the key.
Returns the value associated with the key.
[ "Returns", "the", "value", "associated", "with", "the", "key", "." ]
def value(self, key): """Returns the value associated with the key. This method is provided for compatibility with the C++ API only; most users should use the Pythonic API. Args: key (str): The key. Returns: The value associated with the key. ""...
[ "def", "value", "(", "self", ",", "key", ")", ":", "return", "super", "(", "_RandomAccessReaderBase", ",", "self", ")", ".", "value", "(", "key", ")" ]
https://github.com/pykaldi/pykaldi/blob/b4e7a15a31286e57c01259edfda54d113b5ceb0e/kaldi/util/table.py#L358-L370
chenxiaoyouyou/Bert-BiLSTM-CRF-pytorch
10d130ebb777d872043820ed9b3250cca6188ca5
model/bert_lstm_crf.py
python
BERT_LSTM_CRF.loss
(self, feats, mask, tags)
return loss_value
feats: size=(batch_size, seq_len, tag_size) mask: size=(batch_size, seq_len) tags: size=(batch_size, seq_len) :return:
feats: size=(batch_size, seq_len, tag_size) mask: size=(batch_size, seq_len) tags: size=(batch_size, seq_len) :return:
[ "feats", ":", "size", "=", "(", "batch_size", "seq_len", "tag_size", ")", "mask", ":", "size", "=", "(", "batch_size", "seq_len", ")", "tags", ":", "size", "=", "(", "batch_size", "seq_len", ")", ":", "return", ":" ]
def loss(self, feats, mask, tags): """ feats: size=(batch_size, seq_len, tag_size) mask: size=(batch_size, seq_len) tags: size=(batch_size, seq_len) :return: """ loss_value = self.crf.neg_log_likelihood_loss(feats, mask, tags) batch_size = feats.si...
[ "def", "loss", "(", "self", ",", "feats", ",", "mask", ",", "tags", ")", ":", "loss_value", "=", "self", ".", "crf", ".", "neg_log_likelihood_loss", "(", "feats", ",", "mask", ",", "tags", ")", "batch_size", "=", "feats", ".", "size", "(", "0", ")", ...
https://github.com/chenxiaoyouyou/Bert-BiLSTM-CRF-pytorch/blob/10d130ebb777d872043820ed9b3250cca6188ca5/model/bert_lstm_crf.py#L58-L68
MegviiDetection/video_analyst
f4d1bccb1c698961fed3cb70808f1177fab13bdd
videoanalyst/pipeline/utils/online_classifier/utils/optimization.py
python
GaussNewtonCG.run
(self, num_cg_iter, num_gn_iter=None)
return self.losses, self.residuals
Run the optimizer. args: num_cg_iter: Number of CG iterations per GN iter. If list, then each entry specifies number of CG iterations and number of GN iterations is given by the length of the list. num_gn_iter: Number of GN iterations. Shall only be given if num_...
Run the optimizer. args: num_cg_iter: Number of CG iterations per GN iter. If list, then each entry specifies number of CG iterations and number of GN iterations is given by the length of the list. num_gn_iter: Number of GN iterations. Shall only be given if num_...
[ "Run", "the", "optimizer", ".", "args", ":", "num_cg_iter", ":", "Number", "of", "CG", "iterations", "per", "GN", "iter", ".", "If", "list", "then", "each", "entry", "specifies", "number", "of", "CG", "iterations", "and", "number", "of", "GN", "iterations"...
def run(self, num_cg_iter, num_gn_iter=None): """Run the optimizer. args: num_cg_iter: Number of CG iterations per GN iter. If list, then each entry specifies number of CG iterations and number of GN iterations is given by the length of the list. num_gn_i...
[ "def", "run", "(", "self", ",", "num_cg_iter", ",", "num_gn_iter", "=", "None", ")", ":", "if", "isinstance", "(", "num_cg_iter", ",", "int", ")", ":", "if", "num_gn_iter", "is", "None", ":", "raise", "ValueError", "(", "'Must specify number of GN iter if CG i...
https://github.com/MegviiDetection/video_analyst/blob/f4d1bccb1c698961fed3cb70808f1177fab13bdd/videoanalyst/pipeline/utils/online_classifier/utils/optimization.py#L345-L389
ray-project/ray
703c1610348615dcb8c2d141a0c46675084660f5
python/ray/serve/deployment_state.py
python
ActorReplicaWrapper.check_ready
( self)
return ReplicaStartupStatus.SUCCEEDED, version
Check if current replica has started by making ray API calls on relevant actor / object ref. Returns: state (ReplicaStartupStatus): PENDING_ALLOCATION: - replica is waiting for a worker to start PENDING_INITIALIZATION -...
Check if current replica has started by making ray API calls on relevant actor / object ref.
[ "Check", "if", "current", "replica", "has", "started", "by", "making", "ray", "API", "calls", "on", "relevant", "actor", "/", "object", "ref", "." ]
def check_ready( self) -> Tuple[ReplicaStartupStatus, Optional[DeploymentVersion]]: """ Check if current replica has started by making ray API calls on relevant actor / object ref. Returns: state (ReplicaStartupStatus): PENDING_ALLOCATION: ...
[ "def", "check_ready", "(", "self", ")", "->", "Tuple", "[", "ReplicaStartupStatus", ",", "Optional", "[", "DeploymentVersion", "]", "]", ":", "# check whether the replica has been allocated", "ready", ",", "_", "=", "ray", ".", "wait", "(", "[", "self", ".", "...
https://github.com/ray-project/ray/blob/703c1610348615dcb8c2d141a0c46675084660f5/python/ray/serve/deployment_state.py#L240-L287
Yubico/yubikey-manager
32914673d1d0004aba820e614ac9a9a640b4d196
yubikit/piv.py
python
PivSession.get_management_key_metadata
(self)
return ManagementKeyMetadata( MANAGEMENT_KEY_TYPE(data.get(TAG_METADATA_ALGO, b"\x03")[0]), data[TAG_METADATA_IS_DEFAULT] != b"\0", TOUCH_POLICY(policy[INDEX_TOUCH_POLICY]), )
[]
def get_management_key_metadata(self) -> ManagementKeyMetadata: require_version(self.version, (5, 3, 0)) data = Tlv.parse_dict( self.protocol.send_apdu(0, INS_GET_METADATA, 0, SLOT_CARD_MANAGEMENT) ) policy = data[TAG_METADATA_POLICY] return ManagementKeyMetadata( ...
[ "def", "get_management_key_metadata", "(", "self", ")", "->", "ManagementKeyMetadata", ":", "require_version", "(", "self", ".", "version", ",", "(", "5", ",", "3", ",", "0", ")", ")", "data", "=", "Tlv", ".", "parse_dict", "(", "self", ".", "protocol", ...
https://github.com/Yubico/yubikey-manager/blob/32914673d1d0004aba820e614ac9a9a640b4d196/yubikit/piv.py#L581-L591
sagemath/sage
f9b2db94f675ff16963ccdefba4f1a3393b3fe0d
src/sage/coding/relative_finite_field_extension.py
python
RelativeFiniteFieldExtension.__init__
(self, absolute_field, relative_field, embedding=None)
r""" TESTS: If ``absolute_field`` is not a finite field, an error is raised:: sage: from sage.coding.relative_finite_field_extension import * sage: Fqm = RR sage: Fq.<a> = GF(4) sage: RelativeFiniteFieldExtension(Fqm, Fq) Traceback (most rece...
r""" TESTS:
[ "r", "TESTS", ":" ]
def __init__(self, absolute_field, relative_field, embedding=None): r""" TESTS: If ``absolute_field`` is not a finite field, an error is raised:: sage: from sage.coding.relative_finite_field_extension import * sage: Fqm = RR sage: Fq.<a> = GF(4) ...
[ "def", "__init__", "(", "self", ",", "absolute_field", ",", "relative_field", ",", "embedding", "=", "None", ")", ":", "if", "not", "absolute_field", ".", "is_finite", "(", ")", ":", "raise", "ValueError", "(", "\"absolute_field has to be a finite field\"", ")", ...
https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/coding/relative_finite_field_extension.py#L79-L137
windelbouwman/ppci
915c069e0667042c085ec42c78e9e3c9a5295324
ppci/lang/c3/parser.py
python
Parser.parse_compound
(self)
return ast.Compound(statements, loc)
Parse a compound statement, which is bounded by '{' and '}'
Parse a compound statement, which is bounded by '{' and '}'
[ "Parse", "a", "compound", "statement", "which", "is", "bounded", "by", "{", "and", "}" ]
def parse_compound(self): """ Parse a compound statement, which is bounded by '{' and '}' """ loc = self.consume("{").loc statements = [] while self.peek != "}": statements.append(self.parse_statement()) self.consume("}") # Enforce styling: # if cb1.l...
[ "def", "parse_compound", "(", "self", ")", ":", "loc", "=", "self", ".", "consume", "(", "\"{\"", ")", ".", "loc", "statements", "=", "[", "]", "while", "self", ".", "peek", "!=", "\"}\"", ":", "statements", ".", "append", "(", "self", ".", "parse_st...
https://github.com/windelbouwman/ppci/blob/915c069e0667042c085ec42c78e9e3c9a5295324/ppci/lang/c3/parser.py#L280-L292
vmware/vsphere-automation-sdk-python
ba7d4e0742f58a641dfed9538ecbbb1db4f3891e
samples/vsphere/vcenter/setup/datastore.py
python
validate
(context)
return ( detect_nfs_datastore(context) and detect_vmfs_datastores(context))
[]
def validate(context): return ( detect_nfs_datastore(context) and detect_vmfs_datastores(context))
[ "def", "validate", "(", "context", ")", ":", "return", "(", "detect_nfs_datastore", "(", "context", ")", "and", "detect_vmfs_datastores", "(", "context", ")", ")" ]
https://github.com/vmware/vsphere-automation-sdk-python/blob/ba7d4e0742f58a641dfed9538ecbbb1db4f3891e/samples/vsphere/vcenter/setup/datastore.py#L258-L261
annoviko/pyclustering
bf4f51a472622292627ec8c294eb205585e50f52
pyclustering/cluster/syncnet.py
python
syncnet._phase_kuramoto
(self, teta, t, argv)
return self._freq[index] + (phase / divider)
! @brief Overrided method for calculation of oscillator phase. @param[in] teta (double): Current value of phase. @param[in] t (double): Time (can be ignored). @param[in] argv (uint): Index of oscillator whose phase represented by argument teta. @return (double) ...
!
[ "!" ]
def _phase_kuramoto(self, teta, t, argv): """! @brief Overrided method for calculation of oscillator phase. @param[in] teta (double): Current value of phase. @param[in] t (double): Time (can be ignored). @param[in] argv (uint): Index of oscillator whose phase represented...
[ "def", "_phase_kuramoto", "(", "self", ",", "teta", ",", "t", ",", "argv", ")", ":", "index", "=", "argv", "# index of oscillator", "phase", "=", "0.0", "# phase of a specified oscillator that will calculated in line with current env. states.", "neighbors", "=", "self", ...
https://github.com/annoviko/pyclustering/blob/bf4f51a472622292627ec8c294eb205585e50f52/pyclustering/cluster/syncnet.py#L308-L335
robotlearn/pyrobolearn
9cd7c060723fda7d2779fa255ac998c2c82b8436
pyrobolearn/simulators/middlewares/ros_publisher.py
python
Publisher.__del__
(self)
Close all topics.
Close all topics.
[ "Close", "all", "topics", "." ]
def __del__(self): """ Close all topics. """ self.unregister()
[ "def", "__del__", "(", "self", ")", ":", "self", ".", "unregister", "(", ")" ]
https://github.com/robotlearn/pyrobolearn/blob/9cd7c060723fda7d2779fa255ac998c2c82b8436/pyrobolearn/simulators/middlewares/ros_publisher.py#L390-L394
openstack/swift
b8d7c3dcb817504dcc0959ba52cc4ed2cf66c100
swift/container/sharder.py
python
finalize_shrinking
(broker, acceptor_ranges, donor_ranges, timestamp)
Update donor shard ranges to shrinking state and merge donors and acceptors to broker. :param broker: A :class:`~swift.container.backend.ContainerBroker`. :param acceptor_ranges: A list of :class:`~swift.common.utils.ShardRange` that are to be acceptors. :param donor_ranges: A list of :class:`~...
Update donor shard ranges to shrinking state and merge donors and acceptors to broker.
[ "Update", "donor", "shard", "ranges", "to", "shrinking", "state", "and", "merge", "donors", "and", "acceptors", "to", "broker", "." ]
def finalize_shrinking(broker, acceptor_ranges, donor_ranges, timestamp): """ Update donor shard ranges to shrinking state and merge donors and acceptors to broker. :param broker: A :class:`~swift.container.backend.ContainerBroker`. :param acceptor_ranges: A list of :class:`~swift.common.utils.Shar...
[ "def", "finalize_shrinking", "(", "broker", ",", "acceptor_ranges", ",", "donor_ranges", ",", "timestamp", ")", ":", "for", "donor", "in", "donor_ranges", ":", "if", "donor", ".", "update_state", "(", "ShardRange", ".", "SHRINKING", ")", ":", "# Set donor state ...
https://github.com/openstack/swift/blob/b8d7c3dcb817504dcc0959ba52cc4ed2cf66c100/swift/container/sharder.py#L297-L314
omz/PythonistaAppTemplate
f560f93f8876d82a21d108977f90583df08d55af
PythonistaAppTemplate/PythonistaKit.framework/pylib_ext/sympy/polys/galoistools.py
python
_gf_trace_map
(f, n, g, b, p, K)
return r
utility for ``gf_edf_shoup``
utility for ``gf_edf_shoup``
[ "utility", "for", "gf_edf_shoup" ]
def _gf_trace_map(f, n, g, b, p, K): """ utility for ``gf_edf_shoup`` """ f = gf_rem(f, g, p, K) h = f r = f for i in range(1, n): h = gf_frobenius_map(h, g, b, p, K) r = gf_add(r, h, p, K) r = gf_rem(r, g, p, K) return r
[ "def", "_gf_trace_map", "(", "f", ",", "n", ",", "g", ",", "b", ",", "p", ",", "K", ")", ":", "f", "=", "gf_rem", "(", "f", ",", "g", ",", "p", ",", "K", ")", "h", "=", "f", "r", "=", "f", "for", "i", "in", "range", "(", "1", ",", "n"...
https://github.com/omz/PythonistaAppTemplate/blob/f560f93f8876d82a21d108977f90583df08d55af/PythonistaAppTemplate/PythonistaKit.framework/pylib_ext/sympy/polys/galoistools.py#L1350-L1361
makerbot/ReplicatorG
d6f2b07785a5a5f1e172fb87cb4303b17c575d5d
skein_engines/skeinforge-35/skeinforge_application/skeinforge_plugins/craft_plugins/tower.py
python
Island.createBoundingLoop
(self)
Create the bounding loop if it is not already created.
Create the bounding loop if it is not already created.
[ "Create", "the", "bounding", "loop", "if", "it", "is", "not", "already", "created", "." ]
def createBoundingLoop(self): "Create the bounding loop if it is not already created." if self.boundingLoop == None: self.boundingLoop = intercircle.BoundingLoop().getFromLoop( self.boundary )
[ "def", "createBoundingLoop", "(", "self", ")", ":", "if", "self", ".", "boundingLoop", "==", "None", ":", "self", ".", "boundingLoop", "=", "intercircle", ".", "BoundingLoop", "(", ")", ".", "getFromLoop", "(", "self", ".", "boundary", ")" ]
https://github.com/makerbot/ReplicatorG/blob/d6f2b07785a5a5f1e172fb87cb4303b17c575d5d/skein_engines/skeinforge-35/skeinforge_application/skeinforge_plugins/craft_plugins/tower.py#L122-L125
pypa/bandersnatch
2e3eb53029ddb8f205f85242d724ae492040c1ce
src/bandersnatch_storage_plugins/swift.py
python
SwiftStorage.get_container
(self, container: Optional[str] = None)
Given the name of a container, return its contents. :param str container: The name of the desired container, defaults to :attr:`~SwiftStorage.default_container` :return: A list of objects in the container if it exists :rtype: List[Dict[str, str]] Example: >>> plugi...
Given the name of a container, return its contents.
[ "Given", "the", "name", "of", "a", "container", "return", "its", "contents", "." ]
def get_container(self, container: Optional[str] = None) -> List[Dict[str, str]]: """ Given the name of a container, return its contents. :param str container: The name of the desired container, defaults to :attr:`~SwiftStorage.default_container` :return: A list of objects i...
[ "def", "get_container", "(", "self", ",", "container", ":", "Optional", "[", "str", "]", "=", "None", ")", "->", "List", "[", "Dict", "[", "str", ",", "str", "]", "]", ":", "if", "not", "container", ":", "container", "=", "self", ".", "default_contai...
https://github.com/pypa/bandersnatch/blob/2e3eb53029ddb8f205f85242d724ae492040c1ce/src/bandersnatch_storage_plugins/swift.py#L563-L596
Sceptre/sceptre
b44797ae712e1e57c2421f2d93c35a4e8104c5ee
sceptre/template.py
python
Template._domain_from_region
(region)
return "com.cn" if region.startswith("cn-") else "com"
[]
def _domain_from_region(region): return "com.cn" if region.startswith("cn-") else "com"
[ "def", "_domain_from_region", "(", "region", ")", ":", "return", "\"com.cn\"", "if", "region", ".", "startswith", "(", "\"cn-\"", ")", "else", "\"com\"" ]
https://github.com/Sceptre/sceptre/blob/b44797ae712e1e57c2421f2d93c35a4e8104c5ee/sceptre/template.py#L234-L235
ogrisel/pygbm
686495bedd7d495bcab1d66eb74309de48d3f3c1
pygbm/histogram.py
python
_build_histogram_root
(n_bins, binned_feature, all_gradients, all_hessians)
return histogram
Special case for the root node The root node has to find the split among all the samples from the training set. binned_feature and all_gradients and all_hessians already have a consistent ordering.
Special case for the root node
[ "Special", "case", "for", "the", "root", "node" ]
def _build_histogram_root(n_bins, binned_feature, all_gradients, all_hessians): """Special case for the root node The root node has to find the split among all the samples from the training set. binned_feature and all_gradients and all_hessians already have a consistent orderi...
[ "def", "_build_histogram_root", "(", "n_bins", ",", "binned_feature", ",", "all_gradients", ",", "all_hessians", ")", ":", "histogram", "=", "np", ".", "zeros", "(", "n_bins", ",", "dtype", "=", "HISTOGRAM_DTYPE", ")", "n_node_samples", "=", "binned_feature", "....
https://github.com/ogrisel/pygbm/blob/686495bedd7d495bcab1d66eb74309de48d3f3c1/pygbm/histogram.py#L160-L199
sagemath/sage
f9b2db94f675ff16963ccdefba4f1a3393b3fe0d
src/sage/modular/cusps.py
python
Cusp.__init__
(self, a, b=None, parent=None, check=True)
r""" Create the cusp a/b in `\mathbb{P}^1(\QQ)`, where if b=0 this is the cusp at infinity. When present, b must either be Infinity or coercible to an Integer. EXAMPLES:: sage: Cusp(2,3) 2/3 sage: Cusp(3,6) 1/2 sage: ...
r""" Create the cusp a/b in `\mathbb{P}^1(\QQ)`, where if b=0 this is the cusp at infinity.
[ "r", "Create", "the", "cusp", "a", "/", "b", "in", "\\", "mathbb", "{", "P", "}", "^1", "(", "\\", "QQ", ")", "where", "if", "b", "=", "0", "this", "is", "the", "cusp", "at", "infinity", "." ]
def __init__(self, a, b=None, parent=None, check=True): r""" Create the cusp a/b in `\mathbb{P}^1(\QQ)`, where if b=0 this is the cusp at infinity. When present, b must either be Infinity or coercible to an Integer. EXAMPLES:: sage: Cusp(2,3) 2/...
[ "def", "__init__", "(", "self", ",", "a", ",", "b", "=", "None", ",", "parent", "=", "None", ",", "check", "=", "True", ")", ":", "if", "parent", "is", "None", ":", "parent", "=", "Cusps", "Element", ".", "__init__", "(", "self", ",", "parent", "...
https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/modular/cusps.py#L60-L243
elyra-ai/elyra
5bb2009a7c475bda63f1cc2767eb8c4dfba9a239
elyra/pipeline/pipeline_definition.py
python
Pipeline.runtime_config
(self)
return self._node['app_data'].get('runtime_config')
The runtime configuration associated with the pipeline. :return: The runtime configuration key. This should be a valid key from the Runtimes metadata
The runtime configuration associated with the pipeline.
[ "The", "runtime", "configuration", "associated", "with", "the", "pipeline", "." ]
def runtime_config(self) -> str: """The runtime configuration associated with the pipeline. :return: The runtime configuration key. This should be a valid key from the Runtimes metadata """ return self._node['app_data'].get('runtime_config')
[ "def", "runtime_config", "(", "self", ")", "->", "str", ":", "return", "self", ".", "_node", "[", "'app_data'", "]", ".", "get", "(", "'runtime_config'", ")" ]
https://github.com/elyra-ai/elyra/blob/5bb2009a7c475bda63f1cc2767eb8c4dfba9a239/elyra/pipeline/pipeline_definition.py#L102-L107
perone/Pyevolve
589b6a9b92ed1fd9ef00987bf4bfe807c4a7b7e0
pyevolve/GSimpleGA.py
python
GSimpleGA.getGenerations
(self)
return self.nGenerations
Return the number of generations to evolve :rtype: the number of generations .. versionadded:: 0.6 Added the *getGenerations* method
Return the number of generations to evolve
[ "Return", "the", "number", "of", "generations", "to", "evolve" ]
def getGenerations(self): """ Return the number of generations to evolve :rtype: the number of generations .. versionadded:: 0.6 Added the *getGenerations* method """ return self.nGenerations
[ "def", "getGenerations", "(", "self", ")", ":", "return", "self", ".", "nGenerations" ]
https://github.com/perone/Pyevolve/blob/589b6a9b92ed1fd9ef00987bf4bfe807c4a7b7e0/pyevolve/GSimpleGA.py#L508-L516
reviewboard/reviewboard
7395902e4c181bcd1d633f61105012ffb1d18e1b
reviewboard/cmdline/rbsite.py
python
Command.get_site_paths
(self, options)
return site_paths
Return site paths defined in the command options. Args: options (argparse.Namespace): The parsed options for the command. Returns: list of unicode: The list of site paths.
Return site paths defined in the command options.
[ "Return", "site", "paths", "defined", "in", "the", "command", "options", "." ]
def get_site_paths(self, options): """Return site paths defined in the command options. Args: options (argparse.Namespace): The parsed options for the command. Returns: list of unicode: The list of site paths. """ if not optio...
[ "def", "get_site_paths", "(", "self", ",", "options", ")", ":", "if", "not", "options", ".", "site_path", ":", "return", "[", "]", "site_paths", "=", "options", ".", "site_path", "# When site_path is optional (due to UpgradeCommand), it will be", "# a list. Otherwise, i...
https://github.com/reviewboard/reviewboard/blob/7395902e4c181bcd1d633f61105012ffb1d18e1b/reviewboard/cmdline/rbsite.py#L1268-L1289
HymanLiuTS/flaskTs
286648286976e85d9b9a5873632331efcafe0b21
flasky/lib/python2.7/site-packages/sqlalchemy/events.py
python
ConnectionEvents.dbapi_error
(self, conn, cursor, statement, parameters, context, exception)
Intercept a raw DBAPI error. This event is called with the DBAPI exception instance received from the DBAPI itself, *before* SQLAlchemy wraps the exception with it's own exception wrappers, and before any other operations are performed on the DBAPI cursor; the existing transacti...
Intercept a raw DBAPI error.
[ "Intercept", "a", "raw", "DBAPI", "error", "." ]
def dbapi_error(self, conn, cursor, statement, parameters, context, exception): """Intercept a raw DBAPI error. This event is called with the DBAPI exception instance received from the DBAPI itself, *before* SQLAlchemy wraps the exception with it's own exception wrap...
[ "def", "dbapi_error", "(", "self", ",", "conn", ",", "cursor", ",", "statement", ",", "parameters", ",", "context", ",", "exception", ")", ":" ]
https://github.com/HymanLiuTS/flaskTs/blob/286648286976e85d9b9a5873632331efcafe0b21/flasky/lib/python2.7/site-packages/sqlalchemy/events.py#L672-L717
kuri65536/python-for-android
26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891
python-modules/twisted/twisted/mail/alias.py
python
MessageWrapper._processEnded
(self, result)
Record process termination and cancel the timeout call if it is active.
Record process termination and cancel the timeout call if it is active.
[ "Record", "process", "termination", "and", "cancel", "the", "timeout", "call", "if", "it", "is", "active", "." ]
def _processEnded(self, result): """ Record process termination and cancel the timeout call if it is active. """ self.done = True if self._timeoutCallID is not None: # eomReceived was called, we're actually waiting for the process to # exit. se...
[ "def", "_processEnded", "(", "self", ",", "result", ")", ":", "self", ".", "done", "=", "True", "if", "self", ".", "_timeoutCallID", "is", "not", "None", ":", "# eomReceived was called, we're actually waiting for the process to", "# exit.", "self", ".", "_timeoutCal...
https://github.com/kuri65536/python-for-android/blob/26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891/python-modules/twisted/twisted/mail/alias.py#L234-L247
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_flaskbb/Python-2.7.9/Tools/bgen/bgen/bgenGenerator.py
python
FunctionGenerator.checkit
(self)
[]
def checkit(self): for arg in self.argumentList: arg.errorCheck()
[ "def", "checkit", "(", "self", ")", ":", "for", "arg", "in", "self", ".", "argumentList", ":", "arg", ".", "errorCheck", "(", ")" ]
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_flaskbb/Python-2.7.9/Tools/bgen/bgen/bgenGenerator.py#L246-L248
mayank93/Twitter-Sentiment-Analysis
f095c6ca6bf69787582b5dabb140fefaf278eb37
front-end/web2py/gluon/sqlhtml.py
python
SQLFORM.__init__
( self, table, record = None, deletable = False, linkto = None, upload = None, fields = None, labels = None, col3 = {}, submit_button = 'Submit', delete_label = 'Check to delete', showid = True, readonly = False, ...
SQLFORM(db.table, record=None, fields=['name'], labels={'name': 'Your name'}, linkto=URL(f='table/db/')
SQLFORM(db.table, record=None, fields=['name'], labels={'name': 'Your name'}, linkto=URL(f='table/db/')
[ "SQLFORM", "(", "db", ".", "table", "record", "=", "None", "fields", "=", "[", "name", "]", "labels", "=", "{", "name", ":", "Your", "name", "}", "linkto", "=", "URL", "(", "f", "=", "table", "/", "db", "/", ")" ]
def __init__( self, table, record = None, deletable = False, linkto = None, upload = None, fields = None, labels = None, col3 = {}, submit_button = 'Submit', delete_label = 'Check to delete', showid = True, readonly ...
[ "def", "__init__", "(", "self", ",", "table", ",", "record", "=", "None", ",", "deletable", "=", "False", ",", "linkto", "=", "None", ",", "upload", "=", "None", ",", "fields", "=", "None", ",", "labels", "=", "None", ",", "col3", "=", "{", "}", ...
https://github.com/mayank93/Twitter-Sentiment-Analysis/blob/f095c6ca6bf69787582b5dabb140fefaf278eb37/front-end/web2py/gluon/sqlhtml.py#L833-L1105
pymedusa/Medusa
1405fbb6eb8ef4d20fcca24c32ddca52b11f0f38
ext/github/MainClass.py
python
Github.get_repos
( self, since=github.GithubObject.NotSet, visibility=github.GithubObject.NotSet )
return github.PaginatedList.PaginatedList( github.Repository.Repository, self.__requester, "/repositories", url_parameters, )
:calls: `GET /repositories <http://developer.github.com/v3/repos/#list-all-public-repositories>`_ :param since: integer :param visibility: string ('all','public') :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
:calls: `GET /repositories <http://developer.github.com/v3/repos/#list-all-public-repositories>`_ :param since: integer :param visibility: string ('all','public') :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
[ ":", "calls", ":", "GET", "/", "repositories", "<http", ":", "//", "developer", ".", "github", ".", "com", "/", "v3", "/", "repos", "/", "#list", "-", "all", "-", "public", "-", "repositories", ">", "_", ":", "param", "since", ":", "integer", ":", ...
def get_repos( self, since=github.GithubObject.NotSet, visibility=github.GithubObject.NotSet ): """ :calls: `GET /repositories <http://developer.github.com/v3/repos/#list-all-public-repositories>`_ :param since: integer :param visibility: string ('all','public') :rtyp...
[ "def", "get_repos", "(", "self", ",", "since", "=", "github", ".", "GithubObject", ".", "NotSet", ",", "visibility", "=", "github", ".", "GithubObject", ".", "NotSet", ")", ":", "assert", "since", "is", "github", ".", "GithubObject", ".", "NotSet", "or", ...
https://github.com/pymedusa/Medusa/blob/1405fbb6eb8ef4d20fcca24c32ddca52b11f0f38/ext/github/MainClass.py#L334-L357