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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/manifest.py | python | Manifest._glob_to_re | (self, pattern) | return pattern_re | Translate a shell-like glob pattern to a regular expression.
Return a string containing the regex. Differs from
'fnmatch.translate()' in that '*' does not match "special characters"
(which are platform-specific). | Translate a shell-like glob pattern to a regular expression. | [
"Translate",
"a",
"shell",
"-",
"like",
"glob",
"pattern",
"to",
"a",
"regular",
"expression",
"."
] | def _glob_to_re(self, pattern):
"""Translate a shell-like glob pattern to a regular expression.
Return a string containing the regex. Differs from
'fnmatch.translate()' in that '*' does not match "special characters"
(which are platform-specific).
"""
pattern_re = fnmat... | [
"def",
"_glob_to_re",
"(",
"self",
",",
"pattern",
")",
":",
"pattern_re",
"=",
"fnmatch",
".",
"translate",
"(",
"pattern",
")",
"# '?' and '*' in the glob pattern become '.' and '.*' in the RE, which",
"# IMHO is wrong -- '?' and '*' aren't supposed to match slash in Unix,",
"#... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/manifest.py#L372-L393 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/agilepy/lib_wx/ogleditor.py | python | Circles.pick_handle | (self, coord, detectwidth=0.1) | return np.concatenate((ids.reshape((len(ids), 1)), np.zeros((len(ids), 1), np.int)), 1) | Retuns list [ id, ind_vert] when handle is near coord,
otherwise [] | Retuns list [ id, ind_vert] when handle is near coord,
otherwise [] | [
"Retuns",
"list",
"[",
"id",
"ind_vert",
"]",
"when",
"handle",
"is",
"near",
"coord",
"otherwise",
"[]"
] | def pick_handle(self, coord, detectwidth=0.1):
"""
Retuns list [ id, ind_vert] when handle is near coord,
otherwise []
"""
if len(self) == 0:
return np.zeros((0, 2), np.int)
# print 'pick_handle',self.get_ident(),len(self)
dw = detectwidth**2
... | [
"def",
"pick_handle",
"(",
"self",
",",
"coord",
",",
"detectwidth",
"=",
"0.1",
")",
":",
"if",
"len",
"(",
"self",
")",
"==",
"0",
":",
"return",
"np",
".",
"zeros",
"(",
"(",
"0",
",",
"2",
")",
",",
"np",
".",
"int",
")",
"# print 'pick_handl... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/agilepy/lib_wx/ogleditor.py#L3723-L3744 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_windows.py | python | DirDialog.__init__ | (self, *args, **kwargs) | __init__(self, Window parent, String message=DirSelectorPromptStr,
String defaultPath=EmptyString, long style=DD_DEFAULT_STYLE,
Point pos=DefaultPosition, Size size=DefaultSize,
String name=DirDialogNameStr) -> DirDialog
Constructor. Use ShowModal method to show the dial... | __init__(self, Window parent, String message=DirSelectorPromptStr,
String defaultPath=EmptyString, long style=DD_DEFAULT_STYLE,
Point pos=DefaultPosition, Size size=DefaultSize,
String name=DirDialogNameStr) -> DirDialog | [
"__init__",
"(",
"self",
"Window",
"parent",
"String",
"message",
"=",
"DirSelectorPromptStr",
"String",
"defaultPath",
"=",
"EmptyString",
"long",
"style",
"=",
"DD_DEFAULT_STYLE",
"Point",
"pos",
"=",
"DefaultPosition",
"Size",
"size",
"=",
"DefaultSize",
"String"... | def __init__(self, *args, **kwargs):
"""
__init__(self, Window parent, String message=DirSelectorPromptStr,
String defaultPath=EmptyString, long style=DD_DEFAULT_STYLE,
Point pos=DefaultPosition, Size size=DefaultSize,
String name=DirDialogNameStr) -> DirDialog
... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_windows_",
".",
"DirDialog_swiginit",
"(",
"self",
",",
"_windows_",
".",
"new_DirDialog",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"self",
".",
"_setO... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L3058-L3068 | ||
CaoWGG/TensorRT-YOLOv4 | 4d7c2edce99e8794a4cb4ea3540d51ce91158a36 | onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py | python | Cursor.mangled_name | (self) | return self._mangled_name | Return the mangled name for the entity referenced by this cursor. | Return the mangled name for the entity referenced by this cursor. | [
"Return",
"the",
"mangled",
"name",
"for",
"the",
"entity",
"referenced",
"by",
"this",
"cursor",
"."
] | def mangled_name(self):
"""Return the mangled name for the entity referenced by this cursor."""
if not hasattr(self, '_mangled_name'):
self._mangled_name = conf.lib.clang_Cursor_getMangling(self)
return self._mangled_name | [
"def",
"mangled_name",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_mangled_name'",
")",
":",
"self",
".",
"_mangled_name",
"=",
"conf",
".",
"lib",
".",
"clang_Cursor_getMangling",
"(",
"self",
")",
"return",
"self",
".",
"_mangled_... | https://github.com/CaoWGG/TensorRT-YOLOv4/blob/4d7c2edce99e8794a4cb4ea3540d51ce91158a36/onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py#L1420-L1425 | |
LLNL/lbann | 26083e6c86050302ce33148aea70f62e61cacb92 | python/lbann/contrib/olcf/systems.py | python | cores_per_node | (system = system()) | return _system_params[system].cores_per_node | Number of CPU cores per node. | Number of CPU cores per node. | [
"Number",
"of",
"CPU",
"cores",
"per",
"node",
"."
] | def cores_per_node(system = system()):
"""Number of CPU cores per node."""
if not is_olcf_system(system):
raise RuntimeError('unknown system (' + system + ')')
return _system_params[system].cores_per_node | [
"def",
"cores_per_node",
"(",
"system",
"=",
"system",
"(",
")",
")",
":",
"if",
"not",
"is_olcf_system",
"(",
"system",
")",
":",
"raise",
"RuntimeError",
"(",
"'unknown system ('",
"+",
"system",
"+",
"')'",
")",
"return",
"_system_params",
"[",
"system",
... | https://github.com/LLNL/lbann/blob/26083e6c86050302ce33148aea70f62e61cacb92/python/lbann/contrib/olcf/systems.py#L50-L54 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/setup.py | python | GenerateSrcPackageFiles | () | return data | Generate the list of files to include in a source package dist/install | Generate the list of files to include in a source package dist/install | [
"Generate",
"the",
"list",
"of",
"files",
"to",
"include",
"in",
"a",
"source",
"package",
"dist",
"/",
"install"
] | def GenerateSrcPackageFiles():
"""Generate the list of files to include in a source package dist/install"""
data = [ "src/*.py", "src/syntax/*.py", "src/autocomp/*.py",
"src/eclib/*.py", "docs/*.txt", "pixmaps/*.png", "pixmaps/*.ico",
"src/ebmlib/*.py",
"ekeys/*.ekeys",
... | [
"def",
"GenerateSrcPackageFiles",
"(",
")",
":",
"data",
"=",
"[",
"\"src/*.py\"",
",",
"\"src/syntax/*.py\"",
",",
"\"src/autocomp/*.py\"",
",",
"\"src/eclib/*.py\"",
",",
"\"docs/*.txt\"",
",",
"\"pixmaps/*.png\"",
",",
"\"pixmaps/*.ico\"",
",",
"\"src/ebmlib/*.py\"",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/setup.py#L161-L199 | |
gromacs/gromacs | 7dec3a3f99993cf5687a122de3e12de31c21c399 | python_packaging/src/gmxapi/operation.py | python | pop_context | () | return __current_context.pop() | Exit the current Context by popping it from the stack. | Exit the current Context by popping it from the stack. | [
"Exit",
"the",
"current",
"Context",
"by",
"popping",
"it",
"from",
"the",
"stack",
"."
] | def pop_context() -> Context:
"""Exit the current Context by popping it from the stack."""
return __current_context.pop() | [
"def",
"pop_context",
"(",
")",
"->",
"Context",
":",
"return",
"__current_context",
".",
"pop",
"(",
")"
] | https://github.com/gromacs/gromacs/blob/7dec3a3f99993cf5687a122de3e12de31c21c399/python_packaging/src/gmxapi/operation.py#L2825-L2827 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/misc_util.py | python | Configuration.add_define_macros | (self, macros) | Add define macros to configuration
Add the given sequence of macro name and value duples to the beginning
of the define_macros list This list will be visible to all extension
modules of the current package. | Add define macros to configuration | [
"Add",
"define",
"macros",
"to",
"configuration"
] | def add_define_macros(self, macros):
"""Add define macros to configuration
Add the given sequence of macro name and value duples to the beginning
of the define_macros list This list will be visible to all extension
modules of the current package.
"""
dist = self.get_dist... | [
"def",
"add_define_macros",
"(",
"self",
",",
"macros",
")",
":",
"dist",
"=",
"self",
".",
"get_distribution",
"(",
")",
"if",
"dist",
"is",
"not",
"None",
":",
"if",
"not",
"hasattr",
"(",
"dist",
",",
"'define_macros'",
")",
":",
"dist",
".",
"defin... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/misc_util.py#L1336-L1349 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/threading.py | python | _Semaphore.acquire | (self, blocking=1) | return rc | Acquire a semaphore, decrementing the internal counter by one.
When invoked without arguments: if the internal counter is larger than
zero on entry, decrement it by one and return immediately. If it is zero
on entry, block, waiting until some other thread has called release() to
make it... | Acquire a semaphore, decrementing the internal counter by one. | [
"Acquire",
"a",
"semaphore",
"decrementing",
"the",
"internal",
"counter",
"by",
"one",
"."
] | def acquire(self, blocking=1):
"""Acquire a semaphore, decrementing the internal counter by one.
When invoked without arguments: if the internal counter is larger than
zero on entry, decrement it by one and return immediately. If it is zero
on entry, block, waiting until some other thre... | [
"def",
"acquire",
"(",
"self",
",",
"blocking",
"=",
"1",
")",
":",
"rc",
"=",
"False",
"with",
"self",
".",
"__cond",
":",
"while",
"self",
".",
"__value",
"==",
"0",
":",
"if",
"not",
"blocking",
":",
"break",
"if",
"__debug__",
":",
"self",
".",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/threading.py#L439-L474 | |
qgis/QGIS | 15a77662d4bb712184f6aa60d0bd663010a76a75 | python/plugins/db_manager/db_plugins/oracle/connector.py | python | OracleDBConnector.getTableRowEstimation | (self, table) | Find the estimated number of rows of a table. | Find the estimated number of rows of a table. | [
"Find",
"the",
"estimated",
"number",
"of",
"rows",
"of",
"a",
"table",
"."
] | def getTableRowEstimation(self, table):
""" Find the estimated number of rows of a table. """
schema, tablename = self.getSchemaTableName(table)
prefix = u"ALL" if schema else u"USER"
where = u"AND OWNER = {}".format(
self.quoteString(schema)) if schema else u""
sql ... | [
"def",
"getTableRowEstimation",
"(",
"self",
",",
"table",
")",
":",
"schema",
",",
"tablename",
"=",
"self",
".",
"getSchemaTableName",
"(",
"table",
")",
"prefix",
"=",
"u\"ALL\"",
"if",
"schema",
"else",
"u\"USER\"",
"where",
"=",
"u\"AND OWNER = {}\"",
"."... | https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/db_manager/db_plugins/oracle/connector.py#L821-L841 | ||
ideawu/ssdb-rocks | a3cbb322cafb2f493252829c608e2239df98c9ac | deps/cpy/antlr3/tree.py | python | RewriteRuleElementStream.toTree | (self, el) | return el | Ensure stream emits trees; tokens must be converted to AST nodes.
AST nodes can be passed through unmolested. | Ensure stream emits trees; tokens must be converted to AST nodes.
AST nodes can be passed through unmolested. | [
"Ensure",
"stream",
"emits",
"trees",
";",
"tokens",
"must",
"be",
"converted",
"to",
"AST",
"nodes",
".",
"AST",
"nodes",
"can",
"be",
"passed",
"through",
"unmolested",
"."
] | def toTree(self, el):
"""
Ensure stream emits trees; tokens must be converted to AST nodes.
AST nodes can be passed through unmolested.
"""
return el | [
"def",
"toTree",
"(",
"self",
",",
"el",
")",
":",
"return",
"el"
] | https://github.com/ideawu/ssdb-rocks/blob/a3cbb322cafb2f493252829c608e2239df98c9ac/deps/cpy/antlr3/tree.py#L2315-L2321 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/stc.py | python | StyledTextCtrl.CreateDocument | (*args, **kwargs) | return _stc.StyledTextCtrl_CreateDocument(*args, **kwargs) | CreateDocument(self) -> void
Create a new document object.
Starts with reference count of 1 and not selected into editor. | CreateDocument(self) -> void | [
"CreateDocument",
"(",
"self",
")",
"-",
">",
"void"
] | def CreateDocument(*args, **kwargs):
"""
CreateDocument(self) -> void
Create a new document object.
Starts with reference count of 1 and not selected into editor.
"""
return _stc.StyledTextCtrl_CreateDocument(*args, **kwargs) | [
"def",
"CreateDocument",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_CreateDocument",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L4989-L4996 | |
alexgkendall/caffe-posenet | 62aafbd7c45df91acdba14f5d1406d8295c2bc6f | scripts/cpp_lint.py | python | GetLineWidth | (line) | Determines the width of the line in column positions.
Args:
line: A string, which may be a Unicode string.
Returns:
The width of the line in column positions, accounting for Unicode
combining characters and wide characters. | Determines the width of the line in column positions. | [
"Determines",
"the",
"width",
"of",
"the",
"line",
"in",
"column",
"positions",
"."
] | def GetLineWidth(line):
"""Determines the width of the line in column positions.
Args:
line: A string, which may be a Unicode string.
Returns:
The width of the line in column positions, accounting for Unicode
combining characters and wide characters.
"""
if isinstance(line, unicode):
width =... | [
"def",
"GetLineWidth",
"(",
"line",
")",
":",
"if",
"isinstance",
"(",
"line",
",",
"unicode",
")",
":",
"width",
"=",
"0",
"for",
"uc",
"in",
"unicodedata",
".",
"normalize",
"(",
"'NFC'",
",",
"line",
")",
":",
"if",
"unicodedata",
".",
"east_asian_w... | https://github.com/alexgkendall/caffe-posenet/blob/62aafbd7c45df91acdba14f5d1406d8295c2bc6f/scripts/cpp_lint.py#L3437-L3456 | ||
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/scons/khEnvironment.py | python | DefineProtocolBufferBuilder | (env) | SCons entry point for this tool.
Args:
env: Environment to modify. | SCons entry point for this tool. | [
"SCons",
"entry",
"point",
"for",
"this",
"tool",
"."
] | def DefineProtocolBufferBuilder(env):
# Note: SCons requires the use of this name, which fails gpylint.
"""SCons entry point for this tool.
Args:
env: Environment to modify.
"""
# All protocol buffer generated files will be placed in the export directory
# under protobuf.
# To include them, the call... | [
"def",
"DefineProtocolBufferBuilder",
"(",
"env",
")",
":",
"# Note: SCons requires the use of this name, which fails gpylint.",
"# All protocol buffer generated files will be placed in the export directory",
"# under protobuf.",
"# To include them, the caller need only include \"protobuf/xxx.pb.h... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/scons/khEnvironment.py#L721-L751 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/mantid/simpleapi.py | python | EvaluateFunction | (*args, **kwargs) | return None | This function evaluates a function on a data set.
The data set is defined in a way similar to Fit algorithm.
Example:
EvaluateFunction(Function='name=LinearBackground,A0=0.3', InputWorkspace=dataWS',
StartX='0.05',EndX='1.0',Output="Z1") | This function evaluates a function on a data set.
The data set is defined in a way similar to Fit algorithm. | [
"This",
"function",
"evaluates",
"a",
"function",
"on",
"a",
"data",
"set",
".",
"The",
"data",
"set",
"is",
"defined",
"in",
"a",
"way",
"similar",
"to",
"Fit",
"algorithm",
"."
] | def EvaluateFunction(*args, **kwargs):
"""
This function evaluates a function on a data set.
The data set is defined in a way similar to Fit algorithm.
Example:
EvaluateFunction(Function='name=LinearBackground,A0=0.3', InputWorkspace=dataWS',
StartX='0.05',EndX='1.0',Output="Z1")
""... | [
"def",
"EvaluateFunction",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"None"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/mantid/simpleapi.py#L365-L374 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/dashboard/dashboard/edit_site_config.py | python | EditSiteConfigHandler.get | (self) | Renders the UI with the form. | Renders the UI with the form. | [
"Renders",
"the",
"UI",
"with",
"the",
"form",
"."
] | def get(self):
"""Renders the UI with the form."""
key = self.request.get('key')
if not key:
self.RenderHtml('edit_site_config.html', {})
return
value = stored_object.Get(key)
external_value = namespaced_stored_object.GetExternal(key)
internal_value = namespaced_stored_object.Get(ke... | [
"def",
"get",
"(",
"self",
")",
":",
"key",
"=",
"self",
".",
"request",
".",
"get",
"(",
"'key'",
")",
"if",
"not",
"key",
":",
"self",
".",
"RenderHtml",
"(",
"'edit_site_config.html'",
",",
"{",
"}",
")",
"return",
"value",
"=",
"stored_object",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/edit_site_config.py#L49-L64 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/platform.py | python | _platform | (*args) | return platform | Helper to format the platform string in a filename
compatible format e.g. "system-version-machine". | Helper to format the platform string in a filename
compatible format e.g. "system-version-machine". | [
"Helper",
"to",
"format",
"the",
"platform",
"string",
"in",
"a",
"filename",
"compatible",
"format",
"e",
".",
"g",
".",
"system",
"-",
"version",
"-",
"machine",
"."
] | def _platform(*args):
""" Helper to format the platform string in a filename
compatible format e.g. "system-version-machine".
"""
# Format the platform string
platform = string.join(
map(string.strip,
filter(len, args)),
'-')
# Cleanup some possible filename obs... | [
"def",
"_platform",
"(",
"*",
"args",
")",
":",
"# Format the platform string",
"platform",
"=",
"string",
".",
"join",
"(",
"map",
"(",
"string",
".",
"strip",
",",
"filter",
"(",
"len",
",",
"args",
")",
")",
",",
"'-'",
")",
"# Cleanup some possible fil... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/platform.py#L922-L956 | |
s9xie/DSN | 065e49898d239f5c96be558616b2556eabc50351 | scripts/cpp_lint.py | python | Error | (filename, linenum, category, confidence, message) | Logs the fact we've found a lint error.
We log where the error was found, and also our confidence in the error,
that is, how certain we are this is a legitimate style regression, and
not a misidentification or a use that's sometimes justified.
False positives can be suppressed by the use of
"cpplint(categor... | Logs the fact we've found a lint error. | [
"Logs",
"the",
"fact",
"we",
"ve",
"found",
"a",
"lint",
"error",
"."
] | def Error(filename, linenum, category, confidence, message):
"""Logs the fact we've found a lint error.
We log where the error was found, and also our confidence in the error,
that is, how certain we are this is a legitimate style regression, and
not a misidentification or a use that's sometimes justified.
... | [
"def",
"Error",
"(",
"filename",
",",
"linenum",
",",
"category",
",",
"confidence",
",",
"message",
")",
":",
"if",
"_ShouldPrintError",
"(",
"category",
",",
"confidence",
",",
"linenum",
")",
":",
"_cpplint_state",
".",
"IncrementErrorCount",
"(",
"category... | https://github.com/s9xie/DSN/blob/065e49898d239f5c96be558616b2556eabc50351/scripts/cpp_lint.py#L983-L1015 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/randomimpl.py | python | get_rnd_shuffle | (builder) | return fn | Get the internal function to shuffle the MT taste. | Get the internal function to shuffle the MT taste. | [
"Get",
"the",
"internal",
"function",
"to",
"shuffle",
"the",
"MT",
"taste",
"."
] | def get_rnd_shuffle(builder):
"""
Get the internal function to shuffle the MT taste.
"""
fnty = ir.FunctionType(ir.VoidType(), (rnd_state_ptr_t,))
fn = builder.function.module.get_or_insert_function(fnty, "numba_rnd_shuffle")
fn.args[0].add_attribute("nocapture")
return fn | [
"def",
"get_rnd_shuffle",
"(",
"builder",
")",
":",
"fnty",
"=",
"ir",
".",
"FunctionType",
"(",
"ir",
".",
"VoidType",
"(",
")",
",",
"(",
"rnd_state_ptr_t",
",",
")",
")",
"fn",
"=",
"builder",
".",
"function",
".",
"module",
".",
"get_or_insert_functi... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/randomimpl.py#L96-L103 | |
danbev/learning-v8 | 2b3e17f59c5c79c61f1ae48de953626535312f32 | lldb_commands.py | python | jld | (debugger, param, *args) | Print a v8 LayoutDescriptor object | Print a v8 LayoutDescriptor object | [
"Print",
"a",
"v8",
"LayoutDescriptor",
"object"
] | def jld(debugger, param, *args):
"""Print a v8 LayoutDescriptor object"""
ptr_arg_cmd(debugger, 'jld', param,
"_v8_internal_Print_LayoutDescriptor({})") | [
"def",
"jld",
"(",
"debugger",
",",
"param",
",",
"*",
"args",
")",
":",
"ptr_arg_cmd",
"(",
"debugger",
",",
"'jld'",
",",
"param",
",",
"\"_v8_internal_Print_LayoutDescriptor({})\"",
")"
] | https://github.com/danbev/learning-v8/blob/2b3e17f59c5c79c61f1ae48de953626535312f32/lldb_commands.py#L66-L69 | ||
cocos2d/cocos2d-x | 90f6542cf7fb081335f04e474b880d7ce8c445a1 | download-deps.py | python | CocosZipInstaller.unpack_zipfile | (self, extract_dir) | Unpack zip `filename` to `extract_dir`
Raises ``UnrecognizedFormat`` if `filename` is not a zipfile (as determined
by ``zipfile.is_zipfile()``). | Unpack zip `filename` to `extract_dir` | [
"Unpack",
"zip",
"filename",
"to",
"extract_dir"
] | def unpack_zipfile(self, extract_dir):
"""Unpack zip `filename` to `extract_dir`
Raises ``UnrecognizedFormat`` if `filename` is not a zipfile (as determined
by ``zipfile.is_zipfile()``).
"""
if not zipfile.is_zipfile(self._filename):
raise UnrecognizedFormat("%s is ... | [
"def",
"unpack_zipfile",
"(",
"self",
",",
"extract_dir",
")",
":",
"if",
"not",
"zipfile",
".",
"is_zipfile",
"(",
"self",
".",
"_filename",
")",
":",
"raise",
"UnrecognizedFormat",
"(",
"\"%s is not a zip file\"",
"%",
"(",
"self",
".",
"_filename",
")",
"... | https://github.com/cocos2d/cocos2d-x/blob/90f6542cf7fb081335f04e474b880d7ce8c445a1/download-deps.py#L203-L243 | ||
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/atoms/norm_inf.py | python | norm_inf.is_atom_convex | (self) | return True | Is the atom convex? | Is the atom convex? | [
"Is",
"the",
"atom",
"convex?"
] | def is_atom_convex(self) -> bool:
"""Is the atom convex?
"""
return True | [
"def",
"is_atom_convex",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"True"
] | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/norm_inf.py#L46-L49 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/Tools/glib2.py | python | process_settings | (self) | Process the schema files in *settings_schema_files* to create :py:class:`waflib.Tools.glib2.glib_mkenums` instances. The
same files are validated through :py:class:`waflib.Tools.glib2.glib_validate_schema` tasks. | Process the schema files in *settings_schema_files* to create :py:class:`waflib.Tools.glib2.glib_mkenums` instances. The
same files are validated through :py:class:`waflib.Tools.glib2.glib_validate_schema` tasks. | [
"Process",
"the",
"schema",
"files",
"in",
"*",
"settings_schema_files",
"*",
"to",
"create",
":",
"py",
":",
"class",
":",
"waflib",
".",
"Tools",
".",
"glib2",
".",
"glib_mkenums",
"instances",
".",
"The",
"same",
"files",
"are",
"validated",
"through",
... | def process_settings(self):
"""
Process the schema files in *settings_schema_files* to create :py:class:`waflib.Tools.glib2.glib_mkenums` instances. The
same files are validated through :py:class:`waflib.Tools.glib2.glib_validate_schema` tasks.
"""
enums_tgt_node = []
install_files = []
settings_schema_files =... | [
"def",
"process_settings",
"(",
"self",
")",
":",
"enums_tgt_node",
"=",
"[",
"]",
"install_files",
"=",
"[",
"]",
"settings_schema_files",
"=",
"getattr",
"(",
"self",
",",
"'settings_schema_files'",
",",
"[",
"]",
")",
"if",
"settings_schema_files",
"and",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Tools/glib2.py#L265-L333 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/cudadrv/devices.py | python | require_context | (fn) | return _require_cuda_context | A decorator that ensures a CUDA context is available when *fn* is executed.
Note: The function *fn* cannot switch CUDA-context. | A decorator that ensures a CUDA context is available when *fn* is executed. | [
"A",
"decorator",
"that",
"ensures",
"a",
"CUDA",
"context",
"is",
"available",
"when",
"*",
"fn",
"*",
"is",
"executed",
"."
] | def require_context(fn):
"""
A decorator that ensures a CUDA context is available when *fn* is executed.
Note: The function *fn* cannot switch CUDA-context.
"""
@functools.wraps(fn)
def _require_cuda_context(*args, **kws):
with _runtime.ensure_context():
return fn(*args, **k... | [
"def",
"require_context",
"(",
"fn",
")",
":",
"@",
"functools",
".",
"wraps",
"(",
"fn",
")",
"def",
"_require_cuda_context",
"(",
"*",
"args",
",",
"*",
"*",
"kws",
")",
":",
"with",
"_runtime",
".",
"ensure_context",
"(",
")",
":",
"return",
"fn",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/cudadrv/devices.py#L216-L227 | |
amd/OpenCL-caffe | 638543108517265366c18ae5821f3096cf5cf34a | scripts/cpp_lint.py | python | IsBlankLine | (line) | return not line or line.isspace() | Returns true if the given line is blank.
We consider a line to be blank if the line is empty or consists of
only white spaces.
Args:
line: A line of a string.
Returns:
True, if the given line is blank. | Returns true if the given line is blank. | [
"Returns",
"true",
"if",
"the",
"given",
"line",
"is",
"blank",
"."
] | def IsBlankLine(line):
"""Returns true if the given line is blank.
We consider a line to be blank if the line is empty or consists of
only white spaces.
Args:
line: A line of a string.
Returns:
True, if the given line is blank.
"""
return not line or line.isspace() | [
"def",
"IsBlankLine",
"(",
"line",
")",
":",
"return",
"not",
"line",
"or",
"line",
".",
"isspace",
"(",
")"
] | https://github.com/amd/OpenCL-caffe/blob/638543108517265366c18ae5821f3096cf5cf34a/scripts/cpp_lint.py#L2369-L2381 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/gluon/probability/distributions/binomial.py | python | Binomial.logit | (self) | return prob2logit(self.prob, True) | Get the log-odds of sampling `1`.
Returns
-------
Tensor
Parameter tensor. | Get the log-odds of sampling `1`. | [
"Get",
"the",
"log",
"-",
"odds",
"of",
"sampling",
"1",
"."
] | def logit(self):
"""Get the log-odds of sampling `1`.
Returns
-------
Tensor
Parameter tensor.
"""
# pylint: disable=method-hidden
return prob2logit(self.prob, True) | [
"def",
"logit",
"(",
"self",
")",
":",
"# pylint: disable=method-hidden",
"return",
"prob2logit",
"(",
"self",
".",
"prob",
",",
"True",
")"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/gluon/probability/distributions/binomial.py#L78-L87 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/Inelastic/CrystalField/fitting.py | python | CrystalField.getHeatCapacity | (self, workspace=None, ws_index=0) | return self._getPhysProp(PhysicalProperties('Cv'), workspace, ws_index) | Get the heat cacpacity calculated with the current crystal field parameters
Examples:
cf.getHeatCapacity() # Returns the heat capacity from 1 < T < 300 K in 1 K steps
cf.getHeatCapacity(ws) # Returns the heat capacity with temperatures given by ws.
cf.getHeatCapacity(ws... | Get the heat cacpacity calculated with the current crystal field parameters | [
"Get",
"the",
"heat",
"cacpacity",
"calculated",
"with",
"the",
"current",
"crystal",
"field",
"parameters"
] | def getHeatCapacity(self, workspace=None, ws_index=0):
"""
Get the heat cacpacity calculated with the current crystal field parameters
Examples:
cf.getHeatCapacity() # Returns the heat capacity from 1 < T < 300 K in 1 K steps
cf.getHeatCapacity(ws) # Returns the hea... | [
"def",
"getHeatCapacity",
"(",
"self",
",",
"workspace",
"=",
"None",
",",
"ws_index",
"=",
"0",
")",
":",
"return",
"self",
".",
"_getPhysProp",
"(",
"PhysicalProperties",
"(",
"'Cv'",
")",
",",
"workspace",
",",
"ws_index",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Inelastic/CrystalField/fitting.py#L769-L784 | |
grpc/grpc | 27bc6fe7797e43298dc931b96dc57322d0852a9f | src/python/grpcio/grpc/__init__.py | python | channel_ready_future | (channel) | return _utilities.channel_ready_future(channel) | Creates a Future that tracks when a Channel is ready.
Cancelling the Future does not affect the channel's state machine.
It merely decouples the Future from channel state machine.
Args:
channel: A Channel object.
Returns:
A Future object that matures when the channel connectivity is
... | Creates a Future that tracks when a Channel is ready. | [
"Creates",
"a",
"Future",
"that",
"tracks",
"when",
"a",
"Channel",
"is",
"ready",
"."
] | def channel_ready_future(channel):
"""Creates a Future that tracks when a Channel is ready.
Cancelling the Future does not affect the channel's state machine.
It merely decouples the Future from channel state machine.
Args:
channel: A Channel object.
Returns:
A Future object that matu... | [
"def",
"channel_ready_future",
"(",
"channel",
")",
":",
"from",
"grpc",
"import",
"_utilities",
"# pylint: disable=cyclic-import",
"return",
"_utilities",
".",
"channel_ready_future",
"(",
"channel",
")"
] | https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/grpc/__init__.py#L1945-L1959 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/linalg_ops.py | python | _BatchSelfAdjointEigShape | (op) | return [out_shape] | Shape function for batch self-adjoint eigensolver op. | Shape function for batch self-adjoint eigensolver op. | [
"Shape",
"function",
"for",
"batch",
"self",
"-",
"adjoint",
"eigensolver",
"op",
"."
] | def _BatchSelfAdjointEigShape(op):
"""Shape function for batch self-adjoint eigensolver op."""
input_shape = op.inputs[0].get_shape().with_rank_at_least(2)
# The matrices in the batch must be square.
input_shape[-1].assert_is_compatible_with(input_shape[-2])
dlist = input_shape.dims
dlist[-2] += 1
out_sha... | [
"def",
"_BatchSelfAdjointEigShape",
"(",
"op",
")",
":",
"input_shape",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
".",
"get_shape",
"(",
")",
".",
"with_rank_at_least",
"(",
"2",
")",
"# The matrices in the batch must be square.",
"input_shape",
"[",
"-",
"1",
... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/linalg_ops.py#L89-L97 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_windows.py | python | StandardDialogLayoutAdapter.FitWithScrolling | (*args, **kwargs) | return _windows_.StandardDialogLayoutAdapter_FitWithScrolling(*args, **kwargs) | FitWithScrolling(self, Dialog dialog, ScrolledWindow scrolledWindow) -> bool | FitWithScrolling(self, Dialog dialog, ScrolledWindow scrolledWindow) -> bool | [
"FitWithScrolling",
"(",
"self",
"Dialog",
"dialog",
"ScrolledWindow",
"scrolledWindow",
")",
"-",
">",
"bool"
] | def FitWithScrolling(*args, **kwargs):
"""FitWithScrolling(self, Dialog dialog, ScrolledWindow scrolledWindow) -> bool"""
return _windows_.StandardDialogLayoutAdapter_FitWithScrolling(*args, **kwargs) | [
"def",
"FitWithScrolling",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"StandardDialogLayoutAdapter_FitWithScrolling",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L1014-L1016 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/webkit.py | python | WebKitStateChangedEvent.SetState | (*args, **kwargs) | return _webkit.WebKitStateChangedEvent_SetState(*args, **kwargs) | SetState(self, int state) | SetState(self, int state) | [
"SetState",
"(",
"self",
"int",
"state",
")"
] | def SetState(*args, **kwargs):
"""SetState(self, int state)"""
return _webkit.WebKitStateChangedEvent_SetState(*args, **kwargs) | [
"def",
"SetState",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_webkit",
".",
"WebKitStateChangedEvent_SetState",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/webkit.py#L242-L244 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/telemetry/record_wpr.py | python | _GetSubclasses | (base_dir, cls) | return discover.DiscoverClasses(base_dir, base_dir, cls,
index_by_class_name=True) | Returns all subclasses of |cls| in |base_dir|.
Args:
cls: a class
Returns:
dict of {underscored_class_name: benchmark class} | Returns all subclasses of |cls| in |base_dir|. | [
"Returns",
"all",
"subclasses",
"of",
"|cls|",
"in",
"|base_dir|",
"."
] | def _GetSubclasses(base_dir, cls):
"""Returns all subclasses of |cls| in |base_dir|.
Args:
cls: a class
Returns:
dict of {underscored_class_name: benchmark class}
"""
return discover.DiscoverClasses(base_dir, base_dir, cls,
index_by_class_name=True) | [
"def",
"_GetSubclasses",
"(",
"base_dir",
",",
"cls",
")",
":",
"return",
"discover",
".",
"DiscoverClasses",
"(",
"base_dir",
",",
"base_dir",
",",
"cls",
",",
"index_by_class_name",
"=",
"True",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/record_wpr.py#L68-L78 | |
psnonis/FinBERT | c0c555d833a14e2316a3701e59c0b5156f804b4e | bert/run_classifier.py | python | ColaProcessor.get_labels | (self) | return ["0", "1"] | See base class. | See base class. | [
"See",
"base",
"class",
"."
] | def get_labels(self):
"""See base class."""
return ["0", "1"] | [
"def",
"get_labels",
"(",
"self",
")",
":",
"return",
"[",
"\"0\"",
",",
"\"1\"",
"]"
] | https://github.com/psnonis/FinBERT/blob/c0c555d833a14e2316a3701e59c0b5156f804b4e/bert/run_classifier.py#L354-L356 | |
Illumina/strelka | d7377443b62319f7c7bd70c241c4b2df3459e29a | src/python/scoringModelTraining/somatic/lib/evs/features/VcfFeatureSet.py | python | VcfFeatureSet.collectCore | (self, vcfname, headerKey = None) | return pandas.DataFrame(records, columns=cols) | Return a data frame with features collected from the given VCF
If headerKey is provided, then use this header value to extract labels
for the INFO EVSF feature tag | Return a data frame with features collected from the given VCF | [
"Return",
"a",
"data",
"frame",
"with",
"features",
"collected",
"from",
"the",
"given",
"VCF"
] | def collectCore(self, vcfname, headerKey = None):
"""
Return a data frame with features collected from the given VCF
If headerKey is provided, then use this header value to extract labels
for the INFO EVSF feature tag
"""
def isNucleotide(nucString):
"""
... | [
"def",
"collectCore",
"(",
"self",
",",
"vcfname",
",",
"headerKey",
"=",
"None",
")",
":",
"def",
"isNucleotide",
"(",
"nucString",
")",
":",
"\"\"\"\n Return True if nucString is a single nucleotide, False otherwise.\n \"\"\"",
"return",
"(",
"nucStr... | https://github.com/Illumina/strelka/blob/d7377443b62319f7c7bd70c241c4b2df3459e29a/src/python/scoringModelTraining/somatic/lib/evs/features/VcfFeatureSet.py#L28-L125 | |
apache/arrow | af33dd1157eb8d7d9bfac25ebf61445b793b7943 | dev/archery/archery/bot.py | python | actions | (ctx) | Ursabot | Ursabot | [
"Ursabot"
] | def actions(ctx):
"""Ursabot"""
ctx.ensure_object(dict) | [
"def",
"actions",
"(",
"ctx",
")",
":",
"ctx",
".",
"ensure_object",
"(",
"dict",
")"
] | https://github.com/apache/arrow/blob/af33dd1157eb8d7d9bfac25ebf61445b793b7943/dev/archery/archery/bot.py#L174-L176 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/all_reduce/python/all_reduce.py | python | _strip_padding | (tensors, pad_len) | return stripped | Strip the suffix padding added by _padded_split.
Args:
tensors: list of T @{tf.Tensor} of identical length 1D tensors.
pad_len: number of elements to be stripped from the end of each tensor.
Returns:
list of T @{tf.Tensor} which are the stripped inputs.
Raises:
ValueError: tensors must be a non... | Strip the suffix padding added by _padded_split. | [
"Strip",
"the",
"suffix",
"padding",
"added",
"by",
"_padded_split",
"."
] | def _strip_padding(tensors, pad_len):
"""Strip the suffix padding added by _padded_split.
Args:
tensors: list of T @{tf.Tensor} of identical length 1D tensors.
pad_len: number of elements to be stripped from the end of each tensor.
Returns:
list of T @{tf.Tensor} which are the stripped inputs.
Ra... | [
"def",
"_strip_padding",
"(",
"tensors",
",",
"pad_len",
")",
":",
"if",
"not",
"tensors",
":",
"raise",
"ValueError",
"(",
"\"tensors cannot be empty\"",
")",
"shape",
"=",
"tensors",
"[",
"0",
"]",
".",
"shape",
"if",
"len",
"(",
"shape",
")",
">",
"1"... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/all_reduce/python/all_reduce.py#L131-L157 | |
mhammond/pywin32 | 44afd86ba8485194df93234639243252deeb40d5 | Pythonwin/pywin/framework/scriptutils.py | python | GetActiveEditorDocument | () | return (None, None) | Returns the active editor document and view, or (None,None) if no
active document or its not an editor document. | Returns the active editor document and view, or (None,None) if no
active document or its not an editor document. | [
"Returns",
"the",
"active",
"editor",
"document",
"and",
"view",
"or",
"(",
"None",
"None",
")",
"if",
"no",
"active",
"document",
"or",
"its",
"not",
"an",
"editor",
"document",
"."
] | def GetActiveEditorDocument():
"""Returns the active editor document and view, or (None,None) if no
active document or its not an editor document.
"""
view = GetActiveView()
if view is None or isinstance(view, TreeView):
return (None, None)
doc = view.GetDocument()
if hasattr(doc, "M... | [
"def",
"GetActiveEditorDocument",
"(",
")",
":",
"view",
"=",
"GetActiveView",
"(",
")",
"if",
"view",
"is",
"None",
"or",
"isinstance",
"(",
"view",
",",
"TreeView",
")",
":",
"return",
"(",
"None",
",",
"None",
")",
"doc",
"=",
"view",
".",
"GetDocum... | https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/Pythonwin/pywin/framework/scriptutils.py#L158-L168 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | TreeCtrl.SetItemImage | (*args, **kwargs) | return _controls_.TreeCtrl_SetItemImage(*args, **kwargs) | SetItemImage(self, TreeItemId item, int image, int which=TreeItemIcon_Normal) | SetItemImage(self, TreeItemId item, int image, int which=TreeItemIcon_Normal) | [
"SetItemImage",
"(",
"self",
"TreeItemId",
"item",
"int",
"image",
"int",
"which",
"=",
"TreeItemIcon_Normal",
")"
] | def SetItemImage(*args, **kwargs):
"""SetItemImage(self, TreeItemId item, int image, int which=TreeItemIcon_Normal)"""
return _controls_.TreeCtrl_SetItemImage(*args, **kwargs) | [
"def",
"SetItemImage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TreeCtrl_SetItemImage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L5290-L5292 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/fastparquet/util.py | python | get_file_scheme | (paths) | return 'drill' | For the given row groups, figure out if the partitioning scheme
Parameters
----------
paths: list of str
normally from row_group.columns[0].file_path
Returns
-------
'empty': no rgs at all
'simple': all rgs in a single file
'flat': multiple files in one directory
'hive': di... | For the given row groups, figure out if the partitioning scheme | [
"For",
"the",
"given",
"row",
"groups",
"figure",
"out",
"if",
"the",
"partitioning",
"scheme"
] | def get_file_scheme(paths):
"""For the given row groups, figure out if the partitioning scheme
Parameters
----------
paths: list of str
normally from row_group.columns[0].file_path
Returns
-------
'empty': no rgs at all
'simple': all rgs in a single file
'flat': multiple fi... | [
"def",
"get_file_scheme",
"(",
"paths",
")",
":",
"if",
"not",
"paths",
":",
"return",
"'empty'",
"if",
"set",
"(",
"paths",
")",
"==",
"{",
"None",
"}",
":",
"return",
"'simple'",
"if",
"None",
"in",
"paths",
":",
"return",
"'other'",
"parts",
"=",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/fastparquet/util.py#L273-L312 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/gzip.py | python | GzipFile._check_closed | (self) | Raises a ValueError if the underlying file object has been closed. | Raises a ValueError if the underlying file object has been closed. | [
"Raises",
"a",
"ValueError",
"if",
"the",
"underlying",
"file",
"object",
"has",
"been",
"closed",
"."
] | def _check_closed(self):
"""Raises a ValueError if the underlying file object has been closed.
"""
if self.closed:
raise ValueError('I/O operation on closed file.') | [
"def",
"_check_closed",
"(",
"self",
")",
":",
"if",
"self",
".",
"closed",
":",
"raise",
"ValueError",
"(",
"'I/O operation on closed file.'",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/gzip.py#L150-L155 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | PyTextDataObject.__init__ | (self, *args, **kwargs) | __init__(self, String text=EmptyString) -> PyTextDataObject
wx.PyTextDataObject is a version of `wx.TextDataObject` that is
Python-aware and knows how to reflect calls to its C++ virtual methods
to methods in the Python derived class. You should derive from this
class and overload `Get... | __init__(self, String text=EmptyString) -> PyTextDataObject | [
"__init__",
"(",
"self",
"String",
"text",
"=",
"EmptyString",
")",
"-",
">",
"PyTextDataObject"
] | def __init__(self, *args, **kwargs):
"""
__init__(self, String text=EmptyString) -> PyTextDataObject
wx.PyTextDataObject is a version of `wx.TextDataObject` that is
Python-aware and knows how to reflect calls to its C++ virtual methods
to methods in the Python derived class. Y... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_misc_",
".",
"PyTextDataObject_swiginit",
"(",
"self",
",",
"_misc_",
".",
"new_PyTextDataObject",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"PyTextDataObje... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L5236-L5248 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/learn/python/learn/monitors.py | python | EveryN.step_end | (self, step, output) | return False | Overrides `BaseMonitor.step_end`.
When overriding this method, you must call the super implementation.
Args:
step: `int`, the current value of the global step.
output: `dict` mapping `string` values representing tensor names to
the value resulted from running these tensors. Values may be e... | Overrides `BaseMonitor.step_end`. | [
"Overrides",
"BaseMonitor",
".",
"step_end",
"."
] | def step_end(self, step, output):
"""Overrides `BaseMonitor.step_end`.
When overriding this method, you must call the super implementation.
Args:
step: `int`, the current value of the global step.
output: `dict` mapping `string` values representing tensor names to
the value resulted fr... | [
"def",
"step_end",
"(",
"self",
",",
"step",
",",
"output",
")",
":",
"super",
"(",
"EveryN",
",",
"self",
")",
".",
"step_end",
"(",
"step",
",",
"output",
")",
"if",
"self",
".",
"_every_n_step_begin_called",
":",
"return",
"self",
".",
"every_n_step_e... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/learn/python/learn/monitors.py#L342-L359 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/toolkits/classifier/svm_classifier.py | python | SVMClassifier._get | (self, field) | return super(_Classifier, self)._get(field) | Return the value of a given field. The list of all queryable fields is
detailed below, and can be obtained programmatically with the
:func:`~turicreate.svm.SVMClassifier._list_fields` method.
+------------------------+-------------------------------------------------------------+
| ... | Return the value of a given field. The list of all queryable fields is
detailed below, and can be obtained programmatically with the
:func:`~turicreate.svm.SVMClassifier._list_fields` method. | [
"Return",
"the",
"value",
"of",
"a",
"given",
"field",
".",
"The",
"list",
"of",
"all",
"queryable",
"fields",
"is",
"detailed",
"below",
"and",
"can",
"be",
"obtained",
"programmatically",
"with",
"the",
":",
"func",
":",
"~turicreate",
".",
"svm",
".",
... | def _get(self, field):
"""
Return the value of a given field. The list of all queryable fields is
detailed below, and can be obtained programmatically with the
:func:`~turicreate.svm.SVMClassifier._list_fields` method.
+------------------------+---------------------------------... | [
"def",
"_get",
"(",
"self",
",",
"field",
")",
":",
"return",
"super",
"(",
"_Classifier",
",",
"self",
")",
".",
"_get",
"(",
"field",
")"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/classifier/svm_classifier.py#L412-L469 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/tornado/tornado-6/tornado/escape.py | python | recursive_unicode | (obj: Any) | Walks a simple data structure, converting byte strings to unicode.
Supports lists, tuples, and dictionaries. | Walks a simple data structure, converting byte strings to unicode. | [
"Walks",
"a",
"simple",
"data",
"structure",
"converting",
"byte",
"strings",
"to",
"unicode",
"."
] | def recursive_unicode(obj: Any) -> Any:
"""Walks a simple data structure, converting byte strings to unicode.
Supports lists, tuples, and dictionaries.
"""
if isinstance(obj, dict):
return dict(
(recursive_unicode(k), recursive_unicode(v)) for (k, v) in obj.items()
)
eli... | [
"def",
"recursive_unicode",
"(",
"obj",
":",
"Any",
")",
"->",
"Any",
":",
"if",
"isinstance",
"(",
"obj",
",",
"dict",
")",
":",
"return",
"dict",
"(",
"(",
"recursive_unicode",
"(",
"k",
")",
",",
"recursive_unicode",
"(",
"v",
")",
")",
"for",
"("... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/escape.py#L242-L258 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/plotting/markers.py | python | VerticalMarker.set_position | (self, x) | Set the x position of the marker.
:param x: An x axis coordinate. | Set the x position of the marker.
:param x: An x axis coordinate. | [
"Set",
"the",
"x",
"position",
"of",
"the",
"marker",
".",
":",
"param",
"x",
":",
"An",
"x",
"axis",
"coordinate",
"."
] | def set_position(self, x):
"""
Set the x position of the marker.
:param x: An x axis coordinate.
"""
self.x = x
self.x_moved.emit(x) | [
"def",
"set_position",
"(",
"self",
",",
"x",
")",
":",
"self",
".",
"x",
"=",
"x",
"self",
".",
"x_moved",
".",
"emit",
"(",
"x",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/plotting/markers.py#L300-L306 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/mailbox.py | python | _PartialFile.__init__ | (self, f, start=None, stop=None) | Initialize a _PartialFile. | Initialize a _PartialFile. | [
"Initialize",
"a",
"_PartialFile",
"."
] | def __init__(self, f, start=None, stop=None):
"""Initialize a _PartialFile."""
_ProxyFile.__init__(self, f, start)
self._start = start
self._stop = stop | [
"def",
"__init__",
"(",
"self",
",",
"f",
",",
"start",
"=",
"None",
",",
"stop",
"=",
"None",
")",
":",
"_ProxyFile",
".",
"__init__",
"(",
"self",
",",
"f",
",",
"start",
")",
"self",
".",
"_start",
"=",
"start",
"self",
".",
"_stop",
"=",
"sto... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/mailbox.py#L2027-L2031 | ||
ZintrulCre/LeetCode_Archiver | de23e16ead29336b5ee7aa1898a392a5d6463d27 | LeetCode/python3/695.py | python | Solution.maxAreaOfIsland | (self, grid) | return maxArea | :type grid: List[List[int]]
:rtype: int | :type grid: List[List[int]]
:rtype: int | [
":",
"type",
"grid",
":",
"List",
"[",
"List",
"[",
"int",
"]]",
":",
"rtype",
":",
"int"
] | def maxAreaOfIsland(self, grid):
"""
:type grid: List[List[int]]
:rtype: int
"""
dir_x = [0, 0, 1, -1]
dir_y = [-1, 1, 0, 0]
def helper(i, j):
if i < 0 or i >= len(grid) or j < 0 or j >= len(grid[i]) or (i, j) in visited or grid[i][j] == 0:
... | [
"def",
"maxAreaOfIsland",
"(",
"self",
",",
"grid",
")",
":",
"dir_x",
"=",
"[",
"0",
",",
"0",
",",
"1",
",",
"-",
"1",
"]",
"dir_y",
"=",
"[",
"-",
"1",
",",
"1",
",",
"0",
",",
"0",
"]",
"def",
"helper",
"(",
"i",
",",
"j",
")",
":",
... | https://github.com/ZintrulCre/LeetCode_Archiver/blob/de23e16ead29336b5ee7aa1898a392a5d6463d27/LeetCode/python3/695.py#L2-L26 | |
liulei01/DRBox | b5c76e033c555c9009590ab384e1f7bd3c66c237 | scripts/cpp_lint.py | python | _IsTestFilename | (filename) | Determines if the given filename has a suffix that identifies it as a test.
Args:
filename: The input filename.
Returns:
True if 'filename' looks like a test, False otherwise. | Determines if the given filename has a suffix that identifies it as a test. | [
"Determines",
"if",
"the",
"given",
"filename",
"has",
"a",
"suffix",
"that",
"identifies",
"it",
"as",
"a",
"test",
"."
] | def _IsTestFilename(filename):
"""Determines if the given filename has a suffix that identifies it as a test.
Args:
filename: The input filename.
Returns:
True if 'filename' looks like a test, False otherwise.
"""
if (filename.endswith('_test.cc') or
filename.endswith('_unittest.cc') or
... | [
"def",
"_IsTestFilename",
"(",
"filename",
")",
":",
"if",
"(",
"filename",
".",
"endswith",
"(",
"'_test.cc'",
")",
"or",
"filename",
".",
"endswith",
"(",
"'_unittest.cc'",
")",
"or",
"filename",
".",
"endswith",
"(",
"'_regtest.cc'",
")",
")",
":",
"ret... | https://github.com/liulei01/DRBox/blob/b5c76e033c555c9009590ab384e1f7bd3c66c237/scripts/cpp_lint.py#L3607-L3621 | ||
cksystemsgroup/scalloc | 049857919b5fa1d539c9e4206e353daca2e87394 | tools/cpplint.py | python | _NestingState.CheckCompletedBlocks | (self, filename, error) | Checks that all classes and namespaces have been completely parsed.
Call this when all lines in a file have been processed.
Args:
filename: The name of the current file.
error: The function to call with any errors found. | Checks that all classes and namespaces have been completely parsed. | [
"Checks",
"that",
"all",
"classes",
"and",
"namespaces",
"have",
"been",
"completely",
"parsed",
"."
] | def CheckCompletedBlocks(self, filename, error):
"""Checks that all classes and namespaces have been completely parsed.
Call this when all lines in a file have been processed.
Args:
filename: The name of the current file.
error: The function to call with any errors found.
"""
# Note: Th... | [
"def",
"CheckCompletedBlocks",
"(",
"self",
",",
"filename",
",",
"error",
")",
":",
"# Note: This test can result in false positives if #ifdef constructs",
"# get in the way of brace matching. See the testBuildClass test in",
"# cpplint_unittest.py for an example of this.",
"for",
"obj"... | https://github.com/cksystemsgroup/scalloc/blob/049857919b5fa1d539c9e4206e353daca2e87394/tools/cpplint.py#L2060-L2079 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/layers/python/layers/layers.py | python | convolution3d_transpose | (
inputs,
num_outputs,
kernel_size,
stride=1,
padding='SAME',
data_format=DATA_FORMAT_NDHWC,
activation_fn=nn.relu,
normalizer_fn=None,
normalizer_params=None,
weights_initializer=initializers.xavier_initializer(),
weights_regularizer=None,
biases_initializer=init_ops.zer... | Adds a convolution3d_transpose with an optional batch normalization layer.
The function creates a variable called `weights`, representing the
kernel, that is convolved with the input. If `batch_norm_params` is `None`, a
second variable called 'biases' is added to the result of the operation.
Args:
inputs: ... | Adds a convolution3d_transpose with an optional batch normalization layer. | [
"Adds",
"a",
"convolution3d_transpose",
"with",
"an",
"optional",
"batch",
"normalization",
"layer",
"."
] | def convolution3d_transpose(
inputs,
num_outputs,
kernel_size,
stride=1,
padding='SAME',
data_format=DATA_FORMAT_NDHWC,
activation_fn=nn.relu,
normalizer_fn=None,
normalizer_params=None,
weights_initializer=initializers.xavier_initializer(),
weights_regularizer=None,
bias... | [
"def",
"convolution3d_transpose",
"(",
"inputs",
",",
"num_outputs",
",",
"kernel_size",
",",
"stride",
"=",
"1",
",",
"padding",
"=",
"'SAME'",
",",
"data_format",
"=",
"DATA_FORMAT_NDHWC",
",",
"activation_fn",
"=",
"nn",
".",
"relu",
",",
"normalizer_fn",
"... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/layers/python/layers/layers.py#L1283-L1388 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/email/message.py | python | MIMEPart.iter_attachments | (self) | Return an iterator over the non-main parts of a multipart.
Skip the first of each occurrence of text/plain, text/html,
multipart/related, or multipart/alternative in the multipart (unless
they have a 'Content-Disposition: attachment' header) and include all
remaining subparts in the ret... | Return an iterator over the non-main parts of a multipart. | [
"Return",
"an",
"iterator",
"over",
"the",
"non",
"-",
"main",
"parts",
"of",
"a",
"multipart",
"."
] | def iter_attachments(self):
"""Return an iterator over the non-main parts of a multipart.
Skip the first of each occurrence of text/plain, text/html,
multipart/related, or multipart/alternative in the multipart (unless
they have a 'Content-Disposition: attachment' header) and include al... | [
"def",
"iter_attachments",
"(",
"self",
")",
":",
"maintype",
",",
"subtype",
"=",
"self",
".",
"get_content_type",
"(",
")",
".",
"split",
"(",
"'/'",
")",
"if",
"maintype",
"!=",
"'multipart'",
"or",
"subtype",
"==",
"'alternative'",
":",
"return",
"payl... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/email/message.py#L1030-L1083 | ||
casadi/casadi | 8d0f80a4d0fe2054384bfb9748f7a0f6bae540ff | misc/cpplint.py | python | ParseArguments | (args) | return filenames | Parses the command line arguments.
This may set the output format and verbosity level as side-effects.
Args:
args: The command line arguments:
Returns:
The list of filenames to lint. | Parses the command line arguments. | [
"Parses",
"the",
"command",
"line",
"arguments",
"."
] | def ParseArguments(args):
"""Parses the command line arguments.
This may set the output format and verbosity level as side-effects.
Args:
args: The command line arguments:
Returns:
The list of filenames to lint.
"""
try:
(opts, filenames) = getopt.getopt(args, '', ['help', 'output=', 'verbose... | [
"def",
"ParseArguments",
"(",
"args",
")",
":",
"try",
":",
"(",
"opts",
",",
"filenames",
")",
"=",
"getopt",
".",
"getopt",
"(",
"args",
",",
"''",
",",
"[",
"'help'",
",",
"'output='",
",",
"'verbose='",
",",
"'counting='",
",",
"'filter='",
",",
... | https://github.com/casadi/casadi/blob/8d0f80a4d0fe2054384bfb9748f7a0f6bae540ff/misc/cpplint.py#L4661-L4728 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/_vendor/packaging/tags.py | python | interpreter_name | () | return INTERPRETER_SHORT_NAMES.get(name) or name | Returns the name of the running interpreter. | Returns the name of the running interpreter. | [
"Returns",
"the",
"name",
"of",
"the",
"running",
"interpreter",
"."
] | def interpreter_name() -> str:
"""
Returns the name of the running interpreter.
"""
name = sys.implementation.name
return INTERPRETER_SHORT_NAMES.get(name) or name | [
"def",
"interpreter_name",
"(",
")",
"->",
"str",
":",
"name",
"=",
"sys",
".",
"implementation",
".",
"name",
"return",
"INTERPRETER_SHORT_NAMES",
".",
"get",
"(",
"name",
")",
"or",
"name"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_vendor/packaging/tags.py#L446-L451 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/asyncio/selector_events.py | python | BaseSelectorEventLoop.remove_reader | (self, fd) | return self._remove_reader(fd) | Remove a reader callback. | Remove a reader callback. | [
"Remove",
"a",
"reader",
"callback",
"."
] | def remove_reader(self, fd):
"""Remove a reader callback."""
self._ensure_fd_no_transport(fd)
return self._remove_reader(fd) | [
"def",
"remove_reader",
"(",
"self",
",",
"fd",
")",
":",
"self",
".",
"_ensure_fd_no_transport",
"(",
"fd",
")",
"return",
"self",
".",
"_remove_reader",
"(",
"fd",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/asyncio/selector_events.py#L331-L334 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/html2.py | python | WebView.CanPaste | (*args, **kwargs) | return _html2.WebView_CanPaste(*args, **kwargs) | CanPaste(self) -> bool | CanPaste(self) -> bool | [
"CanPaste",
"(",
"self",
")",
"-",
">",
"bool"
] | def CanPaste(*args, **kwargs):
"""CanPaste(self) -> bool"""
return _html2.WebView_CanPaste(*args, **kwargs) | [
"def",
"CanPaste",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html2",
".",
"WebView_CanPaste",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/html2.py#L222-L224 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/npyio.py | python | mafromtxt | (fname, **kwargs) | return genfromtxt(fname, **kwargs) | Load ASCII data stored in a text file and return a masked array.
.. deprecated:: 1.17
np.mafromtxt is a deprecated alias of `genfromtxt` which
overwrites the ``usemask`` argument with `True` even when
explicitly called as ``mafromtxt(..., usemask=False)``.
Use `genfromtxt` instead.
... | Load ASCII data stored in a text file and return a masked array. | [
"Load",
"ASCII",
"data",
"stored",
"in",
"a",
"text",
"file",
"and",
"return",
"a",
"masked",
"array",
"."
] | def mafromtxt(fname, **kwargs):
"""
Load ASCII data stored in a text file and return a masked array.
.. deprecated:: 1.17
np.mafromtxt is a deprecated alias of `genfromtxt` which
overwrites the ``usemask`` argument with `True` even when
explicitly called as ``mafromtxt(..., usemask=... | [
"def",
"mafromtxt",
"(",
"fname",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"'usemask'",
"]",
"=",
"True",
"# Numpy 1.17",
"warnings",
".",
"warn",
"(",
"\"np.mafromtxt is a deprecated alias of np.genfromtxt, \"",
"\"prefer the latter.\"",
",",
"DeprecationWar... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/npyio.py#L2285-L2310 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | tools/coverage/cuda_clean.py | python | get_files | (pull_id) | Args:
pull_id (int): Pull id.
Returns:
iterable: The generator will yield every filename. | Args:
pull_id (int): Pull id. | [
"Args",
":",
"pull_id",
"(",
"int",
")",
":",
"Pull",
"id",
"."
] | def get_files(pull_id):
"""
Args:
pull_id (int): Pull id.
Returns:
iterable: The generator will yield every filename.
"""
pull = get_pull(pull_id)
for file in pull.get_files():
yield file.filename | [
"def",
"get_files",
"(",
"pull_id",
")",
":",
"pull",
"=",
"get_pull",
"(",
"pull_id",
")",
"for",
"file",
"in",
"pull",
".",
"get_files",
"(",
")",
":",
"yield",
"file",
".",
"filename"
] | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/tools/coverage/cuda_clean.py#L41-L53 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/dataview.py | python | DataViewRenderer.CancelEditing | (*args, **kwargs) | return _dataview.DataViewRenderer_CancelEditing(*args, **kwargs) | CancelEditing(self) | CancelEditing(self) | [
"CancelEditing",
"(",
"self",
")"
] | def CancelEditing(*args, **kwargs):
"""CancelEditing(self)"""
return _dataview.DataViewRenderer_CancelEditing(*args, **kwargs) | [
"def",
"CancelEditing",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewRenderer_CancelEditing",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/dataview.py#L1212-L1214 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py | python | Environment.best_match | (
self, req, working_set, installer=None, replace_conflicting=False) | return self.obtain(req, installer) | Find distribution best matching `req` and usable on `working_set`
This calls the ``find(req)`` method of the `working_set` to see if a
suitable distribution is already active. (This may raise
``VersionConflict`` if an unsuitable version of the project is already
active in the specified... | Find distribution best matching `req` and usable on `working_set` | [
"Find",
"distribution",
"best",
"matching",
"req",
"and",
"usable",
"on",
"working_set"
] | def best_match(
self, req, working_set, installer=None, replace_conflicting=False):
"""Find distribution best matching `req` and usable on `working_set`
This calls the ``find(req)`` method of the `working_set` to see if a
suitable distribution is already active. (This may raise
... | [
"def",
"best_match",
"(",
"self",
",",
"req",
",",
"working_set",
",",
"installer",
"=",
"None",
",",
"replace_conflicting",
"=",
"False",
")",
":",
"try",
":",
"dist",
"=",
"working_set",
".",
"find",
"(",
"req",
")",
"except",
"VersionConflict",
":",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py#L1040-L1066 | |
ROCmSoftwarePlatform/hipCaffe | 4ec5d482515cce532348553b6db6d00d015675d5 | scripts/cpp_lint.py | python | _NestingState.InNamespaceBody | (self) | return self.stack and isinstance(self.stack[-1], _NamespaceInfo) | Check if we are currently one level inside a namespace body.
Returns:
True if top of the stack is a namespace block, False otherwise. | Check if we are currently one level inside a namespace body. | [
"Check",
"if",
"we",
"are",
"currently",
"one",
"level",
"inside",
"a",
"namespace",
"body",
"."
] | def InNamespaceBody(self):
"""Check if we are currently one level inside a namespace body.
Returns:
True if top of the stack is a namespace block, False otherwise.
"""
return self.stack and isinstance(self.stack[-1], _NamespaceInfo) | [
"def",
"InNamespaceBody",
"(",
"self",
")",
":",
"return",
"self",
".",
"stack",
"and",
"isinstance",
"(",
"self",
".",
"stack",
"[",
"-",
"1",
"]",
",",
"_NamespaceInfo",
")"
] | https://github.com/ROCmSoftwarePlatform/hipCaffe/blob/4ec5d482515cce532348553b6db6d00d015675d5/scripts/cpp_lint.py#L1940-L1946 | |
apache/impala | 8ddac48f3428c86f2cbd037ced89cfb903298b12 | shell/impala_shell.py | python | ImpalaShell._replace_history_delimiters | (self, src_delim, tgt_delim) | Replaces source_delim with target_delim for all items in history.
Read all the items from history into a local list. Clear the history and copy them
back after doing the transformation. | Replaces source_delim with target_delim for all items in history. | [
"Replaces",
"source_delim",
"with",
"target_delim",
"for",
"all",
"items",
"in",
"history",
"."
] | def _replace_history_delimiters(self, src_delim, tgt_delim):
"""Replaces source_delim with target_delim for all items in history.
Read all the items from history into a local list. Clear the history and copy them
back after doing the transformation.
"""
history_len = self.readline.get_current_histo... | [
"def",
"_replace_history_delimiters",
"(",
"self",
",",
"src_delim",
",",
"tgt_delim",
")",
":",
"history_len",
"=",
"self",
".",
"readline",
".",
"get_current_history_length",
"(",
")",
"# load the history and replace the shell's delimiter with EOL",
"history_items",
"=",
... | https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/shell/impala_shell.py#L1666-L1682 | ||
deepmodeling/deepmd-kit | 159e45d248b0429844fb6a8cb3b3a201987c8d79 | deepmd/fit/polar.py | python | PolarFittingSeA.get_sel_type | (self) | return self.sel_type | Get selected atom types | Get selected atom types | [
"Get",
"selected",
"atom",
"types"
] | def get_sel_type(self) -> List[int]:
"""
Get selected atom types
"""
return self.sel_type | [
"def",
"get_sel_type",
"(",
"self",
")",
"->",
"List",
"[",
"int",
"]",
":",
"return",
"self",
".",
"sel_type"
] | https://github.com/deepmodeling/deepmd-kit/blob/159e45d248b0429844fb6a8cb3b3a201987c8d79/deepmd/fit/polar.py#L196-L200 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/detector2dview.py | python | Detector2DView.plot_roi | (self) | return | Plot region of interest (as rectangular) to the canvas from the region set from
:return: | Plot region of interest (as rectangular) to the canvas from the region set from
:return: | [
"Plot",
"region",
"of",
"interest",
"(",
"as",
"rectangular",
")",
"to",
"the",
"canvas",
"from",
"the",
"region",
"set",
"from",
":",
"return",
":"
] | def plot_roi(self):
""" Plot region of interest (as rectangular) to the canvas from the region set from
:return:
"""
# check
assert self._roiStart is not None, 'Starting point of region-of-interest cannot be None'
assert self._roiEnd is not None, 'Ending point of region-o... | [
"def",
"plot_roi",
"(",
"self",
")",
":",
"# check",
"assert",
"self",
".",
"_roiStart",
"is",
"not",
"None",
",",
"'Starting point of region-of-interest cannot be None'",
"assert",
"self",
".",
"_roiEnd",
"is",
"not",
"None",
",",
"'Ending point of region-of-interest... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/detector2dview.py#L218-L250 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/android/loading/loading_trace.py | python | LoadingTrace.RecordUrlNavigation | (
cls, url, connection, chrome_metadata, categories,
timeout_seconds=devtools_monitor.DEFAULT_TIMEOUT_SECONDS,
stop_delay_multiplier=0) | return trace | Create a loading trace by using controller to fetch url.
Args:
url: (str) url to fetch.
connection: An opened devtools connection.
chrome_metadata: Dictionary of chrome metadata.
categories: as in tracing.TracingTrack
timeout_seconds: monitoring connection timeout in seconds.
st... | Create a loading trace by using controller to fetch url. | [
"Create",
"a",
"loading",
"trace",
"by",
"using",
"controller",
"to",
"fetch",
"url",
"."
] | def RecordUrlNavigation(
cls, url, connection, chrome_metadata, categories,
timeout_seconds=devtools_monitor.DEFAULT_TIMEOUT_SECONDS,
stop_delay_multiplier=0):
"""Create a loading trace by using controller to fetch url.
Args:
url: (str) url to fetch.
connection: An opened devtools... | [
"def",
"RecordUrlNavigation",
"(",
"cls",
",",
"url",
",",
"connection",
",",
"chrome_metadata",
",",
"categories",
",",
"timeout_seconds",
"=",
"devtools_monitor",
".",
"DEFAULT_TIMEOUT_SECONDS",
",",
"stop_delay_multiplier",
"=",
"0",
")",
":",
"page",
"=",
"pag... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/loading/loading_trace.py#L81-L111 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/richtext.py | python | RichTextCtrl.IsSelectionUnderlined | (*args, **kwargs) | return _richtext.RichTextCtrl_IsSelectionUnderlined(*args, **kwargs) | IsSelectionUnderlined(self) -> bool
Is all of the selection underlined? | IsSelectionUnderlined(self) -> bool | [
"IsSelectionUnderlined",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsSelectionUnderlined(*args, **kwargs):
"""
IsSelectionUnderlined(self) -> bool
Is all of the selection underlined?
"""
return _richtext.RichTextCtrl_IsSelectionUnderlined(*args, **kwargs) | [
"def",
"IsSelectionUnderlined",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_IsSelectionUnderlined",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L3931-L3937 | |
argman/EAST | dca414de39a3a4915a019c9a02c1832a31cdd0ca | nets/resnet_utils.py | python | stack_blocks_dense | (net, blocks, output_stride=None,
outputs_collections=None) | return net | Stacks ResNet `Blocks` and controls output feature density.
First, this function creates scopes for the ResNet in the form of
'block_name/unit_1', 'block_name/unit_2', etc.
Second, this function allows the user to explicitly control the ResNet
output_stride, which is the ratio of the input to output s... | Stacks ResNet `Blocks` and controls output feature density. | [
"Stacks",
"ResNet",
"Blocks",
"and",
"controls",
"output",
"feature",
"density",
"."
] | def stack_blocks_dense(net, blocks, output_stride=None,
outputs_collections=None):
"""Stacks ResNet `Blocks` and controls output feature density.
First, this function creates scopes for the ResNet in the form of
'block_name/unit_1', 'block_name/unit_2', etc.
Second, this functio... | [
"def",
"stack_blocks_dense",
"(",
"net",
",",
"blocks",
",",
"output_stride",
"=",
"None",
",",
"outputs_collections",
"=",
"None",
")",
":",
"# The current_stride variable keeps track of the effective stride of the",
"# activations. This allows us to invoke atrous convolution when... | https://github.com/argman/EAST/blob/dca414de39a3a4915a019c9a02c1832a31cdd0ca/nets/resnet_utils.py#L126-L206 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/webapp2/webapp2_extras/auth.py | python | Auth.get_session_data | (self, pop=False) | return None | Returns the session data as a dictionary.
:param pop:
If True, removes the session.
:returns:
A deserialized session, or None. | Returns the session data as a dictionary. | [
"Returns",
"the",
"session",
"data",
"as",
"a",
"dictionary",
"."
] | def get_session_data(self, pop=False):
"""Returns the session data as a dictionary.
:param pop:
If True, removes the session.
:returns:
A deserialized session, or None.
"""
func = self.session.pop if pop else self.session.get
rv = func('_user', No... | [
"def",
"get_session_data",
"(",
"self",
",",
"pop",
"=",
"False",
")",
":",
"func",
"=",
"self",
".",
"session",
".",
"pop",
"if",
"pop",
"else",
"self",
".",
"session",
".",
"get",
"rv",
"=",
"func",
"(",
"'_user'",
",",
"None",
")",
"if",
"rv",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/webapp2/webapp2_extras/auth.py#L523-L540 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/ragged/ragged_tensor_shape.py | python | RaggedTensorDynamicShape.__init__ | (self, partitioned_dim_sizes, inner_dim_sizes,
dim_size_dtype=None) | Creates a RaggedTensorDynamicShape.
Args:
partitioned_dim_sizes: A `list` of 0-D or 1-D integer `Tensor`, one for
each partitioned dimension. If dimension `d` is uniform, then
`partitioned_dim_sizes[d]` must be an integer scalar, specifying the
size of all slices across dimension `d`... | Creates a RaggedTensorDynamicShape. | [
"Creates",
"a",
"RaggedTensorDynamicShape",
"."
] | def __init__(self, partitioned_dim_sizes, inner_dim_sizes,
dim_size_dtype=None):
"""Creates a RaggedTensorDynamicShape.
Args:
partitioned_dim_sizes: A `list` of 0-D or 1-D integer `Tensor`, one for
each partitioned dimension. If dimension `d` is uniform, then
`partitioned_... | [
"def",
"__init__",
"(",
"self",
",",
"partitioned_dim_sizes",
",",
"inner_dim_sizes",
",",
"dim_size_dtype",
"=",
"None",
")",
":",
"assert",
"isinstance",
"(",
"partitioned_dim_sizes",
",",
"(",
"list",
",",
"tuple",
")",
")",
"with",
"ops",
".",
"name_scope"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/ragged/ragged_tensor_shape.py#L81-L140 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/zipfile.py | python | ZipFile.extractall | (self, path=None, members=None, pwd=None) | Extract all members from the archive to the current working
directory. `path' specifies a different directory to extract to.
`members' is optional and must be a subset of the list returned
by namelist(). | Extract all members from the archive to the current working
directory. `path' specifies a different directory to extract to.
`members' is optional and must be a subset of the list returned
by namelist(). | [
"Extract",
"all",
"members",
"from",
"the",
"archive",
"to",
"the",
"current",
"working",
"directory",
".",
"path",
"specifies",
"a",
"different",
"directory",
"to",
"extract",
"to",
".",
"members",
"is",
"optional",
"and",
"must",
"be",
"a",
"subset",
"of",... | def extractall(self, path=None, members=None, pwd=None):
"""Extract all members from the archive to the current working
directory. `path' specifies a different directory to extract to.
`members' is optional and must be a subset of the list returned
by namelist().
"""
... | [
"def",
"extractall",
"(",
"self",
",",
"path",
"=",
"None",
",",
"members",
"=",
"None",
",",
"pwd",
"=",
"None",
")",
":",
"if",
"members",
"is",
"None",
":",
"members",
"=",
"self",
".",
"namelist",
"(",
")",
"for",
"zipinfo",
"in",
"members",
":... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/zipfile.py#L1026-L1036 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Listbox.insert | (self, index, *elements) | Insert ELEMENTS at INDEX. | Insert ELEMENTS at INDEX. | [
"Insert",
"ELEMENTS",
"at",
"INDEX",
"."
] | def insert(self, index, *elements):
"""Insert ELEMENTS at INDEX."""
self.tk.call((self._w, 'insert', index) + elements) | [
"def",
"insert",
"(",
"self",
",",
"index",
",",
"*",
"elements",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"(",
"self",
".",
"_w",
",",
"'insert'",
",",
"index",
")",
"+",
"elements",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2578-L2580 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/distributed/fleet/metrics/metric.py | python | acc | (correct, total, scope=None, util=None) | return float(global_correct_num[0]) / float(global_total_num[0]) | distributed accuracy in fleet
Args:
correct(numpy.array|Variable|string): correct Variable
total(numpy.array|Variable): total Variable
scope(Scope): specific scope
Returns:
acc(float): accuracy value
Example:
.. code-block:: python
# in model.py
... | distributed accuracy in fleet | [
"distributed",
"accuracy",
"in",
"fleet"
] | def acc(correct, total, scope=None, util=None):
"""
distributed accuracy in fleet
Args:
correct(numpy.array|Variable|string): correct Variable
total(numpy.array|Variable): total Variable
scope(Scope): specific scope
Returns:
acc(float): accuracy value
Example:
... | [
"def",
"acc",
"(",
"correct",
",",
"total",
",",
"scope",
"=",
"None",
",",
"util",
"=",
"None",
")",
":",
"if",
"scope",
"is",
"None",
":",
"scope",
"=",
"paddle",
".",
"static",
".",
"global_scope",
"(",
")",
"if",
"util",
"is",
"None",
":",
"u... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/fleet/metrics/metric.py#L373-L426 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | RecoEgamma/ElectronIdentification/python/Identification/cutBasedElectronID_tools.py | python | configureVIDCutBasedEleID_V3 | ( wpEB, wpEE, isoInputs ) | return parameterSet | This function configures the full cms.PSet for a VID ID and returns it.
The inputs: two objects of the type WorkingPoint_V3, one
containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
The third argument is an object that contains information necessary
for isolation calculations.
... | This function configures the full cms.PSet for a VID ID and returns it.
The inputs: two objects of the type WorkingPoint_V3, one
containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
The third argument is an object that contains information necessary
for isolation calculations.
... | [
"This",
"function",
"configures",
"the",
"full",
"cms",
".",
"PSet",
"for",
"a",
"VID",
"ID",
"and",
"returns",
"it",
".",
"The",
"inputs",
":",
"two",
"objects",
"of",
"the",
"type",
"WorkingPoint_V3",
"one",
"containing",
"the",
"cuts",
"for",
"the",
"... | def configureVIDCutBasedEleID_V3( wpEB, wpEE, isoInputs ):
"""
This function configures the full cms.PSet for a VID ID and returns it.
The inputs: two objects of the type WorkingPoint_V3, one
containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
The third argument is an obje... | [
"def",
"configureVIDCutBasedEleID_V3",
"(",
"wpEB",
",",
"wpEE",
",",
"isoInputs",
")",
":",
"# print \"VID: Configuring cut set %s\" % wpEB.idName",
"parameterSet",
"=",
"cms",
".",
"PSet",
"(",
"#",
"idName",
"=",
"cms",
".",
"string",
"(",
"wpEB",
".",
"idName"... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/RecoEgamma/ElectronIdentification/python/Identification/cutBasedElectronID_tools.py#L480-L507 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/gslib/commands/setmeta.py | python | SetMetaCommand._ParseMetadataHeaders | (self, headers) | return (metadata_minus, metadata_plus) | Validates and parses metadata changes from the headers argument.
Args:
headers: Header dict to validate and parse.
Returns:
(metadata_plus, metadata_minus): Tuple of header sets to add and remove. | Validates and parses metadata changes from the headers argument. | [
"Validates",
"and",
"parses",
"metadata",
"changes",
"from",
"the",
"headers",
"argument",
"."
] | def _ParseMetadataHeaders(self, headers):
"""Validates and parses metadata changes from the headers argument.
Args:
headers: Header dict to validate and parse.
Returns:
(metadata_plus, metadata_minus): Tuple of header sets to add and remove.
"""
metadata_minus = set()
cust_metadata... | [
"def",
"_ParseMetadataHeaders",
"(",
"self",
",",
"headers",
")",
":",
"metadata_minus",
"=",
"set",
"(",
")",
"cust_metadata_minus",
"=",
"set",
"(",
")",
"metadata_plus",
"=",
"{",
"}",
"cust_metadata_plus",
"=",
"{",
"}",
"# Build a count of the keys encountere... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/commands/setmeta.py#L250-L329 | |
psnonis/FinBERT | c0c555d833a14e2316a3701e59c0b5156f804b4e | bert/run_classifier.py | python | DataProcessor.get_labels | (self) | Gets the list of labels for this data set. | Gets the list of labels for this data set. | [
"Gets",
"the",
"list",
"of",
"labels",
"for",
"this",
"data",
"set",
"."
] | def get_labels(self):
"""Gets the list of labels for this data set."""
raise NotImplementedError() | [
"def",
"get_labels",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/psnonis/FinBERT/blob/c0c555d833a14e2316a3701e59c0b5156f804b4e/bert/run_classifier.py#L192-L194 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/lib/twodim_base.py | python | vander | (x, N=None, increasing=False) | return v | Generate a Vandermonde matrix.
The columns of the output matrix are powers of the input vector. The
order of the powers is determined by the `increasing` boolean argument.
Specifically, when `increasing` is False, the `i`-th output column is
the input vector raised element-wise to the power of ``N - i ... | Generate a Vandermonde matrix. | [
"Generate",
"a",
"Vandermonde",
"matrix",
"."
] | def vander(x, N=None, increasing=False):
"""
Generate a Vandermonde matrix.
The columns of the output matrix are powers of the input vector. The
order of the powers is determined by the `increasing` boolean argument.
Specifically, when `increasing` is False, the `i`-th output column is
the inpu... | [
"def",
"vander",
"(",
"x",
",",
"N",
"=",
"None",
",",
"increasing",
"=",
"False",
")",
":",
"x",
"=",
"asarray",
"(",
"x",
")",
"if",
"x",
".",
"ndim",
"!=",
"1",
":",
"raise",
"ValueError",
"(",
"\"x must be a one-dimensional array or sequence.\"",
")"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/lib/twodim_base.py#L510-L597 | |
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | cmake/developer_package/cpplint/cpplint.py | python | IsOutOfLineMethodDefinition | (clean_lines, linenum) | return False | Check if current line contains an out-of-line method definition.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if current line contains an out-of-line method definition. | Check if current line contains an out-of-line method definition. | [
"Check",
"if",
"current",
"line",
"contains",
"an",
"out",
"-",
"of",
"-",
"line",
"method",
"definition",
"."
] | def IsOutOfLineMethodDefinition(clean_lines, linenum):
"""Check if current line contains an out-of-line method definition.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if current line contains an out-of-line method definiti... | [
"def",
"IsOutOfLineMethodDefinition",
"(",
"clean_lines",
",",
"linenum",
")",
":",
"# Scan back a few lines for start of current function",
"for",
"i",
"in",
"xrange",
"(",
"linenum",
",",
"max",
"(",
"-",
"1",
",",
"linenum",
"-",
"10",
")",
",",
"-",
"1",
"... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/cmake/developer_package/cpplint/cpplint.py#L5227-L5240 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/ma/core.py | python | MaskedArray.toflex | (self) | return record | Transforms a masked array into a flexible-type array.
The flexible type array that is returned will have two fields:
* the ``_data`` field stores the ``_data`` part of the array.
* the ``_mask`` field stores the ``_mask`` part of the array.
Parameters
----------
None
... | Transforms a masked array into a flexible-type array. | [
"Transforms",
"a",
"masked",
"array",
"into",
"a",
"flexible",
"-",
"type",
"array",
"."
] | def toflex(self):
"""
Transforms a masked array into a flexible-type array.
The flexible type array that is returned will have two fields:
* the ``_data`` field stores the ``_data`` part of the array.
* the ``_mask`` field stores the ``_mask`` part of the array.
Parame... | [
"def",
"toflex",
"(",
"self",
")",
":",
"# Get the basic dtype ....",
"ddtype",
"=",
"self",
".",
"dtype",
"# Make sure we have a mask",
"_mask",
"=",
"self",
".",
"_mask",
"if",
"_mask",
"is",
"None",
":",
"_mask",
"=",
"make_mask_none",
"(",
"self",
".",
"... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/ma/core.py#L5377-L5428 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/autograph/pyct/anno.py | python | dup | (node, copy_map, field_name='___pyct_anno') | Recursively copies annotations in an AST tree.
Args:
node: ast.AST
copy_map: Dict[Hashable, Hashable], maps a source anno key to a destination
key. All annotations with the source key will be copied to identical
annotations with the destination key.
field_name: str | Recursively copies annotations in an AST tree. | [
"Recursively",
"copies",
"annotations",
"in",
"an",
"AST",
"tree",
"."
] | def dup(node, copy_map, field_name='___pyct_anno'):
"""Recursively copies annotations in an AST tree.
Args:
node: ast.AST
copy_map: Dict[Hashable, Hashable], maps a source anno key to a destination
key. All annotations with the source key will be copied to identical
annotations with the des... | [
"def",
"dup",
"(",
"node",
",",
"copy_map",
",",
"field_name",
"=",
"'___pyct_anno'",
")",
":",
"for",
"n",
"in",
"gast",
".",
"walk",
"(",
"node",
")",
":",
"for",
"k",
"in",
"copy_map",
":",
"if",
"hasanno",
"(",
"n",
",",
"k",
",",
"field_name",... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/autograph/pyct/anno.py#L161-L174 | ||
emscripten-core/emscripten | 0d413d3c5af8b28349682496edc14656f5700c2f | third_party/ply/example/BASIC/basparse.py | python | p_command_def_bad_arg | (p) | command : DEF ID LPAREN error RPAREN EQUALS expr | command : DEF ID LPAREN error RPAREN EQUALS expr | [
"command",
":",
"DEF",
"ID",
"LPAREN",
"error",
"RPAREN",
"EQUALS",
"expr"
] | def p_command_def_bad_arg(p):
'''command : DEF ID LPAREN error RPAREN EQUALS expr'''
p[0] = "BAD ARGUMENT IN DEF STATEMENT" | [
"def",
"p_command_def_bad_arg",
"(",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"\"BAD ARGUMENT IN DEF STATEMENT\""
] | https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/BASIC/basparse.py#L229-L231 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/core/crashhandler.py | python | CrashHandler.__init__ | (self, app, contact_name=None, contact_email=None,
bug_tracker=None, show_crash_traceback=True, call_pdb=False) | Create a new crash handler
Parameters
----------
app : Application
A running :class:`Application` instance, which will be queried at
crash time for internal information.
contact_name : str
A string with the name of the person to contact.
co... | Create a new crash handler | [
"Create",
"a",
"new",
"crash",
"handler"
] | def __init__(self, app, contact_name=None, contact_email=None,
bug_tracker=None, show_crash_traceback=True, call_pdb=False):
"""Create a new crash handler
Parameters
----------
app : Application
A running :class:`Application` instance, which will be queried... | [
"def",
"__init__",
"(",
"self",
",",
"app",
",",
"contact_name",
"=",
"None",
",",
"contact_email",
"=",
"None",
",",
"bug_tracker",
"=",
"None",
",",
"show_crash_traceback",
"=",
"True",
",",
"call_pdb",
"=",
"False",
")",
":",
"self",
".",
"crash_report_... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/crashhandler.py#L97-L135 | ||
tfwu/FaceDetection-ConvNet-3D | f9251c48eb40c5aec8fba7455115c355466555be | python/build/lib.linux-x86_64-2.7/mxnet/executor_manager.py | python | DataParallelExecutorManager.load_data_batch | (self, data_batch) | load data and labels into arrays | load data and labels into arrays | [
"load",
"data",
"and",
"labels",
"into",
"arrays"
] | def load_data_batch(self, data_batch):
""" load data and labels into arrays """
if self.sym_gen is not None:
key = data_batch.bucket_key
if key not in self.execgrp_bucket:
# create new bucket entry
symbol = self.sym_gen(key)
execgrp... | [
"def",
"load_data_batch",
"(",
"self",
",",
"data_batch",
")",
":",
"if",
"self",
".",
"sym_gen",
"is",
"not",
"None",
":",
"key",
"=",
"data_batch",
".",
"bucket_key",
"if",
"key",
"not",
"in",
"self",
".",
"execgrp_bucket",
":",
"# create new bucket entry"... | https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/build/lib.linux-x86_64-2.7/mxnet/executor_manager.py#L364-L381 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/urllib3/connection.py | python | HTTPConnection.host | (self, value) | Setter for the `host` property.
We assume that only urllib3 uses the _dns_host attribute; httplib itself
only uses `host`, and it seems reasonable that other libraries follow suit. | Setter for the `host` property. | [
"Setter",
"for",
"the",
"host",
"property",
"."
] | def host(self, value):
"""
Setter for the `host` property.
We assume that only urllib3 uses the _dns_host attribute; httplib itself
only uses `host`, and it seems reasonable that other libraries follow suit.
"""
self._dns_host = value | [
"def",
"host",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"_dns_host",
"=",
"value"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/urllib3/connection.py#L134-L141 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/retdec-3.2/scripts/type_extractor/type_extractor/parse_structs_unions.py | python | CompositeType.members_list | (self) | return self.members if self.members is not None else [] | Returns list of type's parameters. | Returns list of type's parameters. | [
"Returns",
"list",
"of",
"type",
"s",
"parameters",
"."
] | def members_list(self):
"""Returns list of type's parameters."""
return self.members if self.members is not None else [] | [
"def",
"members_list",
"(",
"self",
")",
":",
"return",
"self",
".",
"members",
"if",
"self",
".",
"members",
"is",
"not",
"None",
"else",
"[",
"]"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/retdec-3.2/scripts/type_extractor/type_extractor/parse_structs_unions.py#L37-L39 | |
zeroc-ice/ice | 6df7df6039674d58fb5ab9a08e46f28591a210f7 | config/makeprops.py | python | PropertyHandler.deprecatedImpl | (self, propertyName) | Needs to be overridden in derived class | Needs to be overridden in derived class | [
"Needs",
"to",
"be",
"overridden",
"in",
"derived",
"class"
] | def deprecatedImpl(self, propertyName):
"""Needs to be overridden in derived class"""
pass | [
"def",
"deprecatedImpl",
"(",
"self",
",",
"propertyName",
")",
":",
"pass"
] | https://github.com/zeroc-ice/ice/blob/6df7df6039674d58fb5ab9a08e46f28591a210f7/config/makeprops.py#L222-L224 | ||
toggl-open-source/toggldesktop | 91865205885531cc8fd9e8d613dad49d625d56e7 | third_party/jsoncpp/scons-tools/srcdist.py | python | generate | (env) | Add builders and construction variables for the
SrcDist tool. | Add builders and construction variables for the
SrcDist tool. | [
"Add",
"builders",
"and",
"construction",
"variables",
"for",
"the",
"SrcDist",
"tool",
"."
] | def generate(env):
"""
Add builders and construction variables for the
SrcDist tool.
"""
## doxyfile_scanner = env.Scanner(
## DoxySourceScan,
## "DoxySourceScan",
## scan_check = DoxySourceScanCheck,
## )
if targz.exists(env):
srcdist_builder = targz.makeBuilder( srcDistEmitter... | [
"def",
"generate",
"(",
"env",
")",
":",
"## doxyfile_scanner = env.Scanner(",
"## DoxySourceScan,",
"## \"DoxySourceScan\",",
"## scan_check = DoxySourceScanCheck,",
"## )",
"if",
"targz",
".",
"exists",
"(",
"env",
")",
":",
"srcdist_builder",
"=",
"tar... | https://github.com/toggl-open-source/toggldesktop/blob/91865205885531cc8fd9e8d613dad49d625d56e7/third_party/jsoncpp/scons-tools/srcdist.py#L159-L173 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/gyp/pylib/gyp/MSVSVersion.py | python | VisualStudioVersion._SetupScriptInternal | (self, target_arch) | Returns a command (with arguments) to be used to set up the
environment. | Returns a command (with arguments) to be used to set up the
environment. | [
"Returns",
"a",
"command",
"(",
"with",
"arguments",
")",
"to",
"be",
"used",
"to",
"set",
"up",
"the",
"environment",
"."
] | def _SetupScriptInternal(self, target_arch):
"""Returns a command (with arguments) to be used to set up the
environment."""
assert target_arch in ('x86', 'x64'), "target_arch not supported"
# If WindowsSDKDir is set and SetEnv.Cmd exists then we are using the
# depot_tools build tools and should run... | [
"def",
"_SetupScriptInternal",
"(",
"self",
",",
"target_arch",
")",
":",
"assert",
"target_arch",
"in",
"(",
"'x86'",
",",
"'x64'",
")",
",",
"\"target_arch not supported\"",
"# If WindowsSDKDir is set and SetEnv.Cmd exists then we are using the",
"# depot_tools build tools an... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/MSVSVersion.py#L81-L132 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/layers/python/layers/optimizers.py | python | optimize_loss | (loss,
global_step,
learning_rate,
optimizer,
gradient_noise_scale=None,
gradient_multipliers=None,
clip_gradients=None,
learning_rate_decay_fn=None,
update_ops=None,
... | Given loss and parameters for optimizer, returns a training op.
Various ways of passing optimizers, include:
- string, name of the optimizer like 'SGD', 'Adam', see OPTIMIZER_CLS_NAMES
for full list. E.g. `optimize_loss(..., optimizer='Adam')`.
- function, takes learning rate `Tensor` as argument and must... | Given loss and parameters for optimizer, returns a training op. | [
"Given",
"loss",
"and",
"parameters",
"for",
"optimizer",
"returns",
"a",
"training",
"op",
"."
] | def optimize_loss(loss,
global_step,
learning_rate,
optimizer,
gradient_noise_scale=None,
gradient_multipliers=None,
clip_gradients=None,
learning_rate_decay_fn=None,
update_op... | [
"def",
"optimize_loss",
"(",
"loss",
",",
"global_step",
",",
"learning_rate",
",",
"optimizer",
",",
"gradient_noise_scale",
"=",
"None",
",",
"gradient_multipliers",
"=",
"None",
",",
"clip_gradients",
"=",
"None",
",",
"learning_rate_decay_fn",
"=",
"None",
","... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/layers/python/layers/optimizers.py#L53-L234 | ||
tiny-dnn/tiny-dnn | c0f576f5cb7b35893f62127cb7aec18f77a3bcc5 | third_party/cpplint.py | python | CloseExpression | (clean_lines, linenum, pos) | return (line, clean_lines.NumLines(), -1) | If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
TODO(unknown): cpplint spends a fair bit of time matching parentheses.
Ideally we would want to index all... | If input points to ( or { or [ or <, finds the position that closes it. | [
"If",
"input",
"points",
"to",
"(",
"or",
"{",
"or",
"[",
"or",
"<",
"finds",
"the",
"position",
"that",
"closes",
"it",
"."
] | def CloseExpression(clean_lines, linenum, pos):
"""If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
TODO(unknown): cpplint spends a fair bit of time match... | [
"def",
"CloseExpression",
"(",
"clean_lines",
",",
"linenum",
",",
"pos",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"if",
"(",
"line",
"[",
"pos",
"]",
"not",
"in",
"'({[<'",
")",
"or",
"Match",
"(",
"r'<[<=]'",
",",
"... | https://github.com/tiny-dnn/tiny-dnn/blob/c0f576f5cb7b35893f62127cb7aec18f77a3bcc5/third_party/cpplint.py#L1767-L1808 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/interpreter.py | python | Interpreter.op_END_FINALLY | (self, inst) | no-op | no-op | [
"no",
"-",
"op"
] | def op_END_FINALLY(self, inst):
"no-op" | [
"def",
"op_END_FINALLY",
"(",
"self",
",",
"inst",
")",
":"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/interpreter.py#L794-L795 | ||
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | ext/ply/example/GardenSnake/GardenSnake.py | python | p_small_stmt | (p) | small_stmt : flow_stmt
| expr_stmt | small_stmt : flow_stmt
| expr_stmt | [
"small_stmt",
":",
"flow_stmt",
"|",
"expr_stmt"
] | def p_small_stmt(p):
"""small_stmt : flow_stmt
| expr_stmt"""
p[0] = p[1] | [
"def",
"p_small_stmt",
"(",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]"
] | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/ext/ply/example/GardenSnake/GardenSnake.py#L433-L436 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/loss/loss.py | python | DiceLoss.__init__ | (self, smooth=1e-5) | Initialize DiceLoss. | Initialize DiceLoss. | [
"Initialize",
"DiceLoss",
"."
] | def __init__(self, smooth=1e-5):
"""Initialize DiceLoss."""
super(DiceLoss, self).__init__()
self.smooth = validator.check_positive_float(smooth, "smooth")
self.reshape = P.Reshape() | [
"def",
"__init__",
"(",
"self",
",",
"smooth",
"=",
"1e-5",
")",
":",
"super",
"(",
"DiceLoss",
",",
"self",
")",
".",
"__init__",
"(",
")",
"self",
".",
"smooth",
"=",
"validator",
".",
"check_positive_float",
"(",
"smooth",
",",
"\"smooth\"",
")",
"s... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/loss/loss.py#L678-L682 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/zipfile.py | python | ZipInfo.FileHeader | (self, zip64=None) | return header + filename + extra | Return the per-file header as a string. | Return the per-file header as a string. | [
"Return",
"the",
"per",
"-",
"file",
"header",
"as",
"a",
"string",
"."
] | def FileHeader(self, zip64=None):
"""Return the per-file header as a string."""
dt = self.date_time
dosdate = (dt[0] - 1980) << 9 | dt[1] << 5 | dt[2]
dostime = dt[3] << 11 | dt[4] << 5 | (dt[5] // 2)
if self.flag_bits & 0x08:
# Set these to zero because we write them... | [
"def",
"FileHeader",
"(",
"self",
",",
"zip64",
"=",
"None",
")",
":",
"dt",
"=",
"self",
".",
"date_time",
"dosdate",
"=",
"(",
"dt",
"[",
"0",
"]",
"-",
"1980",
")",
"<<",
"9",
"|",
"dt",
"[",
"1",
"]",
"<<",
"5",
"|",
"dt",
"[",
"2",
"]"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/zipfile.py#L329-L366 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/isapi/install.py | python | MergeStandardOptions | (options, params) | Take an options object generated by the command line and merge
the values into the IISParameters object. | Take an options object generated by the command line and merge
the values into the IISParameters object. | [
"Take",
"an",
"options",
"object",
"generated",
"by",
"the",
"command",
"line",
"and",
"merge",
"the",
"values",
"into",
"the",
"IISParameters",
"object",
"."
] | def MergeStandardOptions(options, params):
"""
Take an options object generated by the command line and merge
the values into the IISParameters object.
"""
pass | [
"def",
"MergeStandardOptions",
"(",
"options",
",",
"params",
")",
":",
"pass"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/isapi/install.py#L640-L645 | ||
smartdevicelink/sdl_core | 68f082169e0a40fccd9eb0db3c83911c28870f07 | tools/InterfaceGenerator/generator/parsers/JSONRPC.py | python | Parser.__init__ | (self) | Constructor. | Constructor. | [
"Constructor",
"."
] | def __init__(self):
"""Constructor."""
super(Parser, self).__init__()
self._interface_name = None | [
"def",
"__init__",
"(",
"self",
")",
":",
"super",
"(",
"Parser",
",",
"self",
")",
".",
"__init__",
"(",
")",
"self",
".",
"_interface_name",
"=",
"None"
] | https://github.com/smartdevicelink/sdl_core/blob/68f082169e0a40fccd9eb0db3c83911c28870f07/tools/InterfaceGenerator/generator/parsers/JSONRPC.py#L18-L21 | ||
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/MooseDocs/common/exceptions.py | python | MooseDocsException.message | (self) | return self.__message | Return the message supplied to the constructor. | Return the message supplied to the constructor. | [
"Return",
"the",
"message",
"supplied",
"to",
"the",
"constructor",
"."
] | def message(self):
"""Return the message supplied to the constructor."""
return self.__message | [
"def",
"message",
"(",
"self",
")",
":",
"return",
"self",
".",
"__message"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/MooseDocs/common/exceptions.py#L31-L33 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/tools/tensorflow_builder/config_detector/config_detector.py | python | manage_all_configs | (save_results, filename) | Manages configuration detection and retrieval based on user input.
Args:
save_results: Boolean indicating whether to save the results to a file.
filename: String that is the name of the output JSON file. | Manages configuration detection and retrieval based on user input. | [
"Manages",
"configuration",
"detection",
"and",
"retrieval",
"based",
"on",
"user",
"input",
"."
] | def manage_all_configs(save_results, filename):
"""Manages configuration detection and retrieval based on user input.
Args:
save_results: Boolean indicating whether to save the results to a file.
filename: String that is the name of the output JSON file.
"""
# Get all configs
all_configs = get_all_co... | [
"def",
"manage_all_configs",
"(",
"save_results",
",",
"filename",
")",
":",
"# Get all configs",
"all_configs",
"=",
"get_all_configs",
"(",
")",
"# Print all configs based on user input",
"print_all_configs",
"(",
"all_configs",
"[",
"0",
"]",
",",
"all_configs",
"[",... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py#L637-L650 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/telemetry/third_party/png/png.py | python | Reader.read | (self, lenient=False) | return self.width, self.height, pixels, meta | Read the PNG file and decode it. Returns (`width`, `height`,
`pixels`, `metadata`).
May use excessive memory.
`pixels` are returned in boxed row flat pixel format.
If the optional `lenient` argument evaluates to True,
checksum failures will raise warnings rather than exceptio... | Read the PNG file and decode it. Returns (`width`, `height`,
`pixels`, `metadata`). | [
"Read",
"the",
"PNG",
"file",
"and",
"decode",
"it",
".",
"Returns",
"(",
"width",
"height",
"pixels",
"metadata",
")",
"."
] | def read(self, lenient=False):
"""
Read the PNG file and decode it. Returns (`width`, `height`,
`pixels`, `metadata`).
May use excessive memory.
`pixels` are returned in boxed row flat pixel format.
If the optional `lenient` argument evaluates to True,
checksu... | [
"def",
"read",
"(",
"self",
",",
"lenient",
"=",
"False",
")",
":",
"def",
"iteridat",
"(",
")",
":",
"\"\"\"Iterator that yields all the ``IDAT`` chunks as strings.\"\"\"",
"while",
"True",
":",
"try",
":",
"type",
",",
"data",
"=",
"self",
".",
"chunk",
"(",... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/third_party/png/png.py#L1866-L1936 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/importDXF.py | python | decodeName | (name) | return decodedName | Decode the encoded name into utf8 or latin1.
Parameters
----------
name : str
The string to decode.
Returns
-------
str
The decoded string in utf8, latin1, or the original `name`
if the decoding was not needed, for example,
when using Python 3. | Decode the encoded name into utf8 or latin1. | [
"Decode",
"the",
"encoded",
"name",
"into",
"utf8",
"or",
"latin1",
"."
] | def decodeName(name):
"""Decode the encoded name into utf8 or latin1.
Parameters
----------
name : str
The string to decode.
Returns
-------
str
The decoded string in utf8, latin1, or the original `name`
if the decoding was not needed, for example,
when usin... | [
"def",
"decodeName",
"(",
"name",
")",
":",
"try",
":",
"decodedName",
"=",
"(",
"name",
".",
"decode",
"(",
"\"utf8\"",
")",
")",
"except",
"UnicodeDecodeError",
":",
"try",
":",
"decodedName",
"=",
"(",
"name",
".",
"decode",
"(",
"\"latin1\"",
")",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/importDXF.py#L214-L240 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/signal/ltisys.py | python | StateSpace._copy | (self, system) | Copy the parameters of another `StateSpace` system.
Parameters
----------
system : instance of `StateSpace`
The state-space system that is to be copied | Copy the parameters of another `StateSpace` system. | [
"Copy",
"the",
"parameters",
"of",
"another",
"StateSpace",
"system",
"."
] | def _copy(self, system):
"""
Copy the parameters of another `StateSpace` system.
Parameters
----------
system : instance of `StateSpace`
The state-space system that is to be copied
"""
self.A = system.A
self.B = system.B
self.C = syst... | [
"def",
"_copy",
"(",
"self",
",",
"system",
")",
":",
"self",
".",
"A",
"=",
"system",
".",
"A",
"self",
".",
"B",
"=",
"system",
".",
"B",
"self",
".",
"C",
"=",
"system",
".",
"C",
"self",
".",
"D",
"=",
"system",
".",
"D"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/signal/ltisys.py#L1548-L1561 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/deps/v8/tools/run_perf.py | python | ResultTracker.AddRunnableDuration | (self, runnable, duration) | Records a duration of a specific run of the runnable. | Records a duration of a specific run of the runnable. | [
"Records",
"a",
"duration",
"of",
"a",
"specific",
"run",
"of",
"the",
"runnable",
"."
] | def AddRunnableDuration(self, runnable, duration):
"""Records a duration of a specific run of the runnable."""
if runnable.name not in self.runnables:
self.runnables[runnable.name] = {
'graphs': runnable.graphs,
'durations': [duration],
'timeout': runnable.timeout,
}
else... | [
"def",
"AddRunnableDuration",
"(",
"self",
",",
"runnable",
",",
"duration",
")",
":",
"if",
"runnable",
".",
"name",
"not",
"in",
"self",
".",
"runnables",
":",
"self",
".",
"runnables",
"[",
"runnable",
".",
"name",
"]",
"=",
"{",
"'graphs'",
":",
"r... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/deps/v8/tools/run_perf.py#L210-L222 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.