nwo stringlengths 5 86 | sha stringlengths 40 40 | path stringlengths 4 189 | language stringclasses 1
value | identifier stringlengths 1 94 | parameters stringlengths 2 4.03k | argument_list stringclasses 1
value | return_statement stringlengths 0 11.5k | docstring stringlengths 1 33.2k | docstring_summary stringlengths 0 5.15k | docstring_tokens list | function stringlengths 34 151k | function_tokens list | url stringlengths 90 278 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | Pen.GetWidth | (*args, **kwargs) | return _gdi_.Pen_GetWidth(*args, **kwargs) | GetWidth(self) -> int | GetWidth(self) -> int | [
"GetWidth",
"(",
"self",
")",
"-",
">",
"int"
] | def GetWidth(*args, **kwargs):
"""GetWidth(self) -> int"""
return _gdi_.Pen_GetWidth(*args, **kwargs) | [
"def",
"GetWidth",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Pen_GetWidth",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L416-L418 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/PreprocessWindow.py | python | ScanPreProcessWindow.update_merge_value | (self, scan_number, message) | update merged signal
:param scan_number:
:param message:
:return: | update merged signal
:param scan_number:
:param message:
:return: | [
"update",
"merged",
"signal",
":",
"param",
"scan_number",
":",
":",
"param",
"message",
":",
":",
"return",
":"
] | def update_merge_value(self, scan_number, message):
"""update merged signal
:param scan_number:
:param message:
:return:
"""
row_number = self._rowScanDict[scan_number]
self.ui.tableView_scanProcessState.set_status(row_number, message)
self.ui.tableView_sc... | [
"def",
"update_merge_value",
"(",
"self",
",",
"scan_number",
",",
"message",
")",
":",
"row_number",
"=",
"self",
".",
"_rowScanDict",
"[",
"scan_number",
"]",
"self",
".",
"ui",
".",
"tableView_scanProcessState",
".",
"set_status",
"(",
"row_number",
",",
"m... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/PreprocessWindow.py#L406-L414 | ||
alexozer/jankdrone | c4b403eb254b41b832ab2bdfade12ba59c99e5dc | shm/lib/pyratemp/pyratemp.py | python | LoaderFile.__init__ | (self, allowed_path=None, encoding='utf-8') | Init the loader.
:Parameters:
- `allowed_path`: path of the template-files
- `encoding`: encoding of the template-files
:Exceptions:
- `ValueError`: if `allowed_path` is not a directory | Init the loader. | [
"Init",
"the",
"loader",
"."
] | def __init__(self, allowed_path=None, encoding='utf-8'):
"""Init the loader.
:Parameters:
- `allowed_path`: path of the template-files
- `encoding`: encoding of the template-files
:Exceptions:
- `ValueError`: if `allowed_path` is not a directory
"""
... | [
"def",
"__init__",
"(",
"self",
",",
"allowed_path",
"=",
"None",
",",
"encoding",
"=",
"'utf-8'",
")",
":",
"if",
"allowed_path",
"and",
"not",
"os",
".",
"path",
".",
"isdir",
"(",
"allowed_path",
")",
":",
"raise",
"ValueError",
"(",
"\"'allowed_path' h... | https://github.com/alexozer/jankdrone/blob/c4b403eb254b41b832ab2bdfade12ba59c99e5dc/shm/lib/pyratemp/pyratemp.py#L393-L405 | ||
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/cut.py | python | cut | (
x,
bins,
right: bool = True,
labels=None,
retbins: bool = False,
precision: int = 3,
include_lowest: bool = False,
duplicates: str = "raise",
ordered: bool = True,
) | Bin values into discrete intervals.
Use cut when you need to segment and sort data values into bins. This
function is also useful for going from a continuous variable to a
categorical variable.
Parameters
----------
x : array-like
The input array to be binned. Must be 1-dimensional.
... | Bin values into discrete intervals.
Use cut when you need to segment and sort data values into bins. This
function is also useful for going from a continuous variable to a
categorical variable.
Parameters
----------
x : array-like
The input array to be binned. Must be 1-dimensional.
... | [
"Bin",
"values",
"into",
"discrete",
"intervals",
".",
"Use",
"cut",
"when",
"you",
"need",
"to",
"segment",
"and",
"sort",
"data",
"values",
"into",
"bins",
".",
"This",
"function",
"is",
"also",
"useful",
"for",
"going",
"from",
"a",
"continuous",
"varia... | def cut(
x,
bins,
right: bool = True,
labels=None,
retbins: bool = False,
precision: int = 3,
include_lowest: bool = False,
duplicates: str = "raise",
ordered: bool = True,
):
"""
Bin values into discrete intervals.
Use cut when you need to segment and sort data values i... | [
"def",
"cut",
"(",
"x",
",",
"bins",
",",
"right",
":",
"bool",
"=",
"True",
",",
"labels",
"=",
"None",
",",
"retbins",
":",
"bool",
"=",
"False",
",",
"precision",
":",
"int",
"=",
"3",
",",
"include_lowest",
":",
"bool",
"=",
"False",
",",
"du... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/cut.py#L13-L295 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/util/_decorators.py | python | deprecate_kwarg | (old_arg_name, new_arg_name, mapping=None, stacklevel=2) | return _deprecate_kwarg | Decorator to deprecate a keyword argument of a function.
Parameters
----------
old_arg_name : str
Name of argument in function to deprecate
new_arg_name : str or None
Name of preferred argument in function. Use None to raise warning that
``old_arg_name`` keyword is deprecated.
... | Decorator to deprecate a keyword argument of a function. | [
"Decorator",
"to",
"deprecate",
"a",
"keyword",
"argument",
"of",
"a",
"function",
"."
] | def deprecate_kwarg(old_arg_name, new_arg_name, mapping=None, stacklevel=2):
"""
Decorator to deprecate a keyword argument of a function.
Parameters
----------
old_arg_name : str
Name of argument in function to deprecate
new_arg_name : str or None
Name of preferred argument in f... | [
"def",
"deprecate_kwarg",
"(",
"old_arg_name",
",",
"new_arg_name",
",",
"mapping",
"=",
"None",
",",
"stacklevel",
"=",
"2",
")",
":",
"if",
"mapping",
"is",
"not",
"None",
"and",
"not",
"hasattr",
"(",
"mapping",
",",
"'get'",
")",
"and",
"not",
"calla... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/util/_decorators.py#L77-L190 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ebmlib/_trash.py | python | _unixTrash | (paths) | Move paths to FreeDesktop Trash can
See <http://www.ramendik.ru/docs/trashspec.html> | Move paths to FreeDesktop Trash can
See <http://www.ramendik.ru/docs/trashspec.html> | [
"Move",
"paths",
"to",
"FreeDesktop",
"Trash",
"can",
"See",
"<http",
":",
"//",
"www",
".",
"ramendik",
".",
"ru",
"/",
"docs",
"/",
"trashspec",
".",
"html",
">"
] | def _unixTrash(paths):
"""
Move paths to FreeDesktop Trash can
See <http://www.ramendik.ru/docs/trashspec.html>
"""
trashdir = os.path.join(os.environ.get('XDG_DATA_HOME',
os.path.join(os.path.expanduser('~'),'.local','share')), 'Trash')
# Create trash d... | [
"def",
"_unixTrash",
"(",
"paths",
")",
":",
"trashdir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"environ",
".",
"get",
"(",
"'XDG_DATA_HOME'",
",",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"path",
".",
"expanduser",
"(",
"'~'",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ebmlib/_trash.py#L137-L197 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/deps/v8/third_party/jinja2/lexer.py | python | compile_rules | (environment) | return [x[1:] for x in sorted(rules, reverse=True)] | Compiles all the rules from the environment into a list of rules. | Compiles all the rules from the environment into a list of rules. | [
"Compiles",
"all",
"the",
"rules",
"from",
"the",
"environment",
"into",
"a",
"list",
"of",
"rules",
"."
] | def compile_rules(environment):
"""Compiles all the rules from the environment into a list of rules."""
e = re.escape
rules = [
(len(environment.comment_start_string), 'comment',
e(environment.comment_start_string)),
(len(environment.block_start_string), 'block',
e(environm... | [
"def",
"compile_rules",
"(",
"environment",
")",
":",
"e",
"=",
"re",
".",
"escape",
"rules",
"=",
"[",
"(",
"len",
"(",
"environment",
".",
"comment_start_string",
")",
",",
"'comment'",
",",
"e",
"(",
"environment",
".",
"comment_start_string",
")",
")",... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/deps/v8/third_party/jinja2/lexer.py#L196-L216 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/json_schema_compiler/js_interface_generator.py | python | _Generator._AppendInterfaceObject | (self, c) | Appends the code creating the interface object.
For example:
/** @interface */
function SettingsPrivate() {} | Appends the code creating the interface object.
For example:
/** | [
"Appends",
"the",
"code",
"creating",
"the",
"interface",
"object",
".",
"For",
"example",
":",
"/",
"**"
] | def _AppendInterfaceObject(self, c):
"""Appends the code creating the interface object.
For example:
/** @interface */
function SettingsPrivate() {}
"""
(c.Append('/** @interface */')
.Append('function %s() {}' % self._interface)) | [
"def",
"_AppendInterfaceObject",
"(",
"self",
",",
"c",
")",
":",
"(",
"c",
".",
"Append",
"(",
"'/** @interface */'",
")",
".",
"Append",
"(",
"'function %s() {}'",
"%",
"self",
".",
"_interface",
")",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/json_schema_compiler/js_interface_generator.py#L69-L76 | ||
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/gdal-utils/osgeo_utils/gdal_merge.py | python | names_to_fileinfos | (names) | return file_infos | Translate a list of GDAL filenames, into file_info objects.
names -- list of valid GDAL dataset names.
Returns a list of file_info objects. There may be less file_info objects
than names if some of the names could not be opened as GDAL files. | Translate a list of GDAL filenames, into file_info objects. | [
"Translate",
"a",
"list",
"of",
"GDAL",
"filenames",
"into",
"file_info",
"objects",
"."
] | def names_to_fileinfos(names):
"""
Translate a list of GDAL filenames, into file_info objects.
names -- list of valid GDAL dataset names.
Returns a list of file_info objects. There may be less file_info objects
than names if some of the names could not be opened as GDAL files.
"""
file_i... | [
"def",
"names_to_fileinfos",
"(",
"names",
")",
":",
"file_infos",
"=",
"[",
"]",
"for",
"name",
"in",
"names",
":",
"fi",
"=",
"file_info",
"(",
")",
"if",
"fi",
".",
"init_from_name",
"(",
"name",
")",
"==",
"1",
":",
"file_infos",
".",
"append",
"... | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/gdal-utils/osgeo_utils/gdal_merge.py#L138-L154 | |
alibaba/weex_js_engine | 2bdf4b6f020c1fc99c63f649718f6faf7e27fdde | jni/v8core/v8/build/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings._GetStandaloneBinaryPath | (self) | return target_prefix + target + target_ext | Returns the name of the non-bundle binary represented by this target.
E.g. hello_world. Only valid for non-bundles. | Returns the name of the non-bundle binary represented by this target.
E.g. hello_world. Only valid for non-bundles. | [
"Returns",
"the",
"name",
"of",
"the",
"non",
"-",
"bundle",
"binary",
"represented",
"by",
"this",
"target",
".",
"E",
".",
"g",
".",
"hello_world",
".",
"Only",
"valid",
"for",
"non",
"-",
"bundles",
"."
] | def _GetStandaloneBinaryPath(self):
"""Returns the name of the non-bundle binary represented by this target.
E.g. hello_world. Only valid for non-bundles."""
assert not self._IsBundle()
assert self.spec['type'] in (
'executable', 'shared_library', 'static_library', 'loadable_module'), (
... | [
"def",
"_GetStandaloneBinaryPath",
"(",
"self",
")",
":",
"assert",
"not",
"self",
".",
"_IsBundle",
"(",
")",
"assert",
"self",
".",
"spec",
"[",
"'type'",
"]",
"in",
"(",
"'executable'",
",",
"'shared_library'",
",",
"'static_library'",
",",
"'loadable_modul... | https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/xcode_emulation.py#L186-L204 | |
jackaudio/jack2 | 21b293dbc37d42446141a08922cdec0d2550c6a0 | waflib/Task.py | python | Task.compute_sig_implicit_deps | (self) | return self.m.digest() | Used by :py:meth:`waflib.Task.Task.sig_implicit_deps` for computing the actual hash of the
:py:class:`waflib.Node.Node` returned by the scanner.
:return: a hash value for the implicit dependencies
:rtype: string or bytes | Used by :py:meth:`waflib.Task.Task.sig_implicit_deps` for computing the actual hash of the
:py:class:`waflib.Node.Node` returned by the scanner. | [
"Used",
"by",
":",
"py",
":",
"meth",
":",
"waflib",
".",
"Task",
".",
"Task",
".",
"sig_implicit_deps",
"for",
"computing",
"the",
"actual",
"hash",
"of",
"the",
":",
"py",
":",
"class",
":",
"waflib",
".",
"Node",
".",
"Node",
"returned",
"by",
"th... | def compute_sig_implicit_deps(self):
"""
Used by :py:meth:`waflib.Task.Task.sig_implicit_deps` for computing the actual hash of the
:py:class:`waflib.Node.Node` returned by the scanner.
:return: a hash value for the implicit dependencies
:rtype: string or bytes
"""
upd = self.m.update
self.are_implicit... | [
"def",
"compute_sig_implicit_deps",
"(",
"self",
")",
":",
"upd",
"=",
"self",
".",
"m",
".",
"update",
"self",
".",
"are_implicit_nodes_ready",
"(",
")",
"# scanner returns a node that does not have a signature",
"# just *ignore* the error and let them figure out from the comp... | https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/Task.py#L856-L872 | |
fengbingchun/NN_Test | d6305825d5273e4569ccd1eda9ffa2a9c72e18d2 | src/tiny-dnn/third_party/gemmlowp/meta/generators/meta_arm_32.py | python | Main | () | Generate the single threaded meta gemm library. | Generate the single threaded meta gemm library. | [
"Generate",
"the",
"single",
"threaded",
"meta",
"gemm",
"library",
"."
] | def Main():
"""Generate the single threaded meta gemm library."""
cc = cc_emitter.CCEmitter()
meta_arm_common.GenerateHeader(cc, 'gemmlowp_meta_single_thread_gemm_arm32',
'GEMMLOWP_NEON_32')
cc.EmitNamespaceBegin('gemmlowp')
cc.EmitNamespaceBegin('meta')
cc.EmitNamespaceBeg... | [
"def",
"Main",
"(",
")",
":",
"cc",
"=",
"cc_emitter",
".",
"CCEmitter",
"(",
")",
"meta_arm_common",
".",
"GenerateHeader",
"(",
"cc",
",",
"'gemmlowp_meta_single_thread_gemm_arm32'",
",",
"'GEMMLOWP_NEON_32'",
")",
"cc",
".",
"EmitNamespaceBegin",
"(",
"'gemmlow... | https://github.com/fengbingchun/NN_Test/blob/d6305825d5273e4569ccd1eda9ffa2a9c72e18d2/src/tiny-dnn/third_party/gemmlowp/meta/generators/meta_arm_32.py#L8-L27 | ||
google/ion | ef47f3b824050499ce5c6f774b366f6c4dbce0af | ion/build.py | python | BuildState._ParseCommandLineArgs | (self, argv) | return parser.parse_args(argv[1:]) | Parses command line arguments and shows help/usage if necessary.
This function wraps some advanced usage of argparse.parser. We use a two-
pass parsing strategy: the first pass populates all of the options and
arguments that aren't dependent on any other options (which is most of
them). The second pas... | Parses command line arguments and shows help/usage if necessary. | [
"Parses",
"command",
"line",
"arguments",
"and",
"shows",
"help",
"/",
"usage",
"if",
"necessary",
"."
] | def _ParseCommandLineArgs(self, argv):
"""Parses command line arguments and shows help/usage if necessary.
This function wraps some advanced usage of argparse.parser. We use a two-
pass parsing strategy: the first pass populates all of the options and
arguments that aren't dependent on any other optio... | [
"def",
"_ParseCommandLineArgs",
"(",
"self",
",",
"argv",
")",
":",
"# Load the registry of builders that have been annotated with",
"# @RegisterBuilder and determine what OSes and configurations we know how to",
"# build. This information is displayed if the --help option is found.",
"availa... | https://github.com/google/ion/blob/ef47f3b824050499ce5c6f774b366f6c4dbce0af/ion/build.py#L1869-L2063 | |
smilehao/xlua-framework | a03801538be2b0e92d39332d445b22caca1ef61f | ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/internal/python_message.py | python | _DefaultValueConstructorForField | (field) | return MakeScalarDefault | Returns a function which returns a default value for a field.
Args:
field: FieldDescriptor object for this field.
The returned function has one argument:
message: Message instance containing this field, or a weakref proxy
of same.
That function in turn returns a default value for this field. The... | Returns a function which returns a default value for a field. | [
"Returns",
"a",
"function",
"which",
"returns",
"a",
"default",
"value",
"for",
"a",
"field",
"."
] | def _DefaultValueConstructorForField(field):
"""Returns a function which returns a default value for a field.
Args:
field: FieldDescriptor object for this field.
The returned function has one argument:
message: Message instance containing this field, or a weakref proxy
of same.
That function in... | [
"def",
"_DefaultValueConstructorForField",
"(",
"field",
")",
":",
"if",
"field",
".",
"label",
"==",
"_FieldDescriptor",
".",
"LABEL_REPEATED",
":",
"if",
"field",
".",
"has_default_value",
"and",
"field",
".",
"default_value",
"!=",
"[",
"]",
":",
"raise",
"... | https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/internal/python_message.py#L248-L294 | |
emscripten-core/emscripten | 0d413d3c5af8b28349682496edc14656f5700c2f | third_party/ply/example/BASIC/basparse.py | python | p_expr_group | (p) | expr : LPAREN expr RPAREN | expr : LPAREN expr RPAREN | [
"expr",
":",
"LPAREN",
"expr",
"RPAREN"
] | def p_expr_group(p):
'''expr : LPAREN expr RPAREN'''
p[0] = ('GROUP',p[2]) | [
"def",
"p_expr_group",
"(",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"(",
"'GROUP'",
",",
"p",
"[",
"2",
"]",
")"
] | https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/BASIC/basparse.py#L300-L302 | ||
bigartm/bigartm | 47e37f982de87aa67bfd475ff1f39da696b181b3 | 3rdparty/protobuf-3.0.0/gmock/scripts/generator/cpp/ast.py | python | Node.IsDefinition | (self) | return False | Returns bool if this node is a definition. | Returns bool if this node is a definition. | [
"Returns",
"bool",
"if",
"this",
"node",
"is",
"a",
"definition",
"."
] | def IsDefinition(self):
"""Returns bool if this node is a definition."""
return False | [
"def",
"IsDefinition",
"(",
"self",
")",
":",
"return",
"False"
] | https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/gmock/scripts/generator/cpp/ast.py#L119-L121 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/pkg_resources/_vendor/pyparsing.py | python | ParserElement.__ror__ | (self, other ) | return other | self | Implementation of | operator when left operand is not a C{L{ParserElement}} | Implementation of | operator when left operand is not a C{L{ParserElement}} | [
"Implementation",
"of",
"|",
"operator",
"when",
"left",
"operand",
"is",
"not",
"a",
"C",
"{",
"L",
"{",
"ParserElement",
"}}"
] | def __ror__(self, other ):
"""
Implementation of | operator when left operand is not a C{L{ParserElement}}
"""
if isinstance( other, basestring ):
other = ParserElement._literalStringClass( other )
if not isinstance( other, ParserElement ):
warnings.warn("... | [
"def",
"__ror__",
"(",
"self",
",",
"other",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"basestring",
")",
":",
"other",
"=",
"ParserElement",
".",
"_literalStringClass",
"(",
"other",
")",
"if",
"not",
"isinstance",
"(",
"other",
",",
"ParserElement... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/pkg_resources/_vendor/pyparsing.py#L1960-L1970 | |
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/compiler.py | python | CodeGenerator.macro_def | (self, node, frame) | Dump the macro definition for the def created by macro_body. | Dump the macro definition for the def created by macro_body. | [
"Dump",
"the",
"macro",
"definition",
"for",
"the",
"def",
"created",
"by",
"macro_body",
"."
] | def macro_def(self, node, frame):
"""Dump the macro definition for the def created by macro_body."""
arg_tuple = ', '.join(repr(x.name) for x in node.args)
name = getattr(node, 'name', None)
if len(node.args) == 1:
arg_tuple += ','
self.write('Macro(environment, macro... | [
"def",
"macro_def",
"(",
"self",
",",
"node",
",",
"frame",
")",
":",
"arg_tuple",
"=",
"', '",
".",
"join",
"(",
"repr",
"(",
"x",
".",
"name",
")",
"for",
"x",
"in",
"node",
".",
"args",
")",
"name",
"=",
"getattr",
"(",
"node",
",",
"'name'",
... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/compiler.py#L735-L750 | ||
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TNEANet.GetRndEI | (self, *args) | return _snap.TNEANet_GetRndEI(self, *args) | GetRndEI(TNEANet self, TRnd Rnd=Rnd) -> TNEANet::TEdgeI
Parameters:
Rnd: TRnd &
GetRndEI(TNEANet self) -> TNEANet::TEdgeI
Parameters:
self: TNEANet * | GetRndEI(TNEANet self, TRnd Rnd=Rnd) -> TNEANet::TEdgeI | [
"GetRndEI",
"(",
"TNEANet",
"self",
"TRnd",
"Rnd",
"=",
"Rnd",
")",
"-",
">",
"TNEANet",
"::",
"TEdgeI"
] | def GetRndEI(self, *args):
"""
GetRndEI(TNEANet self, TRnd Rnd=Rnd) -> TNEANet::TEdgeI
Parameters:
Rnd: TRnd &
GetRndEI(TNEANet self) -> TNEANet::TEdgeI
Parameters:
self: TNEANet *
"""
return _snap.TNEANet_GetRndEI(self, *args) | [
"def",
"GetRndEI",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TNEANet_GetRndEI",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L21929-L21942 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/eclib/pstatbar.py | python | ProgressStatusBar.IsBusy | (self) | return self.timer.IsRunning() | Is the progress indicator busy or not
@return: bool | Is the progress indicator busy or not
@return: bool | [
"Is",
"the",
"progress",
"indicator",
"busy",
"or",
"not",
"@return",
":",
"bool"
] | def IsBusy(self):
"""Is the progress indicator busy or not
@return: bool
"""
return self.timer.IsRunning() | [
"def",
"IsBusy",
"(",
"self",
")",
":",
"return",
"self",
".",
"timer",
".",
"IsRunning",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/eclib/pstatbar.py#L157-L162 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_osx_support.py | python | _remove_unsupported_archs | (_config_vars) | return _config_vars | Remove any unsupported archs from config vars | Remove any unsupported archs from config vars | [
"Remove",
"any",
"unsupported",
"archs",
"from",
"config",
"vars"
] | def _remove_unsupported_archs(_config_vars):
"""Remove any unsupported archs from config vars"""
# Different Xcode releases support different sets for '-arch'
# flags. In particular, Xcode 4.x no longer supports the
# PPC architectures.
#
# This code automatically removes '-arch ppc' and '-arch ... | [
"def",
"_remove_unsupported_archs",
"(",
"_config_vars",
")",
":",
"# Different Xcode releases support different sets for '-arch'",
"# flags. In particular, Xcode 4.x no longer supports the",
"# PPC architectures.",
"#",
"# This code automatically removes '-arch ppc' and '-arch ppc64'",
"# whe... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_osx_support.py#L220-L257 | |
facebook/openr | ed38bdfd6bf290084bfab4821b59f83e7b59315d | build/fbcode_builder/getdeps/fetcher.py | python | copy_if_different | (src_name, dest_name) | return True | Copy src_name -> dest_name, but only touch dest_name
if src_name is different from dest_name, making this a
more build system friendly way to copy. | Copy src_name -> dest_name, but only touch dest_name
if src_name is different from dest_name, making this a
more build system friendly way to copy. | [
"Copy",
"src_name",
"-",
">",
"dest_name",
"but",
"only",
"touch",
"dest_name",
"if",
"src_name",
"is",
"different",
"from",
"dest_name",
"making",
"this",
"a",
"more",
"build",
"system",
"friendly",
"way",
"to",
"copy",
"."
] | def copy_if_different(src_name, dest_name):
"""Copy src_name -> dest_name, but only touch dest_name
if src_name is different from dest_name, making this a
more build system friendly way to copy."""
src_st = os.lstat(src_name)
if not does_file_need_update(src_name, src_st, dest_name):
return ... | [
"def",
"copy_if_different",
"(",
"src_name",
",",
"dest_name",
")",
":",
"src_st",
"=",
"os",
".",
"lstat",
"(",
"src_name",
")",
"if",
"not",
"does_file_need_update",
"(",
"src_name",
",",
"src_st",
",",
"dest_name",
")",
":",
"return",
"False",
"dest_paren... | https://github.com/facebook/openr/blob/ed38bdfd6bf290084bfab4821b59f83e7b59315d/build/fbcode_builder/getdeps/fetcher.py#L359-L383 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/coremodules/demand/origin_to_destination_wxgui.py | python | AddOdDialog.refresh_browser | (self) | Deletes previous conents
Builds panel for obj
Updates path window and history | Deletes previous conents
Builds panel for obj
Updates path window and history | [
"Deletes",
"previous",
"conents",
"Builds",
"panel",
"for",
"obj",
"Updates",
"path",
"window",
"and",
"history"
] | def refresh_browser(self):
"""
Deletes previous conents
Builds panel for obj
Updates path window and history
"""
# print 'Wizzard.refresh_panel with',obj.ident
# remove previous obj panel
sizer = self.GetSizer()
sizer.Remove(0)
self.browse... | [
"def",
"refresh_browser",
"(",
"self",
")",
":",
"# print 'Wizzard.refresh_panel with',obj.ident",
"# remove previous obj panel",
"sizer",
"=",
"self",
".",
"GetSizer",
"(",
")",
"sizer",
".",
"Remove",
"(",
"0",
")",
"self",
".",
"browser",
".",
"Destroy",
"(",
... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/demand/origin_to_destination_wxgui.py#L848-L866 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | models/AI-Model-Zoo/caffe-xilinx/scripts/cpp_lint.py | python | _OutputFormat | () | return _cpplint_state.output_format | Gets the module's output format. | Gets the module's output format. | [
"Gets",
"the",
"module",
"s",
"output",
"format",
"."
] | def _OutputFormat():
"""Gets the module's output format."""
return _cpplint_state.output_format | [
"def",
"_OutputFormat",
"(",
")",
":",
"return",
"_cpplint_state",
".",
"output_format"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/models/AI-Model-Zoo/caffe-xilinx/scripts/cpp_lint.py#L767-L769 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/collections.py | python | Counter.__add__ | (self, other) | return result | Add counts from two counters.
>>> Counter('abbb') + Counter('bcc')
Counter({'b': 4, 'c': 2, 'a': 1}) | Add counts from two counters. | [
"Add",
"counts",
"from",
"two",
"counters",
"."
] | def __add__(self, other):
'''Add counts from two counters.
>>> Counter('abbb') + Counter('bcc')
Counter({'b': 4, 'c': 2, 'a': 1})
'''
if not isinstance(other, Counter):
return NotImplemented
result = Counter()
for elem, count in self.items():
... | [
"def",
"__add__",
"(",
"self",
",",
"other",
")",
":",
"if",
"not",
"isinstance",
"(",
"other",
",",
"Counter",
")",
":",
"return",
"NotImplemented",
"result",
"=",
"Counter",
"(",
")",
"for",
"elem",
",",
"count",
"in",
"self",
".",
"items",
"(",
")... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/collections.py#L584-L601 | |
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py | python | DependencyGraphNode.DirectDependencies | (self, dependencies=None) | return dependencies | Returns a list of just direct dependencies. | Returns a list of just direct dependencies. | [
"Returns",
"a",
"list",
"of",
"just",
"direct",
"dependencies",
"."
] | def DirectDependencies(self, dependencies=None):
"""Returns a list of just direct dependencies."""
if dependencies == None:
dependencies = []
for dependency in self.dependencies:
# Check for None, corresponding to the root node.
if dependency.ref != None and dependency.ref not in dependen... | [
"def",
"DirectDependencies",
"(",
"self",
",",
"dependencies",
"=",
"None",
")",
":",
"if",
"dependencies",
"==",
"None",
":",
"dependencies",
"=",
"[",
"]",
"for",
"dependency",
"in",
"self",
".",
"dependencies",
":",
"# Check for None, corresponding to the root ... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py#L1600-L1610 | |
seqan/seqan | f5f658343c366c9c3d44ba358ffc9317e78a09ed | util/py_lib/clang/cindex.py | python | SourceLocation.file | (self) | return self._get_instantiation()[0] | Get the file represented by this source location. | Get the file represented by this source location. | [
"Get",
"the",
"file",
"represented",
"by",
"this",
"source",
"location",
"."
] | def file(self):
"""Get the file represented by this source location."""
return self._get_instantiation()[0] | [
"def",
"file",
"(",
"self",
")",
":",
"return",
"self",
".",
"_get_instantiation",
"(",
")",
"[",
"0",
"]"
] | https://github.com/seqan/seqan/blob/f5f658343c366c9c3d44ba358ffc9317e78a09ed/util/py_lib/clang/cindex.py#L119-L121 | |
RobotLocomotion/drake | 0e18a34604c45ed65bc9018a54f7610f91cdad5b | tools/workspace/pybind11/mkdoc.py | python | print_symbols | (f, name, node, level=0, *, tree_parser_doc,
tree_parser_xpath, ignore_dirs_for_coverage) | Prints C++ code for relevant documentation. | Prints C++ code for relevant documentation. | [
"Prints",
"C",
"++",
"code",
"for",
"relevant",
"documentation",
"."
] | def print_symbols(f, name, node, level=0, *, tree_parser_doc,
tree_parser_xpath, ignore_dirs_for_coverage):
"""
Prints C++ code for relevant documentation.
"""
indent = ' ' * level
def iprint(s):
f.write((indent + s).rstrip() + "\n")
name_var = name
if not node.f... | [
"def",
"print_symbols",
"(",
"f",
",",
"name",
",",
"node",
",",
"level",
"=",
"0",
",",
"*",
",",
"tree_parser_doc",
",",
"tree_parser_xpath",
",",
"ignore_dirs_for_coverage",
")",
":",
"indent",
"=",
"' '",
"*",
"level",
"def",
"iprint",
"(",
"s",
")"... | https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/tools/workspace/pybind11/mkdoc.py#L541-L637 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/linear_optimizer/python/ops/sdca_ops.py | python | _ShardedMutableHashTable.values_reduce_sum | (self, name=None) | return math_ops.add_n(sums) | Computes reduce_sum reducing dimension 0 across all values in all shards.
Args:
name: A name for the operation (optional).
Returns:
A tensor with the sum across all values in the same shape as the table's
value shape. | Computes reduce_sum reducing dimension 0 across all values in all shards. | [
"Computes",
"reduce_sum",
"reducing",
"dimension",
"0",
"across",
"all",
"values",
"in",
"all",
"shards",
"."
] | def values_reduce_sum(self, name=None):
"""Computes reduce_sum reducing dimension 0 across all values in all shards.
Args:
name: A name for the operation (optional).
Returns:
A tensor with the sum across all values in the same shape as the table's
value shape.
"""
# TODO(andreass... | [
"def",
"values_reduce_sum",
"(",
"self",
",",
"name",
"=",
"None",
")",
":",
"# TODO(andreasst): consider replacing with something like export_sharded",
"# and doing the sum in SdcaModel.",
"sums",
"=",
"[",
"]",
"for",
"table_shard",
"in",
"self",
".",
"_table_shards",
"... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/linear_optimizer/python/ops/sdca_ops.py#L154-L170 | |
mgbellemare/Arcade-Learning-Environment | 0af0ff4a49a981d113c67b866fa152dbc7a1c0a7 | src/gym/envs/atari/environment.py | python | AtariEnv.__init__ | (
self,
game: str = "pong",
mode: Optional[int] = None,
difficulty: Optional[int] = None,
obs_type: str = "rgb",
frameskip: Union[Tuple[int, int], int] = 5,
repeat_action_probability: float = 0.25,
full_action_space: bool = True,
render_mode: str =... | Initialize the ALE for Gym.
Default parameters are taken from Machado et al., 2018.
Args:
game: str => Game to initialize env with.
mode: Optional[int] => Game mode, see Machado et al., 2018
difficulty: Optional[int] => Game difficulty,see Machado et al., 2018
ob... | Initialize the ALE for Gym.
Default parameters are taken from Machado et al., 2018. | [
"Initialize",
"the",
"ALE",
"for",
"Gym",
".",
"Default",
"parameters",
"are",
"taken",
"from",
"Machado",
"et",
"al",
".",
"2018",
"."
] | def __init__(
self,
game: str = "pong",
mode: Optional[int] = None,
difficulty: Optional[int] = None,
obs_type: str = "rgb",
frameskip: Union[Tuple[int, int], int] = 5,
repeat_action_probability: float = 0.25,
full_action_space: bool = True,
render... | [
"def",
"__init__",
"(",
"self",
",",
"game",
":",
"str",
"=",
"\"pong\"",
",",
"mode",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
",",
"difficulty",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
",",
"obs_type",
":",
"str",
"=",
"\"rgb\"",
","... | https://github.com/mgbellemare/Arcade-Learning-Environment/blob/0af0ff4a49a981d113c67b866fa152dbc7a1c0a7/src/gym/envs/atari/environment.py#L25-L149 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/Tools/suncxx.py | python | sxx_common_flags | (conf) | Flags required for executing the sun C++ compiler | Flags required for executing the sun C++ compiler | [
"Flags",
"required",
"for",
"executing",
"the",
"sun",
"C",
"++",
"compiler"
] | def sxx_common_flags(conf):
"""
Flags required for executing the sun C++ compiler
"""
v = conf.env
v['CXX_SRC_F'] = []
v['CXX_TGT_F'] = ['-c', '-o']
# linker
if not v['LINK_CXX']: v['LINK_CXX'] = v['CXX']
v['CXXLNK_SRC_F'] = []
v['CXXLNK_TGT_F'] = ['-o']
v['CPPPATH_ST'] ... | [
"def",
"sxx_common_flags",
"(",
"conf",
")",
":",
"v",
"=",
"conf",
".",
"env",
"v",
"[",
"'CXX_SRC_F'",
"]",
"=",
"[",
"]",
"v",
"[",
"'CXX_TGT_F'",
"]",
"=",
"[",
"'-c'",
",",
"'-o'",
"]",
"# linker",
"if",
"not",
"v",
"[",
"'LINK_CXX'",
"]",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Tools/suncxx.py#L36-L71 | ||
google/angle | d5df233189cad620b8e0de653fe5e6cb778e209d | third_party/logdog/logdog/stream.py | python | StreamClient.project | (self) | return self._project | Returns (str or None): The stream project, or None if not configured. | Returns (str or None): The stream project, or None if not configured. | [
"Returns",
"(",
"str",
"or",
"None",
")",
":",
"The",
"stream",
"project",
"or",
"None",
"if",
"not",
"configured",
"."
] | def project(self):
"""Returns (str or None): The stream project, or None if not configured."""
return self._project | [
"def",
"project",
"(",
"self",
")",
":",
"return",
"self",
".",
"_project"
] | https://github.com/google/angle/blob/d5df233189cad620b8e0de653fe5e6cb778e209d/third_party/logdog/logdog/stream.py#L253-L255 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | RadioBox.IsItemShown | (*args, **kwargs) | return _controls_.RadioBox_IsItemShown(*args, **kwargs) | IsItemShown(self, unsigned int n) -> bool | IsItemShown(self, unsigned int n) -> bool | [
"IsItemShown",
"(",
"self",
"unsigned",
"int",
"n",
")",
"-",
">",
"bool"
] | def IsItemShown(*args, **kwargs):
"""IsItemShown(self, unsigned int n) -> bool"""
return _controls_.RadioBox_IsItemShown(*args, **kwargs) | [
"def",
"IsItemShown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"RadioBox_IsItemShown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L2641-L2643 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/uuid.py | python | getnode | () | Get the hardware address as a 48-bit positive integer.
The first time this runs, it may launch a separate program, which could
be quite slow. If all attempts to obtain the hardware address fail, we
choose a random 48-bit number with its eighth bit set to 1 as recommended
in RFC 4122. | Get the hardware address as a 48-bit positive integer. | [
"Get",
"the",
"hardware",
"address",
"as",
"a",
"48",
"-",
"bit",
"positive",
"integer",
"."
] | def getnode():
"""Get the hardware address as a 48-bit positive integer.
The first time this runs, it may launch a separate program, which could
be quite slow. If all attempts to obtain the hardware address fail, we
choose a random 48-bit number with its eighth bit set to 1 as recommended
in RFC 4... | [
"def",
"getnode",
"(",
")",
":",
"global",
"_node",
"if",
"_node",
"is",
"not",
"None",
":",
"return",
"_node",
"import",
"sys",
"if",
"sys",
".",
"platform",
"==",
"'win32'",
":",
"getters",
"=",
"[",
"_windll_getnode",
",",
"_netbios_getnode",
",",
"_i... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/uuid.py#L461-L486 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/copy.py | python | copy | (x) | return _reconstruct(x, rv, 0) | Shallow copy operation on arbitrary Python objects.
See the module's __doc__ string for more info. | Shallow copy operation on arbitrary Python objects. | [
"Shallow",
"copy",
"operation",
"on",
"arbitrary",
"Python",
"objects",
"."
] | def copy(x):
"""Shallow copy operation on arbitrary Python objects.
See the module's __doc__ string for more info.
"""
cls = type(x)
copier = _copy_dispatch.get(cls)
if copier:
return copier(x)
copier = getattr(cls, "__copy__", None)
if copier:
return copier(x)
r... | [
"def",
"copy",
"(",
"x",
")",
":",
"cls",
"=",
"type",
"(",
"x",
")",
"copier",
"=",
"_copy_dispatch",
".",
"get",
"(",
"cls",
")",
"if",
"copier",
":",
"return",
"copier",
"(",
"x",
")",
"copier",
"=",
"getattr",
"(",
"cls",
",",
"\"__copy__\"",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/copy.py#L66-L96 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/utils/generic_utils.py | python | _shared_object_loading_scope | () | return getattr(SHARED_OBJECT_LOADING, 'scope', NoopLoadingScope()) | Get the current shared object saving scope in a threadsafe manner. | Get the current shared object saving scope in a threadsafe manner. | [
"Get",
"the",
"current",
"shared",
"object",
"saving",
"scope",
"in",
"a",
"threadsafe",
"manner",
"."
] | def _shared_object_loading_scope():
"""Get the current shared object saving scope in a threadsafe manner."""
return getattr(SHARED_OBJECT_LOADING, 'scope', NoopLoadingScope()) | [
"def",
"_shared_object_loading_scope",
"(",
")",
":",
"return",
"getattr",
"(",
"SHARED_OBJECT_LOADING",
",",
"'scope'",
",",
"NoopLoadingScope",
"(",
")",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/utils/generic_utils.py#L135-L137 | |
OpenChemistry/tomviz | 0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a | tomviz/python/tomviz/executor.py | python | JsonProgress.write_to_file | (self, data) | Write data to write and return path. Implemented by subclass. | Write data to write and return path. Implemented by subclass. | [
"Write",
"data",
"to",
"write",
"and",
"return",
"path",
".",
"Implemented",
"by",
"subclass",
"."
] | def write_to_file(self, data):
"""
Write data to write and return path. Implemented by subclass.
""" | [
"def",
"write_to_file",
"(",
"self",
",",
"data",
")",
":"
] | https://github.com/OpenChemistry/tomviz/blob/0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a/tomviz/python/tomviz/executor.py#L131-L134 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/roslaunch/src/roslaunch/server.py | python | ROSLaunchChildNode.start | (self) | Initialize child. Must be called before run | Initialize child. Must be called before run | [
"Initialize",
"child",
".",
"Must",
"be",
"called",
"before",
"run"
] | def start(self):
"""
Initialize child. Must be called before run
"""
self.logger.info("starting roslaunch child process [%s], server URI is [%s]", self.name, self.server_uri)
super(ROSLaunchChildNode, self).start()
self._register_with_server() | [
"def",
"start",
"(",
"self",
")",
":",
"self",
".",
"logger",
".",
"info",
"(",
"\"starting roslaunch child process [%s], server URI is [%s]\"",
",",
"self",
".",
"name",
",",
"self",
".",
"server_uri",
")",
"super",
"(",
"ROSLaunchChildNode",
",",
"self",
")",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/roslaunch/src/roslaunch/server.py#L527-L533 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/idl_parser/idl_parser.py | python | IDLParser.p_ReadonlyMemberRest | (self, p) | ReadonlyMemberRest : AttributeRest
| MaplikeRest
| SetlikeRest | ReadonlyMemberRest : AttributeRest
| MaplikeRest
| SetlikeRest | [
"ReadonlyMemberRest",
":",
"AttributeRest",
"|",
"MaplikeRest",
"|",
"SetlikeRest"
] | def p_ReadonlyMemberRest(self, p):
"""ReadonlyMemberRest : AttributeRest
| MaplikeRest
| SetlikeRest"""
p[0] = p[1] | [
"def",
"p_ReadonlyMemberRest",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/idl_parser/idl_parser.py#L588-L592 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/runtime/nrt.py | python | _Runtime.library | (self) | return self._library | Return the Library object containing the various NRT functions. | Return the Library object containing the various NRT functions. | [
"Return",
"the",
"Library",
"object",
"containing",
"the",
"various",
"NRT",
"functions",
"."
] | def library(self):
"""
Return the Library object containing the various NRT functions.
"""
self._init_guard()
return self._library | [
"def",
"library",
"(",
"self",
")",
":",
"self",
".",
"_init_guard",
"(",
")",
"return",
"self",
".",
"_library"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/runtime/nrt.py#L65-L70 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/compiler/pycodegen.py | python | CodeGenerator.set_lineno | (self, node, force=False) | return False | Emit SET_LINENO if necessary.
The instruction is considered necessary if the node has a
lineno attribute and it is different than the last lineno
emitted.
Returns true if SET_LINENO was emitted.
There are no rules for when an AST node should have a lineno
attribute. T... | Emit SET_LINENO if necessary. | [
"Emit",
"SET_LINENO",
"if",
"necessary",
"."
] | def set_lineno(self, node, force=False):
"""Emit SET_LINENO if necessary.
The instruction is considered necessary if the node has a
lineno attribute and it is different than the last lineno
emitted.
Returns true if SET_LINENO was emitted.
There are no rules for when an... | [
"def",
"set_lineno",
"(",
"self",
",",
"node",
",",
"force",
"=",
"False",
")",
":",
"lineno",
"=",
"getattr",
"(",
"node",
",",
"'lineno'",
",",
"None",
")",
"if",
"lineno",
"is",
"not",
"None",
"and",
"(",
"lineno",
"!=",
"self",
".",
"last_lineno"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/compiler/pycodegen.py#L316-L336 | |
sfzhang15/FaceBoxes | b52cc92f9362d3adc08d54666aeb9ebb62fdb7da | scripts/cpp_lint.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.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to... | 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.
Args:
clean_lines: A CleansedLines instance contai... | [
"def",
"CloseExpression",
"(",
"clean_lines",
",",
"linenum",
",",
"pos",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"startchar",
"=",
"line",
"[",
"pos",
"]",
"if",
"startchar",
"not",
"in",
"'({[<'",
":",
"return",
"(",
... | https://github.com/sfzhang15/FaceBoxes/blob/b52cc92f9362d3adc08d54666aeb9ebb62fdb7da/scripts/cpp_lint.py#L1254-L1297 | |
cksystemsgroup/scal | fa2208a97a77d65f4e90f85fef3404c27c1f2ac2 | tools/cpplint.py | python | CheckForNonStandardConstructs | (filename, clean_lines, linenum,
nesting_state, error) | r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
Complain about several constructs which gcc-2 accepts, but which are
not standard C++. Warning about these in lint is one way to ease the
transition to new compilers.
- put storage class first (e.g. "static const" instead of "const stat... | r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2. | [
"r",
"Logs",
"an",
"error",
"if",
"we",
"see",
"certain",
"non",
"-",
"ANSI",
"constructs",
"ignored",
"by",
"gcc",
"-",
"2",
"."
] | def CheckForNonStandardConstructs(filename, clean_lines, linenum,
nesting_state, error):
r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
Complain about several constructs which gcc-2 accepts, but which are
not standard C++. Warning about these in lint ... | [
"def",
"CheckForNonStandardConstructs",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"# Remove comments from the line, but leave in strings for now.",
"line",
"=",
"clean_lines",
".",
"lines",
"[",
"linenum",
"]",
"i... | https://github.com/cksystemsgroup/scal/blob/fa2208a97a77d65f4e90f85fef3404c27c1f2ac2/tools/cpplint.py#L2573-L2734 | ||
MegEngine/MegEngine | ce9ad07a27ec909fb8db4dd67943d24ba98fb93a | imperative/python/megengine/utils/profile_analyzer.py | python | TimeFuncHelper._eval_time | (prof_type, end_key, func, opr_prof) | return func(time) | r"""Eval time.
Args:
prof_type: host' or 'device'.
end_key: kern' or 'end'.
func: apply to list of all ``thread`` of ``gpu`` time.
opr_prof: operator profiling result.
Returns:
time. | r"""Eval time. | [
"r",
"Eval",
"time",
"."
] | def _eval_time(prof_type, end_key, func, opr_prof):
r"""Eval time.
Args:
prof_type: host' or 'device'.
end_key: kern' or 'end'.
func: apply to list of all ``thread`` of ``gpu`` time.
opr_prof: operator profiling result.
Returns:
time... | [
"def",
"_eval_time",
"(",
"prof_type",
",",
"end_key",
",",
"func",
",",
"opr_prof",
")",
":",
"if",
"prof_type",
"not",
"in",
"opr_prof",
".",
"time_dict",
":",
"return",
"None",
"time",
"=",
"[",
"time",
"[",
"end_key",
"]",
"-",
"time",
"[",
"\"star... | https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/utils/profile_analyzer.py#L319-L335 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/tlslite/tlslite/TLSRecordLayer.py | python | TLSRecordLayer.getCipherImplementation | (self) | return self._writeState.encContext.implementation | Get the name of the cipher implementation used with
this connection.
@rtype: str
@return: The name of the cipher implementation used with
this connection. Either 'python', 'cryptlib', 'openssl',
or 'pycrypto'. | Get the name of the cipher implementation used with
this connection. | [
"Get",
"the",
"name",
"of",
"the",
"cipher",
"implementation",
"used",
"with",
"this",
"connection",
"."
] | def getCipherImplementation(self):
"""Get the name of the cipher implementation used with
this connection.
@rtype: str
@return: The name of the cipher implementation used with
this connection. Either 'python', 'cryptlib', 'openssl',
or 'pycrypto'.
"""
if... | [
"def",
"getCipherImplementation",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_writeState",
".",
"encContext",
":",
"return",
"None",
"return",
"self",
".",
"_writeState",
".",
"encContext",
".",
"implementation"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/tlslite/tlslite/TLSRecordLayer.py#L371-L382 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/independent.py | python | Independent.__init__ | (
self, distribution, reinterpreted_batch_ndims=None,
validate_args=False, name=None) | Construct a `Independent` distribution.
Args:
distribution: The base distribution instance to transform. Typically an
instance of `Distribution`.
reinterpreted_batch_ndims: Scalar, integer number of rightmost batch dims
which will be regarded as event dims. When `None` all but the first... | Construct a `Independent` distribution. | [
"Construct",
"a",
"Independent",
"distribution",
"."
] | def __init__(
self, distribution, reinterpreted_batch_ndims=None,
validate_args=False, name=None):
"""Construct a `Independent` distribution.
Args:
distribution: The base distribution instance to transform. Typically an
instance of `Distribution`.
reinterpreted_batch_ndims: Scal... | [
"def",
"__init__",
"(",
"self",
",",
"distribution",
",",
"reinterpreted_batch_ndims",
"=",
"None",
",",
"validate_args",
"=",
"False",
",",
"name",
"=",
"None",
")",
":",
"parameters",
"=",
"dict",
"(",
"locals",
"(",
")",
")",
"name",
"=",
"name",
"or"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/independent.py#L107-L156 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/cpplint.py | python | NestingState.Update | (self, filename, clean_lines, linenum, error) | Update nesting state with current line.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Update nesting state with current line. | [
"Update",
"nesting",
"state",
"with",
"current",
"line",
"."
] | def Update(self, filename, clean_lines, linenum, error):
"""Update nesting state with current line.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any err... | [
"def",
"Update",
"(",
"self",
",",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# Remember top of the previous nesting stack.",
"#",
"# The stack is always pushed/popped and no... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/cpplint.py#L3101-L3263 | ||
Xilinx/XRT | dd071c90309df61d3ecdd92dca39f43804915c99 | src/python/xrt_binding.py | python | xclCreateWriteQueue | (handle, q_ctx, q_hdl) | return libcore.xclCreateWriteQueue(handle, q_ctx, q_hdl) | Create Write Queue
:param handle:Device handle
:param q_ctx:Queue Context
:param q_hdl:Queue handle
:return:
This is used to create queue based on information provided in Queue context. Queue handle is generated if creation
successes.
This feature will be enabled in a future release. | Create Write Queue
:param handle:Device handle
:param q_ctx:Queue Context
:param q_hdl:Queue handle
:return: | [
"Create",
"Write",
"Queue",
":",
"param",
"handle",
":",
"Device",
"handle",
":",
"param",
"q_ctx",
":",
"Queue",
"Context",
":",
"param",
"q_hdl",
":",
"Queue",
"handle",
":",
"return",
":"
] | def xclCreateWriteQueue(handle, q_ctx, q_hdl):
"""
Create Write Queue
:param handle:Device handle
:param q_ctx:Queue Context
:param q_hdl:Queue handle
:return:
This is used to create queue based on information provided in Queue context. Queue handle is generated if creation
successes.
... | [
"def",
"xclCreateWriteQueue",
"(",
"handle",
",",
"q_ctx",
",",
"q_hdl",
")",
":",
"_xclStreamDeprecation",
"(",
"sys",
".",
"_getframe",
"(",
")",
".",
"f_code",
".",
"co_name",
")",
"libcore",
".",
"xclCreateWriteQueue",
".",
"restype",
"=",
"ctypes",
".",... | https://github.com/Xilinx/XRT/blob/dd071c90309df61d3ecdd92dca39f43804915c99/src/python/xrt_binding.py#L719-L734 | |
microsoft/ELL | a1d6bacc37a14879cc025d9be2ba40b1a0632315 | tools/importers/common/converters.py | python | LookupTable.get_originating_importer_node_for_output | (self, output_id: str) | return importer_node | Gets the originating ImporterNode for the output identified by output_id. | Gets the originating ImporterNode for the output identified by output_id. | [
"Gets",
"the",
"originating",
"ImporterNode",
"for",
"the",
"output",
"identified",
"by",
"output_id",
"."
] | def get_originating_importer_node_for_output(self, output_id: str) -> ImporterNode:
"""
Gets the originating ImporterNode for the output identified by output_id.
"""
try:
ell_node_id = self.output_id_to_ell_ids[output_id]
importer_node = self.ell_id_to_owning_impo... | [
"def",
"get_originating_importer_node_for_output",
"(",
"self",
",",
"output_id",
":",
"str",
")",
"->",
"ImporterNode",
":",
"try",
":",
"ell_node_id",
"=",
"self",
".",
"output_id_to_ell_ids",
"[",
"output_id",
"]",
"importer_node",
"=",
"self",
".",
"ell_id_to_... | https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/tools/importers/common/converters.py#L285-L294 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py | python | FlagValues._RegisterFlagByModule | (self, module_name, flag) | Records the module that defines a specific flag.
We keep track of which flag is defined by which module so that we
can later sort the flags by module.
Args:
module_name: A string, the name of a Python module.
flag: A Flag object, a flag that is key to the module. | Records the module that defines a specific flag. | [
"Records",
"the",
"module",
"that",
"defines",
"a",
"specific",
"flag",
"."
] | def _RegisterFlagByModule(self, module_name, flag):
"""Records the module that defines a specific flag.
We keep track of which flag is defined by which module so that we
can later sort the flags by module.
Args:
module_name: A string, the name of a Python module.
flag: A Flag object, a fla... | [
"def",
"_RegisterFlagByModule",
"(",
"self",
",",
"module_name",
",",
"flag",
")",
":",
"flags_by_module",
"=",
"self",
".",
"FlagsByModuleDict",
"(",
")",
"flags_by_module",
".",
"setdefault",
"(",
"module_name",
",",
"[",
"]",
")",
".",
"append",
"(",
"fla... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py#L876-L887 | ||
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/cherrypy/lib/httputil.py | python | HeaderMap.values | (self, key) | return [e.value for e in self.elements(key)] | Return a sorted list of HeaderElement.value for the given header. | Return a sorted list of HeaderElement.value for the given header. | [
"Return",
"a",
"sorted",
"list",
"of",
"HeaderElement",
".",
"value",
"for",
"the",
"given",
"header",
"."
] | def values(self, key):
"""Return a sorted list of HeaderElement.value for the given header."""
return [e.value for e in self.elements(key)] | [
"def",
"values",
"(",
"self",
",",
"key",
")",
":",
"return",
"[",
"e",
".",
"value",
"for",
"e",
"in",
"self",
".",
"elements",
"(",
"key",
")",
"]"
] | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/lib/httputil.py#L438-L440 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/msvs.py | python | _ShardTargets | (target_list, target_dicts) | return (new_target_list, new_target_dicts) | Shard some targets apart to work around the linkers limits.
Arguments:
target_list: List of target pairs: 'base/base.gyp:base'.
target_dicts: Dict of target properties keyed on target pair.
Returns:
Tuple of the new sharded versions of the inputs. | Shard some targets apart to work around the linkers limits. | [
"Shard",
"some",
"targets",
"apart",
"to",
"work",
"around",
"the",
"linkers",
"limits",
"."
] | def _ShardTargets(target_list, target_dicts):
"""Shard some targets apart to work around the linkers limits.
Arguments:
target_list: List of target pairs: 'base/base.gyp:base'.
target_dicts: Dict of target properties keyed on target pair.
Returns:
Tuple of the new sharded versions of the inputs.
""... | [
"def",
"_ShardTargets",
"(",
"target_list",
",",
"target_dicts",
")",
":",
"# Gather the targets to shard, and how many pieces.",
"targets_to_shard",
"=",
"{",
"}",
"for",
"t",
"in",
"target_dicts",
":",
"shards",
"=",
"int",
"(",
"target_dicts",
"[",
"t",
"]",
".... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/msvs.py#L1735-L1786 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/utils/extmath.py | python | stable_cumsum | (arr, axis=None, rtol=1e-05, atol=1e-08) | return out | Use high precision for cumsum and check that final value matches sum
Parameters
----------
arr : array-like
To be cumulatively summed as flat
axis : int, optional
Axis along which the cumulative sum is computed.
The default (None) is to compute the cumsum over the flattened arra... | Use high precision for cumsum and check that final value matches sum | [
"Use",
"high",
"precision",
"for",
"cumsum",
"and",
"check",
"that",
"final",
"value",
"matches",
"sum"
] | def stable_cumsum(arr, axis=None, rtol=1e-05, atol=1e-08):
"""Use high precision for cumsum and check that final value matches sum
Parameters
----------
arr : array-like
To be cumulatively summed as flat
axis : int, optional
Axis along which the cumulative sum is computed.
T... | [
"def",
"stable_cumsum",
"(",
"arr",
",",
"axis",
"=",
"None",
",",
"rtol",
"=",
"1e-05",
",",
"atol",
"=",
"1e-08",
")",
":",
"out",
"=",
"np",
".",
"cumsum",
"(",
"arr",
",",
"axis",
"=",
"axis",
",",
"dtype",
"=",
"np",
".",
"float64",
")",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/utils/extmath.py#L810-L832 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/telemetry/core/cros_interface.py | python | CrOSInterface.GetChromePid | (self) | return None | Returns pid of main chrome browser process. | Returns pid of main chrome browser process. | [
"Returns",
"pid",
"of",
"main",
"chrome",
"browser",
"process",
"."
] | def GetChromePid(self):
"""Returns pid of main chrome browser process."""
result = self.GetChromeProcess()
if result and 'pid' in result:
return result['pid']
return None | [
"def",
"GetChromePid",
"(",
"self",
")",
":",
"result",
"=",
"self",
".",
"GetChromeProcess",
"(",
")",
"if",
"result",
"and",
"'pid'",
"in",
"result",
":",
"return",
"result",
"[",
"'pid'",
"]",
"return",
"None"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/core/cros_interface.py#L393-L398 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/function_base.py | python | logspace | (start,stop,num=50,endpoint=True,base=10.0) | return _nx.power(base, y) | Return numbers spaced evenly on a log scale.
In linear space, the sequence starts at ``base ** start``
(`base` to the power of `start`) and ends with ``base ** stop``
(see `endpoint` below).
Parameters
----------
start : float
``base ** start`` is the starting value of the sequence.
... | Return numbers spaced evenly on a log scale. | [
"Return",
"numbers",
"spaced",
"evenly",
"on",
"a",
"log",
"scale",
"."
] | def logspace(start,stop,num=50,endpoint=True,base=10.0):
"""
Return numbers spaced evenly on a log scale.
In linear space, the sequence starts at ``base ** start``
(`base` to the power of `start`) and ends with ``base ** stop``
(see `endpoint` below).
Parameters
----------
start : floa... | [
"def",
"logspace",
"(",
"start",
",",
"stop",
",",
"num",
"=",
"50",
",",
"endpoint",
"=",
"True",
",",
"base",
"=",
"10.0",
")",
":",
"y",
"=",
"linspace",
"(",
"start",
",",
"stop",
",",
"num",
"=",
"num",
",",
"endpoint",
"=",
"endpoint",
")",... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/function_base.py#L98-L173 | |
CaoWGG/TensorRT-CenterNet | f949252e37b51e60f873808f46d3683f15735e79 | onnx-tensorrt/third_party/onnx/third_party/benchmark/tools/strip_asm.py | python | process_asm | (asm) | return new_contents | Strip the ASM of unwanted directives and lines | Strip the ASM of unwanted directives and lines | [
"Strip",
"the",
"ASM",
"of",
"unwanted",
"directives",
"and",
"lines"
] | def process_asm(asm):
"""
Strip the ASM of unwanted directives and lines
"""
new_contents = ''
asm = transform_labels(asm)
# TODO: Add more things we want to remove
discard_regexes = [
re.compile("\s+\..*$"), # directive
re.compile("\s*#(NO_APP|APP)$"), #inline ASM
r... | [
"def",
"process_asm",
"(",
"asm",
")",
":",
"new_contents",
"=",
"''",
"asm",
"=",
"transform_labels",
"(",
"asm",
")",
"# TODO: Add more things we want to remove",
"discard_regexes",
"=",
"[",
"re",
".",
"compile",
"(",
"\"\\s+\\..*$\"",
")",
",",
"# directive",
... | https://github.com/CaoWGG/TensorRT-CenterNet/blob/f949252e37b51e60f873808f46d3683f15735e79/onnx-tensorrt/third_party/onnx/third_party/benchmark/tools/strip_asm.py#L84-L121 | |
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/dataframe.py | python | DataFrame.apply_chunks | (
self,
func,
incols,
outcols,
kwargs=None,
pessimistic_nulls=True,
chunks=None,
blkct=None,
tpb=None,
) | return applyutils.apply_chunks(
self,
func,
incols,
outcols,
kwargs,
pessimistic_nulls,
chunks,
tpb=tpb,
) | Transform user-specified chunks using the user-provided function.
Parameters
----------
{params}
{params_chunks}
Examples
--------
For ``tpb > 1``, ``func`` is executed by ``tpb`` number of threads
concurrently. To access the thread id and count,
... | Transform user-specified chunks using the user-provided function. | [
"Transform",
"user",
"-",
"specified",
"chunks",
"using",
"the",
"user",
"-",
"provided",
"function",
"."
] | def apply_chunks(
self,
func,
incols,
outcols,
kwargs=None,
pessimistic_nulls=True,
chunks=None,
blkct=None,
tpb=None,
):
"""
Transform user-specified chunks using the user-provided function.
Parameters
--------... | [
"def",
"apply_chunks",
"(",
"self",
",",
"func",
",",
"incols",
",",
"outcols",
",",
"kwargs",
"=",
"None",
",",
"pessimistic_nulls",
"=",
"True",
",",
"chunks",
"=",
"None",
",",
"blkct",
"=",
"None",
",",
"tpb",
"=",
"None",
",",
")",
":",
"if",
... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/dataframe.py#L3913-L3977 | |
SonarOpenCommunity/sonar-cxx | 6e1d456fdcd45d35bcdc61c980e34d85fe88971e | cxx-squid/dox/tools/grammar_parser/grammar_parser.py | python | GrammarParser.root | (self, rulename) | Define root rule, search all dependant rules and remove all other rules. | Define root rule, search all dependant rules and remove all other rules. | [
"Define",
"root",
"rule",
"search",
"all",
"dependant",
"rules",
"and",
"remove",
"all",
"other",
"rules",
"."
] | def root(self, rulename):
"""
Define root rule, search all dependant rules and remove all other rules.
"""
expressions = {} # use map instead of set to keep order
expressions = self.__dependencies(rulename, expressions)
rules = {}
for expression in expressions:
... | [
"def",
"root",
"(",
"self",
",",
"rulename",
")",
":",
"expressions",
"=",
"{",
"}",
"# use map instead of set to keep order",
"expressions",
"=",
"self",
".",
"__dependencies",
"(",
"rulename",
",",
"expressions",
")",
"rules",
"=",
"{",
"}",
"for",
"expressi... | https://github.com/SonarOpenCommunity/sonar-cxx/blob/6e1d456fdcd45d35bcdc61c980e34d85fe88971e/cxx-squid/dox/tools/grammar_parser/grammar_parser.py#L117-L127 | ||
google-ar/WebARonTango | e86965d2cbc652156b480e0fcf77c716745578cd | chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py | python | InputStringArrayBucketArgument.IsPointer2D | (self) | return True | Overridden from Argument. | Overridden from Argument. | [
"Overridden",
"from",
"Argument",
"."
] | def IsPointer2D(self):
"""Overridden from Argument."""
return True | [
"def",
"IsPointer2D",
"(",
"self",
")",
":",
"return",
"True"
] | https://github.com/google-ar/WebARonTango/blob/e86965d2cbc652156b480e0fcf77c716745578cd/chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py#L9084-L9086 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/cef_parser.py | python | obj_function.get_capi_name | (self, prefix = None) | return get_capi_name(self.name, False, prefix) | Return the CAPI function name. | Return the CAPI function name. | [
"Return",
"the",
"CAPI",
"function",
"name",
"."
] | def get_capi_name(self, prefix = None):
""" Return the CAPI function name. """
if 'capi_name' in self.attribs:
return self.attribs['capi_name']
return get_capi_name(self.name, False, prefix) | [
"def",
"get_capi_name",
"(",
"self",
",",
"prefix",
"=",
"None",
")",
":",
"if",
"'capi_name'",
"in",
"self",
".",
"attribs",
":",
"return",
"self",
".",
"attribs",
"[",
"'capi_name'",
"]",
"return",
"get_capi_name",
"(",
"self",
".",
"name",
",",
"False... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/cef_parser.py#L1097-L1101 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/distutils/mingw32ccompiler.py | python | generate_def | (dll, dfile) | Given a dll file location, get all its exported symbols and dump them
into the given def file.
The .def file will be overwritten | Given a dll file location, get all its exported symbols and dump them
into the given def file. | [
"Given",
"a",
"dll",
"file",
"location",
"get",
"all",
"its",
"exported",
"symbols",
"and",
"dump",
"them",
"into",
"the",
"given",
"def",
"file",
"."
] | def generate_def(dll, dfile):
"""Given a dll file location, get all its exported symbols and dump them
into the given def file.
The .def file will be overwritten"""
dump = dump_table(dll)
for i in range(len(dump)):
if _START.match(dump[i].decode()):
break
else:
rais... | [
"def",
"generate_def",
"(",
"dll",
",",
"dfile",
")",
":",
"dump",
"=",
"dump_table",
"(",
"dll",
")",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"dump",
")",
")",
":",
"if",
"_START",
".",
"match",
"(",
"dump",
"[",
"i",
"]",
".",
"decode",
"... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/distutils/mingw32ccompiler.py#L268-L299 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/mailbox.py | python | Babyl._pre_mailbox_hook | (self, f) | Called before writing the mailbox to file f. | Called before writing the mailbox to file f. | [
"Called",
"before",
"writing",
"the",
"mailbox",
"to",
"file",
"f",
"."
] | def _pre_mailbox_hook(self, f):
"""Called before writing the mailbox to file f."""
babyl = b'BABYL OPTIONS:' + linesep
babyl += b'Version: 5' + linesep
labels = self.get_labels()
labels = (label.encode() for label in labels)
babyl += b'Labels:' + b','.join(labels) + lines... | [
"def",
"_pre_mailbox_hook",
"(",
"self",
",",
"f",
")",
":",
"babyl",
"=",
"b'BABYL OPTIONS:'",
"+",
"linesep",
"babyl",
"+=",
"b'Version: 5'",
"+",
"linesep",
"labels",
"=",
"self",
".",
"get_labels",
"(",
")",
"labels",
"=",
"(",
"label",
".",
"encode",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/mailbox.py#L1360-L1368 | ||
ZhouWeikuan/DouDiZhu | 0d84ff6c0bc54dba6ae37955de9ae9307513dc99 | code/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | TokenGroup.get_tokens | (tu, extent) | Helper method to return all tokens in an extent.
This functionality is needed multiple places in this module. We define
it here because it seems like a logical place. | Helper method to return all tokens in an extent. | [
"Helper",
"method",
"to",
"return",
"all",
"tokens",
"in",
"an",
"extent",
"."
] | def get_tokens(tu, extent):
"""Helper method to return all tokens in an extent.
This functionality is needed multiple places in this module. We define
it here because it seems like a logical place.
"""
tokens_memory = POINTER(Token)()
tokens_count = c_uint()
con... | [
"def",
"get_tokens",
"(",
"tu",
",",
"extent",
")",
":",
"tokens_memory",
"=",
"POINTER",
"(",
"Token",
")",
"(",
")",
"tokens_count",
"=",
"c_uint",
"(",
")",
"conf",
".",
"lib",
".",
"clang_tokenize",
"(",
"tu",
",",
"extent",
",",
"byref",
"(",
"t... | https://github.com/ZhouWeikuan/DouDiZhu/blob/0d84ff6c0bc54dba6ae37955de9ae9307513dc99/code/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L406-L436 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.GetExecutableName | (self) | Returns the executable name of the bundle represented by this target.
E.g. Chromium. | Returns the executable name of the bundle represented by this target.
E.g. Chromium. | [
"Returns",
"the",
"executable",
"name",
"of",
"the",
"bundle",
"represented",
"by",
"this",
"target",
".",
"E",
".",
"g",
".",
"Chromium",
"."
] | def GetExecutableName(self):
"""Returns the executable name of the bundle represented by this target.
E.g. Chromium."""
if self._IsBundle():
return self.spec.get('product_name', self.spec['target_name'])
else:
return self._GetStandaloneBinaryPath() | [
"def",
"GetExecutableName",
"(",
"self",
")",
":",
"if",
"self",
".",
"_IsBundle",
"(",
")",
":",
"return",
"self",
".",
"spec",
".",
"get",
"(",
"'product_name'",
",",
"self",
".",
"spec",
"[",
"'target_name'",
"]",
")",
"else",
":",
"return",
"self",... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/xcode_emulation.py#L467-L473 | ||
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Node/FS.py | python | FS.__init__ | (self, path = None) | Initialize the Node.FS subsystem.
The supplied path is the top of the source tree, where we
expect to find the top-level build file. If no path is
supplied, the current directory is the default.
The path argument must be a valid absolute path. | Initialize the Node.FS subsystem. | [
"Initialize",
"the",
"Node",
".",
"FS",
"subsystem",
"."
] | def __init__(self, path = None):
"""Initialize the Node.FS subsystem.
The supplied path is the top of the source tree, where we
expect to find the top-level build file. If no path is
supplied, the current directory is the default.
The path argument must be a valid absolute pat... | [
"def",
"__init__",
"(",
"self",
",",
"path",
"=",
"None",
")",
":",
"if",
"SCons",
".",
"Debug",
".",
"track_instances",
":",
"logInstanceCreation",
"(",
"self",
",",
"'Node.FS'",
")",
"self",
".",
"_memo",
"=",
"{",
"}",
"self",
".",
"Root",
"=",
"{... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Node/FS.py#L1165-L1195 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/collections.py | python | Counter.elements | (self) | return _chain.from_iterable(_starmap(_repeat, self.iteritems())) | Iterator over elements repeating each as many times as its count.
>>> c = Counter('ABCABC')
>>> sorted(c.elements())
['A', 'A', 'B', 'B', 'C', 'C']
# Knuth's example for prime factors of 1836: 2**2 * 3**3 * 17**1
>>> prime_factors = Counter({2: 2, 3: 3, 17: 1})
>>> pro... | Iterator over elements repeating each as many times as its count. | [
"Iterator",
"over",
"elements",
"repeating",
"each",
"as",
"many",
"times",
"as",
"its",
"count",
"."
] | def elements(self):
'''Iterator over elements repeating each as many times as its count.
>>> c = Counter('ABCABC')
>>> sorted(c.elements())
['A', 'A', 'B', 'B', 'C', 'C']
# Knuth's example for prime factors of 1836: 2**2 * 3**3 * 17**1
>>> prime_factors = Counter({2: 2... | [
"def",
"elements",
"(",
"self",
")",
":",
"# Emulate Bag.do from Smalltalk and Multiset.begin from C++.",
"return",
"_chain",
".",
"from_iterable",
"(",
"_starmap",
"(",
"_repeat",
",",
"self",
".",
"iteritems",
"(",
")",
")",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/collections.py#L464-L484 | |
omnisci/omniscidb | b9c95f1bd602b4ffc8b0edf18bfad61031e08d86 | python/omnisci/cursor.py | python | Cursor.fetchone | (self) | Fetch a single row from the results set | Fetch a single row from the results set | [
"Fetch",
"a",
"single",
"row",
"from",
"the",
"results",
"set"
] | def fetchone(self):
"""Fetch a single row from the results set"""
try:
return next(self.result_set)
except StopIteration:
return None | [
"def",
"fetchone",
"(",
"self",
")",
":",
"try",
":",
"return",
"next",
"(",
"self",
".",
"result_set",
")",
"except",
"StopIteration",
":",
"return",
"None"
] | https://github.com/omnisci/omniscidb/blob/b9c95f1bd602b4ffc8b0edf18bfad61031e08d86/python/omnisci/cursor.py#L150-L155 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/array_algos/quantile.py | python | quantile_compat | (values: ArrayLike, qs: np.ndarray, interpolation: str) | Compute the quantiles of the given values for each quantile in `qs`.
Parameters
----------
values : np.ndarray or ExtensionArray
qs : np.ndarray[float64]
interpolation : str
Returns
-------
np.ndarray or ExtensionArray | Compute the quantiles of the given values for each quantile in `qs`. | [
"Compute",
"the",
"quantiles",
"of",
"the",
"given",
"values",
"for",
"each",
"quantile",
"in",
"qs",
"."
] | def quantile_compat(values: ArrayLike, qs: np.ndarray, interpolation: str) -> ArrayLike:
"""
Compute the quantiles of the given values for each quantile in `qs`.
Parameters
----------
values : np.ndarray or ExtensionArray
qs : np.ndarray[float64]
interpolation : str
Returns
-------... | [
"def",
"quantile_compat",
"(",
"values",
":",
"ArrayLike",
",",
"qs",
":",
"np",
".",
"ndarray",
",",
"interpolation",
":",
"str",
")",
"->",
"ArrayLike",
":",
"if",
"isinstance",
"(",
"values",
",",
"np",
".",
"ndarray",
")",
":",
"fill_value",
"=",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/array_algos/quantile.py#L21-L51 | ||
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/v8/third_party/jinja2/filters.py | python | environmentfilter | (f) | return f | Decorator for marking evironment dependent filters. The current
:class:`Environment` is passed to the filter as first argument. | Decorator for marking evironment dependent filters. The current
:class:`Environment` is passed to the filter as first argument. | [
"Decorator",
"for",
"marking",
"evironment",
"dependent",
"filters",
".",
"The",
"current",
":",
"class",
":",
"Environment",
"is",
"passed",
"to",
"the",
"filter",
"as",
"first",
"argument",
"."
] | def environmentfilter(f):
"""Decorator for marking evironment dependent filters. The current
:class:`Environment` is passed to the filter as first argument.
"""
f.environmentfilter = True
return f | [
"def",
"environmentfilter",
"(",
"f",
")",
":",
"f",
".",
"environmentfilter",
"=",
"True",
"return",
"f"
] | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/v8/third_party/jinja2/filters.py#L46-L51 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/ogl/_diagram.py | python | Diagram.Snap | (self, x, y) | return x, y | Snaps' the coordinate to the nearest grid position, if
snap-to-grid is on. | Snaps' the coordinate to the nearest grid position, if
snap-to-grid is on. | [
"Snaps",
"the",
"coordinate",
"to",
"the",
"nearest",
"grid",
"position",
"if",
"snap",
"-",
"to",
"-",
"grid",
"is",
"on",
"."
] | def Snap(self, x, y):
"""'Snaps' the coordinate to the nearest grid position, if
snap-to-grid is on."""
if self._snapToGrid:
return self._gridSpacing * int(x / self._gridSpacing + 0.5), self._gridSpacing * int(y / self._gridSpacing + 0.5)
return x, y | [
"def",
"Snap",
"(",
"self",
",",
"x",
",",
"y",
")",
":",
"if",
"self",
".",
"_snapToGrid",
":",
"return",
"self",
".",
"_gridSpacing",
"*",
"int",
"(",
"x",
"/",
"self",
".",
"_gridSpacing",
"+",
"0.5",
")",
",",
"self",
".",
"_gridSpacing",
"*",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/ogl/_diagram.py#L115-L120 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/turtle.py | python | RawTurtle.clear | (self) | Delete the turtle's drawings from the screen. Do not move turtle.
No arguments.
Delete the turtle's drawings from the screen. Do not move turtle.
State and position of the turtle as well as drawings of other
turtles are not affected.
Examples (for a Turtle instance named turtl... | Delete the turtle's drawings from the screen. Do not move turtle. | [
"Delete",
"the",
"turtle",
"s",
"drawings",
"from",
"the",
"screen",
".",
"Do",
"not",
"move",
"turtle",
"."
] | def clear(self):
"""Delete the turtle's drawings from the screen. Do not move turtle.
No arguments.
Delete the turtle's drawings from the screen. Do not move turtle.
State and position of the turtle as well as drawings of other
turtles are not affected.
Examples (for a... | [
"def",
"clear",
"(",
"self",
")",
":",
"self",
".",
"_clear",
"(",
")",
"self",
".",
"_update",
"(",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/turtle.py#L2534-L2547 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/mesa/MesaLib/src/mapi/glapi/gen/gl_XML.py | python | classify_category | (name, number) | return [cat_type, key] | Based on the category name and number, select a numerical class for it.
Categories are divided into four classes numbered 0 through 3. The
classes are:
0. Core GL versions, sorted by version number.
1. ARB extensions, sorted by extension number.
2. Non-ARB extensions, sorted by extension number.
3. Un-num... | Based on the category name and number, select a numerical class for it.
Categories are divided into four classes numbered 0 through 3. The
classes are: | [
"Based",
"on",
"the",
"category",
"name",
"and",
"number",
"select",
"a",
"numerical",
"class",
"for",
"it",
".",
"Categories",
"are",
"divided",
"into",
"four",
"classes",
"numbered",
"0",
"through",
"3",
".",
"The",
"classes",
"are",
":"
] | def classify_category(name, number):
"""Based on the category name and number, select a numerical class for it.
Categories are divided into four classes numbered 0 through 3. The
classes are:
0. Core GL versions, sorted by version number.
1. ARB extensions, sorted by extension number.
2. Non-ARB extensions... | [
"def",
"classify_category",
"(",
"name",
",",
"number",
")",
":",
"try",
":",
"core_version",
"=",
"float",
"(",
"name",
")",
"except",
"Exception",
",",
"e",
":",
"core_version",
"=",
"0.0",
"if",
"core_version",
">",
"0.0",
":",
"cat_type",
"=",
"0",
... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/mesa/MesaLib/src/mapi/glapi/gen/gl_XML.py#L272-L304 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py | python | GenerateClasspathFile | (target_list, target_dicts, toplevel_dir,
toplevel_build, out_name) | Generates a classpath file suitable for symbol navigation and code
completion of Java code (such as in Android projects) by finding all
.java and .jar files used as action inputs. | Generates a classpath file suitable for symbol navigation and code
completion of Java code (such as in Android projects) by finding all
.java and .jar files used as action inputs. | [
"Generates",
"a",
"classpath",
"file",
"suitable",
"for",
"symbol",
"navigation",
"and",
"code",
"completion",
"of",
"Java",
"code",
"(",
"such",
"as",
"in",
"Android",
"projects",
")",
"by",
"finding",
"all",
".",
"java",
"and",
".",
"jar",
"files",
"used... | def GenerateClasspathFile(target_list, target_dicts, toplevel_dir,
toplevel_build, out_name):
'''Generates a classpath file suitable for symbol navigation and code
completion of Java code (such as in Android projects) by finding all
.java and .jar files used as action inputs.'''
gyp.co... | [
"def",
"GenerateClasspathFile",
"(",
"target_list",
",",
"target_dicts",
",",
"toplevel_dir",
",",
"toplevel_build",
",",
"out_name",
")",
":",
"gyp",
".",
"common",
".",
"EnsureDirExists",
"(",
"out_name",
")",
"result",
"=",
"ET",
".",
"Element",
"(",
"'clas... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py#L337-L368 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/devil/devil/android/sdk/shared_prefs.py | python | BooleanPref.get | (self) | return type(self).VALUES[super(BooleanPref, self).get()] | Get the value as a Python bool. | Get the value as a Python bool. | [
"Get",
"the",
"value",
"as",
"a",
"Python",
"bool",
"."
] | def get(self):
"""Get the value as a Python bool."""
return type(self).VALUES[super(BooleanPref, self).get()] | [
"def",
"get",
"(",
"self",
")",
":",
"return",
"type",
"(",
"self",
")",
".",
"VALUES",
"[",
"super",
"(",
"BooleanPref",
",",
"self",
")",
".",
"get",
"(",
")",
"]"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/android/sdk/shared_prefs.py#L69-L71 | |
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | clang/tools/scan-build-py/lib/libear/__init__.py | python | build_libear | (compiler, dst_dir) | Returns the full path to the 'libear' library. | Returns the full path to the 'libear' library. | [
"Returns",
"the",
"full",
"path",
"to",
"the",
"libear",
"library",
"."
] | def build_libear(compiler, dst_dir):
""" Returns the full path to the 'libear' library. """
try:
src_dir = os.path.dirname(os.path.realpath(__file__))
toolset = make_toolset(src_dir)
toolset.set_compiler(compiler)
toolset.set_language_standard('c99')
toolset.add_definiti... | [
"def",
"build_libear",
"(",
"compiler",
",",
"dst_dir",
")",
":",
"try",
":",
"src_dir",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"os",
".",
"path",
".",
"realpath",
"(",
"__file__",
")",
")",
"toolset",
"=",
"make_toolset",
"(",
"src_dir",
")",
... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/clang/tools/scan-build-py/lib/libear/__init__.py#L19-L58 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/more-itertools/py3/more_itertools/more.py | python | split_before | (iterable, pred, maxsplit=-1) | Yield lists of items from *iterable*, where each list ends just before
an item for which callable *pred* returns ``True``:
>>> list(split_before('OneTwo', lambda s: s.isupper()))
[['O', 'n', 'e'], ['T', 'w', 'o']]
>>> list(split_before(range(10), lambda n: n % 3 == 0))
[[0, 1, 2], ... | Yield lists of items from *iterable*, where each list ends just before
an item for which callable *pred* returns ``True``: | [
"Yield",
"lists",
"of",
"items",
"from",
"*",
"iterable",
"*",
"where",
"each",
"list",
"ends",
"just",
"before",
"an",
"item",
"for",
"which",
"callable",
"*",
"pred",
"*",
"returns",
"True",
":"
] | def split_before(iterable, pred, maxsplit=-1):
"""Yield lists of items from *iterable*, where each list ends just before
an item for which callable *pred* returns ``True``:
>>> list(split_before('OneTwo', lambda s: s.isupper()))
[['O', 'n', 'e'], ['T', 'w', 'o']]
>>> list(split_before(... | [
"def",
"split_before",
"(",
"iterable",
",",
"pred",
",",
"maxsplit",
"=",
"-",
"1",
")",
":",
"if",
"maxsplit",
"==",
"0",
":",
"yield",
"list",
"(",
"iterable",
")",
"return",
"buf",
"=",
"[",
"]",
"it",
"=",
"iter",
"(",
"iterable",
")",
"for",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/more-itertools/py3/more_itertools/more.py#L1365-L1397 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/twodim_base.py | python | triu_indices_from | (arr, k=0) | return triu_indices(arr.shape[-2], k=k, m=arr.shape[-1]) | Return the indices for the upper-triangle of arr.
See `triu_indices` for full details.
Parameters
----------
arr : ndarray, shape(N, N)
The indices will be valid for square arrays.
k : int, optional
Diagonal offset (see `triu` for details).
Returns
-------
triu_indices... | Return the indices for the upper-triangle of arr. | [
"Return",
"the",
"indices",
"for",
"the",
"upper",
"-",
"triangle",
"of",
"arr",
"."
] | def triu_indices_from(arr, k=0):
"""
Return the indices for the upper-triangle of arr.
See `triu_indices` for full details.
Parameters
----------
arr : ndarray, shape(N, N)
The indices will be valid for square arrays.
k : int, optional
Diagonal offset (see `triu` for detail... | [
"def",
"triu_indices_from",
"(",
"arr",
",",
"k",
"=",
"0",
")",
":",
"if",
"arr",
".",
"ndim",
"!=",
"2",
":",
"raise",
"ValueError",
"(",
"\"input array must be 2-d\"",
")",
"return",
"triu_indices",
"(",
"arr",
".",
"shape",
"[",
"-",
"2",
"]",
",",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/twodim_base.py#L988-L1017 | |
tpfister/caffe-heatmap | 4db69ef53e6b8a0b3b4ebb29328b0ab3dbf67c4e | scripts/cpp_lint.py | python | _OutputFormat | () | return _cpplint_state.output_format | Gets the module's output format. | Gets the module's output format. | [
"Gets",
"the",
"module",
"s",
"output",
"format",
"."
] | def _OutputFormat():
"""Gets the module's output format."""
return _cpplint_state.output_format | [
"def",
"_OutputFormat",
"(",
")",
":",
"return",
"_cpplint_state",
".",
"output_format"
] | https://github.com/tpfister/caffe-heatmap/blob/4db69ef53e6b8a0b3b4ebb29328b0ab3dbf67c4e/scripts/cpp_lint.py#L767-L769 | |
PolygonTek/BlueshiftEngine | fbc374cbc391e1147c744649f405a66a27c35d89 | Source/ThirdParty/freetype/src/tools/glnames.py | python | filter_glyph_names | ( alist, filter ) | return extras | filter `alist' by taking _out_ all glyph names that are in `filter | filter `alist' by taking _out_ all glyph names that are in `filter | [
"filter",
"alist",
"by",
"taking",
"_out_",
"all",
"glyph",
"names",
"that",
"are",
"in",
"filter"
] | def filter_glyph_names( alist, filter ):
"""filter `alist' by taking _out_ all glyph names that are in `filter'"""
count = 0
extras = []
for name in alist:
try:
filtered_index = filter.index( name )
except:
extras.append( name )
return extras | [
"def",
"filter_glyph_names",
"(",
"alist",
",",
"filter",
")",
":",
"count",
"=",
"0",
"extras",
"=",
"[",
"]",
"for",
"name",
"in",
"alist",
":",
"try",
":",
"filtered_index",
"=",
"filter",
".",
"index",
"(",
"name",
")",
"except",
":",
"extras",
"... | https://github.com/PolygonTek/BlueshiftEngine/blob/fbc374cbc391e1147c744649f405a66a27c35d89/Source/ThirdParty/freetype/src/tools/glnames.py#L5196-L5208 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/cygprofile/patch_orderfile.py | python | _SectionMatchingRules | (section_name, name_to_symbol_infos,
offset_to_symbol_infos, section_to_symbols_map,
symbol_to_sections_map, suffixed_sections) | Gets the set of section matching rules for section_name.
These rules will include section_name, but also any sections which may
contain the same code due to cloning, splitting, or identical code folding.
Args:
section_name: The section to expand.
name_to_symbol_infos: {name: [symbol_info1], ...}, as ret... | Gets the set of section matching rules for section_name. | [
"Gets",
"the",
"set",
"of",
"section",
"matching",
"rules",
"for",
"section_name",
"."
] | def _SectionMatchingRules(section_name, name_to_symbol_infos,
offset_to_symbol_infos, section_to_symbols_map,
symbol_to_sections_map, suffixed_sections):
"""Gets the set of section matching rules for section_name.
These rules will include section_name, but also a... | [
"def",
"_SectionMatchingRules",
"(",
"section_name",
",",
"name_to_symbol_infos",
",",
"offset_to_symbol_infos",
",",
"section_to_symbols_map",
",",
"symbol_to_sections_map",
",",
"suffixed_sections",
")",
":",
"for",
"name",
"in",
"_ExpandSection",
"(",
"section_name",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/cygprofile/patch_orderfile.py#L221-L258 | ||
manutdzou/KITTI_SSD | 5b620c2f291d36a0fe14489214f22a992f173f44 | scripts/cpp_lint.py | python | ProcessLine | (filename, file_extension, clean_lines, line,
include_state, function_state, nesting_state, error,
extra_check_functions=[]) | Processes a single line in the file.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (dot not included) of the file.
clean_lines: An array of strings, each representing a line of the file,
with comments stripped.
line: Number of line being ... | Processes a single line in the file. | [
"Processes",
"a",
"single",
"line",
"in",
"the",
"file",
"."
] | def ProcessLine(filename, file_extension, clean_lines, line,
include_state, function_state, nesting_state, error,
extra_check_functions=[]):
"""Processes a single line in the file.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (d... | [
"def",
"ProcessLine",
"(",
"filename",
",",
"file_extension",
",",
"clean_lines",
",",
"line",
",",
"include_state",
",",
"function_state",
",",
"nesting_state",
",",
"error",
",",
"extra_check_functions",
"=",
"[",
"]",
")",
":",
"raw_lines",
"=",
"clean_lines"... | https://github.com/manutdzou/KITTI_SSD/blob/5b620c2f291d36a0fe14489214f22a992f173f44/scripts/cpp_lint.py#L4604-L4646 | ||
ledger/ledger | 8e79216887cf3c342dfca1ffa52cf4e6389d6de4 | contrib/non-profit-audit-reports/ooolib2/__init__.py | python | Calc.load | (self, filename) | Load .ods spreadsheet.
The load function loads data from a document into the current cells. | Load .ods spreadsheet. | [
"Load",
".",
"ods",
"spreadsheet",
"."
] | def load(self, filename):
"""Load .ods spreadsheet.
The load function loads data from a document into the current cells.
"""
# Read in the important files
# meta.xml
data = self._zip_read(filename, "meta.xml")
self.meta.meta_parse(data)
# content.xml
data = self._zip_read(filename, "content.xml")... | [
"def",
"load",
"(",
"self",
",",
"filename",
")",
":",
"# Read in the important files",
"# meta.xml",
"data",
"=",
"self",
".",
"_zip_read",
"(",
"filename",
",",
"\"meta.xml\"",
")",
"self",
".",
"meta",
".",
"meta_parse",
"(",
"data",
")",
"# content.xml",
... | https://github.com/ledger/ledger/blob/8e79216887cf3c342dfca1ffa52cf4e6389d6de4/contrib/non-profit-audit-reports/ooolib2/__init__.py#L1028-L1041 | ||
llvm-dcpu16/llvm-dcpu16 | ae6b01fecd03219677e391d4421df5d966d80dcf | bindings/python/llvm/disassembler.py | python | Disassembler.get_instructions | (self, source, pc=0) | Obtain multiple instructions from an input source.
This is like get_instruction() except it is a generator for all
instructions within the source. It starts at the beginning of the
source and reads instructions until no more can be read.
This generator returns 3-tuple of:
lo... | Obtain multiple instructions from an input source. | [
"Obtain",
"multiple",
"instructions",
"from",
"an",
"input",
"source",
"."
] | def get_instructions(self, source, pc=0):
"""Obtain multiple instructions from an input source.
This is like get_instruction() except it is a generator for all
instructions within the source. It starts at the beginning of the
source and reads instructions until no more can be read.
... | [
"def",
"get_instructions",
"(",
"self",
",",
"source",
",",
"pc",
"=",
"0",
")",
":",
"source_bytes",
"=",
"c_char_p",
"(",
"source",
")",
"out_str",
"=",
"cast",
"(",
"(",
"c_byte",
"*",
"255",
")",
"(",
")",
",",
"c_char_p",
")",
"# This could probab... | https://github.com/llvm-dcpu16/llvm-dcpu16/blob/ae6b01fecd03219677e391d4421df5d966d80dcf/bindings/python/llvm/disassembler.py#L81-L114 | ||
google/skia | 82d65d0487bd72f5f7332d002429ec2dc61d2463 | infra/bots/recipes/perf_skottietrace.py | python | get_trace_match | (lottie_filename, is_android) | return trace_match | Returns the DM regex to match the specified lottie file name. | Returns the DM regex to match the specified lottie file name. | [
"Returns",
"the",
"DM",
"regex",
"to",
"match",
"the",
"specified",
"lottie",
"file",
"name",
"."
] | def get_trace_match(lottie_filename, is_android):
"""Returns the DM regex to match the specified lottie file name."""
trace_match = '^%s$' % lottie_filename
if is_android and ' ' not in trace_match:
# Punctuation characters confuse DM when shelled out over adb, so escape
# them. Do not need to do this whe... | [
"def",
"get_trace_match",
"(",
"lottie_filename",
",",
"is_android",
")",
":",
"trace_match",
"=",
"'^%s$'",
"%",
"lottie_filename",
"if",
"is_android",
"and",
"' '",
"not",
"in",
"trace_match",
":",
"# Punctuation characters confuse DM when shelled out over adb, so escape"... | https://github.com/google/skia/blob/82d65d0487bd72f5f7332d002429ec2dc61d2463/infra/bots/recipes/perf_skottietrace.py#L128-L140 | |
OpenGenus/cosmos | 1a94e8880068e51d571543be179c323936bd0936 | code/game_theory/src/minimax/minimax.py | python | minimax | (player: int, board, depth_limit, evaluate) | return placement | Minimax algorithm with limited search depth.
Parameters
----------
player: int
the player that needs to take an action (place a disc in the game)
board: the current game board instance. Should be a class that extends Board
depth_limit: int
the tree depth that the search algorithm ne... | Minimax algorithm with limited search depth. | [
"Minimax",
"algorithm",
"with",
"limited",
"search",
"depth",
"."
] | def minimax(player: int, board, depth_limit, evaluate):
"""
Minimax algorithm with limited search depth.
Parameters
----------
player: int
the player that needs to take an action (place a disc in the game)
board: the current game board instance. Should be a class that extends Board
... | [
"def",
"minimax",
"(",
"player",
":",
"int",
",",
"board",
",",
"depth_limit",
",",
"evaluate",
")",
":",
"max_player",
"=",
"player",
"next_player",
"=",
"board",
".",
"PLAYER2",
"if",
"player",
"==",
"board",
".",
"PLAYER1",
"else",
"board",
".",
"PLAY... | https://github.com/OpenGenus/cosmos/blob/1a94e8880068e51d571543be179c323936bd0936/code/game_theory/src/minimax/minimax.py#L40-L137 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | Gauge.GetBezelFace | (*args, **kwargs) | return _controls_.Gauge_GetBezelFace(*args, **kwargs) | GetBezelFace(self) -> int | GetBezelFace(self) -> int | [
"GetBezelFace",
"(",
"self",
")",
"-",
">",
"int"
] | def GetBezelFace(*args, **kwargs):
"""GetBezelFace(self) -> int"""
return _controls_.Gauge_GetBezelFace(*args, **kwargs) | [
"def",
"GetBezelFace",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"Gauge_GetBezelFace",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L783-L785 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/base.py | python | Index._get_nearest_indexer | (self, target, limit, tolerance) | return indexer | Get the indexer for the nearest index labels; requires an index with
values that can be subtracted from each other (e.g., not strings or
tuples). | Get the indexer for the nearest index labels; requires an index with
values that can be subtracted from each other (e.g., not strings or
tuples). | [
"Get",
"the",
"indexer",
"for",
"the",
"nearest",
"index",
"labels",
";",
"requires",
"an",
"index",
"with",
"values",
"that",
"can",
"be",
"subtracted",
"from",
"each",
"other",
"(",
"e",
".",
"g",
".",
"not",
"strings",
"or",
"tuples",
")",
"."
] | def _get_nearest_indexer(self, target, limit, tolerance):
"""
Get the indexer for the nearest index labels; requires an index with
values that can be subtracted from each other (e.g., not strings or
tuples).
"""
left_indexer = self.get_indexer(target, "pad", limit=limit)
... | [
"def",
"_get_nearest_indexer",
"(",
"self",
",",
"target",
",",
"limit",
",",
"tolerance",
")",
":",
"left_indexer",
"=",
"self",
".",
"get_indexer",
"(",
"target",
",",
"\"pad\"",
",",
"limit",
"=",
"limit",
")",
"right_indexer",
"=",
"self",
".",
"get_in... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/base.py#L2811-L2831 | |
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | buildscripts/resmokelib/utils/__init__.py | python | is_yaml_file | (filename) | return os.path.splitext(filename)[1] in (".yaml", ".yml") | Returns true if 'filename' ends in .yml or .yaml, and false
otherwise. | Returns true if 'filename' ends in .yml or .yaml, and false
otherwise. | [
"Returns",
"true",
"if",
"filename",
"ends",
"in",
".",
"yml",
"or",
".",
"yaml",
"and",
"false",
"otherwise",
"."
] | def is_yaml_file(filename):
"""
Returns true if 'filename' ends in .yml or .yaml, and false
otherwise.
"""
return os.path.splitext(filename)[1] in (".yaml", ".yml") | [
"def",
"is_yaml_file",
"(",
"filename",
")",
":",
"return",
"os",
".",
"path",
".",
"splitext",
"(",
"filename",
")",
"[",
"1",
"]",
"in",
"(",
"\".yaml\"",
",",
"\".yml\"",
")"
] | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/buildscripts/resmokelib/utils/__init__.py#L38-L43 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py | python | Decimal.scaleb | (self, other, context=None) | return d | Returns self operand after adding the second value to its exp. | Returns self operand after adding the second value to its exp. | [
"Returns",
"self",
"operand",
"after",
"adding",
"the",
"second",
"value",
"to",
"its",
"exp",
"."
] | def scaleb(self, other, context=None):
"""Returns self operand after adding the second value to its exp."""
if context is None:
context = getcontext()
other = _convert_other(other, raiseit=True)
ans = self._check_nans(other, context)
if ans:
return ans
... | [
"def",
"scaleb",
"(",
"self",
",",
"other",
",",
"context",
"=",
"None",
")",
":",
"if",
"context",
"is",
"None",
":",
"context",
"=",
"getcontext",
"(",
")",
"other",
"=",
"_convert_other",
"(",
"other",
",",
"raiseit",
"=",
"True",
")",
"ans",
"=",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py#L3565-L3588 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/framework/ops.py | python | container | (container_name) | return get_default_graph().container(container_name) | Wrapper for `Graph.container()` using the default graph.
Args:
container_name: The container string to use in the context.
Returns:
A context manager that specifies the default container to use for newly
created stateful ops. | Wrapper for `Graph.container()` using the default graph. | [
"Wrapper",
"for",
"Graph",
".",
"container",
"()",
"using",
"the",
"default",
"graph",
"."
] | def container(container_name):
"""Wrapper for `Graph.container()` using the default graph.
Args:
container_name: The container string to use in the context.
Returns:
A context manager that specifies the default container to use for newly
created stateful ops.
"""
return get_default_graph().conta... | [
"def",
"container",
"(",
"container_name",
")",
":",
"return",
"get_default_graph",
"(",
")",
".",
"container",
"(",
"container_name",
")"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/framework/ops.py#L3450-L3460 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/http/cookiejar.py | python | CookiePolicy.return_ok | (self, cookie, request) | Return true if (and only if) cookie should be returned to server. | Return true if (and only if) cookie should be returned to server. | [
"Return",
"true",
"if",
"(",
"and",
"only",
"if",
")",
"cookie",
"should",
"be",
"returned",
"to",
"server",
"."
] | def return_ok(self, cookie, request):
"""Return true if (and only if) cookie should be returned to server."""
raise NotImplementedError() | [
"def",
"return_ok",
"(",
"self",
",",
"cookie",
",",
"request",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/http/cookiejar.py#L852-L854 | ||
generalized-intelligence/GAAS | 29ab17d3e8a4ba18edef3a57c36d8db6329fac73 | deprecated/algorithms/sfm/OpenSfM/opensfm/multiview.py | python | camera_up_vector | (rotation_matrix) | return rotation_matrix[:, 2] | Unit vector pointing to zenit in camera coords.
:param rotation: camera pose rotation | Unit vector pointing to zenit in camera coords. | [
"Unit",
"vector",
"pointing",
"to",
"zenit",
"in",
"camera",
"coords",
"."
] | def camera_up_vector(rotation_matrix):
"""Unit vector pointing to zenit in camera coords.
:param rotation: camera pose rotation
"""
return rotation_matrix[:, 2] | [
"def",
"camera_up_vector",
"(",
"rotation_matrix",
")",
":",
"return",
"rotation_matrix",
"[",
":",
",",
"2",
"]"
] | https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/deprecated/algorithms/sfm/OpenSfM/opensfm/multiview.py#L443-L448 | |
tiny-dnn/tiny-dnn | c0f576f5cb7b35893f62127cb7aec18f77a3bcc5 | third_party/cpplint.py | python | IsBlockInNameSpace | (nesting_state, is_forward_declaration) | return (len(nesting_state.stack) > 1 and
nesting_state.stack[-1].check_namespace_indentation and
isinstance(nesting_state.stack[-2], _NamespaceInfo)) | Checks that the new block is directly in a namespace.
Args:
nesting_state: The _NestingState object that contains info about our state.
is_forward_declaration: If the class is a forward declared class.
Returns:
Whether or not the new block is directly in a namespace. | Checks that the new block is directly in a namespace. | [
"Checks",
"that",
"the",
"new",
"block",
"is",
"directly",
"in",
"a",
"namespace",
"."
] | def IsBlockInNameSpace(nesting_state, is_forward_declaration):
"""Checks that the new block is directly in a namespace.
Args:
nesting_state: The _NestingState object that contains info about our state.
is_forward_declaration: If the class is a forward declared class.
Returns:
Whether or not the new b... | [
"def",
"IsBlockInNameSpace",
"(",
"nesting_state",
",",
"is_forward_declaration",
")",
":",
"if",
"is_forward_declaration",
":",
"return",
"len",
"(",
"nesting_state",
".",
"stack",
")",
">=",
"1",
"and",
"(",
"isinstance",
"(",
"nesting_state",
".",
"stack",
"[... | https://github.com/tiny-dnn/tiny-dnn/blob/c0f576f5cb7b35893f62127cb7aec18f77a3bcc5/third_party/cpplint.py#L5878-L5894 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/probability/bijector/bijector.py | python | Bijector.inverse_log_jacobian | (self, value, *args, **kwargs) | return self._inverse_log_jacobian(value, *args, **kwargs) | Logarithm of the derivative of the inverse transformation.
Args:
value (Tensor): the value of the transformed variables.
*args (list): the list of positional arguments forwarded to subclasses.
**kwargs (dict): the dictionary of keyword arguments forwarded to subclasses.
... | Logarithm of the derivative of the inverse transformation. | [
"Logarithm",
"of",
"the",
"derivative",
"of",
"the",
"inverse",
"transformation",
"."
] | def inverse_log_jacobian(self, value, *args, **kwargs):
"""
Logarithm of the derivative of the inverse transformation.
Args:
value (Tensor): the value of the transformed variables.
*args (list): the list of positional arguments forwarded to subclasses.
**kwar... | [
"def",
"inverse_log_jacobian",
"(",
"self",
",",
"value",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_inverse_log_jacobian",
"(",
"value",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/probability/bijector/bijector.py#L279-L291 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/datasets/twenty_newsgroups.py | python | strip_newsgroup_footer | (text) | Given text in "news" format, attempt to remove a signature block.
As a rough heuristic, we assume that signatures are set apart by either
a blank line or a line made of hyphens, and that it is the last such line
in the file (disregarding blank lines at the end). | Given text in "news" format, attempt to remove a signature block. | [
"Given",
"text",
"in",
"news",
"format",
"attempt",
"to",
"remove",
"a",
"signature",
"block",
"."
] | def strip_newsgroup_footer(text):
"""
Given text in "news" format, attempt to remove a signature block.
As a rough heuristic, we assume that signatures are set apart by either
a blank line or a line made of hyphens, and that it is the last such line
in the file (disregarding blank lines at the end)... | [
"def",
"strip_newsgroup_footer",
"(",
"text",
")",
":",
"lines",
"=",
"text",
".",
"strip",
"(",
")",
".",
"split",
"(",
"'\\n'",
")",
"for",
"line_num",
"in",
"range",
"(",
"len",
"(",
"lines",
")",
"-",
"1",
",",
"-",
"1",
",",
"-",
"1",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/datasets/twenty_newsgroups.py#L134-L151 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/requests/requests/packages/urllib3/util/response.py | python | is_fp_closed | (obj) | Checks whether a given file-like object is closed.
:param obj:
The file-like object to check. | Checks whether a given file-like object is closed. | [
"Checks",
"whether",
"a",
"given",
"file",
"-",
"like",
"object",
"is",
"closed",
"."
] | def is_fp_closed(obj):
"""
Checks whether a given file-like object is closed.
:param obj:
The file-like object to check.
"""
try:
# Check via the official file-like-object way.
return obj.closed
except AttributeError:
pass
try:
# Check if the object... | [
"def",
"is_fp_closed",
"(",
"obj",
")",
":",
"try",
":",
"# Check via the official file-like-object way.",
"return",
"obj",
".",
"closed",
"except",
"AttributeError",
":",
"pass",
"try",
":",
"# Check if the object is a container for another file-like object that",
"# gets re... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/requests/requests/packages/urllib3/util/response.py#L1-L22 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/pdb.py | python | Pdb.handle_command_def | (self,line) | return | Handles one command line during command list definition. | Handles one command line during command list definition. | [
"Handles",
"one",
"command",
"line",
"during",
"command",
"list",
"definition",
"."
] | def handle_command_def(self,line):
"""Handles one command line during command list definition."""
cmd, arg, line = self.parseline(line)
if not cmd:
return
if cmd == 'silent':
self.commands_silent[self.commands_bnum] = True
return # continue to handle o... | [
"def",
"handle_command_def",
"(",
"self",
",",
"line",
")",
":",
"cmd",
",",
"arg",
",",
"line",
"=",
"self",
".",
"parseline",
"(",
"line",
")",
"if",
"not",
"cmd",
":",
"return",
"if",
"cmd",
"==",
"'silent'",
":",
"self",
".",
"commands_silent",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/pdb.py#L283-L309 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/external/bazel_tools/tools/objc/j2objc_dead_code_pruner.py | python | BuildReachableFileSet | (entry_classes, reachability_tree, header_mapping,
archive_source_file_mapping=None) | return reachable_files | Builds a set of reachable translated files from entry Java classes.
Args:
entry_classes: A comma separated list of Java entry classes.
reachability_tree: A dict mapping translated files to their direct
dependencies.
header_mapping: A dict mapping Java class names to translated source files.
a... | Builds a set of reachable translated files from entry Java classes. | [
"Builds",
"a",
"set",
"of",
"reachable",
"translated",
"files",
"from",
"entry",
"Java",
"classes",
"."
] | def BuildReachableFileSet(entry_classes, reachability_tree, header_mapping,
archive_source_file_mapping=None):
"""Builds a set of reachable translated files from entry Java classes.
Args:
entry_classes: A comma separated list of Java entry classes.
reachability_tree: A dict mappin... | [
"def",
"BuildReachableFileSet",
"(",
"entry_classes",
",",
"reachability_tree",
",",
"header_mapping",
",",
"archive_source_file_mapping",
"=",
"None",
")",
":",
"transpiled_entry_files",
"=",
"[",
"]",
"for",
"entry_class",
"in",
"entry_classes",
".",
"split",
"(",
... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/external/bazel_tools/tools/objc/j2objc_dead_code_pruner.py#L88-L151 | |
xbmc/xbmc | 091211a754589fc40a2a1f239b0ce9f4ee138268 | addons/metadata.tvshows.themoviedb.org.python/libs/data_utils.py | python | _set_unique_ids | (ext_ids, list_item) | return list_item | Extract unique ID in various online databases | Extract unique ID in various online databases | [
"Extract",
"unique",
"ID",
"in",
"various",
"online",
"databases"
] | def _set_unique_ids(ext_ids, list_item):
# type: (InfoType, ListItem) -> ListItem
"""Extract unique ID in various online databases"""
unique_ids = {}
for key, value in ext_ids.items():
if key in VALIDEXTIDS and value:
key = key[:-3]
unique_ids[key] = str(value)
list_i... | [
"def",
"_set_unique_ids",
"(",
"ext_ids",
",",
"list_item",
")",
":",
"# type: (InfoType, ListItem) -> ListItem",
"unique_ids",
"=",
"{",
"}",
"for",
"key",
",",
"value",
"in",
"ext_ids",
".",
"items",
"(",
")",
":",
"if",
"key",
"in",
"VALIDEXTIDS",
"and",
... | https://github.com/xbmc/xbmc/blob/091211a754589fc40a2a1f239b0ce9f4ee138268/addons/metadata.tvshows.themoviedb.org.python/libs/data_utils.py#L115-L124 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/scons.py | python | EscapeSConsVariableExpansion | (s) | return s.replace('$', '$$$$') | SCons has its own variable expansion syntax using $. We must escape it for
strings to be interpreted literally. For some reason this requires four
dollar signs, not two, even without the shell involved. | SCons has its own variable expansion syntax using $. We must escape it for
strings to be interpreted literally. For some reason this requires four
dollar signs, not two, even without the shell involved. | [
"SCons",
"has",
"its",
"own",
"variable",
"expansion",
"syntax",
"using",
"$",
".",
"We",
"must",
"escape",
"it",
"for",
"strings",
"to",
"be",
"interpreted",
"literally",
".",
"For",
"some",
"reason",
"this",
"requires",
"four",
"dollar",
"signs",
"not",
... | def EscapeSConsVariableExpansion(s):
"""SCons has its own variable expansion syntax using $. We must escape it for
strings to be interpreted literally. For some reason this requires four
dollar signs, not two, even without the shell involved."""
return s.replace('$', '$$$$') | [
"def",
"EscapeSConsVariableExpansion",
"(",
"s",
")",
":",
"return",
"s",
".",
"replace",
"(",
"'$'",
",",
"'$$$$'",
")"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/scons.py#L189-L193 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.