nwo
stringlengths
5
86
sha
stringlengths
40
40
path
stringlengths
4
189
language
stringclasses
1 value
identifier
stringlengths
1
94
parameters
stringlengths
2
4.03k
argument_list
stringclasses
1 value
return_statement
stringlengths
0
11.5k
docstring
stringlengths
1
33.2k
docstring_summary
stringlengths
0
5.15k
docstring_tokens
list
function
stringlengths
34
151k
function_tokens
list
url
stringlengths
90
278
quantOS-org/DataCore
e2ef9bd2c22ee9e2845675b6435a14fa607f3551
mdlink/deps/windows/protobuf-2.5.0/python/google/protobuf/service.py
python
Service.GetResponseClass
(self, method_descriptor)
Returns the class of the response message for the specified method. This method isn't really needed, as the RpcChannel's CallMethod constructs the response protocol message. It's provided anyway in case it is useful for the caller to know the response type in advance.
Returns the class of the response message for the specified method.
[ "Returns", "the", "class", "of", "the", "response", "message", "for", "the", "specified", "method", "." ]
def GetResponseClass(self, method_descriptor): """Returns the class of the response message for the specified method. This method isn't really needed, as the RpcChannel's CallMethod constructs the response protocol message. It's provided anyway in case it is useful for the caller to know the response t...
[ "def", "GetResponseClass", "(", "self", ",", "method_descriptor", ")", ":", "raise", "NotImplementedError" ]
https://github.com/quantOS-org/DataCore/blob/e2ef9bd2c22ee9e2845675b6435a14fa607f3551/mdlink/deps/windows/protobuf-2.5.0/python/google/protobuf/service.py#L108-L115
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/stc.py
python
StyledTextEvent.GetListType
(*args, **kwargs)
return _stc.StyledTextEvent_GetListType(*args, **kwargs)
GetListType(self) -> int
GetListType(self) -> int
[ "GetListType", "(", "self", ")", "-", ">", "int" ]
def GetListType(*args, **kwargs): """GetListType(self) -> int""" return _stc.StyledTextEvent_GetListType(*args, **kwargs)
[ "def", "GetListType", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextEvent_GetListType", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L7178-L7180
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/ftplib.py
python
FTP.storlines
(self, cmd, fp, callback=None)
return self.voidresp()
Store a file in line mode. A new port is created for you. Args: cmd: A STOR command. fp: A file-like object with a readline() method. callback: An optional single parameter callable that is called on on each line after it is sent. [default: None] Ret...
Store a file in line mode. A new port is created for you.
[ "Store", "a", "file", "in", "line", "mode", ".", "A", "new", "port", "is", "created", "for", "you", "." ]
def storlines(self, cmd, fp, callback=None): """Store a file in line mode. A new port is created for you. Args: cmd: A STOR command. fp: A file-like object with a readline() method. callback: An optional single parameter callable that is called on on e...
[ "def", "storlines", "(", "self", ",", "cmd", ",", "fp", ",", "callback", "=", "None", ")", ":", "self", ".", "voidcmd", "(", "'TYPE A'", ")", "conn", "=", "self", ".", "transfercmd", "(", "cmd", ")", "while", "1", ":", "buf", "=", "fp", ".", "rea...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/ftplib.py#L457-L480
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/skia/tools/skp/webpages_playback.py
python
SkPicturePlayback._RenameSkpFiles
(self, page_set)
Rename generated SKP files into more descriptive names. Look into the subdirectory of TMP_SKP_DIR and find the most interesting .skp in there to be this page_set's representative .skp.
Rename generated SKP files into more descriptive names.
[ "Rename", "generated", "SKP", "files", "into", "more", "descriptive", "names", "." ]
def _RenameSkpFiles(self, page_set): """Rename generated SKP files into more descriptive names. Look into the subdirectory of TMP_SKP_DIR and find the most interesting .skp in there to be this page_set's representative .skp. """ subdirs = glob.glob(os.path.join(TMP_SKP_DIR, '*')) for site in su...
[ "def", "_RenameSkpFiles", "(", "self", ",", "page_set", ")", ":", "subdirs", "=", "glob", ".", "glob", "(", "os", ".", "path", ".", "join", "(", "TMP_SKP_DIR", ",", "'*'", ")", ")", "for", "site", "in", "subdirs", ":", "if", "self", ".", "_IsChromium...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/skia/tools/skp/webpages_playback.py#L403-L427
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
SAXCallback.reference
(self, name)
called when an entity reference has been found
called when an entity reference has been found
[ "called", "when", "an", "entity", "reference", "has", "been", "found" ]
def reference(self, name): """called when an entity reference has been found""" pass
[ "def", "reference", "(", "self", ",", "name", ")", ":", "pass" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L194-L196
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py2/prompt_toolkit/buffer.py
python
Buffer.auto_down
(self, count=1, go_to_start_of_line_if_history_changes=False)
If we're not on the last line (of a multiline input) go a line down, otherwise go forward in history. (If nothing is selected.)
If we're not on the last line (of a multiline input) go a line down, otherwise go forward in history. (If nothing is selected.)
[ "If", "we", "re", "not", "on", "the", "last", "line", "(", "of", "a", "multiline", "input", ")", "go", "a", "line", "down", "otherwise", "go", "forward", "in", "history", ".", "(", "If", "nothing", "is", "selected", ".", ")" ]
def auto_down(self, count=1, go_to_start_of_line_if_history_changes=False): """ If we're not on the last line (of a multiline input) go a line down, otherwise go forward in history. (If nothing is selected.) """ if self.complete_state: self.complete_next(count=count) ...
[ "def", "auto_down", "(", "self", ",", "count", "=", "1", ",", "go_to_start_of_line_if_history_changes", "=", "False", ")", ":", "if", "self", ".", "complete_state", ":", "self", ".", "complete_next", "(", "count", "=", "count", ")", "elif", "self", ".", "d...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/buffer.py#L608-L622
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/peacock/Input/BlockInfo.py
python
BlockInfo.addParameter
(self, param)
Adds a parameter. Input: param[ParameterInfo]: New parameter to be added
Adds a parameter. Input: param[ParameterInfo]: New parameter to be added
[ "Adds", "a", "parameter", ".", "Input", ":", "param", "[", "ParameterInfo", "]", ":", "New", "parameter", "to", "be", "added" ]
def addParameter(self, param): """ Adds a parameter. Input: param[ParameterInfo]: New parameter to be added """ param.parent = self self.parameters[param.name] = param if param not in self.parameters_list: self.parameters_list.append(param....
[ "def", "addParameter", "(", "self", ",", "param", ")", ":", "param", ".", "parent", "=", "self", "self", ".", "parameters", "[", "param", ".", "name", "]", "=", "param", "if", "param", "not", "in", "self", ".", "parameters_list", ":", "self", ".", "p...
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/Input/BlockInfo.py#L202-L211
trailofbits/llvm-sanitizer-tutorial
d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99
llvm/tools/clang/tools/scan-build-py/libscanbuild/clang.py
python
get_active_checkers
(clang, plugins)
return frozenset(result)
Get the active checker list. :param clang: the compiler we are using :param plugins: list of plugins which was requested by the user :return: list of checker names which are active To get the default checkers we execute Clang to print how this compilation would be called. And take out the...
Get the active checker list.
[ "Get", "the", "active", "checker", "list", "." ]
def get_active_checkers(clang, plugins): """ Get the active checker list. :param clang: the compiler we are using :param plugins: list of plugins which was requested by the user :return: list of checker names which are active To get the default checkers we execute Clang to print how this ...
[ "def", "get_active_checkers", "(", "clang", ",", "plugins", ")", ":", "def", "get_active_checkers_for", "(", "language", ")", ":", "\"\"\" Returns a list of active checkers for the given language. \"\"\"", "load_args", "=", "[", "arg", "for", "plugin", "in", "plugins", ...
https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/tools/clang/tools/scan-build-py/libscanbuild/clang.py#L53-L79
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/linear_model/_bayes.py
python
BayesianRidge._update_coef_
(self, X, y, n_samples, n_features, XT_y, U, Vh, eigen_vals_, alpha_, lambda_)
return coef_, rmse_
Update posterior mean and compute corresponding rmse. Posterior mean is given by coef_ = scaled_sigma_ * X.T * y where scaled_sigma_ = (lambda_/alpha_ * np.eye(n_features) + np.dot(X.T, X))^-1
Update posterior mean and compute corresponding rmse.
[ "Update", "posterior", "mean", "and", "compute", "corresponding", "rmse", "." ]
def _update_coef_(self, X, y, n_samples, n_features, XT_y, U, Vh, eigen_vals_, alpha_, lambda_): """Update posterior mean and compute corresponding rmse. Posterior mean is given by coef_ = scaled_sigma_ * X.T * y where scaled_sigma_ = (lambda_/alpha_ * np.eye(n_features) ...
[ "def", "_update_coef_", "(", "self", ",", "X", ",", "y", ",", "n_samples", ",", "n_features", ",", "XT_y", ",", "U", ",", "Vh", ",", "eigen_vals_", ",", "alpha_", ",", "lambda_", ")", ":", "if", "n_samples", ">", "n_features", ":", "coef_", "=", "np"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/linear_model/_bayes.py#L326-L347
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
3rdparty/protobuf-3.0.0/python/google/protobuf/service_reflection.py
python
_ServiceStubBuilder.BuildServiceStub
(self, cls)
Constructs the stub class. Args: cls: The class that will be constructed.
Constructs the stub class.
[ "Constructs", "the", "stub", "class", "." ]
def BuildServiceStub(self, cls): """Constructs the stub class. Args: cls: The class that will be constructed. """ def _ServiceStubInit(stub, rpc_channel): stub.rpc_channel = rpc_channel self.cls = cls cls.__init__ = _ServiceStubInit for method in self.descriptor.methods: ...
[ "def", "BuildServiceStub", "(", "self", ",", "cls", ")", ":", "def", "_ServiceStubInit", "(", "stub", ",", "rpc_channel", ")", ":", "stub", ".", "rpc_channel", "=", "rpc_channel", "self", ".", "cls", "=", "cls", "cls", ".", "__init__", "=", "_ServiceStubIn...
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/service_reflection.py#L251-L263
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/api/execution_api.py
python
ExecutionApi.execution_get_with_http_info
(self, **kwargs)
return self.api_client.call_api( '/execution', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='list[Execution]', # noqa: E501 aut...
Get all raw executions for your account. # noqa: E501 This returns all raw transactions, which includes order opening and cancelation, and order status changes. It can be quite noisy. More focused information is available at `/execution/tradeHistory`. You may also use the `filter` param to target your query....
Get all raw executions for your account. # noqa: E501
[ "Get", "all", "raw", "executions", "for", "your", "account", ".", "#", "noqa", ":", "E501" ]
def execution_get_with_http_info(self, **kwargs): # noqa: E501 """Get all raw executions for your account. # noqa: E501 This returns all raw transactions, which includes order opening and cancelation, and order status changes. It can be quite noisy. More focused information is available at `/executio...
[ "def", "execution_get_with_http_info", "(", "self", ",", "*", "*", "kwargs", ")", ":", "# noqa: E501", "all_params", "=", "[", "'symbol'", ",", "'filter'", ",", "'columns'", ",", "'count'", ",", "'start'", ",", "'reverse'", ",", "'start_time'", ",", "'end_time...
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/api/execution_api.py#L65-L157
xenia-project/xenia
9b1fdac98665ac091b9660a5d0fbb259ed79e578
third_party/google-styleguide/cpplint/cpplint.py
python
ProcessLine
(filename, file_extension, clean_lines, line, include_state, function_state, nesting_state, error, extra_check_functions=[])
Processes a single line in the file. Args: filename: Filename of the file that is being processed. file_extension: The extension (dot not included) of the file. clean_lines: An array of strings, each representing a line of the file, with comments stripped. line: Number of line being ...
Processes a single line in the file.
[ "Processes", "a", "single", "line", "in", "the", "file", "." ]
def ProcessLine(filename, file_extension, clean_lines, line, include_state, function_state, nesting_state, error, extra_check_functions=[]): """Processes a single line in the file. Args: filename: Filename of the file that is being processed. file_extension: The extension (d...
[ "def", "ProcessLine", "(", "filename", ",", "file_extension", ",", "clean_lines", ",", "line", ",", "include_state", ",", "function_state", ",", "nesting_state", ",", "error", ",", "extra_check_functions", "=", "[", "]", ")", ":", "raw_lines", "=", "clean_lines"...
https://github.com/xenia-project/xenia/blob/9b1fdac98665ac091b9660a5d0fbb259ed79e578/third_party/google-styleguide/cpplint/cpplint.py#L5291-L5330
rootm0s/Protectors
5b3f4d11687a5955caf9c3af30666c4bfc2c19ab
OWASP-ZSC/module/readline_windows/pyreadline/modes/notemacs.py
python
NotEmacsMode.backward_char
(self, e)
Move back a character.
Move back a character.
[ "Move", "back", "a", "character", "." ]
def backward_char(self, e): # (C-b) '''Move back a character. ''' self.l_buffer.backward_char()
[ "def", "backward_char", "(", "self", ",", "e", ")", ":", "# (C-b)", "self", ".", "l_buffer", ".", "backward_char", "(", ")" ]
https://github.com/rootm0s/Protectors/blob/5b3f4d11687a5955caf9c3af30666c4bfc2c19ab/OWASP-ZSC/module/readline_windows/pyreadline/modes/notemacs.py#L110-L112
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/dataset/engine/datasets.py
python
Dataset.is_sharded
(self)
return False
Returns True if the dataset or its children is sharded.
Returns True if the dataset or its children is sharded.
[ "Returns", "True", "if", "the", "dataset", "or", "its", "children", "is", "sharded", "." ]
def is_sharded(self): """Returns True if the dataset or its children is sharded.""" for input_dataset in self.children: if input_dataset.is_sharded(): return True return False
[ "def", "is_sharded", "(", "self", ")", ":", "for", "input_dataset", "in", "self", ".", "children", ":", "if", "input_dataset", ".", "is_sharded", "(", ")", ":", "return", "True", "return", "False" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/engine/datasets.py#L1797-L1803
keyboardio/Kaleidoscope
d59604e98b2439d108647f15be52984a6837d360
bin/cpplint.py
python
_CppLintState.AddFilters
(self, filters)
Adds more filters to the existing list of error-message filters.
Adds more filters to the existing list of error-message filters.
[ "Adds", "more", "filters", "to", "the", "existing", "list", "of", "error", "-", "message", "filters", "." ]
def AddFilters(self, filters): """ Adds more filters to the existing list of error-message filters. """ for filt in filters.split(','): clean_filt = filt.strip() if clean_filt: self.filters.append(clean_filt) for filt in self.filters: if not (filt.startswith('+') or filt.startswith...
[ "def", "AddFilters", "(", "self", ",", "filters", ")", ":", "for", "filt", "in", "filters", ".", "split", "(", "','", ")", ":", "clean_filt", "=", "filt", ".", "strip", "(", ")", "if", "clean_filt", ":", "self", ".", "filters", ".", "append", "(", ...
https://github.com/keyboardio/Kaleidoscope/blob/d59604e98b2439d108647f15be52984a6837d360/bin/cpplint.py#L1059-L1068
google/shaka-packager
e1b0c7c45431327fd3ce193514a5407d07b39b22
packager/third_party/protobuf/python/google/protobuf/symbol_database.py
python
SymbolDatabase.RegisterFileDescriptor
(self, file_descriptor)
Registers the given file descriptor in the local database. Args: file_descriptor: a descriptor.FileDescriptor. Returns: The provided descriptor.
Registers the given file descriptor in the local database.
[ "Registers", "the", "given", "file", "descriptor", "in", "the", "local", "database", "." ]
def RegisterFileDescriptor(self, file_descriptor): """Registers the given file descriptor in the local database. Args: file_descriptor: a descriptor.FileDescriptor. Returns: The provided descriptor. """ self.pool.AddFileDescriptor(file_descriptor)
[ "def", "RegisterFileDescriptor", "(", "self", ",", "file_descriptor", ")", ":", "self", ".", "pool", ".", "AddFileDescriptor", "(", "file_descriptor", ")" ]
https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/google/protobuf/symbol_database.py#L108-L117
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py
python
MakefileWriter.ComputeOutputBasename
(self, spec)
return target_prefix + target + target_ext
Return the 'output basename' of a gyp spec. E.g., the loadable module 'foobar' in directory 'baz' will produce 'libfoobar.so'
Return the 'output basename' of a gyp spec.
[ "Return", "the", "output", "basename", "of", "a", "gyp", "spec", "." ]
def ComputeOutputBasename(self, spec): """Return the 'output basename' of a gyp spec. E.g., the loadable module 'foobar' in directory 'baz' will produce 'libfoobar.so' """ assert not self.is_mac_bundle if self.flavor == 'mac' and self.type in ( 'static_library', 'executable', 'shared...
[ "def", "ComputeOutputBasename", "(", "self", ",", "spec", ")", ":", "assert", "not", "self", ".", "is_mac_bundle", "if", "self", ".", "flavor", "==", "'mac'", "and", "self", ".", "type", "in", "(", "'static_library'", ",", "'executable'", ",", "'shared_libra...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py#L1353-L1393
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/iobench/iobench.py
python
modify_small_chunks
(f, source)
modify 20 units at a time
modify 20 units at a time
[ "modify", "20", "units", "at", "a", "time" ]
def modify_small_chunks(f, source): """ modify 20 units at a time """ f.seek(0) for i in xrange(0, len(source), 20): f.write(source[i:i+20])
[ "def", "modify_small_chunks", "(", "f", ",", "source", ")", ":", "f", ".", "seek", "(", "0", ")", "for", "i", "in", "xrange", "(", "0", ",", "len", "(", "source", ")", ",", "20", ")", ":", "f", ".", "write", "(", "source", "[", "i", ":", "i",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/iobench/iobench.py#L175-L179
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/convert/value_object/read/media/datfile/unit.py
python
UnitCommand.get_data_format_members
(cls, game_version)
return data_format
Return the members in this struct.
Return the members in this struct.
[ "Return", "the", "members", "in", "this", "struct", "." ]
def get_data_format_members(cls, game_version): """ Return the members in this struct. """ data_format = [ # Type (0 = Generic, 1 = Tribe) (READ_GEN, "command_used", StorageType.INT_MEMBER, "int16_t"), (READ_GEN, "command_id", StorageType.ID_MEMBER, "i...
[ "def", "get_data_format_members", "(", "cls", ",", "game_version", ")", ":", "data_format", "=", "[", "# Type (0 = Generic, 1 = Tribe)", "(", "READ_GEN", ",", "\"command_used\"", ",", "StorageType", ".", "INT_MEMBER", ",", "\"int16_t\"", ")", ",", "(", "READ_GEN", ...
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/value_object/read/media/datfile/unit.py#L24-L85
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/linalg/interpolative.py
python
rand
(*shape)
return backend.id_srand(np.prod(shape)).reshape(shape)
Generate standard uniform pseudorandom numbers via a very efficient lagged Fibonacci method. This routine is used for all random number generation in this package and can affect ID and SVD results. Parameters ---------- shape Shape of output array
Generate standard uniform pseudorandom numbers via a very efficient lagged Fibonacci method.
[ "Generate", "standard", "uniform", "pseudorandom", "numbers", "via", "a", "very", "efficient", "lagged", "Fibonacci", "method", "." ]
def rand(*shape): """ Generate standard uniform pseudorandom numbers via a very efficient lagged Fibonacci method. This routine is used for all random number generation in this package and can affect ID and SVD results. Parameters ---------- shape Shape of output array """...
[ "def", "rand", "(", "*", "shape", ")", ":", "# For details, see :func:`backend.id_srand`, and :func:`backend.id_srando`.", "return", "backend", ".", "id_srand", "(", "np", ".", "prod", "(", "shape", ")", ")", ".", "reshape", "(", "shape", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/linalg/interpolative.py#L447-L462
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py
python
Node.add_wkid
(self, wkid)
Add a node to the list of kids waiting to be evaluated
Add a node to the list of kids waiting to be evaluated
[ "Add", "a", "node", "to", "the", "list", "of", "kids", "waiting", "to", "be", "evaluated" ]
def add_wkid(self, wkid): """Add a node to the list of kids waiting to be evaluated""" if self.wkids is not None: self.wkids.append(wkid)
[ "def", "add_wkid", "(", "self", ",", "wkid", ")", ":", "if", "self", ".", "wkids", "is", "not", "None", ":", "self", ".", "wkids", ".", "append", "(", "wkid", ")" ]
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py#L1299-L1302
sailing-pmls/bosen
06cb58902d011fbea5f9428f10ce30e621492204
style_script/cpplint.py
python
FileInfo.NoExtension
(self)
return '/'.join(self.Split()[0:2])
File has no source file extension.
File has no source file extension.
[ "File", "has", "no", "source", "file", "extension", "." ]
def NoExtension(self): """File has no source file extension.""" return '/'.join(self.Split()[0:2])
[ "def", "NoExtension", "(", "self", ")", ":", "return", "'/'", ".", "join", "(", "self", ".", "Split", "(", ")", "[", "0", ":", "2", "]", ")" ]
https://github.com/sailing-pmls/bosen/blob/06cb58902d011fbea5f9428f10ce30e621492204/style_script/cpplint.py#L1055-L1057
msftguy/ssh-rd
a5f3a79daeac5844edebf01916c9613563f1c390
_3rd/boost_1_48_0/tools/build/v2/build/feature.py
python
Feature.parent
(self)
return self._parent
For subfeatures, return pair of (parent_feature, value). Value may be None if this subfeature is not specific to any value of the parent feature.
For subfeatures, return pair of (parent_feature, value).
[ "For", "subfeatures", "return", "pair", "of", "(", "parent_feature", "value", ")", "." ]
def parent(self): """For subfeatures, return pair of (parent_feature, value). Value may be None if this subfeature is not specific to any value of the parent feature. """ return self._parent
[ "def", "parent", "(", "self", ")", ":", "return", "self", ".", "_parent" ]
https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/build/v2/build/feature.py#L66-L72
dmlc/treelite
df56babb6a4a2d7c29d719c28ce53acfa7dbab3c
python/treelite/sklearn/gbm_classifier.py
python
SKLGBMClassifierMixin.process_model
(cls, sklearn_model)
return builder.commit()
Process a GradientBoostingClassifier (binary classifier) to convert it into a Treelite model
Process a GradientBoostingClassifier (binary classifier) to convert it into a Treelite model
[ "Process", "a", "GradientBoostingClassifier", "(", "binary", "classifier", ")", "to", "convert", "it", "into", "a", "Treelite", "model" ]
def process_model(cls, sklearn_model): """Process a GradientBoostingClassifier (binary classifier) to convert it into a Treelite model""" # Check for init='zero' if sklearn_model.init != 'zero': raise treelite.TreeliteError("Gradient boosted trees must be trained with " ...
[ "def", "process_model", "(", "cls", ",", "sklearn_model", ")", ":", "# Check for init='zero'", "if", "sklearn_model", ".", "init", "!=", "'zero'", ":", "raise", "treelite", ".", "TreeliteError", "(", "\"Gradient boosted trees must be trained with \"", "\"the option init='...
https://github.com/dmlc/treelite/blob/df56babb6a4a2d7c29d719c28ce53acfa7dbab3c/python/treelite/sklearn/gbm_classifier.py#L10-L28
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
Dialog.SetLayoutAdaptationLevel
(*args, **kwargs)
return _windows_.Dialog_SetLayoutAdaptationLevel(*args, **kwargs)
SetLayoutAdaptationLevel(self, int level)
SetLayoutAdaptationLevel(self, int level)
[ "SetLayoutAdaptationLevel", "(", "self", "int", "level", ")" ]
def SetLayoutAdaptationLevel(*args, **kwargs): """SetLayoutAdaptationLevel(self, int level)""" return _windows_.Dialog_SetLayoutAdaptationLevel(*args, **kwargs)
[ "def", "SetLayoutAdaptationLevel", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "Dialog_SetLayoutAdaptationLevel", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L843-L845
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/driver.py
python
Driver.reset
(self)
Reset all devices
Reset all devices
[ "Reset", "all", "devices" ]
def reset(self): """Reset all devices """ for dev in self.devices.values(): dev.reset()
[ "def", "reset", "(", "self", ")", ":", "for", "dev", "in", "self", ".", "devices", ".", "values", "(", ")", ":", "dev", ".", "reset", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/driver.py#L348-L352
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/build/linux_setup_msr.py
python
_CheckMsrKernelModule
()
return True
Return whether the 'msr' kernel module is loaded.
Return whether the 'msr' kernel module is loaded.
[ "Return", "whether", "the", "msr", "kernel", "module", "is", "loaded", "." ]
def _CheckMsrKernelModule(): """Return whether the 'msr' kernel module is loaded.""" proc = subprocess.Popen('/sbin/lsmod', stdout=subprocess.PIPE) stdout = proc.communicate()[0] ret = proc.wait() if ret != 0: raise OSError('lsmod failed') if not any([line.startswith('msr ') for line in stdout.splitlin...
[ "def", "_CheckMsrKernelModule", "(", ")", ":", "proc", "=", "subprocess", ".", "Popen", "(", "'/sbin/lsmod'", ",", "stdout", "=", "subprocess", ".", "PIPE", ")", "stdout", "=", "proc", ".", "communicate", "(", ")", "[", "0", "]", "ret", "=", "proc", "....
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/build/linux_setup_msr.py#L30-L42
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_vim.py
python
EditraCommander.FindTillNextChar
(self, char, repeat)
Similar to FindNextChar, but stop one character short
Similar to FindNextChar, but stop one character short
[ "Similar", "to", "FindNextChar", "but", "stop", "one", "character", "short" ]
def FindTillNextChar(self, char, repeat): """Similar to FindNextChar, but stop one character short""" self.stc.FindChar(char, repeat, extra_offset=-1)
[ "def", "FindTillNextChar", "(", "self", ",", "char", ",", "repeat", ")", ":", "self", ".", "stc", ".", "FindChar", "(", "char", ",", "repeat", ",", "extra_offset", "=", "-", "1", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_vim.py#L736-L738
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/indexes/base.py
python
ensure_index_from_sequences
(sequences, names=None)
Construct an index from sequences of data. A single sequence returns an Index. Many sequences returns a MultiIndex. Parameters ---------- sequences : sequence of sequences names : sequence of str Returns ------- index : Index or MultiIndex Examples -------- >>> ensure...
Construct an index from sequences of data.
[ "Construct", "an", "index", "from", "sequences", "of", "data", "." ]
def ensure_index_from_sequences(sequences, names=None): """ Construct an index from sequences of data. A single sequence returns an Index. Many sequences returns a MultiIndex. Parameters ---------- sequences : sequence of sequences names : sequence of str Returns ------- i...
[ "def", "ensure_index_from_sequences", "(", "sequences", ",", "names", "=", "None", ")", ":", "from", ".", "multi", "import", "MultiIndex", "if", "len", "(", "sequences", ")", "==", "1", ":", "if", "names", "is", "not", "None", ":", "names", "=", "names",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/indexes/base.py#L5277-L5315
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftguitools/gui_selectplane.py
python
Draft_SelectPlane.onSetExtension
(self, i)
Execute when setting grid extension.
Execute when setting grid extension.
[ "Execute", "when", "setting", "grid", "extension", "." ]
def onSetExtension(self, i): """Execute when setting grid extension.""" if i > 1: self.param.SetInt("gridSize", i) if hasattr(FreeCADGui, "Snapper"): FreeCADGui.Snapper.setGrid()
[ "def", "onSetExtension", "(", "self", ",", "i", ")", ":", "if", "i", ">", "1", ":", "self", ".", "param", ".", "SetInt", "(", "\"gridSize\"", ",", "i", ")", "if", "hasattr", "(", "FreeCADGui", ",", "\"Snapper\"", ")", ":", "FreeCADGui", ".", "Snapper...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_selectplane.py#L491-L496
deepmodeling/deepmd-kit
159e45d248b0429844fb6a8cb3b3a201987c8d79
deepmd/utils/path.py
python
DPPath.__truediv__
(self, key: str)
Used for / operator.
Used for / operator.
[ "Used", "for", "/", "operator", "." ]
def __truediv__(self, key: str) -> "DPPath": """Used for / operator."""
[ "def", "__truediv__", "(", "self", ",", "key", ":", "str", ")", "->", "\"DPPath\"", ":" ]
https://github.com/deepmodeling/deepmd-kit/blob/159e45d248b0429844fb6a8cb3b3a201987c8d79/deepmd/utils/path.py#L90-L91
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/ops/nn.py
python
separable_conv2d
(input, depthwise_filter, pointwise_filter, strides, padding, name=None)
2-D convolution with separable filters. Performs a depthwise convolution that acts separately on channels followed by a pointwise convolution that mixes channels. Note that this is separability between dimensions `[1, 2]` and `3`, not spatial separability between dimensions `1` and `2`. In detail, o...
2-D convolution with separable filters.
[ "2", "-", "D", "convolution", "with", "separable", "filters", "." ]
def separable_conv2d(input, depthwise_filter, pointwise_filter, strides, padding, name=None): """2-D convolution with separable filters. Performs a depthwise convolution that acts separately on channels followed by a pointwise convolution that mixes channels. Note that ...
[ "def", "separable_conv2d", "(", "input", ",", "depthwise_filter", ",", "pointwise_filter", ",", "strides", ",", "padding", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "\"separable_conv2d\"", ",", "[", "input", ",",...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/nn.py#L646-L722
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/tools/datetimes.py
python
should_cache
( arg: ArrayConvertible, unique_share: float = 0.7, check_count: Optional[int] = None )
return do_caching
Decides whether to do caching. If the percent of unique elements among `check_count` elements less than `unique_share * 100` then we can do caching. Parameters ---------- arg: listlike, tuple, 1-d array, Series unique_share: float, default=0.7, optional 0 < unique_share < 1 check_c...
Decides whether to do caching.
[ "Decides", "whether", "to", "do", "caching", "." ]
def should_cache( arg: ArrayConvertible, unique_share: float = 0.7, check_count: Optional[int] = None ) -> bool: """ Decides whether to do caching. If the percent of unique elements among `check_count` elements less than `unique_share * 100` then we can do caching. Parameters ---------- ...
[ "def", "should_cache", "(", "arg", ":", "ArrayConvertible", ",", "unique_share", ":", "float", "=", "0.7", ",", "check_count", ":", "Optional", "[", "int", "]", "=", "None", ")", "->", "bool", ":", "do_caching", "=", "True", "# default realization", "if", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/tools/datetimes.py#L66-L119
apiaryio/snowcrash
b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3
tools/gyp/pylib/gyp/xcodeproj_file.py
python
XCConfigurationList.AppendBuildSetting
(self, key, value)
Appends value to the build setting for key, which is treated as a list, in all child XCBuildConfiguration objects.
Appends value to the build setting for key, which is treated as a list, in all child XCBuildConfiguration objects.
[ "Appends", "value", "to", "the", "build", "setting", "for", "key", "which", "is", "treated", "as", "a", "list", "in", "all", "child", "XCBuildConfiguration", "objects", "." ]
def AppendBuildSetting(self, key, value): """Appends value to the build setting for key, which is treated as a list, in all child XCBuildConfiguration objects. """ for configuration in self._properties['buildConfigurations']: configuration.AppendBuildSetting(key, value)
[ "def", "AppendBuildSetting", "(", "self", ",", "key", ",", "value", ")", ":", "for", "configuration", "in", "self", ".", "_properties", "[", "'buildConfigurations'", "]", ":", "configuration", ".", "AppendBuildSetting", "(", "key", ",", "value", ")" ]
https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/xcodeproj_file.py#L1680-L1686
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/traitlets/py3/traitlets/traitlets.py
python
_add_all
()
add all trait types to `__all__` do in a function to avoid iterating through globals while defining local variables
add all trait types to `__all__`
[ "add", "all", "trait", "types", "to", "__all__" ]
def _add_all(): """add all trait types to `__all__` do in a function to avoid iterating through globals while defining local variables """ for _name, _value in globals().items(): if not _name.startswith('_') and isinstance(_value, type) and issubclass(_value, TraitType): __all__.app...
[ "def", "_add_all", "(", ")", ":", "for", "_name", ",", "_value", "in", "globals", "(", ")", ".", "items", "(", ")", ":", "if", "not", "_name", ".", "startswith", "(", "'_'", ")", "and", "isinstance", "(", "_value", ",", "type", ")", "and", "issubcl...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/traitlets/py3/traitlets/traitlets.py#L3249-L3256
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/layers/python/layers/feature_column.py
python
_OneHotColumn._to_dnn_input_layer
(self, transformed_input_tensor, unused_weight_collections=None, unused_trainable=False, output_rank=2)
return math_ops.reduce_sum( one_hot_id_tensor, reduction_indices=[output_rank - 1])
Returns a Tensor as an input to the first layer of neural network. Args: transformed_input_tensor: A tensor that has undergone the transformations in `insert_transformed_feature`. Rank should be >= `output_rank`. unused_weight_collections: Unused. One hot encodings are not variable. unused_...
Returns a Tensor as an input to the first layer of neural network.
[ "Returns", "a", "Tensor", "as", "an", "input", "to", "the", "first", "layer", "of", "neural", "network", "." ]
def _to_dnn_input_layer(self, transformed_input_tensor, unused_weight_collections=None, unused_trainable=False, output_rank=2): """Returns a Tensor as an input to the first layer of neural network. Args: ...
[ "def", "_to_dnn_input_layer", "(", "self", ",", "transformed_input_tensor", ",", "unused_weight_collections", "=", "None", ",", "unused_trainable", "=", "False", ",", "output_rank", "=", "2", ")", ":", "# Reshape ID column to `output_rank`.", "sparse_id_column", "=", "s...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/layers/python/layers/feature_column.py#L903-L948
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ntpath.py
python
relpath
(path, start=None)
Return a relative version of a path
Return a relative version of a path
[ "Return", "a", "relative", "version", "of", "a", "path" ]
def relpath(path, start=None): """Return a relative version of a path""" path = os.fspath(path) if isinstance(path, bytes): sep = b'\\' curdir = b'.' pardir = b'..' else: sep = '\\' curdir = '.' pardir = '..' if start is None: start = curdir ...
[ "def", "relpath", "(", "path", ",", "start", "=", "None", ")", ":", "path", "=", "os", ".", "fspath", "(", "path", ")", "if", "isinstance", "(", "path", ",", "bytes", ")", ":", "sep", "=", "b'\\\\'", "curdir", "=", "b'.'", "pardir", "=", "b'..'", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ntpath.py#L536-L579
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
build/android/emulator.py
python
Emulator.__init__
(self, fast_and_loose=False)
Init an Emulator. Args: fast_and_loose: Loosen up the rules for reliable running for speed. Intended for quick testing or re-testing.
Init an Emulator.
[ "Init", "an", "Emulator", "." ]
def __init__(self, fast_and_loose=False): """Init an Emulator. Args: fast_and_loose: Loosen up the rules for reliable running for speed. Intended for quick testing or re-testing. """ try: android_sdk_root = os.environ['ANDROID_SDK_ROOT'] except KeyError: logging.critical(...
[ "def", "__init__", "(", "self", ",", "fast_and_loose", "=", "False", ")", ":", "try", ":", "android_sdk_root", "=", "os", ".", "environ", "[", "'ANDROID_SDK_ROOT'", "]", "except", "KeyError", ":", "logging", ".", "critical", "(", "'The ANDROID_SDK_ROOT must be s...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/build/android/emulator.py#L115-L132
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/ir/builder.py
python
IRBuilder.fadd
(self, lhs, rhs, name='')
Floating-point addition: name = lhs + rhs
Floating-point addition: name = lhs + rhs
[ "Floating", "-", "point", "addition", ":", "name", "=", "lhs", "+", "rhs" ]
def fadd(self, lhs, rhs, name=''): """ Floating-point addition: name = lhs + rhs """
[ "def", "fadd", "(", "self", ",", "lhs", ",", "rhs", ",", "name", "=", "''", ")", ":" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/ir/builder.py#L367-L371
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/io/pytables.py
python
Table.indexables
(self)
return _indexables
create/cache the indexables if they don't exist
create/cache the indexables if they don't exist
[ "create", "/", "cache", "the", "indexables", "if", "they", "don", "t", "exist" ]
def indexables(self): """create/cache the indexables if they don't exist""" _indexables = [] desc = self.description table_attrs = self.table.attrs # Note: each of the `name` kwargs below are str, ensured # by the definition in index_cols. # index columns ...
[ "def", "indexables", "(", "self", ")", ":", "_indexables", "=", "[", "]", "desc", "=", "self", ".", "description", "table_attrs", "=", "self", ".", "table", ".", "attrs", "# Note: each of the `name` kwargs below are str, ensured", "# by the definition in index_cols.", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/pytables.py#L3548-L3619
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exomerge3.py
python
ExodusModel.create_node_field
(self, node_field_name, value='auto')
Create a node field and assign it a default value. A default value can be passed. If no default value is given, 0.0 will be used if the element field appears to be a displacement field. Otherwise, NaN will be used. Example: >>> model.create_node_field('temperature', 298.15)
Create a node field and assign it a default value.
[ "Create", "a", "node", "field", "and", "assign", "it", "a", "default", "value", "." ]
def create_node_field(self, node_field_name, value='auto'): """ Create a node field and assign it a default value. A default value can be passed. If no default value is given, 0.0 will be used if the element field appears to be a displacement field. Otherwise, NaN will be used....
[ "def", "create_node_field", "(", "self", ",", "node_field_name", ",", "value", "=", "'auto'", ")", ":", "# issue warning if no timesteps exist", "if", "not", "self", ".", "get_timesteps", "(", ")", ":", "self", ".", "_empty_field_warning", "(", ")", "# if it exist...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge3.py#L4081-L4107
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py
python
_wrap
(new, old)
Simple substitute for functools.update_wrapper.
Simple substitute for functools.update_wrapper.
[ "Simple", "substitute", "for", "functools", ".", "update_wrapper", "." ]
def _wrap(new, old): """Simple substitute for functools.update_wrapper.""" for replace in ['__module__', '__name__', '__qualname__', '__doc__']: if hasattr(old, replace): setattr(new, replace, getattr(old, replace)) new.__dict__.update(old.__dict__)
[ "def", "_wrap", "(", "new", ",", "old", ")", ":", "for", "replace", "in", "[", "'__module__'", ",", "'__name__'", ",", "'__qualname__'", ",", "'__doc__'", "]", ":", "if", "hasattr", "(", "old", ",", "replace", ")", ":", "setattr", "(", "new", ",", "r...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py#L27-L32
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TNEGraph.Reserve
(self, *args)
return _snap.TNEGraph_Reserve(self, *args)
Reserve(TNEGraph self, int const & Nodes, int const & Edges) Parameters: Nodes: int const & Edges: int const &
Reserve(TNEGraph self, int const & Nodes, int const & Edges)
[ "Reserve", "(", "TNEGraph", "self", "int", "const", "&", "Nodes", "int", "const", "&", "Edges", ")" ]
def Reserve(self, *args): """ Reserve(TNEGraph self, int const & Nodes, int const & Edges) Parameters: Nodes: int const & Edges: int const & """ return _snap.TNEGraph_Reserve(self, *args)
[ "def", "Reserve", "(", "self", ",", "*", "args", ")", ":", "return", "_snap", ".", "TNEGraph_Reserve", "(", "self", ",", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L4719-L4728
alibaba/weex_js_engine
2bdf4b6f020c1fc99c63f649718f6faf7e27fdde
jni/v8core/v8/build/gyp/pylib/gyp/xcode_emulation.py
python
XcodeSettings.GetFullProductName
(self)
Returns FULL_PRODUCT_NAME.
Returns FULL_PRODUCT_NAME.
[ "Returns", "FULL_PRODUCT_NAME", "." ]
def GetFullProductName(self): """Returns FULL_PRODUCT_NAME.""" if self._IsBundle(): return self.GetWrapperName() else: return self._GetStandaloneBinaryPath()
[ "def", "GetFullProductName", "(", "self", ")", ":", "if", "self", ".", "_IsBundle", "(", ")", ":", "return", "self", ".", "GetWrapperName", "(", ")", "else", ":", "return", "self", ".", "_GetStandaloneBinaryPath", "(", ")" ]
https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/xcode_emulation.py#L88-L93
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
AboutDialogInfo.GetLicence
(*args, **kwargs)
return _misc_.AboutDialogInfo_GetLicence(*args, **kwargs)
GetLicence(self) -> String Returns the licence value.
GetLicence(self) -> String
[ "GetLicence", "(", "self", ")", "-", ">", "String" ]
def GetLicence(*args, **kwargs): """ GetLicence(self) -> String Returns the licence value. """ return _misc_.AboutDialogInfo_GetLicence(*args, **kwargs)
[ "def", "GetLicence", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "AboutDialogInfo_GetLicence", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L6724-L6730
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/builder.py
python
NeuralNetworkBuilder.set_optional_input
(self, input_idx, value=None, format="float")
Marks given input as optional input. Optionally, sets default value for optional input if value is not None Parameters ---------- input_idx: int Index of input to be marked and fill with default value value: int/double/float/None Value to be fill as defau...
Marks given input as optional input. Optionally, sets default value for optional input if value is not None
[ "Marks", "given", "input", "as", "optional", "input", ".", "Optionally", "sets", "default", "value", "for", "optional", "input", "if", "value", "is", "not", "None" ]
def set_optional_input(self, input_idx, value=None, format="float"): """ Marks given input as optional input. Optionally, sets default value for optional input if value is not None Parameters ---------- input_idx: int Index of input to be marked and fill with...
[ "def", "set_optional_input", "(", "self", ",", "input_idx", ",", "value", "=", "None", ",", "format", "=", "\"float\"", ")", ":", "if", "input_idx", ">=", "len", "(", "self", ".", "spec", ".", "description", ".", "input", ")", ":", "msg", "=", "(", "...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/builder.py#L618-L666
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/ndlstm/python/misc.py
python
one_hot_mask
(labels, num_classes, scope=None)
Compute 1-hot encodings for masks. Given a label image, this computes the one hot encoding at each pixel. Args: labels: (batch_size, width, height, 1) tensor containing labels. num_classes: number of classes scope: optional scope name Returns: Tensor of shape (batch_size, width, height, num_c...
Compute 1-hot encodings for masks.
[ "Compute", "1", "-", "hot", "encodings", "for", "masks", "." ]
def one_hot_mask(labels, num_classes, scope=None): """Compute 1-hot encodings for masks. Given a label image, this computes the one hot encoding at each pixel. Args: labels: (batch_size, width, height, 1) tensor containing labels. num_classes: number of classes scope: optional scope name Return...
[ "def", "one_hot_mask", "(", "labels", ",", "num_classes", ",", "scope", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "scope", ",", "\"OneHotMask\"", ",", "[", "labels", "]", ")", ":", "height", ",", "width", ",", "depth", "=", "_shape"...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/ndlstm/python/misc.py#L73-L99
mhammond/pywin32
44afd86ba8485194df93234639243252deeb40d5
Pythonwin/pywin/framework/interact.py
python
CreateMDIInteractiveWindow
(makeDoc=None, makeFrame=None)
Create a standard (non-docked) interactive window unconditionally
Create a standard (non-docked) interactive window unconditionally
[ "Create", "a", "standard", "(", "non", "-", "docked", ")", "interactive", "window", "unconditionally" ]
def CreateMDIInteractiveWindow(makeDoc=None, makeFrame=None): """Create a standard (non-docked) interactive window unconditionally""" global edit if makeDoc is None: makeDoc = InteractiveDocument if makeFrame is None: makeFrame = InteractiveFrame edit = CInteractivePython(makeDoc=mak...
[ "def", "CreateMDIInteractiveWindow", "(", "makeDoc", "=", "None", ",", "makeFrame", "=", "None", ")", ":", "global", "edit", "if", "makeDoc", "is", "None", ":", "makeDoc", "=", "InteractiveDocument", "if", "makeFrame", "is", "None", ":", "makeFrame", "=", "I...
https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/Pythonwin/pywin/framework/interact.py#L914-L921
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/spatial/distance.py
python
cityblock
(u, v, w=None)
return l1_diff.sum()
Compute the City Block (Manhattan) distance. Computes the Manhattan distance between two 1-D arrays `u` and `v`, which is defined as .. math:: \\sum_i {\\left| u_i - v_i \\right|}. Parameters ---------- u : (N,) array_like Input array. v : (N,) array_like Input arr...
Compute the City Block (Manhattan) distance.
[ "Compute", "the", "City", "Block", "(", "Manhattan", ")", "distance", "." ]
def cityblock(u, v, w=None): """ Compute the City Block (Manhattan) distance. Computes the Manhattan distance between two 1-D arrays `u` and `v`, which is defined as .. math:: \\sum_i {\\left| u_i - v_i \\right|}. Parameters ---------- u : (N,) array_like Input array. ...
[ "def", "cityblock", "(", "u", ",", "v", ",", "w", "=", "None", ")", ":", "u", "=", "_validate_vector", "(", "u", ")", "v", "=", "_validate_vector", "(", "v", ")", "l1_diff", "=", "abs", "(", "u", "-", "v", ")", "if", "w", "is", "not", "None", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/spatial/distance.py#L976-L1019
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_controls.py
python
GenericDirCtrl.SelectPath
(*args, **kwargs)
return _controls_.GenericDirCtrl_SelectPath(*args, **kwargs)
SelectPath(self, String path, bool select=True)
SelectPath(self, String path, bool select=True)
[ "SelectPath", "(", "self", "String", "path", "bool", "select", "=", "True", ")" ]
def SelectPath(*args, **kwargs): """SelectPath(self, String path, bool select=True)""" return _controls_.GenericDirCtrl_SelectPath(*args, **kwargs)
[ "def", "SelectPath", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "GenericDirCtrl_SelectPath", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L5701-L5703
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/summary/impl/gcs.py
python
CheckIsSupported
()
Raises an OSError if the system isn't set up for Google Cloud Storage. Raises: OSError: If the system hasn't been set up so that TensorBoard can access Google Cloud Storage. The error's message contains installation instructions.
Raises an OSError if the system isn't set up for Google Cloud Storage.
[ "Raises", "an", "OSError", "if", "the", "system", "isn", "t", "set", "up", "for", "Google", "Cloud", "Storage", "." ]
def CheckIsSupported(): """Raises an OSError if the system isn't set up for Google Cloud Storage. Raises: OSError: If the system hasn't been set up so that TensorBoard can access Google Cloud Storage. The error's message contains installation instructions. """ try: subprocess.check_output...
[ "def", "CheckIsSupported", "(", ")", ":", "try", ":", "subprocess", ".", "check_output", "(", "[", "'gsutil'", ",", "'version'", "]", ")", "except", "OSError", "as", "e", ":", "logging", ".", "error", "(", "'Error while checking for gsutil: %s'", ",", "e", "...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/summary/impl/gcs.py#L117-L132
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/ndarray/ndarray.py
python
NDArray.expm1
(self, *args, **kwargs)
return op.expm1(self, *args, **kwargs)
Convenience fluent method for :py:func:`expm1`. The arguments are the same as for :py:func:`expm1`, with this array as data.
Convenience fluent method for :py:func:`expm1`.
[ "Convenience", "fluent", "method", "for", ":", "py", ":", "func", ":", "expm1", "." ]
def expm1(self, *args, **kwargs): """Convenience fluent method for :py:func:`expm1`. The arguments are the same as for :py:func:`expm1`, with this array as data. """ return op.expm1(self, *args, **kwargs)
[ "def", "expm1", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "op", ".", "expm1", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/ndarray/ndarray.py#L1598-L1604
nyuwireless-unipd/ns3-mmwave
4ff9e87e8079764e04cbeccd8e85bff15ae16fb3
src/visualizer/visualizer/core.py
python
Node.set_position
(self, x, y)
! Set position function. @param self: class object. @param x: x position @param y: y position @return none
! Set position function.
[ "!", "Set", "position", "function", "." ]
def set_position(self, x, y): """! Set position function. @param self: class object. @param x: x position @param y: y position @return none """ self.canvas_item.set_property("center_x", x) self.canvas_item.set_property("center_y", y) if se...
[ "def", "set_position", "(", "self", ",", "x", ",", "y", ")", ":", "self", ".", "canvas_item", ".", "set_property", "(", "\"center_x\"", ",", "x", ")", "self", ".", "canvas_item", ".", "set_property", "(", "\"center_y\"", ",", "y", ")", "if", "self", "....
https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/src/visualizer/visualizer/core.py#L402-L440
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-data.py
python
Bs3Cg1EncodedTests.bytesToLines
(sPrefix, asBytes)
return asRet
Formats a series of bytes into one or more lines. A byte ending with a newline indicates that we should start a new line, and prefix it by len(sPrefix) spaces. Returns list of lines.
Formats a series of bytes into one or more lines. A byte ending with a newline indicates that we should start a new line, and prefix it by len(sPrefix) spaces.
[ "Formats", "a", "series", "of", "bytes", "into", "one", "or", "more", "lines", ".", "A", "byte", "ending", "with", "a", "newline", "indicates", "that", "we", "should", "start", "a", "new", "line", "and", "prefix", "it", "by", "len", "(", "sPrefix", ")"...
def bytesToLines(sPrefix, asBytes): """ Formats a series of bytes into one or more lines. A byte ending with a newline indicates that we should start a new line, and prefix it by len(sPrefix) spaces. Returns list of lines. """ asRet = []; sLine = sPrefix;...
[ "def", "bytesToLines", "(", "sPrefix", ",", "asBytes", ")", ":", "asRet", "=", "[", "]", "sLine", "=", "sPrefix", "for", "sByte", "in", "asBytes", ":", "if", "sByte", "[", "-", "1", "]", "==", "'\\n'", ":", "sLine", "+=", "sByte", "[", ":", "-", ...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-data.py#L252-L276
google/nucleus
68d3947fafba1337f294c0668a6e1c7f3f1273e3
nucleus/io/tfrecord.py
python
read_shard_sorted_tfrecords
(path, key, proto=None, max_records=None, compression_type=None)
Yields the parsed records in a TFRecord file path in sorted order. The input TFRecord file must have each shard already in sorted order when using the key function for comparison (but elements can be interleaved across shards). Under those constraints, the elements will be yielded in a global sorted order. ...
Yields the parsed records in a TFRecord file path in sorted order.
[ "Yields", "the", "parsed", "records", "in", "a", "TFRecord", "file", "path", "in", "sorted", "order", "." ]
def read_shard_sorted_tfrecords(path, key, proto=None, max_records=None, compression_type=None): """Yields the parsed records in a TFRecord file path in sorted order. The input TFRecord f...
[ "def", "read_shard_sorted_tfrecords", "(", "path", ",", "key", ",", "proto", "=", "None", ",", "max_records", "=", "None", ",", "compression_type", "=", "None", ")", ":", "if", "sharded_file_utils", ".", "is_sharded_file_spec", "(", "path", ")", ":", "paths", ...
https://github.com/google/nucleus/blob/68d3947fafba1337f294c0668a6e1c7f3f1273e3/nucleus/io/tfrecord.py#L90-L130
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/design-circular-deque.py
python
MyCircularDeque.getFront
(self)
return -1 if self.isEmpty() else self.__buffer[self.__start]
Get the front item from the deque. :rtype: int
Get the front item from the deque. :rtype: int
[ "Get", "the", "front", "item", "from", "the", "deque", ".", ":", "rtype", ":", "int" ]
def getFront(self): """ Get the front item from the deque. :rtype: int """ return -1 if self.isEmpty() else self.__buffer[self.__start]
[ "def", "getFront", "(", "self", ")", ":", "return", "-", "1", "if", "self", ".", "isEmpty", "(", ")", "else", "self", ".", "__buffer", "[", "self", ".", "__start", "]" ]
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/design-circular-deque.py#L61-L66
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/lib-tk/Tkinter.py
python
Misc.winfo_vrootwidth
(self)
return getint( self.tk.call('winfo', 'vrootwidth', self._w))
Return the width of the virtual root window associated with this widget in pixel. If there is no virtual root window return the width of the screen.
Return the width of the virtual root window associated with this widget in pixel. If there is no virtual root window return the width of the screen.
[ "Return", "the", "width", "of", "the", "virtual", "root", "window", "associated", "with", "this", "widget", "in", "pixel", ".", "If", "there", "is", "no", "virtual", "root", "window", "return", "the", "width", "of", "the", "screen", "." ]
def winfo_vrootwidth(self): """Return the width of the virtual root window associated with this widget in pixel. If there is no virtual root window return the width of the screen.""" return getint( self.tk.call('winfo', 'vrootwidth', self._w))
[ "def", "winfo_vrootwidth", "(", "self", ")", ":", "return", "getint", "(", "self", ".", "tk", ".", "call", "(", "'winfo'", ",", "'vrootwidth'", ",", "self", ".", "_w", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L997-L1002
mingchen/protobuf-ios
0958df34558cd54cb7b6e6ca5c8855bf3d475046
compiler/python/google/protobuf/reflection.py
python
_AddMergeFromStringMethod
(message_descriptor, cls)
Helper for _AddMessageMethods().
Helper for _AddMessageMethods().
[ "Helper", "for", "_AddMessageMethods", "()", "." ]
def _AddMergeFromStringMethod(message_descriptor, cls): """Helper for _AddMessageMethods().""" Decoder = decoder.Decoder def MergeFromString(self, serialized): decoder = Decoder(serialized) byte_count = 0 while not decoder.EndOfStream(): bytes_read = _DeserializeOneEntity(message_descriptor, sel...
[ "def", "_AddMergeFromStringMethod", "(", "message_descriptor", ",", "cls", ")", ":", "Decoder", "=", "decoder", ".", "Decoder", "def", "MergeFromString", "(", "self", ",", "serialized", ")", ":", "decoder", "=", "Decoder", "(", "serialized", ")", "byte_count", ...
https://github.com/mingchen/protobuf-ios/blob/0958df34558cd54cb7b6e6ca5c8855bf3d475046/compiler/python/google/protobuf/reflection.py#L1231-L1243
fifengine/fifengine
4b62c42e85bec19893cef8e63e6855927cff2c47
engine/python/fife/extensions/pychan/internal.py
python
Manager.addWidget
(self, widget)
Adds Widget to the manager. So the manager "owns" the Widget. Note: As long as the wiget is in self.allWidgets the Python GC can not free it.
Adds Widget to the manager. So the manager "owns" the Widget. Note: As long as the wiget is in self.allWidgets the Python GC can not free it.
[ "Adds", "Widget", "to", "the", "manager", ".", "So", "the", "manager", "owns", "the", "Widget", ".", "Note", ":", "As", "long", "as", "the", "wiget", "is", "in", "self", ".", "allWidgets", "the", "Python", "GC", "can", "not", "free", "it", "." ]
def addWidget(self, widget): """ Adds Widget to the manager. So the manager "owns" the Widget. Note: As long as the wiget is in self.allWidgets the Python GC can not free it. """ if not widget._added: widget._added = True self.allWidgets.add(widget)
[ "def", "addWidget", "(", "self", ",", "widget", ")", ":", "if", "not", "widget", ".", "_added", ":", "widget", ".", "_added", "=", "True", "self", ".", "allWidgets", ".", "add", "(", "widget", ")" ]
https://github.com/fifengine/fifengine/blob/4b62c42e85bec19893cef8e63e6855927cff2c47/engine/python/fife/extensions/pychan/internal.py#L89-L97
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32com/client/gencache.py
python
SplitGeneratedFileName
(fname)
return tuple(fname.split('x',4))
Reverse of GetGeneratedFileName()
Reverse of GetGeneratedFileName()
[ "Reverse", "of", "GetGeneratedFileName", "()" ]
def SplitGeneratedFileName(fname): """Reverse of GetGeneratedFileName() """ return tuple(fname.split('x',4))
[ "def", "SplitGeneratedFileName", "(", "fname", ")", ":", "return", "tuple", "(", "fname", ".", "split", "(", "'x'", ",", "4", ")", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32com/client/gencache.py#L122-L125
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/distutils/dir_util.py
python
_build_cmdtuple
(path, cmdtuples)
Helper for remove_tree().
Helper for remove_tree().
[ "Helper", "for", "remove_tree", "()", "." ]
def _build_cmdtuple(path, cmdtuples): """Helper for remove_tree().""" for f in os.listdir(path): real_f = os.path.join(path,f) if os.path.isdir(real_f) and not os.path.islink(real_f): _build_cmdtuple(real_f, cmdtuples) else: cmdtuples.append((os.remove, real_f)) ...
[ "def", "_build_cmdtuple", "(", "path", ",", "cmdtuples", ")", ":", "for", "f", "in", "os", ".", "listdir", "(", "path", ")", ":", "real_f", "=", "os", ".", "path", ".", "join", "(", "path", ",", "f", ")", "if", "os", ".", "path", ".", "isdir", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/distutils/dir_util.py#L168-L176
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/devstack.py
python
create_volume
(devstack_node, ceph_node, vol_name, size)
return vol_info['id']
:param size: The size of the volume, in GB
:param size: The size of the volume, in GB
[ ":", "param", "size", ":", "The", "size", "of", "the", "volume", "in", "GB" ]
def create_volume(devstack_node, ceph_node, vol_name, size): """ :param size: The size of the volume, in GB """ size = str(size) log.info("Creating a {size}GB volume named {name}...".format( name=vol_name, size=size)) args = ['source', 'devstack/openrc', run.Raw('&&'), 'cinder', ...
[ "def", "create_volume", "(", "devstack_node", ",", "ceph_node", ",", "vol_name", ",", "size", ")", ":", "size", "=", "str", "(", "size", ")", "log", ".", "info", "(", "\"Creating a {size}GB volume named {name}...\"", ".", "format", "(", "name", "=", "vol_name"...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/devstack.py#L338-L362
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/functools.py
python
update_wrapper
(wrapper, wrapped, assigned = WRAPPER_ASSIGNMENTS, updated = WRAPPER_UPDATES)
return wrapper
Update a wrapper function to look like the wrapped function wrapper is the function to be updated wrapped is the original function assigned is a tuple naming the attributes assigned directly from the wrapped function to the wrapper function (defaults to functools.WRAPPER_ASSIGNMENTS)...
Update a wrapper function to look like the wrapped function
[ "Update", "a", "wrapper", "function", "to", "look", "like", "the", "wrapped", "function" ]
def update_wrapper(wrapper, wrapped, assigned = WRAPPER_ASSIGNMENTS, updated = WRAPPER_UPDATES): """Update a wrapper function to look like the wrapped function wrapper is the function to be updated wrapped is the original function assign...
[ "def", "update_wrapper", "(", "wrapper", ",", "wrapped", ",", "assigned", "=", "WRAPPER_ASSIGNMENTS", ",", "updated", "=", "WRAPPER_UPDATES", ")", ":", "for", "attr", "in", "assigned", ":", "try", ":", "value", "=", "getattr", "(", "wrapped", ",", "attr", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/functools.py#L35-L63
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
external/tools/build/v2/build/targets.py
python
AbstractTarget.__init__
(self, name, project, manager = None)
manager: the Manager object name: name of the target project: the project target to which this one belongs manager:the manager object. If none, uses project.manager ()
manager: the Manager object name: name of the target project: the project target to which this one belongs manager:the manager object. If none, uses project.manager ()
[ "manager", ":", "the", "Manager", "object", "name", ":", "name", "of", "the", "target", "project", ":", "the", "project", "target", "to", "which", "this", "one", "belongs", "manager", ":", "the", "manager", "object", ".", "If", "none", "uses", "project", ...
def __init__ (self, name, project, manager = None): """ manager: the Manager object name: name of the target project: the project target to which this one belongs manager:the manager object. If none, uses project.manager () """ assert (isinstanc...
[ "def", "__init__", "(", "self", ",", "name", ",", "project", ",", "manager", "=", "None", ")", ":", "assert", "(", "isinstance", "(", "project", ",", "ProjectTarget", ")", ")", "# Note: it might seem that we don't need either name or project at all.", "# However, ther...
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/external/tools/build/v2/build/targets.py#L271-L291
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/compiler/xla/xla.py
python
check_function_argument_count
(func, input_arity, infeed_queue)
return None
Validate the number of input arguments to an XLA function. Args: func: the Python function that will be called to generate the body of an XLA computation graph. input_arity: the number of explicit arguments supplied by the caller. infeed_queue: if not None, the infeed queue that will supply a...
Validate the number of input arguments to an XLA function.
[ "Validate", "the", "number", "of", "input", "arguments", "to", "an", "XLA", "function", "." ]
def check_function_argument_count(func, input_arity, infeed_queue): """Validate the number of input arguments to an XLA function. Args: func: the Python function that will be called to generate the body of an XLA computation graph. input_arity: the number of explicit arguments supplied by the caller....
[ "def", "check_function_argument_count", "(", "func", ",", "input_arity", ",", "infeed_queue", ")", ":", "def", "format_error", "(", "complaint", ",", "quantity", ")", ":", "return", "'%s %d argument%s'", "%", "(", "complaint", ",", "quantity", ",", "''", "if", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/compiler/xla/xla.py#L572-L617
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/symsrc/pefile.py
python
PE.parse_import_directory
(self, rva, size)
return import_descs
Walk and parse the import directory.
Walk and parse the import directory.
[ "Walk", "and", "parse", "the", "import", "directory", "." ]
def parse_import_directory(self, rva, size): """Walk and parse the import directory.""" import_descs = [] while True: try: # If the RVA is invalid all would blow up. Some EXEs seem to be # specially nasty and have an invalid RVA. data...
[ "def", "parse_import_directory", "(", "self", ",", "rva", ",", "size", ")", ":", "import_descs", "=", "[", "]", "while", "True", ":", "try", ":", "# If the RVA is invalid all would blow up. Some EXEs seem to be", "# specially nasty and have an invalid RVA.", "data", "=", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/symsrc/pefile.py#L2744-L2791
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/tools/compatibility/ast_edits.py
python
_PastaEditVisitor.visit_Attribute
(self, node)
Handle bare Attributes i.e. [tf.foo, tf.bar].
Handle bare Attributes i.e. [tf.foo, tf.bar].
[ "Handle", "bare", "Attributes", "i", ".", "e", ".", "[", "tf", ".", "foo", "tf", ".", "bar", "]", "." ]
def visit_Attribute(self, node): # pylint: disable=invalid-name """Handle bare Attributes i.e. [tf.foo, tf.bar].""" assert self._stack[-1] is node full_name = self._get_full_name(node) if full_name: parent = self._stack[-2] # Make sure the warning comes first, otherwise the name may have ...
[ "def", "visit_Attribute", "(", "self", ",", "node", ")", ":", "# pylint: disable=invalid-name", "assert", "self", ".", "_stack", "[", "-", "1", "]", "is", "node", "full_name", "=", "self", ".", "_get_full_name", "(", "node", ")", "if", "full_name", ":", "p...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/tools/compatibility/ast_edits.py#L579-L606
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/closure_linter/closure_linter/statetracker.py
python
StateTracker.IsBlockClose
(self)
return self._is_block_close
Returns true if the current token is a block close. Returns: True if the current token is a block close.
Returns true if the current token is a block close.
[ "Returns", "true", "if", "the", "current", "token", "is", "a", "block", "close", "." ]
def IsBlockClose(self): """Returns true if the current token is a block close. Returns: True if the current token is a block close. """ return self._is_block_close
[ "def", "IsBlockClose", "(", "self", ")", ":", "return", "self", ".", "_is_block_close" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/closure_linter/closure_linter/statetracker.py#L669-L675
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/re.py
python
purge
()
Clear the regular expression caches
Clear the regular expression caches
[ "Clear", "the", "regular", "expression", "caches" ]
def purge(): "Clear the regular expression caches" _cache.clear() _compile_repl.cache_clear()
[ "def", "purge", "(", ")", ":", "_cache", ".", "clear", "(", ")", "_compile_repl", ".", "cache_clear", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/re.py#L238-L241
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/tpu/tpu_feed.py
python
InfeedQueue.split_inputs_and_generate_enqueue_ops
(self, inputs, device_assignment=None, placement_function=None, tpu_ordinal_function=None)
return [ self._generate_enqueue_op( shard, name_prefix, index, device=placement_function(index), tpu_ordinal=tpu_ordinal_function(index)) for (shard, index) in zip(sharded_inputs, range(self.number_of_shards)) ]
POORLY-PERFORMING ON MULTI-HOST SYSTEMS. Generates the host-side Ops to enqueue a tuple. This method performs poorly because it takes an entire input on a single host, splits it, and distributes it to all of the cores. It is present only to simplify tutorial examples. inputs is a list of Tensors ...
POORLY-PERFORMING ON MULTI-HOST SYSTEMS.
[ "POORLY", "-", "PERFORMING", "ON", "MULTI", "-", "HOST", "SYSTEMS", "." ]
def split_inputs_and_generate_enqueue_ops(self, inputs, device_assignment=None, placement_function=None, tpu_ordinal_function=None): """POOR...
[ "def", "split_inputs_and_generate_enqueue_ops", "(", "self", ",", "inputs", ",", "device_assignment", "=", "None", ",", "placement_function", "=", "None", ",", "tpu_ordinal_function", "=", "None", ")", ":", "if", "device_assignment", "is", "None", ":", "if", "plac...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/tpu/tpu_feed.py#L640-L746
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/messages.py
python
Enum.def_enum
(dct, name)
return type(name, (Enum,), dct)
Define enum class from dictionary. Args: dct: Dictionary of enumerated values for type. name: Name of enum.
Define enum class from dictionary.
[ "Define", "enum", "class", "from", "dictionary", "." ]
def def_enum(dct, name): """Define enum class from dictionary. Args: dct: Dictionary of enumerated values for type. name: Name of enum. """ return type(name, (Enum,), dct)
[ "def", "def_enum", "(", "dct", ",", "name", ")", ":", "return", "type", "(", "name", ",", "(", "Enum", ",", ")", ",", "dct", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/messages.py#L532-L539
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py3/prompt_toolkit/contrib/telnet/server.py
python
TelnetConnection.erase_screen
(self)
Erase the screen and move the cursor to the top.
Erase the screen and move the cursor to the top.
[ "Erase", "the", "screen", "and", "move", "the", "cursor", "to", "the", "top", "." ]
def erase_screen(self) -> None: """ Erase the screen and move the cursor to the top. """ if self.vt100_output is None: return self.vt100_output.erase_screen() self.vt100_output.cursor_goto(0, 0) self.vt100_output.flush()
[ "def", "erase_screen", "(", "self", ")", "->", "None", ":", "if", "self", ".", "vt100_output", "is", "None", ":", "return", "self", ".", "vt100_output", ".", "erase_screen", "(", ")", "self", ".", "vt100_output", ".", "cursor_goto", "(", "0", ",", "0", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/contrib/telnet/server.py#L253-L261
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/py/py/_path/local.py
python
LocalPath.dirpath
(self, *args, **kwargs)
return super(LocalPath, self).dirpath(*args, **kwargs)
return the directory path joined with any given path arguments.
return the directory path joined with any given path arguments.
[ "return", "the", "directory", "path", "joined", "with", "any", "given", "path", "arguments", "." ]
def dirpath(self, *args, **kwargs): """ return the directory path joined with any given path arguments. """ if not kwargs: path = object.__new__(self.__class__) path.strpath = dirname(self.strpath) if args: path = path.join(*args) return p...
[ "def", "dirpath", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "not", "kwargs", ":", "path", "=", "object", ".", "__new__", "(", "self", ".", "__class__", ")", "path", ".", "strpath", "=", "dirname", "(", "self", ".", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/py/py/_path/local.py#L320-L328
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/util.py
python
IntValidator.Validate
(self, win)
return val.isdigit()
Validate an window value @param win: window to validate
Validate an window value @param win: window to validate
[ "Validate", "an", "window", "value", "@param", "win", ":", "window", "to", "validate" ]
def Validate(self, win): """Validate an window value @param win: window to validate """ val = win.GetValue() return val.isdigit()
[ "def", "Validate", "(", "self", ",", "win", ")", ":", "val", "=", "win", ".", "GetValue", "(", ")", "return", "val", ".", "isdigit", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/util.py#L769-L775
epiqc/ScaffCC
66a79944ee4cd116b27bc1a69137276885461db8
clang/tools/scan-build-py/libscanbuild/report.py
python
encode_value
(container, key, encode)
Run 'encode' on 'container[key]' value and update it.
Run 'encode' on 'container[key]' value and update it.
[ "Run", "encode", "on", "container", "[", "key", "]", "value", "and", "update", "it", "." ]
def encode_value(container, key, encode): """ Run 'encode' on 'container[key]' value and update it. """ if key in container: value = encode(container[key]) container.update({key: value})
[ "def", "encode_value", "(", "container", ",", "key", ",", "encode", ")", ":", "if", "key", "in", "container", ":", "value", "=", "encode", "(", "container", "[", "key", "]", ")", "container", ".", "update", "(", "{", "key", ":", "value", "}", ")" ]
https://github.com/epiqc/ScaffCC/blob/66a79944ee4cd116b27bc1a69137276885461db8/clang/tools/scan-build-py/libscanbuild/report.py#L434-L439
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Misc.winfo_pointery
(self)
return getint( self.tk.call('winfo', 'pointery', self._w))
Return the y coordinate of the pointer on the root window.
Return the y coordinate of the pointer on the root window.
[ "Return", "the", "y", "coordinate", "of", "the", "pointer", "on", "the", "root", "window", "." ]
def winfo_pointery(self): """Return the y coordinate of the pointer on the root window.""" return getint( self.tk.call('winfo', 'pointery', self._w))
[ "def", "winfo_pointery", "(", "self", ")", ":", "return", "getint", "(", "self", ".", "tk", ".", "call", "(", "'winfo'", ",", "'pointery'", ",", "self", ".", "_w", ")", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L821-L824
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/StringIO.py
python
StringIO.read
(self, n = -1)
return r
Read at most size bytes from the file (less if the read hits EOF before obtaining size bytes). If the size argument is negative or omitted, read all data until EOF is reached. The bytes are returned as a string object. An empty string is returned when EOF is encountered immediately.
Read at most size bytes from the file (less if the read hits EOF before obtaining size bytes).
[ "Read", "at", "most", "size", "bytes", "from", "the", "file", "(", "less", "if", "the", "read", "hits", "EOF", "before", "obtaining", "size", "bytes", ")", "." ]
def read(self, n = -1): """Read at most size bytes from the file (less if the read hits EOF before obtaining size bytes). If the size argument is negative or omitted, read all data until EOF is reached. The bytes are returned as a string object. An empty string is returned when ...
[ "def", "read", "(", "self", ",", "n", "=", "-", "1", ")", ":", "_complain_ifclosed", "(", "self", ".", "closed", ")", "if", "self", ".", "buflist", ":", "self", ".", "buf", "+=", "''", ".", "join", "(", "self", ".", "buflist", ")", "self", ".", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/StringIO.py#L119-L137
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/minimum-possible-integer-after-at-most-k-adjacent-swaps-on-digits.py
python
Solution.minInteger
(self, num, k)
return "".join(map(str, result))
:type num: str :type k: int :rtype: str
:type num: str :type k: int :rtype: str
[ ":", "type", "num", ":", "str", ":", "type", "k", ":", "int", ":", "rtype", ":", "str" ]
def minInteger(self, num, k): """ :type num: str :type k: int :rtype: str """ lookup = collections.defaultdict(list) bit = BIT(len(num)+1) for i in reversed(xrange(len(num))): bit.add(i+1, 1) lookup[int(num[i])].append(i+1) ...
[ "def", "minInteger", "(", "self", ",", "num", ",", "k", ")", ":", "lookup", "=", "collections", ".", "defaultdict", "(", "list", ")", "bit", "=", "BIT", "(", "len", "(", "num", ")", "+", "1", ")", "for", "i", "in", "reversed", "(", "xrange", "(",...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/minimum-possible-integer-after-at-most-k-adjacent-swaps-on-digits.py#L25-L44
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf/cudf/core/index.py
python
DatetimeIndex.dayofyear
(self)
return self._get_dt_field("day_of_year")
The day of the year, from 1-365 in non-leap years and from 1-366 in leap years. Examples -------- >>> import pandas as pd >>> import cudf >>> datetime_index = cudf.Index(pd.date_range("2016-12-31", ... "2017-01-08", freq="D")) >>> datetime_index ...
The day of the year, from 1-365 in non-leap years and from 1-366 in leap years.
[ "The", "day", "of", "the", "year", "from", "1", "-", "365", "in", "non", "-", "leap", "years", "and", "from", "1", "-", "366", "in", "leap", "years", "." ]
def dayofyear(self): """ The day of the year, from 1-365 in non-leap years and from 1-366 in leap years. Examples -------- >>> import pandas as pd >>> import cudf >>> datetime_index = cudf.Index(pd.date_range("2016-12-31", ... "2017-01-08", fr...
[ "def", "dayofyear", "(", "self", ")", ":", "return", "self", ".", "_get_dt_field", "(", "\"day_of_year\"", ")" ]
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/index.py#L1753-L1772
lukasmonk/lucaschess
13e2e5cb13b38a720ccf897af649054a64bcb914
Code/SQL/DBF.py
python
DBF.skip
(self, num=1)
return self.goto(num + self.recno)
Salta un registro.
Salta un registro.
[ "Salta", "un", "registro", "." ]
def skip(self, num=1): """ Salta un registro. """ return self.goto(num + self.recno)
[ "def", "skip", "(", "self", ",", "num", "=", "1", ")", ":", "return", "self", ".", "goto", "(", "num", "+", "self", ".", "recno", ")" ]
https://github.com/lukasmonk/lucaschess/blob/13e2e5cb13b38a720ccf897af649054a64bcb914/Code/SQL/DBF.py#L241-L245
envoyproxy/envoy-wasm
ab5d9381fdf92a1efa0b87cff80036b5b3e81198
source/extensions/filters/network/kafka/protocol/generator.py
python
StatefulProcessor.parse_type
(self, type_name, field_spec, highest_possible_version)
Parse a given type element - returns an array type, primitive (e.g. uint32_t) or complex one.
Parse a given type element - returns an array type, primitive (e.g. uint32_t) or complex one.
[ "Parse", "a", "given", "type", "element", "-", "returns", "an", "array", "type", "primitive", "(", "e", ".", "g", ".", "uint32_t", ")", "or", "complex", "one", "." ]
def parse_type(self, type_name, field_spec, highest_possible_version): """ Parse a given type element - returns an array type, primitive (e.g. uint32_t) or complex one. """ if (type_name.startswith('[]')): # In spec files, array types are defined as `[]underlying_type` instead of having its own ...
[ "def", "parse_type", "(", "self", ",", "type_name", ",", "field_spec", ",", "highest_possible_version", ")", ":", "if", "(", "type_name", ".", "startswith", "(", "'[]'", ")", ")", ":", "# In spec files, array types are defined as `[]underlying_type` instead of having its ...
https://github.com/envoyproxy/envoy-wasm/blob/ab5d9381fdf92a1efa0b87cff80036b5b3e81198/source/extensions/filters/network/kafka/protocol/generator.py#L229-L243
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/multiprocessing/process.py
python
Process.authkey
(self, authkey)
Set authorization key of process
Set authorization key of process
[ "Set", "authorization", "key", "of", "process" ]
def authkey(self, authkey): ''' Set authorization key of process ''' self._authkey = AuthenticationString(authkey)
[ "def", "authkey", "(", "self", ",", "authkey", ")", ":", "self", ".", "_authkey", "=", "AuthenticationString", "(", "authkey", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/multiprocessing/process.py#L190-L194
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/oldnumeric/ma.py
python
getmask
(a)
Mask of values in a; could be nomask. Returns nomask if a is not a masked array. To get an array for sure use getmaskarray.
Mask of values in a; could be nomask. Returns nomask if a is not a masked array. To get an array for sure use getmaskarray.
[ "Mask", "of", "values", "in", "a", ";", "could", "be", "nomask", ".", "Returns", "nomask", "if", "a", "is", "not", "a", "masked", "array", ".", "To", "get", "an", "array", "for", "sure", "use", "getmaskarray", "." ]
def getmask (a): """Mask of values in a; could be nomask. Returns nomask if a is not a masked array. To get an array for sure use getmaskarray.""" if isinstance(a, MaskedArray): return a.raw_mask() else: return nomask
[ "def", "getmask", "(", "a", ")", ":", "if", "isinstance", "(", "a", ",", "MaskedArray", ")", ":", "return", "a", ".", "raw_mask", "(", ")", "else", ":", "return", "nomask" ]
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/oldnumeric/ma.py#L149-L156
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/ops/io_ops.py
python
ReaderBase.restore_state
(self, state, name=None)
return gen_io_ops._reader_restore_state(self._reader_ref, state, name=name)
Restore a reader to a previously saved state. Not all Readers support being restored, so this can produce an Unimplemented error. Args: state: A string Tensor. Result of a SerializeState of a Reader with matching type. name: A name for the operation (optional). Returns: The ...
Restore a reader to a previously saved state.
[ "Restore", "a", "reader", "to", "a", "previously", "saved", "state", "." ]
def restore_state(self, state, name=None): """Restore a reader to a previously saved state. Not all Readers support being restored, so this can produce an Unimplemented error. Args: state: A string Tensor. Result of a SerializeState of a Reader with matching type. name: A name for ...
[ "def", "restore_state", "(", "self", ",", "state", ",", "name", "=", "None", ")", ":", "return", "gen_io_ops", ".", "_reader_restore_state", "(", "self", ".", "_reader_ref", ",", "state", ",", "name", "=", "name", ")" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/io_ops.py#L349-L363
glotzerlab/hoomd-blue
f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a
hoomd/filter/set_.py
python
_ParticleFilterSetOperations._cpp_cls_name
(self)
The name of the C++ class in the `_hoomd` module. Used for Python class's inheritance.
The name of the C++ class in the `_hoomd` module.
[ "The", "name", "of", "the", "C", "++", "class", "in", "the", "_hoomd", "module", "." ]
def _cpp_cls_name(self): """The name of the C++ class in the `_hoomd` module. Used for Python class's inheritance. """ raise NotImplementedError
[ "def", "_cpp_cls_name", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/filter/set_.py#L17-L22
neoml-lib/neoml
a0d370fba05269a1b2258cef126f77bbd2054a3e
NeoML/Python/neoml/Dnn/Loss.py
python
Loss.train_labels
(self, train)
Specifies if gradients should also be calculated for the second input, which contains the class labels.
Specifies if gradients should also be calculated for the second input, which contains the class labels.
[ "Specifies", "if", "gradients", "should", "also", "be", "calculated", "for", "the", "second", "input", "which", "contains", "the", "class", "labels", "." ]
def train_labels(self, train): """Specifies if gradients should also be calculated for the second input, which contains the class labels. """ self._internal.set_train_labels(train)
[ "def", "train_labels", "(", "self", ",", "train", ")", ":", "self", ".", "_internal", ".", "set_train_labels", "(", "train", ")" ]
https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Loss.py#L59-L63
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/symbol/numpy/_symbol.py
python
tri
(N, M=None, k=0, dtype=None, ctx=None)
return _npi.tri(N, M, k, dtype, ctx)
r""" An array with ones at and below the given diagonal and zeros elsewhere. Parameters ---------- N : int Number of rows in the array. M : int, optional Number of columns in the array. By default, `M` is taken equal to `N`. k : int, optional The sub-diagonal at ...
r""" An array with ones at and below the given diagonal and zeros elsewhere.
[ "r", "An", "array", "with", "ones", "at", "and", "below", "the", "given", "diagonal", "and", "zeros", "elsewhere", "." ]
def tri(N, M=None, k=0, dtype=None, ctx=None): r""" An array with ones at and below the given diagonal and zeros elsewhere. Parameters ---------- N : int Number of rows in the array. M : int, optional Number of columns in the array. By default, `M` is taken equal to `N`....
[ "def", "tri", "(", "N", ",", "M", "=", "None", ",", "k", "=", "0", ",", "dtype", "=", "None", ",", "ctx", "=", "None", ")", ":", "if", "dtype", "is", "None", ":", "dtype", "=", "'float32'", "if", "M", "is", "None", ":", "M", "=", "N", "if",...
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/symbol/numpy/_symbol.py#L2500-L2530
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/oauthlib/oauth2/rfc6749/endpoints/resource.py
python
ResourceEndpoint.verify_request
(self, uri, http_method='GET', body=None, headers=None, scopes=None)
return token_type_handler.validate_request(request), request
Validate client, code etc, return body + headers
Validate client, code etc, return body + headers
[ "Validate", "client", "code", "etc", "return", "body", "+", "headers" ]
def verify_request(self, uri, http_method='GET', body=None, headers=None, scopes=None): """Validate client, code etc, return body + headers""" request = Request(uri, http_method, body, headers) request.token_type = self.find_token_type(request) request.scopes = sco...
[ "def", "verify_request", "(", "self", ",", "uri", ",", "http_method", "=", "'GET'", ",", "body", "=", "None", ",", "headers", "=", "None", ",", "scopes", "=", "None", ")", ":", "request", "=", "Request", "(", "uri", ",", "http_method", ",", "body", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/oauthlib/oauth2/rfc6749/endpoints/resource.py#L65-L75
gnina/gnina
b9ae032f52fc7a8153987bde09c0efa3620d8bb6
caffe/scripts/cpp_lint.py
python
CheckCaffeDataLayerSetUp
(filename, clean_lines, linenum, error)
Except the base classes, Caffe DataLayer should define DataLayerSetUp instead of LayerSetUp. The base DataLayers define common SetUp steps, the subclasses should not override them. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. li...
Except the base classes, Caffe DataLayer should define DataLayerSetUp instead of LayerSetUp. The base DataLayers define common SetUp steps, the subclasses should not override them. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. li...
[ "Except", "the", "base", "classes", "Caffe", "DataLayer", "should", "define", "DataLayerSetUp", "instead", "of", "LayerSetUp", ".", "The", "base", "DataLayers", "define", "common", "SetUp", "steps", "the", "subclasses", "should", "not", "override", "them", ".", ...
def CheckCaffeDataLayerSetUp(filename, clean_lines, linenum, error): """Except the base classes, Caffe DataLayer should define DataLayerSetUp instead of LayerSetUp. The base DataLayers define common SetUp steps, the subclasses should not override them. Args: filename: The name of the current f...
[ "def", "CheckCaffeDataLayerSetUp", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "ix", "=", "line", ".", "find", "(", "'DataLayer<Dtype>::LayerSetUp'", ")", "if", ...
https://github.com/gnina/gnina/blob/b9ae032f52fc7a8153987bde09c0efa3620d8bb6/caffe/scripts/cpp_lint.py#L1599-L1635
mkeeter/antimony
ee525bbdad34ae94879fd055821f92bcef74e83f
py/fab/shapes.py
python
rounded_rectangle
(xmin, xmax, ymin, ymax, r)
return ( rectangle(xmin, xmax, ymin+r, ymax-r) | rectangle(xmin+r, xmax-r, ymin, ymax) | circle(xmin+r, ymin+r, r) | circle(xmin+r, ymax-r, r) | circle(xmax-r, ymin+r, r) | circle(xmax-r, ymax-r, r) )
Returns a rectangle with rounded corners. r is a roundedness fraction between 0 (not rounded) and 1 (completely rounded)
Returns a rectangle with rounded corners. r is a roundedness fraction between 0 (not rounded) and 1 (completely rounded)
[ "Returns", "a", "rectangle", "with", "rounded", "corners", ".", "r", "is", "a", "roundedness", "fraction", "between", "0", "(", "not", "rounded", ")", "and", "1", "(", "completely", "rounded", ")" ]
def rounded_rectangle(xmin, xmax, ymin, ymax, r): """ Returns a rectangle with rounded corners. r is a roundedness fraction between 0 (not rounded) and 1 (completely rounded) """ r *= min(xmax - xmin, ymax - ymin)/2 return ( rectangle(xmin, xmax, ymin+r, ymax-r) | rectang...
[ "def", "rounded_rectangle", "(", "xmin", ",", "xmax", ",", "ymin", ",", "ymax", ",", "r", ")", ":", "r", "*=", "min", "(", "xmax", "-", "xmin", ",", "ymax", "-", "ymin", ")", "/", "2", "return", "(", "rectangle", "(", "xmin", ",", "xmax", ",", ...
https://github.com/mkeeter/antimony/blob/ee525bbdad34ae94879fd055821f92bcef74e83f/py/fab/shapes.py#L154-L167
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/waflib/Tools/vala.py
python
configure
(self)
Use the following to enforce minimum vala version:: def configure(conf): conf.load('vala', funs='') conf.check_vala(min_version=(0,10,0))
Use the following to enforce minimum vala version::
[ "Use", "the", "following", "to", "enforce", "minimum", "vala", "version", "::" ]
def configure(self): """ Use the following to enforce minimum vala version:: def configure(conf): conf.load('vala', funs='') conf.check_vala(min_version=(0,10,0)) """ self.load('gnu_dirs') self.check_vala_deps() self.check_vala() self.env.VALAFLAGS = ['-C', '--quiet']
[ "def", "configure", "(", "self", ")", ":", "self", ".", "load", "(", "'gnu_dirs'", ")", "self", ".", "check_vala_deps", "(", ")", "self", ".", "check_vala", "(", ")", "self", ".", "env", ".", "VALAFLAGS", "=", "[", "'-C'", ",", "'--quiet'", "]" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Tools/vala.py#L310-L321
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
samples/doodle/doodle.py
python
DoodleWindow.OnLeftDown
(self, event)
called when the left mouse button is pressed
called when the left mouse button is pressed
[ "called", "when", "the", "left", "mouse", "button", "is", "pressed" ]
def OnLeftDown(self, event): """called when the left mouse button is pressed""" self.curLine = [] self.pos = event.GetPosition() self.CaptureMouse()
[ "def", "OnLeftDown", "(", "self", ",", "event", ")", ":", "self", ".", "curLine", "=", "[", "]", "self", ".", "pos", "=", "event", ".", "GetPosition", "(", ")", "self", ".", "CaptureMouse", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/samples/doodle/doodle.py#L144-L148
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
Validation/RecoTrack/python/plotting/ntupleDataFormat.py
python
Event.stripHits
(self)
return StripHits(self._tree)
Returns StripHits object.
Returns StripHits object.
[ "Returns", "StripHits", "object", "." ]
def stripHits(self): """Returns StripHits object.""" return StripHits(self._tree)
[ "def", "stripHits", "(", "self", ")", ":", "return", "StripHits", "(", "self", ".", "_tree", ")" ]
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Validation/RecoTrack/python/plotting/ntupleDataFormat.py#L498-L500
Jittor/jittor
e9aca0444c2bdc8e2389d99122954cd0903eec46
python/jittor/misc.py
python
gather
(x, dim, index)
return x.getitem(tuple(indexes))
if x is a 3-D array, reindex x like: out[i][j][k] = input[index[i][j][k]][j][k] # if dim == 0 out[i][j][k] = input[i][index[i][j][k]][k] # if dim == 1 out[i][j][k] = input[i][j][index[i][j][k]] # if dim == 2 Parameters:: * x (jt.Var) – the source array * dim (int) – the axis along which to in...
if x is a 3-D array, reindex x like:
[ "if", "x", "is", "a", "3", "-", "D", "array", "reindex", "x", "like", ":" ]
def gather(x, dim, index): ''' if x is a 3-D array, reindex x like: out[i][j][k] = input[index[i][j][k]][j][k] # if dim == 0 out[i][j][k] = input[i][index[i][j][k]][k] # if dim == 1 out[i][j][k] = input[i][j][index[i][j][k]] # if dim == 2 Parameters:: * x (jt.Var) – the source array * dim...
[ "def", "gather", "(", "x", ",", "dim", ",", "index", ")", ":", "shape", "=", "index", ".", "shape", "indexes", "=", "[", "f'i{i}'", "for", "i", "in", "range", "(", "len", "(", "shape", ")", ")", "]", "indexes", "[", "dim", "]", "=", "index", "r...
https://github.com/Jittor/jittor/blob/e9aca0444c2bdc8e2389d99122954cd0903eec46/python/jittor/misc.py#L1243-L1269
limbo018/DREAMPlace
146c3b9fd003d1acd52c96d9fd02e3f0a05154e4
dreamplace/EvalMetrics.py
python
EvalMetrics.__repr__
(self)
return self.__str__()
@brief print
[]
def __repr__(self): """ @brief print """ return self.__str__()
[ "def", "__repr__", "(", "self", ")", ":", "return", "self", ".", "__str__", "(", ")" ]
https://github.com/limbo018/DREAMPlace/blob/146c3b9fd003d1acd52c96d9fd02e3f0a05154e4/dreamplace/EvalMetrics.py#L88-L92
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/dateutil/parser/isoparser.py
python
isoparser.__init__
(self, sep=None)
:param sep: A single character that separates date and time portions. If ``None``, the parser will accept any single character. For strict ISO-8601 adherence, pass ``'T'``.
:param sep: A single character that separates date and time portions. If ``None``, the parser will accept any single character. For strict ISO-8601 adherence, pass ``'T'``.
[ ":", "param", "sep", ":", "A", "single", "character", "that", "separates", "date", "and", "time", "portions", ".", "If", "None", "the", "parser", "will", "accept", "any", "single", "character", ".", "For", "strict", "ISO", "-", "8601", "adherence", "pass",...
def __init__(self, sep=None): """ :param sep: A single character that separates date and time portions. If ``None``, the parser will accept any single character. For strict ISO-8601 adherence, pass ``'T'``. """ if sep is not None: if (len(s...
[ "def", "__init__", "(", "self", ",", "sep", "=", "None", ")", ":", "if", "sep", "is", "not", "None", ":", "if", "(", "len", "(", "sep", ")", "!=", "1", "or", "ord", "(", "sep", ")", ">=", "128", "or", "sep", "in", "'0123456789'", ")", ":", "r...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/dateutil/parser/isoparser.py#L43-L57
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
GetTextFromUser
(*args, **kwargs)
return _misc_.GetTextFromUser(*args, **kwargs)
GetTextFromUser(String message, String caption=EmptyString, String default_value=EmptyString, Window parent=None, int x=-1, int y=-1, bool centre=True) -> String
GetTextFromUser(String message, String caption=EmptyString, String default_value=EmptyString, Window parent=None, int x=-1, int y=-1, bool centre=True) -> String
[ "GetTextFromUser", "(", "String", "message", "String", "caption", "=", "EmptyString", "String", "default_value", "=", "EmptyString", "Window", "parent", "=", "None", "int", "x", "=", "-", "1", "int", "y", "=", "-", "1", "bool", "centre", "=", "True", ")", ...
def GetTextFromUser(*args, **kwargs): """ GetTextFromUser(String message, String caption=EmptyString, String default_value=EmptyString, Window parent=None, int x=-1, int y=-1, bool centre=True) -> String """ return _misc_.GetTextFromUser(*args, **kwargs)
[ "def", "GetTextFromUser", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "GetTextFromUser", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L454-L460
facebookincubator/mvfst
034a40c797485113d00127852d4df3c5bb44b3ed
build/fbcode_builder/getdeps/fetcher.py
python
ChangeStatus.__init__
(self, all_changed=False)
Construct a ChangeStatus object. The default is to create a status that indicates no changes, but passing all_changed=True will create one that indicates that everything changed
Construct a ChangeStatus object. The default is to create a status that indicates no changes, but passing all_changed=True will create one that indicates that everything changed
[ "Construct", "a", "ChangeStatus", "object", ".", "The", "default", "is", "to", "create", "a", "status", "that", "indicates", "no", "changes", "but", "passing", "all_changed", "=", "True", "will", "create", "one", "that", "indicates", "that", "everything", "cha...
def __init__(self, all_changed=False): """Construct a ChangeStatus object. The default is to create a status that indicates no changes, but passing all_changed=True will create one that indicates that everything changed""" if all_changed: self.source_files = 1 se...
[ "def", "__init__", "(", "self", ",", "all_changed", "=", "False", ")", ":", "if", "all_changed", ":", "self", ".", "source_files", "=", "1", "self", ".", "make_files", "=", "1", "else", ":", "self", ".", "source_files", "=", "0", "self", ".", "make_fil...
https://github.com/facebookincubator/mvfst/blob/034a40c797485113d00127852d4df3c5bb44b3ed/build/fbcode_builder/getdeps/fetcher.py#L53-L62
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/init_ops_v2.py
python
VarianceScaling.__call__
(self, shape, dtype=dtypes.float32)
Returns a tensor object initialized as specified by the initializer. Args: shape: Shape of the tensor. dtype: Optional dtype of the tensor. Only floating point types are supported. Raises: ValueError: If the dtype is not floating point
Returns a tensor object initialized as specified by the initializer.
[ "Returns", "a", "tensor", "object", "initialized", "as", "specified", "by", "the", "initializer", "." ]
def __call__(self, shape, dtype=dtypes.float32): """Returns a tensor object initialized as specified by the initializer. Args: shape: Shape of the tensor. dtype: Optional dtype of the tensor. Only floating point types are supported. Raises: ValueError: If the dtype is not floating...
[ "def", "__call__", "(", "self", ",", "shape", ",", "dtype", "=", "dtypes", ".", "float32", ")", ":", "partition_info", "=", "None", "# Keeps logic so can be readded later if necessary", "dtype", "=", "_assert_float_dtype", "(", "dtype", ")", "scale", "=", "self", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/init_ops_v2.py#L404-L437
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/dataview.py
python
DataViewListCtrl.GetToggleValue
(*args, **kwargs)
return _dataview.DataViewListCtrl_GetToggleValue(*args, **kwargs)
GetToggleValue(self, unsigned int row, unsigned int col) -> bool
GetToggleValue(self, unsigned int row, unsigned int col) -> bool
[ "GetToggleValue", "(", "self", "unsigned", "int", "row", "unsigned", "int", "col", ")", "-", ">", "bool" ]
def GetToggleValue(*args, **kwargs): """GetToggleValue(self, unsigned int row, unsigned int col) -> bool""" return _dataview.DataViewListCtrl_GetToggleValue(*args, **kwargs)
[ "def", "GetToggleValue", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewListCtrl_GetToggleValue", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/dataview.py#L2197-L2199