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
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
PyControl.DoGetPosition
(*args, **kwargs)
return _controls_.PyControl_DoGetPosition(*args, **kwargs)
DoGetPosition() -> (x,y)
DoGetPosition() -> (x,y)
[ "DoGetPosition", "()", "-", ">", "(", "x", "y", ")" ]
def DoGetPosition(*args, **kwargs): """DoGetPosition() -> (x,y)""" return _controls_.PyControl_DoGetPosition(*args, **kwargs)
[ "def", "DoGetPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "PyControl_DoGetPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L5866-L5868
kevinlin311tw/cvpr16-deepbit
c60fb3233d7d534cfcee9d3ed47d77af437ee32a
scripts/cpp_lint.py
python
Match
(pattern, s)
return _regexp_compile_cache[pattern].match(s)
Matches the string with the pattern, caching the compiled regexp.
Matches the string with the pattern, caching the compiled regexp.
[ "Matches", "the", "string", "with", "the", "pattern", "caching", "the", "compiled", "regexp", "." ]
def Match(pattern, s): """Matches the string with the pattern, caching the compiled regexp.""" # The regexp compilation caching is inlined in both Match and Search for # performance reasons; factoring it out into a separate function turns out # to be noticeably expensive. if pattern not in _regexp_compile_cac...
[ "def", "Match", "(", "pattern", ",", "s", ")", ":", "# The regexp compilation caching is inlined in both Match and Search for", "# performance reasons; factoring it out into a separate function turns out", "# to be noticeably expensive.", "if", "pattern", "not", "in", "_regexp_compile_...
https://github.com/kevinlin311tw/cvpr16-deepbit/blob/c60fb3233d7d534cfcee9d3ed47d77af437ee32a/scripts/cpp_lint.py#L515-L522
papyrussolution/OpenPapyrus
bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91
Src/OSF/protobuf-3.19.1/python/google/protobuf/text_encoding.py
python
CEscape
(text, as_utf8)
return ''.join(_cescape_byte_to_str[ord_(c)] for c in text)
Escape a bytes string for use in an text protocol buffer. Args: text: A byte string to be escaped. as_utf8: Specifies if result may contain non-ASCII characters. In Python 3 this allows unescaped non-ASCII Unicode characters. In Python 2 the return value will be valid UTF-8 rather than only A...
Escape a bytes string for use in an text protocol buffer.
[ "Escape", "a", "bytes", "string", "for", "use", "in", "an", "text", "protocol", "buffer", "." ]
def CEscape(text, as_utf8): # type: (...) -> str """Escape a bytes string for use in an text protocol buffer. Args: text: A byte string to be escaped. as_utf8: Specifies if result may contain non-ASCII characters. In Python 3 this allows unescaped non-ASCII Unicode characters. In Python 2...
[ "def", "CEscape", "(", "text", ",", "as_utf8", ")", ":", "# type: (...) -> str", "# Python's text.encode() 'string_escape' or 'unicode_escape' codecs do not", "# satisfy our needs; they encodes unprintable characters using two-digit hex", "# escapes whereas our C++ unescaping function allows h...
https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/text_encoding.py#L56-L80
cornell-zhang/heterocl
6d9e4b4acc2ee2707b2d25b27298c0335bccedfd
python/heterocl/tvm/exec/rpc_server.py
python
main
()
Main funciton
Main funciton
[ "Main", "funciton" ]
def main(): """Main funciton""" parser = argparse.ArgumentParser() parser.add_argument('--host', type=str, default="0.0.0.0", help='the hostname of the server') parser.add_argument('--port', type=int, default=9090, help='The port of the PRC') parser.ad...
[ "def", "main", "(", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", ")", "parser", ".", "add_argument", "(", "'--host'", ",", "type", "=", "str", ",", "default", "=", "\"0.0.0.0\"", ",", "help", "=", "'the hostname of the server'", ")", "p...
https://github.com/cornell-zhang/heterocl/blob/6d9e4b4acc2ee2707b2d25b27298c0335bccedfd/python/heterocl/tvm/exec/rpc_server.py#L11-L43
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/categorical.py
python
Categorical.argsort
(self, ascending=True, kind="quicksort", *args, **kwargs)
return super().argsort(ascending=ascending, kind=kind, *args, **kwargs)
Return the indices that would sort the Categorical. .. versionchanged:: 0.25.0 Changed to sort missing values at the end. Parameters ---------- ascending : bool, default True Whether the indices should result in an ascending or descending sort. ...
Return the indices that would sort the Categorical.
[ "Return", "the", "indices", "that", "would", "sort", "the", "Categorical", "." ]
def argsort(self, ascending=True, kind="quicksort", *args, **kwargs): """ Return the indices that would sort the Categorical. .. versionchanged:: 0.25.0 Changed to sort missing values at the end. Parameters ---------- ascending : bool, default True ...
[ "def", "argsort", "(", "self", ",", "ascending", "=", "True", ",", "kind", "=", "\"quicksort\"", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "super", "(", ")", ".", "argsort", "(", "ascending", "=", "ascending", ",", "kind", "=", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/categorical.py#L1502-L1553
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/autopep8.py
python
commented_out_code_lines
(source)
return line_numbers
Return line numbers of comments that are likely code. Commented-out code is bad practice, but modifying it just adds even more clutter.
Return line numbers of comments that are likely code.
[ "Return", "line", "numbers", "of", "comments", "that", "are", "likely", "code", "." ]
def commented_out_code_lines(source): """Return line numbers of comments that are likely code. Commented-out code is bad practice, but modifying it just adds even more clutter. """ line_numbers = [] try: for t in generate_tokens(source): token_type = t[0] token_...
[ "def", "commented_out_code_lines", "(", "source", ")", ":", "line_numbers", "=", "[", "]", "try", ":", "for", "t", "in", "generate_tokens", "(", "source", ")", ":", "token_type", "=", "t", "[", "0", "]", "token_string", "=", "t", "[", "1", "]", "start_...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/autopep8.py#L2717-L2747
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/buildscripts/idl/idl/generator.py
python
_CppFileWriterBase.gen_include
(self, include)
Generate a non-system C++ include line.
Generate a non-system C++ include line.
[ "Generate", "a", "non", "-", "system", "C", "++", "include", "line", "." ]
def gen_include(self, include): # type: (unicode) -> None """Generate a non-system C++ include line.""" self._writer.write_unindented_line('#include "%s"' % (include))
[ "def", "gen_include", "(", "self", ",", "include", ")", ":", "# type: (unicode) -> None", "self", ".", "_writer", ".", "write_unindented_line", "(", "'#include \"%s\"'", "%", "(", "include", ")", ")" ]
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/idl/idl/generator.py#L297-L300
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_controls.py
python
StaticBitmap.GetClassDefaultAttributes
(*args, **kwargs)
return _controls_.StaticBitmap_GetClassDefaultAttributes(*args, **kwargs)
GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control -- which is a much better idea than hard coding specific co...
GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
[ "GetClassDefaultAttributes", "(", "int", "variant", "=", "WINDOW_VARIANT_NORMAL", ")", "-", ">", "VisualAttributes" ]
def GetClassDefaultAttributes(*args, **kwargs): """ GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control...
[ "def", "GetClassDefaultAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "StaticBitmap_GetClassDefaultAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L1100-L1115
scribusproject/scribus
41ec7c775a060912cf251682a8b1437f753f80f4
scribus/plugins/scriptplugin/samples/golden-mean.py
python
goldenMean
(aSize=0)
return aSize * ((sqrt(5) - 1)/2)
x = (?5-1)/2
x = (?5-1)/2
[ "x", "=", "(", "?5", "-", "1", ")", "/", "2" ]
def goldenMean(aSize=0): """x = (?5-1)/2""" return aSize * ((sqrt(5) - 1)/2)
[ "def", "goldenMean", "(", "aSize", "=", "0", ")", ":", "return", "aSize", "*", "(", "(", "sqrt", "(", "5", ")", "-", "1", ")", "/", "2", ")" ]
https://github.com/scribusproject/scribus/blob/41ec7c775a060912cf251682a8b1437f753f80f4/scribus/plugins/scriptplugin/samples/golden-mean.py#L53-L55
balloonwj/TeamTalk
dc79c40687e4c9d7bec07ff5c9782be586fd9b41
win-client/3rdParty/src/json/makerelease.py
python
svn_tag_sandbox
( tag_url, message )
Makes a tag based on the sandbox revisions.
Makes a tag based on the sandbox revisions.
[ "Makes", "a", "tag", "based", "on", "the", "sandbox", "revisions", "." ]
def svn_tag_sandbox( tag_url, message ): """Makes a tag based on the sandbox revisions. """ svn_command( 'copy', '-m', message, '.', tag_url )
[ "def", "svn_tag_sandbox", "(", "tag_url", ",", "message", ")", ":", "svn_command", "(", "'copy'", ",", "'-m'", ",", "message", ",", "'.'", ",", "tag_url", ")" ]
https://github.com/balloonwj/TeamTalk/blob/dc79c40687e4c9d7bec07ff5c9782be586fd9b41/win-client/3rdParty/src/json/makerelease.py#L96-L99
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/eclib/ctrlbox.py
python
ControlBar._DispatchEvent
(self, evt)
Translate the button events generated by the controls added by L{AddTool} to L{ControlBarEvent}'s.
Translate the button events generated by the controls added by L{AddTool} to L{ControlBarEvent}'s.
[ "Translate", "the", "button", "events", "generated", "by", "the", "controls", "added", "by", "L", "{", "AddTool", "}", "to", "L", "{", "ControlBarEvent", "}", "s", "." ]
def _DispatchEvent(self, evt): """Translate the button events generated by the controls added by L{AddTool} to L{ControlBarEvent}'s. """ e_id = evt.GetId() if e_id in self._tools['simple']: cb_evt = ControlBarEvent(edEVT_CTRLBAR, e_id) self.GetEventHandle...
[ "def", "_DispatchEvent", "(", "self", ",", "evt", ")", ":", "e_id", "=", "evt", ".", "GetId", "(", ")", "if", "e_id", "in", "self", ".", "_tools", "[", "'simple'", "]", ":", "cb_evt", "=", "ControlBarEvent", "(", "edEVT_CTRLBAR", ",", "e_id", ")", "s...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/eclib/ctrlbox.py#L384-L395
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/_pydecimal.py
python
Context.divide
(self, a, b)
Decimal division in a specified context. >>> ExtendedContext.divide(Decimal('1'), Decimal('3')) Decimal('0.333333333') >>> ExtendedContext.divide(Decimal('2'), Decimal('3')) Decimal('0.666666667') >>> ExtendedContext.divide(Decimal('5'), Decimal('2')) Decimal('2.5') ...
Decimal division in a specified context.
[ "Decimal", "division", "in", "a", "specified", "context", "." ]
def divide(self, a, b): """Decimal division in a specified context. >>> ExtendedContext.divide(Decimal('1'), Decimal('3')) Decimal('0.333333333') >>> ExtendedContext.divide(Decimal('2'), Decimal('3')) Decimal('0.666666667') >>> ExtendedContext.divide(Decimal('5'), Decima...
[ "def", "divide", "(", "self", ",", "a", ",", "b", ")", ":", "a", "=", "_convert_other", "(", "a", ",", "raiseit", "=", "True", ")", "r", "=", "a", ".", "__truediv__", "(", "b", ",", "context", "=", "self", ")", "if", "r", "is", "NotImplemented", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/_pydecimal.py#L4358-L4393
kismetwireless/kismet
a7c0dc270c960fb1f58bd9cec4601c201885fd4e
capture_bt_geiger/KismetCaptureBtGeiger/kismetexternal/__init__.py
python
Datasource.send_datasource_probe_report
(self, seqno, success=False, message=None, channels=None, channel=None, spectrum=None, hardware=None, **kwargs)
When operating as a Kismet datasource, send a probe source report; this is used to determine the datasource driver. This should be called by child implementations of this class from the datasource_probesource function. :param seqno: Sequence number of PROBESOURCE command :param success...
When operating as a Kismet datasource, send a probe source report; this is used to determine the datasource driver. This should be called by child implementations of this class from the datasource_probesource function.
[ "When", "operating", "as", "a", "Kismet", "datasource", "send", "a", "probe", "source", "report", ";", "this", "is", "used", "to", "determine", "the", "datasource", "driver", ".", "This", "should", "be", "called", "by", "child", "implementations", "of", "thi...
def send_datasource_probe_report(self, seqno, success=False, message=None, channels=None, channel=None, spectrum=None, hardware=None, **kwargs): """ When operating as a Kismet datasource, send a probe source report; this is used to determine the datasource dr...
[ "def", "send_datasource_probe_report", "(", "self", ",", "seqno", ",", "success", "=", "False", ",", "message", "=", "None", ",", "channels", "=", "None", ",", "channel", "=", "None", ",", "spectrum", "=", "None", ",", "hardware", "=", "None", ",", "*", ...
https://github.com/kismetwireless/kismet/blob/a7c0dc270c960fb1f58bd9cec4601c201885fd4e/capture_bt_geiger/KismetCaptureBtGeiger/kismetexternal/__init__.py#L1170-L1215
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/distutils/config.py
python
PyPIRCCommand._store_pypirc
(self, username, password)
Creates a default .pypirc file.
Creates a default .pypirc file.
[ "Creates", "a", "default", ".", "pypirc", "file", "." ]
def _store_pypirc(self, username, password): """Creates a default .pypirc file.""" rc = self._get_rc_file() with os.fdopen(os.open(rc, os.O_CREAT | os.O_WRONLY, 0o600), 'w') as f: f.write(DEFAULT_PYPIRC % (username, password))
[ "def", "_store_pypirc", "(", "self", ",", "username", ",", "password", ")", ":", "rc", "=", "self", ".", "_get_rc_file", "(", ")", "with", "os", ".", "fdopen", "(", "os", ".", "open", "(", "rc", ",", "os", ".", "O_CREAT", "|", "os", ".", "O_WRONLY"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/distutils/config.py#L42-L46
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py2/setuptools/_vendor/pyparsing.py
python
ParserElement.copy
( self )
return cpy
Make a copy of this C{ParserElement}. Useful for defining different parse actions for the same parsing pattern, using copies of the original parse element. Example:: integer = Word(nums).setParseAction(lambda toks: int(toks[0])) integerK = integer.copy().addParseAction(...
Make a copy of this C{ParserElement}. Useful for defining different parse actions for the same parsing pattern, using copies of the original parse element. Example:: integer = Word(nums).setParseAction(lambda toks: int(toks[0])) integerK = integer.copy().addParseAction(...
[ "Make", "a", "copy", "of", "this", "C", "{", "ParserElement", "}", ".", "Useful", "for", "defining", "different", "parse", "actions", "for", "the", "same", "parsing", "pattern", "using", "copies", "of", "the", "original", "parse", "element", ".", "Example", ...
def copy( self ): """ Make a copy of this C{ParserElement}. Useful for defining different parse actions for the same parsing pattern, using copies of the original parse element. Example:: integer = Word(nums).setParseAction(lambda toks: int(toks[0])) int...
[ "def", "copy", "(", "self", ")", ":", "cpy", "=", "copy", ".", "copy", "(", "self", ")", "cpy", ".", "parseAction", "=", "self", ".", "parseAction", "[", ":", "]", "cpy", ".", "ignoreExprs", "=", "self", ".", "ignoreExprs", "[", ":", "]", "if", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/_vendor/pyparsing.py#L1167-L1188
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/sets.py
python
Set.__iand__
(self, other)
return self
Update a set with the intersection of itself and another.
Update a set with the intersection of itself and another.
[ "Update", "a", "set", "with", "the", "intersection", "of", "itself", "and", "another", "." ]
def __iand__(self, other): """Update a set with the intersection of itself and another.""" self._binary_sanity_check(other) self._data = (self & other)._data return self
[ "def", "__iand__", "(", "self", ",", "other", ")", ":", "self", ".", "_binary_sanity_check", "(", "other", ")", "self", ".", "_data", "=", "(", "self", "&", "other", ")", ".", "_data", "return", "self" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/sets.py#L438-L442
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_controls.py
python
ListCtrl.InsertImageItem
(*args, **kwargs)
return _controls_.ListCtrl_InsertImageItem(*args, **kwargs)
InsertImageItem(self, long index, int imageIndex) -> long
InsertImageItem(self, long index, int imageIndex) -> long
[ "InsertImageItem", "(", "self", "long", "index", "int", "imageIndex", ")", "-", ">", "long" ]
def InsertImageItem(*args, **kwargs): """InsertImageItem(self, long index, int imageIndex) -> long""" return _controls_.ListCtrl_InsertImageItem(*args, **kwargs)
[ "def", "InsertImageItem", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ListCtrl_InsertImageItem", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L4708-L4710
PixarAnimationStudios/USD
faed18ce62c8736b02413635b584a2f637156bad
pxr/usd/usd/usdGenSchema.py
python
_SanitizeDoc
(doc, leader)
return leader.join([line.lstrip() for line in doc.split('\n')])
Cleanup the doc string in several ways: * Convert None to empty string * Replace new line chars with doxygen comments * Strip leading white space per line
Cleanup the doc string in several ways: * Convert None to empty string * Replace new line chars with doxygen comments * Strip leading white space per line
[ "Cleanup", "the", "doc", "string", "in", "several", "ways", ":", "*", "Convert", "None", "to", "empty", "string", "*", "Replace", "new", "line", "chars", "with", "doxygen", "comments", "*", "Strip", "leading", "white", "space", "per", "line" ]
def _SanitizeDoc(doc, leader): """Cleanup the doc string in several ways: * Convert None to empty string * Replace new line chars with doxygen comments * Strip leading white space per line """ if doc is None: return '' return leader.join([line.lstrip() for line in doc.spli...
[ "def", "_SanitizeDoc", "(", "doc", ",", "leader", ")", ":", "if", "doc", "is", "None", ":", "return", "''", "return", "leader", ".", "join", "(", "[", "line", ".", "lstrip", "(", ")", "for", "line", "in", "doc", ".", "split", "(", "'\\n'", ")", "...
https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usd/usd/usdGenSchema.py#L122-L131
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
mlir/utils/jupyter/mlir_opt_kernel/kernel.py
python
_get_executable
()
Find the mlir-opt executable.
Find the mlir-opt executable.
[ "Find", "the", "mlir", "-", "opt", "executable", "." ]
def _get_executable(): """Find the mlir-opt executable.""" def is_exe(fpath): """Returns whether executable file.""" return os.path.isfile(fpath) and os.access(fpath, os.X_OK) program = os.environ.get('MLIR_OPT_EXECUTABLE', 'mlir-opt') path, name = os.path.split(program) # Attempt ...
[ "def", "_get_executable", "(", ")", ":", "def", "is_exe", "(", "fpath", ")", ":", "\"\"\"Returns whether executable file.\"\"\"", "return", "os", ".", "path", ".", "isfile", "(", "fpath", ")", "and", "os", ".", "access", "(", "fpath", ",", "os", ".", "X_OK...
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/mlir/utils/jupyter/mlir_opt_kernel/kernel.py#L15-L33
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_gdi.py
python
Brush.SetStipple
(*args, **kwargs)
return _gdi_.Brush_SetStipple(*args, **kwargs)
SetStipple(self, Bitmap stipple) Sets the stipple `wx.Bitmap`.
SetStipple(self, Bitmap stipple)
[ "SetStipple", "(", "self", "Bitmap", "stipple", ")" ]
def SetStipple(*args, **kwargs): """ SetStipple(self, Bitmap stipple) Sets the stipple `wx.Bitmap`. """ return _gdi_.Brush_SetStipple(*args, **kwargs)
[ "def", "SetStipple", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "Brush_SetStipple", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L537-L543
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/numpy/array_creations.py
python
ones_like
(a, dtype=None, shape=None)
return _x_like(a, dtype, shape, ones)
Returns an array of ones with the same shape and type as a given array. Note: Input array must have the same size across a dimension. If `a` is not a Tensor, dtype is float32 by default if not provided. Args: a (Union[Tensor, list, tuple]): The shape and data-type of a define these sam...
Returns an array of ones with the same shape and type as a given array.
[ "Returns", "an", "array", "of", "ones", "with", "the", "same", "shape", "and", "type", "as", "a", "given", "array", "." ]
def ones_like(a, dtype=None, shape=None): """ Returns an array of ones with the same shape and type as a given array. Note: Input array must have the same size across a dimension. If `a` is not a Tensor, dtype is float32 by default if not provided. Args: a (Union[Tensor, list, ...
[ "def", "ones_like", "(", "a", ",", "dtype", "=", "None", ",", "shape", "=", "None", ")", ":", "return", "_x_like", "(", "a", ",", "dtype", ",", "shape", ",", "ones", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/numpy/array_creations.py#L858-L893
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_controls.py
python
BitmapButton.__init__
(self, *args, **kwargs)
__init__(self, Window parent, int id=-1, Bitmap bitmap=wxNullBitmap, Point pos=DefaultPosition, Size size=DefaultSize, long style=BU_AUTODRAW, Validator validator=DefaultValidator, String name=ButtonNameStr) -> BitmapButton Create and show a button with a bitmap for the l...
__init__(self, Window parent, int id=-1, Bitmap bitmap=wxNullBitmap, Point pos=DefaultPosition, Size size=DefaultSize, long style=BU_AUTODRAW, Validator validator=DefaultValidator, String name=ButtonNameStr) -> BitmapButton
[ "__init__", "(", "self", "Window", "parent", "int", "id", "=", "-", "1", "Bitmap", "bitmap", "=", "wxNullBitmap", "Point", "pos", "=", "DefaultPosition", "Size", "size", "=", "DefaultSize", "long", "style", "=", "BU_AUTODRAW", "Validator", "validator", "=", ...
def __init__(self, *args, **kwargs): """ __init__(self, Window parent, int id=-1, Bitmap bitmap=wxNullBitmap, Point pos=DefaultPosition, Size size=DefaultSize, long style=BU_AUTODRAW, Validator validator=DefaultValidator, String name=ButtonNameStr) -> BitmapButton...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_controls_", ".", "BitmapButton_swiginit", "(", "self", ",", "_controls_", ".", "new_BitmapButton", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")", "self", ".", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L295-L305
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ftplib.py
python
parse227
(resp)
return host, port
Parse the '227' response for a PASV request. Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)' Return ('host.addr.as.numbers', port#) tuple.
Parse the '227' response for a PASV request. Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)' Return ('host.addr.as.numbers', port#) tuple.
[ "Parse", "the", "227", "response", "for", "a", "PASV", "request", ".", "Raises", "error_proto", "if", "it", "does", "not", "contain", "(", "h1", "h2", "h3", "h4", "p1", "p2", ")", "Return", "(", "host", ".", "addr", ".", "as", ".", "numbers", "port#"...
def parse227(resp): '''Parse the '227' response for a PASV request. Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)' Return ('host.addr.as.numbers', port#) tuple.''' if resp[:3] != '227': raise error_reply(resp) global _227_re if _227_re is None: import re ...
[ "def", "parse227", "(", "resp", ")", ":", "if", "resp", "[", ":", "3", "]", "!=", "'227'", ":", "raise", "error_reply", "(", "resp", ")", "global", "_227_re", "if", "_227_re", "is", "None", ":", "import", "re", "_227_re", "=", "re", ".", "compile", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ftplib.py#L839-L856
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/rnn/python/ops/lstm_ops.py
python
LSTMBlockFusedCell.__init__
(self, num_units, forget_bias=1.0, cell_clip=None, use_peephole=False)
Initialize the LSTM cell. Args: num_units: int, The number of units in the LSTM cell. forget_bias: float, The bias added to forget gates (see above). cell_clip: clip the cell to this value. Defaults to `3`. use_peephole: Whether to use peephole connections or not.
Initialize the LSTM cell.
[ "Initialize", "the", "LSTM", "cell", "." ]
def __init__(self, num_units, forget_bias=1.0, cell_clip=None, use_peephole=False): """Initialize the LSTM cell. Args: num_units: int, The number of units in the LSTM cell. forget_bias: float, The bias added to forget gates (see above). ...
[ "def", "__init__", "(", "self", ",", "num_units", ",", "forget_bias", "=", "1.0", ",", "cell_clip", "=", "None", ",", "use_peephole", "=", "False", ")", ":", "self", ".", "_num_units", "=", "num_units", "self", ".", "_forget_bias", "=", "forget_bias", "sel...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/rnn/python/ops/lstm_ops.py#L582-L598
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/stc.py
python
StyledTextCtrl.GetCaretSticky
(*args, **kwargs)
return _stc.StyledTextCtrl_GetCaretSticky(*args, **kwargs)
GetCaretSticky(self) -> int Can the caret preferred x position only be changed by explicit movement commands?
GetCaretSticky(self) -> int
[ "GetCaretSticky", "(", "self", ")", "-", ">", "int" ]
def GetCaretSticky(*args, **kwargs): """ GetCaretSticky(self) -> int Can the caret preferred x position only be changed by explicit movement commands? """ return _stc.StyledTextCtrl_GetCaretSticky(*args, **kwargs)
[ "def", "GetCaretSticky", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_GetCaretSticky", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L5567-L5573
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/zipfile.py
python
ZipFile.extractall
(self, path=None, members=None, pwd=None)
Extract all members from the archive to the current working directory. `path' specifies a different directory to extract to. `members' is optional and must be a subset of the list returned by namelist().
Extract all members from the archive to the current working directory. `path' specifies a different directory to extract to. `members' is optional and must be a subset of the list returned by namelist().
[ "Extract", "all", "members", "from", "the", "archive", "to", "the", "current", "working", "directory", ".", "path", "specifies", "a", "different", "directory", "to", "extract", "to", ".", "members", "is", "optional", "and", "must", "be", "a", "subset", "of",...
def extractall(self, path=None, members=None, pwd=None): """Extract all members from the archive to the current working directory. `path' specifies a different directory to extract to. `members' is optional and must be a subset of the list returned by namelist(). """ ...
[ "def", "extractall", "(", "self", ",", "path", "=", "None", ",", "members", "=", "None", ",", "pwd", "=", "None", ")", ":", "if", "members", "is", "None", ":", "members", "=", "self", ".", "namelist", "(", ")", "for", "zipinfo", "in", "members", ":...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/zipfile.py#L1026-L1036
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/msvs.py
python
_NormalizedSource
(source)
return source
Normalize the path. But not if that gets rid of a variable, as this may expand to something larger than one directory. Arguments: source: The path to be normalize.d Returns: The normalized path.
Normalize the path.
[ "Normalize", "the", "path", "." ]
def _NormalizedSource(source): """Normalize the path. But not if that gets rid of a variable, as this may expand to something larger than one directory. Arguments: source: The path to be normalize.d Returns: The normalized path. """ normalized = os.path.normpath(source) if source.count('$...
[ "def", "_NormalizedSource", "(", "source", ")", ":", "normalized", "=", "os", ".", "path", ".", "normpath", "(", "source", ")", "if", "source", ".", "count", "(", "'$'", ")", "==", "normalized", ".", "count", "(", "'$'", ")", ":", "source", "=", "nor...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/msvs.py#L114-L129
ValveSoftware/source-sdk-2013
0d8dceea4310fde5706b3ce1c70609d72a38efdf
sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/encoder.py
python
_ModifiedEncoder
(wire_type, encode_value, compute_value_size, modify_value)
return SpecificEncoder
Like SimpleEncoder but additionally invokes modify_value on every value before passing it to encode_value. Usually modify_value is ZigZagEncode.
Like SimpleEncoder but additionally invokes modify_value on every value before passing it to encode_value. Usually modify_value is ZigZagEncode.
[ "Like", "SimpleEncoder", "but", "additionally", "invokes", "modify_value", "on", "every", "value", "before", "passing", "it", "to", "encode_value", ".", "Usually", "modify_value", "is", "ZigZagEncode", "." ]
def _ModifiedEncoder(wire_type, encode_value, compute_value_size, modify_value): """Like SimpleEncoder but additionally invokes modify_value on every value before passing it to encode_value. Usually modify_value is ZigZagEncode.""" def SpecificEncoder(field_number, is_repeated, is_packed): if is_packed: ...
[ "def", "_ModifiedEncoder", "(", "wire_type", ",", "encode_value", ",", "compute_value_size", ",", "modify_value", ")", ":", "def", "SpecificEncoder", "(", "field_number", ",", "is_repeated", ",", "is_packed", ")", ":", "if", "is_packed", ":", "tag_bytes", "=", "...
https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/encoder.py#L433-L464
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/sframe/data_structures/sframe.py
python
SFrame.num_cols
(self)
return self.__proxy__.num_columns()
The number of columns in this SFrame. Returns ------- out : int Number of columns in the SFrame. See Also -------- num_columns, num_rows
The number of columns in this SFrame.
[ "The", "number", "of", "columns", "in", "this", "SFrame", "." ]
def num_cols(self): """ The number of columns in this SFrame. Returns ------- out : int Number of columns in the SFrame. See Also -------- num_columns, num_rows """ return self.__proxy__.num_columns()
[ "def", "num_cols", "(", "self", ")", ":", "return", "self", ".", "__proxy__", ".", "num_columns", "(", ")" ]
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/sframe.py#L2825-L2838
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wptserve/wptserve/handlers.py
python
BasicAuthHandler.__init__
(self, handler, user, password)
A Basic Auth handler :Args: - handler: a secondary handler for the request after authentication is successful (example file_handler) - user: string of the valid user name or None if any / all credentials are allowed - password: string of the password required
A Basic Auth handler
[ "A", "Basic", "Auth", "handler" ]
def __init__(self, handler, user, password): """ A Basic Auth handler :Args: - handler: a secondary handler for the request after authentication is successful (example file_handler) - user: string of the valid user name or None if any / all credentials are allowed -...
[ "def", "__init__", "(", "self", ",", "handler", ",", "user", ",", "password", ")", ":", "self", ".", "user", "=", "user", "self", ".", "password", "=", "password", "self", ".", "handler", "=", "handler" ]
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wptserve/wptserve/handlers.py#L300-L311
mitmedialab/Junkyard-Jumbotron
7e32ecc8a01ea5a578fea6ea54f1f44c7f8f546e
python/calibrate.py
python
_get_camera_xform
(image)
return xform
Return the xform that maps world coordinates to image coordinates. Uses the Iphone's lens characteristics.
Return the xform that maps world coordinates to image coordinates. Uses the Iphone's lens characteristics.
[ "Return", "the", "xform", "that", "maps", "world", "coordinates", "to", "image", "coordinates", ".", "Uses", "the", "Iphone", "s", "lens", "characteristics", "." ]
def _get_camera_xform(image): """Return the xform that maps world coordinates to image coordinates. Uses the Iphone's lens characteristics.""" film_size = 6.35 # Iphone sensor size, in mm focal_length = 3.85 # Iphone focal length, in mm width, height = image.size aspect = float(width) / heigh...
[ "def", "_get_camera_xform", "(", "image", ")", ":", "film_size", "=", "6.35", "# Iphone sensor size, in mm", "focal_length", "=", "3.85", "# Iphone focal length, in mm", "width", ",", "height", "=", "image", ".", "size", "aspect", "=", "float", "(", "width", ")", ...
https://github.com/mitmedialab/Junkyard-Jumbotron/blob/7e32ecc8a01ea5a578fea6ea54f1f44c7f8f546e/python/calibrate.py#L16-L27
RamadhanAmizudin/malware
2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1
Fuzzbunch/fuzzbunch/pluginfinder.py
python
getpluginlist
(location, bin)
return pluginlist
@brief Get a list of available plugins from a given directory @param location Directory to search for plugins @param bin Is what we're trying to load binary?
[]
def getpluginlist(location, bin): """@brief Get a list of available plugins from a given directory @param location Directory to search for plugins @param bin Is what we're trying to load binary? """ fblist = getextensionfiles(location, FB_CONFIG_EXT) # get lis...
[ "def", "getpluginlist", "(", "location", ",", "bin", ")", ":", "fblist", "=", "getextensionfiles", "(", "location", ",", "FB_CONFIG_EXT", ")", "# get list of .fb files", "configlist", "=", "getextensionfiles", "(", "location", ",", "PLUGIN_CONFIG_EXT", ")", "# get l...
https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pluginfinder.py#L30-L59
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/internal/type_checkers.py
python
TypeChecker.CheckValue
(self, proposed_value)
return proposed_value
Type check the provided value and return it. The returned value might have been normalized to another type.
Type check the provided value and return it.
[ "Type", "check", "the", "provided", "value", "and", "return", "it", "." ]
def CheckValue(self, proposed_value): """Type check the provided value and return it. The returned value might have been normalized to another type. """ if not isinstance(proposed_value, self._acceptable_types): message = ('%.1024r has type %s, but expected one of: %s' % (propose...
[ "def", "CheckValue", "(", "self", ",", "proposed_value", ")", ":", "if", "not", "isinstance", "(", "proposed_value", ",", "self", ".", "_acceptable_types", ")", ":", "message", "=", "(", "'%.1024r has type %s, but expected one of: %s'", "%", "(", "proposed_value", ...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/internal/type_checkers.py#L101-L110
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/factorization/python/ops/gmm_ops.py
python
_covariance
(x, diag)
return cov
Defines the covariance operation of a matrix. Args: x: a matrix Tensor. Dimension 0 should contain the number of examples. diag: if True, it computes the diagonal covariance. Returns: A Tensor representing the covariance of x. In the case of diagonal matrix just the diagonal is returned.
Defines the covariance operation of a matrix.
[ "Defines", "the", "covariance", "operation", "of", "a", "matrix", "." ]
def _covariance(x, diag): """Defines the covariance operation of a matrix. Args: x: a matrix Tensor. Dimension 0 should contain the number of examples. diag: if True, it computes the diagonal covariance. Returns: A Tensor representing the covariance of x. In the case of diagonal matrix just the di...
[ "def", "_covariance", "(", "x", ",", "diag", ")", ":", "num_points", "=", "math_ops", ".", "cast", "(", "array_ops", ".", "shape", "(", "x", ")", "[", "0", "]", ",", "dtypes", ".", "float32", ")", "x", "-=", "math_ops", ".", "reduce_mean", "(", "x"...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L45-L63
continental/ecal
204dab80a24fe01abca62541133b311bf0c09608
lang/python/core/ecal/core/core.py
python
subscriber.__init__
(self, topic_name, topic_type="")
initialize subscriber :param topic_name: the unique topic name :type topic_name: string :param topic_type: optional type description :type topic_type: string
initialize subscriber
[ "initialize", "subscriber" ]
def __init__(self, topic_name, topic_type=""): """ initialize subscriber :param topic_name: the unique topic name :type topic_name: string :param topic_type: optional type description :type topic_type: string """ # topic name self.tname = topic_name # topic type self.ttype = ...
[ "def", "__init__", "(", "self", ",", "topic_name", ",", "topic_type", "=", "\"\"", ")", ":", "# topic name", "self", ".", "tname", "=", "topic_name", "# topic type", "self", ".", "ttype", "=", "topic_type", "# topic handle", "self", ".", "thandle", "=", "sub...
https://github.com/continental/ecal/blob/204dab80a24fe01abca62541133b311bf0c09608/lang/python/core/ecal/core/core.py#L639-L653
aimerykong/Low-Rank-Bilinear-Pooling
487eb2c857fd9c95357a5166b0c15ad0fe135b28
caffe-20160312/scripts/download_model_binary.py
python
reporthook
(count, block_size, total_size)
From http://blog.moleculea.com/2012/10/04/urlretrieve-progres-indicator/
From http://blog.moleculea.com/2012/10/04/urlretrieve-progres-indicator/
[ "From", "http", ":", "//", "blog", ".", "moleculea", ".", "com", "/", "2012", "/", "10", "/", "04", "/", "urlretrieve", "-", "progres", "-", "indicator", "/" ]
def reporthook(count, block_size, total_size): """ From http://blog.moleculea.com/2012/10/04/urlretrieve-progres-indicator/ """ global start_time if count == 0: start_time = time.time() return duration = (time.time() - start_time) or 0.01 progress_size = int(count * block_siz...
[ "def", "reporthook", "(", "count", ",", "block_size", ",", "total_size", ")", ":", "global", "start_time", "if", "count", "==", "0", ":", "start_time", "=", "time", ".", "time", "(", ")", "return", "duration", "=", "(", "time", ".", "time", "(", ")", ...
https://github.com/aimerykong/Low-Rank-Bilinear-Pooling/blob/487eb2c857fd9c95357a5166b0c15ad0fe135b28/caffe-20160312/scripts/download_model_binary.py#L13-L27
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/calendar.py
python
HTMLCalendar.formatyear
(self, theyear, width=3)
return ''.join(v)
Return a formatted year as a table of tables.
Return a formatted year as a table of tables.
[ "Return", "a", "formatted", "year", "as", "a", "table", "of", "tables", "." ]
def formatyear(self, theyear, width=3): """ Return a formatted year as a table of tables. """ v = [] a = v.append width = max(width, 1) a('<table border="0" cellpadding="0" cellspacing="0" class="%s">' % self.cssclass_year) a('\n') a('<tr...
[ "def", "formatyear", "(", "self", ",", "theyear", ",", "width", "=", "3", ")", ":", "v", "=", "[", "]", "a", "=", "v", ".", "append", "width", "=", "max", "(", "width", ",", "1", ")", "a", "(", "'<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" cl...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/calendar.py#L498-L520
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/ufunc_db.py
python
get_ufuncs
()
return _ufunc_db.keys()
obtain a list of supported ufuncs in the db
obtain a list of supported ufuncs in the db
[ "obtain", "a", "list", "of", "supported", "ufuncs", "in", "the", "db" ]
def get_ufuncs(): """obtain a list of supported ufuncs in the db""" _lazy_init_db() return _ufunc_db.keys()
[ "def", "get_ufuncs", "(", ")", ":", "_lazy_init_db", "(", ")", "return", "_ufunc_db", ".", "keys", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/ufunc_db.py#L27-L30
openalpr/openalpr
736ab0e608cf9b20d92f36a873bb1152240daa98
src/bindings/python/openalpr/openalpr.py
python
Alpr.get_version
(self)
return version_number
This gets the version of OpenALPR :return: Version information
This gets the version of OpenALPR
[ "This", "gets", "the", "version", "of", "OpenALPR" ]
def get_version(self): """ This gets the version of OpenALPR :return: Version information """ ptr = self._get_version_func(self.alpr_pointer) version_number = ctypes.cast(ptr, ctypes.c_char_p).value version_number = _convert_from_charp(version_number) se...
[ "def", "get_version", "(", "self", ")", ":", "ptr", "=", "self", ".", "_get_version_func", "(", "self", ".", "alpr_pointer", ")", "version_number", "=", "ctypes", ".", "cast", "(", "ptr", ",", "ctypes", ".", "c_char_p", ")", ".", "value", "version_number",...
https://github.com/openalpr/openalpr/blob/736ab0e608cf9b20d92f36a873bb1152240daa98/src/bindings/python/openalpr/openalpr.py#L191-L202
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/peacock/Input/ExecutableInfo.py
python
ExecutableInfo.setPath
(self, new_path, use_test_objects=False)
Executable path set property. Will try to generate the json data of the executable.
Executable path set property. Will try to generate the json data of the executable.
[ "Executable", "path", "set", "property", ".", "Will", "try", "to", "generate", "the", "json", "data", "of", "the", "executable", "." ]
def setPath(self, new_path, use_test_objects=False): """ Executable path set property. Will try to generate the json data of the executable. """ if not new_path: return setting_key = self.SETTINGS_KEY extra_args = [] if use_test_objects: ...
[ "def", "setPath", "(", "self", ",", "new_path", ",", "use_test_objects", "=", "False", ")", ":", "if", "not", "new_path", ":", "return", "setting_key", "=", "self", ".", "SETTINGS_KEY", "extra_args", "=", "[", "]", "if", "use_test_objects", ":", "setting_key...
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/Input/ExecutableInfo.py#L35-L71
paperManu/splash
0cc65377fa8c1225e1a1b8b3cfa35b4fd3a71467
tools/package_ubuntu.py
python
dput
(ppa: str, repo: str, version: List[int])
return subprocess.call(f"dput {ppa} {repo}_{version_str}-1_source.changes", shell=True)
Upload the Debian source package to the PPA :param ppa: PPA URL to upload to :param repo: Repository name :param version: Library version :return: Return the exit code of the command
Upload the Debian source package to the PPA
[ "Upload", "the", "Debian", "source", "package", "to", "the", "PPA" ]
def dput(ppa: str, repo: str, version: List[int]) -> int: """ Upload the Debian source package to the PPA :param ppa: PPA URL to upload to :param repo: Repository name :param version: Library version :return: Return the exit code of the command """ version_str = f"{version[0]}.{version...
[ "def", "dput", "(", "ppa", ":", "str", ",", "repo", ":", "str", ",", "version", ":", "List", "[", "int", "]", ")", "->", "int", ":", "version_str", "=", "f\"{version[0]}.{version[1]}.{version[2]}\"", "return", "subprocess", ".", "call", "(", "f\"dput {ppa} {...
https://github.com/paperManu/splash/blob/0cc65377fa8c1225e1a1b8b3cfa35b4fd3a71467/tools/package_ubuntu.py#L55-L66
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/xlsgrid.py
python
XLSTable.__init__
(self, grid, cells, rows, cols)
Default class constructor. :param `grid`: an instance of :class:`grid.Grid`; :param `cells`: a Python dictionary. For every key `(row, col)`, the corresponding value is an instance of :class:`XLSCell`; :param `rows`: the number of rows in the table; :param `cols`: the number of...
Default class constructor.
[ "Default", "class", "constructor", "." ]
def __init__(self, grid, cells, rows, cols): """ Default class constructor. :param `grid`: an instance of :class:`grid.Grid`; :param `cells`: a Python dictionary. For every key `(row, col)`, the corresponding value is an instance of :class:`XLSCell`; :param `rows`: the ...
[ "def", "__init__", "(", "self", ",", "grid", ",", "cells", ",", "rows", ",", "cols", ")", ":", "# The base class must be initialized *first*", "gridlib", ".", "PyGridTableBase", ".", "__init__", "(", "self", ")", "self", ".", "cells", "=", "cells", "self", "...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/xlsgrid.py#L1731-L1746
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/email/message.py
python
Message.set_boundary
(self, boundary)
Set the boundary parameter in Content-Type to 'boundary'. This is subtly different than deleting the Content-Type header and adding a new one with a new boundary parameter via add_header(). The main difference is that using the set_boundary() method preserves the order of the Content-T...
Set the boundary parameter in Content-Type to 'boundary'.
[ "Set", "the", "boundary", "parameter", "in", "Content", "-", "Type", "to", "boundary", "." ]
def set_boundary(self, boundary): """Set the boundary parameter in Content-Type to 'boundary'. This is subtly different than deleting the Content-Type header and adding a new one with a new boundary parameter via add_header(). The main difference is that using the set_boundary() method...
[ "def", "set_boundary", "(", "self", ",", "boundary", ")", ":", "missing", "=", "object", "(", ")", "params", "=", "self", ".", "_get_params_preserve", "(", "missing", ",", "'content-type'", ")", "if", "params", "is", "missing", ":", "# There was no Content-Typ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/email/message.py#L702-L745
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
PhysicsTools/Heppy/python/physicsutils/VBF.py
python
VBF.__init__
(self, jets, diLepton, vbfMvaCalc, cjvPtCut)
jets: jets cleaned from the diLepton legs. diLepton: the di-tau, for example. Necessary to compute input variables for MVA selection
jets: jets cleaned from the diLepton legs. diLepton: the di-tau, for example. Necessary to compute input variables for MVA selection
[ "jets", ":", "jets", "cleaned", "from", "the", "diLepton", "legs", ".", "diLepton", ":", "the", "di", "-", "tau", "for", "example", ".", "Necessary", "to", "compute", "input", "variables", "for", "MVA", "selection" ]
def __init__(self, jets, diLepton, vbfMvaCalc, cjvPtCut): '''jets: jets cleaned from the diLepton legs. diLepton: the di-tau, for example. Necessary to compute input variables for MVA selection ''' self.cjvPtCut = cjvPtCut self.vbfMvaCalc = vbfMvaCalc self.jets = jets ...
[ "def", "__init__", "(", "self", ",", "jets", ",", "diLepton", ",", "vbfMvaCalc", ",", "cjvPtCut", ")", ":", "self", ".", "cjvPtCut", "=", "cjvPtCut", "self", ".", "vbfMvaCalc", "=", "vbfMvaCalc", "self", ".", "jets", "=", "jets", "# the MET is taken from the...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/PhysicsTools/Heppy/python/physicsutils/VBF.py#L7-L54
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/image/image.py
python
ImageIter.next
(self)
return io.DataBatch([batch_data], [batch_label], pad=pad)
Returns the next batch of data.
Returns the next batch of data.
[ "Returns", "the", "next", "batch", "of", "data", "." ]
def next(self): """Returns the next batch of data.""" batch_size = self.batch_size c, h, w = self.data_shape # if last batch data is rolled over if self._cache_data is not None: # check both the data and label have values assert self._cache_label is not No...
[ "def", "next", "(", "self", ")", ":", "batch_size", "=", "self", ".", "batch_size", "c", ",", "h", ",", "w", "=", "self", ".", "data_shape", "# if last batch data is rolled over", "if", "self", ".", "_cache_data", "is", "not", "None", ":", "# check both the ...
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/image/image.py#L1513-L1558
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/xml/sax/xmlreader.py
python
InputSource.getPublicId
(self)
return self.__public_id
Returns the public identifier of this InputSource.
Returns the public identifier of this InputSource.
[ "Returns", "the", "public", "identifier", "of", "this", "InputSource", "." ]
def getPublicId(self): "Returns the public identifier of this InputSource." return self.__public_id
[ "def", "getPublicId", "(", "self", ")", ":", "return", "self", ".", "__public_id" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/xml/sax/xmlreader.py#L214-L216
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/executor.py
python
_is_enable_standalone_executor
()
return flag
Whether to use experimental executor `StandaloneExecutor`.
Whether to use experimental executor `StandaloneExecutor`.
[ "Whether", "to", "use", "experimental", "executor", "StandaloneExecutor", "." ]
def _is_enable_standalone_executor(): """ Whether to use experimental executor `StandaloneExecutor`. """ flag = False env_val = os.environ.get('FLAGS_USE_STANDALONE_EXECUTOR', None) if env_val in [1, '1', True, 'True', 'true']: flag = True return flag
[ "def", "_is_enable_standalone_executor", "(", ")", ":", "flag", "=", "False", "env_val", "=", "os", ".", "environ", ".", "get", "(", "'FLAGS_USE_STANDALONE_EXECUTOR'", ",", "None", ")", "if", "env_val", "in", "[", "1", ",", "'1'", ",", "True", ",", "'True'...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/executor.py#L392-L400
tomahawk-player/tomahawk-resolvers
7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d
archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/service.py
python
Service.GetResponseClass
(self, method_descriptor)
Returns the class of the response message for the specified method. This method isn't really needed, as the RpcChannel's CallMethod constructs the response protocol message. It's provided anyway in case it is useful for the caller to know the response type in advance.
Returns the class of the response message for the specified method.
[ "Returns", "the", "class", "of", "the", "response", "message", "for", "the", "specified", "method", "." ]
def GetResponseClass(self, method_descriptor): """Returns the class of the response message for the specified method. This method isn't really needed, as the RpcChannel's CallMethod constructs the response protocol message. It's provided anyway in case it is useful for the caller to know the response t...
[ "def", "GetResponseClass", "(", "self", ",", "method_descriptor", ")", ":", "raise", "NotImplementedError" ]
https://github.com/tomahawk-player/tomahawk-resolvers/blob/7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d/archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/service.py#L108-L115
naver/sling
5671cd445a2caae0b4dd0332299e4cfede05062c
webkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/standalone.py
python
_StandaloneConnection.get_remote_addr
(self)
return self._request_handler.client_address
Getter to mimic mp_conn.remote_addr. Setting the property in __init__ won't work because the request handler is not initialized yet there.
Getter to mimic mp_conn.remote_addr.
[ "Getter", "to", "mimic", "mp_conn", ".", "remote_addr", "." ]
def get_remote_addr(self): """Getter to mimic mp_conn.remote_addr. Setting the property in __init__ won't work because the request handler is not initialized yet there.""" return self._request_handler.client_address
[ "def", "get_remote_addr", "(", "self", ")", ":", "return", "self", ".", "_request_handler", ".", "client_address" ]
https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/standalone.py#L186-L192
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/external/bazel_tools/tools/android/stubify_manifest.py
python
StubifyMobileInstall
(manifest_string)
return (new_manifest, old_application, app_package)
Does the stubification on an XML string for mobile-install. Args: manifest_string: the input manifest as a string. Returns: A tuple of (output manifest, old application class, app package) Raises: Exception: if something goes wrong
Does the stubification on an XML string for mobile-install.
[ "Does", "the", "stubification", "on", "an", "XML", "string", "for", "mobile", "-", "install", "." ]
def StubifyMobileInstall(manifest_string): """Does the stubification on an XML string for mobile-install. Args: manifest_string: the input manifest as a string. Returns: A tuple of (output manifest, old application class, app package) Raises: Exception: if something goes wrong """ manifest, app...
[ "def", "StubifyMobileInstall", "(", "manifest_string", ")", ":", "manifest", ",", "application", "=", "_ParseManifest", "(", "manifest_string", ")", "old_application", "=", "application", ".", "get", "(", "\"{%s}name\"", "%", "ANDROID", ",", "\"android.app.Application...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/external/bazel_tools/tools/android/stubify_manifest.py#L60-L88
deepmodeling/deepmd-kit
159e45d248b0429844fb6a8cb3b3a201987c8d79
deepmd/descriptor/descriptor.py
python
Descriptor.enable_compression
(self, min_nbor_dist: float, model_file: str = 'frozon_model.pb', table_extrapolate: float = 5., table_stride_1: float = 0.01, table_stride_2: float = 0.1, ch...
Reveive the statisitcs (distance, max_nbor_size and env_mat_range) of the training data. Parameters ---------- min_nbor_dist : float The nearest distance between atoms model_file : str, default: 'frozon_model.pb' The original frozen model, which w...
Reveive the statisitcs (distance, max_nbor_size and env_mat_range) of the training data.
[ "Reveive", "the", "statisitcs", "(", "distance", "max_nbor_size", "and", "env_mat_range", ")", "of", "the", "training", "data", "." ]
def enable_compression(self, min_nbor_dist: float, model_file: str = 'frozon_model.pb', table_extrapolate: float = 5., table_stride_1: float = 0.01, table_stride_2: float = 0.1, ...
[ "def", "enable_compression", "(", "self", ",", "min_nbor_dist", ":", "float", ",", "model_file", ":", "str", "=", "'frozon_model.pb'", ",", "table_extrapolate", ":", "float", "=", "5.", ",", "table_stride_1", ":", "float", "=", "0.01", ",", "table_stride_2", "...
https://github.com/deepmodeling/deepmd-kit/blob/159e45d248b0429844fb6a8cb3b3a201987c8d79/deepmd/descriptor/descriptor.py#L228-L263
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/operations/control_ops.py
python
Merge.__init__
(self)
Initialize Merge.
Initialize Merge.
[ "Initialize", "Merge", "." ]
def __init__(self): """Initialize Merge."""
[ "def", "__init__", "(", "self", ")", ":" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/control_ops.py#L110-L111
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/LoadVesuvio.py
python
LoadVesuvio._calculate_double_difference
(self, ws_index)
Calculates the difference between the foil out, thin & thick foils using the mixing parameter beta. The final counts are: y = c_out(i)*(1-\beta) -c_thin(i) + \beta*c_thick(i). The output will be stored in cout @param ws_index :: The current index being processed
Calculates the difference between the foil out, thin & thick foils using the mixing parameter beta. The final counts are: y = c_out(i)*(1-\beta) -c_thin(i) + \beta*c_thick(i). The output will be stored in cout
[ "Calculates", "the", "difference", "between", "the", "foil", "out", "thin", "&", "thick", "foils", "using", "the", "mixing", "parameter", "beta", ".", "The", "final", "counts", "are", ":", "y", "=", "c_out", "(", "i", ")", "*", "(", "1", "-", "\\", "...
def _calculate_double_difference(self, ws_index): """ Calculates the difference between the foil out, thin & thick foils using the mixing parameter beta. The final counts are: y = c_out(i)*(1-\beta) -c_thin(i) + \beta*c_thick(i). The output will be stored in c...
[ "def", "_calculate_double_difference", "(", "self", ",", "ws_index", ")", ":", "cout", "=", "self", ".", "foil_out", ".", "dataY", "(", "ws_index", ")", "one_min_beta", "=", "(", "1.", "-", "self", ".", "_beta", ")", "cout", "*=", "one_min_beta", "cout", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/LoadVesuvio.py#L938-L957
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/SystemEvents/Folder_Actions_Suite.py
python
Folder_Actions_Suite_Events.do_folder_action
(self, _object, _attributes={}, **_arguments)
do folder action: Event the Finder sends to the Folder Actions FBA Required argument: the object for the command Keyword argument with_window_size: the new window size for the folder action message to process Keyword argument with_item_list: a list of items for the folder action message to proce...
do folder action: Event the Finder sends to the Folder Actions FBA Required argument: the object for the command Keyword argument with_window_size: the new window size for the folder action message to process Keyword argument with_item_list: a list of items for the folder action message to proce...
[ "do", "folder", "action", ":", "Event", "the", "Finder", "sends", "to", "the", "Folder", "Actions", "FBA", "Required", "argument", ":", "the", "object", "for", "the", "command", "Keyword", "argument", "with_window_size", ":", "the", "new", "window", "size", ...
def do_folder_action(self, _object, _attributes={}, **_arguments): """do folder action: Event the Finder sends to the Folder Actions FBA Required argument: the object for the command Keyword argument with_window_size: the new window size for the folder action message to process Keyword a...
[ "def", "do_folder_action", "(", "self", ",", "_object", ",", "_attributes", "=", "{", "}", ",", "*", "*", "_arguments", ")", ":", "_code", "=", "'faco'", "_subcode", "=", "'fola'", "aetools", ".", "keysubst", "(", "_arguments", ",", "self", ".", "_argmap...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/SystemEvents/Folder_Actions_Suite.py#L68-L91
CanalTP/navitia
cb84ce9859070187e708818b058e6a7e0b7f891b
source/jormungandr/jormungandr/utils.py
python
decode_polyline
(encoded, precision=6)
return decoded
Version of : https://developers.google.com/maps/documentation/utilities/polylinealgorithm But with improved precision See: https://mapzen.com/documentation/mobility/decoding/#python (valhalla) http://developers.geovelo.fr/#/documentation/compute (geovelo)
Version of : https://developers.google.com/maps/documentation/utilities/polylinealgorithm But with improved precision See: https://mapzen.com/documentation/mobility/decoding/#python (valhalla) http://developers.geovelo.fr/#/documentation/compute (geovelo)
[ "Version", "of", ":", "https", ":", "//", "developers", ".", "google", ".", "com", "/", "maps", "/", "documentation", "/", "utilities", "/", "polylinealgorithm", "But", "with", "improved", "precision", "See", ":", "https", ":", "//", "mapzen", ".", "com", ...
def decode_polyline(encoded, precision=6): ''' Version of : https://developers.google.com/maps/documentation/utilities/polylinealgorithm But with improved precision See: https://mapzen.com/documentation/mobility/decoding/#python (valhalla) http://developers.geovelo.fr/#/documentation/compute (g...
[ "def", "decode_polyline", "(", "encoded", ",", "precision", "=", "6", ")", ":", "inv", "=", "10", "**", "-", "precision", "decoded", "=", "[", "]", "previous", "=", "[", "0", ",", "0", "]", "i", "=", "0", "# for each byte", "while", "i", "<", "len"...
https://github.com/CanalTP/navitia/blob/cb84ce9859070187e708818b058e6a7e0b7f891b/source/jormungandr/jormungandr/utils.py#L417-L448
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/TechDraw/TechDrawTools/CommandMoveView.py
python
CommandMoveView.GetResources
(self)
return {'Pixmap': 'actions/TechDraw_MoveView.svg', 'Accel': "", 'MenuText': QT_TRANSLATE_NOOP("MoveView", "Move View"), 'ToolTip': QT_TRANSLATE_NOOP("MoveView", "Move a View to a new Page")}
Return a dictionary with data that will be used by the button or menu item.
Return a dictionary with data that will be used by the button or menu item.
[ "Return", "a", "dictionary", "with", "data", "that", "will", "be", "used", "by", "the", "button", "or", "menu", "item", "." ]
def GetResources(self): """Return a dictionary with data that will be used by the button or menu item.""" return {'Pixmap': 'actions/TechDraw_MoveView.svg', 'Accel': "", 'MenuText': QT_TRANSLATE_NOOP("MoveView", "Move View"), 'ToolTip': QT_TRANSLATE_NOOP("...
[ "def", "GetResources", "(", "self", ")", ":", "return", "{", "'Pixmap'", ":", "'actions/TechDraw_MoveView.svg'", ",", "'Accel'", ":", "\"\"", ",", "'MenuText'", ":", "QT_TRANSLATE_NOOP", "(", "\"MoveView\"", ",", "\"Move View\"", ")", ",", "'ToolTip'", ":", "QT_...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/TechDraw/TechDrawTools/CommandMoveView.py#L43-L48
chanyn/3Dpose_ssl
585696676279683a279b1ecca136c0e0d02aef2a
caffe-3dssl/scripts/cpp_lint.py
python
_SetFilters
(filters)
Sets the module's error-message filters. These filters are applied when deciding whether to emit a given error message. Args: filters: A string of comma-separated filters (eg "whitespace/indent"). Each filter should start with + or -; else we die.
Sets the module's error-message filters.
[ "Sets", "the", "module", "s", "error", "-", "message", "filters", "." ]
def _SetFilters(filters): """Sets the module's error-message filters. These filters are applied when deciding whether to emit a given error message. Args: filters: A string of comma-separated filters (eg "whitespace/indent"). Each filter should start with + or -; else we die. """ _cpplint...
[ "def", "_SetFilters", "(", "filters", ")", ":", "_cpplint_state", ".", "SetFilters", "(", "filters", ")" ]
https://github.com/chanyn/3Dpose_ssl/blob/585696676279683a279b1ecca136c0e0d02aef2a/caffe-3dssl/scripts/cpp_lint.py#L797-L807
cvmfs/cvmfs
4637bdb5153178eadf885c1acf37bdc5c685bf8a
cpplint.py
python
CheckBracesSpacing
(filename, clean_lines, linenum, error)
Checks for horizontal spacing near commas. 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.
Checks for horizontal spacing near commas.
[ "Checks", "for", "horizontal", "spacing", "near", "commas", "." ]
def CheckBracesSpacing(filename, clean_lines, linenum, error): """Checks for horizontal spacing near commas. 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...
[ "def", "CheckBracesSpacing", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Except after an opening paren, or after another opening brace (in case of", "# an initializer list, f...
https://github.com/cvmfs/cvmfs/blob/4637bdb5153178eadf885c1acf37bdc5c685bf8a/cpplint.py#L3316-L3392
microsoft/EdgeML
ef9f8a77f096acbdeb941014791f8eda1c1bc35b
tf/edgeml_tf/trainer/bonsaiTrainer.py
python
BonsaiTrainer.lossGraph
(self)
return self.loss, self.marginLoss, self.regLoss
Loss Graph for given Bonsai Obj
Loss Graph for given Bonsai Obj
[ "Loss", "Graph", "for", "given", "Bonsai", "Obj" ]
def lossGraph(self): ''' Loss Graph for given Bonsai Obj ''' self.regLoss = 0.5 * (self.lZ * tf.square(tf.norm(self.bonsaiObj.Z)) + self.lW * tf.square(tf.norm(self.bonsaiObj.W)) + self.lV * tf.square(tf.norm(self.bonsaiObj.V)) ...
[ "def", "lossGraph", "(", "self", ")", ":", "self", ".", "regLoss", "=", "0.5", "*", "(", "self", ".", "lZ", "*", "tf", ".", "square", "(", "tf", ".", "norm", "(", "self", ".", "bonsaiObj", ".", "Z", ")", ")", "+", "self", ".", "lW", "*", "tf"...
https://github.com/microsoft/EdgeML/blob/ef9f8a77f096acbdeb941014791f8eda1c1bc35b/tf/edgeml_tf/trainer/bonsaiTrainer.py#L78-L117
cksystemsgroup/scal
fa2208a97a77d65f4e90f85fef3404c27c1f2ac2
tools/cpplint.py
python
ParseNolintSuppressions
(filename, raw_line, linenum, error)
Updates the global list of error-suppressions. Parses any NOLINT comments on the current line, updating the global error_suppressions store. Reports an error if the NOLINT comment was malformed. Args: filename: str, the name of the input file. raw_line: str, the line of input text, with comments. ...
Updates the global list of error-suppressions.
[ "Updates", "the", "global", "list", "of", "error", "-", "suppressions", "." ]
def ParseNolintSuppressions(filename, raw_line, linenum, error): """Updates the global list of error-suppressions. Parses any NOLINT comments on the current line, updating the global error_suppressions store. Reports an error if the NOLINT comment was malformed. Args: filename: str, the name of the inp...
[ "def", "ParseNolintSuppressions", "(", "filename", ",", "raw_line", ",", "linenum", ",", "error", ")", ":", "matched", "=", "Search", "(", "r'\\bNOLINT(NEXTLINE)?\\b(\\([^)]+\\))?'", ",", "raw_line", ")", "if", "matched", ":", "if", "matched", ".", "group", "(",...
https://github.com/cksystemsgroup/scal/blob/fa2208a97a77d65f4e90f85fef3404c27c1f2ac2/tools/cpplint.py#L504-L533
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros_comm/rosservice/src/rosservice/__init__.py
python
_rosservice_cmd_uri
(argv, )
Parse 'uri' command arguments and run command. Will cause a system exit if command-line argument parsing fails. @param argv: command-line arguments @type argv: [str] @raise ROSServiceException: if uri command cannot be executed
Parse 'uri' command arguments and run command. Will cause a system exit if command-line argument parsing fails.
[ "Parse", "uri", "command", "arguments", "and", "run", "command", ".", "Will", "cause", "a", "system", "exit", "if", "command", "-", "line", "argument", "parsing", "fails", "." ]
def _rosservice_cmd_uri(argv, ): """ Parse 'uri' command arguments and run command. Will cause a system exit if command-line argument parsing fails. @param argv: command-line arguments @type argv: [str] @raise ROSServiceException: if uri command cannot be executed """ _rosservice_uri(_...
[ "def", "_rosservice_cmd_uri", "(", "argv", ",", ")", ":", "_rosservice_uri", "(", "_optparse_service_only", "(", "'uri'", ",", "argv", "=", "argv", ")", ")" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rosservice/src/rosservice/__init__.py#L529-L537
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/jedi/jedi/evaluate/finder.py
python
_check_flow_information
(context, flow, search_name, pos)
return result
Try to find out the type of a variable just with the information that is given by the flows: e.g. It is also responsible for assert checks.:: if isinstance(k, str): k. # <- completion here ensures that `k` is a string.
Try to find out the type of a variable just with the information that is given by the flows: e.g. It is also responsible for assert checks.::
[ "Try", "to", "find", "out", "the", "type", "of", "a", "variable", "just", "with", "the", "information", "that", "is", "given", "by", "the", "flows", ":", "e", ".", "g", ".", "It", "is", "also", "responsible", "for", "assert", "checks", ".", "::" ]
def _check_flow_information(context, flow, search_name, pos): """ Try to find out the type of a variable just with the information that is given by the flows: e.g. It is also responsible for assert checks.:: if isinstance(k, str): k. # <- completion here ensures that `k` is a string. ...
[ "def", "_check_flow_information", "(", "context", ",", "flow", ",", "search_name", ",", "pos", ")", ":", "if", "not", "settings", ".", "dynamic_flow_information", ":", "return", "None", "result", "=", "None", "if", "is_scope", "(", "flow", ")", ":", "# Check...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/jedi/jedi/evaluate/finder.py#L203-L240
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/special/basic.py
python
yn_zeros
(n, nt)
return jnyn_zeros(n, nt)[2]
Compute zeros of integer-order Bessel function Yn(x). Parameters ---------- n : int Order of Bessel function nt : int Number of zeros to return References ---------- .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons,...
Compute zeros of integer-order Bessel function Yn(x).
[ "Compute", "zeros", "of", "integer", "-", "order", "Bessel", "function", "Yn", "(", "x", ")", "." ]
def yn_zeros(n, nt): """Compute zeros of integer-order Bessel function Yn(x). Parameters ---------- n : int Order of Bessel function nt : int Number of zeros to return References ---------- .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special Func...
[ "def", "yn_zeros", "(", "n", ",", "nt", ")", ":", "return", "jnyn_zeros", "(", "n", ",", "nt", ")", "[", "2", "]" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/special/basic.py#L301-L318
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
base/android/jni_generator/jni_generator.py
python
InlHeaderFileGenerator.GetClassPathDefinitions
(self)
return '\n'.join(ret)
Returns the ClassPath constants.
Returns the ClassPath constants.
[ "Returns", "the", "ClassPath", "constants", "." ]
def GetClassPathDefinitions(self): """Returns the ClassPath constants.""" ret = [] template = Template("""\ const char k${JAVA_CLASS}ClassPath[] = "${JNI_CLASS_PATH}";""") all_classes = self.GetUniqueClasses(self.called_by_natives) if self.options.native_exports_optional: all_classes.update(se...
[ "def", "GetClassPathDefinitions", "(", "self", ")", ":", "ret", "=", "[", "]", "template", "=", "Template", "(", "\"\"\"\\\nconst char k${JAVA_CLASS}ClassPath[] = \"${JNI_CLASS_PATH}\";\"\"\"", ")", "all_classes", "=", "self", ".", "GetUniqueClasses", "(", "self", ".", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/base/android/jni_generator/jni_generator.py#L1162-L1192
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py
python
PtyProcess.isalive
(self)
return False
This tests if the child process is running or not. This is non-blocking. If the child was terminated then this will read the exitstatus or signalstatus of the child. This returns True if the child process appears to be running or False if not. It can take literally SECONDS for Solaris to...
This tests if the child process is running or not. This is non-blocking. If the child was terminated then this will read the exitstatus or signalstatus of the child. This returns True if the child process appears to be running or False if not. It can take literally SECONDS for Solaris to...
[ "This", "tests", "if", "the", "child", "process", "is", "running", "or", "not", ".", "This", "is", "non", "-", "blocking", ".", "If", "the", "child", "was", "terminated", "then", "this", "will", "read", "the", "exitstatus", "or", "signalstatus", "of", "t...
def isalive(self): '''This tests if the child process is running or not. This is non-blocking. If the child was terminated then this will read the exitstatus or signalstatus of the child. This returns True if the child process appears to be running or False if not. It can take literally ...
[ "def", "isalive", "(", "self", ")", ":", "if", "self", ".", "terminated", ":", "return", "False", "if", "self", ".", "flag_eof", ":", "# This is for Linux, which requires the blocking form", "# of waitpid to get the status of a defunct process.", "# This is super-lame. The fl...
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py#L685-L760
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_windows.py
python
GetFontFromUser
(*args, **kwargs)
return _windows_.GetFontFromUser(*args, **kwargs)
GetFontFromUser(Window parent=None, Font fontInit=wxNullFont, String caption=EmptyString) -> Font
GetFontFromUser(Window parent=None, Font fontInit=wxNullFont, String caption=EmptyString) -> Font
[ "GetFontFromUser", "(", "Window", "parent", "=", "None", "Font", "fontInit", "=", "wxNullFont", "String", "caption", "=", "EmptyString", ")", "-", ">", "Font" ]
def GetFontFromUser(*args, **kwargs): """GetFontFromUser(Window parent=None, Font fontInit=wxNullFont, String caption=EmptyString) -> Font""" return _windows_.GetFontFromUser(*args, **kwargs)
[ "def", "GetFontFromUser", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "GetFontFromUser", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L3613-L3615
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py
python
resolve_egg_link
(path)
return next(dist_groups, ())
Given a path to an .egg-link, resolve distributions present in the referenced path.
Given a path to an .egg-link, resolve distributions present in the referenced path.
[ "Given", "a", "path", "to", "an", ".", "egg", "-", "link", "resolve", "distributions", "present", "in", "the", "referenced", "path", "." ]
def resolve_egg_link(path): """ Given a path to an .egg-link, resolve distributions present in the referenced path. """ referenced_paths = non_empty_lines(path) resolved_paths = ( os.path.join(os.path.dirname(path), ref) for ref in referenced_paths ) dist_groups = map(fin...
[ "def", "resolve_egg_link", "(", "path", ")", ":", "referenced_paths", "=", "non_empty_lines", "(", "path", ")", "resolved_paths", "=", "(", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "dirname", "(", "path", ")", ",", "ref", ")", "for"...
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/_vendor/pkg_resources/__init__.py#L2150-L2161
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/richtext.py
python
RichTextBuffer_CleanUpHandlers
(*args)
return _richtext.RichTextBuffer_CleanUpHandlers(*args)
RichTextBuffer_CleanUpHandlers()
RichTextBuffer_CleanUpHandlers()
[ "RichTextBuffer_CleanUpHandlers", "()" ]
def RichTextBuffer_CleanUpHandlers(*args): """RichTextBuffer_CleanUpHandlers()""" return _richtext.RichTextBuffer_CleanUpHandlers(*args)
[ "def", "RichTextBuffer_CleanUpHandlers", "(", "*", "args", ")", ":", "return", "_richtext", ".", "RichTextBuffer_CleanUpHandlers", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L2697-L2699
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/indexes/datetimelike.py
python
DatetimeIndexOpsMixin._add_datetimelike_methods
(cls)
Add in the datetimelike methods (as we may have to override the superclass).
Add in the datetimelike methods (as we may have to override the superclass).
[ "Add", "in", "the", "datetimelike", "methods", "(", "as", "we", "may", "have", "to", "override", "the", "superclass", ")", "." ]
def _add_datetimelike_methods(cls): """ Add in the datetimelike methods (as we may have to override the superclass). """ def __add__(self, other): # dispatch to ExtensionArray implementation result = self._data.__add__(maybe_unwrap_index(other)) ...
[ "def", "_add_datetimelike_methods", "(", "cls", ")", ":", "def", "__add__", "(", "self", ",", "other", ")", ":", "# dispatch to ExtensionArray implementation", "result", "=", "self", ".", "_data", ".", "__add__", "(", "maybe_unwrap_index", "(", "other", ")", ")"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/indexes/datetimelike.py#L481-L510
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/flatmenu.py
python
GetMRUEntryLabel
(n, path)
return "&%d %s"%(n + 1, pathInMenu)
Returns the string used for the MRU list items in the menu. :param integer `n`: the index of the file name in the MRU list; :param string `path`: the full path of the file name. :note: The index `n` is 0-based, as usual, but the strings start from 1.
Returns the string used for the MRU list items in the menu.
[ "Returns", "the", "string", "used", "for", "the", "MRU", "list", "items", "in", "the", "menu", "." ]
def GetMRUEntryLabel(n, path): """ Returns the string used for the MRU list items in the menu. :param integer `n`: the index of the file name in the MRU list; :param string `path`: the full path of the file name. :note: The index `n` is 0-based, as usual, but the strings start from 1. """ ...
[ "def", "GetMRUEntryLabel", "(", "n", ",", "path", ")", ":", "# we need to quote '&' characters which are used for mnemonics", "pathInMenu", "=", "path", ".", "replace", "(", "\"&\"", ",", "\"&&\"", ")", "return", "\"&%d %s\"", "%", "(", "n", "+", "1", ",", "path...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L1862-L1874
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/html.py
python
HtmlWindow.ToText
(*args, **kwargs)
return _html.HtmlWindow_ToText(*args, **kwargs)
ToText(self) -> String
ToText(self) -> String
[ "ToText", "(", "self", ")", "-", ">", "String" ]
def ToText(*args, **kwargs): """ToText(self) -> String""" return _html.HtmlWindow_ToText(*args, **kwargs)
[ "def", "ToText", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html", ".", "HtmlWindow_ToText", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html.py#L1110-L1112
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/logging/__init__.py
python
Handler.handle
(self, record)
return rv
Conditionally emit the specified logging record. Emission depends on filters which may have been added to the handler. Wrap the actual emission of the record with acquisition/release of the I/O thread lock. Returns whether the filter passed the record for emission.
Conditionally emit the specified logging record.
[ "Conditionally", "emit", "the", "specified", "logging", "record", "." ]
def handle(self, record): """ Conditionally emit the specified logging record. Emission depends on filters which may have been added to the handler. Wrap the actual emission of the record with acquisition/release of the I/O thread lock. Returns whether the filter passed the reco...
[ "def", "handle", "(", "self", ",", "record", ")", ":", "rv", "=", "self", ".", "filter", "(", "record", ")", "if", "rv", ":", "self", ".", "acquire", "(", ")", "try", ":", "self", ".", "emit", "(", "record", ")", "finally", ":", "self", ".", "r...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/logging/__init__.py#L736-L752
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/linalg/linear_operator_identity.py
python
BaseLinearOperatorIdentity._min_matrix_dim
(self)
return min(domain_dim, range_dim)
Minimum of domain/range dimension, if statically available, else None.
Minimum of domain/range dimension, if statically available, else None.
[ "Minimum", "of", "domain", "/", "range", "dimension", "if", "statically", "available", "else", "None", "." ]
def _min_matrix_dim(self): """Minimum of domain/range dimension, if statically available, else None.""" domain_dim = tensor_shape.dimension_value(self.domain_dimension) range_dim = tensor_shape.dimension_value(self.range_dimension) if domain_dim is None or range_dim is None: return None return...
[ "def", "_min_matrix_dim", "(", "self", ")", ":", "domain_dim", "=", "tensor_shape", ".", "dimension_value", "(", "self", ".", "domain_dimension", ")", "range_dim", "=", "tensor_shape", ".", "dimension_value", "(", "self", ".", "range_dimension", ")", "if", "doma...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/linalg/linear_operator_identity.py#L73-L79
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/nn/modules/module.py
python
Module.named_modules
(self, memo: Optional[Set['Module']] = None, prefix: str = '', remove_duplicate: bool = True)
r"""Returns an iterator over all modules in the network, yielding both the name of the module as well as the module itself. Args: memo: a memo to store the set of modules already added to the result prefix: a prefix that will be added to the name of the module remove...
r"""Returns an iterator over all modules in the network, yielding both the name of the module as well as the module itself.
[ "r", "Returns", "an", "iterator", "over", "all", "modules", "in", "the", "network", "yielding", "both", "the", "name", "of", "the", "module", "as", "well", "as", "the", "module", "itself", "." ]
def named_modules(self, memo: Optional[Set['Module']] = None, prefix: str = '', remove_duplicate: bool = True): r"""Returns an iterator over all modules in the network, yielding both the name of the module as well as the module itself. Args: memo: a memo to store the set of modules ...
[ "def", "named_modules", "(", "self", ",", "memo", ":", "Optional", "[", "Set", "[", "'Module'", "]", "]", "=", "None", ",", "prefix", ":", "str", "=", "''", ",", "remove_duplicate", ":", "bool", "=", "True", ")", ":", "if", "memo", "is", "None", ":...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/nn/modules/module.py#L1669-L1712
lballabio/quantlib-old
136336947ed4fea9ecc1da6edad188700e821739
gensrc/gensrc/types/fulltype.py
python
FullType.objectReference
(self)
return self.objectReference_
Return a boolean indicating whether or not variables of the specified datatype comprise references to objects.
Return a boolean indicating whether or not variables of the specified datatype comprise references to objects.
[ "Return", "a", "boolean", "indicating", "whether", "or", "not", "variables", "of", "the", "specified", "datatype", "comprise", "references", "to", "objects", "." ]
def objectReference(self): """Return a boolean indicating whether or not variables of the specified datatype comprise references to objects.""" return self.objectReference_
[ "def", "objectReference", "(", "self", ")", ":", "return", "self", ".", "objectReference_" ]
https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/types/fulltype.py#L73-L76
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/telemetry/internal/app/android_app.py
python
AndroidApp.GetProcess
(self, subprocess_name)
return self._app_backend.GetProcess(subprocess_name)
Returns the process with the specified subprocess name.
Returns the process with the specified subprocess name.
[ "Returns", "the", "process", "with", "the", "specified", "subprocess", "name", "." ]
def GetProcess(self, subprocess_name): """Returns the process with the specified subprocess name.""" return self._app_backend.GetProcess(subprocess_name)
[ "def", "GetProcess", "(", "self", ",", "subprocess_name", ")", ":", "return", "self", ".", "_app_backend", ".", "GetProcess", "(", "subprocess_name", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/internal/app/android_app.py#L36-L38
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/ops/data_flow_ops.py
python
QueueBase.names
(self)
return self._names
The list of names for each component of a queue element.
The list of names for each component of a queue element.
[ "The", "list", "of", "names", "for", "each", "component", "of", "a", "queue", "element", "." ]
def names(self): """The list of names for each component of a queue element.""" return self._names
[ "def", "names", "(", "self", ")", ":", "return", "self", ".", "_names" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/data_flow_ops.py#L211-L213
toggl-open-source/toggldesktop
91865205885531cc8fd9e8d613dad49d625d56e7
third_party/cpplint/cpplint.py
python
GetTemplateArgs
(clean_lines, linenum)
return typenames
Find list of template arguments associated with this function declaration. Args: clean_lines: A CleansedLines instance containing the file. linenum: Line number containing the start of the function declaration, usually one line after the end of the template-argument-list. Returns: Set of t...
Find list of template arguments associated with this function declaration.
[ "Find", "list", "of", "template", "arguments", "associated", "with", "this", "function", "declaration", "." ]
def GetTemplateArgs(clean_lines, linenum): """Find list of template arguments associated with this function declaration. Args: clean_lines: A CleansedLines instance containing the file. linenum: Line number containing the start of the function declaration, usually one line after the end of the...
[ "def", "GetTemplateArgs", "(", "clean_lines", ",", "linenum", ")", ":", "# Find start of function", "func_line", "=", "linenum", "while", "func_line", ">", "0", ":", "line", "=", "clean_lines", ".", "elided", "[", "func_line", "]", "if", "Match", "(", "r'^\\s*...
https://github.com/toggl-open-source/toggldesktop/blob/91865205885531cc8fd9e8d613dad49d625d56e7/third_party/cpplint/cpplint.py#L3712-L3773
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros_comm/rospy/src/rospy/impl/tcpros_base.py
python
TCPServer.run
(self)
Main TCP receive loop. Should be run in a separate thread -- use start() to do this automatically.
Main TCP receive loop. Should be run in a separate thread -- use start() to do this automatically.
[ "Main", "TCP", "receive", "loop", ".", "Should", "be", "run", "in", "a", "separate", "thread", "--", "use", "start", "()", "to", "do", "this", "automatically", "." ]
def run(self): """ Main TCP receive loop. Should be run in a separate thread -- use start() to do this automatically. """ self.is_shutdown = False if not self.server_sock: raise ROSInternalException("%s did not connect"%self.__class__.__name__) while n...
[ "def", "run", "(", "self", ")", ":", "self", ".", "is_shutdown", "=", "False", "if", "not", "self", ".", "server_sock", ":", "raise", "ROSInternalException", "(", "\"%s did not connect\"", "%", "self", ".", "__class__", ".", "__name__", ")", "while", "not", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rospy/src/rospy/impl/tcpros_base.py#L148-L175
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/control/robotinterface.py
python
RobotInterfaceBase.sensorMeasurements
(self, name: str)
Returns the latest measurements from a sensor. Interpretation of the result is sensor-dependent.
Returns the latest measurements from a sensor. Interpretation of the result is sensor-dependent.
[ "Returns", "the", "latest", "measurements", "from", "a", "sensor", ".", "Interpretation", "of", "the", "result", "is", "sensor", "-", "dependent", "." ]
def sensorMeasurements(self, name: str): """Returns the latest measurements from a sensor. Interpretation of the result is sensor-dependent. """ raise NotImplementedError()
[ "def", "sensorMeasurements", "(", "self", ",", "name", ":", "str", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/control/robotinterface.py#L407-L411
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/learn/python/learn/estimators/head.py
python
_BinaryLogisticHead._metrics
(self, eval_loss, predictions, labels, weights)
return metrics
Returns a dict of metrics keyed by name.
Returns a dict of metrics keyed by name.
[ "Returns", "a", "dict", "of", "metrics", "keyed", "by", "name", "." ]
def _metrics(self, eval_loss, predictions, labels, weights): """Returns a dict of metrics keyed by name.""" with ops.name_scope("metrics", values=( [eval_loss, labels, weights] + list(six.itervalues(predictions)))): classes = predictions[prediction_key.PredictionKey.CLASSES] logistic = predi...
[ "def", "_metrics", "(", "self", ",", "eval_loss", ",", "predictions", ",", "labels", ",", "weights", ")", ":", "with", "ops", ".", "name_scope", "(", "\"metrics\"", ",", "values", "=", "(", "[", "eval_loss", ",", "labels", ",", "weights", "]", "+", "li...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/learn/python/learn/estimators/head.py#L892-L935
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/protobuf/py2/google/protobuf/internal/well_known_types.py
python
ListValue.add_list
(self)
return list_value
Appends and returns a list value as the next value in the list.
Appends and returns a list value as the next value in the list.
[ "Appends", "and", "returns", "a", "list", "value", "as", "the", "next", "value", "in", "the", "list", "." ]
def add_list(self): """Appends and returns a list value as the next value in the list.""" list_value = self.values.add().list_value # Clear will mark list_value modified which will indeed create a list. list_value.Clear() return list_value
[ "def", "add_list", "(", "self", ")", ":", "list_value", "=", "self", ".", "values", ".", "add", "(", ")", ".", "list_value", "# Clear will mark list_value modified which will indeed create a list.", "list_value", ".", "Clear", "(", ")", "return", "list_value" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/internal/well_known_types.py#L846-L851
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/ops/math_ops.py
python
accumulate_n
(inputs, shape=None, tensor_dtype=None, name=None)
Returns the element-wise sum of a list of tensors. Optionally, pass `shape` and `tensor_dtype` for shape and type checking, otherwise, these are inferred. For example: ```python # tensor 'a' is [[1, 2], [3, 4]] # tensor `b` is [[5, 0], [0, 6]] tf.accumulate_n([a, b, a]) ==> [[7, 4], [6, 14]] # Expli...
Returns the element-wise sum of a list of tensors.
[ "Returns", "the", "element", "-", "wise", "sum", "of", "a", "list", "of", "tensors", "." ]
def accumulate_n(inputs, shape=None, tensor_dtype=None, name=None): """Returns the element-wise sum of a list of tensors. Optionally, pass `shape` and `tensor_dtype` for shape and type checking, otherwise, these are inferred. For example: ```python # tensor 'a' is [[1, 2], [3, 4]] # tensor `b` is [[5, ...
[ "def", "accumulate_n", "(", "inputs", ",", "shape", "=", "None", ",", "tensor_dtype", "=", "None", ",", "name", "=", "None", ")", ":", "if", "tensor_dtype", "is", "None", ":", "if", "not", "inputs", "or", "not", "isinstance", "(", "inputs", ",", "(", ...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/math_ops.py#L1475-L1545
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/rexec.py
python
RExec.r_execfile
(self, file)
Execute the Python code in the file in the restricted environment's __main__ module.
Execute the Python code in the file in the restricted environment's __main__ module.
[ "Execute", "the", "Python", "code", "in", "the", "file", "in", "the", "restricted", "environment", "s", "__main__", "module", "." ]
def r_execfile(self, file): """Execute the Python code in the file in the restricted environment's __main__ module. """ m = self.add_module('__main__') execfile(file, m.__dict__)
[ "def", "r_execfile", "(", "self", ",", "file", ")", ":", "m", "=", "self", ".", "add_module", "(", "'__main__'", ")", "execfile", "(", "file", ",", "m", ".", "__dict__", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/rexec.py#L330-L336
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/find-two-non-overlapping-sub-arrays-each-with-target-sum.py
python
Solution.minSumOfLengths
(self, arr, target)
return result if result != float("inf") else -1
:type arr: List[int] :type target: int :rtype: int
:type arr: List[int] :type target: int :rtype: int
[ ":", "type", "arr", ":", "List", "[", "int", "]", ":", "type", "target", ":", "int", ":", "rtype", ":", "int" ]
def minSumOfLengths(self, arr, target): """ :type arr: List[int] :type target: int :rtype: int """ prefix, dp = {0: -1}, [0]*len(arr) # dp[i], min len of target subarray until i result = min_len = float("inf") accu = 0 for right in xrange(len(arr)...
[ "def", "minSumOfLengths", "(", "self", ",", "arr", ",", "target", ")", ":", "prefix", ",", "dp", "=", "{", "0", ":", "-", "1", "}", ",", "[", "0", "]", "*", "len", "(", "arr", ")", "# dp[i], min len of target subarray until i", "result", "=", "min_len"...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/find-two-non-overlapping-sub-arrays-each-with-target-sum.py#L5-L23
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/difflib.py
python
restore
(delta, which)
r""" Generate one of the two sequences that generated a delta. Given a `delta` produced by `Differ.compare()` or `ndiff()`, extract lines originating from file 1 or 2 (parameter `which`), stripping off line prefixes. Examples: >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(1), ... ...
r""" Generate one of the two sequences that generated a delta.
[ "r", "Generate", "one", "of", "the", "two", "sequences", "that", "generated", "a", "delta", "." ]
def restore(delta, which): r""" Generate one of the two sequences that generated a delta. Given a `delta` produced by `Differ.compare()` or `ndiff()`, extract lines originating from file 1 or 2 (parameter `which`), stripping off line prefixes. Examples: >>> diff = ndiff('one\ntwo\nthree\n...
[ "def", "restore", "(", "delta", ",", "which", ")", ":", "try", ":", "tag", "=", "{", "1", ":", "\"- \"", ",", "2", ":", "\"+ \"", "}", "[", "int", "(", "which", ")", "]", "except", "KeyError", ":", "raise", "ValueError", ",", "(", "'unknown delta c...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/difflib.py#L2022-L2052
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/training/saver.py
python
Saver._add_collection_def
(meta_graph_def, key)
Adds a collection to MetaGraphDef protocol buffer. Args: meta_graph_def: MetaGraphDef protocol buffer. key: One of the GraphKeys or user-defined string.
Adds a collection to MetaGraphDef protocol buffer.
[ "Adds", "a", "collection", "to", "MetaGraphDef", "protocol", "buffer", "." ]
def _add_collection_def(meta_graph_def, key): """Adds a collection to MetaGraphDef protocol buffer. Args: meta_graph_def: MetaGraphDef protocol buffer. key: One of the GraphKeys or user-defined string. """ _add_collection_def(meta_graph_def, key)
[ "def", "_add_collection_def", "(", "meta_graph_def", ",", "key", ")", ":", "_add_collection_def", "(", "meta_graph_def", ",", "key", ")" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/training/saver.py#L1132-L1139
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/misc/pilutil.py
python
imshow
(arr)
Simple showing of an image through an external viewer. Uses the image viewer specified by the environment variable SCIPY_PIL_IMAGE_VIEWER, or if that is not defined then `see`, to view a temporary file generated from array data. Parameters ---------- arr : ndarray Array of image data t...
Simple showing of an image through an external viewer.
[ "Simple", "showing", "of", "an", "image", "through", "an", "external", "viewer", "." ]
def imshow(arr): """ Simple showing of an image through an external viewer. Uses the image viewer specified by the environment variable SCIPY_PIL_IMAGE_VIEWER, or if that is not defined then `see`, to view a temporary file generated from array data. Parameters ---------- arr : ndarray ...
[ "def", "imshow", "(", "arr", ")", ":", "im", "=", "toimage", "(", "arr", ")", "fnum", ",", "fname", "=", "tempfile", ".", "mkstemp", "(", "'.png'", ")", "try", ":", "im", ".", "save", "(", "fname", ")", "except", ":", "raise", "RuntimeError", "(", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/misc/pilutil.py#L404-L443
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/layers/nn.py
python
squeeze
(input, axes, name=None)
return out
This OP will squeeze single-dimensional entries of input tensor's shape. If axes is provided, will remove the dims by axes, the dims selected by axes should be one. If not provide axes, all dims equal to one will be deleted. .. code-block:: text Case1: Input: X.shape = (1, ...
This OP will squeeze single-dimensional entries of input tensor's shape. If axes is provided, will remove the dims by axes, the dims selected by axes should be one. If not provide axes, all dims equal to one will be deleted.
[ "This", "OP", "will", "squeeze", "single", "-", "dimensional", "entries", "of", "input", "tensor", "s", "shape", ".", "If", "axes", "is", "provided", "will", "remove", "the", "dims", "by", "axes", "the", "dims", "selected", "by", "axes", "should", "be", ...
def squeeze(input, axes, name=None): """ This OP will squeeze single-dimensional entries of input tensor's shape. If axes is provided, will remove the dims by axes, the dims selected by axes should be one. If not provide axes, all dims equal to one will be deleted. .. code-block:: text Ca...
[ "def", "squeeze", "(", "input", ",", "axes", ",", "name", "=", "None", ")", ":", "if", "in_dygraph_mode", "(", ")", ":", "out", ",", "_", "=", "_C_ops", ".", "squeeze2", "(", "input", ",", "'axes'", ",", "axes", ")", "return", "out", "helper", "=",...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/layers/nn.py#L6341-L6413
devsisters/libquic
8954789a056d8e7d5fcb6452fd1572ca57eb5c4e
src/third_party/protobuf/python/google/protobuf/json_format.py
python
_GenericMessageToJsonObject
(message, unused_including_default)
return message.ToJsonString()
Converts message by ToJsonString according to Proto3 JSON Specification.
Converts message by ToJsonString according to Proto3 JSON Specification.
[ "Converts", "message", "by", "ToJsonString", "according", "to", "Proto3", "JSON", "Specification", "." ]
def _GenericMessageToJsonObject(message, unused_including_default): """Converts message by ToJsonString according to Proto3 JSON Specification.""" # Duration, Timestamp and FieldMask have ToJsonString method to do the # convert. Users can also call the method directly. return message.ToJsonString()
[ "def", "_GenericMessageToJsonObject", "(", "message", ",", "unused_including_default", ")", ":", "# Duration, Timestamp and FieldMask have ToJsonString method to do the", "# convert. Users can also call the method directly.", "return", "message", ".", "ToJsonString", "(", ")" ]
https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/json_format.py#L241-L245
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/ops/mask_ops.py
python
kleene_xor
( left: Union[bool, np.ndarray], right: Union[bool, np.ndarray], left_mask: Optional[np.ndarray], right_mask: Optional[np.ndarray], )
return result, mask
Boolean ``xor`` using Kleene logic. This is the same as ``or``, with the following adjustments * True, True -> False * True, NA -> NA Parameters ---------- left, right : ndarray, NA, or bool The values of the array. left_mask, right_mask : ndarray, optional The masks. On...
Boolean ``xor`` using Kleene logic.
[ "Boolean", "xor", "using", "Kleene", "logic", "." ]
def kleene_xor( left: Union[bool, np.ndarray], right: Union[bool, np.ndarray], left_mask: Optional[np.ndarray], right_mask: Optional[np.ndarray], ): """ Boolean ``xor`` using Kleene logic. This is the same as ``or``, with the following adjustments * True, True -> False * True, NA ...
[ "def", "kleene_xor", "(", "left", ":", "Union", "[", "bool", ",", "np", ".", "ndarray", "]", ",", "right", ":", "Union", "[", "bool", ",", "np", ".", "ndarray", "]", ",", "left_mask", ":", "Optional", "[", "np", ".", "ndarray", "]", ",", "right_mas...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/ops/mask_ops.py#L72-L116
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/server/wsgi/wms/ogc/implementation/common.py
python
WmsGetMapRequest._ProcessCommon
(self)
Processes the GetMapRequest parameters and prepares the GEE tile URL. Returns: Nothing, but might raise a ServiceException of the right version.
Processes the GetMapRequest parameters and prepares the GEE tile URL.
[ "Processes", "the", "GetMapRequest", "parameters", "and", "prepares", "the", "GEE", "tile", "URL", "." ]
def _ProcessCommon(self): """Processes the GetMapRequest parameters and prepares the GEE tile URL. Returns: Nothing, but might raise a ServiceException of the right version. """ logger.debug("Processing common information for the GetMap request") self._CheckParameters() # We should by...
[ "def", "_ProcessCommon", "(", "self", ")", ":", "logger", ".", "debug", "(", "\"Processing common information for the GetMap request\"", ")", "self", ".", "_CheckParameters", "(", ")", "# We should by rights check that CRS/SRS matches the layer's, but", "# we don't because (at le...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/wms/ogc/implementation/common.py#L180-L200
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/pipeline/pipeline/pipeline.py
python
InOrder.__enter__
(self)
When entering a 'with' block.
When entering a 'with' block.
[ "When", "entering", "a", "with", "block", "." ]
def __enter__(self): """When entering a 'with' block.""" InOrder._thread_init() if InOrder._local._activated: raise UnexpectedPipelineError('Already in an InOrder "with" block.') InOrder._local._activated = True InOrder._local._in_order_futures.clear()
[ "def", "__enter__", "(", "self", ")", ":", "InOrder", ".", "_thread_init", "(", ")", "if", "InOrder", ".", "_local", ".", "_activated", ":", "raise", "UnexpectedPipelineError", "(", "'Already in an InOrder \"with\" block.'", ")", "InOrder", ".", "_local", ".", "...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/pipeline/pipeline/pipeline.py#L1202-L1208
zhaoweicai/cascade-rcnn
2252f46158ea6555868ca6fa5c221ea71d9b5e6c
scripts/cpp_lint.py
python
CheckBraces
(filename, clean_lines, linenum, error)
Looks for misplaced braces (e.g. at the end of line). 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.
Looks for misplaced braces (e.g. at the end of line).
[ "Looks", "for", "misplaced", "braces", "(", "e", ".", "g", ".", "at", "the", "end", "of", "line", ")", "." ]
def CheckBraces(filename, clean_lines, linenum, error): """Looks for misplaced braces (e.g. at the end of line). 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 er...
[ "def", "CheckBraces", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# get rid of comments and strings", "if", "Match", "(", "r'\\s*{\\s*$'", ",", "line", ")", ":", ...
https://github.com/zhaoweicai/cascade-rcnn/blob/2252f46158ea6555868ca6fa5c221ea71d9b5e6c/scripts/cpp_lint.py#L3073-L3244
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/msvc.py
python
EnvironmentInfo.SdkSetup
(self)
return [join(self.si.WindowsSdkDir, 'Setup')]
Microsoft Windows SDK Setup. Return ------ list of str paths
Microsoft Windows SDK Setup.
[ "Microsoft", "Windows", "SDK", "Setup", "." ]
def SdkSetup(self): """ Microsoft Windows SDK Setup. Return ------ list of str paths """ if self.vs_ver > 9.0: return [] return [join(self.si.WindowsSdkDir, 'Setup')]
[ "def", "SdkSetup", "(", "self", ")", ":", "if", "self", ".", "vs_ver", ">", "9.0", ":", "return", "[", "]", "return", "[", "join", "(", "self", ".", "si", ".", "WindowsSdkDir", ",", "'Setup'", ")", "]" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/msvc.py#L1494-L1506
ZintrulCre/LeetCode_Archiver
de23e16ead29336b5ee7aa1898a392a5d6463d27
LeetCode/python3/965.py
python
Solution.isUnivalTree
(self, root)
return self.CompareValue(root, root.val)
:type root: TreeNode :rtype: bool
:type root: TreeNode :rtype: bool
[ ":", "type", "root", ":", "TreeNode", ":", "rtype", ":", "bool" ]
def isUnivalTree(self, root): """ :type root: TreeNode :rtype: bool """ if not root: return True return self.CompareValue(root, root.val)
[ "def", "isUnivalTree", "(", "self", ",", "root", ")", ":", "if", "not", "root", ":", "return", "True", "return", "self", ".", "CompareValue", "(", "root", ",", "root", ".", "val", ")" ]
https://github.com/ZintrulCre/LeetCode_Archiver/blob/de23e16ead29336b5ee7aa1898a392a5d6463d27/LeetCode/python3/965.py#L4-L11
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
xmlNode.searchNsByHref
(self, doc, href)
return __tmp
Search a Ns aliasing a given URI. Recurse on the parents until it finds the defined namespace or return None otherwise.
Search a Ns aliasing a given URI. Recurse on the parents until it finds the defined namespace or return None otherwise.
[ "Search", "a", "Ns", "aliasing", "a", "given", "URI", ".", "Recurse", "on", "the", "parents", "until", "it", "finds", "the", "defined", "namespace", "or", "return", "None", "otherwise", "." ]
def searchNsByHref(self, doc, href): """Search a Ns aliasing a given URI. Recurse on the parents until it finds the defined namespace or return None otherwise. """ if doc is None: doc__o = None else: doc__o = doc._o ret = libxml2mod.xmlSearchNsByHref(doc__o, self._o,...
[ "def", "searchNsByHref", "(", "self", ",", "doc", ",", "href", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlSearchNsByHref", "(", "doc__o", ",", "sel...
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L3470-L3479
Slicer/Slicer
ba9fadf332cb0303515b68d8d06a344c82e3e3e5
Base/Python/slicer/util.py
python
loadSegmentation
(filename, returnNode=False)
return loadNodeFromFile(filename, 'SegmentationFile', {}, returnNode)
Load node from file. :param filename: full path of the file to load. :param returnNode: Deprecated. :return: loaded node (if multiple nodes are loaded then a list of nodes). If returnNode is True then a status flag and loaded node are returned.
Load node from file.
[ "Load", "node", "from", "file", "." ]
def loadSegmentation(filename, returnNode=False): """Load node from file. :param filename: full path of the file to load. :param returnNode: Deprecated. :return: loaded node (if multiple nodes are loaded then a list of nodes). If returnNode is True then a status flag and loaded node are returned. """ r...
[ "def", "loadSegmentation", "(", "filename", ",", "returnNode", "=", "False", ")", ":", "return", "loadNodeFromFile", "(", "filename", ",", "'SegmentationFile'", ",", "{", "}", ",", "returnNode", ")" ]
https://github.com/Slicer/Slicer/blob/ba9fadf332cb0303515b68d8d06a344c82e3e3e5/Base/Python/slicer/util.py#L782-L790
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/jsonschema/validators.py
python
RefResolver.resolve_fragment
(self, document, fragment)
return document
Resolve a ``fragment`` within the referenced ``document``. Arguments: document: The referent document fragment (str): a URI fragment to resolve within it
Resolve a ``fragment`` within the referenced ``document``.
[ "Resolve", "a", "fragment", "within", "the", "referenced", "document", "." ]
def resolve_fragment(self, document, fragment): """ Resolve a ``fragment`` within the referenced ``document``. Arguments: document: The referent document fragment (str): a URI fragment to resolve within it """ fragment...
[ "def", "resolve_fragment", "(", "self", ",", "document", ",", "fragment", ")", ":", "fragment", "=", "fragment", ".", "lstrip", "(", "u\"/\"", ")", "parts", "=", "unquote", "(", "fragment", ")", ".", "split", "(", "u\"/\"", ")", "if", "fragment", "else",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/jsonschema/validators.py#L783-L817
H-uru/Plasma
c2140ea046e82e9c199e257a7f2e7edb42602871
Scripts/Python/plasma/Plasma.py
python
PtEnableAvatarCursorFade
()
Enable the avatar cursor fade
Enable the avatar cursor fade
[ "Enable", "the", "avatar", "cursor", "fade" ]
def PtEnableAvatarCursorFade(): """Enable the avatar cursor fade""" pass
[ "def", "PtEnableAvatarCursorFade", "(", ")", ":", "pass" ]
https://github.com/H-uru/Plasma/blob/c2140ea046e82e9c199e257a7f2e7edb42602871/Scripts/Python/plasma/Plasma.py#L238-L240