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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/io.py | python | IOBase.flush | (self) | Flush write buffers, if applicable.
This is not implemented for read-only and non-blocking streams. | Flush write buffers, if applicable. | [
"Flush",
"write",
"buffers",
"if",
"applicable",
"."
] | def flush(self):
"""Flush write buffers, if applicable.
This is not implemented for read-only and non-blocking streams.
""" | [
"def",
"flush",
"(",
"self",
")",
":"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/io.py#L366-L370 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/packager.py | python | make_deb_repo | (repo, distro, build_os) | Make the Debian repo. | Make the Debian repo. | [
"Make",
"the",
"Debian",
"repo",
"."
] | def make_deb_repo(repo, distro, build_os):
"""Make the Debian repo."""
# Note: the Debian repository Packages files must be generated
# very carefully in order to be usable.
oldpwd = os.getcwd()
os.chdir(repo + "../../../../../../")
try:
dirs = {
os.path.dirname(deb)[2:]
... | [
"def",
"make_deb_repo",
"(",
"repo",
",",
"distro",
",",
"build_os",
")",
":",
"# Note: the Debian repository Packages files must be generated",
"# very carefully in order to be usable.",
"oldpwd",
"=",
"os",
".",
"getcwd",
"(",
")",
"os",
".",
"chdir",
"(",
"repo",
"... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/packager.py#L620-L663 | ||
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sunlink.py | python | generate | (env) | Add Builders and construction variables for Forte to an Environment. | Add Builders and construction variables for Forte to an Environment. | [
"Add",
"Builders",
"and",
"construction",
"variables",
"for",
"Forte",
"to",
"an",
"Environment",
"."
] | def generate(env):
"""Add Builders and construction variables for Forte to an Environment."""
link.generate(env)
env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -G')
env['RPATHPREFIX'] = '-R'
env['RPATHSUFFIX'] = ''
env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}'
... | [
"def",
"generate",
"(",
"env",
")",
":",
"link",
".",
"generate",
"(",
"env",
")",
"env",
"[",
"'SHLINKFLAGS'",
"]",
"=",
"SCons",
".",
"Util",
".",
"CLVar",
"(",
"'$LINKFLAGS -G'",
")",
"env",
"[",
"'RPATHPREFIX'",
"]",
"=",
"'-R'",
"env",
"[",
"'RP... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sunlink.py#L59-L71 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/idl/idl/generator.py | python | _CppHeaderFileWriter.gen_class_declaration_block | (self, class_name) | return writer.IndentedScopedBlock(self._writer,
'class %s {' % common.title_case(class_name), '};') | Generate a class declaration block. | Generate a class declaration block. | [
"Generate",
"a",
"class",
"declaration",
"block",
"."
] | def gen_class_declaration_block(self, class_name):
# type: (str) -> writer.IndentedScopedBlock
"""Generate a class declaration block."""
return writer.IndentedScopedBlock(self._writer,
'class %s {' % common.title_case(class_name), '};') | [
"def",
"gen_class_declaration_block",
"(",
"self",
",",
"class_name",
")",
":",
"# type: (str) -> writer.IndentedScopedBlock",
"return",
"writer",
".",
"IndentedScopedBlock",
"(",
"self",
".",
"_writer",
",",
"'class %s {'",
"%",
"common",
".",
"title_case",
"(",
"cla... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/generator.py#L449-L453 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | PlatformInformation.SetPortId | (*args, **kwargs) | return _misc_.PlatformInformation_SetPortId(*args, **kwargs) | SetPortId(self, int n) | SetPortId(self, int n) | [
"SetPortId",
"(",
"self",
"int",
"n",
")"
] | def SetPortId(*args, **kwargs):
"""SetPortId(self, int n)"""
return _misc_.PlatformInformation_SetPortId(*args, **kwargs) | [
"def",
"SetPortId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"PlatformInformation_SetPortId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L1162-L1164 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/numbers.py | python | Real.conjugate | (self) | return +self | Conjugate is a no-op for Reals. | Conjugate is a no-op for Reals. | [
"Conjugate",
"is",
"a",
"no",
"-",
"op",
"for",
"Reals",
"."
] | def conjugate(self):
"""Conjugate is a no-op for Reals."""
return +self | [
"def",
"conjugate",
"(",
"self",
")",
":",
"return",
"+",
"self"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/numbers.py#L260-L262 | |
CanalTP/navitia | cb84ce9859070187e708818b058e6a7e0b7f891b | source/jormungandr/jormungandr/scenarios/journey_filter.py | python | get_all_journeys | (responses) | return (j for r in responses for j in r.journeys) | :param responses: protobuf
:return: generator of journeys | :param responses: protobuf
:return: generator of journeys | [
":",
"param",
"responses",
":",
"protobuf",
":",
"return",
":",
"generator",
"of",
"journeys"
] | def get_all_journeys(responses):
"""
:param responses: protobuf
:return: generator of journeys
"""
return (j for r in responses for j in r.journeys) | [
"def",
"get_all_journeys",
"(",
"responses",
")",
":",
"return",
"(",
"j",
"for",
"r",
"in",
"responses",
"for",
"j",
"in",
"r",
".",
"journeys",
")"
] | https://github.com/CanalTP/navitia/blob/cb84ce9859070187e708818b058e6a7e0b7f891b/source/jormungandr/jormungandr/scenarios/journey_filter.py#L624-L629 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pathlib.py | python | PurePath.name | (self) | return parts[-1] | The final path component, if any. | The final path component, if any. | [
"The",
"final",
"path",
"component",
"if",
"any",
"."
] | def name(self):
"""The final path component, if any."""
parts = self._parts
if len(parts) == (1 if (self._drv or self._root) else 0):
return ''
return parts[-1] | [
"def",
"name",
"(",
"self",
")",
":",
"parts",
"=",
"self",
".",
"_parts",
"if",
"len",
"(",
"parts",
")",
"==",
"(",
"1",
"if",
"(",
"self",
".",
"_drv",
"or",
"self",
".",
"_root",
")",
"else",
"0",
")",
":",
"return",
"''",
"return",
"parts"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pathlib.py#L796-L801 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TStr_GetNrFPath | (*args) | return _snap.TStr_GetNrFPath(*args) | TStr_GetNrFPath(TStr FPath) -> TStr
Parameters:
FPath: TStr const & | TStr_GetNrFPath(TStr FPath) -> TStr | [
"TStr_GetNrFPath",
"(",
"TStr",
"FPath",
")",
"-",
">",
"TStr"
] | def TStr_GetNrFPath(*args):
"""
TStr_GetNrFPath(TStr FPath) -> TStr
Parameters:
FPath: TStr const &
"""
return _snap.TStr_GetNrFPath(*args) | [
"def",
"TStr_GetNrFPath",
"(",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TStr_GetNrFPath",
"(",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L11137-L11145 | |
ros-planning/moveit | ee48dc5cedc981d0869352aa3db0b41469c2735c | moveit_commander/src/moveit_commander/planning_scene_interface.py | python | PlanningSceneInterface.add_cylinder | (self, name, pose, height, radius) | Add a cylinder to the planning scene | Add a cylinder to the planning scene | [
"Add",
"a",
"cylinder",
"to",
"the",
"planning",
"scene"
] | def add_cylinder(self, name, pose, height, radius):
""" Add a cylinder to the planning scene """
co = self.__make_cylinder(name, pose, height, radius)
self.__submit(co, attach=False) | [
"def",
"add_cylinder",
"(",
"self",
",",
"name",
",",
"pose",
",",
"height",
",",
"radius",
")",
":",
"co",
"=",
"self",
".",
"__make_cylinder",
"(",
"name",
",",
"pose",
",",
"height",
",",
"radius",
")",
"self",
".",
"__submit",
"(",
"co",
",",
"... | https://github.com/ros-planning/moveit/blob/ee48dc5cedc981d0869352aa3db0b41469c2735c/moveit_commander/src/moveit_commander/planning_scene_interface.py#L104-L107 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/writers/manpage.py | python | Translator.visit_reference | (self, node) | E.g. link or email address. | E.g. link or email address. | [
"E",
".",
"g",
".",
"link",
"or",
"email",
"address",
"."
] | def visit_reference(self, node):
"""E.g. link or email address."""
self.body.append(self.defs['reference'][0]) | [
"def",
"visit_reference",
"(",
"self",
",",
"node",
")",
":",
"self",
".",
"body",
".",
"append",
"(",
"self",
".",
"defs",
"[",
"'reference'",
"]",
"[",
"0",
"]",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/writers/manpage.py#L977-L979 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | samples/ide/activegrid/tool/FindService.py | python | FindService.InstallControls | (self, frame, menuBar = None, toolBar = None, statusBar = None, document = None) | Install Find Service Menu Items | Install Find Service Menu Items | [
"Install",
"Find",
"Service",
"Menu",
"Items"
] | def InstallControls(self, frame, menuBar = None, toolBar = None, statusBar = None, document = None):
""" Install Find Service Menu Items """
editMenu = menuBar.GetMenu(menuBar.FindMenu(_("&Edit")))
editMenu.AppendSeparator()
editMenu.Append(FindService.FIND_ID, _("&Find...\tCtrl+F"), _("... | [
"def",
"InstallControls",
"(",
"self",
",",
"frame",
",",
"menuBar",
"=",
"None",
",",
"toolBar",
"=",
"None",
",",
"statusBar",
"=",
"None",
",",
"document",
"=",
"None",
")",
":",
"editMenu",
"=",
"menuBar",
".",
"GetMenu",
"(",
"menuBar",
".",
"Find... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/samples/ide/activegrid/tool/FindService.py#L67-L95 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_windows.py | python | PrePyScrolledWindow | (*args, **kwargs) | return val | PrePyScrolledWindow() -> PyScrolledWindow | PrePyScrolledWindow() -> PyScrolledWindow | [
"PrePyScrolledWindow",
"()",
"-",
">",
"PyScrolledWindow"
] | def PrePyScrolledWindow(*args, **kwargs):
"""PrePyScrolledWindow() -> PyScrolledWindow"""
val = _windows_.new_PrePyScrolledWindow(*args, **kwargs)
return val | [
"def",
"PrePyScrolledWindow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"val",
"=",
"_windows_",
".",
"new_PrePyScrolledWindow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"return",
"val"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L4668-L4671 | |
chatopera/clause | dee31153d5ffdef33deedb6bff03e7806c296968 | var/assets/clients/gen-py/clause/Serving.py | python | Iface.putSession | (self, request) | Parameters:
- request | Parameters:
- request | [
"Parameters",
":",
"-",
"request"
] | def putSession(self, request):
"""
Parameters:
- request
"""
pass | [
"def",
"putSession",
"(",
"self",
",",
"request",
")",
":",
"pass"
] | https://github.com/chatopera/clause/blob/dee31153d5ffdef33deedb6bff03e7806c296968/var/assets/clients/gen-py/clause/Serving.py#L352-L358 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/framemanager.py | python | AuiDockingGuideWindow.DrawArrow | (self, dc) | Draws the docking guide arrow icon (not used if the docking guide images are ok).
:param `dc`: a :class:`DC` device context object. | Draws the docking guide arrow icon (not used if the docking guide images are ok). | [
"Draws",
"the",
"docking",
"guide",
"arrow",
"icon",
"(",
"not",
"used",
"if",
"the",
"docking",
"guide",
"images",
"are",
"ok",
")",
"."
] | def DrawArrow(self, dc):
"""
Draws the docking guide arrow icon (not used if the docking guide images are ok).
:param `dc`: a :class:`DC` device context object.
"""
rect = self.GetClientRect()
point = wx.Point()
point.x = (rect.GetLeft() + rect.GetRight()) / 2
... | [
"def",
"DrawArrow",
"(",
"self",
",",
"dc",
")",
":",
"rect",
"=",
"self",
".",
"GetClientRect",
"(",
")",
"point",
"=",
"wx",
".",
"Point",
"(",
")",
"point",
".",
"x",
"=",
"(",
"rect",
".",
"GetLeft",
"(",
")",
"+",
"rect",
".",
"GetRight",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/framemanager.py#L2110-L2150 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pkg_resources/_vendor/pyparsing.py | python | Regex.__init__ | ( self, pattern, flags=0) | The parameters C{pattern} and C{flags} are passed to the C{re.compile()} function as-is. See the Python C{re} module for an explanation of the acceptable patterns and flags. | The parameters C{pattern} and C{flags} are passed to the C{re.compile()} function as-is. See the Python C{re} module for an explanation of the acceptable patterns and flags. | [
"The",
"parameters",
"C",
"{",
"pattern",
"}",
"and",
"C",
"{",
"flags",
"}",
"are",
"passed",
"to",
"the",
"C",
"{",
"re",
".",
"compile",
"()",
"}",
"function",
"as",
"-",
"is",
".",
"See",
"the",
"Python",
"C",
"{",
"re",
"}",
"module",
"for",... | def __init__( self, pattern, flags=0):
"""The parameters C{pattern} and C{flags} are passed to the C{re.compile()} function as-is. See the Python C{re} module for an explanation of the acceptable patterns and flags."""
super(Regex,self).__init__()
if isinstance(pattern, basestring):
... | [
"def",
"__init__",
"(",
"self",
",",
"pattern",
",",
"flags",
"=",
"0",
")",
":",
"super",
"(",
"Regex",
",",
"self",
")",
".",
"__init__",
"(",
")",
"if",
"isinstance",
"(",
"pattern",
",",
"basestring",
")",
":",
"if",
"not",
"pattern",
":",
"war... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pkg_resources/_vendor/pyparsing.py#L2779-L2811 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/multiprocessing/managers.py | python | Server.serve_forever | (self) | Run the server forever | Run the server forever | [
"Run",
"the",
"server",
"forever"
] | def serve_forever(self):
'''
Run the server forever
'''
current_process()._manager_server = self
try:
try:
while 1:
try:
c = self.listener.accept()
except (OSError, IOError):
... | [
"def",
"serve_forever",
"(",
"self",
")",
":",
"current_process",
"(",
")",
".",
"_manager_server",
"=",
"self",
"try",
":",
"try",
":",
"while",
"1",
":",
"try",
":",
"c",
"=",
"self",
".",
"listener",
".",
"accept",
"(",
")",
"except",
"(",
"OSErro... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/multiprocessing/managers.py#L170-L189 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBThread_GetThreadFromEvent | (*args) | return _lldb.SBThread_GetThreadFromEvent(*args) | SBThread_GetThreadFromEvent(SBEvent event) -> SBThread | SBThread_GetThreadFromEvent(SBEvent event) -> SBThread | [
"SBThread_GetThreadFromEvent",
"(",
"SBEvent",
"event",
")",
"-",
">",
"SBThread"
] | def SBThread_GetThreadFromEvent(*args):
"""SBThread_GetThreadFromEvent(SBEvent event) -> SBThread"""
return _lldb.SBThread_GetThreadFromEvent(*args) | [
"def",
"SBThread_GetThreadFromEvent",
"(",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBThread_GetThreadFromEvent",
"(",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L9993-L9995 | |
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py | python | MergeSymbols | (directory, args) | Merge all symbol files (yaml) in a given directory into a single file. | Merge all symbol files (yaml) in a given directory into a single file. | [
"Merge",
"all",
"symbol",
"files",
"(",
"yaml",
")",
"in",
"a",
"given",
"directory",
"into",
"a",
"single",
"file",
"."
] | def MergeSymbols(directory, args):
"""Merge all symbol files (yaml) in a given directory into a single file."""
invocation = [args.binary, '-merge-dir='+directory, args.saving_path]
subprocess.call(invocation)
print 'Merge is finished. Saving results in ' + args.saving_path | [
"def",
"MergeSymbols",
"(",
"directory",
",",
"args",
")",
":",
"invocation",
"=",
"[",
"args",
".",
"binary",
",",
"'-merge-dir='",
"+",
"directory",
",",
"args",
".",
"saving_path",
"]",
"subprocess",
".",
"call",
"(",
"invocation",
")",
"print",
"'Merge... | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py#L48-L52 | ||
naver/sling | 5671cd445a2caae0b4dd0332299e4cfede05062c | webkit/Tools/Scripts/webkitpy/style/optparser.py | python | CommandOptionValues.__eq__ | (self, other) | return True | Return whether this instance is equal to another. | Return whether this instance is equal to another. | [
"Return",
"whether",
"this",
"instance",
"is",
"equal",
"to",
"another",
"."
] | def __eq__(self, other):
"""Return whether this instance is equal to another."""
if self.filter_rules != other.filter_rules:
return False
if self.git_commit != other.git_commit:
return False
if self.diff_files != other.diff_files:
return False
... | [
"def",
"__eq__",
"(",
"self",
",",
"other",
")",
":",
"if",
"self",
".",
"filter_rules",
"!=",
"other",
".",
"filter_rules",
":",
"return",
"False",
"if",
"self",
".",
"git_commit",
"!=",
"other",
".",
"git_commit",
":",
"return",
"False",
"if",
"self",
... | https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/style/optparser.py#L177-L194 | |
koth/kcws | 88efbd36a7022de4e6e90f5a1fb880cf87cfae9f | third_party/python/cpplint/cpplint.py | python | PrintUsage | (message) | Prints a brief usage string and exits, optionally with an error message.
Args:
message: The optional error message. | Prints a brief usage string and exits, optionally with an error message. | [
"Prints",
"a",
"brief",
"usage",
"string",
"and",
"exits",
"optionally",
"with",
"an",
"error",
"message",
"."
] | def PrintUsage(message):
"""Prints a brief usage string and exits, optionally with an error message.
Args:
message: The optional error message.
"""
sys.stderr.write(_USAGE)
if message:
sys.exit('\nFATAL ERROR: ' + message)
else:
sys.exit(1) | [
"def",
"PrintUsage",
"(",
"message",
")",
":",
"sys",
".",
"stderr",
".",
"write",
"(",
"_USAGE",
")",
"if",
"message",
":",
"sys",
".",
"exit",
"(",
"'\\nFATAL ERROR: '",
"+",
"message",
")",
"else",
":",
"sys",
".",
"exit",
"(",
"1",
")"
] | https://github.com/koth/kcws/blob/88efbd36a7022de4e6e90f5a1fb880cf87cfae9f/third_party/python/cpplint/cpplint.py#L6219-L6229 | ||
tfwu/FaceDetection-ConvNet-3D | f9251c48eb40c5aec8fba7455115c355466555be | python/build/lib.linux-x86_64-2.7/mxnet/model.py | python | FeedForward.predict | (self, X, num_batch=None, return_data=False, reset=True) | Run the prediction, always only use one device.
Parameters
----------
X : mxnet.DataIter
num_batch : int or None
the number of batch to run. Go though all batches if None
Returns
-------
y : numpy.ndarray or a list of numpy.ndarray if the network has m... | Run the prediction, always only use one device.
Parameters
----------
X : mxnet.DataIter
num_batch : int or None
the number of batch to run. Go though all batches if None
Returns
-------
y : numpy.ndarray or a list of numpy.ndarray if the network has m... | [
"Run",
"the",
"prediction",
"always",
"only",
"use",
"one",
"device",
".",
"Parameters",
"----------",
"X",
":",
"mxnet",
".",
"DataIter",
"num_batch",
":",
"int",
"or",
"None",
"the",
"number",
"of",
"batch",
"to",
"run",
".",
"Go",
"though",
"all",
"ba... | def predict(self, X, num_batch=None, return_data=False, reset=True):
"""Run the prediction, always only use one device.
Parameters
----------
X : mxnet.DataIter
num_batch : int or None
the number of batch to run. Go though all batches if None
Returns
-... | [
"def",
"predict",
"(",
"self",
",",
"X",
",",
"num_batch",
"=",
"None",
",",
"return_data",
"=",
"False",
",",
"reset",
"=",
"True",
")",
":",
"X",
"=",
"self",
".",
"_init_iter",
"(",
"X",
",",
"None",
",",
"is_train",
"=",
"False",
")",
"if",
"... | https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/build/lib.linux-x86_64-2.7/mxnet/model.py#L580-L639 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/core/arrayprint.py | python | dtype_short_repr | (dtype) | return typename | Convert a dtype to a short form which evaluates to the same dtype.
The intent is roughly that the following holds
>>> from numpy import *
>>> dt = np.int64([1, 2]).dtype
>>> assert eval(dtype_short_repr(dt)) == dt | Convert a dtype to a short form which evaluates to the same dtype. | [
"Convert",
"a",
"dtype",
"to",
"a",
"short",
"form",
"which",
"evaluates",
"to",
"the",
"same",
"dtype",
"."
] | def dtype_short_repr(dtype):
"""
Convert a dtype to a short form which evaluates to the same dtype.
The intent is roughly that the following holds
>>> from numpy import *
>>> dt = np.int64([1, 2]).dtype
>>> assert eval(dtype_short_repr(dt)) == dt
"""
if dtype.names is not None:
... | [
"def",
"dtype_short_repr",
"(",
"dtype",
")",
":",
"if",
"dtype",
".",
"names",
"is",
"not",
"None",
":",
"# structured dtypes give a list or tuple repr",
"return",
"str",
"(",
"dtype",
")",
"elif",
"issubclass",
"(",
"dtype",
".",
"type",
",",
"flexible",
")"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/core/arrayprint.py#L1356-L1378 | |
llvm-mirror/lldb | d01083a850f577b85501a0902b52fd0930de72c7 | examples/python/symbolication.py | python | Image.create_target | (self) | return None | Create a target using the information in this Image object. | Create a target using the information in this Image object. | [
"Create",
"a",
"target",
"using",
"the",
"information",
"in",
"this",
"Image",
"object",
"."
] | def create_target(self):
'''Create a target using the information in this Image object.'''
if self.unavailable:
return None
if self.locate_module_and_debug_symbols():
resolved_path = self.get_resolved_path()
path_spec = lldb.SBFileSpec(resolved_path)
... | [
"def",
"create_target",
"(",
"self",
")",
":",
"if",
"self",
".",
"unavailable",
":",
"return",
"None",
"if",
"self",
".",
"locate_module_and_debug_symbols",
"(",
")",
":",
"resolved_path",
"=",
"self",
".",
"get_resolved_path",
"(",
")",
"path_spec",
"=",
"... | https://github.com/llvm-mirror/lldb/blob/d01083a850f577b85501a0902b52fd0930de72c7/examples/python/symbolication.py#L413-L435 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py | python | Text.tag_unbind | (self, tagName, sequence, funcid=None) | Unbind for all characters with TAGNAME for event SEQUENCE the
function identified with FUNCID. | Unbind for all characters with TAGNAME for event SEQUENCE the
function identified with FUNCID. | [
"Unbind",
"for",
"all",
"characters",
"with",
"TAGNAME",
"for",
"event",
"SEQUENCE",
"the",
"function",
"identified",
"with",
"FUNCID",
"."
] | def tag_unbind(self, tagName, sequence, funcid=None):
"""Unbind for all characters with TAGNAME for event SEQUENCE the
function identified with FUNCID."""
self.tk.call(self._w, 'tag', 'bind', tagName, sequence, '')
if funcid:
self.deletecommand(funcid) | [
"def",
"tag_unbind",
"(",
"self",
",",
"tagName",
",",
"sequence",
",",
"funcid",
"=",
"None",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'tag'",
",",
"'bind'",
",",
"tagName",
",",
"sequence",
",",
"''",
")",
"if",
"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L3105-L3110 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_basestc.py | python | EditraBaseStc.GetIndentChar | (self) | Gets the indentation char used in document
@return: indentation char used either space or tab | Gets the indentation char used in document
@return: indentation char used either space or tab | [
"Gets",
"the",
"indentation",
"char",
"used",
"in",
"document",
"@return",
":",
"indentation",
"char",
"used",
"either",
"space",
"or",
"tab"
] | def GetIndentChar(self):
"""Gets the indentation char used in document
@return: indentation char used either space or tab
"""
if self.GetUseTabs():
return u'\t'
else:
return u' ' * self.GetIndent() | [
"def",
"GetIndentChar",
"(",
"self",
")",
":",
"if",
"self",
".",
"GetUseTabs",
"(",
")",
":",
"return",
"u'\\t'",
"else",
":",
"return",
"u' '",
"*",
"self",
".",
"GetIndent",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_basestc.py#L686-L694 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | TextUrlEvent.__init__ | (self, *args, **kwargs) | __init__(self, int winid, MouseEvent evtMouse, long start, long end) -> TextUrlEvent | __init__(self, int winid, MouseEvent evtMouse, long start, long end) -> TextUrlEvent | [
"__init__",
"(",
"self",
"int",
"winid",
"MouseEvent",
"evtMouse",
"long",
"start",
"long",
"end",
")",
"-",
">",
"TextUrlEvent"
] | def __init__(self, *args, **kwargs):
"""__init__(self, int winid, MouseEvent evtMouse, long start, long end) -> TextUrlEvent"""
_controls_.TextUrlEvent_swiginit(self,_controls_.new_TextUrlEvent(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_controls_",
".",
"TextUrlEvent_swiginit",
"(",
"self",
",",
"_controls_",
".",
"new_TextUrlEvent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L2113-L2115 | ||
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | clang/tools/scan-build-py/libear/__init__.py | python | build_libear | (compiler, dst_dir) | Returns the full path to the 'libear' library. | Returns the full path to the 'libear' library. | [
"Returns",
"the",
"full",
"path",
"to",
"the",
"libear",
"library",
"."
] | def build_libear(compiler, dst_dir):
""" Returns the full path to the 'libear' library. """
try:
src_dir = os.path.dirname(os.path.realpath(__file__))
toolset = make_toolset(src_dir)
toolset.set_compiler(compiler)
toolset.set_language_standard('c99')
toolset.add_definiti... | [
"def",
"build_libear",
"(",
"compiler",
",",
"dst_dir",
")",
":",
"try",
":",
"src_dir",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"os",
".",
"path",
".",
"realpath",
"(",
"__file__",
")",
")",
"toolset",
"=",
"make_toolset",
"(",
"src_dir",
")",
... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/clang/tools/scan-build-py/libear/__init__.py#L19-L58 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/factorization/python/ops/gmm_ops.py | python | GmmAlgorithm._define_prior_log_prob_operation | (self, shard_id) | Computes the prior probability of all samples.
Updates a vector where each item is the prior probabibility of an
input example.
Args:
shard_id: id of current shard_id. | Computes the prior probability of all samples. | [
"Computes",
"the",
"prior",
"probability",
"of",
"all",
"samples",
"."
] | def _define_prior_log_prob_operation(self, shard_id):
"""Computes the prior probability of all samples.
Updates a vector where each item is the prior probabibility of an
input example.
Args:
shard_id: id of current shard_id.
"""
self._prior_probs[shard_id] = math_ops.reduce_logsumexp(
... | [
"def",
"_define_prior_log_prob_operation",
"(",
"self",
",",
"shard_id",
")",
":",
"self",
".",
"_prior_probs",
"[",
"shard_id",
"]",
"=",
"math_ops",
".",
"reduce_logsumexp",
"(",
"self",
".",
"_probs",
"[",
"shard_id",
"]",
",",
"axis",
"=",
"1",
",",
"k... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L309-L319 | ||
facebook/openr | ed38bdfd6bf290084bfab4821b59f83e7b59315d | build/fbcode_builder/shell_quoting.py | python | path_join | (*args) | return ShellQuoted(os.path.join(*[raw_shell(shell_quote(s)) for s in args])) | Joins ShellQuoted and raw pieces of paths to make a shell-quoted path | Joins ShellQuoted and raw pieces of paths to make a shell-quoted path | [
"Joins",
"ShellQuoted",
"and",
"raw",
"pieces",
"of",
"paths",
"to",
"make",
"a",
"shell",
"-",
"quoted",
"path"
] | def path_join(*args):
"Joins ShellQuoted and raw pieces of paths to make a shell-quoted path"
return ShellQuoted(os.path.join(*[raw_shell(shell_quote(s)) for s in args])) | [
"def",
"path_join",
"(",
"*",
"args",
")",
":",
"return",
"ShellQuoted",
"(",
"os",
".",
"path",
".",
"join",
"(",
"*",
"[",
"raw_shell",
"(",
"shell_quote",
"(",
"s",
")",
")",
"for",
"s",
"in",
"args",
"]",
")",
")"
] | https://github.com/facebook/openr/blob/ed38bdfd6bf290084bfab4821b59f83e7b59315d/build/fbcode_builder/shell_quoting.py#L89-L91 | |
esa/pykep | b410363653623730b577de257c04b0e0289f2014 | pykep/trajopt/gym/_tandem.py | python | _tandem_udp.__init__ | (self, prob_id = 1, constrained = True) | The TandEM problem of the trajectory gym consists in 48 different instances varying in fly-by sequence and
the presence of a time constraint.
Args:
- prob_id (``int``): The problem id defines the fly-by sequence.
- constrained (``bool``): Activates the constraint on the time of ... | The TandEM problem of the trajectory gym consists in 48 different instances varying in fly-by sequence and
the presence of a time constraint. | [
"The",
"TandEM",
"problem",
"of",
"the",
"trajectory",
"gym",
"consists",
"in",
"48",
"different",
"instances",
"varying",
"in",
"fly",
"-",
"by",
"sequence",
"and",
"the",
"presence",
"of",
"a",
"time",
"constraint",
"."
] | def __init__(self, prob_id = 1, constrained = True):
"""
The TandEM problem of the trajectory gym consists in 48 different instances varying in fly-by sequence and
the presence of a time constraint.
Args:
- prob_id (``int``): The problem id defines the fly-by sequence.
... | [
"def",
"__init__",
"(",
"self",
",",
"prob_id",
"=",
"1",
",",
"constrained",
"=",
"True",
")",
":",
"# Redefining the planets as to change their safe radius",
"earth",
"=",
"jpl_lp",
"(",
"'earth'",
")",
"earth",
".",
"safe_radius",
"=",
"1.05",
"# We need the Ea... | https://github.com/esa/pykep/blob/b410363653623730b577de257c04b0e0289f2014/pykep/trajopt/gym/_tandem.py#L33-L108 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/probability/distribution/distribution.py | python | Distribution.kl_loss | (self, dist, *args, **kwargs) | return self._kl_loss(dist, *args, **kwargs) | Evaluate the KL divergence, i.e. KL(a||b).
Args:
dist (str): type of the distribution.
*args (list): the list of positional arguments forwarded to subclasses.
**kwargs (dict): the dictionary of keyword arguments forwarded to subclasses.
Note:
dist_spec_a... | Evaluate the KL divergence, i.e. KL(a||b). | [
"Evaluate",
"the",
"KL",
"divergence",
"i",
".",
"e",
".",
"KL",
"(",
"a||b",
")",
"."
] | def kl_loss(self, dist, *args, **kwargs):
"""
Evaluate the KL divergence, i.e. KL(a||b).
Args:
dist (str): type of the distribution.
*args (list): the list of positional arguments forwarded to subclasses.
**kwargs (dict): the dictionary of keyword arguments f... | [
"def",
"kl_loss",
"(",
"self",
",",
"dist",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_kl_loss",
"(",
"dist",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/probability/distribution/distribution.py#L576-L592 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/random.py | python | Random.getstate | (self) | return self.VERSION, super().getstate(), self.gauss_next | Return internal state; can be passed to setstate() later. | Return internal state; can be passed to setstate() later. | [
"Return",
"internal",
"state",
";",
"can",
"be",
"passed",
"to",
"setstate",
"()",
"later",
"."
] | def getstate(self):
"""Return internal state; can be passed to setstate() later."""
return self.VERSION, super().getstate(), self.gauss_next | [
"def",
"getstate",
"(",
"self",
")",
":",
"return",
"self",
".",
"VERSION",
",",
"super",
"(",
")",
".",
"getstate",
"(",
")",
",",
"self",
".",
"gauss_next"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/random.py#L129-L131 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/_strptime.py | python | LocaleTime.__init__ | (self) | Set all attributes.
Order of methods called matters for dependency reasons.
The locale language is set at the offset and then checked again before
exiting. This is to make sure that the attributes were not set with a
mix of information from more than one locale. This would most likel... | Set all attributes. | [
"Set",
"all",
"attributes",
"."
] | def __init__(self):
"""Set all attributes.
Order of methods called matters for dependency reasons.
The locale language is set at the offset and then checked again before
exiting. This is to make sure that the attributes were not set with a
mix of information from more than one... | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"lang",
"=",
"_getlang",
"(",
")",
"self",
".",
"__calc_weekday",
"(",
")",
"self",
".",
"__calc_month",
"(",
")",
"self",
".",
"__calc_am_pm",
"(",
")",
"self",
".",
"__calc_timezone",
"(",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/_strptime.py#L49-L78 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/ipc_messages_log.py | python | _ProcessLog | (f, msg_map) | Read lines from f and resolve the IPC messages according to msg_map. | Read lines from f and resolve the IPC messages according to msg_map. | [
"Read",
"lines",
"from",
"f",
"and",
"resolve",
"the",
"IPC",
"messages",
"according",
"to",
"msg_map",
"."
] | def _ProcessLog(f, msg_map):
"""Read lines from f and resolve the IPC messages according to msg_map."""
unknown_msg_re = re.compile('\[unknown type (\d+)\]')
for line in f:
line = line.rstrip()
match = re.search(unknown_msg_re, line)
if match:
line = re.sub(unknown_msg_re,
_R... | [
"def",
"_ProcessLog",
"(",
"f",
",",
"msg_map",
")",
":",
"unknown_msg_re",
"=",
"re",
".",
"compile",
"(",
"'\\[unknown type (\\d+)\\]'",
")",
"for",
"line",
"in",
"f",
":",
"line",
"=",
"line",
".",
"rstrip",
"(",
")",
"match",
"=",
"re",
".",
"searc... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/ipc_messages_log.py#L121-L131 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/closure_linter/closure_linter/typeannotation.py | python | TypeAnnotation.Append | (self, item) | Adds a sub_type to this type and finalizes it.
Args:
item: The TypeAnnotation item to append. | Adds a sub_type to this type and finalizes it. | [
"Adds",
"a",
"sub_type",
"to",
"this",
"type",
"and",
"finalizes",
"it",
"."
] | def Append(self, item):
"""Adds a sub_type to this type and finalizes it.
Args:
item: The TypeAnnotation item to append.
"""
# item is a TypeAnnotation instance, so pylint: disable=protected-access
self.sub_types.append(item._Finalize(self)) | [
"def",
"Append",
"(",
"self",
",",
"item",
")",
":",
"# item is a TypeAnnotation instance, so pylint: disable=protected-access",
"self",
".",
"sub_types",
".",
"append",
"(",
"item",
".",
"_Finalize",
"(",
"self",
")",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/typeannotation.py#L106-L113 | ||
alibaba/weex_js_engine | 2bdf4b6f020c1fc99c63f649718f6faf7e27fdde | jni/v8core/v8/build/gyp/pylib/gyp/generator/android.py | python | AndroidMkWriter.ComputeAndroidModule | (self, spec) | return make.StringToMakefileVariable(name) | Return the Android module name used for a gyp spec.
We use the complete qualified target name to avoid collisions between
duplicate targets in different directories. We also add a suffix to
distinguish gyp-generated module names. | Return the Android module name used for a gyp spec. | [
"Return",
"the",
"Android",
"module",
"name",
"used",
"for",
"a",
"gyp",
"spec",
"."
] | def ComputeAndroidModule(self, spec):
"""Return the Android module name used for a gyp spec.
We use the complete qualified target name to avoid collisions between
duplicate targets in different directories. We also add a suffix to
distinguish gyp-generated module names.
"""
if self.type == 'sh... | [
"def",
"ComputeAndroidModule",
"(",
"self",
",",
"spec",
")",
":",
"if",
"self",
".",
"type",
"==",
"'shared_library'",
":",
"# For reasons of convention, the Android build system requires that all",
"# shared library modules are named 'libfoo' when generating -l flags.",
"prefix",... | https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/generator/android.py#L571-L596 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/ExportSampleLogsToCSVFile.py | python | ExportSampleLogsToCSVFile.name | (self) | return "ExportSampleLogsToCSVFile" | Algorithm name | Algorithm name | [
"Algorithm",
"name"
] | def name(self):
""" Algorithm name
"""
return "ExportSampleLogsToCSVFile" | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"\"ExportSampleLogsToCSVFile\""
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/ExportSampleLogsToCSVFile.py#L51-L54 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py | python | ParserElement.runTests | (self, tests, parseAll=True, comment='#', fullDump=True, printResults=True, failureTests=False) | return success, allResults | Execute the parse expression on a series of test strings, showing each
test, the parsed results or where the parse failed. Quick and easy way to
run a parse expression against a list of sample strings.
Parameters:
- tests - a list of separate test strings, or a multilin... | [] | def runTests(self, tests, parseAll=True, comment='#', fullDump=True, printResults=True, failureTests=False):
"""
Execute the parse expression on a series of test strings, showing each
test, the parsed results or where the parse failed. Quick and easy way to
run a parse expression aga... | [
"def",
"runTests",
"(",
"self",
",",
"tests",
",",
"parseAll",
"=",
"True",
",",
"comment",
"=",
"'#'",
",",
"fullDump",
"=",
"True",
",",
"printResults",
"=",
"True",
",",
"failureTests",
"=",
"False",
")",
":",
"if",
"isinstance",
"(",
"tests",
",",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py#L4463-L4721 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/ndarray/numpy/_op.py | python | fmin | (x1, x2, out=None, **kwargs) | return _api_internal.fmin(x1, x2, out) | Returns element-wise minimum of the input arrays with broadcasting. (Ignores NaNs)
Parameters
----------
x1, x2 : scalar or mxnet.numpy.ndarray
The arrays holding the elements to be compared. They must have the same shape,
or shapes that can be broadcast to a single shape.
Returns
... | Returns element-wise minimum of the input arrays with broadcasting. (Ignores NaNs) | [
"Returns",
"element",
"-",
"wise",
"minimum",
"of",
"the",
"input",
"arrays",
"with",
"broadcasting",
".",
"(",
"Ignores",
"NaNs",
")"
] | def fmin(x1, x2, out=None, **kwargs):
"""
Returns element-wise minimum of the input arrays with broadcasting. (Ignores NaNs)
Parameters
----------
x1, x2 : scalar or mxnet.numpy.ndarray
The arrays holding the elements to be compared. They must have the same shape,
or shapes that can... | [
"def",
"fmin",
"(",
"x1",
",",
"x2",
",",
"out",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"isinstance",
"(",
"x1",
",",
"numeric_types",
")",
"and",
"isinstance",
"(",
"x2",
",",
"numeric_types",
")",
":",
"_np",
".",
"fmin",
"(",
"x... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/ndarray/numpy/_op.py#L5017-L5033 | |
intel/caffe | 3f494b442ee3f9d17a07b09ecbd5fa2bbda00836 | examples/faster-rcnn/tools/train_faster_rcnn_alt_opt.py | python | train_fast_rcnn | (queue=None, imdb_name=None, init_model=None, solver=None,
max_iters=None, cfg=None, rpn_file=None) | Train a Fast R-CNN using proposals generated by an RPN. | Train a Fast R-CNN using proposals generated by an RPN. | [
"Train",
"a",
"Fast",
"R",
"-",
"CNN",
"using",
"proposals",
"generated",
"by",
"an",
"RPN",
"."
] | def train_fast_rcnn(queue=None, imdb_name=None, init_model=None, solver=None,
max_iters=None, cfg=None, rpn_file=None):
"""Train a Fast R-CNN using proposals generated by an RPN.
"""
cfg.TRAIN.HAS_RPN = False # not generating prosals on-the-fly
cfg.TRAIN.PROPOSAL_METHOD = ... | [
"def",
"train_fast_rcnn",
"(",
"queue",
"=",
"None",
",",
"imdb_name",
"=",
"None",
",",
"init_model",
"=",
"None",
",",
"solver",
"=",
"None",
",",
"max_iters",
"=",
"None",
",",
"cfg",
"=",
"None",
",",
"rpn_file",
"=",
"None",
")",
":",
"cfg",
"."... | https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/examples/faster-rcnn/tools/train_faster_rcnn_alt_opt.py#L173-L201 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/ssl.py | python | SSLObject.compression | (self) | return self._sslobj.compression() | Return the current compression algorithm in use, or ``None`` if
compression was not negotiated or not supported by one of the peers. | Return the current compression algorithm in use, or ``None`` if
compression was not negotiated or not supported by one of the peers. | [
"Return",
"the",
"current",
"compression",
"algorithm",
"in",
"use",
"or",
"None",
"if",
"compression",
"was",
"not",
"negotiated",
"or",
"not",
"supported",
"by",
"one",
"of",
"the",
"peers",
"."
] | def compression(self):
"""Return the current compression algorithm in use, or ``None`` if
compression was not negotiated or not supported by one of the peers."""
return self._sslobj.compression() | [
"def",
"compression",
"(",
"self",
")",
":",
"return",
"self",
".",
"_sslobj",
".",
"compression",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/ssl.py#L763-L766 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/model.py | python | OperationModel._get_streaming_body | (self, shape) | return None | Returns the streaming member's shape if any; or None otherwise. | Returns the streaming member's shape if any; or None otherwise. | [
"Returns",
"the",
"streaming",
"member",
"s",
"shape",
"if",
"any",
";",
"or",
"None",
"otherwise",
"."
] | def _get_streaming_body(self, shape):
"""Returns the streaming member's shape if any; or None otherwise."""
if shape is None:
return None
payload = shape.serialization.get('payload')
if payload is not None:
payload_shape = shape.members[payload]
if pay... | [
"def",
"_get_streaming_body",
"(",
"self",
",",
"shape",
")",
":",
"if",
"shape",
"is",
"None",
":",
"return",
"None",
"payload",
"=",
"shape",
".",
"serialization",
".",
"get",
"(",
"'payload'",
")",
"if",
"payload",
"is",
"not",
"None",
":",
"payload_s... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/model.py#L528-L537 | |
zlgopen/awtk | 2c49e854a78749d9092907c027a7fba9062be549 | 3rd/mbedtls/scripts/config.py | python | include_in_full | (name) | return True | Rules for symbols in the "full" configuration. | Rules for symbols in the "full" configuration. | [
"Rules",
"for",
"symbols",
"in",
"the",
"full",
"configuration",
"."
] | def include_in_full(name):
"""Rules for symbols in the "full" configuration."""
if name in EXCLUDE_FROM_FULL:
return False
if name.endswith('_ALT'):
return is_seamless_alt(name)
return True | [
"def",
"include_in_full",
"(",
"name",
")",
":",
"if",
"name",
"in",
"EXCLUDE_FROM_FULL",
":",
"return",
"False",
"if",
"name",
".",
"endswith",
"(",
"'_ALT'",
")",
":",
"return",
"is_seamless_alt",
"(",
"name",
")",
"return",
"True"
] | https://github.com/zlgopen/awtk/blob/2c49e854a78749d9092907c027a7fba9062be549/3rd/mbedtls/scripts/config.py#L222-L228 | |
coinapi/coinapi-sdk | 854f21e7f69ea8599ae35c5403565cf299d8b795 | oeml-sdk/python/openapi_client/api_client.py | python | ApiClient.request | (self, method, url, query_params=None, headers=None,
post_params=None, body=None, _preload_content=True,
_request_timeout=None) | Makes the HTTP request using RESTClient. | Makes the HTTP request using RESTClient. | [
"Makes",
"the",
"HTTP",
"request",
"using",
"RESTClient",
"."
] | def request(self, method, url, query_params=None, headers=None,
post_params=None, body=None, _preload_content=True,
_request_timeout=None):
"""Makes the HTTP request using RESTClient."""
if method == "GET":
return self.rest_client.GET(url,
... | [
"def",
"request",
"(",
"self",
",",
"method",
",",
"url",
",",
"query_params",
"=",
"None",
",",
"headers",
"=",
"None",
",",
"post_params",
"=",
"None",
",",
"body",
"=",
"None",
",",
"_preload_content",
"=",
"True",
",",
"_request_timeout",
"=",
"None"... | https://github.com/coinapi/coinapi-sdk/blob/854f21e7f69ea8599ae35c5403565cf299d8b795/oeml-sdk/python/openapi_client/api_client.py#L431-L490 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/examples/speech_commands/wav_to_features.py | python | wav_to_features | (sample_rate, clip_duration_ms, window_size_ms,
window_stride_ms, feature_bin_count, quantize, preprocess,
input_wav, output_c_file) | Converts an audio file into its corresponding feature map.
Args:
sample_rate: Expected sample rate of the wavs.
clip_duration_ms: Expected duration in milliseconds of the wavs.
window_size_ms: How long each spectrogram timeslice is.
window_stride_ms: How far to move in time between spectrogram timesl... | Converts an audio file into its corresponding feature map. | [
"Converts",
"an",
"audio",
"file",
"into",
"its",
"corresponding",
"feature",
"map",
"."
] | def wav_to_features(sample_rate, clip_duration_ms, window_size_ms,
window_stride_ms, feature_bin_count, quantize, preprocess,
input_wav, output_c_file):
"""Converts an audio file into its corresponding feature map.
Args:
sample_rate: Expected sample rate of the wavs.
... | [
"def",
"wav_to_features",
"(",
"sample_rate",
",",
"clip_duration_ms",
",",
"window_size_ms",
",",
"window_stride_ms",
",",
"feature_bin_count",
",",
"quantize",
",",
"preprocess",
",",
"input_wav",
",",
"output_c_file",
")",
":",
"# Start a new TensorFlow session.",
"s... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/examples/speech_commands/wav_to_features.py#L43-L118 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Path/PathScripts/PathUtils.py | python | RtoIJ | (startpoint, command) | return newcommand | This function takes a startpoint and an arc command in radius mode and
returns an arc command in IJ mode. Useful for preprocessor scripts | This function takes a startpoint and an arc command in radius mode and
returns an arc command in IJ mode. Useful for preprocessor scripts | [
"This",
"function",
"takes",
"a",
"startpoint",
"and",
"an",
"arc",
"command",
"in",
"radius",
"mode",
"and",
"returns",
"an",
"arc",
"command",
"in",
"IJ",
"mode",
".",
"Useful",
"for",
"preprocessor",
"scripts"
] | def RtoIJ(startpoint, command):
"""
This function takes a startpoint and an arc command in radius mode and
returns an arc command in IJ mode. Useful for preprocessor scripts
"""
if "R" not in command.Parameters:
raise ValueError("No R parameter in command")
if command.Name not in ["G2", ... | [
"def",
"RtoIJ",
"(",
"startpoint",
",",
"command",
")",
":",
"if",
"\"R\"",
"not",
"in",
"command",
".",
"Parameters",
":",
"raise",
"ValueError",
"(",
"\"No R parameter in command\"",
")",
"if",
"command",
".",
"Name",
"not",
"in",
"[",
"\"G2\"",
",",
"\"... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathUtils.py#L779-L815 | |
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | flang/examples/FlangOmpReport/yaml_summarizer.py | python | clean_summary | (result) | Cleans the result after processing the yaml files with summary format. | Cleans the result after processing the yaml files with summary format. | [
"Cleans",
"the",
"result",
"after",
"processing",
"the",
"yaml",
"files",
"with",
"summary",
"format",
"."
] | def clean_summary(result):
""" Cleans the result after processing the yaml files with summary format."""
# Remove all "clauses" that are empty to keep things compact
for construct in result:
if construct["clauses"] == []:
construct.pop("clauses") | [
"def",
"clean_summary",
"(",
"result",
")",
":",
"# Remove all \"clauses\" that are empty to keep things compact",
"for",
"construct",
"in",
"result",
":",
"if",
"construct",
"[",
"\"clauses\"",
"]",
"==",
"[",
"]",
":",
"construct",
".",
"pop",
"(",
"\"clauses\"",
... | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/flang/examples/FlangOmpReport/yaml_summarizer.py#L160-L165 | ||
naver/sling | 5671cd445a2caae0b4dd0332299e4cfede05062c | webkit/Tools/Scripts/webkitpy/thirdparty/irc/irclib.py | python | nm_to_n | (s) | return s.split("!")[0] | Get the nick part of a nickmask.
(The source of an Event is a nickmask.) | Get the nick part of a nickmask. | [
"Get",
"the",
"nick",
"part",
"of",
"a",
"nickmask",
"."
] | def nm_to_n(s):
"""Get the nick part of a nickmask.
(The source of an Event is a nickmask.)
"""
return s.split("!")[0] | [
"def",
"nm_to_n",
"(",
"s",
")",
":",
"return",
"s",
".",
"split",
"(",
"\"!\"",
")",
"[",
"0",
"]"
] | https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/thirdparty/irc/irclib.py#L1277-L1282 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/email/parser.py | python | Parser.__init__ | (self, *args, **kws) | Parser of RFC 2822 and MIME email messages.
Creates an in-memory object tree representing the email message, which
can then be manipulated and turned over to a Generator to return the
textual representation of the message.
The string must be formatted as a block of RFC 2822 headers and... | Parser of RFC 2822 and MIME email messages. | [
"Parser",
"of",
"RFC",
"2822",
"and",
"MIME",
"email",
"messages",
"."
] | def __init__(self, *args, **kws):
"""Parser of RFC 2822 and MIME email messages.
Creates an in-memory object tree representing the email message, which
can then be manipulated and turned over to a Generator to return the
textual representation of the message.
The string must be... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kws",
")",
":",
"if",
"len",
"(",
"args",
")",
">=",
"1",
":",
"if",
"'_class'",
"in",
"kws",
":",
"raise",
"TypeError",
"(",
"\"Multiple values for keyword arg '_class'\"",
")",
"kws",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/email/parser.py#L18-L54 | ||
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/base/android/jni_generator/jni_generator.py | python | MangleCalledByNatives | (jni_params, called_by_natives, always_mangle) | return called_by_natives | Mangles all the overloads from the call_by_natives list or
mangle all methods if always_mangle is true. | Mangles all the overloads from the call_by_natives list or
mangle all methods if always_mangle is true. | [
"Mangles",
"all",
"the",
"overloads",
"from",
"the",
"call_by_natives",
"list",
"or",
"mangle",
"all",
"methods",
"if",
"always_mangle",
"is",
"true",
"."
] | def MangleCalledByNatives(jni_params, called_by_natives, always_mangle):
"""Mangles all the overloads from the call_by_natives list or
mangle all methods if always_mangle is true.
"""
method_counts = collections.defaultdict(
lambda: collections.defaultdict(lambda: 0))
for called_by_native in called_b... | [
"def",
"MangleCalledByNatives",
"(",
"jni_params",
",",
"called_by_natives",
",",
"always_mangle",
")",
":",
"method_counts",
"=",
"collections",
".",
"defaultdict",
"(",
"lambda",
":",
"collections",
".",
"defaultdict",
"(",
"lambda",
":",
"0",
")",
")",
"for",... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/base/android/jni_generator/jni_generator.py#L648-L667 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/logging/handlers.py | python | HTTPHandler.mapLogRecord | (self, record) | return record.__dict__ | Default implementation of mapping the log record into a dict
that is sent as the CGI data. Overwrite in your class.
Contributed by Franz Glasner. | Default implementation of mapping the log record into a dict
that is sent as the CGI data. Overwrite in your class.
Contributed by Franz Glasner. | [
"Default",
"implementation",
"of",
"mapping",
"the",
"log",
"record",
"into",
"a",
"dict",
"that",
"is",
"sent",
"as",
"the",
"CGI",
"data",
".",
"Overwrite",
"in",
"your",
"class",
".",
"Contributed",
"by",
"Franz",
"Glasner",
"."
] | def mapLogRecord(self, record):
"""
Default implementation of mapping the log record into a dict
that is sent as the CGI data. Overwrite in your class.
Contributed by Franz Glasner.
"""
return record.__dict__ | [
"def",
"mapLogRecord",
"(",
"self",
",",
"record",
")",
":",
"return",
"record",
".",
"__dict__"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/logging/handlers.py#L1149-L1155 | |
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/ML/ScreenComposite.py | python | message | (msg, noRet=0) | emits messages to _sys.stdout_
override this in modules which import this one to redirect output
**Arguments**
- msg: the string to be displayed | emits messages to _sys.stdout_
override this in modules which import this one to redirect output | [
"emits",
"messages",
"to",
"_sys",
".",
"stdout_",
"override",
"this",
"in",
"modules",
"which",
"import",
"this",
"one",
"to",
"redirect",
"output"
] | def message(msg, noRet=0):
""" emits messages to _sys.stdout_
override this in modules which import this one to redirect output
**Arguments**
- msg: the string to be displayed
"""
if noRet:
sys.stdout.write('%s ' % (msg))
else:
sys.stdout.write('%s\n' % (msg)) | [
"def",
"message",
"(",
"msg",
",",
"noRet",
"=",
"0",
")",
":",
"if",
"noRet",
":",
"sys",
".",
"stdout",
".",
"write",
"(",
"'%s '",
"%",
"(",
"msg",
")",
")",
"else",
":",
"sys",
".",
"stdout",
".",
"write",
"(",
"'%s\\n'",
"%",
"(",
"msg",
... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/ML/ScreenComposite.py#L138-L150 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/__init__.py | python | IMetadataProvider.metadata_isdir | (name) | Is the named metadata a directory? (like ``os.path.isdir()``) | Is the named metadata a directory? (like ``os.path.isdir()``) | [
"Is",
"the",
"named",
"metadata",
"a",
"directory?",
"(",
"like",
"os",
".",
"path",
".",
"isdir",
"()",
")"
] | def metadata_isdir(name):
"""Is the named metadata a directory? (like ``os.path.isdir()``)""" | [
"def",
"metadata_isdir",
"(",
"name",
")",
":"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/__init__.py#L598-L599 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | SchemaValidCtxt.SchemaValidateCtxt | (self, reader, options) | return ret | Use W3C XSD schema context to validate the document as it
is processed. Activation is only possible before the first
Read(). If @ctxt is None, then XML Schema validation is
deactivated. | Use W3C XSD schema context to validate the document as it
is processed. Activation is only possible before the first
Read(). If | [
"Use",
"W3C",
"XSD",
"schema",
"context",
"to",
"validate",
"the",
"document",
"as",
"it",
"is",
"processed",
".",
"Activation",
"is",
"only",
"possible",
"before",
"the",
"first",
"Read",
"()",
".",
"If"
] | def SchemaValidateCtxt(self, reader, options):
"""Use W3C XSD schema context to validate the document as it
is processed. Activation is only possible before the first
Read(). If @ctxt is None, then XML Schema validation is
deactivated. """
if reader is None: reader__o = No... | [
"def",
"SchemaValidateCtxt",
"(",
"self",
",",
"reader",
",",
"options",
")",
":",
"if",
"reader",
"is",
"None",
":",
"reader__o",
"=",
"None",
"else",
":",
"reader__o",
"=",
"reader",
".",
"_o",
"ret",
"=",
"libxml2mod",
".",
"xmlTextReaderSchemaValidateCtx... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L6437-L6445 | |
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | lldb/utils/lui/lldbutil.py | python | get_filenames | (thread) | return [GetFilename(i) for i in range(thread.GetNumFrames())] | Returns a sequence of file names from the stack frames of this thread. | Returns a sequence of file names from the stack frames of this thread. | [
"Returns",
"a",
"sequence",
"of",
"file",
"names",
"from",
"the",
"stack",
"frames",
"of",
"this",
"thread",
"."
] | def get_filenames(thread):
"""
Returns a sequence of file names from the stack frames of this thread.
"""
def GetFilename(i):
return thread.GetFrameAtIndex(
i).GetLineEntry().GetFileSpec().GetFilename()
return [GetFilename(i) for i in range(thread.GetNumFrames())] | [
"def",
"get_filenames",
"(",
"thread",
")",
":",
"def",
"GetFilename",
"(",
"i",
")",
":",
"return",
"thread",
".",
"GetFrameAtIndex",
"(",
"i",
")",
".",
"GetLineEntry",
"(",
")",
".",
"GetFileSpec",
"(",
")",
".",
"GetFilename",
"(",
")",
"return",
"... | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/lldb/utils/lui/lldbutil.py#L734-L742 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/RANSApplication/python_scripts/formulations/rans_formulation.py | python | RansFormulation.GetCommunicator | (self) | Get the communicator for MPI use
Returns:
Kratos.Communicator: Communicator used in the model part | Get the communicator for MPI use | [
"Get",
"the",
"communicator",
"for",
"MPI",
"use"
] | def GetCommunicator(self):
"""Get the communicator for MPI use
Returns:
Kratos.Communicator: Communicator used in the model part
"""
if hasattr(self, "_RansFormulation__communicator"):
return self.__communicator
else:
raise Exception(self.__cl... | [
"def",
"GetCommunicator",
"(",
"self",
")",
":",
"if",
"hasattr",
"(",
"self",
",",
"\"_RansFormulation__communicator\"",
")",
":",
"return",
"self",
".",
"__communicator",
"else",
":",
"raise",
"Exception",
"(",
"self",
".",
"__class__",
".",
"__name__",
"+",... | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/RANSApplication/python_scripts/formulations/rans_formulation.py#L210-L219 | ||
timi-liuliang/echo | 40a5a24d430eee4118314459ab7e03afcb3b8719 | thirdparty/protobuf/python/google/protobuf/text_format.py | python | _Tokenizer._ParseError | (self, message) | return ParseError('%d:%d : %s' % (
self._line + 1, self._column + 1, message)) | Creates and *returns* a ParseError for the current token. | Creates and *returns* a ParseError for the current token. | [
"Creates",
"and",
"*",
"returns",
"*",
"a",
"ParseError",
"for",
"the",
"current",
"token",
"."
] | def _ParseError(self, message):
"""Creates and *returns* a ParseError for the current token."""
return ParseError('%d:%d : %s' % (
self._line + 1, self._column + 1, message)) | [
"def",
"_ParseError",
"(",
"self",
",",
"message",
")",
":",
"return",
"ParseError",
"(",
"'%d:%d : %s'",
"%",
"(",
"self",
".",
"_line",
"+",
"1",
",",
"self",
".",
"_column",
"+",
"1",
",",
"message",
")",
")"
] | https://github.com/timi-liuliang/echo/blob/40a5a24d430eee4118314459ab7e03afcb3b8719/thirdparty/protobuf/python/google/protobuf/text_format.py#L728-L731 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/image/detection.py | python | DetRandomCropAug._calculate_areas | (self, label) | return heights * widths | Calculate areas for multiple labels | Calculate areas for multiple labels | [
"Calculate",
"areas",
"for",
"multiple",
"labels"
] | def _calculate_areas(self, label):
"""Calculate areas for multiple labels"""
heights = np.maximum(0, label[:, 3] - label[:, 1])
widths = np.maximum(0, label[:, 2] - label[:, 0])
return heights * widths | [
"def",
"_calculate_areas",
"(",
"self",
",",
"label",
")",
":",
"heights",
"=",
"np",
".",
"maximum",
"(",
"0",
",",
"label",
"[",
":",
",",
"3",
"]",
"-",
"label",
"[",
":",
",",
"1",
"]",
")",
"widths",
"=",
"np",
".",
"maximum",
"(",
"0",
... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/image/detection.py#L213-L217 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Canvas.create_window | (self, *args, **kw) | return self._create('window', args, kw) | Create window with coordinates x1,y1,x2,y2. | Create window with coordinates x1,y1,x2,y2. | [
"Create",
"window",
"with",
"coordinates",
"x1",
"y1",
"x2",
"y2",
"."
] | def create_window(self, *args, **kw):
"""Create window with coordinates x1,y1,x2,y2."""
return self._create('window', args, kw) | [
"def",
"create_window",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kw",
")",
":",
"return",
"self",
".",
"_create",
"(",
"'window'",
",",
"args",
",",
"kw",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2276-L2278 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/virtualenv/virtualenv_embedded/site.py | python | aliasmbcs | () | On Windows, some default encodings are not provided by Python,
while they are always available as "mbcs" in each locale. Make
them usable by aliasing to "mbcs" in such a case. | On Windows, some default encodings are not provided by Python,
while they are always available as "mbcs" in each locale. Make
them usable by aliasing to "mbcs" in such a case. | [
"On",
"Windows",
"some",
"default",
"encodings",
"are",
"not",
"provided",
"by",
"Python",
"while",
"they",
"are",
"always",
"available",
"as",
"mbcs",
"in",
"each",
"locale",
".",
"Make",
"them",
"usable",
"by",
"aliasing",
"to",
"mbcs",
"in",
"such",
"a"... | def aliasmbcs():
"""On Windows, some default encodings are not provided by Python,
while they are always available as "mbcs" in each locale. Make
them usable by aliasing to "mbcs" in such a case."""
if sys.platform == 'win32':
import locale, codecs
enc = locale.getdefaultlocale()[1]
... | [
"def",
"aliasmbcs",
"(",
")",
":",
"if",
"sys",
".",
"platform",
"==",
"'win32'",
":",
"import",
"locale",
",",
"codecs",
"enc",
"=",
"locale",
".",
"getdefaultlocale",
"(",
")",
"[",
"1",
"]",
"if",
"enc",
".",
"startswith",
"(",
"'cp'",
")",
":",
... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/virtualenv/virtualenv_embedded/site.py#L510-L523 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/ma/core.py | python | MaskedArray.argsort | (self, axis=np._NoValue, kind='quicksort', order=None,
endwith=True, fill_value=None) | return filled.argsort(axis=axis, kind=kind, order=order) | Return an ndarray of indices that sort the array along the
specified axis. Masked values are filled beforehand to
`fill_value`.
Parameters
----------
axis : int, optional
Axis along which to sort. If None, the default, the flattened array
is used.
... | Return an ndarray of indices that sort the array along the
specified axis. Masked values are filled beforehand to
`fill_value`. | [
"Return",
"an",
"ndarray",
"of",
"indices",
"that",
"sort",
"the",
"array",
"along",
"the",
"specified",
"axis",
".",
"Masked",
"values",
"are",
"filled",
"beforehand",
"to",
"fill_value",
"."
] | def argsort(self, axis=np._NoValue, kind='quicksort', order=None,
endwith=True, fill_value=None):
"""
Return an ndarray of indices that sort the array along the
specified axis. Masked values are filled beforehand to
`fill_value`.
Parameters
----------
... | [
"def",
"argsort",
"(",
"self",
",",
"axis",
"=",
"np",
".",
"_NoValue",
",",
"kind",
"=",
"'quicksort'",
",",
"order",
"=",
"None",
",",
"endwith",
"=",
"True",
",",
"fill_value",
"=",
"None",
")",
":",
"# 2017-04-11, Numpy 1.13.0, gh-8701: warn on axis defaul... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/ma/core.py#L5330-L5408 | |
freesurfer/freesurfer | 6dbe527d43ffa611acb2cd112e9469f9bfec8e36 | python/freesurfer/surface.py | python | Surface.__eq__ | (self, other) | return equal | Check for equality. | Check for equality. | [
"Check",
"for",
"equality",
"."
] | def __eq__(self, other):
'''Check for equality.'''
equal = np.array_equal(self.vertices, other.vertices) and \
np.array_equal(self.faces, other.faces) and \
self.hemi == other.hemi and \
self.geom == other.geom
return equal | [
"def",
"__eq__",
"(",
"self",
",",
"other",
")",
":",
"equal",
"=",
"np",
".",
"array_equal",
"(",
"self",
".",
"vertices",
",",
"other",
".",
"vertices",
")",
"and",
"np",
".",
"array_equal",
"(",
"self",
".",
"faces",
",",
"other",
".",
"faces",
... | https://github.com/freesurfer/freesurfer/blob/6dbe527d43ffa611acb2cd112e9469f9bfec8e36/python/freesurfer/surface.py#L30-L36 | |
google/VoltAir | 88bc3c8e09420d600d0b3d6d6c6eea75ebe0c5f2 | build/build_android.py | python | Popd | () | Pops and returns the top of the directory stack. | Pops and returns the top of the directory stack. | [
"Pops",
"and",
"returns",
"the",
"top",
"of",
"the",
"directory",
"stack",
"."
] | def Popd():
"""Pops and returns the top of the directory stack.
"""
os.chdir(_dirstack.pop()) | [
"def",
"Popd",
"(",
")",
":",
"os",
".",
"chdir",
"(",
"_dirstack",
".",
"pop",
"(",
")",
")"
] | https://github.com/google/VoltAir/blob/88bc3c8e09420d600d0b3d6d6c6eea75ebe0c5f2/build/build_android.py#L97-L100 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/cgi.py | python | print_environ_usage | () | Dump a list of environment variables used by CGI as HTML. | Dump a list of environment variables used by CGI as HTML. | [
"Dump",
"a",
"list",
"of",
"environment",
"variables",
"used",
"by",
"CGI",
"as",
"HTML",
"."
] | def print_environ_usage():
"""Dump a list of environment variables used by CGI as HTML."""
print """
<H3>These environment variables could have been set:</H3>
<UL>
<LI>AUTH_TYPE
<LI>CONTENT_LENGTH
<LI>CONTENT_TYPE
<LI>DATE_GMT
<LI>DATE_LOCAL
<LI>DOCUMENT_NAME
<LI>DOCUMENT_ROOT
<LI>DOCUMENT_URI
<LI>GATEWAY_INTER... | [
"def",
"print_environ_usage",
"(",
")",
":",
"print",
"\"\"\"\n<H3>These environment variables could have been set:</H3>\n<UL>\n<LI>AUTH_TYPE\n<LI>CONTENT_LENGTH\n<LI>CONTENT_TYPE\n<LI>DATE_GMT\n<LI>DATE_LOCAL\n<LI>DOCUMENT_NAME\n<LI>DOCUMENT_ROOT\n<LI>DOCUMENT_URI\n<LI>GATEWAY_INTERFACE\n<LI>LAST_MODIF... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/cgi.py#L983-L1024 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py | python | Grid.grid_forget | (self) | Unmap this widget. | Unmap this widget. | [
"Unmap",
"this",
"widget",
"."
] | def grid_forget(self):
"""Unmap this widget."""
self.tk.call('grid', 'forget', self._w) | [
"def",
"grid_forget",
"(",
"self",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"'grid'",
",",
"'forget'",
",",
"self",
".",
"_w",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py#L2230-L2232 | ||
chadmv/cvwrap | 51367b050704817cf3e72d4be018c182b4dd8dcb | scripts/cvwrap/menu.py | python | get_create_command_kwargs | () | return args | Gets the cvWrap command arguments either from the option box widgets or the saved
option vars. If the widgets exist, their values will be saved to the option vars.
@return A dictionary of the kwargs to the cvWrap command. | Gets the cvWrap command arguments either from the option box widgets or the saved
option vars. If the widgets exist, their values will be saved to the option vars. | [
"Gets",
"the",
"cvWrap",
"command",
"arguments",
"either",
"from",
"the",
"option",
"box",
"widgets",
"or",
"the",
"saved",
"option",
"vars",
".",
"If",
"the",
"widgets",
"exist",
"their",
"values",
"will",
"be",
"saved",
"to",
"the",
"option",
"vars",
"."... | def get_create_command_kwargs():
"""Gets the cvWrap command arguments either from the option box widgets or the saved
option vars. If the widgets exist, their values will be saved to the option vars.
@return A dictionary of the kwargs to the cvWrap command."""
args = {}
if cmds.textFieldGrp(NAME_WI... | [
"def",
"get_create_command_kwargs",
"(",
")",
":",
"args",
"=",
"{",
"}",
"if",
"cmds",
".",
"textFieldGrp",
"(",
"NAME_WIDGET",
",",
"exists",
"=",
"True",
")",
":",
"args",
"[",
"'name'",
"]",
"=",
"cmds",
".",
"textFieldGrp",
"(",
"NAME_WIDGET",
",",
... | https://github.com/chadmv/cvwrap/blob/51367b050704817cf3e72d4be018c182b4dd8dcb/scripts/cvwrap/menu.py#L73-L109 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/tools/optimize_for_inference_lib.py | python | values_from_const | (node_def) | return tensor_value | Extracts the values from a const NodeDef as a numpy ndarray.
Args:
node_def: Const NodeDef that has the values we want to access.
Returns:
Numpy ndarray containing the values.
Raises:
ValueError: If the node isn't a Const. | Extracts the values from a const NodeDef as a numpy ndarray. | [
"Extracts",
"the",
"values",
"from",
"a",
"const",
"NodeDef",
"as",
"a",
"numpy",
"ndarray",
"."
] | def values_from_const(node_def):
"""Extracts the values from a const NodeDef as a numpy ndarray.
Args:
node_def: Const NodeDef that has the values we want to access.
Returns:
Numpy ndarray containing the values.
Raises:
ValueError: If the node isn't a Const.
"""
if node_def.op != "Const":
... | [
"def",
"values_from_const",
"(",
"node_def",
")",
":",
"if",
"node_def",
".",
"op",
"!=",
"\"Const\"",
":",
"raise",
"ValueError",
"(",
"\"Can not extract constant value from a node that is not Const. Got:\\n\"",
"f\"{node_def}\"",
")",
"input_tensor",
"=",
"node_def",
".... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/tools/optimize_for_inference_lib.py#L176-L194 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2class.py | python | cleanupOutputCallbacks | () | clears the entire output callback table. this includes the
compiled-in I/O callbacks. | clears the entire output callback table. this includes the
compiled-in I/O callbacks. | [
"clears",
"the",
"entire",
"output",
"callback",
"table",
".",
"this",
"includes",
"the",
"compiled",
"-",
"in",
"I",
"/",
"O",
"callbacks",
"."
] | def cleanupOutputCallbacks():
"""clears the entire output callback table. this includes the
compiled-in I/O callbacks. """
libxml2mod.xmlCleanupOutputCallbacks() | [
"def",
"cleanupOutputCallbacks",
"(",
")",
":",
"libxml2mod",
".",
"xmlCleanupOutputCallbacks",
"(",
")"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L1090-L1093 | ||
apple/swift | 469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893 | utils/gyb_syntax_support/__init__.py | python | check_child_condition_raw | (child) | return result | Generates a C++ closure to check whether a given raw syntax node can
satisfy the requirements of child. | Generates a C++ closure to check whether a given raw syntax node can
satisfy the requirements of child. | [
"Generates",
"a",
"C",
"++",
"closure",
"to",
"check",
"whether",
"a",
"given",
"raw",
"syntax",
"node",
"can",
"satisfy",
"the",
"requirements",
"of",
"child",
"."
] | def check_child_condition_raw(child):
"""
Generates a C++ closure to check whether a given raw syntax node can
satisfy the requirements of child.
"""
result = '[](const RawSyntax *Raw) {\n'
result += ' // check %s\n' % child.name
if child.token_choices:
result += 'if (!Raw->isToken()... | [
"def",
"check_child_condition_raw",
"(",
"child",
")",
":",
"result",
"=",
"'[](const RawSyntax *Raw) {\\n'",
"result",
"+=",
"' // check %s\\n'",
"%",
"child",
".",
"name",
"if",
"child",
".",
"token_choices",
":",
"result",
"+=",
"'if (!Raw->isToken()) return false;\\... | https://github.com/apple/swift/blob/469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893/utils/gyb_syntax_support/__init__.py#L51-L80 | |
OpenLightingProject/ola | d1433a1bed73276fbe55ce18c03b1c208237decc | python/ola/PidStore.py | python | Group._UnpackFixedLength | (self, atoms, data) | return output, offset | Unpack a list of atoms of a known, fixed size.
Args:
atoms: A list of atoms, must all have FixedSize() == True.
data: The binary data.
Returns:
A tuple in the form (output_dict, data_consumed) | Unpack a list of atoms of a known, fixed size. | [
"Unpack",
"a",
"list",
"of",
"atoms",
"of",
"a",
"known",
"fixed",
"size",
"."
] | def _UnpackFixedLength(self, atoms, data):
"""Unpack a list of atoms of a known, fixed size.
Args:
atoms: A list of atoms, must all have FixedSize() == True.
data: The binary data.
Returns:
A tuple in the form (output_dict, data_consumed)
"""
output = {}
offset = 0
for at... | [
"def",
"_UnpackFixedLength",
"(",
"self",
",",
"atoms",
",",
"data",
")",
":",
"output",
"=",
"{",
"}",
"offset",
"=",
"0",
"for",
"atom",
"in",
"atoms",
":",
"size",
"=",
"atom",
".",
"size",
"output",
"[",
"atom",
".",
"name",
"]",
"=",
"atom",
... | https://github.com/OpenLightingProject/ola/blob/d1433a1bed73276fbe55ce18c03b1c208237decc/python/ola/PidStore.py#L918-L934 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/linalg/linalg.py | python | matrix_power | (a, n) | return result | Raise a square matrix to the (integer) power `n`.
For positive integers `n`, the power is computed by repeated matrix
squarings and matrix multiplications. If ``n == 0``, the identity matrix
of the same shape as M is returned. If ``n < 0``, the inverse
is computed and then raised to the ``abs(n)``.
... | Raise a square matrix to the (integer) power `n`. | [
"Raise",
"a",
"square",
"matrix",
"to",
"the",
"(",
"integer",
")",
"power",
"n",
"."
] | def matrix_power(a, n):
"""
Raise a square matrix to the (integer) power `n`.
For positive integers `n`, the power is computed by repeated matrix
squarings and matrix multiplications. If ``n == 0``, the identity matrix
of the same shape as M is returned. If ``n < 0``, the inverse
is computed an... | [
"def",
"matrix_power",
"(",
"a",
",",
"n",
")",
":",
"a",
"=",
"asanyarray",
"(",
"a",
")",
"_assert_stacked_2d",
"(",
"a",
")",
"_assert_stacked_square",
"(",
"a",
")",
"try",
":",
"n",
"=",
"operator",
".",
"index",
"(",
"n",
")",
"except",
"TypeEr... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/linalg/linalg.py#L554-L666 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/debugger_cli_common.py | python | Menu.append | (self, item) | Append an item to the Menu.
Args:
item: (MenuItem) the item to be appended. | Append an item to the Menu. | [
"Append",
"an",
"item",
"to",
"the",
"Menu",
"."
] | def append(self, item):
"""Append an item to the Menu.
Args:
item: (MenuItem) the item to be appended.
"""
self._items.append(item) | [
"def",
"append",
"(",
"self",
",",
"item",
")",
":",
"self",
".",
"_items",
".",
"append",
"(",
"item",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/debugger_cli_common.py#L1164-L1170 | ||
deepmind/streetlearn | ccf1d60b9c45154894d45a897748aee85d7eb69b | streetlearn/python/agents/plain_agent.py | python | PlainAgent.__init__ | (self,
num_actions,
observation_names,
lstm_num_hiddens=256,
feed_action_and_reward=True,
max_reward=1.0,
name="streetlearn_core") | Initializes an agent core designed to be used with A3C/IMPALA.
Supports a single visual observation tensor and outputs a single, scalar
discrete action with policy logits and a baseline value.
Args:
num_actions: Number of actions available.
observation_names: String with observation types sepa... | Initializes an agent core designed to be used with A3C/IMPALA. | [
"Initializes",
"an",
"agent",
"core",
"designed",
"to",
"be",
"used",
"with",
"A3C",
"/",
"IMPALA",
"."
] | def __init__(self,
num_actions,
observation_names,
lstm_num_hiddens=256,
feed_action_and_reward=True,
max_reward=1.0,
name="streetlearn_core"):
"""Initializes an agent core designed to be used with A3C/IMPALA.
Supports a ... | [
"def",
"__init__",
"(",
"self",
",",
"num_actions",
",",
"observation_names",
",",
"lstm_num_hiddens",
"=",
"256",
",",
"feed_action_and_reward",
"=",
"True",
",",
"max_reward",
"=",
"1.0",
",",
"name",
"=",
"\"streetlearn_core\"",
")",
":",
"super",
"(",
"Pla... | https://github.com/deepmind/streetlearn/blob/ccf1d60b9c45154894d45a897748aee85d7eb69b/streetlearn/python/agents/plain_agent.py#L45-L86 | ||
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/pybind/mgr/telemetry/module.py | python | Module.preview_all | (self) | return 0, report, '' | Preview a sample report of the most recent collections available of all channels (including 'device') | Preview a sample report of the most recent collections available of all channels (including 'device') | [
"Preview",
"a",
"sample",
"report",
"of",
"the",
"most",
"recent",
"collections",
"available",
"of",
"all",
"channels",
"(",
"including",
"device",
")"
] | def preview_all(self) -> Tuple[int, str, str]:
'''
Preview a sample report of the most recent collections available of all channels (including 'device')
'''
report = {}
col_delta = self.collection_delta()
with self.get_report_lock:
if col_delta is not None an... | [
"def",
"preview_all",
"(",
"self",
")",
"->",
"Tuple",
"[",
"int",
",",
"str",
",",
"str",
"]",
":",
"report",
"=",
"{",
"}",
"col_delta",
"=",
"self",
".",
"collection_delta",
"(",
")",
"with",
"self",
".",
"get_report_lock",
":",
"if",
"col_delta",
... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/telemetry/module.py#L1696-L1723 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/nn/functional/loss.py | python | margin_cross_entropy | (logits,
label,
margin1=1.0,
margin2=0.5,
margin3=0.0,
scale=64.0,
group=None,
return_softmax=False,
reduction='mean') | .. math::
L=-\\frac{1}{N}\sum^N_{i=1}\log\\frac{e^{s(cos(m_{1}\\theta_{y_i}+m_{2})-m_{3})}}{e^{s(cos(m_{1}\\theta_{y_i}+m_{2})-m_{3})}+\sum^n_{j=1,j\\neq y_i} e^{scos\\theta_{y_i}}}
where the :math:`\\theta_{y_i}` is the angle between the feature :math:`x` and
the representation of class :math:`i`. Th... | .. math:: | [
"..",
"math",
"::"
] | def margin_cross_entropy(logits,
label,
margin1=1.0,
margin2=0.5,
margin3=0.0,
scale=64.0,
group=None,
return_softmax=False,
... | [
"def",
"margin_cross_entropy",
"(",
"logits",
",",
"label",
",",
"margin1",
"=",
"1.0",
",",
"margin2",
"=",
"0.5",
",",
"margin3",
"=",
"0.0",
",",
"scale",
"=",
"64.0",
",",
"group",
"=",
"None",
",",
"return_softmax",
"=",
"False",
",",
"reduction",
... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/nn/functional/loss.py#L1111-L1372 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/linalg/linear_operator_identity.py | python | LinearOperatorIdentity.add_to_tensor | (self, mat, name="add_to_tensor") | Add matrix represented by this operator to `mat`. Equiv to `I + mat`.
Args:
mat: `Tensor` with same `dtype` and shape broadcastable to `self`.
name: A name to give this `Op`.
Returns:
A `Tensor` with broadcast shape and same `dtype` as `self`. | Add matrix represented by this operator to `mat`. Equiv to `I + mat`. | [
"Add",
"matrix",
"represented",
"by",
"this",
"operator",
"to",
"mat",
".",
"Equiv",
"to",
"I",
"+",
"mat",
"."
] | def add_to_tensor(self, mat, name="add_to_tensor"):
"""Add matrix represented by this operator to `mat`. Equiv to `I + mat`.
Args:
mat: `Tensor` with same `dtype` and shape broadcastable to `self`.
name: A name to give this `Op`.
Returns:
A `Tensor` with broadcast shape and same `dtyp... | [
"def",
"add_to_tensor",
"(",
"self",
",",
"mat",
",",
"name",
"=",
"\"add_to_tensor\"",
")",
":",
"with",
"self",
".",
"_name_scope",
"(",
"name",
",",
"values",
"=",
"[",
"mat",
"]",
")",
":",
"mat",
"=",
"ops",
".",
"convert_to_tensor",
"(",
"mat",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/linalg/linear_operator_identity.py#L381-L395 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/mailbox.py | python | MH.add | (self, message) | return new_key | Add message and return assigned key. | Add message and return assigned key. | [
"Add",
"message",
"and",
"return",
"assigned",
"key",
"."
] | def add(self, message):
"""Add message and return assigned key."""
keys = self.keys()
if len(keys) == 0:
new_key = 1
else:
new_key = max(keys) + 1
new_path = os.path.join(self._path, str(new_key))
f = _create_carefully(new_path)
closed = Fa... | [
"def",
"add",
"(",
"self",
",",
"message",
")",
":",
"keys",
"=",
"self",
".",
"keys",
"(",
")",
"if",
"len",
"(",
"keys",
")",
"==",
"0",
":",
"new_key",
"=",
"1",
"else",
":",
"new_key",
"=",
"max",
"(",
"keys",
")",
"+",
"1",
"new_path",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/mailbox.py#L947-L979 | |
google/usd_from_gltf | 6d288cce8b68744494a226574ae1d7ba6a9c46eb | tools/ufgbatch/ufgcommon/deploy.py | python | copy_to_deploy_dir | (tasks, in_path, test_path, deploy_path, deploy_gltf) | Copy test USDZ files to the local deploy directory. | Copy test USDZ files to the local deploy directory. | [
"Copy",
"test",
"USDZ",
"files",
"to",
"the",
"local",
"deploy",
"directory",
"."
] | def copy_to_deploy_dir(tasks, in_path, test_path, deploy_path, deploy_gltf):
"""Copy test USDZ files to the local deploy directory."""
gltf_dep_exts = ['.bin', '.bmp', '.gif', '.png', '.jpg', '.jpeg']
deploy_exts = ['.usdz', '.gltf', '.glb'] + gltf_dep_exts
if os.path.exists(deploy_path):
# Delete all USDZ ... | [
"def",
"copy_to_deploy_dir",
"(",
"tasks",
",",
"in_path",
",",
"test_path",
",",
"deploy_path",
",",
"deploy_gltf",
")",
":",
"gltf_dep_exts",
"=",
"[",
"'.bin'",
",",
"'.bmp'",
",",
"'.gif'",
",",
"'.png'",
",",
"'.jpg'",
",",
"'.jpeg'",
"]",
"deploy_exts"... | https://github.com/google/usd_from_gltf/blob/6d288cce8b68744494a226574ae1d7ba6a9c46eb/tools/ufgbatch/ufgcommon/deploy.py#L217-L251 | ||
GJDuck/LowFat | ecf6a0f0fa1b73a27a626cf493cc39e477b6faea | llvm-4.0.0.src/utils/llvm-build/llvmbuild/main.py | python | LLVMProjectInfo.validate_components | (self) | validate_components() -> None
Validate that the project components are well-defined. Among other
things, this checks that:
- Components have valid references.
- Components references do not form cycles.
We also construct the map from component names to info, and the
... | validate_components() -> None | [
"validate_components",
"()",
"-",
">",
"None"
] | def validate_components(self):
"""validate_components() -> None
Validate that the project components are well-defined. Among other
things, this checks that:
- Components have valid references.
- Components references do not form cycles.
We also construct the map fro... | [
"def",
"validate_components",
"(",
"self",
")",
":",
"# Create the component info map and validate that component names are",
"# unique.",
"self",
".",
"component_info_map",
"=",
"{",
"}",
"for",
"ci",
"in",
"self",
".",
"component_infos",
":",
"existing",
"=",
"self",
... | https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/utils/llvm-build/llvmbuild/main.py#L102-L194 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/numbers.py | python | Real.__trunc__ | (self) | trunc(self): Truncates self to an Integral.
Returns an Integral i such that:
* i>0 iff self>0;
* abs(i) <= abs(self);
* for any Integral j satisfying the first two conditions,
abs(i) >= abs(j) [i.e. i has "maximal" abs among those].
i.e. "truncate towards 0". | trunc(self): Truncates self to an Integral. | [
"trunc",
"(",
"self",
")",
":",
"Truncates",
"self",
"to",
"an",
"Integral",
"."
] | def __trunc__(self):
"""trunc(self): Truncates self to an Integral.
Returns an Integral i such that:
* i>0 iff self>0;
* abs(i) <= abs(self);
* for any Integral j satisfying the first two conditions,
abs(i) >= abs(j) [i.e. i has "maximal" abs among those].
... | [
"def",
"__trunc__",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/numbers.py#L188-L198 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/autograph/impl/api.py | python | _attach_metadata | (e, f, converted) | Augments an error with the metadata necessary for rewrite. | Augments an error with the metadata necessary for rewrite. | [
"Augments",
"an",
"error",
"with",
"the",
"metadata",
"necessary",
"for",
"rewrite",
"."
] | def _attach_metadata(e, f, converted):
"""Augments an error with the metadata necessary for rewrite."""
if hasattr(e, 'ag_pass_through'):
return
metadata = getattr(e, 'ag_error_metadata', None)
source_map = f.ag_source_map if converted else {}
if metadata is None:
logging.log(
1, 'Caught err... | [
"def",
"_attach_metadata",
"(",
"e",
",",
"f",
",",
"converted",
")",
":",
"if",
"hasattr",
"(",
"e",
",",
"'ag_pass_through'",
")",
":",
"return",
"metadata",
"=",
"getattr",
"(",
"e",
",",
"'ag_error_metadata'",
",",
"None",
")",
"source_map",
"=",
"f"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/autograph/impl/api.py#L301-L317 | ||
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/MooseDocs/base/lexers.py | python | LexerInformation.__contains__ | (self, value) | return value in self.__match | Check if a named group exists in the regex match. | Check if a named group exists in the regex match. | [
"Check",
"if",
"a",
"named",
"group",
"exists",
"in",
"the",
"regex",
"match",
"."
] | def __contains__(self, value):
"""
Check if a named group exists in the regex match.
"""
return value in self.__match | [
"def",
"__contains__",
"(",
"self",
",",
"value",
")",
":",
"return",
"value",
"in",
"self",
".",
"__match"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/MooseDocs/base/lexers.py#L174-L178 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/train/loss_scale_manager.py | python | DynamicLossScaleManager.get_loss_scale | (self) | return self.loss_scale | Get the current loss scale value.
Returns:
float, `loss_scale` value. | Get the current loss scale value. | [
"Get",
"the",
"current",
"loss",
"scale",
"value",
"."
] | def get_loss_scale(self):
"""
Get the current loss scale value.
Returns:
float, `loss_scale` value.
"""
return self.loss_scale | [
"def",
"get_loss_scale",
"(",
"self",
")",
":",
"return",
"self",
".",
"loss_scale"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/train/loss_scale_manager.py#L158-L165 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/unicode_support.py | python | _Py_ISALNUM | (ch) | return _Py_ctype_table[_Py_CHARMASK(ch)] & _PY_CTF.ALNUM | Equivalent to the CPython macro `Py_ISALNUM()` | Equivalent to the CPython macro `Py_ISALNUM()` | [
"Equivalent",
"to",
"the",
"CPython",
"macro",
"Py_ISALNUM",
"()"
] | def _Py_ISALNUM(ch):
"""
Equivalent to the CPython macro `Py_ISALNUM()`
"""
return _Py_ctype_table[_Py_CHARMASK(ch)] & _PY_CTF.ALNUM | [
"def",
"_Py_ISALNUM",
"(",
"ch",
")",
":",
"return",
"_Py_ctype_table",
"[",
"_Py_CHARMASK",
"(",
"ch",
")",
"]",
"&",
"_PY_CTF",
".",
"ALNUM"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/unicode_support.py#L725-L729 | |
lightvector/KataGo | 20d34784703c5b4000643d3ccc43bb37d418f3b5 | python/sgfmill/boards.py | python | Board._find_surrounded_groups | (self) | return surrounded | Find solidly-connected groups with 0 liberties.
Returns a list of _Groups. | Find solidly-connected groups with 0 liberties. | [
"Find",
"solidly",
"-",
"connected",
"groups",
"with",
"0",
"liberties",
"."
] | def _find_surrounded_groups(self):
"""Find solidly-connected groups with 0 liberties.
Returns a list of _Groups.
"""
surrounded = []
handled = set()
for (row, col) in self.board_points:
colour = self.board[row][col]
if colour is None:
... | [
"def",
"_find_surrounded_groups",
"(",
"self",
")",
":",
"surrounded",
"=",
"[",
"]",
"handled",
"=",
"set",
"(",
")",
"for",
"(",
"row",
",",
"col",
")",
"in",
"self",
".",
"board_points",
":",
"colour",
"=",
"self",
".",
"board",
"[",
"row",
"]",
... | https://github.com/lightvector/KataGo/blob/20d34784703c5b4000643d3ccc43bb37d418f3b5/python/sgfmill/boards.py#L110-L129 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/run_config.py | python | _count_worker | (cluster_spec) | return (len(cluster_spec.as_dict().get('worker', [])) +
len(cluster_spec.as_dict().get('master', []))) if cluster_spec else 0 | Counts the number of workers in cluster_spec.
Workers with TaskType.WORKER and TaskType.MASTER are included in the return
value.
Args:
cluster_spec: a ClusterSpec instance that describes current deployment.
Returns:
The total number of eligible workers.
If 'cluster_spec' was None, then 0 is retu... | Counts the number of workers in cluster_spec. | [
"Counts",
"the",
"number",
"of",
"workers",
"in",
"cluster_spec",
"."
] | def _count_worker(cluster_spec):
"""Counts the number of workers in cluster_spec.
Workers with TaskType.WORKER and TaskType.MASTER are included in the return
value.
Args:
cluster_spec: a ClusterSpec instance that describes current deployment.
Returns:
The total number of eligible workers.
If '... | [
"def",
"_count_worker",
"(",
"cluster_spec",
")",
":",
"return",
"(",
"len",
"(",
"cluster_spec",
".",
"as_dict",
"(",
")",
".",
"get",
"(",
"'worker'",
",",
"[",
"]",
")",
")",
"+",
"len",
"(",
"cluster_spec",
".",
"as_dict",
"(",
")",
".",
"get",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/run_config.py#L428-L443 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/telnetlib.py | python | Telnet.read_very_eager | (self) | return self.read_very_lazy() | Read everything that's possible without blocking in I/O (eager).
Raise EOFError if connection closed and no cooked data
available. Return '' if no cooked data available otherwise.
Don't block unless in the midst of an IAC sequence. | Read everything that's possible without blocking in I/O (eager). | [
"Read",
"everything",
"that",
"s",
"possible",
"without",
"blocking",
"in",
"I",
"/",
"O",
"(",
"eager",
")",
"."
] | def read_very_eager(self):
"""Read everything that's possible without blocking in I/O (eager).
Raise EOFError if connection closed and no cooked data
available. Return '' if no cooked data available otherwise.
Don't block unless in the midst of an IAC sequence.
"""
sel... | [
"def",
"read_very_eager",
"(",
"self",
")",
":",
"self",
".",
"process_rawq",
"(",
")",
"while",
"not",
"self",
".",
"eof",
"and",
"self",
".",
"sock_avail",
"(",
")",
":",
"self",
".",
"fill_rawq",
"(",
")",
"self",
".",
"process_rawq",
"(",
")",
"r... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/telnetlib.py#L403-L415 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/linalg/misc.py | python | norm | (a, ord=None, axis=None, keepdims=False) | return np.linalg.norm(a, ord=ord) | Matrix or vector norm.
This function is able to return one of seven different matrix norms,
or one of an infinite number of vector norms (described below), depending
on the value of the ``ord`` parameter.
Parameters
----------
a : (M,) or (M, N) array_like
Input array. If `axis` is No... | Matrix or vector norm. | [
"Matrix",
"or",
"vector",
"norm",
"."
] | def norm(a, ord=None, axis=None, keepdims=False):
"""
Matrix or vector norm.
This function is able to return one of seven different matrix norms,
or one of an infinite number of vector norms (described below), depending
on the value of the ``ord`` parameter.
Parameters
----------
a : (... | [
"def",
"norm",
"(",
"a",
",",
"ord",
"=",
"None",
",",
"axis",
"=",
"None",
",",
"keepdims",
"=",
"False",
")",
":",
"# Differs from numpy only in non-finite handling and the use of blas.",
"a",
"=",
"np",
".",
"asarray_chkfinite",
"(",
"a",
")",
"# Only use opt... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/linalg/misc.py#L19-L174 | |
artyom-beilis/cppcms | 463a9a68e0bc15e2d01e8b8d72cc4fcc7f2b3264 | contrib/integration/session/python/cppcms.py | python | Session.get_exposed | (self,key) | return r!=0 | Check if the key's value is exposed in cookies | Check if the key's value is exposed in cookies | [
"Check",
"if",
"the",
"key",
"s",
"value",
"is",
"exposed",
"in",
"cookies"
] | def get_exposed(self,key):
"""Check if the key's value is exposed in cookies"""
r=Loader.capi.cppcms_capi_session_get_exposed(self.d,key)
self.check()
return r!=0; | [
"def",
"get_exposed",
"(",
"self",
",",
"key",
")",
":",
"r",
"=",
"Loader",
".",
"capi",
".",
"cppcms_capi_session_get_exposed",
"(",
"self",
".",
"d",
",",
"key",
")",
"self",
".",
"check",
"(",
")",
"return",
"r",
"!=",
"0"
] | https://github.com/artyom-beilis/cppcms/blob/463a9a68e0bc15e2d01e8b8d72cc4fcc7f2b3264/contrib/integration/session/python/cppcms.py#L276-L280 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/multiprocessing/pool.py | python | Pool.imap_unordered | (self, func, iterable, chunksize=1) | Like `imap()` method but ordering of results is arbitrary. | Like `imap()` method but ordering of results is arbitrary. | [
"Like",
"imap",
"()",
"method",
"but",
"ordering",
"of",
"results",
"is",
"arbitrary",
"."
] | def imap_unordered(self, func, iterable, chunksize=1):
'''
Like `imap()` method but ordering of results is arbitrary.
'''
if self._state != RUN:
raise ValueError("Pool not running")
if chunksize == 1:
result = IMapUnorderedIterator(self._cache)
... | [
"def",
"imap_unordered",
"(",
"self",
",",
"func",
",",
"iterable",
",",
"chunksize",
"=",
"1",
")",
":",
"if",
"self",
".",
"_state",
"!=",
"RUN",
":",
"raise",
"ValueError",
"(",
"\"Pool not running\"",
")",
"if",
"chunksize",
"==",
"1",
":",
"result",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/multiprocessing/pool.py#L327-L354 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pyrsistent/_pbag.py | python | PBag.update | (self, iterable) | return self | Update bag with all elements in iterable.
>>> s = pbag([1])
>>> s.update([1, 2])
pbag([1, 1, 2]) | Update bag with all elements in iterable. | [
"Update",
"bag",
"with",
"all",
"elements",
"in",
"iterable",
"."
] | def update(self, iterable):
"""
Update bag with all elements in iterable.
>>> s = pbag([1])
>>> s.update([1, 2])
pbag([1, 1, 2])
"""
if iterable:
return PBag(reduce(_add_to_counters, iterable, self._counts))
return self | [
"def",
"update",
"(",
"self",
",",
"iterable",
")",
":",
"if",
"iterable",
":",
"return",
"PBag",
"(",
"reduce",
"(",
"_add_to_counters",
",",
"iterable",
",",
"self",
".",
"_counts",
")",
")",
"return",
"self"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pyrsistent/_pbag.py#L52-L63 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | GetSngVec | (*args) | return _snap.GetSngVec(*args) | GetSngVec(PNGraph const & Graph, TFltV & LeftSV, TFltV & RightSV)
Parameters:
Graph: PNGraph const &
LeftSV: TFltV &
RightSV: TFltV &
GetSngVec(PNGraph const & Graph, int const & SngVecs, TFltV & SngValV, TVec< TFltV > & LeftSV,
TVec< TFltV > & RightSV)
Parameters:
... | GetSngVec(PNGraph const & Graph, TFltV & LeftSV, TFltV & RightSV) | [
"GetSngVec",
"(",
"PNGraph",
"const",
"&",
"Graph",
"TFltV",
"&",
"LeftSV",
"TFltV",
"&",
"RightSV",
")"
] | def GetSngVec(*args):
"""
GetSngVec(PNGraph const & Graph, TFltV & LeftSV, TFltV & RightSV)
Parameters:
Graph: PNGraph const &
LeftSV: TFltV &
RightSV: TFltV &
GetSngVec(PNGraph const & Graph, int const & SngVecs, TFltV & SngValV, TVec< TFltV > & LeftSV,
TVec< TFltV > & ... | [
"def",
"GetSngVec",
"(",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"GetSngVec",
"(",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L5565-L5585 | |
goldeneye-source/ges-code | 2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d | thirdparty/protobuf-2.3.0/python/google/protobuf/descriptor.py | python | MethodDescriptor.__init__ | (self, name, full_name, index, containing_service,
input_type, output_type, options=None) | The arguments are as described in the description of MethodDescriptor
attributes above.
Note that containing_service may be None, and may be set later if necessary. | The arguments are as described in the description of MethodDescriptor
attributes above. | [
"The",
"arguments",
"are",
"as",
"described",
"in",
"the",
"description",
"of",
"MethodDescriptor",
"attributes",
"above",
"."
] | def __init__(self, name, full_name, index, containing_service,
input_type, output_type, options=None):
"""The arguments are as described in the description of MethodDescriptor
attributes above.
Note that containing_service may be None, and may be set later if necessary.
"""
super(Met... | [
"def",
"__init__",
"(",
"self",
",",
"name",
",",
"full_name",
",",
"index",
",",
"containing_service",
",",
"input_type",
",",
"output_type",
",",
"options",
"=",
"None",
")",
":",
"super",
"(",
"MethodDescriptor",
",",
"self",
")",
".",
"__init__",
"(",
... | https://github.com/goldeneye-source/ges-code/blob/2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d/thirdparty/protobuf-2.3.0/python/google/protobuf/descriptor.py#L541-L554 | ||
gromacs/gromacs | 7dec3a3f99993cf5687a122de3e12de31c21c399 | python_packaging/src/gmxapi/simulation/read_tpr.py | python | RegisteredOperation.namespace | (self) | return 'gmxapi' | read_tpr is importable from the gmxapi module. | read_tpr is importable from the gmxapi module. | [
"read_tpr",
"is",
"importable",
"from",
"the",
"gmxapi",
"module",
"."
] | def namespace(self) -> str:
"""read_tpr is importable from the gmxapi module."""
return 'gmxapi' | [
"def",
"namespace",
"(",
"self",
")",
"->",
"str",
":",
"return",
"'gmxapi'"
] | https://github.com/gromacs/gromacs/blob/7dec3a3f99993cf5687a122de3e12de31c21c399/python_packaging/src/gmxapi/simulation/read_tpr.py#L282-L284 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | PyLocale.GetSingularString | (*args, **kwargs) | return _gdi_.PyLocale_GetSingularString(*args, **kwargs) | GetSingularString(self, String origString, String domain=EmptyString) -> String | GetSingularString(self, String origString, String domain=EmptyString) -> String | [
"GetSingularString",
"(",
"self",
"String",
"origString",
"String",
"domain",
"=",
"EmptyString",
")",
"-",
">",
"String"
] | def GetSingularString(*args, **kwargs):
"""GetSingularString(self, String origString, String domain=EmptyString) -> String"""
return _gdi_.PyLocale_GetSingularString(*args, **kwargs) | [
"def",
"GetSingularString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"PyLocale_GetSingularString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L3155-L3157 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/s3transfer/bandwidth.py | python | ConsumptionScheduler.__init__ | (self) | Schedules when to consume a desired amount | Schedules when to consume a desired amount | [
"Schedules",
"when",
"to",
"consume",
"a",
"desired",
"amount"
] | def __init__(self):
"""Schedules when to consume a desired amount"""
self._tokens_to_scheduled_consumption = {}
self._total_wait = 0 | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"_tokens_to_scheduled_consumption",
"=",
"{",
"}",
"self",
".",
"_total_wait",
"=",
"0"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/s3transfer/bandwidth.py#L289-L292 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/auibook.py | python | AuiNotebook.AddTabAreaButton | (self, id, location, normal_bitmap=wx.NullBitmap, disabled_bitmap=wx.NullBitmap, name="") | Adds a button in the tab area.
:param integer `id`: the button identifier. This can be one of the following:
============================== =================================
Button Identifier Description
============================== ================================... | Adds a button in the tab area. | [
"Adds",
"a",
"button",
"in",
"the",
"tab",
"area",
"."
] | def AddTabAreaButton(self, id, location, normal_bitmap=wx.NullBitmap, disabled_bitmap=wx.NullBitmap, name=""):
"""
Adds a button in the tab area.
:param integer `id`: the button identifier. This can be one of the following:
============================== =============================... | [
"def",
"AddTabAreaButton",
"(",
"self",
",",
"id",
",",
"location",
",",
"normal_bitmap",
"=",
"wx",
".",
"NullBitmap",
",",
"disabled_bitmap",
"=",
"wx",
".",
"NullBitmap",
",",
"name",
"=",
"\"\"",
")",
":",
"active_tabctrl",
"=",
"self",
".",
"GetActive... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/auibook.py#L5828-L5850 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/ninja.py | python | NinjaWriter.WriteSpec | (self, spec, config_name, generator_flags,
case_sensitive_filesystem) | return self.target | The main entry point for NinjaWriter: write the build rules for a spec.
Returns a Target object, which represents the output paths for this spec.
Returns None if there are no outputs (e.g. a settings-only 'none' type
target). | The main entry point for NinjaWriter: write the build rules for a spec. | [
"The",
"main",
"entry",
"point",
"for",
"NinjaWriter",
":",
"write",
"the",
"build",
"rules",
"for",
"a",
"spec",
"."
] | def WriteSpec(self, spec, config_name, generator_flags,
case_sensitive_filesystem):
"""The main entry point for NinjaWriter: write the build rules for a spec.
Returns a Target object, which represents the output paths for this spec.
Returns None if there are no outputs (e.g. a settings-only 'none' ty... | [
"def",
"WriteSpec",
"(",
"self",
",",
"spec",
",",
"config_name",
",",
"generator_flags",
",",
"case_sensitive_filesystem",
")",
":",
"self",
".",
"config_name",
"=",
"config_name",
"self",
".",
"name",
"=",
"spec",
"[",
"'target_name'",
"]",
"self",
".",
"t... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/ninja.py#L358-L460 | |
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/pybind/mgr/volumes/fs/operations/subvolume.py | python | open_subvol | (mgr, fs, vol_spec, group, subvolname, op_type) | open a subvolume. This API is to be used as a context manager.
:param fs: ceph filesystem handle
:param vol_spec: volume specification
:param group: group object for the subvolume
:param subvolname: subvolume name
:param op_type: operation type for which subvolume is being opened
:return: yield... | open a subvolume. This API is to be used as a context manager. | [
"open",
"a",
"subvolume",
".",
"This",
"API",
"is",
"to",
"be",
"used",
"as",
"a",
"context",
"manager",
"."
] | def open_subvol(mgr, fs, vol_spec, group, subvolname, op_type):
"""
open a subvolume. This API is to be used as a context manager.
:param fs: ceph filesystem handle
:param vol_spec: volume specification
:param group: group object for the subvolume
:param subvolname: subvolume name
:param op... | [
"def",
"open_subvol",
"(",
"mgr",
",",
"fs",
",",
"vol_spec",
",",
"group",
",",
"subvolname",
",",
"op_type",
")",
":",
"subvolume",
"=",
"loaded_subvolumes",
".",
"get_subvolume_object",
"(",
"mgr",
",",
"fs",
",",
"vol_spec",
",",
"group",
",",
"subvoln... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/volumes/fs/operations/subvolume.py#L61-L74 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.