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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/tkFileDialog.py | python | askdirectory | (**options) | return Directory(**options).show() | Ask for a directory, and return the file name | Ask for a directory, and return the file name | [
"Ask",
"for",
"a",
"directory",
"and",
"return",
"the",
"file",
"name"
] | def askdirectory (**options):
"Ask for a directory, and return the file name"
return Directory(**options).show() | [
"def",
"askdirectory",
"(",
"*",
"*",
"options",
")",
":",
"return",
"Directory",
"(",
"*",
"*",
"options",
")",
".",
"show",
"(",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/tkFileDialog.py#L176-L178 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/agilepy/lib_wx/processdialog.py | python | ProcessDialogInteractive.on_cancel | (self, event) | Apply values, destroy itself and parent | Apply values, destroy itself and parent | [
"Apply",
"values",
"destroy",
"itself",
"and",
"parent"
] | def on_cancel(self, event):
"""
Apply values, destroy itself and parent
"""
# print 'on_cancel'
self.on_close(event) | [
"def",
"on_cancel",
"(",
"self",
",",
"event",
")",
":",
"# print 'on_cancel'",
"self",
".",
"on_close",
"(",
"event",
")"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/agilepy/lib_wx/processdialog.py#L432-L437 | ||
clementine-player/Clementine | 111379dfd027802b59125829fcf87e3e1d0ad73b | dist/cpplint.py | python | CheckMakePairUsesDeduction | (filename, clean_lines, linenum, error) | Check that make_pair's template arguments are deduced.
G++ 4.6 in C++11 mode fails badly if make_pair's template arguments are
specified explicitly, and such use isn't intended in any case.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linen... | Check that make_pair's template arguments are deduced. | [
"Check",
"that",
"make_pair",
"s",
"template",
"arguments",
"are",
"deduced",
"."
] | def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error):
"""Check that make_pair's template arguments are deduced.
G++ 4.6 in C++11 mode fails badly if make_pair's template arguments are
specified explicitly, and such use isn't intended in any case.
Args:
filename: The name of the current fi... | [
"def",
"CheckMakePairUsesDeduction",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"match",
"=",
"_RE_PATTERN_EXPLICIT_MAKEPAIR",
".",
"search",
"(",
"line",
")",
"i... | https://github.com/clementine-player/Clementine/blob/111379dfd027802b59125829fcf87e3e1d0ad73b/dist/cpplint.py#L5549-L5567 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/optimize/optimize.py | python | check_grad | (func, grad, x0, *args, **kwargs) | return sqrt(sum((grad(x0, *args) -
approx_fprime(x0, func, step, *args))**2)) | Check the correctness of a gradient function by comparing it against a
(forward) finite-difference approximation of the gradient.
Parameters
----------
func : callable ``func(x0, *args)``
Function whose derivative is to be checked.
grad : callable ``grad(x0, *args)``
Gradient of `fu... | Check the correctness of a gradient function by comparing it against a
(forward) finite-difference approximation of the gradient. | [
"Check",
"the",
"correctness",
"of",
"a",
"gradient",
"function",
"by",
"comparing",
"it",
"against",
"a",
"(",
"forward",
")",
"finite",
"-",
"difference",
"approximation",
"of",
"the",
"gradient",
"."
] | def check_grad(func, grad, x0, *args, **kwargs):
"""Check the correctness of a gradient function by comparing it against a
(forward) finite-difference approximation of the gradient.
Parameters
----------
func : callable ``func(x0, *args)``
Function whose derivative is to be checked.
gra... | [
"def",
"check_grad",
"(",
"func",
",",
"grad",
",",
"x0",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"step",
"=",
"kwargs",
".",
"pop",
"(",
"'epsilon'",
",",
"_epsilon",
")",
"if",
"kwargs",
":",
"raise",
"ValueError",
"(",
"\"Unknown keyw... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/optimize/optimize.py#L691-L737 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/data_structures/sframe.py | python | SFrame.__setitem__ | (self, key, value) | A wrapper around add_column(s). Key can be either a list or a str. If
value is an SArray, it is added to the SFrame as a column. If it is a
constant value (int, str, or float), then a column is created where
every entry is equal to the constant value. Existing columns can also
be rep... | A wrapper around add_column(s). Key can be either a list or a str. If
value is an SArray, it is added to the SFrame as a column. If it is a
constant value (int, str, or float), then a column is created where
every entry is equal to the constant value. Existing columns can also
be rep... | [
"A",
"wrapper",
"around",
"add_column",
"(",
"s",
")",
".",
"Key",
"can",
"be",
"either",
"a",
"list",
"or",
"a",
"str",
".",
"If",
"value",
"is",
"an",
"SArray",
"it",
"is",
"added",
"to",
"the",
"SFrame",
"as",
"a",
"column",
".",
"If",
"it",
"... | def __setitem__(self, key, value):
"""
A wrapper around add_column(s). Key can be either a list or a str. If
value is an SArray, it is added to the SFrame as a column. If it is a
constant value (int, str, or float), then a column is created where
every entry is equal to the co... | [
"def",
"__setitem__",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"if",
"type",
"(",
"key",
")",
"is",
"list",
":",
"self",
".",
"add_columns",
"(",
"value",
",",
"key",
",",
"inplace",
"=",
"True",
")",
"elif",
"type",
"(",
"key",
")",
"is"... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/data_structures/sframe.py#L3889-L3940 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/VBox/ValidationKit/common/utils.py | python | unpackFile | (sArchive, sDstDir, fnLog, fnError = None, fnFilter = None) | return [] | Unpacks the given file if it has a know archive extension, otherwise do
nothing.
fnLog & fnError both take a string parameter.
fnFilter takes a member name (string) and returns True if it's included
and False if excluded.
Returns list of the extracted files (full path) on success.
Returns emp... | Unpacks the given file if it has a know archive extension, otherwise do
nothing. | [
"Unpacks",
"the",
"given",
"file",
"if",
"it",
"has",
"a",
"know",
"archive",
"extension",
"otherwise",
"do",
"nothing",
"."
] | def unpackFile(sArchive, sDstDir, fnLog, fnError = None, fnFilter = None):
# type: (string, string, (string) -> None, (string) -> None, (string) -> bool) -> list[string]
"""
Unpacks the given file if it has a know archive extension, otherwise do
nothing.
fnLog & fnError both take a string parameter... | [
"def",
"unpackFile",
"(",
"sArchive",
",",
"sDstDir",
",",
"fnLog",
",",
"fnError",
"=",
"None",
",",
"fnFilter",
"=",
"None",
")",
":",
"# type: (string, string, (string) -> None, (string) -> None, (string) -> bool) -> list[string]",
"sBaseNameLower",
"=",
"os",
".",
"... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/ValidationKit/common/utils.py#L1928-L1964 | |
metashell/metashell | f4177e4854ea00c8dbc722cadab26ef413d798ea | 3rd/templight/compiler-rt/lib/sanitizer_common/scripts/cpplint.py | python | NestingState.InnermostClass | (self) | return None | Get class info on the top of the stack.
Returns:
A _ClassInfo object if we are inside a class, or None otherwise. | Get class info on the top of the stack. | [
"Get",
"class",
"info",
"on",
"the",
"top",
"of",
"the",
"stack",
"."
] | def InnermostClass(self):
"""Get class info on the top of the stack.
Returns:
A _ClassInfo object if we are inside a class, or None otherwise.
"""
for i in range(len(self.stack), 0, -1):
classinfo = self.stack[i - 1]
if isinstance(classinfo, _ClassInfo):
return classinfo
r... | [
"def",
"InnermostClass",
"(",
"self",
")",
":",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"stack",
")",
",",
"0",
",",
"-",
"1",
")",
":",
"classinfo",
"=",
"self",
".",
"stack",
"[",
"i",
"-",
"1",
"]",
"if",
"isinstance",
"(",
... | https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L2746-L2756 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/traitlets/py2/traitlets/traitlets.py | python | TraitType.__init__ | (self, default_value=Undefined, allow_none=False, read_only=None, help=None,
config=None, **kwargs) | Declare a traitlet.
If *allow_none* is True, None is a valid value in addition to any
values that are normally valid. The default is up to the subclass.
For most trait types, the default value for ``allow_none`` is False.
Extra metadata can be associated with the traitlet using the .ta... | Declare a traitlet. | [
"Declare",
"a",
"traitlet",
"."
] | def __init__(self, default_value=Undefined, allow_none=False, read_only=None, help=None,
config=None, **kwargs):
"""Declare a traitlet.
If *allow_none* is True, None is a valid value in addition to any
values that are normally valid. The default is up to the subclass.
For most t... | [
"def",
"__init__",
"(",
"self",
",",
"default_value",
"=",
"Undefined",
",",
"allow_none",
"=",
"False",
",",
"read_only",
"=",
"None",
",",
"help",
"=",
"None",
",",
"config",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"default_value",
"is"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/traitlets/py2/traitlets/traitlets.py#L419-L466 | ||
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/update_fusion_version.py | python | FindUpdateCurrentVersion | (fusion_version_file, long_version, short_version,
year) | return (old_long, old_short) | Find and update long and short version names in the fusion_version_file.
Args:
fusion_version_file: Absolute filename for fusion_version.txt
long_version: The new long_version to update to.
short_version: The new short_version to update to.
year: The current year to be used in copyright statement.
... | Find and update long and short version names in the fusion_version_file. | [
"Find",
"and",
"update",
"long",
"and",
"short",
"version",
"names",
"in",
"the",
"fusion_version_file",
"."
] | def FindUpdateCurrentVersion(fusion_version_file, long_version, short_version,
year):
"""Find and update long and short version names in the fusion_version_file.
Args:
fusion_version_file: Absolute filename for fusion_version.txt
long_version: The new long_version to update to.... | [
"def",
"FindUpdateCurrentVersion",
"(",
"fusion_version_file",
",",
"long_version",
",",
"short_version",
",",
"year",
")",
":",
"cmd",
"=",
"'cd %s; g4 open %s'",
"%",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"fusion_version_file",
")",
",",
"os",
".",
"p... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/update_fusion_version.py#L53-L94 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/rds/__init__.py | python | RDSConnection.create_parameter_group | (self, name, engine='MySQL5.1', description='') | return self.get_object('CreateDBParameterGroup', params, ParameterGroup) | Create a new dbparameter group for your account.
:type name: string
:param name: The name of the new dbparameter group
:type engine: str
:param engine: Name of database engine.
:type description: string
:param description: The description of the new dbparameter group
... | Create a new dbparameter group for your account. | [
"Create",
"a",
"new",
"dbparameter",
"group",
"for",
"your",
"account",
"."
] | def create_parameter_group(self, name, engine='MySQL5.1', description=''):
"""
Create a new dbparameter group for your account.
:type name: string
:param name: The name of the new dbparameter group
:type engine: str
:param engine: Name of database engine.
:type... | [
"def",
"create_parameter_group",
"(",
"self",
",",
"name",
",",
"engine",
"=",
"'MySQL5.1'",
",",
"description",
"=",
"''",
")",
":",
"params",
"=",
"{",
"'DBParameterGroupName'",
":",
"name",
",",
"'DBParameterGroupFamily'",
":",
"engine",
",",
"'Description'",... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/rds/__init__.py#L817-L836 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/grid.py | python | GridTableBase.GetNumberCols | (*args, **kwargs) | return _grid.GridTableBase_GetNumberCols(*args, **kwargs) | GetNumberCols(self) -> int | GetNumberCols(self) -> int | [
"GetNumberCols",
"(",
"self",
")",
"-",
">",
"int"
] | def GetNumberCols(*args, **kwargs):
"""GetNumberCols(self) -> int"""
return _grid.GridTableBase_GetNumberCols(*args, **kwargs) | [
"def",
"GetNumberCols",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridTableBase_GetNumberCols",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L806-L808 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/foldpanelbar.py | python | CaptionBarEvent.GetBar | (self) | return self._bar | Returns the selected :class:`CaptionBar`. | Returns the selected :class:`CaptionBar`. | [
"Returns",
"the",
"selected",
":",
"class",
":",
"CaptionBar",
"."
] | def GetBar(self):
""" Returns the selected :class:`CaptionBar`. """
return self._bar | [
"def",
"GetBar",
"(",
"self",
")",
":",
"return",
"self",
".",
"_bar"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/foldpanelbar.py#L552-L555 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/src/robotsim.py | python | TransformPoser.set | (self, R, t) | return _robotsim.TransformPoser_set(self, R, t) | set(TransformPoser self, double const [9] R, double const [3] t) | set(TransformPoser self, double const [9] R, double const [3] t) | [
"set",
"(",
"TransformPoser",
"self",
"double",
"const",
"[",
"9",
"]",
"R",
"double",
"const",
"[",
"3",
"]",
"t",
")"
] | def set(self, R, t):
"""
set(TransformPoser self, double const [9] R, double const [3] t)
"""
return _robotsim.TransformPoser_set(self, R, t) | [
"def",
"set",
"(",
"self",
",",
"R",
",",
"t",
")",
":",
"return",
"_robotsim",
".",
"TransformPoser_set",
"(",
"self",
",",
"R",
",",
"t",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L3252-L3259 | |
chromiumembedded/cef | 80caf947f3fe2210e5344713c5281d8af9bdc295 | tools/automate/automate-git.py | python | get_git_url | (path) | return 'Unknown' | Returns the origin url for the specified path. | Returns the origin url for the specified path. | [
"Returns",
"the",
"origin",
"url",
"for",
"the",
"specified",
"path",
"."
] | def get_git_url(path):
""" Returns the origin url for the specified path. """
cmd = "%s config --get remote.origin.url" % (git_exe)
result = exec_cmd(cmd, path)
if result['out'] != '':
return result['out'].strip()
return 'Unknown' | [
"def",
"get_git_url",
"(",
"path",
")",
":",
"cmd",
"=",
"\"%s config --get remote.origin.url\"",
"%",
"(",
"git_exe",
")",
"result",
"=",
"exec_cmd",
"(",
"cmd",
",",
"path",
")",
"if",
"result",
"[",
"'out'",
"]",
"!=",
"''",
":",
"return",
"result",
"... | https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/automate/automate-git.py#L172-L178 | |
tensorflow/deepmath | b5b721f54de1d5d6a02d78f5da5995237f9995f9 | deepmath/premises/model_final_cnn_3x.py | python | Model.axiom_embedding | (self, axioms) | return self.make_embedding(axioms) | Compute the embedding for each of the axioms. | Compute the embedding for each of the axioms. | [
"Compute",
"the",
"embedding",
"for",
"each",
"of",
"the",
"axioms",
"."
] | def axiom_embedding(self, axioms):
"""Compute the embedding for each of the axioms."""
return self.make_embedding(axioms) | [
"def",
"axiom_embedding",
"(",
"self",
",",
"axioms",
")",
":",
"return",
"self",
".",
"make_embedding",
"(",
"axioms",
")"
] | https://github.com/tensorflow/deepmath/blob/b5b721f54de1d5d6a02d78f5da5995237f9995f9/deepmath/premises/model_final_cnn_3x.py#L54-L56 | |
0ad/0ad | f58db82e0e925016d83f4e3fa7ca599e3866e2af | source/tools/i18n/checkDiff.py | python | get_diff | () | return io.StringIO(diff_process.stdout.decode()) | Return a diff using svn diff | Return a diff using svn diff | [
"Return",
"a",
"diff",
"using",
"svn",
"diff"
] | def get_diff():
"""Return a diff using svn diff"""
os.chdir(projectRootDirectory)
diff_process = subprocess.run(["svn", "diff", "binaries"], capture_output=True)
if diff_process.returncode != 0:
print(f"Error running svn diff: {diff_process.stderr.decode()}. Exiting.")
return
return... | [
"def",
"get_diff",
"(",
")",
":",
"os",
".",
"chdir",
"(",
"projectRootDirectory",
")",
"diff_process",
"=",
"subprocess",
".",
"run",
"(",
"[",
"\"svn\"",
",",
"\"diff\"",
",",
"\"binaries\"",
"]",
",",
"capture_output",
"=",
"True",
")",
"if",
"diff_proc... | https://github.com/0ad/0ad/blob/f58db82e0e925016d83f4e3fa7ca599e3866e2af/source/tools/i18n/checkDiff.py#L26-L34 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | grc/core/utils/expr_utils.py | python | get_variable_dependencies | (expr, vars) | return set(v for v in vars if v in expr_toks) | Return a set of variables used in this expression.
Args:
expr: an expression string
vars: a list of variable names
Returns:
a subset of vars used in the expression | Return a set of variables used in this expression. | [
"Return",
"a",
"set",
"of",
"variables",
"used",
"in",
"this",
"expression",
"."
] | def get_variable_dependencies(expr, vars):
"""
Return a set of variables used in this expression.
Args:
expr: an expression string
vars: a list of variable names
Returns:
a subset of vars used in the expression
"""
expr_toks = _expr_split(expr)
return set(v for v in... | [
"def",
"get_variable_dependencies",
"(",
"expr",
",",
"vars",
")",
":",
"expr_toks",
"=",
"_expr_split",
"(",
"expr",
")",
"return",
"set",
"(",
"v",
"for",
"v",
"in",
"vars",
"if",
"v",
"in",
"expr_toks",
")"
] | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/grc/core/utils/expr_utils.py#L32-L44 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/v8/tools/stats-viewer.py | python | Main | (data_file, name_filter) | Run the stats counter.
Args:
data_file: The counters file to monitor.
name_filter: The regexp filter to apply to counter names. | Run the stats counter. | [
"Run",
"the",
"stats",
"counter",
"."
] | def Main(data_file, name_filter):
"""Run the stats counter.
Args:
data_file: The counters file to monitor.
name_filter: The regexp filter to apply to counter names.
"""
StatsViewer(data_file, name_filter).Run() | [
"def",
"Main",
"(",
"data_file",
",",
"name_filter",
")",
":",
"StatsViewer",
"(",
"data_file",
",",
"name_filter",
")",
".",
"Run",
"(",
")"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/tools/stats-viewer.py#L454-L461 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/polynomial/hermite_e.py | python | hermeroots | (c) | return r | Compute the roots of a HermiteE series.
Return the roots (a.k.a. "zeros") of the polynomial
.. math:: p(x) = \\sum_i c[i] * He_i(x).
Parameters
----------
c : 1-D array_like
1-D array of coefficients.
Returns
-------
out : ndarray
Array of the roots of the series. If ... | Compute the roots of a HermiteE series. | [
"Compute",
"the",
"roots",
"of",
"a",
"HermiteE",
"series",
"."
] | def hermeroots(c):
"""
Compute the roots of a HermiteE series.
Return the roots (a.k.a. "zeros") of the polynomial
.. math:: p(x) = \\sum_i c[i] * He_i(x).
Parameters
----------
c : 1-D array_like
1-D array of coefficients.
Returns
-------
out : ndarray
Array ... | [
"def",
"hermeroots",
"(",
"c",
")",
":",
"# c is a trimmed copy",
"[",
"c",
"]",
"=",
"pu",
".",
"as_series",
"(",
"[",
"c",
"]",
")",
"if",
"len",
"(",
"c",
")",
"<=",
"1",
":",
"return",
"np",
".",
"array",
"(",
"[",
"]",
",",
"dtype",
"=",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/polynomial/hermite_e.py#L1612-L1668 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/ao/quantization/quantize.py | python | swap_module | (mod, mapping, custom_module_class_mapping) | return new_mod | r"""Swaps the module if it has a quantized counterpart and it has an
`observer` attached.
Args:
mod: input module
mapping: a dictionary that maps from nn module to nnq module
Return:
The corresponding quantized module of `mod` | r"""Swaps the module if it has a quantized counterpart and it has an
`observer` attached. | [
"r",
"Swaps",
"the",
"module",
"if",
"it",
"has",
"a",
"quantized",
"counterpart",
"and",
"it",
"has",
"an",
"observer",
"attached",
"."
] | def swap_module(mod, mapping, custom_module_class_mapping):
r"""Swaps the module if it has a quantized counterpart and it has an
`observer` attached.
Args:
mod: input module
mapping: a dictionary that maps from nn module to nnq module
Return:
The corresponding quantized module ... | [
"def",
"swap_module",
"(",
"mod",
",",
"mapping",
",",
"custom_module_class_mapping",
")",
":",
"new_mod",
"=",
"mod",
"if",
"hasattr",
"(",
"mod",
",",
"'qconfig'",
")",
"and",
"mod",
".",
"qconfig",
"is",
"not",
"None",
":",
"swapped",
"=",
"False",
"i... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/ao/quantization/quantize.py#L550-L590 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/autograph/operators/slices.py | python | _py_set_item | (target, i, x) | return target | Overload of set_item that executes a Python list modification. | Overload of set_item that executes a Python list modification. | [
"Overload",
"of",
"set_item",
"that",
"executes",
"a",
"Python",
"list",
"modification",
"."
] | def _py_set_item(target, i, x):
"""Overload of set_item that executes a Python list modification."""
target[i] = x
return target | [
"def",
"_py_set_item",
"(",
"target",
",",
"i",
",",
"x",
")",
":",
"target",
"[",
"i",
"]",
"=",
"x",
"return",
"target"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/autograph/operators/slices.py#L143-L146 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/locale.py | python | format_string | (f, val, grouping=False) | return new_f % val | Formats a string in the same way that the % formatting would use,
but takes the current locale into account.
Grouping is applied if the third parameter is true. | Formats a string in the same way that the % formatting would use,
but takes the current locale into account.
Grouping is applied if the third parameter is true. | [
"Formats",
"a",
"string",
"in",
"the",
"same",
"way",
"that",
"the",
"%",
"formatting",
"would",
"use",
"but",
"takes",
"the",
"current",
"locale",
"into",
"account",
".",
"Grouping",
"is",
"applied",
"if",
"the",
"third",
"parameter",
"is",
"true",
"."
] | def format_string(f, val, grouping=False):
"""Formats a string in the same way that the % formatting would use,
but takes the current locale into account.
Grouping is applied if the third parameter is true."""
percents = list(_percent_re.finditer(f))
new_f = _percent_re.sub('%s', f)
if operator... | [
"def",
"format_string",
"(",
"f",
",",
"val",
",",
"grouping",
"=",
"False",
")",
":",
"percents",
"=",
"list",
"(",
"_percent_re",
".",
"finditer",
"(",
"f",
")",
")",
"new_f",
"=",
"_percent_re",
".",
"sub",
"(",
"'%s'",
",",
"f",
")",
"if",
"ope... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/locale.py#L222-L254 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | GraphicsMatrix.Scale | (*args, **kwargs) | return _gdi_.GraphicsMatrix_Scale(*args, **kwargs) | Scale(self, Double xScale, Double yScale)
Scales this matrix. | Scale(self, Double xScale, Double yScale) | [
"Scale",
"(",
"self",
"Double",
"xScale",
"Double",
"yScale",
")"
] | def Scale(*args, **kwargs):
"""
Scale(self, Double xScale, Double yScale)
Scales this matrix.
"""
return _gdi_.GraphicsMatrix_Scale(*args, **kwargs) | [
"def",
"Scale",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"GraphicsMatrix_Scale",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L5665-L5671 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/_bootstrap.py | python | _ImportLockContext.__enter__ | (self) | Acquire the import lock. | Acquire the import lock. | [
"Acquire",
"the",
"import",
"lock",
"."
] | def __enter__(self):
"""Acquire the import lock."""
_imp.acquire_lock() | [
"def",
"__enter__",
"(",
"self",
")",
":",
"_imp",
".",
"acquire_lock",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/_bootstrap.py#L855-L857 | ||
perilouswithadollarsign/cstrike15_src | f82112a2388b841d72cb62ca48ab1846dfcc11c8 | thirdparty/protobuf-2.5.0/python/google/protobuf/internal/cpp_message.py | python | ExtensionDict._FindExtensionByName | (self, name) | return self._message._extensions_by_name.get(name, None) | Tries to find a known extension with the specified name.
Args:
name: Extension full name.
Returns:
Extension field descriptor. | Tries to find a known extension with the specified name. | [
"Tries",
"to",
"find",
"a",
"known",
"extension",
"with",
"the",
"specified",
"name",
"."
] | def _FindExtensionByName(self, name):
"""Tries to find a known extension with the specified name.
Args:
name: Extension full name.
Returns:
Extension field descriptor.
"""
return self._message._extensions_by_name.get(name, None) | [
"def",
"_FindExtensionByName",
"(",
"self",
",",
"name",
")",
":",
"return",
"self",
".",
"_message",
".",
"_extensions_by_name",
".",
"get",
"(",
"name",
",",
"None",
")"
] | https://github.com/perilouswithadollarsign/cstrike15_src/blob/f82112a2388b841d72cb62ca48ab1846dfcc11c8/thirdparty/protobuf-2.5.0/python/google/protobuf/internal/cpp_message.py#L345-L354 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | Locale_AddCatalogLookupPathPrefix | (*args, **kwargs) | return _gdi_.Locale_AddCatalogLookupPathPrefix(*args, **kwargs) | Locale_AddCatalogLookupPathPrefix(String prefix) | Locale_AddCatalogLookupPathPrefix(String prefix) | [
"Locale_AddCatalogLookupPathPrefix",
"(",
"String",
"prefix",
")"
] | def Locale_AddCatalogLookupPathPrefix(*args, **kwargs):
"""Locale_AddCatalogLookupPathPrefix(String prefix)"""
return _gdi_.Locale_AddCatalogLookupPathPrefix(*args, **kwargs) | [
"def",
"Locale_AddCatalogLookupPathPrefix",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Locale_AddCatalogLookupPathPrefix",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L3112-L3114 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/dashboard/dashboard/alerts.py | python | StoppageAlertDicts | (stoppage_alerts) | return [_GetStoppageAlertDict(a) for a in stoppage_alerts] | Makes a list of dicts with properties of StoppageAlert entities. | Makes a list of dicts with properties of StoppageAlert entities. | [
"Makes",
"a",
"list",
"of",
"dicts",
"with",
"properties",
"of",
"StoppageAlert",
"entities",
"."
] | def StoppageAlertDicts(stoppage_alerts):
"""Makes a list of dicts with properties of StoppageAlert entities."""
return [_GetStoppageAlertDict(a) for a in stoppage_alerts] | [
"def",
"StoppageAlertDicts",
"(",
"stoppage_alerts",
")",
":",
"return",
"[",
"_GetStoppageAlertDict",
"(",
"a",
")",
"for",
"a",
"in",
"stoppage_alerts",
"]"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/alerts.py#L141-L143 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | dom/bindings/parser/WebIDL.py | python | IDLInterface.findInterfaceLoopPoint | (self, otherInterface) | return None | Finds an interface, amongst our ancestors and consequential interfaces,
that inherits from otherInterface or implements otherInterface
directly. If there is no such interface, returns None. | Finds an interface, amongst our ancestors and consequential interfaces,
that inherits from otherInterface or implements otherInterface
directly. If there is no such interface, returns None. | [
"Finds",
"an",
"interface",
"amongst",
"our",
"ancestors",
"and",
"consequential",
"interfaces",
"that",
"inherits",
"from",
"otherInterface",
"or",
"implements",
"otherInterface",
"directly",
".",
"If",
"there",
"is",
"no",
"such",
"interface",
"returns",
"None",
... | def findInterfaceLoopPoint(self, otherInterface):
"""
Finds an interface, amongst our ancestors and consequential interfaces,
that inherits from otherInterface or implements otherInterface
directly. If there is no such interface, returns None.
"""
if self.parent:
... | [
"def",
"findInterfaceLoopPoint",
"(",
"self",
",",
"otherInterface",
")",
":",
"if",
"self",
".",
"parent",
":",
"if",
"self",
".",
"parent",
"==",
"otherInterface",
":",
"return",
"self",
"loopPoint",
"=",
"self",
".",
"parent",
".",
"findInterfaceLoopPoint",... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/dom/bindings/parser/WebIDL.py#L1289-L1307 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/robotsim.py | python | GeneralizedIKObjective.sampleTransform | (self) | return _robotsim.GeneralizedIKObjective_sampleTransform(self) | r"""
Returns a transformation (R,t) from link relative to link2, sampled at random
from the space of transforms that satisfies the objective obj. | r"""
Returns a transformation (R,t) from link relative to link2, sampled at random
from the space of transforms that satisfies the objective obj. | [
"r",
"Returns",
"a",
"transformation",
"(",
"R",
"t",
")",
"from",
"link",
"relative",
"to",
"link2",
"sampled",
"at",
"random",
"from",
"the",
"space",
"of",
"transforms",
"that",
"satisfies",
"the",
"objective",
"obj",
"."
] | def sampleTransform(self) ->None:
r"""
Returns a transformation (R,t) from link relative to link2, sampled at random
from the space of transforms that satisfies the objective obj.
"""
return _robotsim.GeneralizedIKObjective_sampleTransform(self) | [
"def",
"sampleTransform",
"(",
"self",
")",
"->",
"None",
":",
"return",
"_robotsim",
".",
"GeneralizedIKObjective_sampleTransform",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L6632-L6638 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pyio.py | python | RawIOBase.write | (self, b) | Write the given buffer to the IO stream.
Returns the number of bytes written, which may be less than the
length of b in bytes. | Write the given buffer to the IO stream. | [
"Write",
"the",
"given",
"buffer",
"to",
"the",
"IO",
"stream",
"."
] | def write(self, b):
"""Write the given buffer to the IO stream.
Returns the number of bytes written, which may be less than the
length of b in bytes.
"""
self._unsupported("write") | [
"def",
"write",
"(",
"self",
",",
"b",
")",
":",
"self",
".",
"_unsupported",
"(",
"\"write\"",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pyio.py#L614-L620 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pyrsistent/_pdeque.py | python | pdeque | (iterable=(), maxlen=None) | return PDeque(left, right, length, maxlen) | Return deque containing the elements of iterable. If maxlen is specified then
len(iterable) - maxlen elements are discarded from the left to if len(iterable) > maxlen.
>>> pdeque([1, 2, 3])
pdeque([1, 2, 3])
>>> pdeque([1, 2, 3, 4], maxlen=2)
pdeque([3, 4], maxlen=2) | Return deque containing the elements of iterable. If maxlen is specified then
len(iterable) - maxlen elements are discarded from the left to if len(iterable) > maxlen. | [
"Return",
"deque",
"containing",
"the",
"elements",
"of",
"iterable",
".",
"If",
"maxlen",
"is",
"specified",
"then",
"len",
"(",
"iterable",
")",
"-",
"maxlen",
"elements",
"are",
"discarded",
"from",
"the",
"left",
"to",
"if",
"len",
"(",
"iterable",
")"... | def pdeque(iterable=(), maxlen=None):
"""
Return deque containing the elements of iterable. If maxlen is specified then
len(iterable) - maxlen elements are discarded from the left to if len(iterable) > maxlen.
>>> pdeque([1, 2, 3])
pdeque([1, 2, 3])
>>> pdeque([1, 2, 3, 4], maxlen=2)
pdeque... | [
"def",
"pdeque",
"(",
"iterable",
"=",
"(",
")",
",",
"maxlen",
"=",
"None",
")",
":",
"t",
"=",
"tuple",
"(",
"iterable",
")",
"if",
"maxlen",
"is",
"not",
"None",
":",
"t",
"=",
"t",
"[",
"-",
"maxlen",
":",
"]",
"length",
"=",
"len",
"(",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pyrsistent/_pdeque.py#L350-L367 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py2/pkg_resources/__init__.py | python | IResourceProvider.resource_isdir | (resource_name) | Is the named resource a directory? (like ``os.path.isdir()``) | Is the named resource a directory? (like ``os.path.isdir()``) | [
"Is",
"the",
"named",
"resource",
"a",
"directory?",
"(",
"like",
"os",
".",
"path",
".",
"isdir",
"()",
")"
] | def resource_isdir(resource_name):
"""Is the named resource a directory? (like ``os.path.isdir()``)""" | [
"def",
"resource_isdir",
"(",
"resource_name",
")",
":"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/pkg_resources/__init__.py#L546-L547 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/Demos/desktopmanager.py | python | get_new_desktop_name | (parent_hwnd) | Create a dialog box to ask the user for name of desktop to be created | Create a dialog box to ask the user for name of desktop to be created | [
"Create",
"a",
"dialog",
"box",
"to",
"ask",
"the",
"user",
"for",
"name",
"of",
"desktop",
"to",
"be",
"created"
] | def get_new_desktop_name(parent_hwnd):
""" Create a dialog box to ask the user for name of desktop to be created """
msgs={win32con.WM_COMMAND:desktop_name_dlgproc,
win32con.WM_CLOSE:desktop_name_dlgproc,
win32con.WM_DESTROY:desktop_name_dlgproc}
# dlg item [type, caption, id, (x,y,cx,cy... | [
"def",
"get_new_desktop_name",
"(",
"parent_hwnd",
")",
":",
"msgs",
"=",
"{",
"win32con",
".",
"WM_COMMAND",
":",
"desktop_name_dlgproc",
",",
"win32con",
".",
"WM_CLOSE",
":",
"desktop_name_dlgproc",
",",
"win32con",
".",
"WM_DESTROY",
":",
"desktop_name_dlgproc",... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/Demos/desktopmanager.py#L24-L43 | ||
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | lldb/utils/lui/lldbutil.py | python | print_stacktraces | (process, string_buffer=False) | Prints the stack traces of all the threads. | Prints the stack traces of all the threads. | [
"Prints",
"the",
"stack",
"traces",
"of",
"all",
"the",
"threads",
"."
] | def print_stacktraces(process, string_buffer=False):
"""Prints the stack traces of all the threads."""
output = io.StringIO() if string_buffer else sys.stdout
print("Stack traces for " + str(process), file=output)
for thread in process:
print(print_stacktrace(thread, string_buffer=True), file... | [
"def",
"print_stacktraces",
"(",
"process",
",",
"string_buffer",
"=",
"False",
")",
":",
"output",
"=",
"io",
".",
"StringIO",
"(",
")",
"if",
"string_buffer",
"else",
"sys",
".",
"stdout",
"print",
"(",
"\"Stack traces for \"",
"+",
"str",
"(",
"process",
... | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/lldb/utils/lui/lldbutil.py#L819-L830 | ||
chromiumembedded/cef | 80caf947f3fe2210e5344713c5281d8af9bdc295 | tools/yapf/yapf/yapflib/pytree_unwrapper.py | python | _DetermineMustSplitAnnotation | (node) | Enforce a split in the list if the list ends with a comma. | Enforce a split in the list if the list ends with a comma. | [
"Enforce",
"a",
"split",
"in",
"the",
"list",
"if",
"the",
"list",
"ends",
"with",
"a",
"comma",
"."
] | def _DetermineMustSplitAnnotation(node):
"""Enforce a split in the list if the list ends with a comma."""
if not _ContainsComments(node):
if (not isinstance(node.children[-1], pytree.Leaf) or
node.children[-1].value != ','):
return
num_children = len(node.children)
index = 0
_SetMustSplitOnF... | [
"def",
"_DetermineMustSplitAnnotation",
"(",
"node",
")",
":",
"if",
"not",
"_ContainsComments",
"(",
"node",
")",
":",
"if",
"(",
"not",
"isinstance",
"(",
"node",
".",
"children",
"[",
"-",
"1",
"]",
",",
"pytree",
".",
"Leaf",
")",
"or",
"node",
"."... | https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/yapf/yapf/yapflib/pytree_unwrapper.py#L336-L354 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/pickle.py | python | whichmodule | (func, funcname) | return name | Figure out the module in which a function occurs.
Search sys.modules for the module.
Cache in classmap.
Return a module name.
If the function cannot be found, return "__main__". | Figure out the module in which a function occurs. | [
"Figure",
"out",
"the",
"module",
"in",
"which",
"a",
"function",
"occurs",
"."
] | def whichmodule(func, funcname):
"""Figure out the module in which a function occurs.
Search sys.modules for the module.
Cache in classmap.
Return a module name.
If the function cannot be found, return "__main__".
"""
# Python functions should always get an __module__ from their globals.
... | [
"def",
"whichmodule",
"(",
"func",
",",
"funcname",
")",
":",
"# Python functions should always get an __module__ from their globals.",
"mod",
"=",
"getattr",
"(",
"func",
",",
"\"__module__\"",
",",
"None",
")",
"if",
"mod",
"is",
"not",
"None",
":",
"return",
"m... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/pickle.py#L799-L822 | |
google/certificate-transparency | 2588562fd306a447958471b6f06c1069619c1641 | python/ct/crypto/pem.py | python | PemWriter.write_blocks | (self, blobs) | Write PEM blobs.
Args:
blobs: an iterable of binary blobs.
Raises:
IOError: the file could not be written to. | Write PEM blobs. | [
"Write",
"PEM",
"blobs",
"."
] | def write_blocks(self, blobs):
"""Write PEM blobs.
Args:
blobs: an iterable of binary blobs.
Raises:
IOError: the file could not be written to.
"""
check_newline = True
for b in blobs:
self.write(b, check_newline=check_newline)
... | [
"def",
"write_blocks",
"(",
"self",
",",
"blobs",
")",
":",
"check_newline",
"=",
"True",
"for",
"b",
"in",
"blobs",
":",
"self",
".",
"write",
"(",
"b",
",",
"check_newline",
"=",
"check_newline",
")",
"check_newline",
"=",
"False"
] | https://github.com/google/certificate-transparency/blob/2588562fd306a447958471b6f06c1069619c1641/python/ct/crypto/pem.py#L257-L269 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | PropertyGrid.SetupTextCtrlValue | (*args, **kwargs) | return _propgrid.PropertyGrid_SetupTextCtrlValue(*args, **kwargs) | SetupTextCtrlValue(self, String text) | SetupTextCtrlValue(self, String text) | [
"SetupTextCtrlValue",
"(",
"self",
"String",
"text",
")"
] | def SetupTextCtrlValue(*args, **kwargs):
"""SetupTextCtrlValue(self, String text)"""
return _propgrid.PropertyGrid_SetupTextCtrlValue(*args, **kwargs) | [
"def",
"SetupTextCtrlValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGrid_SetupTextCtrlValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L2443-L2445 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | VersionInfo.__init__ | (self, *args, **kwargs) | __init__(self, String name, int major, int minor, int micro=0, String description=wxEmptyString,
String copyright=wxEmptyString) -> VersionInfo | __init__(self, String name, int major, int minor, int micro=0, String description=wxEmptyString,
String copyright=wxEmptyString) -> VersionInfo | [
"__init__",
"(",
"self",
"String",
"name",
"int",
"major",
"int",
"minor",
"int",
"micro",
"=",
"0",
"String",
"description",
"=",
"wxEmptyString",
"String",
"copyright",
"=",
"wxEmptyString",
")",
"-",
">",
"VersionInfo"
] | def __init__(self, *args, **kwargs):
"""
__init__(self, String name, int major, int minor, int micro=0, String description=wxEmptyString,
String copyright=wxEmptyString) -> VersionInfo
"""
_core_.VersionInfo_swiginit(self,_core_.new_VersionInfo(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_core_",
".",
"VersionInfo_swiginit",
"(",
"self",
",",
"_core_",
".",
"new_VersionInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L16555-L16560 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/dummyarray.py | python | Array.iter_contiguous_extent | (self) | Generates extents | Generates extents | [
"Generates",
"extents"
] | def iter_contiguous_extent(self):
""" Generates extents
"""
if self.is_c_contig or self.is_f_contig:
yield self.extent
else:
if self.dims[0].stride < self.dims[-1].stride:
innerdim = self.dims[0]
outerdims = self.dims[1:]
... | [
"def",
"iter_contiguous_extent",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_c_contig",
"or",
"self",
".",
"is_f_contig",
":",
"yield",
"self",
".",
"extent",
"else",
":",
"if",
"self",
".",
"dims",
"[",
"0",
"]",
".",
"stride",
"<",
"self",
".",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/dummyarray.py#L238-L262 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/xml/etree/ElementTree.py | python | XMLParser.doctype | (self, name, pubid, system) | This method of XMLParser is deprecated. | This method of XMLParser is deprecated. | [
"This",
"method",
"of",
"XMLParser",
"is",
"deprecated",
"."
] | def doctype(self, name, pubid, system):
"""This method of XMLParser is deprecated."""
warnings.warn(
"This method of XMLParser is deprecated. Define doctype() "
"method on the TreeBuilder target.",
DeprecationWarning,
) | [
"def",
"doctype",
"(",
"self",
",",
"name",
",",
"pubid",
",",
"system",
")",
":",
"warnings",
".",
"warn",
"(",
"\"This method of XMLParser is deprecated. Define doctype() \"",
"\"method on the TreeBuilder target.\"",
",",
"DeprecationWarning",
",",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/xml/etree/ElementTree.py#L1622-L1628 | ||
ZeroCM/zcm | a4f8a1c2d81414a13116a70c0979b1bf546866df | waftools/wafcache.py | python | fcache.copy_from_cache | (self, sig, files_from, files_to) | return OK | Copy files from the cache | Copy files from the cache | [
"Copy",
"files",
"from",
"the",
"cache"
] | def copy_from_cache(self, sig, files_from, files_to):
"""
Copy files from the cache
"""
try:
for i, x in enumerate(files_to):
orig = os.path.join(CACHE_DIR, sig[:2], sig, str(i))
atomic_copy(orig, x)
# success! update the cache time
os.utime(os.path.join(CACHE_DIR, sig[:2], sig), None)
excep... | [
"def",
"copy_from_cache",
"(",
"self",
",",
"sig",
",",
"files_from",
",",
"files_to",
")",
":",
"try",
":",
"for",
"i",
",",
"x",
"in",
"enumerate",
"(",
"files_to",
")",
":",
"orig",
"=",
"os",
".",
"path",
".",
"join",
"(",
"CACHE_DIR",
",",
"si... | https://github.com/ZeroCM/zcm/blob/a4f8a1c2d81414a13116a70c0979b1bf546866df/waftools/wafcache.py#L484-L497 | |
su2code/SU2 | 72b2fa977b64b9683a388920f05298a40d39e5c5 | SU2_PY/config_gui.py | python | prepare_data | () | return option_data | Method to get configuration data from source files.
Outputs a dictionary of categories as keys and lists of config_options as values | Method to get configuration data from source files.
Outputs a dictionary of categories as keys and lists of config_options as values | [
"Method",
"to",
"get",
"configuration",
"data",
"from",
"source",
"files",
".",
"Outputs",
"a",
"dictionary",
"of",
"categories",
"as",
"keys",
"and",
"lists",
"of",
"config_options",
"as",
"values"
] | def prepare_data():
""" Method to get configuration data from source files.
Outputs a dictionary of categories as keys and lists of config_options as values
"""
# These variables should point to the configuration files
su2_basedir = os.environ['SU2_HOME']
config_cpp = os.path.join(su2_basedir,'Common/... | [
"def",
"prepare_data",
"(",
")",
":",
"# These variables should point to the configuration files",
"su2_basedir",
"=",
"os",
".",
"environ",
"[",
"'SU2_HOME'",
"]",
"config_cpp",
"=",
"os",
".",
"path",
".",
"join",
"(",
"su2_basedir",
",",
"'Common/src/config_structu... | https://github.com/su2code/SU2/blob/72b2fa977b64b9683a388920f05298a40d39e5c5/SU2_PY/config_gui.py#L282-L308 | |
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Script/Interactive.py | python | SConsInteractiveCmd.do_build | (self, argv) | \
build [TARGETS] Build the specified TARGETS and their
dependencies. 'b' is a synonym. | \
build [TARGETS] Build the specified TARGETS and their
dependencies. 'b' is a synonym. | [
"\\",
"build",
"[",
"TARGETS",
"]",
"Build",
"the",
"specified",
"TARGETS",
"and",
"their",
"dependencies",
".",
"b",
"is",
"a",
"synonym",
"."
] | def do_build(self, argv):
"""\
build [TARGETS] Build the specified TARGETS and their
dependencies. 'b' is a synonym.
"""
import SCons.Node
import SCons.SConsign
import SCons.Script.Main
options = copy.deepcopy(self.options... | [
"def",
"do_build",
"(",
"self",
",",
"argv",
")",
":",
"import",
"SCons",
".",
"Node",
"import",
"SCons",
".",
"SConsign",
"import",
"SCons",
".",
"Script",
".",
"Main",
"options",
"=",
"copy",
".",
"deepcopy",
"(",
"self",
".",
"options",
")",
"option... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Script/Interactive.py#L151-L261 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/html.py | python | HtmlWindowInterface.GetHTMLBackgroundColour | (*args, **kwargs) | return _html.HtmlWindowInterface_GetHTMLBackgroundColour(*args, **kwargs) | GetHTMLBackgroundColour(self) -> Colour | GetHTMLBackgroundColour(self) -> Colour | [
"GetHTMLBackgroundColour",
"(",
"self",
")",
"-",
">",
"Colour"
] | def GetHTMLBackgroundColour(*args, **kwargs):
"""GetHTMLBackgroundColour(self) -> Colour"""
return _html.HtmlWindowInterface_GetHTMLBackgroundColour(*args, **kwargs) | [
"def",
"GetHTMLBackgroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlWindowInterface_GetHTMLBackgroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/html.py#L936-L938 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/jinja2/filters.py | python | do_reject | (*args, **kwargs) | return _select_or_reject(args, kwargs, lambda x: not x, False) | Filters a sequence of objects by appying a test to either the object
or the attribute and rejecting the ones with the test succeeding.
Example usage:
.. sourcecode:: jinja
{{ numbers|reject("odd") }}
.. versionadded:: 2.7 | Filters a sequence of objects by appying a test to either the object
or the attribute and rejecting the ones with the test succeeding. | [
"Filters",
"a",
"sequence",
"of",
"objects",
"by",
"appying",
"a",
"test",
"to",
"either",
"the",
"object",
"or",
"the",
"attribute",
"and",
"rejecting",
"the",
"ones",
"with",
"the",
"test",
"succeeding",
"."
] | def do_reject(*args, **kwargs):
"""Filters a sequence of objects by appying a test to either the object
or the attribute and rejecting the ones with the test succeeding.
Example usage:
.. sourcecode:: jinja
{{ numbers|reject("odd") }}
.. versionadded:: 2.7
"""
return _select_or_r... | [
"def",
"do_reject",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_select_or_reject",
"(",
"args",
",",
"kwargs",
",",
"lambda",
"x",
":",
"not",
"x",
",",
"False",
")"
] | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/jinja2/filters.py#L860-L872 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/_vendor/ordered_set.py | python | is_iterable | (obj) | return (
hasattr(obj, "__iter__")
and not isinstance(obj, str)
and not isinstance(obj, tuple)
) | Are we being asked to look up a list of things, instead of a single thing?
We check for the `__iter__` attribute so that this can cover types that
don't have to be known by this module, such as NumPy arrays.
Strings, however, should be considered as atomic values to look up, not
iterables. The same goe... | Are we being asked to look up a list of things, instead of a single thing?
We check for the `__iter__` attribute so that this can cover types that
don't have to be known by this module, such as NumPy arrays. | [
"Are",
"we",
"being",
"asked",
"to",
"look",
"up",
"a",
"list",
"of",
"things",
"instead",
"of",
"a",
"single",
"thing?",
"We",
"check",
"for",
"the",
"__iter__",
"attribute",
"so",
"that",
"this",
"can",
"cover",
"types",
"that",
"don",
"t",
"have",
"... | def is_iterable(obj):
"""
Are we being asked to look up a list of things, instead of a single thing?
We check for the `__iter__` attribute so that this can cover types that
don't have to be known by this module, such as NumPy arrays.
Strings, however, should be considered as atomic values to look u... | [
"def",
"is_iterable",
"(",
"obj",
")",
":",
"return",
"(",
"hasattr",
"(",
"obj",
",",
"\"__iter__\"",
")",
"and",
"not",
"isinstance",
"(",
"obj",
",",
"str",
")",
"and",
"not",
"isinstance",
"(",
"obj",
",",
"tuple",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/_vendor/ordered_set.py#L22-L39 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/scipy/optimize/line_search.py | python | LineSearch.__init__ | (self, func) | Initialize LineSearch. | Initialize LineSearch. | [
"Initialize",
"LineSearch",
"."
] | def __init__(self, func):
"""Initialize LineSearch."""
super(LineSearch, self).__init__()
self.func = func | [
"def",
"__init__",
"(",
"self",
",",
"func",
")",
":",
"super",
"(",
"LineSearch",
",",
"self",
")",
".",
"__init__",
"(",
")",
"self",
".",
"func",
"=",
"func"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/scipy/optimize/line_search.py#L190-L193 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | commonTools/release/updateTrilinosDB.py | python | database_stats | (package_db) | return {"Total number of packages" : num_packages,
"Number of Trilinos packages" : num_trilinos_packages,
"Number of Trilinos sub-packages" : num_trilinos_sub_packages,
"Number of third-party libraries" : num_tpls
} | Return a dictionary storing statistical information about the given package
database. | Return a dictionary storing statistical information about the given package
database. | [
"Return",
"a",
"dictionary",
"storing",
"statistical",
"information",
"about",
"the",
"given",
"package",
"database",
"."
] | def database_stats(package_db):
"""
Return a dictionary storing statistical information about the given package
database.
"""
num_packages = len(package_db)
num_trilinos_packages = 0
num_trilinos_sub_packages = 0
num_tpls = 0
for packageData in packa... | [
"def",
"database_stats",
"(",
"package_db",
")",
":",
"num_packages",
"=",
"len",
"(",
"package_db",
")",
"num_trilinos_packages",
"=",
"0",
"num_trilinos_sub_packages",
"=",
"0",
"num_tpls",
"=",
"0",
"for",
"packageData",
"in",
"package_db",
".",
"values",
"("... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/commonTools/release/updateTrilinosDB.py#L329-L353 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | PNEANet.GetEAStrI | (self, *args) | return _snap.PNEANet_GetEAStrI(self, *args) | GetEAStrI(PNEANet self, TStr attr, int const & EId) -> TNEANet::TAStrI
Parameters:
attr: TStr const &
EId: int const & | GetEAStrI(PNEANet self, TStr attr, int const & EId) -> TNEANet::TAStrI | [
"GetEAStrI",
"(",
"PNEANet",
"self",
"TStr",
"attr",
"int",
"const",
"&",
"EId",
")",
"-",
">",
"TNEANet",
"::",
"TAStrI"
] | def GetEAStrI(self, *args):
"""
GetEAStrI(PNEANet self, TStr attr, int const & EId) -> TNEANet::TAStrI
Parameters:
attr: TStr const &
EId: int const &
"""
return _snap.PNEANet_GetEAStrI(self, *args) | [
"def",
"GetEAStrI",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"PNEANet_GetEAStrI",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L23685-L23694 | |
envoyproxy/envoy-wasm | ab5d9381fdf92a1efa0b87cff80036b5b3e81198 | source/extensions/filters/network/kafka/protocol/generator.py | python | Complex.compute_constructors | (self) | return sorted(signature_to_constructor.values(), key=lambda x: x['versions'][0]) | Field lists for different versions may not differ (as Kafka can bump version without any
changes). But constructors need to be unique, so we need to remove duplicates if the signatures
match. | Field lists for different versions may not differ (as Kafka can bump version without any
changes). But constructors need to be unique, so we need to remove duplicates if the signatures
match. | [
"Field",
"lists",
"for",
"different",
"versions",
"may",
"not",
"differ",
"(",
"as",
"Kafka",
"can",
"bump",
"version",
"without",
"any",
"changes",
")",
".",
"But",
"constructors",
"need",
"to",
"be",
"unique",
"so",
"we",
"need",
"to",
"remove",
"duplica... | def compute_constructors(self):
"""
Field lists for different versions may not differ (as Kafka can bump version without any
changes). But constructors need to be unique, so we need to remove duplicates if the signatures
match.
"""
signature_to_constructor = {}
for field_list in self.compute... | [
"def",
"compute_constructors",
"(",
"self",
")",
":",
"signature_to_constructor",
"=",
"{",
"}",
"for",
"field_list",
"in",
"self",
".",
"compute_field_lists",
"(",
")",
":",
"signature",
"=",
"field_list",
".",
"constructor_signature",
"(",
")",
"constructor",
... | https://github.com/envoyproxy/envoy-wasm/blob/ab5d9381fdf92a1efa0b87cff80036b5b3e81198/source/extensions/filters/network/kafka/protocol/generator.py#L621-L643 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextCtrl.SelectionIsRectangle | (*args, **kwargs) | return _stc.StyledTextCtrl_SelectionIsRectangle(*args, **kwargs) | SelectionIsRectangle(self) -> bool
Is the selection rectangular? The alternative is the more common stream selection. | SelectionIsRectangle(self) -> bool | [
"SelectionIsRectangle",
"(",
"self",
")",
"-",
">",
"bool"
] | def SelectionIsRectangle(*args, **kwargs):
"""
SelectionIsRectangle(self) -> bool
Is the selection rectangular? The alternative is the more common stream selection.
"""
return _stc.StyledTextCtrl_SelectionIsRectangle(*args, **kwargs) | [
"def",
"SelectionIsRectangle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_SelectionIsRectangle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L4964-L4970 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/android/pylib/symbols/deobfuscator.py | python | Deobfuscator.TransformLines | (self, lines) | Deobfuscates obfuscated names found in the given lines.
If anything goes wrong (process crashes, timeout, etc), returns |lines|.
Args:
lines: A list of strings without trailing newlines.
Returns:
A list of strings without trailing newlines. | Deobfuscates obfuscated names found in the given lines. | [
"Deobfuscates",
"obfuscated",
"names",
"found",
"in",
"the",
"given",
"lines",
"."
] | def TransformLines(self, lines):
"""Deobfuscates obfuscated names found in the given lines.
If anything goes wrong (process crashes, timeout, etc), returns |lines|.
Args:
lines: A list of strings without trailing newlines.
Returns:
A list of strings without trailing newlines.
"""
... | [
"def",
"TransformLines",
"(",
"self",
",",
"lines",
")",
":",
"if",
"not",
"lines",
":",
"return",
"[",
"]",
"# Deobfuscated stacks contain more frames than obfuscated ones when method",
"# inlining occurs. To account for the extra output lines, keep reading until",
"# this eof_lin... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/pylib/symbols/deobfuscator.py#L52-L120 | ||
Evolving-AI-Lab/fooling | 66f097dd6bd2eb6794ade3e187a7adfdf1887688 | caffe/python/caffe/io.py | python | datum_to_array | (datum) | Converts a datum to an array. Note that the label is not returned,
as one can easily get it by calling datum.label. | Converts a datum to an array. Note that the label is not returned,
as one can easily get it by calling datum.label. | [
"Converts",
"a",
"datum",
"to",
"an",
"array",
".",
"Note",
"that",
"the",
"label",
"is",
"not",
"returned",
"as",
"one",
"can",
"easily",
"get",
"it",
"by",
"calling",
"datum",
".",
"label",
"."
] | def datum_to_array(datum):
"""Converts a datum to an array. Note that the label is not returned,
as one can easily get it by calling datum.label.
"""
if len(datum.data):
return np.fromstring(datum.data, dtype = np.uint8).reshape(
datum.channels, datum.height, datum.width)
else:
return np.array... | [
"def",
"datum_to_array",
"(",
"datum",
")",
":",
"if",
"len",
"(",
"datum",
".",
"data",
")",
":",
"return",
"np",
".",
"fromstring",
"(",
"datum",
".",
"data",
",",
"dtype",
"=",
"np",
".",
"uint8",
")",
".",
"reshape",
"(",
"datum",
".",
"channel... | https://github.com/Evolving-AI-Lab/fooling/blob/66f097dd6bd2eb6794ade3e187a7adfdf1887688/caffe/python/caffe/io.py#L150-L159 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/ndarray/ndarray.py | python | NDArray.__hash__ | (self) | return id(self)//16 | Default hash function. | Default hash function. | [
"Default",
"hash",
"function",
"."
] | def __hash__(self):
"""Default hash function."""
return id(self)//16 | [
"def",
"__hash__",
"(",
"self",
")",
":",
"return",
"id",
"(",
"self",
")",
"//",
"16"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/ndarray/ndarray.py#L425-L427 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py | python | Bits._setsie | (self, i) | Initialise bitstring with signed interleaved exponential-Golomb code for integer i. | Initialise bitstring with signed interleaved exponential-Golomb code for integer i. | [
"Initialise",
"bitstring",
"with",
"signed",
"interleaved",
"exponential",
"-",
"Golomb",
"code",
"for",
"integer",
"i",
"."
] | def _setsie(self, i):
"""Initialise bitstring with signed interleaved exponential-Golomb code for integer i."""
if not i:
self._setbin_unsafe('1')
else:
self._setuie(abs(i))
self._append(Bits([i < 0])) | [
"def",
"_setsie",
"(",
"self",
",",
"i",
")",
":",
"if",
"not",
"i",
":",
"self",
".",
"_setbin_unsafe",
"(",
"'1'",
")",
"else",
":",
"self",
".",
"_setuie",
"(",
"abs",
"(",
"i",
")",
")",
"self",
".",
"_append",
"(",
"Bits",
"(",
"[",
"i",
... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py#L1758-L1764 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/html.py | python | HtmlRenderingState.GetBgColour | (*args, **kwargs) | return _html.HtmlRenderingState_GetBgColour(*args, **kwargs) | GetBgColour(self) -> Colour | GetBgColour(self) -> Colour | [
"GetBgColour",
"(",
"self",
")",
"-",
">",
"Colour"
] | def GetBgColour(*args, **kwargs):
"""GetBgColour(self) -> Colour"""
return _html.HtmlRenderingState_GetBgColour(*args, **kwargs) | [
"def",
"GetBgColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlRenderingState_GetBgColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html.py#L529-L531 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/closure_linter/closure_linter/ecmalintrules.py | python | EcmaScriptLintRules.InExplicitlyTypedLanguage | (self) | return False | Returns whether this ecma implementation is explicitly typed. | Returns whether this ecma implementation is explicitly typed. | [
"Returns",
"whether",
"this",
"ecma",
"implementation",
"is",
"explicitly",
"typed",
"."
] | def InExplicitlyTypedLanguage(self):
"""Returns whether this ecma implementation is explicitly typed."""
return False | [
"def",
"InExplicitlyTypedLanguage",
"(",
"self",
")",
":",
"return",
"False"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/closure_linter/closure_linter/ecmalintrules.py#L784-L786 | |
emscripten-core/emscripten | 0d413d3c5af8b28349682496edc14656f5700c2f | third_party/ply/example/newclasscalc/calc.py | python | Calc.t_NUMBER | (self, t) | return t | r'\d+ | r'\d+ | [
"r",
"\\",
"d",
"+"
] | def t_NUMBER(self, t):
r'\d+'
try:
t.value = int(t.value)
except ValueError:
print("Integer value too large %s" % t.value)
t.value = 0
#print "parsed number %s" % repr(t.value)
return t | [
"def",
"t_NUMBER",
"(",
"self",
",",
"t",
")",
":",
"try",
":",
"t",
".",
"value",
"=",
"int",
"(",
"t",
".",
"value",
")",
"except",
"ValueError",
":",
"print",
"(",
"\"Integer value too large %s\"",
"%",
"t",
".",
"value",
")",
"t",
".",
"value",
... | https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/newclasscalc/calc.py#L80-L88 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/lib/function_base.py | python | extract | (condition, arr) | return _nx.take(ravel(arr), nonzero(ravel(condition))[0]) | Return the elements of an array that satisfy some condition.
This is equivalent to ``np.compress(ravel(condition), ravel(arr))``. If
`condition` is boolean ``np.extract`` is equivalent to ``arr[condition]``.
Parameters
----------
condition : array_like
An array whose nonzero or True entri... | Return the elements of an array that satisfy some condition. | [
"Return",
"the",
"elements",
"of",
"an",
"array",
"that",
"satisfy",
"some",
"condition",
"."
] | def extract(condition, arr):
"""
Return the elements of an array that satisfy some condition.
This is equivalent to ``np.compress(ravel(condition), ravel(arr))``. If
`condition` is boolean ``np.extract`` is equivalent to ``arr[condition]``.
Parameters
----------
condition : array_like
... | [
"def",
"extract",
"(",
"condition",
",",
"arr",
")",
":",
"return",
"_nx",
".",
"take",
"(",
"ravel",
"(",
"arr",
")",
",",
"nonzero",
"(",
"ravel",
"(",
"condition",
")",
")",
"[",
"0",
"]",
")"
] | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/lib/function_base.py#L1258-L1299 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/resample.py | python | Resampler._get_binner | (self) | return binner, bin_grouper | Create the BinGrouper, assume that self.set_grouper(obj)
has already been called. | Create the BinGrouper, assume that self.set_grouper(obj)
has already been called. | [
"Create",
"the",
"BinGrouper",
"assume",
"that",
"self",
".",
"set_grouper",
"(",
"obj",
")",
"has",
"already",
"been",
"called",
"."
] | def _get_binner(self):
"""
Create the BinGrouper, assume that self.set_grouper(obj)
has already been called.
"""
binner, bins, binlabels = self._get_binner_for_time()
assert len(bins) == len(binlabels)
bin_grouper = BinGrouper(bins, binlabels, indexer=self.groupby... | [
"def",
"_get_binner",
"(",
"self",
")",
":",
"binner",
",",
"bins",
",",
"binlabels",
"=",
"self",
".",
"_get_binner_for_time",
"(",
")",
"assert",
"len",
"(",
"bins",
")",
"==",
"len",
"(",
"binlabels",
")",
"bin_grouper",
"=",
"BinGrouper",
"(",
"bins"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/resample.py#L236-L244 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/tornado/tornado-6/tornado/iostream.py | python | BaseIOStream.read_from_fd | (self, buf: Union[bytearray, memoryview]) | Attempts to read from the underlying file.
Reads up to ``len(buf)`` bytes, storing them in the buffer.
Returns the number of bytes read. Returns None if there was
nothing to read (the socket returned `~errno.EWOULDBLOCK` or
equivalent), and zero on EOF.
.. versionchanged:: 5.0
... | Attempts to read from the underlying file. | [
"Attempts",
"to",
"read",
"from",
"the",
"underlying",
"file",
"."
] | def read_from_fd(self, buf: Union[bytearray, memoryview]) -> Optional[int]:
"""Attempts to read from the underlying file.
Reads up to ``len(buf)`` bytes, storing them in the buffer.
Returns the number of bytes read. Returns None if there was
nothing to read (the socket returned `~errno.... | [
"def",
"read_from_fd",
"(",
"self",
",",
"buf",
":",
"Union",
"[",
"bytearray",
",",
"memoryview",
"]",
")",
"->",
"Optional",
"[",
"int",
"]",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/iostream.py#L305-L318 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/idl/idl/binder.py | python | _bind_server_parameter_set_at | (ctxt, param) | Translate set_at options to C++ enum value. | Translate set_at options to C++ enum value. | [
"Translate",
"set_at",
"options",
"to",
"C",
"++",
"enum",
"value",
"."
] | def _bind_server_parameter_set_at(ctxt, param):
# type: (errors.ParserContext, syntax.ServerParameter) -> str
"""Translate set_at options to C++ enum value."""
if param.set_at == ['readonly']:
# Readonly may not be mixed with startup or runtime
return "ServerParameterType::kReadOnly"
s... | [
"def",
"_bind_server_parameter_set_at",
"(",
"ctxt",
",",
"param",
")",
":",
"# type: (errors.ParserContext, syntax.ServerParameter) -> str",
"if",
"param",
".",
"set_at",
"==",
"[",
"'readonly'",
"]",
":",
"# Readonly may not be mixed with startup or runtime",
"return",
"\"S... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/binder.py#L1317-L1344 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | uCSIsMiscellaneousSymbols | (code) | return ret | Check whether the character is part of MiscellaneousSymbols
UCS Block | Check whether the character is part of MiscellaneousSymbols
UCS Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"MiscellaneousSymbols",
"UCS",
"Block"
] | def uCSIsMiscellaneousSymbols(code):
"""Check whether the character is part of MiscellaneousSymbols
UCS Block """
ret = libxml2mod.xmlUCSIsMiscellaneousSymbols(code)
return ret | [
"def",
"uCSIsMiscellaneousSymbols",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsMiscellaneousSymbols",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L2752-L2756 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/richtext.py | python | RichTextParagraphLayoutBox.CopyFragment | (*args, **kwargs) | return _richtext.RichTextParagraphLayoutBox_CopyFragment(*args, **kwargs) | CopyFragment(self, RichTextRange range, RichTextParagraphLayoutBox fragment) -> bool | CopyFragment(self, RichTextRange range, RichTextParagraphLayoutBox fragment) -> bool | [
"CopyFragment",
"(",
"self",
"RichTextRange",
"range",
"RichTextParagraphLayoutBox",
"fragment",
")",
"-",
">",
"bool"
] | def CopyFragment(*args, **kwargs):
"""CopyFragment(self, RichTextRange range, RichTextParagraphLayoutBox fragment) -> bool"""
return _richtext.RichTextParagraphLayoutBox_CopyFragment(*args, **kwargs) | [
"def",
"CopyFragment",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextParagraphLayoutBox_CopyFragment",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L1814-L1816 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/optimize/_trustregion.py | python | _minimize_trust_region | (fun, x0, args=(), jac=None, hess=None, hessp=None,
subproblem=None, initial_trust_radius=1.0,
max_trust_radius=1000.0, eta=0.15, gtol=1e-4,
maxiter=None, disp=False, return_all=False,
callback=None, inexact=True... | return result | Minimization of scalar function of one or more variables using a
trust-region algorithm.
Options for the trust-region algorithm are:
initial_trust_radius : float
Initial trust radius.
max_trust_radius : float
Never propose steps that are longer than this value.
e... | Minimization of scalar function of one or more variables using a
trust-region algorithm. | [
"Minimization",
"of",
"scalar",
"function",
"of",
"one",
"or",
"more",
"variables",
"using",
"a",
"trust",
"-",
"region",
"algorithm",
"."
] | def _minimize_trust_region(fun, x0, args=(), jac=None, hess=None, hessp=None,
subproblem=None, initial_trust_radius=1.0,
max_trust_radius=1000.0, eta=0.15, gtol=1e-4,
maxiter=None, disp=False, return_all=False,
c... | [
"def",
"_minimize_trust_region",
"(",
"fun",
",",
"x0",
",",
"args",
"=",
"(",
")",
",",
"jac",
"=",
"None",
",",
"hess",
"=",
"None",
",",
"hessp",
"=",
"None",
",",
"subproblem",
"=",
"None",
",",
"initial_trust_radius",
"=",
"1.0",
",",
"max_trust_r... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/_trustregion.py#L102-L266 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/LoadDNSLegacy.py | python | LoadDNSLegacy.name | (self) | return "LoadDNSLegacy" | Returns name | Returns name | [
"Returns",
"name"
] | def name(self):
"""
Returns name
"""
return "LoadDNSLegacy" | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"\"LoadDNSLegacy\""
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/LoadDNSLegacy.py#L39-L43 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/idlelib/ScriptBinding.py | python | ScriptBinding.run_module_event | (self, event) | return 'break' | Run the module after setting up the environment.
First check the syntax. If OK, make sure the shell is active and
then transfer the arguments, set the run environment's working
directory to the directory of the module being executed and also
add that directory to its sys.path if not al... | Run the module after setting up the environment. | [
"Run",
"the",
"module",
"after",
"setting",
"up",
"the",
"environment",
"."
] | def run_module_event(self, event):
"""Run the module after setting up the environment.
First check the syntax. If OK, make sure the shell is active and
then transfer the arguments, set the run environment's working
directory to the directory of the module being executed and also
... | [
"def",
"run_module_event",
"(",
"self",
",",
"event",
")",
":",
"filename",
"=",
"self",
".",
"getfilename",
"(",
")",
"if",
"not",
"filename",
":",
"return",
"'break'",
"code",
"=",
"self",
".",
"checksyntax",
"(",
"filename",
")",
"if",
"not",
"code",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/idlelib/ScriptBinding.py#L131-L169 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Listbox.selection_clear | (self, first, last=None) | Clear the selection from FIRST to LAST (not included). | Clear the selection from FIRST to LAST (not included). | [
"Clear",
"the",
"selection",
"from",
"FIRST",
"to",
"LAST",
"(",
"not",
"included",
")",
"."
] | def selection_clear(self, first, last=None):
"""Clear the selection from FIRST to LAST (not included)."""
self.tk.call(self._w,
'selection', 'clear', first, last) | [
"def",
"selection_clear",
"(",
"self",
",",
"first",
",",
"last",
"=",
"None",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'selection'",
",",
"'clear'",
",",
"first",
",",
"last",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2600-L2603 | ||
continental/ecal | 204dab80a24fe01abca62541133b311bf0c09608 | samples/python/ecalhdf5_rw/ecalhdf5_rw.py | python | main | () | eCALHDF5 Write & Read Sample
Step 1: create hdf5 file and add some data
Step 2: read data from newly created file | eCALHDF5 Write & Read Sample
Step 1: create hdf5 file and add some data
Step 2: read data from newly created file | [
"eCALHDF5",
"Write",
"&",
"Read",
"Sample",
"Step",
"1",
":",
"create",
"hdf5",
"file",
"and",
"add",
"some",
"data",
"Step",
"2",
":",
"read",
"data",
"from",
"newly",
"created",
"file"
] | def main():
"""
eCALHDF5 Write & Read Sample
Step 1: create hdf5 file and add some data
Step 2: read data from newly created file
"""
ENTRY_COUNT = 30
MAX_ENTRY_DATA_SIZE = 32767
# Step 1: create hdf5 file and add some data
# File properties
output_dir = "ecalhdf5_rw_meas_folder"
file_name ... | [
"def",
"main",
"(",
")",
":",
"ENTRY_COUNT",
"=",
"30",
"MAX_ENTRY_DATA_SIZE",
"=",
"32767",
"# Step 1: create hdf5 file and add some data",
"# File properties",
"output_dir",
"=",
"\"ecalhdf5_rw_meas_folder\"",
"file_name",
"=",
"\"measurement\"",
"channels",
"=",
"[",
"... | https://github.com/continental/ecal/blob/204dab80a24fe01abca62541133b311bf0c09608/samples/python/ecalhdf5_rw/ecalhdf5_rw.py#L24-L133 | ||
RegrowthStudios/SoACode-Public | c3ddd69355b534d5e70e2e6d0c489b4e93ab1ffe | utils/git-hooks/cpplint/cpplint.py | python | _IncludeState.CanonicalizeAlphabeticalOrder | (self, header_path) | return header_path.replace('-inl.h', '.h').replace('-', '_').lower() | Returns a path canonicalized for alphabetical comparison.
- replaces "-" with "_" so they both cmp the same.
- removes '-inl' since we don't require them to be after the main header.
- lowercase everything, just in case.
Args:
header_path: Path to be canonicalized.
Returns:
Canonicali... | Returns a path canonicalized for alphabetical comparison. | [
"Returns",
"a",
"path",
"canonicalized",
"for",
"alphabetical",
"comparison",
"."
] | def CanonicalizeAlphabeticalOrder(self, header_path):
"""Returns a path canonicalized for alphabetical comparison.
- replaces "-" with "_" so they both cmp the same.
- removes '-inl' since we don't require them to be after the main header.
- lowercase everything, just in case.
Args:
header_p... | [
"def",
"CanonicalizeAlphabeticalOrder",
"(",
"self",
",",
"header_path",
")",
":",
"return",
"header_path",
".",
"replace",
"(",
"'-inl.h'",
",",
"'.h'",
")",
".",
"replace",
"(",
"'-'",
",",
"'_'",
")",
".",
"lower",
"(",
")"
] | https://github.com/RegrowthStudios/SoACode-Public/blob/c3ddd69355b534d5e70e2e6d0c489b4e93ab1ffe/utils/git-hooks/cpplint/cpplint.py#L426-L439 | |
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/ceph-volume/ceph_volume/util/prepare.py | python | create_id | (fsid, json_secrets, osd_id=None) | return ' '.join(stdout).strip() | :param fsid: The osd fsid to create, always required
:param json_secrets: a json-ready object with whatever secrets are wanted
to be passed to the monitor
:param osd_id: Reuse an existing ID from an OSD that's been destroyed, if the
id does not exist in the cluster a ... | :param fsid: The osd fsid to create, always required
:param json_secrets: a json-ready object with whatever secrets are wanted
to be passed to the monitor
:param osd_id: Reuse an existing ID from an OSD that's been destroyed, if the
id does not exist in the cluster a ... | [
":",
"param",
"fsid",
":",
"The",
"osd",
"fsid",
"to",
"create",
"always",
"required",
":",
"param",
"json_secrets",
":",
"a",
"json",
"-",
"ready",
"object",
"with",
"whatever",
"secrets",
"are",
"wanted",
"to",
"be",
"passed",
"to",
"the",
"monitor",
"... | def create_id(fsid, json_secrets, osd_id=None):
"""
:param fsid: The osd fsid to create, always required
:param json_secrets: a json-ready object with whatever secrets are wanted
to be passed to the monitor
:param osd_id: Reuse an existing ID from an OSD that's been destroyed, i... | [
"def",
"create_id",
"(",
"fsid",
",",
"json_secrets",
",",
"osd_id",
"=",
"None",
")",
":",
"bootstrap_keyring",
"=",
"'/var/lib/ceph/bootstrap-osd/%s.keyring'",
"%",
"conf",
".",
"cluster",
"cmd",
"=",
"[",
"'ceph'",
",",
"'--cluster'",
",",
"conf",
".",
"clu... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/ceph-volume/ceph_volume/util/prepare.py#L145-L174 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | TreeCtrl.SetImageList | (*args, **kwargs) | return _controls_.TreeCtrl_SetImageList(*args, **kwargs) | SetImageList(self, ImageList imageList) | SetImageList(self, ImageList imageList) | [
"SetImageList",
"(",
"self",
"ImageList",
"imageList",
")"
] | def SetImageList(*args, **kwargs):
"""SetImageList(self, ImageList imageList)"""
return _controls_.TreeCtrl_SetImageList(*args, **kwargs) | [
"def",
"SetImageList",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TreeCtrl_SetImageList",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L5237-L5239 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/lib2to3/pytree.py | python | Leaf._eq | (self, other) | return (self.type, self.value) == (other.type, other.value) | Compare two nodes for equality. | Compare two nodes for equality. | [
"Compare",
"two",
"nodes",
"for",
"equality",
"."
] | def _eq(self, other):
"""Compare two nodes for equality."""
return (self.type, self.value) == (other.type, other.value) | [
"def",
"_eq",
"(",
"self",
",",
"other",
")",
":",
"return",
"(",
"self",
".",
"type",
",",
"self",
".",
"value",
")",
"==",
"(",
"other",
".",
"type",
",",
"other",
".",
"value",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/lib2to3/pytree.py#L362-L364 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/FrameWork.py | python | ostypecode | (x) | return s | Convert a long int to the 4-character code it really is | Convert a long int to the 4-character code it really is | [
"Convert",
"a",
"long",
"int",
"to",
"the",
"4",
"-",
"character",
"code",
"it",
"really",
"is"
] | def ostypecode(x):
"Convert a long int to the 4-character code it really is"
s = ''
for i in range(4):
x, c = divmod(x, 256)
s = chr(c) + s
return s | [
"def",
"ostypecode",
"(",
"x",
")",
":",
"s",
"=",
"''",
"for",
"i",
"in",
"range",
"(",
"4",
")",
":",
"x",
",",
"c",
"=",
"divmod",
"(",
"x",
",",
"256",
")",
"s",
"=",
"chr",
"(",
"c",
")",
"+",
"s",
"return",
"s"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/FrameWork.py#L1074-L1080 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vendor/distlib/wheel.py | python | Wheel.__init__ | (self, filename=None, sign=False, verify=False) | Initialise an instance using a (valid) filename. | Initialise an instance using a (valid) filename. | [
"Initialise",
"an",
"instance",
"using",
"a",
"(",
"valid",
")",
"filename",
"."
] | def __init__(self, filename=None, sign=False, verify=False):
"""
Initialise an instance using a (valid) filename.
"""
self.sign = sign
self.verify = verify
self.buildver = ''
self.pyver = [PYVER]
self.abi = ['none']
self.arch = ['any']
self... | [
"def",
"__init__",
"(",
"self",
",",
"filename",
"=",
"None",
",",
"sign",
"=",
"False",
",",
"verify",
"=",
"False",
")",
":",
"self",
".",
"sign",
"=",
"sign",
"self",
".",
"verify",
"=",
"verify",
"self",
".",
"buildver",
"=",
"''",
"self",
".",... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vendor/distlib/wheel.py#L129-L167 | ||
zhaoweicai/cascade-rcnn | 2252f46158ea6555868ca6fa5c221ea71d9b5e6c | python/caffe/io.py | python | Transformer.deprocess | (self, in_, data) | return decaf_in | Invert Caffe formatting; see preprocess(). | Invert Caffe formatting; see preprocess(). | [
"Invert",
"Caffe",
"formatting",
";",
"see",
"preprocess",
"()",
"."
] | def deprocess(self, in_, data):
"""
Invert Caffe formatting; see preprocess().
"""
self.__check_input(in_)
decaf_in = data.copy().squeeze()
transpose = self.transpose.get(in_)
channel_swap = self.channel_swap.get(in_)
raw_scale = self.raw_scale.get(in_)
... | [
"def",
"deprocess",
"(",
"self",
",",
"in_",
",",
"data",
")",
":",
"self",
".",
"__check_input",
"(",
"in_",
")",
"decaf_in",
"=",
"data",
".",
"copy",
"(",
")",
".",
"squeeze",
"(",
")",
"transpose",
"=",
"self",
".",
"transpose",
".",
"get",
"("... | https://github.com/zhaoweicai/cascade-rcnn/blob/2252f46158ea6555868ca6fa5c221ea71d9b5e6c/python/caffe/io.py#L164-L185 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/html5lib/_inputstream.py | python | EncodingBytes.matchBytes | (self, bytes) | return rv | Look for a sequence of bytes at the start of a string. If the bytes
are found return True and advance the position to the byte after the
match. Otherwise return False and leave the position alone | Look for a sequence of bytes at the start of a string. If the bytes
are found return True and advance the position to the byte after the
match. Otherwise return False and leave the position alone | [
"Look",
"for",
"a",
"sequence",
"of",
"bytes",
"at",
"the",
"start",
"of",
"a",
"string",
".",
"If",
"the",
"bytes",
"are",
"found",
"return",
"True",
"and",
"advance",
"the",
"position",
"to",
"the",
"byte",
"after",
"the",
"match",
".",
"Otherwise",
... | def matchBytes(self, bytes):
"""Look for a sequence of bytes at the start of a string. If the bytes
are found return True and advance the position to the byte after the
match. Otherwise return False and leave the position alone"""
rv = self.startswith(bytes, self.position)
if rv:... | [
"def",
"matchBytes",
"(",
"self",
",",
"bytes",
")",
":",
"rv",
"=",
"self",
".",
"startswith",
"(",
"bytes",
",",
"self",
".",
"position",
")",
"if",
"rv",
":",
"self",
".",
"position",
"+=",
"len",
"(",
"bytes",
")",
"return",
"rv"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/html5lib/_inputstream.py#L657-L664 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/ciconfig/tags.py | python | TagsConfig.get_test_kinds | (self) | return self._conf.keys() | List the test kinds. | List the test kinds. | [
"List",
"the",
"test",
"kinds",
"."
] | def get_test_kinds(self):
"""List the test kinds."""
return self._conf.keys() | [
"def",
"get_test_kinds",
"(",
"self",
")",
":",
"return",
"self",
".",
"_conf",
".",
"keys",
"(",
")"
] | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/ciconfig/tags.py#L56-L58 | |
infinit/elle | a8154593c42743f45b9df09daf62b44630c24a02 | drake/src/drake/ocaml/__init__.py | python | Source.to_objects | (self, toolkit, config) | return [obj] | Convert to the associated bytecode object file. | Convert to the associated bytecode object file. | [
"Convert",
"to",
"the",
"associated",
"bytecode",
"object",
"file",
"."
] | def to_objects(self, toolkit, config):
'''Convert to the associated bytecode object file.'''
kind = InterfaceObject if isinstance(self, Interface) else ImplementationObject
obj = kind(self.name().with_extension(self.extension))
Compiler(self, obj, toolkit, config)
return [obj] | [
"def",
"to_objects",
"(",
"self",
",",
"toolkit",
",",
"config",
")",
":",
"kind",
"=",
"InterfaceObject",
"if",
"isinstance",
"(",
"self",
",",
"Interface",
")",
"else",
"ImplementationObject",
"obj",
"=",
"kind",
"(",
"self",
".",
"name",
"(",
")",
"."... | https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/ocaml/__init__.py#L132-L139 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/__init__.py | python | connect_fps | (aws_access_key_id=None, aws_secret_access_key=None, **kwargs) | return FPSConnection(aws_access_key_id, aws_secret_access_key, **kwargs) | :type aws_access_key_id: string
:param aws_access_key_id: Your AWS Access Key ID
:type aws_secret_access_key: string
:param aws_secret_access_key: Your AWS Secret Access Key
:rtype: :class:`boto.fps.connection.FPSConnection`
:return: A connection to FPS | :type aws_access_key_id: string
:param aws_access_key_id: Your AWS Access Key ID | [
":",
"type",
"aws_access_key_id",
":",
"string",
":",
"param",
"aws_access_key_id",
":",
"Your",
"AWS",
"Access",
"Key",
"ID"
] | def connect_fps(aws_access_key_id=None, aws_secret_access_key=None, **kwargs):
"""
:type aws_access_key_id: string
:param aws_access_key_id: Your AWS Access Key ID
:type aws_secret_access_key: string
:param aws_secret_access_key: Your AWS Secret Access Key
:rtype: :class:`boto.fps.connection.F... | [
"def",
"connect_fps",
"(",
"aws_access_key_id",
"=",
"None",
",",
"aws_secret_access_key",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
"boto",
".",
"fps",
".",
"connection",
"import",
"FPSConnection",
"return",
"FPSConnection",
"(",
"aws_access_key_i... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/__init__.py#L243-L255 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/io/matlab/mio4.py | python | VarReader4.shape_from_header | (self, hdr) | return shape | Read the shape of the array described by the header.
The file position after this call is unspecified. | Read the shape of the array described by the header.
The file position after this call is unspecified. | [
"Read",
"the",
"shape",
"of",
"the",
"array",
"described",
"by",
"the",
"header",
".",
"The",
"file",
"position",
"after",
"this",
"call",
"is",
"unspecified",
"."
] | def shape_from_header(self, hdr):
'''Read the shape of the array described by the header.
The file position after this call is unspecified.
'''
mclass = hdr.mclass
if mclass == mxFULL_CLASS:
shape = tuple(map(int, hdr.dims))
elif mclass == mxCHAR_CLASS:
... | [
"def",
"shape_from_header",
"(",
"self",
",",
"hdr",
")",
":",
"mclass",
"=",
"hdr",
".",
"mclass",
"if",
"mclass",
"==",
"mxFULL_CLASS",
":",
"shape",
"=",
"tuple",
"(",
"map",
"(",
"int",
",",
"hdr",
".",
"dims",
")",
")",
"elif",
"mclass",
"==",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/io/matlab/mio4.py#L269-L301 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | FWCore/Utilities/python/Enumerate.py | python | Enumerate.isValidKey | (self, key) | return key in self.__dict__ | Returns true if this value is a valid enum key | Returns true if this value is a valid enum key | [
"Returns",
"true",
"if",
"this",
"value",
"is",
"a",
"valid",
"enum",
"key"
] | def isValidKey (self, key):
""" Returns true if this value is a valid enum key"""
return key in self.__dict__ | [
"def",
"isValidKey",
"(",
"self",
",",
"key",
")",
":",
"return",
"key",
"in",
"self",
".",
"__dict__"
] | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/FWCore/Utilities/python/Enumerate.py#L35-L37 | |
H-uru/Plasma | c2140ea046e82e9c199e257a7f2e7edb42602871 | Scripts/Python/xAvatarCustomization.py | python | CanShowClothingItem | (clothingItem) | return False | returns true if this item is elegable for showing | returns true if this item is elegable for showing | [
"returns",
"true",
"if",
"this",
"item",
"is",
"elegable",
"for",
"showing"
] | def CanShowClothingItem(clothingItem):
"returns true if this item is elegable for showing"
# make sure we're not supposed to hide the item
if (clothingItem.internalOnly and PtIsInternalRelease()) or not clothingItem.internalOnly:
if (clothingItem.nonStandardItem and ItemInWardrobe(clothingItem)) or... | [
"def",
"CanShowClothingItem",
"(",
"clothingItem",
")",
":",
"# make sure we're not supposed to hide the item",
"if",
"(",
"clothingItem",
".",
"internalOnly",
"and",
"PtIsInternalRelease",
"(",
")",
")",
"or",
"not",
"clothingItem",
".",
"internalOnly",
":",
"if",
"(... | https://github.com/H-uru/Plasma/blob/c2140ea046e82e9c199e257a7f2e7edb42602871/Scripts/Python/xAvatarCustomization.py#L475-L492 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextBuffer.GetExtWildcard | (*args, **kwargs) | return _richtext.RichTextBuffer_GetExtWildcard(*args, **kwargs) | GetExtWildcard(self, bool combine=False, bool save=False) --> (wildcards, types)
Gets a wildcard string for the file dialog based on all the currently
loaded richtext file handlers, and a list that can be used to map
those filter types to the file handler type. | GetExtWildcard(self, bool combine=False, bool save=False) --> (wildcards, types) | [
"GetExtWildcard",
"(",
"self",
"bool",
"combine",
"=",
"False",
"bool",
"save",
"=",
"False",
")",
"--",
">",
"(",
"wildcards",
"types",
")"
] | def GetExtWildcard(*args, **kwargs):
"""
GetExtWildcard(self, bool combine=False, bool save=False) --> (wildcards, types)
Gets a wildcard string for the file dialog based on all the currently
loaded richtext file handlers, and a list that can be used to map
those filter types to... | [
"def",
"GetExtWildcard",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextBuffer_GetExtWildcard",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L2584-L2592 | |
apache/qpid-proton | 6bcdfebb55ea3554bc29b1901422532db331a591 | python/proton/_url.py | python | Url.defaults | (self) | return self | Fill in missing values (scheme, host or port) with defaults
:return: self | Fill in missing values (scheme, host or port) with defaults
:return: self | [
"Fill",
"in",
"missing",
"values",
"(",
"scheme",
"host",
"or",
"port",
")",
"with",
"defaults",
":",
"return",
":",
"self"
] | def defaults(self):
"""
Fill in missing values (scheme, host or port) with defaults
:return: self
"""
self.scheme = self.scheme or self.AMQP
self._host = self._host or '0.0.0.0'
self._port = self._port or self.Port(self.scheme)
return self | [
"def",
"defaults",
"(",
"self",
")",
":",
"self",
".",
"scheme",
"=",
"self",
".",
"scheme",
"or",
"self",
".",
"AMQP",
"self",
".",
"_host",
"=",
"self",
".",
"_host",
"or",
"'0.0.0.0'",
"self",
".",
"_port",
"=",
"self",
".",
"_port",
"or",
"self... | https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_url.py#L257-L265 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBProcess_GetRestartedFromEvent | (*args) | return _lldb.SBProcess_GetRestartedFromEvent(*args) | SBProcess_GetRestartedFromEvent(SBEvent event) -> bool | SBProcess_GetRestartedFromEvent(SBEvent event) -> bool | [
"SBProcess_GetRestartedFromEvent",
"(",
"SBEvent",
"event",
")",
"-",
">",
"bool"
] | def SBProcess_GetRestartedFromEvent(*args):
"""SBProcess_GetRestartedFromEvent(SBEvent event) -> bool"""
return _lldb.SBProcess_GetRestartedFromEvent(*args) | [
"def",
"SBProcess_GetRestartedFromEvent",
"(",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBProcess_GetRestartedFromEvent",
"(",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L7471-L7473 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/constants/constants.py | python | convert_temperature | (val, old_scale, new_scale) | return res | Convert from a temperature scale to another one among Celsius, Kelvin,
Fahrenheit and Rankine scales.
Parameters
----------
val : array_like
Value(s) of the temperature(s) to be converted expressed in the
original scale.
old_scale: str
Specifies as a string the original sca... | Convert from a temperature scale to another one among Celsius, Kelvin,
Fahrenheit and Rankine scales. | [
"Convert",
"from",
"a",
"temperature",
"scale",
"to",
"another",
"one",
"among",
"Celsius",
"Kelvin",
"Fahrenheit",
"and",
"Rankine",
"scales",
"."
] | def convert_temperature(val, old_scale, new_scale):
"""
Convert from a temperature scale to another one among Celsius, Kelvin,
Fahrenheit and Rankine scales.
Parameters
----------
val : array_like
Value(s) of the temperature(s) to be converted expressed in the
original scale.
... | [
"def",
"convert_temperature",
"(",
"val",
",",
"old_scale",
",",
"new_scale",
")",
":",
"# Convert from `old_scale` to Kelvin",
"if",
"old_scale",
".",
"lower",
"(",
")",
"in",
"[",
"'celsius'",
",",
"'c'",
"]",
":",
"tempo",
"=",
"_np",
".",
"asanyarray",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/constants/constants.py#L178-L246 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/sans/state/StateObjects/state_instrument_info.py | python | _set_detector_names | (state: StateInstrumentInfo, ipf_path, invalid_detector_types=None) | Sets the detectors names on a State object which has a `detector` map entry, e.g. StateMask
:param state: the state object
:param ipf_path: the path to the Instrument Parameter File
:param invalid_detector_types: a list of invalid detector types which don't exist for the instrument | Sets the detectors names on a State object which has a `detector` map entry, e.g. StateMask | [
"Sets",
"the",
"detectors",
"names",
"on",
"a",
"State",
"object",
"which",
"has",
"a",
"detector",
"map",
"entry",
"e",
".",
"g",
".",
"StateMask"
] | def _set_detector_names(state: StateInstrumentInfo, ipf_path, invalid_detector_types=None):
"""
Sets the detectors names on a State object which has a `detector` map entry, e.g. StateMask
:param state: the state object
:param ipf_path: the path to the Instrument Parameter File
:param invalid_detect... | [
"def",
"_set_detector_names",
"(",
"state",
":",
"StateInstrumentInfo",
",",
"ipf_path",
",",
"invalid_detector_types",
"=",
"None",
")",
":",
"if",
"invalid_detector_types",
"is",
"None",
":",
"invalid_detector_types",
"=",
"[",
"]",
"lab_keyword",
"=",
"DetectorTy... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/sans/state/StateObjects/state_instrument_info.py#L60-L95 | ||
NervanaSystems/ngraph | f677a119765ca30636cf407009dabd118664951f | python/src/ngraph/ops.py | python | cum_sum | (
arg: NodeInput,
axis: NodeInput,
exclusive: bool = False,
reverse: bool = False,
name: Optional[str] = None,
) | return _get_node_factory().create(
"CumSum", as_nodes(arg, axis), {"exclusive": exclusive, "reverse": reverse}
) | Construct a cumulative summation operation.
:param arg: The tensor to be summed.
:param axis: zero dimension tensor specifying axis position along which sum will be performed.
:param exclusive: if set to true, the top element is not included
:param reverse: if set to true, will perform the sums in reve... | Construct a cumulative summation operation. | [
"Construct",
"a",
"cumulative",
"summation",
"operation",
"."
] | def cum_sum(
arg: NodeInput,
axis: NodeInput,
exclusive: bool = False,
reverse: bool = False,
name: Optional[str] = None,
) -> Node:
"""Construct a cumulative summation operation.
:param arg: The tensor to be summed.
:param axis: zero dimension tensor specifying axis position along whic... | [
"def",
"cum_sum",
"(",
"arg",
":",
"NodeInput",
",",
"axis",
":",
"NodeInput",
",",
"exclusive",
":",
"bool",
"=",
"False",
",",
"reverse",
":",
"bool",
"=",
"False",
",",
"name",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
")",
"->",
"Node... | https://github.com/NervanaSystems/ngraph/blob/f677a119765ca30636cf407009dabd118664951f/python/src/ngraph/ops.py#L2048-L2065 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | gpu/command_buffer/build_gles2_cmd_buffer.py | python | Function.__GetArgList | (self, arg_string, add_comma) | return "%s%s" % (comma, arg_string) | Adds a comma if arg_string is not empty and add_comma is true. | Adds a comma if arg_string is not empty and add_comma is true. | [
"Adds",
"a",
"comma",
"if",
"arg_string",
"is",
"not",
"empty",
"and",
"add_comma",
"is",
"true",
"."
] | def __GetArgList(self, arg_string, add_comma):
"""Adds a comma if arg_string is not empty and add_comma is true."""
comma = ""
if add_comma and len(arg_string):
comma = ", "
return "%s%s" % (comma, arg_string) | [
"def",
"__GetArgList",
"(",
"self",
",",
"arg_string",
",",
"add_comma",
")",
":",
"comma",
"=",
"\"\"",
"if",
"add_comma",
"and",
"len",
"(",
"arg_string",
")",
":",
"comma",
"=",
"\", \"",
"return",
"\"%s%s\"",
"%",
"(",
"comma",
",",
"arg_string",
")"... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/gpu/command_buffer/build_gles2_cmd_buffer.py#L5204-L5209 | |
msitt/blpapi-python | bebcf43668c9e5f5467b1f685f9baebbfc45bc87 | src/blpapi/element.py | python | Element.getValueAsString | (self, index=0) | return res[1] | Args:
index (int): Index of the value in the element
Returns:
str: ``index``\ th entry in the :class:`Element` as a string.
Raises:
InvalidConversionException: If the data type of this
:class:`Element` cannot be converted to a string.
Ind... | Args:
index (int): Index of the value in the element | [
"Args",
":",
"index",
"(",
"int",
")",
":",
"Index",
"of",
"the",
"value",
"in",
"the",
"element"
] | def getValueAsString(self, index=0):
"""
Args:
index (int): Index of the value in the element
Returns:
str: ``index``\ th entry in the :class:`Element` as a string.
Raises:
InvalidConversionException: If the data type of this
:class:`... | [
"def",
"getValueAsString",
"(",
"self",
",",
"index",
"=",
"0",
")",
":",
"self",
".",
"__assertIsValid",
"(",
")",
"res",
"=",
"internals",
".",
"blpapi_Element_getValueAsString",
"(",
"self",
".",
"__handle",
",",
"index",
")",
"_ExceptionUtil",
".",
"rais... | https://github.com/msitt/blpapi-python/blob/bebcf43668c9e5f5467b1f685f9baebbfc45bc87/src/blpapi/element.py#L670-L687 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py3/prompt_toolkit/input/win32_pipe.py | python | Win32PipeInput.flush_keys | (self) | return result | Flush pending keys and return them.
(Used for flushing the 'escape' key.) | Flush pending keys and return them.
(Used for flushing the 'escape' key.) | [
"Flush",
"pending",
"keys",
"and",
"return",
"them",
".",
"(",
"Used",
"for",
"flushing",
"the",
"escape",
"key",
".",
")"
] | def flush_keys(self) -> List[KeyPress]:
"""
Flush pending keys and return them.
(Used for flushing the 'escape' key.)
"""
# Flush all pending keys. (This is most important to flush the vt100
# 'Escape' key early when nothing else follows.)
self.vt100_parser.flush(... | [
"def",
"flush_keys",
"(",
"self",
")",
"->",
"List",
"[",
"KeyPress",
"]",
":",
"# Flush all pending keys. (This is most important to flush the vt100",
"# 'Escape' key early when nothing else follows.)",
"self",
".",
"vt100_parser",
".",
"flush",
"(",
")",
"# Return result.",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/input/win32_pipe.py#L94-L106 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/import/vissim/tls_vissimXML2SUMOnet_update.py | python | is_verbinder | (xmldoc) | return is_verbinder_d | checks if a given link is a verbinder | checks if a given link is a verbinder | [
"checks",
"if",
"a",
"given",
"link",
"is",
"a",
"verbinder"
] | def is_verbinder(xmldoc):
"""checks if a given link is a verbinder"""
is_verbinder_d = dict()
for link in xmldoc.getElementsByTagName("link"):
if len(link.getElementsByTagName("fromLinkEndPt")) > 0:
is_verbinder_d[link.getAttribute("no")] = True
else:
is_verbinder_d[l... | [
"def",
"is_verbinder",
"(",
"xmldoc",
")",
":",
"is_verbinder_d",
"=",
"dict",
"(",
")",
"for",
"link",
"in",
"xmldoc",
".",
"getElementsByTagName",
"(",
"\"link\"",
")",
":",
"if",
"len",
"(",
"link",
".",
"getElementsByTagName",
"(",
"\"fromLinkEndPt\"",
"... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/import/vissim/tls_vissimXML2SUMOnet_update.py#L429-L437 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/tensor_array_ops.py | python | _GraphTensorArrayV2.write | (self, index, value, name=None) | See TensorArray. | See TensorArray. | [
"See",
"TensorArray",
"."
] | def write(self, index, value, name=None):
"""See TensorArray."""
with ops.name_scope(name, "TensorArrayV2Write", [self._flow, index, value]):
# TODO(b/129870929): Fix after all callers provide proper init dtype.
value = ops.convert_to_tensor(
value, preferred_dtype=self._dtype, name="value... | [
"def",
"write",
"(",
"self",
",",
"index",
",",
"value",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"TensorArrayV2Write\"",
",",
"[",
"self",
".",
"_flow",
",",
"index",
",",
"value",
"]",
")",
":",
"#... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/tensor_array_ops.py#L537-L551 | ||
choasup/caffe-yolo9000 | e8a476c4c23d756632f7a26c681a96e3ab672544 | scripts/cpp_lint.py | python | FileInfo.BaseName | (self) | return self.Split()[1] | File base name - text after the final slash, before the final period. | File base name - text after the final slash, before the final period. | [
"File",
"base",
"name",
"-",
"text",
"after",
"the",
"final",
"slash",
"before",
"the",
"final",
"period",
"."
] | def BaseName(self):
"""File base name - text after the final slash, before the final period."""
return self.Split()[1] | [
"def",
"BaseName",
"(",
"self",
")",
":",
"return",
"self",
".",
"Split",
"(",
")",
"[",
"1",
"]"
] | https://github.com/choasup/caffe-yolo9000/blob/e8a476c4c23d756632f7a26c681a96e3ab672544/scripts/cpp_lint.py#L944-L946 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | PreListCtrl | (*args, **kwargs) | return val | PreListCtrl() -> ListCtrl | PreListCtrl() -> ListCtrl | [
"PreListCtrl",
"()",
"-",
">",
"ListCtrl"
] | def PreListCtrl(*args, **kwargs):
"""PreListCtrl() -> ListCtrl"""
val = _controls_.new_PreListCtrl(*args, **kwargs)
return val | [
"def",
"PreListCtrl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"val",
"=",
"_controls_",
".",
"new_PreListCtrl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"return",
"val"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L4864-L4867 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/distribute/merge_call_interim.py | python | maybe_merge_call | (fn, strategy, *args, **kwargs) | Maybe invoke `fn` via `merge_call` which may or may not be fulfilled.
The caller of this utility function requests to invoke `fn` via `merge_call`
at `tf.distribute.Strategy`'s best efforts. It is `tf.distribute`'s internal
whether the request is honored, depending on the `Strategy`. See
`tf.distribute.Replica... | Maybe invoke `fn` via `merge_call` which may or may not be fulfilled. | [
"Maybe",
"invoke",
"fn",
"via",
"merge_call",
"which",
"may",
"or",
"may",
"not",
"be",
"fulfilled",
"."
] | def maybe_merge_call(fn, strategy, *args, **kwargs):
"""Maybe invoke `fn` via `merge_call` which may or may not be fulfilled.
The caller of this utility function requests to invoke `fn` via `merge_call`
at `tf.distribute.Strategy`'s best efforts. It is `tf.distribute`'s internal
whether the request is honored,... | [
"def",
"maybe_merge_call",
"(",
"fn",
",",
"strategy",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"strategy_supports_no_merge_call",
"(",
")",
":",
"return",
"fn",
"(",
"strategy",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"else",... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/merge_call_interim.py#L30-L54 | ||
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/tools/grit/grit/format/android_xml.py | python | _FormatPluralMessage | (message) | return ''.join(lines) | Compiles ICU plural syntax to the body of an Android <plurals> element.
1. In a .grd file, we can write a plural string like this:
<message name="IDS_THINGS">
{NUM_THINGS, plural,
=1 {1 thing}
other {# things}}
</message>
2. The Android equivalent looks like this:
<plurals name="th... | Compiles ICU plural syntax to the body of an Android <plurals> element. | [
"Compiles",
"ICU",
"plural",
"syntax",
"to",
"the",
"body",
"of",
"an",
"Android",
"<plurals",
">",
"element",
"."
] | def _FormatPluralMessage(message):
"""Compiles ICU plural syntax to the body of an Android <plurals> element.
1. In a .grd file, we can write a plural string like this:
<message name="IDS_THINGS">
{NUM_THINGS, plural,
=1 {1 thing}
other {# things}}
</message>
2. The Android equivalent... | [
"def",
"_FormatPluralMessage",
"(",
"message",
")",
":",
"ret",
"=",
"{",
"}",
"plural_match",
"=",
"_PLURALS_PATTERN",
".",
"match",
"(",
"message",
")",
"if",
"not",
"plural_match",
":",
"return",
"None",
"body_in",
"=",
"plural_match",
".",
"group",
"(",
... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/tools/grit/grit/format/android_xml.py#L147-L191 | |
CalcProgrammer1/OpenRGB | 8156b0167a7590dd8ba561dfde524bfcacf46b5e | dependencies/mbedtls-2.24.0/scripts/config.py | python | ConfigFile._format_template | (self, name, indent, middle) | return ''.join([indent,
'' if setting.active else '//',
middle,
value]).rstrip() | Build a line for config.h for the given setting.
The line has the form "<indent>#define <name> <value>"
where <middle> is "#define <name> ". | Build a line for config.h for the given setting. | [
"Build",
"a",
"line",
"for",
"config",
".",
"h",
"for",
"the",
"given",
"setting",
"."
] | def _format_template(self, name, indent, middle):
"""Build a line for config.h for the given setting.
The line has the form "<indent>#define <name> <value>"
where <middle> is "#define <name> ".
"""
setting = self.settings[name]
value = setting.value
if value is N... | [
"def",
"_format_template",
"(",
"self",
",",
"name",
",",
"indent",
",",
"middle",
")",
":",
"setting",
"=",
"self",
".",
"settings",
"[",
"name",
"]",
"value",
"=",
"setting",
".",
"value",
"if",
"value",
"is",
"None",
":",
"value",
"=",
"''",
"# No... | https://github.com/CalcProgrammer1/OpenRGB/blob/8156b0167a7590dd8ba561dfde524bfcacf46b5e/dependencies/mbedtls-2.24.0/scripts/config.py#L392-L414 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.