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 | wx/lib/agw/xlsgrid.py | python | XLSText.__init__ | (self, book, cell, xf_index, display_text=None, hyperlink=None, default_width=10) | Default class constructor.
:param `book`: an instance of the `xlrd.Book` class;
:param `cell`: an instance of `xlrd.sheet.Cell` class;
:param `xf_index`: an index into `xlrd.Book.xf_list`, which holds a
reference to the `xlrd.sheet.Cell` class (the actual cell for `xlrd`);
:par... | Default class constructor. | [
"Default",
"class",
"constructor",
"."
] | def __init__(self, book, cell, xf_index, display_text=None, hyperlink=None, default_width=10):
"""
Default class constructor.
:param `book`: an instance of the `xlrd.Book` class;
:param `cell`: an instance of `xlrd.sheet.Cell` class;
:param `xf_index`: an index into `xlrd.Book.x... | [
"def",
"__init__",
"(",
"self",
",",
"book",
",",
"cell",
",",
"xf_index",
",",
"display_text",
"=",
"None",
",",
"hyperlink",
"=",
"None",
",",
"default_width",
"=",
"10",
")",
":",
"XFClass",
"=",
"book",
".",
"xf_list",
"[",
"xf_index",
"]",
"font",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/xlsgrid.py#L603-L644 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/telemetry/telemetry/core/timeline/thread.py | python | Thread.BeginSlice | (self, category, name, timestamp, thread_timestamp=None,
args=None) | return new_slice | Opens a new slice for the thread.
Calls to beginSlice and endSlice must be made with
non-monotonically-decreasing timestamps.
* category: Category to which the slice belongs.
* name: Name of the slice to add.
* timestamp: The timetsamp of the slice, in milliseconds.
* thread_timestamp: Thread s... | Opens a new slice for the thread.
Calls to beginSlice and endSlice must be made with
non-monotonically-decreasing timestamps. | [
"Opens",
"a",
"new",
"slice",
"for",
"the",
"thread",
".",
"Calls",
"to",
"beginSlice",
"and",
"endSlice",
"must",
"be",
"made",
"with",
"non",
"-",
"monotonically",
"-",
"decreasing",
"timestamps",
"."
] | def BeginSlice(self, category, name, timestamp, thread_timestamp=None,
args=None):
"""Opens a new slice for the thread.
Calls to beginSlice and endSlice must be made with
non-monotonically-decreasing timestamps.
* category: Category to which the slice belongs.
* name: Name of the s... | [
"def",
"BeginSlice",
"(",
"self",
",",
"category",
",",
"name",
",",
"timestamp",
",",
"thread_timestamp",
"=",
"None",
",",
"args",
"=",
"None",
")",
":",
"if",
"len",
"(",
"self",
".",
"_open_slices",
")",
">",
"0",
"and",
"timestamp",
"<",
"self",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/telemetry/core/timeline/thread.py#L100-L124 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/variables.py | python | Variable.to_proto | (self) | return var_def | Converts a `Variable` to a `VariableDef` protocol buffer.
Returns:
A `VariableDef` protocol buffer. | Converts a `Variable` to a `VariableDef` protocol buffer. | [
"Converts",
"a",
"Variable",
"to",
"a",
"VariableDef",
"protocol",
"buffer",
"."
] | def to_proto(self):
"""Converts a `Variable` to a `VariableDef` protocol buffer.
Returns:
A `VariableDef` protocol buffer.
"""
var_def = variable_pb2.VariableDef()
var_def.variable_name = self._variable.name
var_def.initializer_name = self.initializer.name
var_def.snapshot_name = self... | [
"def",
"to_proto",
"(",
"self",
")",
":",
"var_def",
"=",
"variable_pb2",
".",
"VariableDef",
"(",
")",
"var_def",
".",
"variable_name",
"=",
"self",
".",
"_variable",
".",
"name",
"var_def",
".",
"initializer_name",
"=",
"self",
".",
"initializer",
".",
"... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/variables.py#L699-L711 | |
physercoe/starquant | c00cad64d1de2da05081b3dc320ef264c6295e08 | cppsrc/log4cplus-2.0.4/catch/.conan/build.py | python | BuilderSettings.login_username | (self) | return os.getenv("CONAN_LOGIN_USERNAME", "horenmar") | Set Bintray login username | Set Bintray login username | [
"Set",
"Bintray",
"login",
"username"
] | def login_username(self):
""" Set Bintray login username
"""
return os.getenv("CONAN_LOGIN_USERNAME", "horenmar") | [
"def",
"login_username",
"(",
"self",
")",
":",
"return",
"os",
".",
"getenv",
"(",
"\"CONAN_LOGIN_USERNAME\"",
",",
"\"horenmar\"",
")"
] | https://github.com/physercoe/starquant/blob/c00cad64d1de2da05081b3dc320ef264c6295e08/cppsrc/log4cplus-2.0.4/catch/.conan/build.py#L19-L22 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/modulefinder.py | python | ModuleFinder.any_missing_maybe | (self) | return missing, maybe | Return two lists, one with modules that are certainly missing
and one with modules that *may* be missing. The latter names could
either be submodules *or* just global names in the package.
The reason it can't always be determined is that it's impossible to
tell which names are imported ... | Return two lists, one with modules that are certainly missing
and one with modules that *may* be missing. The latter names could
either be submodules *or* just global names in the package. | [
"Return",
"two",
"lists",
"one",
"with",
"modules",
"that",
"are",
"certainly",
"missing",
"and",
"one",
"with",
"modules",
"that",
"*",
"may",
"*",
"be",
"missing",
".",
"The",
"latter",
"names",
"could",
"either",
"be",
"submodules",
"*",
"or",
"*",
"j... | def any_missing_maybe(self):
"""Return two lists, one with modules that are certainly missing
and one with modules that *may* be missing. The latter names could
either be submodules *or* just global names in the package.
The reason it can't always be determined is that it's impossible t... | [
"def",
"any_missing_maybe",
"(",
"self",
")",
":",
"missing",
"=",
"[",
"]",
"maybe",
"=",
"[",
"]",
"for",
"name",
"in",
"self",
".",
"badmodules",
":",
"if",
"name",
"in",
"self",
".",
"excludes",
":",
"continue",
"i",
"=",
"name",
".",
"rfind",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/modulefinder.py#L542-L586 | |
polyfem/polyfem | 34a7719c2a3874b7ecc865c28d8b3d9bbdf7d0ba | src/autogen/quadrature/tetrahedron.py | python | is_valid | (scheme, tol=1e-6, relaxed=False) | return math.isclose(numpy.sum(scheme.weights), 1.0, rel_tol=1e-10) \
and (relaxed or (scheme.weights >= tol).all()) \
and (scheme.points >= 0).all() \
and (scheme.points[:, 0] + scheme.points[:, 1] + scheme.points[:, 2] <= 1 - tol).all() \
and (scheme.points[:, 0] >= tol).all() \
... | A scheme is valid if:
1. All its weights sums up to one;
2. All the weights are positive;
3. All its points are inside the reference tetrahedron;
4. No point lie on an face. | A scheme is valid if:
1. All its weights sums up to one;
2. All the weights are positive;
3. All its points are inside the reference tetrahedron;
4. No point lie on an face. | [
"A",
"scheme",
"is",
"valid",
"if",
":",
"1",
".",
"All",
"its",
"weights",
"sums",
"up",
"to",
"one",
";",
"2",
".",
"All",
"the",
"weights",
"are",
"positive",
";",
"3",
".",
"All",
"its",
"points",
"are",
"inside",
"the",
"reference",
"tetrahedron... | def is_valid(scheme, tol=1e-6, relaxed=False):
"""
A scheme is valid if:
1. All its weights sums up to one;
2. All the weights are positive;
3. All its points are inside the reference tetrahedron;
4. No point lie on an face.
"""
return math.isclose(numpy.sum(scheme.weights), 1.0, rel_tol... | [
"def",
"is_valid",
"(",
"scheme",
",",
"tol",
"=",
"1e-6",
",",
"relaxed",
"=",
"False",
")",
":",
"return",
"math",
".",
"isclose",
"(",
"numpy",
".",
"sum",
"(",
"scheme",
".",
"weights",
")",
",",
"1.0",
",",
"rel_tol",
"=",
"1e-10",
")",
"and",... | https://github.com/polyfem/polyfem/blob/34a7719c2a3874b7ecc865c28d8b3d9bbdf7d0ba/src/autogen/quadrature/tetrahedron.py#L84-L98 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | native_client_sdk/src/doc/_sphinxext/chromesite_builder.py | python | setup | (app) | Extension registration hook. | Extension registration hook. | [
"Extension",
"registration",
"hook",
"."
] | def setup(app):
""" Extension registration hook.
"""
# linkcheck issues HEAD requests to save time, but some Google properties
# reject them and we get spurious 405 responses. Monkey-patch sphinx to
# just use normal GET requests.
# See: https://bitbucket.org/birkenfeld/sphinx/issue/1292/
from sphinx.buil... | [
"def",
"setup",
"(",
"app",
")",
":",
"# linkcheck issues HEAD requests to save time, but some Google properties",
"# reject them and we get spurious 405 responses. Monkey-patch sphinx to",
"# just use normal GET requests.",
"# See: https://bitbucket.org/birkenfeld/sphinx/issue/1292/",
"from",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/native_client_sdk/src/doc/_sphinxext/chromesite_builder.py#L281-L297 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | TextAttr.GetFontUnderlined | (*args, **kwargs) | return _controls_.TextAttr_GetFontUnderlined(*args, **kwargs) | GetFontUnderlined(self) -> bool | GetFontUnderlined(self) -> bool | [
"GetFontUnderlined",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetFontUnderlined(*args, **kwargs):
"""GetFontUnderlined(self) -> bool"""
return _controls_.TextAttr_GetFontUnderlined(*args, **kwargs) | [
"def",
"GetFontUnderlined",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextAttr_GetFontUnderlined",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L1683-L1685 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | ImageFromStreamMime | (*args, **kwargs) | return val | ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
Loads an image from an input stream, or any readable Python file-like
object, specifying the image format with a MIME type string. | ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image | [
"ImageFromStreamMime",
"(",
"InputStream",
"stream",
"String",
"mimetype",
"int",
"index",
"=",
"-",
"1",
")",
"-",
">",
"Image"
] | def ImageFromStreamMime(*args, **kwargs):
"""
ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
Loads an image from an input stream, or any readable Python file-like
object, specifying the image format with a MIME type string.
"""
val = _core_.new_ImageFromStreamMi... | [
"def",
"ImageFromStreamMime",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"val",
"=",
"_core_",
".",
"new_ImageFromStreamMime",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"return",
"val"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L3724-L3732 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | tools/clang_format.py | python | ClangFormat.format | (self, file_name) | return formatted | Update the format of the specified file | Update the format of the specified file | [
"Update",
"the",
"format",
"of",
"the",
"specified",
"file"
] | def format(self, file_name):
"""Update the format of the specified file
"""
if self._lint(file_name, print_diff=False):
return True
# Update the file with clang-format
formatted = not subprocess.call(
[self.path, "--style=file", "-i", file_name])
... | [
"def",
"format",
"(",
"self",
",",
"file_name",
")",
":",
"if",
"self",
".",
"_lint",
"(",
"file_name",
",",
"print_diff",
"=",
"False",
")",
":",
"return",
"True",
"# Update the file with clang-format",
"formatted",
"=",
"not",
"subprocess",
".",
"call",
"(... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/tools/clang_format.py#L180-L197 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/model_fitting/model_fitting_model.py | python | ModelFittingModel._get_unit_from_sample_logs | (self, parameter_name: str) | return "" | Returns the units of a sample log if the parameter exists as a sample log. | Returns the units of a sample log if the parameter exists as a sample log. | [
"Returns",
"the",
"units",
"of",
"a",
"sample",
"log",
"if",
"the",
"parameter",
"exists",
"as",
"a",
"sample",
"log",
"."
] | def _get_unit_from_sample_logs(self, parameter_name: str) -> str:
"""Returns the units of a sample log if the parameter exists as a sample log."""
workspace = self.context.data_context.current_workspace
if workspace:
run = workspace.run()
return run.getLogData(parameter_n... | [
"def",
"_get_unit_from_sample_logs",
"(",
"self",
",",
"parameter_name",
":",
"str",
")",
"->",
"str",
":",
"workspace",
"=",
"self",
".",
"context",
".",
"data_context",
".",
"current_workspace",
"if",
"workspace",
":",
"run",
"=",
"workspace",
".",
"run",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/model_fitting/model_fitting_model.py#L290-L296 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ntpath.py | python | splitdrive | (p) | return p[:0], p | Split a pathname into drive/UNC sharepoint and relative path specifiers.
Returns a 2-tuple (drive_or_unc, path); either part may be empty.
If you assign
result = splitdrive(p)
It is always true that:
result[0] + result[1] == p
If the path contained a drive letter, drive_or_unc will con... | Split a pathname into drive/UNC sharepoint and relative path specifiers.
Returns a 2-tuple (drive_or_unc, path); either part may be empty. | [
"Split",
"a",
"pathname",
"into",
"drive",
"/",
"UNC",
"sharepoint",
"and",
"relative",
"path",
"specifiers",
".",
"Returns",
"a",
"2",
"-",
"tuple",
"(",
"drive_or_unc",
"path",
")",
";",
"either",
"part",
"may",
"be",
"empty",
"."
] | def splitdrive(p):
"""Split a pathname into drive/UNC sharepoint and relative path specifiers.
Returns a 2-tuple (drive_or_unc, path); either part may be empty.
If you assign
result = splitdrive(p)
It is always true that:
result[0] + result[1] == p
If the path contained a drive let... | [
"def",
"splitdrive",
"(",
"p",
")",
":",
"p",
"=",
"os",
".",
"fspath",
"(",
"p",
")",
"if",
"len",
"(",
"p",
")",
">=",
"2",
":",
"if",
"isinstance",
"(",
"p",
",",
"bytes",
")",
":",
"sep",
"=",
"b'\\\\'",
"altsep",
"=",
"b'/'",
"colon",
"=... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ntpath.py#L122-L170 | |
msracver/Deep-Image-Analogy | 632b9287b42552e32dad64922967c8c9ec7fc4d3 | scripts/cpp_lint.py | python | FileInfo.NoExtension | (self) | return '/'.join(self.Split()[0:2]) | File has no source file extension. | File has no source file extension. | [
"File",
"has",
"no",
"source",
"file",
"extension",
"."
] | def NoExtension(self):
"""File has no source file extension."""
return '/'.join(self.Split()[0:2]) | [
"def",
"NoExtension",
"(",
"self",
")",
":",
"return",
"'/'",
".",
"join",
"(",
"self",
".",
"Split",
"(",
")",
"[",
"0",
":",
"2",
"]",
")"
] | https://github.com/msracver/Deep-Image-Analogy/blob/632b9287b42552e32dad64922967c8c9ec7fc4d3/scripts/cpp_lint.py#L952-L954 | |
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/MSVSVersion.py | python | SelectVisualStudioVersion | (version='auto', allow_fallback=True) | return versions[0] | Select which version of Visual Studio projects to generate.
Arguments:
version: Hook to allow caller to force a particular version (vs auto).
Returns:
An object representing a visual studio project format version. | Select which version of Visual Studio projects to generate. | [
"Select",
"which",
"version",
"of",
"Visual",
"Studio",
"projects",
"to",
"generate",
"."
] | def SelectVisualStudioVersion(version='auto', allow_fallback=True):
"""Select which version of Visual Studio projects to generate.
Arguments:
version: Hook to allow caller to force a particular version (vs auto).
Returns:
An object representing a visual studio project format version.
"""
# In auto mo... | [
"def",
"SelectVisualStudioVersion",
"(",
"version",
"=",
"'auto'",
",",
"allow_fallback",
"=",
"True",
")",
":",
"# In auto mode, check environment variable for override.",
"if",
"version",
"==",
"'auto'",
":",
"version",
"=",
"os",
".",
"environ",
".",
"get",
"(",
... | 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/MSVSVersion.py#L401-L443 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/core/fromnumeric.py | python | swapaxes | (a, axis1, axis2) | return _wrapfunc(a, 'swapaxes', axis1, axis2) | Interchange two axes of an array.
Parameters
----------
a : array_like
Input array.
axis1 : int
First axis.
axis2 : int
Second axis.
Returns
-------
a_swapped : ndarray
For NumPy >= 1.10.0, if `a` is an ndarray, then a view of `a` is
returned; ot... | Interchange two axes of an array. | [
"Interchange",
"two",
"axes",
"of",
"an",
"array",
"."
] | def swapaxes(a, axis1, axis2):
"""
Interchange two axes of an array.
Parameters
----------
a : array_like
Input array.
axis1 : int
First axis.
axis2 : int
Second axis.
Returns
-------
a_swapped : ndarray
For NumPy >= 1.10.0, if `a` is an ndarray,... | [
"def",
"swapaxes",
"(",
"a",
",",
"axis1",
",",
"axis2",
")",
":",
"return",
"_wrapfunc",
"(",
"a",
",",
"'swapaxes'",
",",
"axis1",
",",
"axis2",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/core/fromnumeric.py#L542-L585 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/decimal.py | python | Context.radix | (self) | return Decimal(10) | Just returns 10, as this is Decimal, :)
>>> ExtendedContext.radix()
Decimal('10') | Just returns 10, as this is Decimal, :) | [
"Just",
"returns",
"10",
"as",
"this",
"is",
"Decimal",
":",
")"
] | def radix(self):
"""Just returns 10, as this is Decimal, :)
>>> ExtendedContext.radix()
Decimal('10')
"""
return Decimal(10) | [
"def",
"radix",
"(",
"self",
")",
":",
"return",
"Decimal",
"(",
"10",
")"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/decimal.py#L4674-L4680 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/distutils/command/sdist.py | python | sdist.check_metadata | (self) | Deprecated API. | Deprecated API. | [
"Deprecated",
"API",
"."
] | def check_metadata(self):
"""Deprecated API."""
warn("distutils.command.sdist.check_metadata is deprecated, \
use the check command instead", PendingDeprecationWarning)
check = self.distribution.get_command_obj('check')
check.ensure_finalized()
check.run() | [
"def",
"check_metadata",
"(",
"self",
")",
":",
"warn",
"(",
"\"distutils.command.sdist.check_metadata is deprecated, \\\n use the check command instead\"",
",",
"PendingDeprecationWarning",
")",
"check",
"=",
"self",
".",
"distribution",
".",
"get_command_obj",
"(... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/distutils/command/sdist.py#L170-L176 | ||
zeakey/DeepSkeleton | dc70170f8fd2ec8ca1157484ce66129981104486 | scripts/cpp_lint.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",
"]",
"# Update pp_stack first",
"self",
".",
"UpdatePreprocessor",
"(",
"line",
")",
"# Coun... | https://github.com/zeakey/DeepSkeleton/blob/dc70170f8fd2ec8ca1157484ce66129981104486/scripts/cpp_lint.py#L2004-L2158 | ||
TGAC/KAT | e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216 | deps/jellyfish-2.2.0/swig/python/jellyfish.py | python | HashSet.__init__ | (self, *args) | Read a Jellyfish database sequentially
Read a Jellyfish database sequentially | Read a Jellyfish database sequentially
Read a Jellyfish database sequentially | [
"Read",
"a",
"Jellyfish",
"database",
"sequentially",
"Read",
"a",
"Jellyfish",
"database",
"sequentially"
] | def __init__(self, *args):
"""
Read a Jellyfish database sequentially
Read a Jellyfish database sequentially
"""
this = _jellyfish.new_HashSet(*args)
try: self.this.append(this)
except: self.this = this | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
")",
":",
"this",
"=",
"_jellyfish",
".",
"new_HashSet",
"(",
"*",
"args",
")",
"try",
":",
"self",
".",
"this",
".",
"append",
"(",
"this",
")",
"except",
":",
"self",
".",
"this",
"=",
"this"
] | https://github.com/TGAC/KAT/blob/e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216/deps/jellyfish-2.2.0/swig/python/jellyfish.py#L314-L321 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/traci/_vehicletype.py | python | VehicleTypeDomain.copy | (self, origTypeID, newTypeID) | copy(string, string) -> None
Duplicates the vType with ID origTypeID. The newly created vType is assigned the ID newTypeID | copy(string, string) -> None | [
"copy",
"(",
"string",
"string",
")",
"-",
">",
"None"
] | def copy(self, origTypeID, newTypeID):
"""copy(string, string) -> None
Duplicates the vType with ID origTypeID. The newly created vType is assigned the ID newTypeID
"""
self._setCmd(tc.COPY, origTypeID, "s", newTypeID) | [
"def",
"copy",
"(",
"self",
",",
"origTypeID",
",",
"newTypeID",
")",
":",
"self",
".",
"_setCmd",
"(",
"tc",
".",
"COPY",
",",
"origTypeID",
",",
"\"s\"",
",",
"newTypeID",
")"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_vehicletype.py#L343-L348 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/ttk.py | python | Button.__init__ | (self, master=None, **kw) | Construct a Ttk Button widget with the parent master.
STANDARD OPTIONS
class, compound, cursor, image, state, style, takefocus,
text, textvariable, underline, width
WIDGET-SPECIFIC OPTIONS
command, default, width | Construct a Ttk Button widget with the parent master. | [
"Construct",
"a",
"Ttk",
"Button",
"widget",
"with",
"the",
"parent",
"master",
"."
] | def __init__(self, master=None, **kw):
"""Construct a Ttk Button widget with the parent master.
STANDARD OPTIONS
class, compound, cursor, image, state, style, takefocus,
text, textvariable, underline, width
WIDGET-SPECIFIC OPTIONS
command, default, width
... | [
"def",
"__init__",
"(",
"self",
",",
"master",
"=",
"None",
",",
"*",
"*",
"kw",
")",
":",
"Widget",
".",
"__init__",
"(",
"self",
",",
"master",
",",
"\"ttk::button\"",
",",
"kw",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/ttk.py#L597-L609 | ||
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/android/gyp/create_unwind_table.py | python | ParseAddressCfi | (address_cfi: AddressCfi, function_start_address: int,
parsers: Tuple[UnwindInstructionsParser, ...],
prev_cfa_sp_offset: int
) | return None, False, prev_cfa_sp_offset | Parses address CFI with given parsers.
Args:
address_cfi: The CFI for an address in the function.
function_start_address: The start address of the function.
parsers: Available parsers to try on CFI data.
prev_cfa_sp_offset: Previous CFA stack pointer offset.
Returns:
A tuple containing:
- ... | Parses address CFI with given parsers. | [
"Parses",
"address",
"CFI",
"with",
"given",
"parsers",
"."
] | def ParseAddressCfi(address_cfi: AddressCfi, function_start_address: int,
parsers: Tuple[UnwindInstructionsParser, ...],
prev_cfa_sp_offset: int
) -> Tuple[Union[AddressUnwind, None], bool, int]:
"""Parses address CFI with given parsers.
Args:
address... | [
"def",
"ParseAddressCfi",
"(",
"address_cfi",
":",
"AddressCfi",
",",
"function_start_address",
":",
"int",
",",
"parsers",
":",
"Tuple",
"[",
"UnwindInstructionsParser",
",",
"...",
"]",
",",
"prev_cfa_sp_offset",
":",
"int",
")",
"->",
"Tuple",
"[",
"Union",
... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/gyp/create_unwind_table.py#L806-L840 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ensurepip/__init__.py | python | _uninstall_helper | (*, verbosity=0) | return _run_pip(args + [p[0] for p in reversed(_PROJECTS)]) | Helper to support a clean default uninstall process on Windows
Note that calling this function may alter os.environ. | Helper to support a clean default uninstall process on Windows | [
"Helper",
"to",
"support",
"a",
"clean",
"default",
"uninstall",
"process",
"on",
"Windows"
] | def _uninstall_helper(*, verbosity=0):
"""Helper to support a clean default uninstall process on Windows
Note that calling this function may alter os.environ.
"""
# Nothing to do if pip was never installed, or has been removed
try:
import pip
except ImportError:
return
# If... | [
"def",
"_uninstall_helper",
"(",
"*",
",",
"verbosity",
"=",
"0",
")",
":",
"# Nothing to do if pip was never installed, or has been removed",
"try",
":",
"import",
"pip",
"except",
"ImportError",
":",
"return",
"# If the pip version doesn't match the bundled one, leave it alon... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ensurepip/__init__.py#L129-L154 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/Jinja2/py2/jinja2/compiler.py | python | CodeGenerator.pop_parameter_definitions | (self) | Pops the current parameter definitions set. | Pops the current parameter definitions set. | [
"Pops",
"the",
"current",
"parameter",
"definitions",
"set",
"."
] | def pop_parameter_definitions(self):
"""Pops the current parameter definitions set."""
self._param_def_block.pop() | [
"def",
"pop_parameter_definitions",
"(",
"self",
")",
":",
"self",
".",
"_param_def_block",
".",
"pop",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py2/jinja2/compiler.py#L639-L641 | ||
apiaryio/snowcrash | b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3 | tools/gyp/pylib/gyp/generator/android.py | python | AndroidMkWriter.WriteTarget | (self, spec, configs, deps, link_deps, part_of_all) | Write Makefile code to produce the final target of the gyp spec.
spec, configs: input from gyp.
deps, link_deps: dependency lists; see ComputeDeps()
part_of_all: flag indicating this target is part of 'all' | Write Makefile code to produce the final target of the gyp spec. | [
"Write",
"Makefile",
"code",
"to",
"produce",
"the",
"final",
"target",
"of",
"the",
"gyp",
"spec",
"."
] | def WriteTarget(self, spec, configs, deps, link_deps, part_of_all):
"""Write Makefile code to produce the final target of the gyp spec.
spec, configs: input from gyp.
deps, link_deps: dependency lists; see ComputeDeps()
part_of_all: flag indicating this target is part of 'all'
"""
self.WriteLn(... | [
"def",
"WriteTarget",
"(",
"self",
",",
"spec",
",",
"configs",
",",
"deps",
",",
"link_deps",
",",
"part_of_all",
")",
":",
"self",
".",
"WriteLn",
"(",
"'### Rules for final target.'",
")",
"if",
"self",
".",
"type",
"!=",
"'none'",
":",
"self",
".",
"... | https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/generator/android.py#L819-L879 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/rds/__init__.py | python | RDSConnection.restore_dbinstance_from_point_in_time | (self, source_instance_id,
target_instance_id,
use_latest=False,
restore_time=None,
dbinstance_class=None,
... | return self.get_object('RestoreDBInstanceToPointInTime',
params, DBInstance) | Create a new DBInstance from a point in time.
:type source_instance_id: string
:param source_instance_id: The identifier for the source DBInstance.
:type target_instance_id: string
:param target_instance_id: The identifier of the new DBInstance.
:type use_latest: bool
... | Create a new DBInstance from a point in time. | [
"Create",
"a",
"new",
"DBInstance",
"from",
"a",
"point",
"in",
"time",
"."
] | def restore_dbinstance_from_point_in_time(self, source_instance_id,
target_instance_id,
use_latest=False,
restore_time=None,
dbinstance_... | [
"def",
"restore_dbinstance_from_point_in_time",
"(",
"self",
",",
"source_instance_id",
",",
"target_instance_id",
",",
"use_latest",
"=",
"False",
",",
"restore_time",
"=",
"None",
",",
"dbinstance_class",
"=",
"None",
",",
"port",
"=",
"None",
",",
"availability_z... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/rds/__init__.py#L1275-L1338 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/core/events.py | python | EventManager.__init__ | (self, shell, available_events) | Initialise the :class:`CallbackManager`.
Parameters
----------
shell
The :class:`~IPython.core.interactiveshell.InteractiveShell` instance
available_callbacks
An iterable of names for callback events. | Initialise the :class:`CallbackManager`.
Parameters
----------
shell
The :class:`~IPython.core.interactiveshell.InteractiveShell` instance
available_callbacks
An iterable of names for callback events. | [
"Initialise",
"the",
":",
"class",
":",
"CallbackManager",
".",
"Parameters",
"----------",
"shell",
"The",
":",
"class",
":",
"~IPython",
".",
"core",
".",
"interactiveshell",
".",
"InteractiveShell",
"instance",
"available_callbacks",
"An",
"iterable",
"of",
"na... | def __init__(self, shell, available_events):
"""Initialise the :class:`CallbackManager`.
Parameters
----------
shell
The :class:`~IPython.core.interactiveshell.InteractiveShell` instance
available_callbacks
An iterable of names for callback events.
... | [
"def",
"__init__",
"(",
"self",
",",
"shell",
",",
"available_events",
")",
":",
"self",
".",
"shell",
"=",
"shell",
"self",
".",
"callbacks",
"=",
"{",
"n",
":",
"[",
"]",
"for",
"n",
"in",
"available_events",
"}"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/events.py#L27-L38 | ||
ethereon/lycon | 93076d39ca8e42a509af471d620daa859c6c2a3f | lycon/core.py | python | get_supported_extensions | () | return ('jpeg', 'jpg', 'png') | Returns a list of supported image extensions. | Returns a list of supported image extensions. | [
"Returns",
"a",
"list",
"of",
"supported",
"image",
"extensions",
"."
] | def get_supported_extensions():
"""
Returns a list of supported image extensions.
"""
return ('jpeg', 'jpg', 'png') | [
"def",
"get_supported_extensions",
"(",
")",
":",
"return",
"(",
"'jpeg'",
",",
"'jpg'",
",",
"'png'",
")"
] | https://github.com/ethereon/lycon/blob/93076d39ca8e42a509af471d620daa859c6c2a3f/lycon/core.py#L40-L44 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/external/bazel_tools/tools/build_defs/docker/create_image_config.py | python | KeyValueToDict | (pair) | return d | Converts an iterable object of key=value pairs to dictionary. | Converts an iterable object of key=value pairs to dictionary. | [
"Converts",
"an",
"iterable",
"object",
"of",
"key",
"=",
"value",
"pairs",
"to",
"dictionary",
"."
] | def KeyValueToDict(pair):
"""Converts an iterable object of key=value pairs to dictionary."""
d = dict()
for kv in pair:
(k, v) = kv.split('=', 1)
d[k] = v
return d | [
"def",
"KeyValueToDict",
"(",
"pair",
")",
":",
"d",
"=",
"dict",
"(",
")",
"for",
"kv",
"in",
"pair",
":",
"(",
"k",
",",
"v",
")",
"=",
"kv",
".",
"split",
"(",
"'='",
",",
"1",
")",
"d",
"[",
"k",
"]",
"=",
"v",
"return",
"d"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/external/bazel_tools/tools/build_defs/docker/create_image_config.py#L107-L113 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/distributed/DoInterestManager.py | python | DoInterestManager._sendAddInterest | (self, handle, contextId, parentId, zoneIdList, description,
action=None) | Part of the new otp-server code.
handle is a client-side created number that refers to
a set of interests. The same handle number doesn't
necessarily have any relationship to the same handle
on another client. | Part of the new otp-server code. | [
"Part",
"of",
"the",
"new",
"otp",
"-",
"server",
"code",
"."
] | def _sendAddInterest(self, handle, contextId, parentId, zoneIdList, description,
action=None):
"""
Part of the new otp-server code.
handle is a client-side created number that refers to
a set of interests. The same handle number doesn't
... | [
"def",
"_sendAddInterest",
"(",
"self",
",",
"handle",
",",
"contextId",
",",
"parentId",
",",
"zoneIdList",
",",
"description",
",",
"action",
"=",
"None",
")",
":",
"assert",
"DoInterestManager",
".",
"notify",
".",
"debugCall",
"(",
")",
"if",
"__debug__"... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/distributed/DoInterestManager.py#L485-L525 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/datetimes.py | python | sequence_to_dt64ns | (
data,
dtype=None,
copy=False,
tz=None,
dayfirst=False,
yearfirst=False,
ambiguous="raise",
) | return result, tz, inferred_freq | Parameters
----------
data : list-like
dtype : dtype, str, or None, default None
copy : bool, default False
tz : tzinfo, str, or None, default None
dayfirst : bool, default False
yearfirst : bool, default False
ambiguous : str, bool, or arraylike, default 'raise'
See pandas._libs... | Parameters
----------
data : list-like
dtype : dtype, str, or None, default None
copy : bool, default False
tz : tzinfo, str, or None, default None
dayfirst : bool, default False
yearfirst : bool, default False
ambiguous : str, bool, or arraylike, default 'raise'
See pandas._libs... | [
"Parameters",
"----------",
"data",
":",
"list",
"-",
"like",
"dtype",
":",
"dtype",
"str",
"or",
"None",
"default",
"None",
"copy",
":",
"bool",
"default",
"False",
"tz",
":",
"tzinfo",
"str",
"or",
"None",
"default",
"None",
"dayfirst",
":",
"bool",
"d... | def sequence_to_dt64ns(
data,
dtype=None,
copy=False,
tz=None,
dayfirst=False,
yearfirst=False,
ambiguous="raise",
):
"""
Parameters
----------
data : list-like
dtype : dtype, str, or None, default None
copy : bool, default False
tz : tzinfo, str, or None, default... | [
"def",
"sequence_to_dt64ns",
"(",
"data",
",",
"dtype",
"=",
"None",
",",
"copy",
"=",
"False",
",",
"tz",
"=",
"None",
",",
"dayfirst",
"=",
"False",
",",
"yearfirst",
"=",
"False",
",",
"ambiguous",
"=",
"\"raise\"",
",",
")",
":",
"inferred_freq",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/datetimes.py#L1678-L1803 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tpu/feature_column_v2.py | python | _TPUSharedEmbeddingColumnV2.is_categorical_column_weighted | (self) | return False | Check if the categorical column of the embedding column is weighted. | Check if the categorical column of the embedding column is weighted. | [
"Check",
"if",
"the",
"categorical",
"column",
"of",
"the",
"embedding",
"column",
"is",
"weighted",
"."
] | def is_categorical_column_weighted(self):
"""Check if the categorical column of the embedding column is weighted."""
if isinstance(
self.categorical_column,
(
fc._WeightedCategoricalColumn, # pylint: disable=protected-access
fc_lib.WeightedCategoricalColumn)):
retu... | [
"def",
"is_categorical_column_weighted",
"(",
"self",
")",
":",
"if",
"isinstance",
"(",
"self",
".",
"categorical_column",
",",
"(",
"fc",
".",
"_WeightedCategoricalColumn",
",",
"# pylint: disable=protected-access",
"fc_lib",
".",
"WeightedCategoricalColumn",
")",
")"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tpu/feature_column_v2.py#L508-L516 | |
stellar-deprecated/stellard | 67eabb2217bdfa9a6ea317f62338fb6bca458c90 | src/protobuf/python/mox.py | python | MockMethod.__call__ | (self, *params, **named_params) | return expected_method._return_value | Log parameters and return the specified return value.
If the Mock(Anything/Object) associated with this call is in record mode,
this MockMethod will be pushed onto the expected call queue. If the mock
is in replay mode, this will pop a MockMethod off the top of the queue and
verify this call is equal ... | Log parameters and return the specified return value. | [
"Log",
"parameters",
"and",
"return",
"the",
"specified",
"return",
"value",
"."
] | def __call__(self, *params, **named_params):
"""Log parameters and return the specified return value.
If the Mock(Anything/Object) associated with this call is in record mode,
this MockMethod will be pushed onto the expected call queue. If the mock
is in replay mode, this will pop a MockMethod off the... | [
"def",
"__call__",
"(",
"self",
",",
"*",
"params",
",",
"*",
"*",
"named_params",
")",
":",
"self",
".",
"_params",
"=",
"params",
"self",
".",
"_named_params",
"=",
"named_params",
"if",
"not",
"self",
".",
"_replay_mode",
":",
"self",
".",
"_call_queu... | https://github.com/stellar-deprecated/stellard/blob/67eabb2217bdfa9a6ea317f62338fb6bca458c90/src/protobuf/python/mox.py#L545-L573 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/framework/ops.py | python | get_collection_ref | (key) | return get_default_graph().get_collection_ref(key) | Wrapper for `Graph.get_collection_ref()` using the default graph.
See [`Graph.get_collection_ref()`](../../api_docs/python/framework.md#Graph.get_collection_ref)
for more details.
Args:
key: The key for the collection. For example, the `GraphKeys` class
contains many standard names for collections.
... | Wrapper for `Graph.get_collection_ref()` using the default graph. | [
"Wrapper",
"for",
"Graph",
".",
"get_collection_ref",
"()",
"using",
"the",
"default",
"graph",
"."
] | def get_collection_ref(key):
"""Wrapper for `Graph.get_collection_ref()` using the default graph.
See [`Graph.get_collection_ref()`](../../api_docs/python/framework.md#Graph.get_collection_ref)
for more details.
Args:
key: The key for the collection. For example, the `GraphKeys` class
contains many ... | [
"def",
"get_collection_ref",
"(",
"key",
")",
":",
"return",
"get_default_graph",
"(",
")",
".",
"get_collection_ref",
"(",
"key",
")"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/framework/ops.py#L3943-L3959 | |
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | src/python/m5/util/fdthelper.py | python | FdtState.int_to_cells | (self, value, cells) | return [(value >> 32*(x-1)) & 0xFFFFFFFF for x in range(cells, 0, -1)] | Helper function for: generates a list of 32 bit cells from an int,
used to split up addresses in appropriate 32 bit chunks. | Helper function for: generates a list of 32 bit cells from an int,
used to split up addresses in appropriate 32 bit chunks. | [
"Helper",
"function",
"for",
":",
"generates",
"a",
"list",
"of",
"32",
"bit",
"cells",
"from",
"an",
"int",
"used",
"to",
"split",
"up",
"addresses",
"in",
"appropriate",
"32",
"bit",
"chunks",
"."
] | def int_to_cells(self, value, cells):
"""Helper function for: generates a list of 32 bit cells from an int,
used to split up addresses in appropriate 32 bit chunks."""
value = int(value)
if (value >> (32 * cells)) != 0:
fatal("Value %d doesn't fit in %d cells" % (value, cell... | [
"def",
"int_to_cells",
"(",
"self",
",",
"value",
",",
"cells",
")",
":",
"value",
"=",
"int",
"(",
"value",
")",
"if",
"(",
"value",
">>",
"(",
"32",
"*",
"cells",
")",
")",
"!=",
"0",
":",
"fatal",
"(",
"\"Value %d doesn't fit in %d cells\"",
"%",
... | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/python/m5/util/fdthelper.py#L118-L126 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/entity_object/conversion/converter_object.py | python | RawAPIObject.link_patch_target | (self) | Set the target NyanObject for a patch. | Set the target NyanObject for a patch. | [
"Set",
"the",
"target",
"NyanObject",
"for",
"a",
"patch",
"."
] | def link_patch_target(self):
"""
Set the target NyanObject for a patch.
"""
if not self.is_patch():
raise Exception(f"Cannot link patch target: {self} is not a patch")
if isinstance(self._patch_target, ForwardRef):
target = self._patch_target.resolve()
... | [
"def",
"link_patch_target",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"is_patch",
"(",
")",
":",
"raise",
"Exception",
"(",
"f\"Cannot link patch target: {self} is not a patch\"",
")",
"if",
"isinstance",
"(",
"self",
".",
"_patch_target",
",",
"ForwardRef"... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/entity_object/conversion/converter_object.py#L434-L447 | ||
facebookincubator/BOLT | 88c70afe9d388ad430cc150cc158641701397f70 | third-party/benchmark/tools/gbench/util.py | python | find_benchmark_flag | (prefix, benchmark_flags) | return result | Search the specified list of flags for a flag matching `<prefix><arg>` and
if it is found return the arg it specifies. If specified more than once the
last value is returned. If the flag is not found None is returned. | Search the specified list of flags for a flag matching `<prefix><arg>` and
if it is found return the arg it specifies. If specified more than once the
last value is returned. If the flag is not found None is returned. | [
"Search",
"the",
"specified",
"list",
"of",
"flags",
"for",
"a",
"flag",
"matching",
"<prefix",
">",
"<arg",
">",
"and",
"if",
"it",
"is",
"found",
"return",
"the",
"arg",
"it",
"specifies",
".",
"If",
"specified",
"more",
"than",
"once",
"the",
"last",
... | def find_benchmark_flag(prefix, benchmark_flags):
"""
Search the specified list of flags for a flag matching `<prefix><arg>` and
if it is found return the arg it specifies. If specified more than once the
last value is returned. If the flag is not found None is returned.
"""
assert prefix.starts... | [
"def",
"find_benchmark_flag",
"(",
"prefix",
",",
"benchmark_flags",
")",
":",
"assert",
"prefix",
".",
"startswith",
"(",
"'--'",
")",
"and",
"prefix",
".",
"endswith",
"(",
"'='",
")",
"result",
"=",
"None",
"for",
"f",
"in",
"benchmark_flags",
":",
"if"... | https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/third-party/benchmark/tools/gbench/util.py#L91-L102 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | addon-sdk/source/python-lib/mozrunner/__init__.py | python | Runner.kill | (self, kill_signal=signal.SIGTERM) | Kill the browser | Kill the browser | [
"Kill",
"the",
"browser"
] | def kill(self, kill_signal=signal.SIGTERM):
"""Kill the browser"""
if sys.platform != 'win32':
self.process_handler.kill()
for name in self.names:
for pid in get_pids(name, self.process_handler.pid):
self.process_handler.pid = pid
... | [
"def",
"kill",
"(",
"self",
",",
"kill_signal",
"=",
"signal",
".",
"SIGTERM",
")",
":",
"if",
"sys",
".",
"platform",
"!=",
"'win32'",
":",
"self",
".",
"process_handler",
".",
"kill",
"(",
")",
"for",
"name",
"in",
"self",
".",
"names",
":",
"for",... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/addon-sdk/source/python-lib/mozrunner/__init__.py#L544-L560 | ||
OpenLightingProject/ola | d1433a1bed73276fbe55ce18c03b1c208237decc | python/ola/RDMAPI.py | python | RDMAPI.Get | (self, universe, uid, sub_device, pid, callback, args=[],
include_frames=False) | return self._SendRequest(universe, uid, sub_device, pid, callback, args,
PidStore.RDM_GET, include_frames) | Send a RDM Get message, packing the arguments into a message.
Args:
universe: The universe to send the request on.
uid: The UID to address the request to.
sub_device: The Sub Device to send the request to.
pid: A PID object that describes the format of the request.
callback: The callb... | Send a RDM Get message, packing the arguments into a message. | [
"Send",
"a",
"RDM",
"Get",
"message",
"packing",
"the",
"arguments",
"into",
"a",
"message",
"."
] | def Get(self, universe, uid, sub_device, pid, callback, args=[],
include_frames=False):
"""Send a RDM Get message, packing the arguments into a message.
Args:
universe: The universe to send the request on.
uid: The UID to address the request to.
sub_device: The Sub Device to send th... | [
"def",
"Get",
"(",
"self",
",",
"universe",
",",
"uid",
",",
"sub_device",
",",
"pid",
",",
"callback",
",",
"args",
"=",
"[",
"]",
",",
"include_frames",
"=",
"False",
")",
":",
"if",
"self",
".",
"_strict_checks",
"and",
"uid",
".",
"IsBroadcast",
... | https://github.com/OpenLightingProject/ola/blob/d1433a1bed73276fbe55ce18c03b1c208237decc/python/ola/RDMAPI.py#L91-L112 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | BookCtrlBase.GetCurrentPage | (*args, **kwargs) | return _core_.BookCtrlBase_GetCurrentPage(*args, **kwargs) | GetCurrentPage(self) -> Window | GetCurrentPage(self) -> Window | [
"GetCurrentPage",
"(",
"self",
")",
"-",
">",
"Window"
] | def GetCurrentPage(*args, **kwargs):
"""GetCurrentPage(self) -> Window"""
return _core_.BookCtrlBase_GetCurrentPage(*args, **kwargs) | [
"def",
"GetCurrentPage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"BookCtrlBase_GetCurrentPage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L13542-L13544 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/database.py | python | InstalledDistribution._get_records | (self) | return results | Get the list of installed files for the distribution
:return: A list of tuples of path, hash and size. Note that hash and
size might be ``None`` for some entries. The path is exactly
as stored in the file (which is as in PEP 376). | Get the list of installed files for the distribution
:return: A list of tuples of path, hash and size. Note that hash and
size might be ``None`` for some entries. The path is exactly
as stored in the file (which is as in PEP 376). | [
"Get",
"the",
"list",
"of",
"installed",
"files",
"for",
"the",
"distribution",
":",
"return",
":",
"A",
"list",
"of",
"tuples",
"of",
"path",
"hash",
"and",
"size",
".",
"Note",
"that",
"hash",
"and",
"size",
"might",
"be",
"None",
"for",
"some",
"ent... | def _get_records(self):
"""
Get the list of installed files for the distribution
:return: A list of tuples of path, hash and size. Note that hash and
size might be ``None`` for some entries. The path is exactly
as stored in the file (which is as in PEP 376).
... | [
"def",
"_get_records",
"(",
"self",
")",
":",
"results",
"=",
"[",
"]",
"r",
"=",
"self",
".",
"get_distinfo_resource",
"(",
"'RECORD'",
")",
"with",
"contextlib",
".",
"closing",
"(",
"r",
".",
"as_stream",
"(",
")",
")",
"as",
"stream",
":",
"with",
... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/database.py#L580-L601 | |
ApolloAuto/apollo | 463fb82f9e979d02dcb25044e60931293ab2dba0 | modules/tools/routing/debug_topo.py | python | plot_node | (node, plot_id, color) | return mid_pt | plot topology graph node | plot topology graph node | [
"plot",
"topology",
"graph",
"node"
] | def plot_node(node, plot_id, color):
"""plot topology graph node"""
print('length of %s: %f' % (node.lane_id, node.length))
mid_pt = plot_central_curve(node.central_curve, color)
if 'l' in plot_id:
draw_id(mid_pt, node.lane_id, 'green')
if 'r' in plot_id:
draw_id(mid_pt, node.road_id... | [
"def",
"plot_node",
"(",
"node",
",",
"plot_id",
",",
"color",
")",
":",
"print",
"(",
"'length of %s: %f'",
"%",
"(",
"node",
".",
"lane_id",
",",
"node",
".",
"length",
")",
")",
"mid_pt",
"=",
"plot_central_curve",
"(",
"node",
".",
"central_curve",
"... | https://github.com/ApolloAuto/apollo/blob/463fb82f9e979d02dcb25044e60931293ab2dba0/modules/tools/routing/debug_topo.py#L129-L137 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | contrib/gizmos/gtk/gizmos.py | python | TreeListCtrl.ScrollTo | (*args, **kwargs) | return _gizmos.TreeListCtrl_ScrollTo(*args, **kwargs) | ScrollTo(self, TreeItemId item) | ScrollTo(self, TreeItemId item) | [
"ScrollTo",
"(",
"self",
"TreeItemId",
"item",
")"
] | def ScrollTo(*args, **kwargs):
"""ScrollTo(self, TreeItemId item)"""
return _gizmos.TreeListCtrl_ScrollTo(*args, **kwargs) | [
"def",
"ScrollTo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gizmos",
".",
"TreeListCtrl_ScrollTo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/gtk/gizmos.py#L911-L913 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/email/_policybase.py | python | _PolicyBase.__init__ | (self, **kw) | Create new Policy, possibly overriding some defaults.
See class docstring for a list of overridable attributes. | Create new Policy, possibly overriding some defaults. | [
"Create",
"new",
"Policy",
"possibly",
"overriding",
"some",
"defaults",
"."
] | def __init__(self, **kw):
"""Create new Policy, possibly overriding some defaults.
See class docstring for a list of overridable attributes.
"""
for name, value in kw.items():
if hasattr(self, name):
super(_PolicyBase,self).__setattr__(name, value)
... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"*",
"kw",
")",
":",
"for",
"name",
",",
"value",
"in",
"kw",
".",
"items",
"(",
")",
":",
"if",
"hasattr",
"(",
"self",
",",
"name",
")",
":",
"super",
"(",
"_PolicyBase",
",",
"self",
")",
".",
"__set... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/email/_policybase.py#L41-L53 | ||
samdauwe/BabylonCpp | 3dad13a666299cbcf2e2db5b24575c19743e1000 | codegeneration/generate_shader_store.py | python | generateProceduralTexturesShaderHeaders | (inputDir, outputDir) | Generates procedural textures library header files. | Generates procedural textures library header files. | [
"Generates",
"procedural",
"textures",
"library",
"header",
"files",
"."
] | def generateProceduralTexturesShaderHeaders(inputDir, outputDir):
"""
Generates procedural textures library header files.
"""
import time
proceduralTexturesInputDir = os.path.join(inputDir,
"proceduralTexturesLibrary", "src")
proceduralTexturesOuputDir = o... | [
"def",
"generateProceduralTexturesShaderHeaders",
"(",
"inputDir",
",",
"outputDir",
")",
":",
"import",
"time",
"proceduralTexturesInputDir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"inputDir",
",",
"\"proceduralTexturesLibrary\"",
",",
"\"src\"",
")",
"proceduralT... | https://github.com/samdauwe/BabylonCpp/blob/3dad13a666299cbcf2e2db5b24575c19743e1000/codegeneration/generate_shader_store.py#L346-L380 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Terminal/Standard_Suite.py | python | Standard_Suite_Events.move | (self, _object, _attributes={}, **_arguments) | move: Move object(s) to a new location.
Required argument: the object for the command
Keyword argument to: The new location for the object(s).
Keyword argument _attributes: AppleEvent attribute dictionary | move: Move object(s) to a new location.
Required argument: the object for the command
Keyword argument to: The new location for the object(s).
Keyword argument _attributes: AppleEvent attribute dictionary | [
"move",
":",
"Move",
"object",
"(",
"s",
")",
"to",
"a",
"new",
"location",
".",
"Required",
"argument",
":",
"the",
"object",
"for",
"the",
"command",
"Keyword",
"argument",
"to",
":",
"The",
"new",
"location",
"for",
"the",
"object",
"(",
"s",
")",
... | def move(self, _object, _attributes={}, **_arguments):
"""move: Move object(s) to a new location.
Required argument: the object for the command
Keyword argument to: The new location for the object(s).
Keyword argument _attributes: AppleEvent attribute dictionary
"""
_code... | [
"def",
"move",
"(",
"self",
",",
"_object",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'core'",
"_subcode",
"=",
"'move'",
"aetools",
".",
"keysubst",
"(",
"_arguments",
",",
"self",
".",
"_argmap_move",
")... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Terminal/Standard_Suite.py#L193-L212 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/v8/third_party/jinja2/bccache.py | python | BytecodeCache.clear | (self) | Clears the cache. This method is not used by Jinja2 but should be
implemented to allow applications to clear the bytecode cache used
by a particular environment. | Clears the cache. This method is not used by Jinja2 but should be
implemented to allow applications to clear the bytecode cache used
by a particular environment. | [
"Clears",
"the",
"cache",
".",
"This",
"method",
"is",
"not",
"used",
"by",
"Jinja2",
"but",
"should",
"be",
"implemented",
"to",
"allow",
"applications",
"to",
"clear",
"the",
"bytecode",
"cache",
"used",
"by",
"a",
"particular",
"environment",
"."
] | def clear(self):
"""Clears the cache. This method is not used by Jinja2 but should be
implemented to allow applications to clear the bytecode cache used
by a particular environment.
""" | [
"def",
"clear",
"(",
"self",
")",
":"
] | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/v8/third_party/jinja2/bccache.py#L160-L164 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/pexpect/screen.py | python | screen.lf | (self) | This moves the cursor down with scrolling. | This moves the cursor down with scrolling. | [
"This",
"moves",
"the",
"cursor",
"down",
"with",
"scrolling",
"."
] | def lf (self):
"""This moves the cursor down with scrolling.
"""
old_r = self.cur_r
self.cursor_down()
if old_r == self.cur_r:
self.scroll_up ()
self.erase_line() | [
"def",
"lf",
"(",
"self",
")",
":",
"old_r",
"=",
"self",
".",
"cur_r",
"self",
".",
"cursor_down",
"(",
")",
"if",
"old_r",
"==",
"self",
".",
"cur_r",
":",
"self",
".",
"scroll_up",
"(",
")",
"self",
".",
"erase_line",
"(",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/pexpect/screen.py#L126-L135 | ||
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/agents/train_ppo.py | python | train | (config, env_processes) | Training and evaluation entry point yielding scores.
Resolves some configuration attributes, creates environments, graph, and
training loop. By default, assigns all operations to the CPU.
Args:
config: Object providing configurations via attributes.
env_processes: Whether to step environments in separat... | Training and evaluation entry point yielding scores. | [
"Training",
"and",
"evaluation",
"entry",
"point",
"yielding",
"scores",
"."
] | def train(config, env_processes):
"""Training and evaluation entry point yielding scores.
Resolves some configuration attributes, creates environments, graph, and
training loop. By default, assigns all operations to the CPU.
Args:
config: Object providing configurations via attributes.
env_processes: ... | [
"def",
"train",
"(",
"config",
",",
"env_processes",
")",
":",
"tf",
".",
"reset_default_graph",
"(",
")",
"if",
"config",
".",
"update_every",
"%",
"config",
".",
"num_agents",
":",
"tf",
".",
"logging",
".",
"warn",
"(",
"'Number of agents should divide epis... | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/agents/train_ppo.py#L94-L127 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/gyp/pylib/gyp/generator/ninja.py | python | NinjaWriter.WriteSources | (self, ninja_file, config_name, config, sources, predepends,
precompiled_header, spec) | Write build rules to compile all of |sources|. | Write build rules to compile all of |sources|. | [
"Write",
"build",
"rules",
"to",
"compile",
"all",
"of",
"|sources|",
"."
] | def WriteSources(self, ninja_file, config_name, config, sources, predepends,
precompiled_header, spec):
"""Write build rules to compile all of |sources|."""
if self.toolset == 'host':
self.ninja.variable('ar', '$ar_host')
self.ninja.variable('cc', '$cc_host')
self.ninja.vari... | [
"def",
"WriteSources",
"(",
"self",
",",
"ninja_file",
",",
"config_name",
",",
"config",
",",
"sources",
",",
"predepends",
",",
"precompiled_header",
",",
"spec",
")",
":",
"if",
"self",
".",
"toolset",
"==",
"'host'",
":",
"self",
".",
"ninja",
".",
"... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/generator/ninja.py#L904-L924 | ||
bundy-dns/bundy | 3d41934996b82b0cd2fe22dd74d2abc1daba835d | src/lib/python/bundy/server_common/bundy_server.py | python | BUNDYServer.unwatch_fileno | (self, fileno, on_read, on_write, on_error) | Unregister a fileno for the internal select() call.
This is a cancel operation for callbacks registered in watch_fileno().
Currently, on_xxx parameters are expected to be bool, and if True
all callbacks for 'fileno' will be removed. If we see the need in
future, this can be extended so... | Unregister a fileno for the internal select() call. | [
"Unregister",
"a",
"fileno",
"for",
"the",
"internal",
"select",
"()",
"call",
"."
] | def unwatch_fileno(self, fileno, on_read, on_write, on_error):
"""Unregister a fileno for the internal select() call.
This is a cancel operation for callbacks registered in watch_fileno().
Currently, on_xxx parameters are expected to be bool, and if True
all callbacks for 'fileno' will ... | [
"def",
"unwatch_fileno",
"(",
"self",
",",
"fileno",
",",
"on_read",
",",
"on_write",
",",
"on_error",
")",
":",
"if",
"on_read",
":",
"if",
"not",
"fileno",
"in",
"self",
".",
"_read_callbacks",
".",
"keys",
"(",
")",
":",
"raise",
"ValueError",
"(",
... | https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/src/lib/python/bundy/server_common/bundy_server.py#L217-L246 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/command/easy_install.py | python | samefile | (p1, p2) | return norm_p1 == norm_p2 | Determine if two paths reference the same file.
Augments os.path.samefile to work on Windows and
suppresses errors if the path doesn't exist. | Determine if two paths reference the same file. | [
"Determine",
"if",
"two",
"paths",
"reference",
"the",
"same",
"file",
"."
] | def samefile(p1, p2):
"""
Determine if two paths reference the same file.
Augments os.path.samefile to work on Windows and
suppresses errors if the path doesn't exist.
"""
both_exist = os.path.exists(p1) and os.path.exists(p2)
use_samefile = hasattr(os.path, 'samefile') and both_exist
i... | [
"def",
"samefile",
"(",
"p1",
",",
"p2",
")",
":",
"both_exist",
"=",
"os",
".",
"path",
".",
"exists",
"(",
"p1",
")",
"and",
"os",
".",
"path",
".",
"exists",
"(",
"p2",
")",
"use_samefile",
"=",
"hasattr",
"(",
"os",
".",
"path",
",",
"'samefi... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/command/easy_install.py#L78-L91 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | PhysicsTools/Heppy/python/analyzers/examples/ZMuMuAnalyzer.py | python | ZMuMuAnalyzer.testMuonID | (self, muon) | return muon.tightId() and \
self.testVertex( muon ) | Tight muon selection, no isolation requirement | Tight muon selection, no isolation requirement | [
"Tight",
"muon",
"selection",
"no",
"isolation",
"requirement"
] | def testMuonID(self, muon):
'''Tight muon selection, no isolation requirement'''
# import pdb; pdb.set_trace()
return muon.tightId() and \
self.testVertex( muon ) | [
"def",
"testMuonID",
"(",
"self",
",",
"muon",
")",
":",
"# import pdb; pdb.set_trace()",
"return",
"muon",
".",
"tightId",
"(",
")",
"and",
"self",
".",
"testVertex",
"(",
"muon",
")"
] | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/PhysicsTools/Heppy/python/analyzers/examples/ZMuMuAnalyzer.py#L67-L71 | |
gnina/gnina | b9ae032f52fc7a8153987bde09c0efa3620d8bb6 | caffe/python/caffe/pycaffe.py | python | _Net_backward | (self, diffs=None, start=None, end=None, **kwargs) | return {out: self.blobs[out].diff for out in outputs} | Backward pass: prepare diffs and run the net backward.
Parameters
----------
diffs : list of diffs to return in addition to bottom diffs.
kwargs : Keys are output blob names and values are diff ndarrays.
If None, top diffs are taken from forward loss.
start : optional name of layer at w... | Backward pass: prepare diffs and run the net backward. | [
"Backward",
"pass",
":",
"prepare",
"diffs",
"and",
"run",
"the",
"net",
"backward",
"."
] | def _Net_backward(self, diffs=None, start=None, end=None, **kwargs):
"""
Backward pass: prepare diffs and run the net backward.
Parameters
----------
diffs : list of diffs to return in addition to bottom diffs.
kwargs : Keys are output blob names and values are diff ndarrays.
If Non... | [
"def",
"_Net_backward",
"(",
"self",
",",
"diffs",
"=",
"None",
",",
"start",
"=",
"None",
",",
"end",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"diffs",
"is",
"None",
":",
"diffs",
"=",
"[",
"]",
"if",
"start",
"is",
"not",
"None",
... | https://github.com/gnina/gnina/blob/b9ae032f52fc7a8153987bde09c0efa3620d8bb6/caffe/python/caffe/pycaffe.py#L137-L182 | |
h2oai/datatable | 753197c3f76041dd6468e0f6a9708af92d80f6aa | src/datatable/utils/misc.py | python | humanize_bytes | (size) | Convert given number of bytes into a human readable representation, i.e. add
prefix such as KB, MB, GB, etc. The `size` argument must be a non-negative
integer.
:param size: integer representing byte size of something
:return: string representation of the size, in human-readable form | Convert given number of bytes into a human readable representation, i.e. add
prefix such as KB, MB, GB, etc. The `size` argument must be a non-negative
integer. | [
"Convert",
"given",
"number",
"of",
"bytes",
"into",
"a",
"human",
"readable",
"representation",
"i",
".",
"e",
".",
"add",
"prefix",
"such",
"as",
"KB",
"MB",
"GB",
"etc",
".",
"The",
"size",
"argument",
"must",
"be",
"a",
"non",
"-",
"negative",
"int... | def humanize_bytes(size):
"""
Convert given number of bytes into a human readable representation, i.e. add
prefix such as KB, MB, GB, etc. The `size` argument must be a non-negative
integer.
:param size: integer representing byte size of something
:return: string representation of the size, in ... | [
"def",
"humanize_bytes",
"(",
"size",
")",
":",
"if",
"size",
"==",
"0",
":",
"return",
"\"0\"",
"if",
"size",
"is",
"None",
":",
"return",
"\"\"",
"assert",
"size",
">=",
"0",
",",
"\"`size` cannot be negative, got %d\"",
"%",
"size",
"suffixes",
"=",
"\"... | https://github.com/h2oai/datatable/blob/753197c3f76041dd6468e0f6a9708af92d80f6aa/src/datatable/utils/misc.py#L185-L211 | ||
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/gdata/auth.py | python | generate_client_login_request_body | (email, password, service, source,
account_type='HOSTED_OR_GOOGLE', captcha_token=None,
captcha_response=None) | return gdata.gauth.generate_client_login_request_body(email, password,
service, source, account_type, captcha_token, captcha_response) | Creates the body of the autentication request
See http://code.google.com/apis/accounts/AuthForInstalledApps.html#Request
for more details.
Args:
email: str
password: str
service: str
source: str
account_type: str (optional) Defaul is 'HOSTED_OR_GOOGLE', other valid
values are 'GOOGLE... | Creates the body of the autentication request | [
"Creates",
"the",
"body",
"of",
"the",
"autentication",
"request"
] | def generate_client_login_request_body(email, password, service, source,
account_type='HOSTED_OR_GOOGLE', captcha_token=None,
captcha_response=None):
"""Creates the body of the autentication request
See http://code.google.com/apis/accounts/AuthForInstalledApps.html#Request
for more details.
Args:
... | [
"def",
"generate_client_login_request_body",
"(",
"email",
",",
"password",
",",
"service",
",",
"source",
",",
"account_type",
"=",
"'HOSTED_OR_GOOGLE'",
",",
"captcha_token",
"=",
"None",
",",
"captcha_response",
"=",
"None",
")",
":",
"return",
"gdata",
".",
... | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/auth.py#L74-L96 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/extension.py | python | _make_wrapped_comparison_op | (opname) | return wrapper | Create a comparison method that dispatches to ``._data``. | Create a comparison method that dispatches to ``._data``. | [
"Create",
"a",
"comparison",
"method",
"that",
"dispatches",
"to",
".",
"_data",
"."
] | def _make_wrapped_comparison_op(opname):
"""
Create a comparison method that dispatches to ``._data``.
"""
def wrapper(self, other):
if isinstance(other, ABCSeries):
# the arrays defer to Series for comparison ops but the indexes
# don't, so we have to unwrap here.
... | [
"def",
"_make_wrapped_comparison_op",
"(",
"opname",
")",
":",
"def",
"wrapper",
"(",
"self",
",",
"other",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"ABCSeries",
")",
":",
"# the arrays defer to Series for comparison ops but the indexes",
"# don't, so we have t... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/extension.py#L115-L132 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/msvs.py | python | _EscapeCommandLineArgumentForMSBuild | (s) | return s | Escapes a Windows command-line argument for use by MSBuild. | Escapes a Windows command-line argument for use by MSBuild. | [
"Escapes",
"a",
"Windows",
"command",
"-",
"line",
"argument",
"for",
"use",
"by",
"MSBuild",
"."
] | def _EscapeCommandLineArgumentForMSBuild(s):
"""Escapes a Windows command-line argument for use by MSBuild."""
def _Replace(match):
return (len(match.group(1))/2*4)*'\\' + '\\"'
# Escape all quotes so that they are interpreted literally.
s = quote_replacer_regex2.sub(_Replace, s)
return s | [
"def",
"_EscapeCommandLineArgumentForMSBuild",
"(",
"s",
")",
":",
"def",
"_Replace",
"(",
"match",
")",
":",
"return",
"(",
"len",
"(",
"match",
".",
"group",
"(",
"1",
")",
")",
"/",
"2",
"*",
"4",
")",
"*",
"'\\\\'",
"+",
"'\\\\\"'",
"# Escape all q... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/msvs.py#L719-L727 | |
herbstluftwm/herbstluftwm | 23ef0274bd4d317208eae5fea72b21478a71431b | doc/gendoc.py | python | ObjectInformation.superclasses_transitive | (self) | return cls2supers | return a set of a dict mapping a class to the set
of it's transitive superclasses | return a set of a dict mapping a class to the set
of it's transitive superclasses | [
"return",
"a",
"set",
"of",
"a",
"dict",
"mapping",
"a",
"class",
"to",
"the",
"set",
"of",
"it",
"s",
"transitive",
"superclasses"
] | def superclasses_transitive(self):
"""return a set of a dict mapping a class to the set
of it's transitive superclasses"""
def bounded_depth_first_search(clsname, target_dict):
"""collect all super classes for 'clsname' and put it into
the target_dict"""
# che... | [
"def",
"superclasses_transitive",
"(",
"self",
")",
":",
"def",
"bounded_depth_first_search",
"(",
"clsname",
",",
"target_dict",
")",
":",
"\"\"\"collect all super classes for 'clsname' and put it into\n the target_dict\"\"\"",
"# check this first to avoid cycles",
"if",
... | https://github.com/herbstluftwm/herbstluftwm/blob/23ef0274bd4d317208eae5fea72b21478a71431b/doc/gendoc.py#L509-L528 | |
intel-iot-devkit/how-to-code-samples | b4ea616f36bbfa2e042beb1698f968cfd651d79f | watering-system/python/iot_watering_system/hardware/board.py | python | Board.remove_event_handler | (self, event, handler) | Remove hardware event handler. | Remove hardware event handler. | [
"Remove",
"hardware",
"event",
"handler",
"."
] | def remove_event_handler(self, event, handler):
"""
Remove hardware event handler.
"""
self.emitter.remove(event, handler) | [
"def",
"remove_event_handler",
"(",
"self",
",",
"event",
",",
"handler",
")",
":",
"self",
".",
"emitter",
".",
"remove",
"(",
"event",
",",
"handler",
")"
] | https://github.com/intel-iot-devkit/how-to-code-samples/blob/b4ea616f36bbfa2e042beb1698f968cfd651d79f/watering-system/python/iot_watering_system/hardware/board.py#L86-L92 | ||
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | gr-digital/python/digital/qa_ofdm_chanest_vcvc.py | python | qa_ofdm_chanest_vcvc.test_006_channel_and_carroffset | (self) | Add a channel, check if it's correctly estimated | Add a channel, check if it's correctly estimated | [
"Add",
"a",
"channel",
"check",
"if",
"it",
"s",
"correctly",
"estimated"
] | def test_006_channel_and_carroffset(self):
""" Add a channel, check if it's correctly estimated """
fft_len = 16
carr_offset = 2
# Index 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
# 15
sync_symbol1 = (0, 0, 0, 1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, 0)
... | [
"def",
"test_006_channel_and_carroffset",
"(",
"self",
")",
":",
"fft_len",
"=",
"16",
"carr_offset",
"=",
"2",
"# Index 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14",
"# 15",
"sync_symbol1",
"=",
"(",
"0",
",",
"0",
",",
"0",
",",
"1",
",",
"0",
... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-digital/python/digital/qa_ofdm_chanest_vcvc.py#L182-L215 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/sparse/coo.py | python | coo_matrix.sum_duplicates | (self) | Eliminate duplicate matrix entries by adding them together
This is an *in place* operation | Eliminate duplicate matrix entries by adding them together | [
"Eliminate",
"duplicate",
"matrix",
"entries",
"by",
"adding",
"them",
"together"
] | def sum_duplicates(self):
"""Eliminate duplicate matrix entries by adding them together
This is an *in place* operation
"""
if self.has_canonical_format:
return
summed = self._sum_duplicates(self.row, self.col, self.data)
self.row, self.col, self.data = summe... | [
"def",
"sum_duplicates",
"(",
"self",
")",
":",
"if",
"self",
".",
"has_canonical_format",
":",
"return",
"summed",
"=",
"self",
".",
"_sum_duplicates",
"(",
"self",
".",
"row",
",",
"self",
".",
"col",
",",
"self",
".",
"data",
")",
"self",
".",
"row"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/sparse/coo.py#L522-L531 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/distributions/util.py | python | matrix_diag_transform | (matrix, transform=None, name=None) | return transformed_mat | Transform diagonal of [batch-]matrix, leave rest of matrix unchanged.
Create a trainable covariance defined by a Cholesky factor:
```python
# Transform network layer into 2 x 2 array.
matrix_values = tf.contrib.layers.fully_connected(activations, 4)
matrix = tf.reshape(matrix_values, (batch_size, 2, 2))
... | Transform diagonal of [batch-]matrix, leave rest of matrix unchanged. | [
"Transform",
"diagonal",
"of",
"[",
"batch",
"-",
"]",
"matrix",
"leave",
"rest",
"of",
"matrix",
"unchanged",
"."
] | def matrix_diag_transform(matrix, transform=None, name=None):
"""Transform diagonal of [batch-]matrix, leave rest of matrix unchanged.
Create a trainable covariance defined by a Cholesky factor:
```python
# Transform network layer into 2 x 2 array.
matrix_values = tf.contrib.layers.fully_connected(activatio... | [
"def",
"matrix_diag_transform",
"(",
"matrix",
",",
"transform",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"matrix_diag_transform\"",
",",
"[",
"matrix",
"]",
")",
":",
"matrix",
"=",
"ops",
".... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/distributions/util.py#L521-L580 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/signal/signaltools.py | python | hilbert2 | (x, N=None) | return x | Compute the '2-D' analytic signal of `x`
Parameters
----------
x : array_like
2-D signal data.
N : int or tuple of two ints, optional
Number of Fourier components. Default is ``x.shape``
Returns
-------
xa : ndarray
Analytic signal of `x` taken along axes (0,1).
... | Compute the '2-D' analytic signal of `x` | [
"Compute",
"the",
"2",
"-",
"D",
"analytic",
"signal",
"of",
"x"
] | def hilbert2(x, N=None):
"""
Compute the '2-D' analytic signal of `x`
Parameters
----------
x : array_like
2-D signal data.
N : int or tuple of two ints, optional
Number of Fourier components. Default is ``x.shape``
Returns
-------
xa : ndarray
Analytic sign... | [
"def",
"hilbert2",
"(",
"x",
",",
"N",
"=",
"None",
")",
":",
"x",
"=",
"atleast_2d",
"(",
"x",
")",
"if",
"x",
".",
"ndim",
">",
"2",
":",
"raise",
"ValueError",
"(",
"\"x must be 2-D.\"",
")",
"if",
"iscomplexobj",
"(",
"x",
")",
":",
"raise",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/signal/signaltools.py#L1624-L1681 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/jira/client.py | python | JIRA.add_watcher | (self, issue, watcher) | Add a user to an issue's watchers list.
:param issue: ID or key of the issue affected
:param watcher: username of the user to add to the watchers list | Add a user to an issue's watchers list. | [
"Add",
"a",
"user",
"to",
"an",
"issue",
"s",
"watchers",
"list",
"."
] | def add_watcher(self, issue, watcher):
"""Add a user to an issue's watchers list.
:param issue: ID or key of the issue affected
:param watcher: username of the user to add to the watchers list
"""
url = self._get_url('issue/' + str(issue) + '/watchers')
self._session.pos... | [
"def",
"add_watcher",
"(",
"self",
",",
"issue",
",",
"watcher",
")",
":",
"url",
"=",
"self",
".",
"_get_url",
"(",
"'issue/'",
"+",
"str",
"(",
"issue",
")",
"+",
"'/watchers'",
")",
"self",
".",
"_session",
".",
"post",
"(",
"url",
",",
"data",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/jira/client.py#L1598-L1606 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/rospy/src/rospy/impl/broadcast_manager.py | python | BroadcastManager.getPid | (self, caller_id) | return 1, "", os.getpid() | Get the PID of this server | Get the PID of this server | [
"Get",
"the",
"PID",
"of",
"this",
"server"
] | def getPid(self, caller_id):
"""
Get the PID of this server
"""
return 1, "", os.getpid() | [
"def",
"getPid",
"(",
"self",
",",
"caller_id",
")",
":",
"return",
"1",
",",
"\"\"",
",",
"os",
".",
"getpid",
"(",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rospy/src/rospy/impl/broadcast_manager.py#L202-L206 | |
RLBot/RLBot | 34332b12cf158b3ef8dbf174ae67c53683368a9d | src/main/python/rlbot/agents/base_agent.py | python | BaseAgent.get_extra_pids | (self) | return [] | Gets the list of process ids that should be marked as high priority.
:return: A list of process ids that are used by this bot in addition to the ones inside the python process. | Gets the list of process ids that should be marked as high priority.
:return: A list of process ids that are used by this bot in addition to the ones inside the python process. | [
"Gets",
"the",
"list",
"of",
"process",
"ids",
"that",
"should",
"be",
"marked",
"as",
"high",
"priority",
".",
":",
"return",
":",
"A",
"list",
"of",
"process",
"ids",
"that",
"are",
"used",
"by",
"this",
"bot",
"in",
"addition",
"to",
"the",
"ones",
... | def get_extra_pids(self):
"""
Gets the list of process ids that should be marked as high priority.
:return: A list of process ids that are used by this bot in addition to the ones inside the python process.
"""
return [] | [
"def",
"get_extra_pids",
"(",
"self",
")",
":",
"return",
"[",
"]"
] | https://github.com/RLBot/RLBot/blob/34332b12cf158b3ef8dbf174ae67c53683368a9d/src/main/python/rlbot/agents/base_agent.py#L196-L201 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/io/pytables.py | python | HDFStore.__getattr__ | (self, name) | allow attribute access to get stores | allow attribute access to get stores | [
"allow",
"attribute",
"access",
"to",
"get",
"stores"
] | def __getattr__(self, name):
""" allow attribute access to get stores """
try:
return self.get(name)
except (KeyError, ClosedFileError):
pass
raise AttributeError(
"'{object}' object has no attribute '{name}'".format(
object=type(self).... | [
"def",
"__getattr__",
"(",
"self",
",",
"name",
")",
":",
"try",
":",
"return",
"self",
".",
"get",
"(",
"name",
")",
"except",
"(",
"KeyError",
",",
"ClosedFileError",
")",
":",
"pass",
"raise",
"AttributeError",
"(",
"\"'{object}' object has no attribute '{n... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/io/pytables.py#L512-L520 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | tools/heapcheck/suppressions.py | python | ReadSuppressionsFromFile | (filename) | return result | Given a file, returns a list of suppressions. | Given a file, returns a list of suppressions. | [
"Given",
"a",
"file",
"returns",
"a",
"list",
"of",
"suppressions",
"."
] | def ReadSuppressionsFromFile(filename):
"""Given a file, returns a list of suppressions."""
input_file = file(filename, 'r')
result = []
cur_descr = ''
cur_type = ''
cur_stack = []
nline = 0
try:
for line in input_file:
nline += 1
line = line.strip()
if line.startswith('#'):
... | [
"def",
"ReadSuppressionsFromFile",
"(",
"filename",
")",
":",
"input_file",
"=",
"file",
"(",
"filename",
",",
"'r'",
")",
"result",
"=",
"[",
"]",
"cur_descr",
"=",
"''",
"cur_type",
"=",
"''",
"cur_stack",
"=",
"[",
"]",
"nline",
"=",
"0",
"try",
":"... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/heapcheck/suppressions.py#L102-L140 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.GetHotspotSingleLine | (*args, **kwargs) | return _stc.StyledTextCtrl_GetHotspotSingleLine(*args, **kwargs) | GetHotspotSingleLine(self) -> bool
Get the HotspotSingleLine property | GetHotspotSingleLine(self) -> bool | [
"GetHotspotSingleLine",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetHotspotSingleLine(*args, **kwargs):
"""
GetHotspotSingleLine(self) -> bool
Get the HotspotSingleLine property
"""
return _stc.StyledTextCtrl_GetHotspotSingleLine(*args, **kwargs) | [
"def",
"GetHotspotSingleLine",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_GetHotspotSingleLine",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L5272-L5278 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/sans/command_interface/ISISCommandInterface.py | python | LimitsQXY | (qmin, qmax, step, type) | To set the bin parameters for the algorithm Qxy()
@param qmin: the first Q value to include
@param qmaz: the last Q value to include
@param step: bin width
@param type: pass LOG for logarithmic binning | To set the bin parameters for the algorithm Qxy() | [
"To",
"set",
"the",
"bin",
"parameters",
"for",
"the",
"algorithm",
"Qxy",
"()"
] | def LimitsQXY(qmin, qmax, step, type):
"""
To set the bin parameters for the algorithm Qxy()
@param qmin: the first Q value to include
@param qmaz: the last Q value to include
@param step: bin width
@param type: pass LOG for logarithmic binning
"""
qmin = float(qmin)
... | [
"def",
"LimitsQXY",
"(",
"qmin",
",",
"qmax",
",",
"step",
",",
"type",
")",
":",
"qmin",
"=",
"float",
"(",
"qmin",
")",
"qmax",
"=",
"float",
"(",
"qmax",
")",
"step",
"=",
"float",
"(",
"step",
")",
"print_message",
"(",
"'LimitsQXY('",
"+",
"st... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/sans/command_interface/ISISCommandInterface.py#L620-L639 | ||
appleseedhq/appleseed | 1ba62025b5db722e179a2219d8d366c34bfaa342 | sandbox/lib/python/site-packages/Qt.py | python | _none | () | Internal option (used in installer) | Internal option (used in installer) | [
"Internal",
"option",
"(",
"used",
"in",
"installer",
")"
] | def _none():
"""Internal option (used in installer)"""
Mock = type("Mock", (), {"__getattr__": lambda Qt, attr: None})
Qt.__binding__ = "None"
Qt.__qt_version__ = "0.0.0"
Qt.__binding_version__ = "0.0.0"
Qt.QtCompat.loadUi = lambda uifile, baseinstance=None: None
Qt.QtCompat.setSectionResi... | [
"def",
"_none",
"(",
")",
":",
"Mock",
"=",
"type",
"(",
"\"Mock\"",
",",
"(",
")",
",",
"{",
"\"__getattr__\"",
":",
"lambda",
"Qt",
",",
"attr",
":",
"None",
"}",
")",
"Qt",
".",
"__binding__",
"=",
"\"None\"",
"Qt",
".",
"__qt_version__",
"=",
"... | https://github.com/appleseedhq/appleseed/blob/1ba62025b5db722e179a2219d8d366c34bfaa342/sandbox/lib/python/site-packages/Qt.py#L1285-L1298 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/aui.py | python | AuiToolBar.DeleteTool | (*args, **kwargs) | return _aui.AuiToolBar_DeleteTool(*args, **kwargs) | DeleteTool(self, int toolId) -> bool | DeleteTool(self, int toolId) -> bool | [
"DeleteTool",
"(",
"self",
"int",
"toolId",
")",
"-",
">",
"bool"
] | def DeleteTool(*args, **kwargs):
"""DeleteTool(self, int toolId) -> bool"""
return _aui.AuiToolBar_DeleteTool(*args, **kwargs) | [
"def",
"DeleteTool",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiToolBar_DeleteTool",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/aui.py#L2078-L2080 | |
jeog/TDAmeritradeAPI | 91c738afd7d57b54f6231170bd64c2550fafd34d | python/tdma_api/get.py | python | UserPrincipalsGetter.returns_preferences | (self) | return bool(clib.get_val(self._abi('ReturnsPreferences'),
c_int, self._obj)) | Returns if user preferences are being retrieved. | Returns if user preferences are being retrieved. | [
"Returns",
"if",
"user",
"preferences",
"are",
"being",
"retrieved",
"."
] | def returns_preferences(self):
"""Returns if user preferences are being retrieved."""
return bool(clib.get_val(self._abi('ReturnsPreferences'),
c_int, self._obj)) | [
"def",
"returns_preferences",
"(",
"self",
")",
":",
"return",
"bool",
"(",
"clib",
".",
"get_val",
"(",
"self",
".",
"_abi",
"(",
"'ReturnsPreferences'",
")",
",",
"c_int",
",",
"self",
".",
"_obj",
")",
")"
] | https://github.com/jeog/TDAmeritradeAPI/blob/91c738afd7d57b54f6231170bd64c2550fafd34d/python/tdma_api/get.py#L1272-L1275 | |
metashell/metashell | f4177e4854ea00c8dbc722cadab26ef413d798ea | 3rd/templight/compiler-rt/lib/sanitizer_common/scripts/cpplint.py | python | CheckSectionSpacing | (filename, clean_lines, class_info, linenum, error) | Checks for additional blank line issues related to sections.
Currently the only thing checked here is blank line before protected/private.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
class_info: A _ClassInfo objects.
linenum: The number ... | Checks for additional blank line issues related to sections. | [
"Checks",
"for",
"additional",
"blank",
"line",
"issues",
"related",
"to",
"sections",
"."
] | def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error):
"""Checks for additional blank line issues related to sections.
Currently the only thing checked here is blank line before protected/private.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance co... | [
"def",
"CheckSectionSpacing",
"(",
"filename",
",",
"clean_lines",
",",
"class_info",
",",
"linenum",
",",
"error",
")",
":",
"# Skip checks if the class is small, where small means 25 lines or less.",
"# 25 lines seems like a good cutoff since that's the usual height of",
"# termina... | https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L3658-L3710 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/llvm/bindings/python/llvm/bit_reader.py | python | parse_bitcode | (mem_buffer) | return m | Input is .core.MemoryBuffer | Input is .core.MemoryBuffer | [
"Input",
"is",
".",
"core",
".",
"MemoryBuffer"
] | def parse_bitcode(mem_buffer):
"""Input is .core.MemoryBuffer"""
module = c_object_p()
result = lib.LLVMParseBitcode2(mem_buffer, byref(module))
if result:
raise RuntimeError('LLVM Error')
m = Module(module)
m.take_ownership(mem_buffer)
return m | [
"def",
"parse_bitcode",
"(",
"mem_buffer",
")",
":",
"module",
"=",
"c_object_p",
"(",
")",
"result",
"=",
"lib",
".",
"LLVMParseBitcode2",
"(",
"mem_buffer",
",",
"byref",
"(",
"module",
")",
")",
"if",
"result",
":",
"raise",
"RuntimeError",
"(",
"'LLVM ... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/llvm/bindings/python/llvm/bit_reader.py#L16-L24 | |
timi-liuliang/echo | 40a5a24d430eee4118314459ab7e03afcb3b8719 | thirdparty/protobuf/python/mox.py | python | UnknownMethodCallError.__init__ | (self, unknown_method_name) | Init exception.
Args:
# unknown_method_name: Method call that is not part of the mocked class's
# public interface.
unknown_method_name: str | Init exception. | [
"Init",
"exception",
"."
] | def __init__(self, unknown_method_name):
"""Init exception.
Args:
# unknown_method_name: Method call that is not part of the mocked class's
# public interface.
unknown_method_name: str
"""
Error.__init__(self)
self._unknown_method_name = unknown_method_name | [
"def",
"__init__",
"(",
"self",
",",
"unknown_method_name",
")",
":",
"Error",
".",
"__init__",
"(",
"self",
")",
"self",
".",
"_unknown_method_name",
"=",
"unknown_method_name"
] | https://github.com/timi-liuliang/echo/blob/40a5a24d430eee4118314459ab7e03afcb3b8719/thirdparty/protobuf/python/mox.py#L133-L143 | ||
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/algorithms/cfr.py | python | _update_current_policy | (current_policy, info_state_nodes) | Updates in place `current_policy` from the cumulative regrets.
This function is a module level function to be reused by both CFRSolver and
CFRBRSolver.
Args:
current_policy: A `policy.TabularPolicy` to be updated in-place.
info_state_nodes: A dictionary {`info_state_str` -> `_InfoStateNode`}. | Updates in place `current_policy` from the cumulative regrets. | [
"Updates",
"in",
"place",
"current_policy",
"from",
"the",
"cumulative",
"regrets",
"."
] | def _update_current_policy(current_policy, info_state_nodes):
"""Updates in place `current_policy` from the cumulative regrets.
This function is a module level function to be reused by both CFRSolver and
CFRBRSolver.
Args:
current_policy: A `policy.TabularPolicy` to be updated in-place.
info_state_nod... | [
"def",
"_update_current_policy",
"(",
"current_policy",
",",
"info_state_nodes",
")",
":",
"for",
"info_state",
",",
"info_state_node",
"in",
"info_state_nodes",
".",
"items",
"(",
")",
":",
"state_policy",
"=",
"current_policy",
".",
"policy_for_key",
"(",
"info_st... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/cfr.py#L74-L90 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextCtrl.HitTestXY | (*args, **kwargs) | return _richtext.RichTextCtrl_HitTestXY(*args, **kwargs) | HitTestRC(self, Point pt) --> (result, col, row)
Returns the column and row of the given point in pixels. Note that
``pt`` should be given in device coordinates, and not be adjusted for
the client area origin nor for scrolling. The return value is a tuple
of the hit test result and th... | HitTestRC(self, Point pt) --> (result, col, row) | [
"HitTestRC",
"(",
"self",
"Point",
"pt",
")",
"--",
">",
"(",
"result",
"col",
"row",
")"
] | def HitTestXY(*args, **kwargs):
"""
HitTestRC(self, Point pt) --> (result, col, row)
Returns the column and row of the given point in pixels. Note that
``pt`` should be given in device coordinates, and not be adjusted for
the client area origin nor for scrolling. The return va... | [
"def",
"HitTestXY",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_HitTestXY",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L3210-L3219 | |
rootm0s/Protectors | 5b3f4d11687a5955caf9c3af30666c4bfc2c19ab | OWASP-ZSC/module/readline_windows/pyreadline/lineeditor/history.py | python | LineHistory.beginning_of_history | (self) | Move to the first line in the history. | Move to the first line in the history. | [
"Move",
"to",
"the",
"first",
"line",
"in",
"the",
"history",
"."
] | def beginning_of_history(self): # (M-<)
'''Move to the first line in the history.'''
self.history_cursor = 0
if len(self.history) > 0:
self.l_buffer = self.history[0] | [
"def",
"beginning_of_history",
"(",
"self",
")",
":",
"# (M-<)",
"self",
".",
"history_cursor",
"=",
"0",
"if",
"len",
"(",
"self",
".",
"history",
")",
">",
"0",
":",
"self",
".",
"l_buffer",
"=",
"self",
".",
"history",
"[",
"0",
"]"
] | https://github.com/rootm0s/Protectors/blob/5b3f4d11687a5955caf9c3af30666c4bfc2c19ab/OWASP-ZSC/module/readline_windows/pyreadline/lineeditor/history.py#L135-L139 | ||
eric612/MobileNet-YOLO | 69b4441cb3ec8d553fbdef788ad033e246f901bd | python/caffe/pycaffe.py | python | _Net_layer_dict | (self) | return self._layer_dict | An OrderedDict (bottom to top, i.e., input to output) of network
layers indexed by name | An OrderedDict (bottom to top, i.e., input to output) of network
layers indexed by name | [
"An",
"OrderedDict",
"(",
"bottom",
"to",
"top",
"i",
".",
"e",
".",
"input",
"to",
"output",
")",
"of",
"network",
"layers",
"indexed",
"by",
"name"
] | def _Net_layer_dict(self):
"""
An OrderedDict (bottom to top, i.e., input to output) of network
layers indexed by name
"""
if not hasattr(self, '_layer_dict'):
self._layer_dict = OrderedDict(zip(self._layer_names, self.layers))
return self._layer_dict | [
"def",
"_Net_layer_dict",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_layer_dict'",
")",
":",
"self",
".",
"_layer_dict",
"=",
"OrderedDict",
"(",
"zip",
"(",
"self",
".",
"_layer_names",
",",
"self",
".",
"layers",
")",
")",
"r... | https://github.com/eric612/MobileNet-YOLO/blob/69b4441cb3ec8d553fbdef788ad033e246f901bd/python/caffe/pycaffe.py#L47-L54 | |
apache/parquet-cpp | 642da055adf009652689b20e68a198cffb857651 | build-support/cpplint.py | python | FileInfo.Split | (self) | return (project,) + os.path.splitext(rest) | Splits the file into the directory, basename, and extension.
For 'chrome/browser/browser.cc', Split() would
return ('chrome/browser', 'browser', '.cc')
Returns:
A tuple of (directory, basename, extension). | Splits the file into the directory, basename, and extension. | [
"Splits",
"the",
"file",
"into",
"the",
"directory",
"basename",
"and",
"extension",
"."
] | def Split(self):
"""Splits the file into the directory, basename, and extension.
For 'chrome/browser/browser.cc', Split() would
return ('chrome/browser', 'browser', '.cc')
Returns:
A tuple of (directory, basename, extension).
"""
googlename = self.RepositoryName()
project, rest = os... | [
"def",
"Split",
"(",
"self",
")",
":",
"googlename",
"=",
"self",
".",
"RepositoryName",
"(",
")",
"project",
",",
"rest",
"=",
"os",
".",
"path",
".",
"split",
"(",
"googlename",
")",
"return",
"(",
"project",
",",
")",
"+",
"os",
".",
"path",
"."... | https://github.com/apache/parquet-cpp/blob/642da055adf009652689b20e68a198cffb857651/build-support/cpplint.py#L1033-L1045 | |
livecode/livecode | 4606a10ea10b16d5071d0f9f263ccdd7ede8b31d | gyp/pylib/gyp/MSVSVersion.py | python | _ConvertToCygpath | (path) | return path | Convert to cygwin path if we are using cygwin. | Convert to cygwin path if we are using cygwin. | [
"Convert",
"to",
"cygwin",
"path",
"if",
"we",
"are",
"using",
"cygwin",
"."
] | def _ConvertToCygpath(path):
"""Convert to cygwin path if we are using cygwin."""
if sys.platform == 'cygwin':
p = subprocess.Popen(['cygpath', path], stdout=subprocess.PIPE)
path = p.communicate()[0].strip()
return path | [
"def",
"_ConvertToCygpath",
"(",
"path",
")",
":",
"if",
"sys",
".",
"platform",
"==",
"'cygwin'",
":",
"p",
"=",
"subprocess",
".",
"Popen",
"(",
"[",
"'cygpath'",
",",
"path",
"]",
",",
"stdout",
"=",
"subprocess",
".",
"PIPE",
")",
"path",
"=",
"p... | https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/MSVSVersion.py#L325-L330 | |
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | .github/github_org_control/ldap_api.py | python | LdapApi.get_absent_emails | (self, emails) | return absent_emails | Checks users by email in LDAP and returns absent emails | Checks users by email in LDAP and returns absent emails | [
"Checks",
"users",
"by",
"email",
"in",
"LDAP",
"and",
"returns",
"absent",
"emails"
] | def get_absent_emails(self, emails):
"""Checks users by email in LDAP and returns absent emails"""
absent_emails = set()
for email in emails:
if not self.get_user_info_by_email(email):
absent_emails.add(email)
return absent_emails | [
"def",
"get_absent_emails",
"(",
"self",
",",
"emails",
")",
":",
"absent_emails",
"=",
"set",
"(",
")",
"for",
"email",
"in",
"emails",
":",
"if",
"not",
"self",
".",
"get_user_info_by_email",
"(",
"email",
")",
":",
"absent_emails",
".",
"add",
"(",
"e... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/.github/github_org_control/ldap_api.py#L220-L226 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | PNEANet.AttrValueEI | (self, *args) | return _snap.PNEANet_AttrValueEI(self, *args) | AttrValueEI(PNEANet self, TInt EId, TStrV Values)
Parameters:
EId: TInt const &
Values: TStrV &
AttrValueEI(PNEANet self, TInt EId, TStrIntPrH::TIter EdgeHI, TStrV Values)
Parameters:
EId: TInt const &
EdgeHI: TStrIntPrH::TIter
Value... | AttrValueEI(PNEANet self, TInt EId, TStrV Values) | [
"AttrValueEI",
"(",
"PNEANet",
"self",
"TInt",
"EId",
"TStrV",
"Values",
")"
] | def AttrValueEI(self, *args):
"""
AttrValueEI(PNEANet self, TInt EId, TStrV Values)
Parameters:
EId: TInt const &
Values: TStrV &
AttrValueEI(PNEANet self, TInt EId, TStrIntPrH::TIter EdgeHI, TStrV Values)
Parameters:
EId: TInt const &
... | [
"def",
"AttrValueEI",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"PNEANet_AttrValueEI",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L23488-L23504 | |
fifengine/fifengine | 4b62c42e85bec19893cef8e63e6855927cff2c47 | engine/python/fife/extensions/pychan/events.py | python | EventListenerBase.detach | (self) | Stop receiving events.
No need to call this manually. | Stop receiving events.
No need to call this manually. | [
"Stop",
"receiving",
"events",
".",
"No",
"need",
"to",
"call",
"this",
"manually",
"."
] | def detach(self):
"""
Stop receiving events.
No need to call this manually.
"""
if not self.is_attached:
return
if self.debug: print("Detach:",self)
self.is_attached = False | [
"def",
"detach",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"is_attached",
":",
"return",
"if",
"self",
".",
"debug",
":",
"print",
"(",
"\"Detach:\"",
",",
"self",
")",
"self",
".",
"is_attached",
"=",
"False"
] | https://github.com/fifengine/fifengine/blob/4b62c42e85bec19893cef8e63e6855927cff2c47/engine/python/fife/extensions/pychan/events.py#L163-L171 | ||
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | examples/python/hamiltonian/hamiltonian.py | python | gencon | (gr) | return s | Input a graph as an adjacency list, e.g. {0:[1,2], 1:[2], 2:[1,0]}.
Produces solver to check if the given graph has
a Hamiltonian cycle. Query the solver using s.check() and if sat,
then s.model() spells out the cycle. Two example graphs from
http://en.wikipedia.org/wiki/Hamiltonian_path are tested.
... | Input a graph as an adjacency list, e.g. {0:[1,2], 1:[2], 2:[1,0]}.
Produces solver to check if the given graph has
a Hamiltonian cycle. Query the solver using s.check() and if sat,
then s.model() spells out the cycle. Two example graphs from
http://en.wikipedia.org/wiki/Hamiltonian_path are tested. | [
"Input",
"a",
"graph",
"as",
"an",
"adjacency",
"list",
"e",
".",
"g",
".",
"{",
"0",
":",
"[",
"1",
"2",
"]",
"1",
":",
"[",
"2",
"]",
"2",
":",
"[",
"1",
"0",
"]",
"}",
".",
"Produces",
"solver",
"to",
"check",
"if",
"the",
"given",
"grap... | def gencon(gr):
"""
Input a graph as an adjacency list, e.g. {0:[1,2], 1:[2], 2:[1,0]}.
Produces solver to check if the given graph has
a Hamiltonian cycle. Query the solver using s.check() and if sat,
then s.model() spells out the cycle. Two example graphs from
http://en.wikipedia.org/wiki/Hami... | [
"def",
"gencon",
"(",
"gr",
")",
":",
"L",
"=",
"len",
"(",
"gr",
")",
"cv",
"=",
"[",
"Int",
"(",
"'cv%s'",
"%",
"i",
")",
"for",
"i",
"in",
"range",
"(",
"L",
")",
"]",
"s",
"=",
"Solver",
"(",
")",
"s",
".",
"add",
"(",
"cv",
"[",
"0... | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/examples/python/hamiltonian/hamiltonian.py#L10-L34 | |
vgough/encfs | c444f9b9176beea1ad41a7b2e29ca26e709b57f7 | vendor/github.com/muflihun/easyloggingpp/tools/cpplint.py | python | CheckForNonConstReference | (filename, clean_lines, linenum,
nesting_state, error) | Check for non-const references.
Separate from CheckLanguage since it scans backwards from current
line, instead of scanning forward.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
nesting_state: A... | Check for non-const references. | [
"Check",
"for",
"non",
"-",
"const",
"references",
"."
] | def CheckForNonConstReference(filename, clean_lines, linenum,
nesting_state, error):
"""Check for non-const references.
Separate from CheckLanguage since it scans backwards from current
line, instead of scanning forward.
Args:
filename: The name of the current file.
clean... | [
"def",
"CheckForNonConstReference",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"# Do nothing if there is no '&' on current line.",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"if",
"'&'",
"n... | https://github.com/vgough/encfs/blob/c444f9b9176beea1ad41a7b2e29ca26e709b57f7/vendor/github.com/muflihun/easyloggingpp/tools/cpplint.py#L4011-L4121 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/index/collector.py | python | _clean_file_url_path | (part) | return urllib.request.pathname2url(urllib.request.url2pathname(part)) | Clean the first part of a URL path that corresponds to a local
filesystem path (i.e. the first part after splitting on "@" characters). | Clean the first part of a URL path that corresponds to a local
filesystem path (i.e. the first part after splitting on " | [
"Clean",
"the",
"first",
"part",
"of",
"a",
"URL",
"path",
"that",
"corresponds",
"to",
"a",
"local",
"filesystem",
"path",
"(",
"i",
".",
"e",
".",
"the",
"first",
"part",
"after",
"splitting",
"on"
] | def _clean_file_url_path(part):
# type: (str) -> str
"""
Clean the first part of a URL path that corresponds to a local
filesystem path (i.e. the first part after splitting on "@" characters).
"""
# We unquote prior to quoting to make sure nothing is double quoted.
# Also, on Windows the pat... | [
"def",
"_clean_file_url_path",
"(",
"part",
")",
":",
"# type: (str) -> str",
"# We unquote prior to quoting to make sure nothing is double quoted.",
"# Also, on Windows the path part might contain a drive letter which",
"# should not be quoted. On Linux where drive letters do not",
"# exist, th... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/index/collector.py#L198-L209 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/dashboard/dashboard/find_change_points_exp.py | python | RunFindChangePoints | (
test, series, find_change_points_func=find_change_points.FindChangePoints,
**kwargs) | return _RemoveKnownAnomalies(test, change_points) | Runs an change-point-finding function on part of a data series.
This function will be repeatedly called by SimulateAlertProcessingPipeline
in the bench_find_change_points module with the same TestMetadata entity but
with more and more points added to the end.
This is meant to imitate the current behavior of F... | Runs an change-point-finding function on part of a data series. | [
"Runs",
"an",
"change",
"-",
"point",
"-",
"finding",
"function",
"on",
"part",
"of",
"a",
"data",
"series",
"."
] | def RunFindChangePoints(
test, series, find_change_points_func=find_change_points.FindChangePoints,
**kwargs):
"""Runs an change-point-finding function on part of a data series.
This function will be repeatedly called by SimulateAlertProcessingPipeline
in the bench_find_change_points module with the same... | [
"def",
"RunFindChangePoints",
"(",
"test",
",",
"series",
",",
"find_change_points_func",
"=",
"find_change_points",
".",
"FindChangePoints",
",",
"*",
"*",
"kwargs",
")",
":",
"# The anomaly threshold config dictionary determines how many points are",
"# analyzed and how far a... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/find_change_points_exp.py#L11-L49 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | tools/gyp-explain.py | python | MatchNode | (graph, substring) | return candidates[0] | Given a dictionary, returns the key that matches |substring| best. Exits
if there's not one single best match. | Given a dictionary, returns the key that matches |substring| best. Exits
if there's not one single best match. | [
"Given",
"a",
"dictionary",
"returns",
"the",
"key",
"that",
"matches",
"|substring|",
"best",
".",
"Exits",
"if",
"there",
"s",
"not",
"one",
"single",
"best",
"match",
"."
] | def MatchNode(graph, substring):
"""Given a dictionary, returns the key that matches |substring| best. Exits
if there's not one single best match."""
candidates = []
for target in graph:
if substring in target:
candidates.append(target)
if not candidates:
print 'No targets match "%s"' % substri... | [
"def",
"MatchNode",
"(",
"graph",
",",
"substring",
")",
":",
"candidates",
"=",
"[",
"]",
"for",
"target",
"in",
"graph",
":",
"if",
"substring",
"in",
"target",
":",
"candidates",
".",
"append",
"(",
"target",
")",
"if",
"not",
"candidates",
":",
"pr... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/gyp-explain.py#L36-L51 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/distributions/python/ops/operator_pd_identity.py | python | OperatorPDIdentity.dtype | (self) | return self._dtype | Data type of matrix elements of `A`. | Data type of matrix elements of `A`. | [
"Data",
"type",
"of",
"matrix",
"elements",
"of",
"A",
"."
] | def dtype(self):
"""Data type of matrix elements of `A`."""
return self._dtype | [
"def",
"dtype",
"(",
"self",
")",
":",
"return",
"self",
".",
"_dtype"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/operator_pd_identity.py#L134-L136 | |
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/pymcuprog/utils.py | python | set_supply_voltage_setpoint | (housekeeper, voltage) | Set supply setpoint
:param housekeeper: Instance of pyedbglib.protocols.housekeepingprotocol.Jtagice3HousekeepingProtocol
:param voltage: New setpoint for target supply | Set supply setpoint | [
"Set",
"supply",
"setpoint"
] | def set_supply_voltage_setpoint(housekeeper, voltage):
"""
Set supply setpoint
:param housekeeper: Instance of pyedbglib.protocols.housekeepingprotocol.Jtagice3HousekeepingProtocol
:param voltage: New setpoint for target supply
"""
try:
housekeeper.get_le16(Jtagice3HousekeepingProtocol.... | [
"def",
"set_supply_voltage_setpoint",
"(",
"housekeeper",
",",
"voltage",
")",
":",
"try",
":",
"housekeeper",
".",
"get_le16",
"(",
"Jtagice3HousekeepingProtocol",
".",
"HOUSEKEEPING_CONTEXT_ANALOG",
",",
"Jtagice3HousekeepingProtocol",
".",
"HOUSEKEEPING_TSUP_VOLTAGE",
")... | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/pymcuprog/utils.py#L116-L141 | ||
openmm/openmm | cb293447c4fc8b03976dfe11399f107bab70f3d9 | wrappers/python/openmm/app/charmmpsffile.py | python | CharmmPsfFile.boxVectors | (self) | return self.box_vectors | Return the box vectors | Return the box vectors | [
"Return",
"the",
"box",
"vectors"
] | def boxVectors(self):
""" Return the box vectors """
return self.box_vectors | [
"def",
"boxVectors",
"(",
"self",
")",
":",
"return",
"self",
".",
"box_vectors"
] | https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/charmmpsffile.py#L1658-L1660 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/inspector_protocol/jinja2/_compat.py | python | with_metaclass | (meta, *bases) | return type.__new__(metaclass, 'temporary_class', (), {}) | Create a base class with a metaclass. | Create a base class with a metaclass. | [
"Create",
"a",
"base",
"class",
"with",
"a",
"metaclass",
"."
] | def with_metaclass(meta, *bases):
"""Create a base class with a metaclass."""
# This requires a bit of explanation: the basic idea is to make a
# dummy metaclass for one level of class instantiation that replaces
# itself with the actual metaclass.
class metaclass(type):
def __new__(cls, nam... | [
"def",
"with_metaclass",
"(",
"meta",
",",
"*",
"bases",
")",
":",
"# This requires a bit of explanation: the basic idea is to make a",
"# dummy metaclass for one level of class instantiation that replaces",
"# itself with the actual metaclass.",
"class",
"metaclass",
"(",
"type",
")... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/inspector_protocol/jinja2/_compat.py#L85-L93 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py | python | XcodeArchsDefault._ExpandArchs | (self, archs, sdkroot) | return expanded_archs | Expands variables references in ARCHS, and remove duplicates. | Expands variables references in ARCHS, and remove duplicates. | [
"Expands",
"variables",
"references",
"in",
"ARCHS",
"and",
"remove",
"duplicates",
"."
] | def _ExpandArchs(self, archs, sdkroot):
"""Expands variables references in ARCHS, and remove duplicates."""
variable_mapping = self._VariableMapping(sdkroot)
expanded_archs = []
for arch in archs:
if self.variable_pattern.match(arch):
variable = arch
... | [
"def",
"_ExpandArchs",
"(",
"self",
",",
"archs",
",",
"sdkroot",
")",
":",
"variable_mapping",
"=",
"self",
".",
"_VariableMapping",
"(",
"sdkroot",
")",
"expanded_archs",
"=",
"[",
"]",
"for",
"arch",
"in",
"archs",
":",
"if",
"self",
".",
"variable_patt... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py#L64-L80 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/compiler/mlir/tfr/python/tfr_gen.py | python | TFRGen._create_mlir_loc | (self, loc) | Creates mlir location from autograph ORIGIN value.
Args:
loc: OriginInfo
Returns:
A serialized mlir location string. | Creates mlir location from autograph ORIGIN value. | [
"Creates",
"mlir",
"location",
"from",
"autograph",
"ORIGIN",
"value",
"."
] | def _create_mlir_loc(self, loc):
"""Creates mlir location from autograph ORIGIN value.
Args:
loc: OriginInfo
Returns:
A serialized mlir location string.
"""
if loc is not None and loc.loc.filename:
file_name = os.path.basename(loc.loc.filename)
return 'loc("{}":{}:{})'.form... | [
"def",
"_create_mlir_loc",
"(",
"self",
",",
"loc",
")",
":",
"if",
"loc",
"is",
"not",
"None",
"and",
"loc",
".",
"loc",
".",
"filename",
":",
"file_name",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"loc",
".",
"loc",
".",
"filename",
")",
"ret... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/compiler/mlir/tfr/python/tfr_gen.py#L648-L662 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cgutils.py | python | _StructProxy.__getattr__ | (self, field) | Load the LLVM value of the named *field*. | Load the LLVM value of the named *field*. | [
"Load",
"the",
"LLVM",
"value",
"of",
"the",
"named",
"*",
"field",
"*",
"."
] | def __getattr__(self, field):
"""
Load the LLVM value of the named *field*.
"""
if not field.startswith('_'):
return self[self._datamodel.get_field_position(field)]
else:
raise AttributeError(field) | [
"def",
"__getattr__",
"(",
"self",
",",
"field",
")",
":",
"if",
"not",
"field",
".",
"startswith",
"(",
"'_'",
")",
":",
"return",
"self",
"[",
"self",
".",
"_datamodel",
".",
"get_field_position",
"(",
"field",
")",
"]",
"else",
":",
"raise",
"Attrib... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cgutils.py#L150-L157 | ||
fnplus/interview-techdev-guide | eaca1b6db4b27e9813aaec25a199b1baa4f9439b | Data Structures/Heap/Python/Heap.py | python | max_heapify | (arr,n,i) | This function will perform max heapify on elements level-wise
or wil choose largest among it's left,right child and itself.
Parameters:
arr: List of integers.
n: Length of list arr.
i: index of element
Returns:
None | This function will perform max heapify on elements level-wise
or wil choose largest among it's left,right child and itself.
Parameters:
arr: List of integers.
n: Length of list arr.
i: index of element
Returns:
None | [
"This",
"function",
"will",
"perform",
"max",
"heapify",
"on",
"elements",
"level",
"-",
"wise",
"or",
"wil",
"choose",
"largest",
"among",
"it",
"s",
"left",
"right",
"child",
"and",
"itself",
".",
"Parameters",
":",
"arr",
":",
"List",
"of",
"integers",
... | def max_heapify(arr,n,i):
"""This function will perform max heapify on elements level-wise
or wil choose largest among it's left,right child and itself.
Parameters:
arr: List of integers.
n: Length of list arr.
i: index of element
Returns:
None... | [
"def",
"max_heapify",
"(",
"arr",
",",
"n",
",",
"i",
")",
":",
"largest",
"=",
"i",
"left",
"=",
"2",
"*",
"i",
"+",
"1",
"right",
"=",
"2",
"*",
"i",
"+",
"2",
"if",
"(",
"left",
"<",
"n",
"and",
"arr",
"[",
"left",
"]",
">",
"arr",
"["... | https://github.com/fnplus/interview-techdev-guide/blob/eaca1b6db4b27e9813aaec25a199b1baa4f9439b/Data Structures/Heap/Python/Heap.py#L26-L46 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/code_coverage/croc.py | python | CoverageStats.AddDefaults | (self) | Add some default stats which might be assumed present.
Do not clobber if already present. Adds resilience when evaling a
croc file which expects certain stats to exist. | Add some default stats which might be assumed present. | [
"Add",
"some",
"default",
"stats",
"which",
"might",
"be",
"assumed",
"present",
"."
] | def AddDefaults(self):
"""Add some default stats which might be assumed present.
Do not clobber if already present. Adds resilience when evaling a
croc file which expects certain stats to exist."""
for k, v in self.DEFAULTS.iteritems():
if not k in self:
self[k] = v | [
"def",
"AddDefaults",
"(",
"self",
")",
":",
"for",
"k",
",",
"v",
"in",
"self",
".",
"DEFAULTS",
".",
"iteritems",
"(",
")",
":",
"if",
"not",
"k",
"in",
"self",
":",
"self",
"[",
"k",
"]",
"=",
"v"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/code_coverage/croc.py#L50-L57 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.