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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/configparser.py | python | RawConfigParser.sections | (self) | return list(self._sections.keys()) | Return a list of section names, excluding [DEFAULT] | Return a list of section names, excluding [DEFAULT] | [
"Return",
"a",
"list",
"of",
"section",
"names",
"excluding",
"[",
"DEFAULT",
"]"
] | def sections(self):
"""Return a list of section names, excluding [DEFAULT]"""
# self._sections will never have [DEFAULT] in it
return list(self._sections.keys()) | [
"def",
"sections",
"(",
"self",
")",
":",
"# self._sections will never have [DEFAULT] in it",
"return",
"list",
"(",
"self",
".",
"_sections",
".",
"keys",
"(",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/configparser.py#L643-L646 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/data-stream-as-disjoint-intervals.py | python | SummaryRanges.__init__ | (self) | Initialize your data structure here. | Initialize your data structure here. | [
"Initialize",
"your",
"data",
"structure",
"here",
"."
] | def __init__(self):
"""
Initialize your data structure here.
"""
self.__intervals = [] | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"__intervals",
"=",
"[",
"]"
] | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/data-stream-as-disjoint-intervals.py#L12-L16 | ||
mingchen/protobuf-ios | 0958df34558cd54cb7b6e6ca5c8855bf3d475046 | compiler/python/google/protobuf/internal/containers.py | python | RepeatedScalarFieldContainer.__getslice__ | (self, start, stop) | return self._values[start:stop] | Retrieves the subset of items from between the specified indices. | Retrieves the subset of items from between the specified indices. | [
"Retrieves",
"the",
"subset",
"of",
"items",
"from",
"between",
"the",
"specified",
"indices",
"."
] | def __getslice__(self, start, stop):
"""Retrieves the subset of items from between the specified indices."""
return self._values[start:stop] | [
"def",
"__getslice__",
"(",
"self",
",",
"start",
",",
"stop",
")",
":",
"return",
"self",
".",
"_values",
"[",
"start",
":",
"stop",
"]"
] | https://github.com/mingchen/protobuf-ios/blob/0958df34558cd54cb7b6e6ca5c8855bf3d475046/compiler/python/google/protobuf/internal/containers.py#L138-L140 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/most-common-word.py | python | Solution.mostCommonWord | (self, paragraph, banned) | return result | :type paragraph: str
:type banned: List[str]
:rtype: str | :type paragraph: str
:type banned: List[str]
:rtype: str | [
":",
"type",
"paragraph",
":",
"str",
":",
"type",
"banned",
":",
"List",
"[",
"str",
"]",
":",
"rtype",
":",
"str"
] | def mostCommonWord(self, paragraph, banned):
"""
:type paragraph: str
:type banned: List[str]
:rtype: str
"""
lookup = set(banned)
counts = collections.Counter(word.strip("!?',.")
for word in paragraph.lower().split())
... | [
"def",
"mostCommonWord",
"(",
"self",
",",
"paragraph",
",",
"banned",
")",
":",
"lookup",
"=",
"set",
"(",
"banned",
")",
"counts",
"=",
"collections",
".",
"Counter",
"(",
"word",
".",
"strip",
"(",
"\"!?',.\"",
")",
"for",
"word",
"in",
"paragraph",
... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/most-common-word.py#L8-L23 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/preprocessor.py | python | Preprocessor.clone | (self) | return rv | Create a clone of the current processor, including line ending
settings, marker, variable definitions, output stream. | Create a clone of the current processor, including line ending
settings, marker, variable definitions, output stream. | [
"Create",
"a",
"clone",
"of",
"the",
"current",
"processor",
"including",
"line",
"ending",
"settings",
"marker",
"variable",
"definitions",
"output",
"stream",
"."
] | def clone(self):
"""
Create a clone of the current processor, including line ending
settings, marker, variable definitions, output stream.
"""
rv = Preprocessor()
rv.context.update(self.context)
rv.setMarker(self.marker)
rv.LE = self.LE
rv.out = se... | [
"def",
"clone",
"(",
"self",
")",
":",
"rv",
"=",
"Preprocessor",
"(",
")",
"rv",
".",
"context",
".",
"update",
"(",
"self",
".",
"context",
")",
"rv",
".",
"setMarker",
"(",
"self",
".",
"marker",
")",
"rv",
".",
"LE",
"=",
"self",
".",
"LE",
... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/preprocessor.py#L369-L379 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/devil/devil/android/apk_helper.py | python | GetInstrumentationName | (apk_path) | return ApkHelper(apk_path).GetInstrumentationName() | Returns the name of the Instrumentation in the apk. | Returns the name of the Instrumentation in the apk. | [
"Returns",
"the",
"name",
"of",
"the",
"Instrumentation",
"in",
"the",
"apk",
"."
] | def GetInstrumentationName(apk_path):
"""Returns the name of the Instrumentation in the apk."""
return ApkHelper(apk_path).GetInstrumentationName() | [
"def",
"GetInstrumentationName",
"(",
"apk_path",
")",
":",
"return",
"ApkHelper",
"(",
"apk_path",
")",
".",
"GetInstrumentationName",
"(",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/android/apk_helper.py#L25-L27 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/tlslite/tlslite/integration/AsyncStateMachine.py | python | AsyncStateMachine.outConnectEvent | (self) | Called when a handshake operation completes.
May be overridden in subclass. | Called when a handshake operation completes. | [
"Called",
"when",
"a",
"handshake",
"operation",
"completes",
"."
] | def outConnectEvent(self):
"""Called when a handshake operation completes.
May be overridden in subclass.
"""
pass | [
"def",
"outConnectEvent",
"(",
"self",
")",
":",
"pass"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/tlslite/tlslite/integration/AsyncStateMachine.py#L92-L97 | ||
vnpy/vnpy | f50f2535ed39dd33272e0985ed40c7078e4c19f6 | vnpy/trader/utility.py | python | ArrayManager.dx | (self, n: int, array: bool = False) | return result[-1] | DX. | DX. | [
"DX",
"."
] | def dx(self, n: int, array: bool = False) -> Union[float, np.ndarray]:
"""
DX.
"""
result = talib.DX(self.high, self.low, self.close, n)
if array:
return result
return result[-1] | [
"def",
"dx",
"(",
"self",
",",
"n",
":",
"int",
",",
"array",
":",
"bool",
"=",
"False",
")",
"->",
"Union",
"[",
"float",
",",
"np",
".",
"ndarray",
"]",
":",
"result",
"=",
"talib",
".",
"DX",
"(",
"self",
".",
"high",
",",
"self",
".",
"lo... | https://github.com/vnpy/vnpy/blob/f50f2535ed39dd33272e0985ed40c7078e4c19f6/vnpy/trader/utility.py#L750-L757 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | GBSpan.GetRowspan | (*args, **kwargs) | return _core_.GBSpan_GetRowspan(*args, **kwargs) | GetRowspan(self) -> int | GetRowspan(self) -> int | [
"GetRowspan",
"(",
"self",
")",
"-",
">",
"int"
] | def GetRowspan(*args, **kwargs):
"""GetRowspan(self) -> int"""
return _core_.GBSpan_GetRowspan(*args, **kwargs) | [
"def",
"GetRowspan",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"GBSpan_GetRowspan",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L15652-L15654 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/training/tracking/data_structures.py | python | _DictWrapper._trackable_children | (self, save_type=base.SaveType.CHECKPOINT, **kwargs) | return children | Check that the object is saveable before listing its dependencies. | Check that the object is saveable before listing its dependencies. | [
"Check",
"that",
"the",
"object",
"is",
"saveable",
"before",
"listing",
"its",
"dependencies",
"."
] | def _trackable_children(self, save_type=base.SaveType.CHECKPOINT, **kwargs):
"""Check that the object is saveable before listing its dependencies."""
self._check_self_external_modification()
if self._self_non_string_key:
raise ValueError(
f"Unable to save the object {self} (a dictionary wrap... | [
"def",
"_trackable_children",
"(",
"self",
",",
"save_type",
"=",
"base",
".",
"SaveType",
".",
"CHECKPOINT",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"_check_self_external_modification",
"(",
")",
"if",
"self",
".",
"_self_non_string_key",
":",
"raise"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/training/tracking/data_structures.py#L854-L884 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/internals/managers.py | python | BlockManager.consolidate | (self) | return bm | Join together blocks having same dtype
Returns
-------
y : BlockManager | Join together blocks having same dtype | [
"Join",
"together",
"blocks",
"having",
"same",
"dtype"
] | def consolidate(self):
"""
Join together blocks having same dtype
Returns
-------
y : BlockManager
"""
if self.is_consolidated():
return self
bm = type(self)(self.blocks, self.axes)
bm._is_consolidated = False
bm._consolidate_... | [
"def",
"consolidate",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_consolidated",
"(",
")",
":",
"return",
"self",
"bm",
"=",
"type",
"(",
"self",
")",
"(",
"self",
".",
"blocks",
",",
"self",
".",
"axes",
")",
"bm",
".",
"_is_consolidated",
"=",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/internals/managers.py#L927-L941 | |
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8/tools/release/releases.py | python | FilterDuplicatesAndReverse | (cr_releases) | return result | Returns the chromium releases in reverse order filtered by v8 revision
duplicates.
cr_releases is a list of [cr_rev, v8_hsh] reverse-sorted by cr_rev. | Returns the chromium releases in reverse order filtered by v8 revision
duplicates. | [
"Returns",
"the",
"chromium",
"releases",
"in",
"reverse",
"order",
"filtered",
"by",
"v8",
"revision",
"duplicates",
"."
] | def FilterDuplicatesAndReverse(cr_releases):
"""Returns the chromium releases in reverse order filtered by v8 revision
duplicates.
cr_releases is a list of [cr_rev, v8_hsh] reverse-sorted by cr_rev.
"""
last = ""
result = []
for release in reversed(cr_releases):
if last == release[1]:
continue
... | [
"def",
"FilterDuplicatesAndReverse",
"(",
"cr_releases",
")",
":",
"last",
"=",
"\"\"",
"result",
"=",
"[",
"]",
"for",
"release",
"in",
"reversed",
"(",
"cr_releases",
")",
":",
"if",
"last",
"==",
"release",
"[",
"1",
"]",
":",
"continue",
"last",
"=",... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8/tools/release/releases.py#L70-L83 | |
microsoft/clang | 86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5 | bindings/python/clang/cindex.py | python | Type.get_align | (self) | return conf.lib.clang_Type_getAlignOf(self) | Retrieve the alignment of the record. | Retrieve the alignment of the record. | [
"Retrieve",
"the",
"alignment",
"of",
"the",
"record",
"."
] | def get_align(self):
"""
Retrieve the alignment of the record.
"""
return conf.lib.clang_Type_getAlignOf(self) | [
"def",
"get_align",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_Type_getAlignOf",
"(",
"self",
")"
] | https://github.com/microsoft/clang/blob/86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5/bindings/python/clang/cindex.py#L2357-L2361 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/cmd.py | python | Cmd.precmd | (self, line) | return line | Hook method executed just before the command line is
interpreted, but after the input prompt is generated and issued. | Hook method executed just before the command line is
interpreted, but after the input prompt is generated and issued. | [
"Hook",
"method",
"executed",
"just",
"before",
"the",
"command",
"line",
"is",
"interpreted",
"but",
"after",
"the",
"input",
"prompt",
"is",
"generated",
"and",
"issued",
"."
] | def precmd(self, line):
"""Hook method executed just before the command line is
interpreted, but after the input prompt is generated and issued.
"""
return line | [
"def",
"precmd",
"(",
"self",
",",
"line",
")",
":",
"return",
"line"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/cmd.py#L154-L159 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/mpl2dgraphicsview.py | python | Qt4Mpl2dCanvas.y_min | (self) | return self._yLimit[0] | minimum y
:return: | minimum y
:return: | [
"minimum",
"y",
":",
"return",
":"
] | def y_min(self):
""" minimum y
:return:
"""
return self._yLimit[0] | [
"def",
"y_min",
"(",
"self",
")",
":",
"return",
"self",
".",
"_yLimit",
"[",
"0",
"]"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/mpl2dgraphicsview.py#L367-L371 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/aui.py | python | AuiTabContainer.GetFlags | (*args, **kwargs) | return _aui.AuiTabContainer_GetFlags(*args, **kwargs) | GetFlags(self) -> int | GetFlags(self) -> int | [
"GetFlags",
"(",
"self",
")",
"-",
">",
"int"
] | def GetFlags(*args, **kwargs):
"""GetFlags(self) -> int"""
return _aui.AuiTabContainer_GetFlags(*args, **kwargs) | [
"def",
"GetFlags",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiTabContainer_GetFlags",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L1141-L1143 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/tpu/python/tpu/tpu_estimator.py | python | _EvalMetrics.to_metric_metric_ops_for_tpu | (self, dummy_update_op) | return eval_metric_ops, eval_update_ops | Creates the eval_metric_ops now based on the TPU outfeed.
`eval_metric_ops` is defined in `EstimatorSpec`. From all shards, tensors
are dequeued from outfeed and then concatenated (along batch size dimension)
to form global-like tensors. All global-like tensors are passed to the
metric fn.
Args:
... | Creates the eval_metric_ops now based on the TPU outfeed. | [
"Creates",
"the",
"eval_metric_ops",
"now",
"based",
"on",
"the",
"TPU",
"outfeed",
"."
] | def to_metric_metric_ops_for_tpu(self, dummy_update_op):
"""Creates the eval_metric_ops now based on the TPU outfeed.
`eval_metric_ops` is defined in `EstimatorSpec`. From all shards, tensors
are dequeued from outfeed and then concatenated (along batch size dimension)
to form global-like tensors. All ... | [
"def",
"to_metric_metric_ops_for_tpu",
"(",
"self",
",",
"dummy_update_op",
")",
":",
"num_cores",
"=",
"self",
".",
"_ctx",
".",
"num_cores",
"# For each i, dequeue_ops[i] is a list containing the tensors from all",
"# shards. This list is concatenated later.",
"dequeue_ops",
"=... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/tpu/python/tpu/tpu_estimator.py#L1168-L1234 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/vis/visualization.py | python | setViewport | (viewport) | Sets the current window to use a given GLViewport (see klampt.vis.glprogram.GLViewport) | Sets the current window to use a given GLViewport (see klampt.vis.glprogram.GLViewport) | [
"Sets",
"the",
"current",
"window",
"to",
"use",
"a",
"given",
"GLViewport",
"(",
"see",
"klampt",
".",
"vis",
".",
"glprogram",
".",
"GLViewport",
")"
] | def setViewport(viewport):
"""Sets the current window to use a given GLViewport (see klampt.vis.glprogram.GLViewport)"""
_frontend.set_view(viewport) | [
"def",
"setViewport",
"(",
"viewport",
")",
":",
"_frontend",
".",
"set_view",
"(",
"viewport",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/vis/visualization.py#L662-L664 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/sized_controls.py | python | SizedDialog.__init__ | (self, *args, **kwargs) | A sized dialog
Controls added to its content pane will automatically be added to
the panes sizer.
Usage:
'self' is a SizedDialog instance
pane = self.GetContentsPane()
pane.SetSizerType("horizontal")
b1 = wx.Button(pane, wx.ID_... | A sized dialog
Controls added to its content pane will automatically be added to
the panes sizer.
Usage:
'self' is a SizedDialog instance
pane = self.GetContentsPane()
pane.SetSizerType("horizontal")
b1 = wx.Button(pane, wx.ID_... | [
"A",
"sized",
"dialog",
"Controls",
"added",
"to",
"its",
"content",
"pane",
"will",
"automatically",
"be",
"added",
"to",
"the",
"panes",
"sizer",
".",
"Usage",
":",
"self",
"is",
"a",
"SizedDialog",
"instance",
"pane",
"=",
"self",
".",
"GetContentsPane",
... | def __init__(self, *args, **kwargs):
"""A sized dialog
Controls added to its content pane will automatically be added to
the panes sizer.
Usage:
'self' is a SizedDialog instance
pane = self.GetContentsPane()
pane.SetSizerType("horiz... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"wx",
".",
"Dialog",
".",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"self",
".",
"SetExtraStyle",
"(",
"wx",
".",
"WS_EX_VALIDATE_RE... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/sized_controls.py#L666-L694 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/pydocview.py | python | DocApp.DoBackgroundListenAndLoad | (self) | Open any files specified in the given command line argument passed in via shared memory | Open any files specified in the given command line argument passed in via shared memory | [
"Open",
"any",
"files",
"specified",
"in",
"the",
"given",
"command",
"line",
"argument",
"passed",
"in",
"via",
"shared",
"memory"
] | def DoBackgroundListenAndLoad(self):
"""
Open any files specified in the given command line argument passed in via shared memory
"""
self._timer.Stop()
self._sharedMemory.seek(0)
if self._sharedMemory.read_byte() == '+': # available data
data = self._sharedM... | [
"def",
"DoBackgroundListenAndLoad",
"(",
"self",
")",
":",
"self",
".",
"_timer",
".",
"Stop",
"(",
")",
"self",
".",
"_sharedMemory",
".",
"seek",
"(",
"0",
")",
"if",
"self",
".",
"_sharedMemory",
".",
"read_byte",
"(",
")",
"==",
"'+'",
":",
"# avai... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pydocview.py#L1741-L1766 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2class.py | python | uCSIsKannada | (code) | return ret | Check whether the character is part of Kannada UCS Block | Check whether the character is part of Kannada UCS Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"Kannada",
"UCS",
"Block"
] | def uCSIsKannada(code):
"""Check whether the character is part of Kannada UCS Block """
ret = libxml2mod.xmlUCSIsKannada(code)
return ret | [
"def",
"uCSIsKannada",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsKannada",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L1850-L1853 | |
llvm-mirror/lldb | d01083a850f577b85501a0902b52fd0930de72c7 | third_party/Python/module/six/six.py | python | add_move | (move) | Add an item to six.moves. | Add an item to six.moves. | [
"Add",
"an",
"item",
"to",
"six",
".",
"moves",
"."
] | def add_move(move):
"""Add an item to six.moves."""
setattr(_MovedItems, move.name, move) | [
"def",
"add_move",
"(",
"move",
")",
":",
"setattr",
"(",
"_MovedItems",
",",
"move",
".",
"name",
",",
"move",
")"
] | https://github.com/llvm-mirror/lldb/blob/d01083a850f577b85501a0902b52fd0930de72c7/third_party/Python/module/six/six.py#L505-L507 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/layers/python/layers/feature_column.py | python | _SparseColumn.insert_transformed_feature | (self, columns_to_tensors) | Handles sparse column to id conversion. | Handles sparse column to id conversion. | [
"Handles",
"sparse",
"column",
"to",
"id",
"conversion",
"."
] | def insert_transformed_feature(self, columns_to_tensors):
"""Handles sparse column to id conversion."""
input_tensor = self._get_input_sparse_tensor(columns_to_tensors[self.name])
columns_to_tensors[self] = self._do_transform(input_tensor) | [
"def",
"insert_transformed_feature",
"(",
"self",
",",
"columns_to_tensors",
")",
":",
"input_tensor",
"=",
"self",
".",
"_get_input_sparse_tensor",
"(",
"columns_to_tensors",
"[",
"self",
".",
"name",
"]",
")",
"columns_to_tensors",
"[",
"self",
"]",
"=",
"self",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/layers/python/layers/feature_column.py#L469-L472 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/robotsim.py | python | RobotModel.randomizeConfig | (self, unboundedScale: float=1.0) | return _robotsim.RobotModel_randomizeConfig(self, unboundedScale) | r"""
Samples a random configuration and updates the robot's pose. Properly handles
non-normal joints and handles DOFs with infinite bounds using a centered
Laplacian distribution with the given scaling term.
Args:
unboundedScale (float, optional): default value 1.0
... | r"""
Samples a random configuration and updates the robot's pose. Properly handles
non-normal joints and handles DOFs with infinite bounds using a centered
Laplacian distribution with the given scaling term. | [
"r",
"Samples",
"a",
"random",
"configuration",
"and",
"updates",
"the",
"robot",
"s",
"pose",
".",
"Properly",
"handles",
"non",
"-",
"normal",
"joints",
"and",
"handles",
"DOFs",
"with",
"infinite",
"bounds",
"using",
"a",
"centered",
"Laplacian",
"distribut... | def randomizeConfig(self, unboundedScale: float=1.0) ->None:
r"""
Samples a random configuration and updates the robot's pose. Properly handles
non-normal joints and handles DOFs with infinite bounds using a centered
Laplacian distribution with the given scaling term.
Args:
... | [
"def",
"randomizeConfig",
"(",
"self",
",",
"unboundedScale",
":",
"float",
"=",
"1.0",
")",
"->",
"None",
":",
"return",
"_robotsim",
".",
"RobotModel_randomizeConfig",
"(",
"self",
",",
"unboundedScale",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L5109-L5123 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/Jinja2/py2/jinja2/runtime.py | python | Context.derived | (self, locals=None) | return context | Internal helper function to create a derived context. This is
used in situations where the system needs a new context in the same
template that is independent. | Internal helper function to create a derived context. This is
used in situations where the system needs a new context in the same
template that is independent. | [
"Internal",
"helper",
"function",
"to",
"create",
"a",
"derived",
"context",
".",
"This",
"is",
"used",
"in",
"situations",
"where",
"the",
"system",
"needs",
"a",
"new",
"context",
"in",
"the",
"same",
"template",
"that",
"is",
"independent",
"."
] | def derived(self, locals=None):
"""Internal helper function to create a derived context. This is
used in situations where the system needs a new context in the same
template that is independent.
"""
context = new_context(
self.environment, self.name, {}, self.get_all... | [
"def",
"derived",
"(",
"self",
",",
"locals",
"=",
"None",
")",
":",
"context",
"=",
"new_context",
"(",
"self",
".",
"environment",
",",
"self",
".",
"name",
",",
"{",
"}",
",",
"self",
".",
"get_all",
"(",
")",
",",
"True",
",",
"None",
",",
"l... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py2/jinja2/runtime.py#L298-L308 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/ExportSpectraMask.py | python | writeISISmasks | (filename,masks,nSpectraInRow=8) | Function writes input array in the form of ISSI mask file array
This is the helper function for export_mask procedure,
which can be used separately
namely, if one have array 1,2,3,4, 20, 30,31,32
file will have the following ASCII stings:
1-4 20 30-32
nSpectaInRow indicates t... | Function writes input array in the form of ISSI mask file array
This is the helper function for export_mask procedure,
which can be used separately | [
"Function",
"writes",
"input",
"array",
"in",
"the",
"form",
"of",
"ISSI",
"mask",
"file",
"array",
"This",
"is",
"the",
"helper",
"function",
"for",
"export_mask",
"procedure",
"which",
"can",
"be",
"used",
"separately"
] | def writeISISmasks(filename,masks,nSpectraInRow=8):
"""Function writes input array in the form of ISSI mask file array
This is the helper function for export_mask procedure,
which can be used separately
namely, if one have array 1,2,3,4, 20, 30,31,32
file will have the following ASCII ... | [
"def",
"writeISISmasks",
"(",
"filename",
",",
"masks",
",",
"nSpectraInRow",
"=",
"8",
")",
":",
"ext",
"=",
"os",
".",
"path",
".",
"splitext",
"(",
"filename",
")",
"[",
"1",
"]",
"if",
"len",
"(",
"ext",
")",
"==",
"0",
":",
"filename",
"=",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/ExportSpectraMask.py#L98-L161 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | uCSIsHangulCompatibilityJamo | (code) | return ret | Check whether the character is part of
HangulCompatibilityJamo UCS Block | Check whether the character is part of
HangulCompatibilityJamo UCS Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"HangulCompatibilityJamo",
"UCS",
"Block"
] | def uCSIsHangulCompatibilityJamo(code):
"""Check whether the character is part of
HangulCompatibilityJamo UCS Block """
ret = libxml2mod.xmlUCSIsHangulCompatibilityJamo(code)
return ret | [
"def",
"uCSIsHangulCompatibilityJamo",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsHangulCompatibilityJamo",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L2571-L2575 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/idlelib/configdialog.py | python | HighPage.set_color_sample | (self) | Set the color of the frame background to reflect the selected target.
Instance variables accessed:
theme_elements
highlight_target
fg_bg_toggle
highlight_sample
Attributes updated:
frame_color_set | Set the color of the frame background to reflect the selected target. | [
"Set",
"the",
"color",
"of",
"the",
"frame",
"background",
"to",
"reflect",
"the",
"selected",
"target",
"."
] | def set_color_sample(self):
"""Set the color of the frame background to reflect the selected target.
Instance variables accessed:
theme_elements
highlight_target
fg_bg_toggle
highlight_sample
Attributes updated:
frame_color_set
... | [
"def",
"set_color_sample",
"(",
"self",
")",
":",
"# Set the color sample area.",
"tag",
"=",
"self",
".",
"theme_elements",
"[",
"self",
".",
"highlight_target",
".",
"get",
"(",
")",
"]",
"[",
"0",
"]",
"plane",
"=",
"'foreground'",
"if",
"self",
".",
"f... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/configdialog.py#L1224-L1240 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/linalg/_interpolative_backend.py | python | idd_frmi | (m) | return _id.idd_frmi(m) | Initialize data for :func:`idd_frm`.
:param m:
Length of vector to be transformed.
:type m: int
:return:
Greatest power-of-two integer `n` satisfying `n <= m`.
:rtype: int
:return:
Initialization array to be used by :func:`idd_frm`.
:rtype: :class:`numpy.ndarray` | Initialize data for :func:`idd_frm`. | [
"Initialize",
"data",
"for",
":",
"func",
":",
"idd_frm",
"."
] | def idd_frmi(m):
"""
Initialize data for :func:`idd_frm`.
:param m:
Length of vector to be transformed.
:type m: int
:return:
Greatest power-of-two integer `n` satisfying `n <= m`.
:rtype: int
:return:
Initialization array to be used by :func:`idd_frm`.
:rtype: ... | [
"def",
"idd_frmi",
"(",
"m",
")",
":",
"return",
"_id",
".",
"idd_frmi",
"(",
"m",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/linalg/_interpolative_backend.py#L142-L157 | |
chromiumembedded/cef | 80caf947f3fe2210e5344713c5281d8af9bdc295 | tools/file_util.py | python | eval_file | (src) | return eval(read_file(src), {'__builtins__': None}, None) | Loads and evaluates the contents of the specified file. | Loads and evaluates the contents of the specified file. | [
"Loads",
"and",
"evaluates",
"the",
"contents",
"of",
"the",
"specified",
"file",
"."
] | def eval_file(src):
""" Loads and evaluates the contents of the specified file. """
return eval(read_file(src), {'__builtins__': None}, None) | [
"def",
"eval_file",
"(",
"src",
")",
":",
"return",
"eval",
"(",
"read_file",
"(",
"src",
")",
",",
"{",
"'__builtins__'",
":",
"None",
"}",
",",
"None",
")"
] | https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/file_util.py#L192-L194 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/indexes/base.py | python | Index.values | (self) | return self._data | Return an array representing the data in the Index.
.. warning::
We recommend using :attr:`Index.array` or
:meth:`Index.to_numpy`, depending on whether you need
a reference to the underlying data or a NumPy array.
Returns
-------
array: numpy.ndarray o... | Return an array representing the data in the Index. | [
"Return",
"an",
"array",
"representing",
"the",
"data",
"in",
"the",
"Index",
"."
] | def values(self) -> ArrayLike:
"""
Return an array representing the data in the Index.
.. warning::
We recommend using :attr:`Index.array` or
:meth:`Index.to_numpy`, depending on whether you need
a reference to the underlying data or a NumPy array.
Ret... | [
"def",
"values",
"(",
"self",
")",
"->",
"ArrayLike",
":",
"return",
"self",
".",
"_data"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/indexes/base.py#L4348-L4367 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | DateTime.FormatDate | (*args, **kwargs) | return _misc_.DateTime_FormatDate(*args, **kwargs) | FormatDate(self) -> String | FormatDate(self) -> String | [
"FormatDate",
"(",
"self",
")",
"-",
">",
"String"
] | def FormatDate(*args, **kwargs):
"""FormatDate(self) -> String"""
return _misc_.DateTime_FormatDate(*args, **kwargs) | [
"def",
"FormatDate",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateTime_FormatDate",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L4166-L4168 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/fusion/portableglobe/servers/stub_search.py | python | StubDatabase.ClearSearchTables | (self) | Clear search tables stub. | Clear search tables stub. | [
"Clear",
"search",
"tables",
"stub",
"."
] | def ClearSearchTables(self):
"""Clear search tables stub."""
self.search_tables_ = [] | [
"def",
"ClearSearchTables",
"(",
"self",
")",
":",
"self",
".",
"search_tables_",
"=",
"[",
"]"
] | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/servers/stub_search.py#L25-L27 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/Build.py | python | BuildContext.get_group_name | (self, g) | return '' | name for the group g (utility) | name for the group g (utility) | [
"name",
"for",
"the",
"group",
"g",
"(",
"utility",
")"
] | def get_group_name(self, g):
"""name for the group g (utility)"""
if not isinstance(g, list):
g = self.groups[g]
for x in self.group_names:
if id(self.group_names[x]) == id(g):
return x
return '' | [
"def",
"get_group_name",
"(",
"self",
",",
"g",
")",
":",
"if",
"not",
"isinstance",
"(",
"g",
",",
"list",
")",
":",
"g",
"=",
"self",
".",
"groups",
"[",
"g",
"]",
"for",
"x",
"in",
"self",
".",
"group_names",
":",
"if",
"id",
"(",
"self",
".... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Build.py#L630-L637 | |
libornovax/master_thesis_code | 6eca474ed3cae673afde010caef338cf7349f839 | caffe/scripts/cpp_lint.py | python | ParseArguments | (args) | return filenames | Parses the command line arguments.
This may set the output format and verbosity level as side-effects.
Args:
args: The command line arguments:
Returns:
The list of filenames to lint. | Parses the command line arguments. | [
"Parses",
"the",
"command",
"line",
"arguments",
"."
] | def ParseArguments(args):
"""Parses the command line arguments.
This may set the output format and verbosity level as side-effects.
Args:
args: The command line arguments:
Returns:
The list of filenames to lint.
"""
try:
(opts, filenames) = getopt.getopt(args, '', ['help', 'output=', 'verbose... | [
"def",
"ParseArguments",
"(",
"args",
")",
":",
"try",
":",
"(",
"opts",
",",
"filenames",
")",
"=",
"getopt",
".",
"getopt",
"(",
"args",
",",
"''",
",",
"[",
"'help'",
",",
"'output='",
",",
"'verbose='",
",",
"'counting='",
",",
"'filter='",
",",
... | https://github.com/libornovax/master_thesis_code/blob/6eca474ed3cae673afde010caef338cf7349f839/caffe/scripts/cpp_lint.py#L4779-L4846 | |
libornovax/master_thesis_code | 6eca474ed3cae673afde010caef338cf7349f839 | scripts/show_bb3txt_detections.py | python | DetectionBrowser.__init__ | (self, path_detections, detections_mapping, confidence,
path_gt=None, gt_mapping=None, path_datasets=None, path_pgp=None) | Input:
path_detections: Path to the BB3TXT file with detections
detections_mapping: Name of the mapping of the path_detections BB3TXT file
confidence: Minimum confidence of a detection to be displayed
path_gt: Path to the BB3TXT file with ground truth (optional)
gt_mapping: ... | Input:
path_detections: Path to the BB3TXT file with detections
detections_mapping: Name of the mapping of the path_detections BB3TXT file
confidence: Minimum confidence of a detection to be displayed
path_gt: Path to the BB3TXT file with ground truth (optional)
gt_mapping: ... | [
"Input",
":",
"path_detections",
":",
"Path",
"to",
"the",
"BB3TXT",
"file",
"with",
"detections",
"detections_mapping",
":",
"Name",
"of",
"the",
"mapping",
"of",
"the",
"path_detections",
"BB3TXT",
"file",
"confidence",
":",
"Minimum",
"confidence",
"of",
"a",... | def __init__(self, path_detections, detections_mapping, confidence,
path_gt=None, gt_mapping=None, path_datasets=None, path_pgp=None):
"""
Input:
path_detections: Path to the BB3TXT file with detections
detections_mapping: Name of the mapping of the path_detections BB3TXT file
confidence: M... | [
"def",
"__init__",
"(",
"self",
",",
"path_detections",
",",
"detections_mapping",
",",
"confidence",
",",
"path_gt",
"=",
"None",
",",
"gt_mapping",
"=",
"None",
",",
"path_datasets",
"=",
"None",
",",
"path_pgp",
"=",
"None",
")",
":",
"super",
"(",
"Det... | https://github.com/libornovax/master_thesis_code/blob/6eca474ed3cae673afde010caef338cf7349f839/scripts/show_bb3txt_detections.py#L61-L102 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/backends/_nnapi/serializer.py | python | _NnapiSerializer._do_add_binary | (self, node, opcode, fuse_code, *, qparams=None) | Helper for pointwise binary broadcast ops with superfluous extra args | Helper for pointwise binary broadcast ops with superfluous extra args | [
"Helper",
"for",
"pointwise",
"binary",
"broadcast",
"ops",
"with",
"superfluous",
"extra",
"args"
] | def _do_add_binary(self, node, opcode, fuse_code, *, qparams=None):
"""Helper for pointwise binary broadcast ops with superfluous extra args"""
assert node.outputsSize() == 1
assert node.inputsAt(0).type().kind() == "TensorType"
assert node.inputsAt(1).type().kind() == "TensorType"
... | [
"def",
"_do_add_binary",
"(",
"self",
",",
"node",
",",
"opcode",
",",
"fuse_code",
",",
"*",
",",
"qparams",
"=",
"None",
")",
":",
"assert",
"node",
".",
"outputsSize",
"(",
")",
"==",
"1",
"assert",
"node",
".",
"inputsAt",
"(",
"0",
")",
".",
"... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/backends/_nnapi/serializer.py#L1293-L1339 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/menus.py | python | MultiColumnCompletionMenuControl.preferred_width | (self, max_available_width: int) | return result + self._required_margin | Preferred width: prefer to use at least min_rows, but otherwise as much
as possible horizontally. | Preferred width: prefer to use at least min_rows, but otherwise as much
as possible horizontally. | [
"Preferred",
"width",
":",
"prefer",
"to",
"use",
"at",
"least",
"min_rows",
"but",
"otherwise",
"as",
"much",
"as",
"possible",
"horizontally",
"."
] | def preferred_width(self, max_available_width: int) -> Optional[int]:
"""
Preferred width: prefer to use at least min_rows, but otherwise as much
as possible horizontally.
"""
complete_state = get_app().current_buffer.complete_state
if complete_state is None:
... | [
"def",
"preferred_width",
"(",
"self",
",",
"max_available_width",
":",
"int",
")",
"->",
"Optional",
"[",
"int",
"]",
":",
"complete_state",
"=",
"get_app",
"(",
")",
".",
"current_buffer",
".",
"complete_state",
"if",
"complete_state",
"is",
"None",
":",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/menus.py#L350-L373 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | NativePixelData_Accessor.IsOk | (*args, **kwargs) | return _gdi_.NativePixelData_Accessor_IsOk(*args, **kwargs) | IsOk(self) -> bool | IsOk(self) -> bool | [
"IsOk",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsOk(*args, **kwargs):
"""IsOk(self) -> bool"""
return _gdi_.NativePixelData_Accessor_IsOk(*args, **kwargs) | [
"def",
"IsOk",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"NativePixelData_Accessor_IsOk",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L1121-L1123 | |
apache/qpid-proton | 6bcdfebb55ea3554bc29b1901422532db331a591 | python/proton/_utils.py | python | SyncRequestResponse.on_message | (self, event: 'Event') | Called when we receive a message for our receiver.
:param event: The event which occurs when a message is received. | Called when we receive a message for our receiver. | [
"Called",
"when",
"we",
"receive",
"a",
"message",
"for",
"our",
"receiver",
"."
] | def on_message(self, event: 'Event') -> None:
"""
Called when we receive a message for our receiver.
:param event: The event which occurs when a message is received.
"""
self.response = event.message
self.connection.container.yield_() | [
"def",
"on_message",
"(",
"self",
",",
"event",
":",
"'Event'",
")",
"->",
"None",
":",
"self",
".",
"response",
"=",
"event",
".",
"message",
"self",
".",
"connection",
".",
"container",
".",
"yield_",
"(",
")"
] | https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_utils.py#L633-L640 | ||
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/actor/Actor.py | python | Actor.getGeomNode | (self) | return self.__geomNode | Return the node that contains all actor geometry | Return the node that contains all actor geometry | [
"Return",
"the",
"node",
"that",
"contains",
"all",
"actor",
"geometry"
] | def getGeomNode(self):
"""
Return the node that contains all actor geometry
"""
return self.__geomNode | [
"def",
"getGeomNode",
"(",
"self",
")",
":",
"return",
"self",
".",
"__geomNode"
] | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/actor/Actor.py#L623-L627 | |
maidsafe-archive/MaidSafe | defd65e1c8cfb6a1cbdeaaa0eee31d065421792d | tools/cpplint.py | python | _BlockInfo.CheckBegin | (self, filename, clean_lines, linenum, error) | Run checks that applies to text up to the opening brace.
This is mostly for checking the text after the class identifier
and the "{", usually where the base class is specified. For other
blocks, there isn't much to check, so we always pass.
Args:
filename: The name of the current file.
cl... | Run checks that applies to text up to the opening brace. | [
"Run",
"checks",
"that",
"applies",
"to",
"text",
"up",
"to",
"the",
"opening",
"brace",
"."
] | def CheckBegin(self, filename, clean_lines, linenum, error):
"""Run checks that applies to text up to the opening brace.
This is mostly for checking the text after the class identifier
and the "{", usually where the base class is specified. For other
blocks, there isn't much to check, so we always pas... | [
"def",
"CheckBegin",
"(",
"self",
",",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"pass"
] | https://github.com/maidsafe-archive/MaidSafe/blob/defd65e1c8cfb6a1cbdeaaa0eee31d065421792d/tools/cpplint.py#L1374-L1387 | ||
verilog-to-routing/vtr-verilog-to-routing | d9719cf7374821156c3cee31d66991cb85578562 | vtr_flow/scripts/run_vtr_flow.py | python | format_human_readable_memory | (num_kbytes) | return value | format the number of bytes given as a human readable value | format the number of bytes given as a human readable value | [
"format",
"the",
"number",
"of",
"bytes",
"given",
"as",
"a",
"human",
"readable",
"value"
] | def format_human_readable_memory(num_kbytes):
"""format the number of bytes given as a human readable value"""
if num_kbytes < 1024:
value = "%.2f KiB" % (num_kbytes)
elif num_kbytes < (1024 ** 2):
value = "%.2f MiB" % (num_kbytes / (1024 ** 1))
else:
value = "%.2f GiB" % (num_kb... | [
"def",
"format_human_readable_memory",
"(",
"num_kbytes",
")",
":",
"if",
"num_kbytes",
"<",
"1024",
":",
"value",
"=",
"\"%.2f KiB\"",
"%",
"(",
"num_kbytes",
")",
"elif",
"num_kbytes",
"<",
"(",
"1024",
"**",
"2",
")",
":",
"value",
"=",
"\"%.2f MiB\"",
... | https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/d9719cf7374821156c3cee31d66991cb85578562/vtr_flow/scripts/run_vtr_flow.py#L427-L435 | |
v8/v8 | fee3bf095260bf657a3eea4d3d41f90c42c6c857 | tools/cppgc/gen_cmake.py | python | V8GNTransformer._Expr | (self, expr) | Post-order traverse expression trees | Post-order traverse expression trees | [
"Post",
"-",
"order",
"traverse",
"expression",
"trees"
] | def _Expr(self, expr):
'Post-order traverse expression trees'
if isinstance(expr, lark.Token):
if expr.type == 'IDENTIFIER':
return self.builder.BuildIdentifier(str(expr))
elif expr.type == 'INTEGER':
return self.builder.BuildInteger(str(expr))
... | [
"def",
"_Expr",
"(",
"self",
",",
"expr",
")",
":",
"if",
"isinstance",
"(",
"expr",
",",
"lark",
".",
"Token",
")",
":",
"if",
"expr",
".",
"type",
"==",
"'IDENTIFIER'",
":",
"return",
"self",
".",
"builder",
".",
"BuildIdentifier",
"(",
"str",
"(",... | https://github.com/v8/v8/blob/fee3bf095260bf657a3eea4d3d41f90c42c6c857/tools/cppgc/gen_cmake.py#L171-L190 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/dashboard/dashboard/utils.py | python | GetIpWhitelist | () | return stored_object.Get(IP_WHITELIST_KEY) | Returns a list of IP address strings in the whitelist. | Returns a list of IP address strings in the whitelist. | [
"Returns",
"a",
"list",
"of",
"IP",
"address",
"strings",
"in",
"the",
"whitelist",
"."
] | def GetIpWhitelist():
"""Returns a list of IP address strings in the whitelist."""
return stored_object.Get(IP_WHITELIST_KEY) | [
"def",
"GetIpWhitelist",
"(",
")",
":",
"return",
"stored_object",
".",
"Get",
"(",
"IP_WHITELIST_KEY",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/utils.py#L359-L361 | |
larroy/clearskies_core | 3574ddf0edc8555454c7044126e786a6c29444dc | tools/gyp/pylib/gyp/MSVSVersion.py | python | VisualStudioVersion.ProjectVersion | (self) | return self.project_version | Get the version number of the vcproj or vcxproj files. | Get the version number of the vcproj or vcxproj files. | [
"Get",
"the",
"version",
"number",
"of",
"the",
"vcproj",
"or",
"vcxproj",
"files",
"."
] | def ProjectVersion(self):
"""Get the version number of the vcproj or vcxproj files."""
return self.project_version | [
"def",
"ProjectVersion",
"(",
"self",
")",
":",
"return",
"self",
".",
"project_version"
] | https://github.com/larroy/clearskies_core/blob/3574ddf0edc8555454c7044126e786a6c29444dc/tools/gyp/pylib/gyp/MSVSVersion.py#L43-L45 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | Font.GetStrikethrough | (*args, **kwargs) | return _gdi_.Font_GetStrikethrough(*args, **kwargs) | GetStrikethrough(self) -> bool | GetStrikethrough(self) -> bool | [
"GetStrikethrough",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetStrikethrough(*args, **kwargs):
"""GetStrikethrough(self) -> bool"""
return _gdi_.Font_GetStrikethrough(*args, **kwargs) | [
"def",
"GetStrikethrough",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Font_GetStrikethrough",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L2331-L2333 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | xmlDoc.freeDoc | (self) | Free up all the structures used by a document, tree
included. | Free up all the structures used by a document, tree
included. | [
"Free",
"up",
"all",
"the",
"structures",
"used",
"by",
"a",
"document",
"tree",
"included",
"."
] | def freeDoc(self):
"""Free up all the structures used by a document, tree
included. """
libxml2mod.xmlFreeDoc(self._o) | [
"def",
"freeDoc",
"(",
"self",
")",
":",
"libxml2mod",
".",
"xmlFreeDoc",
"(",
"self",
".",
"_o",
")"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L4283-L4286 | ||
Tencent/Pebble | 68315f176d9e328a233ace29b7579a829f89879f | thirdparty/gflags/gflags.py | python | FlagValues.RegisteredFlags | (self) | return self.FlagDict().keys() | Returns: a list of the names and short names of all registered flags. | Returns: a list of the names and short names of all registered flags. | [
"Returns",
":",
"a",
"list",
"of",
"the",
"names",
"and",
"short",
"names",
"of",
"all",
"registered",
"flags",
"."
] | def RegisteredFlags(self):
"""Returns: a list of the names and short names of all registered flags."""
return self.FlagDict().keys() | [
"def",
"RegisteredFlags",
"(",
"self",
")",
":",
"return",
"self",
".",
"FlagDict",
"(",
")",
".",
"keys",
"(",
")"
] | https://github.com/Tencent/Pebble/blob/68315f176d9e328a233ace29b7579a829f89879f/thirdparty/gflags/gflags.py#L1273-L1275 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | PhysicsTools/HeppyCore/python/utils/eostools.py | python | runEOSCommand | (path, cmd, *args) | return runner.runCommand(command) | Run an eos command.
!!! Will, when the EOS command fails, it passes silently...
I think we should really try and raise an exception in case of problems.
should be possible as the return code is provided in the tuple returned by runner. | Run an eos command. | [
"Run",
"an",
"eos",
"command",
"."
] | def runEOSCommand(path, cmd, *args):
"""Run an eos command.
!!! Will, when the EOS command fails, it passes silently...
I think we should really try and raise an exception in case of problems.
should be possible as the return code is provided in the tuple returned by runner."""
lfn = eosToLFN(... | [
"def",
"runEOSCommand",
"(",
"path",
",",
"cmd",
",",
"*",
"args",
")",
":",
"lfn",
"=",
"eosToLFN",
"(",
"path",
")",
"pfn",
"=",
"lfnToPFN",
"(",
"lfn",
")",
"tokens",
"=",
"cmsIO",
".",
"splitPFN",
"(",
"pfn",
")",
"#obviously, this is not nice",
"c... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/PhysicsTools/HeppyCore/python/utils/eostools.py#L39-L55 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/Image.py | python | Image.putpixel | (self, xy, value) | return self.im.putpixel(xy, value) | Modifies the pixel at the given position. The color is given as
a single numerical value for single-band images, and a tuple for
multi-band images. In addition to this, RGB and RGBA tuples are
accepted for P images.
Note that this method is relatively slow. For more extensive changes,
... | Modifies the pixel at the given position. The color is given as
a single numerical value for single-band images, and a tuple for
multi-band images. In addition to this, RGB and RGBA tuples are
accepted for P images. | [
"Modifies",
"the",
"pixel",
"at",
"the",
"given",
"position",
".",
"The",
"color",
"is",
"given",
"as",
"a",
"single",
"numerical",
"value",
"for",
"single",
"-",
"band",
"images",
"and",
"a",
"tuple",
"for",
"multi",
"-",
"band",
"images",
".",
"In",
... | def putpixel(self, xy, value):
"""
Modifies the pixel at the given position. The color is given as
a single numerical value for single-band images, and a tuple for
multi-band images. In addition to this, RGB and RGBA tuples are
accepted for P images.
Note that this metho... | [
"def",
"putpixel",
"(",
"self",
",",
"xy",
",",
"value",
")",
":",
"if",
"self",
".",
"readonly",
":",
"self",
".",
"_copy",
"(",
")",
"self",
".",
"load",
"(",
")",
"if",
"self",
".",
"pyaccess",
":",
"return",
"self",
".",
"pyaccess",
".",
"put... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/Image.py#L1684-L1720 | |
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | driver/python/pysequoiadb/collection.py | python | collection.open_lob | (self, oid, mode=LOB_READ) | return obj | open the specified lob to read or write.
Parameters:
Name Type Info:
oid str/bson.ObjectId The specified oid
mode int The open mode:
lob.LOB_READ
l... | open the specified lob to read or write. | [
"open",
"the",
"specified",
"lob",
"to",
"read",
"or",
"write",
"."
] | def open_lob(self, oid, mode=LOB_READ):
"""open the specified lob to read or write.
Parameters:
Name Type Info:
oid str/bson.ObjectId The specified oid
mode int The open mode:
lob.... | [
"def",
"open_lob",
"(",
"self",
",",
"oid",
",",
"mode",
"=",
"LOB_READ",
")",
":",
"if",
"not",
"isinstance",
"(",
"oid",
",",
"bson",
".",
"ObjectId",
")",
"and",
"not",
"isinstance",
"(",
"oid",
",",
"str_type",
")",
":",
"raise",
"SDBTypeError",
... | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/driver/python/pysequoiadb/collection.py#L1071-L1108 | |
SpaceNetChallenge/BuildingDetectors | 3def3c44b5847c744cd2f3356182892d92496579 | qinhaifang/src/caffe-mnc/scripts/cpp_lint.py | python | CloseExpression | (clean_lines, linenum, pos) | return (line, clean_lines.NumLines(), -1) | If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to... | If input points to ( or { or [ or <, finds the position that closes it. | [
"If",
"input",
"points",
"to",
"(",
"or",
"{",
"or",
"[",
"or",
"<",
"finds",
"the",
"position",
"that",
"closes",
"it",
"."
] | def CloseExpression(clean_lines, linenum, pos):
"""If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
Args:
clean_lines: A CleansedLines instance contai... | [
"def",
"CloseExpression",
"(",
"clean_lines",
",",
"linenum",
",",
"pos",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"startchar",
"=",
"line",
"[",
"pos",
"]",
"if",
"startchar",
"not",
"in",
"'({[<'",
":",
"return",
"(",
... | https://github.com/SpaceNetChallenge/BuildingDetectors/blob/3def3c44b5847c744cd2f3356182892d92496579/qinhaifang/src/caffe-mnc/scripts/cpp_lint.py#L1254-L1297 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/dataview.py | python | DataViewModel.HasContainerColumns | (*args, **kwargs) | return _dataview.DataViewModel_HasContainerColumns(*args, **kwargs) | HasContainerColumns(self, DataViewItem item) -> bool
Override this method to indicate if a container item merely acts as a
headline (such as for categorisation) or if it also acts a normal item with
entries for the other columns. The default implementation returns ``False``. | HasContainerColumns(self, DataViewItem item) -> bool | [
"HasContainerColumns",
"(",
"self",
"DataViewItem",
"item",
")",
"-",
">",
"bool"
] | def HasContainerColumns(*args, **kwargs):
"""
HasContainerColumns(self, DataViewItem item) -> bool
Override this method to indicate if a container item merely acts as a
headline (such as for categorisation) or if it also acts a normal item with
entries for the other columns. The... | [
"def",
"HasContainerColumns",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewModel_HasContainerColumns",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/dataview.py#L546-L554 | |
spring/spring | 553a21526b144568b608a0507674b076ec80d9f9 | buildbot/stacktrace_translator/stacktrace_translator.py | python | get_modules | (dbgfile) | return files | returns a list of all available files in a 7z archive
>>> get_modules(TESTFILE)
['AI/Interfaces/C/0.1/AIInterface.dbg', 'AI/Interfaces/Java/0.1/AIInterface.dbg', 'AI/Skirmish/AAI/0.9/SkirmishAI.dbg', 'AI/Skirmish/CircuitAI/stable/SkirmishAI.dbg', 'AI/Skirmish/CppTestAI/0.1/SkirmishAI.dbg', 'AI/Skirmish/KAIK/0.13/Sk... | returns a list of all available files in a 7z archive
>>> get_modules(TESTFILE)
['AI/Interfaces/C/0.1/AIInterface.dbg', 'AI/Interfaces/Java/0.1/AIInterface.dbg', 'AI/Skirmish/AAI/0.9/SkirmishAI.dbg', 'AI/Skirmish/CircuitAI/stable/SkirmishAI.dbg', 'AI/Skirmish/CppTestAI/0.1/SkirmishAI.dbg', 'AI/Skirmish/KAIK/0.13/Sk... | [
"returns",
"a",
"list",
"of",
"all",
"available",
"files",
"in",
"a",
"7z",
"archive",
">>>",
"get_modules",
"(",
"TESTFILE",
")",
"[",
"AI",
"/",
"Interfaces",
"/",
"C",
"/",
"0",
".",
"1",
"/",
"AIInterface",
".",
"dbg",
"AI",
"/",
"Interfaces",
"/... | def get_modules(dbgfile):
'''
returns a list of all available files in a 7z archive
>>> get_modules(TESTFILE)
['AI/Interfaces/C/0.1/AIInterface.dbg', 'AI/Interfaces/Java/0.1/AIInterface.dbg', 'AI/Skirmish/AAI/0.9/SkirmishAI.dbg', 'AI/Skirmish/CircuitAI/stable/SkirmishAI.dbg', 'AI/Skirmish/CppTestAI/0.1/SkirmishAI... | [
"def",
"get_modules",
"(",
"dbgfile",
")",
":",
"sevenzip",
"=",
"Popen",
"(",
"[",
"SEVENZIP",
",",
"'l'",
",",
"dbgfile",
"]",
",",
"stdout",
"=",
"PIPE",
",",
"stderr",
"=",
"PIPE",
",",
"universal_newlines",
"=",
"True",
")",
"stdout",
",",
"stderr... | https://github.com/spring/spring/blob/553a21526b144568b608a0507674b076ec80d9f9/buildbot/stacktrace_translator/stacktrace_translator.py#L209-L227 | |
aimerykong/Low-Rank-Bilinear-Pooling | 487eb2c857fd9c95357a5166b0c15ad0fe135b28 | caffe-20160312/scripts/cpp_lint.py | python | _NestingState.InnermostClass | (self) | return None | Get class info on the top of the stack.
Returns:
A _ClassInfo object if we are inside a class, or None otherwise. | Get class info on the top of the stack. | [
"Get",
"class",
"info",
"on",
"the",
"top",
"of",
"the",
"stack",
"."
] | def InnermostClass(self):
"""Get class info on the top of the stack.
Returns:
A _ClassInfo object if we are inside a class, or None otherwise.
"""
for i in range(len(self.stack), 0, -1):
classinfo = self.stack[i - 1]
if isinstance(classinfo, _ClassInfo):
return classinfo
r... | [
"def",
"InnermostClass",
"(",
"self",
")",
":",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"stack",
")",
",",
"0",
",",
"-",
"1",
")",
":",
"classinfo",
"=",
"self",
".",
"stack",
"[",
"i",
"-",
"1",
"]",
"if",
"isinstance",
"(",
... | https://github.com/aimerykong/Low-Rank-Bilinear-Pooling/blob/487eb2c857fd9c95357a5166b0c15ad0fe135b28/caffe-20160312/scripts/cpp_lint.py#L2160-L2170 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/boost/boost_1_68_0/libs/metaparse/tools/benchmark/generate.py | python | in_comment | (regex) | return '^[ \t]*//[ \t]*' + regex + '[ \t]*$' | Builds a regex matching "regex" in a comment | Builds a regex matching "regex" in a comment | [
"Builds",
"a",
"regex",
"matching",
"regex",
"in",
"a",
"comment"
] | def in_comment(regex):
"""Builds a regex matching "regex" in a comment"""
return '^[ \t]*//[ \t]*' + regex + '[ \t]*$' | [
"def",
"in_comment",
"(",
"regex",
")",
":",
"return",
"'^[ \\t]*//[ \\t]*'",
"+",
"regex",
"+",
"'[ \\t]*$'"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/boost/boost_1_68_0/libs/metaparse/tools/benchmark/generate.py#L45-L47 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/operator.py | python | pos | (a) | return +a | Same as +a. | Same as +a. | [
"Same",
"as",
"+",
"a",
"."
] | def pos(a):
"Same as +a."
return +a | [
"def",
"pos",
"(",
"a",
")",
":",
"return",
"+",
"a"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/operator.py#L120-L122 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/distutils/misc_util.py | python | filter_sources | (sources) | return c_sources, cxx_sources, f_sources, fmodule_sources | Return four lists of filenames containing
C, C++, Fortran, and Fortran 90 module sources,
respectively. | Return four lists of filenames containing
C, C++, Fortran, and Fortran 90 module sources,
respectively. | [
"Return",
"four",
"lists",
"of",
"filenames",
"containing",
"C",
"C",
"++",
"Fortran",
"and",
"Fortran",
"90",
"module",
"sources",
"respectively",
"."
] | def filter_sources(sources):
"""Return four lists of filenames containing
C, C++, Fortran, and Fortran 90 module sources,
respectively.
"""
c_sources = []
cxx_sources = []
f_sources = []
fmodule_sources = []
for source in sources:
if fortran_ext_match(source):
mod... | [
"def",
"filter_sources",
"(",
"sources",
")",
":",
"c_sources",
"=",
"[",
"]",
"cxx_sources",
"=",
"[",
"]",
"f_sources",
"=",
"[",
"]",
"fmodule_sources",
"=",
"[",
"]",
"for",
"source",
"in",
"sources",
":",
"if",
"fortran_ext_match",
"(",
"source",
")... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/distutils/misc_util.py#L460-L480 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | ScrollBar.IsVertical | (*args, **kwargs) | return _controls_.ScrollBar_IsVertical(*args, **kwargs) | IsVertical(self) -> bool | IsVertical(self) -> bool | [
"IsVertical",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsVertical(*args, **kwargs):
"""IsVertical(self) -> bool"""
return _controls_.ScrollBar_IsVertical(*args, **kwargs) | [
"def",
"IsVertical",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ScrollBar_IsVertical",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L2172-L2174 | |
D-X-Y/caffe-faster-rcnn | eb50c97ff48f3df115d0e85fe0a32b0c7e2aa4cb | scripts/cpp_lint.py | python | CheckForFunctionLengths | (filename, clean_lines, linenum,
function_state, error) | Reports for long function bodies.
For an overview why this is done, see:
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions
Uses a simplistic algorithm assuming other style guidelines
(especially spacing) are followed.
Only checks unindented functions, so class members are ... | Reports for long function bodies. | [
"Reports",
"for",
"long",
"function",
"bodies",
"."
] | def CheckForFunctionLengths(filename, clean_lines, linenum,
function_state, error):
"""Reports for long function bodies.
For an overview why this is done, see:
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions
Uses a simplistic algorithm assuming ... | [
"def",
"CheckForFunctionLengths",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"function_state",
",",
"error",
")",
":",
"lines",
"=",
"clean_lines",
".",
"lines",
"line",
"=",
"lines",
"[",
"linenum",
"]",
"raw",
"=",
"clean_lines",
".",
"raw_l... | https://github.com/D-X-Y/caffe-faster-rcnn/blob/eb50c97ff48f3df115d0e85fe0a32b0c7e2aa4cb/scripts/cpp_lint.py#L2388-L2455 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/multiprocessing/pool.py | python | Pool.map | (self, func, iterable, chunksize=None) | return self.map_async(func, iterable, chunksize).get() | Equivalent of `map()` builtin | Equivalent of `map()` builtin | [
"Equivalent",
"of",
"map",
"()",
"builtin"
] | def map(self, func, iterable, chunksize=None):
'''
Equivalent of `map()` builtin
'''
assert self._state == RUN
return self.map_async(func, iterable, chunksize).get() | [
"def",
"map",
"(",
"self",
",",
"func",
",",
"iterable",
",",
"chunksize",
"=",
"None",
")",
":",
"assert",
"self",
".",
"_state",
"==",
"RUN",
"return",
"self",
".",
"map_async",
"(",
"func",
",",
"iterable",
",",
"chunksize",
")",
".",
"get",
"(",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/multiprocessing/pool.py#L245-L250 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/isapi/simple.py | python | SimpleFilter.TerminateFilter | (self, status) | Called by the ISAPI framework as the filter terminates. | Called by the ISAPI framework as the filter terminates. | [
"Called",
"by",
"the",
"ISAPI",
"framework",
"as",
"the",
"filter",
"terminates",
"."
] | def TerminateFilter(self, status):
"""Called by the ISAPI framework as the filter terminates.
"""
pass | [
"def",
"TerminateFilter",
"(",
"self",
",",
"status",
")",
":",
"pass"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/isapi/simple.py#L65-L68 | ||
DmitryUlyanov/Multicore-TSNE | 443731a47134d14653cfea526227a27cc3b38702 | tsne-embedding.py | python | imscatter | (images, positions) | return scatter_image | Creates a scatter plot, where each plot is shown by corresponding image | Creates a scatter plot, where each plot is shown by corresponding image | [
"Creates",
"a",
"scatter",
"plot",
"where",
"each",
"plot",
"is",
"shown",
"by",
"corresponding",
"image"
] | def imscatter(images, positions):
'''
Creates a scatter plot, where each plot is shown by corresponding image
'''
positions = np.array(positions)
bottoms = positions[:, 1] - np.array([im.shape[1] / 2.0 for im in images])
tops = bottoms + np.array([im.shape[1] for im in images])
lefts =... | [
"def",
"imscatter",
"(",
"images",
",",
"positions",
")",
":",
"positions",
"=",
"np",
".",
"array",
"(",
"positions",
")",
"bottoms",
"=",
"positions",
"[",
":",
",",
"1",
"]",
"-",
"np",
".",
"array",
"(",
"[",
"im",
".",
"shape",
"[",
"1",
"]"... | https://github.com/DmitryUlyanov/Multicore-TSNE/blob/443731a47134d14653cfea526227a27cc3b38702/tsne-embedding.py#L9-L42 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/factorization/python/ops/gmm_ops.py | python | GmmAlgorithm._define_diag_covariance_probs | (self, shard_id, shard) | Defines the diagonal covariance probabilities per example in a class.
Args:
shard_id: id of the current shard.
shard: current data shard, 1 X num_examples X dimensions.
Returns a matrix num_examples * num_classes. | Defines the diagonal covariance probabilities per example in a class. | [
"Defines",
"the",
"diagonal",
"covariance",
"probabilities",
"per",
"example",
"in",
"a",
"class",
"."
] | def _define_diag_covariance_probs(self, shard_id, shard):
"""Defines the diagonal covariance probabilities per example in a class.
Args:
shard_id: id of the current shard.
shard: current data shard, 1 X num_examples X dimensions.
Returns a matrix num_examples * num_classes.
"""
# num_c... | [
"def",
"_define_diag_covariance_probs",
"(",
"self",
",",
"shard_id",
",",
"shard",
")",
":",
"# num_classes X 1",
"# TODO(xavigonzalvo): look into alternatives to log for",
"# reparametrization of variance parameters.",
"det_expanded",
"=",
"tf",
".",
"reduce_sum",
"(",
"tf",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L241-L263 | ||
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/transaction.py | python | Transaction.tx | (self) | return self._tx | Gets the tx of this Transaction. # noqa: E501
:return: The tx of this Transaction. # noqa: E501
:rtype: str | Gets the tx of this Transaction. # noqa: E501 | [
"Gets",
"the",
"tx",
"of",
"this",
"Transaction",
".",
"#",
"noqa",
":",
"E501"
] | def tx(self):
"""Gets the tx of this Transaction. # noqa: E501
:return: The tx of this Transaction. # noqa: E501
:rtype: str
"""
return self._tx | [
"def",
"tx",
"(",
"self",
")",
":",
"return",
"self",
".",
"_tx"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/transaction.py#L275-L282 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py | python | Checkbutton.select | (self) | Put the button in on-state. | Put the button in on-state. | [
"Put",
"the",
"button",
"in",
"on",
"-",
"state",
"."
] | def select(self):
"""Put the button in on-state."""
self.tk.call(self._w, 'select') | [
"def",
"select",
"(",
"self",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'select'",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py#L2656-L2658 | ||
baldurk/renderdoc | ec5c14dee844b18dc545b52c4bd705ae20cba5d7 | docs/pycharm_helpers/plugins/python-ce/helpers/generator3/module_redeclarator.py | python | ModuleRedeclarator.output_import_froms | (self, out, imports_list) | Mention all imported names known within the module, wrapping as per PEP. | Mention all imported names known within the module, wrapping as per PEP. | [
"Mention",
"all",
"imported",
"names",
"known",
"within",
"the",
"module",
"wrapping",
"as",
"per",
"PEP",
"."
] | def output_import_froms(self, out, imports_list):
"""Mention all imported names known within the module, wrapping as per PEP."""
if imports_list:
self.add_import_header_if_needed()
for mod_name in sorted_no_case(imports_list.keys()):
import_names = imports_list[mo... | [
"def",
"output_import_froms",
"(",
"self",
",",
"out",
",",
"imports_list",
")",
":",
"if",
"imports_list",
":",
"self",
".",
"add_import_header_if_needed",
"(",
")",
"for",
"mod_name",
"in",
"sorted_no_case",
"(",
"imports_list",
".",
"keys",
"(",
")",
")",
... | https://github.com/baldurk/renderdoc/blob/ec5c14dee844b18dc545b52c4bd705ae20cba5d7/docs/pycharm_helpers/plugins/python-ce/helpers/generator3/module_redeclarator.py#L1277-L1319 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | KeyboardState.ShiftDown | (*args, **kwargs) | return _core_.KeyboardState_ShiftDown(*args, **kwargs) | ShiftDown(self) -> bool
Returns ``True`` if the Shift key was down at the time of the event. | ShiftDown(self) -> bool | [
"ShiftDown",
"(",
"self",
")",
"-",
">",
"bool"
] | def ShiftDown(*args, **kwargs):
"""
ShiftDown(self) -> bool
Returns ``True`` if the Shift key was down at the time of the event.
"""
return _core_.KeyboardState_ShiftDown(*args, **kwargs) | [
"def",
"ShiftDown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"KeyboardState_ShiftDown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L4345-L4351 | |
baidu/lac | 3e10dbed9bfd87bea927c84a6627a167c17b5617 | python/LAC/nets.py | python | do_train | (args, dataset, segment_tool) | return test_program, train_ret['crf_decode'] | 执行训练过程
Args:
args: DefaultArgs对象,在utils.py中定义,
存储模型训练的所有参数,
Returns:
训练产出的program及模型输出变量 | 执行训练过程 | [
"执行训练过程"
] | def do_train(args, dataset, segment_tool):
"""执行训练过程
Args:
args: DefaultArgs对象,在utils.py中定义,
存储模型训练的所有参数,
Returns:
训练产出的program及模型输出变量
"""
train_program = fluid.Program()
startup_program = fluid.Program()
# init executor
if args.use_cuda:
place = f... | [
"def",
"do_train",
"(",
"args",
",",
"dataset",
",",
"segment_tool",
")",
":",
"train_program",
"=",
"fluid",
".",
"Program",
"(",
")",
"startup_program",
"=",
"fluid",
".",
"Program",
"(",
")",
"# init executor",
"if",
"args",
".",
"use_cuda",
":",
"place... | https://github.com/baidu/lac/blob/3e10dbed9bfd87bea927c84a6627a167c17b5617/python/LAC/nets.py#L276-L359 | |
epiqc/ScaffCC | 66a79944ee4cd116b27bc1a69137276885461db8 | clang/bindings/python/clang/cindex.py | python | Cursor.is_converting_constructor | (self) | return conf.lib.clang_CXXConstructor_isConvertingConstructor(self) | Returns True if the cursor refers to a C++ converting constructor. | Returns True if the cursor refers to a C++ converting constructor. | [
"Returns",
"True",
"if",
"the",
"cursor",
"refers",
"to",
"a",
"C",
"++",
"converting",
"constructor",
"."
] | def is_converting_constructor(self):
"""Returns True if the cursor refers to a C++ converting constructor.
"""
return conf.lib.clang_CXXConstructor_isConvertingConstructor(self) | [
"def",
"is_converting_constructor",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_CXXConstructor_isConvertingConstructor",
"(",
"self",
")"
] | https://github.com/epiqc/ScaffCC/blob/66a79944ee4cd116b27bc1a69137276885461db8/clang/bindings/python/clang/cindex.py#L1450-L1453 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/models/CompFactory.py | python | CompFactory.create | (
self, the_parsed_component_xml, parsed_port_xml_list, parsed_serializable_list
) | return the_component | Create a component model here. | Create a component model here. | [
"Create",
"a",
"component",
"model",
"here",
"."
] | def create(
self, the_parsed_component_xml, parsed_port_xml_list, parsed_serializable_list
):
"""
Create a component model here.
"""
x = the_parsed_component_xml
comp_obj = x.get_component()
comp_port_obj_list = x.get_ports()
comp_command_obj_list = x.... | [
"def",
"create",
"(",
"self",
",",
"the_parsed_component_xml",
",",
"parsed_port_xml_list",
",",
"parsed_serializable_list",
")",
":",
"x",
"=",
"the_parsed_component_xml",
"comp_obj",
"=",
"x",
".",
"get_component",
"(",
")",
"comp_port_obj_list",
"=",
"x",
".",
... | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/models/CompFactory.py#L70-L431 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/email/mime/application.py | python | MIMEApplication.__init__ | (self, _data, _subtype='octet-stream',
_encoder=encoders.encode_base64, **_params) | Create an application/* type MIME document.
_data is a string containing the raw application data.
_subtype is the MIME content type subtype, defaulting to
'octet-stream'.
_encoder is a function which will perform the actual encoding for
transport of the application data, defa... | Create an application/* type MIME document. | [
"Create",
"an",
"application",
"/",
"*",
"type",
"MIME",
"document",
"."
] | def __init__(self, _data, _subtype='octet-stream',
_encoder=encoders.encode_base64, **_params):
"""Create an application/* type MIME document.
_data is a string containing the raw application data.
_subtype is the MIME content type subtype, defaulting to
'octet-stream'... | [
"def",
"__init__",
"(",
"self",
",",
"_data",
",",
"_subtype",
"=",
"'octet-stream'",
",",
"_encoder",
"=",
"encoders",
".",
"encode_base64",
",",
"*",
"*",
"_params",
")",
":",
"if",
"_subtype",
"is",
"None",
":",
"raise",
"TypeError",
"(",
"'Invalid appl... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/email/mime/application.py#L16-L36 | ||
turi-code/SFrame | 796b9bdfb2fa1b881d82080754643c7e68629cd2 | oss_src/unity/python/sframe/data_structures/sgraph.py | python | _dataframe_to_edge_list | (df) | Convert dataframe into list of edges, assuming that source and target ids are stored in _SRC_VID_COLUMN, and _DST_VID_COLUMN respectively. | Convert dataframe into list of edges, assuming that source and target ids are stored in _SRC_VID_COLUMN, and _DST_VID_COLUMN respectively. | [
"Convert",
"dataframe",
"into",
"list",
"of",
"edges",
"assuming",
"that",
"source",
"and",
"target",
"ids",
"are",
"stored",
"in",
"_SRC_VID_COLUMN",
"and",
"_DST_VID_COLUMN",
"respectively",
"."
] | def _dataframe_to_edge_list(df):
"""
Convert dataframe into list of edges, assuming that source and target ids are stored in _SRC_VID_COLUMN, and _DST_VID_COLUMN respectively.
"""
cols = df.columns
if len(cols):
assert _SRC_VID_COLUMN in cols, "Vertex DataFrame must contain column %s" % _SRC... | [
"def",
"_dataframe_to_edge_list",
"(",
"df",
")",
":",
"cols",
"=",
"df",
".",
"columns",
"if",
"len",
"(",
"cols",
")",
":",
"assert",
"_SRC_VID_COLUMN",
"in",
"cols",
",",
"\"Vertex DataFrame must contain column %s\"",
"%",
"_SRC_VID_COLUMN",
"assert",
"_DST_VID... | https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/sgraph.py#L1440-L1452 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/urllib3/contrib/pyopenssl.py | python | inject_into_urllib3 | () | Monkey-patch urllib3 with PyOpenSSL-backed SSL-support. | Monkey-patch urllib3 with PyOpenSSL-backed SSL-support. | [
"Monkey",
"-",
"patch",
"urllib3",
"with",
"PyOpenSSL",
"-",
"backed",
"SSL",
"-",
"support",
"."
] | def inject_into_urllib3():
"Monkey-patch urllib3 with PyOpenSSL-backed SSL-support."
_validate_dependencies_met()
util.SSLContext = PyOpenSSLContext
util.ssl_.SSLContext = PyOpenSSLContext
util.HAS_SNI = HAS_SNI
util.ssl_.HAS_SNI = HAS_SNI
util.IS_PYOPENSSL = True
util.ssl_.IS_PYOPENSS... | [
"def",
"inject_into_urllib3",
"(",
")",
":",
"_validate_dependencies_met",
"(",
")",
"util",
".",
"SSLContext",
"=",
"PyOpenSSLContext",
"util",
".",
"ssl_",
".",
"SSLContext",
"=",
"PyOpenSSLContext",
"util",
".",
"HAS_SNI",
"=",
"HAS_SNI",
"util",
".",
"ssl_",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/urllib3/contrib/pyopenssl.py#L115-L125 | ||
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TStrV.Reserve | (self, *args) | return _snap.TStrV_Reserve(self, *args) | Reserve(TStrV self, int const & _MxVals)
Parameters:
_MxVals: int const &
Reserve(TStrV self, int const & _MxVals, int const & _Vals)
Parameters:
_MxVals: int const &
_Vals: int const & | Reserve(TStrV self, int const & _MxVals) | [
"Reserve",
"(",
"TStrV",
"self",
"int",
"const",
"&",
"_MxVals",
")"
] | def Reserve(self, *args):
"""
Reserve(TStrV self, int const & _MxVals)
Parameters:
_MxVals: int const &
Reserve(TStrV self, int const & _MxVals, int const & _Vals)
Parameters:
_MxVals: int const &
_Vals: int const &
"""
retu... | [
"def",
"Reserve",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TStrV_Reserve",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L19283-L19297 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/applications/workbench/workbench/plotting/globalfiguremanager.py | python | GlobalFigureManager.figure_title_changed | (cls, figure_number) | Notify the observers that a figure title was changed
:param figure_number: The unique number in GlobalFigureManager | Notify the observers that a figure title was changed
:param figure_number: The unique number in GlobalFigureManager | [
"Notify",
"the",
"observers",
"that",
"a",
"figure",
"title",
"was",
"changed",
":",
"param",
"figure_number",
":",
"The",
"unique",
"number",
"in",
"GlobalFigureManager"
] | def figure_title_changed(cls, figure_number):
"""
Notify the observers that a figure title was changed
:param figure_number: The unique number in GlobalFigureManager
"""
cls.notify_observers(FigureAction.Renamed, figure_number) | [
"def",
"figure_title_changed",
"(",
"cls",
",",
"figure_number",
")",
":",
"cls",
".",
"notify_observers",
"(",
"FigureAction",
".",
"Renamed",
",",
"figure_number",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/applications/workbench/workbench/plotting/globalfiguremanager.py#L273-L278 | ||
xbmc/xbmc | 091211a754589fc40a2a1f239b0ce9f4ee138268 | addons/metadata.tvshows.themoviedb.org.python/libs/data_utils.py | python | _set_cast | (cast_info, list_item) | return list_item | Save cast info to list item | Save cast info to list item | [
"Save",
"cast",
"info",
"to",
"list",
"item"
] | def _set_cast(cast_info, list_item):
# type: (InfoType, ListItem) -> ListItem
"""Save cast info to list item"""
cast = []
for item in cast_info:
data = {
'name': item['name'],
'role': item.get('character', item.get('character_name', '')),
'order': item['order'... | [
"def",
"_set_cast",
"(",
"cast_info",
",",
"list_item",
")",
":",
"# type: (InfoType, ListItem) -> ListItem",
"cast",
"=",
"[",
"]",
"for",
"item",
"in",
"cast_info",
":",
"data",
"=",
"{",
"'name'",
":",
"item",
"[",
"'name'",
"]",
",",
"'role'",
":",
"it... | https://github.com/xbmc/xbmc/blob/091211a754589fc40a2a1f239b0ce9f4ee138268/addons/metadata.tvshows.themoviedb.org.python/libs/data_utils.py#L72-L89 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/learn/python/learn/estimators/dynamic_rnn_estimator.py | python | _multi_value_loss | (
activations, labels, sequence_length, target_column, features) | Maps `activations` from the RNN to loss for multi value models.
Args:
activations: Output from an RNN. Should have dtype `float32` and shape
`[batch_size, padded_length, ?]`.
labels: A `Tensor` with length `[batch_size, padded_length]`.
sequence_length: A `Tensor` with shape `[batch_size]` and dtyp... | Maps `activations` from the RNN to loss for multi value models. | [
"Maps",
"activations",
"from",
"the",
"RNN",
"to",
"loss",
"for",
"multi",
"value",
"models",
"."
] | def _multi_value_loss(
activations, labels, sequence_length, target_column, features):
"""Maps `activations` from the RNN to loss for multi value models.
Args:
activations: Output from an RNN. Should have dtype `float32` and shape
`[batch_size, padded_length, ?]`.
labels: A `Tensor` with length `... | [
"def",
"_multi_value_loss",
"(",
"activations",
",",
"labels",
",",
"sequence_length",
",",
"target_column",
",",
"features",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"'MultiValueLoss'",
")",
":",
"activations_masked",
",",
"labels_masked",
"=",
"rnn_commo... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/learn/python/learn/estimators/dynamic_rnn_estimator.py#L302-L322 | ||
apple/swift-clang | d7403439fc6641751840b723e7165fb02f52db95 | tools/scan-build-py/libscanbuild/shell.py | python | encode | (command) | return " ".join([escape(arg) for arg in command]) | Takes a command as list and returns a string. | Takes a command as list and returns a string. | [
"Takes",
"a",
"command",
"as",
"list",
"and",
"returns",
"a",
"string",
"."
] | def encode(command):
""" Takes a command as list and returns a string. """
def needs_quote(word):
""" Returns true if arguments needs to be protected by quotes.
Previous implementation was shlex.split method, but that's not good
for this job. Currently is running through the string wit... | [
"def",
"encode",
"(",
"command",
")",
":",
"def",
"needs_quote",
"(",
"word",
")",
":",
"\"\"\" Returns true if arguments needs to be protected by quotes.\n\n Previous implementation was shlex.split method, but that's not good\n for this job. Currently is running through the st... | https://github.com/apple/swift-clang/blob/d7403439fc6641751840b723e7165fb02f52db95/tools/scan-build-py/libscanbuild/shell.py#L13-L51 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/threading.py | python | Event.clear | (self) | Reset the internal flag to false.
Subsequently, threads calling wait() will block until set() is called to
set the internal flag to true again. | Reset the internal flag to false. | [
"Reset",
"the",
"internal",
"flag",
"to",
"false",
"."
] | def clear(self):
"""Reset the internal flag to false.
Subsequently, threads calling wait() will block until set() is called to
set the internal flag to true again.
"""
with self._cond:
self._flag = False | [
"def",
"clear",
"(",
"self",
")",
":",
"with",
"self",
".",
"_cond",
":",
"self",
".",
"_flag",
"=",
"False"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/threading.py#L524-L532 | ||
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/wiredtiger/tools/wtstats/wtstats.py | python | parse_wtstats_file | (file, result) | parse wtstats file, one stat per line, example format:
Dec 05 14:43:14 0 /data/b block-manager: mapped bytes read | parse wtstats file, one stat per line, example format:
Dec 05 14:43:14 0 /data/b block-manager: mapped bytes read | [
"parse",
"wtstats",
"file",
"one",
"stat",
"per",
"line",
"example",
"format",
":",
"Dec",
"05",
"14",
":",
"43",
":",
"14",
"0",
"/",
"data",
"/",
"b",
"block",
"-",
"manager",
":",
"mapped",
"bytes",
"read"
] | def parse_wtstats_file(file, result):
""" parse wtstats file, one stat per line, example format:
Dec 05 14:43:14 0 /data/b block-manager: mapped bytes read
"""
print 'Processing wtstats file: ' + file
# Parse file
for line in open(file, 'rU'):
month, day, time, v, title = line.st... | [
"def",
"parse_wtstats_file",
"(",
"file",
",",
"result",
")",
":",
"print",
"'Processing wtstats file: '",
"+",
"file",
"# Parse file",
"for",
"line",
"in",
"open",
"(",
"file",
",",
"'rU'",
")",
":",
"month",
",",
"day",
",",
"time",
",",
"v",
",",
"tit... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/wiredtiger/tools/wtstats/wtstats.py#L109-L118 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/distributions/python/ops/shape.py | python | _ShapeUtil.event_ndims | (self) | return self._event_ndims | Returns number of dimensions needed to index a sample's coordinates. | Returns number of dimensions needed to index a sample's coordinates. | [
"Returns",
"number",
"of",
"dimensions",
"needed",
"to",
"index",
"a",
"sample",
"s",
"coordinates",
"."
] | def event_ndims(self):
"""Returns number of dimensions needed to index a sample's coordinates."""
return self._event_ndims | [
"def",
"event_ndims",
"(",
"self",
")",
":",
"return",
"self",
".",
"_event_ndims"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/shape.py#L162-L164 | |
Cisco-Talos/moflow | ed71dfb0540d9e0d7a4c72f0881b58958d573728 | BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/cpp_message.py | python | GetDescriptorPool | () | return _net_proto2___python.NewCDescriptorPool() | Creates a new DescriptorPool C++ object. | Creates a new DescriptorPool C++ object. | [
"Creates",
"a",
"new",
"DescriptorPool",
"C",
"++",
"object",
"."
] | def GetDescriptorPool():
"""Creates a new DescriptorPool C++ object."""
return _net_proto2___python.NewCDescriptorPool() | [
"def",
"GetDescriptorPool",
"(",
")",
":",
"return",
"_net_proto2___python",
".",
"NewCDescriptorPool",
"(",
")"
] | https://github.com/Cisco-Talos/moflow/blob/ed71dfb0540d9e0d7a4c72f0881b58958d573728/BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/cpp_message.py#L48-L50 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/filedialog.py | python | askopenfilename | (**options) | return Open(**options).show() | Ask for a filename to open | Ask for a filename to open | [
"Ask",
"for",
"a",
"filename",
"to",
"open"
] | def askopenfilename(**options):
"Ask for a filename to open"
return Open(**options).show() | [
"def",
"askopenfilename",
"(",
"*",
"*",
"options",
")",
":",
"return",
"Open",
"(",
"*",
"*",
"options",
")",
".",
"show",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/filedialog.py#L372-L375 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/src/robotsim.py | python | SimJoint.addForce | (self, force: "double") | return _robotsim.SimJoint_addForce(self, force) | r"""
addForce(SimJoint self, double force)
Adds a torque for the hinge joint and a force for a slider joint. | r"""
addForce(SimJoint self, double force) | [
"r",
"addForce",
"(",
"SimJoint",
"self",
"double",
"force",
")"
] | def addForce(self, force: "double") -> "void":
r"""
addForce(SimJoint self, double force)
Adds a torque for the hinge joint and a force for a slider joint.
"""
return _robotsim.SimJoint_addForce(self, force) | [
"def",
"addForce",
"(",
"self",
",",
"force",
":",
"\"double\"",
")",
"->",
"\"void\"",
":",
"return",
"_robotsim",
".",
"SimJoint_addForce",
"(",
"self",
",",
"force",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L8140-L8148 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/jinja2/bccache.py | python | BytecodeCache.get_bucket | (self, environment, name, filename, source) | return bucket | Return a cache bucket for the given template. All arguments are
mandatory but filename may be `None`. | Return a cache bucket for the given template. All arguments are
mandatory but filename may be `None`. | [
"Return",
"a",
"cache",
"bucket",
"for",
"the",
"given",
"template",
".",
"All",
"arguments",
"are",
"mandatory",
"but",
"filename",
"may",
"be",
"None",
"."
] | def get_bucket(self, environment, name, filename, source):
"""Return a cache bucket for the given template. All arguments are
mandatory but filename may be `None`.
"""
key = self.get_cache_key(name, filename)
checksum = self.get_source_checksum(source)
bucket = Bucket(en... | [
"def",
"get_bucket",
"(",
"self",
",",
"environment",
",",
"name",
",",
"filename",
",",
"source",
")",
":",
"key",
"=",
"self",
".",
"get_cache_key",
"(",
"name",
",",
"filename",
")",
"checksum",
"=",
"self",
".",
"get_source_checksum",
"(",
"source",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/jinja2/bccache.py#L172-L180 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/data.py | python | CoverageData.add_arc_data | (self, arc_data) | Add measured arc data.
`arc_data` is { filename: { (l1,l2): None, ... }, ...} | Add measured arc data. | [
"Add",
"measured",
"arc",
"data",
"."
] | def add_arc_data(self, arc_data):
"""Add measured arc data.
`arc_data` is { filename: { (l1,l2): None, ... }, ...}
"""
for filename, arcs in arc_data.items():
self.arcs.setdefault(filename, {}).update(arcs) | [
"def",
"add_arc_data",
"(",
"self",
",",
"arc_data",
")",
":",
"for",
"filename",
",",
"arcs",
"in",
"arc_data",
".",
"items",
"(",
")",
":",
"self",
".",
"arcs",
".",
"setdefault",
"(",
"filename",
",",
"{",
"}",
")",
".",
"update",
"(",
"arcs",
"... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/data.py#L208-L215 | ||
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | example/rcnn/rcnn/dataset/coco.py | python | coco.evaluate_detections | (self, detections) | detections_val2014_results.json | detections_val2014_results.json | [
"detections_val2014_results",
".",
"json"
] | def evaluate_detections(self, detections):
""" detections_val2014_results.json """
res_folder = os.path.join(self.cache_path, 'results')
if not os.path.exists(res_folder):
os.makedirs(res_folder)
res_file = os.path.join(res_folder, 'detections_%s_results.json' % self.image_se... | [
"def",
"evaluate_detections",
"(",
"self",
",",
"detections",
")",
":",
"res_folder",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"cache_path",
",",
"'results'",
")",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"res_folder",
")",
":"... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/example/rcnn/rcnn/dataset/coco.py#L154-L162 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBSymbol.__ne__ | (self, *args) | return _lldb.SBSymbol___ne__(self, *args) | __ne__(self, SBSymbol rhs) -> bool | __ne__(self, SBSymbol rhs) -> bool | [
"__ne__",
"(",
"self",
"SBSymbol",
"rhs",
")",
"-",
">",
"bool"
] | def __ne__(self, *args):
"""__ne__(self, SBSymbol rhs) -> bool"""
return _lldb.SBSymbol___ne__(self, *args) | [
"def",
"__ne__",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBSymbol___ne__",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L8147-L8149 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/vision/py_transforms_util.py | python | invert_color | (img) | return ImageOps.invert(img) | Invert colors of input PIL image.
Args:
img (PIL image): Image to be color inverted.
Returns:
img (PIL image), Color inverted image. | Invert colors of input PIL image. | [
"Invert",
"colors",
"of",
"input",
"PIL",
"image",
"."
] | def invert_color(img):
"""
Invert colors of input PIL image.
Args:
img (PIL image): Image to be color inverted.
Returns:
img (PIL image), Color inverted image.
"""
if not is_pil(img):
raise TypeError(augment_error_message.format(type(img)))
return ImageOps.invert... | [
"def",
"invert_color",
"(",
"img",
")",
":",
"if",
"not",
"is_pil",
"(",
"img",
")",
":",
"raise",
"TypeError",
"(",
"augment_error_message",
".",
"format",
"(",
"type",
"(",
"img",
")",
")",
")",
"return",
"ImageOps",
".",
"invert",
"(",
"img",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/vision/py_transforms_util.py#L1554-L1569 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/gslib/copy_helper.py | python | _DoParallelCompositeUpload | (fp, src_url, dst_url, dst_obj_metadata,
canned_acl, file_size, preconditions, gsutil_api,
command_obj, copy_exception_handler) | return elapsed_time, composed_object | Uploads a local file to a cloud object using parallel composite upload.
The file is partitioned into parts, and then the parts are uploaded in
parallel, composed to form the original destination object, and deleted.
Args:
fp: The file object to be uploaded.
src_url: FileUrl representing the local file.
... | Uploads a local file to a cloud object using parallel composite upload. | [
"Uploads",
"a",
"local",
"file",
"to",
"a",
"cloud",
"object",
"using",
"parallel",
"composite",
"upload",
"."
] | def _DoParallelCompositeUpload(fp, src_url, dst_url, dst_obj_metadata,
canned_acl, file_size, preconditions, gsutil_api,
command_obj, copy_exception_handler):
"""Uploads a local file to a cloud object using parallel composite upload.
The file is partiti... | [
"def",
"_DoParallelCompositeUpload",
"(",
"fp",
",",
"src_url",
",",
"dst_url",
",",
"dst_obj_metadata",
",",
"canned_acl",
",",
"file_size",
",",
"preconditions",
",",
"gsutil_api",
",",
"command_obj",
",",
"copy_exception_handler",
")",
":",
"start_time",
"=",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/copy_helper.py#L926-L1037 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge2.py | python | ExodusModel._get_unreferenced_nodes | (self) | return unused_nodes | Return a list of node indices which are not used by any element. | Return a list of node indices which are not used by any element. | [
"Return",
"a",
"list",
"of",
"node",
"indices",
"which",
"are",
"not",
"used",
"by",
"any",
"element",
"."
] | def _get_unreferenced_nodes(self):
"""Return a list of node indices which are not used by any element."""
used_node = [False] * len(self.nodes)
for id_ in self.get_element_block_ids():
connectivity = self.get_connectivity(id_)
for node_index in connectivity:
... | [
"def",
"_get_unreferenced_nodes",
"(",
"self",
")",
":",
"used_node",
"=",
"[",
"False",
"]",
"*",
"len",
"(",
"self",
".",
"nodes",
")",
"for",
"id_",
"in",
"self",
".",
"get_element_block_ids",
"(",
")",
":",
"connectivity",
"=",
"self",
".",
"get_conn... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge2.py#L5690-L5700 | |
vgteam/vg | cf4d516a5e9ee5163c783e4437ddf16b18a4b561 | vgci/vgci.py | python | VGCITest.test_map_mhc_snp1kg | (self) | Indexing, mapping and calling bakeoff F1 test for MHC snp1kg graph | Indexing, mapping and calling bakeoff F1 test for MHC snp1kg graph | [
"Indexing",
"mapping",
"and",
"calling",
"bakeoff",
"F1",
"test",
"for",
"MHC",
"snp1kg",
"graph"
] | def test_map_mhc_snp1kg(self):
""" Indexing, mapping and calling bakeoff F1 test for MHC snp1kg graph """
log.info("Test start at {}".format(datetime.now()))
self._test_bakeoff('MHC', 'snp1kg', True) | [
"def",
"test_map_mhc_snp1kg",
"(",
"self",
")",
":",
"log",
".",
"info",
"(",
"\"Test start at {}\"",
".",
"format",
"(",
"datetime",
".",
"now",
"(",
")",
")",
")",
"self",
".",
"_test_bakeoff",
"(",
"'MHC'",
",",
"'snp1kg'",
",",
"True",
")"
] | https://github.com/vgteam/vg/blob/cf4d516a5e9ee5163c783e4437ddf16b18a4b561/vgci/vgci.py#L1448-L1451 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/rdataset.py | python | Rdataset.update | (self, other) | Add all rdatas in other to self.
@param other: The rdataset from which to update
@type other: dns.rdataset.Rdataset object | Add all rdatas in other to self. | [
"Add",
"all",
"rdatas",
"in",
"other",
"to",
"self",
"."
] | def update(self, other):
"""Add all rdatas in other to self.
@param other: The rdataset from which to update
@type other: dns.rdataset.Rdataset object"""
self.update_ttl(other.ttl)
super(Rdataset, self).update(other) | [
"def",
"update",
"(",
"self",
",",
"other",
")",
":",
"self",
".",
"update_ttl",
"(",
"other",
".",
"ttl",
")",
"super",
"(",
"Rdataset",
",",
"self",
")",
".",
"update",
"(",
"other",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/rdataset.py#L134-L141 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Window.SetLabel | (*args, **kwargs) | return _core_.Window_SetLabel(*args, **kwargs) | SetLabel(self, String label)
Set the text which the window shows in its label if applicable. | SetLabel(self, String label) | [
"SetLabel",
"(",
"self",
"String",
"label",
")"
] | def SetLabel(*args, **kwargs):
"""
SetLabel(self, String label)
Set the text which the window shows in its label if applicable.
"""
return _core_.Window_SetLabel(*args, **kwargs) | [
"def",
"SetLabel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_SetLabel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L9201-L9207 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pyparsing.py | python | locatedExpr | (expr) | return Group(locator("locn_start") + expr("value") + locator.copy().leaveWhitespace()("locn_end")) | Helper to decorate a returned token with its starting and ending
locations in the input string.
This helper adds the following results names:
- locn_start = location where matched expression begins
- locn_end = location where matched expression ends
- value = the actual parsed results
... | Helper to decorate a returned token with its starting and ending | [
"Helper",
"to",
"decorate",
"a",
"returned",
"token",
"with",
"its",
"starting",
"and",
"ending"
] | def locatedExpr(expr):
"""Helper to decorate a returned token with its starting and ending
locations in the input string.
This helper adds the following results names:
- locn_start = location where matched expression begins
- locn_end = location where matched expression ends
- value... | [
"def",
"locatedExpr",
"(",
"expr",
")",
":",
"locator",
"=",
"Empty",
"(",
")",
".",
"setParseAction",
"(",
"lambda",
"s",
",",
"l",
",",
"t",
":",
"l",
")",
"return",
"Group",
"(",
"locator",
"(",
"\"locn_start\"",
")",
"+",
"expr",
"(",
"\"value\""... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pyparsing.py#L11271-L11323 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/training_util.py | python | _get_global_step_read | (graph=None) | return None | Gets global step read tensor in graph.
Args:
graph: The graph in which to create the global step read tensor. If missing,
use default graph.
Returns:
Global step read tensor.
Raises:
RuntimeError: if multiple items found in collection GLOBAL_STEP_READ_KEY. | Gets global step read tensor in graph. | [
"Gets",
"global",
"step",
"read",
"tensor",
"in",
"graph",
"."
] | def _get_global_step_read(graph=None):
"""Gets global step read tensor in graph.
Args:
graph: The graph in which to create the global step read tensor. If missing,
use default graph.
Returns:
Global step read tensor.
Raises:
RuntimeError: if multiple items found in collection GLOBAL_STEP_RE... | [
"def",
"_get_global_step_read",
"(",
"graph",
"=",
"None",
")",
":",
"graph",
"=",
"graph",
"or",
"ops",
".",
"get_default_graph",
"(",
")",
"global_step_read_tensors",
"=",
"graph",
".",
"get_collection",
"(",
"GLOBAL_STEP_READ_KEY",
")",
"if",
"len",
"(",
"g... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/training_util.py#L188-L209 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/dataview.py | python | DataViewCtrl.AppendProgressColumn | (*args, **kwargs) | return _dataview.DataViewCtrl_AppendProgressColumn(*args, **kwargs) | AppendProgressColumn(self, PyObject label_or_bitmap, unsigned int model_column,
int mode=DATAVIEW_CELL_INERT, int width=DVC_DEFAULT_WIDTH,
int align=ALIGN_CENTER, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn | AppendProgressColumn(self, PyObject label_or_bitmap, unsigned int model_column,
int mode=DATAVIEW_CELL_INERT, int width=DVC_DEFAULT_WIDTH,
int align=ALIGN_CENTER, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn | [
"AppendProgressColumn",
"(",
"self",
"PyObject",
"label_or_bitmap",
"unsigned",
"int",
"model_column",
"int",
"mode",
"=",
"DATAVIEW_CELL_INERT",
"int",
"width",
"=",
"DVC_DEFAULT_WIDTH",
"int",
"align",
"=",
"ALIGN_CENTER",
"int",
"flags",
"=",
"DATAVIEW_COL_RESIZABLE"... | def AppendProgressColumn(*args, **kwargs):
"""
AppendProgressColumn(self, PyObject label_or_bitmap, unsigned int model_column,
int mode=DATAVIEW_CELL_INERT, int width=DVC_DEFAULT_WIDTH,
int align=ALIGN_CENTER, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn
"""
... | [
"def",
"AppendProgressColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewCtrl_AppendProgressColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/dataview.py#L1663-L1669 | |
llvm-mirror/lldb | d01083a850f577b85501a0902b52fd0930de72c7 | utils/vim-lldb/python-vim-lldb/vim_panes.py | python | get_selected_frame | (target) | return (frame, "") | Returns a tuple with (frame, error) where frame == None if error occurs | Returns a tuple with (frame, error) where frame == None if error occurs | [
"Returns",
"a",
"tuple",
"with",
"(",
"frame",
"error",
")",
"where",
"frame",
"==",
"None",
"if",
"error",
"occurs"
] | def get_selected_frame(target):
""" Returns a tuple with (frame, error) where frame == None if error occurs """
(thread, error) = get_selected_thread(target)
if thread is None:
return (None, error)
frame = thread.GetSelectedFrame()
if frame is None or not frame.IsValid():
return (No... | [
"def",
"get_selected_frame",
"(",
"target",
")",
":",
"(",
"thread",
",",
"error",
")",
"=",
"get_selected_thread",
"(",
"target",
")",
"if",
"thread",
"is",
"None",
":",
"return",
"(",
"None",
",",
"error",
")",
"frame",
"=",
"thread",
".",
"GetSelected... | https://github.com/llvm-mirror/lldb/blob/d01083a850f577b85501a0902b52fd0930de72c7/utils/vim-lldb/python-vim-lldb/vim_panes.py#L89-L98 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.