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
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
lastError
()
return Error(_obj=ret)
Get the last global error registered. This is per thread if compiled with thread support.
Get the last global error registered. This is per thread if compiled with thread support.
[ "Get", "the", "last", "global", "error", "registered", ".", "This", "is", "per", "thread", "if", "compiled", "with", "thread", "support", "." ]
def lastError(): """Get the last global error registered. This is per thread if compiled with thread support. """ ret = libxml2mod.xmlGetLastError() if ret is None:raise treeError('xmlGetLastError() failed') return Error(_obj=ret)
[ "def", "lastError", "(", ")", ":", "ret", "=", "libxml2mod", ".", "xmlGetLastError", "(", ")", "if", "ret", "is", "None", ":", "raise", "treeError", "(", "'xmlGetLastError() failed'", ")", "return", "Error", "(", "_obj", "=", "ret", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L1139-L1144
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
lldb/examples/python/diagnose_unwind.py
python
diagnose_unwind
(debugger, command, result, dict)
Gather diagnostic information to help debug incorrect unwind (backtrace) behavior in lldb. When there is a backtrace that doesn't look correct, run this command with the correct thread selected and a large amount of diagnostic information will be printed, it is likely to be helpful when reporting the problem.
Gather diagnostic information to help debug incorrect unwind (backtrace) behavior in lldb. When there is a backtrace that doesn't look correct, run this command with the correct thread selected and a large amount of diagnostic information will be printed, it is likely to be helpful when reporting the problem.
[ "Gather", "diagnostic", "information", "to", "help", "debug", "incorrect", "unwind", "(", "backtrace", ")", "behavior", "in", "lldb", ".", "When", "there", "is", "a", "backtrace", "that", "doesn", "t", "look", "correct", "run", "this", "command", "with", "th...
def diagnose_unwind(debugger, command, result, dict): """ Gather diagnostic information to help debug incorrect unwind (backtrace) behavior in lldb. When there is a backtrace that doesn't look correct, run this command with the correct thread selected and a large amount of diagnostic information will be pr...
[ "def", "diagnose_unwind", "(", "debugger", ",", "command", ",", "result", ",", "dict", ")", ":", "command_args", "=", "shlex", ".", "split", "(", "command", ")", "parser", "=", "create_diagnose_unwind_options", "(", ")", "try", ":", "(", "options", ",", "a...
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/lldb/examples/python/diagnose_unwind.py#L148-L299
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/feature_column/feature_column.py
python
_shape_offsets
(shape)
return offsets
Returns moving offset for each dimension given shape.
Returns moving offset for each dimension given shape.
[ "Returns", "moving", "offset", "for", "each", "dimension", "given", "shape", "." ]
def _shape_offsets(shape): """Returns moving offset for each dimension given shape.""" offsets = [] for dim in reversed(shape): if offsets: offsets.append(dim * offsets[-1]) else: offsets.append(dim) offsets.reverse() return offsets
[ "def", "_shape_offsets", "(", "shape", ")", ":", "offsets", "=", "[", "]", "for", "dim", "in", "reversed", "(", "shape", ")", ":", "if", "offsets", ":", "offsets", ".", "append", "(", "dim", "*", "offsets", "[", "-", "1", "]", ")", "else", ":", "...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/feature_column/feature_column.py#L1590-L1599
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/utils.py
python
add_dict_to_cookiejar
(cj, cookie_dict)
return cookiejar_from_dict(cookie_dict, cj)
Returns a CookieJar from a key/value dictionary. :param cj: CookieJar to insert cookies into. :param cookie_dict: Dict of key/values to insert into CookieJar. :rtype: CookieJar
Returns a CookieJar from a key/value dictionary.
[ "Returns", "a", "CookieJar", "from", "a", "key", "/", "value", "dictionary", "." ]
def add_dict_to_cookiejar(cj, cookie_dict): """Returns a CookieJar from a key/value dictionary. :param cj: CookieJar to insert cookies into. :param cookie_dict: Dict of key/values to insert into CookieJar. :rtype: CookieJar """ return cookiejar_from_dict(cookie_dict, cj)
[ "def", "add_dict_to_cookiejar", "(", "cj", ",", "cookie_dict", ")", ":", "return", "cookiejar_from_dict", "(", "cookie_dict", ",", "cj", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/utils.py#L424-L432
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/Environment.py
python
Base.Ignore
(self, target, dependency)
return tlist
Ignore a dependency.
Ignore a dependency.
[ "Ignore", "a", "dependency", "." ]
def Ignore(self, target, dependency): """Ignore a dependency.""" tlist = self.arg2nodes(target, self.fs.Entry) dlist = self.arg2nodes(dependency, self.fs.Entry) for t in tlist: t.add_ignore(dlist) return tlist
[ "def", "Ignore", "(", "self", ",", "target", ",", "dependency", ")", ":", "tlist", "=", "self", ".", "arg2nodes", "(", "target", ",", "self", ".", "fs", ".", "Entry", ")", "dlist", "=", "self", ".", "arg2nodes", "(", "dependency", ",", "self", ".", ...
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Environment.py#L2179-L2185
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/polynomial/polyutils.py
python
as_series
(alist, trim=True)
return ret
Return argument as a list of 1-d arrays. The returned list contains array(s) of dtype double, complex double, or object. A 1-d argument of shape ``(N,)`` is parsed into ``N`` arrays of size one; a 2-d argument of shape ``(M,N)`` is parsed into ``M`` arrays of size ``N`` (i.e., is "parsed by row"); and...
Return argument as a list of 1-d arrays.
[ "Return", "argument", "as", "a", "list", "of", "1", "-", "d", "arrays", "." ]
def as_series(alist, trim=True) : """ Return argument as a list of 1-d arrays. The returned list contains array(s) of dtype double, complex double, or object. A 1-d argument of shape ``(N,)`` is parsed into ``N`` arrays of size one; a 2-d argument of shape ``(M,N)`` is parsed into ``M`` arrays ...
[ "def", "as_series", "(", "alist", ",", "trim", "=", "True", ")", ":", "arrays", "=", "[", "np", ".", "array", "(", "a", ",", "ndmin", "=", "1", ",", "copy", "=", "0", ")", "for", "a", "in", "alist", "]", "if", "min", "(", "[", "a", ".", "si...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/polynomial/polyutils.py#L115-L179
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
media/webrtc/trunk/tools/gyp/pylib/gyp/MSVSUserFile.py
python
_FindCommandInPath
(command)
return command
If there are no slashes in the command given, this function searches the PATH env to find the given command, and converts it to an absolute path. We have to do this because MSVS is looking for an actual file to launch a debugger on, not just a command line. Note that this happens at GYP time, so a...
If there are no slashes in the command given, this function searches the PATH env to find the given command, and converts it to an absolute path. We have to do this because MSVS is looking for an actual file to launch a debugger on, not just a command line. Note that this happens at GYP time, so a...
[ "If", "there", "are", "no", "slashes", "in", "the", "command", "given", "this", "function", "searches", "the", "PATH", "env", "to", "find", "the", "given", "command", "and", "converts", "it", "to", "an", "absolute", "path", ".", "We", "have", "to", "do",...
def _FindCommandInPath(command): """If there are no slashes in the command given, this function searches the PATH env to find the given command, and converts it to an absolute path. We have to do this because MSVS is looking for an actual file to launch a debugger on, not just a command line. No...
[ "def", "_FindCommandInPath", "(", "command", ")", ":", "if", "'/'", "in", "command", "or", "'\\\\'", "in", "command", ":", "# If the command already has path elements (either relative or", "# absolute), then assume it is constructed properly.", "return", "command", "else", ":...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/MSVSUserFile.py#L17-L36
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
GBSizerItem.SetSpan
(*args, **kwargs)
return _core_.GBSizerItem_SetSpan(*args, **kwargs)
SetSpan(self, GBSpan span) -> bool If the item is already a member of a sizer then first ensure that there is no other item that would intersect with this one with its new spanning size, then set the new spanning. Returns True if the change is successful and after the next Layout() the...
SetSpan(self, GBSpan span) -> bool
[ "SetSpan", "(", "self", "GBSpan", "span", ")", "-", ">", "bool" ]
def SetSpan(*args, **kwargs): """ SetSpan(self, GBSpan span) -> bool If the item is already a member of a sizer then first ensure that there is no other item that would intersect with this one with its new spanning size, then set the new spanning. Returns True if the change ...
[ "def", "SetSpan", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "GBSizerItem_SetSpan", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L15766-L15776
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
VarScrollHelperBase.GetVisibleBegin
(*args, **kwargs)
return _windows_.VarScrollHelperBase_GetVisibleBegin(*args, **kwargs)
GetVisibleBegin(self) -> size_t
GetVisibleBegin(self) -> size_t
[ "GetVisibleBegin", "(", "self", ")", "-", ">", "size_t" ]
def GetVisibleBegin(*args, **kwargs): """GetVisibleBegin(self) -> size_t""" return _windows_.VarScrollHelperBase_GetVisibleBegin(*args, **kwargs)
[ "def", "GetVisibleBegin", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "VarScrollHelperBase_GetVisibleBegin", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L2218-L2220
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/Utilities/sconsign.py
python
nodeinfo_raw
(name, ninfo, prefix="")
return name + ': {' + ', '.join(values) + '}'
This just formats the dictionary, which we would normally use str() to do, except that we want the keys sorted for deterministic output.
This just formats the dictionary, which we would normally use str() to do, except that we want the keys sorted for deterministic output.
[ "This", "just", "formats", "the", "dictionary", "which", "we", "would", "normally", "use", "str", "()", "to", "do", "except", "that", "we", "want", "the", "keys", "sorted", "for", "deterministic", "output", "." ]
def nodeinfo_raw(name, ninfo, prefix=""): """ This just formats the dictionary, which we would normally use str() to do, except that we want the keys sorted for deterministic output. """ d = ninfo.__getstate__() try: keys = ninfo.field_list + ['_version_id'] except AttributeError: ...
[ "def", "nodeinfo_raw", "(", "name", ",", "ninfo", ",", "prefix", "=", "\"\"", ")", ":", "d", "=", "ninfo", ".", "__getstate__", "(", ")", "try", ":", "keys", "=", "ninfo", ".", "field_list", "+", "[", "'_version_id'", "]", "except", "AttributeError", "...
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Utilities/sconsign.py#L198-L213
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/mock-1.0.0/mock.py
python
MagicMock.mock_add_spec
(self, spec, spec_set=False)
Add a spec to a mock. `spec` can either be an object or a list of strings. Only attributes on the `spec` can be fetched as attributes from the mock. If `spec_set` is True then only attributes on the spec can be set.
Add a spec to a mock. `spec` can either be an object or a list of strings. Only attributes on the `spec` can be fetched as attributes from the mock.
[ "Add", "a", "spec", "to", "a", "mock", ".", "spec", "can", "either", "be", "an", "object", "or", "a", "list", "of", "strings", ".", "Only", "attributes", "on", "the", "spec", "can", "be", "fetched", "as", "attributes", "from", "the", "mock", "." ]
def mock_add_spec(self, spec, spec_set=False): """Add a spec to a mock. `spec` can either be an object or a list of strings. Only attributes on the `spec` can be fetched as attributes from the mock. If `spec_set` is True then only attributes on the spec can be set.""" self._mock...
[ "def", "mock_add_spec", "(", "self", ",", "spec", ",", "spec_set", "=", "False", ")", ":", "self", ".", "_mock_add_spec", "(", "spec", ",", "spec_set", ")", "self", ".", "_mock_set_magics", "(", ")" ]
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mock-1.0.0/mock.py#L1890-L1897
google/tink
59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14
python/tink/cleartext_keyset_handle.py
python
read
(keyset_reader: tink.KeysetReader)
return tink.KeysetHandle._create(keyset)
Create a KeysetHandle from a keyset_reader.
Create a KeysetHandle from a keyset_reader.
[ "Create", "a", "KeysetHandle", "from", "a", "keyset_reader", "." ]
def read(keyset_reader: tink.KeysetReader) -> tink.KeysetHandle: """Create a KeysetHandle from a keyset_reader.""" keyset = keyset_reader.read() return tink.KeysetHandle._create(keyset)
[ "def", "read", "(", "keyset_reader", ":", "tink", ".", "KeysetReader", ")", "->", "tink", ".", "KeysetHandle", ":", "keyset", "=", "keyset_reader", ".", "read", "(", ")", "return", "tink", ".", "KeysetHandle", ".", "_create", "(", "keyset", ")" ]
https://github.com/google/tink/blob/59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14/python/tink/cleartext_keyset_handle.py#L32-L35
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/bisect.py
python
bisect_right
(a, x, lo=0, hi=None)
return lo
Return the index where to insert item x in list a, assuming a is sorted. The return value i is such that all e in a[:i] have e <= x, and all e in a[i:] have e > x. So if x already appears in the list, a.insert(x) will insert just after the rightmost x already there. Optional args lo (default 0) and h...
Return the index where to insert item x in list a, assuming a is sorted.
[ "Return", "the", "index", "where", "to", "insert", "item", "x", "in", "list", "a", "assuming", "a", "is", "sorted", "." ]
def bisect_right(a, x, lo=0, hi=None): """Return the index where to insert item x in list a, assuming a is sorted. The return value i is such that all e in a[:i] have e <= x, and all e in a[i:] have e > x. So if x already appears in the list, a.insert(x) will insert just after the rightmost x already ...
[ "def", "bisect_right", "(", "a", ",", "x", ",", "lo", "=", "0", ",", "hi", "=", "None", ")", ":", "if", "lo", "<", "0", ":", "raise", "ValueError", "(", "'lo must be non-negative'", ")", "if", "hi", "is", "None", ":", "hi", "=", "len", "(", "a", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/bisect.py#L24-L43
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_main.py
python
MainWindow.OnMaximizeEditor
(self, evt)
Maximize the editor and hide the other panes. If the editor is already maximized, it is un-maximized and the other panes are restored @param evt: CommandEvent instance
Maximize the editor and hide the other panes. If the editor is already maximized, it is un-maximized and the other panes are restored @param evt: CommandEvent instance
[ "Maximize", "the", "editor", "and", "hide", "the", "other", "panes", ".", "If", "the", "editor", "is", "already", "maximized", "it", "is", "un", "-", "maximized", "and", "the", "other", "panes", "are", "restored", "@param", "evt", ":", "CommandEvent", "ins...
def OnMaximizeEditor(self, evt): """Maximize the editor and hide the other panes. If the editor is already maximized, it is un-maximized and the other panes are restored @param evt: CommandEvent instance """ paneInfo = self.PanelMgr.GetPane("EditPane") if self.PanelMgr...
[ "def", "OnMaximizeEditor", "(", "self", ",", "evt", ")", ":", "paneInfo", "=", "self", ".", "PanelMgr", ".", "GetPane", "(", "\"EditPane\"", ")", "if", "self", ".", "PanelMgr", ".", "IsEditorMaximized", "(", ")", ":", "self", ".", "PanelMgr", ".", "Resto...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_main.py#L1028-L1040
waymo-research/waymo-open-dataset
5de359f3429e1496761790770868296140161b66
waymo_open_dataset/metrics/ops/py_metrics_ops.py
python
detection_metrics
(prediction_bbox, prediction_type, prediction_score, prediction_frame_id, prediction_overlap_nlz, ground_truth_bbox, ground_truth_type, ground_truth_frame_id, ...
return metrics_module.detection_metrics( prediction_bbox=prediction_bbox, prediction_type=prediction_type, prediction_score=prediction_score, prediction_frame_id=prediction_frame_id, prediction_overlap_nlz=prediction_overlap_nlz, ground_truth_bbox=ground_truth_bbox, ground_trut...
Wraps detection_metrics. See metrics_ops.cc for full documentation.
Wraps detection_metrics. See metrics_ops.cc for full documentation.
[ "Wraps", "detection_metrics", ".", "See", "metrics_ops", ".", "cc", "for", "full", "documentation", "." ]
def detection_metrics(prediction_bbox, prediction_type, prediction_score, prediction_frame_id, prediction_overlap_nlz, ground_truth_bbox, ground_truth_type, ground_tr...
[ "def", "detection_metrics", "(", "prediction_bbox", ",", "prediction_type", ",", "prediction_score", ",", "prediction_frame_id", ",", "prediction_overlap_nlz", ",", "ground_truth_bbox", ",", "ground_truth_type", ",", "ground_truth_frame_id", ",", "ground_truth_difficulty", ",...
https://github.com/waymo-research/waymo-open-dataset/blob/5de359f3429e1496761790770868296140161b66/waymo_open_dataset/metrics/ops/py_metrics_ops.py#L27-L54
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
build/android/android_commands.py
python
GetEmulators
()
return devices
Returns a list of emulators. Does not filter by status (e.g. offline). Both devices starting with 'emulator' will be returned in below output: * daemon not running. starting it now on port 5037 * * daemon started successfully * List of devices attached 027c10494100b4d7 device emulator-55...
Returns a list of emulators. Does not filter by status (e.g. offline).
[ "Returns", "a", "list", "of", "emulators", ".", "Does", "not", "filter", "by", "status", "(", "e", ".", "g", ".", "offline", ")", "." ]
def GetEmulators(): """Returns a list of emulators. Does not filter by status (e.g. offline). Both devices starting with 'emulator' will be returned in below output: * daemon not running. starting it now on port 5037 * * daemon started successfully * List of devices attached 027c10494100b4d7 ...
[ "def", "GetEmulators", "(", ")", ":", "re_device", "=", "re", ".", "compile", "(", "'^emulator-[0-9]+'", ",", "re", ".", "MULTILINE", ")", "devices", "=", "re_device", ".", "findall", "(", "cmd_helper", ".", "GetCmdOutput", "(", "[", "'adb'", ",", "'device...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/build/android/android_commands.py#L65-L79
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/shape_base.py
python
dsplit
(ary, indices_or_sections)
return split(ary, indices_or_sections, 2)
Split array into multiple sub-arrays along the 3rd axis (depth). Please refer to the `split` documentation. `dsplit` is equivalent to `split` with ``axis=2``, the array is always split along the third axis provided the array dimension is greater than or equal to 3. See Also -------- split : S...
Split array into multiple sub-arrays along the 3rd axis (depth).
[ "Split", "array", "into", "multiple", "sub", "-", "arrays", "along", "the", "3rd", "axis", "(", "depth", ")", "." ]
def dsplit(ary, indices_or_sections): """ Split array into multiple sub-arrays along the 3rd axis (depth). Please refer to the `split` documentation. `dsplit` is equivalent to `split` with ``axis=2``, the array is always split along the third axis provided the array dimension is greater than or eq...
[ "def", "dsplit", "(", "ary", ",", "indices_or_sections", ")", ":", "if", "_nx", ".", "ndim", "(", "ary", ")", "<", "3", ":", "raise", "ValueError", "(", "'dsplit only works on arrays of 3 or more dimensions'", ")", "return", "split", "(", "ary", ",", "indices_...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/shape_base.py#L993-L1034
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/mailbox.py
python
MH.__len__
(self)
return len(list(self.iterkeys()))
Return a count of messages in the mailbox.
Return a count of messages in the mailbox.
[ "Return", "a", "count", "of", "messages", "in", "the", "mailbox", "." ]
def __len__(self): """Return a count of messages in the mailbox.""" return len(list(self.iterkeys()))
[ "def", "__len__", "(", "self", ")", ":", "return", "len", "(", "list", "(", "self", ".", "iterkeys", "(", ")", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/mailbox.py#L1074-L1076
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/Pygments/py3/pygments/formatters/img.py
python
ImageFormatter._get_text_color
(self, style)
return fill
Get the correct color for the token from the style.
Get the correct color for the token from the style.
[ "Get", "the", "correct", "color", "for", "the", "token", "from", "the", "style", "." ]
def _get_text_color(self, style): """ Get the correct color for the token from the style. """ if style['color'] is not None: fill = '#' + style['color'] else: fill = '#000' return fill
[ "def", "_get_text_color", "(", "self", ",", "style", ")", ":", "if", "style", "[", "'color'", "]", "is", "not", "None", ":", "fill", "=", "'#'", "+", "style", "[", "'color'", "]", "else", ":", "fill", "=", "'#000'", "return", "fill" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Pygments/py3/pygments/formatters/img.py#L445-L453
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/html.py
python
HtmlParser.PushTagHandler
(*args, **kwargs)
return _html.HtmlParser_PushTagHandler(*args, **kwargs)
PushTagHandler(self, HtmlTagHandler handler, String tags)
PushTagHandler(self, HtmlTagHandler handler, String tags)
[ "PushTagHandler", "(", "self", "HtmlTagHandler", "handler", "String", "tags", ")" ]
def PushTagHandler(*args, **kwargs): """PushTagHandler(self, HtmlTagHandler handler, String tags)""" return _html.HtmlParser_PushTagHandler(*args, **kwargs)
[ "def", "PushTagHandler", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html", ".", "HtmlParser_PushTagHandler", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html.py#L217-L219
coinapi/coinapi-sdk
854f21e7f69ea8599ae35c5403565cf299d8b795
oeml-sdk/python/openapi_client/model/ord_status.py
python
OrdStatus._from_openapi_data
(cls, *args, **kwargs)
return self
OrdStatus - a model defined in OpenAPI Note that value can be passed either in args or in kwargs, but not in both. Args: args[0] (str): Order statuses and the lifecycle are documented in the separate section: <a href=\"#oeml-order-lifecycle\">OEML / Starter Guide / Order Lifecycle</a> ., m...
OrdStatus - a model defined in OpenAPI
[ "OrdStatus", "-", "a", "model", "defined", "in", "OpenAPI" ]
def _from_openapi_data(cls, *args, **kwargs): """OrdStatus - a model defined in OpenAPI Note that value can be passed either in args or in kwargs, but not in both. Args: args[0] (str): Order statuses and the lifecycle are documented in the separate section: <a href=\"#oeml-order-li...
[ "def", "_from_openapi_data", "(", "cls", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# required up here when default value is not given", "_path_to_item", "=", "kwargs", ".", "pop", "(", "'_path_to_item'", ",", "(", ")", ")", "self", "=", "super", "(...
https://github.com/coinapi/coinapi-sdk/blob/854f21e7f69ea8599ae35c5403565cf299d8b795/oeml-sdk/python/openapi_client/model/ord_status.py#L200-L290
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
Rect2D.MoveLeftTopTo
(*args, **kwargs)
return _core_.Rect2D_MoveLeftTopTo(*args, **kwargs)
MoveLeftTopTo(self, Point2D pt)
MoveLeftTopTo(self, Point2D pt)
[ "MoveLeftTopTo", "(", "self", "Point2D", "pt", ")" ]
def MoveLeftTopTo(*args, **kwargs): """MoveLeftTopTo(self, Point2D pt)""" return _core_.Rect2D_MoveLeftTopTo(*args, **kwargs)
[ "def", "MoveLeftTopTo", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Rect2D_MoveLeftTopTo", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L1911-L1913
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Menu.invoke
(self, index)
return self.tk.call(self._w, 'invoke', index)
Invoke a menu item identified by INDEX and execute the associated command.
Invoke a menu item identified by INDEX and execute the associated command.
[ "Invoke", "a", "menu", "item", "identified", "by", "INDEX", "and", "execute", "the", "associated", "command", "." ]
def invoke(self, index): """Invoke a menu item identified by INDEX and execute the associated command.""" return self.tk.call(self._w, 'invoke', index)
[ "def", "invoke", "(", "self", ",", "index", ")", ":", "return", "self", ".", "tk", ".", "call", "(", "self", ".", "_w", ",", "'invoke'", ",", "index", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2736-L2739
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/array_ops.py
python
broadcast_dynamic_shape
(shape_x, shape_y)
return gen_array_ops.broadcast_args(shape_x, shape_y)
Computes the shape of a broadcast given symbolic shapes. When `shape_x` and `shape_y` are Tensors representing shapes (i.e. the result of calling tf.shape on another Tensor) this computes a Tensor which is the shape of the result of a broadcasting op applied in tensors of shapes `shape_x` and `shape_y`. Thi...
Computes the shape of a broadcast given symbolic shapes.
[ "Computes", "the", "shape", "of", "a", "broadcast", "given", "symbolic", "shapes", "." ]
def broadcast_dynamic_shape(shape_x, shape_y): """Computes the shape of a broadcast given symbolic shapes. When `shape_x` and `shape_y` are Tensors representing shapes (i.e. the result of calling tf.shape on another Tensor) this computes a Tensor which is the shape of the result of a broadcasting op applied in...
[ "def", "broadcast_dynamic_shape", "(", "shape_x", ",", "shape_y", ")", ":", "return", "gen_array_ops", ".", "broadcast_args", "(", "shape_x", ",", "shape_y", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/array_ops.py#L513-L542
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/learn/python/learn/models.py
python
_reverse_seq
(input_seq, lengths)
return result
Reverse a list of Tensors up to specified lengths. Args: input_seq: Sequence of seq_len tensors of dimension (batch_size, depth) lengths: A tensor of dimension batch_size, containing lengths for each sequence in the batch. If "None" is specified, simply reverses the list. R...
Reverse a list of Tensors up to specified lengths.
[ "Reverse", "a", "list", "of", "Tensors", "up", "to", "specified", "lengths", "." ]
def _reverse_seq(input_seq, lengths): """Reverse a list of Tensors up to specified lengths. Args: input_seq: Sequence of seq_len tensors of dimension (batch_size, depth) lengths: A tensor of dimension batch_size, containing lengths for each sequence in the batch. If "None" is specified, si...
[ "def", "_reverse_seq", "(", "input_seq", ",", "lengths", ")", ":", "if", "lengths", "is", "None", ":", "return", "list", "(", "reversed", "(", "input_seq", ")", ")", "for", "input_", "in", "input_seq", ":", "input_", ".", "set_shape", "(", "input_", ".",...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/models.py#L238-L263
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
src/mem/slicc/parser.py
python
SLICC.p_expr__localvar
(self, p)
aexpr : type ident
aexpr : type ident
[ "aexpr", ":", "type", "ident" ]
def p_expr__localvar(self, p): "aexpr : type ident" p[0] = ast.LocalVariableAST(self, p[1], p[2])
[ "def", "p_expr__localvar", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "ast", ".", "LocalVariableAST", "(", "self", ",", "p", "[", "1", "]", ",", "p", "[", "2", "]", ")" ]
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/mem/slicc/parser.py#L677-L679
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
Validation/RecoTrack/python/plotting/plotting.py
python
AggregateBins.create
(self, tdirectory)
return result
Create and return the histogram from a TDirectory
Create and return the histogram from a TDirectory
[ "Create", "and", "return", "the", "histogram", "from", "a", "TDirectory" ]
def create(self, tdirectory): """Create and return the histogram from a TDirectory""" th1 = _getOrCreateObject(tdirectory, self._histoName) if th1 is None: return None binLabels = [""]*len(self._mapping) binValues = [None]*len(self._mapping) # TH1 can't real...
[ "def", "create", "(", "self", ",", "tdirectory", ")", ":", "th1", "=", "_getOrCreateObject", "(", "tdirectory", ",", "self", ".", "_histoName", ")", "if", "th1", "is", "None", ":", "return", "None", "binLabels", "=", "[", "\"\"", "]", "*", "len", "(", ...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Validation/RecoTrack/python/plotting/plotting.py#L988-L1073
wesnoth/wesnoth
6ccac5a5e8ff75303c9190c0da60580925cb32c0
data/tools/wesnoth/wmldata.py
python
DataSub.set_comment_first
(self, comment)
For the lazy.
For the lazy.
[ "For", "the", "lazy", "." ]
def set_comment_first(self, comment): """For the lazy.""" for item in self.get_all("comment"): if isinstance(item, DataComment): if item.data == comment: return self.insert_first(DataComment("comment", comment))
[ "def", "set_comment_first", "(", "self", ",", "comment", ")", ":", "for", "item", "in", "self", ".", "get_all", "(", "\"comment\"", ")", ":", "if", "isinstance", "(", "item", ",", "DataComment", ")", ":", "if", "item", ".", "data", "==", "comment", ":"...
https://github.com/wesnoth/wesnoth/blob/6ccac5a5e8ff75303c9190c0da60580925cb32c0/data/tools/wesnoth/wmldata.py#L565-L571
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/core.py
python
MaskedArray.__radd__
(self, other)
return add(other, self)
Add other to self, and return a new masked array.
Add other to self, and return a new masked array.
[ "Add", "other", "to", "self", "and", "return", "a", "new", "masked", "array", "." ]
def __radd__(self, other): """ Add other to self, and return a new masked array. """ # In analogy with __rsub__ and __rdiv__, use original order: # we get here from `other + self`. return add(other, self)
[ "def", "__radd__", "(", "self", ",", "other", ")", ":", "# In analogy with __rsub__ and __rdiv__, use original order:", "# we get here from `other + self`.", "return", "add", "(", "other", ",", "self", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/core.py#L4101-L4108
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/control/robotinterfaceutils.py
python
RobotInterfaceEmulator.initialize
(self,qsns,vsns,tsns,qcmd,vcmd,tcmd)
Could be called before the emulator starts running to initialize the commanded joint positions before the emulator takes over.
Could be called before the emulator starts running to initialize the commanded joint positions before the emulator takes over.
[ "Could", "be", "called", "before", "the", "emulator", "starts", "running", "to", "initialize", "the", "commanded", "joint", "positions", "before", "the", "emulator", "takes", "over", "." ]
def initialize(self,qsns,vsns,tsns,qcmd,vcmd,tcmd): """Could be called before the emulator starts running to initialize the commanded joint positions before the emulator takes over. """ assert qcmd is None or len(qcmd) == len(self.jointData) assert vcmd is None or len(vcmd) == le...
[ "def", "initialize", "(", "self", ",", "qsns", ",", "vsns", ",", "tsns", ",", "qcmd", ",", "vcmd", ",", "tcmd", ")", ":", "assert", "qcmd", "is", "None", "or", "len", "(", "qcmd", ")", "==", "len", "(", "self", ".", "jointData", ")", "assert", "v...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/control/robotinterfaceutils.py#L4225-L4248
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/network/session.py
python
PipSession.__init__
(self, *args, **kwargs)
:param trusted_hosts: Domains not to emit warnings for when not using HTTPS.
:param trusted_hosts: Domains not to emit warnings for when not using HTTPS.
[ ":", "param", "trusted_hosts", ":", "Domains", "not", "to", "emit", "warnings", "for", "when", "not", "using", "HTTPS", "." ]
def __init__(self, *args, **kwargs): """ :param trusted_hosts: Domains not to emit warnings for when not using HTTPS. """ retries = kwargs.pop("retries", 0) cache = kwargs.pop("cache", None) trusted_hosts = kwargs.pop("trusted_hosts", []) # type: List[str] ...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "retries", "=", "kwargs", ".", "pop", "(", "\"retries\"", ",", "0", ")", "cache", "=", "kwargs", ".", "pop", "(", "\"cache\"", ",", "None", ")", "trusted_hosts", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/network/session.py#L228-L302
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/nn/functional/pooling.py
python
adaptive_avg_pool1d
(x, output_size, name=None)
return squeeze(pool_out, [2])
This API implements adaptive average pooling 1d operation. See more details in :ref:`api_nn_pooling_AdaptiveAvgPool1d` . Args: x (Tensor): The input tensor of pooling operator, which is a 3-D tensor with shape [N, C, L]. The format of input tensor is NCL, ...
This API implements adaptive average pooling 1d operation. See more details in :ref:`api_nn_pooling_AdaptiveAvgPool1d` .
[ "This", "API", "implements", "adaptive", "average", "pooling", "1d", "operation", ".", "See", "more", "details", "in", ":", "ref", ":", "api_nn_pooling_AdaptiveAvgPool1d", "." ]
def adaptive_avg_pool1d(x, output_size, name=None): """ This API implements adaptive average pooling 1d operation. See more details in :ref:`api_nn_pooling_AdaptiveAvgPool1d` . Args: x (Tensor): The input tensor of pooling operator, which is a 3-D tensor with shape...
[ "def", "adaptive_avg_pool1d", "(", "x", ",", "output_size", ",", "name", "=", "None", ")", ":", "pool_type", "=", "'avg'", "if", "not", "in_dygraph_mode", "(", ")", ":", "check_variable_and_dtype", "(", "x", ",", "'x'", ",", "[", "'float16'", ",", "'float3...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/nn/functional/pooling.py#L1210-L1283
sigmaai/self-driving-golf-cart
8d891600af3d851add27a10ae45cf3c2108bb87c
ros/src/ros_carla_bridge/carla_ros_bridge/src/carla_ros_bridge/collision_sensor.py
python
CollisionSensor.__init__
(self, carla_actor, parent, communication, synchronous_mode)
Constructor :param carla_actor: carla actor object :type carla_actor: carla.Actor :param parent: the parent of this :type parent: carla_ros_bridge.Parent :param communication: communication-handle :type communication: carla_ros_bridge.communication :param synchro...
Constructor
[ "Constructor" ]
def __init__(self, carla_actor, parent, communication, synchronous_mode): """ Constructor :param carla_actor: carla actor object :type carla_actor: carla.Actor :param parent: the parent of this :type parent: carla_ros_bridge.Parent :param communication: communica...
[ "def", "__init__", "(", "self", ",", "carla_actor", ",", "parent", ",", "communication", ",", "synchronous_mode", ")", ":", "super", "(", "CollisionSensor", ",", "self", ")", ".", "__init__", "(", "carla_actor", "=", "carla_actor", ",", "parent", "=", "paren...
https://github.com/sigmaai/self-driving-golf-cart/blob/8d891600af3d851add27a10ae45cf3c2108bb87c/ros/src/ros_carla_bridge/carla_ros_bridge/src/carla_ros_bridge/collision_sensor.py#L23-L41
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/jedi/jedi/refactoring.py
python
Refactoring.__init__
(self, change_dct)
:param change_dct: dict(old_path=(new_path, old_lines, new_lines))
:param change_dct: dict(old_path=(new_path, old_lines, new_lines))
[ ":", "param", "change_dct", ":", "dict", "(", "old_path", "=", "(", "new_path", "old_lines", "new_lines", "))" ]
def __init__(self, change_dct): """ :param change_dct: dict(old_path=(new_path, old_lines, new_lines)) """ self.change_dct = change_dct
[ "def", "__init__", "(", "self", ",", "change_dct", ")", ":", "self", ".", "change_dct", "=", "change_dct" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/jedi/jedi/refactoring.py#L25-L29
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
build/win/reorder-imports.py
python
reorder_imports
(input_dir, output_dir, architecture)
return 0
Run swapimports.exe on the initial chrome.exe, and write to the output directory. Also copy over any related files that might be needed (pdbs, manifests etc.).
Run swapimports.exe on the initial chrome.exe, and write to the output directory. Also copy over any related files that might be needed (pdbs, manifests etc.).
[ "Run", "swapimports", ".", "exe", "on", "the", "initial", "chrome", ".", "exe", "and", "write", "to", "the", "output", "directory", ".", "Also", "copy", "over", "any", "related", "files", "that", "might", "be", "needed", "(", "pdbs", "manifests", "etc", ...
def reorder_imports(input_dir, output_dir, architecture): """Run swapimports.exe on the initial chrome.exe, and write to the output directory. Also copy over any related files that might be needed (pdbs, manifests etc.). """ input_image = os.path.join(input_dir, 'chrome.exe') output_image = os.path.join(ou...
[ "def", "reorder_imports", "(", "input_dir", ",", "output_dir", ",", "architecture", ")", ":", "input_image", "=", "os", ".", "path", ".", "join", "(", "input_dir", ",", "'chrome.exe'", ")", "output_image", "=", "os", ".", "path", ".", "join", "(", "output_...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/win/reorder-imports.py#L13-L38
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/chunk.py
python
Chunk.getsize
(self)
return self.chunksize
Return the size of the current chunk.
Return the size of the current chunk.
[ "Return", "the", "size", "of", "the", "current", "chunk", "." ]
def getsize(self): """Return the size of the current chunk.""" return self.chunksize
[ "def", "getsize", "(", "self", ")", ":", "return", "self", ".", "chunksize" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/chunk.py#L82-L84
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/rfc822.py
python
unquote
(s)
return s
Remove quotes from a string.
Remove quotes from a string.
[ "Remove", "quotes", "from", "a", "string", "." ]
def unquote(s): """Remove quotes from a string.""" if len(s) > 1: if s.startswith('"') and s.endswith('"'): return s[1:-1].replace('\\\\', '\\').replace('\\"', '"') if s.startswith('<') and s.endswith('>'): return s[1:-1] return s
[ "def", "unquote", "(", "s", ")", ":", "if", "len", "(", "s", ")", ">", "1", ":", "if", "s", ".", "startswith", "(", "'\"'", ")", "and", "s", ".", "endswith", "(", "'\"'", ")", ":", "return", "s", "[", "1", ":", "-", "1", "]", ".", "replace"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/rfc822.py#L477-L484
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
buildscripts/eslint.py
python
get_files_to_check_from_patch
(patches)
return valid_files
Take a patch file generated by git diff, and scan the patch for a list of files to check.
Take a patch file generated by git diff, and scan the patch for a list of files to check.
[ "Take", "a", "patch", "file", "generated", "by", "git", "diff", "and", "scan", "the", "patch", "for", "a", "list", "of", "files", "to", "check", "." ]
def get_files_to_check_from_patch(patches): """Take a patch file generated by git diff, and scan the patch for a list of files to check. """ candidates = [] # Get a list of candidate_files check = re.compile(r"^diff --git a\/([a-z\/\.\-_0-9]+) b\/[a-z\/\.\-_0-9]+") lines = [] for patch in ...
[ "def", "get_files_to_check_from_patch", "(", "patches", ")", ":", "candidates", "=", "[", "]", "# Get a list of candidate_files", "check", "=", "re", ".", "compile", "(", "r\"^diff --git a\\/([a-z\\/\\.\\-_0-9]+) b\\/[a-z\\/\\.\\-_0-9]+\"", ")", "lines", "=", "[", "]", ...
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/buildscripts/eslint.py#L431-L450
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/nn/probability/distribution/exponential.py
python
Exponential._cdf
(self, value, rate=None)
return self.select(comp, zeros, cdf)
r""" Cumulative distribution function (cdf) of Exponential distributions. Args: value (Tensor): The value to be evaluated. rate (Tensor): The rate of the distribution. Default: self.rate. Note: `value` must be greater or equal to zero. .. math:: ...
r""" Cumulative distribution function (cdf) of Exponential distributions.
[ "r", "Cumulative", "distribution", "function", "(", "cdf", ")", "of", "Exponential", "distributions", "." ]
def _cdf(self, value, rate=None): r""" Cumulative distribution function (cdf) of Exponential distributions. Args: value (Tensor): The value to be evaluated. rate (Tensor): The rate of the distribution. Default: self.rate. Note: `value` must be greate...
[ "def", "_cdf", "(", "self", ",", "value", ",", "rate", "=", "None", ")", ":", "value", "=", "self", ".", "_check_value", "(", "value", ",", "'value'", ")", "value", "=", "self", ".", "cast", "(", "value", ",", "self", ".", "dtype", ")", "rate", "...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/probability/distribution/exponential.py#L278-L298
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/waflib/Utils.py
python
destos_to_binfmt
(key)
return 'elf'
Return the binary format based on the unversioned platform name. :param key: platform name :type key: string :return: string representing the binary format
Return the binary format based on the unversioned platform name.
[ "Return", "the", "binary", "format", "based", "on", "the", "unversioned", "platform", "name", "." ]
def destos_to_binfmt(key): """ Return the binary format based on the unversioned platform name. :param key: platform name :type key: string :return: string representing the binary format """ if key == 'darwin': return 'mac-o' elif key in ('win32', 'cygwin', 'uwin', 'msys'): return 'pe' return 'elf'
[ "def", "destos_to_binfmt", "(", "key", ")", ":", "if", "key", "==", "'darwin'", ":", "return", "'mac-o'", "elif", "key", "in", "(", "'win32'", ",", "'cygwin'", ",", "'uwin'", ",", "'msys'", ")", ":", "return", "'pe'", "return", "'elf'" ]
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Utils.py#L557-L569
telefonicaid/fiware-orion
27c3202b9ddcfb9e3635a0af8d373f76e89b1d24
scripts/pdi-pep8.py
python
expand_indent
(line)
return result
Return the amount of indentation. Tabs are expanded to the next multiple of 8. >>> expand_indent(' ') 4 >>> expand_indent('\\t') 8 >>> expand_indent(' \\t') 8 >>> expand_indent(' \\t') 8 >>> expand_indent(' \\t') 16
Return the amount of indentation. Tabs are expanded to the next multiple of 8.
[ "Return", "the", "amount", "of", "indentation", ".", "Tabs", "are", "expanded", "to", "the", "next", "multiple", "of", "8", "." ]
def expand_indent(line): """ Return the amount of indentation. Tabs are expanded to the next multiple of 8. >>> expand_indent(' ') 4 >>> expand_indent('\\t') 8 >>> expand_indent(' \\t') 8 >>> expand_indent(' \\t') 8 >>> expand_indent(' \\t') 16 ...
[ "def", "expand_indent", "(", "line", ")", ":", "result", "=", "0", "for", "char", "in", "line", ":", "if", "char", "==", "'\\t'", ":", "result", "=", "result", "//", "8", "*", "8", "+", "8", "elif", "char", "==", "' '", ":", "result", "+=", "1", ...
https://github.com/telefonicaid/fiware-orion/blob/27c3202b9ddcfb9e3635a0af8d373f76e89b1d24/scripts/pdi-pep8.py#L734-L758
Qihoo360/mongosync
55b647e81c072ebe91daaa3b9dc1a953c3c22e19
dep/mongo-cxx-driver/site_scons/buildscripts/cpplint.py
python
FindNextMultiLineCommentStart
(lines, lineix)
return len(lines)
Find the beginning marker for a multiline comment.
Find the beginning marker for a multiline comment.
[ "Find", "the", "beginning", "marker", "for", "a", "multiline", "comment", "." ]
def FindNextMultiLineCommentStart(lines, lineix): """Find the beginning marker for a multiline comment.""" while lineix < len(lines): if lines[lineix].strip().startswith('/*'): # Only return this marker if the comment goes beyond this line if lines[lineix].strip().find('*/', 2) < 0: return l...
[ "def", "FindNextMultiLineCommentStart", "(", "lines", ",", "lineix", ")", ":", "while", "lineix", "<", "len", "(", "lines", ")", ":", "if", "lines", "[", "lineix", "]", ".", "strip", "(", ")", ".", "startswith", "(", "'/*'", ")", ":", "# Only return this...
https://github.com/Qihoo360/mongosync/blob/55b647e81c072ebe91daaa3b9dc1a953c3c22e19/dep/mongo-cxx-driver/site_scons/buildscripts/cpplint.py#L863-L871
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/analysis.py
python
rewrite_semantic_constants
(func_ir, called_args)
This rewrites values known to be constant by their semantics as ir.Const nodes, this is to give branch pruning the best chance possible of killing branches. An example might be rewriting len(tuple) as the literal length. func_ir is the IR called_args are the actual arguments with which the function is ...
This rewrites values known to be constant by their semantics as ir.Const nodes, this is to give branch pruning the best chance possible of killing branches. An example might be rewriting len(tuple) as the literal length.
[ "This", "rewrites", "values", "known", "to", "be", "constant", "by", "their", "semantics", "as", "ir", ".", "Const", "nodes", "this", "is", "to", "give", "branch", "pruning", "the", "best", "chance", "possible", "of", "killing", "branches", ".", "An", "exa...
def rewrite_semantic_constants(func_ir, called_args): """ This rewrites values known to be constant by their semantics as ir.Const nodes, this is to give branch pruning the best chance possible of killing branches. An example might be rewriting len(tuple) as the literal length. func_ir is the IR ...
[ "def", "rewrite_semantic_constants", "(", "func_ir", ",", "called_args", ")", ":", "DEBUG", "=", "0", "if", "DEBUG", ">", "1", ":", "print", "(", "(", "\"rewrite_semantic_constants: \"", "+", "func_ir", ".", "func_id", ".", "func_name", ")", ".", "center", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/analysis.py#L459-L522
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/training/python/training/sequence_queueing_state_saver.py
python
_deconstruct_sparse_tensor_seq
(input_sequence, shared_name=None)
return transformed_input_seq, sparse_tensor_keys, tensor_op_list
Converts `SparseTensor` values into `Tensors` of IDs and meta data. Given a dict of keys -> `Tensor` or `SparseTensor` transforms the `SparseTensor` values into `Tensor` values of IDs by calling `_store_sparse`. The IDs are pointers into and underlying `SparseTensorsMap` that is being constructed. Additional m...
Converts `SparseTensor` values into `Tensors` of IDs and meta data.
[ "Converts", "SparseTensor", "values", "into", "Tensors", "of", "IDs", "and", "meta", "data", "." ]
def _deconstruct_sparse_tensor_seq(input_sequence, shared_name=None): """Converts `SparseTensor` values into `Tensors` of IDs and meta data. Given a dict of keys -> `Tensor` or `SparseTensor` transforms the `SparseTensor` values into `Tensor` values of IDs by calling `_store_sparse`. The IDs are pointers into ...
[ "def", "_deconstruct_sparse_tensor_seq", "(", "input_sequence", ",", "shared_name", "=", "None", ")", ":", "sparse_tensor_keys", "=", "[", "k", "for", "k", "in", "sorted", "(", "input_sequence", ".", "keys", "(", ")", ")", "if", "(", "isinstance", "(", "inpu...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/training/python/training/sequence_queueing_state_saver.py#L1738-L1773
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_log.py
python
LogBuffer.SetFilter
(self, src)
Set the level of what is shown in the display @param src: Only show messages from src @return: bool
Set the level of what is shown in the display @param src: Only show messages from src @return: bool
[ "Set", "the", "level", "of", "what", "is", "shown", "in", "the", "display", "@param", "src", ":", "Only", "show", "messages", "from", "src", "@return", ":", "bool" ]
def SetFilter(self, src): """Set the level of what is shown in the display @param src: Only show messages from src @return: bool """ if src in self._srcs: self._filter = src return True elif src == _("All"): self._filter = SHOW_ALL_MSG...
[ "def", "SetFilter", "(", "self", ",", "src", ")", ":", "if", "src", "in", "self", ".", "_srcs", ":", "self", ".", "_filter", "=", "src", "return", "True", "elif", "src", "==", "_", "(", "\"All\"", ")", ":", "self", ".", "_filter", "=", "SHOW_ALL_MS...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_log.py#L235-L248
google/mozc
7329757e1ad30e327c1ae823a8302c79482d6b9c
src/build_mozc.py
python
CleanMain
(options, unused_args)
The main function for the 'clean' command.
The main function for the 'clean' command.
[ "The", "main", "function", "for", "the", "clean", "command", "." ]
def CleanMain(options, unused_args): """The main function for the 'clean' command.""" # File and directory names to be removed. file_names = [] directory_names = [] # Collect stuff in the gyp directories. gyp_directory_names = [os.path.dirname(f) for f in GetGypFileNames(options)] for gyp_directory_name...
[ "def", "CleanMain", "(", "options", ",", "unused_args", ")", ":", "# File and directory names to be removed.", "file_names", "=", "[", "]", "directory_names", "=", "[", "]", "# Collect stuff in the gyp directories.", "gyp_directory_names", "=", "[", "os", ".", "path", ...
https://github.com/google/mozc/blob/7329757e1ad30e327c1ae823a8302c79482d6b9c/src/build_mozc.py#L796-L832
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/eager/tape.py
python
Tape.should_record
(self, tensors)
return pywrap_tensorflow.TFE_Py_TapeShouldRecord( self._tape, [x._id for x in tensors])
Returns true if any tensor should be recorded. Args: tensors: some tensors. Returns: True if any of the tensors is in the tape.
Returns true if any tensor should be recorded.
[ "Returns", "true", "if", "any", "tensor", "should", "be", "recorded", "." ]
def should_record(self, tensors): """Returns true if any tensor should be recorded. Args: tensors: some tensors. Returns: True if any of the tensors is in the tape. """ return pywrap_tensorflow.TFE_Py_TapeShouldRecord( self._tape, [x._id for x in tensors])
[ "def", "should_record", "(", "self", ",", "tensors", ")", ":", "return", "pywrap_tensorflow", ".", "TFE_Py_TapeShouldRecord", "(", "self", ".", "_tape", ",", "[", "x", ".", "_id", "for", "x", "in", "tensors", "]", ")" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/eager/tape.py#L65-L75
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/distribute/multi_process_runner.py
python
MultiProcessRunner.start_in_process_as
(self, as_task_type, as_task_id)
Start the processes, with the specified task run in main process. This is similar to `start()` except that the task with task_type `as_task_type` and task_id `as_task_id` is run in the main process. This method is particularly useful when debugging tool such as `pdb` is needed in some specific task. No...
Start the processes, with the specified task run in main process.
[ "Start", "the", "processes", "with", "the", "specified", "task", "run", "in", "main", "process", "." ]
def start_in_process_as(self, as_task_type, as_task_id): """Start the processes, with the specified task run in main process. This is similar to `start()` except that the task with task_type `as_task_type` and task_id `as_task_id` is run in the main process. This method is particularly useful when debu...
[ "def", "start_in_process_as", "(", "self", ",", "as_task_type", ",", "as_task_id", ")", ":", "if", "self", ".", "_processes", ":", "raise", "ValueError", "(", "'MultiProcessRunner already started.'", ")", "with", "self", ".", "_process_lock", ":", "if", "self", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/multi_process_runner.py#L366-L416
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
python/mxnet/kvstore.py
python
KVStore._set_updater
(self, updater)
Sets a push updater into the store. This function only changes the local store. When running on multiple machines one must use `set_optimizer`. Parameters ---------- updater : function The updater function. Examples -------- >>> def update(k...
Sets a push updater into the store.
[ "Sets", "a", "push", "updater", "into", "the", "store", "." ]
def _set_updater(self, updater): """Sets a push updater into the store. This function only changes the local store. When running on multiple machines one must use `set_optimizer`. Parameters ---------- updater : function The updater function. Exampl...
[ "def", "_set_updater", "(", "self", ",", "updater", ")", ":", "self", ".", "_updater", "=", "updater", "# set updater with int keys", "_updater_proto", "=", "ctypes", ".", "CFUNCTYPE", "(", "None", ",", "ctypes", ".", "c_int", ",", "NDArrayHandle", ",", "NDArr...
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/kvstore.py#L530-L568
apache/kudu
90895ce76590f10730ad7aac3613b69d89ff5422
build-support/dep_extract.py
python
DependencyExtractor.extract_deps
(self, exe)
return deps
Runs 'ldd' on the provided 'exe' path, returning a list of any libraries it depends on. Blacklisted libraries are removed from this list. If the provided 'exe' is not a binary executable, returns an empty list.
Runs 'ldd' on the provided 'exe' path, returning a list of any libraries it depends on. Blacklisted libraries are removed from this list.
[ "Runs", "ldd", "on", "the", "provided", "exe", "path", "returning", "a", "list", "of", "any", "libraries", "it", "depends", "on", ".", "Blacklisted", "libraries", "are", "removed", "from", "this", "list", "." ]
def extract_deps(self, exe): """ Runs 'ldd' on the provided 'exe' path, returning a list of any libraries it depends on. Blacklisted libraries are removed from this list. If the provided 'exe' is not a binary executable, returns an empty list. """ if (exe.endswith(".jar") or exe...
[ "def", "extract_deps", "(", "self", ",", "exe", ")", ":", "if", "(", "exe", ".", "endswith", "(", "\".jar\"", ")", "or", "exe", ".", "endswith", "(", "\".pl\"", ")", "or", "exe", ".", "endswith", "(", "\".py\"", ")", "or", "exe", ".", "endswith", "...
https://github.com/apache/kudu/blob/90895ce76590f10730ad7aac3613b69d89ff5422/build-support/dep_extract.py#L79-L119
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_gdi.py
python
Region.UnionRegion
(*args, **kwargs)
return _gdi_.Region_UnionRegion(*args, **kwargs)
UnionRegion(self, Region region) -> bool
UnionRegion(self, Region region) -> bool
[ "UnionRegion", "(", "self", "Region", "region", ")", "-", ">", "bool" ]
def UnionRegion(*args, **kwargs): """UnionRegion(self, Region region) -> bool""" return _gdi_.Region_UnionRegion(*args, **kwargs)
[ "def", "UnionRegion", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "Region_UnionRegion", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L1603-L1605
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/stc.py
python
StyledTextCtrl.GetSelectedTextUTF8
(self)
return text
Retrieve the selected text as UTF8. In an ansi build of wxPython the text retrieved from the document is assumed to be in the current default encoding.
Retrieve the selected text as UTF8. In an ansi build of wxPython the text retrieved from the document is assumed to be in the current default encoding.
[ "Retrieve", "the", "selected", "text", "as", "UTF8", ".", "In", "an", "ansi", "build", "of", "wxPython", "the", "text", "retrieved", "from", "the", "document", "is", "assumed", "to", "be", "in", "the", "current", "default", "encoding", "." ]
def GetSelectedTextUTF8(self): """ Retrieve the selected text as UTF8. In an ansi build of wxPython the text retrieved from the document is assumed to be in the current default encoding. """ text = self.GetSelectedTextRaw() if not wx.USE_UNICODE: u = ...
[ "def", "GetSelectedTextUTF8", "(", "self", ")", ":", "text", "=", "self", ".", "GetSelectedTextRaw", "(", ")", "if", "not", "wx", ".", "USE_UNICODE", ":", "u", "=", "text", ".", "decode", "(", "wx", ".", "GetDefaultPyEncoding", "(", ")", ")", "text", "...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L6830-L6840
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/plugins/mapmatching/wxgui.py
python
WxGui.on_create_cyclists_database
(self, event=None)
Analyze attributes of persons and create an elaborated trips database.
Analyze attributes of persons and create an elaborated trips database.
[ "Analyze", "attributes", "of", "persons", "and", "create", "an", "elaborated", "trips", "database", "." ]
def on_create_cyclists_database(self, event=None): """ Analyze attributes of persons and create an elaborated trips database. """ p = mapmatching.CyclistsDatabaseAnalyzer('cyclistsdatabase', self._mapmatching, results=self._results, ...
[ "def", "on_create_cyclists_database", "(", "self", ",", "event", "=", "None", ")", ":", "p", "=", "mapmatching", ".", "CyclistsDatabaseAnalyzer", "(", "'cyclistsdatabase'", ",", "self", ".", "_mapmatching", ",", "results", "=", "self", ".", "_results", ",", "l...
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/plugins/mapmatching/wxgui.py#L1777-L1805
SpenceKonde/megaTinyCore
1c4a70b18a149fe6bcb551dfa6db11ca50b8997b
megaavr/tools/libs/pymcuprog/avr8target.py
python
TinyXAvrTarget.breakpoint_clear
(self)
return self.protocol.check_response(resp)
Clears the hardware breakpoint :return:
Clears the hardware breakpoint
[ "Clears", "the", "hardware", "breakpoint" ]
def breakpoint_clear(self): """ Clears the hardware breakpoint :return: """ resp = self.protocol.jtagice3_command_response( bytearray([Avr8Protocol.CMD_AVR8_HW_BREAK_CLEAR, Avr8Protocol.CMD_VERSION0, 1])) return self.protocol.check_response(resp)
[ "def", "breakpoint_clear", "(", "self", ")", ":", "resp", "=", "self", ".", "protocol", ".", "jtagice3_command_response", "(", "bytearray", "(", "[", "Avr8Protocol", ".", "CMD_AVR8_HW_BREAK_CLEAR", ",", "Avr8Protocol", ".", "CMD_VERSION0", ",", "1", "]", ")", ...
https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/pymcuprog/avr8target.py#L317-L325
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
FileTypeInfo.GetMimeType
(*args, **kwargs)
return _misc_.FileTypeInfo_GetMimeType(*args, **kwargs)
GetMimeType(self) -> String
GetMimeType(self) -> String
[ "GetMimeType", "(", "self", ")", "-", ">", "String" ]
def GetMimeType(*args, **kwargs): """GetMimeType(self) -> String""" return _misc_.FileTypeInfo_GetMimeType(*args, **kwargs)
[ "def", "GetMimeType", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "FileTypeInfo_GetMimeType", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L2515-L2517
s5z/zsim
fb4d6e0475a25cffd23f0687ede2d43d96b4a99f
misc/cpplint.py
python
RemoveMultiLineCommentsFromRange
(lines, begin, end)
Clears a range of lines for multi-line comments.
Clears a range of lines for multi-line comments.
[ "Clears", "a", "range", "of", "lines", "for", "multi", "-", "line", "comments", "." ]
def RemoveMultiLineCommentsFromRange(lines, begin, end): """Clears a range of lines for multi-line comments.""" # Having // dummy comments makes the lines non-empty, so we will not get # unnecessary blank line warnings later in the code. for i in range(begin, end): lines[i] = '// dummy'
[ "def", "RemoveMultiLineCommentsFromRange", "(", "lines", ",", "begin", ",", "end", ")", ":", "# Having // dummy comments makes the lines non-empty, so we will not get", "# unnecessary blank line warnings later in the code.", "for", "i", "in", "range", "(", "begin", ",", "end", ...
https://github.com/s5z/zsim/blob/fb4d6e0475a25cffd23f0687ede2d43d96b4a99f/misc/cpplint.py#L944-L949
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/idlelib/rpc.py
python
SocketIO.exithook
(self)
override for specific exit action
override for specific exit action
[ "override", "for", "specific", "exit", "action" ]
def exithook(self): "override for specific exit action" os._exit(0)
[ "def", "exithook", "(", "self", ")", ":", "os", ".", "_exit", "(", "0", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/idlelib/rpc.py#L145-L147
VowpalWabbit/vowpal_wabbit
866b8fa88ff85a957c7eb72065ea44518b9ba416
python/vowpalwabbit/pyvw.py
python
Example.push_hashed_feature
( self, ns: Union[NamespaceId, str, int], f: int, v: float = 1.0 )
Add a hashed feature to a given namespace. Args: ns : namespace namespace in which the feature is to be pushed f : integer feature v : float The value of the feature, be default is 1.0
Add a hashed feature to a given namespace.
[ "Add", "a", "hashed", "feature", "to", "a", "given", "namespace", "." ]
def push_hashed_feature( self, ns: Union[NamespaceId, str, int], f: int, v: float = 1.0 ) -> None: """Add a hashed feature to a given namespace. Args: ns : namespace namespace in which the feature is to be pushed f : integer feature ...
[ "def", "push_hashed_feature", "(", "self", ",", "ns", ":", "Union", "[", "NamespaceId", ",", "str", ",", "int", "]", ",", "f", ":", "int", ",", "v", ":", "float", "=", "1.0", ")", "->", "None", ":", "if", "self", ".", "setup_done", ":", "self", "...
https://github.com/VowpalWabbit/vowpal_wabbit/blob/866b8fa88ff85a957c7eb72065ea44518b9ba416/python/vowpalwabbit/pyvw.py#L1651-L1666
daijifeng001/caffe-rfcn
543f8f6a4b7c88256ea1445ae951a12d1ad9cffd
scripts/cpp_lint.py
python
_CppLintState.SetOutputFormat
(self, output_format)
Sets the output format for errors.
Sets the output format for errors.
[ "Sets", "the", "output", "format", "for", "errors", "." ]
def SetOutputFormat(self, output_format): """Sets the output format for errors.""" self.output_format = output_format
[ "def", "SetOutputFormat", "(", "self", ",", "output_format", ")", ":", "self", ".", "output_format", "=", "output_format" ]
https://github.com/daijifeng001/caffe-rfcn/blob/543f8f6a4b7c88256ea1445ae951a12d1ad9cffd/scripts/cpp_lint.py#L703-L705
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
CondCore/Utilities/python/tier0.py
python
Tier0Handler.getFirstSafeRun
( self )
return int(safeRunDict['result'][0])
Queries Tier0DataSvc to get the first condition safe run. Parameters: @returns: integer, the run number. Raises if connection error, bad response, timeout after retries occur, or if the run number is not available.
Queries Tier0DataSvc to get the first condition safe run. Parameters:
[ "Queries", "Tier0DataSvc", "to", "get", "the", "first", "condition", "safe", "run", ".", "Parameters", ":" ]
def getFirstSafeRun( self ): """ Queries Tier0DataSvc to get the first condition safe run. Parameters: @returns: integer, the run number. Raises if connection error, bad response, timeout after retries occur, or if the run number is not available. """ firstConditi...
[ "def", "getFirstSafeRun", "(", "self", ")", ":", "firstConditionSafeRunAPI", "=", "\"firstconditionsaferun\"", "safeRunDict", "=", "self", ".", "_queryTier0DataSvc", "(", "os", ".", "path", ".", "join", "(", "self", ".", "_uri", ",", "firstConditionSafeRunAPI", ")...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/CondCore/Utilities/python/tier0.py#L142-L156
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
FlexGridSizer.AddGrowableRow
(*args, **kwargs)
return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
AddGrowableRow(self, size_t idx, int proportion=0) Specifies that row *idx* (starting from zero) should be grown if there is extra space available to the sizer. The *proportion* parameter has the same meaning as the stretch factor for the box sizers except that if all proportions are 0...
AddGrowableRow(self, size_t idx, int proportion=0)
[ "AddGrowableRow", "(", "self", "size_t", "idx", "int", "proportion", "=", "0", ")" ]
def AddGrowableRow(*args, **kwargs): """ AddGrowableRow(self, size_t idx, int proportion=0) Specifies that row *idx* (starting from zero) should be grown if there is extra space available to the sizer. The *proportion* parameter has the same meaning as the stretch factor ...
[ "def", "AddGrowableRow", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "FlexGridSizer_AddGrowableRow", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L15340-L15351
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/ssl.py
python
SSLObject.selected_npn_protocol
(self)
Return the currently selected NPN protocol as a string, or ``None`` if a next protocol was not negotiated or if NPN is not supported by one of the peers.
Return the currently selected NPN protocol as a string, or ``None`` if a next protocol was not negotiated or if NPN is not supported by one of the peers.
[ "Return", "the", "currently", "selected", "NPN", "protocol", "as", "a", "string", "or", "None", "if", "a", "next", "protocol", "was", "not", "negotiated", "or", "if", "NPN", "is", "not", "supported", "by", "one", "of", "the", "peers", "." ]
def selected_npn_protocol(self): """Return the currently selected NPN protocol as a string, or ``None`` if a next protocol was not negotiated or if NPN is not supported by one of the peers.""" if _ssl.HAS_NPN: return self._sslobj.selected_npn_protocol()
[ "def", "selected_npn_protocol", "(", "self", ")", ":", "if", "_ssl", ".", "HAS_NPN", ":", "return", "self", ".", "_sslobj", ".", "selected_npn_protocol", "(", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/ssl.py#L926-L931
kushview/Element
1cc16380caa2ab79461246ba758b9de1f46db2a5
waflib/Tools/ldc2.py
python
configure
(conf)
Configuration for *ldc2*
Configuration for *ldc2*
[ "Configuration", "for", "*", "ldc2", "*" ]
def configure(conf): """ Configuration for *ldc2* """ conf.find_ldc2() conf.load('ar') conf.load('d') conf.common_flags_ldc2() conf.d_platform_flags()
[ "def", "configure", "(", "conf", ")", ":", "conf", ".", "find_ldc2", "(", ")", "conf", ".", "load", "(", "'ar'", ")", "conf", ".", "load", "(", "'d'", ")", "conf", ".", "common_flags_ldc2", "(", ")", "conf", ".", "d_platform_flags", "(", ")" ]
https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Tools/ldc2.py#L47-L55
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/tools/inspector_protocol/jinja2/filters.py
python
do_upper
(s)
return soft_unicode(s).upper()
Convert a value to uppercase.
Convert a value to uppercase.
[ "Convert", "a", "value", "to", "uppercase", "." ]
def do_upper(s): """Convert a value to uppercase.""" return soft_unicode(s).upper()
[ "def", "do_upper", "(", "s", ")", ":", "return", "soft_unicode", "(", "s", ")", ".", "upper", "(", ")" ]
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/inspector_protocol/jinja2/filters.py#L143-L145
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/numbers.py
python
Integral.__ror__
(self, other)
other | self
other | self
[ "other", "|", "self" ]
def __ror__(self, other): """other | self""" raise NotImplementedError
[ "def", "__ror__", "(", "self", ",", "other", ")", ":", "raise", "NotImplementedError" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/numbers.py#L366-L368
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
src/bindings/python/src/compatibility/ngraph/opset1/ops.py
python
logical_xor
( left_node: NodeInput, right_node: NodeInput, auto_broadcast: str = "NUMPY", name: Optional[str] = None, )
return _get_node_factory_opset1().create( "LogicalXor", [left_node, right_node], {"auto_broadcast": auto_broadcast.upper()} )
Return node which performs logical XOR operation on input nodes element-wise. :param left_node: The first input node providing data. :param right_node: The second input node providing data. :param auto_broadcast: The type of broadcasting that specifies mapping of input tensor axes ...
Return node which performs logical XOR operation on input nodes element-wise.
[ "Return", "node", "which", "performs", "logical", "XOR", "operation", "on", "input", "nodes", "element", "-", "wise", "." ]
def logical_xor( left_node: NodeInput, right_node: NodeInput, auto_broadcast: str = "NUMPY", name: Optional[str] = None, ) -> Node: """Return node which performs logical XOR operation on input nodes element-wise. :param left_node: The first input node providing data. :param right_node: The ...
[ "def", "logical_xor", "(", "left_node", ":", "NodeInput", ",", "right_node", ":", "NodeInput", ",", "auto_broadcast", ":", "str", "=", "\"NUMPY\"", ",", "name", ":", "Optional", "[", "str", "]", "=", "None", ",", ")", "->", "Node", ":", "return", "_get_n...
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/src/bindings/python/src/compatibility/ngraph/opset1/ops.py#L1357-L1374
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/Jinja2/py3/jinja2/lexer.py
python
TokenStream.look
(self)
return result
Look at the next token.
Look at the next token.
[ "Look", "at", "the", "next", "token", "." ]
def look(self) -> Token: """Look at the next token.""" old_token = next(self) result = self.current self.push(result) self.current = old_token return result
[ "def", "look", "(", "self", ")", "->", "Token", ":", "old_token", "=", "next", "(", "self", ")", "result", "=", "self", ".", "current", "self", ".", "push", "(", "result", ")", "self", ".", "current", "=", "old_token", "return", "result" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py3/jinja2/lexer.py#L352-L358
xhzdeng/crpn
a5aef0f80dbe486103123f740c634fb01e6cc9a1
tools/train_faster_rcnn_alt_opt.py
python
train_fast_rcnn
(queue=None, imdb_name=None, init_model=None, solver=None, max_iters=None, cfg=None, rpn_file=None)
Train a Fast R-CNN using proposals generated by an RPN.
Train a Fast R-CNN using proposals generated by an RPN.
[ "Train", "a", "Fast", "R", "-", "CNN", "using", "proposals", "generated", "by", "an", "RPN", "." ]
def train_fast_rcnn(queue=None, imdb_name=None, init_model=None, solver=None, max_iters=None, cfg=None, rpn_file=None): """Train a Fast R-CNN using proposals generated by an RPN. """ cfg.TRAIN.HAS_RPN = False # not generating prosals on-the-fly cfg.TRAIN.PROPOSAL_METHOD = ...
[ "def", "train_fast_rcnn", "(", "queue", "=", "None", ",", "imdb_name", "=", "None", ",", "init_model", "=", "None", ",", "solver", "=", "None", ",", "max_iters", "=", "None", ",", "cfg", "=", "None", ",", "rpn_file", "=", "None", ")", ":", "cfg", "."...
https://github.com/xhzdeng/crpn/blob/a5aef0f80dbe486103123f740c634fb01e6cc9a1/tools/train_faster_rcnn_alt_opt.py#L173-L201
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
TextAttr.SetLineSpacing
(*args, **kwargs)
return _controls_.TextAttr_SetLineSpacing(*args, **kwargs)
SetLineSpacing(self, int spacing)
SetLineSpacing(self, int spacing)
[ "SetLineSpacing", "(", "self", "int", "spacing", ")" ]
def SetLineSpacing(*args, **kwargs): """SetLineSpacing(self, int spacing)""" return _controls_.TextAttr_SetLineSpacing(*args, **kwargs)
[ "def", "SetLineSpacing", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "TextAttr_SetLineSpacing", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L1595-L1597
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/manifold/_locally_linear.py
python
barycenter_kneighbors_graph
(X, n_neighbors, reg=1e-3, n_jobs=None)
return csr_matrix((data.ravel(), ind.ravel(), indptr), shape=(n_samples, n_samples))
Computes the barycenter weighted graph of k-Neighbors for points in X Parameters ---------- X : {array-like, NearestNeighbors} Sample data, shape = (n_samples, n_features), in the form of a numpy array or a NearestNeighbors object. n_neighbors : int Number of neighbors for each...
Computes the barycenter weighted graph of k-Neighbors for points in X
[ "Computes", "the", "barycenter", "weighted", "graph", "of", "k", "-", "Neighbors", "for", "points", "in", "X" ]
def barycenter_kneighbors_graph(X, n_neighbors, reg=1e-3, n_jobs=None): """Computes the barycenter weighted graph of k-Neighbors for points in X Parameters ---------- X : {array-like, NearestNeighbors} Sample data, shape = (n_samples, n_features), in the form of a numpy array or a Neare...
[ "def", "barycenter_kneighbors_graph", "(", "X", ",", "n_neighbors", ",", "reg", "=", "1e-3", ",", "n_jobs", "=", "None", ")", ":", "knn", "=", "NearestNeighbors", "(", "n_neighbors", "+", "1", ",", "n_jobs", "=", "n_jobs", ")", ".", "fit", "(", "X", ")...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/manifold/_locally_linear.py#L67-L107
nyuwireless-unipd/ns3-mmwave
4ff9e87e8079764e04cbeccd8e85bff15ae16fb3
utils/grid.py
python
TimelinesRenderer.draw_ranges
(self, ctx, ranges, x, y, width, height)
! Draw Ranges @param self this object @param ctx ctx @param ranges ranges @param x x @param y y @param width width @param height height @return none
! Draw Ranges
[ "!", "Draw", "Ranges" ]
def draw_ranges(self, ctx, ranges, x, y, width, height): """! Draw Ranges @param self this object @param ctx ctx @param ranges ranges @param x x @param y y @param width width @param height height @return none """ if (self.grey_back...
[ "def", "draw_ranges", "(", "self", ",", "ctx", ",", "ranges", ",", "x", ",", "y", ",", "width", ",", "height", ")", ":", "if", "(", "self", ".", "grey_background", "%", "2", ")", "==", "0", ":", "ctx", ".", "rectangle", "(", "x", ",", "y", "-",...
https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/utils/grid.py#L757-L789
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBDebugger.GetScriptingLanguage
(self, *args)
return _lldb.SBDebugger_GetScriptingLanguage(self, *args)
GetScriptingLanguage(self, str script_language_name) -> ScriptLanguage
GetScriptingLanguage(self, str script_language_name) -> ScriptLanguage
[ "GetScriptingLanguage", "(", "self", "str", "script_language_name", ")", "-", ">", "ScriptLanguage" ]
def GetScriptingLanguage(self, *args): """GetScriptingLanguage(self, str script_language_name) -> ScriptLanguage""" return _lldb.SBDebugger_GetScriptingLanguage(self, *args)
[ "def", "GetScriptingLanguage", "(", "self", ",", "*", "args", ")", ":", "return", "_lldb", ".", "SBDebugger_GetScriptingLanguage", "(", "self", ",", "*", "args", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L3370-L3372
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/stc.py
python
StyledTextCtrl.DescribeKeyWordSets
(*args, **kwargs)
return _stc.StyledTextCtrl_DescribeKeyWordSets(*args, **kwargs)
DescribeKeyWordSets(self) -> String
DescribeKeyWordSets(self) -> String
[ "DescribeKeyWordSets", "(", "self", ")", "-", ">", "String" ]
def DescribeKeyWordSets(*args, **kwargs): """DescribeKeyWordSets(self) -> String""" return _stc.StyledTextCtrl_DescribeKeyWordSets(*args, **kwargs)
[ "def", "DescribeKeyWordSets", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_DescribeKeyWordSets", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L6511-L6513
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/symbol/numpy/_symbol.py
python
equal
(x1, x2, out=None)
return _ufunc_helper(x1, x2, _npi.equal, _np.equal, _npi.equal_scalar, None, out)
Return (x1 == x2) element-wise. Parameters ---------- x1, x2 : _Symbol or scalars Input arrays. If ``x1.shape != x2.shape``, they must be broadcastable to a common shape (which becomes the shape of the output). out : Dummy parameter, optional A location into which the result is s...
Return (x1 == x2) element-wise. Parameters ---------- x1, x2 : _Symbol or scalars Input arrays. If ``x1.shape != x2.shape``, they must be broadcastable to a common shape (which becomes the shape of the output). out : Dummy parameter, optional A location into which the result is s...
[ "Return", "(", "x1", "==", "x2", ")", "element", "-", "wise", ".", "Parameters", "----------", "x1", "x2", ":", "_Symbol", "or", "scalars", "Input", "arrays", ".", "If", "x1", ".", "shape", "!", "=", "x2", ".", "shape", "they", "must", "be", "broadca...
def equal(x1, x2, out=None): """ Return (x1 == x2) element-wise. Parameters ---------- x1, x2 : _Symbol or scalars Input arrays. If ``x1.shape != x2.shape``, they must be broadcastable to a common shape (which becomes the shape of the output). out : Dummy parameter, optional ...
[ "def", "equal", "(", "x1", ",", "x2", ",", "out", "=", "None", ")", ":", "return", "_ufunc_helper", "(", "x1", ",", "x2", ",", "_npi", ".", "equal", ",", "_np", ".", "equal", ",", "_npi", ".", "equal_scalar", ",", "None", ",", "out", ")" ]
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/symbol/numpy/_symbol.py#L6341-L6369
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/optimize/_trustregion_constr/qp_subproblem.py
python
projected_cg
(H, c, Z, Y, b, trust_radius=np.inf, lb=None, ub=None, tol=None, max_iter=None, max_infeasible_iter=None, return_all=False)
return x, info
Solve EQP problem with projected CG method. Solve equality-constrained quadratic programming problem ``min 1/2 x.T H x + x.t c`` subject to ``A x + b = 0`` and, possibly, to trust region constraints ``||x|| < trust_radius`` and box constraints ``lb <= x <= ub``. Parameters ---------- H : ...
Solve EQP problem with projected CG method.
[ "Solve", "EQP", "problem", "with", "projected", "CG", "method", "." ]
def projected_cg(H, c, Z, Y, b, trust_radius=np.inf, lb=None, ub=None, tol=None, max_iter=None, max_infeasible_iter=None, return_all=False): """Solve EQP problem with projected CG method. Solve equality-constrained quadratic programming problem ``min 1/2 x...
[ "def", "projected_cg", "(", "H", ",", "c", ",", "Z", ",", "Y", ",", "b", ",", "trust_radius", "=", "np", ".", "inf", ",", "lb", "=", "None", ",", "ub", "=", "None", ",", "tol", "=", "None", ",", "max_iter", "=", "None", ",", "max_infeasible_iter"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/optimize/_trustregion_constr/qp_subproblem.py#L412-L639
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
src/python/gem5/components/boards/riscv_board.py
python
RiscvBoard._setup_pma
(self)
Set the PMA devices on each core
Set the PMA devices on each core
[ "Set", "the", "PMA", "devices", "on", "each", "core" ]
def _setup_pma(self) -> None: """Set the PMA devices on each core""" uncacheable_range = [ AddrRange(dev.pio_addr, size=dev.pio_size) for dev in self._on_chip_devices + self._off_chip_devices ] # TODO: Not sure if this should be done per-core like in the example...
[ "def", "_setup_pma", "(", "self", ")", "->", "None", ":", "uncacheable_range", "=", "[", "AddrRange", "(", "dev", ".", "pio_addr", ",", "size", "=", "dev", ".", "pio_size", ")", "for", "dev", "in", "self", ".", "_on_chip_devices", "+", "self", ".", "_o...
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/python/gem5/components/boards/riscv_board.py#L159-L171
Z3Prover/z3
d745d03afdfdf638d66093e2bfbacaf87187f35b
src/api/python/z3/z3.py
python
FloatSingle
(ctx=None)
return FPSortRef(Z3_mk_fpa_sort_single(ctx.ref()), ctx)
Floating-point 32-bit (single) sort.
Floating-point 32-bit (single) sort.
[ "Floating", "-", "point", "32", "-", "bit", "(", "single", ")", "sort", "." ]
def FloatSingle(ctx=None): """Floating-point 32-bit (single) sort.""" ctx = _get_ctx(ctx) return FPSortRef(Z3_mk_fpa_sort_single(ctx.ref()), ctx)
[ "def", "FloatSingle", "(", "ctx", "=", "None", ")", ":", "ctx", "=", "_get_ctx", "(", "ctx", ")", "return", "FPSortRef", "(", "Z3_mk_fpa_sort_single", "(", "ctx", ".", "ref", "(", ")", ")", ",", "ctx", ")" ]
https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L9292-L9295
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/heapq.py
python
heapreplace
(heap, item)
return returnitem
Pop and return the current smallest value, and add the new item. This is more efficient than heappop() followed by heappush(), and can be more appropriate when using a fixed-size heap. Note that the value returned may be larger than item! That constrains reasonable uses of this routine unless written...
Pop and return the current smallest value, and add the new item.
[ "Pop", "and", "return", "the", "current", "smallest", "value", "and", "add", "the", "new", "item", "." ]
def heapreplace(heap, item): """Pop and return the current smallest value, and add the new item. This is more efficient than heappop() followed by heappush(), and can be more appropriate when using a fixed-size heap. Note that the value returned may be larger than item! That constrains reasonable use...
[ "def", "heapreplace", "(", "heap", ",", "item", ")", ":", "returnitem", "=", "heap", "[", "0", "]", "# raises appropriate IndexError if heap is empty", "heap", "[", "0", "]", "=", "item", "_siftup", "(", "heap", ",", "0", ")", "return", "returnitem" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/heapq.py#L145-L159
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/stc.py
python
StyledTextCtrl.SetScrollWidth
(*args, **kwargs)
return _stc.StyledTextCtrl_SetScrollWidth(*args, **kwargs)
SetScrollWidth(self, int pixelWidth) Sets the document width assumed for scrolling.
SetScrollWidth(self, int pixelWidth)
[ "SetScrollWidth", "(", "self", "int", "pixelWidth", ")" ]
def SetScrollWidth(*args, **kwargs): """ SetScrollWidth(self, int pixelWidth) Sets the document width assumed for scrolling. """ return _stc.StyledTextCtrl_SetScrollWidth(*args, **kwargs)
[ "def", "SetScrollWidth", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_SetScrollWidth", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L4167-L4173
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/indexes/base.py
python
Index.hasnans
(self)
Return if I have any nans; enables various perf speedups.
Return if I have any nans; enables various perf speedups.
[ "Return", "if", "I", "have", "any", "nans", ";", "enables", "various", "perf", "speedups", "." ]
def hasnans(self) -> bool: """ Return if I have any nans; enables various perf speedups. """ if self._can_hold_na: return bool(self._isnan.any()) else: return False
[ "def", "hasnans", "(", "self", ")", "->", "bool", ":", "if", "self", ".", "_can_hold_na", ":", "return", "bool", "(", "self", ".", "_isnan", ".", "any", "(", ")", ")", "else", ":", "return", "False" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/indexes/base.py#L2445-L2452
nickgillian/grt
4d4cab1999a349b00d8924da769ff3f0c29d3176
build/python/examples/PreProcessingModulesExamples/median_filter_example.py
python
main
()
GRT MedianFilter Example This example demonstrates how to create and use the GRT MedianFilter PreProcessing Module. The MedianFilter implements a simple median filter, this will give the value seperating the higher half of the most recent data from the lower half. The filter will automatically store th...
GRT MedianFilter Example This example demonstrates how to create and use the GRT MedianFilter PreProcessing Module.
[ "GRT", "MedianFilter", "Example", "This", "example", "demonstrates", "how", "to", "create", "and", "use", "the", "GRT", "MedianFilter", "PreProcessing", "Module", "." ]
def main(): """GRT MedianFilter Example This example demonstrates how to create and use the GRT MedianFilter PreProcessing Module. The MedianFilter implements a simple median filter, this will give the value seperating the higher half of the most recent data from the lower half. The filter will aut...
[ "def", "main", "(", ")", ":", "# Create a new instance of a median average filter with a window size of 5 for a 1 dimensional signal", "filter", "=", "GRT", ".", "MedianFilter", "(", "10", ",", "1", ")", "# Generate some data (basic counter) and filter it", "for", "i", "in", ...
https://github.com/nickgillian/grt/blob/4d4cab1999a349b00d8924da769ff3f0c29d3176/build/python/examples/PreProcessingModulesExamples/median_filter_example.py#L7-L42
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/algorithms.py
python
mode
(values, dropna=True)
return Series(result)
Returns the mode(s) of an array. Parameters ---------- values : array-like Array over which to check for duplicate values. dropna : boolean, default True Don't consider counts of NaN/NaT. .. versionadded:: 0.24.0 Returns ------- mode : Series
Returns the mode(s) of an array.
[ "Returns", "the", "mode", "(", "s", ")", "of", "an", "array", "." ]
def mode(values, dropna=True): """ Returns the mode(s) of an array. Parameters ---------- values : array-like Array over which to check for duplicate values. dropna : boolean, default True Don't consider counts of NaN/NaT. .. versionadded:: 0.24.0 Returns -----...
[ "def", "mode", "(", "values", ",", "dropna", "=", "True", ")", ":", "from", "pandas", "import", "Series", "values", "=", "_ensure_arraylike", "(", "values", ")", "original", "=", "values", "# categorical is a fast-path", "if", "is_categorical_dtype", "(", "value...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/algorithms.py#L790-L832
stan-dev/math
5fd79f89933269a4ca4d8dd1fde2a36d53d4768c
lib/cpplint_1.4.5/cpplint.py
python
GetPreviousNonBlankLine
(clean_lines, linenum)
return ('', -1)
Return the most recent non-blank line and its line number. Args: clean_lines: A CleansedLines instance containing the file contents. linenum: The number of the line to check. Returns: A tuple with two elements. The first element is the contents of the last non-blank line before the current line, ...
Return the most recent non-blank line and its line number.
[ "Return", "the", "most", "recent", "non", "-", "blank", "line", "and", "its", "line", "number", "." ]
def GetPreviousNonBlankLine(clean_lines, linenum): """Return the most recent non-blank line and its line number. Args: clean_lines: A CleansedLines instance containing the file contents. linenum: The number of the line to check. Returns: A tuple with two elements. The first element is the contents ...
[ "def", "GetPreviousNonBlankLine", "(", "clean_lines", ",", "linenum", ")", ":", "prevlinenum", "=", "linenum", "-", "1", "while", "prevlinenum", ">=", "0", ":", "prevline", "=", "clean_lines", ".", "elided", "[", "prevlinenum", "]", "if", "not", "IsBlankLine",...
https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/cpplint_1.4.5/cpplint.py#L3949-L3969
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/distutils/ccompiler.py
python
CCompiler.detect_language
(self, sources)
return lang
Detect the language of a given file, or list of files. Uses language_map, and language_order to do the job.
Detect the language of a given file, or list of files. Uses language_map, and language_order to do the job.
[ "Detect", "the", "language", "of", "a", "given", "file", "or", "list", "of", "files", ".", "Uses", "language_map", "and", "language_order", "to", "do", "the", "job", "." ]
def detect_language(self, sources): """Detect the language of a given file, or list of files. Uses language_map, and language_order to do the job. """ if not isinstance(sources, list): sources = [sources] lang = None index = len(self.language_order) fo...
[ "def", "detect_language", "(", "self", ",", "sources", ")", ":", "if", "not", "isinstance", "(", "sources", ",", "list", ")", ":", "sources", "=", "[", "sources", "]", "lang", "=", "None", "index", "=", "len", "(", "self", ".", "language_order", ")", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/distutils/ccompiler.py#L474-L492
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/parfor.py
python
PreParforPass.run
(self)
Run pre-parfor processing pass.
Run pre-parfor processing pass.
[ "Run", "pre", "-", "parfor", "processing", "pass", "." ]
def run(self): """Run pre-parfor processing pass. """ # e.g. convert A.sum() to np.sum(A) for easier match and optimization canonicalize_array_math(self.func_ir, self.typemap, self.calltypes, self.typingctx) if self.options.numpy: self....
[ "def", "run", "(", "self", ")", ":", "# e.g. convert A.sum() to np.sum(A) for easier match and optimization", "canonicalize_array_math", "(", "self", ".", "func_ir", ",", "self", ".", "typemap", ",", "self", ".", "calltypes", ",", "self", ".", "typingctx", ")", "if"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/parfor.py#L1330-L1338
Manu343726/siplasplas
9fae7559f87087cf8ef34f04bd1e774b84b2ea9c
reference/cindex.py
python
Cursor.mangled_name
(self)
return self._mangled_name
Return the mangled name for the entity referenced by this cursor.
Return the mangled name for the entity referenced by this cursor.
[ "Return", "the", "mangled", "name", "for", "the", "entity", "referenced", "by", "this", "cursor", "." ]
def mangled_name(self): """Return the mangled name for the entity referenced by this cursor.""" if not hasattr(self, '_mangled_name'): self._mangled_name = conf.lib.clang_Cursor_getMangling(self) return self._mangled_name
[ "def", "mangled_name", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'_mangled_name'", ")", ":", "self", ".", "_mangled_name", "=", "conf", ".", "lib", ".", "clang_Cursor_getMangling", "(", "self", ")", "return", "self", ".", "_mangled_...
https://github.com/Manu343726/siplasplas/blob/9fae7559f87087cf8ef34f04bd1e774b84b2ea9c/reference/cindex.py#L1276-L1281
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/globe_cutter_app.py
python
GlobeBuilder.PackageGlobeForDownload
(self, make_copy, is_map=False)
Packages globe or map as a single-file globe.
Packages globe or map as a single-file globe.
[ "Packages", "globe", "or", "map", "as", "a", "single", "-", "file", "globe", "." ]
def PackageGlobeForDownload(self, make_copy, is_map=False): """Packages globe or map as a single-file globe.""" if is_map: self.Status("Packaging map for download ...") is_2d_str = "--is_2d" out_file = self.map_file else: self.Status("Packaging globe for download ...") is_2d_st...
[ "def", "PackageGlobeForDownload", "(", "self", ",", "make_copy", ",", "is_map", "=", "False", ")", ":", "if", "is_map", ":", "self", ".", "Status", "(", "\"Packaging map for download ...\"", ")", "is_2d_str", "=", "\"--is_2d\"", "out_file", "=", "self", ".", "...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/globe_cutter_app.py#L662-L704
echronos/echronos
c996f1d2c8af6c6536205eb319c1bf1d4d84569c
external_tools/ply_info/example/calcdebug/calc.py
python
p_expression_binop
(p)
expression : expression '+' expression | expression '-' expression | expression '*' expression | expression '/' expression
expression : expression '+' expression | expression '-' expression | expression '*' expression | expression '/' expression
[ "expression", ":", "expression", "+", "expression", "|", "expression", "-", "expression", "|", "expression", "*", "expression", "|", "expression", "/", "expression" ]
def p_expression_binop(p): '''expression : expression '+' expression | expression '-' expression | expression '*' expression | expression '/' expression''' if p[2] == '+' : p[0] = p[1] + p[3] elif p[2] == '-': p[0] = p[1] - p[3] elif p[2] == '*': p[...
[ "def", "p_expression_binop", "(", "p", ")", ":", "if", "p", "[", "2", "]", "==", "'+'", ":", "p", "[", "0", "]", "=", "p", "[", "1", "]", "+", "p", "[", "3", "]", "elif", "p", "[", "2", "]", "==", "'-'", ":", "p", "[", "0", "]", "=", ...
https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/calcdebug/calc.py#L62-L70
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/PyShell.py
python
PyShell._close
(self)
Extend EditorWindow._close(), shut down debugger and execution server
Extend EditorWindow._close(), shut down debugger and execution server
[ "Extend", "EditorWindow", ".", "_close", "()", "shut", "down", "debugger", "and", "execution", "server" ]
def _close(self): "Extend EditorWindow._close(), shut down debugger and execution server" self.close_debugger() if use_subprocess: self.interp.kill_subprocess() # Restore std streams sys.stdout = self.save_stdout sys.stderr = self.save_stderr sys.stdin...
[ "def", "_close", "(", "self", ")", ":", "self", ".", "close_debugger", "(", ")", "if", "use_subprocess", ":", "self", ".", "interp", ".", "kill_subprocess", "(", ")", "# Restore std streams", "sys", ".", "stdout", "=", "self", ".", "save_stdout", "sys", "....
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/PyShell.py#L997-L1011
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/aui/framemanager.py
python
AuiPaneInfo.ResetButtons
(self)
Resets all the buttons and recreates them from scratch depending on the :class:`AuiManager` flags.
Resets all the buttons and recreates them from scratch depending on the :class:`AuiManager` flags.
[ "Resets", "all", "the", "buttons", "and", "recreates", "them", "from", "scratch", "depending", "on", "the", ":", "class", ":", "AuiManager", "flags", "." ]
def ResetButtons(self): """ Resets all the buttons and recreates them from scratch depending on the :class:`AuiManager` flags. """ floating = self.HasFlag(self.optionFloating) self.buttons = [] if not floating and self.HasMinimizeButton(): button = A...
[ "def", "ResetButtons", "(", "self", ")", ":", "floating", "=", "self", ".", "HasFlag", "(", "self", ".", "optionFloating", ")", "self", ".", "buttons", "=", "[", "]", "if", "not", "floating", "and", "self", ".", "HasMinimizeButton", "(", ")", ":", "but...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/framemanager.py#L1807-L1830
jsupancic/deep_hand_pose
22cbeae1a8410ff5d37c060c7315719d0a5d608f
scripts/cpp_lint.py
python
CheckInvalidIncrement
(filename, clean_lines, linenum, error)
Checks for invalid increment *count++. For example following function: void increment_counter(int* count) { *count++; } is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*count, (*count)++ or *count += 1. Args: filename: The name of the current file. ...
Checks for invalid increment *count++.
[ "Checks", "for", "invalid", "increment", "*", "count", "++", "." ]
def CheckInvalidIncrement(filename, clean_lines, linenum, error): """Checks for invalid increment *count++. For example following function: void increment_counter(int* count) { *count++; } is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*count, (*count)++ ...
[ "def", "CheckInvalidIncrement", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "if", "_RE_PATTERN_INVALID_INCREMENT", ".", "match", "(", "line", ")", ":", "error", ...
https://github.com/jsupancic/deep_hand_pose/blob/22cbeae1a8410ff5d37c060c7315719d0a5d608f/scripts/cpp_lint.py#L1733-L1752
rbgirshick/caffe-fast-rcnn
28a579eaf0668850705598b3075b8969f22226d9
scripts/cpp_lint.py
python
ReplaceAll
(pattern, rep, s)
return _regexp_compile_cache[pattern].sub(rep, s)
Replaces instances of pattern in a string with a replacement. The compiled regex is kept in a cache shared by Match and Search. Args: pattern: regex pattern rep: replacement text s: search string Returns: string with replacements made (or original string if no replacements)
Replaces instances of pattern in a string with a replacement.
[ "Replaces", "instances", "of", "pattern", "in", "a", "string", "with", "a", "replacement", "." ]
def ReplaceAll(pattern, rep, s): """Replaces instances of pattern in a string with a replacement. The compiled regex is kept in a cache shared by Match and Search. Args: pattern: regex pattern rep: replacement text s: search string Returns: string with replacements made (or original string if...
[ "def", "ReplaceAll", "(", "pattern", ",", "rep", ",", "s", ")", ":", "if", "pattern", "not", "in", "_regexp_compile_cache", ":", "_regexp_compile_cache", "[", "pattern", "]", "=", "sre_compile", ".", "compile", "(", "pattern", ")", "return", "_regexp_compile_c...
https://github.com/rbgirshick/caffe-fast-rcnn/blob/28a579eaf0668850705598b3075b8969f22226d9/scripts/cpp_lint.py#L525-L540
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/stc.py
python
StyledTextEvent.SetMargin
(*args, **kwargs)
return _stc.StyledTextEvent_SetMargin(*args, **kwargs)
SetMargin(self, int val)
SetMargin(self, int val)
[ "SetMargin", "(", "self", "int", "val", ")" ]
def SetMargin(*args, **kwargs): """SetMargin(self, int val)""" return _stc.StyledTextEvent_SetMargin(*args, **kwargs)
[ "def", "SetMargin", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextEvent_SetMargin", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L7066-L7068
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/platform.py
python
release
()
return uname()[2]
Returns the system's release, e.g. '2.2.0' or 'NT' An empty string is returned if the value cannot be determined.
Returns the system's release, e.g. '2.2.0' or 'NT'
[ "Returns", "the", "system", "s", "release", "e", ".", "g", ".", "2", ".", "2", ".", "0", "or", "NT" ]
def release(): """ Returns the system's release, e.g. '2.2.0' or 'NT' An empty string is returned if the value cannot be determined. """ return uname()[2]
[ "def", "release", "(", ")", ":", "return", "uname", "(", ")", "[", "2", "]" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/platform.py#L1322-L1329
ApolloAuto/apollo
463fb82f9e979d02dcb25044e60931293ab2dba0
modules/tools/routing/road_show.py
python
draw_arc
(arc)
:param arc: proto obj :return: none
:param arc: proto obj :return: none
[ ":", "param", "arc", ":", "proto", "obj", ":", "return", ":", "none" ]
def draw_arc(arc): """ :param arc: proto obj :return: none """ xy = (arc.center.x, arc.center.y) start = 0 end = 0 if arc.start_angle < arc.end_angle: start = arc.start_angle / math.pi * 180 end = arc.end_angle / math.pi * 180 else: end = arc.start_angle / mat...
[ "def", "draw_arc", "(", "arc", ")", ":", "xy", "=", "(", "arc", ".", "center", ".", "x", ",", "arc", ".", "center", ".", "y", ")", "start", "=", "0", "end", "=", "0", "if", "arc", ".", "start_angle", "<", "arc", ".", "end_angle", ":", "start", ...
https://github.com/ApolloAuto/apollo/blob/463fb82f9e979d02dcb25044e60931293ab2dba0/modules/tools/routing/road_show.py#L45-L63
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/gyp/pylib/gyp/msvs_emulation.py
python
MsvsSettings._GetAndMunge
(self, field, path, default, prefix, append, map)
return _AppendOrReturn(append, result)
Retrieve a value from |field| at |path| or return |default|. If |append| is specified, and the item is found, it will be appended to that object instead of returned. If |map| is specified, results will be remapped through |map| before being returned or appended.
Retrieve a value from |field| at |path| or return |default|. If |append| is specified, and the item is found, it will be appended to that object instead of returned. If |map| is specified, results will be remapped through |map| before being returned or appended.
[ "Retrieve", "a", "value", "from", "|field|", "at", "|path|", "or", "return", "|default|", ".", "If", "|append|", "is", "specified", "and", "the", "item", "is", "found", "it", "will", "be", "appended", "to", "that", "object", "instead", "of", "returned", "....
def _GetAndMunge(self, field, path, default, prefix, append, map): """Retrieve a value from |field| at |path| or return |default|. If |append| is specified, and the item is found, it will be appended to that object instead of returned. If |map| is specified, results will be remapped through |map| before...
[ "def", "_GetAndMunge", "(", "self", ",", "field", ",", "path", ",", "default", ",", "prefix", ",", "append", ",", "map", ")", ":", "result", "=", "_GenericRetrieve", "(", "field", ",", "default", ",", "path", ")", "result", "=", "_DoRemapping", "(", "r...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/msvs_emulation.py#L279-L287
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/mailbox.py
python
MH.__contains__
(self, key)
return os.path.exists(os.path.join(self._path, str(key)))
Return True if the keyed message exists, False otherwise.
Return True if the keyed message exists, False otherwise.
[ "Return", "True", "if", "the", "keyed", "message", "exists", "False", "otherwise", "." ]
def __contains__(self, key): """Return True if the keyed message exists, False otherwise.""" return os.path.exists(os.path.join(self._path, str(key)))
[ "def", "__contains__", "(", "self", ",", "key", ")", ":", "return", "os", ".", "path", ".", "exists", "(", "os", ".", "path", ".", "join", "(", "self", ".", "_path", ",", "str", "(", "key", ")", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/mailbox.py#L1081-L1083
llvm-mirror/lldb
d01083a850f577b85501a0902b52fd0930de72c7
third_party/Python/module/pexpect-4.6/pexpect/screen.py
python
screen.scroll_constrain
(self)
This keeps the scroll region within the screen region.
This keeps the scroll region within the screen region.
[ "This", "keeps", "the", "scroll", "region", "within", "the", "screen", "region", "." ]
def scroll_constrain (self): '''This keeps the scroll region within the screen region.''' if self.scroll_row_start <= 0: self.scroll_row_start = 1 if self.scroll_row_end > self.rows: self.scroll_row_end = self.rows
[ "def", "scroll_constrain", "(", "self", ")", ":", "if", "self", ".", "scroll_row_start", "<=", "0", ":", "self", ".", "scroll_row_start", "=", "1", "if", "self", ".", "scroll_row_end", ">", "self", ".", "rows", ":", "self", ".", "scroll_row_end", "=", "s...
https://github.com/llvm-mirror/lldb/blob/d01083a850f577b85501a0902b52fd0930de72c7/third_party/Python/module/pexpect-4.6/pexpect/screen.py#L339-L345
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
media/webrtc/trunk/build/android/adb_logcat_printer.py
python
FindLogFiles
(base_dir)
return file_map
Search a directory for logcat files. Args: base_dir: directory to search Returns: Mapping of device_id to a sorted list of file paths for a given device
Search a directory for logcat files.
[ "Search", "a", "directory", "for", "logcat", "files", "." ]
def FindLogFiles(base_dir): """Search a directory for logcat files. Args: base_dir: directory to search Returns: Mapping of device_id to a sorted list of file paths for a given device """ logcat_filter = re.compile('^logcat_(\w+)_(\d+)$') # list of tuples (<device_id>, <seq num>, <full file path>)...
[ "def", "FindLogFiles", "(", "base_dir", ")", ":", "logcat_filter", "=", "re", ".", "compile", "(", "'^logcat_(\\w+)_(\\d+)$'", ")", "# list of tuples (<device_id>, <seq num>, <full file path>)", "filtered_list", "=", "[", "]", "for", "cur_file", "in", "os", ".", "list...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/build/android/adb_logcat_printer.py#L70-L94
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/showbase/ShowBase.py
python
ShowBase.wxRun
(self)
This method replaces `run()` after we have called `spawnWxLoop()`. Since at this point wxPython now owns the main loop, this method is a call to wxApp.MainLoop().
This method replaces `run()` after we have called `spawnWxLoop()`. Since at this point wxPython now owns the main loop, this method is a call to wxApp.MainLoop().
[ "This", "method", "replaces", "run", "()", "after", "we", "have", "called", "spawnWxLoop", "()", ".", "Since", "at", "this", "point", "wxPython", "now", "owns", "the", "main", "loop", "this", "method", "is", "a", "call", "to", "wxApp", ".", "MainLoop", "...
def wxRun(self): """ This method replaces `run()` after we have called `spawnWxLoop()`. Since at this point wxPython now owns the main loop, this method is a call to wxApp.MainLoop(). """ if Thread.getCurrentThread().getCurrentTask(): # This happens in the p3d environment du...
[ "def", "wxRun", "(", "self", ")", ":", "if", "Thread", ".", "getCurrentThread", "(", ")", ".", "getCurrentTask", "(", ")", ":", "# This happens in the p3d environment during startup.", "# Ignore it.", "return", "self", ".", "wxApp", ".", "MainLoop", "(", ")" ]
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/showbase/ShowBase.py#L3174-L3184