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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Slicer/Slicer | ba9fadf332cb0303515b68d8d06a344c82e3e3e5 | Base/Python/slicer/util.py | python | removeParameterEditWidgetConnections | (parameterEditWidgets, updateParameterNodeFromGUI) | Remove connections created by :py:meth:`addParameterEditWidgetConnections`. | Remove connections created by :py:meth:`addParameterEditWidgetConnections`. | [
"Remove",
"connections",
"created",
"by",
":",
"py",
":",
"meth",
":",
"addParameterEditWidgetConnections",
"."
] | def removeParameterEditWidgetConnections(parameterEditWidgets, updateParameterNodeFromGUI):
""" Remove connections created by :py:meth:`addParameterEditWidgetConnections`.
"""
for (widget, parameterName) in parameterEditWidgets:
widgetClassName = widget.className()
if widgetClassName=="QSpinBox":
w... | [
"def",
"removeParameterEditWidgetConnections",
"(",
"parameterEditWidgets",
",",
"updateParameterNodeFromGUI",
")",
":",
"for",
"(",
"widget",
",",
"parameterName",
")",
"in",
"parameterEditWidgets",
":",
"widgetClassName",
"=",
"widget",
".",
"className",
"(",
")",
"... | https://github.com/Slicer/Slicer/blob/ba9fadf332cb0303515b68d8d06a344c82e3e3e5/Base/Python/slicer/util.py#L407-L422 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py | python | AppleScript_Suite_Events._3e_ | (self, _object, _attributes={}, **_arguments) | >: Greater than
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything | >: Greater than
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything | [
">",
":",
"Greater",
"than",
"Required",
"argument",
":",
"an",
"AE",
"object",
"reference",
"Keyword",
"argument",
"_attributes",
":",
"AppleEvent",
"attribute",
"dictionary",
"Returns",
":",
"anything"
] | def _3e_(self, _object, _attributes={}, **_arguments):
""">: Greater than
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything
"""
_code = 'ascr'
_subcode = '> '
if _arguments: raise T... | [
"def",
"_3e_",
"(",
"self",
",",
"_object",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'ascr'",
"_subcode",
"=",
"'> '",
"if",
"_arguments",
":",
"raise",
"TypeError",
",",
"'No optional args expected'",
"_ar... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py#L141-L160 | ||
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/sping/PDF/pdfgen.py | python | Canvas.beginPath | (self) | return PDFPathObject() | Returns a fresh path object | Returns a fresh path object | [
"Returns",
"a",
"fresh",
"path",
"object"
] | def beginPath(self):
"""Returns a fresh path object"""
return PDFPathObject() | [
"def",
"beginPath",
"(",
"self",
")",
":",
"return",
"PDFPathObject",
"(",
")"
] | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/sping/PDF/pdfgen.py#L533-L535 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/optim/lr_scheduler.py | python | _LRScheduler.state_dict | (self) | return {key: value for key, value in self.__dict__.items() if key != 'optimizer'} | Returns the state of the scheduler as a :class:`dict`.
It contains an entry for every variable in self.__dict__ which
is not the optimizer. | Returns the state of the scheduler as a :class:`dict`. | [
"Returns",
"the",
"state",
"of",
"the",
"scheduler",
"as",
"a",
":",
"class",
":",
"dict",
"."
] | def state_dict(self):
"""Returns the state of the scheduler as a :class:`dict`.
It contains an entry for every variable in self.__dict__ which
is not the optimizer.
"""
return {key: value for key, value in self.__dict__.items() if key != 'optimizer'} | [
"def",
"state_dict",
"(",
"self",
")",
":",
"return",
"{",
"key",
":",
"value",
"for",
"key",
",",
"value",
"in",
"self",
".",
"__dict__",
".",
"items",
"(",
")",
"if",
"key",
"!=",
"'optimizer'",
"}"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/optim/lr_scheduler.py#L79-L85 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/wizard.py | python | PyWizardPage.DoSetClientSize | (*args, **kwargs) | return _wizard.PyWizardPage_DoSetClientSize(*args, **kwargs) | DoSetClientSize(self, int width, int height) | DoSetClientSize(self, int width, int height) | [
"DoSetClientSize",
"(",
"self",
"int",
"width",
"int",
"height",
")"
] | def DoSetClientSize(*args, **kwargs):
"""DoSetClientSize(self, int width, int height)"""
return _wizard.PyWizardPage_DoSetClientSize(*args, **kwargs) | [
"def",
"DoSetClientSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_wizard",
".",
"PyWizardPage_DoSetClientSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/wizard.py#L159-L161 | |
swift/swift | 12d031cf8177fdec0137f9aa7e2912fa23c4416b | 3rdParty/SCons/scons-3.0.1/engine/SCons/Node/Alias.py | python | Alias.get_contents | (self) | return ''.join(childsigs) | The contents of an alias is the concatenation
of the content signatures of all its sources. | The contents of an alias is the concatenation
of the content signatures of all its sources. | [
"The",
"contents",
"of",
"an",
"alias",
"is",
"the",
"concatenation",
"of",
"the",
"content",
"signatures",
"of",
"all",
"its",
"sources",
"."
] | def get_contents(self):
"""The contents of an alias is the concatenation
of the content signatures of all its sources."""
childsigs = [n.get_csig() for n in self.children()]
return ''.join(childsigs) | [
"def",
"get_contents",
"(",
"self",
")",
":",
"childsigs",
"=",
"[",
"n",
".",
"get_csig",
"(",
")",
"for",
"n",
"in",
"self",
".",
"children",
"(",
")",
"]",
"return",
"''",
".",
"join",
"(",
"childsigs",
")"
] | https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Node/Alias.py#L130-L134 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/base.py | python | IndexOpsMixin.tolist | (self) | return self._values.tolist() | Return a list of the values.
These are each a scalar type, which is a Python scalar
(for str, int, float) or a pandas scalar
(for Timestamp/Timedelta/Interval/Period)
Returns
-------
list
See Also
--------
numpy.ndarray.tolist : Return the array... | Return a list of the values. | [
"Return",
"a",
"list",
"of",
"the",
"values",
"."
] | def tolist(self):
"""
Return a list of the values.
These are each a scalar type, which is a Python scalar
(for str, int, float) or a pandas scalar
(for Timestamp/Timedelta/Interval/Period)
Returns
-------
list
See Also
--------
n... | [
"def",
"tolist",
"(",
"self",
")",
":",
"if",
"not",
"isinstance",
"(",
"self",
".",
"_values",
",",
"np",
".",
"ndarray",
")",
":",
"# check for ndarray instead of dtype to catch DTA/TDA",
"return",
"list",
"(",
"self",
".",
"_values",
")",
"return",
"self",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/base.py#L713-L733 | |
ablab/quast | 5f6709528129a6ad266a6b24ef3f40b88f0fe04b | quast_libs/site_packages/jsontemplate/jsontemplate.py | python | PrefixRegistry.__init__ | (self, functions) | Args:
functions: List of 2-tuples (prefix, function), e.g.
[('pluralize', _Pluralize), ('cycle', _Cycle)] | Args:
functions: List of 2-tuples (prefix, function), e.g.
[('pluralize', _Pluralize), ('cycle', _Cycle)] | [
"Args",
":",
"functions",
":",
"List",
"of",
"2",
"-",
"tuples",
"(",
"prefix",
"function",
")",
"e",
".",
"g",
".",
"[",
"(",
"pluralize",
"_Pluralize",
")",
"(",
"cycle",
"_Cycle",
")",
"]"
] | def __init__(self, functions):
"""
Args:
functions: List of 2-tuples (prefix, function), e.g.
[('pluralize', _Pluralize), ('cycle', _Cycle)]
"""
self.functions = functions | [
"def",
"__init__",
"(",
"self",
",",
"functions",
")",
":",
"self",
".",
"functions",
"=",
"functions"
] | https://github.com/ablab/quast/blob/5f6709528129a6ad266a6b24ef3f40b88f0fe04b/quast_libs/site_packages/jsontemplate/jsontemplate.py#L193-L199 | ||
BSVino/DoubleAction | c550b168a3e919926c198c30240f506538b92e75 | mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/reflection.py | python | _ExtensionDict.__init__ | (self, extended_message) | extended_message: Message instance for which we are the Extensions dict. | extended_message: Message instance for which we are the Extensions dict. | [
"extended_message",
":",
"Message",
"instance",
"for",
"which",
"we",
"are",
"the",
"Extensions",
"dict",
"."
] | def __init__(self, extended_message):
"""extended_message: Message instance for which we are the Extensions dict.
"""
self._extended_message = extended_message | [
"def",
"__init__",
"(",
"self",
",",
"extended_message",
")",
":",
"self",
".",
"_extended_message",
"=",
"extended_message"
] | https://github.com/BSVino/DoubleAction/blob/c550b168a3e919926c198c30240f506538b92e75/mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/reflection.py#L1059-L1063 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/mimetypes.py | python | guess_all_extensions | (type, strict=True) | return _db.guess_all_extensions(type, strict) | Guess the extensions for a file based on its MIME type.
Return value is a list of strings giving the possible filename
extensions, including the leading dot ('.'). The extension is not
guaranteed to have been associated with any particular data
stream, but would be mapped to the MIME type `type' by
... | Guess the extensions for a file based on its MIME type. | [
"Guess",
"the",
"extensions",
"for",
"a",
"file",
"based",
"on",
"its",
"MIME",
"type",
"."
] | def guess_all_extensions(type, strict=True):
"""Guess the extensions for a file based on its MIME type.
Return value is a list of strings giving the possible filename
extensions, including the leading dot ('.'). The extension is not
guaranteed to have been associated with any particular data
strea... | [
"def",
"guess_all_extensions",
"(",
"type",
",",
"strict",
"=",
"True",
")",
":",
"if",
"_db",
"is",
"None",
":",
"init",
"(",
")",
"return",
"_db",
".",
"guess_all_extensions",
"(",
"type",
",",
"strict",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/mimetypes.py#L297-L312 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/plugins/Launch/launch/cfgdlg.py | python | ConfigPanel.UpdateForHandler | (self) | Update the panel for the current filetype handler | Update the panel for the current filetype handler | [
"Update",
"the",
"panel",
"for",
"the",
"current",
"filetype",
"handler"
] | def UpdateForHandler(self):
"""Update the panel for the current filetype handler"""
handler = self.GetCurrentHandler()
elist = self.FindWindowById(ID_EXECUTABLES)
elist.DeleteAllItems()
def_ch = self.FindWindowById(wx.ID_DEFAULT)
def_ch.SetItems(handler.GetAliases())
... | [
"def",
"UpdateForHandler",
"(",
"self",
")",
":",
"handler",
"=",
"self",
".",
"GetCurrentHandler",
"(",
")",
"elist",
"=",
"self",
".",
"FindWindowById",
"(",
"ID_EXECUTABLES",
")",
"elist",
".",
"DeleteAllItems",
"(",
")",
"def_ch",
"=",
"self",
".",
"Fi... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/plugins/Launch/launch/cfgdlg.py#L348-L364 | ||
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/osr.py | python | SpatialReference.SetEquirectangular2 | (self, *args, **kwargs) | return _osr.SpatialReference_SetEquirectangular2(self, *args, **kwargs) | r"""SetEquirectangular2(SpatialReference self, double clat, double clong, double pseudostdparallellat, double fe, double fn) -> OGRErr | r"""SetEquirectangular2(SpatialReference self, double clat, double clong, double pseudostdparallellat, double fe, double fn) -> OGRErr | [
"r",
"SetEquirectangular2",
"(",
"SpatialReference",
"self",
"double",
"clat",
"double",
"clong",
"double",
"pseudostdparallellat",
"double",
"fe",
"double",
"fn",
")",
"-",
">",
"OGRErr"
] | def SetEquirectangular2(self, *args, **kwargs):
r"""SetEquirectangular2(SpatialReference self, double clat, double clong, double pseudostdparallellat, double fe, double fn) -> OGRErr"""
return _osr.SpatialReference_SetEquirectangular2(self, *args, **kwargs) | [
"def",
"SetEquirectangular2",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_osr",
".",
"SpatialReference_SetEquirectangular2",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/osr.py#L570-L572 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/events.py | python | AbstractEventLoop._timer_handle_cancelled | (self, handle) | Notification that a TimerHandle has been cancelled. | Notification that a TimerHandle has been cancelled. | [
"Notification",
"that",
"a",
"TimerHandle",
"has",
"been",
"cancelled",
"."
] | def _timer_handle_cancelled(self, handle):
"""Notification that a TimerHandle has been cancelled."""
raise NotImplementedError | [
"def",
"_timer_handle_cancelled",
"(",
"self",
",",
"handle",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/events.py#L259-L261 | ||
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/intelc.py | python | get_intel_compiler_top | (version, abi) | return top | Return the main path to the top-level dir of the Intel compiler,
using the given version.
The compiler will be in <top>/bin/icl.exe (icc on linux),
the include dir is <top>/include, etc. | Return the main path to the top-level dir of the Intel compiler,
using the given version.
The compiler will be in <top>/bin/icl.exe (icc on linux),
the include dir is <top>/include, etc. | [
"Return",
"the",
"main",
"path",
"to",
"the",
"top",
"-",
"level",
"dir",
"of",
"the",
"Intel",
"compiler",
"using",
"the",
"given",
"version",
".",
"The",
"compiler",
"will",
"be",
"in",
"<top",
">",
"/",
"bin",
"/",
"icl",
".",
"exe",
"(",
"icc",
... | def get_intel_compiler_top(version, abi):
"""
Return the main path to the top-level dir of the Intel compiler,
using the given version.
The compiler will be in <top>/bin/icl.exe (icc on linux),
the include dir is <top>/include, etc.
"""
if is_windows:
if not SCons.Util.can_read_reg:... | [
"def",
"get_intel_compiler_top",
"(",
"version",
",",
"abi",
")",
":",
"if",
"is_windows",
":",
"if",
"not",
"SCons",
".",
"Util",
".",
"can_read_reg",
":",
"raise",
"NoRegistryModuleError",
"(",
"\"No Windows registry module was found\"",
")",
"top",
"=",
"get_in... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/intelc.py#L304-L392 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/stc.py | python | StyledTextCtrl.LineUpRectExtend | (*args, **kwargs) | return _stc.StyledTextCtrl_LineUpRectExtend(*args, **kwargs) | LineUpRectExtend(self)
Move caret up one line, extending rectangular selection to new caret position. | LineUpRectExtend(self) | [
"LineUpRectExtend",
"(",
"self",
")"
] | def LineUpRectExtend(*args, **kwargs):
"""
LineUpRectExtend(self)
Move caret up one line, extending rectangular selection to new caret position.
"""
return _stc.StyledTextCtrl_LineUpRectExtend(*args, **kwargs) | [
"def",
"LineUpRectExtend",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_LineUpRectExtend",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L5375-L5381 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | addon-sdk/source/python-lib/jetpack_sdk_env.py | python | welcome | () | Perform a bunch of sanity tests to make sure the Add-on SDK
environment is sane, and then display a welcome message. | Perform a bunch of sanity tests to make sure the Add-on SDK
environment is sane, and then display a welcome message. | [
"Perform",
"a",
"bunch",
"of",
"sanity",
"tests",
"to",
"make",
"sure",
"the",
"Add",
"-",
"on",
"SDK",
"environment",
"is",
"sane",
"and",
"then",
"display",
"a",
"welcome",
"message",
"."
] | def welcome():
"""
Perform a bunch of sanity tests to make sure the Add-on SDK
environment is sane, and then display a welcome message.
"""
try:
if sys.version_info[0] > 2:
print ("Error: You appear to be using Python %d, but "
"the Add-on SDK only supports th... | [
"def",
"welcome",
"(",
")",
":",
"try",
":",
"if",
"sys",
".",
"version_info",
"[",
"0",
"]",
">",
"2",
":",
"print",
"(",
"\"Error: You appear to be using Python %d, but \"",
"\"the Add-on SDK only supports the Python 2.x line.\"",
"%",
"(",
"sys",
".",
"version_in... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/addon-sdk/source/python-lib/jetpack_sdk_env.py#L8-L63 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/indexes/multi.py | python | MultiIndex._maybe_match_names | (self, other) | return names | Try to find common names to attach to the result of an operation between
a and b. Return a consensus list of names if they match at least partly
or list of None if they have completely different names. | Try to find common names to attach to the result of an operation between
a and b. Return a consensus list of names if they match at least partly
or list of None if they have completely different names. | [
"Try",
"to",
"find",
"common",
"names",
"to",
"attach",
"to",
"the",
"result",
"of",
"an",
"operation",
"between",
"a",
"and",
"b",
".",
"Return",
"a",
"consensus",
"list",
"of",
"names",
"if",
"they",
"match",
"at",
"least",
"partly",
"or",
"list",
"o... | def _maybe_match_names(self, other):
"""
Try to find common names to attach to the result of an operation between
a and b. Return a consensus list of names if they match at least partly
or list of None if they have completely different names.
"""
if len(self.names) != len... | [
"def",
"_maybe_match_names",
"(",
"self",
",",
"other",
")",
":",
"if",
"len",
"(",
"self",
".",
"names",
")",
"!=",
"len",
"(",
"other",
".",
"names",
")",
":",
"return",
"[",
"None",
"]",
"*",
"len",
"(",
"self",
".",
"names",
")",
"names",
"="... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/indexes/multi.py#L3579-L3594 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/irc/irclib.py | python | ServerConnection.whois | (self, targets) | Send a WHOIS command. | Send a WHOIS command. | [
"Send",
"a",
"WHOIS",
"command",
"."
] | def whois(self, targets):
"""Send a WHOIS command."""
self.send_raw("WHOIS " + ",".join(targets)) | [
"def",
"whois",
"(",
"self",
",",
"targets",
")",
":",
"self",
".",
"send_raw",
"(",
"\"WHOIS \"",
"+",
"\",\"",
".",
"join",
"(",
"targets",
")",
")"
] | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/irc/irclib.py#L844-L846 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/tensor_forest/hybrid/python/hybrid_model.py | python | HybridModel.loss | (self, data, labels) | return loss | The loss to minimize while training. | The loss to minimize while training. | [
"The",
"loss",
"to",
"minimize",
"while",
"training",
"."
] | def loss(self, data, labels):
"""The loss to minimize while training."""
if self.is_regression:
diff = self.training_inference_graph(data) - math_ops.to_float(labels)
mean_squared_error = math_ops.reduce_mean(diff * diff)
root_mean_squared_error = math_ops.sqrt(mean_squared_error, name="loss"... | [
"def",
"loss",
"(",
"self",
",",
"data",
",",
"labels",
")",
":",
"if",
"self",
".",
"is_regression",
":",
"diff",
"=",
"self",
".",
"training_inference_graph",
"(",
"data",
")",
"-",
"math_ops",
".",
"to_float",
"(",
"labels",
")",
"mean_squared_error",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/tensor_forest/hybrid/python/hybrid_model.py#L109-L126 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_pytorch/pytorch_binding/pytorch_nndct/nn/qat/modules/quantizer.py | python | TQTQuantizer.export_quant_info | (self) | return [bitwidth, int(bitwidth - 1 - ceil_log2t)] | Export trained threshold to TorchQuantizer's quant info [bitwidth, fp].
(1) TQT: qx = clip(round(fx / scale)) * scale, scale = 2^ceil(log2t) / 2^(b-1)
(2) NndctFixNeron: qx = clip(round(fx * scale)) * (1 / scale), scale = 2^fp
Let (1) equals (2), we can get
(3): 2^(b-1) / 2^ceil(log2t) = 2^fp
=> f... | Export trained threshold to TorchQuantizer's quant info [bitwidth, fp]. | [
"Export",
"trained",
"threshold",
"to",
"TorchQuantizer",
"s",
"quant",
"info",
"[",
"bitwidth",
"fp",
"]",
"."
] | def export_quant_info(self):
"""Export trained threshold to TorchQuantizer's quant info [bitwidth, fp].
(1) TQT: qx = clip(round(fx / scale)) * scale, scale = 2^ceil(log2t) / 2^(b-1)
(2) NndctFixNeron: qx = clip(round(fx * scale)) * (1 / scale), scale = 2^fp
Let (1) equals (2), we can get
(3): 2^(b... | [
"def",
"export_quant_info",
"(",
"self",
")",
":",
"bitwidth",
"=",
"self",
".",
"bitwidth",
".",
"item",
"(",
")",
"ceil_log2t",
"=",
"torch",
".",
"ceil",
"(",
"self",
".",
"log_threshold",
")",
".",
"item",
"(",
")",
"return",
"[",
"bitwidth",
",",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_pytorch/pytorch_binding/pytorch_nndct/nn/qat/modules/quantizer.py#L353-L366 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryILLPreprocess.py | python | ReflectometryILLPreprocess._convertToWavelength | (self, ws) | return wavelengthWS | Convert the X units of ws to wavelength. | Convert the X units of ws to wavelength. | [
"Convert",
"the",
"X",
"units",
"of",
"ws",
"to",
"wavelength",
"."
] | def _convertToWavelength(self, ws):
"""Convert the X units of ws to wavelength."""
wavelengthWSName = self._names.withSuffix('in_wavelength')
wavelengthWS = ConvertUnits(
InputWorkspace=ws,
OutputWorkspace=wavelengthWSName,
Target='Wavelength',
EMo... | [
"def",
"_convertToWavelength",
"(",
"self",
",",
"ws",
")",
":",
"wavelengthWSName",
"=",
"self",
".",
"_names",
".",
"withSuffix",
"(",
"'in_wavelength'",
")",
"wavelengthWS",
"=",
"ConvertUnits",
"(",
"InputWorkspace",
"=",
"ws",
",",
"OutputWorkspace",
"=",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryILLPreprocess.py#L269-L280 | |
htcondor/htcondor | 4829724575176d1d6c936e4693dfd78a728569b0 | src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/client.py | python | IClient.OpenGettingStartedWizard | (self) | Opens getting started wizard. | Opens getting started wizard. | [
"Opens",
"getting",
"started",
"wizard",
"."
] | def OpenGettingStartedWizard(self):
'''Opens getting started wizard.
'''
self.OpenDialog('GETTINGSTARTED') | [
"def",
"OpenGettingStartedWizard",
"(",
"self",
")",
":",
"self",
".",
"OpenDialog",
"(",
"'GETTINGSTARTED'",
")"
] | https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/client.py#L162-L165 | ||
floooh/oryol | eb08cffe1b1cb6b05ed14ec692bca9372cef064e | fips-files/generators/util/png.py | python | isarray | (x) | Same as ``isinstance(x, array)`` except on Python 2.2, where it
always returns ``False``. This helps PyPNG work on Python 2.2. | Same as ``isinstance(x, array)`` except on Python 2.2, where it
always returns ``False``. This helps PyPNG work on Python 2.2. | [
"Same",
"as",
"isinstance",
"(",
"x",
"array",
")",
"except",
"on",
"Python",
"2",
".",
"2",
"where",
"it",
"always",
"returns",
"False",
".",
"This",
"helps",
"PyPNG",
"work",
"on",
"Python",
"2",
".",
"2",
"."
] | def isarray(x):
"""Same as ``isinstance(x, array)`` except on Python 2.2, where it
always returns ``False``. This helps PyPNG work on Python 2.2.
"""
try:
return isinstance(x, array)
except:
return False | [
"def",
"isarray",
"(",
"x",
")",
":",
"try",
":",
"return",
"isinstance",
"(",
"x",
",",
"array",
")",
"except",
":",
"return",
"False"
] | https://github.com/floooh/oryol/blob/eb08cffe1b1cb6b05ed14ec692bca9372cef064e/fips-files/generators/util/png.py#L206-L214 | ||
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/eslint.py | python | ESLint._validate_version | (self, warn=False) | return False | Validate ESLint is the expected version | Validate ESLint is the expected version | [
"Validate",
"ESLint",
"is",
"the",
"expected",
"version"
] | def _validate_version(self, warn=False):
"""Validate ESLint is the expected version
"""
esl_version = callo([self.path, "--version"]).rstrip()
# Ignore the leading v in the version string.
if ESLINT_VERSION == esl_version[1:]:
return True
if warn:
... | [
"def",
"_validate_version",
"(",
"self",
",",
"warn",
"=",
"False",
")",
":",
"esl_version",
"=",
"callo",
"(",
"[",
"self",
".",
"path",
",",
"\"--version\"",
"]",
")",
".",
"rstrip",
"(",
")",
"# Ignore the leading v in the version string.",
"if",
"ESLINT_VE... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/eslint.py#L149-L160 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/tools/saved_model_cli.py | python | _get_outputs_tensor_info_from_meta_graph_def | (meta_graph_def,
signature_def_key) | return signature_def_utils.get_signature_def_by_key(meta_graph_def,
signature_def_key).outputs | Gets TensorInfos for all outputs of the SignatureDef.
Returns a dictionary that maps each output key to its TensorInfo for the given
signature_def_key in the meta_graph_def.
Args:
meta_graph_def: MetaGraphDef protocol buffer with the SignatureDefmap to
look up signature_def_key.
signature_def_key: A... | Gets TensorInfos for all outputs of the SignatureDef. | [
"Gets",
"TensorInfos",
"for",
"all",
"outputs",
"of",
"the",
"SignatureDef",
"."
] | def _get_outputs_tensor_info_from_meta_graph_def(meta_graph_def,
signature_def_key):
"""Gets TensorInfos for all outputs of the SignatureDef.
Returns a dictionary that maps each output key to its TensorInfo for the given
signature_def_key in the meta_graph_def.
... | [
"def",
"_get_outputs_tensor_info_from_meta_graph_def",
"(",
"meta_graph_def",
",",
"signature_def_key",
")",
":",
"return",
"signature_def_utils",
".",
"get_signature_def_by_key",
"(",
"meta_graph_def",
",",
"signature_def_key",
")",
".",
"outputs"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/tools/saved_model_cli.py#L97-L113 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | GraphicsContext.GetPartialTextExtents | (*args, **kwargs) | return _gdi_.GraphicsContext_GetPartialTextExtents(*args, **kwargs) | GetPartialTextExtents(self, text) -> [widths]
Returns a list of widths from the beginning of ``text`` to the
coresponding character in ``text``. | GetPartialTextExtents(self, text) -> [widths] | [
"GetPartialTextExtents",
"(",
"self",
"text",
")",
"-",
">",
"[",
"widths",
"]"
] | def GetPartialTextExtents(*args, **kwargs):
"""
GetPartialTextExtents(self, text) -> [widths]
Returns a list of widths from the beginning of ``text`` to the
coresponding character in ``text``.
"""
return _gdi_.GraphicsContext_GetPartialTextExtents(*args, **kwargs) | [
"def",
"GetPartialTextExtents",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"GraphicsContext_GetPartialTextExtents",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L6582-L6589 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/http/cookiejar.py | python | time2netscape | (t=None) | return "%s, %02d-%s-%04d %02d:%02d:%02d GMT" % (
DAYS[dt.weekday()], dt.day, MONTHS[dt.month-1],
dt.year, dt.hour, dt.minute, dt.second) | Return a string representing time in seconds since epoch, t.
If the function is called without an argument, it will use the current
time.
The format of the returned string is like this:
Wed, DD-Mon-YYYY HH:MM:SS GMT | Return a string representing time in seconds since epoch, t. | [
"Return",
"a",
"string",
"representing",
"time",
"in",
"seconds",
"since",
"epoch",
"t",
"."
] | def time2netscape(t=None):
"""Return a string representing time in seconds since epoch, t.
If the function is called without an argument, it will use the current
time.
The format of the returned string is like this:
Wed, DD-Mon-YYYY HH:MM:SS GMT
"""
if t is None:
dt = datetime.da... | [
"def",
"time2netscape",
"(",
"t",
"=",
"None",
")",
":",
"if",
"t",
"is",
"None",
":",
"dt",
"=",
"datetime",
".",
"datetime",
".",
"utcnow",
"(",
")",
"else",
":",
"dt",
"=",
"datetime",
".",
"datetime",
".",
"utcfromtimestamp",
"(",
"t",
")",
"re... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/http/cookiejar.py#L105-L122 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/rosbag/src/rosbag/bag.py | python | Bag.mode | (self) | return self._mode | Get the mode. | Get the mode. | [
"Get",
"the",
"mode",
"."
] | def mode(self):
"""Get the mode."""
return self._mode | [
"def",
"mode",
"(",
"self",
")",
":",
"return",
"self",
".",
"_mode"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rosbag/src/rosbag/bag.py#L204-L206 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/sets.py | python | BaseSet.union | (self, other) | return result | Return the union of two sets as a new set.
(I.e. all elements that are in either set.) | Return the union of two sets as a new set. | [
"Return",
"the",
"union",
"of",
"two",
"sets",
"as",
"a",
"new",
"set",
"."
] | def union(self, other):
"""Return the union of two sets as a new set.
(I.e. all elements that are in either set.)
"""
result = self.__class__(self)
result._update(other)
return result | [
"def",
"union",
"(",
"self",
",",
"other",
")",
":",
"result",
"=",
"self",
".",
"__class__",
"(",
"self",
")",
"result",
".",
"_update",
"(",
"other",
")",
"return",
"result"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/sets.py#L187-L194 | |
nghttp2/nghttp2 | a67822b3828a71b2993a68202465148c0fa3f228 | doc/_exts/rubydomain/rubydomain.py | python | RubyObject.handle_signature | (self, sig, signode) | return fullname, name_prefix | Transform a Ruby signature into RST nodes.
Returns (fully qualified name of the thing, classname if any).
If inside a class, the current class name is handled intelligently:
* it is stripped from the displayed name if present
* it is added to the full name (return value) if not present | Transform a Ruby signature into RST nodes.
Returns (fully qualified name of the thing, classname if any). | [
"Transform",
"a",
"Ruby",
"signature",
"into",
"RST",
"nodes",
".",
"Returns",
"(",
"fully",
"qualified",
"name",
"of",
"the",
"thing",
"classname",
"if",
"any",
")",
"."
] | def handle_signature(self, sig, signode):
"""
Transform a Ruby signature into RST nodes.
Returns (fully qualified name of the thing, classname if any).
If inside a class, the current class name is handled intelligently:
* it is stripped from the displayed name if present
... | [
"def",
"handle_signature",
"(",
"self",
",",
"sig",
",",
"signode",
")",
":",
"m",
"=",
"rb_sig_re",
".",
"match",
"(",
"sig",
")",
"if",
"m",
"is",
"None",
":",
"raise",
"ValueError",
"name_prefix",
",",
"name",
",",
"arglist",
",",
"retann",
"=",
"... | https://github.com/nghttp2/nghttp2/blob/a67822b3828a71b2993a68202465148c0fa3f228/doc/_exts/rubydomain/rubydomain.py#L95-L190 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/html.py | python | HtmlCell.SetPos | (*args, **kwargs) | return _html.HtmlCell_SetPos(*args, **kwargs) | SetPos(self, int x, int y) | SetPos(self, int x, int y) | [
"SetPos",
"(",
"self",
"int",
"x",
"int",
"y",
")"
] | def SetPos(*args, **kwargs):
"""SetPos(self, int x, int y)"""
return _html.HtmlCell_SetPos(*args, **kwargs) | [
"def",
"SetPos",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlCell_SetPos",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/html.py#L678-L680 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/integrate/_ivp/common.py | python | validate_tol | (rtol, atol, n) | return rtol, atol | Validate tolerance values. | Validate tolerance values. | [
"Validate",
"tolerance",
"values",
"."
] | def validate_tol(rtol, atol, n):
"""Validate tolerance values."""
if rtol < 100 * EPS:
warn("`rtol` is too low, setting to {}".format(100 * EPS))
rtol = 100 * EPS
atol = np.asarray(atol)
if atol.ndim > 0 and atol.shape != (n,):
raise ValueError("`atol` has wrong shape.")
if... | [
"def",
"validate_tol",
"(",
"rtol",
",",
"atol",
",",
"n",
")",
":",
"if",
"rtol",
"<",
"100",
"*",
"EPS",
":",
"warn",
"(",
"\"`rtol` is too low, setting to {}\"",
".",
"format",
"(",
"100",
"*",
"EPS",
")",
")",
"rtol",
"=",
"100",
"*",
"EPS",
"ato... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/integrate/_ivp/common.py#L44-L57 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/tbe/apply_adam.py | python | _apply_adam_tbe | () | return | ApplyAdam TBE register | ApplyAdam TBE register | [
"ApplyAdam",
"TBE",
"register"
] | def _apply_adam_tbe():
"""ApplyAdam TBE register"""
return | [
"def",
"_apply_adam_tbe",
"(",
")",
":",
"return"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/apply_adam.py#L77-L79 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/idna/intranges.py | python | intranges_contain | (int_, ranges) | return False | Determine if `int_` falls into one of the ranges in `ranges`. | Determine if `int_` falls into one of the ranges in `ranges`. | [
"Determine",
"if",
"int_",
"falls",
"into",
"one",
"of",
"the",
"ranges",
"in",
"ranges",
"."
] | def intranges_contain(int_, ranges):
"""Determine if `int_` falls into one of the ranges in `ranges`."""
tuple_ = _encode_range(int_, 0)
pos = bisect.bisect_left(ranges, tuple_)
# we could be immediately ahead of a tuple (start, end)
# with start < int_ <= end
if pos > 0:
left, right = _... | [
"def",
"intranges_contain",
"(",
"int_",
",",
"ranges",
")",
":",
"tuple_",
"=",
"_encode_range",
"(",
"int_",
",",
"0",
")",
"pos",
"=",
"bisect",
".",
"bisect_left",
"(",
"ranges",
",",
"tuple_",
")",
"# we could be immediately ahead of a tuple (start, end)",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/idna/intranges.py#L38-L53 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/ma/core.py | python | MaskedArray._get_recordmask | (self) | return np.all(flatten_structured_array(_mask), axis= -1) | Return the mask of the records.
A record is masked when all the fields are masked. | Return the mask of the records.
A record is masked when all the fields are masked. | [
"Return",
"the",
"mask",
"of",
"the",
"records",
".",
"A",
"record",
"is",
"masked",
"when",
"all",
"the",
"fields",
"are",
"masked",
"."
] | def _get_recordmask(self):
"""
Return the mask of the records.
A record is masked when all the fields are masked.
"""
_mask = ndarray.__getattribute__(self, '_mask').view(ndarray)
if _mask.dtype.names is None:
return _mask
return np.all(flatten_structured_arr... | [
"def",
"_get_recordmask",
"(",
"self",
")",
":",
"_mask",
"=",
"ndarray",
".",
"__getattribute__",
"(",
"self",
",",
"'_mask'",
")",
".",
"view",
"(",
"ndarray",
")",
"if",
"_mask",
".",
"dtype",
".",
"names",
"is",
"None",
":",
"return",
"_mask",
"ret... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/ma/core.py#L3133-L3142 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/propgrid.py | python | NewStringProperty | (*args, **kwargs) | return _propgrid.NewStringProperty(*args, **kwargs) | NewStringProperty(String label=(*wxPGProperty::sm_wxPG_LABEL), String name=(*wxPGProperty::sm_wxPG_LABEL),
String value=wxEmptyString) -> PGProperty | NewStringProperty(String label=(*wxPGProperty::sm_wxPG_LABEL), String name=(*wxPGProperty::sm_wxPG_LABEL),
String value=wxEmptyString) -> PGProperty | [
"NewStringProperty",
"(",
"String",
"label",
"=",
"(",
"*",
"wxPGProperty",
"::",
"sm_wxPG_LABEL",
")",
"String",
"name",
"=",
"(",
"*",
"wxPGProperty",
"::",
"sm_wxPG_LABEL",
")",
"String",
"value",
"=",
"wxEmptyString",
")",
"-",
">",
"PGProperty"
] | def NewStringProperty(*args, **kwargs):
"""
NewStringProperty(String label=(*wxPGProperty::sm_wxPG_LABEL), String name=(*wxPGProperty::sm_wxPG_LABEL),
String value=wxEmptyString) -> PGProperty
"""
return _propgrid.NewStringProperty(*args, **kwargs) | [
"def",
"NewStringProperty",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"NewStringProperty",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L3657-L3662 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/debug/cli/curses_ui.py | python | CursesUI._show_array_indices | (self) | Show array indices for the lines at the top and bottom of the output.
For the top line and bottom line of the output display area, show the
element indices of the array being displayed.
Returns:
If either the top of the bottom row has any matching array indices,
a dict from line index (0 being... | Show array indices for the lines at the top and bottom of the output. | [
"Show",
"array",
"indices",
"for",
"the",
"lines",
"at",
"the",
"top",
"and",
"bottom",
"of",
"the",
"output",
"."
] | def _show_array_indices(self):
"""Show array indices for the lines at the top and bottom of the output.
For the top line and bottom line of the output display area, show the
element indices of the array being displayed.
Returns:
If either the top of the bottom row has any matching array indices,... | [
"def",
"_show_array_indices",
"(",
"self",
")",
":",
"indices_top",
"=",
"self",
".",
"_show_array_index_at_line",
"(",
"0",
")",
"output_top",
"=",
"self",
".",
"_output_top_row",
"if",
"self",
".",
"_main_menu_pad",
":",
"output_top",
"+=",
"1",
"bottom_line_i... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/debug/cli/curses_ui.py#L1455-L1482 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/wsgiref/headers.py | python | _formatparam | (param, value=None, quote=1) | Convenience function to format and return a key=value pair.
This will quote the value if needed or if quote is true. | Convenience function to format and return a key=value pair. | [
"Convenience",
"function",
"to",
"format",
"and",
"return",
"a",
"key",
"=",
"value",
"pair",
"."
] | def _formatparam(param, value=None, quote=1):
"""Convenience function to format and return a key=value pair.
This will quote the value if needed or if quote is true.
"""
if value is not None and len(value) > 0:
if quote or tspecials.search(value):
value = value.replace('\\', '\\\\')... | [
"def",
"_formatparam",
"(",
"param",
",",
"value",
"=",
"None",
",",
"quote",
"=",
"1",
")",
":",
"if",
"value",
"is",
"not",
"None",
"and",
"len",
"(",
"value",
")",
">",
"0",
":",
"if",
"quote",
"or",
"tspecials",
".",
"search",
"(",
"value",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/wsgiref/headers.py#L13-L25 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/ninja/misc/ninja_syntax.py | python | Writer._line | (self, text, indent=0) | Write 'text' word-wrapped at self.width characters. | Write 'text' word-wrapped at self.width characters. | [
"Write",
"text",
"word",
"-",
"wrapped",
"at",
"self",
".",
"width",
"characters",
"."
] | def _line(self, text, indent=0):
"""Write 'text' word-wrapped at self.width characters."""
leading_space = ' ' * indent
while len(leading_space) + len(text) > self.width:
# The text is too wide; wrap if possible.
# Find the rightmost space that would obey our width cons... | [
"def",
"_line",
"(",
"self",
",",
"text",
",",
"indent",
"=",
"0",
")",
":",
"leading_space",
"=",
"' '",
"*",
"indent",
"while",
"len",
"(",
"leading_space",
")",
"+",
"len",
"(",
"text",
")",
">",
"self",
".",
"width",
":",
"# The text is too wide; ... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/ninja/misc/ninja_syntax.py#L114-L148 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/arrays/datetimelike.py | python | DatetimeLikeArrayMixin._add_delta | (self, other) | return new_values | Add a timedelta-like, Tick or TimedeltaIndex-like object
to self, yielding an int64 numpy array
Parameters
----------
delta : {timedelta, np.timedelta64, Tick,
TimedeltaIndex, ndarray[timedelta64]}
Returns
-------
result : ndarray[int64]
... | Add a timedelta-like, Tick or TimedeltaIndex-like object
to self, yielding an int64 numpy array | [
"Add",
"a",
"timedelta",
"-",
"like",
"Tick",
"or",
"TimedeltaIndex",
"-",
"like",
"object",
"to",
"self",
"yielding",
"an",
"int64",
"numpy",
"array"
] | def _add_delta(self, other):
"""
Add a timedelta-like, Tick or TimedeltaIndex-like object
to self, yielding an int64 numpy array
Parameters
----------
delta : {timedelta, np.timedelta64, Tick,
TimedeltaIndex, ndarray[timedelta64]}
Returns
... | [
"def",
"_add_delta",
"(",
"self",
",",
"other",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"(",
"Tick",
",",
"timedelta",
",",
"np",
".",
"timedelta64",
")",
")",
":",
"new_values",
"=",
"self",
".",
"_add_timedeltalike_scalar",
"(",
"other",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/arrays/datetimelike.py#L941-L966 | |
Harick1/caffe-yolo | eea92bf3ddfe4d0ff6b0b3ba9b15c029a83ed9a3 | scripts/cpp_lint.py | python | ProcessFile | (filename, vlevel, extra_check_functions=[]) | Does google-lint on a single file.
Args:
filename: The name of the file to parse.
vlevel: The level of errors to report. Every error of confidence
>= verbose_level will be reported. 0 is a good default.
extra_check_functions: An array of additional check functions that will be
... | Does google-lint on a single file. | [
"Does",
"google",
"-",
"lint",
"on",
"a",
"single",
"file",
"."
] | def ProcessFile(filename, vlevel, extra_check_functions=[]):
"""Does google-lint on a single file.
Args:
filename: The name of the file to parse.
vlevel: The level of errors to report. Every error of confidence
>= verbose_level will be reported. 0 is a good default.
extra_check_functions: An ar... | [
"def",
"ProcessFile",
"(",
"filename",
",",
"vlevel",
",",
"extra_check_functions",
"=",
"[",
"]",
")",
":",
"_SetVerboseLevel",
"(",
"vlevel",
")",
"try",
":",
"# Support the UNIX convention of using \"-\" for stdin. Note that",
"# we are not opening the file with universal... | https://github.com/Harick1/caffe-yolo/blob/eea92bf3ddfe4d0ff6b0b3ba9b15c029a83ed9a3/scripts/cpp_lint.py#L4689-L4754 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/Tools/dbus.py | python | add_dbus_file | (self, filename, prefix, mode) | Add a dbus file to the list of dbus files to process. Store them in the attribute *dbus_lst*.
:param filename: xml file to compile
:type filename: string
:param prefix: dbus binding tool prefix (--prefix=prefix)
:type prefix: string
:param mode: dbus binding tool mode (--mode=mode)
:type mode: string | Add a dbus file to the list of dbus files to process. Store them in the attribute *dbus_lst*. | [
"Add",
"a",
"dbus",
"file",
"to",
"the",
"list",
"of",
"dbus",
"files",
"to",
"process",
".",
"Store",
"them",
"in",
"the",
"attribute",
"*",
"dbus_lst",
"*",
"."
] | def add_dbus_file(self, filename, prefix, mode):
"""
Add a dbus file to the list of dbus files to process. Store them in the attribute *dbus_lst*.
:param filename: xml file to compile
:type filename: string
:param prefix: dbus binding tool prefix (--prefix=prefix)
:type prefix: string
:param mode: dbus binding ... | [
"def",
"add_dbus_file",
"(",
"self",
",",
"filename",
",",
"prefix",
",",
"mode",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'dbus_lst'",
")",
":",
"self",
".",
"dbus_lst",
"=",
"[",
"]",
"if",
"not",
"'process_dbus'",
"in",
"self",
".",
"m... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Tools/dbus.py#L26-L41 | ||
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | lldb/third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py | python | spawn.eof | (self) | return self.flag_eof | This returns True if the EOF exception was ever raised. | This returns True if the EOF exception was ever raised. | [
"This",
"returns",
"True",
"if",
"the",
"EOF",
"exception",
"was",
"ever",
"raised",
"."
] | def eof(self):
'''This returns True if the EOF exception was ever raised.
'''
return self.flag_eof | [
"def",
"eof",
"(",
"self",
")",
":",
"return",
"self",
".",
"flag_eof"
] | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/lldb/third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py#L604-L607 | |
nvdla/sw | 79538ba1b52b040a4a4645f630e457fa01839e90 | umd/external/protobuf-2.6/python/google/protobuf/message.py | python | Message.__setstate__ | (self, state) | Support the pickle protocol. | Support the pickle protocol. | [
"Support",
"the",
"pickle",
"protocol",
"."
] | def __setstate__(self, state):
"""Support the pickle protocol."""
self.__init__()
self.ParseFromString(state['serialized']) | [
"def",
"__setstate__",
"(",
"self",
",",
"state",
")",
":",
"self",
".",
"__init__",
"(",
")",
"self",
".",
"ParseFromString",
"(",
"state",
"[",
"'serialized'",
"]",
")"
] | https://github.com/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/google/protobuf/message.py#L281-L284 | ||
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/MooseDocs/base/Extension.py | python | Extension.postWrite | (self, page) | Called after renderer has written content.
Inputs:
page[pages.Source]: The source object representing the content | Called after renderer has written content. | [
"Called",
"after",
"renderer",
"has",
"written",
"content",
"."
] | def postWrite(self, page):
"""
Called after renderer has written content.
Inputs:
page[pages.Source]: The source object representing the content
"""
pass | [
"def",
"postWrite",
"(",
"self",
",",
"page",
")",
":",
"pass"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/MooseDocs/base/Extension.py#L160-L167 | ||
openmm/openmm | cb293447c4fc8b03976dfe11399f107bab70f3d9 | wrappers/python/openmm/app/internal/pdbstructure.py | python | Atom.iter_positions | (self) | Iterate over atomic positions. Returns Quantity(Vec3(), unit) objects, unlike
iter_locations, which returns Atom.Location objects. | Iterate over atomic positions. Returns Quantity(Vec3(), unit) objects, unlike
iter_locations, which returns Atom.Location objects. | [
"Iterate",
"over",
"atomic",
"positions",
".",
"Returns",
"Quantity",
"(",
"Vec3",
"()",
"unit",
")",
"objects",
"unlike",
"iter_locations",
"which",
"returns",
"Atom",
".",
"Location",
"objects",
"."
] | def iter_positions(self):
"""
Iterate over atomic positions. Returns Quantity(Vec3(), unit) objects, unlike
iter_locations, which returns Atom.Location objects.
"""
for loc in self.iter_locations():
yield loc.position | [
"def",
"iter_positions",
"(",
"self",
")",
":",
"for",
"loc",
"in",
"self",
".",
"iter_locations",
"(",
")",
":",
"yield",
"loc",
".",
"position"
] | https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/internal/pdbstructure.py#L828-L834 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/idl/idl/syntax.py | python | FieldTypeArray.__init__ | (self, element_type) | Construct a FieldTypeArray. | Construct a FieldTypeArray. | [
"Construct",
"a",
"FieldTypeArray",
"."
] | def __init__(self, element_type):
# type: (FieldTypeSingle) -> None
"""Construct a FieldTypeArray."""
self.element_type = element_type # type: FieldTypeSingle
super(FieldTypeArray, self).__init__(element_type.file_name, element_type.line,
el... | [
"def",
"__init__",
"(",
"self",
",",
"element_type",
")",
":",
"# type: (FieldTypeSingle) -> None",
"self",
".",
"element_type",
"=",
"element_type",
"# type: FieldTypeSingle",
"super",
"(",
"FieldTypeArray",
",",
"self",
")",
".",
"__init__",
"(",
"element_type",
"... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/syntax.py#L747-L753 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/media.py | python | MediaCtrl.GetPlaybackRate | (*args, **kwargs) | return _media.MediaCtrl_GetPlaybackRate(*args, **kwargs) | GetPlaybackRate(self) -> double | GetPlaybackRate(self) -> double | [
"GetPlaybackRate",
"(",
"self",
")",
"-",
">",
"double"
] | def GetPlaybackRate(*args, **kwargs):
"""GetPlaybackRate(self) -> double"""
return _media.MediaCtrl_GetPlaybackRate(*args, **kwargs) | [
"def",
"GetPlaybackRate",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_media",
".",
"MediaCtrl_GetPlaybackRate",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/media.py#L125-L127 | |
LisaAnne/lisa-caffe-public | 49b8643ddef23a4f6120017968de30c45e693f59 | python/caffe/io.py | python | blobproto_to_array | (blob, return_diff=False) | Convert a blob proto to an array. In default, we will just return the data,
unless return_diff is True, in which case we will return the diff. | Convert a blob proto to an array. In default, we will just return the data,
unless return_diff is True, in which case we will return the diff. | [
"Convert",
"a",
"blob",
"proto",
"to",
"an",
"array",
".",
"In",
"default",
"we",
"will",
"just",
"return",
"the",
"data",
"unless",
"return_diff",
"is",
"True",
"in",
"which",
"case",
"we",
"will",
"return",
"the",
"diff",
"."
] | def blobproto_to_array(blob, return_diff=False):
"""Convert a blob proto to an array. In default, we will just return the data,
unless return_diff is True, in which case we will return the diff.
"""
if return_diff:
return np.array(blob.diff).reshape(
blob.num, blob.channels, blob.hei... | [
"def",
"blobproto_to_array",
"(",
"blob",
",",
"return_diff",
"=",
"False",
")",
":",
"if",
"return_diff",
":",
"return",
"np",
".",
"array",
"(",
"blob",
".",
"diff",
")",
".",
"reshape",
"(",
"blob",
".",
"num",
",",
"blob",
".",
"channels",
",",
"... | https://github.com/LisaAnne/lisa-caffe-public/blob/49b8643ddef23a4f6120017968de30c45e693f59/python/caffe/io.py#L18-L27 | ||
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/controls/GravityWalker.py | python | GravityWalker.setAvatarPhysicsIndicator | (self, indicator) | indicator is a NodePath | indicator is a NodePath | [
"indicator",
"is",
"a",
"NodePath"
] | def setAvatarPhysicsIndicator(self, indicator):
"""
indicator is a NodePath
"""
assert self.notify.debugStateCall(self)
self.cWallSphereNodePath.show() | [
"def",
"setAvatarPhysicsIndicator",
"(",
"self",
",",
"indicator",
")",
":",
"assert",
"self",
".",
"notify",
".",
"debugStateCall",
"(",
"self",
")",
"self",
".",
"cWallSphereNodePath",
".",
"show",
"(",
")"
] | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/controls/GravityWalker.py#L255-L260 | ||
yun-liu/RCF | 91bfb054ad04187dbbe21e539e165ad9bd3ff00b | scripts/cpp_lint.py | python | _CppLintState.SetFilters | (self, filters) | Sets the error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "+whitespace/indent").
Each filter should start with + or -; else we die.
Raises:
ValueError: The comma-sepa... | Sets the error-message filters. | [
"Sets",
"the",
"error",
"-",
"message",
"filters",
"."
] | def SetFilters(self, filters):
"""Sets the error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "+whitespace/indent").
Each filter should start with + or -; else we die.
Ra... | [
"def",
"SetFilters",
"(",
"self",
",",
"filters",
")",
":",
"# Default filters always have less priority than the flag ones.",
"self",
".",
"filters",
"=",
"_DEFAULT_FILTERS",
"[",
":",
"]",
"for",
"filt",
"in",
"filters",
".",
"split",
"(",
"','",
")",
":",
"cl... | https://github.com/yun-liu/RCF/blob/91bfb054ad04187dbbe21e539e165ad9bd3ff00b/scripts/cpp_lint.py#L717-L740 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/plot.py | python | PlotCanvas.GetPointLabelFunc | (self) | return self._pointLabelFunc | Returns pointLabel Drawing Function | Returns pointLabel Drawing Function | [
"Returns",
"pointLabel",
"Drawing",
"Function"
] | def GetPointLabelFunc(self):
"""Returns pointLabel Drawing Function"""
return self._pointLabelFunc | [
"def",
"GetPointLabelFunc",
"(",
"self",
")",
":",
"return",
"self",
".",
"_pointLabelFunc"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/plot.py#L994-L996 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/hotshot/__init__.py | python | Profile.fileno | (self) | return self._prof.fileno() | Return the file descriptor of the profiler's log file. | Return the file descriptor of the profiler's log file. | [
"Return",
"the",
"file",
"descriptor",
"of",
"the",
"profiler",
"s",
"log",
"file",
"."
] | def fileno(self):
"""Return the file descriptor of the profiler's log file."""
return self._prof.fileno() | [
"def",
"fileno",
"(",
"self",
")",
":",
"return",
"self",
".",
"_prof",
".",
"fileno",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/hotshot/__init__.py#L30-L32 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatmenu.py | python | FlatMenu.OnMouseMove | (self, event) | Handles the ``wx.EVT_MOTION`` event for :class:`FlatMenu`.
:param `event`: a :class:`MouseEvent` event to be processed. | Handles the ``wx.EVT_MOTION`` event for :class:`FlatMenu`. | [
"Handles",
"the",
"wx",
".",
"EVT_MOTION",
"event",
"for",
":",
"class",
":",
"FlatMenu",
"."
] | def OnMouseMove(self, event):
"""
Handles the ``wx.EVT_MOTION`` event for :class:`FlatMenu`.
:param `event`: a :class:`MouseEvent` event to be processed.
"""
if "__WXMSW__" in wx.Platform:
# Ignore dummy mouse move events
pt = wx.GetMousePosition()
... | [
"def",
"OnMouseMove",
"(",
"self",
",",
"event",
")",
":",
"if",
"\"__WXMSW__\"",
"in",
"wx",
".",
"Platform",
":",
"# Ignore dummy mouse move events",
"pt",
"=",
"wx",
".",
"GetMousePosition",
"(",
")",
"if",
"self",
".",
"_mousePtAtStartup",
"==",
"pt",
":... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L6075-L6106 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/core/oinspect.py | python | _get_wrapped | (obj) | return obj | Get the original object if wrapped in one or more @decorators
Some objects automatically construct similar objects on any unrecognised
attribute access (e.g. unittest.mock.call). To protect against infinite loops,
this will arbitrarily cut off after 100 levels of obj.__wrapped__
attribute access. --TK,... | Get the original object if wrapped in one or more @decorators | [
"Get",
"the",
"original",
"object",
"if",
"wrapped",
"in",
"one",
"or",
"more",
"@decorators"
] | def _get_wrapped(obj):
"""Get the original object if wrapped in one or more @decorators
Some objects automatically construct similar objects on any unrecognised
attribute access (e.g. unittest.mock.call). To protect against infinite loops,
this will arbitrarily cut off after 100 levels of obj.__wrapped... | [
"def",
"_get_wrapped",
"(",
"obj",
")",
":",
"orig_obj",
"=",
"obj",
"i",
"=",
"0",
"while",
"safe_hasattr",
"(",
"obj",
",",
"'__wrapped__'",
")",
":",
"obj",
"=",
"obj",
".",
"__wrapped__",
"i",
"+=",
"1",
"if",
"i",
">",
"100",
":",
"# __wrapped__... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/oinspect.py#L294-L310 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/bisect.py | python | insort_right | (a, x, lo=0, hi=None) | Insert item x in list a, and keep it sorted assuming a is sorted.
If x is already in a, insert it to the right of the rightmost x.
Optional args lo (default 0) and hi (default len(a)) bound the
slice of a to be searched. | Insert item x in list a, and keep it sorted assuming a is sorted. | [
"Insert",
"item",
"x",
"in",
"list",
"a",
"and",
"keep",
"it",
"sorted",
"assuming",
"a",
"is",
"sorted",
"."
] | def insort_right(a, x, lo=0, hi=None):
"""Insert item x in list a, and keep it sorted assuming a is sorted.
If x is already in a, insert it to the right of the rightmost x.
Optional args lo (default 0) and hi (default len(a)) bound the
slice of a to be searched.
"""
if lo < 0:
raise V... | [
"def",
"insort_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/x86/toolchain/lib/python2.7/bisect.py#L3-L20 | ||
facebook/proxygen | a9ca025af207787815cb01eee1971cd572c7a81e | build/fbcode_builder/getdeps/builder.py | python | CargoBuilder._resolve_dep_to_git | (self) | return dep_to_git | For each direct dependency of the currently build manifest check if it
is also cargo-builded and if yes then extract it's git configs and
install dir | For each direct dependency of the currently build manifest check if it
is also cargo-builded and if yes then extract it's git configs and
install dir | [
"For",
"each",
"direct",
"dependency",
"of",
"the",
"currently",
"build",
"manifest",
"check",
"if",
"it",
"is",
"also",
"cargo",
"-",
"builded",
"and",
"if",
"yes",
"then",
"extract",
"it",
"s",
"git",
"configs",
"and",
"install",
"dir"
] | def _resolve_dep_to_git(self):
"""
For each direct dependency of the currently build manifest check if it
is also cargo-builded and if yes then extract it's git configs and
install dir
"""
dependencies = self.manifest.get_dependencies(self.ctx)
if not dependencies... | [
"def",
"_resolve_dep_to_git",
"(",
"self",
")",
":",
"dependencies",
"=",
"self",
".",
"manifest",
".",
"get_dependencies",
"(",
"self",
".",
"ctx",
")",
"if",
"not",
"dependencies",
":",
"return",
"[",
"]",
"dep_to_git",
"=",
"{",
"}",
"for",
"dep",
"in... | https://github.com/facebook/proxygen/blob/a9ca025af207787815cb01eee1971cd572c7a81e/build/fbcode_builder/getdeps/builder.py#L1363-L1394 | |
cztomczak/cefpython | 5679f28cec18a57a56e298da2927aac8d8f83ad6 | tools/automate.py | python | update_cef_patches | () | Update cef/patch/ directory with CEF Python patches.
Issue73 is applied in getenv() by setting appropriate env var.
Note that this modifies only cef_build_dir/cef/ directory. If the
build was run previously then there is a copy of the cef/ directory
in the cef_build_dir/chromium/ directory which is not... | Update cef/patch/ directory with CEF Python patches.
Issue73 is applied in getenv() by setting appropriate env var. | [
"Update",
"cef",
"/",
"patch",
"/",
"directory",
"with",
"CEF",
"Python",
"patches",
".",
"Issue73",
"is",
"applied",
"in",
"getenv",
"()",
"by",
"setting",
"appropriate",
"env",
"var",
"."
] | def update_cef_patches():
"""Update cef/patch/ directory with CEF Python patches.
Issue73 is applied in getenv() by setting appropriate env var.
Note that this modifies only cef_build_dir/cef/ directory. If the
build was run previously then there is a copy of the cef/ directory
in the cef_build_dir... | [
"def",
"update_cef_patches",
"(",
")",
":",
"print",
"(",
"\"[automate.py] Updating CEF patches with CEF Python patches\"",
")",
"cef_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"Options",
".",
"cef_build_dir",
",",
"\"cef\"",
")",
"cef_patch_dir",
"=",
"os",
... | https://github.com/cztomczak/cefpython/blob/5679f28cec18a57a56e298da2927aac8d8f83ad6/tools/automate.py#L331-L367 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | validateNamesValue | (value) | return ret | Validate that the given value match Names production | Validate that the given value match Names production | [
"Validate",
"that",
"the",
"given",
"value",
"match",
"Names",
"production"
] | def validateNamesValue(value):
"""Validate that the given value match Names production """
ret = libxml2mod.xmlValidateNamesValue(value)
return ret | [
"def",
"validateNamesValue",
"(",
"value",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlValidateNamesValue",
"(",
"value",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L1845-L1848 | |
mingchen/protobuf-ios | 0958df34558cd54cb7b6e6ca5c8855bf3d475046 | compiler/python/google/protobuf/internal/containers.py | python | RepeatedCompositeFieldContainer.__init__ | (self, message_listener, message_descriptor) | Note that we pass in a descriptor instead of the generated directly,
since at the time we construct a _RepeatedCompositeFieldContainer we
haven't yet necessarily initialized the type that will be contained in the
container.
Args:
message_listener: A MessageListener implementation.
The Rep... | Note that we pass in a descriptor instead of the generated directly,
since at the time we construct a _RepeatedCompositeFieldContainer we
haven't yet necessarily initialized the type that will be contained in the
container. | [
"Note",
"that",
"we",
"pass",
"in",
"a",
"descriptor",
"instead",
"of",
"the",
"generated",
"directly",
"since",
"at",
"the",
"time",
"we",
"construct",
"a",
"_RepeatedCompositeFieldContainer",
"we",
"haven",
"t",
"yet",
"necessarily",
"initialized",
"the",
"typ... | def __init__(self, message_listener, message_descriptor):
"""
Note that we pass in a descriptor instead of the generated directly,
since at the time we construct a _RepeatedCompositeFieldContainer we
haven't yet necessarily initialized the type that will be contained in the
container.
Args:
... | [
"def",
"__init__",
"(",
"self",
",",
"message_listener",
",",
"message_descriptor",
")",
":",
"super",
"(",
"RepeatedCompositeFieldContainer",
",",
"self",
")",
".",
"__init__",
"(",
"message_listener",
")",
"self",
".",
"_message_descriptor",
"=",
"message_descript... | https://github.com/mingchen/protobuf-ios/blob/0958df34558cd54cb7b6e6ca5c8855bf3d475046/compiler/python/google/protobuf/internal/containers.py#L179-L196 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Tools/CryVersionSelector/cryselect.py | python | error_project_json_decode | (args) | Error to specify that the json file is corrupt and couldn't be parsed. | Error to specify that the json file is corrupt and couldn't be parsed. | [
"Error",
"to",
"specify",
"that",
"the",
"json",
"file",
"is",
"corrupt",
"and",
"couldn",
"t",
"be",
"parsed",
"."
] | def error_project_json_decode(args):
"""
Error to specify that the json file is corrupt and couldn't be parsed.
"""
message = "Unable to parse '{}'.\n".format(args.project_file)
if not args.silent and HAS_WIN_MODULES:
MESSAGEBOX(None, message, command_title(args),
win32con... | [
"def",
"error_project_json_decode",
"(",
"args",
")",
":",
"message",
"=",
"\"Unable to parse '{}'.\\n\"",
".",
"format",
"(",
"args",
".",
"project_file",
")",
"if",
"not",
"args",
".",
"silent",
"and",
"HAS_WIN_MODULES",
":",
"MESSAGEBOX",
"(",
"None",
",",
... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Tools/CryVersionSelector/cryselect.py#L100-L110 | ||
cvmfs/cvmfs | 4637bdb5153178eadf885c1acf37bdc5c685bf8a | cpplint.py | python | _IncludeState.CanonicalizeAlphabeticalOrder | (self, header_path) | return header_path.replace('-inl.h', '.h').replace('-', '_').lower() | Returns a path canonicalized for alphabetical comparison.
- replaces "-" with "_" so they both cmp the same.
- removes '-inl' since we don't require them to be after the main header.
- lowercase everything, just in case.
Args:
header_path: Path to be canonicalized.
Returns:
Canonicali... | Returns a path canonicalized for alphabetical comparison. | [
"Returns",
"a",
"path",
"canonicalized",
"for",
"alphabetical",
"comparison",
"."
] | def CanonicalizeAlphabeticalOrder(self, header_path):
"""Returns a path canonicalized for alphabetical comparison.
- replaces "-" with "_" so they both cmp the same.
- removes '-inl' since we don't require them to be after the main header.
- lowercase everything, just in case.
Args:
header_p... | [
"def",
"CanonicalizeAlphabeticalOrder",
"(",
"self",
",",
"header_path",
")",
":",
"return",
"header_path",
".",
"replace",
"(",
"'-inl.h'",
",",
"'.h'",
")",
".",
"replace",
"(",
"'-'",
",",
"'_'",
")",
".",
"lower",
"(",
")"
] | https://github.com/cvmfs/cvmfs/blob/4637bdb5153178eadf885c1acf37bdc5c685bf8a/cpplint.py#L667-L680 | |
floooh/oryol | eb08cffe1b1cb6b05ed14ec692bca9372cef064e | fips-files/generators/util/png.py | python | check_palette | (palette) | return p | Check a palette argument (to the :class:`Writer` class) for validity.
Returns the palette as a list if okay; raises an exception otherwise. | Check a palette argument (to the :class:`Writer` class) for validity.
Returns the palette as a list if okay; raises an exception otherwise. | [
"Check",
"a",
"palette",
"argument",
"(",
"to",
"the",
":",
"class",
":",
"Writer",
"class",
")",
"for",
"validity",
".",
"Returns",
"the",
"palette",
"as",
"a",
"list",
"if",
"okay",
";",
"raises",
"an",
"exception",
"otherwise",
"."
] | def check_palette(palette):
"""Check a palette argument (to the :class:`Writer` class) for validity.
Returns the palette as a list if okay; raises an exception otherwise.
"""
# None is the default and is allowed.
if palette is None:
return None
p = list(palette)
if not (0 < len(p) ... | [
"def",
"check_palette",
"(",
"palette",
")",
":",
"# None is the default and is allowed.",
"if",
"palette",
"is",
"None",
":",
"return",
"None",
"p",
"=",
"list",
"(",
"palette",
")",
"if",
"not",
"(",
"0",
"<",
"len",
"(",
"p",
")",
"<=",
"256",
")",
... | https://github.com/floooh/oryol/blob/eb08cffe1b1cb6b05ed14ec692bca9372cef064e/fips-files/generators/util/png.py#L267-L293 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/symsrc/pefile.py | python | SectionStructure.entropy_H | (self, data) | return entropy | Calculate the entropy of a chunk of data. | Calculate the entropy of a chunk of data. | [
"Calculate",
"the",
"entropy",
"of",
"a",
"chunk",
"of",
"data",
"."
] | def entropy_H(self, data):
"""Calculate the entropy of a chunk of data."""
if len(data) == 0:
return 0.0
occurences = array.array('L', [0]*256)
for x in data:
occurences[ord(x)] += 1
entropy = 0
for x in occurences:
if x... | [
"def",
"entropy_H",
"(",
"self",
",",
"data",
")",
":",
"if",
"len",
"(",
"data",
")",
"==",
"0",
":",
"return",
"0.0",
"occurences",
"=",
"array",
".",
"array",
"(",
"'L'",
",",
"[",
"0",
"]",
"*",
"256",
")",
"for",
"x",
"in",
"data",
":",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/symsrc/pefile.py#L913-L930 | |
apple/foundationdb | f7118ad406f44ab7a33970fc8370647ed0085e18 | layers/taskbucket/__init__.py | python | TaskBucket.extend | (self, tr, taskDict) | Extends the lock on a task previously locked by get_one for another self.timeout seconds.
If the task has already timed out, raises TaskTimedOutException. | Extends the lock on a task previously locked by get_one for another self.timeout seconds.
If the task has already timed out, raises TaskTimedOutException. | [
"Extends",
"the",
"lock",
"on",
"a",
"task",
"previously",
"locked",
"by",
"get_one",
"for",
"another",
"self",
".",
"timeout",
"seconds",
".",
"If",
"the",
"task",
"has",
"already",
"timed",
"out",
"raises",
"TaskTimedOutException",
"."
] | def extend(self, tr, taskDict):
"""Extends the lock on a task previously locked by get_one for another self.timeout seconds.
If the task has already timed out, raises TaskTimedOutException."""
pass | [
"def",
"extend",
"(",
"self",
",",
"tr",
",",
"taskDict",
")",
":",
"pass"
] | https://github.com/apple/foundationdb/blob/f7118ad406f44ab7a33970fc8370647ed0085e18/layers/taskbucket/__init__.py#L208-L211 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | contrib/gizmos/msw/gizmos.py | python | TreeListCtrl.SetColumnImage | (*args, **kwargs) | return _gizmos.TreeListCtrl_SetColumnImage(*args, **kwargs) | SetColumnImage(self, int column, int image) | SetColumnImage(self, int column, int image) | [
"SetColumnImage",
"(",
"self",
"int",
"column",
"int",
"image",
")"
] | def SetColumnImage(*args, **kwargs):
"""SetColumnImage(self, int column, int image)"""
return _gizmos.TreeListCtrl_SetColumnImage(*args, **kwargs) | [
"def",
"SetColumnImage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gizmos",
".",
"TreeListCtrl_SetColumnImage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/msw/gizmos.py#L626-L628 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | build/mac/change_mach_o_flags.py | python | CheckedRead | (file, count) | return bytes | Reads |count| bytes from the file-like |file| object, raising a
MachOError if any other number of bytes is read. | Reads |count| bytes from the file-like |file| object, raising a
MachOError if any other number of bytes is read. | [
"Reads",
"|count|",
"bytes",
"from",
"the",
"file",
"-",
"like",
"|file|",
"object",
"raising",
"a",
"MachOError",
"if",
"any",
"other",
"number",
"of",
"bytes",
"is",
"read",
"."
] | def CheckedRead(file, count):
"""Reads |count| bytes from the file-like |file| object, raising a
MachOError if any other number of bytes is read."""
bytes = file.read(count)
if len(bytes) != count:
raise MachOError, \
'read: expected length %d, observed %d' % (count, len(bytes))
return bytes | [
"def",
"CheckedRead",
"(",
"file",
",",
"count",
")",
":",
"bytes",
"=",
"file",
".",
"read",
"(",
"count",
")",
"if",
"len",
"(",
"bytes",
")",
"!=",
"count",
":",
"raise",
"MachOError",
",",
"'read: expected length %d, observed %d'",
"%",
"(",
"count",
... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/build/mac/change_mach_o_flags.py#L113-L122 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/src/robotsim.py | python | GeneralizedIKSolver.getJacobian | (self) | return _robotsim.GeneralizedIKSolver_getJacobian(self) | r"""
getJacobian(GeneralizedIKSolver self)
Returns a matrix describing the instantaneous derivative of the objective with
respect to the active parameters. | r"""
getJacobian(GeneralizedIKSolver self) | [
"r",
"getJacobian",
"(",
"GeneralizedIKSolver",
"self",
")"
] | def getJacobian(self) -> "void":
r"""
getJacobian(GeneralizedIKSolver self)
Returns a matrix describing the instantaneous derivative of the objective with
respect to the active parameters.
"""
return _robotsim.GeneralizedIKSolver_getJacobian(self) | [
"def",
"getJacobian",
"(",
"self",
")",
"->",
"\"void\"",
":",
"return",
"_robotsim",
".",
"GeneralizedIKSolver_getJacobian",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L7039-L7048 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/rfc822.py | python | Message.__getitem__ | (self, name) | return self.dict[name.lower()] | Get a specific header, as from a dictionary. | Get a specific header, as from a dictionary. | [
"Get",
"a",
"specific",
"header",
"as",
"from",
"a",
"dictionary",
"."
] | def __getitem__(self, name):
"""Get a specific header, as from a dictionary."""
return self.dict[name.lower()] | [
"def",
"__getitem__",
"(",
"self",
",",
"name",
")",
":",
"return",
"self",
".",
"dict",
"[",
"name",
".",
"lower",
"(",
")",
"]"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/rfc822.py#L386-L388 | |
facebook/fbthrift | fb9c8562aba04c4fd9b17716eb5d970cc88a75bb | thrift/lib/py/util/Serializer.py | python | serialize | (protocol_factory, thr) | return transport.getvalue() | Convenience method for serializing objects using the given
protocol factory and a TMemoryBuffer. | Convenience method for serializing objects using the given
protocol factory and a TMemoryBuffer. | [
"Convenience",
"method",
"for",
"serializing",
"objects",
"using",
"the",
"given",
"protocol",
"factory",
"and",
"a",
"TMemoryBuffer",
"."
] | def serialize(protocol_factory, thr):
# type: (Any, Any) -> AnyStr
"""Convenience method for serializing objects using the given
protocol factory and a TMemoryBuffer."""
transport = TTransport.TMemoryBuffer()
protocol = protocol_factory.getProtocol(transport)
thr.write(protocol)
if isinstanc... | [
"def",
"serialize",
"(",
"protocol_factory",
",",
"thr",
")",
":",
"# type: (Any, Any) -> AnyStr",
"transport",
"=",
"TTransport",
".",
"TMemoryBuffer",
"(",
")",
"protocol",
"=",
"protocol_factory",
".",
"getProtocol",
"(",
"transport",
")",
"thr",
".",
"write",
... | https://github.com/facebook/fbthrift/blob/fb9c8562aba04c4fd9b17716eb5d970cc88a75bb/thrift/lib/py/util/Serializer.py#L30-L39 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/neural_network/multilayer_perceptron.py | python | BaseMultilayerPerceptron._compute_loss_grad | (self, layer, n_samples, activations, deltas,
coef_grads, intercept_grads) | return coef_grads, intercept_grads | Compute the gradient of loss with respect to coefs and intercept for
specified layer.
This function does backpropagation for the specified one layer. | Compute the gradient of loss with respect to coefs and intercept for
specified layer. | [
"Compute",
"the",
"gradient",
"of",
"loss",
"with",
"respect",
"to",
"coefs",
"and",
"intercept",
"for",
"specified",
"layer",
"."
] | def _compute_loss_grad(self, layer, n_samples, activations, deltas,
coef_grads, intercept_grads):
"""Compute the gradient of loss with respect to coefs and intercept for
specified layer.
This function does backpropagation for the specified one layer.
"""
... | [
"def",
"_compute_loss_grad",
"(",
"self",
",",
"layer",
",",
"n_samples",
",",
"activations",
",",
"deltas",
",",
"coef_grads",
",",
"intercept_grads",
")",
":",
"coef_grads",
"[",
"layer",
"]",
"=",
"safe_sparse_dot",
"(",
"activations",
"[",
"layer",
"]",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/neural_network/multilayer_perceptron.py#L117-L131 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/ipaddress.py | python | _BaseNetwork.is_link_local | (self) | return (self.network_address.is_link_local and
self.broadcast_address.is_link_local) | Test if the address is reserved for link-local.
Returns:
A boolean, True if the address is reserved per RFC 4291. | Test if the address is reserved for link-local. | [
"Test",
"if",
"the",
"address",
"is",
"reserved",
"for",
"link",
"-",
"local",
"."
] | def is_link_local(self):
"""Test if the address is reserved for link-local.
Returns:
A boolean, True if the address is reserved per RFC 4291.
"""
return (self.network_address.is_link_local and
self.broadcast_address.is_link_local) | [
"def",
"is_link_local",
"(",
"self",
")",
":",
"return",
"(",
"self",
".",
"network_address",
".",
"is_link_local",
"and",
"self",
".",
"broadcast_address",
".",
"is_link_local",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/ipaddress.py#L1135-L1143 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/setuptools/_vendor/pyparsing.py | python | tokenMap | (func, *args) | return pa | Helper to define a parse action by mapping a function to all elements of a ParseResults list.If any additional
args are passed, they are forwarded to the given function as additional arguments after
the token, as in C{hex_integer = Word(hexnums).setParseAction(tokenMap(int, 16))}, which will convert the
pa... | Helper to define a parse action by mapping a function to all elements of a ParseResults list.If any additional
args are passed, they are forwarded to the given function as additional arguments after
the token, as in C{hex_integer = Word(hexnums).setParseAction(tokenMap(int, 16))}, which will convert the
pa... | [
"Helper",
"to",
"define",
"a",
"parse",
"action",
"by",
"mapping",
"a",
"function",
"to",
"all",
"elements",
"of",
"a",
"ParseResults",
"list",
".",
"If",
"any",
"additional",
"args",
"are",
"passed",
"they",
"are",
"forwarded",
"to",
"the",
"given",
"func... | def tokenMap(func, *args):
"""
Helper to define a parse action by mapping a function to all elements of a ParseResults list.If any additional
args are passed, they are forwarded to the given function as additional arguments after
the token, as in C{hex_integer = Word(hexnums).setParseAction(tokenMap(in... | [
"def",
"tokenMap",
"(",
"func",
",",
"*",
"args",
")",
":",
"def",
"pa",
"(",
"s",
",",
"l",
",",
"t",
")",
":",
"return",
"[",
"func",
"(",
"tokn",
",",
"*",
"args",
")",
"for",
"tokn",
"in",
"t",
"]",
"try",
":",
"func_name",
"=",
"getattr"... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/setuptools/_vendor/pyparsing.py#L4825-L4867 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/directnotify/Notifier.py | python | Notifier.setLogging | (self, enable) | Set the logging flag to int (1=on, 0=off) | Set the logging flag to int (1=on, 0=off) | [
"Set",
"the",
"logging",
"flag",
"to",
"int",
"(",
"1",
"=",
"on",
"0",
"=",
"off",
")"
] | def setLogging(self, enable):
"""
Set the logging flag to int (1=on, 0=off)
"""
self.__logging = enable | [
"def",
"setLogging",
"(",
"self",
",",
"enable",
")",
":",
"self",
".",
"__logging",
"=",
"enable"
] | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/directnotify/Notifier.py#L227-L231 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/eager/python/evaluator.py | python | Evaluator.call | (self, eval_data) | Update metrics using the output of self.model.
Note: This function is executed as a graph function in graph mode.
This means:
a) Operations on the same resource are executed in textual order.
This should make it easier to do things like add the updated
value of a variable to another, for exam... | Update metrics using the output of self.model. | [
"Update",
"metrics",
"using",
"the",
"output",
"of",
"self",
".",
"model",
"."
] | def call(self, eval_data):
"""Update metrics using the output of self.model.
Note: This function is executed as a graph function in graph mode.
This means:
a) Operations on the same resource are executed in textual order.
This should make it easier to do things like add the updated
value ... | [
"def",
"call",
"(",
"self",
",",
"eval_data",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"Evaluators must define a call member function.\"",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/eager/python/evaluator.py#L182-L199 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/requests/cookies.py | python | RequestsCookieJar.values | (self) | return list(self.itervalues()) | Dict-like values() that returns a list of values of cookies from the
jar.
.. seealso:: keys() and items(). | Dict-like values() that returns a list of values of cookies from the | [
"Dict",
"-",
"like",
"values",
"()",
"that",
"returns",
"a",
"list",
"of",
"values",
"of",
"cookies",
"from",
"the"
] | def values(self):
"""Dict-like values() that returns a list of values of cookies from the
jar.
.. seealso:: keys() and items().
"""
return list(self.itervalues()) | [
"def",
"values",
"(",
"self",
")",
":",
"return",
"list",
"(",
"self",
".",
"itervalues",
"(",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/requests/cookies.py#L487-L499 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/android/loading/sandwich_prefetch.py | python | PrefetchBenchmarkBuilder._PopulateCommonPipelines | (self) | Creates necessary tasks to produce initial cache archive.
Also creates a task for producing a json file with a mapping of URLs to
subresources (urls-resources.json).
Here is the full dependency tree for the returned task:
common/patched-cache-validation.json
depends on: common/patched-cache.zip
... | Creates necessary tasks to produce initial cache archive. | [
"Creates",
"necessary",
"tasks",
"to",
"produce",
"initial",
"cache",
"archive",
"."
] | def _PopulateCommonPipelines(self):
"""Creates necessary tasks to produce initial cache archive.
Also creates a task for producing a json file with a mapping of URLs to
subresources (urls-resources.json).
Here is the full dependency tree for the returned task:
common/patched-cache-validation.json
... | [
"def",
"_PopulateCommonPipelines",
"(",
"self",
")",
":",
"self",
".",
"_original_headers_path",
"=",
"self",
".",
"RebaseOutputPath",
"(",
"'common/response-headers.json'",
")",
"@",
"self",
".",
"RegisterTask",
"(",
"'common/webpages-patched.wpr'",
",",
"dependencies"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/loading/sandwich_prefetch.py#L510-L585 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Canvas.find_all | (self) | return self.find('all') | Return all items. | Return all items. | [
"Return",
"all",
"items",
"."
] | def find_all(self):
"""Return all items."""
return self.find('all') | [
"def",
"find_all",
"(",
"self",
")",
":",
"return",
"self",
".",
"find",
"(",
"'all'",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2297-L2299 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/period.py | python | period_array | (
data: Sequence[Optional[Period]],
freq: Optional[Union[str, Tick]] = None,
copy: bool = False,
) | return PeriodArray._from_sequence(data, dtype=dtype) | Construct a new PeriodArray from a sequence of Period scalars.
Parameters
----------
data : Sequence of Period objects
A sequence of Period objects. These are required to all have
the same ``freq.`` Missing values can be indicated by ``None``
or ``pandas.NaT``.
freq : str, Tick,... | Construct a new PeriodArray from a sequence of Period scalars. | [
"Construct",
"a",
"new",
"PeriodArray",
"from",
"a",
"sequence",
"of",
"Period",
"scalars",
"."
] | def period_array(
data: Sequence[Optional[Period]],
freq: Optional[Union[str, Tick]] = None,
copy: bool = False,
) -> PeriodArray:
"""
Construct a new PeriodArray from a sequence of Period scalars.
Parameters
----------
data : Sequence of Period objects
A sequence of Period obje... | [
"def",
"period_array",
"(",
"data",
":",
"Sequence",
"[",
"Optional",
"[",
"Period",
"]",
"]",
",",
"freq",
":",
"Optional",
"[",
"Union",
"[",
"str",
",",
"Tick",
"]",
"]",
"=",
"None",
",",
"copy",
":",
"bool",
"=",
"False",
",",
")",
"->",
"Pe... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/period.py#L794-L873 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextCtrl.ApplyTextEffectToSelection | (*args, **kwargs) | return _richtext.RichTextCtrl_ApplyTextEffectToSelection(*args, **kwargs) | ApplyTextEffectToSelection(self, int flags) -> bool | ApplyTextEffectToSelection(self, int flags) -> bool | [
"ApplyTextEffectToSelection",
"(",
"self",
"int",
"flags",
")",
"-",
">",
"bool"
] | def ApplyTextEffectToSelection(*args, **kwargs):
"""ApplyTextEffectToSelection(self, int flags) -> bool"""
return _richtext.RichTextCtrl_ApplyTextEffectToSelection(*args, **kwargs) | [
"def",
"ApplyTextEffectToSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_ApplyTextEffectToSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L3975-L3977 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Runtime/VART/vart/rnn-runner/apps/imdb_sentiment_detection/utils/hdf5_format.py | python | save_optimizer_weights_to_hdf5_group | (hdf5_group, optimizer) | Saves optimizer weights of a optimizer to a HDF5 group.
Arguments:
hdf5_group: HDF5 group.
optimizer: optimizer instance. | Saves optimizer weights of a optimizer to a HDF5 group. | [
"Saves",
"optimizer",
"weights",
"of",
"a",
"optimizer",
"to",
"a",
"HDF5",
"group",
"."
] | def save_optimizer_weights_to_hdf5_group(hdf5_group, optimizer):
"""Saves optimizer weights of a optimizer to a HDF5 group.
Arguments:
hdf5_group: HDF5 group.
optimizer: optimizer instance.
"""
symbolic_weights = getattr(optimizer, 'weights')
if symbolic_weights:
weights_group = hdf5_group.c... | [
"def",
"save_optimizer_weights_to_hdf5_group",
"(",
"hdf5_group",
",",
"optimizer",
")",
":",
"symbolic_weights",
"=",
"getattr",
"(",
"optimizer",
",",
"'weights'",
")",
"if",
"symbolic_weights",
":",
"weights_group",
"=",
"hdf5_group",
".",
"create_group",
"(",
"'... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Runtime/VART/vart/rnn-runner/apps/imdb_sentiment_detection/utils/hdf5_format.py#L585-L606 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/linear_optimizer/python/ops/sparse_feature_column.py | python | SparseFeatureColumn.example_indices | (self) | return self._example_indices | The example indices represented as a dense tensor.
Returns:
A 1-D Tensor of int64 with shape `[N]`. | The example indices represented as a dense tensor. | [
"The",
"example",
"indices",
"represented",
"as",
"a",
"dense",
"tensor",
"."
] | def example_indices(self):
"""The example indices represented as a dense tensor.
Returns:
A 1-D Tensor of int64 with shape `[N]`.
"""
return self._example_indices | [
"def",
"example_indices",
"(",
"self",
")",
":",
"return",
"self",
".",
"_example_indices"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/linear_optimizer/python/ops/sparse_feature_column.py#L98-L104 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/auibook.py | python | AuiNotebook.FindNextActiveTab | (self, ctrl_idx, ctrl) | return 0 | Finds the next active tab (used mainly when :class:`AuiNotebook` has inactive/disabled
tabs in it).
:param integer `ctrl_idx`: the index of the first (most obvious) tab to check for active status;
:param `ctrl`: an instance of :class:`AuiTabCtrl`. | Finds the next active tab (used mainly when :class:`AuiNotebook` has inactive/disabled
tabs in it). | [
"Finds",
"the",
"next",
"active",
"tab",
"(",
"used",
"mainly",
"when",
":",
"class",
":",
"AuiNotebook",
"has",
"inactive",
"/",
"disabled",
"tabs",
"in",
"it",
")",
"."
] | def FindNextActiveTab(self, ctrl_idx, ctrl):
"""
Finds the next active tab (used mainly when :class:`AuiNotebook` has inactive/disabled
tabs in it).
:param integer `ctrl_idx`: the index of the first (most obvious) tab to check for active status;
:param `ctrl`: an instance of :cl... | [
"def",
"FindNextActiveTab",
"(",
"self",
",",
"ctrl_idx",
",",
"ctrl",
")",
":",
"if",
"self",
".",
"GetEnabled",
"(",
"ctrl_idx",
")",
":",
"return",
"ctrl_idx",
"for",
"indx",
"in",
"xrange",
"(",
"ctrl_idx",
",",
"ctrl",
".",
"GetPageCount",
"(",
")",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibook.py#L3499-L3519 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/modulefinder.py | python | ModuleFinder.any_missing_maybe | (self) | return missing, maybe | Return two lists, one with modules that are certainly missing
and one with modules that *may* be missing. The latter names could
either be submodules *or* just global names in the package.
The reason it can't always be determined is that it's impossible to
tell which names are imported ... | Return two lists, one with modules that are certainly missing
and one with modules that *may* be missing. The latter names could
either be submodules *or* just global names in the package. | [
"Return",
"two",
"lists",
"one",
"with",
"modules",
"that",
"are",
"certainly",
"missing",
"and",
"one",
"with",
"modules",
"that",
"*",
"may",
"*",
"be",
"missing",
".",
"The",
"latter",
"names",
"could",
"either",
"be",
"submodules",
"*",
"or",
"*",
"j... | def any_missing_maybe(self):
"""Return two lists, one with modules that are certainly missing
and one with modules that *may* be missing. The latter names could
either be submodules *or* just global names in the package.
The reason it can't always be determined is that it's impossible t... | [
"def",
"any_missing_maybe",
"(",
"self",
")",
":",
"missing",
"=",
"[",
"]",
"maybe",
"=",
"[",
"]",
"for",
"name",
"in",
"self",
".",
"badmodules",
":",
"if",
"name",
"in",
"self",
".",
"excludes",
":",
"continue",
"i",
"=",
"name",
".",
"rfind",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/modulefinder.py#L495-L539 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/maximum-binary-tree.py | python | Solution.constructMaximumBinaryTree | (self, nums) | return nodeStack[0] | :type nums: List[int]
:rtype: TreeNode | :type nums: List[int]
:rtype: TreeNode | [
":",
"type",
"nums",
":",
"List",
"[",
"int",
"]",
":",
"rtype",
":",
"TreeNode"
] | def constructMaximumBinaryTree(self, nums):
"""
:type nums: List[int]
:rtype: TreeNode
"""
# https://github.com/kamyu104/LintCode/blob/master/C++/max-tree.cpp
nodeStack = []
for num in nums:
node = TreeNode(num)
while nodeStack and num > no... | [
"def",
"constructMaximumBinaryTree",
"(",
"self",
",",
"nums",
")",
":",
"# https://github.com/kamyu104/LintCode/blob/master/C++/max-tree.cpp",
"nodeStack",
"=",
"[",
"]",
"for",
"num",
"in",
"nums",
":",
"node",
"=",
"TreeNode",
"(",
"num",
")",
"while",
"nodeStack... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/maximum-binary-tree.py#L12-L26 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/parallel/_cost_model_context.py | python | _CostModelContext.get_costmodel_allreduce_fusion_tail_percent | (self) | return self._context_handle.get_costmodel_allreduce_fusion_tail_percent() | Get costmodel allreduce fusion tail percent.
Raises:
ValueError: If context handle is none. | Get costmodel allreduce fusion tail percent. | [
"Get",
"costmodel",
"allreduce",
"fusion",
"tail",
"percent",
"."
] | def get_costmodel_allreduce_fusion_tail_percent(self):
"""
Get costmodel allreduce fusion tail percent.
Raises:
ValueError: If context handle is none.
"""
if self._context_handle is None:
raise ValueError("Context handle is none in context!!!")
re... | [
"def",
"get_costmodel_allreduce_fusion_tail_percent",
"(",
"self",
")",
":",
"if",
"self",
".",
"_context_handle",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Context handle is none in context!!!\"",
")",
"return",
"self",
".",
"_context_handle",
".",
"get_costmod... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/parallel/_cost_model_context.py#L364-L373 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/infobar.py | python | InfoBar.SetShowHideEffects | (self, showEffect, hideEffect) | Set the effects to use when showing and hiding the bar.
Either or both of the parameters can be set to ``wx.SHOW_EFFECT_NONE`` to disable using
effects entirely.
By default, the info bar uses ``wx.SHOW_EFFECT_SLIDE_TO_BOTTOM`` effect for showing itself
and ``wx.SHOW_EFFECT_SLIDE_TO_TOP... | Set the effects to use when showing and hiding the bar. | [
"Set",
"the",
"effects",
"to",
"use",
"when",
"showing",
"and",
"hiding",
"the",
"bar",
"."
] | def SetShowHideEffects(self, showEffect, hideEffect):
"""
Set the effects to use when showing and hiding the bar.
Either or both of the parameters can be set to ``wx.SHOW_EFFECT_NONE`` to disable using
effects entirely.
By default, the info bar uses ``wx.SHOW_EFFECT_SLIDE_TO_BO... | [
"def",
"SetShowHideEffects",
"(",
"self",
",",
"showEffect",
",",
"hideEffect",
")",
":",
"self",
".",
"_showEffect",
"=",
"showEffect",
"self",
".",
"_hideEffect",
"=",
"hideEffect"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/infobar.py#L775-L812 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/resmokelib/run/__init__.py | python | TestRunner.run_tests | (self) | Run the suite and tests specified. | Run the suite and tests specified. | [
"Run",
"the",
"suite",
"and",
"tests",
"specified",
"."
] | def run_tests(self):
"""Run the suite and tests specified."""
self._resmoke_logger.info("verbatim resmoke.py invocation: %s",
" ".join([shlex.quote(arg) for arg in sys.argv]))
if config.EVERGREEN_TASK_DOC:
self._resmoke_logger.info("Evergreen task d... | [
"def",
"run_tests",
"(",
"self",
")",
":",
"self",
".",
"_resmoke_logger",
".",
"info",
"(",
"\"verbatim resmoke.py invocation: %s\"",
",",
"\" \"",
".",
"join",
"(",
"[",
"shlex",
".",
"quote",
"(",
"arg",
")",
"for",
"arg",
"in",
"sys",
".",
"argv",
"]... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/run/__init__.py#L216-L257 | ||
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/control.py | python | coverage.__init__ | (self, data_file=None, data_suffix=None, cover_pylib=None,
auto_data=False, timid=None, branch=None, config_file=True,
source=None, omit=None, include=None) | `data_file` is the base name of the data file to use, defaulting to
".coverage". `data_suffix` is appended (with a dot) to `data_file` to
create the final file name. If `data_suffix` is simply True, then a
suffix is created with the machine and process identity included.
`cover_pylib`... | `data_file` is the base name of the data file to use, defaulting to
".coverage". `data_suffix` is appended (with a dot) to `data_file` to
create the final file name. If `data_suffix` is simply True, then a
suffix is created with the machine and process identity included. | [
"data_file",
"is",
"the",
"base",
"name",
"of",
"the",
"data",
"file",
"to",
"use",
"defaulting",
"to",
".",
"coverage",
".",
"data_suffix",
"is",
"appended",
"(",
"with",
"a",
"dot",
")",
"to",
"data_file",
"to",
"create",
"the",
"final",
"file",
"name"... | def __init__(self, data_file=None, data_suffix=None, cover_pylib=None,
auto_data=False, timid=None, branch=None, config_file=True,
source=None, omit=None, include=None):
"""
`data_file` is the base name of the data file to use, defaulting to
".coverage". `data_su... | [
"def",
"__init__",
"(",
"self",
",",
"data_file",
"=",
"None",
",",
"data_suffix",
"=",
"None",
",",
"cover_pylib",
"=",
"None",
",",
"auto_data",
"=",
"False",
",",
"timid",
"=",
"None",
",",
"branch",
"=",
"None",
",",
"config_file",
"=",
"True",
","... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/control.py#L33-L192 | ||
nyuwireless-unipd/ns3-mmwave | 4ff9e87e8079764e04cbeccd8e85bff15ae16fb3 | utils/grid.py | python | MainWindow.__init__ | (self) | return | ! Initializer
@param self this object
@return none | ! Initializer | [
"!",
"Initializer"
] | def __init__(self):
"""! Initializer
@param self this object
@return none
"""
return | [
"def",
"__init__",
"(",
"self",
")",
":",
"return"
] | https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/utils/grid.py#L1542-L1547 | |
twtygqyy/caffe-augmentation | c76600d247e5132fa5bd89d87bb5df458341fa84 | scripts/cpp_lint.py | python | IsBlankLine | (line) | return not line or line.isspace() | Returns true if the given line is blank.
We consider a line to be blank if the line is empty or consists of
only white spaces.
Args:
line: A line of a string.
Returns:
True, if the given line is blank. | Returns true if the given line is blank. | [
"Returns",
"true",
"if",
"the",
"given",
"line",
"is",
"blank",
"."
] | def IsBlankLine(line):
"""Returns true if the given line is blank.
We consider a line to be blank if the line is empty or consists of
only white spaces.
Args:
line: A line of a string.
Returns:
True, if the given line is blank.
"""
return not line or line.isspace() | [
"def",
"IsBlankLine",
"(",
"line",
")",
":",
"return",
"not",
"line",
"or",
"line",
".",
"isspace",
"(",
")"
] | https://github.com/twtygqyy/caffe-augmentation/blob/c76600d247e5132fa5bd89d87bb5df458341fa84/scripts/cpp_lint.py#L2373-L2385 | |
moflow/moflow | 2dfb27c799c90c6caf1477508eca3eec616ef7d2 | bap/libtracewrap/libtrace/protobuf/python/google/protobuf/service.py | python | Service.GetRequestClass | (self, method_descriptor) | Returns the class of the request message for the specified method.
CallMethod() requires that the request is of a particular subclass of
Message. GetRequestClass() gets the default instance of this required
type.
Example:
method = service.GetDescriptor().FindMethodByName("Foo")
request = s... | Returns the class of the request message for the specified method. | [
"Returns",
"the",
"class",
"of",
"the",
"request",
"message",
"for",
"the",
"specified",
"method",
"."
] | def GetRequestClass(self, method_descriptor):
"""Returns the class of the request message for the specified method.
CallMethod() requires that the request is of a particular subclass of
Message. GetRequestClass() gets the default instance of this required
type.
Example:
method = service.GetD... | [
"def",
"GetRequestClass",
"(",
"self",
",",
"method_descriptor",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/moflow/moflow/blob/2dfb27c799c90c6caf1477508eca3eec616ef7d2/bap/libtracewrap/libtrace/protobuf/python/google/protobuf/service.py#L93-L106 | ||
gemrb/gemrb | 730206eed8d1dd358ca5e69a62f9e099aa22ffc6 | gemrb/GUIScripts/DualClass.py | python | DCProfsDonePress | () | return | Goes to the next applicable step.
This is either skill selection, spell selection, or nothing. | Goes to the next applicable step. | [
"Goes",
"to",
"the",
"next",
"applicable",
"step",
"."
] | def DCProfsDonePress ():
"""Goes to the next applicable step.
This is either skill selection, spell selection, or nothing."""
global NewMageSpells, NewPriestMask
# check for mage spells and thief skills
SpellTable = CommonTables.ClassSkills.GetValue (ClassName, "MAGESPELL")
ClericTable = CommonTables.ClassSkil... | [
"def",
"DCProfsDonePress",
"(",
")",
":",
"global",
"NewMageSpells",
",",
"NewPriestMask",
"# check for mage spells and thief skills",
"SpellTable",
"=",
"CommonTables",
".",
"ClassSkills",
".",
"GetValue",
"(",
"ClassName",
",",
"\"MAGESPELL\"",
")",
"ClericTable",
"="... | https://github.com/gemrb/gemrb/blob/730206eed8d1dd358ca5e69a62f9e099aa22ffc6/gemrb/GUIScripts/DualClass.py#L520-L561 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/oldnumeric/ma.py | python | MaskedArray.__nonzero__ | (self) | return bool(m is not nomask and m.any()
or d is not nomask and d.any()) | returns true if any element is non-zero or masked | returns true if any element is non-zero or masked | [
"returns",
"true",
"if",
"any",
"element",
"is",
"non",
"-",
"zero",
"or",
"masked"
] | def __nonzero__(self):
"""returns true if any element is non-zero or masked
"""
# XXX: This changes bool conversion logic from MA.
# XXX: In MA bool(a) == len(a) != 0, but in numpy
# XXX: scalars do not have len
m = self._mask
d = self._data
return bool(m... | [
"def",
"__nonzero__",
"(",
"self",
")",
":",
"# XXX: This changes bool conversion logic from MA.",
"# XXX: In MA bool(a) == len(a) != 0, but in numpy",
"# XXX: scalars do not have len",
"m",
"=",
"self",
".",
"_mask",
"d",
"=",
"self",
".",
"_data",
"return",
"bool",
"(",
... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/oldnumeric/ma.py#L854-L864 | |
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Wrapping/Python/paraview/servermanager.py | python | InputProperty.__getitem__ | (self, idx) | return OutputPort(_getPyProxy(self.SMProperty.GetProxy(idx)),\
self.SMProperty.GetOutputPortForConnection(idx)) | Returns the range [min, max) of elements. Raises an IndexError
exception if an argument is out of bounds. | Returns the range [min, max) of elements. Raises an IndexError
exception if an argument is out of bounds. | [
"Returns",
"the",
"range",
"[",
"min",
"max",
")",
"of",
"elements",
".",
"Raises",
"an",
"IndexError",
"exception",
"if",
"an",
"argument",
"is",
"out",
"of",
"bounds",
"."
] | def __getitem__(self, idx):
"""Returns the range [min, max) of elements. Raises an IndexError
exception if an argument is out of bounds."""
if isinstance(idx, slice):
indices = idx.indices(len(self))
retVal = []
for i in range(*indices):
port = None
if s... | [
"def",
"__getitem__",
"(",
"self",
",",
"idx",
")",
":",
"if",
"isinstance",
"(",
"idx",
",",
"slice",
")",
":",
"indices",
"=",
"idx",
".",
"indices",
"(",
"len",
"(",
"self",
")",
")",
"retVal",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/servermanager.py#L1426-L1442 | |
apache/impala | 8ddac48f3428c86f2cbd037ced89cfb903298b12 | shell/ext-py/six-1.14.0/six.py | python | ensure_str | (s, encoding='utf-8', errors='strict') | return s | Coerce *s* to `str`.
For Python 2:
- `unicode` -> encoded to `str`
- `str` -> `str`
For Python 3:
- `str` -> `str`
- `bytes` -> decoded to `str` | Coerce *s* to `str`. | [
"Coerce",
"*",
"s",
"*",
"to",
"str",
"."
] | def ensure_str(s, encoding='utf-8', errors='strict'):
"""Coerce *s* to `str`.
For Python 2:
- `unicode` -> encoded to `str`
- `str` -> `str`
For Python 3:
- `str` -> `str`
- `bytes` -> decoded to `str`
"""
if not isinstance(s, (text_type, binary_type)):
raise TypeEr... | [
"def",
"ensure_str",
"(",
"s",
",",
"encoding",
"=",
"'utf-8'",
",",
"errors",
"=",
"'strict'",
")",
":",
"if",
"not",
"isinstance",
"(",
"s",
",",
"(",
"text_type",
",",
"binary_type",
")",
")",
":",
"raise",
"TypeError",
"(",
"\"not expecting type '%s'\"... | https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/shell/ext-py/six-1.14.0/six.py#L901-L918 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/feature_column/feature_column_v2.py | python | NumericColumn.variable_shape | (self) | return tensor_shape.TensorShape(self.shape) | See `DenseColumn` base class. | See `DenseColumn` base class. | [
"See",
"DenseColumn",
"base",
"class",
"."
] | def variable_shape(self):
"""See `DenseColumn` base class."""
return tensor_shape.TensorShape(self.shape) | [
"def",
"variable_shape",
"(",
"self",
")",
":",
"return",
"tensor_shape",
".",
"TensorShape",
"(",
"self",
".",
"shape",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/feature_column/feature_column_v2.py#L2669-L2671 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/android/appstats.py | python | MemoryHelper.QueryMemory | (adb, pid) | return results | Queries the device for memory information about the process with a pid of
|pid|. It will query Native, Dalvik, and Pss memory of the process. It
returns a list of values: [ Native, Pss, Dalvik ]. If the process is not
found it will return [ 0, 0, 0 ]. | Queries the device for memory information about the process with a pid of
|pid|. It will query Native, Dalvik, and Pss memory of the process. It
returns a list of values: [ Native, Pss, Dalvik ]. If the process is not
found it will return [ 0, 0, 0 ]. | [
"Queries",
"the",
"device",
"for",
"memory",
"information",
"about",
"the",
"process",
"with",
"a",
"pid",
"of",
"|pid|",
".",
"It",
"will",
"query",
"Native",
"Dalvik",
"and",
"Pss",
"memory",
"of",
"the",
"process",
".",
"It",
"returns",
"a",
"list",
"... | def QueryMemory(adb, pid):
"""Queries the device for memory information about the process with a pid of
|pid|. It will query Native, Dalvik, and Pss memory of the process. It
returns a list of values: [ Native, Pss, Dalvik ]. If the process is not
found it will return [ 0, 0, 0 ]."""
results = [0... | [
"def",
"QueryMemory",
"(",
"adb",
",",
"pid",
")",
":",
"results",
"=",
"[",
"0",
",",
"0",
",",
"0",
"]",
"mem_lines",
"=",
"adb",
".",
"RunShellCommand",
"(",
"[",
"'dumpsys'",
",",
"'meminfo'",
",",
"pid",
"]",
")",
"for",
"line",
"in",
"mem_lin... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/appstats.py#L205-L239 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | DateTime.IsLeapYear | (*args, **kwargs) | return _misc_.DateTime_IsLeapYear(*args, **kwargs) | IsLeapYear(int year=Inv_Year, int cal=Gregorian) -> bool | IsLeapYear(int year=Inv_Year, int cal=Gregorian) -> bool | [
"IsLeapYear",
"(",
"int",
"year",
"=",
"Inv_Year",
"int",
"cal",
"=",
"Gregorian",
")",
"-",
">",
"bool"
] | def IsLeapYear(*args, **kwargs):
"""IsLeapYear(int year=Inv_Year, int cal=Gregorian) -> bool"""
return _misc_.DateTime_IsLeapYear(*args, **kwargs) | [
"def",
"IsLeapYear",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateTime_IsLeapYear",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L3702-L3704 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBWatchpoint.GetWatchAddress | (self) | return _lldb.SBWatchpoint_GetWatchAddress(self) | GetWatchAddress(SBWatchpoint self) -> lldb::addr_t | GetWatchAddress(SBWatchpoint self) -> lldb::addr_t | [
"GetWatchAddress",
"(",
"SBWatchpoint",
"self",
")",
"-",
">",
"lldb",
"::",
"addr_t"
] | def GetWatchAddress(self):
"""GetWatchAddress(SBWatchpoint self) -> lldb::addr_t"""
return _lldb.SBWatchpoint_GetWatchAddress(self) | [
"def",
"GetWatchAddress",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBWatchpoint_GetWatchAddress",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L15191-L15193 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.