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
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/dynOptionMenuWidget.py
python
DynOptionMenu.SetMenu
(self,valueList,value=None)
clear and reload the menu with a new set of options. valueList - list of new options value - initial value to set the optionmenu's menubutton to
clear and reload the menu with a new set of options. valueList - list of new options value - initial value to set the optionmenu's menubutton to
[ "clear", "and", "reload", "the", "menu", "with", "a", "new", "set", "of", "options", ".", "valueList", "-", "list", "of", "new", "options", "value", "-", "initial", "value", "to", "set", "the", "optionmenu", "s", "menubutton", "to" ]
def SetMenu(self,valueList,value=None): """ clear and reload the menu with a new set of options. valueList - list of new options value - initial value to set the optionmenu's menubutton to """ self['menu'].delete(0,'end') for item in valueList: self['m...
[ "def", "SetMenu", "(", "self", ",", "valueList", ",", "value", "=", "None", ")", ":", "self", "[", "'menu'", "]", ".", "delete", "(", "0", ",", "'end'", ")", "for", "item", "in", "valueList", ":", "self", "[", "'menu'", "]", ".", "add_command", "("...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/dynOptionMenuWidget.py#L24-L35
plumonito/dtslam
5994bb9cf7a11981b830370db206bceb654c085d
3rdparty/opencv-git/3rdparty/jinja2/nodes.py
python
Node.set_ctx
(self, ctx)
return self
Reset the context of a node and all child nodes. Per default the parser will all generate nodes that have a 'load' context as it's the most common one. This method is used in the parser to set assignment targets and other nodes to a store context.
Reset the context of a node and all child nodes. Per default the parser will all generate nodes that have a 'load' context as it's the most common one. This method is used in the parser to set assignment targets and other nodes to a store context.
[ "Reset", "the", "context", "of", "a", "node", "and", "all", "child", "nodes", ".", "Per", "default", "the", "parser", "will", "all", "generate", "nodes", "that", "have", "a", "load", "context", "as", "it", "s", "the", "most", "common", "one", ".", "Thi...
def set_ctx(self, ctx): """Reset the context of a node and all child nodes. Per default the parser will all generate nodes that have a 'load' context as it's the most common one. This method is used in the parser to set assignment targets and other nodes to a store context. """...
[ "def", "set_ctx", "(", "self", ",", "ctx", ")", ":", "todo", "=", "deque", "(", "[", "self", "]", ")", "while", "todo", ":", "node", "=", "todo", ".", "popleft", "(", ")", "if", "'ctx'", "in", "node", ".", "fields", ":", "node", ".", "ctx", "="...
https://github.com/plumonito/dtslam/blob/5994bb9cf7a11981b830370db206bceb654c085d/3rdparty/opencv-git/3rdparty/jinja2/nodes.py#L194-L206
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
xpathContext.xpathContextSetCache
(self, active, value, options)
return ret
Creates/frees an object cache on the XPath context. If activates XPath objects (xmlXPathObject) will be cached internally to be reused. @options: 0: This will set the XPath object caching: @value: This will set the maximum number of XPath objects to be cached per slot There are 5...
Creates/frees an object cache on the XPath context. If activates XPath objects (xmlXPathObject) will be cached internally to be reused.
[ "Creates", "/", "frees", "an", "object", "cache", "on", "the", "XPath", "context", ".", "If", "activates", "XPath", "objects", "(", "xmlXPathObject", ")", "will", "be", "cached", "internally", "to", "be", "reused", "." ]
def xpathContextSetCache(self, active, value, options): """Creates/frees an object cache on the XPath context. If activates XPath objects (xmlXPathObject) will be cached internally to be reused. @options: 0: This will set the XPath object caching: @value: This will set the maximum ...
[ "def", "xpathContextSetCache", "(", "self", ",", "active", ",", "value", ",", "options", ")", ":", "ret", "=", "libxml2mod", ".", "xmlXPathContextSetCache", "(", "self", ".", "_o", ",", "active", ",", "value", ",", "options", ")", "return", "ret" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L7325-L7335
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/showbase/ShowBase.py
python
ShowBase.openMainWindow
(self, *args, **kw)
return success
Creates the initial, main window for the application, and sets up the mouse and render2d structures appropriately for it. If this method is called a second time, it will close the previous main window and open a new one, preserving the lens properties in base.camLens. :returns:...
Creates the initial, main window for the application, and sets up the mouse and render2d structures appropriately for it. If this method is called a second time, it will close the previous main window and open a new one, preserving the lens properties in base.camLens.
[ "Creates", "the", "initial", "main", "window", "for", "the", "application", "and", "sets", "up", "the", "mouse", "and", "render2d", "structures", "appropriately", "for", "it", ".", "If", "this", "method", "is", "called", "a", "second", "time", "it", "will", ...
def openMainWindow(self, *args, **kw): """ Creates the initial, main window for the application, and sets up the mouse and render2d structures appropriately for it. If this method is called a second time, it will close the previous main window and open a new one, preserving the ...
[ "def", "openMainWindow", "(", "self", ",", "*", "args", ",", "*", "*", "kw", ")", ":", "keepCamera", "=", "kw", ".", "get", "(", "'keepCamera'", ",", "False", ")", "success", "=", "1", "oldWin", "=", "self", ".", "win", "oldLens", "=", "self", ".",...
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/showbase/ShowBase.py#L1030-L1090
lawy623/SVS
b7c7ae367c82a4797ff4a896a2ff304f02e7f724
caffe/scripts/cpp_lint.py
python
_SetVerboseLevel
(level)
return _cpplint_state.SetVerboseLevel(level)
Sets the module's verbosity, and returns the previous setting.
Sets the module's verbosity, and returns the previous setting.
[ "Sets", "the", "module", "s", "verbosity", "and", "returns", "the", "previous", "setting", "." ]
def _SetVerboseLevel(level): """Sets the module's verbosity, and returns the previous setting.""" return _cpplint_state.SetVerboseLevel(level)
[ "def", "_SetVerboseLevel", "(", "level", ")", ":", "return", "_cpplint_state", ".", "SetVerboseLevel", "(", "level", ")" ]
https://github.com/lawy623/SVS/blob/b7c7ae367c82a4797ff4a896a2ff304f02e7f724/caffe/scripts/cpp_lint.py#L782-L784
gnina/gnina
b9ae032f52fc7a8153987bde09c0efa3620d8bb6
caffe/python/caffe/pycaffe.py
python
_Net_forward
(self, blobs=None, start=None, end=None, **kwargs)
return {out: self.blobs[out].data for out in outputs}
Forward pass: prepare inputs and run the net forward. Parameters ---------- blobs : list of blobs to return in addition to output blobs. kwargs : Keys are input blob names and values are blob ndarrays. For formatting inputs for Caffe, see Net.preprocess(). If None, input is ta...
Forward pass: prepare inputs and run the net forward.
[ "Forward", "pass", ":", "prepare", "inputs", "and", "run", "the", "net", "forward", "." ]
def _Net_forward(self, blobs=None, start=None, end=None, **kwargs): """ Forward pass: prepare inputs and run the net forward. Parameters ---------- blobs : list of blobs to return in addition to output blobs. kwargs : Keys are input blob names and values are blob ndarrays. For form...
[ "def", "_Net_forward", "(", "self", ",", "blobs", "=", "None", ",", "start", "=", "None", ",", "end", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "blobs", "is", "None", ":", "blobs", "=", "[", "]", "if", "start", "is", "not", "None", ...
https://github.com/gnina/gnina/blob/b9ae032f52fc7a8153987bde09c0efa3620d8bb6/caffe/python/caffe/pycaffe.py#L88-L134
hfinkel/llvm-project-cxxjit
91084ef018240bbb8e24235ff5cd8c355a9c1a1e
clang/bindings/python/clang/cindex.py
python
TranslationUnit.from_ast_file
(cls, filename, index=None)
return cls(ptr=ptr, index=index)
Create a TranslationUnit instance from a saved AST file. A previously-saved AST file (provided with -emit-ast or TranslationUnit.save()) is loaded from the filename specified. If the file cannot be loaded, a TranslationUnitLoadError will be raised. index is optional and is the...
Create a TranslationUnit instance from a saved AST file.
[ "Create", "a", "TranslationUnit", "instance", "from", "a", "saved", "AST", "file", "." ]
def from_ast_file(cls, filename, index=None): """Create a TranslationUnit instance from a saved AST file. A previously-saved AST file (provided with -emit-ast or TranslationUnit.save()) is loaded from the filename specified. If the file cannot be loaded, a TranslationUnitLoadError will...
[ "def", "from_ast_file", "(", "cls", ",", "filename", ",", "index", "=", "None", ")", ":", "if", "index", "is", "None", ":", "index", "=", "Index", ".", "create", "(", ")", "ptr", "=", "conf", ".", "lib", ".", "clang_createTranslationUnit", "(", "index"...
https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/clang/bindings/python/clang/cindex.py#L2835-L2856
eldar/deepcut-cnn
928bf2f224fce132f6e4404b4c95fb017297a5e0
scripts/cpp_lint.py
python
FileInfo.BaseName
(self)
return self.Split()[1]
File base name - text after the final slash, before the final period.
File base name - text after the final slash, before the final period.
[ "File", "base", "name", "-", "text", "after", "the", "final", "slash", "before", "the", "final", "period", "." ]
def BaseName(self): """File base name - text after the final slash, before the final period.""" return self.Split()[1]
[ "def", "BaseName", "(", "self", ")", ":", "return", "self", ".", "Split", "(", ")", "[", "1", "]" ]
https://github.com/eldar/deepcut-cnn/blob/928bf2f224fce132f6e4404b4c95fb017297a5e0/scripts/cpp_lint.py#L944-L946
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/winpython/py3compat.py
python
get_meth_class
(obj)
Return method class
Return method class
[ "Return", "method", "class" ]
def get_meth_class(obj): """Return method class""" if PY2: # Python 2 return obj.im_class else: # Python 3 return obj.__self__.__class__
[ "def", "get_meth_class", "(", "obj", ")", ":", "if", "PY2", ":", "# Python 2", "return", "obj", ".", "im_class", "else", ":", "# Python 3", "return", "obj", ".", "__self__", ".", "__class__" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/winpython/py3compat.py#L196-L203
Tencent/TNN
7acca99f54c55747b415a4c57677403eebc7b706
third_party/flatbuffers/python/flatbuffers/builder.py
python
Builder.StartVector
(self, elemSize, numElems, alignment)
return self.Offset()
StartVector initializes bookkeeping for writing a new vector. A vector has the following format: - <UOffsetT: number of elements in this vector> - <T: data>+, where T is the type of elements of this vector.
StartVector initializes bookkeeping for writing a new vector.
[ "StartVector", "initializes", "bookkeeping", "for", "writing", "a", "new", "vector", "." ]
def StartVector(self, elemSize, numElems, alignment): """ StartVector initializes bookkeeping for writing a new vector. A vector has the following format: - <UOffsetT: number of elements in this vector> - <T: data>+, where T is the type of elements of this vector. ""...
[ "def", "StartVector", "(", "self", ",", "elemSize", ",", "numElems", ",", "alignment", ")", ":", "self", ".", "assertNotNested", "(", ")", "self", ".", "nested", "=", "True", "self", ".", "vectorNumElems", "=", "numElems", "self", ".", "Prep", "(", "N", ...
https://github.com/Tencent/TNN/blob/7acca99f54c55747b415a4c57677403eebc7b706/third_party/flatbuffers/python/flatbuffers/builder.py#L363-L377
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
contrib/gizmos/osx_cocoa/gizmos.py
python
TreeListCtrl.Create
(*args, **kwargs)
return _gizmos.TreeListCtrl_Create(*args, **kwargs)
Create(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=TR_DEFAULT_STYLE, Validator validator=DefaultValidator, String name=TreeListCtrlNameStr) -> bool Do the 2nd phase and create the GUI control.
Create(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=TR_DEFAULT_STYLE, Validator validator=DefaultValidator, String name=TreeListCtrlNameStr) -> bool
[ "Create", "(", "self", "Window", "parent", "int", "id", "=", "-", "1", "Point", "pos", "=", "DefaultPosition", "Size", "size", "=", "DefaultSize", "long", "style", "=", "TR_DEFAULT_STYLE", "Validator", "validator", "=", "DefaultValidator", "String", "name", "=...
def Create(*args, **kwargs): """ Create(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=TR_DEFAULT_STYLE, Validator validator=DefaultValidator, String name=TreeListCtrlNameStr) -> bool Do the 2nd phase and creat...
[ "def", "Create", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gizmos", ".", "TreeListCtrl_Create", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/osx_cocoa/gizmos.py#L484-L493
wujian16/Cornell-MOE
df299d1be882d2af9796d7a68b3f9505cac7a53e
moe/optimal_learning/python/data_containers.py
python
HistoricalData.append_historical_data
(self, points_sampled, points_sampled_value, points_sampled_noise_variance, validate=False)
Append lists of points_sampled, their values, and their noise variances to the data members of this class. This class (see class docstring) stores its data members as numpy arrays; this method provides a way for users who already have data in this format to append directly instead of creating an interm...
Append lists of points_sampled, their values, and their noise variances to the data members of this class.
[ "Append", "lists", "of", "points_sampled", "their", "values", "and", "their", "noise", "variances", "to", "the", "data", "members", "of", "this", "class", "." ]
def append_historical_data(self, points_sampled, points_sampled_value, points_sampled_noise_variance, validate=False): """Append lists of points_sampled, their values, and their noise variances to the data members of this class. This class (see class docstring) stores its data members as numpy arrays; ...
[ "def", "append_historical_data", "(", "self", ",", "points_sampled", ",", "points_sampled_value", ",", "points_sampled_noise_variance", ",", "validate", "=", "False", ")", ":", "if", "points_sampled", ".", "size", "==", "0", ":", "return", "if", "validate", ":", ...
https://github.com/wujian16/Cornell-MOE/blob/df299d1be882d2af9796d7a68b3f9505cac7a53e/moe/optimal_learning/python/data_containers.py#L232-L256
qgis/QGIS
15a77662d4bb712184f6aa60d0bd663010a76a75
python/plugins/grassprovider/Grass7Algorithm.py
python
Grass7Algorithm.loadAttributeTable
(self, name, layer, destName=None)
Creates a dedicated command to load an attribute table into the temporary GRASS DB. :param name: name of the input parameter. :param layer: a layer object to import from. :param destName: force the name for the table into GRASS DB.
Creates a dedicated command to load an attribute table into the temporary GRASS DB. :param name: name of the input parameter. :param layer: a layer object to import from. :param destName: force the name for the table into GRASS DB.
[ "Creates", "a", "dedicated", "command", "to", "load", "an", "attribute", "table", "into", "the", "temporary", "GRASS", "DB", ".", ":", "param", "name", ":", "name", "of", "the", "input", "parameter", ".", ":", "param", "layer", ":", "a", "layer", "object...
def loadAttributeTable(self, name, layer, destName=None): """ Creates a dedicated command to load an attribute table into the temporary GRASS DB. :param name: name of the input parameter. :param layer: a layer object to import from. :param destName: force the name for the...
[ "def", "loadAttributeTable", "(", "self", ",", "name", ",", "layer", ",", "destName", "=", "None", ")", ":", "self", ".", "inputLayers", ".", "append", "(", "layer", ")", "if", "not", "destName", ":", "destName", "=", "'table_{}'", ".", "format", "(", ...
https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/grassprovider/Grass7Algorithm.py#L992-L1006
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/propgrid.py
python
PGProperty.GetAttributesAsList
(*args, **kwargs)
return _propgrid.PGProperty_GetAttributesAsList(*args, **kwargs)
GetAttributesAsList(self) -> wxVariant
GetAttributesAsList(self) -> wxVariant
[ "GetAttributesAsList", "(", "self", ")", "-", ">", "wxVariant" ]
def GetAttributesAsList(*args, **kwargs): """GetAttributesAsList(self) -> wxVariant""" return _propgrid.PGProperty_GetAttributesAsList(*args, **kwargs)
[ "def", "GetAttributesAsList", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGProperty_GetAttributesAsList", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L548-L550
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/metrics/python/ops/metric_ops.py
python
streaming_concat
(values, axis=0, max_size=None, metrics_collections=None, updates_collections=None, name=None)
Concatenate values along an axis across batches. The function `streaming_concat` creates two local variables, `array` and `size`, that are used to store concatenated values. Internally, `array` is used as storage for a dynamic array (if `maxsize` is `None`), which ensures that updates can be run in amortized c...
Concatenate values along an axis across batches.
[ "Concatenate", "values", "along", "an", "axis", "across", "batches", "." ]
def streaming_concat(values, axis=0, max_size=None, metrics_collections=None, updates_collections=None, name=None): """Concatenate values along an axis across batches. The function `streaming_concat` creates tw...
[ "def", "streaming_concat", "(", "values", ",", "axis", "=", "0", ",", "max_size", "=", "None", ",", "metrics_collections", "=", "None", ",", "updates_collections", "=", "None", ",", "name", "=", "None", ")", ":", "with", "variable_scope", ".", "variable_scop...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/metrics/python/ops/metric_ops.py#L2265-L2374
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
URI.user
(self)
return ret
Get the user part from an URI
Get the user part from an URI
[ "Get", "the", "user", "part", "from", "an", "URI" ]
def user(self): """Get the user part from an URI """ ret = libxml2mod.xmlURIGetUser(self._o) return ret
[ "def", "user", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlURIGetUser", "(", "self", ".", "_o", ")", "return", "ret" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L7055-L7058
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
utils/cpplint.py
python
_CppLintState.SetFilters
(self, filters)
Sets the error-message filters. These filters are applied when deciding whether to emit a given error message. Args: filters: A string of comma-separated filters (eg "+whitespace/indent"). Each filter should start with + or -; else we die. Raises: ValueError: The comma-sepa...
Sets the error-message filters.
[ "Sets", "the", "error", "-", "message", "filters", "." ]
def SetFilters(self, filters): """Sets the error-message filters. These filters are applied when deciding whether to emit a given error message. Args: filters: A string of comma-separated filters (eg "+whitespace/indent"). Each filter should start with + or -; else we die. Ra...
[ "def", "SetFilters", "(", "self", ",", "filters", ")", ":", "# Default filters always have less priority than the flag ones.", "self", ".", "filters", "=", "_DEFAULT_FILTERS", "[", ":", "]", "self", ".", "AddFilters", "(", "filters", ")" ]
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/utils/cpplint.py#L789-L805
cvxpy/cvxpy
5165b4fb750dfd237de8659383ef24b4b2e33aaf
cvxpy/cvxcore/python/canonInterface.py
python
set_matrix_data
(linC, linPy)
Calls the appropriate cvxcore function to set the matrix data field of our C++ linOp.
Calls the appropriate cvxcore function to set the matrix data field of our C++ linOp.
[ "Calls", "the", "appropriate", "cvxcore", "function", "to", "set", "the", "matrix", "data", "field", "of", "our", "C", "++", "linOp", "." ]
def set_matrix_data(linC, linPy) -> None: """Calls the appropriate cvxcore function to set the matrix data field of our C++ linOp. """ if get_type(linPy) == cvxcore.SPARSE_CONST: coo = format_matrix(linPy.data, format='sparse') linC.set_sparse_data(coo.data, coo.row.astype(float), ...
[ "def", "set_matrix_data", "(", "linC", ",", "linPy", ")", "->", "None", ":", "if", "get_type", "(", "linPy", ")", "==", "cvxcore", ".", "SPARSE_CONST", ":", "coo", "=", "format_matrix", "(", "linPy", ".", "data", ",", "format", "=", "'sparse'", ")", "l...
https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/cvxcore/python/canonInterface.py#L416-L427
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/idlelib/run.py
python
MyHandler.exithook
(self)
override SocketIO method - wait for MainThread to shut us down
override SocketIO method - wait for MainThread to shut us down
[ "override", "SocketIO", "method", "-", "wait", "for", "MainThread", "to", "shut", "us", "down" ]
def exithook(self): "override SocketIO method - wait for MainThread to shut us down" time.sleep(10)
[ "def", "exithook", "(", "self", ")", ":", "time", ".", "sleep", "(", "10", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/idlelib/run.py#L308-L310
MegEngine/MegEngine
ce9ad07a27ec909fb8db4dd67943d24ba98fb93a
imperative/python/megengine/traced_module/traced_module.py
python
TracedModule.graph
(self)
return list(self.argdef_graph_map.values())[0]
Return the ``InternalGraph`` of this ``TracedModule``.
Return the ``InternalGraph`` of this ``TracedModule``.
[ "Return", "the", "InternalGraph", "of", "this", "TracedModule", "." ]
def graph(self) -> InternalGraph: """Return the ``InternalGraph`` of this ``TracedModule``. """ assert len(self.argdef_graph_map) == 1 return list(self.argdef_graph_map.values())[0]
[ "def", "graph", "(", "self", ")", "->", "InternalGraph", ":", "assert", "len", "(", "self", ".", "argdef_graph_map", ")", "==", "1", "return", "list", "(", "self", ".", "argdef_graph_map", ".", "values", "(", ")", ")", "[", "0", "]" ]
https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/traced_module/traced_module.py#L2109-L2113
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py
python
Canvas.move
(self, *args)
Move an item TAGORID given in ARGS.
Move an item TAGORID given in ARGS.
[ "Move", "an", "item", "TAGORID", "given", "in", "ARGS", "." ]
def move(self, *args): """Move an item TAGORID given in ARGS.""" self.tk.call((self._w, 'move') + args)
[ "def", "move", "(", "self", ",", "*", "args", ")", ":", "self", ".", "tk", ".", "call", "(", "(", "self", ".", "_w", ",", "'move'", ")", "+", "args", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L2360-L2362
google/skia
82d65d0487bd72f5f7332d002429ec2dc61d2463
infra/bots/git_utils.py
python
NewGitCheckout.root
(self)
return self.name
Returns the root directory containing the checked-out files.
Returns the root directory containing the checked-out files.
[ "Returns", "the", "root", "directory", "containing", "the", "checked", "-", "out", "files", "." ]
def root(self): """Returns the root directory containing the checked-out files.""" return self.name
[ "def", "root", "(", "self", ")", ":", "return", "self", ".", "name" ]
https://github.com/google/skia/blob/82d65d0487bd72f5f7332d002429ec2dc61d2463/infra/bots/git_utils.py#L138-L140
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
recoverMemory
(buffer, size)
return xmlDoc(_obj=ret)
parse an XML in-memory block and build a tree. In the case the document is not Well Formed, an attempt to build a tree is tried anyway
parse an XML in-memory block and build a tree. In the case the document is not Well Formed, an attempt to build a tree is tried anyway
[ "parse", "an", "XML", "in", "-", "memory", "block", "and", "build", "a", "tree", ".", "In", "the", "case", "the", "document", "is", "not", "Well", "Formed", "an", "attempt", "to", "build", "a", "tree", "is", "tried", "anyway" ]
def recoverMemory(buffer, size): """parse an XML in-memory block and build a tree. In the case the document is not Well Formed, an attempt to build a tree is tried anyway """ ret = libxml2mod.xmlRecoverMemory(buffer, size) if ret is None:raise treeError('xmlRecoverMemory() failed') return x...
[ "def", "recoverMemory", "(", "buffer", ",", "size", ")", ":", "ret", "=", "libxml2mod", ".", "xmlRecoverMemory", "(", "buffer", ",", "size", ")", "if", "ret", "is", "None", ":", "raise", "treeError", "(", "'xmlRecoverMemory() failed'", ")", "return", "xmlDoc...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L613-L619
Sigil-Ebook/Sigil
0d145d3a4874b4a26f7aabd68dbd9d18a2402e52
src/Resource_Files/plugin_launchers/python/sigil_bs4/element.py
python
PageElement.find_all_next
(self, name=None, attrs=OrderedDict(), text=None, limit=None, **kwargs)
return self._find_all(name, attrs, text, limit, self.next_elements, **kwargs)
Returns all items that match the given criteria and appear after this Tag in the document.
Returns all items that match the given criteria and appear after this Tag in the document.
[ "Returns", "all", "items", "that", "match", "the", "given", "criteria", "and", "appear", "after", "this", "Tag", "in", "the", "document", "." ]
def find_all_next(self, name=None, attrs=OrderedDict(), text=None, limit=None, **kwargs): """Returns all items that match the given criteria and appear after this Tag in the document.""" return self._find_all(name, attrs, text, limit, self.next_elements, ...
[ "def", "find_all_next", "(", "self", ",", "name", "=", "None", ",", "attrs", "=", "OrderedDict", "(", ")", ",", "text", "=", "None", ",", "limit", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "_find_all", "(", "name", ",",...
https://github.com/Sigil-Ebook/Sigil/blob/0d145d3a4874b4a26f7aabd68dbd9d18a2402e52/src/Resource_Files/plugin_launchers/python/sigil_bs4/element.py#L441-L446
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/src/robotsim.py
python
IKObjective.copy
(self)
return _robotsim.IKObjective_copy(self)
r""" copy(IKObjective self) -> IKObjective Copy constructor.
r""" copy(IKObjective self) -> IKObjective
[ "r", "copy", "(", "IKObjective", "self", ")", "-", ">", "IKObjective" ]
def copy(self) -> "IKObjective": r""" copy(IKObjective self) -> IKObjective Copy constructor. """ return _robotsim.IKObjective_copy(self)
[ "def", "copy", "(", "self", ")", "->", "\"IKObjective\"", ":", "return", "_robotsim", ".", "IKObjective_copy", "(", "self", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L6286-L6294
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/config.py
python
ConfigHandler._exclude_files_parser
(cls, key)
return parser
Returns a parser function to make sure field inputs are not files. Parses a value after getting the key so error messages are more informative. :param key: :rtype: callable
Returns a parser function to make sure field inputs are not files.
[ "Returns", "a", "parser", "function", "to", "make", "sure", "field", "inputs", "are", "not", "files", "." ]
def _exclude_files_parser(cls, key): """Returns a parser function to make sure field inputs are not files. Parses a value after getting the key so error messages are more informative. :param key: :rtype: callable """ def parser(value): exclud...
[ "def", "_exclude_files_parser", "(", "cls", ",", "key", ")", ":", "def", "parser", "(", "value", ")", ":", "exclude_directive", "=", "'file:'", "if", "value", ".", "startswith", "(", "exclude_directive", ")", ":", "raise", "ValueError", "(", "'Only strings are...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/config.py#L291-L308
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
GridBagSizer.SetItemSpan
(*args)
return _core_.GridBagSizer_SetItemSpan(*args)
SetItemSpan(self, item, GBSpan span) -> bool Set the row/col spanning of the specified *item* where *item* is either a window or subsizer that is a member of this sizer, or a zero-based index of an item. Returns True on success. If the move is not allowed (because an item is already t...
SetItemSpan(self, item, GBSpan span) -> bool
[ "SetItemSpan", "(", "self", "item", "GBSpan", "span", ")", "-", ">", "bool" ]
def SetItemSpan(*args): """ SetItemSpan(self, item, GBSpan span) -> bool Set the row/col spanning of the specified *item* where *item* is either a window or subsizer that is a member of this sizer, or a zero-based index of an item. Returns True on success. If the move is ...
[ "def", "SetItemSpan", "(", "*", "args", ")", ":", "return", "_core_", ".", "GridBagSizer_SetItemSpan", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L16008-L16017
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/requests/utils.py
python
extract_zipped_paths
(path)
return extracted_path
Replace nonexistent paths that look like they refer to a member of a zip archive with the location of an extracted copy of the target, or else just return the provided path unchanged.
Replace nonexistent paths that look like they refer to a member of a zip archive with the location of an extracted copy of the target, or else just return the provided path unchanged.
[ "Replace", "nonexistent", "paths", "that", "look", "like", "they", "refer", "to", "a", "member", "of", "a", "zip", "archive", "with", "the", "location", "of", "an", "extracted", "copy", "of", "the", "target", "or", "else", "just", "return", "the", "provide...
def extract_zipped_paths(path): """Replace nonexistent paths that look like they refer to a member of a zip archive with the location of an extracted copy of the target, or else just return the provided path unchanged. """ if os.path.exists(path): # this is already a valid path, no need to d...
[ "def", "extract_zipped_paths", "(", "path", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "path", ")", ":", "# this is already a valid path, no need to do anything further", "return", "path", "# find the first valid part of the provided path and treat that as a zip arc...
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/requests/utils.py#L227-L256
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/utils.py
python
unquote_unreserved
(uri)
return ''.join(parts)
Un-escape any percent-escape sequences in a URI that are unreserved characters. This leaves all reserved, illegal and non-ASCII bytes encoded.
Un-escape any percent-escape sequences in a URI that are unreserved characters. This leaves all reserved, illegal and non-ASCII bytes encoded.
[ "Un", "-", "escape", "any", "percent", "-", "escape", "sequences", "in", "a", "URI", "that", "are", "unreserved", "characters", ".", "This", "leaves", "all", "reserved", "illegal", "and", "non", "-", "ASCII", "bytes", "encoded", "." ]
def unquote_unreserved(uri): """Un-escape any percent-escape sequences in a URI that are unreserved characters. This leaves all reserved, illegal and non-ASCII bytes encoded. """ parts = uri.split('%') for i in range(1, len(parts)): h = parts[i][0:2] if len(h) == 2 and h.isalnum(): ...
[ "def", "unquote_unreserved", "(", "uri", ")", ":", "parts", "=", "uri", ".", "split", "(", "'%'", ")", "for", "i", "in", "range", "(", "1", ",", "len", "(", "parts", ")", ")", ":", "h", "=", "parts", "[", "i", "]", "[", "0", ":", "2", "]", ...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/utils.py#L395-L414
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/cgitb.py
python
reset
()
return '''<!--: spam Content-Type: text/html <body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> --> <body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> --> --> </font> </font> </font> </script> </object> </blockquote> </pre> </table> </table> </table> </table> </table> </font> </font> </font>'''
Return a string that resets the CGI and browser to a known state.
Return a string that resets the CGI and browser to a known state.
[ "Return", "a", "string", "that", "resets", "the", "CGI", "and", "browser", "to", "a", "known", "state", "." ]
def reset(): """Return a string that resets the CGI and browser to a known state.""" return '''<!--: spam Content-Type: text/html <body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> --> <body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> --> --> </font> </font> </font> </script> </object> </blockquot...
[ "def", "reset", "(", ")", ":", "return", "'''<!--: spam\nContent-Type: text/html\n\n<body bgcolor=\"#f0f0f8\"><font color=\"#f0f0f8\" size=\"-5\"> -->\n<body bgcolor=\"#f0f0f8\"><font color=\"#f0f0f8\" size=\"-5\"> --> -->\n</font> </font> </font> </script> </object> </blockquote> </pre>\n</table> </tab...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/cgitb.py#L35-L43
xhzdeng/crpn
a5aef0f80dbe486103123f740c634fb01e6cc9a1
caffe-fast-rcnn/python/caffe/io.py
python
Transformer.deprocess
(self, in_, data)
return decaf_in
Invert Caffe formatting; see preprocess().
Invert Caffe formatting; see preprocess().
[ "Invert", "Caffe", "formatting", ";", "see", "preprocess", "()", "." ]
def deprocess(self, in_, data): """ Invert Caffe formatting; see preprocess(). """ self.__check_input(in_) decaf_in = data.copy().squeeze() transpose = self.transpose.get(in_) channel_swap = self.channel_swap.get(in_) raw_scale = self.raw_scale.get(in_) ...
[ "def", "deprocess", "(", "self", ",", "in_", ",", "data", ")", ":", "self", ".", "__check_input", "(", "in_", ")", "decaf_in", "=", "data", ".", "copy", "(", ")", ".", "squeeze", "(", ")", "transpose", "=", "self", ".", "transpose", ".", "get", "("...
https://github.com/xhzdeng/crpn/blob/a5aef0f80dbe486103123f740c634fb01e6cc9a1/caffe-fast-rcnn/python/caffe/io.py#L164-L185
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/special_math_ops.py
python
bessel_i1e
(x, name=None)
Computes the Bessel i1e function of `x` element-wise. Modified Bessel function of order 1. >>> tf.math.special.bessel_i1e([-1., -0.5, 0.5, 1.]).numpy() array([-0.20791042, -0.15642083, 0.15642083, 0.20791042], dtype=float32) Args: x: A `Tensor` or `SparseTensor`. Must be one of the following types: `ha...
Computes the Bessel i1e function of `x` element-wise.
[ "Computes", "the", "Bessel", "i1e", "function", "of", "x", "element", "-", "wise", "." ]
def bessel_i1e(x, name=None): """Computes the Bessel i1e function of `x` element-wise. Modified Bessel function of order 1. >>> tf.math.special.bessel_i1e([-1., -0.5, 0.5, 1.]).numpy() array([-0.20791042, -0.15642083, 0.15642083, 0.20791042], dtype=float32) Args: x: A `Tensor` or `SparseTensor`. Must...
[ "def", "bessel_i1e", "(", "x", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "'bessel_i1e'", ",", "[", "x", "]", ")", ":", "return", "gen_special_math_ops", ".", "bessel_i1e", "(", "x", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/special_math_ops.py#L340-L361
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
contrib/src/sceneeditor/seTree.py
python
TreeItem.OnSelect
(self)
Called when item selected.
Called when item selected.
[ "Called", "when", "item", "selected", "." ]
def OnSelect(self): """Called when item selected."""
[ "def", "OnSelect", "(", "self", ")", ":" ]
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/contrib/src/sceneeditor/seTree.py#L413-L414
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/PelicanReduction.py
python
PelicanReduction._get_minimum_tof
(self)
return min_tof * 1e6
Converts the maximum energy transfer to neutron to an equivalent minimum tof. The distance from the sample to the detector is 2.4m (fixed) and source to sample is 0.695m. The result is the minimum tof from source to detector and the result is returned in microseconds.
Converts the maximum energy transfer to neutron to an equivalent minimum tof. The distance from the sample to the detector is 2.4m (fixed) and source to sample is 0.695m. The result is the minimum tof from source to detector and the result is returned in microseconds.
[ "Converts", "the", "maximum", "energy", "transfer", "to", "neutron", "to", "an", "equivalent", "minimum", "tof", ".", "The", "distance", "from", "the", "sample", "to", "the", "detector", "is", "2", ".", "4m", "(", "fixed", ")", "and", "source", "to", "sa...
def _get_minimum_tof(self): ''' Converts the maximum energy transfer to neutron to an equivalent minimum tof. The distance from the sample to the detector is 2.4m (fixed) and source to sample is 0.695m. The result is the minimum tof from source to detector and the result is retur...
[ "def", "_get_minimum_tof", "(", "self", ")", ":", "nom_velocity", "=", "437.4", "*", "math", ".", "sqrt", "(", "self", ".", "_efixed", ")", "max_meV", "=", "self", ".", "_efixed", "+", "self", ".", "_max_energy_gain", "max_velocity", "=", "437.4", "*", "...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/PelicanReduction.py#L679-L690
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/ensemble/gradient_boosting.py
python
BaseGradientBoosting._clear_state
(self)
Clear the state of the gradient boosting model.
Clear the state of the gradient boosting model.
[ "Clear", "the", "state", "of", "the", "gradient", "boosting", "model", "." ]
def _clear_state(self): """Clear the state of the gradient boosting model. """ if hasattr(self, 'estimators_'): self.estimators_ = np.empty((0, 0), dtype=np.object) if hasattr(self, 'train_score_'): del self.train_score_ if hasattr(self, 'oob_improvement_'): ...
[ "def", "_clear_state", "(", "self", ")", ":", "if", "hasattr", "(", "self", ",", "'estimators_'", ")", ":", "self", ".", "estimators_", "=", "np", ".", "empty", "(", "(", "0", ",", "0", ")", ",", "dtype", "=", "np", ".", "object", ")", "if", "has...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/ensemble/gradient_boosting.py#L895-L904
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/framework/dtypes.py
python
DType.is_compatible_with
(self, other)
return self._type_enum in ( other.as_datatype_enum, other.base_dtype.as_datatype_enum)
Returns True if the `other` DType will be converted to this DType. The conversion rules are as follows: ``` DType(T) .is_compatible_with(DType(T)) == True DType(T) .is_compatible_with(DType(T).as_ref) == True DType(T).as_ref.is_compatible_with(DType(T)) == False DType...
Returns True if the `other` DType will be converted to this DType.
[ "Returns", "True", "if", "the", "other", "DType", "will", "be", "converted", "to", "this", "DType", "." ]
def is_compatible_with(self, other): """Returns True if the `other` DType will be converted to this DType. The conversion rules are as follows: ``` DType(T) .is_compatible_with(DType(T)) == True DType(T) .is_compatible_with(DType(T).as_ref) == True DType(T).as_ref.is_compati...
[ "def", "is_compatible_with", "(", "self", ",", "other", ")", ":", "other", "=", "as_dtype", "(", "other", ")", "return", "self", ".", "_type_enum", "in", "(", "other", ".", "as_datatype_enum", ",", "other", ".", "base_dtype", ".", "as_datatype_enum", ")" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/framework/dtypes.py#L218-L239
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/traceback.py
python
extract_tb
(tb, limit=None)
return StackSummary.extract(walk_tb(tb), limit=limit)
Return a StackSummary object representing a list of pre-processed entries from traceback. This is useful for alternate formatting of stack traces. If 'limit' is omitted or None, all entries are extracted. A pre-processed stack trace entry is a FrameSummary object containing attributes filename, l...
Return a StackSummary object representing a list of pre-processed entries from traceback.
[ "Return", "a", "StackSummary", "object", "representing", "a", "list", "of", "pre", "-", "processed", "entries", "from", "traceback", "." ]
def extract_tb(tb, limit=None): """ Return a StackSummary object representing a list of pre-processed entries from traceback. This is useful for alternate formatting of stack traces. If 'limit' is omitted or None, all entries are extracted. A pre-processed stack trace entry is a FrameSummary ...
[ "def", "extract_tb", "(", "tb", ",", "limit", "=", "None", ")", ":", "return", "StackSummary", ".", "extract", "(", "walk_tb", "(", "tb", ")", ",", "limit", "=", "limit", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/traceback.py#L59-L72
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/google/protobuf-py/mox.py
python
MockMethod.AndRaise
(self, exception)
Set the exception to raise when this method is called. Args: # exception: the exception to raise when this method is called. exception: Exception
Set the exception to raise when this method is called.
[ "Set", "the", "exception", "to", "raise", "when", "this", "method", "is", "called", "." ]
def AndRaise(self, exception): """Set the exception to raise when this method is called. Args: # exception: the exception to raise when this method is called. exception: Exception """ self._exception = exception
[ "def", "AndRaise", "(", "self", ",", "exception", ")", ":", "self", ".", "_exception", "=", "exception" ]
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/mox.py#L728-L736
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf/cudf/core/window/rolling.py
python
Rolling.apply
(self, func, *args, **kwargs)
return self._apply_agg(func)
Counterpart of `pandas.core.window.Rolling.apply <https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.window.rolling.Rolling.apply.html>`_. Parameters ---------- func : function A user defined function that takes an 1D array as input args : tuple ...
Counterpart of `pandas.core.window.Rolling.apply <https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.window.rolling.Rolling.apply.html>`_.
[ "Counterpart", "of", "pandas", ".", "core", ".", "window", ".", "Rolling", ".", "apply", "<https", ":", "//", "pandas", ".", "pydata", ".", "org", "/", "pandas", "-", "docs", "/", "stable", "/", "reference", "/", "api", "/", "pandas", ".", "core", "....
def apply(self, func, *args, **kwargs): """ Counterpart of `pandas.core.window.Rolling.apply <https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.window.rolling.Rolling.apply.html>`_. Parameters ---------- func : function A user defined fun...
[ "def", "apply", "(", "self", ",", "func", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "has_nulls", "=", "False", "if", "isinstance", "(", "self", ".", "obj", ",", "cudf", ".", "Series", ")", ":", "if", "self", ".", "obj", ".", "_column",...
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/window/rolling.py#L282-L339
wenwei202/caffe
f54a74abaf6951d8485cbdcfa1d74a4c37839466
scripts/cpp_lint.py
python
FindEndOfExpressionInLine
(line, startpos, depth, startchar, endchar)
return (-1, depth)
Find the position just after the matching endchar. Args: line: a CleansedLines line. startpos: start searching at this position. depth: nesting level at startpos. startchar: expression opening character. endchar: expression closing character. Returns: On finding matching endchar: (index ju...
Find the position just after the matching endchar.
[ "Find", "the", "position", "just", "after", "the", "matching", "endchar", "." ]
def FindEndOfExpressionInLine(line, startpos, depth, startchar, endchar): """Find the position just after the matching endchar. Args: line: a CleansedLines line. startpos: start searching at this position. depth: nesting level at startpos. startchar: expression opening character. endchar: expre...
[ "def", "FindEndOfExpressionInLine", "(", "line", ",", "startpos", ",", "depth", ",", "startchar", ",", "endchar", ")", ":", "for", "i", "in", "xrange", "(", "startpos", ",", "len", "(", "line", ")", ")", ":", "if", "line", "[", "i", "]", "==", "start...
https://github.com/wenwei202/caffe/blob/f54a74abaf6951d8485cbdcfa1d74a4c37839466/scripts/cpp_lint.py#L1230-L1251
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py3/prompt_toolkit/completion/base.py
python
Completion.display_meta_text
(self)
return fragment_list_to_text(self.display_meta)
The 'meta' field as plain text.
The 'meta' field as plain text.
[ "The", "meta", "field", "as", "plain", "text", "." ]
def display_meta_text(self) -> str: "The 'meta' field as plain text." from prompt_toolkit.formatted_text import fragment_list_to_text return fragment_list_to_text(self.display_meta)
[ "def", "display_meta_text", "(", "self", ")", "->", "str", ":", "from", "prompt_toolkit", ".", "formatted_text", "import", "fragment_list_to_text", "return", "fragment_list_to_text", "(", "self", ".", "display_meta", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/completion/base.py#L109-L113
KratosMultiphysics/Kratos
0000833054ed0503424eb28205d6508d9ca6cbbc
kratos/python_scripts/kratos_utilities.py
python
DeleteFileIfExisting
(file_name)
This function tries to delete a file It uses try/except to also work in MPI
This function tries to delete a file It uses try/except to also work in MPI
[ "This", "function", "tries", "to", "delete", "a", "file", "It", "uses", "try", "/", "except", "to", "also", "work", "in", "MPI" ]
def DeleteFileIfExisting(file_name): """This function tries to delete a file It uses try/except to also work in MPI """ try: os.remove(file_name) except: pass
[ "def", "DeleteFileIfExisting", "(", "file_name", ")", ":", "try", ":", "os", ".", "remove", "(", "file_name", ")", "except", ":", "pass" ]
https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/kratos/python_scripts/kratos_utilities.py#L7-L14
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/profiler/parser/framework_parser.py
python
FrameworkParser._construct_point_info
(self, task_id_full_op_name_dict, step_point_data)
return point_info
step_point_data is a list[step_data], step data is a dict, key is same as STEP_INFO_STRUCT.
step_point_data is a list[step_data], step data is a dict, key is same as STEP_INFO_STRUCT.
[ "step_point_data", "is", "a", "list", "[", "step_data", "]", "step", "data", "is", "a", "dict", "key", "is", "same", "as", "STEP_INFO_STRUCT", "." ]
def _construct_point_info(self, task_id_full_op_name_dict, step_point_data): """step_point_data is a list[step_data], step data is a dict, key is same as STEP_INFO_STRUCT.""" point_info = {} for step_point in step_point_data: task_id = combine_stream_task_id(step_point['streamId'], s...
[ "def", "_construct_point_info", "(", "self", ",", "task_id_full_op_name_dict", ",", "step_point_data", ")", ":", "point_info", "=", "{", "}", "for", "step_point", "in", "step_point_data", ":", "task_id", "=", "combine_stream_task_id", "(", "step_point", "[", "'strea...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/profiler/parser/framework_parser.py#L306-L314
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/flatnotebook.py
python
PageContainer.GetPageImage
(self, page)
return -1
Returns the image index associated to a page.
Returns the image index associated to a page.
[ "Returns", "the", "image", "index", "associated", "to", "a", "page", "." ]
def GetPageImage(self, page): """ Returns the image index associated to a page. """ if page < len(self._pagesInfoVec): return self._pagesInfoVec[page].GetImageIndex() return -1
[ "def", "GetPageImage", "(", "self", ",", "page", ")", ":", "if", "page", "<", "len", "(", "self", ".", "_pagesInfoVec", ")", ":", "return", "self", ".", "_pagesInfoVec", "[", "page", "]", ".", "GetImageIndex", "(", ")", "return", "-", "1" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/flatnotebook.py#L4570-L4577
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TStr.__eq__
(self, *args)
return _snap.TStr___eq__(self, *args)
__eq__(TStr self, TStr Str) -> bool Parameters: Str: TStr const & __eq__(TStr self, char const * CStr) -> bool Parameters: CStr: char const *
__eq__(TStr self, TStr Str) -> bool
[ "__eq__", "(", "TStr", "self", "TStr", "Str", ")", "-", ">", "bool" ]
def __eq__(self, *args): """ __eq__(TStr self, TStr Str) -> bool Parameters: Str: TStr const & __eq__(TStr self, char const * CStr) -> bool Parameters: CStr: char const * """ return _snap.TStr___eq__(self, *args)
[ "def", "__eq__", "(", "self", ",", "*", "args", ")", ":", "return", "_snap", ".", "TStr___eq__", "(", "self", ",", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L9586-L9599
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/optimize/_numdiff.py
python
check_derivative
(fun, jac, x0, bounds=(-np.inf, np.inf), args=(), kwargs={})
Check correctness of a function computing derivatives (Jacobian or gradient) by comparison with a finite difference approximation. Parameters ---------- fun : callable Function of which to estimate the derivatives. The argument x passed to this function is ndarray of shape (n,) (never a...
Check correctness of a function computing derivatives (Jacobian or gradient) by comparison with a finite difference approximation.
[ "Check", "correctness", "of", "a", "function", "computing", "derivatives", "(", "Jacobian", "or", "gradient", ")", "by", "comparison", "with", "a", "finite", "difference", "approximation", "." ]
def check_derivative(fun, jac, x0, bounds=(-np.inf, np.inf), args=(), kwargs={}): """Check correctness of a function computing derivatives (Jacobian or gradient) by comparison with a finite difference approximation. Parameters ---------- fun : callable Function of which...
[ "def", "check_derivative", "(", "fun", ",", "jac", ",", "x0", ",", "bounds", "=", "(", "-", "np", ".", "inf", ",", "np", ".", "inf", ")", ",", "args", "=", "(", ")", ",", "kwargs", "=", "{", "}", ")", ":", "J_to_test", "=", "jac", "(", "x0", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/_numdiff.py#L564-L639
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/telemetry/telemetry/core/discover.py
python
DiscoverModules
(start_dir, top_level_dir, pattern='*')
return modules
Discover all modules in |start_dir| which match |pattern|. Args: start_dir: The directory to recursively search. top_level_dir: The top level of the package, for importing. pattern: Unix shell-style pattern for filtering the filenames to import. Returns: list of modules.
Discover all modules in |start_dir| which match |pattern|.
[ "Discover", "all", "modules", "in", "|start_dir|", "which", "match", "|pattern|", "." ]
def DiscoverModules(start_dir, top_level_dir, pattern='*'): """Discover all modules in |start_dir| which match |pattern|. Args: start_dir: The directory to recursively search. top_level_dir: The top level of the package, for importing. pattern: Unix shell-style pattern for filtering the filenames to im...
[ "def", "DiscoverModules", "(", "start_dir", ",", "top_level_dir", ",", "pattern", "=", "'*'", ")", ":", "modules", "=", "[", "]", "for", "dir_path", ",", "_", ",", "filenames", "in", "os", ".", "walk", "(", "start_dir", ")", ":", "for", "filename", "in...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/telemetry/core/discover.py#L15-L46
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/dataset/engine/validators.py
python
check_gnn_get_neg_sampled_neighbors
(method)
return new_method
A wrapper that wraps a parameter checker around the GNN `get_neg_sampled_neighbors` function.
A wrapper that wraps a parameter checker around the GNN `get_neg_sampled_neighbors` function.
[ "A", "wrapper", "that", "wraps", "a", "parameter", "checker", "around", "the", "GNN", "get_neg_sampled_neighbors", "function", "." ]
def check_gnn_get_neg_sampled_neighbors(method): """A wrapper that wraps a parameter checker around the GNN `get_neg_sampled_neighbors` function.""" @wraps(method) def new_method(self, *args, **kwargs): [node_list, neg_neighbor_num, neg_neighbor_type], _ = parse_user_args(method, *args, **kwargs) ...
[ "def", "check_gnn_get_neg_sampled_neighbors", "(", "method", ")", ":", "@", "wraps", "(", "method", ")", "def", "new_method", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "[", "node_list", ",", "neg_neighbor_num", ",", "neg_neighbor_type...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/engine/validators.py#L1684-L1697
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/decimal.py
python
Context.scaleb
(self, a, b)
return a.scaleb (b, context=self)
Returns the first operand after adding the second value its exp. >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('-2')) Decimal('0.0750') >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('0')) Decimal('7.50') >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('3')) ...
Returns the first operand after adding the second value its exp.
[ "Returns", "the", "first", "operand", "after", "adding", "the", "second", "value", "its", "exp", "." ]
def scaleb (self, a, b): """Returns the first operand after adding the second value its exp. >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('-2')) Decimal('0.0750') >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('0')) Decimal('7.50') >>> ExtendedContext.scaleb(...
[ "def", "scaleb", "(", "self", ",", "a", ",", "b", ")", ":", "return", "a", ".", "scaleb", "(", "b", ",", "context", "=", "self", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/decimal.py#L4775-L4785
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ebmlib/fileutil.py
python
IsLink
(path)
Is the file a link @return: bool
Is the file a link @return: bool
[ "Is", "the", "file", "a", "link", "@return", ":", "bool" ]
def IsLink(path): """Is the file a link @return: bool """ if WIN: return path.endswith(".lnk") or os.path.islink(path) else: return os.path.islink(path)
[ "def", "IsLink", "(", "path", ")", ":", "if", "WIN", ":", "return", "path", ".", "endswith", "(", "\".lnk\"", ")", "or", "os", ".", "path", ".", "islink", "(", "path", ")", "else", ":", "return", "os", ".", "path", ".", "islink", "(", "path", ")"...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ebmlib/fileutil.py#L194-L202
tinyobjloader/tinyobjloader
8322e00ae685ea623ab6ac5a6cebcfa2d22fbf93
deps/cpplint.py
python
CheckAccess
(filename, clean_lines, linenum, nesting_state, error)
Checks for improper use of DISALLOW* macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A NestingState instance which maintains information about the current stack...
Checks for improper use of DISALLOW* macros.
[ "Checks", "for", "improper", "use", "of", "DISALLOW", "*", "macros", "." ]
def CheckAccess(filename, clean_lines, linenum, nesting_state, error): """Checks for improper use of DISALLOW* macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A NestingState ins...
[ "def", "CheckAccess", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# get rid of comments and strings", "matched", "=", "Match", "(", "(", "r'...
https://github.com/tinyobjloader/tinyobjloader/blob/8322e00ae685ea623ab6ac5a6cebcfa2d22fbf93/deps/cpplint.py#L2969-L2996
ApolloAuto/apollo
463fb82f9e979d02dcb25044e60931293ab2dba0
modules/tools/routing/road_show.py
python
draw_boundary
(line_segment)
:param line_segment: :return:
:param line_segment: :return:
[ ":", "param", "line_segment", ":", ":", "return", ":" ]
def draw_boundary(line_segment): """ :param line_segment: :return: """ px, py = proto_utils.flatten(line_segment.point, ['x', 'y']) px, py = downsample_array(px), downsample_array(py) plt.gca().plot(px, py, 'k')
[ "def", "draw_boundary", "(", "line_segment", ")", ":", "px", ",", "py", "=", "proto_utils", ".", "flatten", "(", "line_segment", ".", "point", ",", "[", "'x'", ",", "'y'", "]", ")", "px", ",", "py", "=", "downsample_array", "(", "px", ")", ",", "down...
https://github.com/ApolloAuto/apollo/blob/463fb82f9e979d02dcb25044e60931293ab2dba0/modules/tools/routing/road_show.py#L74-L81
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/dataview.py
python
DataViewIconText.SetIcon
(*args, **kwargs)
return _dataview.DataViewIconText_SetIcon(*args, **kwargs)
SetIcon(self, Icon icon)
SetIcon(self, Icon icon)
[ "SetIcon", "(", "self", "Icon", "icon", ")" ]
def SetIcon(*args, **kwargs): """SetIcon(self, Icon icon)""" return _dataview.DataViewIconText_SetIcon(*args, **kwargs)
[ "def", "SetIcon", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewIconText_SetIcon", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/dataview.py#L1324-L1326
H-uru/Plasma
c2140ea046e82e9c199e257a7f2e7edb42602871
Scripts/Python/plasma/Plasma.py
python
PtGetDefaultDisplayParams
()
Returns the default resolution and display settings
Returns the default resolution and display settings
[ "Returns", "the", "default", "resolution", "and", "display", "settings" ]
def PtGetDefaultDisplayParams(): """Returns the default resolution and display settings""" pass
[ "def", "PtGetDefaultDisplayParams", "(", ")", ":", "pass" ]
https://github.com/H-uru/Plasma/blob/c2140ea046e82e9c199e257a7f2e7edb42602871/Scripts/Python/plasma/Plasma.py#L414-L416
yrnkrn/zapcc
c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50
tools/clang/utils/check_cfc/check_cfc.py
python
is_windows
()
return platform.system() == 'Windows'
Returns True if running on Windows.
Returns True if running on Windows.
[ "Returns", "True", "if", "running", "on", "Windows", "." ]
def is_windows(): """Returns True if running on Windows.""" return platform.system() == 'Windows'
[ "def", "is_windows", "(", ")", ":", "return", "platform", ".", "system", "(", ")", "==", "'Windows'" ]
https://github.com/yrnkrn/zapcc/blob/c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50/tools/clang/utils/check_cfc/check_cfc.py#L64-L66
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/fusion/portableglobe/servers/stub_search.py
python
StubDatabase.LoadSearchTable
(self, table_name, content)
Load data for search stub.
Load data for search stub.
[ "Load", "data", "for", "search", "stub", "." ]
def LoadSearchTable(self, table_name, content): """Load data for search stub.""" self.search_tables_.append(table_name)
[ "def", "LoadSearchTable", "(", "self", ",", "table_name", ",", "content", ")", ":", "self", ".", "search_tables_", ".", "append", "(", "table_name", ")" ]
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/servers/stub_search.py#L29-L31
bingwin/MicroChat
81d9a71a212c1cbca5bba497ec42659a7d25dccf
mars/lint/cpplint.py
python
_SetVerboseLevel
(level)
return _cpplint_state.SetVerboseLevel(level)
Sets the module's verbosity, and returns the previous setting.
Sets the module's verbosity, and returns the previous setting.
[ "Sets", "the", "module", "s", "verbosity", "and", "returns", "the", "previous", "setting", "." ]
def _SetVerboseLevel(level): """Sets the module's verbosity, and returns the previous setting.""" return _cpplint_state.SetVerboseLevel(level)
[ "def", "_SetVerboseLevel", "(", "level", ")", ":", "return", "_cpplint_state", ".", "SetVerboseLevel", "(", "level", ")" ]
https://github.com/bingwin/MicroChat/blob/81d9a71a212c1cbca5bba497ec42659a7d25dccf/mars/lint/cpplint.py#L870-L872
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/pipeline/pipeline/pipeline.py
python
Pipeline.abort
(self, abort_message='')
Mark the entire pipeline up to the root as aborted. Note this should only be called from *outside* the context of a running pipeline. Synchronous and generator pipelines should raise the 'Abort' exception to cause this behavior during execution. Args: abort_message: Optional message explaining w...
Mark the entire pipeline up to the root as aborted.
[ "Mark", "the", "entire", "pipeline", "up", "to", "the", "root", "as", "aborted", "." ]
def abort(self, abort_message=''): """Mark the entire pipeline up to the root as aborted. Note this should only be called from *outside* the context of a running pipeline. Synchronous and generator pipelines should raise the 'Abort' exception to cause this behavior during execution. Args: ab...
[ "def", "abort", "(", "self", ",", "abort_message", "=", "''", ")", ":", "# TODO: Use thread-local variable to enforce that this is not called", "# while a pipeline is executing in the current thread.", "if", "(", "self", ".", "async", "and", "self", ".", "_root_pipeline_key",...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/pipeline/pipeline/pipeline.py#L715-L738
wy1iu/LargeMargin_Softmax_Loss
c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec
tools/extra/extract_seconds.py
python
get_start_time
(line_iterable, year)
return start_datetime
Find start time from group of lines
Find start time from group of lines
[ "Find", "start", "time", "from", "group", "of", "lines" ]
def get_start_time(line_iterable, year): """Find start time from group of lines """ start_datetime = None for line in line_iterable: line = line.strip() if line.find('Solving') != -1: start_datetime = extract_datetime_from_line(line, year) break return start_...
[ "def", "get_start_time", "(", "line_iterable", ",", "year", ")", ":", "start_datetime", "=", "None", "for", "line", "in", "line_iterable", ":", "line", "=", "line", ".", "strip", "(", ")", "if", "line", ".", "find", "(", "'Solving'", ")", "!=", "-", "1...
https://github.com/wy1iu/LargeMargin_Softmax_Loss/blob/c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec/tools/extra/extract_seconds.py#L31-L41
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/genmsg/src/genmsg/msg_loader.py
python
_load_constant_line
(orig_line)
return Constant(field_type, name, val_converted, val.strip())
:raises: :exc:`InvalidMsgSpec`
:raises: :exc:`InvalidMsgSpec`
[ ":", "raises", ":", ":", "exc", ":", "InvalidMsgSpec" ]
def _load_constant_line(orig_line): """ :raises: :exc:`InvalidMsgSpec` """ clean_line = _strip_comments(orig_line) line_splits = [s for s in [x.strip() for x in clean_line.split(" ")] if s] #split type/name, filter out empties field_type = line_splits[0] if not is_valid_constant_type(field_t...
[ "def", "_load_constant_line", "(", "orig_line", ")", ":", "clean_line", "=", "_strip_comments", "(", "orig_line", ")", "line_splits", "=", "[", "s", "for", "s", "in", "[", "x", ".", "strip", "(", ")", "for", "x", "in", "clean_line", ".", "split", "(", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/genmsg/src/genmsg/msg_loader.py#L183-L209
rodeofx/OpenWalter
6116fbe3f04f1146c854afbfbdbe944feaee647e
walter/common/walterWidgets/walterLayersView.py
python
LayersView.__init__
(self, parent=None)
Called after the instance has been created.
Called after the instance has been created.
[ "Called", "after", "the", "instance", "has", "been", "created", "." ]
def __init__(self, parent=None): """Called after the instance has been created.""" super(LayersView, self).__init__(parent) model = LayersModel(self) self.setModel(model) # Context Menu self.contextMenu = QtWidgets.QMenu(self) self.setContextMenuPolicy(QtCore.Qt...
[ "def", "__init__", "(", "self", ",", "parent", "=", "None", ")", ":", "super", "(", "LayersView", ",", "self", ")", ".", "__init__", "(", "parent", ")", "model", "=", "LayersModel", "(", "self", ")", "self", ".", "setModel", "(", "model", ")", "# Con...
https://github.com/rodeofx/OpenWalter/blob/6116fbe3f04f1146c854afbfbdbe944feaee647e/walter/common/walterWidgets/walterLayersView.py#L19-L35
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/imaplib.py
python
IMAP4.close
(self)
return typ, dat
Close currently selected mailbox. Deleted messages are removed from writable mailbox. This is the recommended command before 'LOGOUT'. (typ, [data]) = <instance>.close()
Close currently selected mailbox.
[ "Close", "currently", "selected", "mailbox", "." ]
def close(self): """Close currently selected mailbox. Deleted messages are removed from writable mailbox. This is the recommended command before 'LOGOUT'. (typ, [data]) = <instance>.close() """ try: typ, dat = self._simple_command('CLOSE') finally: ...
[ "def", "close", "(", "self", ")", ":", "try", ":", "typ", ",", "dat", "=", "self", ".", "_simple_command", "(", "'CLOSE'", ")", "finally", ":", "self", ".", "state", "=", "'AUTH'", "return", "typ", ",", "dat" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/imaplib.py#L452-L464
CaoWGG/TensorRT-YOLOv4
4d7c2edce99e8794a4cb4ea3540d51ce91158a36
onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py
python
Type.get_declaration
(self)
return conf.lib.clang_getTypeDeclaration(self)
Return the cursor for the declaration of the given type.
Return the cursor for the declaration of the given type.
[ "Return", "the", "cursor", "for", "the", "declaration", "of", "the", "given", "type", "." ]
def get_declaration(self): """ Return the cursor for the declaration of the given type. """ return conf.lib.clang_getTypeDeclaration(self)
[ "def", "get_declaration", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getTypeDeclaration", "(", "self", ")" ]
https://github.com/CaoWGG/TensorRT-YOLOv4/blob/4d7c2edce99e8794a4cb4ea3540d51ce91158a36/onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py#L2048-L2052
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/turtle.py
python
RawTurtle.onrelease
(self, fun, btn=1, add=None)
Bind fun to mouse-button-release event on this turtle on canvas. Arguments: fun -- a function with two arguments, to which will be assigned the coordinates of the clicked point on the canvas. num -- number of the mouse-button defaults to 1 (left mouse button). Example ...
Bind fun to mouse-button-release event on this turtle on canvas.
[ "Bind", "fun", "to", "mouse", "-", "button", "-", "release", "event", "on", "this", "turtle", "on", "canvas", "." ]
def onrelease(self, fun, btn=1, add=None): """Bind fun to mouse-button-release event on this turtle on canvas. Arguments: fun -- a function with two arguments, to which will be assigned the coordinates of the clicked point on the canvas. num -- number of the mouse-butto...
[ "def", "onrelease", "(", "self", ",", "fun", ",", "btn", "=", "1", ",", "add", "=", "None", ")", ":", "self", ".", "screen", ".", "_onrelease", "(", "self", ".", "turtle", ".", "_item", ",", "fun", ",", "btn", ",", "add", ")", "self", ".", "_up...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/turtle.py#L3435-L3458
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/random.py
python
Random.shuffle
(self, x, random=None)
Shuffle list x in place, and return None. Optional argument random is a 0-argument function returning a random float in [0.0, 1.0); if it is the default None, the standard random.random will be used.
Shuffle list x in place, and return None.
[ "Shuffle", "list", "x", "in", "place", "and", "return", "None", "." ]
def shuffle(self, x, random=None): """Shuffle list x in place, and return None. Optional argument random is a 0-argument function returning a random float in [0.0, 1.0); if it is the default None, the standard random.random will be used. """ if random is None: ...
[ "def", "shuffle", "(", "self", ",", "x", ",", "random", "=", "None", ")", ":", "if", "random", "is", "None", ":", "randbelow", "=", "self", ".", "_randbelow", "for", "i", "in", "reversed", "(", "range", "(", "1", ",", "len", "(", "x", ")", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/random.py#L264-L284
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/binding/ffi.py
python
ObjectRef._dispose
(self)
Dispose of the underlying LLVM resource. Should be overriden by subclasses. Automatically called by close(), __del__() and __exit__() (unless the resource has been detached).
Dispose of the underlying LLVM resource. Should be overriden by subclasses. Automatically called by close(), __del__() and __exit__() (unless the resource has been detached).
[ "Dispose", "of", "the", "underlying", "LLVM", "resource", ".", "Should", "be", "overriden", "by", "subclasses", ".", "Automatically", "called", "by", "close", "()", "__del__", "()", "and", "__exit__", "()", "(", "unless", "the", "resource", "has", "been", "d...
def _dispose(self): """ Dispose of the underlying LLVM resource. Should be overriden by subclasses. Automatically called by close(), __del__() and __exit__() (unless the resource has been detached). """
[ "def", "_dispose", "(", "self", ")", ":" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/binding/ffi.py#L278-L283
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/translate.py
python
resolve_references
(config, definitions)
Recursively replace $ref keys. To cut down on duplication, common definitions can be declared (and passed in via the ``definitions`` attribute) and then references as {"$ref": "name"}, when this happens the reference dict is placed with the value from the ``definition`` dict. This is recursively d...
Recursively replace $ref keys.
[ "Recursively", "replace", "$ref", "keys", "." ]
def resolve_references(config, definitions): """Recursively replace $ref keys. To cut down on duplication, common definitions can be declared (and passed in via the ``definitions`` attribute) and then references as {"$ref": "name"}, when this happens the reference dict is placed with the value from...
[ "def", "resolve_references", "(", "config", ",", "definitions", ")", ":", "for", "key", ",", "value", "in", "config", ".", "items", "(", ")", ":", "if", "isinstance", "(", "value", ",", "dict", ")", ":", "if", "len", "(", "value", ")", "==", "1", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/translate.py#L59-L76
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/policy.py
python
TabularPolicy.copy_with_noise
(self, alpha=0.0, beta=0.0, random_state=np.random.RandomState())
return copied_instance
Returns a copy of this policy perturbed with noise. Generates a new random distribution using a softmax on normal random variables with temperature beta, and mixes it with the old distribution using 1-alpha * old_distribution + alpha * random_distribution. Args: alpha: Parameter characterizing th...
Returns a copy of this policy perturbed with noise.
[ "Returns", "a", "copy", "of", "this", "policy", "perturbed", "with", "noise", "." ]
def copy_with_noise(self, alpha=0.0, beta=0.0, random_state=np.random.RandomState()): """Returns a copy of this policy perturbed with noise. Generates a new random distribution using a softmax on normal random variables with temperature beta...
[ "def", "copy_with_noise", "(", "self", ",", "alpha", "=", "0.0", ",", "beta", "=", "0.0", ",", "random_state", "=", "np", ".", "random", ".", "RandomState", "(", ")", ")", ":", "copied_instance", "=", "self", ".", "__copy__", "(", "False", ")", "probab...
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/policy.py#L359-L387
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
sdhash-ui/cherrypy/process/plugins.py
python
Autoreloader.sysfiles
(self)
return files
Return a Set of sys.modules filenames to monitor.
Return a Set of sys.modules filenames to monitor.
[ "Return", "a", "Set", "of", "sys", ".", "modules", "filenames", "to", "monitor", "." ]
def sysfiles(self): """Return a Set of sys.modules filenames to monitor.""" files = set() for k, m in sys.modules.items(): if re.match(self.match, k): if hasattr(m, '__loader__') and hasattr(m.__loader__, 'archive'): f = m.__loader__.archive ...
[ "def", "sysfiles", "(", "self", ")", ":", "files", "=", "set", "(", ")", "for", "k", ",", "m", "in", "sys", ".", "modules", ".", "items", "(", ")", ":", "if", "re", ".", "match", "(", "self", ".", "match", ",", "k", ")", ":", "if", "hasattr",...
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/process/plugins.py#L583-L596
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/util/request.py
python
make_headers
(keep_alive=None, accept_encoding=None, user_agent=None, basic_auth=None, proxy_basic_auth=None, disable_cache=None)
return headers
Shortcuts for generating request headers. :param keep_alive: If ``True``, adds 'connection: keep-alive' header. :param accept_encoding: Can be a boolean, list, or string. ``True`` translates to 'gzip,deflate'. List will get joined by comma. String will be used as provid...
Shortcuts for generating request headers.
[ "Shortcuts", "for", "generating", "request", "headers", "." ]
def make_headers(keep_alive=None, accept_encoding=None, user_agent=None, basic_auth=None, proxy_basic_auth=None, disable_cache=None): """ Shortcuts for generating request headers. :param keep_alive: If ``True``, adds 'connection: keep-alive' header. :param accept_encoding: ...
[ "def", "make_headers", "(", "keep_alive", "=", "None", ",", "accept_encoding", "=", "None", ",", "user_agent", "=", "None", ",", "basic_auth", "=", "None", ",", "proxy_basic_auth", "=", "None", ",", "disable_cache", "=", "None", ")", ":", "headers", "=", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/util/request.py#L11-L74
forkineye/ESPixelStick
22926f1c0d1131f1369fc7cad405689a095ae3cb
dist/bin/esptool/serial/serialutil.py
python
SerialBase.stopbits
(self, stopbits)
Change stop bits size.
Change stop bits size.
[ "Change", "stop", "bits", "size", "." ]
def stopbits(self, stopbits): """Change stop bits size.""" if stopbits not in self.STOPBITS: raise ValueError("Not a valid stop bit size: {!r}".format(stopbits)) self._stopbits = stopbits if self.is_open: self._reconfigure_port()
[ "def", "stopbits", "(", "self", ",", "stopbits", ")", ":", "if", "stopbits", "not", "in", "self", ".", "STOPBITS", ":", "raise", "ValueError", "(", "\"Not a valid stop bit size: {!r}\"", ".", "format", "(", "stopbits", ")", ")", "self", ".", "_stopbits", "="...
https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/esptool/serial/serialutil.py#L343-L349
wesnoth/wesnoth
6ccac5a5e8ff75303c9190c0da60580925cb32c0
data/tools/wesnoth/wmldata.py
python
DataSub.remove
(self, child)
Removes a sub-element.
Removes a sub-element.
[ "Removes", "a", "sub", "-", "element", "." ]
def remove(self, child): """Removes a sub-element.""" self.data.remove(child) self.dict[child.name].remove(child)
[ "def", "remove", "(", "self", ",", "child", ")", ":", "self", ".", "data", ".", "remove", "(", "child", ")", "self", ".", "dict", "[", "child", ".", "name", "]", ".", "remove", "(", "child", ")" ]
https://github.com/wesnoth/wesnoth/blob/6ccac5a5e8ff75303c9190c0da60580925cb32c0/data/tools/wesnoth/wmldata.py#L349-L352
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
ui/resources/resource_check/resource_scale_factors.py
python
ResourceScaleFactors.__init__
(self, input_api, output_api, paths)
Initializes ResourceScaleFactors with paths.
Initializes ResourceScaleFactors with paths.
[ "Initializes", "ResourceScaleFactors", "with", "paths", "." ]
def __init__(self, input_api, output_api, paths): """ Initializes ResourceScaleFactors with paths.""" self.input_api = input_api self.output_api = output_api self.paths = paths
[ "def", "__init__", "(", "self", ",", "input_api", ",", "output_api", ",", "paths", ")", ":", "self", ".", "input_api", "=", "input_api", "self", ".", "output_api", "=", "output_api", "self", ".", "paths", "=", "paths" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/ui/resources/resource_check/resource_scale_factors.py#L35-L39
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/dataview.py
python
DataViewTreeStore.SetItemIcon
(*args, **kwargs)
return _dataview.DataViewTreeStore_SetItemIcon(*args, **kwargs)
SetItemIcon(self, DataViewItem item, Icon icon)
SetItemIcon(self, DataViewItem item, Icon icon)
[ "SetItemIcon", "(", "self", "DataViewItem", "item", "Icon", "icon", ")" ]
def SetItemIcon(*args, **kwargs): """SetItemIcon(self, DataViewItem item, Icon icon)""" return _dataview.DataViewTreeStore_SetItemIcon(*args, **kwargs)
[ "def", "SetItemIcon", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewTreeStore_SetItemIcon", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/dataview.py#L2420-L2422
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/stc.py
python
StyledTextEvent.GetText
(*args, **kwargs)
return _stc.StyledTextEvent_GetText(*args, **kwargs)
GetText(self) -> String
GetText(self) -> String
[ "GetText", "(", "self", ")", "-", ">", "String" ]
def GetText(*args, **kwargs): """GetText(self) -> String""" return _stc.StyledTextEvent_GetText(*args, **kwargs)
[ "def", "GetText", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextEvent_GetText", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L7138-L7140
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/logging/config.py
python
BaseConfigurator.convert
(self, value)
return value
Convert values to an appropriate type. dicts, lists and tuples are replaced by their converting alternatives. Strings are checked to see if they have a conversion format and are converted if they do.
Convert values to an appropriate type. dicts, lists and tuples are replaced by their converting alternatives. Strings are checked to see if they have a conversion format and are converted if they do.
[ "Convert", "values", "to", "an", "appropriate", "type", ".", "dicts", "lists", "and", "tuples", "are", "replaced", "by", "their", "converting", "alternatives", ".", "Strings", "are", "checked", "to", "see", "if", "they", "have", "a", "conversion", "format", ...
def convert(self, value): """ Convert values to an appropriate type. dicts, lists and tuples are replaced by their converting alternatives. Strings are checked to see if they have a conversion format and are converted if they do. """ if not isinstance(value, ConvertingDic...
[ "def", "convert", "(", "self", ",", "value", ")", ":", "if", "not", "isinstance", "(", "value", ",", "ConvertingDict", ")", "and", "isinstance", "(", "value", ",", "dict", ")", ":", "value", "=", "ConvertingDict", "(", "value", ")", "value", ".", "conf...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/logging/config.py#L438-L464
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
python/mxnet/symbol/random.py
python
normal
(loc=0, scale=1, shape=_Null, dtype=_Null, **kwargs)
return _random_helper(_internal._random_normal, _internal._sample_normal, [loc, scale], shape, dtype, kwargs)
Draw random samples from a normal (Gaussian) distribution. Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation). Parameters ---------- loc : float or Symbol Mean (centre) of the distribution. scale : float or Symbol ...
Draw random samples from a normal (Gaussian) distribution.
[ "Draw", "random", "samples", "from", "a", "normal", "(", "Gaussian", ")", "distribution", "." ]
def normal(loc=0, scale=1, shape=_Null, dtype=_Null, **kwargs): """Draw random samples from a normal (Gaussian) distribution. Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation). Parameters ---------- loc : float or Symbol ...
[ "def", "normal", "(", "loc", "=", "0", ",", "scale", "=", "1", ",", "shape", "=", "_Null", ",", "dtype", "=", "_Null", ",", "*", "*", "kwargs", ")", ":", "return", "_random_helper", "(", "_internal", ".", "_random_normal", ",", "_internal", ".", "_sa...
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/symbol/random.py#L74-L96
PaddlePaddle/Anakin
5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730
tools/external_converter_v2/utils/net/net_io.py
python
NetProtoIO.clear_graph
(self)
Clear the graph of net proto.
Clear the graph of net proto.
[ "Clear", "the", "graph", "of", "net", "proto", "." ]
def clear_graph(self): """ Clear the graph of net proto. """ self.net_proto.graph.Clear()
[ "def", "clear_graph", "(", "self", ")", ":", "self", ".", "net_proto", ".", "graph", ".", "Clear", "(", ")" ]
https://github.com/PaddlePaddle/Anakin/blob/5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730/tools/external_converter_v2/utils/net/net_io.py#L94-L98
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
build/util/version.py
python
write_if_changed
(file_name, contents)
Writes the specified contents to the specified file_name iff the contents are different than the current contents.
Writes the specified contents to the specified file_name iff the contents are different than the current contents.
[ "Writes", "the", "specified", "contents", "to", "the", "specified", "file_name", "iff", "the", "contents", "are", "different", "than", "the", "current", "contents", "." ]
def write_if_changed(file_name, contents): """ Writes the specified contents to the specified file_name iff the contents are different than the current contents. """ try: old_contents = open(file_name, 'r').read() except EnvironmentError: pass else: if contents == old_contents: return ...
[ "def", "write_if_changed", "(", "file_name", ",", "contents", ")", ":", "try", ":", "old_contents", "=", "open", "(", "file_name", ",", "'r'", ")", ".", "read", "(", ")", "except", "EnvironmentError", ":", "pass", "else", ":", "if", "contents", "==", "ol...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/util/version.py#L91-L104
apache/qpid-proton
6bcdfebb55ea3554bc29b1901422532db331a591
python/proton/_reactor.py
python
Reactor.get_connection_address
(self, connection: Connection)
return connection.connected_address
*Deprecated* in favor of the property proton.Connection.connected_address. This may be used to retrieve the remote peer address. :return: string containing the address in URL format or None if no address is available. Use the proton.Url class to create a Url object from the returned val...
*Deprecated* in favor of the property proton.Connection.connected_address. This may be used to retrieve the remote peer address. :return: string containing the address in URL format or None if no address is available. Use the proton.Url class to create a Url object from the returned val...
[ "*", "Deprecated", "*", "in", "favor", "of", "the", "property", "proton", ".", "Connection", ".", "connected_address", ".", "This", "may", "be", "used", "to", "retrieve", "the", "remote", "peer", "address", ".", ":", "return", ":", "string", "containing", ...
def get_connection_address(self, connection: Connection) -> str: """*Deprecated* in favor of the property proton.Connection.connected_address. This may be used to retrieve the remote peer address. :return: string containing the address in URL format or None if no address is available. U...
[ "def", "get_connection_address", "(", "self", ",", "connection", ":", "Connection", ")", "->", "str", ":", "return", "connection", ".", "connected_address" ]
https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_reactor.py#L368-L375
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftviewproviders/view_base.py
python
ViewProviderDraft.__getstate__
(self)
return None
Return a tuple of all serializable objects or None. When saving the document this view provider object gets stored using Python's `json` module. Since we have some un-serializable objects (Coin objects) in here we must define this method to return a tuple of all serializable ob...
Return a tuple of all serializable objects or None.
[ "Return", "a", "tuple", "of", "all", "serializable", "objects", "or", "None", "." ]
def __getstate__(self): """Return a tuple of all serializable objects or None. When saving the document this view provider object gets stored using Python's `json` module. Since we have some un-serializable objects (Coin objects) in here we must define this method to return a t...
[ "def", "__getstate__", "(", "self", ")", ":", "return", "None" ]
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftviewproviders/view_base.py#L119-L137
apache/kudu
90895ce76590f10730ad7aac3613b69d89ff5422
python/kudu/__init__.py
python
timedelta
(seconds=0, millis=0, micros=0, nanos=0)
return TimeDelta.from_nanos(total_ns)
Construct a Kudu TimeDelta to set timeouts, etc. Use this function instead of interacting with the TimeDelta class yourself. Returns ------- delta : kudu.client.TimeDelta
Construct a Kudu TimeDelta to set timeouts, etc. Use this function instead of interacting with the TimeDelta class yourself.
[ "Construct", "a", "Kudu", "TimeDelta", "to", "set", "timeouts", "etc", ".", "Use", "this", "function", "instead", "of", "interacting", "with", "the", "TimeDelta", "class", "yourself", "." ]
def timedelta(seconds=0, millis=0, micros=0, nanos=0): """ Construct a Kudu TimeDelta to set timeouts, etc. Use this function instead of interacting with the TimeDelta class yourself. Returns ------- delta : kudu.client.TimeDelta """ from kudu.compat import long # TimeDelta is a wra...
[ "def", "timedelta", "(", "seconds", "=", "0", ",", "millis", "=", "0", ",", "micros", "=", "0", ",", "nanos", "=", "0", ")", ":", "from", "kudu", ".", "compat", "import", "long", "# TimeDelta is a wrapper for kudu::MonoDelta", "total_ns", "=", "(", "long",...
https://github.com/apache/kudu/blob/90895ce76590f10730ad7aac3613b69d89ff5422/python/kudu/__init__.py#L111-L124
google/iree
1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76
build_tools/benchmarks/run_benchmarks_on_android.py
python
parse_arguments
()
return args
Parses command-line options.
Parses command-line options.
[ "Parses", "command", "-", "line", "options", "." ]
def parse_arguments(): """Parses command-line options.""" def check_dir_path(path): if os.path.isdir(path): return path else: raise argparse.ArgumentTypeError(path) def check_exe_path(path): if os.access(path, os.X_OK): return path else: raise argparse.ArgumentTypeError(f...
[ "def", "parse_arguments", "(", ")", ":", "def", "check_dir_path", "(", "path", ")", ":", "if", "os", ".", "path", ".", "isdir", "(", "path", ")", ":", "return", "path", "else", ":", "raise", "argparse", ".", "ArgumentTypeError", "(", "path", ")", "def"...
https://github.com/google/iree/blob/1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76/build_tools/benchmarks/run_benchmarks_on_android.py#L611-L701
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/chigger/base/ChiggerResult.py
python
ChiggerResult.__len__
(self)
return len(self._sources)
The number of source objects.
The number of source objects.
[ "The", "number", "of", "source", "objects", "." ]
def __len__(self): """ The number of source objects. """ return len(self._sources)
[ "def", "__len__", "(", "self", ")", ":", "return", "len", "(", "self", ".", "_sources", ")" ]
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/chigger/base/ChiggerResult.py#L167-L171
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/tpu/tpu_system_metadata.py
python
_query_tpu_system_metadata
(master_address, cluster_def=None, query_topology=False)
return metadata
Automatically detects the TPU system metadata in the system.
Automatically detects the TPU system metadata in the system.
[ "Automatically", "detects", "the", "TPU", "system", "metadata", "in", "the", "system", "." ]
def _query_tpu_system_metadata(master_address, cluster_def=None, query_topology=False): """Automatically detects the TPU system metadata in the system.""" tpu_core_count = 0 devices = [] device_dict = collections.defaultdict(list) if context.executing_eagerly(): logical_dev...
[ "def", "_query_tpu_system_metadata", "(", "master_address", ",", "cluster_def", "=", "None", ",", "query_topology", "=", "False", ")", ":", "tpu_core_count", "=", "0", "devices", "=", "[", "]", "device_dict", "=", "collections", ".", "defaultdict", "(", "list", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/tpu/tpu_system_metadata.py#L68-L164
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/pydoc.py
python
TextDoc.docroutine
(self, object, name=None, mod=None, cl=None)
Produce text documentation for a function or method object.
Produce text documentation for a function or method object.
[ "Produce", "text", "documentation", "for", "a", "function", "or", "method", "object", "." ]
def docroutine(self, object, name=None, mod=None, cl=None): """Produce text documentation for a function or method object.""" realname = object.__name__ name = name or realname note = '' skipdocs = 0 if _is_bound_method(object): imclass = object.__self__.__cla...
[ "def", "docroutine", "(", "self", ",", "object", ",", "name", "=", "None", ",", "mod", "=", "None", ",", "cl", "=", "None", ")", ":", "realname", "=", "object", ".", "__name__", "name", "=", "name", "or", "realname", "note", "=", "''", "skipdocs", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/pydoc.py#L1458-L1511
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/tensor_forest/client/random_forest.py
python
MultiForestMultiHeadEstimator.__init__
(self, params_list, device_assigner=None, model_dir=None, graph_builder_class=tensor_forest.RandomForestGraphs, config=None, weights_name=None, keys_name=None, feature_engineering_fn=None, early_stopping_rounds=100, num_trainers=1, trainer_id=0,...
Initializes a TensorForestEstimator instance. Args: params_list: A list of ForestHParams objects for each head, given in order of outputs in the label tensor to be trained on. device_assigner: An `object` instance that controls how trees get assigned to devices. If `None`, will use ...
Initializes a TensorForestEstimator instance.
[ "Initializes", "a", "TensorForestEstimator", "instance", "." ]
def __init__(self, params_list, device_assigner=None, model_dir=None, graph_builder_class=tensor_forest.RandomForestGraphs, config=None, weights_name=None, keys_name=None, feature_engineering_fn=None, early_stopping_rounds=100, num_trainers=1, t...
[ "def", "__init__", "(", "self", ",", "params_list", ",", "device_assigner", "=", "None", ",", "model_dir", "=", "None", ",", "graph_builder_class", "=", "tensor_forest", ".", "RandomForestGraphs", ",", "config", "=", "None", ",", "weights_name", "=", "None", "...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/tensor_forest/client/random_forest.py#L460-L530
nasa/fprime
595cf3682d8365943d86c1a6fe7c78f0a116acf0
Autocoders/Python/src/fprime_ac/utils/pyparsing.py
python
_makeTags
(tagStr, xml)
return openTag, closeTag
Internal helper to construct opening and closing tag expressions, given a tag name
Internal helper to construct opening and closing tag expressions, given a tag name
[ "Internal", "helper", "to", "construct", "opening", "and", "closing", "tag", "expressions", "given", "a", "tag", "name" ]
def _makeTags(tagStr, xml): """Internal helper to construct opening and closing tag expressions, given a tag name""" if isinstance(tagStr, str): resname = tagStr tagStr = Keyword(tagStr, caseless=not xml) else: resname = tagStr.name tagAttrName = Word(alphas, alphanums + "_-") ...
[ "def", "_makeTags", "(", "tagStr", ",", "xml", ")", ":", "if", "isinstance", "(", "tagStr", ",", "str", ")", ":", "resname", "=", "tagStr", "tagStr", "=", "Keyword", "(", "tagStr", ",", "caseless", "=", "not", "xml", ")", "else", ":", "resname", "=",...
https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/utils/pyparsing.py#L3146-L3197
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/dask_cudf/dask_cudf/sorting.py
python
merge_quantiles
(finalq, qs, vals)
return rv.reset_index(drop=True)
Combine several quantile calculations of different data. [NOTE: Same logic as dask.array merge_percentiles]
Combine several quantile calculations of different data. [NOTE: Same logic as dask.array merge_percentiles]
[ "Combine", "several", "quantile", "calculations", "of", "different", "data", ".", "[", "NOTE", ":", "Same", "logic", "as", "dask", ".", "array", "merge_percentiles", "]" ]
def merge_quantiles(finalq, qs, vals): """Combine several quantile calculations of different data. [NOTE: Same logic as dask.array merge_percentiles] """ if isinstance(finalq, Iterator): finalq = list(finalq) finalq = np.array(finalq) qs = list(map(list, qs)) vals = list(vals) va...
[ "def", "merge_quantiles", "(", "finalq", ",", "qs", ",", "vals", ")", ":", "if", "isinstance", "(", "finalq", ",", "Iterator", ")", ":", "finalq", "=", "list", "(", "finalq", ")", "finalq", "=", "np", ".", "array", "(", "finalq", ")", "qs", "=", "l...
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/dask_cudf/dask_cudf/sorting.py#L48-L107
v8mips/v8mips
f0c9cc0bbfd461c7f516799d9a58e9a7395f737e
tools/stats-viewer.py
python
StatsViewer.MountSharedData
(self)
Mount the binary counters file as a memory-mapped file. If something goes wrong print an informative message and exit the program.
Mount the binary counters file as a memory-mapped file. If something goes wrong print an informative message and exit the program.
[ "Mount", "the", "binary", "counters", "file", "as", "a", "memory", "-", "mapped", "file", ".", "If", "something", "goes", "wrong", "print", "an", "informative", "message", "and", "exit", "the", "program", "." ]
def MountSharedData(self): """Mount the binary counters file as a memory-mapped file. If something goes wrong print an informative message and exit the program.""" if not os.path.exists(self.data_name): maps_name = "/proc/%s/maps" % self.data_name if not os.path.exists(maps_name): p...
[ "def", "MountSharedData", "(", "self", ")", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "self", ".", "data_name", ")", ":", "maps_name", "=", "\"/proc/%s/maps\"", "%", "self", ".", "data_name", "if", "not", "os", ".", "path", ".", "exists"...
https://github.com/v8mips/v8mips/blob/f0c9cc0bbfd461c7f516799d9a58e9a7395f737e/tools/stats-viewer.py#L96-L127
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/peacock/ExodusViewer/plugins/GoldDiffPlugin.py
python
ExternalVTKWindowPlugin.closeEvent
(self, *args)
Store the size of the window.
Store the size of the window.
[ "Store", "the", "size", "of", "the", "window", "." ]
def closeEvent(self, *args): """ Store the size of the window. """ self._widget_size = self.size() self._toggle.setCheckState(QtCore.Qt.Unchecked) self._toggle.clicked.emit(False)
[ "def", "closeEvent", "(", "self", ",", "*", "args", ")", ":", "self", ".", "_widget_size", "=", "self", ".", "size", "(", ")", "self", ".", "_toggle", ".", "setCheckState", "(", "QtCore", ".", "Qt", ".", "Unchecked", ")", "self", ".", "_toggle", ".",...
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/ExodusViewer/plugins/GoldDiffPlugin.py#L53-L59
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/tasks.py
python
_unregister_task
(task)
Unregister a task.
Unregister a task.
[ "Unregister", "a", "task", "." ]
def _unregister_task(task): """Unregister a task.""" _all_tasks.discard(task)
[ "def", "_unregister_task", "(", "task", ")", ":", "_all_tasks", ".", "discard", "(", "task", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/tasks.py#L879-L881
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/linalg/linalg_impl.py
python
_lu_solve_assertions
(lower_upper, perm, rhs, validate_args)
return assertions
Returns list of assertions related to `lu_solve` assumptions.
Returns list of assertions related to `lu_solve` assumptions.
[ "Returns", "list", "of", "assertions", "related", "to", "lu_solve", "assumptions", "." ]
def _lu_solve_assertions(lower_upper, perm, rhs, validate_args): """Returns list of assertions related to `lu_solve` assumptions.""" assertions = lu_reconstruct_assertions(lower_upper, perm, validate_args) message = 'Input `rhs` must have at least 2 dimensions.' if rhs.shape.ndims is not None: if rhs.shape...
[ "def", "_lu_solve_assertions", "(", "lower_upper", ",", "perm", ",", "rhs", ",", "validate_args", ")", ":", "assertions", "=", "lu_reconstruct_assertions", "(", "lower_upper", ",", "perm", ",", "validate_args", ")", "message", "=", "'Input `rhs` must have at least 2 d...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/linalg/linalg_impl.py#L1203-L1226
9miao/CrossApp
1f5375e061bf69841eb19728598f5ae3f508d620
tools/bindings-generator/clang/cindex.py
python
SourceLocation.from_position
(tu, file, line, column)
return conf.lib.clang_getLocation(tu, file, line, column)
Retrieve the source location associated with a given file/line/column in a particular translation unit.
Retrieve the source location associated with a given file/line/column in a particular translation unit.
[ "Retrieve", "the", "source", "location", "associated", "with", "a", "given", "file", "/", "line", "/", "column", "in", "a", "particular", "translation", "unit", "." ]
def from_position(tu, file, line, column): """ Retrieve the source location associated with a given file/line/column in a particular translation unit. """ return conf.lib.clang_getLocation(tu, file, line, column)
[ "def", "from_position", "(", "tu", ",", "file", ",", "line", ",", "column", ")", ":", "return", "conf", ".", "lib", ".", "clang_getLocation", "(", "tu", ",", "file", ",", "line", ",", "column", ")" ]
https://github.com/9miao/CrossApp/blob/1f5375e061bf69841eb19728598f5ae3f508d620/tools/bindings-generator/clang/cindex.py#L180-L185
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/svm/base.py
python
BaseLibSVM._validate_targets
(self, y)
return column_or_1d(y, warn=True).astype(np.float64)
Validation of y and class_weight. Default implementation for SVR and one-class; overridden in BaseSVC.
Validation of y and class_weight.
[ "Validation", "of", "y", "and", "class_weight", "." ]
def _validate_targets(self, y): """Validation of y and class_weight. Default implementation for SVR and one-class; overridden in BaseSVC. """ # XXX this is ugly. # Regression models should not have a class_weight_ attribute. self.class_weight_ = np.empty(0) retur...
[ "def", "_validate_targets", "(", "self", ",", "y", ")", ":", "# XXX this is ugly.", "# Regression models should not have a class_weight_ attribute.", "self", ".", "class_weight_", "=", "np", ".", "empty", "(", "0", ")", "return", "column_or_1d", "(", "y", ",", "warn...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/svm/base.py#L204-L212
leela-zero/leela-zero
e3ed6310d33d75078ba74c3adf887d18439fc2e3
scripts/cpplint.py
python
CleansedLines._CollapseStrings
(elided)
return collapsed
Collapses strings and chars on a line to simple "" or '' blocks. We nix strings first so we're not fooled by text like '"http://"' Args: elided: The line being processed. Returns: The line with collapsed strings.
Collapses strings and chars on a line to simple "" or '' blocks.
[ "Collapses", "strings", "and", "chars", "on", "a", "line", "to", "simple", "or", "blocks", "." ]
def _CollapseStrings(elided): """Collapses strings and chars on a line to simple "" or '' blocks. We nix strings first so we're not fooled by text like '"http://"' Args: elided: The line being processed. Returns: The line with collapsed strings. """ if _RE_PATTERN_INCLUDE.match(el...
[ "def", "_CollapseStrings", "(", "elided", ")", ":", "if", "_RE_PATTERN_INCLUDE", ".", "match", "(", "elided", ")", ":", "return", "elided", "# Remove escaped characters first to make quote/single quote collapsing", "# basic. Things that look like escaped characters shouldn't occur...
https://github.com/leela-zero/leela-zero/blob/e3ed6310d33d75078ba74c3adf887d18439fc2e3/scripts/cpplint.py#L1318-L1382
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/ceph_manager.py
python
OSDThrasher.do_join
(self)
Break out of this Ceph loop
Break out of this Ceph loop
[ "Break", "out", "of", "this", "Ceph", "loop" ]
def do_join(self): """ Break out of this Ceph loop """ self.stopping = True self.thread.get() if self.sighup_delay: self.log("joining the do_sighup greenlet") self.sighup_thread.get() if self.optrack_toggle_delay: self.log("join...
[ "def", "do_join", "(", "self", ")", ":", "self", ".", "stopping", "=", "True", "self", ".", "thread", ".", "get", "(", ")", "if", "self", ".", "sighup_delay", ":", "self", ".", "log", "(", "\"joining the do_sighup greenlet\"", ")", "self", ".", "sighup_t...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/ceph_manager.py#L817-L834
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/s3transfer/futures.py
python
TransferCoordinator.submit
(self, executor, task, tag=None)
return future
Submits a task to a provided executor :type executor: s3transfer.futures.BoundedExecutor :param executor: The executor to submit the callable to :type task: s3transfer.tasks.Task :param task: The task to submit to the executor :type tag: s3transfer.futures.TaskTag :par...
Submits a task to a provided executor
[ "Submits", "a", "task", "to", "a", "provided", "executor" ]
def submit(self, executor, task, tag=None): """Submits a task to a provided executor :type executor: s3transfer.futures.BoundedExecutor :param executor: The executor to submit the callable to :type task: s3transfer.tasks.Task :param task: The task to submit to the executor ...
[ "def", "submit", "(", "self", ",", "executor", ",", "task", ",", "tag", "=", "None", ")", ":", "logger", ".", "debug", "(", "\"Submitting task %s to executor %s for transfer request: %s.\"", "%", "(", "task", ",", "executor", ",", "self", ".", "transfer_id", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/s3transfer/futures.py#L269-L294
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
python/mxnet/module/base_module.py
python
BaseModule.init_optimizer
(self, kvstore='local', optimizer='sgd', optimizer_params=(('learning_rate', 0.01),), force_init=False)
Installs and initializes optimizers, as well as initialize kvstore for distributed training Parameters ---------- kvstore : str or KVStore Defaults to `'local'`. optimizer : str or Optimizer Defaults to `'sgd'`. optimizer_params : dict ...
Installs and initializes optimizers, as well as initialize kvstore for distributed training
[ "Installs", "and", "initializes", "optimizers", "as", "well", "as", "initialize", "kvstore", "for", "distributed", "training" ]
def init_optimizer(self, kvstore='local', optimizer='sgd', optimizer_params=(('learning_rate', 0.01),), force_init=False): """Installs and initializes optimizers, as well as initialize kvstore for distributed training Parameters ---------- kvstore : str...
[ "def", "init_optimizer", "(", "self", ",", "kvstore", "=", "'local'", ",", "optimizer", "=", "'sgd'", ",", "optimizer_params", "=", "(", "(", "'learning_rate'", ",", "0.01", ")", ",", ")", ",", "force_init", "=", "False", ")", ":", "raise", "NotImplemented...
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/module/base_module.py#L958-L981
open-source-parsers/jsoncpp
42e892d96e47b1f6e29844cc705e148ec4856448
devtools/batchbuild.py
python
fix_eol
(stdout)
return re.sub('\r*\n', os.linesep, stdout)
Fixes wrong EOL produced by cmake --build on Windows (\r\r\n instead of \r\n).
Fixes wrong EOL produced by cmake --build on Windows (\r\r\n instead of \r\n).
[ "Fixes", "wrong", "EOL", "produced", "by", "cmake", "--", "build", "on", "Windows", "(", "\\", "r", "\\", "r", "\\", "n", "instead", "of", "\\", "r", "\\", "n", ")", "." ]
def fix_eol(stdout): """Fixes wrong EOL produced by cmake --build on Windows (\r\r\n instead of \r\n). """ return re.sub('\r*\n', os.linesep, stdout)
[ "def", "fix_eol", "(", "stdout", ")", ":", "return", "re", ".", "sub", "(", "'\\r*\\n'", ",", "os", ".", "linesep", ",", "stdout", ")" ]
https://github.com/open-source-parsers/jsoncpp/blob/42e892d96e47b1f6e29844cc705e148ec4856448/devtools/batchbuild.py#L106-L109