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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
pgRouting/osm2pgrouting | 8491929fc4037d308f271e84d59bb96da3c28aa2 | tools/cpplint.py | python | NestingState.CheckCompletedBlocks | (self, filename, error) | Checks that all classes and namespaces have been completely parsed.
Call this when all lines in a file have been processed.
Args:
filename: The name of the current file.
error: The function to call with any errors found. | Checks that all classes and namespaces have been completely parsed. | [
"Checks",
"that",
"all",
"classes",
"and",
"namespaces",
"have",
"been",
"completely",
"parsed",
"."
] | def CheckCompletedBlocks(self, filename, error):
"""Checks that all classes and namespaces have been completely parsed.
Call this when all lines in a file have been processed.
Args:
filename: The name of the current file.
error: The function to call with any errors found.
"""
# Note: Th... | [
"def",
"CheckCompletedBlocks",
"(",
"self",
",",
"filename",
",",
"error",
")",
":",
"# Note: This test can result in false positives if #ifdef constructs",
"# get in the way of brace matching. See the testBuildClass test in",
"# cpplint_unittest.py for an example of this.",
"for",
"obj"... | https://github.com/pgRouting/osm2pgrouting/blob/8491929fc4037d308f271e84d59bb96da3c28aa2/tools/cpplint.py#L2549-L2568 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | StaticBitmap.SetIcon | (*args, **kwargs) | return _controls_.StaticBitmap_SetIcon(*args, **kwargs) | SetIcon(self, Icon icon) | SetIcon(self, Icon icon) | [
"SetIcon",
"(",
"self",
"Icon",
"icon",
")"
] | def SetIcon(*args, **kwargs):
"""SetIcon(self, Icon icon)"""
return _controls_.StaticBitmap_SetIcon(*args, **kwargs) | [
"def",
"SetIcon",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"StaticBitmap_SetIcon",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L1096-L1098 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/model/coordinates.py | python | Frame.worldOrigin | (self) | return self._worldCoordinates[1] | Returns an element of R^3 denoting the translation of the origin
of this frame in world coordinates | Returns an element of R^3 denoting the translation of the origin
of this frame in world coordinates | [
"Returns",
"an",
"element",
"of",
"R^3",
"denoting",
"the",
"translation",
"of",
"the",
"origin",
"of",
"this",
"frame",
"in",
"world",
"coordinates"
] | def worldOrigin(self):
"""Returns an element of R^3 denoting the translation of the origin
of this frame in world coordinates"""
return self._worldCoordinates[1] | [
"def",
"worldOrigin",
"(",
"self",
")",
":",
"return",
"self",
".",
"_worldCoordinates",
"[",
"1",
"]"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/model/coordinates.py#L51-L54 | |
CaoWGG/TensorRT-CenterNet | f949252e37b51e60f873808f46d3683f15735e79 | onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py | python | Config.set_compatibility_check | (check_status) | Perform compatibility check when loading libclang
The python bindings are only tested and evaluated with the version of
libclang they are provided with. To ensure correct behavior a (limited)
compatibility check is performed when loading the bindings. This check
will throw an exception,... | Perform compatibility check when loading libclang | [
"Perform",
"compatibility",
"check",
"when",
"loading",
"libclang"
] | def set_compatibility_check(check_status):
""" Perform compatibility check when loading libclang
The python bindings are only tested and evaluated with the version of
libclang they are provided with. To ensure correct behavior a (limited)
compatibility check is performed when loading th... | [
"def",
"set_compatibility_check",
"(",
"check_status",
")",
":",
"if",
"Config",
".",
"loaded",
":",
"raise",
"Exception",
"(",
"\"compatibility_check must be set before before \"",
"\"using any other functionalities in libclang.\"",
")",
"Config",
".",
"compatibility_check",
... | https://github.com/CaoWGG/TensorRT-CenterNet/blob/f949252e37b51e60f873808f46d3683f15735e79/onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py#L3789-L3810 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/quantization_utils.py | python | quantize_weights | (
full_precision_model, nbits, quantization_mode="linear", sample_data=None, **kwargs
) | return quantized_model | Utility function to convert a full precision (float) MLModel to a
nbit quantized MLModel (float16).
full_precision_model: MLModel
Model which will be converted to half precision. Currently conversion
for only neural network models is supported. If a pipeline model is
passed in then all ... | Utility function to convert a full precision (float) MLModel to a
nbit quantized MLModel (float16). | [
"Utility",
"function",
"to",
"convert",
"a",
"full",
"precision",
"(",
"float",
")",
"MLModel",
"to",
"a",
"nbit",
"quantized",
"MLModel",
"(",
"float16",
")",
"."
] | def quantize_weights(
full_precision_model, nbits, quantization_mode="linear", sample_data=None, **kwargs
):
"""
Utility function to convert a full precision (float) MLModel to a
nbit quantized MLModel (float16).
full_precision_model: MLModel
Model which will be converted to half precision.... | [
"def",
"quantize_weights",
"(",
"full_precision_model",
",",
"nbits",
",",
"quantization_mode",
"=",
"\"linear\"",
",",
"sample_data",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"qmode_mapping",
"=",
"{",
"\"linear\"",
":",
"_QUANTIZATION_MODE_LINEAR_QUANTIZATI... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/quantization_utils.py#L1544-L1654 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | DQM/Integration/scripts/harvesting_tools/cmsHarvester.py | python | CMSHarvester.option_handler_caf_access | (self, option, opt_str, value, parser) | Set the self.caf_access flag to try and create jobs that
run on the CAF. | Set the self.caf_access flag to try and create jobs that
run on the CAF. | [
"Set",
"the",
"self",
".",
"caf_access",
"flag",
"to",
"try",
"and",
"create",
"jobs",
"that",
"run",
"on",
"the",
"CAF",
"."
] | def option_handler_caf_access(self, option, opt_str, value, parser):
"""Set the self.caf_access flag to try and create jobs that
run on the CAF.
"""
self.caf_access = True
self.logger.warning("Running in `caf_access' mode. " \
"Will try to create job... | [
"def",
"option_handler_caf_access",
"(",
"self",
",",
"option",
",",
"opt_str",
",",
"value",
",",
"parser",
")",
":",
"self",
".",
"caf_access",
"=",
"True",
"self",
".",
"logger",
".",
"warning",
"(",
"\"Running in `caf_access' mode. \"",
"\"Will try to create j... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/DQM/Integration/scripts/harvesting_tools/cmsHarvester.py#L1103-L1113 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/integrate/quadrature.py | python | cumtrapz | (y, x=None, dx=1.0, axis=-1, initial=None) | return res | Cumulatively integrate y(x) using the composite trapezoidal rule.
Parameters
----------
y : array_like
Values to integrate.
x : array_like, optional
The coordinate to integrate along. If None (default), use spacing `dx`
between consecutive elements in `y`.
dx : int, optiona... | Cumulatively integrate y(x) using the composite trapezoidal rule. | [
"Cumulatively",
"integrate",
"y",
"(",
"x",
")",
"using",
"the",
"composite",
"trapezoidal",
"rule",
"."
] | def cumtrapz(y, x=None, dx=1.0, axis=-1, initial=None):
"""
Cumulatively integrate y(x) using the composite trapezoidal rule.
Parameters
----------
y : array_like
Values to integrate.
x : array_like, optional
The coordinate to integrate along. If None (default), use spacing `dx... | [
"def",
"cumtrapz",
"(",
"y",
",",
"x",
"=",
"None",
",",
"dx",
"=",
"1.0",
",",
"axis",
"=",
"-",
"1",
",",
"initial",
"=",
"None",
")",
":",
"y",
"=",
"np",
".",
"asarray",
"(",
"y",
")",
"if",
"x",
"is",
"None",
":",
"d",
"=",
"dx",
"el... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/integrate/quadrature.py#L206-L295 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/tabnanny.py | python | check | (file) | check(file_or_dir)
If file_or_dir is a directory and not a symbolic link, then recursively
descend the directory tree named by file_or_dir, checking all .py files
along the way. If file_or_dir is an ordinary Python source file, it is
checked for whitespace related problems. The diagnostic messages are
... | check(file_or_dir) | [
"check",
"(",
"file_or_dir",
")"
] | def check(file):
"""check(file_or_dir)
If file_or_dir is a directory and not a symbolic link, then recursively
descend the directory tree named by file_or_dir, checking all .py files
along the way. If file_or_dir is an ordinary Python source file, it is
checked for whitespace related problems. The ... | [
"def",
"check",
"(",
"file",
")",
":",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"file",
")",
"and",
"not",
"os",
".",
"path",
".",
"islink",
"(",
"file",
")",
":",
"if",
"verbose",
":",
"print",
"\"%r: listing directory\"",
"%",
"(",
"file",
","... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/tabnanny.py#L74-L130 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/type_check.py | python | isreal | (x) | return imag(x) == 0 | Returns a bool array, where True if input element is real.
If element has complex type with zero complex part, the return value
for that element is True.
Parameters
----------
x : array_like
Input array.
Returns
-------
out : ndarray, bool
Boolean array of same shape a... | Returns a bool array, where True if input element is real. | [
"Returns",
"a",
"bool",
"array",
"where",
"True",
"if",
"input",
"element",
"is",
"real",
"."
] | def isreal(x):
"""
Returns a bool array, where True if input element is real.
If element has complex type with zero complex part, the return value
for that element is True.
Parameters
----------
x : array_like
Input array.
Returns
-------
out : ndarray, bool
Bo... | [
"def",
"isreal",
"(",
"x",
")",
":",
"return",
"imag",
"(",
"x",
")",
"==",
"0"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/type_check.py#L207-L235 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | Window.SetLayoutDirection | (*args, **kwargs) | return _core_.Window_SetLayoutDirection(*args, **kwargs) | SetLayoutDirection(self, int dir)
Set the layout direction (LTR or RTL) for this window. | SetLayoutDirection(self, int dir) | [
"SetLayoutDirection",
"(",
"self",
"int",
"dir",
")"
] | def SetLayoutDirection(*args, **kwargs):
"""
SetLayoutDirection(self, int dir)
Set the layout direction (LTR or RTL) for this window.
"""
return _core_.Window_SetLayoutDirection(*args, **kwargs) | [
"def",
"SetLayoutDirection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_SetLayoutDirection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L9311-L9317 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/inspector_protocol/jinja2/runtime.py | python | Context.get | (self, key, default=None) | Returns an item from the template context, if it doesn't exist
`default` is returned. | Returns an item from the template context, if it doesn't exist
`default` is returned. | [
"Returns",
"an",
"item",
"from",
"the",
"template",
"context",
"if",
"it",
"doesn",
"t",
"exist",
"default",
"is",
"returned",
"."
] | def get(self, key, default=None):
"""Returns an item from the template context, if it doesn't exist
`default` is returned.
"""
try:
return self[key]
except KeyError:
return default | [
"def",
"get",
"(",
"self",
",",
"key",
",",
"default",
"=",
"None",
")",
":",
"try",
":",
"return",
"self",
"[",
"key",
"]",
"except",
"KeyError",
":",
"return",
"default"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/inspector_protocol/jinja2/runtime.py#L187-L194 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/telemetry/telemetry/core/forwarders/android_forwarder.py | python | AndroidRndisForwarder._OverrideDns | (self) | Overrides DNS on device to point at the host. | Overrides DNS on device to point at the host. | [
"Overrides",
"DNS",
"on",
"device",
"to",
"point",
"at",
"the",
"host",
"."
] | def _OverrideDns(self):
"""Overrides DNS on device to point at the host."""
self._original_dns = self._GetCurrentDns()
if not self._original_dns[0]:
# No default route. Install one via the host. This is needed because
# getaddrinfo in bionic uses routes to determine AI_ADDRCONFIG.
self._ad... | [
"def",
"_OverrideDns",
"(",
"self",
")",
":",
"self",
".",
"_original_dns",
"=",
"self",
".",
"_GetCurrentDns",
"(",
")",
"if",
"not",
"self",
".",
"_original_dns",
"[",
"0",
"]",
":",
"# No default route. Install one via the host. This is needed because",
"# getadd... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/telemetry/core/forwarders/android_forwarder.py#L101-L109 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Window.GetMinClientSize | (*args, **kwargs) | return _core_.Window_GetMinClientSize(*args, **kwargs) | GetMinClientSize(self) -> Size | GetMinClientSize(self) -> Size | [
"GetMinClientSize",
"(",
"self",
")",
"-",
">",
"Size"
] | def GetMinClientSize(*args, **kwargs):
"""GetMinClientSize(self) -> Size"""
return _core_.Window_GetMinClientSize(*args, **kwargs) | [
"def",
"GetMinClientSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_GetMinClientSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L9796-L9798 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_windows.py | python | Printout.GetPageInfo | (*args, **kwargs) | return _windows_.Printout_GetPageInfo(*args, **kwargs) | GetPageInfo() -> (minPage, maxPage, pageFrom, pageTo) | GetPageInfo() -> (minPage, maxPage, pageFrom, pageTo) | [
"GetPageInfo",
"()",
"-",
">",
"(",
"minPage",
"maxPage",
"pageFrom",
"pageTo",
")"
] | def GetPageInfo(*args, **kwargs):
"""GetPageInfo() -> (minPage, maxPage, pageFrom, pageTo)"""
return _windows_.Printout_GetPageInfo(*args, **kwargs) | [
"def",
"GetPageInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"Printout_GetPageInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L5407-L5409 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/stats/stats.py | python | _histogram | (a, numbins=10, defaultlimits=None, weights=None, printextras=False) | return HistogramResult(hist, defaultlimits[0], binsize, extrapoints) | Separate the range into several bins and return the number of instances
in each bin.
Parameters
----------
a : array_like
Array of scores which will be put into bins.
numbins : int, optional
The number of bins to use for the histogram. Default is 10.
defaultlimits : tuple (lower... | Separate the range into several bins and return the number of instances
in each bin. | [
"Separate",
"the",
"range",
"into",
"several",
"bins",
"and",
"return",
"the",
"number",
"of",
"instances",
"in",
"each",
"bin",
"."
] | def _histogram(a, numbins=10, defaultlimits=None, weights=None, printextras=False):
"""
Separate the range into several bins and return the number of instances
in each bin.
Parameters
----------
a : array_like
Array of scores which will be put into bins.
numbins : int, optional
... | [
"def",
"_histogram",
"(",
"a",
",",
"numbins",
"=",
"10",
",",
"defaultlimits",
"=",
"None",
",",
"weights",
"=",
"None",
",",
"printextras",
"=",
"False",
")",
":",
"a",
"=",
"np",
".",
"ravel",
"(",
"a",
")",
"if",
"defaultlimits",
"is",
"None",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/stats/stats.py#L1842-L1915 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/nntplib.py | python | NNTP.quit | (self) | return resp | Process a QUIT command and close the socket. Returns:
- resp: server response if successful | Process a QUIT command and close the socket. Returns:
- resp: server response if successful | [
"Process",
"a",
"QUIT",
"command",
"and",
"close",
"the",
"socket",
".",
"Returns",
":",
"-",
"resp",
":",
"server",
"response",
"if",
"successful"
] | def quit(self):
"""Process a QUIT command and close the socket. Returns:
- resp: server response if successful"""
resp = self.shortcmd('QUIT')
self.file.close()
self.sock.close()
del self.file, self.sock
return resp | [
"def",
"quit",
"(",
"self",
")",
":",
"resp",
"=",
"self",
".",
"shortcmd",
"(",
"'QUIT'",
")",
"self",
".",
"file",
".",
"close",
"(",
")",
"self",
".",
"sock",
".",
"close",
"(",
")",
"del",
"self",
".",
"file",
",",
"self",
".",
"sock",
"ret... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/nntplib.py#L604-L612 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_grad/grad_implementations.py | python | bprop_scalar_uadd | (x, out, dout) | return (dout,) | Backpropagator for primitive `scalar_uadd`. | Backpropagator for primitive `scalar_uadd`. | [
"Backpropagator",
"for",
"primitive",
"scalar_uadd",
"."
] | def bprop_scalar_uadd(x, out, dout):
"""Backpropagator for primitive `scalar_uadd`."""
return (dout,) | [
"def",
"bprop_scalar_uadd",
"(",
"x",
",",
"out",
",",
"dout",
")",
":",
"return",
"(",
"dout",
",",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_grad/grad_implementations.py#L83-L85 | |
facebook/bistro | db9eff7e92f5cedcc917a440d5c88064c7980e40 | build/fbcode_builder/getdeps/fetcher.py | python | ShipitPathMap._minimize_roots | (self) | compute the de-duplicated set of roots within fbsource.
We take the shortest common directory prefix to make this
determination | compute the de-duplicated set of roots within fbsource.
We take the shortest common directory prefix to make this
determination | [
"compute",
"the",
"de",
"-",
"duplicated",
"set",
"of",
"roots",
"within",
"fbsource",
".",
"We",
"take",
"the",
"shortest",
"common",
"directory",
"prefix",
"to",
"make",
"this",
"determination"
] | def _minimize_roots(self):
"""compute the de-duplicated set of roots within fbsource.
We take the shortest common directory prefix to make this
determination"""
self.roots.sort(key=len)
minimized = []
for r in self.roots:
add_this_entry = True
for... | [
"def",
"_minimize_roots",
"(",
"self",
")",
":",
"self",
".",
"roots",
".",
"sort",
"(",
"key",
"=",
"len",
")",
"minimized",
"=",
"[",
"]",
"for",
"r",
"in",
"self",
".",
"roots",
":",
"add_this_entry",
"=",
"True",
"for",
"existing",
"in",
"minimiz... | https://github.com/facebook/bistro/blob/db9eff7e92f5cedcc917a440d5c88064c7980e40/build/fbcode_builder/getdeps/fetcher.py#L411-L427 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/learn/python/learn/dataframe/transform.py | python | Transform.name | (self) | Name of the transform. | Name of the transform. | [
"Name",
"of",
"the",
"transform",
"."
] | def name(self):
"""Name of the transform."""
raise NotImplementedError() | [
"def",
"name",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/learn/python/learn/dataframe/transform.py#L116-L118 | ||
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/sping/SVG/pidSVG.py | python | SVGCanvas.save | (self, file=None, format=None) | Hand hand this either a file= <filename> or
file = <an open file object>. By default, I've made the fomrat extension be
.svg. By default it saves the file to "self.name" + '.svg' | Hand hand this either a file= <filename> or
file = <an open file object>. By default, I've made the fomrat extension be
.svg. By default it saves the file to "self.name" + '.svg' | [
"Hand",
"hand",
"this",
"either",
"a",
"file",
"=",
"<filename",
">",
"or",
"file",
"=",
"<an",
"open",
"file",
"object",
">",
".",
"By",
"default",
"I",
"ve",
"made",
"the",
"fomrat",
"extension",
"be",
".",
"svg",
".",
"By",
"default",
"it",
"saves... | def save(self, file=None, format=None):
"""Hand hand this either a file= <filename> or
file = <an open file object>. By default, I've made the fomrat extension be
.svg. By default it saves the file to "self.name" + '.svg' """
if file == None:
file = self.name
if isinstance(file, str):
... | [
"def",
"save",
"(",
"self",
",",
"file",
"=",
"None",
",",
"format",
"=",
"None",
")",
":",
"if",
"file",
"==",
"None",
":",
"file",
"=",
"self",
".",
"name",
"if",
"isinstance",
"(",
"file",
",",
"str",
")",
":",
"isFileName",
"=",
"1",
"else",
... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/sping/SVG/pidSVG.py#L250-L273 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge2.py | python | ExodusModel.get_node_set_field_names | (self, node_set_ids='all') | return self._sort_field_names(list(names)) | Return a list of all node set field names.
By default, this returns node set fields which are defined on any
node set. To return fields which are defined on a particular
node set, pass a node set id.
Examples:
>>> model.get_node_set_field_names()
>>> model.get_node_set... | Return a list of all node set field names. | [
"Return",
"a",
"list",
"of",
"all",
"node",
"set",
"field",
"names",
"."
] | def get_node_set_field_names(self, node_set_ids='all'):
"""
Return a list of all node set field names.
By default, this returns node set fields which are defined on any
node set. To return fields which are defined on a particular
node set, pass a node set id.
Examples:... | [
"def",
"get_node_set_field_names",
"(",
"self",
",",
"node_set_ids",
"=",
"'all'",
")",
":",
"node_set_ids",
"=",
"self",
".",
"_format_node_set_id_list",
"(",
"node_set_ids",
")",
"names",
"=",
"set",
"(",
")",
"for",
"id_",
"in",
"node_set_ids",
":",
"names"... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge2.py#L3330-L3347 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | example/gluon/style_transfer/utils.py | python | CenterCrop.__call__ | (self, img) | return img.crop((x1, y1, x1 + tw, y1 + th)) | Args:
img (PIL.Image): Image to be cropped.
Returns:
PIL.Image: Cropped image. | Args:
img (PIL.Image): Image to be cropped.
Returns:
PIL.Image: Cropped image. | [
"Args",
":",
"img",
"(",
"PIL",
".",
"Image",
")",
":",
"Image",
"to",
"be",
"cropped",
".",
"Returns",
":",
"PIL",
".",
"Image",
":",
"Cropped",
"image",
"."
] | def __call__(self, img):
"""
Args:
img (PIL.Image): Image to be cropped.
Returns:
PIL.Image: Cropped image.
"""
w, h = img.size
th, tw = self.size
x1 = int(round((w - tw) / 2.))
y1 = int(round((h - th) / 2.))
return img.crop... | [
"def",
"__call__",
"(",
"self",
",",
"img",
")",
":",
"w",
",",
"h",
"=",
"img",
".",
"size",
"th",
",",
"tw",
"=",
"self",
".",
"size",
"x1",
"=",
"int",
"(",
"round",
"(",
"(",
"w",
"-",
"tw",
")",
"/",
"2.",
")",
")",
"y1",
"=",
"int",... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/gluon/style_transfer/utils.py#L193-L204 | |
liuzechun/Bi-Real-net | f58aa4d1fa730fcd2e33c3745fcd6c479d7f42e3 | pytorch_implementation/BiReal_50/utils.py | python | adjust_learning_rate | (optimizer, epoch, args) | Sets the learning rate to the initial LR decayed by 10 every 30 epochs | Sets the learning rate to the initial LR decayed by 10 every 30 epochs | [
"Sets",
"the",
"learning",
"rate",
"to",
"the",
"initial",
"LR",
"decayed",
"by",
"10",
"every",
"30",
"epochs"
] | def adjust_learning_rate(optimizer, epoch, args):
"""Sets the learning rate to the initial LR decayed by 10 every 30 epochs"""
lr = args.lr * (0.1 ** (epoch // 30))
for param_group in optimizer.param_groups:
param_group['lr'] = lr | [
"def",
"adjust_learning_rate",
"(",
"optimizer",
",",
"epoch",
",",
"args",
")",
":",
"lr",
"=",
"args",
".",
"lr",
"*",
"(",
"0.1",
"**",
"(",
"epoch",
"//",
"30",
")",
")",
"for",
"param_group",
"in",
"optimizer",
".",
"param_groups",
":",
"param_gro... | https://github.com/liuzechun/Bi-Real-net/blob/f58aa4d1fa730fcd2e33c3745fcd6c479d7f42e3/pytorch_implementation/BiReal_50/utils.py#L126-L130 | ||
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/directnotify/DirectNotify.py | python | DirectNotify.__init__ | (self) | DirectNotify class keeps a dictionary of Notfiers | DirectNotify class keeps a dictionary of Notfiers | [
"DirectNotify",
"class",
"keeps",
"a",
"dictionary",
"of",
"Notfiers"
] | def __init__(self):
"""
DirectNotify class keeps a dictionary of Notfiers
"""
self.__categories = { }
# create a default log file
self.logger = Logger.Logger()
# This will get filled in later by ShowBase.py with a
# C++-level StreamWriter object for writi... | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"__categories",
"=",
"{",
"}",
"# create a default log file",
"self",
".",
"logger",
"=",
"Logger",
".",
"Logger",
"(",
")",
"# This will get filled in later by ShowBase.py with a",
"# C++-level StreamWriter object ... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/directnotify/DirectNotify.py#L14-L25 | ||
turi-code/SFrame | 796b9bdfb2fa1b881d82080754643c7e68629cd2 | oss_src/unity/python/sframe/data_structures/sketch.py | python | Sketch.frequency_count | (self, element) | Returns a sketched estimate of the number of occurrences of a given
element. This estimate is based on the count sketch. The element type
must be of the same type as the input SArray. Throws an exception if
element is of the incorrect type.
Parameters
----------
element ... | Returns a sketched estimate of the number of occurrences of a given
element. This estimate is based on the count sketch. The element type
must be of the same type as the input SArray. Throws an exception if
element is of the incorrect type. | [
"Returns",
"a",
"sketched",
"estimate",
"of",
"the",
"number",
"of",
"occurrences",
"of",
"a",
"given",
"element",
".",
"This",
"estimate",
"is",
"based",
"on",
"the",
"count",
"sketch",
".",
"The",
"element",
"type",
"must",
"be",
"of",
"the",
"same",
"... | def frequency_count(self, element):
"""
Returns a sketched estimate of the number of occurrences of a given
element. This estimate is based on the count sketch. The element type
must be of the same type as the input SArray. Throws an exception if
element is of the incorrect type.... | [
"def",
"frequency_count",
"(",
"self",
",",
"element",
")",
":",
"with",
"cython_context",
"(",
")",
":",
"return",
"int",
"(",
"self",
".",
"__proxy__",
".",
"frequency_count",
"(",
"element",
")",
")"
] | https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/sketch.py#L464-L487 | ||
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/google/protobuf/internal/encoder.py | python | BytesSizer | (field_number, is_repeated, is_packed) | Returns a sizer for a bytes field. | Returns a sizer for a bytes field. | [
"Returns",
"a",
"sizer",
"for",
"a",
"bytes",
"field",
"."
] | def BytesSizer(field_number, is_repeated, is_packed):
"""Returns a sizer for a bytes field."""
tag_size = _TagSize(field_number)
local_VarintSize = _VarintSize
local_len = len
assert not is_packed
if is_repeated:
def RepeatedFieldSize(value):
result = tag_size * len(value)
for element in va... | [
"def",
"BytesSizer",
"(",
"field_number",
",",
"is_repeated",
",",
"is_packed",
")",
":",
"tag_size",
"=",
"_TagSize",
"(",
"field_number",
")",
"local_VarintSize",
"=",
"_VarintSize",
"local_len",
"=",
"len",
"assert",
"not",
"is_packed",
"if",
"is_repeated",
"... | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/internal/encoder.py#L252-L271 | ||
happynear/caffe-windows | 967eedf25009e334b7f6f933bb5e17aaaff5bef6 | scripts/cpp_lint.py | python | _GetTextInside | (text, start_pattern) | return text[start_position:position - 1] | r"""Retrieves all the text between matching open and close parentheses.
Given a string of lines and a regular expression string, retrieve all the text
following the expression and between opening punctuation symbols like
(, [, or {, and the matching close-punctuation symbol. This properly nested
occurrences of... | r"""Retrieves all the text between matching open and close parentheses. | [
"r",
"Retrieves",
"all",
"the",
"text",
"between",
"matching",
"open",
"and",
"close",
"parentheses",
"."
] | def _GetTextInside(text, start_pattern):
r"""Retrieves all the text between matching open and close parentheses.
Given a string of lines and a regular expression string, retrieve all the text
following the expression and between opening punctuation symbols like
(, [, or {, and the matching close-punctuation sy... | [
"def",
"_GetTextInside",
"(",
"text",
",",
"start_pattern",
")",
":",
"# TODO(sugawarayu): Audit cpplint.py to see what places could be profitably",
"# rewritten to use _GetTextInside (and use inferior regexp matching today).",
"# Give opening punctuations to get the matching close-punctuations.... | https://github.com/happynear/caffe-windows/blob/967eedf25009e334b7f6f933bb5e17aaaff5bef6/scripts/cpp_lint.py#L3756-L3809 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/vision/validators.py | python | check_hsv_to_rgb | (method) | return new_method | Wrapper method to check the parameters of hsv_to_rgb. | Wrapper method to check the parameters of hsv_to_rgb. | [
"Wrapper",
"method",
"to",
"check",
"the",
"parameters",
"of",
"hsv_to_rgb",
"."
] | def check_hsv_to_rgb(method):
"""Wrapper method to check the parameters of hsv_to_rgb."""
@wraps(method)
def new_method(self, *args, **kwargs):
[is_hwc], _ = parse_user_args(method, *args, **kwargs)
type_check(is_hwc, (bool,), "is_hwc")
return method(self, *args, **kwargs)
retu... | [
"def",
"check_hsv_to_rgb",
"(",
"method",
")",
":",
"@",
"wraps",
"(",
"method",
")",
"def",
"new_method",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"[",
"is_hwc",
"]",
",",
"_",
"=",
"parse_user_args",
"(",
"method",
",",
"... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/vision/validators.py#L645-L654 | |
IntelRealSense/librealsense | c94410a420b74e5fb6a414bd12215c05ddd82b69 | wrappers/python/examples/pyglet_pointcloud_viewer.py | python | axes | (size=1, width=1) | draw 3d axes | draw 3d axes | [
"draw",
"3d",
"axes"
] | def axes(size=1, width=1):
"""draw 3d axes"""
gl.glLineWidth(width)
pyglet.graphics.draw(6, gl.GL_LINES,
('v3f', (0, 0, 0, size, 0, 0,
0, 0, 0, 0, size, 0,
0, 0, 0, 0, 0, size)),
('c3f', (1,... | [
"def",
"axes",
"(",
"size",
"=",
"1",
",",
"width",
"=",
"1",
")",
":",
"gl",
".",
"glLineWidth",
"(",
"width",
")",
"pyglet",
".",
"graphics",
".",
"draw",
"(",
"6",
",",
"gl",
".",
"GL_LINES",
",",
"(",
"'v3f'",
",",
"(",
"0",
",",
"0",
","... | https://github.com/IntelRealSense/librealsense/blob/c94410a420b74e5fb6a414bd12215c05ddd82b69/wrappers/python/examples/pyglet_pointcloud_viewer.py#L245-L256 | ||
seqan/seqan | f5f658343c366c9c3d44ba358ffc9317e78a09ed | util/py_lib/seqan/dox/lexer.py | python | Lexer.tokens | (self) | Returns an iterator to the tokens found in the buffer. | Returns an iterator to the tokens found in the buffer. | [
"Returns",
"an",
"iterator",
"to",
"the",
"tokens",
"found",
"in",
"the",
"buffer",
"."
] | def tokens(self):
""" Returns an iterator to the tokens found in the buffer.
"""
while 1:
tok = self.token()
if tok is None:
yield EOF
break
yield tok | [
"def",
"tokens",
"(",
"self",
")",
":",
"while",
"1",
":",
"tok",
"=",
"self",
".",
"token",
"(",
")",
"if",
"tok",
"is",
"None",
":",
"yield",
"EOF",
"break",
"yield",
"tok"
] | https://github.com/seqan/seqan/blob/f5f658343c366c9c3d44ba358ffc9317e78a09ed/util/py_lib/seqan/dox/lexer.py#L132-L140 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/roc/stubs.py | python | ds_bpermute | (src_lane, dest_lane) | AMDGCN Data Share intrinsic backwards permute (pull semantics) | AMDGCN Data Share intrinsic backwards permute (pull semantics) | [
"AMDGCN",
"Data",
"Share",
"intrinsic",
"backwards",
"permute",
"(",
"pull",
"semantics",
")"
] | def ds_bpermute(src_lane, dest_lane):
"""
AMDGCN Data Share intrinsic backwards permute (pull semantics)
"""
raise _stub_error | [
"def",
"ds_bpermute",
"(",
"src_lane",
",",
"dest_lane",
")",
":",
"raise",
"_stub_error"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/roc/stubs.py#L109-L113 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/third_party/Python/module/pexpect-2.4/examples/rippy.py | python | mux_mkv | (
video_final_filename,
video_transcoded_filename,
audio_compressed_filename,
verbose_flag=0,
dry_run_flag=0) | This is depricated. | This is depricated. | [
"This",
"is",
"depricated",
"."
] | def mux_mkv(
video_final_filename,
video_transcoded_filename,
audio_compressed_filename,
verbose_flag=0,
dry_run_flag=0):
"""This is depricated."""
cmd = 'mkvmerge -o %s --noaudio %s %s' % (
video_final_filename, video_transcoded_filename, audio_compressed_filenam... | [
"def",
"mux_mkv",
"(",
"video_final_filename",
",",
"video_transcoded_filename",
",",
"audio_compressed_filename",
",",
"verbose_flag",
"=",
"0",
",",
"dry_run_flag",
"=",
"0",
")",
":",
"cmd",
"=",
"'mkvmerge -o %s --noaudio %s %s'",
"%",
"(",
"video_final_filename",
... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/third_party/Python/module/pexpect-2.4/examples/rippy.py#L992-L1005 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/ndarray/ndarray.py | python | NDArray.cos | (self, *args, **kwargs) | return op.cos(self, *args, **kwargs) | Convenience fluent method for :py:func:`cos`.
The arguments are the same as for :py:func:`cos`, with
this array as data. | Convenience fluent method for :py:func:`cos`. | [
"Convenience",
"fluent",
"method",
"for",
":",
"py",
":",
"func",
":",
"cos",
"."
] | def cos(self, *args, **kwargs):
"""Convenience fluent method for :py:func:`cos`.
The arguments are the same as for :py:func:`cos`, with
this array as data.
"""
return op.cos(self, *args, **kwargs) | [
"def",
"cos",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"op",
".",
"cos",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/ndarray/ndarray.py#L1486-L1492 | |
sonyxperiadev/WebGL | 0299b38196f78c6d5f74bcf6fa312a3daee6de60 | Tools/Scripts/webkitpy/style/checkers/cpp.py | python | _does_primary_header_exist | (filename) | return os.path.isfile(primary_header) | Return a primary header file name for a file, or empty string
if the file is not source file or primary header does not exist. | Return a primary header file name for a file, or empty string
if the file is not source file or primary header does not exist. | [
"Return",
"a",
"primary",
"header",
"file",
"name",
"for",
"a",
"file",
"or",
"empty",
"string",
"if",
"the",
"file",
"is",
"not",
"source",
"file",
"or",
"primary",
"header",
"does",
"not",
"exist",
"."
] | def _does_primary_header_exist(filename):
"""Return a primary header file name for a file, or empty string
if the file is not source file or primary header does not exist.
"""
fileinfo = FileInfo(filename)
if not fileinfo.is_source():
return False
primary_header = fileinfo.no_extension()... | [
"def",
"_does_primary_header_exist",
"(",
"filename",
")",
":",
"fileinfo",
"=",
"FileInfo",
"(",
"filename",
")",
"if",
"not",
"fileinfo",
".",
"is_source",
"(",
")",
":",
"return",
"False",
"primary_header",
"=",
"fileinfo",
".",
"no_extension",
"(",
")",
... | https://github.com/sonyxperiadev/WebGL/blob/0299b38196f78c6d5f74bcf6fa312a3daee6de60/Tools/Scripts/webkitpy/style/checkers/cpp.py#L2601-L2609 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/gluon/utils.py | python | split_data | (data, num_slice, batch_axis=0, even_split=True) | return slices | Splits an NDArray into `num_slice` slices along `batch_axis`.
Usually used for data parallelism where each slices is sent
to one device (i.e. GPU).
Parameters
----------
data : NDArray
A batch of data.
num_slice : int
Number of desired slices.
batch_axis : int, default 0
... | Splits an NDArray into `num_slice` slices along `batch_axis`.
Usually used for data parallelism where each slices is sent
to one device (i.e. GPU). | [
"Splits",
"an",
"NDArray",
"into",
"num_slice",
"slices",
"along",
"batch_axis",
".",
"Usually",
"used",
"for",
"data",
"parallelism",
"where",
"each",
"slices",
"is",
"sent",
"to",
"one",
"device",
"(",
"i",
".",
"e",
".",
"GPU",
")",
"."
] | def split_data(data, num_slice, batch_axis=0, even_split=True):
"""Splits an NDArray into `num_slice` slices along `batch_axis`.
Usually used for data parallelism where each slices is sent
to one device (i.e. GPU).
Parameters
----------
data : NDArray
A batch of data.
num_slice : in... | [
"def",
"split_data",
"(",
"data",
",",
"num_slice",
",",
"batch_axis",
"=",
"0",
",",
"even_split",
"=",
"True",
")",
":",
"size",
"=",
"data",
".",
"shape",
"[",
"batch_axis",
"]",
"if",
"even_split",
"and",
"size",
"%",
"num_slice",
"!=",
"0",
":",
... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/gluon/utils.py#L43-L91 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | Joystick.IsOk | (*args, **kwargs) | return _misc_.Joystick_IsOk(*args, **kwargs) | IsOk(self) -> bool | IsOk(self) -> bool | [
"IsOk",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsOk(*args, **kwargs):
"""IsOk(self) -> bool"""
return _misc_.Joystick_IsOk(*args, **kwargs) | [
"def",
"IsOk",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"Joystick_IsOk",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L2166-L2168 | |
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/atoms/sigma_max.py | python | sigma_max.sign_from_args | (self) | return (True, False) | Returns sign (is positive, is negative) of the expression. | Returns sign (is positive, is negative) of the expression. | [
"Returns",
"sign",
"(",
"is",
"positive",
"is",
"negative",
")",
"of",
"the",
"expression",
"."
] | def sign_from_args(self) -> Tuple[bool, bool]:
"""Returns sign (is positive, is negative) of the expression.
"""
# Always positive.
return (True, False) | [
"def",
"sign_from_args",
"(",
"self",
")",
"->",
"Tuple",
"[",
"bool",
",",
"bool",
"]",
":",
"# Always positive.",
"return",
"(",
"True",
",",
"False",
")"
] | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/sigma_max.py#L62-L66 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/mrecords.py | python | MaskedRecords.copy | (self) | return copied | Returns a copy of the masked record. | Returns a copy of the masked record. | [
"Returns",
"a",
"copy",
"of",
"the",
"masked",
"record",
"."
] | def copy(self):
"""
Returns a copy of the masked record.
"""
copied = self._data.copy().view(type(self))
copied._mask = self._mask.copy()
return copied | [
"def",
"copy",
"(",
"self",
")",
":",
"copied",
"=",
"self",
".",
"_data",
".",
"copy",
"(",
")",
".",
"view",
"(",
"type",
"(",
"self",
")",
")",
"copied",
".",
"_mask",
"=",
"self",
".",
"_mask",
".",
"copy",
"(",
")",
"return",
"copied"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/mrecords.py#L420-L427 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/closure_linter/closure_linter/ecmalintrules.py | python | EcmaScriptLintRules.CheckToken | (self, token, state) | Checks a token, given the current parser_state, for warnings and errors.
Args:
token: The current token under consideration
state: parser_state object that indicates the current state in the page | Checks a token, given the current parser_state, for warnings and errors. | [
"Checks",
"a",
"token",
"given",
"the",
"current",
"parser_state",
"for",
"warnings",
"and",
"errors",
"."
] | def CheckToken(self, token, state):
"""Checks a token, given the current parser_state, for warnings and errors.
Args:
token: The current token under consideration
state: parser_state object that indicates the current state in the page
"""
# Store some convenience variables
first_in_line... | [
"def",
"CheckToken",
"(",
"self",
",",
"token",
",",
"state",
")",
":",
"# Store some convenience variables",
"first_in_line",
"=",
"token",
".",
"IsFirstInLine",
"(",
")",
"last_in_line",
"=",
"token",
".",
"IsLastInLine",
"(",
")",
"last_non_space_token",
"=",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/closure_linter/closure_linter/ecmalintrules.py#L238-L720 | ||
hakuna-m/wubiuefi | caec1af0a09c78fd5a345180ada1fe45e0c63493 | src/pypack/altgraph/Graph.py | python | Graph.edge_by_node | (self, head, tail) | return None | Returns the edge that connects the head_id and tail_id nodes | Returns the edge that connects the head_id and tail_id nodes | [
"Returns",
"the",
"edge",
"that",
"connects",
"the",
"head_id",
"and",
"tail_id",
"nodes"
] | def edge_by_node(self, head, tail):
"""
Returns the edge that connects the head_id and tail_id nodes
"""
for edge in self.out_edges(head):
if self.tail(edge) == tail:
return edge
return None | [
"def",
"edge_by_node",
"(",
"self",
",",
"head",
",",
"tail",
")",
":",
"for",
"edge",
"in",
"self",
".",
"out_edges",
"(",
"head",
")",
":",
"if",
"self",
".",
"tail",
"(",
"edge",
")",
"==",
"tail",
":",
"return",
"edge",
"return",
"None"
] | https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/pypack/altgraph/Graph.py#L194-L201 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/cpp.py | python | PreProcessor.do_if | (self, t) | Default handling of a #if line. | Default handling of a #if line. | [
"Default",
"handling",
"of",
"a",
"#if",
"line",
"."
] | def do_if(self, t):
"""
Default handling of a #if line.
"""
self._do_if_else_condition(self.eval_expression(t)) | [
"def",
"do_if",
"(",
"self",
",",
"t",
")",
":",
"self",
".",
"_do_if_else_condition",
"(",
"self",
".",
"eval_expression",
"(",
"t",
")",
")"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/cpp.py#L452-L456 | ||
naver/sling | 5671cd445a2caae0b4dd0332299e4cfede05062c | webkit/Tools/Scripts/webkitpy/style/checkers/cpp.py | python | SingleLineView.convert_column_to_row | (self, single_line_column_number) | return self._starting_row + row_offset | Convert the column number from the single line into the original
line number.
Special cases:
* Columns in the added spaces are considered part of the previous line.
* Columns beyond the end of the line are consider part the last line
in the view. | Convert the column number from the single line into the original
line number. | [
"Convert",
"the",
"column",
"number",
"from",
"the",
"single",
"line",
"into",
"the",
"original",
"line",
"number",
"."
] | def convert_column_to_row(self, single_line_column_number):
"""Convert the column number from the single line into the original
line number.
Special cases:
* Columns in the added spaces are considered part of the previous line.
* Columns beyond the end of the line are consider p... | [
"def",
"convert_column_to_row",
"(",
"self",
",",
"single_line_column_number",
")",
":",
"total_columns",
"=",
"0",
"row_offset",
"=",
"0",
"while",
"row_offset",
"<",
"len",
"(",
"self",
".",
"_row_lengths",
")",
"-",
"1",
"and",
"single_line_column_number",
">... | https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/style/checkers/cpp.py#L407-L420 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | MenuItem.SetFont | (*args, **kwargs) | return _core_.MenuItem_SetFont(*args, **kwargs) | SetFont(self, Font font) | SetFont(self, Font font) | [
"SetFont",
"(",
"self",
"Font",
"font",
")"
] | def SetFont(*args, **kwargs):
"""SetFont(self, Font font)"""
return _core_.MenuItem_SetFont(*args, **kwargs) | [
"def",
"SetFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MenuItem_SetFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L12557-L12559 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/resample.py | python | Resampler.transform | (self, arg, *args, **kwargs) | return self._selected_obj.groupby(self.groupby).transform(arg, *args, **kwargs) | Call function producing a like-indexed Series on each group and return
a Series with the transformed values.
Parameters
----------
arg : function
To apply to each group. Should return a Series with the same index.
Returns
-------
transformed : Series... | Call function producing a like-indexed Series on each group and return
a Series with the transformed values. | [
"Call",
"function",
"producing",
"a",
"like",
"-",
"indexed",
"Series",
"on",
"each",
"group",
"and",
"return",
"a",
"Series",
"with",
"the",
"transformed",
"values",
"."
] | def transform(self, arg, *args, **kwargs):
"""
Call function producing a like-indexed Series on each group and return
a Series with the transformed values.
Parameters
----------
arg : function
To apply to each group. Should return a Series with the same index... | [
"def",
"transform",
"(",
"self",
",",
"arg",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_selected_obj",
".",
"groupby",
"(",
"self",
".",
"groupby",
")",
".",
"transform",
"(",
"arg",
",",
"*",
"args",
",",
"*",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/resample.py#L293-L311 | |
apple/swift-clang | d7403439fc6641751840b723e7165fb02f52db95 | bindings/python/clang/cindex.py | python | Cursor.get_included_file | (self) | return conf.lib.clang_getIncludedFile(self) | Returns the File that is included by the current inclusion cursor. | Returns the File that is included by the current inclusion cursor. | [
"Returns",
"the",
"File",
"that",
"is",
"included",
"by",
"the",
"current",
"inclusion",
"cursor",
"."
] | def get_included_file(self):
"""Returns the File that is included by the current inclusion cursor."""
assert self.kind == CursorKind.INCLUSION_DIRECTIVE
return conf.lib.clang_getIncludedFile(self) | [
"def",
"get_included_file",
"(",
"self",
")",
":",
"assert",
"self",
".",
"kind",
"==",
"CursorKind",
".",
"INCLUSION_DIRECTIVE",
"return",
"conf",
".",
"lib",
".",
"clang_getIncludedFile",
"(",
"self",
")"
] | https://github.com/apple/swift-clang/blob/d7403439fc6641751840b723e7165fb02f52db95/bindings/python/clang/cindex.py#L1532-L1536 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py2/prompt_toolkit/buffer.py | python | Buffer.complete_next | (self, count=1, disable_wrap_around=False) | Browse to the next completions.
(Does nothing if there are no completion.) | Browse to the next completions.
(Does nothing if there are no completion.) | [
"Browse",
"to",
"the",
"next",
"completions",
".",
"(",
"Does",
"nothing",
"if",
"there",
"are",
"no",
"completion",
".",
")"
] | def complete_next(self, count=1, disable_wrap_around=False):
"""
Browse to the next completions.
(Does nothing if there are no completion.)
"""
if self.complete_state:
completions_count = len(self.complete_state.current_completions)
if self.complete_state... | [
"def",
"complete_next",
"(",
"self",
",",
"count",
"=",
"1",
",",
"disable_wrap_around",
"=",
"False",
")",
":",
"if",
"self",
".",
"complete_state",
":",
"completions_count",
"=",
"len",
"(",
"self",
".",
"complete_state",
".",
"current_completions",
")",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/buffer.py#L708-L725 | ||
openweave/openweave-core | 11ceb6b7efd39fe05de7f79229247a5774d56766 | src/device-manager/python/weave-device-mgr.py | python | DeviceMgrCmd.do_startsystemtest | (self, line) | start-system-test <product-name> <test-id>
Start system test on a device.
<product-name>: thermostat
<product-name>: topaz | start-system-test <product-name> <test-id> | [
"start",
"-",
"system",
"-",
"test",
"<product",
"-",
"name",
">",
"<test",
"-",
"id",
">"
] | def do_startsystemtest(self, line):
"""
start-system-test <product-name> <test-id>
Start system test on a device.
<product-name>: thermostat
<product-name>: topaz
"""
args = shlex.split(line)
if (len(args) != 2):
print("Usage:")... | [
"def",
"do_startsystemtest",
"(",
"self",
",",
"line",
")",
":",
"args",
"=",
"shlex",
".",
"split",
"(",
"line",
")",
"if",
"(",
"len",
"(",
"args",
")",
"!=",
"2",
")",
":",
"print",
"(",
"\"Usage:\"",
")",
"self",
".",
"do_help",
"(",
"'start-sy... | https://github.com/openweave/openweave-core/blob/11ceb6b7efd39fe05de7f79229247a5774d56766/src/device-manager/python/weave-device-mgr.py#L2459-L2491 | ||
etternagame/etterna | 8775f74ac9c353320128609d4b4150672e9a6d04 | extern/crashpad/buildtools/checkdeps/builddeps.py | python | _GitSourceDirectories | (base_directory) | return git_source_directories | Returns set of normalized paths to subdirectories containing sources
managed by git. | Returns set of normalized paths to subdirectories containing sources
managed by git. | [
"Returns",
"set",
"of",
"normalized",
"paths",
"to",
"subdirectories",
"containing",
"sources",
"managed",
"by",
"git",
"."
] | def _GitSourceDirectories(base_directory):
"""Returns set of normalized paths to subdirectories containing sources
managed by git."""
base_dir_norm = NormalizePath(base_directory)
git_source_directories = set([base_dir_norm])
git_cmd = 'git.bat' if os.name == 'nt' else 'git'
git_ls_files_cmd = [git_cmd, 'l... | [
"def",
"_GitSourceDirectories",
"(",
"base_directory",
")",
":",
"base_dir_norm",
"=",
"NormalizePath",
"(",
"base_directory",
")",
"git_source_directories",
"=",
"set",
"(",
"[",
"base_dir_norm",
"]",
")",
"git_cmd",
"=",
"'git.bat'",
"if",
"os",
".",
"name",
"... | https://github.com/etternagame/etterna/blob/8775f74ac9c353320128609d4b4150672e9a6d04/extern/crashpad/buildtools/checkdeps/builddeps.py#L50-L78 | |
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/pybind/mgr/dashboard/services/exception.py | python | serialize_dashboard_exception | (e, include_http_status=False, task=None) | return out | :type e: Exception
:param include_http_status: Used for Tasks, where the HTTP status code is not available. | :type e: Exception
:param include_http_status: Used for Tasks, where the HTTP status code is not available. | [
":",
"type",
"e",
":",
"Exception",
":",
"param",
"include_http_status",
":",
"Used",
"for",
"Tasks",
"where",
"the",
"HTTP",
"status",
"code",
"is",
"not",
"available",
"."
] | def serialize_dashboard_exception(e, include_http_status=False, task=None):
"""
:type e: Exception
:param include_http_status: Used for Tasks, where the HTTP status code is not available.
"""
from ..tools import ViewCache
if isinstance(e, ViewCacheNoDataException):
return {'status': View... | [
"def",
"serialize_dashboard_exception",
"(",
"e",
",",
"include_http_status",
"=",
"False",
",",
"task",
"=",
"None",
")",
":",
"from",
".",
".",
"tools",
"import",
"ViewCache",
"if",
"isinstance",
"(",
"e",
",",
"ViewCacheNoDataException",
")",
":",
"return",... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/dashboard/services/exception.py#L19-L39 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/src/robotsim.py | python | RobotModel.configFromDrivers | (self, driverValues: "doubleVector") | return _robotsim.RobotModel_configFromDrivers(self, driverValues) | r"""
configFromDrivers(RobotModel self, doubleVector driverValues)
Converts a list of driver values (length numDrivers()) to a full configuration
(length numLinks()). | r"""
configFromDrivers(RobotModel self, doubleVector driverValues) | [
"r",
"configFromDrivers",
"(",
"RobotModel",
"self",
"doubleVector",
"driverValues",
")"
] | def configFromDrivers(self, driverValues: "doubleVector") -> "void":
r"""
configFromDrivers(RobotModel self, doubleVector driverValues)
Converts a list of driver values (length numDrivers()) to a full configuration
(length numLinks()).
"""
return _robotsim.RobotModel... | [
"def",
"configFromDrivers",
"(",
"self",
",",
"driverValues",
":",
"\"doubleVector\"",
")",
"->",
"\"void\"",
":",
"return",
"_robotsim",
".",
"RobotModel_configFromDrivers",
"(",
"self",
",",
"driverValues",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L5393-L5402 | |
microsoft/clang | 86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5 | bindings/python/clang/cindex.py | python | TokenGroup.get_tokens | (tu, extent) | Helper method to return all tokens in an extent.
This functionality is needed multiple places in this module. We define
it here because it seems like a logical place. | Helper method to return all tokens in an extent. | [
"Helper",
"method",
"to",
"return",
"all",
"tokens",
"in",
"an",
"extent",
"."
] | def get_tokens(tu, extent):
"""Helper method to return all tokens in an extent.
This functionality is needed multiple places in this module. We define
it here because it seems like a logical place.
"""
tokens_memory = POINTER(Token)()
tokens_count = c_uint()
con... | [
"def",
"get_tokens",
"(",
"tu",
",",
"extent",
")",
":",
"tokens_memory",
"=",
"POINTER",
"(",
"Token",
")",
"(",
")",
"tokens_count",
"=",
"c_uint",
"(",
")",
"conf",
".",
"lib",
".",
"clang_tokenize",
"(",
"tu",
",",
"extent",
",",
"byref",
"(",
"t... | https://github.com/microsoft/clang/blob/86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5/bindings/python/clang/cindex.py#L527-L557 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pydecimal.py | python | Decimal.is_zero | (self) | return not self._is_special and self._int == '0' | Return True if self is a zero; otherwise return False. | Return True if self is a zero; otherwise return False. | [
"Return",
"True",
"if",
"self",
"is",
"a",
"zero",
";",
"otherwise",
"return",
"False",
"."
] | def is_zero(self):
"""Return True if self is a zero; otherwise return False."""
return not self._is_special and self._int == '0' | [
"def",
"is_zero",
"(",
"self",
")",
":",
"return",
"not",
"self",
".",
"_is_special",
"and",
"self",
".",
"_int",
"==",
"'0'"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pydecimal.py#L3163-L3165 | |
GJDuck/LowFat | ecf6a0f0fa1b73a27a626cf493cc39e477b6faea | llvm-4.0.0.src/utils/lit/lit/run.py | python | Run.execute_tests | (self, display, jobs, max_time=None,
use_processes=False) | execute_tests(display, jobs, [max_time])
Execute each of the tests in the run, using up to jobs number of
parallel tasks, and inform the display of each individual result. The
provided tests should be a subset of the tests available in this run
object.
If max_time is non-None, ... | execute_tests(display, jobs, [max_time]) | [
"execute_tests",
"(",
"display",
"jobs",
"[",
"max_time",
"]",
")"
] | def execute_tests(self, display, jobs, max_time=None,
use_processes=False):
"""
execute_tests(display, jobs, [max_time])
Execute each of the tests in the run, using up to jobs number of
parallel tasks, and inform the display of each individual result. The
p... | [
"def",
"execute_tests",
"(",
"self",
",",
"display",
",",
"jobs",
",",
"max_time",
"=",
"None",
",",
"use_processes",
"=",
"False",
")",
":",
"# Choose the appropriate parallel execution implementation.",
"consumer",
"=",
"None",
"if",
"jobs",
"!=",
"1",
"and",
... | https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/utils/lit/lit/run.py#L205-L290 | ||
cisco-open-source/qtwebdriver | 161780d3e816fc9dd52ad1af3933f0ecd77e05bd | src/base/android/jni_generator/jni_generator.py | python | JavaParamToJni | (param) | Converts a java param into a JNI signature type. | Converts a java param into a JNI signature type. | [
"Converts",
"a",
"java",
"param",
"into",
"a",
"JNI",
"signature",
"type",
"."
] | def JavaParamToJni(param):
"""Converts a java param into a JNI signature type."""
pod_param_map = {
'int': 'I',
'boolean': 'Z',
'long': 'J',
'double': 'D',
'float': 'F',
'byte': 'B',
'void': 'V',
}
object_param_list = [
'Ljava/lang/Boolean',
'Ljava/lang/Inte... | [
"def",
"JavaParamToJni",
"(",
"param",
")",
":",
"pod_param_map",
"=",
"{",
"'int'",
":",
"'I'",
",",
"'boolean'",
":",
"'Z'",
",",
"'long'",
":",
"'J'",
",",
"'double'",
":",
"'D'",
",",
"'float'",
":",
"'F'",
",",
"'byte'",
":",
"'B'",
",",
"'void'... | https://github.com/cisco-open-source/qtwebdriver/blob/161780d3e816fc9dd52ad1af3933f0ecd77e05bd/src/base/android/jni_generator/jni_generator.py#L116-L223 | ||
hakuna-m/wubiuefi | caec1af0a09c78fd5a345180ada1fe45e0c63493 | src/openpgp/sap/msg/SignedMsg.py | python | SignedMsg.list_target_keyids | (self) | return [k.body.keyid for k in self.sigs if hasattr(k.body, 'keyid')] | List all signing key IDs. | List all signing key IDs. | [
"List",
"all",
"signing",
"key",
"IDs",
"."
] | def list_target_keyids(self):
"""List all signing key IDs.
"""
return [k.body.keyid for k in self.sigs if hasattr(k.body, 'keyid')] | [
"def",
"list_target_keyids",
"(",
"self",
")",
":",
"return",
"[",
"k",
".",
"body",
".",
"keyid",
"for",
"k",
"in",
"self",
".",
"sigs",
"if",
"hasattr",
"(",
"k",
".",
"body",
",",
"'keyid'",
")",
"]"
] | https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/openpgp/sap/msg/SignedMsg.py#L24-L27 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | contrib/src/sceneeditor/seSelection.py | python | SelectedNodePaths.getDeselectedDict | (self, id) | Search deselectedDict for node path, try to repair broken node paths. | Search deselectedDict for node path, try to repair broken node paths. | [
"Search",
"deselectedDict",
"for",
"node",
"path",
"try",
"to",
"repair",
"broken",
"node",
"paths",
"."
] | def getDeselectedDict(self, id):
"""
Search deselectedDict for node path, try to repair broken node paths.
"""
dnp = self.deselectedDict.get(id, None)
if dnp:
# Yes
return dnp
else:
# Not in deselected dictionary
return None | [
"def",
"getDeselectedDict",
"(",
"self",
",",
"id",
")",
":",
"dnp",
"=",
"self",
".",
"deselectedDict",
".",
"get",
"(",
"id",
",",
"None",
")",
"if",
"dnp",
":",
"# Yes",
"return",
"dnp",
"else",
":",
"# Not in deselected dictionary",
"return",
"None"
] | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/contrib/src/sceneeditor/seSelection.py#L146-L156 | ||
qt/qt | 0a2f2382541424726168804be2c90b91381608c6 | src/3rdparty/webkit/Source/ThirdParty/gyp/pylib/gyp/generator/msvs.py | python | _GenerateMSVSProject | (project, options, version) | Generates a .vcproj file. It may create .rules and .user files too.
Arguments:
project: The project object we will generate the file for.
options: Global options passed to the generator.
version: The VisualStudioVersion object. | Generates a .vcproj file. It may create .rules and .user files too. | [
"Generates",
"a",
".",
"vcproj",
"file",
".",
"It",
"may",
"create",
".",
"rules",
"and",
".",
"user",
"files",
"too",
"."
] | def _GenerateMSVSProject(project, options, version):
"""Generates a .vcproj file. It may create .rules and .user files too.
Arguments:
project: The project object we will generate the file for.
options: Global options passed to the generator.
version: The VisualStudioVersion object.
"""
spec = pro... | [
"def",
"_GenerateMSVSProject",
"(",
"project",
",",
"options",
",",
"version",
")",
":",
"spec",
"=",
"project",
".",
"spec",
"vcproj_dir",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"project",
".",
"path",
")",
"if",
"vcproj_dir",
"and",
"not",
"os",
... | https://github.com/qt/qt/blob/0a2f2382541424726168804be2c90b91381608c6/src/3rdparty/webkit/Source/ThirdParty/gyp/pylib/gyp/generator/msvs.py#L729-L786 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/optimize/_minimize.py | python | minimize | (fun, x0, args=(), method=None, jac=None, hess=None,
hessp=None, bounds=None, constraints=(), tol=None,
callback=None, options=None) | Minimization of scalar function of one or more variables.
Parameters
----------
fun : callable
The objective function to be minimized.
``fun(x, *args) -> float``
where x is an 1-D array with shape (n,) and `args`
is a tuple of the fixed parameters needed to completely
... | Minimization of scalar function of one or more variables. | [
"Minimization",
"of",
"scalar",
"function",
"of",
"one",
"or",
"more",
"variables",
"."
] | def minimize(fun, x0, args=(), method=None, jac=None, hess=None,
hessp=None, bounds=None, constraints=(), tol=None,
callback=None, options=None):
"""Minimization of scalar function of one or more variables.
Parameters
----------
fun : callable
The objective function to... | [
"def",
"minimize",
"(",
"fun",
",",
"x0",
",",
"args",
"=",
"(",
")",
",",
"method",
"=",
"None",
",",
"jac",
"=",
"None",
",",
"hess",
"=",
"None",
",",
"hessp",
"=",
"None",
",",
"bounds",
"=",
"None",
",",
"constraints",
"=",
"(",
")",
",",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/optimize/_minimize.py#L42-L627 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/multiprocessing/__init__.py | python | allow_connection_pickling | () | Install support for sending connections and sockets between processes | Install support for sending connections and sockets between processes | [
"Install",
"support",
"for",
"sending",
"connections",
"and",
"sockets",
"between",
"processes"
] | def allow_connection_pickling():
'''
Install support for sending connections and sockets between processes
'''
from multiprocessing import reduction | [
"def",
"allow_connection_pickling",
"(",
")",
":",
"from",
"multiprocessing",
"import",
"reduction"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/multiprocessing/__init__.py#L161-L165 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/distutils/spawn.py | python | _nt_quote_args | (args) | return args | Quote command-line arguments for DOS/Windows conventions: just
wraps every argument which contains blanks in double quotes, and
returns a new argument list. | Quote command-line arguments for DOS/Windows conventions: just
wraps every argument which contains blanks in double quotes, and
returns a new argument list. | [
"Quote",
"command",
"-",
"line",
"arguments",
"for",
"DOS",
"/",
"Windows",
"conventions",
":",
"just",
"wraps",
"every",
"argument",
"which",
"contains",
"blanks",
"in",
"double",
"quotes",
"and",
"returns",
"a",
"new",
"argument",
"list",
"."
] | def _nt_quote_args (args):
"""Quote command-line arguments for DOS/Windows conventions: just
wraps every argument which contains blanks in double quotes, and
returns a new argument list.
"""
# XXX this doesn't seem very robust to me -- but if the Windows guys
# say it'll work, I guess I'll have... | [
"def",
"_nt_quote_args",
"(",
"args",
")",
":",
"# XXX this doesn't seem very robust to me -- but if the Windows guys",
"# say it'll work, I guess I'll have to accept it. (What if an arg",
"# contains quotes? What other magic characters, other than spaces,",
"# have to be escaped? Is there an e... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/distutils/spawn.py#L49-L64 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/integrate/quadrature.py | python | romb | (y, dx=1.0, axis=-1, show=False) | return R[(k, k)] | Romberg integration using samples of a function.
Parameters
----------
y : array_like
A vector of ``2**k + 1`` equally-spaced samples of a function.
dx : float, optional
The sample spacing. Default is 1.
axis : int, optional
The axis along which to integrate. Default is -1 (... | Romberg integration using samples of a function. | [
"Romberg",
"integration",
"using",
"samples",
"of",
"a",
"function",
"."
] | def romb(y, dx=1.0, axis=-1, show=False):
"""
Romberg integration using samples of a function.
Parameters
----------
y : array_like
A vector of ``2**k + 1`` equally-spaced samples of a function.
dx : float, optional
The sample spacing. Default is 1.
axis : int, optional
... | [
"def",
"romb",
"(",
"y",
",",
"dx",
"=",
"1.0",
",",
"axis",
"=",
"-",
"1",
",",
"show",
"=",
"False",
")",
":",
"y",
"=",
"np",
".",
"asarray",
"(",
"y",
")",
"nd",
"=",
"len",
"(",
"y",
".",
"shape",
")",
"Nsamps",
"=",
"y",
".",
"shape... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/integrate/quadrature.py#L436-L527 | |
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/google/protobuf/internal/containers.py | python | RepeatedScalarFieldContainer.__delitem__ | (self, key) | Deletes the item at the specified position. | Deletes the item at the specified position. | [
"Deletes",
"the",
"item",
"at",
"the",
"specified",
"position",
"."
] | def __delitem__(self, key):
"""Deletes the item at the specified position."""
del self._values[key]
self._message_listener.Modified() | [
"def",
"__delitem__",
"(",
"self",
",",
"key",
")",
":",
"del",
"self",
".",
"_values",
"[",
"key",
"]",
"self",
".",
"_message_listener",
".",
"Modified",
"(",
")"
] | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/internal/containers.py#L320-L323 | ||
DGA-MI-SSI/YaCo | 9b85e6ca1809114c4df1382c11255f7e38408912 | deps/libxml2-2.7.8/xstc/xstc.py | python | XSTCTestCase.addLibLog | (self, msg) | This one is intended to be used by the error handler
function | This one is intended to be used by the error handler
function | [
"This",
"one",
"is",
"intended",
"to",
"be",
"used",
"by",
"the",
"error",
"handler",
"function"
] | def addLibLog(self, msg):
"""This one is intended to be used by the error handler
function"""
global options
if not options.silent:
self.libLog.append(msg) | [
"def",
"addLibLog",
"(",
"self",
",",
"msg",
")",
":",
"global",
"options",
"if",
"not",
"options",
".",
"silent",
":",
"self",
".",
"libLog",
".",
"append",
"(",
"msg",
")"
] | https://github.com/DGA-MI-SSI/YaCo/blob/9b85e6ca1809114c4df1382c11255f7e38408912/deps/libxml2-2.7.8/xstc/xstc.py#L222-L227 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Menu.yposition | (self, index) | return getint(self.tk.call(
self._w, 'yposition', index)) | Return the y-position of the topmost pixel of the menu item at INDEX. | Return the y-position of the topmost pixel of the menu item at INDEX. | [
"Return",
"the",
"y",
"-",
"position",
"of",
"the",
"topmost",
"pixel",
"of",
"the",
"menu",
"item",
"at",
"INDEX",
"."
] | def yposition(self, index):
"""Return the y-position of the topmost pixel of the menu item at INDEX."""
return getint(self.tk.call(
self._w, 'yposition', index)) | [
"def",
"yposition",
"(",
"self",
",",
"index",
")",
":",
"return",
"getint",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'yposition'",
",",
"index",
")",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2749-L2752 | |
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Node/FS.py | python | Entry.get_contents | (self) | return SCons.Node._get_contents_map[self._func_get_contents](self) | Fetch the contents of the entry. Returns the exact binary
contents of the file. | Fetch the contents of the entry. Returns the exact binary
contents of the file. | [
"Fetch",
"the",
"contents",
"of",
"the",
"entry",
".",
"Returns",
"the",
"exact",
"binary",
"contents",
"of",
"the",
"file",
"."
] | def get_contents(self):
"""Fetch the contents of the entry. Returns the exact binary
contents of the file."""
return SCons.Node._get_contents_map[self._func_get_contents](self) | [
"def",
"get_contents",
"(",
"self",
")",
":",
"return",
"SCons",
".",
"Node",
".",
"_get_contents_map",
"[",
"self",
".",
"_func_get_contents",
"]",
"(",
"self",
")"
] | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Node/FS.py#L1027-L1030 | |
Cantera/cantera | 0119484b261967ccb55a0066c020599cacc312e4 | interfaces/cython/cantera/onedim.py | python | CounterflowDiffusionFlame.mixture_fraction | (self, m) | return vals | r"""
Compute the mixture fraction based on element *m* or from the
Bilger mixture fraction (m="Bilger")
The mixture fraction is computed from the elemental mass fraction of
element *m*, normalized by its values on the fuel and oxidizer
inlets:
.. math:: Z = \frac{Z_{\ma... | r"""
Compute the mixture fraction based on element *m* or from the
Bilger mixture fraction (m="Bilger") | [
"r",
"Compute",
"the",
"mixture",
"fraction",
"based",
"on",
"element",
"*",
"m",
"*",
"or",
"from",
"the",
"Bilger",
"mixture",
"fraction",
"(",
"m",
"=",
"Bilger",
")"
] | def mixture_fraction(self, m):
r"""
Compute the mixture fraction based on element *m* or from the
Bilger mixture fraction (m="Bilger")
The mixture fraction is computed from the elemental mass fraction of
element *m*, normalized by its values on the fuel and oxidizer
inle... | [
"def",
"mixture_fraction",
"(",
"self",
",",
"m",
")",
":",
"Yf",
"=",
"[",
"self",
".",
"solution",
"(",
"k",
",",
"0",
")",
"for",
"k",
"in",
"self",
".",
"gas",
".",
"species_names",
"]",
"Yo",
"=",
"[",
"self",
".",
"solution",
"(",
"k",
",... | https://github.com/Cantera/cantera/blob/0119484b261967ccb55a0066c020599cacc312e4/interfaces/cython/cantera/onedim.py#L1371-L1412 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/math/so3.py | python | error | (R1,R2) | return moment(R) | Returns a 3D "difference vector" that describes how far R1 is from R2.
More precisely, this is the Lie derivative, which is the rotation vector
representation of R1*R2^T. | Returns a 3D "difference vector" that describes how far R1 is from R2.
More precisely, this is the Lie derivative, which is the rotation vector
representation of R1*R2^T. | [
"Returns",
"a",
"3D",
"difference",
"vector",
"that",
"describes",
"how",
"far",
"R1",
"is",
"from",
"R2",
".",
"More",
"precisely",
"this",
"is",
"the",
"Lie",
"derivative",
"which",
"is",
"the",
"rotation",
"vector",
"representation",
"of",
"R1",
"*",
"R... | def error(R1,R2):
"""Returns a 3D "difference vector" that describes how far R1 is from R2.
More precisely, this is the Lie derivative, which is the rotation vector
representation of R1*R2^T."""
R = mul(R1,inv(R2))
return moment(R) | [
"def",
"error",
"(",
"R1",
",",
"R2",
")",
":",
"R",
"=",
"mul",
"(",
"R1",
",",
"inv",
"(",
"R2",
")",
")",
"return",
"moment",
"(",
"R",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/math/so3.py#L272-L277 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/CoSimulationApplication/python_scripts/co_simulation_analysis.py | python | CoSimulationAnalysis._CreateSolver | (self) | return solver_wrapper_factory.CreateSolverWrapper(self.cosim_settings["solver_settings"], self.models, problem_name) | Create the solver | Create the solver | [
"Create",
"the",
"solver"
] | def _CreateSolver(self):
"""Create the solver
"""
problem_name = self.cosim_settings["problem_data"]["problem_name"].GetString()
return solver_wrapper_factory.CreateSolverWrapper(self.cosim_settings["solver_settings"], self.models, problem_name) | [
"def",
"_CreateSolver",
"(",
"self",
")",
":",
"problem_name",
"=",
"self",
".",
"cosim_settings",
"[",
"\"problem_data\"",
"]",
"[",
"\"problem_name\"",
"]",
".",
"GetString",
"(",
")",
"return",
"solver_wrapper_factory",
".",
"CreateSolverWrapper",
"(",
"self",
... | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/CoSimulationApplication/python_scripts/co_simulation_analysis.py#L104-L108 | |
turi-code/SFrame | 796b9bdfb2fa1b881d82080754643c7e68629cd2 | oss_src/unity/python/sframe/data_structures/sarray.py | python | SArray.where | (cls, condition, istrue, isfalse, dtype=None) | return cls(_proxy=condition.__proxy__.ternary_operator(istrue.__proxy__, isfalse.__proxy__)) | Selects elements from either istrue or isfalse depending on the value
of the condition SArray.
Parameters
----------
condition : SArray
An SArray of values such that for each value, if non-zero, yields a
value from istrue, otherwise from isfalse.
istrue : SArr... | Selects elements from either istrue or isfalse depending on the value
of the condition SArray. | [
"Selects",
"elements",
"from",
"either",
"istrue",
"or",
"isfalse",
"depending",
"on",
"the",
"value",
"of",
"the",
"condition",
"SArray",
"."
] | def where(cls, condition, istrue, isfalse, dtype=None):
"""
Selects elements from either istrue or isfalse depending on the value
of the condition SArray.
Parameters
----------
condition : SArray
An SArray of values such that for each value, if non-zero, yields ... | [
"def",
"where",
"(",
"cls",
",",
"condition",
",",
"istrue",
",",
"isfalse",
",",
"dtype",
"=",
"None",
")",
":",
"true_is_sarray",
"=",
"isinstance",
"(",
"istrue",
",",
"SArray",
")",
"false_is_sarray",
"=",
"isinstance",
"(",
"isfalse",
",",
"SArray",
... | https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/sarray.py#L563-L645 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/mplgraphicsview3d.py | python | MplPlot3dCanvas.clear_3d_plots | (self) | return | Clear all the figures from canvas
:return: | Clear all the figures from canvas
:return: | [
"Clear",
"all",
"the",
"figures",
"from",
"canvas",
":",
"return",
":"
] | def clear_3d_plots(self):
"""
Clear all the figures from canvas
:return:
"""
for plt in self._currPlotList:
# del plt
self._myAxes.collections.remove(plt)
self._currPlotList = []
return | [
"def",
"clear_3d_plots",
"(",
"self",
")",
":",
"for",
"plt",
"in",
"self",
".",
"_currPlotList",
":",
"# del plt",
"self",
".",
"_myAxes",
".",
"collections",
".",
"remove",
"(",
"plt",
")",
"self",
".",
"_currPlotList",
"=",
"[",
"]",
"return"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/mplgraphicsview3d.py#L56-L66 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/jax/nfsp.py | python | NFSP._add_transition | (self, time_step, agent_output) | Adds the new transition using `time_step` to the reservoir buffer.
Transitions are in the form (time_step, agent_output.probs, legal_mask).
Args:
time_step: an instance of rl_environment.TimeStep.
agent_output: an instance of rl_agent.StepOutput. | Adds the new transition using `time_step` to the reservoir buffer. | [
"Adds",
"the",
"new",
"transition",
"using",
"time_step",
"to",
"the",
"reservoir",
"buffer",
"."
] | def _add_transition(self, time_step, agent_output):
"""Adds the new transition using `time_step` to the reservoir buffer.
Transitions are in the form (time_step, agent_output.probs, legal_mask).
Args:
time_step: an instance of rl_environment.TimeStep.
agent_output: an instance of rl_agent.Step... | [
"def",
"_add_transition",
"(",
"self",
",",
"time_step",
",",
"agent_output",
")",
":",
"legal_actions",
"=",
"time_step",
".",
"observations",
"[",
"\"legal_actions\"",
"]",
"[",
"self",
".",
"player_id",
"]",
"legal_actions_mask",
"=",
"np",
".",
"zeros",
"(... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/jax/nfsp.py#L240-L256 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/model/DrillExportModel.py | python | DrillExportModel.getAlgorithmExtentions | (self) | return {k:v for k,v in self._exportExtensions.items()} | Get the extension used for the output file of each export algorithm.
Returns:
dict(str:str): dictionnary algo:extension | Get the extension used for the output file of each export algorithm. | [
"Get",
"the",
"extension",
"used",
"for",
"the",
"output",
"file",
"of",
"each",
"export",
"algorithm",
"."
] | def getAlgorithmExtentions(self):
"""
Get the extension used for the output file of each export algorithm.
Returns:
dict(str:str): dictionnary algo:extension
"""
return {k:v for k,v in self._exportExtensions.items()} | [
"def",
"getAlgorithmExtentions",
"(",
"self",
")",
":",
"return",
"{",
"k",
":",
"v",
"for",
"k",
",",
"v",
"in",
"self",
".",
"_exportExtensions",
".",
"items",
"(",
")",
"}"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/model/DrillExportModel.py#L86-L93 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPML_ALG_PROPERTY.fromBytes | (buffer) | return TpmBuffer(buffer).createObj(TPML_ALG_PROPERTY) | Returns new TPML_ALG_PROPERTY object constructed from its marshaled
representation in the given byte buffer | Returns new TPML_ALG_PROPERTY object constructed from its marshaled
representation in the given byte buffer | [
"Returns",
"new",
"TPML_ALG_PROPERTY",
"object",
"constructed",
"from",
"its",
"marshaled",
"representation",
"in",
"the",
"given",
"byte",
"buffer"
] | def fromBytes(buffer):
""" Returns new TPML_ALG_PROPERTY object constructed from its marshaled
representation in the given byte buffer
"""
return TpmBuffer(buffer).createObj(TPML_ALG_PROPERTY) | [
"def",
"fromBytes",
"(",
"buffer",
")",
":",
"return",
"TpmBuffer",
"(",
"buffer",
")",
".",
"createObj",
"(",
"TPML_ALG_PROPERTY",
")"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L4729-L4733 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/optimize/nonlin.py | python | LowRankMatrix.matvec | (self, v) | return LowRankMatrix._matvec(v, self.alpha, self.cs, self.ds) | Evaluate w = M v | Evaluate w = M v | [
"Evaluate",
"w",
"=",
"M",
"v"
] | def matvec(self, v):
"""Evaluate w = M v"""
if self.collapsed is not None:
return np.dot(self.collapsed, v)
return LowRankMatrix._matvec(v, self.alpha, self.cs, self.ds) | [
"def",
"matvec",
"(",
"self",
",",
"v",
")",
":",
"if",
"self",
".",
"collapsed",
"is",
"not",
"None",
":",
"return",
"np",
".",
"dot",
"(",
"self",
".",
"collapsed",
",",
"v",
")",
"return",
"LowRankMatrix",
".",
"_matvec",
"(",
"v",
",",
"self",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/nonlin.py#L748-L752 | |
raspberrypi/tools | 13474ee775d0c5ec8a7da4fb0a9fa84187abfc87 | arm-bcm2708/arm-bcm2708-linux-gnueabi/share/gdb/python/gdb/types.py | python | make_enum_dict | (enum_type) | return enum_dict | Return a dictionary from a program's enum type.
Arguments:
enum_type: The enum to compute the dictionary for.
Returns:
The dictionary of the enum.
Raises:
TypeError: The type is not an enum. | Return a dictionary from a program's enum type. | [
"Return",
"a",
"dictionary",
"from",
"a",
"program",
"s",
"enum",
"type",
"."
] | def make_enum_dict(enum_type):
"""Return a dictionary from a program's enum type.
Arguments:
enum_type: The enum to compute the dictionary for.
Returns:
The dictionary of the enum.
Raises:
TypeError: The type is not an enum.
"""
if enum_type.code != gdb.TYPE_CODE_ENUM... | [
"def",
"make_enum_dict",
"(",
"enum_type",
")",
":",
"if",
"enum_type",
".",
"code",
"!=",
"gdb",
".",
"TYPE_CODE_ENUM",
":",
"raise",
"TypeError",
"(",
"\"not an enum type\"",
")",
"enum_dict",
"=",
"{",
"}",
"for",
"field",
"in",
"enum_type",
".",
"fields"... | https://github.com/raspberrypi/tools/blob/13474ee775d0c5ec8a7da4fb0a9fa84187abfc87/arm-bcm2708/arm-bcm2708-linux-gnueabi/share/gdb/python/gdb/types.py#L72-L91 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/core/glc_assembler.py | python | GlcAssembler.IsDone | (self, tool_name, form_) | Check whether a job (with given name and base folder) is done or not.
Args:
tool_name: tool name to check if it is present in list of running
processes.
form_: form object to get parameters submitted by client.
Returns:
status of job: {"RUNNING", "SUCCEEDED", "FAILED"}. | Check whether a job (with given name and base folder) is done or not. | [
"Check",
"whether",
"a",
"job",
"(",
"with",
"given",
"name",
"and",
"base",
"folder",
")",
"is",
"done",
"or",
"not",
"."
] | def IsDone(self, tool_name, form_):
"""Check whether a job (with given name and base folder) is done or not.
Args:
tool_name: tool name to check if it is present in list of running
processes.
form_: form object to get parameters submitted by client.
Returns:
status of job... | [
"def",
"IsDone",
"(",
"self",
",",
"tool_name",
",",
"form_",
")",
":",
"base",
"=",
"form_",
".",
"getvalue_path",
"(",
"\"base\"",
")",
"# Extra check to prevent XSS attack.",
"if",
"self",
".",
"IsPathInvalid",
"(",
"{",
"\"base\"",
":",
"base",
"}",
")",... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/core/glc_assembler.py#L665-L689 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/ma/core.py | python | _MaskedBinaryOperation.accumulate | (self, target, axis=0) | return masked_result | Accumulate `target` along `axis` after filling with y fill
value. | Accumulate `target` along `axis` after filling with y fill
value. | [
"Accumulate",
"target",
"along",
"axis",
"after",
"filling",
"with",
"y",
"fill",
"value",
"."
] | def accumulate(self, target, axis=0):
"""Accumulate `target` along `axis` after filling with y fill
value.
"""
tclass = get_masked_subclass(target)
t = filled(target, self.filly)
result = self.f.accumulate(t, axis)
masked_result = result.view(tclass)
retu... | [
"def",
"accumulate",
"(",
"self",
",",
"target",
",",
"axis",
"=",
"0",
")",
":",
"tclass",
"=",
"get_masked_subclass",
"(",
"target",
")",
"t",
"=",
"filled",
"(",
"target",
",",
"self",
".",
"filly",
")",
"result",
"=",
"self",
".",
"f",
".",
"ac... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/ma/core.py#L1110-L1119 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/mozbuild/mozbuild/backend/recursivemake.py | python | RecursiveMakeBackend._process_hierarchy_elements | (self, obj, element, namespace, action) | Walks the ``HierarchicalStringList`` ``element`` and performs
``action`` on each HierarchicalStringList in the hierarchy.
``action`` is a callback to be invoked with the following arguments:
- ``element`` - The HierarchicalStringList along the current namespace
- ``namespace`` - T... | Walks the ``HierarchicalStringList`` ``element`` and performs
``action`` on each HierarchicalStringList in the hierarchy. | [
"Walks",
"the",
"HierarchicalStringList",
"element",
"and",
"performs",
"action",
"on",
"each",
"HierarchicalStringList",
"in",
"the",
"hierarchy",
"."
] | def _process_hierarchy_elements(self, obj, element, namespace, action):
"""Walks the ``HierarchicalStringList`` ``element`` and performs
``action`` on each HierarchicalStringList in the hierarchy.
``action`` is a callback to be invoked with the following arguments:
- ``element`` - T... | [
"def",
"_process_hierarchy_elements",
"(",
"self",
",",
"obj",
",",
"element",
",",
"namespace",
",",
"action",
")",
":",
"if",
"namespace",
":",
"namespace",
"+=",
"'/'",
"action",
"(",
"element",
",",
"namespace",
")",
"children",
"=",
"element",
".",
"g... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozbuild/backend/recursivemake.py#L831-L848 | ||
indutny/candor | 48e7260618f5091c80a3416828e2808cad3ea22e | tools/gyp/pylib/gyp/MSVSSettings.py | python | ConvertToMSBuildSettings | (msvs_settings, stderr=sys.stderr) | return msbuild_settings | Converts MSVS settings (VS2008 and earlier) to MSBuild settings (VS2010+).
Args:
msvs_settings: A dictionary. The key is the tool name. The values are
themselves dictionaries of settings and their values.
stderr: The stream receiving the error messages.
Returns:
A dictionary of MSBui... | Converts MSVS settings (VS2008 and earlier) to MSBuild settings (VS2010+). | [
"Converts",
"MSVS",
"settings",
"(",
"VS2008",
"and",
"earlier",
")",
"to",
"MSBuild",
"settings",
"(",
"VS2010",
"+",
")",
"."
] | def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr):
"""Converts MSVS settings (VS2008 and earlier) to MSBuild settings (VS2010+).
Args:
msvs_settings: A dictionary. The key is the tool name. The values are
themselves dictionaries of settings and their values.
stderr: The stream ... | [
"def",
"ConvertToMSBuildSettings",
"(",
"msvs_settings",
",",
"stderr",
"=",
"sys",
".",
"stderr",
")",
":",
"msbuild_settings",
"=",
"{",
"}",
"for",
"msvs_tool_name",
",",
"msvs_tool_settings",
"in",
"msvs_settings",
".",
"iteritems",
"(",
")",
":",
"if",
"m... | https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/MSVSSettings.py#L406-L439 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | DateTime_Today | (*args) | return _misc_.DateTime_Today(*args) | DateTime_Today() -> DateTime | DateTime_Today() -> DateTime | [
"DateTime_Today",
"()",
"-",
">",
"DateTime"
] | def DateTime_Today(*args):
"""DateTime_Today() -> DateTime"""
return _misc_.DateTime_Today(*args) | [
"def",
"DateTime_Today",
"(",
"*",
"args",
")",
":",
"return",
"_misc_",
".",
"DateTime_Today",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L4309-L4311 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py3/prompt_toolkit/application/run_in_terminal.py | python | run_in_terminal | (
func: Callable[[], _T], render_cli_done: bool = False, in_executor: bool = False
) | return ensure_future(run()) | Run function on the terminal above the current application or prompt.
What this does is first hiding the prompt, then running this callable
(which can safely output to the terminal), and then again rendering the
prompt which causes the output of this function to scroll above the
prompt.
``func`` i... | Run function on the terminal above the current application or prompt. | [
"Run",
"function",
"on",
"the",
"terminal",
"above",
"the",
"current",
"application",
"or",
"prompt",
"."
] | def run_in_terminal(
func: Callable[[], _T], render_cli_done: bool = False, in_executor: bool = False
) -> Awaitable[_T]:
"""
Run function on the terminal above the current application or prompt.
What this does is first hiding the prompt, then running this callable
(which can safely output to the t... | [
"def",
"run_in_terminal",
"(",
"func",
":",
"Callable",
"[",
"[",
"]",
",",
"_T",
"]",
",",
"render_cli_done",
":",
"bool",
"=",
"False",
",",
"in_executor",
":",
"bool",
"=",
"False",
")",
"->",
"Awaitable",
"[",
"_T",
"]",
":",
"async",
"def",
"run... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/application/run_in_terminal.py#L26-L58 | |
tangzhenyu/Scene-Text-Understanding | 0f7ffc7aea5971a50cdc03d33d0a41075285948b | ctpn_crnn_ocr/CTPN/caffe/scripts/cpp_lint.py | python | ProcessLine | (filename, file_extension, clean_lines, line,
include_state, function_state, nesting_state, error,
extra_check_functions=[]) | Processes a single line in the file.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (dot not included) of the file.
clean_lines: An array of strings, each representing a line of the file,
with comments stripped.
line: Number of line being ... | Processes a single line in the file. | [
"Processes",
"a",
"single",
"line",
"in",
"the",
"file",
"."
] | def ProcessLine(filename, file_extension, clean_lines, line,
include_state, function_state, nesting_state, error,
extra_check_functions=[]):
"""Processes a single line in the file.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (d... | [
"def",
"ProcessLine",
"(",
"filename",
",",
"file_extension",
",",
"clean_lines",
",",
"line",
",",
"include_state",
",",
"function_state",
",",
"nesting_state",
",",
"error",
",",
"extra_check_functions",
"=",
"[",
"]",
")",
":",
"raw_lines",
"=",
"clean_lines"... | https://github.com/tangzhenyu/Scene-Text-Understanding/blob/0f7ffc7aea5971a50cdc03d33d0a41075285948b/ctpn_crnn_ocr/CTPN/caffe/scripts/cpp_lint.py#L4600-L4642 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | ListCtrl.SetItemColumnImage | (*args, **kwargs) | return _controls_.ListCtrl_SetItemColumnImage(*args, **kwargs) | SetItemColumnImage(self, long item, long column, int image) -> bool | SetItemColumnImage(self, long item, long column, int image) -> bool | [
"SetItemColumnImage",
"(",
"self",
"long",
"item",
"long",
"column",
"int",
"image",
")",
"-",
">",
"bool"
] | def SetItemColumnImage(*args, **kwargs):
"""SetItemColumnImage(self, long item, long column, int image) -> bool"""
return _controls_.ListCtrl_SetItemColumnImage(*args, **kwargs) | [
"def",
"SetItemColumnImage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListCtrl_SetItemColumnImage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L4535-L4537 | |
baidu/Familia | 958febfd5fe7a61e46a35bfb084e71f806dde6a6 | tools/TopicMerge/topic_model_merge.py | python | TopicModelMerge.reduce_topic | (self, topk, Jac_thresh, Jac_opt, output_file) | 根据Jaccard Similarity对冗余主题进行压缩
Args:
topk: 每个主题取的词个数
Jac_thresh: 阈值,Jaccard Similarity高于该值则当成冗余主题对
Jac_opt: 0 表示选用Jaccard Similarity,1表示选用Weighted Jaccard Similarity
output_file: 去重模型保存文件
Returns:
None | 根据Jaccard Similarity对冗余主题进行压缩 | [
"根据Jaccard",
"Similarity对冗余主题进行压缩"
] | def reduce_topic(self, topk, Jac_thresh, Jac_opt, output_file):
"""
根据Jaccard Similarity对冗余主题进行压缩
Args:
topk: 每个主题取的词个数
Jac_thresh: 阈值,Jaccard Similarity高于该值则当成冗余主题对
Jac_opt: 0 表示选用Jaccard Similarity,1表示选用Weighted Jaccard Similarity
output_file: 去... | [
"def",
"reduce_topic",
"(",
"self",
",",
"topk",
",",
"Jac_thresh",
",",
"Jac_opt",
",",
"output_file",
")",
":",
"topic_word",
",",
"topic_sum",
"=",
"self",
".",
"conv_topic_word",
"(",
")",
"topk_items",
"=",
"self",
".",
"select_topk",
"(",
"topic_word",... | https://github.com/baidu/Familia/blob/958febfd5fe7a61e46a35bfb084e71f806dde6a6/tools/TopicMerge/topic_model_merge.py#L142-L219 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/bisect.py | python | bisect_right | (a, x, lo=0, hi=None) | return lo | Return the index where to insert item x in list a, assuming a is sorted.
The return value i is such that all e in a[:i] have e <= x, and all e in
a[i:] have e > x. So if x already appears in the list, a.insert(x) will
insert just after the rightmost x already there.
Optional args lo (default 0) and h... | Return the index where to insert item x in list a, assuming a is sorted. | [
"Return",
"the",
"index",
"where",
"to",
"insert",
"item",
"x",
"in",
"list",
"a",
"assuming",
"a",
"is",
"sorted",
"."
] | def bisect_right(a, x, lo=0, hi=None):
"""Return the index where to insert item x in list a, assuming a is sorted.
The return value i is such that all e in a[:i] have e <= x, and all e in
a[i:] have e > x. So if x already appears in the list, a.insert(x) will
insert just after the rightmost x already ... | [
"def",
"bisect_right",
"(",
"a",
",",
"x",
",",
"lo",
"=",
"0",
",",
"hi",
"=",
"None",
")",
":",
"if",
"lo",
"<",
"0",
":",
"raise",
"ValueError",
"(",
"'lo must be non-negative'",
")",
"if",
"hi",
"is",
"None",
":",
"hi",
"=",
"len",
"(",
"a",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/bisect.py#L24-L43 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py | python | _CudnnRNN.__init__ | (self,
rnn_mode,
num_layers,
num_units,
input_size,
input_mode=CUDNN_INPUT_LINEAR_MODE,
direction=CUDNN_RNN_UNIDIRECTION,
dtype=dtypes.float32,
dropout=0.,
seed=0,
num_pr... | Creates a CudnnRNN model from model spec.
Args:
rnn_mode: a string specifies the mode, under which this RNN model runs.
Could be either 'lstm', 'gru', 'rnn_tanh' or 'rnn_relu'.
num_layers: the number of layers for the RNN model.
num_units: the number of units within the RNN model.
i... | Creates a CudnnRNN model from model spec. | [
"Creates",
"a",
"CudnnRNN",
"model",
"from",
"model",
"spec",
"."
] | def __init__(self,
rnn_mode,
num_layers,
num_units,
input_size,
input_mode=CUDNN_INPUT_LINEAR_MODE,
direction=CUDNN_RNN_UNIDIRECTION,
dtype=dtypes.float32,
dropout=0.,
seed=0,
... | [
"def",
"__init__",
"(",
"self",
",",
"rnn_mode",
",",
"num_layers",
",",
"num_units",
",",
"input_size",
",",
"input_mode",
"=",
"CUDNN_INPUT_LINEAR_MODE",
",",
"direction",
"=",
"CUDNN_RNN_UNIDIRECTION",
",",
"dtype",
"=",
"dtypes",
".",
"float32",
",",
"dropou... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py#L1655-L1703 | ||
google/skia | 82d65d0487bd72f5f7332d002429ec2dc61d2463 | infra/bots/assets/skp/create.py | python | get_flutter_skps | (target_dir) | Creates SKPs using Flutter's skp_generator tool.
Documentation is at https://github.com/flutter/tests/tree/master/skp_generator | Creates SKPs using Flutter's skp_generator tool. | [
"Creates",
"SKPs",
"using",
"Flutter",
"s",
"skp_generator",
"tool",
"."
] | def get_flutter_skps(target_dir):
"""Creates SKPs using Flutter's skp_generator tool.
Documentation is at https://github.com/flutter/tests/tree/master/skp_generator
"""
with utils.tmp_dir():
print('Retrieving Flutter SKPs...')
utils.git_clone('https://github.com/flutter/tests.git', '.')
os.chdir('s... | [
"def",
"get_flutter_skps",
"(",
"target_dir",
")",
":",
"with",
"utils",
".",
"tmp_dir",
"(",
")",
":",
"print",
"(",
"'Retrieving Flutter SKPs...'",
")",
"utils",
".",
"git_clone",
"(",
"'https://github.com/flutter/tests.git'",
",",
"'.'",
")",
"os",
".",
"chdi... | https://github.com/google/skia/blob/82d65d0487bd72f5f7332d002429ec2dc61d2463/infra/bots/assets/skp/create.py#L45-L64 | ||
facebookincubator/BOLT | 88c70afe9d388ad430cc150cc158641701397f70 | lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py | python | PtyProcess.isatty | (self) | return os.isatty(self.fd) | This returns True if the file descriptor is open and connected to a
tty(-like) device, else False.
On SVR4-style platforms implementing streams, such as SunOS and HP-UX,
the child pty may not appear as a terminal device. This means
methods such as setecho(), setwinsize(), getwinsize() ... | This returns True if the file descriptor is open and connected to a
tty(-like) device, else False. | [
"This",
"returns",
"True",
"if",
"the",
"file",
"descriptor",
"is",
"open",
"and",
"connected",
"to",
"a",
"tty",
"(",
"-",
"like",
")",
"device",
"else",
"False",
"."
] | def isatty(self):
'''This returns True if the file descriptor is open and connected to a
tty(-like) device, else False.
On SVR4-style platforms implementing streams, such as SunOS and HP-UX,
the child pty may not appear as a terminal device. This means
methods such as setecho()... | [
"def",
"isatty",
"(",
"self",
")",
":",
"return",
"os",
".",
"isatty",
"(",
"self",
".",
"fd",
")"
] | https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py#L411-L420 | |
wheybags/freeablo | 921ac20be95828460ccc184a9de11eca5c7c0519 | extern/fmt/support/manage.py | python | create_build_env | () | return env | Create a build environment. | Create a build environment. | [
"Create",
"a",
"build",
"environment",
"."
] | def create_build_env():
"""Create a build environment."""
class Env:
pass
env = Env()
# Import the documentation build module.
env.fmt_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, os.path.join(env.fmt_dir, 'doc'))
import build
env.build_d... | [
"def",
"create_build_env",
"(",
")",
":",
"class",
"Env",
":",
"pass",
"env",
"=",
"Env",
"(",
")",
"# Import the documentation build module.",
"env",
".",
"fmt_dir",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"o... | https://github.com/wheybags/freeablo/blob/921ac20be95828460ccc184a9de11eca5c7c0519/extern/fmt/support/manage.py#L74-L92 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/debug/cli/cli_shared.py | python | parse_ranges_highlight | (ranges_string) | Process ranges highlight string.
Args:
ranges_string: (str) A string representing a numerical range of a list of
numerical ranges. See the help info of the -r flag of the print_tensor
command for more details.
Returns:
An instance of tensor_format.HighlightOptions, if range_string is a valid
... | Process ranges highlight string. | [
"Process",
"ranges",
"highlight",
"string",
"."
] | def parse_ranges_highlight(ranges_string):
"""Process ranges highlight string.
Args:
ranges_string: (str) A string representing a numerical range of a list of
numerical ranges. See the help info of the -r flag of the print_tensor
command for more details.
Returns:
An instance of tensor_forma... | [
"def",
"parse_ranges_highlight",
"(",
"ranges_string",
")",
":",
"ranges",
"=",
"None",
"def",
"ranges_filter",
"(",
"x",
")",
":",
"r",
"=",
"np",
".",
"zeros",
"(",
"x",
".",
"shape",
",",
"dtype",
"=",
"bool",
")",
"for",
"range_start",
",",
"range_... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/cli/cli_shared.py#L111-L138 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/robotsim.py | python | SimBody.isEnabled | (self) | return _robotsim.SimBody_isEnabled(self) | r"""
Returns true if this body is being simulated. | r"""
Returns true if this body is being simulated. | [
"r",
"Returns",
"true",
"if",
"this",
"body",
"is",
"being",
"simulated",
"."
] | def isEnabled(self) ->bool:
r"""
Returns true if this body is being simulated.
"""
return _robotsim.SimBody_isEnabled(self) | [
"def",
"isEnabled",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"_robotsim",
".",
"SimBody_isEnabled",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L7439-L7444 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/devil/devil/utils/mock_calls.py | python | TestCase.call_target | (self, call) | return target | Resolve a self.call instance to the target it represents.
Args:
call: a self.call instance, e.g. self.call.adb.Shell
Returns:
The target object represented by the call, e.g. self.adb.Shell
Raises:
ValueError if the path of the call does not start with "self", i.e. the
target o... | Resolve a self.call instance to the target it represents. | [
"Resolve",
"a",
"self",
".",
"call",
"instance",
"to",
"the",
"target",
"it",
"represents",
"."
] | def call_target(self, call):
"""Resolve a self.call instance to the target it represents.
Args:
call: a self.call instance, e.g. self.call.adb.Shell
Returns:
The target object represented by the call, e.g. self.adb.Shell
Raises:
ValueError if the path of the call does not start with... | [
"def",
"call_target",
"(",
"self",
",",
"call",
")",
":",
"path",
"=",
"call",
".",
"name",
".",
"split",
"(",
"'.'",
")",
"if",
"path",
".",
"pop",
"(",
"0",
")",
"!=",
"'self'",
":",
"raise",
"ValueError",
"(",
"\"Target %r outside of 'self' object\"",... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/utils/mock_calls.py#L75-L96 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/quopri.py | python | needsquoting | (c, quotetabs, header) | return c == ESCAPE or not (b' ' <= c <= b'~') | Decide whether a particular byte ordinal needs to be quoted.
The 'quotetabs' flag indicates whether embedded tabs and spaces should be
quoted. Note that line-ending tabs and spaces are always encoded, as per
RFC 1521. | Decide whether a particular byte ordinal needs to be quoted. | [
"Decide",
"whether",
"a",
"particular",
"byte",
"ordinal",
"needs",
"to",
"be",
"quoted",
"."
] | def needsquoting(c, quotetabs, header):
"""Decide whether a particular byte ordinal needs to be quoted.
The 'quotetabs' flag indicates whether embedded tabs and spaces should be
quoted. Note that line-ending tabs and spaces are always encoded, as per
RFC 1521.
"""
assert isinstance(c, bytes)
... | [
"def",
"needsquoting",
"(",
"c",
",",
"quotetabs",
",",
"header",
")",
":",
"assert",
"isinstance",
"(",
"c",
",",
"bytes",
")",
"if",
"c",
"in",
"b' \\t'",
":",
"return",
"quotetabs",
"# if header, we have to escape _ because _ is used to escape space",
"if",
"c"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/quopri.py#L21-L34 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | PropertyGrid.GenerateEditorButton | (*args, **kwargs) | return _propgrid.PropertyGrid_GenerateEditorButton(*args, **kwargs) | GenerateEditorButton(self, Point pos, Size sz) -> Window | GenerateEditorButton(self, Point pos, Size sz) -> Window | [
"GenerateEditorButton",
"(",
"self",
"Point",
"pos",
"Size",
"sz",
")",
"-",
">",
"Window"
] | def GenerateEditorButton(*args, **kwargs):
"""GenerateEditorButton(self, Point pos, Size sz) -> Window"""
return _propgrid.PropertyGrid_GenerateEditorButton(*args, **kwargs) | [
"def",
"GenerateEditorButton",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGrid_GenerateEditorButton",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L2339-L2341 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/multiprocessing/connection.py | python | arbitrary_address | (family) | Return an arbitrary free address for the given family | Return an arbitrary free address for the given family | [
"Return",
"an",
"arbitrary",
"free",
"address",
"for",
"the",
"given",
"family"
] | def arbitrary_address(family):
'''
Return an arbitrary free address for the given family
'''
if family == 'AF_INET':
return ('localhost', 0)
elif family == 'AF_UNIX':
return tempfile.mktemp(prefix='listener-', dir=get_temp_dir())
elif family == 'AF_PIPE':
return tempfile.... | [
"def",
"arbitrary_address",
"(",
"family",
")",
":",
"if",
"family",
"==",
"'AF_INET'",
":",
"return",
"(",
"'localhost'",
",",
"0",
")",
"elif",
"family",
"==",
"'AF_UNIX'",
":",
"return",
"tempfile",
".",
"mktemp",
"(",
"prefix",
"=",
"'listener-'",
",",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/multiprocessing/connection.py#L83-L95 | ||
OAID/Caffe-HRT | aae71e498ab842c6f92bcc23fc668423615a4d65 | python/caffe/pycaffe.py | python | _Net_blob_loss_weights | (self) | return self._blob_loss_weights_dict | An OrderedDict (bottom to top, i.e., input to output) of network
blob loss weights indexed by name | An OrderedDict (bottom to top, i.e., input to output) of network
blob loss weights indexed by name | [
"An",
"OrderedDict",
"(",
"bottom",
"to",
"top",
"i",
".",
"e",
".",
"input",
"to",
"output",
")",
"of",
"network",
"blob",
"loss",
"weights",
"indexed",
"by",
"name"
] | def _Net_blob_loss_weights(self):
"""
An OrderedDict (bottom to top, i.e., input to output) of network
blob loss weights indexed by name
"""
if not hasattr(self, '_blobs_loss_weights_dict'):
self._blob_loss_weights_dict = OrderedDict(zip(self._blob_names,
... | [
"def",
"_Net_blob_loss_weights",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_blobs_loss_weights_dict'",
")",
":",
"self",
".",
"_blob_loss_weights_dict",
"=",
"OrderedDict",
"(",
"zip",
"(",
"self",
".",
"_blob_names",
",",
"self",
".",... | https://github.com/OAID/Caffe-HRT/blob/aae71e498ab842c6f92bcc23fc668423615a4d65/python/caffe/pycaffe.py#L36-L44 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/logging/__init__.py | python | StreamHandler.__init__ | (self, stream=None) | Initialize the handler.
If stream is not specified, sys.stderr is used. | Initialize the handler. | [
"Initialize",
"the",
"handler",
"."
] | def __init__(self, stream=None):
"""
Initialize the handler.
If stream is not specified, sys.stderr is used.
"""
Handler.__init__(self)
if stream is None:
stream = sys.stderr
self.stream = stream | [
"def",
"__init__",
"(",
"self",
",",
"stream",
"=",
"None",
")",
":",
"Handler",
".",
"__init__",
"(",
"self",
")",
"if",
"stream",
"is",
"None",
":",
"stream",
"=",
"sys",
".",
"stderr",
"self",
".",
"stream",
"=",
"stream"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/logging/__init__.py#L834-L843 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/pyserial/serial/serialwin32.py | python | Win32Serial.getDSR | (self) | return win32.MS_DSR_ON & self._GetCommModemStatus() != 0 | Read terminal status line: Data Set Ready | Read terminal status line: Data Set Ready | [
"Read",
"terminal",
"status",
"line",
":",
"Data",
"Set",
"Ready"
] | def getDSR(self):
"""Read terminal status line: Data Set Ready"""
if not self.hComPort: raise portNotOpenError
return win32.MS_DSR_ON & self._GetCommModemStatus() != 0 | [
"def",
"getDSR",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"hComPort",
":",
"raise",
"portNotOpenError",
"return",
"win32",
".",
"MS_DSR_ON",
"&",
"self",
".",
"_GetCommModemStatus",
"(",
")",
"!=",
"0"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/pyserial/serial/serialwin32.py#L374-L377 | |
qgis/QGIS | 15a77662d4bb712184f6aa60d0bd663010a76a75 | python/pyplugin_installer/installer_data.py | python | Repositories.urlParams | (self) | return "?qgis={}".format(re.sub(r'\.\d*$', '', pyQgisVersion())) | return GET parameters to be added to every request | return GET parameters to be added to every request | [
"return",
"GET",
"parameters",
"to",
"be",
"added",
"to",
"every",
"request"
] | def urlParams(self) -> str:
""" return GET parameters to be added to every request """
# Strip down the point release segment from the version string
return "?qgis={}".format(re.sub(r'\.\d*$', '', pyQgisVersion())) | [
"def",
"urlParams",
"(",
"self",
")",
"->",
"str",
":",
"# Strip down the point release segment from the version string",
"return",
"\"?qgis={}\"",
".",
"format",
"(",
"re",
".",
"sub",
"(",
"r'\\.\\d*$'",
",",
"''",
",",
"pyQgisVersion",
"(",
")",
")",
")"
] | https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/pyplugin_installer/installer_data.py#L208-L211 | |
NREL/EnergyPlus | fadc5973b85c70e8cc923efb69c144e808a26078 | third_party/fmt-8.0.1/support/docopt.py | python | docopt | (doc, argv=None, help=True, version=None, options_first=False) | Parse `argv` based on command-line interface described in `doc`.
`docopt` creates your command-line interface based on its
description that you pass as `doc`. Such description can contain
--options, <positional-argument>, commands, which could be
[optional], (required), (mutually | exclusive) or repeat... | Parse `argv` based on command-line interface described in `doc`. | [
"Parse",
"argv",
"based",
"on",
"command",
"-",
"line",
"interface",
"described",
"in",
"doc",
"."
] | def docopt(doc, argv=None, help=True, version=None, options_first=False):
"""Parse `argv` based on command-line interface described in `doc`.
`docopt` creates your command-line interface based on its
description that you pass as `doc`. Such description can contain
--options, <positional-argument>, comm... | [
"def",
"docopt",
"(",
"doc",
",",
"argv",
"=",
"None",
",",
"help",
"=",
"True",
",",
"version",
"=",
"None",
",",
"options_first",
"=",
"False",
")",
":",
"argv",
"=",
"sys",
".",
"argv",
"[",
"1",
":",
"]",
"if",
"argv",
"is",
"None",
"else",
... | https://github.com/NREL/EnergyPlus/blob/fadc5973b85c70e8cc923efb69c144e808a26078/third_party/fmt-8.0.1/support/docopt.py#L490-L581 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.