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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Fem/ObjectsFem.py | python | makeConstraintHeatflux | (
doc,
name="ConstraintHeatflux"
) | return obj | makeConstraintHeatflux(document, [name]):
makes a Fem ConstraintHeatflux object | makeConstraintHeatflux(document, [name]):
makes a Fem ConstraintHeatflux object | [
"makeConstraintHeatflux",
"(",
"document",
"[",
"name",
"]",
")",
":",
"makes",
"a",
"Fem",
"ConstraintHeatflux",
"object"
] | def makeConstraintHeatflux(
doc,
name="ConstraintHeatflux"
):
"""makeConstraintHeatflux(document, [name]):
makes a Fem ConstraintHeatflux object"""
obj = doc.addObject("Fem::ConstraintHeatflux", name)
return obj | [
"def",
"makeConstraintHeatflux",
"(",
"doc",
",",
"name",
"=",
"\"ConstraintHeatflux\"",
")",
":",
"obj",
"=",
"doc",
".",
"addObject",
"(",
"\"Fem::ConstraintHeatflux\"",
",",
"name",
")",
"return",
"obj"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Fem/ObjectsFem.py#L206-L213 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/MSCommon/vc.py | python | find_vc_pdir_vswhere | (msvc_version) | Find the MSVC product directory using the vswhere program.
:param msvc_version: MSVC version to search for
:return: MSVC install dir or None
:raises UnsupportedVersion: if the version is not known by this file | Find the MSVC product directory using the vswhere program. | [
"Find",
"the",
"MSVC",
"product",
"directory",
"using",
"the",
"vswhere",
"program",
"."
] | def find_vc_pdir_vswhere(msvc_version):
"""
Find the MSVC product directory using the vswhere program.
:param msvc_version: MSVC version to search for
:return: MSVC install dir or None
:raises UnsupportedVersion: if the version is not known by this file
"""
try:
vswhere_version = _... | [
"def",
"find_vc_pdir_vswhere",
"(",
"msvc_version",
")",
":",
"try",
":",
"vswhere_version",
"=",
"_VCVER_TO_VSWHERE_VER",
"[",
"msvc_version",
"]",
"except",
"KeyError",
":",
"debug",
"(",
"\"Unknown version of MSVC: %s\"",
"%",
"msvc_version",
")",
"raise",
"Unsuppo... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/MSCommon/vc.py#L290-L343 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/toolkits/_feature_engineering/_autovectorizer.py | python | _interpretations_class.short_text__str | (self, column_name, output_column_prefix) | return [
NGramCounter(
features=[column_name],
n=3,
method="character",
output_column_prefix=output_column_prefix,
),
TFIDF(
features=[column_name],
min_document_frequency=0.01,
... | Transforms short text into a dictionary of TFIDF-weighted 3-gram
character counts. | Transforms short text into a dictionary of TFIDF-weighted 3-gram
character counts. | [
"Transforms",
"short",
"text",
"into",
"a",
"dictionary",
"of",
"TFIDF",
"-",
"weighted",
"3",
"-",
"gram",
"character",
"counts",
"."
] | def short_text__str(self, column_name, output_column_prefix):
"""
Transforms short text into a dictionary of TFIDF-weighted 3-gram
character counts.
"""
from ._ngram_counter import NGramCounter
from ._tfidf import TFIDF
return [
NGramCounter(
... | [
"def",
"short_text__str",
"(",
"self",
",",
"column_name",
",",
"output_column_prefix",
")",
":",
"from",
".",
"_ngram_counter",
"import",
"NGramCounter",
"from",
".",
"_tfidf",
"import",
"TFIDF",
"return",
"[",
"NGramCounter",
"(",
"features",
"=",
"[",
"column... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/_feature_engineering/_autovectorizer.py#L237-L259 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/requests/cookies.py | python | RequestsCookieJar.iterkeys | (self) | Dict-like iterkeys() that returns an iterator of names of cookies
from the jar.
.. seealso:: itervalues() and iteritems(). | Dict-like iterkeys() that returns an iterator of names of cookies
from the jar. | [
"Dict",
"-",
"like",
"iterkeys",
"()",
"that",
"returns",
"an",
"iterator",
"of",
"names",
"of",
"cookies",
"from",
"the",
"jar",
"."
] | def iterkeys(self):
"""Dict-like iterkeys() that returns an iterator of names of cookies
from the jar.
.. seealso:: itervalues() and iteritems().
"""
for cookie in iter(self):
yield cookie.name | [
"def",
"iterkeys",
"(",
"self",
")",
":",
"for",
"cookie",
"in",
"iter",
"(",
"self",
")",
":",
"yield",
"cookie",
".",
"name"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/requests/cookies.py#L218-L225 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/signal/windows.py | python | _cos_win | (M, a, sym=True) | return _truncate(w, needs_trunc) | r"""
Generic weighted sum of cosine terms window
Parameters
----------
M : int
Number of points in the output window
a : array_like
Sequence of weighting coefficients. This uses the convention of being
centered on the origin, so these will typically all be positive
n... | r"""
Generic weighted sum of cosine terms window | [
"r",
"Generic",
"weighted",
"sum",
"of",
"cosine",
"terms",
"window"
] | def _cos_win(M, a, sym=True):
r"""
Generic weighted sum of cosine terms window
Parameters
----------
M : int
Number of points in the output window
a : array_like
Sequence of weighting coefficients. This uses the convention of being
centered on the origin, so these will t... | [
"def",
"_cos_win",
"(",
"M",
",",
"a",
",",
"sym",
"=",
"True",
")",
":",
"if",
"_len_guards",
"(",
"M",
")",
":",
"return",
"np",
".",
"ones",
"(",
"M",
")",
"M",
",",
"needs_trunc",
"=",
"_extend",
"(",
"M",
",",
"sym",
")",
"fac",
"=",
"np... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/signal/windows.py#L40-L118 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib2to3/pgen2/driver.py | python | Driver.parse_string | (self, text, debug=False) | return self.parse_tokens(tokens, debug) | Parse a string and return the syntax tree. | Parse a string and return the syntax tree. | [
"Parse",
"a",
"string",
"and",
"return",
"the",
"syntax",
"tree",
"."
] | def parse_string(self, text, debug=False):
"""Parse a string and return the syntax tree."""
tokens = tokenize.generate_tokens(StringIO.StringIO(text).readline)
return self.parse_tokens(tokens, debug) | [
"def",
"parse_string",
"(",
"self",
",",
"text",
",",
"debug",
"=",
"False",
")",
":",
"tokens",
"=",
"tokenize",
".",
"generate_tokens",
"(",
"StringIO",
".",
"StringIO",
"(",
"text",
")",
".",
"readline",
")",
"return",
"self",
".",
"parse_tokens",
"("... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib2to3/pgen2/driver.py#L103-L106 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/queue.py | python | _PySimpleQueue.empty | (self) | return len(self._queue) == 0 | Return True if the queue is empty, False otherwise (not reliable!). | Return True if the queue is empty, False otherwise (not reliable!). | [
"Return",
"True",
"if",
"the",
"queue",
"is",
"empty",
"False",
"otherwise",
"(",
"not",
"reliable!",
")",
"."
] | def empty(self):
'''Return True if the queue is empty, False otherwise (not reliable!).'''
return len(self._queue) == 0 | [
"def",
"empty",
"(",
"self",
")",
":",
"return",
"len",
"(",
"self",
".",
"_queue",
")",
"==",
"0"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/queue.py#L311-L313 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | PRESUBMIT.py | python | _CheckNoProductionCodeUsingTestOnlyFunctions | (input_api, output_api) | Attempts to prevent use of functions intended only for testing in
non-testing code. For now this is just a best-effort implementation
that ignores header files and may have some false positives. A
better implementation would probably need a proper C++ parser. | Attempts to prevent use of functions intended only for testing in
non-testing code. For now this is just a best-effort implementation
that ignores header files and may have some false positives. A
better implementation would probably need a proper C++ parser. | [
"Attempts",
"to",
"prevent",
"use",
"of",
"functions",
"intended",
"only",
"for",
"testing",
"in",
"non",
"-",
"testing",
"code",
".",
"For",
"now",
"this",
"is",
"just",
"a",
"best",
"-",
"effort",
"implementation",
"that",
"ignores",
"header",
"files",
"... | def _CheckNoProductionCodeUsingTestOnlyFunctions(input_api, output_api):
"""Attempts to prevent use of functions intended only for testing in
non-testing code. For now this is just a best-effort implementation
that ignores header files and may have some false positives. A
better implementation would probably ne... | [
"def",
"_CheckNoProductionCodeUsingTestOnlyFunctions",
"(",
"input_api",
",",
"output_api",
")",
":",
"# We only scan .cc files and the like, as the declaration of",
"# for-testing functions in header files are hard to distinguish from",
"# calls to such functions without a proper C++ parser.",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/PRESUBMIT.py#L259-L299 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | Cursor.SetSize | (*args, **kwargs) | return _gdi_.Cursor_SetSize(*args, **kwargs) | SetSize(self, Size size) | SetSize(self, Size size) | [
"SetSize",
"(",
"self",
"Size",
"size",
")"
] | def SetSize(*args, **kwargs):
"""SetSize(self, Size size)"""
return _gdi_.Cursor_SetSize(*args, **kwargs) | [
"def",
"SetSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Cursor_SetSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L1596-L1598 | |
GraphIt-DSL/graphit | 2e0149719b10484ae4caf99257fa9448bc1aa9a9 | autotune/graphit_autotuner.py | python | GraphItTuner.save_final_config | (self, configuration) | called at the end of tuning | called at the end of tuning | [
"called",
"at",
"the",
"end",
"of",
"tuning"
] | def save_final_config(self, configuration):
"""called at the end of tuning"""
print ('Final Configuration:', configuration.data)
self.manipulator().save_to_file(configuration.data,'final_config.json') | [
"def",
"save_final_config",
"(",
"self",
",",
"configuration",
")",
":",
"print",
"(",
"'Final Configuration:'",
",",
"configuration",
".",
"data",
")",
"self",
".",
"manipulator",
"(",
")",
".",
"save_to_file",
"(",
"configuration",
".",
"data",
",",
"'final_... | https://github.com/GraphIt-DSL/graphit/blob/2e0149719b10484ae4caf99257fa9448bc1aa9a9/autotune/graphit_autotuner.py#L336-L339 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/pipeline.py | python | Pipeline.decision_function | (self, X) | return self.steps[-1][-1].decision_function(Xt) | Apply transforms, and decision_function of the final estimator
Parameters
----------
X : iterable
Data to predict on. Must fulfill input requirements of first step
of the pipeline.
Returns
-------
y_score : array-like of shape (n_samples, n_class... | Apply transforms, and decision_function of the final estimator | [
"Apply",
"transforms",
"and",
"decision_function",
"of",
"the",
"final",
"estimator"
] | def decision_function(self, X):
"""Apply transforms, and decision_function of the final estimator
Parameters
----------
X : iterable
Data to predict on. Must fulfill input requirements of first step
of the pipeline.
Returns
-------
y_scor... | [
"def",
"decision_function",
"(",
"self",
",",
"X",
")",
":",
"Xt",
"=",
"X",
"for",
"_",
",",
"name",
",",
"transform",
"in",
"self",
".",
"_iter",
"(",
"with_final",
"=",
"False",
")",
":",
"Xt",
"=",
"transform",
".",
"transform",
"(",
"Xt",
")",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/pipeline.py#L475-L491 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/io/parsers.py | python | _validate_usecols_arg | (usecols) | return usecols, None | Validate the 'usecols' parameter.
Checks whether or not the 'usecols' parameter contains all integers
(column selection by index), strings (column by name) or is a callable.
Raises a ValueError if that is not the case.
Parameters
----------
usecols : list-like, callable, or None
List o... | Validate the 'usecols' parameter. | [
"Validate",
"the",
"usecols",
"parameter",
"."
] | def _validate_usecols_arg(usecols):
"""
Validate the 'usecols' parameter.
Checks whether or not the 'usecols' parameter contains all integers
(column selection by index), strings (column by name) or is a callable.
Raises a ValueError if that is not the case.
Parameters
----------
useco... | [
"def",
"_validate_usecols_arg",
"(",
"usecols",
")",
":",
"msg",
"=",
"(",
"\"'usecols' must either be list-like of all strings, all unicode, \"",
"\"all integers or a callable.\"",
")",
"if",
"usecols",
"is",
"not",
"None",
":",
"if",
"callable",
"(",
"usecols",
")",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/io/parsers.py#L1274-L1326 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/series.py | python | Series.__len__ | (self) | return len(self._data) | Return the length of the Series. | Return the length of the Series. | [
"Return",
"the",
"length",
"of",
"the",
"Series",
"."
] | def __len__(self) -> int:
"""
Return the length of the Series.
"""
return len(self._data) | [
"def",
"__len__",
"(",
"self",
")",
"->",
"int",
":",
"return",
"len",
"(",
"self",
".",
"_data",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/series.py#L548-L552 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/polynomial/hermite_e.py | python | hermefit | (x, y, deg, rcond=None, full=False, w=None) | return pu._fit(hermevander, x, y, deg, rcond, full, w) | Least squares fit of Hermite series to data.
Return the coefficients of a HermiteE series of degree `deg` that is
the least squares fit to the data values `y` given at points `x`. If
`y` is 1-D the returned coefficients will also be 1-D. If `y` is 2-D
multiple fits are done, one for each column of `y`,... | Least squares fit of Hermite series to data. | [
"Least",
"squares",
"fit",
"of",
"Hermite",
"series",
"to",
"data",
"."
] | def hermefit(x, y, deg, rcond=None, full=False, w=None):
"""
Least squares fit of Hermite series to data.
Return the coefficients of a HermiteE series of degree `deg` that is
the least squares fit to the data values `y` given at points `x`. If
`y` is 1-D the returned coefficients will also be 1-D. ... | [
"def",
"hermefit",
"(",
"x",
",",
"y",
",",
"deg",
",",
"rcond",
"=",
"None",
",",
"full",
"=",
"False",
",",
"w",
"=",
"None",
")",
":",
"return",
"pu",
".",
"_fit",
"(",
"hermevander",
",",
"x",
",",
"y",
",",
"deg",
",",
"rcond",
",",
"ful... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/polynomial/hermite_e.py#L1266-L1395 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | contrib/gizmos/osx_carbon/gizmos.py | python | TreeListCtrl.InsertItem | (*args, **kwargs) | return _gizmos.TreeListCtrl_InsertItem(*args, **kwargs) | InsertItem(self, TreeItemId parent, TreeItemId idPrevious, String text,
int image=-1, int selectedImage=-1, TreeItemData data=None) -> TreeItemId | InsertItem(self, TreeItemId parent, TreeItemId idPrevious, String text,
int image=-1, int selectedImage=-1, TreeItemData data=None) -> TreeItemId | [
"InsertItem",
"(",
"self",
"TreeItemId",
"parent",
"TreeItemId",
"idPrevious",
"String",
"text",
"int",
"image",
"=",
"-",
"1",
"int",
"selectedImage",
"=",
"-",
"1",
"TreeItemData",
"data",
"=",
"None",
")",
"-",
">",
"TreeItemId"
] | def InsertItem(*args, **kwargs):
"""
InsertItem(self, TreeItemId parent, TreeItemId idPrevious, String text,
int image=-1, int selectedImage=-1, TreeItemData data=None) -> TreeItemId
"""
return _gizmos.TreeListCtrl_InsertItem(*args, **kwargs) | [
"def",
"InsertItem",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gizmos",
".",
"TreeListCtrl_InsertItem",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/osx_carbon/gizmos.py#L837-L842 | |
blackberry/Boost | fc90c3fde129c62565c023f091eddc4a7ed9902b | tools/build/v2/tools/common.py | python | Configurations.use | (self, id) | Mark a configuration as 'used'.
Returns True if the state of the configuration has been changed to
'used' and False if it the state wasn't changed. Reports an error
if the configuration isn't known. | Mark a configuration as 'used'. | [
"Mark",
"a",
"configuration",
"as",
"used",
"."
] | def use(self, id):
"""
Mark a configuration as 'used'.
Returns True if the state of the configuration has been changed to
'used' and False if it the state wasn't changed. Reports an error
if the configuration isn't known.
"""
if id not in self.all... | [
"def",
"use",
"(",
"self",
",",
"id",
")",
":",
"if",
"id",
"not",
"in",
"self",
".",
"all_",
":",
"#FIXME:",
"errors",
".",
"error",
"(",
"\"common: the configuration '$(id)' is not known\"",
")",
"if",
"id",
"not",
"in",
"self",
".",
"used_",
":",
"sel... | https://github.com/blackberry/Boost/blob/fc90c3fde129c62565c023f091eddc4a7ed9902b/tools/build/v2/tools/common.py#L123-L141 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/protobuf/python/google/protobuf/message.py | python | Message.SetInParent | (self) | Mark this as present in the parent.
This normally happens automatically when you assign a field of a
sub-message, but sometimes you want to make the sub-message
present while keeping it empty. If you find yourself using this,
you may want to reconsider your design. | Mark this as present in the parent. | [
"Mark",
"this",
"as",
"present",
"in",
"the",
"parent",
"."
] | def SetInParent(self):
"""Mark this as present in the parent.
This normally happens automatically when you assign a field of a
sub-message, but sometimes you want to make the sub-message
present while keeping it empty. If you find yourself using this,
you may want to reconsider your design."""
... | [
"def",
"SetInParent",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/protobuf/python/google/protobuf/message.py#L122-L129 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/gyp/pylib/gyp/xcode_emulation.py | python | XcodeArchsDefault.ActiveArchs | (self, archs, valid_archs, sdkroot) | return expanded_archs | Expands variables references in ARCHS, and filter by VALID_ARCHS if it
is defined (if not set, Xcode accept any value in ARCHS, otherwise, only
values present in VALID_ARCHS are kept). | Expands variables references in ARCHS, and filter by VALID_ARCHS if it
is defined (if not set, Xcode accept any value in ARCHS, otherwise, only
values present in VALID_ARCHS are kept). | [
"Expands",
"variables",
"references",
"in",
"ARCHS",
"and",
"filter",
"by",
"VALID_ARCHS",
"if",
"it",
"is",
"defined",
"(",
"if",
"not",
"set",
"Xcode",
"accept",
"any",
"value",
"in",
"ARCHS",
"otherwise",
"only",
"values",
"present",
"in",
"VALID_ARCHS",
... | def ActiveArchs(self, archs, valid_archs, sdkroot):
"""Expands variables references in ARCHS, and filter by VALID_ARCHS if it
is defined (if not set, Xcode accept any value in ARCHS, otherwise, only
values present in VALID_ARCHS are kept)."""
expanded_archs = self._ExpandArchs(archs or self._default, sd... | [
"def",
"ActiveArchs",
"(",
"self",
",",
"archs",
",",
"valid_archs",
",",
"sdkroot",
")",
":",
"expanded_archs",
"=",
"self",
".",
"_ExpandArchs",
"(",
"archs",
"or",
"self",
".",
"_default",
",",
"sdkroot",
"or",
"''",
")",
"if",
"valid_archs",
":",
"fi... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/xcode_emulation.py#L85-L96 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_log.py | python | LogBuffer.OnDestroy | (self, evt) | Unregister from receiving any more log messages | Unregister from receiving any more log messages | [
"Unregister",
"from",
"receiving",
"any",
"more",
"log",
"messages"
] | def OnDestroy(self, evt):
"""Unregister from receiving any more log messages"""
if evt.GetId() == self.GetId():
ed_msg.Unsubscribe(self.UpdateLog)
evt.Skip() | [
"def",
"OnDestroy",
"(",
"self",
",",
"evt",
")",
":",
"if",
"evt",
".",
"GetId",
"(",
")",
"==",
"self",
".",
"GetId",
"(",
")",
":",
"ed_msg",
".",
"Unsubscribe",
"(",
"self",
".",
"UpdateLog",
")",
"evt",
".",
"Skip",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_log.py#L203-L207 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/image/python/ops/single_image_random_dot_stereograms.py | python | single_image_random_dot_stereograms | (
depth_values,
hidden_surface_removal=None,
convergence_dots_size=None,
dots_per_inch=None,
eye_separation=None, mu=None,
normalize=None, normalize_max=None,
normalize_min=None,
border_level=None,
number_colors=None,
output_image_shape=None,
output_data_window=None) | return result | Output a RandomDotStereogram Tensor for export via encode_PNG/JPG OP.
Given the 2-D tensor 'depth_values' with encoded Z values, this operation
will encode 3-D data into a 2-D image. The output of this Op is suitable
for the encode_PNG/JPG ops. Be careful with image compression as this may
corrupt the encode... | Output a RandomDotStereogram Tensor for export via encode_PNG/JPG OP. | [
"Output",
"a",
"RandomDotStereogram",
"Tensor",
"for",
"export",
"via",
"encode_PNG",
"/",
"JPG",
"OP",
"."
] | def single_image_random_dot_stereograms(
depth_values,
hidden_surface_removal=None,
convergence_dots_size=None,
dots_per_inch=None,
eye_separation=None, mu=None,
normalize=None, normalize_max=None,
normalize_min=None,
border_level=None,
number_colors=None,
output_image_shape=None... | [
"def",
"single_image_random_dot_stereograms",
"(",
"depth_values",
",",
"hidden_surface_removal",
"=",
"None",
",",
"convergence_dots_size",
"=",
"None",
",",
"dots_per_inch",
"=",
"None",
",",
"eye_separation",
"=",
"None",
",",
"mu",
"=",
"None",
",",
"normalize",... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/image/python/ops/single_image_random_dot_stereograms.py#L28-L123 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Taskmaster.py | python | Task.execute | (self) | Called to execute the task.
This method is called from multiple threads in a parallel build,
so only do thread safe stuff here. Do thread unsafe stuff in
prepare(), executed() or failed(). | Called to execute the task. | [
"Called",
"to",
"execute",
"the",
"task",
"."
] | def execute(self):
"""
Called to execute the task.
This method is called from multiple threads in a parallel build,
so only do thread safe stuff here. Do thread unsafe stuff in
prepare(), executed() or failed().
"""
T = self.tm.trace
if T: T.write(self.t... | [
"def",
"execute",
"(",
"self",
")",
":",
"T",
"=",
"self",
".",
"tm",
".",
"trace",
"if",
"T",
":",
"T",
".",
"write",
"(",
"self",
".",
"trace_message",
"(",
"u'Task.execute()'",
",",
"self",
".",
"node",
")",
")",
"try",
":",
"cached_targets",
"=... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Taskmaster.py#L220-L263 | ||
RobotLocomotion/drake | 0e18a34604c45ed65bc9018a54f7610f91cdad5b | tools/lint/clang_format_lint.py | python | main | () | Checks that clang-format is idempotent on each path specified as a
command-line argument. Exit 1 if any of the paths are invalid or
clang-format suggests any edits. Otherwise exit 0. | Checks that clang-format is idempotent on each path specified as a
command-line argument. Exit 1 if any of the paths are invalid or
clang-format suggests any edits. Otherwise exit 0. | [
"Checks",
"that",
"clang",
"-",
"format",
"is",
"idempotent",
"on",
"each",
"path",
"specified",
"as",
"a",
"command",
"-",
"line",
"argument",
".",
"Exit",
"1",
"if",
"any",
"of",
"the",
"paths",
"are",
"invalid",
"or",
"clang",
"-",
"format",
"suggests... | def main():
"""Checks that clang-format is idempotent on each path specified as a
command-line argument. Exit 1 if any of the paths are invalid or
clang-format suggests any edits. Otherwise exit 0.
"""
total_errors = 0
for filename in sys.argv[1:]:
if not _is_cxx(filename):
... | [
"def",
"main",
"(",
")",
":",
"total_errors",
"=",
"0",
"for",
"filename",
"in",
"sys",
".",
"argv",
"[",
"1",
":",
"]",
":",
"if",
"not",
"_is_cxx",
"(",
"filename",
")",
":",
"print",
"(",
"\"clang_format_lint.py: Skipping \"",
"+",
"filename",
")",
... | https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/tools/lint/clang_format_lint.py#L38-L54 | ||
lukasmonk/lucaschess | 13e2e5cb13b38a720ccf897af649054a64bcb914 | Code/QT/Columnas.py | python | Columna.QTcolorFondo | (self, rgb) | Convierte un parametro de color del fondo para que sea usable por QT | Convierte un parametro de color del fondo para que sea usable por QT | [
"Convierte",
"un",
"parametro",
"de",
"color",
"del",
"fondo",
"para",
"que",
"sea",
"usable",
"por",
"QT"
] | def QTcolorFondo(self, rgb):
"""
Convierte un parametro de color del fondo para que sea usable por QT
"""
if rgb == -1:
return None
else:
return QtGui.QBrush(QtGui.QColor(rgb)) | [
"def",
"QTcolorFondo",
"(",
"self",
",",
"rgb",
")",
":",
"if",
"rgb",
"==",
"-",
"1",
":",
"return",
"None",
"else",
":",
"return",
"QtGui",
".",
"QBrush",
"(",
"QtGui",
".",
"QColor",
"(",
"rgb",
")",
")"
] | https://github.com/lukasmonk/lucaschess/blob/13e2e5cb13b38a720ccf897af649054a64bcb914/Code/QT/Columnas.py#L110-L117 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Rect.GetBottomRight | (*args, **kwargs) | return _core_.Rect_GetBottomRight(*args, **kwargs) | GetBottomRight(self) -> Point | GetBottomRight(self) -> Point | [
"GetBottomRight",
"(",
"self",
")",
"-",
">",
"Point"
] | def GetBottomRight(*args, **kwargs):
"""GetBottomRight(self) -> Point"""
return _core_.Rect_GetBottomRight(*args, **kwargs) | [
"def",
"GetBottomRight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Rect_GetBottomRight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L1329-L1331 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/protobuf/python/mox.py | python | MockMethod.MultipleTimes | (self, group_name="default") | return self._CheckAndCreateNewGroup(group_name, MultipleTimesGroup) | Move this method into group of calls which may be called multiple times.
A group of repeating calls must be defined together, and must be executed in
full before the next expected mehtod can be called.
Args:
group_name: the name of the unordered group.
Returns:
self | Move this method into group of calls which may be called multiple times. | [
"Move",
"this",
"method",
"into",
"group",
"of",
"calls",
"which",
"may",
"be",
"called",
"multiple",
"times",
"."
] | def MultipleTimes(self, group_name="default"):
"""Move this method into group of calls which may be called multiple times.
A group of repeating calls must be defined together, and must be executed in
full before the next expected mehtod can be called.
Args:
group_name: the name of the unordered ... | [
"def",
"MultipleTimes",
"(",
"self",
",",
"group_name",
"=",
"\"default\"",
")",
":",
"return",
"self",
".",
"_CheckAndCreateNewGroup",
"(",
"group_name",
",",
"MultipleTimesGroup",
")"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/protobuf/python/mox.py#L704-L716 | |
CaoWGG/TensorRT-YOLOv4 | 4d7c2edce99e8794a4cb4ea3540d51ce91158a36 | onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py | python | Cursor.is_definition | (self) | return conf.lib.clang_isCursorDefinition(self) | Returns true if the declaration pointed at by the cursor is also a
definition of that entity. | Returns true if the declaration pointed at by the cursor is also a
definition of that entity. | [
"Returns",
"true",
"if",
"the",
"declaration",
"pointed",
"at",
"by",
"the",
"cursor",
"is",
"also",
"a",
"definition",
"of",
"that",
"entity",
"."
] | def is_definition(self):
"""
Returns true if the declaration pointed at by the cursor is also a
definition of that entity.
"""
return conf.lib.clang_isCursorDefinition(self) | [
"def",
"is_definition",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_isCursorDefinition",
"(",
"self",
")"
] | https://github.com/CaoWGG/TensorRT-YOLOv4/blob/4d7c2edce99e8794a4cb4ea3540d51ce91158a36/onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py#L1308-L1313 | |
mandiant/flare-wmi | b0a5a094ff9ca7d7a1c4fc711dc00c74dec4b6b1 | python-cim/cim/cim.py | python | LogicalIndexStore.get_physical_page_buffer | (self, index) | fetch the raw bytes of the page at the given physical page number
Args:
index (int): the physical page number.
Returns:
bytes: the raw data at the given page. | fetch the raw bytes of the page at the given physical page number
Args:
index (int): the physical page number. | [
"fetch",
"the",
"raw",
"bytes",
"of",
"the",
"page",
"at",
"the",
"given",
"physical",
"page",
"number",
"Args",
":",
"index",
"(",
"int",
")",
":",
"the",
"physical",
"page",
"number",
"."
] | def get_physical_page_buffer(self, index):
"""
fetch the raw bytes of the page at the given physical page number
Args:
index (int): the physical page number.
Returns:
bytes: the raw data at the given page.
"""
if not os.path.exists(self._... | [
"def",
"get_physical_page_buffer",
"(",
"self",
",",
"index",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"self",
".",
"_file_path",
")",
":",
"raise",
"MissingIndexFileError",
"(",
")",
"if",
"index",
">=",
"self",
".",
"page_count",
"... | https://github.com/mandiant/flare-wmi/blob/b0a5a094ff9ca7d7a1c4fc711dc00c74dec4b6b1/python-cim/cim/cim.py#L717-L735 | ||
bareos/bareos | 56a10bb368b0a81e977bb51304033fe49d59efb0 | core/src/plugins/filed/python/pyfiles/BareosFdPluginLocalFilesBaseclass.py | python | BareosFdPluginLocalFilesBaseclass.start_backup_file | (self, savepkt) | return bareosfd.bRC_OK | Defines the file to backup and creates the savepkt. In this example
only files (no directories) are allowed | Defines the file to backup and creates the savepkt. In this example
only files (no directories) are allowed | [
"Defines",
"the",
"file",
"to",
"backup",
"and",
"creates",
"the",
"savepkt",
".",
"In",
"this",
"example",
"only",
"files",
"(",
"no",
"directories",
")",
"are",
"allowed"
] | def start_backup_file(self, savepkt):
"""
Defines the file to backup and creates the savepkt. In this example
only files (no directories) are allowed
"""
bareosfd.DebugMessage(100, "start_backup_file() called\n")
if not self.files_to_backup:
bareosfd.DebugMess... | [
"def",
"start_backup_file",
"(",
"self",
",",
"savepkt",
")",
":",
"bareosfd",
".",
"DebugMessage",
"(",
"100",
",",
"\"start_backup_file() called\\n\"",
")",
"if",
"not",
"self",
".",
"files_to_backup",
":",
"bareosfd",
".",
"DebugMessage",
"(",
"100",
",",
"... | https://github.com/bareos/bareos/blob/56a10bb368b0a81e977bb51304033fe49d59efb0/core/src/plugins/filed/python/pyfiles/BareosFdPluginLocalFilesBaseclass.py#L69-L143 | |
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/gdal.py | python | ErrorReset | (*args) | return _gdal.ErrorReset(*args) | r"""ErrorReset() | r"""ErrorReset() | [
"r",
"ErrorReset",
"()"
] | def ErrorReset(*args):
r"""ErrorReset()"""
return _gdal.ErrorReset(*args) | [
"def",
"ErrorReset",
"(",
"*",
"args",
")",
":",
"return",
"_gdal",
".",
"ErrorReset",
"(",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gdal.py#L1538-L1540 | |
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | htmlNewDocNoDtD | (URI, ExternalID) | return xmlDoc(_obj=ret) | Creates a new HTML document without a DTD node if @URI and
@ExternalID are None | Creates a new HTML document without a DTD node if | [
"Creates",
"a",
"new",
"HTML",
"document",
"without",
"a",
"DTD",
"node",
"if"
] | def htmlNewDocNoDtD(URI, ExternalID):
"""Creates a new HTML document without a DTD node if @URI and
@ExternalID are None """
ret = libxml2mod.htmlNewDocNoDtD(URI, ExternalID)
if ret is None:raise treeError('htmlNewDocNoDtD() failed')
return xmlDoc(_obj=ret) | [
"def",
"htmlNewDocNoDtD",
"(",
"URI",
",",
"ExternalID",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"htmlNewDocNoDtD",
"(",
"URI",
",",
"ExternalID",
")",
"if",
"ret",
"is",
"None",
":",
"raise",
"treeError",
"(",
"'htmlNewDocNoDtD() failed'",
")",
"return",
"... | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L814-L819 | |
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8/build/landmine_utils.py | python | platform | () | Returns a string representing the platform this build is targetted for.
Possible values: 'win', 'mac', 'linux', 'ios', 'android' | Returns a string representing the platform this build is targetted for.
Possible values: 'win', 'mac', 'linux', 'ios', 'android' | [
"Returns",
"a",
"string",
"representing",
"the",
"platform",
"this",
"build",
"is",
"targetted",
"for",
".",
"Possible",
"values",
":",
"win",
"mac",
"linux",
"ios",
"android"
] | def platform():
"""
Returns a string representing the platform this build is targetted for.
Possible values: 'win', 'mac', 'linux', 'ios', 'android'
"""
if 'OS' in gyp_defines():
if 'android' in gyp_defines()['OS']:
return 'android'
else:
return gyp_defines()['OS']
elif IsWindows():
... | [
"def",
"platform",
"(",
")",
":",
"if",
"'OS'",
"in",
"gyp_defines",
"(",
")",
":",
"if",
"'android'",
"in",
"gyp_defines",
"(",
")",
"[",
"'OS'",
"]",
":",
"return",
"'android'",
"else",
":",
"return",
"gyp_defines",
"(",
")",
"[",
"'OS'",
"]",
"eli... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8/build/landmine_utils.py#L77-L92 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2class.py | python | parserCtxt.ctxtReadMemory | (self, buffer, size, URL, encoding, options) | return __tmp | parse an XML in-memory document and build a tree. This
reuses the existing @ctxt parser context | parse an XML in-memory document and build a tree. This
reuses the existing | [
"parse",
"an",
"XML",
"in",
"-",
"memory",
"document",
"and",
"build",
"a",
"tree",
".",
"This",
"reuses",
"the",
"existing"
] | def ctxtReadMemory(self, buffer, size, URL, encoding, options):
"""parse an XML in-memory document and build a tree. This
reuses the existing @ctxt parser context """
ret = libxml2mod.xmlCtxtReadMemory(self._o, buffer, size, URL, encoding, options)
if ret is None:raise treeError('xmlC... | [
"def",
"ctxtReadMemory",
"(",
"self",
",",
"buffer",
",",
"size",
",",
"URL",
",",
"encoding",
",",
"options",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlCtxtReadMemory",
"(",
"self",
".",
"_o",
",",
"buffer",
",",
"size",
",",
"URL",
",",
"encoding"... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L4282-L4288 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/ir/builder.py | python | IRBuilder.fsub | (self, lhs, rhs, name='') | Floating-point subtraction:
name = lhs - rhs | Floating-point subtraction:
name = lhs - rhs | [
"Floating",
"-",
"point",
"subtraction",
":",
"name",
"=",
"lhs",
"-",
"rhs"
] | def fsub(self, lhs, rhs, name=''):
"""
Floating-point subtraction:
name = lhs - rhs
""" | [
"def",
"fsub",
"(",
"self",
",",
"lhs",
",",
"rhs",
",",
"name",
"=",
"''",
")",
":"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/ir/builder.py#L381-L385 | ||
herbstluftwm/herbstluftwm | 23ef0274bd4d317208eae5fea72b21478a71431b | python/herbstluftwm/types.py | python | hlwm_types | () | return types | Return a list of HlwmType objects.
Unfortunately, the order matters for the is_instance() predicate: Here, the
first matching type in the list must be used. (This is because
`isinstance(True, int)` is true) | Return a list of HlwmType objects. | [
"Return",
"a",
"list",
"of",
"HlwmType",
"objects",
"."
] | def hlwm_types():
"""
Return a list of HlwmType objects.
Unfortunately, the order matters for the is_instance() predicate: Here, the
first matching type in the list must be used. (This is because
`isinstance(True, int)` is true)
"""
types = [
HlwmType(name='bool',
f... | [
"def",
"hlwm_types",
"(",
")",
":",
"types",
"=",
"[",
"HlwmType",
"(",
"name",
"=",
"'bool'",
",",
"from_user_str",
"=",
"bool_from_user_str",
",",
"to_user_str",
"=",
"lambda",
"b",
":",
"'true'",
"if",
"b",
"else",
"'false'",
",",
"is_instance",
"=",
... | https://github.com/herbstluftwm/herbstluftwm/blob/23ef0274bd4d317208eae5fea72b21478a71431b/python/herbstluftwm/types.py#L133-L169 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/special/_precompute/gammainc_asy.py | python | compute_alpha | (n) | return lagrange_inversion(coeffs) | alpha_n from DLMF 8.12.13 | alpha_n from DLMF 8.12.13 | [
"alpha_n",
"from",
"DLMF",
"8",
".",
"12",
".",
"13"
] | def compute_alpha(n):
"""alpha_n from DLMF 8.12.13"""
coeffs = mp.taylor(eta, 0, n - 1)
return lagrange_inversion(coeffs) | [
"def",
"compute_alpha",
"(",
"n",
")",
":",
"coeffs",
"=",
"mp",
".",
"taylor",
"(",
"eta",
",",
"0",
",",
"n",
"-",
"1",
")",
"return",
"lagrange_inversion",
"(",
"coeffs",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/special/_precompute/gammainc_asy.py#L56-L59 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/inspect.py | python | strseq | (object, convert, join=joinseq) | Recursively walk a sequence, stringifying each element. | Recursively walk a sequence, stringifying each element. | [
"Recursively",
"walk",
"a",
"sequence",
"stringifying",
"each",
"element",
"."
] | def strseq(object, convert, join=joinseq):
"""Recursively walk a sequence, stringifying each element."""
if type(object) in (list, tuple):
return join(map(lambda o, c=convert, j=join: strseq(o, c, j), object))
else:
return convert(object) | [
"def",
"strseq",
"(",
"object",
",",
"convert",
",",
"join",
"=",
"joinseq",
")",
":",
"if",
"type",
"(",
"object",
")",
"in",
"(",
"list",
",",
"tuple",
")",
":",
"return",
"join",
"(",
"map",
"(",
"lambda",
"o",
",",
"c",
"=",
"convert",
",",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/inspect.py#L837-L842 | ||
sfzhang15/RefineDet | 52b6fe23dc1a160fe710b7734576dca509bf4fae | python/caffe/io.py | python | load_image | (filename, color=True) | return img | Load an image converting from grayscale or alpha as needed.
Parameters
----------
filename : string
color : boolean
flag for color format. True (default) loads as RGB while False
loads as intensity (if image is already grayscale).
Returns
-------
image : an image with type ... | Load an image converting from grayscale or alpha as needed. | [
"Load",
"an",
"image",
"converting",
"from",
"grayscale",
"or",
"alpha",
"as",
"needed",
"."
] | def load_image(filename, color=True):
"""
Load an image converting from grayscale or alpha as needed.
Parameters
----------
filename : string
color : boolean
flag for color format. True (default) loads as RGB while False
loads as intensity (if image is already grayscale).
R... | [
"def",
"load_image",
"(",
"filename",
",",
"color",
"=",
"True",
")",
":",
"img",
"=",
"skimage",
".",
"img_as_float",
"(",
"skimage",
".",
"io",
".",
"imread",
"(",
"filename",
",",
"as_grey",
"=",
"not",
"color",
")",
")",
".",
"astype",
"(",
"np",... | https://github.com/sfzhang15/RefineDet/blob/52b6fe23dc1a160fe710b7734576dca509bf4fae/python/caffe/io.py#L279-L303 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/idlelib/squeezer.py | python | Squeezer.reload | (cls) | Load class variables from config. | Load class variables from config. | [
"Load",
"class",
"variables",
"from",
"config",
"."
] | def reload(cls):
"""Load class variables from config."""
cls.auto_squeeze_min_lines = idleConf.GetOption(
"main", "PyShell", "auto-squeeze-min-lines",
type="int", default=50,
) | [
"def",
"reload",
"(",
"cls",
")",
":",
"cls",
".",
"auto_squeeze_min_lines",
"=",
"idleConf",
".",
"GetOption",
"(",
"\"main\"",
",",
"\"PyShell\"",
",",
"\"auto-squeeze-min-lines\"",
",",
"type",
"=",
"\"int\"",
",",
"default",
"=",
"50",
",",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/squeezer.py#L205-L210 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/email/quoprimime.py | python | _unquote_match | (match) | return unquote(s) | Turn a match in the form =AB to the ASCII character with value 0xab | Turn a match in the form =AB to the ASCII character with value 0xab | [
"Turn",
"a",
"match",
"in",
"the",
"form",
"=",
"AB",
"to",
"the",
"ASCII",
"character",
"with",
"value",
"0xab"
] | def _unquote_match(match):
"""Turn a match in the form =AB to the ASCII character with value 0xab"""
s = match.group(0)
return unquote(s) | [
"def",
"_unquote_match",
"(",
"match",
")",
":",
"s",
"=",
"match",
".",
"group",
"(",
"0",
")",
"return",
"unquote",
"(",
"s",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/email/quoprimime.py#L321-L324 | |
netket/netket | 0d534e54ecbf25b677ea72af6b85947979420652 | netket/operator/spin.py | python | sigmaz | (
hilbert: _AbstractHilbert, site: int, dtype: _DType = float
) | return _LocalOperator(hilbert, mat, [site], dtype=dtype) | Builds the :math:`\\sigma^z` operator acting on the `site`-th of the Hilbert
space `hilbert`.
If `hilbert` is a non-Spin space of local dimension M, it is considered
as a (M-1)/2 - spin space.
:param hilbert: The hilbert space
:param site: the site on which this operator acts
:return: a nk.ope... | Builds the :math:`\\sigma^z` operator acting on the `site`-th of the Hilbert
space `hilbert`. | [
"Builds",
"the",
":",
"math",
":",
"\\\\",
"sigma^z",
"operator",
"acting",
"on",
"the",
"site",
"-",
"th",
"of",
"the",
"Hilbert",
"space",
"hilbert",
"."
] | def sigmaz(
hilbert: _AbstractHilbert, site: int, dtype: _DType = float
) -> _LocalOperator:
"""
Builds the :math:`\\sigma^z` operator acting on the `site`-th of the Hilbert
space `hilbert`.
If `hilbert` is a non-Spin space of local dimension M, it is considered
as a (M-1)/2 - spin space.
... | [
"def",
"sigmaz",
"(",
"hilbert",
":",
"_AbstractHilbert",
",",
"site",
":",
"int",
",",
"dtype",
":",
"_DType",
"=",
"float",
")",
"->",
"_LocalOperator",
":",
"import",
"numpy",
"as",
"np",
"N",
"=",
"hilbert",
".",
"size_at_index",
"(",
"site",
")",
... | https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/operator/spin.py#L70-L91 | |
PixarAnimationStudios/USD | faed18ce62c8736b02413635b584a2f637156bad | pxr/base/tf/__init__.py | python | GetCodeLocation | (framesUp) | return (f_back.f_globals['__name__'], f_back.f_code.co_name,
f_back.f_code.co_filename, f_back.f_lineno) | Returns a tuple (moduleName, functionName, fileName, lineNo).
To trace the current location of python execution, use GetCodeLocation().
By default, the information is returned at the current stack-frame; thus
info = GetCodeLocation()
will return information about the line that GetCodeLocation() w... | Returns a tuple (moduleName, functionName, fileName, lineNo). | [
"Returns",
"a",
"tuple",
"(",
"moduleName",
"functionName",
"fileName",
"lineNo",
")",
"."
] | def GetCodeLocation(framesUp):
"""Returns a tuple (moduleName, functionName, fileName, lineNo).
To trace the current location of python execution, use GetCodeLocation().
By default, the information is returned at the current stack-frame; thus
info = GetCodeLocation()
will return information a... | [
"def",
"GetCodeLocation",
"(",
"framesUp",
")",
":",
"import",
"sys",
"f_back",
"=",
"sys",
".",
"_getframe",
"(",
"framesUp",
")",
".",
"f_back",
"return",
"(",
"f_back",
".",
"f_globals",
"[",
"'__name__'",
"]",
",",
"f_back",
".",
"f_code",
".",
"co_n... | https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/base/tf/__init__.py#L135-L161 | |
h0x91b/redis-v8 | ac8b9d49701d75bcee3719892a2a6a50b437e47a | redis/deps/v8/tools/stats-viewer.py | python | SharedDataAccess.CharAt | (self, index) | return self.data[index] | Return the ascii character at the specified byte index. | Return the ascii character at the specified byte index. | [
"Return",
"the",
"ascii",
"character",
"at",
"the",
"specified",
"byte",
"index",
"."
] | def CharAt(self, index):
"""Return the ascii character at the specified byte index."""
return self.data[index] | [
"def",
"CharAt",
"(",
"self",
",",
"index",
")",
":",
"return",
"self",
".",
"data",
"[",
"index",
"]"
] | https://github.com/h0x91b/redis-v8/blob/ac8b9d49701d75bcee3719892a2a6a50b437e47a/redis/deps/v8/tools/stats-viewer.py#L322-L324 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/share/gdb/python/gdb/command/explore.py | python | ExploreUtils.check_args | (name, arg_str) | Utility to check if adequate number of arguments are passed to an
explore command.
Arguments:
name: The name of the explore command.
arg_str: The argument string passed to the explore command.
Returns:
True if adequate arguments are passed, false otherwise.
... | Utility to check if adequate number of arguments are passed to an
explore command. | [
"Utility",
"to",
"check",
"if",
"adequate",
"number",
"of",
"arguments",
"are",
"passed",
"to",
"an",
"explore",
"command",
"."
] | def check_args(name, arg_str):
"""Utility to check if adequate number of arguments are passed to an
explore command.
Arguments:
name: The name of the explore command.
arg_str: The argument string passed to the explore command.
Returns:
True if adequa... | [
"def",
"check_args",
"(",
"name",
",",
"arg_str",
")",
":",
"if",
"len",
"(",
"arg_str",
")",
"<",
"1",
":",
"raise",
"gdb",
".",
"GdbError",
"(",
"\"ERROR: '%s' requires an argument.\"",
"%",
"name",
")",
"return",
"False",
"else",
":",
"return",
"True"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/share/gdb/python/gdb/command/explore.py#L587-L606 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/layers/python/layers/layers.py | python | flatten | (inputs,
outputs_collections=None,
scope=None) | Flattens the input while maintaining the batch_size.
Assumes that the first dimension represents the batch.
Args:
inputs: a tensor of size [batch_size, ...].
outputs_collections: collection to add the outputs.
scope: Optional scope for op_scope.
Returns:
a flattened tensor with shape [batch_s... | Flattens the input while maintaining the batch_size. | [
"Flattens",
"the",
"input",
"while",
"maintaining",
"the",
"batch_size",
"."
] | def flatten(inputs,
outputs_collections=None,
scope=None):
"""Flattens the input while maintaining the batch_size.
Assumes that the first dimension represents the batch.
Args:
inputs: a tensor of size [batch_size, ...].
outputs_collections: collection to add the outputs.
sc... | [
"def",
"flatten",
"(",
"inputs",
",",
"outputs_collections",
"=",
"None",
",",
"scope",
"=",
"None",
")",
":",
"with",
"ops",
".",
"op_scope",
"(",
"[",
"inputs",
"]",
",",
"scope",
",",
"'Flatten'",
")",
"as",
"sc",
":",
"inputs",
"=",
"ops",
".",
... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/layers/python/layers/layers.py#L696-L724 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/sax/xmlreader.py | python | InputSource.getCharacterStream | (self) | return self.__charfile | Get the character stream for this input source. | Get the character stream for this input source. | [
"Get",
"the",
"character",
"stream",
"for",
"this",
"input",
"source",
"."
] | def getCharacterStream(self):
"Get the character stream for this input source."
return self.__charfile | [
"def",
"getCharacterStream",
"(",
"self",
")",
":",
"return",
"self",
".",
"__charfile"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/sax/xmlreader.py#L272-L274 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/saved_model/signature_def_utils_impl.py | python | build_signature_def | (inputs=None, outputs=None, method_name=None) | return signature_def | Utility function to build a SignatureDef protocol buffer.
Args:
inputs: Inputs of the SignatureDef defined as a proto map of string to
tensor info.
outputs: Outputs of the SignatureDef defined as a proto map of string to
tensor info.
method_name: Method name of the SignatureDef as a strin... | Utility function to build a SignatureDef protocol buffer. | [
"Utility",
"function",
"to",
"build",
"a",
"SignatureDef",
"protocol",
"buffer",
"."
] | def build_signature_def(inputs=None, outputs=None, method_name=None):
"""Utility function to build a SignatureDef protocol buffer.
Args:
inputs: Inputs of the SignatureDef defined as a proto map of string to
tensor info.
outputs: Outputs of the SignatureDef defined as a proto map of string to
... | [
"def",
"build_signature_def",
"(",
"inputs",
"=",
"None",
",",
"outputs",
"=",
"None",
",",
"method_name",
"=",
"None",
")",
":",
"signature_def",
"=",
"meta_graph_pb2",
".",
"SignatureDef",
"(",
")",
"if",
"inputs",
"is",
"not",
"None",
":",
"for",
"item"... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/saved_model/signature_def_utils_impl.py#L26-L48 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/SystemEvents/Standard_Suite.py | python | Standard_Suite_Events.open | (self, _object=None, _attributes={}, **_arguments) | open: Open an object.
Required argument: list of objects
Keyword argument _attributes: AppleEvent attribute dictionary | open: Open an object.
Required argument: list of objects
Keyword argument _attributes: AppleEvent attribute dictionary | [
"open",
":",
"Open",
"an",
"object",
".",
"Required",
"argument",
":",
"list",
"of",
"objects",
"Keyword",
"argument",
"_attributes",
":",
"AppleEvent",
"attribute",
"dictionary"
] | def open(self, _object=None, _attributes={}, **_arguments):
"""open: Open an object.
Required argument: list of objects
Keyword argument _attributes: AppleEvent attribute dictionary
"""
_code = 'aevt'
_subcode = 'odoc'
if _arguments: raise TypeError, 'No optional... | [
"def",
"open",
"(",
"self",
",",
"_object",
"=",
"None",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'aevt'",
"_subcode",
"=",
"'odoc'",
"if",
"_arguments",
":",
"raise",
"TypeError",
",",
"'No optional args e... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/SystemEvents/Standard_Suite.py#L214-L232 | ||
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/ML/Composite/Composite.py | python | Composite._RemapInput | (self, inputVect) | return remappedInput | remaps the input so that it matches the expected internal ordering
**Arguments**
- inputVect: the input to be reordered
**Returns**
- a list with the reordered (and possible shorter) data
**Note**
- you must call _SetDescriptorNames()_ and _SetInputOrder()_ for this to wo... | remaps the input so that it matches the expected internal ordering | [
"remaps",
"the",
"input",
"so",
"that",
"it",
"matches",
"the",
"expected",
"internal",
"ordering"
] | def _RemapInput(self, inputVect):
""" remaps the input so that it matches the expected internal ordering
**Arguments**
- inputVect: the input to be reordered
**Returns**
- a list with the reordered (and possible shorter) data
**Note**
- you must call _SetDescriptorNam... | [
"def",
"_RemapInput",
"(",
"self",
",",
"inputVect",
")",
":",
"order",
"=",
"self",
".",
"_mapOrder",
"if",
"order",
"is",
"None",
":",
"return",
"inputVect",
"remappedInput",
"=",
"[",
"None",
"]",
"*",
"len",
"(",
"order",
")",
"for",
"i",
"in",
"... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/ML/Composite/Composite.py#L328-L358 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/cpplint.py | python | IsBlankLine | (line) | return not line or line.isspace() | Returns true if the given line is blank.
We consider a line to be blank if the line is empty or consists of
only white spaces.
Args:
line: A line of a string.
Returns:
True, if the given line is blank. | Returns true if the given line is blank. | [
"Returns",
"true",
"if",
"the",
"given",
"line",
"is",
"blank",
"."
] | def IsBlankLine(line):
"""Returns true if the given line is blank.
We consider a line to be blank if the line is empty or consists of
only white spaces.
Args:
line: A line of a string.
Returns:
True, if the given line is blank.
"""
return not line or line.isspace() | [
"def",
"IsBlankLine",
"(",
"line",
")",
":",
"return",
"not",
"line",
"or",
"line",
".",
"isspace",
"(",
")"
] | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/cpplint.py#L2818-L2830 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/aui.py | python | AuiPaneInfo.HasGripperTop | (*args, **kwargs) | return _aui.AuiPaneInfo_HasGripperTop(*args, **kwargs) | HasGripperTop(self) -> bool | HasGripperTop(self) -> bool | [
"HasGripperTop",
"(",
"self",
")",
"-",
">",
"bool"
] | def HasGripperTop(*args, **kwargs):
"""HasGripperTop(self) -> bool"""
return _aui.AuiPaneInfo_HasGripperTop(*args, **kwargs) | [
"def",
"HasGripperTop",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiPaneInfo_HasGripperTop",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/aui.py#L329-L331 | |
lammps/lammps | b75c3065430a75b1b5543a10e10f46d9b4c91913 | tools/i-pi/ipi/engine/forces.py | python | ForceBeads.f_gather | (self) | return newf | Obtains the force vector for each replica.
Returns:
An array with all the components of the force. Row i gives the force
array for replica i of the system. | Obtains the force vector for each replica. | [
"Obtains",
"the",
"force",
"vector",
"for",
"each",
"replica",
"."
] | def f_gather(self):
"""Obtains the force vector for each replica.
Returns:
An array with all the components of the force. Row i gives the force
array for replica i of the system.
"""
newf = np.zeros((self.nbeads,3*self.natoms),float)
self.queue()
for b in range(s... | [
"def",
"f_gather",
"(",
"self",
")",
":",
"newf",
"=",
"np",
".",
"zeros",
"(",
"(",
"self",
".",
"nbeads",
",",
"3",
"*",
"self",
".",
"natoms",
")",
",",
"float",
")",
"self",
".",
"queue",
"(",
")",
"for",
"b",
"in",
"range",
"(",
"self",
... | https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/engine/forces.py#L509-L523 | |
nsnam/ns-3-dev-git | efdb2e21f45c0a87a60b47c547b68fa140a7b686 | utils/grid.py | python | TimelineDataRange.get_all | (self) | return self.ranges | ! Get all ranges
@param self this object
@return the ranges | ! Get all ranges | [
"!",
"Get",
"all",
"ranges"
] | def get_all(self):
"""! Get all ranges
@param self this object
@return the ranges
"""
return self.ranges | [
"def",
"get_all",
"(",
"self",
")",
":",
"return",
"self",
".",
"ranges"
] | https://github.com/nsnam/ns-3-dev-git/blob/efdb2e21f45c0a87a60b47c547b68fa140a7b686/utils/grid.py#L125-L130 | |
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/rpmutils.py | python | defaultSystem | () | return rsystem | Return the canonicalized system name. | Return the canonicalized system name. | [
"Return",
"the",
"canonicalized",
"system",
"name",
"."
] | def defaultSystem():
""" Return the canonicalized system name. """
rsystem = platform.system()
# Try to lookup the string in the canon tables
if rsystem in os_canon:
rsystem = os_canon[rsystem][0]
return rsystem | [
"def",
"defaultSystem",
"(",
")",
":",
"rsystem",
"=",
"platform",
".",
"system",
"(",
")",
"# Try to lookup the string in the canon tables",
"if",
"rsystem",
"in",
"os_canon",
":",
"rsystem",
"=",
"os_canon",
"[",
"rsystem",
"]",
"[",
"0",
"]",
"return",
"rsy... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/rpmutils.py#L458-L466 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pkg_resources/__init__.py | python | Distribution.__getattr__ | (self, attr) | return getattr(self._provider, attr) | Delegate all unrecognized public attributes to .metadata provider | Delegate all unrecognized public attributes to .metadata provider | [
"Delegate",
"all",
"unrecognized",
"public",
"attributes",
"to",
".",
"metadata",
"provider"
] | def __getattr__(self, attr):
"""Delegate all unrecognized public attributes to .metadata provider"""
if attr.startswith('_'):
raise AttributeError(attr)
return getattr(self._provider, attr) | [
"def",
"__getattr__",
"(",
"self",
",",
"attr",
")",
":",
"if",
"attr",
".",
"startswith",
"(",
"'_'",
")",
":",
"raise",
"AttributeError",
"(",
"attr",
")",
"return",
"getattr",
"(",
"self",
".",
"_provider",
",",
"attr",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pkg_resources/__init__.py#L2822-L2826 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/tensor_array_ops.py | python | _TensorArrayCloseShape | (op) | return [] | Shape function for ops that take a scalar and produce no outputs. | Shape function for ops that take a scalar and produce no outputs. | [
"Shape",
"function",
"for",
"ops",
"that",
"take",
"a",
"scalar",
"and",
"produce",
"no",
"outputs",
"."
] | def _TensorArrayCloseShape(op):
"""Shape function for ops that take a scalar and produce no outputs."""
op.inputs[0].get_shape().merge_with(tensor_shape.vector(2))
return [] | [
"def",
"_TensorArrayCloseShape",
"(",
"op",
")",
":",
"op",
".",
"inputs",
"[",
"0",
"]",
".",
"get_shape",
"(",
")",
".",
"merge_with",
"(",
"tensor_shape",
".",
"vector",
"(",
"2",
")",
")",
"return",
"[",
"]"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/tensor_array_ops.py#L410-L413 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBBreakpoint.SetThreadID | (self, sb_thread_id) | return _lldb.SBBreakpoint_SetThreadID(self, sb_thread_id) | SetThreadID(SBBreakpoint self, lldb::tid_t sb_thread_id) | SetThreadID(SBBreakpoint self, lldb::tid_t sb_thread_id) | [
"SetThreadID",
"(",
"SBBreakpoint",
"self",
"lldb",
"::",
"tid_t",
"sb_thread_id",
")"
] | def SetThreadID(self, sb_thread_id):
"""SetThreadID(SBBreakpoint self, lldb::tid_t sb_thread_id)"""
return _lldb.SBBreakpoint_SetThreadID(self, sb_thread_id) | [
"def",
"SetThreadID",
"(",
"self",
",",
"sb_thread_id",
")",
":",
"return",
"_lldb",
".",
"SBBreakpoint_SetThreadID",
"(",
"self",
",",
"sb_thread_id",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L1636-L1638 | |
lightvector/KataGo | 20d34784703c5b4000643d3ccc43bb37d418f3b5 | python/sgfmill/boards.py | python | Board.play | (self, row, col, colour) | return simple_ko_point | Play a move on the board.
Raises IndexError if the coordinates are out of range.
Raises ValueError if the specified point isn't empty.
Performs any necessary captures. Allows self-captures. Doesn't enforce
any ko rule.
Returns the point forbidden by simple ko, or None | Play a move on the board. | [
"Play",
"a",
"move",
"on",
"the",
"board",
"."
] | def play(self, row, col, colour):
"""Play a move on the board.
Raises IndexError if the coordinates are out of range.
Raises ValueError if the specified point isn't empty.
Performs any necessary captures. Allows self-captures. Doesn't enforce
any ko rule.
Returns the ... | [
"def",
"play",
"(",
"self",
",",
"row",
",",
"col",
",",
"colour",
")",
":",
"if",
"row",
"<",
"0",
"or",
"col",
"<",
"0",
":",
"raise",
"IndexError",
"opponent",
"=",
"opponent_of",
"(",
"colour",
")",
"if",
"self",
".",
"board",
"[",
"row",
"]"... | https://github.com/lightvector/KataGo/blob/20d34784703c5b4000643d3ccc43bb37d418f3b5/python/sgfmill/boards.py#L147-L185 | |
xiaolonw/caffe-video_triplet | c39ea1ad6e937ccf7deba4510b7e555165abf05f | examples/web_demo/app.py | python | embed_image_html | (image) | return 'data:image/png;base64,' + data | Creates an image embedded in HTML base64 format. | Creates an image embedded in HTML base64 format. | [
"Creates",
"an",
"image",
"embedded",
"in",
"HTML",
"base64",
"format",
"."
] | def embed_image_html(image):
"""Creates an image embedded in HTML base64 format."""
image_pil = Image.fromarray((255 * image).astype('uint8'))
image_pil = image_pil.resize((256, 256))
string_buf = StringIO.StringIO()
image_pil.save(string_buf, format='png')
data = string_buf.getvalue().encode('b... | [
"def",
"embed_image_html",
"(",
"image",
")",
":",
"image_pil",
"=",
"Image",
".",
"fromarray",
"(",
"(",
"255",
"*",
"image",
")",
".",
"astype",
"(",
"'uint8'",
")",
")",
"image_pil",
"=",
"image_pil",
".",
"resize",
"(",
"(",
"256",
",",
"256",
")... | https://github.com/xiaolonw/caffe-video_triplet/blob/c39ea1ad6e937ccf7deba4510b7e555165abf05f/examples/web_demo/app.py#L82-L89 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/inspect.py | python | getcallargs | (*func_and_positional, **named) | return arg2value | Get the mapping of arguments to values.
A dict is returned, with keys the function argument names (including the
names of the * and ** arguments, if any), and values the respective bound
values from 'positional' and 'named'. | Get the mapping of arguments to values. | [
"Get",
"the",
"mapping",
"of",
"arguments",
"to",
"values",
"."
] | def getcallargs(*func_and_positional, **named):
"""Get the mapping of arguments to values.
A dict is returned, with keys the function argument names (including the
names of the * and ** arguments, if any), and values the respective bound
values from 'positional' and 'named'."""
func = func_and_posi... | [
"def",
"getcallargs",
"(",
"*",
"func_and_positional",
",",
"*",
"*",
"named",
")",
":",
"func",
"=",
"func_and_positional",
"[",
"0",
"]",
"positional",
"=",
"func_and_positional",
"[",
"1",
":",
"]",
"spec",
"=",
"getfullargspec",
"(",
"func",
")",
"args... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/inspect.py#L1325-L1385 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/numbers.py | python | _int_arith_flags | (rettype) | Return the modifier flags for integer arithmetic. | Return the modifier flags for integer arithmetic. | [
"Return",
"the",
"modifier",
"flags",
"for",
"integer",
"arithmetic",
"."
] | def _int_arith_flags(rettype):
"""
Return the modifier flags for integer arithmetic.
"""
if rettype.signed:
# Ignore the effects of signed overflow. This is important for
# optimization of some indexing operations. For example
# array[i+1] could see `i+1` trigger a signed overf... | [
"def",
"_int_arith_flags",
"(",
"rettype",
")",
":",
"if",
"rettype",
".",
"signed",
":",
"# Ignore the effects of signed overflow. This is important for",
"# optimization of some indexing operations. For example",
"# array[i+1] could see `i+1` trigger a signed overflow and",
"# give a... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/numbers.py#L22-L36 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | TimeSpan.Hours | (*args, **kwargs) | return _misc_.TimeSpan_Hours(*args, **kwargs) | Hours(long hours) -> TimeSpan | Hours(long hours) -> TimeSpan | [
"Hours",
"(",
"long",
"hours",
")",
"-",
">",
"TimeSpan"
] | def Hours(*args, **kwargs):
"""Hours(long hours) -> TimeSpan"""
return _misc_.TimeSpan_Hours(*args, **kwargs) | [
"def",
"Hours",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"TimeSpan_Hours",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L4379-L4381 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/image_ops_impl.py | python | adjust_jpeg_quality | (image, jpeg_quality, name=None) | Adjust jpeg encoding quality of an image.
This is a convenience method that converts an image to uint8 representation,
encodes it to jpeg with `jpeg_quality`, decodes it, and then converts back
to the original data type.
`jpeg_quality` must be in the interval `[0, 100]`.
Usage Example:
>>> x = [[[1.0, 2... | Adjust jpeg encoding quality of an image. | [
"Adjust",
"jpeg",
"encoding",
"quality",
"of",
"an",
"image",
"."
] | def adjust_jpeg_quality(image, jpeg_quality, name=None):
"""Adjust jpeg encoding quality of an image.
This is a convenience method that converts an image to uint8 representation,
encodes it to jpeg with `jpeg_quality`, decodes it, and then converts back
to the original data type.
`jpeg_quality` must be in t... | [
"def",
"adjust_jpeg_quality",
"(",
"image",
",",
"jpeg_quality",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"'adjust_jpeg_quality'",
",",
"[",
"image",
"]",
")",
":",
"image",
"=",
"ops",
".",
"convert_to_tensor... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/image_ops_impl.py#L2842-L2888 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/ctc_ops.py | python | ctc_beam_search_decoder | (inputs,
sequence_length,
beam_width=100,
top_paths=1,
merge_repeated=True) | return ([
sparse_tensor.SparseTensor(ix, val, shape)
for (ix, val, shape) in zip(decoded_ixs, decoded_vals, decoded_shapes)
], log_probabilities) | Performs beam search decoding on the logits given in input.
**Note** The `ctc_greedy_decoder` is a special case of the
`ctc_beam_search_decoder` with `top_paths=1` and `beam_width=1` (but
that decoder is faster for this special case).
If `merge_repeated` is `True`, merge repeated classes in the output beams.
... | Performs beam search decoding on the logits given in input. | [
"Performs",
"beam",
"search",
"decoding",
"on",
"the",
"logits",
"given",
"in",
"input",
"."
] | def ctc_beam_search_decoder(inputs,
sequence_length,
beam_width=100,
top_paths=1,
merge_repeated=True):
"""Performs beam search decoding on the logits given in input.
**Note** The `ctc_greedy_decoder` is... | [
"def",
"ctc_beam_search_decoder",
"(",
"inputs",
",",
"sequence_length",
",",
"beam_width",
"=",
"100",
",",
"top_paths",
"=",
"1",
",",
"merge_repeated",
"=",
"True",
")",
":",
"decoded_ixs",
",",
"decoded_vals",
",",
"decoded_shapes",
",",
"log_probabilities",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/ctc_ops.py#L381-L439 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/site.py | python | setBEGINLIBPATH | () | The OS/2 EMX port has optional extension modules that do double duty
as DLLs (and must use the .DLL file extension) for other extensions.
The library search path needs to be amended so these will be found
during module import. Use BEGINLIBPATH so that these are at the start
of the library search path. | The OS/2 EMX port has optional extension modules that do double duty
as DLLs (and must use the .DLL file extension) for other extensions.
The library search path needs to be amended so these will be found
during module import. Use BEGINLIBPATH so that these are at the start
of the library search path. | [
"The",
"OS",
"/",
"2",
"EMX",
"port",
"has",
"optional",
"extension",
"modules",
"that",
"do",
"double",
"duty",
"as",
"DLLs",
"(",
"and",
"must",
"use",
"the",
".",
"DLL",
"file",
"extension",
")",
"for",
"other",
"extensions",
".",
"The",
"library",
... | def setBEGINLIBPATH():
"""The OS/2 EMX port has optional extension modules that do double duty
as DLLs (and must use the .DLL file extension) for other extensions.
The library search path needs to be amended so these will be found
during module import. Use BEGINLIBPATH so that these are at the start
... | [
"def",
"setBEGINLIBPATH",
"(",
")",
":",
"dllpath",
"=",
"os",
".",
"path",
".",
"join",
"(",
"sys",
".",
"prefix",
",",
"\"Lib\"",
",",
"\"lib-dynload\"",
")",
"libpath",
"=",
"os",
".",
"environ",
"[",
"'BEGINLIBPATH'",
"]",
".",
"split",
"(",
"';'",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/site.py#L317-L331 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/operator.py | python | gt | (a, b) | return a > b | Same as a > b. | Same as a > b. | [
"Same",
"as",
"a",
">",
"b",
"."
] | def gt(a, b):
"Same as a > b."
return a > b | [
"def",
"gt",
"(",
"a",
",",
"b",
")",
":",
"return",
"a",
">",
"b"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/operator.py#L47-L49 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | Process.GetPid | (*args, **kwargs) | return _misc_.Process_GetPid(*args, **kwargs) | GetPid(self) -> long
get the process ID of the process executed by Open() | GetPid(self) -> long | [
"GetPid",
"(",
"self",
")",
"-",
">",
"long"
] | def GetPid(*args, **kwargs):
"""
GetPid(self) -> long
get the process ID of the process executed by Open()
"""
return _misc_.Process_GetPid(*args, **kwargs) | [
"def",
"GetPid",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"Process_GetPid",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L1990-L1996 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/tabbedpages.py | python | TabbedPageSet.change_page | (self, page_name) | Show the page whose name is given in page_name. | Show the page whose name is given in page_name. | [
"Show",
"the",
"page",
"whose",
"name",
"is",
"given",
"in",
"page_name",
"."
] | def change_page(self, page_name):
"""Show the page whose name is given in page_name."""
if self._current_page == page_name:
return
if page_name is not None and page_name not in self.pages:
raise KeyError("No such TabPage: '%s'" % page_name)
if self._current_page ... | [
"def",
"change_page",
"(",
"self",
",",
"page_name",
")",
":",
"if",
"self",
".",
"_current_page",
"==",
"page_name",
":",
"return",
"if",
"page_name",
"is",
"not",
"None",
"and",
"page_name",
"not",
"in",
"self",
".",
"pages",
":",
"raise",
"KeyError",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/tabbedpages.py#L453-L468 | ||
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/lib/type_check.py | python | imag | (val) | return asanyarray(val).imag | Return the imaginary part of the elements of the array.
Parameters
----------
val : array_like
Input array.
Returns
-------
out : ndarray
Output array. If `val` is real, the type of `val` is used for the
output. If `val` has complex elements, the returned type is float... | Return the imaginary part of the elements of the array. | [
"Return",
"the",
"imaginary",
"part",
"of",
"the",
"elements",
"of",
"the",
"array",
"."
] | def imag(val):
"""
Return the imaginary part of the elements of the array.
Parameters
----------
val : array_like
Input array.
Returns
-------
out : ndarray
Output array. If `val` is real, the type of `val` is used for the
output. If `val` has complex elements,... | [
"def",
"imag",
"(",
"val",
")",
":",
"return",
"asanyarray",
"(",
"val",
")",
".",
"imag"
] | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/lib/type_check.py#L139-L168 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | NativeFontInfo.GetFamily | (*args, **kwargs) | return _gdi_.NativeFontInfo_GetFamily(*args, **kwargs) | GetFamily(self) -> int | GetFamily(self) -> int | [
"GetFamily",
"(",
"self",
")",
"-",
">",
"int"
] | def GetFamily(*args, **kwargs):
"""GetFamily(self) -> int"""
return _gdi_.NativeFontInfo_GetFamily(*args, **kwargs) | [
"def",
"GetFamily",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"NativeFontInfo_GetFamily",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L1901-L1903 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/optimize/_lsq/common.py | python | CL_scaling_vector | (x, g, lb, ub) | return v, dv | Compute Coleman-Li scaling vector and its derivatives.
Components of a vector v are defined as follows:
::
| ub[i] - x[i], if g[i] < 0 and ub[i] < np.inf
v[i] = | x[i] - lb[i], if g[i] > 0 and lb[i] > -np.inf
| 1, otherwise
According to this definiti... | Compute Coleman-Li scaling vector and its derivatives.
Components of a vector v are defined as follows:
::
| ub[i] - x[i], if g[i] < 0 and ub[i] < np.inf
v[i] = | x[i] - lb[i], if g[i] > 0 and lb[i] > -np.inf
| 1, otherwise
According to this definiti... | [
"Compute",
"Coleman",
"-",
"Li",
"scaling",
"vector",
"and",
"its",
"derivatives",
".",
"Components",
"of",
"a",
"vector",
"v",
"are",
"defined",
"as",
"follows",
":",
"::",
"|",
"ub",
"[",
"i",
"]",
"-",
"x",
"[",
"i",
"]",
"if",
"g",
"[",
"i",
... | def CL_scaling_vector(x, g, lb, ub):
"""Compute Coleman-Li scaling vector and its derivatives.
Components of a vector v are defined as follows:
::
| ub[i] - x[i], if g[i] < 0 and ub[i] < np.inf
v[i] = | x[i] - lb[i], if g[i] > 0 and lb[i] > -np.inf
| 1, o... | [
"def",
"CL_scaling_vector",
"(",
"x",
",",
"g",
",",
"lb",
",",
"ub",
")",
":",
"v",
"=",
"np",
".",
"ones_like",
"(",
"x",
")",
"dv",
"=",
"np",
".",
"zeros_like",
"(",
"x",
")",
"mask",
"=",
"(",
"g",
"<",
"0",
")",
"&",
"np",
".",
"isfin... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/optimize/_lsq/common.py#L468-L509 | |
Illumina/strelka | d7377443b62319f7c7bd70c241c4b2df3459e29a | src/python/lib/strelkaSharedOptions.py | python | StrelkaSharedWorkflowOptionsBase.getOptionDefaults | (self) | return cleanLocals(locals()) | Set option defaults.
Every local variable in this method becomes part of the default hash | Set option defaults. | [
"Set",
"option",
"defaults",
"."
] | def getOptionDefaults(self) :
"""
Set option defaults.
Every local variable in this method becomes part of the default hash
"""
configCommandLine=sys.argv
libexecDir=os.path.abspath(os.path.join(scriptDir,"@THIS_RELATIVE_LIBEXECDIR@"))
assert os.path.isdir(libe... | [
"def",
"getOptionDefaults",
"(",
"self",
")",
":",
"configCommandLine",
"=",
"sys",
".",
"argv",
"libexecDir",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"os",
".",
"path",
".",
"join",
"(",
"scriptDir",
",",
"\"@THIS_RELATIVE_LIBEXECDIR@\"",
")",
")",
"... | https://github.com/Illumina/strelka/blob/d7377443b62319f7c7bd70c241c4b2df3459e29a/src/python/lib/strelkaSharedOptions.py#L115-L188 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.MarkerDeleteHandle | (*args, **kwargs) | return _stc.StyledTextCtrl_MarkerDeleteHandle(*args, **kwargs) | MarkerDeleteHandle(self, int handle)
Delete a marker. | MarkerDeleteHandle(self, int handle) | [
"MarkerDeleteHandle",
"(",
"self",
"int",
"handle",
")"
] | def MarkerDeleteHandle(*args, **kwargs):
"""
MarkerDeleteHandle(self, int handle)
Delete a marker.
"""
return _stc.StyledTextCtrl_MarkerDeleteHandle(*args, **kwargs) | [
"def",
"MarkerDeleteHandle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_MarkerDeleteHandle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L2153-L2159 | |
TGAC/KAT | e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216 | deps/boost/tools/build/src/util/utility.py | python | to_seq | (value) | If value is a sequence, returns it.
If it is a string, returns a sequence with value as its sole element. | If value is a sequence, returns it.
If it is a string, returns a sequence with value as its sole element. | [
"If",
"value",
"is",
"a",
"sequence",
"returns",
"it",
".",
"If",
"it",
"is",
"a",
"string",
"returns",
"a",
"sequence",
"with",
"value",
"as",
"its",
"sole",
"element",
"."
] | def to_seq (value):
""" If value is a sequence, returns it.
If it is a string, returns a sequence with value as its sole element.
"""
if not value:
return []
if isinstance (value, str):
return [value]
else:
return value | [
"def",
"to_seq",
"(",
"value",
")",
":",
"if",
"not",
"value",
":",
"return",
"[",
"]",
"if",
"isinstance",
"(",
"value",
",",
"str",
")",
":",
"return",
"[",
"value",
"]",
"else",
":",
"return",
"value"
] | https://github.com/TGAC/KAT/blob/e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216/deps/boost/tools/build/src/util/utility.py#L20-L31 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/toolkits/regression/random_forest_regression.py | python | RandomForestRegression.predict | (self, dataset, missing_value_action="auto") | return super(RandomForestRegression, self).predict(
dataset, output_type="margin", missing_value_action=missing_value_action
) | Predict the target column of the given dataset.
The target column is provided during
:func:`~turicreate.random_forest_regression.create`. If the target column is in the
`dataset` it will be ignored.
Parameters
----------
dataset : SFrame
A dataset that has the... | Predict the target column of the given dataset. | [
"Predict",
"the",
"target",
"column",
"of",
"the",
"given",
"dataset",
"."
] | def predict(self, dataset, missing_value_action="auto"):
"""
Predict the target column of the given dataset.
The target column is provided during
:func:`~turicreate.random_forest_regression.create`. If the target column is in the
`dataset` it will be ignored.
Parameters... | [
"def",
"predict",
"(",
"self",
",",
"dataset",
",",
"missing_value_action",
"=",
"\"auto\"",
")",
":",
"return",
"super",
"(",
"RandomForestRegression",
",",
"self",
")",
".",
"predict",
"(",
"dataset",
",",
"output_type",
"=",
"\"margin\"",
",",
"missing_valu... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/regression/random_forest_regression.py#L247-L289 | |
PX4/PX4-Autopilot | 0b9f60a0370be53d683352c63fd92db3d6586e18 | platforms/nuttx/NuttX/tools/kconfiglib.py | python | Symbol.__str__ | (self) | return self.custom_str(standard_sc_expr_str) | Returns a string representation of the symbol when it is printed,
matching the Kconfig format, with parent dependencies propagated.
The string is constructed by joining the strings returned by
MenuNode.__str__() for each of the symbol's menu nodes, so symbols
defined in multiple locatio... | Returns a string representation of the symbol when it is printed,
matching the Kconfig format, with parent dependencies propagated. | [
"Returns",
"a",
"string",
"representation",
"of",
"the",
"symbol",
"when",
"it",
"is",
"printed",
"matching",
"the",
"Kconfig",
"format",
"with",
"parent",
"dependencies",
"propagated",
"."
] | def __str__(self):
"""
Returns a string representation of the symbol when it is printed,
matching the Kconfig format, with parent dependencies propagated.
The string is constructed by joining the strings returned by
MenuNode.__str__() for each of the symbol's menu nodes, so symb... | [
"def",
"__str__",
"(",
"self",
")",
":",
"return",
"self",
".",
"custom_str",
"(",
"standard_sc_expr_str",
")"
] | https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/platforms/nuttx/NuttX/tools/kconfiglib.py#L4358-L4371 | |
anestisb/oatdump_plus | ba858c1596598f0d9ae79c14d08c708cecc50af3 | tools/cpplint.py | python | CleansedLines._CollapseStrings | (elided) | return elided | Collapses strings and chars on a line to simple "" or '' blocks.
We nix strings first so we're not fooled by text like '"http://"'
Args:
elided: The line being processed.
Returns:
The line with collapsed strings. | Collapses strings and chars on a line to simple "" or '' blocks. | [
"Collapses",
"strings",
"and",
"chars",
"on",
"a",
"line",
"to",
"simple",
"or",
"blocks",
"."
] | def _CollapseStrings(elided):
"""Collapses strings and chars on a line to simple "" or '' blocks.
We nix strings first so we're not fooled by text like '"http://"'
Args:
elided: The line being processed.
Returns:
The line with collapsed strings.
"""
if not _RE_PATTERN_INCLUDE.matc... | [
"def",
"_CollapseStrings",
"(",
"elided",
")",
":",
"if",
"not",
"_RE_PATTERN_INCLUDE",
".",
"match",
"(",
"elided",
")",
":",
"# Remove escaped characters first to make quote/single quote collapsing",
"# basic. Things that look like escaped characters shouldn't occur",
"# outside... | https://github.com/anestisb/oatdump_plus/blob/ba858c1596598f0d9ae79c14d08c708cecc50af3/tools/cpplint.py#L1043-L1061 | |
htcondor/htcondor | 4829724575176d1d6c936e4693dfd78a728569b0 | src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/conversion.py | python | IConversion.VoicemailStatusToText | (self, Status) | return self._ToText('vms', Status) | Returns voicemail status as text.
@param Status: Voicemail status.
@type Status: L{Voicemail status<enums.vmsUnknown>}
@return: Text describing the voicemail status.
@rtype: unicode | Returns voicemail status as text. | [
"Returns",
"voicemail",
"status",
"as",
"text",
"."
] | def VoicemailStatusToText(self, Status):
'''Returns voicemail status as text.
@param Status: Voicemail status.
@type Status: L{Voicemail status<enums.vmsUnknown>}
@return: Text describing the voicemail status.
@rtype: unicode
'''
return self._ToText('vms', Status... | [
"def",
"VoicemailStatusToText",
"(",
"self",
",",
"Status",
")",
":",
"return",
"self",
".",
"_ToText",
"(",
"'vms'",
",",
"Status",
")"
] | https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/conversion.py#L407-L415 | |
swift/swift | 12d031cf8177fdec0137f9aa7e2912fa23c4416b | 3rdParty/SCons/scons-3.0.1/engine/SCons/EnvironmentValues.py | python | EnvironmentValue.parse_trial | (self) | Try alternate parsing methods.
:return: | Try alternate parsing methods.
:return: | [
"Try",
"alternate",
"parsing",
"methods",
".",
":",
"return",
":"
] | def parse_trial(self):
"""
Try alternate parsing methods.
:return:
"""
parts = []
for c in self.value:
pass | [
"def",
"parse_trial",
"(",
"self",
")",
":",
"parts",
"=",
"[",
"]",
"for",
"c",
"in",
"self",
".",
"value",
":",
"pass"
] | https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/EnvironmentValues.py#L80-L87 | ||
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_stand_gym_env.py | python | MinitaurStandGymEnv._policy_flip | (self, time_step, orientation) | return joint_values | Hand coded policy to make the minitaur stand up to its two legs.
This method is the hand coded policy that uses sine waves and orientation
of the robot to make it stand up to its two legs. It is composed of these
behaviors:
- Rotate bottom legs to always point to the ground
- Rotate upper legs the ... | Hand coded policy to make the minitaur stand up to its two legs. | [
"Hand",
"coded",
"policy",
"to",
"make",
"the",
"minitaur",
"stand",
"up",
"to",
"its",
"two",
"legs",
"."
] | def _policy_flip(self, time_step, orientation):
"""Hand coded policy to make the minitaur stand up to its two legs.
This method is the hand coded policy that uses sine waves and orientation
of the robot to make it stand up to its two legs. It is composed of these
behaviors:
- Rotate bottom legs to ... | [
"def",
"_policy_flip",
"(",
"self",
",",
"time_step",
",",
"orientation",
")",
":",
"# Set the default behavior (stand on 4 short legs).",
"shorten",
"=",
"-",
"0.7",
"a0",
"=",
"math",
".",
"pi",
"/",
"2",
"+",
"shorten",
"a1",
"=",
"math",
".",
"pi",
"/",
... | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_stand_gym_env.py#L172-L237 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/seq2seq/python/ops/attention_wrapper.py | python | hardmax | (logits, name=None) | Returns batched one-hot vectors.
The depth index containing the `1` is that of the maximum logit value.
Args:
logits: A batch tensor of logit values.
name: Name to use when creating ops.
Returns:
A batched one-hot tensor. | Returns batched one-hot vectors. | [
"Returns",
"batched",
"one",
"-",
"hot",
"vectors",
"."
] | def hardmax(logits, name=None):
"""Returns batched one-hot vectors.
The depth index containing the `1` is that of the maximum logit value.
Args:
logits: A batch tensor of logit values.
name: Name to use when creating ops.
Returns:
A batched one-hot tensor.
"""
with ops.name_scope(name, "Hardma... | [
"def",
"hardmax",
"(",
"logits",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"Hardmax\"",
",",
"[",
"logits",
"]",
")",
":",
"logits",
"=",
"ops",
".",
"convert_to_tensor",
"(",
"logits",
",",
"name",
"="... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/seq2seq/python/ops/attention_wrapper.py#L948-L966 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/auibook.py | python | AuiNotebook.InitNotebook | (self, agwStyle) | Contains common initialization code called by all constructors.
:param integer `agwStyle`: the notebook style.
:see: :meth:`~AuiNotebook.__init__` for a list of available `agwStyle` bits. | Contains common initialization code called by all constructors. | [
"Contains",
"common",
"initialization",
"code",
"called",
"by",
"all",
"constructors",
"."
] | def InitNotebook(self, agwStyle):
"""
Contains common initialization code called by all constructors.
:param integer `agwStyle`: the notebook style.
:see: :meth:`~AuiNotebook.__init__` for a list of available `agwStyle` bits.
"""
self._agwFlags = agwStyle
self... | [
"def",
"InitNotebook",
"(",
"self",
",",
"agwStyle",
")",
":",
"self",
".",
"_agwFlags",
"=",
"agwStyle",
"self",
".",
"_popupWin",
"=",
"None",
"self",
".",
"_imageList",
"=",
"None",
"self",
".",
"_navProps",
"=",
"TabNavigatorProps",
"(",
")",
"self",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibook.py#L2835-L2895 | ||
facebook/ThreatExchange | 31914a51820c73c8a0daffe62ccca29a6e3d359e | api-reference-examples/python/pytx/pytx/common.py | python | Common.save | (self,
params=None,
request_dict=False,
retries=None,
headers=None,
proxies=None,
verify=None) | return Broker.post(self._DETAILS,
params=params,
retries=retries,
headers=headers,
proxies=proxies,
verify=verify) | Submit changes to the graph to update an object. We will determine the
Details URL and submit there (used for updating an existing object). If
no parameters are provided, we will try to use get_changed() which may
or may not be accurate (you have been warned!).
:param params: The parame... | Submit changes to the graph to update an object. We will determine the
Details URL and submit there (used for updating an existing object). If
no parameters are provided, we will try to use get_changed() which may
or may not be accurate (you have been warned!). | [
"Submit",
"changes",
"to",
"the",
"graph",
"to",
"update",
"an",
"object",
".",
"We",
"will",
"determine",
"the",
"Details",
"URL",
"and",
"submit",
"there",
"(",
"used",
"for",
"updating",
"an",
"existing",
"object",
")",
".",
"If",
"no",
"parameters",
... | def save(self,
params=None,
request_dict=False,
retries=None,
headers=None,
proxies=None,
verify=None):
"""
Submit changes to the graph to update an object. We will determine the
Details URL and submit there (used for ... | [
"def",
"save",
"(",
"self",
",",
"params",
"=",
"None",
",",
"request_dict",
"=",
"False",
",",
"retries",
"=",
"None",
",",
"headers",
"=",
"None",
",",
"proxies",
"=",
"None",
",",
"verify",
"=",
"None",
")",
":",
"if",
"params",
"is",
"None",
":... | https://github.com/facebook/ThreatExchange/blob/31914a51820c73c8a0daffe62ccca29a6e3d359e/api-reference-examples/python/pytx/pytx/common.py#L553-L592 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/model/trajectory.py | python | Trajectory.deriv | (self, t: float, endBehavior: str = 'halt') | return self.deriv_state(t,endBehavior) | Evaluates the trajectory velocity using piecewise linear
interpolation.
Args:
t (float): The time at which to evaluate the segment
endBehavior (str): If 'loop' then the trajectory loops forever.
Returns:
The velocity (derivative) at time t | Evaluates the trajectory velocity using piecewise linear
interpolation. | [
"Evaluates",
"the",
"trajectory",
"velocity",
"using",
"piecewise",
"linear",
"interpolation",
"."
] | def deriv(self, t: float, endBehavior: str = 'halt') -> Vector:
"""Evaluates the trajectory velocity using piecewise linear
interpolation.
Args:
t (float): The time at which to evaluate the segment
endBehavior (str): If 'loop' then the trajectory loops forever.
... | [
"def",
"deriv",
"(",
"self",
",",
"t",
":",
"float",
",",
"endBehavior",
":",
"str",
"=",
"'halt'",
")",
"->",
"Vector",
":",
"return",
"self",
".",
"deriv_state",
"(",
"t",
",",
"endBehavior",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/model/trajectory.py#L173-L184 | |
giuspen/cherrytree | 84712f206478fcf9acf30174009ad28c648c6344 | pygtk2/modules/core.py | python | CherryTree.nodes_add_from_gnote_folder | (self, action) | Add Nodes Parsing a Gnote Folder | Add Nodes Parsing a Gnote Folder | [
"Add",
"Nodes",
"Parsing",
"a",
"Gnote",
"Folder"
] | def nodes_add_from_gnote_folder(self, action):
"""Add Nodes Parsing a Gnote Folder"""
start_folder = os.path.join(os.path.expanduser('~'), ".local", "share", "gnote")
folderpath = support.dialog_folder_select(curr_folder=start_folder, parent=self.window)
if not folderpath: return
... | [
"def",
"nodes_add_from_gnote_folder",
"(",
"self",
",",
"action",
")",
":",
"start_folder",
"=",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"path",
".",
"expanduser",
"(",
"'~'",
")",
",",
"\".local\"",
",",
"\"share\"",
",",
"\"gnote\"",
")",
"fold... | https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/core.py#L940-L948 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/feature_column/feature_column.py | python | categorical_column_with_vocabulary_file | (
key, vocabulary_file, vocabulary_size, num_oov_buckets=0,
default_value=None, dtype=dtypes.string) | return _VocabularyFileCategoricalColumn(
key=key,
vocabulary_file=vocabulary_file,
vocabulary_size=vocabulary_size,
num_oov_buckets=0 if num_oov_buckets is None else num_oov_buckets,
default_value=-1 if default_value is None else default_value,
dtype=dtype) | A `_CategoricalColumn` with a vocabulary file.
Use this when your inputs are in string or integer format, and you have a
vocabulary file that maps each value to an integer ID. By default,
out-of-vocabulary values are ignored. Use either (but not both) of
`num_oov_buckets` and `default_value` to specify how to ... | A `_CategoricalColumn` with a vocabulary file. | [
"A",
"_CategoricalColumn",
"with",
"a",
"vocabulary",
"file",
"."
] | def categorical_column_with_vocabulary_file(
key, vocabulary_file, vocabulary_size, num_oov_buckets=0,
default_value=None, dtype=dtypes.string):
"""A `_CategoricalColumn` with a vocabulary file.
Use this when your inputs are in string or integer format, and you have a
vocabulary file that maps each value... | [
"def",
"categorical_column_with_vocabulary_file",
"(",
"key",
",",
"vocabulary_file",
",",
"vocabulary_size",
",",
"num_oov_buckets",
"=",
"0",
",",
"default_value",
"=",
"None",
",",
"dtype",
"=",
"dtypes",
".",
"string",
")",
":",
"if",
"not",
"vocabulary_file",... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/feature_column/feature_column.py#L737-L839 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/debug/lib/debug_events_monitors.py | python | BaseMonitor.on_graph_execution_trace | (self,
graph_execution_trace_index,
graph_execution_trace) | Monitor method for intra-graph execution events.
Return values (if any) are ignored by the associated DebugDataReader.
Args:
graph_execution_trace_index: The index of the intra-graph execution
event, as an int.
graph_execution_trace: A GraphExecutionTrace data object, for an
intra-... | Monitor method for intra-graph execution events. | [
"Monitor",
"method",
"for",
"intra",
"-",
"graph",
"execution",
"events",
"."
] | def on_graph_execution_trace(self,
graph_execution_trace_index,
graph_execution_trace):
"""Monitor method for intra-graph execution events.
Return values (if any) are ignored by the associated DebugDataReader.
Args:
graph_execution_trace_... | [
"def",
"on_graph_execution_trace",
"(",
"self",
",",
"graph_execution_trace_index",
",",
"graph_execution_trace",
")",
":"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/debug/lib/debug_events_monitors.py#L63-L75 | ||
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | doc/examples/dev/multi/gravimetry.py | python | Gravimetry.__init__ | (self, verbose=False) | Default constructor. | Default constructor. | [
"Default",
"constructor",
"."
] | def __init__(self, verbose=False):
"""Default constructor."""
self.fop = self.createFOP(verbose)
self.tD = None
self.tM = None
self.inv = self.createInv(verbose) | [
"def",
"__init__",
"(",
"self",
",",
"verbose",
"=",
"False",
")",
":",
"self",
".",
"fop",
"=",
"self",
".",
"createFOP",
"(",
"verbose",
")",
"self",
".",
"tD",
"=",
"None",
"self",
".",
"tM",
"=",
"None",
"self",
".",
"inv",
"=",
"self",
".",
... | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/doc/examples/dev/multi/gravimetry.py#L31-L36 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/optparse.py | python | OptionContainer.add_option | (self, *args, **kwargs) | return option | add_option(Option)
add_option(opt_str, ..., kwarg=val, ...) | add_option(Option)
add_option(opt_str, ..., kwarg=val, ...) | [
"add_option",
"(",
"Option",
")",
"add_option",
"(",
"opt_str",
"...",
"kwarg",
"=",
"val",
"...",
")"
] | def add_option(self, *args, **kwargs):
"""add_option(Option)
add_option(opt_str, ..., kwarg=val, ...)
"""
if isinstance(args[0], str):
option = self.option_class(*args, **kwargs)
elif len(args) == 1 and not kwargs:
option = args[0]
if not is... | [
"def",
"add_option",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"isinstance",
"(",
"args",
"[",
"0",
"]",
",",
"str",
")",
":",
"option",
"=",
"self",
".",
"option_class",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/optparse.py#L995-L1023 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/logging/__init__.py | python | _showwarning | (message, category, filename, lineno, file=None, line=None) | Implementation of showwarnings which redirects to logging, which will first
check to see if the file parameter is None. If a file is specified, it will
delegate to the original warnings implementation of showwarning. Otherwise,
it will call warnings.formatwarning and will log the resulting string to a
w... | Implementation of showwarnings which redirects to logging, which will first
check to see if the file parameter is None. If a file is specified, it will
delegate to the original warnings implementation of showwarning. Otherwise,
it will call warnings.formatwarning and will log the resulting string to a
w... | [
"Implementation",
"of",
"showwarnings",
"which",
"redirects",
"to",
"logging",
"which",
"will",
"first",
"check",
"to",
"see",
"if",
"the",
"file",
"parameter",
"is",
"None",
".",
"If",
"a",
"file",
"is",
"specified",
"it",
"will",
"delegate",
"to",
"the",
... | def _showwarning(message, category, filename, lineno, file=None, line=None):
"""
Implementation of showwarnings which redirects to logging, which will first
check to see if the file parameter is None. If a file is specified, it will
delegate to the original warnings implementation of showwarning. Otherw... | [
"def",
"_showwarning",
"(",
"message",
",",
"category",
",",
"filename",
",",
"lineno",
",",
"file",
"=",
"None",
",",
"line",
"=",
"None",
")",
":",
"if",
"file",
"is",
"not",
"None",
":",
"if",
"_warnings_showwarning",
"is",
"not",
"None",
":",
"_war... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/logging/__init__.py#L2188-L2204 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/stc.py | python | StyledTextCtrl.GetFoldLevel | (*args, **kwargs) | return _stc.StyledTextCtrl_GetFoldLevel(*args, **kwargs) | GetFoldLevel(self, int line) -> int
Retrieve the fold level of a line. | GetFoldLevel(self, int line) -> int | [
"GetFoldLevel",
"(",
"self",
"int",
"line",
")",
"-",
">",
"int"
] | def GetFoldLevel(*args, **kwargs):
"""
GetFoldLevel(self, int line) -> int
Retrieve the fold level of a line.
"""
return _stc.StyledTextCtrl_GetFoldLevel(*args, **kwargs) | [
"def",
"GetFoldLevel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_GetFoldLevel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L3906-L3912 | |
xenia-project/xenia | 9b1fdac98665ac091b9660a5d0fbb259ed79e578 | third_party/google-styleguide/cpplint/cpplint.py | python | IsInitializerList | (clean_lines, linenum) | return False | Check if current line is inside constructor initializer list.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if current line appears to be inside constructor initializer
list, False otherwise. | Check if current line is inside constructor initializer list. | [
"Check",
"if",
"current",
"line",
"is",
"inside",
"constructor",
"initializer",
"list",
"."
] | def IsInitializerList(clean_lines, linenum):
"""Check if current line is inside constructor initializer list.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if current line appears to be inside constructor initializer
list,... | [
"def",
"IsInitializerList",
"(",
"clean_lines",
",",
"linenum",
")",
":",
"for",
"i",
"in",
"xrange",
"(",
"linenum",
",",
"1",
",",
"-",
"1",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"i",
"]",
"if",
"i",
"==",
"linenum",
":",
"rem... | https://github.com/xenia-project/xenia/blob/9b1fdac98665ac091b9660a5d0fbb259ed79e578/third_party/google-styleguide/cpplint/cpplint.py#L4621-L4660 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/rnn/python/ops/fused_rnn_cell.py | python | FusedRNNCellAdaptor.__init__ | (self, cell, use_dynamic_rnn=False) | Initialize the adaptor.
Args:
cell: an instance of a subclass of a `rnn_cell.RNNCell`.
use_dynamic_rnn: whether to use dynamic (or static) RNN. | Initialize the adaptor. | [
"Initialize",
"the",
"adaptor",
"."
] | def __init__(self, cell, use_dynamic_rnn=False):
"""Initialize the adaptor.
Args:
cell: an instance of a subclass of a `rnn_cell.RNNCell`.
use_dynamic_rnn: whether to use dynamic (or static) RNN.
"""
self._cell = cell
self._use_dynamic_rnn = use_dynamic_rnn | [
"def",
"__init__",
"(",
"self",
",",
"cell",
",",
"use_dynamic_rnn",
"=",
"False",
")",
":",
"self",
".",
"_cell",
"=",
"cell",
"self",
".",
"_use_dynamic_rnn",
"=",
"use_dynamic_rnn"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/rnn/python/ops/fused_rnn_cell.py#L84-L92 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/lookup/lookup_ops.py | python | MutableDenseHashTable.size | (self, name=None) | Compute the number of elements in this table.
Args:
name: A name for the operation (optional).
Returns:
A scalar tensor containing the number of elements in this table. | Compute the number of elements in this table. | [
"Compute",
"the",
"number",
"of",
"elements",
"in",
"this",
"table",
"."
] | def size(self, name=None):
"""Compute the number of elements in this table.
Args:
name: A name for the operation (optional).
Returns:
A scalar tensor containing the number of elements in this table.
"""
with ops.name_scope(name, "%s_Size" % self._name,
[self._ta... | [
"def",
"size",
"(",
"self",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"%s_Size\"",
"%",
"self",
".",
"_name",
",",
"[",
"self",
".",
"_table_ref",
"]",
")",
"as",
"name",
":",
"with",
"ops",
".",
"c... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/lookup/lookup_ops.py#L571-L584 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | Window.GetCharHeight | (*args, **kwargs) | return _core_.Window_GetCharHeight(*args, **kwargs) | GetCharHeight(self) -> int
Get the (average) character size for the current font. | GetCharHeight(self) -> int | [
"GetCharHeight",
"(",
"self",
")",
"-",
">",
"int"
] | def GetCharHeight(*args, **kwargs):
"""
GetCharHeight(self) -> int
Get the (average) character size for the current font.
"""
return _core_.Window_GetCharHeight(*args, **kwargs) | [
"def",
"GetCharHeight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_GetCharHeight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L11014-L11020 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/polynomial/hermite.py | python | _normed_hermite_n | (x, n) | return c0 + c1*x*np.sqrt(2) | Evaluate a normalized Hermite polynomial.
Compute the value of the normalized Hermite polynomial of degree ``n``
at the points ``x``.
Parameters
----------
x : ndarray of double.
Points at which to evaluate the function
n : int
Degree of the normalized Hermite function to be e... | Evaluate a normalized Hermite polynomial. | [
"Evaluate",
"a",
"normalized",
"Hermite",
"polynomial",
"."
] | def _normed_hermite_n(x, n):
"""
Evaluate a normalized Hermite polynomial.
Compute the value of the normalized Hermite polynomial of degree ``n``
at the points ``x``.
Parameters
----------
x : ndarray of double.
Points at which to evaluate the function
n : int
Degree o... | [
"def",
"_normed_hermite_n",
"(",
"x",
",",
"n",
")",
":",
"if",
"n",
"==",
"0",
":",
"return",
"np",
".",
"full",
"(",
"x",
".",
"shape",
",",
"1",
"/",
"np",
".",
"sqrt",
"(",
"np",
".",
"sqrt",
"(",
"np",
".",
"pi",
")",
")",
")",
"c0",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/polynomial/hermite.py#L1515-L1555 | |
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | mlir/python/mlir/dialects/_ods_common.py | python | get_default_loc_context | (location=None) | return location.context | Returns a context in which the defaulted location is created. If the location
is None, takes the current location from the stack, raises ValueError if there
is no location on the stack. | Returns a context in which the defaulted location is created. If the location
is None, takes the current location from the stack, raises ValueError if there
is no location on the stack. | [
"Returns",
"a",
"context",
"in",
"which",
"the",
"defaulted",
"location",
"is",
"created",
".",
"If",
"the",
"location",
"is",
"None",
"takes",
"the",
"current",
"location",
"from",
"the",
"stack",
"raises",
"ValueError",
"if",
"there",
"is",
"no",
"location... | def get_default_loc_context(location=None):
"""
Returns a context in which the defaulted location is created. If the location
is None, takes the current location from the stack, raises ValueError if there
is no location on the stack.
"""
if location is None:
# Location.current raises ValueError if there... | [
"def",
"get_default_loc_context",
"(",
"location",
"=",
"None",
")",
":",
"if",
"location",
"is",
"None",
":",
"# Location.current raises ValueError if there is no current location.",
"return",
"_cext",
".",
"ir",
".",
"Location",
".",
"current",
".",
"context",
"retu... | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/mlir/python/mlir/dialects/_ods_common.py#L114-L123 | |
lilypond/lilypond | 2a14759372979f5b796ee802b0ee3bc15d28b06b | release/binaries/lib/lilypond.py | python | LilyPondPackager.package_tar | (self) | Create a .tar.gz archive of the LilyPond binaries. | Create a .tar.gz archive of the LilyPond binaries. | [
"Create",
"a",
".",
"tar",
".",
"gz",
"archive",
"of",
"the",
"LilyPond",
"binaries",
"."
] | def package_tar(self):
"""Create a .tar.gz archive of the LilyPond binaries."""
self.prepare_package()
# Put the entire tree into a .tar.gz archive.
platform = self.c.platform.value
architecture = self.c.architecture
archive = f"{self.lilypond.directory}-{platform}-{arch... | [
"def",
"package_tar",
"(",
"self",
")",
":",
"self",
".",
"prepare_package",
"(",
")",
"# Put the entire tree into a .tar.gz archive.",
"platform",
"=",
"self",
".",
"c",
".",
"platform",
".",
"value",
"architecture",
"=",
"self",
".",
"c",
".",
"architecture",
... | https://github.com/lilypond/lilypond/blob/2a14759372979f5b796ee802b0ee3bc15d28b06b/release/binaries/lib/lilypond.py#L447-L472 | ||
apache/qpid-proton | 6bcdfebb55ea3554bc29b1901422532db331a591 | python/proton/_data.py | python | Data.exit | (self) | return pn_data_exit(self._data) | Sets the current node to the parent node and the parent node to
its own parent.
:return: ``True`` iff the pointers to the current/parent nodes are changed,
``False`` otherwise. | Sets the current node to the parent node and the parent node to
its own parent. | [
"Sets",
"the",
"current",
"node",
"to",
"the",
"parent",
"node",
"and",
"the",
"parent",
"node",
"to",
"its",
"own",
"parent",
"."
] | def exit(self) -> bool:
"""
Sets the current node to the parent node and the parent node to
its own parent.
:return: ``True`` iff the pointers to the current/parent nodes are changed,
``False`` otherwise.
"""
return pn_data_exit(self._data) | [
"def",
"exit",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"pn_data_exit",
"(",
"self",
".",
"_data",
")"
] | https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_data.py#L746-L754 | |
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/ML/Neural/Network.py | python | Network.ConstructRandomWeights | (self, minWeight=-1, maxWeight=1) | initialize all the weights in the network to random numbers
**Arguments**
- minWeight: the minimum value a weight can take
- maxWeight: the maximum value a weight can take | initialize all the weights in the network to random numbers | [
"initialize",
"all",
"the",
"weights",
"in",
"the",
"network",
"to",
"random",
"numbers"
] | def ConstructRandomWeights(self, minWeight=-1, maxWeight=1):
"""initialize all the weights in the network to random numbers
**Arguments**
- minWeight: the minimum value a weight can take
- maxWeight: the maximum value a weight can take
"""
for node in self.nodeList:
inputs = ... | [
"def",
"ConstructRandomWeights",
"(",
"self",
",",
"minWeight",
"=",
"-",
"1",
",",
"maxWeight",
"=",
"1",
")",
":",
"for",
"node",
"in",
"self",
".",
"nodeList",
":",
"inputs",
"=",
"node",
".",
"GetInputs",
"(",
")",
"if",
"inputs",
":",
"weights",
... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/ML/Neural/Network.py#L38-L52 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | ppapi/generators/idl_lexer.py | python | IDLLexer.t_KEYWORD_SYMBOL | (self, t) | return t | r'_?[A-Za-z][A-Za-z_0-9]* | r'_?[A-Za-z][A-Za-z_0-9]* | [
"r",
"_?",
"[",
"A",
"-",
"Za",
"-",
"z",
"]",
"[",
"A",
"-",
"Za",
"-",
"z_0",
"-",
"9",
"]",
"*"
] | def t_KEYWORD_SYMBOL(self, t):
r'_?[A-Za-z][A-Za-z_0-9]*'
# All non-keywords are assumed to be symbols
t.type = self.keywords.get(t.value, 'SYMBOL')
# We strip leading underscores so that you can specify symbols with the same
# value as a keywords (E.g. a dictionary named 'interface').
if t.va... | [
"def",
"t_KEYWORD_SYMBOL",
"(",
"self",
",",
"t",
")",
":",
"# All non-keywords are assumed to be symbols",
"t",
".",
"type",
"=",
"self",
".",
"keywords",
".",
"get",
"(",
"t",
".",
"value",
",",
"'SYMBOL'",
")",
"# We strip leading underscores so that you can spec... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/ppapi/generators/idl_lexer.py#L145-L155 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.