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
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
Wrapping/Python/paraview/servermanager.py
python
GetAssociationFromString
(val)
Returns array association integer value from its string representation
Returns array association integer value from its string representation
[ "Returns", "array", "association", "integer", "value", "from", "its", "string", "representation" ]
def GetAssociationFromString(val): """Returns array association integer value from its string representation""" global ASSOCIATIONS, _LEGACY_ASSOCIATIONS val = str(val).upper() try: return ASSOCIATIONS[val] except KeyError: try: return _LEGACY_ASSOCIATIONS[val] ex...
[ "def", "GetAssociationFromString", "(", "val", ")", ":", "global", "ASSOCIATIONS", ",", "_LEGACY_ASSOCIATIONS", "val", "=", "str", "(", "val", ")", ".", "upper", "(", ")", "try", ":", "return", "ASSOCIATIONS", "[", "val", "]", "except", "KeyError", ":", "t...
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/servermanager.py#L3186-L3196
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/tools/inspector_protocol/jinja2/sandbox.py
python
is_internal_attribute
(obj, attr)
return attr.startswith('__')
Test if the attribute given is an internal python attribute. For example this function returns `True` for the `func_code` attribute of python objects. This is useful if the environment method :meth:`~SandboxedEnvironment.is_safe_attribute` is overridden. >>> from jinja2.sandbox import is_internal_att...
Test if the attribute given is an internal python attribute. For example this function returns `True` for the `func_code` attribute of python objects. This is useful if the environment method :meth:`~SandboxedEnvironment.is_safe_attribute` is overridden.
[ "Test", "if", "the", "attribute", "given", "is", "an", "internal", "python", "attribute", ".", "For", "example", "this", "function", "returns", "True", "for", "the", "func_code", "attribute", "of", "python", "objects", ".", "This", "is", "useful", "if", "the...
def is_internal_attribute(obj, attr): """Test if the attribute given is an internal python attribute. For example this function returns `True` for the `func_code` attribute of python objects. This is useful if the environment method :meth:`~SandboxedEnvironment.is_safe_attribute` is overridden. >...
[ "def", "is_internal_attribute", "(", "obj", ",", "attr", ")", ":", "if", "isinstance", "(", "obj", ",", "types", ".", "FunctionType", ")", ":", "if", "attr", "in", "UNSAFE_FUNCTION_ATTRIBUTES", ":", "return", "True", "elif", "isinstance", "(", "obj", ",", ...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/inspector_protocol/jinja2/sandbox.py#L171-L204
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/msvc.py
python
EnvironmentInfo.OSLibraries
(self)
Microsoft Windows SDK Libraries. Return ------ list of str paths
Microsoft Windows SDK Libraries.
[ "Microsoft", "Windows", "SDK", "Libraries", "." ]
def OSLibraries(self): """ Microsoft Windows SDK Libraries. Return ------ list of str paths """ if self.vs_ver <= 10.0: arch_subdir = self.pi.target_dir(hidex86=True, x64=True) return [join(self.si.WindowsSdkDir, 'Lib%s' % arch...
[ "def", "OSLibraries", "(", "self", ")", ":", "if", "self", ".", "vs_ver", "<=", "10.0", ":", "arch_subdir", "=", "self", ".", "pi", ".", "target_dir", "(", "hidex86", "=", "True", ",", "x64", "=", "True", ")", "return", "[", "join", "(", "self", "....
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/msvc.py#L1354-L1371
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/closure_linter/closure_linter/statetracker.py
python
StateTracker.InBlock
(self)
return bool(self._block_depth)
Returns true if the current token is within a block. Returns: True if the current token is within a block.
Returns true if the current token is within a block.
[ "Returns", "true", "if", "the", "current", "token", "is", "within", "a", "block", "." ]
def InBlock(self): """Returns true if the current token is within a block. Returns: True if the current token is within a block. """ return bool(self._block_depth)
[ "def", "InBlock", "(", "self", ")", ":", "return", "bool", "(", "self", ".", "_block_depth", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/statetracker.py#L869-L875
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/idlelib/configHelpSourceEdit.py
python
GetHelpSourceDialog.MenuOk
(self)
return menuOk
Simple validity check for a sensible menu item name
Simple validity check for a sensible menu item name
[ "Simple", "validity", "check", "for", "a", "sensible", "menu", "item", "name" ]
def MenuOk(self): "Simple validity check for a sensible menu item name" menuOk = True menu = self.menu.get() menu.strip() if not menu: tkMessageBox.showerror(title='Menu Item Error', message='No menu item specified', ...
[ "def", "MenuOk", "(", "self", ")", ":", "menuOk", "=", "True", "menu", "=", "self", ".", "menu", ".", "get", "(", ")", "menu", ".", "strip", "(", ")", "if", "not", "menu", ":", "tkMessageBox", ".", "showerror", "(", "title", "=", "'Menu Item Error'",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/idlelib/configHelpSourceEdit.py#L99-L117
cztomczak/cefpython
5679f28cec18a57a56e298da2927aac8d8f83ad6
tools/toc.py
python
headinghash
(title)
return hash_
Get a link hash for a heading H1,H2,H3.
Get a link hash for a heading H1,H2,H3.
[ "Get", "a", "link", "hash", "for", "a", "heading", "H1", "H2", "H3", "." ]
def headinghash(title): """Get a link hash for a heading H1,H2,H3.""" hash_ = title.lower() hash_ = hash_.replace(" - ", "specialcase1") hash_ = hash_.replace(" / ", "specialcase2") hash_ = re.sub(r"[^a-z0-9_\- ]+", r"", hash_) hash_ = hash_.replace(" ", "-") hash_ = re.sub(r"[-]+", r"-", ha...
[ "def", "headinghash", "(", "title", ")", ":", "hash_", "=", "title", ".", "lower", "(", ")", "hash_", "=", "hash_", ".", "replace", "(", "\" - \"", ",", "\"specialcase1\"", ")", "hash_", "=", "hash_", ".", "replace", "(", "\" / \"", ",", "\"specialcase2\...
https://github.com/cztomczak/cefpython/blob/5679f28cec18a57a56e298da2927aac8d8f83ad6/tools/toc.py#L167-L178
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/cython/Cython/Debugger/libpython.py
python
PyObjectPtr.is_optimized_out
(self)
return self._gdbval.is_optimized_out
Is the value of the underlying PyObject* visible to the debugger? This can vary with the precise version of the compiler used to build Python, and the precise version of gdb. See e.g. https://bugzilla.redhat.com/show_bug.cgi?id=556975 with PyEval_EvalFrameEx's "f"
Is the value of the underlying PyObject* visible to the debugger?
[ "Is", "the", "value", "of", "the", "underlying", "PyObject", "*", "visible", "to", "the", "debugger?" ]
def is_optimized_out(self): ''' Is the value of the underlying PyObject* visible to the debugger? This can vary with the precise version of the compiler used to build Python, and the precise version of gdb. See e.g. https://bugzilla.redhat.com/show_bug.cgi?id=556975 with ...
[ "def", "is_optimized_out", "(", "self", ")", ":", "return", "self", ".", "_gdbval", ".", "is_optimized_out" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/cython/Cython/Debugger/libpython.py#L265-L275
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/ma/core.py
python
_recursive_fill_value
(dtype, f)
Recursively produce a fill value for `dtype`, calling f on scalar dtypes
Recursively produce a fill value for `dtype`, calling f on scalar dtypes
[ "Recursively", "produce", "a", "fill", "value", "for", "dtype", "calling", "f", "on", "scalar", "dtypes" ]
def _recursive_fill_value(dtype, f): """ Recursively produce a fill value for `dtype`, calling f on scalar dtypes """ if dtype.names is not None: vals = tuple(_recursive_fill_value(dtype[name], f) for name in dtype.names) return np.array(vals, dtype=dtype)[()] # decay to void scalar fro...
[ "def", "_recursive_fill_value", "(", "dtype", ",", "f", ")", ":", "if", "dtype", ".", "names", "is", "not", "None", ":", "vals", "=", "tuple", "(", "_recursive_fill_value", "(", "dtype", "[", "name", "]", ",", "f", ")", "for", "name", "in", "dtype", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/ma/core.py#L211-L223
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/idlelib/TreeWidget.py
python
TreeItem._IsExpandable
(self)
return self.expandable
Do not override! Called by TreeNode.
Do not override! Called by TreeNode.
[ "Do", "not", "override!", "Called", "by", "TreeNode", "." ]
def _IsExpandable(self): """Do not override! Called by TreeNode.""" if self.expandable is None: self.expandable = self.IsExpandable() return self.expandable
[ "def", "_IsExpandable", "(", "self", ")", ":", "if", "self", ".", "expandable", "is", "None", ":", "self", ".", "expandable", "=", "self", ".", "IsExpandable", "(", ")", "return", "self", ".", "expandable" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/idlelib/TreeWidget.py#L324-L328
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/ops/control_flow_ops.py
python
GradLoopState.pending_exits_count
(self, cnt)
Set the pending count to cnt.
Set the pending count to cnt.
[ "Set", "the", "pending", "count", "to", "cnt", "." ]
def pending_exits_count(self, cnt): """Set the pending count to cnt.""" self._pending_exits_count = cnt
[ "def", "pending_exits_count", "(", "self", ",", "cnt", ")", ":", "self", ".", "_pending_exits_count", "=", "cnt" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/control_flow_ops.py#L821-L823
RobotLocomotion/drake
0e18a34604c45ed65bc9018a54f7610f91cdad5b
examples/manipulation_station/end_effector_teleop_mouse.py
python
MouseKeyboardTeleop.SetXYZ
(self, xyz)
@param xyz is a 3 element vector of x, y, z.
[]
def SetXYZ(self, xyz): """ @param xyz is a 3 element vector of x, y, z. """ self.x = xyz[0] self.y = xyz[1] self.z = xyz[2]
[ "def", "SetXYZ", "(", "self", ",", "xyz", ")", ":", "self", ".", "x", "=", "xyz", "[", "0", "]", "self", ".", "y", "=", "xyz", "[", "1", "]", "self", ".", "z", "=", "xyz", "[", "2", "]" ]
https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/examples/manipulation_station/end_effector_teleop_mouse.py#L167-L173
cvmfs/cvmfs
4637bdb5153178eadf885c1acf37bdc5c685bf8a
cpplint.py
python
FindNextMultiLineCommentEnd
(lines, lineix)
return len(lines)
We are inside a comment, find the end marker.
We are inside a comment, find the end marker.
[ "We", "are", "inside", "a", "comment", "find", "the", "end", "marker", "." ]
def FindNextMultiLineCommentEnd(lines, lineix): """We are inside a comment, find the end marker.""" while lineix < len(lines): if lines[lineix].strip().endswith('*/'): return lineix lineix += 1 return len(lines)
[ "def", "FindNextMultiLineCommentEnd", "(", "lines", ",", "lineix", ")", ":", "while", "lineix", "<", "len", "(", "lines", ")", ":", "if", "lines", "[", "lineix", "]", ".", "strip", "(", ")", ".", "endswith", "(", "'*/'", ")", ":", "return", "lineix", ...
https://github.com/cvmfs/cvmfs/blob/4637bdb5153178eadf885c1acf37bdc5c685bf8a/cpplint.py#L1241-L1247
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/traitlets/py2/traitlets/config/application.py
python
get_config
()
Get the config object for the global Application instance, if there is one otherwise return an empty config object
Get the config object for the global Application instance, if there is one
[ "Get", "the", "config", "object", "for", "the", "global", "Application", "instance", "if", "there", "is", "one" ]
def get_config(): """Get the config object for the global Application instance, if there is one otherwise return an empty config object """ if Application.initialized(): return Application.instance().config else: return Config()
[ "def", "get_config", "(", ")", ":", "if", "Application", ".", "initialized", "(", ")", ":", "return", "Application", ".", "instance", "(", ")", ".", "config", "else", ":", "return", "Config", "(", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/traitlets/py2/traitlets/config/application.py#L703-L711
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/html.py
python
HtmlWinParser_AddTagHandler
(*args, **kwargs)
return _html.HtmlWinParser_AddTagHandler(*args, **kwargs)
HtmlWinParser_AddTagHandler(PyObject tagHandlerClass)
HtmlWinParser_AddTagHandler(PyObject tagHandlerClass)
[ "HtmlWinParser_AddTagHandler", "(", "PyObject", "tagHandlerClass", ")" ]
def HtmlWinParser_AddTagHandler(*args, **kwargs): """HtmlWinParser_AddTagHandler(PyObject tagHandlerClass)""" return _html.HtmlWinParser_AddTagHandler(*args, **kwargs)
[ "def", "HtmlWinParser_AddTagHandler", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html", ".", "HtmlWinParser_AddTagHandler", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/html.py#L449-L451
devsisters/libquic
8954789a056d8e7d5fcb6452fd1572ca57eb5c4e
boringssl/util/generate-asm-lcov.py
python
parse
(filename, data, current)
return out
Parses an annotated execution flow |data| from callgrind_annotate for source |filename| and updates the current execution counts from |current|.
Parses an annotated execution flow |data| from callgrind_annotate for source |filename| and updates the current execution counts from |current|.
[ "Parses", "an", "annotated", "execution", "flow", "|data|", "from", "callgrind_annotate", "for", "source", "|filename|", "and", "updates", "the", "current", "execution", "counts", "from", "|current|", "." ]
def parse(filename, data, current): """Parses an annotated execution flow |data| from callgrind_annotate for source |filename| and updates the current execution counts from |current|.""" with open(filename) as f: source = f.read().split('\n') out = current if out == None: out = [0 if is_asm(l) else N...
[ "def", "parse", "(", "filename", ",", "data", ",", "current", ")", ":", "with", "open", "(", "filename", ")", "as", "f", ":", "source", "=", "f", ".", "read", "(", ")", ".", "split", "(", "'\\n'", ")", "out", "=", "current", "if", "out", "==", ...
https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/boringssl/util/generate-asm-lcov.py#L60-L91
Samsung/veles
95ed733c2e49bc011ad98ccf2416ecec23fbf352
veles/external/freetype/__init__.py
python
Stroker.cubic_to
(self, control1, control2, to)
'Draw' a single quadratic Bezier in the stroker's current sub-path, from the last position. :param control1: A pointer to the first Bezier control point. :param control2: A pointer to second Bezier control point. :param to: A pointer to the destination point. **Note**: ...
'Draw' a single quadratic Bezier in the stroker's current sub-path, from the last position.
[ "Draw", "a", "single", "quadratic", "Bezier", "in", "the", "stroker", "s", "current", "sub", "-", "path", "from", "the", "last", "position", "." ]
def cubic_to(self, control1, control2, to): ''' 'Draw' a single quadratic Bezier in the stroker's current sub-path, from the last position. :param control1: A pointer to the first Bezier control point. :param control2: A pointer to second Bezier control point. :param t...
[ "def", "cubic_to", "(", "self", ",", "control1", ",", "control2", ",", "to", ")", ":", "error", "=", "FT_Stroker_CubicTo", "(", "self", ".", "_FT_Stroker", ",", "control1", ",", "control2", ",", "to", ")", "if", "error", ":", "raise", "FT_Exception", "("...
https://github.com/Samsung/veles/blob/95ed733c2e49bc011ad98ccf2416ecec23fbf352/veles/external/freetype/__init__.py#L1848-L1865
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/android/pylib/utils/chrome_proxy_utils.py
python
WPRServer.StartServer
(self, wpr_archive_path)
Starts a webpagereplay_go_server instance.
Starts a webpagereplay_go_server instance.
[ "Starts", "a", "webpagereplay_go_server", "instance", "." ]
def StartServer(self, wpr_archive_path): """Starts a webpagereplay_go_server instance.""" if wpr_archive_path == self._archive_path and self._server: # Reuse existing webpagereplay_go_server instance. return if self._server: self.StopServer() replay_options = [] if self._record_m...
[ "def", "StartServer", "(", "self", ",", "wpr_archive_path", ")", ":", "if", "wpr_archive_path", "==", "self", ".", "_archive_path", "and", "self", ".", "_server", ":", "# Reuse existing webpagereplay_go_server instance.", "return", "if", "self", ".", "_server", ":",...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/pylib/utils/chrome_proxy_utils.py#L31-L56
ValveSoftware/source-sdk-2013
0d8dceea4310fde5706b3ce1c70609d72a38efdf
sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/descriptor.py
python
Descriptor.__init__
(self, name, full_name, filename, containing_type, fields, nested_types, enum_types, extensions, options=None, is_extendable=True, extension_ranges=None, file=None, serialized_start=None, serialized_end=None)
Arguments to __init__() are as described in the description of Descriptor fields above. Note that filename is an obsolete argument, that is not used anymore. Please use file.name to access this as an attribute.
Arguments to __init__() are as described in the description of Descriptor fields above.
[ "Arguments", "to", "__init__", "()", "are", "as", "described", "in", "the", "description", "of", "Descriptor", "fields", "above", "." ]
def __init__(self, name, full_name, filename, containing_type, fields, nested_types, enum_types, extensions, options=None, is_extendable=True, extension_ranges=None, file=None, serialized_start=None, serialized_end=None): """Arguments to __init__() are as described in th...
[ "def", "__init__", "(", "self", ",", "name", ",", "full_name", ",", "filename", ",", "containing_type", ",", "fields", ",", "nested_types", ",", "enum_types", ",", "extensions", ",", "options", "=", "None", ",", "is_extendable", "=", "True", ",", "extension_...
https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/descriptor.py#L210-L254
gtcasl/gpuocelot
fa63920ee7c5f9a86e264cd8acd4264657cbd190
ocelot/scripts/build_environment.py
python
getGLEW
(env, enabled)
return (glew,bin_path,lib_path,inc_path,libs)
Determines GLEW {bin_path,lib_path,include_path,libs} and is it installed? returns (have_glew,bin_path,lib_path,inc_path,libs)
Determines GLEW {bin_path,lib_path,include_path,libs} and is it installed?
[ "Determines", "GLEW", "{", "bin_path", "lib_path", "include_path", "libs", "}", "and", "is", "it", "installed?" ]
def getGLEW(env, enabled): """Determines GLEW {bin_path,lib_path,include_path,libs} and is it installed? returns (have_glew,bin_path,lib_path,inc_path,libs) """ configure = Configure(env) glew = configure.CheckLib('GLEW') if not enabled: print "Glew disabled by user" return (False, [], [], [], []) if...
[ "def", "getGLEW", "(", "env", ",", "enabled", ")", ":", "configure", "=", "Configure", "(", "env", ")", "glew", "=", "configure", ".", "CheckLib", "(", "'GLEW'", ")", "if", "not", "enabled", ":", "print", "\"Glew disabled by user\"", "return", "(", "False"...
https://github.com/gtcasl/gpuocelot/blob/fa63920ee7c5f9a86e264cd8acd4264657cbd190/ocelot/scripts/build_environment.py#L146-L192
gemrb/gemrb
730206eed8d1dd358ca5e69a62f9e099aa22ffc6
gemrb/GUIScripts/InventoryCommon.py
python
IdentifyUseScroll
()
return
Identifies the item with a scroll or other item.
Identifies the item with a scroll or other item.
[ "Identifies", "the", "item", "with", "a", "scroll", "or", "other", "item", "." ]
def IdentifyUseScroll (): """Identifies the item with a scroll or other item.""" global ItemIdentifyWindow pc = GemRB.GameGetSelectedPCSingle () slot = GemRB.GetVar ("ItemButton") if ItemIdentifyWindow: ItemIdentifyWindow.Unload () if ItemInfoWindow: ItemInfoWindow.Unload () if GemRB.HasSpecialItem (pc, 1,...
[ "def", "IdentifyUseScroll", "(", ")", ":", "global", "ItemIdentifyWindow", "pc", "=", "GemRB", ".", "GameGetSelectedPCSingle", "(", ")", "slot", "=", "GemRB", ".", "GetVar", "(", "\"ItemButton\"", ")", "if", "ItemIdentifyWindow", ":", "ItemIdentifyWindow", ".", ...
https://github.com/gemrb/gemrb/blob/730206eed8d1dd358ca5e69a62f9e099aa22ffc6/gemrb/GUIScripts/InventoryCommon.py#L940-L955
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/typing/templates.py
python
Signature.is_method
(self)
return self.recvr is not None
Whether this signature represents a bound method or a regular function.
Whether this signature represents a bound method or a regular function.
[ "Whether", "this", "signature", "represents", "a", "bound", "method", "or", "a", "regular", "function", "." ]
def is_method(self): """ Whether this signature represents a bound method or a regular function. """ return self.recvr is not None
[ "def", "is_method", "(", "self", ")", ":", "return", "self", ".", "recvr", "is", "not", "None" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/typing/templates.py#L83-L88
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/directtools/DirectUtil.py
python
lerpBackgroundColor
(r, g, b, duration)
Function to lerp background color to a new value
Function to lerp background color to a new value
[ "Function", "to", "lerp", "background", "color", "to", "a", "new", "value" ]
def lerpBackgroundColor(r, g, b, duration): """ Function to lerp background color to a new value """ def lerpColor(state): dt = base.clock.getDt() state.time += dt sf = state.time / state.duration if sf >= 1.0: base.setBackgroundColor(state.ec[0], state.ec[1],...
[ "def", "lerpBackgroundColor", "(", "r", ",", "g", ",", "b", ",", "duration", ")", ":", "def", "lerpColor", "(", "state", ")", ":", "dt", "=", "base", ".", "clock", ".", "getDt", "(", ")", "state", ".", "time", "+=", "dt", "sf", "=", "state", ".",...
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/directtools/DirectUtil.py#L34-L56
yyzybb537/libgo
4af17b7c67643c4d54aa354dcc77963ea07847d0
third_party/boost.context/tools/build/src/tools/stage.py
python
InstallTargetClass.update_location
(self, ps)
return ps
If <location> is not set, sets it based on the project data.
If <location> is not set, sets it based on the project data.
[ "If", "<location", ">", "is", "not", "set", "sets", "it", "based", "on", "the", "project", "data", "." ]
def update_location(self, ps): """If <location> is not set, sets it based on the project data.""" loc = ps.get('location') if not loc: loc = os.path.join(self.project().get('location'), self.name()) ps = ps.add_raw(["<location>" + loc]) return ps
[ "def", "update_location", "(", "self", ",", "ps", ")", ":", "loc", "=", "ps", ".", "get", "(", "'location'", ")", "if", "not", "loc", ":", "loc", "=", "os", ".", "path", ".", "join", "(", "self", ".", "project", "(", ")", ".", "get", "(", "'loc...
https://github.com/yyzybb537/libgo/blob/4af17b7c67643c4d54aa354dcc77963ea07847d0/third_party/boost.context/tools/build/src/tools/stage.py#L41-L49
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
libcxx/utils/gdb/libcxx/printers.py
python
AbstractUnorderedCollectionPrinter._get_key_value
(self, node)
Subclasses should override to return a list of values to yield.
Subclasses should override to return a list of values to yield.
[ "Subclasses", "should", "override", "to", "return", "a", "list", "of", "values", "to", "yield", "." ]
def _get_key_value(self, node): """Subclasses should override to return a list of values to yield.""" raise NotImplementedError
[ "def", "_get_key_value", "(", "self", ",", "node", ")", ":", "raise", "NotImplementedError" ]
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/libcxx/utils/gdb/libcxx/printers.py#L816-L818
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vendor/distlib/database.py
python
make_dist
(name, version, **kwargs)
return Distribution(md)
A convenience method for making a dist given just a name and version.
A convenience method for making a dist given just a name and version.
[ "A", "convenience", "method", "for", "making", "a", "dist", "given", "just", "a", "name", "and", "version", "." ]
def make_dist(name, version, **kwargs): """ A convenience method for making a dist given just a name and version. """ md = Metadata(**kwargs) md['Name'] = name md['Version'] = version return Distribution(md)
[ "def", "make_dist", "(", "name", ",", "version", ",", "*", "*", "kwargs", ")", ":", "md", "=", "Metadata", "(", "*", "*", "kwargs", ")", "md", "[", "'Name'", "]", "=", "name", "md", "[", "'Version'", "]", "=", "version", "return", "Distribution", "...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vendor/distlib/database.py#L1294-L1301
MegEngine/MegEngine
ce9ad07a27ec909fb8db4dd67943d24ba98fb93a
imperative/python/megengine/quantization/observer.py
python
PassiveObserver.forward
(self, x)
return x
r"""Just return input because :attr:`qparams` is set by :func:`~.apply_easy_quant`.
r"""Just return input because :attr:`qparams` is set by :func:`~.apply_easy_quant`.
[ "r", "Just", "return", "input", "because", ":", "attr", ":", "qparams", "is", "set", "by", ":", "func", ":", "~", ".", "apply_easy_quant", "." ]
def forward(self, x): r"""Just return input because :attr:`qparams` is set by :func:`~.apply_easy_quant`.""" return x
[ "def", "forward", "(", "self", ",", "x", ")", ":", "return", "x" ]
https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/quantization/observer.py#L526-L528
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
FileCtrl.SetDirectory
(*args, **kwargs)
return _controls_.FileCtrl_SetDirectory(*args, **kwargs)
SetDirectory(self, String dir) -> bool
SetDirectory(self, String dir) -> bool
[ "SetDirectory", "(", "self", "String", "dir", ")", "-", ">", "bool" ]
def SetDirectory(*args, **kwargs): """SetDirectory(self, String dir) -> bool""" return _controls_.FileCtrl_SetDirectory(*args, **kwargs)
[ "def", "SetDirectory", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "FileCtrl_SetDirectory", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L7663-L7665
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/wizard.py
python
PyWizardPage.DoSetVirtualSize
(*args, **kwargs)
return _wizard.PyWizardPage_DoSetVirtualSize(*args, **kwargs)
DoSetVirtualSize(self, int x, int y)
DoSetVirtualSize(self, int x, int y)
[ "DoSetVirtualSize", "(", "self", "int", "x", "int", "y", ")" ]
def DoSetVirtualSize(*args, **kwargs): """DoSetVirtualSize(self, int x, int y)""" return _wizard.PyWizardPage_DoSetVirtualSize(*args, **kwargs)
[ "def", "DoSetVirtualSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_wizard", ".", "PyWizardPage_DoSetVirtualSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/wizard.py#L163-L165
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/email/message.py
python
_formatparam
(param, value=None, quote=True)
Convenience function to format and return a key=value pair. This will quote the value if needed or if quote is true. If value is a three tuple (charset, language, value), it will be encoded according to RFC2231 rules.
Convenience function to format and return a key=value pair.
[ "Convenience", "function", "to", "format", "and", "return", "a", "key", "=", "value", "pair", "." ]
def _formatparam(param, value=None, quote=True): """Convenience function to format and return a key=value pair. This will quote the value if needed or if quote is true. If value is a three tuple (charset, language, value), it will be encoded according to RFC2231 rules. """ if value is not None...
[ "def", "_formatparam", "(", "param", ",", "value", "=", "None", ",", "quote", "=", "True", ")", ":", "if", "value", "is", "not", "None", "and", "len", "(", "value", ")", ">", "0", ":", "# A tuple is used for RFC 2231 encoded parameter values where items", "# a...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/email/message.py#L38-L60
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/meta/bytecodetools/bytecode_consumer.py
python
ByteCodeConsumer.instruction_pre
(self, instr)
consumer calls this instruction before every instruction.
consumer calls this instruction before every instruction.
[ "consumer", "calls", "this", "instruction", "before", "every", "instruction", "." ]
def instruction_pre(self, instr): """ consumer calls this instruction before every instruction. """
[ "def", "instruction_pre", "(", "self", ",", "instr", ")", ":" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/meta/bytecodetools/bytecode_consumer.py#L44-L47
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/tools/docs/parser.py
python
_ModulePageInfo.collect_docs_for_module
(self, parser_config)
Collect information necessary specifically for a module's doc page. Mainly this is information about the members of the module. Args: parser_config: An instance of ParserConfig.
Collect information necessary specifically for a module's doc page.
[ "Collect", "information", "necessary", "specifically", "for", "a", "module", "s", "doc", "page", "." ]
def collect_docs_for_module(self, parser_config): """Collect information necessary specifically for a module's doc page. Mainly this is information about the members of the module. Args: parser_config: An instance of ParserConfig. """ relative_path = os.path.relpath( path='.', ...
[ "def", "collect_docs_for_module", "(", "self", ",", "parser_config", ")", ":", "relative_path", "=", "os", ".", "path", ".", "relpath", "(", "path", "=", "'.'", ",", "start", "=", "os", ".", "path", ".", "dirname", "(", "documentation_path", "(", "self", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/tools/docs/parser.py#L1267-L1305
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/buildscripts/idl/idl/errors.py
python
ParserContext.add_bad_bson_type_error
(self, location, ast_type, ast_parent, bson_type_name)
Add an error about a bad bson type.
Add an error about a bad bson type.
[ "Add", "an", "error", "about", "a", "bad", "bson", "type", "." ]
def add_bad_bson_type_error(self, location, ast_type, ast_parent, bson_type_name): # type: (common.SourceLocation, unicode, unicode, unicode) -> None """Add an error about a bad bson type.""" self._add_error(location, ERROR_ID_BAD_BSON_TYPE, "BSON Type '%s' is not recogni...
[ "def", "add_bad_bson_type_error", "(", "self", ",", "location", ",", "ast_type", ",", "ast_parent", ",", "bson_type_name", ")", ":", "# type: (common.SourceLocation, unicode, unicode, unicode) -> None", "self", ".", "_add_error", "(", "location", ",", "ERROR_ID_BAD_BSON_TYP...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/idl/idl/errors.py#L347-L352
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/grid.py
python
Grid.GetColSizes
(*args, **kwargs)
return _grid.Grid_GetColSizes(*args, **kwargs)
GetColSizes(self) -> GridSizesInfo
GetColSizes(self) -> GridSizesInfo
[ "GetColSizes", "(", "self", ")", "-", ">", "GridSizesInfo" ]
def GetColSizes(*args, **kwargs): """GetColSizes(self) -> GridSizesInfo""" return _grid.Grid_GetColSizes(*args, **kwargs)
[ "def", "GetColSizes", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_GetColSizes", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L1846-L1848
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/telemetry/internal/platform/tracing_agent/__init__.py
python
TracingAgent.CollectAgentTraceData
(self, trace_data_builder, timeout=None)
Override to add agent's custom logic to collect tracing data.
Override to add agent's custom logic to collect tracing data.
[ "Override", "to", "add", "agent", "s", "custom", "logic", "to", "collect", "tracing", "data", "." ]
def CollectAgentTraceData(self, trace_data_builder, timeout=None): """ Override to add agent's custom logic to collect tracing data. """ del trace_data_builder del timeout raise NotImplementedError
[ "def", "CollectAgentTraceData", "(", "self", ",", "trace_data_builder", ",", "timeout", "=", "None", ")", ":", "del", "trace_data_builder", "del", "timeout", "raise", "NotImplementedError" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/internal/platform/tracing_agent/__init__.py#L94-L98
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/knobctrl.py
python
KnobCtrl.GetMaxValue
(self)
return self._maxvalue
Returns the maximum value for :class:`KnobCtrl`.
Returns the maximum value for :class:`KnobCtrl`.
[ "Returns", "the", "maximum", "value", "for", ":", "class", ":", "KnobCtrl", "." ]
def GetMaxValue(self): """ Returns the maximum value for :class:`KnobCtrl`. """ return self._maxvalue
[ "def", "GetMaxValue", "(", "self", ")", ":", "return", "self", ".", "_maxvalue" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/knobctrl.py#L454-L457
simsong/bulk_extractor
738911df22b7066ca9e1662f4131fb44090a4196
python/xmltodict.py
python
unparse
(input_dict, output=None, encoding='utf-8', full_document=True, **kwargs)
Emit an XML document for the given `input_dict` (reverse of `parse`). The resulting XML document is returned as a string, but if `output` (a file-like object) is specified, it is written there instead. Dictionary keys prefixed with `attr_prefix` (default=`'@'`) are interpreted as XML node attributes, ...
Emit an XML document for the given `input_dict` (reverse of `parse`).
[ "Emit", "an", "XML", "document", "for", "the", "given", "input_dict", "(", "reverse", "of", "parse", ")", "." ]
def unparse(input_dict, output=None, encoding='utf-8', full_document=True, **kwargs): """Emit an XML document for the given `input_dict` (reverse of `parse`). The resulting XML document is returned as a string, but if `output` (a file-like object) is specified, it is written there instead. ...
[ "def", "unparse", "(", "input_dict", ",", "output", "=", "None", ",", "encoding", "=", "'utf-8'", ",", "full_document", "=", "True", ",", "*", "*", "kwargs", ")", ":", "(", "(", "key", ",", "value", ")", ",", ")", "=", "input_dict", ".", "items", "...
https://github.com/simsong/bulk_extractor/blob/738911df22b7066ca9e1662f4131fb44090a4196/python/xmltodict.py#L306-L339
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/sipconfig.py
python
ModuleMakefile.generate_target_default
(self, mfile)
Generate the default target. mfile is the file object.
Generate the default target.
[ "Generate", "the", "default", "target", "." ]
def generate_target_default(self, mfile): """Generate the default target. mfile is the file object. """ # Do these first so that it's safe for a sub-class to append additional # commands to the real target, but make sure the default is correct. mfile.write("\nall: $(TARG...
[ "def", "generate_target_default", "(", "self", ",", "mfile", ")", ":", "# Do these first so that it's safe for a sub-class to append additional", "# commands to the real target, but make sure the default is correct.", "mfile", ".", "write", "(", "\"\\nall: $(TARGET)\\n\"", ")", "mfil...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/sipconfig.py#L1729-L1805
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/catkin_pkg/cmake.py
python
configure_string
(template, environment)
return re.sub('\@[a-zA-Z0-9_]+\@', substitute, template)
Substitute variables enclosed by @ characters. :param template: the template, ``str`` :param environment: dictionary of placeholders to substitute, ``dict`` :returns: string with evaluates template :raises: KeyError for placeholders in the template which are not in the environment
Substitute variables enclosed by @ characters.
[ "Substitute", "variables", "enclosed", "by", "@", "characters", "." ]
def configure_string(template, environment): ''' Substitute variables enclosed by @ characters. :param template: the template, ``str`` :param environment: dictionary of placeholders to substitute, ``dict`` :returns: string with evaluates template :raises: KeyError for placeholders in the ...
[ "def", "configure_string", "(", "template", ",", "environment", ")", ":", "def", "substitute", "(", "match", ")", ":", "var", "=", "match", ".", "group", "(", "0", ")", "[", "1", ":", "-", "1", "]", "return", "environment", "[", "var", "]", "return",...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/catkin_pkg/cmake.py#L66-L80
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/panel.py
python
Panel._construct_return_type
(self, result, axes=None)
Return the type for the ndim of the result.
Return the type for the ndim of the result.
[ "Return", "the", "type", "for", "the", "ndim", "of", "the", "result", "." ]
def _construct_return_type(self, result, axes=None): """ Return the type for the ndim of the result. """ ndim = getattr(result, 'ndim', None) # need to assume they are the same if ndim is None: if isinstance(result, dict): ndim = getattr(list(...
[ "def", "_construct_return_type", "(", "self", ",", "result", ",", "axes", "=", "None", ")", ":", "ndim", "=", "getattr", "(", "result", ",", "'ndim'", ",", "None", ")", "# need to assume they are the same", "if", "ndim", "is", "None", ":", "if", "isinstance"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/panel.py#L1181-L1215
NVIDIAGameWorks/kaolin
e5148d05e9c1e2ce92a07881ce3593b1c5c3f166
kaolin/ops/mesh/tetmesh.py
python
inverse_vertices_offset
(tet_vertices)
return inverse_offset_matrix
r"""Given tetrahedrons with 4 vertices A, B, C, D. Compute the inverse of the offset matrix w.r.t. vertex A for each tetrahedron. The offset matrix is obtained by the concatenation of :math:`B - A`, :math:`C - A` and :math:`D - A`. The resulting shape of the offset matrix is :math:`(\text{batch_size}, \...
r"""Given tetrahedrons with 4 vertices A, B, C, D. Compute the inverse of the offset matrix w.r.t. vertex A for each tetrahedron. The offset matrix is obtained by the concatenation of :math:`B - A`, :math:`C - A` and :math:`D - A`. The resulting shape of the offset matrix is :math:`(\text{batch_size}, \...
[ "r", "Given", "tetrahedrons", "with", "4", "vertices", "A", "B", "C", "D", ".", "Compute", "the", "inverse", "of", "the", "offset", "matrix", "w", ".", "r", ".", "t", ".", "vertex", "A", "for", "each", "tetrahedron", ".", "The", "offset", "matrix", "...
def inverse_vertices_offset(tet_vertices): r"""Given tetrahedrons with 4 vertices A, B, C, D. Compute the inverse of the offset matrix w.r.t. vertex A for each tetrahedron. The offset matrix is obtained by the concatenation of :math:`B - A`, :math:`C - A` and :math:`D - A`. The resulting shape of th...
[ "def", "inverse_vertices_offset", "(", "tet_vertices", ")", ":", "_validate_tet_vertices", "(", "tet_vertices", ")", "# split the tensor", "A", ",", "B", ",", "C", ",", "D", "=", "torch", ".", "split", "(", "tet_vertices", ",", "split_size_or_sections", "=", "1"...
https://github.com/NVIDIAGameWorks/kaolin/blob/e5148d05e9c1e2ce92a07881ce3593b1c5c3f166/kaolin/ops/mesh/tetmesh.py#L37-L78
glotzerlab/hoomd-blue
f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a
hoomd/variant.py
python
Variant.__setstate__
(self, state)
Restore the state of the variant.
Restore the state of the variant.
[ "Restore", "the", "state", "of", "the", "variant", "." ]
def __setstate__(self, state): """Restore the state of the variant.""" _hoomd.Variant.__init__(self) self.__dict__ = state
[ "def", "__setstate__", "(", "self", ",", "state", ")", ":", "_hoomd", ".", "Variant", ".", "__init__", "(", "self", ")", "self", ".", "__dict__", "=", "state" ]
https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/variant.py#L53-L56
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/safely-roll-deps.py
python
process_deps
(path, project, new_rev, is_dry_run)
return old_rev
Update project_revision to |new_issue|. A bit hacky, could it be made better?
Update project_revision to |new_issue|.
[ "Update", "project_revision", "to", "|new_issue|", "." ]
def process_deps(path, project, new_rev, is_dry_run): """Update project_revision to |new_issue|. A bit hacky, could it be made better? """ content = open(path).read() # Hack for Blink to get the AutoRollBot running again. if project == "blink": project = "webkit" old_line = r"(\s+)'%s_revision': '([0...
[ "def", "process_deps", "(", "path", ",", "project", ",", "new_rev", ",", "is_dry_run", ")", ":", "content", "=", "open", "(", "path", ")", ".", "read", "(", ")", "# Hack for Blink to get the AutoRollBot running again.", "if", "project", "==", "\"blink\"", ":", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/safely-roll-deps.py#L30-L48
msracver/Deep-Image-Analogy
632b9287b42552e32dad64922967c8c9ec7fc4d3
scripts/cpp_lint.py
python
CheckInvalidIncrement
(filename, clean_lines, linenum, error)
Checks for invalid increment *count++. For example following function: void increment_counter(int* count) { *count++; } is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*count, (*count)++ or *count += 1. Args: filename: The name of the current file. ...
Checks for invalid increment *count++.
[ "Checks", "for", "invalid", "increment", "*", "count", "++", "." ]
def CheckInvalidIncrement(filename, clean_lines, linenum, error): """Checks for invalid increment *count++. For example following function: void increment_counter(int* count) { *count++; } is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*count, (*count)++ ...
[ "def", "CheckInvalidIncrement", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "if", "_RE_PATTERN_INVALID_INCREMENT", ".", "match", "(", "line", ")", ":", "error", ...
https://github.com/msracver/Deep-Image-Analogy/blob/632b9287b42552e32dad64922967c8c9ec7fc4d3/scripts/cpp_lint.py#L1733-L1752
CanalTP/navitia
cb84ce9859070187e708818b058e6a7e0b7f891b
source/jormungandr/jormungandr/interfaces/v1/swagger_schema.py
python
get_schema_properties
(serializer)
return properties, external_definitions
create the schema from a serpy serializer for each serializer field, we'll search for it's schema All complex fields (a field that is another serializer), we add the field's serializer to the external definitions
create the schema from a serpy serializer
[ "create", "the", "schema", "from", "a", "serpy", "serializer" ]
def get_schema_properties(serializer): """ create the schema from a serpy serializer for each serializer field, we'll search for it's schema All complex fields (a field that is another serializer), we add the field's serializer to the external definitions """ external_definitions = [] p...
[ "def", "get_schema_properties", "(", "serializer", ")", ":", "external_definitions", "=", "[", "]", "properties", "=", "{", "}", "for", "field_name", ",", "field", "in", "serializer", ".", "_field_map", ".", "items", "(", ")", ":", "schema", "=", "{", "}",...
https://github.com/CanalTP/navitia/blob/cb84ce9859070187e708818b058e6a7e0b7f891b/source/jormungandr/jormungandr/interfaces/v1/swagger_schema.py#L208-L258
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/lamb_next_mv.py
python
_lamb_next_mv_tbe
()
return
LambNextMV TBE register
LambNextMV TBE register
[ "LambNextMV", "TBE", "register" ]
def _lamb_next_mv_tbe(): """LambNextMV TBE register""" return
[ "def", "_lamb_next_mv_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/lamb_next_mv.py#L57-L59
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_gdi.py
python
FontEnumerator.EnumerateFacenames
(*args, **kwargs)
return _gdi_.FontEnumerator_EnumerateFacenames(*args, **kwargs)
EnumerateFacenames(self, int encoding=FONTENCODING_SYSTEM, bool fixedWidthOnly=False) -> bool
EnumerateFacenames(self, int encoding=FONTENCODING_SYSTEM, bool fixedWidthOnly=False) -> bool
[ "EnumerateFacenames", "(", "self", "int", "encoding", "=", "FONTENCODING_SYSTEM", "bool", "fixedWidthOnly", "=", "False", ")", "-", ">", "bool" ]
def EnumerateFacenames(*args, **kwargs): """EnumerateFacenames(self, int encoding=FONTENCODING_SYSTEM, bool fixedWidthOnly=False) -> bool""" return _gdi_.FontEnumerator_EnumerateFacenames(*args, **kwargs)
[ "def", "EnumerateFacenames", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "FontEnumerator_EnumerateFacenames", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L2750-L2752
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/pdb.py
python
Pdb.checkline
(self, filename, lineno)
return lineno
Check whether specified line seems to be executable. Return `lineno` if it is, 0 if not (e.g. a docstring, comment, blank line or EOF). Warning: testing is not comprehensive.
Check whether specified line seems to be executable.
[ "Check", "whether", "specified", "line", "seems", "to", "be", "executable", "." ]
def checkline(self, filename, lineno): """Check whether specified line seems to be executable. Return `lineno` if it is, 0 if not (e.g. a docstring, comment, blank line or EOF). Warning: testing is not comprehensive. """ # this method should be callable before starting debugging...
[ "def", "checkline", "(", "self", ",", "filename", ",", "lineno", ")", ":", "# this method should be callable before starting debugging, so default", "# to \"no globals\" if there is no current frame", "globs", "=", "self", ".", "curframe", ".", "f_globals", "if", "hasattr", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/pdb.py#L472-L491
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/html.py
python
HtmlCell.IsTerminalCell
(*args, **kwargs)
return _html.HtmlCell_IsTerminalCell(*args, **kwargs)
IsTerminalCell(self) -> bool
IsTerminalCell(self) -> bool
[ "IsTerminalCell", "(", "self", ")", "-", ">", "bool" ]
def IsTerminalCell(*args, **kwargs): """IsTerminalCell(self) -> bool""" return _html.HtmlCell_IsTerminalCell(*args, **kwargs)
[ "def", "IsTerminalCell", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html", ".", "HtmlCell_IsTerminalCell", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/html.py#L710-L712
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
bindings/python/cntk/internal/__init__.py
python
_value_as_sequence
(val, var)
return val.as_sequences(var)
Helper function to hide map_if_possible().
Helper function to hide map_if_possible().
[ "Helper", "function", "to", "hide", "map_if_possible", "()", "." ]
def _value_as_sequence(val, var): ''' Helper function to hide map_if_possible(). ''' map_if_possible(val) return val.as_sequences(var)
[ "def", "_value_as_sequence", "(", "val", ",", "var", ")", ":", "map_if_possible", "(", "val", ")", "return", "val", ".", "as_sequences", "(", "var", ")" ]
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/internal/__init__.py#L12-L17
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/graph_editor/edit.py
python
detach
(sgv, control_inputs=False, control_outputs=None, control_ios=None)
return sgv, detached_inputs, detached_outputs
Detach both the inputs and the outputs of a subgraph view. Args: sgv: the subgraph view to be detached. This argument is converted to a subgraph using the same rules as the function subgraph.make_view. Note that sgv is modified in place. control_inputs: A boolean indicating whether control inputs...
Detach both the inputs and the outputs of a subgraph view.
[ "Detach", "both", "the", "inputs", "and", "the", "outputs", "of", "a", "subgraph", "view", "." ]
def detach(sgv, control_inputs=False, control_outputs=None, control_ios=None): """Detach both the inputs and the outputs of a subgraph view. Args: sgv: the subgraph view to be detached. This argument is converted to a subgraph using the same rules as the function subgraph.make_view. Note that sgv i...
[ "def", "detach", "(", "sgv", ",", "control_inputs", "=", "False", ",", "control_outputs", "=", "None", ",", "control_ios", "=", "None", ")", ":", "control_inputs", ",", "control_outputs", "=", "select", ".", "check_cios", "(", "control_inputs", ",", "control_o...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/graph_editor/edit.py#L141-L169
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/urllib3/util/url.py
python
parse_url
(url)
return Url( scheme=ensure_type(scheme), auth=ensure_type(auth), host=ensure_type(host), port=port, path=ensure_type(path), query=ensure_type(query), fragment=ensure_type(fragment), )
Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is performed to parse incomplete urls. Fields not provided will be None. This parser is RFC 3986 compliant. The parser logic and helper functions are based heavily on work done in the ``rfc3986`` module. :param str url: URL ...
[]
def parse_url(url): """ Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is performed to parse incomplete urls. Fields not provided will be None. This parser is RFC 3986 compliant. The parser logic and helper functions are based heavily on work done in the ``rfc3986`` m...
[ "def", "parse_url", "(", "url", ")", ":", "if", "not", "url", ":", "# Empty", "return", "Url", "(", ")", "source_url", "=", "url", "if", "not", "SCHEME_RE", ".", "search", "(", "url", ")", ":", "url", "=", "\"//\"", "+", "url", "try", ":", "scheme"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/urllib3/util/url.py#L659-L843
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqt/mantidqt/plotting/markers.py
python
SingleMarker.add_all_annotations
(self)
Add all previously added annotations
Add all previously added annotations
[ "Add", "all", "previously", "added", "annotations" ]
def add_all_annotations(self): """Add all previously added annotations""" for label in self.annotations: self.add_annotate(label)
[ "def", "add_all_annotations", "(", "self", ")", ":", "for", "label", "in", "self", ".", "annotations", ":", "self", ".", "add_annotate", "(", "label", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/plotting/markers.py#L913-L916
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/variables.py
python
initialize_local_variables
()
return local_variables_initializer()
See `tf.compat.v1.local_variables_initializer`.
See `tf.compat.v1.local_variables_initializer`.
[ "See", "tf", ".", "compat", ".", "v1", ".", "local_variables_initializer", "." ]
def initialize_local_variables(): """See `tf.compat.v1.local_variables_initializer`.""" return local_variables_initializer()
[ "def", "initialize_local_variables", "(", ")", ":", "return", "local_variables_initializer", "(", ")" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/variables.py#L3268-L3270
perilouswithadollarsign/cstrike15_src
f82112a2388b841d72cb62ca48ab1846dfcc11c8
thirdparty/protobuf-2.5.0/python/google/protobuf/message.py
python
Message.HasField
(self, field_name)
Checks if a certain field is set for the message. Note if the field_name is not defined in the message descriptor, ValueError will be raised.
Checks if a certain field is set for the message. Note if the field_name is not defined in the message descriptor, ValueError will be raised.
[ "Checks", "if", "a", "certain", "field", "is", "set", "for", "the", "message", ".", "Note", "if", "the", "field_name", "is", "not", "defined", "in", "the", "message", "descriptor", "ValueError", "will", "be", "raised", "." ]
def HasField(self, field_name): """Checks if a certain field is set for the message. Note if the field_name is not defined in the message descriptor, ValueError will be raised.""" raise NotImplementedError
[ "def", "HasField", "(", "self", ",", "field_name", ")", ":", "raise", "NotImplementedError" ]
https://github.com/perilouswithadollarsign/cstrike15_src/blob/f82112a2388b841d72cb62ca48ab1846dfcc11c8/thirdparty/protobuf-2.5.0/python/google/protobuf/message.py#L231-L235
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/html.py
python
HtmlCell.ProcessMouseClick
(*args, **kwargs)
return _html.HtmlCell_ProcessMouseClick(*args, **kwargs)
ProcessMouseClick(self, HtmlWindowInterface window, Point pos, MouseEvent event) -> bool
ProcessMouseClick(self, HtmlWindowInterface window, Point pos, MouseEvent event) -> bool
[ "ProcessMouseClick", "(", "self", "HtmlWindowInterface", "window", "Point", "pos", "MouseEvent", "event", ")", "-", ">", "bool" ]
def ProcessMouseClick(*args, **kwargs): """ProcessMouseClick(self, HtmlWindowInterface window, Point pos, MouseEvent event) -> bool""" return _html.HtmlCell_ProcessMouseClick(*args, **kwargs)
[ "def", "ProcessMouseClick", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html", ".", "HtmlCell_ProcessMouseClick", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/html.py#L698-L700
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/command/sdist.py
python
sdist.prune_file_list
(self)
Prune off branches that might slip into the file list as created by 'read_template()', but really don't belong there: * the build tree (typically "build") * the release tree itself (only an issue if we ran "sdist" previously with --keep-temp, or it aborted) * any RCS, C...
Prune off branches that might slip into the file list as created by 'read_template()', but really don't belong there: * the build tree (typically "build") * the release tree itself (only an issue if we ran "sdist" previously with --keep-temp, or it aborted) * any RCS, C...
[ "Prune", "off", "branches", "that", "might", "slip", "into", "the", "file", "list", "as", "created", "by", "read_template", "()", "but", "really", "don", "t", "belong", "there", ":", "*", "the", "build", "tree", "(", "typically", "build", ")", "*", "the"...
def prune_file_list(self): """Prune off branches that might slip into the file list as created by 'read_template()', but really don't belong there: * the build tree (typically "build") * the release tree itself (only an issue if we ran "sdist" previously with --keep-temp,...
[ "def", "prune_file_list", "(", "self", ")", ":", "build", "=", "self", ".", "get_finalized_command", "(", "'build'", ")", "base_dir", "=", "self", ".", "distribution", ".", "get_fullname", "(", ")", "self", ".", "filelist", ".", "exclude_pattern", "(", "None...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/command/sdist.py#L353-L375
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/numpy/math_ops.py
python
arctan2
(x1, x2, dtype=None)
return _apply_tensor_op(F.atan2, x1, x2, dtype=dtype)
Element-wise arc tangent of :math:`x1/x2` choosing the quadrant correctly. Note: Numpy arguments `out`, `where`, `casting`, `order`, `subok`, `signature`, and `extobj` are not supported. Args: x1 (Tensor): input tensor. x2 (Tensor): input tensor. dtype (:class:`mindspor...
Element-wise arc tangent of :math:`x1/x2` choosing the quadrant correctly.
[ "Element", "-", "wise", "arc", "tangent", "of", ":", "math", ":", "x1", "/", "x2", "choosing", "the", "quadrant", "correctly", "." ]
def arctan2(x1, x2, dtype=None): """ Element-wise arc tangent of :math:`x1/x2` choosing the quadrant correctly. Note: Numpy arguments `out`, `where`, `casting`, `order`, `subok`, `signature`, and `extobj` are not supported. Args: x1 (Tensor): input tensor. x2 (Tensor): ...
[ "def", "arctan2", "(", "x1", ",", "x2", ",", "dtype", "=", "None", ")", ":", "x1", "=", "_cast_type_for_trigonometric", "(", "x1", ")", "x2", "=", "_cast_type_for_trigonometric", "(", "x2", ")", "return", "_apply_tensor_op", "(", "F", ".", "atan2", ",", ...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/numpy/math_ops.py#L3781-L3812
DISTORTEC/distortos
49266f5818f08e10e4faca7298f1e6b60be733ba
scripts/generateBoard.py
python
mergeDictionaries
(a, b)
return a
Merge two dictionaries into one and return merged dictionary. Recursively handle nested dictionaries. If given key exists in both dictionaries, value from `b` overwrites value from `a`. * `a` is the dictionary into which `b` will be merged * `b` is the dictionary which will be merged into `a`
Merge two dictionaries into one and return merged dictionary.
[ "Merge", "two", "dictionaries", "into", "one", "and", "return", "merged", "dictionary", "." ]
def mergeDictionaries(a, b): """Merge two dictionaries into one and return merged dictionary. Recursively handle nested dictionaries. If given key exists in both dictionaries, value from `b` overwrites value from `a`. * `a` is the dictionary into which `b` will be merged * `b` is the dictionary which will be mer...
[ "def", "mergeDictionaries", "(", "a", ",", "b", ")", ":", "for", "key", "in", "b", ":", "if", "key", "in", "a", ":", "if", "(", "isinstance", "(", "a", "[", "key", "]", ",", "collectionsAbc", ".", "MutableMapping", ")", "==", "True", "and", "isinst...
https://github.com/DISTORTEC/distortos/blob/49266f5818f08e10e4faca7298f1e6b60be733ba/scripts/generateBoard.py#L92-L110
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBProcessInfo.GetParentProcessID
(self)
return _lldb.SBProcessInfo_GetParentProcessID(self)
GetParentProcessID(SBProcessInfo self) -> lldb::pid_t
GetParentProcessID(SBProcessInfo self) -> lldb::pid_t
[ "GetParentProcessID", "(", "SBProcessInfo", "self", ")", "-", ">", "lldb", "::", "pid_t" ]
def GetParentProcessID(self): """GetParentProcessID(SBProcessInfo self) -> lldb::pid_t""" return _lldb.SBProcessInfo_GetParentProcessID(self)
[ "def", "GetParentProcessID", "(", "self", ")", ":", "return", "_lldb", ".", "SBProcessInfo_GetParentProcessID", "(", "self", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L9025-L9027
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/req/req_tracker.py
python
RequirementTracker.remove
(self, req)
Remove an InstallRequirement from build tracking.
Remove an InstallRequirement from build tracking.
[ "Remove", "an", "InstallRequirement", "from", "build", "tracking", "." ]
def remove(self, req): # type: (InstallRequirement) -> None """Remove an InstallRequirement from build tracking. """ assert req.link # Delete the created file and the corresponding entries. os.unlink(self._entry_path(req.link)) self._entries.remove(req) ...
[ "def", "remove", "(", "self", ",", "req", ")", ":", "# type: (InstallRequirement) -> None", "assert", "req", ".", "link", "# Delete the created file and the corresponding entries.", "os", ".", "unlink", "(", "self", ".", "_entry_path", "(", "req", ".", "link", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/req/req_tracker.py#L122-L132
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/akg/ascend/pow.py
python
_power_akg
()
return
Pow Akg register
Pow Akg register
[ "Pow", "Akg", "register" ]
def _power_akg(): """Pow Akg register""" return
[ "def", "_power_akg", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/akg/ascend/pow.py#L33-L35
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/learn/python/learn/learn_io/data_feeder.py
python
setup_train_data_feeder
( x, y, n_classes, batch_size=None, shuffle=True, epochs=None)
return data_feeder_cls( x, y, n_classes, batch_size, shuffle=shuffle, epochs=epochs)
Create data feeder, to sample inputs from dataset. If `x` and `y` are iterators, use `StreamingDataFeeder`. Args: x: numpy, pandas or Dask matrix or iterable. y: numpy, pandas or Dask array or iterable. n_classes: number of classes. batch_size: size to split data into parts. Must be >= 1. shuf...
Create data feeder, to sample inputs from dataset.
[ "Create", "data", "feeder", "to", "sample", "inputs", "from", "dataset", "." ]
def setup_train_data_feeder( x, y, n_classes, batch_size=None, shuffle=True, epochs=None): """Create data feeder, to sample inputs from dataset. If `x` and `y` are iterators, use `StreamingDataFeeder`. Args: x: numpy, pandas or Dask matrix or iterable. y: numpy, pandas or Dask array or iterable. ...
[ "def", "setup_train_data_feeder", "(", "x", ",", "y", ",", "n_classes", ",", "batch_size", "=", "None", ",", "shuffle", "=", "True", ",", "epochs", "=", "None", ")", ":", "x", ",", "y", "=", "_data_type_filter", "(", "x", ",", "y", ")", "if", "HAS_DA...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/learn_io/data_feeder.py#L79-L117
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/_checkparam.py
python
Validator.check_non_positive_int
(arg_value, arg_name=None, prim_name=None)
return check_number(arg_value, 0, Rel.LE, int, arg_name, prim_name)
Check argument is non-negative integer, which mean arg_value <= 0. Usage: - number = check_non_positive_int(number) - number = check_non_positive_int(number, "bias")
Check argument is non-negative integer, which mean arg_value <= 0.
[ "Check", "argument", "is", "non", "-", "negative", "integer", "which", "mean", "arg_value", "<", "=", "0", "." ]
def check_non_positive_int(arg_value, arg_name=None, prim_name=None): """ Check argument is non-negative integer, which mean arg_value <= 0. Usage: - number = check_non_positive_int(number) - number = check_non_positive_int(number, "bias") """ return check_number...
[ "def", "check_non_positive_int", "(", "arg_value", ",", "arg_name", "=", "None", ",", "prim_name", "=", "None", ")", ":", "return", "check_number", "(", "arg_value", ",", "0", ",", "Rel", ".", "LE", ",", "int", ",", "arg_name", ",", "prim_name", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_checkparam.py#L285-L293
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py
python
MsvsSettings.GetOutputName
(self, config, expand_special)
return output_file
Gets the explicitly overridden output name for a target or returns None if it's not overridden.
Gets the explicitly overridden output name for a target or returns None if it's not overridden.
[ "Gets", "the", "explicitly", "overridden", "output", "name", "for", "a", "target", "or", "returns", "None", "if", "it", "s", "not", "overridden", "." ]
def GetOutputName(self, config, expand_special): """Gets the explicitly overridden output name for a target or returns None if it's not overridden.""" config = self._TargetConfig(config) type = self.spec["type"] root = "VCLibrarianTool" if type == "static_library" else "VCLinkerT...
[ "def", "GetOutputName", "(", "self", ",", "config", ",", "expand_special", ")", ":", "config", "=", "self", ".", "_TargetConfig", "(", "config", ")", "type", "=", "self", ".", "spec", "[", "\"type\"", "]", "root", "=", "\"VCLibrarianTool\"", "if", "type", ...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py#L433-L445
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_windows.py
python
ColourDialog.__init__
(self, *args, **kwargs)
__init__(self, Window parent, ColourData data=None) -> ColourDialog Constructor. Pass a parent window, and optionally a `wx.ColourData`, which will be copied to the colour dialog's internal ColourData instance.
__init__(self, Window parent, ColourData data=None) -> ColourDialog
[ "__init__", "(", "self", "Window", "parent", "ColourData", "data", "=", "None", ")", "-", ">", "ColourDialog" ]
def __init__(self, *args, **kwargs): """ __init__(self, Window parent, ColourData data=None) -> ColourDialog Constructor. Pass a parent window, and optionally a `wx.ColourData`, which will be copied to the colour dialog's internal ColourData instance. """ _windo...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_windows_", ".", "ColourDialog_swiginit", "(", "self", ",", "_windows_", ".", "new_ColourDialog", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")", "self", ".", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L3018-L3027
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/mesa/MesaLib/src/mapi/glapi/gen/gl_XML.py
python
gl_function.get_images
(self)
return self.images
Return potentially empty list of input images.
Return potentially empty list of input images.
[ "Return", "potentially", "empty", "list", "of", "input", "images", "." ]
def get_images(self): """Return potentially empty list of input images.""" return self.images
[ "def", "get_images", "(", "self", ")", ":", "return", "self", ".", "images" ]
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/mesa/MesaLib/src/mapi/glapi/gen/gl_XML.py#L713-L715
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/http/server.py
python
BaseHTTPRequestHandler.end_headers
(self)
Send the blank line ending the MIME headers.
Send the blank line ending the MIME headers.
[ "Send", "the", "blank", "line", "ending", "the", "MIME", "headers", "." ]
def end_headers(self): """Send the blank line ending the MIME headers.""" if self.request_version != 'HTTP/0.9': self._headers_buffer.append(b"\r\n") self.flush_headers()
[ "def", "end_headers", "(", "self", ")", ":", "if", "self", ".", "request_version", "!=", "'HTTP/0.9'", ":", "self", ".", "_headers_buffer", ".", "append", "(", "b\"\\r\\n\"", ")", "self", ".", "flush_headers", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/http/server.py#L524-L528
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
IconBundle.__init__
(self, *args, **kwargs)
__init__(self) -> IconBundle
__init__(self) -> IconBundle
[ "__init__", "(", "self", ")", "-", ">", "IconBundle" ]
def __init__(self, *args, **kwargs): """__init__(self) -> IconBundle""" _gdi_.IconBundle_swiginit(self,_gdi_.new_IconBundle(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_gdi_", ".", "IconBundle_swiginit", "(", "self", ",", "_gdi_", ".", "new_IconBundle", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L1391-L1393
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/tools/inspector_protocol/jinja2/filters.py
python
do_select
(*args, **kwargs)
return select_or_reject(args, kwargs, lambda x: x, False)
Filters a sequence of objects by applying a test to each object, and only selecting the objects with the test succeeding. If no test is specified, each object will be evaluated as a boolean. Example usage: .. sourcecode:: jinja {{ numbers|select("odd") }} {{ numbers|select("odd") }} ...
Filters a sequence of objects by applying a test to each object, and only selecting the objects with the test succeeding.
[ "Filters", "a", "sequence", "of", "objects", "by", "applying", "a", "test", "to", "each", "object", "and", "only", "selecting", "the", "objects", "with", "the", "test", "succeeding", "." ]
def do_select(*args, **kwargs): """Filters a sequence of objects by applying a test to each object, and only selecting the objects with the test succeeding. If no test is specified, each object will be evaluated as a boolean. Example usage: .. sourcecode:: jinja {{ numbers|select("odd") ...
[ "def", "do_select", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "select_or_reject", "(", "args", ",", "kwargs", ",", "lambda", "x", ":", "x", ",", "False", ")" ]
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/inspector_protocol/jinja2/filters.py#L967-L985
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/composite/multitype_ops/equal_impl.py
python
_none_equal_string
(x, y)
return False
Determine if string equals none. Args: x (None): first input None. y (str): second input string. Returns: bool, return false.
Determine if string equals none.
[ "Determine", "if", "string", "equals", "none", "." ]
def _none_equal_string(x, y): """ Determine if string equals none. Args: x (None): first input None. y (str): second input string. Returns: bool, return false. """ return False
[ "def", "_none_equal_string", "(", "x", ",", "y", ")", ":", "return", "False" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/composite/multitype_ops/equal_impl.py#L105-L116
mhammond/pywin32
44afd86ba8485194df93234639243252deeb40d5
Pythonwin/pywin/framework/editor/editor.py
python
EditorView._PrepareUserStateChange
(self)
return self.GetModify(), self.GetSel(), self.GetFirstVisibleLine()
Return selection, lineindex, etc info, so it can be restored
Return selection, lineindex, etc info, so it can be restored
[ "Return", "selection", "lineindex", "etc", "info", "so", "it", "can", "be", "restored" ]
def _PrepareUserStateChange(self): "Return selection, lineindex, etc info, so it can be restored" self.SetRedraw(0) return self.GetModify(), self.GetSel(), self.GetFirstVisibleLine()
[ "def", "_PrepareUserStateChange", "(", "self", ")", ":", "self", ".", "SetRedraw", "(", "0", ")", "return", "self", ".", "GetModify", "(", ")", ",", "self", ".", "GetSel", "(", ")", ",", "self", ".", "GetFirstVisibleLine", "(", ")" ]
https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/Pythonwin/pywin/framework/editor/editor.py#L218-L221
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/unicode.py
python
unicode_islower
(data)
return impl
impl is an approximate translation of: https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Objects/unicodeobject.c#L11900-L11933 # noqa: E501 mixed with: https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Objects/bytes_methods.c#L131-L156 # noqa...
impl is an approximate translation of: https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Objects/unicodeobject.c#L11900-L11933 # noqa: E501 mixed with: https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Objects/bytes_methods.c#L131-L156 # noqa...
[ "impl", "is", "an", "approximate", "translation", "of", ":", "https", ":", "//", "github", ".", "com", "/", "python", "/", "cpython", "/", "blob", "/", "201c8f79450628241574fba940e08107178dc3a5", "/", "Objects", "/", "unicodeobject", ".", "c#L11900", "-", "L11...
def unicode_islower(data): """ impl is an approximate translation of: https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Objects/unicodeobject.c#L11900-L11933 # noqa: E501 mixed with: https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Obje...
[ "def", "unicode_islower", "(", "data", ")", ":", "def", "impl", "(", "data", ")", ":", "length", "=", "len", "(", "data", ")", "if", "length", "==", "1", ":", "return", "_PyUnicode_IsLowercase", "(", "_get_code_point", "(", "data", ",", "0", ")", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/unicode.py#L1893-L1916
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/image/image.py
python
RandomOrderAug.dumps
(self)
return [self.__class__.__name__.lower(), [x.dumps() for x in self.ts]]
Override the default to avoid duplicate dump.
Override the default to avoid duplicate dump.
[ "Override", "the", "default", "to", "avoid", "duplicate", "dump", "." ]
def dumps(self): """Override the default to avoid duplicate dump.""" return [self.__class__.__name__.lower(), [x.dumps() for x in self.ts]]
[ "def", "dumps", "(", "self", ")", ":", "return", "[", "self", ".", "__class__", ".", "__name__", ".", "lower", "(", ")", ",", "[", "x", ".", "dumps", "(", ")", "for", "x", "in", "self", ".", "ts", "]", "]" ]
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/image/image.py#L937-L939
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/nn/probability/distribution/gamma.py
python
Gamma._var
(self, concentration=None, rate=None)
return concentration / self.square(rate)
The variance of the distribution.
The variance of the distribution.
[ "The", "variance", "of", "the", "distribution", "." ]
def _var(self, concentration=None, rate=None): """ The variance of the distribution. """ concentration, rate = self._check_param_type(concentration, rate) return concentration / self.square(rate)
[ "def", "_var", "(", "self", ",", "concentration", "=", "None", ",", "rate", "=", "None", ")", ":", "concentration", ",", "rate", "=", "self", ".", "_check_param_type", "(", "concentration", ",", "rate", ")", "return", "concentration", "/", "self", ".", "...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/probability/distribution/gamma.py#L260-L265
kushview/Element
1cc16380caa2ab79461246ba758b9de1f46db2a5
waflib/Tools/python.py
python
check_python_version
(conf, minver=None)
Check if the python interpreter is found matching a given minimum version. minver should be a tuple, eg. to check for python >= 2.4.2 pass (2,4,2) as minver. If successful, PYTHON_VERSION is defined as 'MAJOR.MINOR' (eg. '2.4') of the actual python version found, and PYTHONDIR and PYTHONARCHDIR are defined, pointi...
Check if the python interpreter is found matching a given minimum version. minver should be a tuple, eg. to check for python >= 2.4.2 pass (2,4,2) as minver.
[ "Check", "if", "the", "python", "interpreter", "is", "found", "matching", "a", "given", "minimum", "version", ".", "minver", "should", "be", "a", "tuple", "eg", ".", "to", "check", "for", "python", ">", "=", "2", ".", "4", ".", "2", "pass", "(", "2",...
def check_python_version(conf, minver=None): """ Check if the python interpreter is found matching a given minimum version. minver should be a tuple, eg. to check for python >= 2.4.2 pass (2,4,2) as minver. If successful, PYTHON_VERSION is defined as 'MAJOR.MINOR' (eg. '2.4') of the actual python version found, a...
[ "def", "check_python_version", "(", "conf", ",", "minver", "=", "None", ")", ":", "assert", "minver", "is", "None", "or", "isinstance", "(", "minver", ",", "tuple", ")", "pybin", "=", "conf", ".", "env", ".", "PYTHON", "if", "not", "pybin", ":", "conf"...
https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Tools/python.py#L461-L544
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/datetimes.py
python
DatetimeArray.to_period
(self, freq=None)
return PeriodArray._from_datetime64(self._data, freq, tz=self.tz)
Cast to PeriodArray/Index at a particular frequency. Converts DatetimeArray/Index to PeriodArray/Index. Parameters ---------- freq : str or Offset, optional One of pandas' :ref:`offset strings <timeseries.offset_aliases>` or an Offset object. Will be inferred by...
Cast to PeriodArray/Index at a particular frequency.
[ "Cast", "to", "PeriodArray", "/", "Index", "at", "a", "particular", "frequency", "." ]
def to_period(self, freq=None): """ Cast to PeriodArray/Index at a particular frequency. Converts DatetimeArray/Index to PeriodArray/Index. Parameters ---------- freq : str or Offset, optional One of pandas' :ref:`offset strings <timeseries.offset_aliases>` ...
[ "def", "to_period", "(", "self", ",", "freq", "=", "None", ")", ":", "from", "pandas", ".", "core", ".", "arrays", "import", "PeriodArray", "if", "self", ".", "tz", "is", "not", "None", ":", "warnings", ".", "warn", "(", "\"Converting to PeriodArray/Index ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/datetimes.py#L1054-L1117
p4lang/behavioral-model
81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9
tools/p4dbg.py
python
DebuggerAPI.do_stop_packet_in
(self, line)
Stop accepting packets into the switch
Stop accepting packets into the switch
[ "Stop", "accepting", "packets", "into", "the", "switch" ]
def do_stop_packet_in(self, line): "Stop accepting packets into the switch" req = Msg_StopPacketIn(switch_id = 0, req_id = self.get_req_id()) self.sok.send(req.generate()) msg = self.wait_for_msg() self.check_msg_CLS(msg, Msg_Status) assert(msg.status == 0) self.s...
[ "def", "do_stop_packet_in", "(", "self", ",", "line", ")", ":", "req", "=", "Msg_StopPacketIn", "(", "switch_id", "=", "0", ",", "req_id", "=", "self", ".", "get_req_id", "(", ")", ")", "self", ".", "sok", ".", "send", "(", "req", ".", "generate", "(...
https://github.com/p4lang/behavioral-model/blob/81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9/tools/p4dbg.py#L1045-L1052
dmlc/decord
96b750c7221322391969929e855b942d2fdcd06b
python/decord/_ffi/runtime_ctypes.py
python
DECORDContext.device_name
(self)
return _api_internal._GetDeviceAttr( self.device_type, self.device_id, 5)
Return the string name of device.
Return the string name of device.
[ "Return", "the", "string", "name", "of", "device", "." ]
def device_name(self): """Return the string name of device.""" return _api_internal._GetDeviceAttr( self.device_type, self.device_id, 5)
[ "def", "device_name", "(", "self", ")", ":", "return", "_api_internal", ".", "_GetDeviceAttr", "(", "self", ".", "device_type", ",", "self", ".", "device_id", ",", "5", ")" ]
https://github.com/dmlc/decord/blob/96b750c7221322391969929e855b942d2fdcd06b/python/decord/_ffi/runtime_ctypes.py#L194-L197
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py
python
Wm.wm_iconphoto
(self, default=False, *args)
Sets the titlebar icon for this window based on the named photo images passed through args. If default is True, this is applied to all future created toplevels as well. The data in the images is taken as a snapshot at the time of invocation. If the images are later changed, this is not ...
Sets the titlebar icon for this window based on the named photo images passed through args. If default is True, this is applied to all future created toplevels as well.
[ "Sets", "the", "titlebar", "icon", "for", "this", "window", "based", "on", "the", "named", "photo", "images", "passed", "through", "args", ".", "If", "default", "is", "True", "this", "is", "applied", "to", "all", "future", "created", "toplevels", "as", "we...
def wm_iconphoto(self, default=False, *args): # new in Tk 8.5 """Sets the titlebar icon for this window based on the named photo images passed through args. If default is True, this is applied to all future created toplevels as well. The data in the images is taken as a snapshot at the ...
[ "def", "wm_iconphoto", "(", "self", ",", "default", "=", "False", ",", "*", "args", ")", ":", "# new in Tk 8.5", "if", "default", ":", "self", ".", "tk", ".", "call", "(", "'wm'", ",", "'iconphoto'", ",", "self", ".", "_w", ",", "\"-default\"", ",", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L1887-L1910
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/html2.py
python
WebView.CanCut
(*args, **kwargs)
return _html2.WebView_CanCut(*args, **kwargs)
CanCut(self) -> bool
CanCut(self) -> bool
[ "CanCut", "(", "self", ")", "-", ">", "bool" ]
def CanCut(*args, **kwargs): """CanCut(self) -> bool""" return _html2.WebView_CanCut(*args, **kwargs)
[ "def", "CanCut", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html2", ".", "WebView_CanCut", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/html2.py#L218-L220
OSGeo/gdal
3748fc4ba4fba727492774b2b908a2130c864a83
swig/python/osgeo/gdal.py
python
VirtualMem.GetAddr
(self, *args)
return _gdal.VirtualMem_GetAddr(self, *args)
r"""GetAddr(VirtualMem self)
r"""GetAddr(VirtualMem self)
[ "r", "GetAddr", "(", "VirtualMem", "self", ")" ]
def GetAddr(self, *args): r"""GetAddr(VirtualMem self)""" return _gdal.VirtualMem_GetAddr(self, *args)
[ "def", "GetAddr", "(", "self", ",", "*", "args", ")", ":", "return", "_gdal", ".", "VirtualMem_GetAddr", "(", "self", ",", "*", "args", ")" ]
https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gdal.py#L2080-L2082
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_gdi.py
python
RendererVersion.__init__
(self, *args, **kwargs)
__init__(self, int version_, int age_) -> RendererVersion This simple struct represents the `wx.RendererNative` interface version and is only used as the return value of `wx.RendererNative.GetVersion`.
__init__(self, int version_, int age_) -> RendererVersion
[ "__init__", "(", "self", "int", "version_", "int", "age_", ")", "-", ">", "RendererVersion" ]
def __init__(self, *args, **kwargs): """ __init__(self, int version_, int age_) -> RendererVersion This simple struct represents the `wx.RendererNative` interface version and is only used as the return value of `wx.RendererNative.GetVersion`. """ _gdi_.RendererV...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_gdi_", ".", "RendererVersion_swiginit", "(", "self", ",", "_gdi_", ".", "new_RendererVersion", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L7220-L7228
uzh-rpg/rpg_svo
d6161063b47f36ce78252ee4c4fedf3f6d8f2898
svo_analysis/src/svo_analysis/tum_benchmark_tools/evaluate_rpe.py
python
read_trajectory
(filename, matrix=True)
return traj
Read a trajectory from a text file. Input: filename -- file to be read matrix -- convert poses to 4x4 matrices Output: dictionary of stamped 3D poses
Read a trajectory from a text file. Input: filename -- file to be read matrix -- convert poses to 4x4 matrices Output: dictionary of stamped 3D poses
[ "Read", "a", "trajectory", "from", "a", "text", "file", ".", "Input", ":", "filename", "--", "file", "to", "be", "read", "matrix", "--", "convert", "poses", "to", "4x4", "matrices", "Output", ":", "dictionary", "of", "stamped", "3D", "poses" ]
def read_trajectory(filename, matrix=True): """ Read a trajectory from a text file. Input: filename -- file to be read matrix -- convert poses to 4x4 matrices Output: dictionary of stamped 3D poses """ file = open(filename) data = file.read() lines = data.replace("...
[ "def", "read_trajectory", "(", "filename", ",", "matrix", "=", "True", ")", ":", "file", "=", "open", "(", "filename", ")", "data", "=", "file", ".", "read", "(", ")", "lines", "=", "data", ".", "replace", "(", "\",\"", ",", "\" \"", ")", ".", "rep...
https://github.com/uzh-rpg/rpg_svo/blob/d6161063b47f36ce78252ee4c4fedf3f6d8f2898/svo_analysis/src/svo_analysis/tum_benchmark_tools/evaluate_rpe.py#L76-L108
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/ribbon/buttonbar.py
python
RibbonButtonBar.OnMouseEnter
(self, event)
Handles the ``wx.EVT_ENTER_WINDOW`` event for :class:`RibbonButtonBar`. :param `event`: a :class:`MouseEvent` event to be processed.
Handles the ``wx.EVT_ENTER_WINDOW`` event for :class:`RibbonButtonBar`.
[ "Handles", "the", "wx", ".", "EVT_ENTER_WINDOW", "event", "for", ":", "class", ":", "RibbonButtonBar", "." ]
def OnMouseEnter(self, event): """ Handles the ``wx.EVT_ENTER_WINDOW`` event for :class:`RibbonButtonBar`. :param `event`: a :class:`MouseEvent` event to be processed. """ if self._active_button and not event.LeftIsDown(): self._active_button = None
[ "def", "OnMouseEnter", "(", "self", ",", "event", ")", ":", "if", "self", ".", "_active_button", "and", "not", "event", ".", "LeftIsDown", "(", ")", ":", "self", ".", "_active_button", "=", "None" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ribbon/buttonbar.py#L1277-L1285
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
Window.GetForegroundColour
(*args, **kwargs)
return _core_.Window_GetForegroundColour(*args, **kwargs)
GetForegroundColour(self) -> Colour Returns the foreground colour of the window. The interpretation of foreground colour is dependent on the window class; it may be the text colour or other colour, or it may not be used at all.
GetForegroundColour(self) -> Colour
[ "GetForegroundColour", "(", "self", ")", "-", ">", "Colour" ]
def GetForegroundColour(*args, **kwargs): """ GetForegroundColour(self) -> Colour Returns the foreground colour of the window. The interpretation of foreground colour is dependent on the window class; it may be the text colour or other colour, or it may not be used at all. ...
[ "def", "GetForegroundColour", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_GetForegroundColour", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L10892-L10900
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/algorithms/deep_cfr_tf2.py
python
DeepCFRSolver._reinitialize_advantage_network
(self, player)
Reinitalize player's advantage network and optimizer for training.
Reinitalize player's advantage network and optimizer for training.
[ "Reinitalize", "player", "s", "advantage", "network", "and", "optimizer", "for", "training", "." ]
def _reinitialize_advantage_network(self, player): """Reinitalize player's advantage network and optimizer for training.""" with tf.device(self._train_device): self._adv_networks_train[player] = AdvantageNetwork( self._embedding_size, self._advantage_network_layers, self._num_actions) ...
[ "def", "_reinitialize_advantage_network", "(", "self", ",", "player", ")", ":", "with", "tf", ".", "device", "(", "self", ".", "_train_device", ")", ":", "self", ".", "_adv_networks_train", "[", "player", "]", "=", "AdvantageNetwork", "(", "self", ".", "_emb...
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/deep_cfr_tf2.py#L386-L395
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/_bootstrap_external.py
python
SourceFileLoader.set_data
(self, path, data, *, _mode=0o666)
Write bytes data to a file.
Write bytes data to a file.
[ "Write", "bytes", "data", "to", "a", "file", "." ]
def set_data(self, path, data, *, _mode=0o666): """Write bytes data to a file.""" parent, filename = _path_split(path) path_parts = [] # Figure out what directories are missing. while parent and not _path_isdir(parent): parent, part = _path_split(parent) p...
[ "def", "set_data", "(", "self", ",", "path", ",", "data", ",", "*", ",", "_mode", "=", "0o666", ")", ":", "parent", ",", "filename", "=", "_path_split", "(", "path", ")", "path_parts", "=", "[", "]", "# Figure out what directories are missing.", "while", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/_bootstrap_external.py#L961-L989
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/genpy/src/genpy/message.py
python
get_service_class
(service_type, reload_on_error=False)
return cls
Get the service class. NOTE: this function maintains a local cache of results to improve performance. :param service_type: type name of service, ``str`` :param reload_on_error: (optional). Attempt to reload the Python module if unable to load message the first time. Defaults to False. This is ne...
Get the service class. NOTE: this function maintains a local cache of results to improve performance. :param service_type: type name of service, ``str`` :param reload_on_error: (optional). Attempt to reload the Python module if unable to load message the first time. Defaults to False. This is ne...
[ "Get", "the", "service", "class", ".", "NOTE", ":", "this", "function", "maintains", "a", "local", "cache", "of", "results", "to", "improve", "performance", ".", ":", "param", "service_type", ":", "type", "name", "of", "service", "str", ":", "param", "relo...
def get_service_class(service_type, reload_on_error=False): """ Get the service class. NOTE: this function maintains a local cache of results to improve performance. :param service_type: type name of service, ``str`` :param reload_on_error: (optional). Attempt to reload the Python module if un...
[ "def", "get_service_class", "(", "service_type", ",", "reload_on_error", "=", "False", ")", ":", "if", "service_type", "in", "_service_class_cache", ":", "return", "_service_class_cache", "[", "service_type", "]", "cls", "=", "_get_message_or_service_class", "(", "'sr...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/genpy/src/genpy/message.py#L629-L644
msftguy/ssh-rd
a5f3a79daeac5844edebf01916c9613563f1c390
_3rd/boost_1_48_0/tools/build/v2/build/feature.py
python
expand_composites
(properties)
return result
Expand all composite properties in the set so that all components are explicitly expressed.
Expand all composite properties in the set so that all components are explicitly expressed.
[ "Expand", "all", "composite", "properties", "in", "the", "set", "so", "that", "all", "components", "are", "explicitly", "expressed", "." ]
def expand_composites (properties): """ Expand all composite properties in the set so that all components are explicitly expressed. """ explicit_features = set(p.feature() for p in properties) result = [] # now expand composite features for p in properties: expanded = expand_co...
[ "def", "expand_composites", "(", "properties", ")", ":", "explicit_features", "=", "set", "(", "p", ".", "feature", "(", ")", "for", "p", "in", "properties", ")", "result", "=", "[", "]", "# now expand composite features", "for", "p", "in", "properties", ":"...
https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/build/v2/build/feature.py#L576-L610
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
DQM/Integration/scripts/harvesting_tools/cmsHarvester.py
python
CMSHarvester.write_multicrab_config
(self)
Write a multi-CRAB job configuration Python file.
Write a multi-CRAB job configuration Python file.
[ "Write", "a", "multi", "-", "CRAB", "job", "configuration", "Python", "file", "." ]
def write_multicrab_config(self): """Write a multi-CRAB job configuration Python file. """ self.logger.info("Writing multi-CRAB configuration...") file_name_base = "multicrab.cfg" # Create multi-CRAB configuration. multicrab_contents = self.create_multicrab_config() ...
[ "def", "write_multicrab_config", "(", "self", ")", ":", "self", ".", "logger", ".", "info", "(", "\"Writing multi-CRAB configuration...\"", ")", "file_name_base", "=", "\"multicrab.cfg\"", "# Create multi-CRAB configuration.", "multicrab_contents", "=", "self", ".", "crea...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/DQM/Integration/scripts/harvesting_tools/cmsHarvester.py#L5040-L5063
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/timeseries/python/timeseries/math_utils.py
python
InputStatisticsFromMiniBatch._update_statistics_from_mini_batch
( self, statistics, auxiliary_variables, times, values)
return per_chunk_stat_updates
Given mini-batch input, update `statistics` and `auxiliary_variables`.
Given mini-batch input, update `statistics` and `auxiliary_variables`.
[ "Given", "mini", "-", "batch", "input", "update", "statistics", "and", "auxiliary_variables", "." ]
def _update_statistics_from_mini_batch( self, statistics, auxiliary_variables, times, values): """Given mini-batch input, update `statistics` and `auxiliary_variables`.""" values = math_ops.cast(values, self._dtype) # The density (measured in times per observation) that we see in each part # of th...
[ "def", "_update_statistics_from_mini_batch", "(", "self", ",", "statistics", ",", "auxiliary_variables", ",", "times", ",", "values", ")", ":", "values", "=", "math_ops", ".", "cast", "(", "values", ",", "self", ".", "_dtype", ")", "# The density (measured in time...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/timeseries/python/timeseries/math_utils.py#L788-L906
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Text.scan_dragto
(self, x, y)
Adjust the view of the text to 10 times the difference between X and Y and the coordinates given in scan_mark.
Adjust the view of the text to 10 times the difference between X and Y and the coordinates given in scan_mark.
[ "Adjust", "the", "view", "of", "the", "text", "to", "10", "times", "the", "difference", "between", "X", "and", "Y", "and", "the", "coordinates", "given", "in", "scan_mark", "." ]
def scan_dragto(self, x, y): """Adjust the view of the text to 10 times the difference between X and Y and the coordinates given in scan_mark.""" self.tk.call(self._w, 'scan', 'dragto', x, y)
[ "def", "scan_dragto", "(", "self", ",", "x", ",", "y", ")", ":", "self", ".", "tk", ".", "call", "(", "self", ".", "_w", ",", "'scan'", ",", "'dragto'", ",", "x", ",", "y", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py#L3073-L3077
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/xml/dom/expatbuilder.py
python
Namespaces.start_namespace_decl_handler
(self, prefix, uri)
Push this namespace declaration on our storage.
Push this namespace declaration on our storage.
[ "Push", "this", "namespace", "declaration", "on", "our", "storage", "." ]
def start_namespace_decl_handler(self, prefix, uri): """Push this namespace declaration on our storage.""" self._ns_ordered_prefixes.append((prefix, uri))
[ "def", "start_namespace_decl_handler", "(", "self", ",", "prefix", ",", "uri", ")", ":", "self", ".", "_ns_ordered_prefixes", ".", "append", "(", "(", "prefix", ",", "uri", ")", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/xml/dom/expatbuilder.py#L739-L741
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
pygimli/physics/em/tdem.py
python
readTEMfastFile
(temfile)
return snd
ReadTEMfastFile(filename) reads TEM-fast file into usf sounding.
ReadTEMfastFile(filename) reads TEM-fast file into usf sounding.
[ "ReadTEMfastFile", "(", "filename", ")", "reads", "TEM", "-", "fast", "file", "into", "usf", "sounding", "." ]
def readTEMfastFile(temfile): """ReadTEMfastFile(filename) reads TEM-fast file into usf sounding.""" snd = {} snd['FILENAME'] = temfile fid = open(temfile) for i in range(4): zeile = fid.readline() snd['STACK_SIZE'] = int(zeile.split()[3]) snd['RAMP_TIME'] = float(zeile.split()[5])*1...
[ "def", "readTEMfastFile", "(", "temfile", ")", ":", "snd", "=", "{", "}", "snd", "[", "'FILENAME'", "]", "=", "temfile", "fid", "=", "open", "(", "temfile", ")", "for", "i", "in", "range", "(", "4", ")", ":", "zeile", "=", "fid", ".", "readline", ...
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/physics/em/tdem.py#L201-L223
ucbrise/confluo
578883a4f7fbbb4aea78c342d366f5122ef598f7
pyclient/confluo/rpc/schema.py
python
Column.__str__
(self)
return '{} : {}'.format(self.name_, self.data_type_)
Convert to string Returns: String representation of the column
Convert to string
[ "Convert", "to", "string" ]
def __str__(self): """ Convert to string Returns: String representation of the column """ return '{} : {}'.format(self.name_, self.data_type_)
[ "def", "__str__", "(", "self", ")", ":", "return", "'{} : {}'", ".", "format", "(", "self", ".", "name_", ",", "self", ".", "data_type_", ")" ]
https://github.com/ucbrise/confluo/blob/578883a4f7fbbb4aea78c342d366f5122ef598f7/pyclient/confluo/rpc/schema.py#L110-L116
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/closure_linter/closure_linter/indentation.py
python
IndentationRules._PopToImpliedBlock
(self)
Pops the stack until an implied block token is found.
Pops the stack until an implied block token is found.
[ "Pops", "the", "stack", "until", "an", "implied", "block", "token", "is", "found", "." ]
def _PopToImpliedBlock(self): """Pops the stack until an implied block token is found.""" while not self._Pop().token.metadata.is_implied_block: pass
[ "def", "_PopToImpliedBlock", "(", "self", ")", ":", "while", "not", "self", ".", "_Pop", "(", ")", ".", "token", ".", "metadata", ".", "is_implied_block", ":", "pass" ]
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/closure_linter/closure_linter/indentation.py#L554-L557
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py2/prompt_toolkit/key_binding/bindings/utils.py
python
create_handle_decorator
(registry, filter=Always())
return handle
Create a key handle decorator, which is compatible with `Registry.handle`, but will chain the given filter to every key binding. :param filter: `CLIFilter`
Create a key handle decorator, which is compatible with `Registry.handle`, but will chain the given filter to every key binding.
[ "Create", "a", "key", "handle", "decorator", "which", "is", "compatible", "with", "Registry", ".", "handle", "but", "will", "chain", "the", "given", "filter", "to", "every", "key", "binding", "." ]
def create_handle_decorator(registry, filter=Always()): """ Create a key handle decorator, which is compatible with `Registry.handle`, but will chain the given filter to every key binding. :param filter: `CLIFilter` """ assert isinstance(filter, CLIFilter) def handle(*keys, **kw): ...
[ "def", "create_handle_decorator", "(", "registry", ",", "filter", "=", "Always", "(", ")", ")", ":", "assert", "isinstance", "(", "filter", ",", "CLIFilter", ")", "def", "handle", "(", "*", "keys", ",", "*", "*", "kw", ")", ":", "# Chain the given filter t...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/key_binding/bindings/utils.py#L8-L25
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/common/portable_globe.py
python
Globe.IsLocal
(self)
return self.is_local_
Returns whether we are currently serving a local globe.
Returns whether we are currently serving a local globe.
[ "Returns", "whether", "we", "are", "currently", "serving", "a", "local", "globe", "." ]
def IsLocal(self): """Returns whether we are currently serving a local globe.""" return self.is_local_
[ "def", "IsLocal", "(", "self", ")", ":", "return", "self", ".", "is_local_" ]
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/common/portable_globe.py#L75-L77
apiaryio/drafter
4634ebd07f6c6f257cc656598ccd535492fdfb55
tools/gyp/tools/graphviz.py
python
WriteGraph
(edges)
Print a graphviz graph to stdout. |edges| is a map of target to a list of other targets it depends on.
Print a graphviz graph to stdout. |edges| is a map of target to a list of other targets it depends on.
[ "Print", "a", "graphviz", "graph", "to", "stdout", ".", "|edges|", "is", "a", "map", "of", "target", "to", "a", "list", "of", "other", "targets", "it", "depends", "on", "." ]
def WriteGraph(edges): """Print a graphviz graph to stdout. |edges| is a map of target to a list of other targets it depends on.""" # Bucket targets by file. files = collections.defaultdict(list) for src, dst in edges.items(): build_file, target_name, toolset = ParseTarget(src) files[build_file].appe...
[ "def", "WriteGraph", "(", "edges", ")", ":", "# Bucket targets by file.", "files", "=", "collections", ".", "defaultdict", "(", "list", ")", "for", "src", ",", "dst", "in", "edges", ".", "items", "(", ")", ":", "build_file", ",", "target_name", ",", "tools...
https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/tools/graphviz.py#L43-L83
ROCmSoftwarePlatform/hipCaffe
4ec5d482515cce532348553b6db6d00d015675d5
scripts/cpp_lint.py
python
CheckEmptyBlockBody
(filename, clean_lines, linenum, error)
Look for empty loop/conditional body with only a single semicolon. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Look for empty loop/conditional body with only a single semicolon.
[ "Look", "for", "empty", "loop", "/", "conditional", "body", "with", "only", "a", "single", "semicolon", "." ]
def CheckEmptyBlockBody(filename, clean_lines, linenum, error): """Look for empty loop/conditional body with only a single semicolon. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The functio...
[ "def", "CheckEmptyBlockBody", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "# Search for loop keywords at the beginning of the line. Because only", "# whitespaces are allowed before the keywords, this will also ignore most", "# do-while-loops, since those...
https://github.com/ROCmSoftwarePlatform/hipCaffe/blob/4ec5d482515cce532348553b6db6d00d015675d5/scripts/cpp_lint.py#L3243-L3275