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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
priyankchheda/algorithms | c361aa9071573fa9966d5b02d05e524815abcf2b | binary_search_tree/lowest_common_ancestor.py | python | lowest_common_ancestor | (root, a, b) | return root | lowest common ancestor in BST | lowest common ancestor in BST | [
"lowest",
"common",
"ancestor",
"in",
"BST"
] | def lowest_common_ancestor(root, a, b):
""" lowest common ancestor in BST """
if root.data > max(a, b):
return lowest_common_ancestor(root.left, a, b)
if root.data < min(a, b):
return lowest_common_ancestor(root.right, a, b)
return root | [
"def",
"lowest_common_ancestor",
"(",
"root",
",",
"a",
",",
"b",
")",
":",
"if",
"root",
".",
"data",
">",
"max",
"(",
"a",
",",
"b",
")",
":",
"return",
"lowest_common_ancestor",
"(",
"root",
".",
"left",
",",
"a",
",",
"b",
")",
"if",
"root",
... | https://github.com/priyankchheda/algorithms/blob/c361aa9071573fa9966d5b02d05e524815abcf2b/binary_search_tree/lowest_common_ancestor.py#L35-L41 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/threading.py | python | Semaphore.acquire | (self, blocking=True, timeout=None) | return rc | Acquire a semaphore, decrementing the internal counter by one.
When invoked without arguments: if the internal counter is larger than
zero on entry, decrement it by one and return immediately. If it is zero
on entry, block, waiting until some other thread has called release() to
make it... | Acquire a semaphore, decrementing the internal counter by one. | [
"Acquire",
"a",
"semaphore",
"decrementing",
"the",
"internal",
"counter",
"by",
"one",
"."
] | def acquire(self, blocking=True, timeout=None):
"""Acquire a semaphore, decrementing the internal counter by one.
When invoked without arguments: if the internal counter is larger than
zero on entry, decrement it by one and return immediately. If it is zero
on entry, block, waiting unti... | [
"def",
"acquire",
"(",
"self",
",",
"blocking",
"=",
"True",
",",
"timeout",
"=",
"None",
")",
":",
"if",
"not",
"blocking",
"and",
"timeout",
"is",
"not",
"None",
":",
"raise",
"ValueError",
"(",
"\"can't specify timeout for non-blocking acquire\"",
")",
"rc"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/threading.py#L404-L447 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/third_party/depot_tools/cpplint.py | python | CheckForNewlineAtEOF | (filename, lines, error) | Logs an error if there is no newline char at the end of the file.
Args:
filename: The name of the current file.
lines: An array of strings, each representing a line of the file.
error: The function to call with any errors found. | Logs an error if there is no newline char at the end of the file. | [
"Logs",
"an",
"error",
"if",
"there",
"is",
"no",
"newline",
"char",
"at",
"the",
"end",
"of",
"the",
"file",
"."
] | def CheckForNewlineAtEOF(filename, lines, error):
"""Logs an error if there is no newline char at the end of the file.
Args:
filename: The name of the current file.
lines: An array of strings, each representing a line of the file.
error: The function to call with any errors found.
"""
# The array ... | [
"def",
"CheckForNewlineAtEOF",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"# The array lines() was created by adding two newlines to the",
"# original file (go figure), then splitting on \\n.",
"# To verify that the file ends in \\n, we just have to make sure the",
"# last-but-... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/third_party/depot_tools/cpplint.py#L1912-L1927 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/sorting.py | python | compress_group_index | (group_index, sort=True) | return comp_ids, obs_group_ids | Group_index is offsets into cartesian product of all possible labels. This
space can be huge, so this function compresses it, by computing offsets
(comp_ids) into the list of unique labels (obs_group_ids). | Group_index is offsets into cartesian product of all possible labels. This
space can be huge, so this function compresses it, by computing offsets
(comp_ids) into the list of unique labels (obs_group_ids). | [
"Group_index",
"is",
"offsets",
"into",
"cartesian",
"product",
"of",
"all",
"possible",
"labels",
".",
"This",
"space",
"can",
"be",
"huge",
"so",
"this",
"function",
"compresses",
"it",
"by",
"computing",
"offsets",
"(",
"comp_ids",
")",
"into",
"the",
"li... | def compress_group_index(group_index, sort=True):
"""
Group_index is offsets into cartesian product of all possible labels. This
space can be huge, so this function compresses it, by computing offsets
(comp_ids) into the list of unique labels (obs_group_ids).
"""
size_hint = min(len(group_index... | [
"def",
"compress_group_index",
"(",
"group_index",
",",
"sort",
"=",
"True",
")",
":",
"size_hint",
"=",
"min",
"(",
"len",
"(",
"group_index",
")",
",",
"hashtable",
".",
"_SIZE_HINT_LIMIT",
")",
"table",
"=",
"hashtable",
".",
"Int64HashTable",
"(",
"size_... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/sorting.py#L366-L384 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/layer/rnn_cells.py | python | _check_is_tuple | (param_name, input_data, cls_name) | Internal function, used to check whether the input data is Tensor. | Internal function, used to check whether the input data is Tensor. | [
"Internal",
"function",
"used",
"to",
"check",
"whether",
"the",
"input",
"data",
"is",
"Tensor",
"."
] | def _check_is_tuple(param_name, input_data, cls_name):
"""Internal function, used to check whether the input data is Tensor."""
if input_data is not None and not isinstance(P.typeof(input_data), mstype.Tuple):
raise TypeError(f"For '{cls_name}', the '{param_name}' should be '{mstype.Tuple}', "
... | [
"def",
"_check_is_tuple",
"(",
"param_name",
",",
"input_data",
",",
"cls_name",
")",
":",
"if",
"input_data",
"is",
"not",
"None",
"and",
"not",
"isinstance",
"(",
"P",
".",
"typeof",
"(",
"input_data",
")",
",",
"mstype",
".",
"Tuple",
")",
":",
"raise... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/layer/rnn_cells.py#L44-L48 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/bintrees/bintrees/treemixin.py | python | TreeMixin.update | (self, *args) | T.update(E) -> None. Update T from E : for (k, v) in E: T[k] = v | T.update(E) -> None. Update T from E : for (k, v) in E: T[k] = v | [
"T",
".",
"update",
"(",
"E",
")",
"-",
">",
"None",
".",
"Update",
"T",
"from",
"E",
":",
"for",
"(",
"k",
"v",
")",
"in",
"E",
":",
"T",
"[",
"k",
"]",
"=",
"v"
] | def update(self, *args):
""" T.update(E) -> None. Update T from E : for (k, v) in E: T[k] = v """
for items in args:
try:
generator = items.items()
except AttributeError:
generator = iter(items)
for key, value in generator:
... | [
"def",
"update",
"(",
"self",
",",
"*",
"args",
")",
":",
"for",
"items",
"in",
"args",
":",
"try",
":",
"generator",
"=",
"items",
".",
"items",
"(",
")",
"except",
"AttributeError",
":",
"generator",
"=",
"iter",
"(",
"items",
")",
"for",
"key",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/bintrees/bintrees/treemixin.py#L380-L389 | ||
google/skia | 82d65d0487bd72f5f7332d002429ec2dc61d2463 | tools/jsondiff.py | python | GMDiffer._GetActualResults | (self, contents) | return result_dict | Returns the dictionary of actual results from a JSON string,
in this form:
{
'test1' : 14760033689012826769,
'test2' : 9151974350149210736,
...
}
We make these simplifying assumptions:
1. All results are of type JSONKEY_HASHTYPE_BITMAP_64BITMD5.
... | Returns the dictionary of actual results from a JSON string,
in this form: | [
"Returns",
"the",
"dictionary",
"of",
"actual",
"results",
"from",
"a",
"JSON",
"string",
"in",
"this",
"form",
":"
] | def _GetActualResults(self, contents):
"""Returns the dictionary of actual results from a JSON string,
in this form:
{
'test1' : 14760033689012826769,
'test2' : 9151974350149210736,
...
}
We make these simplifying assumptions:
1. All result... | [
"def",
"_GetActualResults",
"(",
"self",
",",
"contents",
")",
":",
"result_dict",
"=",
"{",
"}",
"json_dict",
"=",
"gm_json",
".",
"LoadFromString",
"(",
"contents",
")",
"all_result_types",
"=",
"json_dict",
"[",
"gm_json",
".",
"JSONKEY_ACTUALRESULTS",
"]",
... | https://github.com/google/skia/blob/82d65d0487bd72f5f7332d002429ec2dc61d2463/tools/jsondiff.py#L106-L139 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/turtle.py | python | TNavigator.sety | (self, y) | Set the turtle's second coordinate to y
Argument:
y -- a number (integer or float)
Set the turtle's first coordinate to x, second coordinate remains
unchanged.
Example (for a Turtle instance named turtle):
>>> turtle.position()
(0.00, 40.00)
>>> turtle.... | Set the turtle's second coordinate to y | [
"Set",
"the",
"turtle",
"s",
"second",
"coordinate",
"to",
"y"
] | def sety(self, y):
"""Set the turtle's second coordinate to y
Argument:
y -- a number (integer or float)
Set the turtle's first coordinate to x, second coordinate remains
unchanged.
Example (for a Turtle instance named turtle):
>>> turtle.position()
(0.... | [
"def",
"sety",
"(",
"self",
",",
"y",
")",
":",
"self",
".",
"_goto",
"(",
"Vec2D",
"(",
"self",
".",
"_position",
"[",
"0",
"]",
",",
"y",
")",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/turtle.py#L1725-L1741 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/v8/third_party/markupsafe/__init__.py | python | _escape_argspec | (obj, iterable, escape) | return obj | Helper for various string-wrapped functions. | Helper for various string-wrapped functions. | [
"Helper",
"for",
"various",
"string",
"-",
"wrapped",
"functions",
"."
] | def _escape_argspec(obj, iterable, escape):
"""Helper for various string-wrapped functions."""
for key, value in iterable:
if hasattr(value, '__html__') or isinstance(value, string_types):
obj[key] = escape(value)
return obj | [
"def",
"_escape_argspec",
"(",
"obj",
",",
"iterable",
",",
"escape",
")",
":",
"for",
"key",
",",
"value",
"in",
"iterable",
":",
"if",
"hasattr",
"(",
"value",
",",
"'__html__'",
")",
"or",
"isinstance",
"(",
"value",
",",
"string_types",
")",
":",
"... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/third_party/markupsafe/__init__.py#L203-L208 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Window.SetMinSize | (*args, **kwargs) | return _core_.Window_SetMinSize(*args, **kwargs) | SetMinSize(self, Size minSize)
A more convenient method than `SetSizeHints` for setting just the
min size. | SetMinSize(self, Size minSize) | [
"SetMinSize",
"(",
"self",
"Size",
"minSize",
")"
] | def SetMinSize(*args, **kwargs):
"""
SetMinSize(self, Size minSize)
A more convenient method than `SetSizeHints` for setting just the
min size.
"""
return _core_.Window_SetMinSize(*args, **kwargs) | [
"def",
"SetMinSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_SetMinSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L9754-L9761 | |
google/tink | 59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14 | python/tink/streaming_aead/_streaming_aead.py | python | StreamingAead.new_decrypting_stream | (self, ciphertext_source: BinaryIO,
associated_data: bytes) | Returns a decrypting stream that reads from ciphertext_source.
The returned stream implements a readable but not seekable io.BufferedIOBase
interface. It only accepts binary data. For text, it needs to be wrapped
with io.TextIOWrapper.
The cipertext_source's read() method is expected to return an empt... | Returns a decrypting stream that reads from ciphertext_source. | [
"Returns",
"a",
"decrypting",
"stream",
"that",
"reads",
"from",
"ciphertext_source",
"."
] | def new_decrypting_stream(self, ciphertext_source: BinaryIO,
associated_data: bytes) -> BinaryIO:
"""Returns a decrypting stream that reads from ciphertext_source.
The returned stream implements a readable but not seekable io.BufferedIOBase
interface. It only accepts binary data... | [
"def",
"new_decrypting_stream",
"(",
"self",
",",
"ciphertext_source",
":",
"BinaryIO",
",",
"associated_data",
":",
"bytes",
")",
"->",
"BinaryIO",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/google/tink/blob/59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14/python/tink/streaming_aead/_streaming_aead.py#L70-L100 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/util.py | python | FileOperator.copy_file | (self, infile, outfile, check=True) | Copy a file respecting dry-run and force flags. | Copy a file respecting dry-run and force flags. | [
"Copy",
"a",
"file",
"respecting",
"dry",
"-",
"run",
"and",
"force",
"flags",
"."
] | def copy_file(self, infile, outfile, check=True):
"""Copy a file respecting dry-run and force flags.
"""
self.ensure_dir(os.path.dirname(outfile))
logger.info('Copying %s to %s', infile, outfile)
if not self.dry_run:
msg = None
if check:
if... | [
"def",
"copy_file",
"(",
"self",
",",
"infile",
",",
"outfile",
",",
"check",
"=",
"True",
")",
":",
"self",
".",
"ensure_dir",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"outfile",
")",
")",
"logger",
".",
"info",
"(",
"'Copying %s to %s'",
",",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/util.py#L513-L528 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/plugins/filebrowser/filebrowser/browser.py | python | FileBrowser2.SetMainWindow | (self, mainw) | Set the main window this browser belongs to.
@param mainw: MainWindow or None | Set the main window this browser belongs to.
@param mainw: MainWindow or None | [
"Set",
"the",
"main",
"window",
"this",
"browser",
"belongs",
"to",
".",
"@param",
"mainw",
":",
"MainWindow",
"or",
"None"
] | def SetMainWindow(self, mainw):
"""Set the main window this browser belongs to.
@param mainw: MainWindow or None
"""
self._mw = mainw | [
"def",
"SetMainWindow",
"(",
"self",
",",
"mainw",
")",
":",
"self",
".",
"_mw",
"=",
"mainw"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/plugins/filebrowser/filebrowser/browser.py#L961-L966 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/configure.py | python | host_arch_win | () | return matchup.get(arch, 'ia32') | Host architecture check using environ vars (better way to do this?) | Host architecture check using environ vars (better way to do this?) | [
"Host",
"architecture",
"check",
"using",
"environ",
"vars",
"(",
"better",
"way",
"to",
"do",
"this?",
")"
] | def host_arch_win():
"""Host architecture check using environ vars (better way to do this?)"""
observed_arch = os.environ.get('PROCESSOR_ARCHITECTURE', 'x86')
arch = os.environ.get('PROCESSOR_ARCHITEW6432', observed_arch)
matchup = {
'AMD64' : 'x64',
'x86' : 'ia32',
'arm' : 'arm',
'mips... | [
"def",
"host_arch_win",
"(",
")",
":",
"observed_arch",
"=",
"os",
".",
"environ",
".",
"get",
"(",
"'PROCESSOR_ARCHITECTURE'",
",",
"'x86'",
")",
"arch",
"=",
"os",
".",
"environ",
".",
"get",
"(",
"'PROCESSOR_ARCHITEW6432'",
",",
"observed_arch",
")",
"mat... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/configure.py#L973-L986 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/lib/debug_graphs.py | python | DFSGraphTracer.__init__ | (self,
input_lists,
skip_node_names=None,
destination_node_name=None) | Constructor of _DFSGraphTracer.
Args:
input_lists: A list of dicts. Each dict is an adjacency (input) map from
the recipient node name as the key and the list of input node names
as the value.
skip_node_names: Optional: a list of node names to skip tracing.
destination_node_name: ... | Constructor of _DFSGraphTracer. | [
"Constructor",
"of",
"_DFSGraphTracer",
"."
] | def __init__(self,
input_lists,
skip_node_names=None,
destination_node_name=None):
"""Constructor of _DFSGraphTracer.
Args:
input_lists: A list of dicts. Each dict is an adjacency (input) map from
the recipient node name as the key and the list of inpu... | [
"def",
"__init__",
"(",
"self",
",",
"input_lists",
",",
"skip_node_names",
"=",
"None",
",",
"destination_node_name",
"=",
"None",
")",
":",
"self",
".",
"_input_lists",
"=",
"input_lists",
"self",
".",
"_skip_node_names",
"=",
"skip_node_names",
"self",
".",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/lib/debug_graphs.py#L149-L178 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/FilterEvents/eventFilterGUI.py | python | MainWindow.load_File | (self) | Load the file by file name or run number | Load the file by file name or run number | [
"Load",
"the",
"file",
"by",
"file",
"name",
"or",
"run",
"number"
] | def load_File(self):
""" Load the file by file name or run number
"""
# Get file name from line editor
filename = str(self.ui.lineEdit.text())
dataws = self._loadFile(str(filename))
if dataws is None:
error_msg = 'Unable to locate run {} in default directory ... | [
"def",
"load_File",
"(",
"self",
")",
":",
"# Get file name from line editor",
"filename",
"=",
"str",
"(",
"self",
".",
"ui",
".",
"lineEdit",
".",
"text",
"(",
")",
")",
"dataws",
"=",
"self",
".",
"_loadFile",
"(",
"str",
"(",
"filename",
")",
")",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/FilterEvents/eventFilterGUI.py#L587-L603 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/richtext.py | python | RichTextBuffer.ClearEventHandlers | (*args, **kwargs) | return _richtext.RichTextBuffer_ClearEventHandlers(*args, **kwargs) | ClearEventHandlers(self) | ClearEventHandlers(self) | [
"ClearEventHandlers",
"(",
"self",
")"
] | def ClearEventHandlers(*args, **kwargs):
"""ClearEventHandlers(self)"""
return _richtext.RichTextBuffer_ClearEventHandlers(*args, **kwargs) | [
"def",
"ClearEventHandlers",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextBuffer_ClearEventHandlers",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L2491-L2493 | |
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | initializeDict | () | return ret | Do the dictionary mutex initialization. this function is
not thread safe, initialization should preferably be done
once at startup | Do the dictionary mutex initialization. this function is
not thread safe, initialization should preferably be done
once at startup | [
"Do",
"the",
"dictionary",
"mutex",
"initialization",
".",
"this",
"function",
"is",
"not",
"thread",
"safe",
"initialization",
"should",
"preferably",
"be",
"done",
"once",
"at",
"startup"
] | def initializeDict():
"""Do the dictionary mutex initialization. this function is
not thread safe, initialization should preferably be done
once at startup """
ret = libxml2mod.xmlInitializeDict()
return ret | [
"def",
"initializeDict",
"(",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlInitializeDict",
"(",
")",
"return",
"ret"
] | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L1043-L1048 | |
lighttransport/nanort | 74063967336311f54ede5dffdfa242123825033b | deps/cpplint.py | python | _IncludeState.FindHeader | (self, header) | return -1 | Check if a header has already been included.
Args:
header: header to check.
Returns:
Line number of previous occurrence, or -1 if the header has not
been seen before. | Check if a header has already been included. | [
"Check",
"if",
"a",
"header",
"has",
"already",
"been",
"included",
"."
] | def FindHeader(self, header):
"""Check if a header has already been included.
Args:
header: header to check.
Returns:
Line number of previous occurrence, or -1 if the header has not
been seen before.
"""
for section_list in self.include_list:
for f in section_list:
i... | [
"def",
"FindHeader",
"(",
"self",
",",
"header",
")",
":",
"for",
"section_list",
"in",
"self",
".",
"include_list",
":",
"for",
"f",
"in",
"section_list",
":",
"if",
"f",
"[",
"0",
"]",
"==",
"header",
":",
"return",
"f",
"[",
"1",
"]",
"return",
... | https://github.com/lighttransport/nanort/blob/74063967336311f54ede5dffdfa242123825033b/deps/cpplint.py#L631-L644 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/Build.py | python | BuildContext.get_targets | (self) | return (min_grp, to_post) | Return the task generator corresponding to the 'targets' list, used by :py:meth:`waflib.Build.BuildContext.get_build_iterator`::
$ waf --targets=myprogram,myshlib | Return the task generator corresponding to the 'targets' list, used by :py:meth:`waflib.Build.BuildContext.get_build_iterator`:: | [
"Return",
"the",
"task",
"generator",
"corresponding",
"to",
"the",
"targets",
"list",
"used",
"by",
":",
"py",
":",
"meth",
":",
"waflib",
".",
"Build",
".",
"BuildContext",
".",
"get_build_iterator",
"::"
] | def get_targets(self):
"""
Return the task generator corresponding to the 'targets' list, used by :py:meth:`waflib.Build.BuildContext.get_build_iterator`::
$ waf --targets=myprogram,myshlib
"""
to_post = []
min_grp = 0
for name in self.targets.split(','):
tg = self.get_tgen_by_name(name)
if not tg... | [
"def",
"get_targets",
"(",
"self",
")",
":",
"to_post",
"=",
"[",
"]",
"min_grp",
"=",
"0",
"for",
"name",
"in",
"self",
".",
"targets",
".",
"split",
"(",
"','",
")",
":",
"tg",
"=",
"self",
".",
"get_tgen_by_name",
"(",
"name",
")",
"if",
"not",
... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Build.py#L716-L735 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/eager/context.py | python | Context.function_call_options | (self) | return self._thread_local_data.function_call_options | Returns function call options for current thread.
Note that the returned object is still referenced by the eager context.
Returns: the FunctionCallOptions for current thread. | Returns function call options for current thread. | [
"Returns",
"function",
"call",
"options",
"for",
"current",
"thread",
"."
] | def function_call_options(self):
"""Returns function call options for current thread.
Note that the returned object is still referenced by the eager context.
Returns: the FunctionCallOptions for current thread.
"""
if self._thread_local_data.function_call_options is None:
config = self.confi... | [
"def",
"function_call_options",
"(",
"self",
")",
":",
"if",
"self",
".",
"_thread_local_data",
".",
"function_call_options",
"is",
"None",
":",
"config",
"=",
"self",
".",
"config",
"# Default to soft placement for functions unless specified",
"if",
"self",
".",
"_so... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/eager/context.py#L1236-L1252 | |
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py | python | AndroidMkWriter.WriteTarget | (self, spec, configs, deps, link_deps, part_of_all,
write_alias_target) | Write Makefile code to produce the final target of the gyp spec.
spec, configs: input from gyp.
deps, link_deps: dependency lists; see ComputeDeps()
part_of_all: flag indicating this target is part of 'all'
write_alias_target: flag indicating whether to create short aliases for this
... | Write Makefile code to produce the final target of the gyp spec. | [
"Write",
"Makefile",
"code",
"to",
"produce",
"the",
"final",
"target",
"of",
"the",
"gyp",
"spec",
"."
] | def WriteTarget(self, spec, configs, deps, link_deps, part_of_all,
write_alias_target):
"""Write Makefile code to produce the final target of the gyp spec.
spec, configs: input from gyp.
deps, link_deps: dependency lists; see ComputeDeps()
part_of_all: flag indicating this target is p... | [
"def",
"WriteTarget",
"(",
"self",
",",
"spec",
",",
"configs",
",",
"deps",
",",
"link_deps",
",",
"part_of_all",
",",
"write_alias_target",
")",
":",
"self",
".",
"WriteLn",
"(",
"'### Rules for final target.'",
")",
"if",
"self",
".",
"type",
"!=",
"'none... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py#L822-L898 | ||
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/oldnumeric/ma.py | python | MAError.__init__ | (self, args=None) | Create an exception | Create an exception | [
"Create",
"an",
"exception"
] | def __init__ (self, args=None):
"Create an exception"
# The .args attribute must be a tuple.
if not isinstance(args, tuple):
args = (args,)
self.args = args | [
"def",
"__init__",
"(",
"self",
",",
"args",
"=",
"None",
")",
":",
"# The .args attribute must be a tuple.",
"if",
"not",
"isinstance",
"(",
"args",
",",
"tuple",
")",
":",
"args",
"=",
"(",
"args",
",",
")",
"self",
".",
"args",
"=",
"args"
] | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/oldnumeric/ma.py#L34-L40 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | mojo/public/bindings/pylib/parse/mojo_parser.py | python | Parser.p_unary_expression | (self, p) | unary_expression : primary_expression
| unary_operator expression | unary_expression : primary_expression
| unary_operator expression | [
"unary_expression",
":",
"primary_expression",
"|",
"unary_operator",
"expression"
] | def p_unary_expression(self, p):
"""unary_expression : primary_expression
| unary_operator expression"""
p[0] = ListFromConcat(*p[1:]) | [
"def",
"p_unary_expression",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"ListFromConcat",
"(",
"*",
"p",
"[",
"1",
":",
"]",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/mojo/public/bindings/pylib/parse/mojo_parser.py#L285-L288 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | AnyButton.ShowsLabel | (*args, **kwargs) | return _controls_.AnyButton_ShowsLabel(*args, **kwargs) | ShowsLabel(self) -> bool | ShowsLabel(self) -> bool | [
"ShowsLabel",
"(",
"self",
")",
"-",
">",
"bool"
] | def ShowsLabel(*args, **kwargs):
"""ShowsLabel(self) -> bool"""
return _controls_.AnyButton_ShowsLabel(*args, **kwargs) | [
"def",
"ShowsLabel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"AnyButton_ShowsLabel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L163-L165 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANSILLReduction.py | python | SANSILLReduction._check_wavelengths_match | (ws1, ws2) | Checks if the wavelength difference between the data is close enough
@param ws1 : workspace 1
@param ws2 : workspace 2 | Checks if the wavelength difference between the data is close enough | [
"Checks",
"if",
"the",
"wavelength",
"difference",
"between",
"the",
"data",
"is",
"close",
"enough"
] | def _check_wavelengths_match(ws1, ws2):
"""
Checks if the wavelength difference between the data is close enough
@param ws1 : workspace 1
@param ws2 : workspace 2
"""
tolerance = 0.01 # A
wavelength_1 = ws1.getRun().getLogData('wavelength').value
... | [
"def",
"_check_wavelengths_match",
"(",
"ws1",
",",
"ws2",
")",
":",
"tolerance",
"=",
"0.01",
"# A",
"wavelength_1",
"=",
"ws1",
".",
"getRun",
"(",
")",
".",
"getLogData",
"(",
"'wavelength'",
")",
".",
"value",
"wavelength_2",
"=",
"ws2",
".",
"getRun",... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANSILLReduction.py#L66-L79 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/inline_closurecall.py | python | InlineClosureCallPass._fix_stencil_neighborhood | (self, options) | return True | Extract the two-level tuple representing the stencil neighborhood
from the program IR to provide a tuple to StencilFunc. | Extract the two-level tuple representing the stencil neighborhood
from the program IR to provide a tuple to StencilFunc. | [
"Extract",
"the",
"two",
"-",
"level",
"tuple",
"representing",
"the",
"stencil",
"neighborhood",
"from",
"the",
"program",
"IR",
"to",
"provide",
"a",
"tuple",
"to",
"StencilFunc",
"."
] | def _fix_stencil_neighborhood(self, options):
"""
Extract the two-level tuple representing the stencil neighborhood
from the program IR to provide a tuple to StencilFunc.
"""
# build_tuple node with neighborhood for each dimension
dims_build_tuple = get_definition(self.fu... | [
"def",
"_fix_stencil_neighborhood",
"(",
"self",
",",
"options",
")",
":",
"# build_tuple node with neighborhood for each dimension",
"dims_build_tuple",
"=",
"get_definition",
"(",
"self",
".",
"func_ir",
",",
"options",
"[",
"'neighborhood'",
"]",
")",
"require",
"(",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/inline_closurecall.py#L202-L216 | |
FlightGear/flightgear | cf4801e11c5b69b107f87191584eefda3c5a9b26 | scripts/python/TerraSync/terrasync/main.py | python | HTTPGetCallback.__init__ | (self, src, callback) | Initialize an HTTPGetCallback instance.
src -- a VirtualPath instance (corresponding to the path on
the server for which a GET request is to be issued)
callback -- a function taking two parameters: the URL (string)
and an http.client.HTTPResponse instance. W... | Initialize an HTTPGetCallback instance. | [
"Initialize",
"an",
"HTTPGetCallback",
"instance",
"."
] | def __init__(self, src, callback):
"""Initialize an HTTPGetCallback instance.
src -- a VirtualPath instance (corresponding to the path on
the server for which a GET request is to be issued)
callback -- a function taking two parameters: the URL (string)
... | [
"def",
"__init__",
"(",
"self",
",",
"src",
",",
"callback",
")",
":",
"if",
"callback",
"is",
"not",
"None",
":",
"self",
".",
"callback",
"=",
"callback",
"self",
".",
"src",
"=",
"src"
] | https://github.com/FlightGear/flightgear/blob/cf4801e11c5b69b107f87191584eefda3c5a9b26/scripts/python/TerraSync/terrasync/main.py#L114-L127 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/shutil.py | python | copyfile | (src, dst, *, follow_symlinks=True) | return dst | Copy data from src to dst.
If follow_symlinks is not set and src is a symbolic link, a new
symlink will be created instead of copying the file it points to. | Copy data from src to dst. | [
"Copy",
"data",
"from",
"src",
"to",
"dst",
"."
] | def copyfile(src, dst, *, follow_symlinks=True):
"""Copy data from src to dst.
If follow_symlinks is not set and src is a symbolic link, a new
symlink will be created instead of copying the file it points to.
"""
if _samefile(src, dst):
raise SameFileError("{!r} and {!r} are the same file"... | [
"def",
"copyfile",
"(",
"src",
",",
"dst",
",",
"*",
",",
"follow_symlinks",
"=",
"True",
")",
":",
"if",
"_samefile",
"(",
"src",
",",
"dst",
")",
":",
"raise",
"SameFileError",
"(",
"\"{!r} and {!r} are the same file\"",
".",
"format",
"(",
"src",
",",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/shutil.py#L96-L123 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/map_fn.py | python | _result_flat_signature_to_batchable_tensor_spec | (result_flat_signature) | return tensor_specs | Converts result_flat_signature -> result_batchable_tensor_specs. | Converts result_flat_signature -> result_batchable_tensor_specs. | [
"Converts",
"result_flat_signature",
"-",
">",
"result_batchable_tensor_specs",
"."
] | def _result_flat_signature_to_batchable_tensor_spec(result_flat_signature):
"""Converts result_flat_signature -> result_batchable_tensor_specs."""
tensor_specs = []
for spec in result_flat_signature:
if not isinstance(spec, type_spec.BatchableTypeSpec):
raise TypeError("map_fn can not generate %s output... | [
"def",
"_result_flat_signature_to_batchable_tensor_spec",
"(",
"result_flat_signature",
")",
":",
"tensor_specs",
"=",
"[",
"]",
"for",
"spec",
"in",
"result_flat_signature",
":",
"if",
"not",
"isinstance",
"(",
"spec",
",",
"type_spec",
".",
"BatchableTypeSpec",
")",... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/map_fn.py#L543-L550 | |
infinit/elle | a8154593c42743f45b9df09daf62b44630c24a02 | drake/src/drake/utils.py | python | camel_case | (s) | return re_map(lambda s: s[1].capitalize(),
re.compile('[-_][a-zA-Z]'), s) | Convert the given indentifier to camel case.
Converts dashes or underscore separated identifiers to camel case.
>>> camel_case('foo')
'foo'
>>> camel_case('foo-bar')
'fooBar'
>>> camel_case('foo_bar_baz_quux')
'fooBarBazQuux' | Convert the given indentifier to camel case. | [
"Convert",
"the",
"given",
"indentifier",
"to",
"camel",
"case",
"."
] | def camel_case(s):
"""Convert the given indentifier to camel case.
Converts dashes or underscore separated identifiers to camel case.
>>> camel_case('foo')
'foo'
>>> camel_case('foo-bar')
'fooBar'
>>> camel_case('foo_bar_baz_quux')
'fooBarBazQuux'
"""
return re_map(lambda s: s[1].capitalize(),
... | [
"def",
"camel_case",
"(",
"s",
")",
":",
"return",
"re_map",
"(",
"lambda",
"s",
":",
"s",
"[",
"1",
"]",
".",
"capitalize",
"(",
")",
",",
"re",
".",
"compile",
"(",
"'[-_][a-zA-Z]'",
")",
",",
"s",
")"
] | https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/utils.py#L28-L41 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/io/pytables.py | python | Table.process_axes | (self, obj, selection: Selection, columns=None) | return obj | process axes filters | process axes filters | [
"process",
"axes",
"filters"
] | def process_axes(self, obj, selection: Selection, columns=None):
"""process axes filters"""
# make a copy to avoid side effects
if columns is not None:
columns = list(columns)
# make sure to include levels if we have them
if columns is not None and self.is_multi_inde... | [
"def",
"process_axes",
"(",
"self",
",",
"obj",
",",
"selection",
":",
"Selection",
",",
"columns",
"=",
"None",
")",
":",
"# make a copy to avoid side effects",
"if",
"columns",
"is",
"not",
"None",
":",
"columns",
"=",
"list",
"(",
"columns",
")",
"# make ... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/pytables.py#L4079-L4135 | |
yrnkrn/zapcc | c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50 | tools/clang/bindings/python/clang/cindex.py | python | Type.is_restrict_qualified | (self) | return conf.lib.clang_isRestrictQualifiedType(self) | Determine whether a Type has the "restrict" qualifier set.
This does not look through typedefs that may have added "restrict" at
a different level. | Determine whether a Type has the "restrict" qualifier set. | [
"Determine",
"whether",
"a",
"Type",
"has",
"the",
"restrict",
"qualifier",
"set",
"."
] | def is_restrict_qualified(self):
"""Determine whether a Type has the "restrict" qualifier set.
This does not look through typedefs that may have added "restrict" at
a different level.
"""
return conf.lib.clang_isRestrictQualifiedType(self) | [
"def",
"is_restrict_qualified",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_isRestrictQualifiedType",
"(",
"self",
")"
] | https://github.com/yrnkrn/zapcc/blob/c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50/tools/clang/bindings/python/clang/cindex.py#L2279-L2285 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/linalg/_solvers.py | python | solve_continuous_lyapunov | (a, q) | return u.dot(y).dot(u.conj().T) | Solves the continuous Lyapunov equation :math:`AX + XA^H = Q`.
Uses the Bartels-Stewart algorithm to find :math:`X`.
Parameters
----------
a : array_like
A square matrix
q : array_like
Right-hand side square matrix
Returns
-------
x : ndarray
Solution to the c... | Solves the continuous Lyapunov equation :math:`AX + XA^H = Q`. | [
"Solves",
"the",
"continuous",
"Lyapunov",
"equation",
":",
"math",
":",
"AX",
"+",
"XA^H",
"=",
"Q",
"."
] | def solve_continuous_lyapunov(a, q):
"""
Solves the continuous Lyapunov equation :math:`AX + XA^H = Q`.
Uses the Bartels-Stewart algorithm to find :math:`X`.
Parameters
----------
a : array_like
A square matrix
q : array_like
Right-hand side square matrix
Returns
... | [
"def",
"solve_continuous_lyapunov",
"(",
"a",
",",
"q",
")",
":",
"a",
"=",
"np",
".",
"atleast_2d",
"(",
"_asarray_validated",
"(",
"a",
",",
"check_finite",
"=",
"True",
")",
")",
"q",
"=",
"np",
".",
"atleast_2d",
"(",
"_asarray_validated",
"(",
"q",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/linalg/_solvers.py#L110-L199 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/factorization/python/ops/factorization_ops.py | python | WALSModel._shard_sizes | (cls, dims, num_shards) | return [shard_size + 1] * residual + [shard_size] * (num_shards - residual) | Helper function to split dims values into num_shards. | Helper function to split dims values into num_shards. | [
"Helper",
"function",
"to",
"split",
"dims",
"values",
"into",
"num_shards",
"."
] | def _shard_sizes(cls, dims, num_shards):
"""Helper function to split dims values into num_shards."""
shard_size, residual = divmod(dims, num_shards)
return [shard_size + 1] * residual + [shard_size] * (num_shards - residual) | [
"def",
"_shard_sizes",
"(",
"cls",
",",
"dims",
",",
"num_shards",
")",
":",
"shard_size",
",",
"residual",
"=",
"divmod",
"(",
"dims",
",",
"num_shards",
")",
"return",
"[",
"shard_size",
"+",
"1",
"]",
"*",
"residual",
"+",
"[",
"shard_size",
"]",
"*... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/factorization/python/ops/factorization_ops.py#L274-L277 | |
s9xie/hed | 94fb22f10cbfec8d84fbc0642b224022014b6bd6 | python/caffe/io.py | python | array_to_datum | (arr, label=0) | return datum | Converts a 3-dimensional array to datum. If the array has dtype uint8,
the output data will be encoded as a string. Otherwise, the output data
will be stored in float format. | Converts a 3-dimensional array to datum. If the array has dtype uint8,
the output data will be encoded as a string. Otherwise, the output data
will be stored in float format. | [
"Converts",
"a",
"3",
"-",
"dimensional",
"array",
"to",
"datum",
".",
"If",
"the",
"array",
"has",
"dtype",
"uint8",
"the",
"output",
"data",
"will",
"be",
"encoded",
"as",
"a",
"string",
".",
"Otherwise",
"the",
"output",
"data",
"will",
"be",
"stored"... | def array_to_datum(arr, label=0):
"""Converts a 3-dimensional array to datum. If the array has dtype uint8,
the output data will be encoded as a string. Otherwise, the output data
will be stored in float format.
"""
if arr.ndim != 3:
raise ValueError('Incorrect array shape.')
datum = caf... | [
"def",
"array_to_datum",
"(",
"arr",
",",
"label",
"=",
"0",
")",
":",
"if",
"arr",
".",
"ndim",
"!=",
"3",
":",
"raise",
"ValueError",
"(",
"'Incorrect array shape.'",
")",
"datum",
"=",
"caffe_pb2",
".",
"Datum",
"(",
")",
"datum",
".",
"channels",
"... | https://github.com/s9xie/hed/blob/94fb22f10cbfec8d84fbc0642b224022014b6bd6/python/caffe/io.py#L63-L77 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/groupby/groupby.py | python | GroupBy.tail | (self, n=5) | return self._selected_obj[mask] | Return last n rows of each group.
Similar to ``.apply(lambda x: x.tail(n))``, but it returns a subset of rows
from the original DataFrame with original index and order preserved
(``as_index`` flag is ignored).
Does not work for negative values of `n`.
Returns
-------
... | Return last n rows of each group. | [
"Return",
"last",
"n",
"rows",
"of",
"each",
"group",
"."
] | def tail(self, n=5):
"""
Return last n rows of each group.
Similar to ``.apply(lambda x: x.tail(n))``, but it returns a subset of rows
from the original DataFrame with original index and order preserved
(``as_index`` flag is ignored).
Does not work for negative values o... | [
"def",
"tail",
"(",
"self",
",",
"n",
"=",
"5",
")",
":",
"self",
".",
"_reset_group_selection",
"(",
")",
"mask",
"=",
"self",
".",
"_cumcount_array",
"(",
"ascending",
"=",
"False",
")",
"<",
"n",
"return",
"self",
".",
"_selected_obj",
"[",
"mask",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/groupby/groupby.py#L2405-L2435 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2class.py | python | nanoFTPProxy | (host, port, user, passwd, type) | Setup the FTP proxy informations. This can also be done by
using ftp_proxy ftp_proxy_user and ftp_proxy_password
environment variables. | Setup the FTP proxy informations. This can also be done by
using ftp_proxy ftp_proxy_user and ftp_proxy_password
environment variables. | [
"Setup",
"the",
"FTP",
"proxy",
"informations",
".",
"This",
"can",
"also",
"be",
"done",
"by",
"using",
"ftp_proxy",
"ftp_proxy_user",
"and",
"ftp_proxy_password",
"environment",
"variables",
"."
] | def nanoFTPProxy(host, port, user, passwd, type):
"""Setup the FTP proxy informations. This can also be done by
using ftp_proxy ftp_proxy_user and ftp_proxy_password
environment variables. """
libxml2mod.xmlNanoFTPProxy(host, port, user, passwd, type) | [
"def",
"nanoFTPProxy",
"(",
"host",
",",
"port",
",",
"user",
",",
"passwd",
",",
"type",
")",
":",
"libxml2mod",
".",
"xmlNanoFTPProxy",
"(",
"host",
",",
"port",
",",
"user",
",",
"passwd",
",",
"type",
")"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L446-L450 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/dataset/uci_housing.py | python | test | () | return reader | UCI_HOUSING test set creator.
It returns a reader creator, each sample in the reader is features after
normalization and price number.
:return: Test reader creator
:rtype: callable | UCI_HOUSING test set creator. | [
"UCI_HOUSING",
"test",
"set",
"creator",
"."
] | def test():
"""
UCI_HOUSING test set creator.
It returns a reader creator, each sample in the reader is features after
normalization and price number.
:return: Test reader creator
:rtype: callable
"""
global UCI_TEST_DATA
load_data(paddle.dataset.common.download(URL, 'uci_housing',... | [
"def",
"test",
"(",
")",
":",
"global",
"UCI_TEST_DATA",
"load_data",
"(",
"paddle",
".",
"dataset",
".",
"common",
".",
"download",
"(",
"URL",
",",
"'uci_housing'",
",",
"MD5",
")",
")",
"def",
"reader",
"(",
")",
":",
"for",
"d",
"in",
"UCI_TEST_DAT... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/dataset/uci_housing.py#L117-L134 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/plot_widget/plotting_canvas/plotting_canvas_presenter.py | python | PlottingCanvasPresenter.replot_workspace_with_error_state | (self, workspace_name, error_state) | Replot a workspace in the plot with a different error_state | Replot a workspace in the plot with a different error_state | [
"Replot",
"a",
"workspace",
"in",
"the",
"plot",
"with",
"a",
"different",
"error_state"
] | def replot_workspace_with_error_state(self, workspace_name, error_state):
"""Replot a workspace in the plot with a different error_state"""
self._view.replot_workspace_with_error_state(workspace_name, error_state) | [
"def",
"replot_workspace_with_error_state",
"(",
"self",
",",
"workspace_name",
",",
"error_state",
")",
":",
"self",
".",
"_view",
".",
"replot_workspace_with_error_state",
"(",
"workspace_name",
",",
"error_state",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/plot_widget/plotting_canvas/plotting_canvas_presenter.py#L54-L56 | ||
bigartm/bigartm | 47e37f982de87aa67bfd475ff1f39da696b181b3 | python/artm/score_tracker.py | python | PerplexityScoreTracker.__init__ | (self, score) | :Properties:
* Note: every field is a list of info about score on all synchronizations.
* value - values of perplexity.
* raw - raw values in formula for perplexity (in case of one class id).
* normalizer - normalizer values in formula for perplexity (in case of one class id).
*... | :Properties:
* Note: every field is a list of info about score on all synchronizations.
* value - values of perplexity.
* raw - raw values in formula for perplexity (in case of one class id).
* normalizer - normalizer values in formula for perplexity (in case of one class id).
*... | [
":",
"Properties",
":",
"*",
"Note",
":",
"every",
"field",
"is",
"a",
"list",
"of",
"info",
"about",
"score",
"on",
"all",
"synchronizations",
".",
"*",
"value",
"-",
"values",
"of",
"perplexity",
".",
"*",
"raw",
"-",
"raw",
"values",
"in",
"formula"... | def __init__(self, score):
"""
:Properties:
* Note: every field is a list of info about score on all synchronizations.
* value - values of perplexity.
* raw - raw values in formula for perplexity (in case of one class id).
* normalizer - normalizer values in formula for p... | [
"def",
"__init__",
"(",
"self",
",",
"score",
")",
":",
"BaseScoreTracker",
".",
"__init__",
"(",
"self",
",",
"score",
")"
] | https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/python/artm/score_tracker.py#L133-L149 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/learn/python/learn/monitors.py | python | ValidationMonitor.__init__ | (self, x=None, y=None, input_fn=None, batch_size=None,
eval_steps=None,
every_n_steps=100, metrics=None, hooks=None,
early_stopping_rounds=None,
early_stopping_metric="loss",
early_stopping_metric_minimize=True, name=None) | Initializes a ValidationMonitor.
Args:
x: See `BaseEstimator.evaluate`.
y: See `BaseEstimator.evaluate`.
input_fn: See `BaseEstimator.evaluate`.
batch_size: See `BaseEstimator.evaluate`.
eval_steps: See `BaseEstimator.evaluate`.
every_n_steps: Check for new checkpoints to evalua... | Initializes a ValidationMonitor. | [
"Initializes",
"a",
"ValidationMonitor",
"."
] | def __init__(self, x=None, y=None, input_fn=None, batch_size=None,
eval_steps=None,
every_n_steps=100, metrics=None, hooks=None,
early_stopping_rounds=None,
early_stopping_metric="loss",
early_stopping_metric_minimize=True, name=None):
"""In... | [
"def",
"__init__",
"(",
"self",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"input_fn",
"=",
"None",
",",
"batch_size",
"=",
"None",
",",
"eval_steps",
"=",
"None",
",",
"every_n_steps",
"=",
"100",
",",
"metrics",
"=",
"None",
",",
"hooks",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/learn/python/learn/monitors.py#L564-L621 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/mozbuild/mozpack/packager/__init__.py | python | SimplePackager.close | (self) | Push all instructions to the formatter. | Push all instructions to the formatter. | [
"Push",
"all",
"instructions",
"to",
"the",
"formatter",
"."
] | def close(self):
'''
Push all instructions to the formatter.
'''
self._closed = True
for base in self.get_bases():
if base:
self.formatter.add_base(base)
self._chrome_queue.execute()
self._queue.execute()
self._file_queue.execut... | [
"def",
"close",
"(",
"self",
")",
":",
"self",
".",
"_closed",
"=",
"True",
"for",
"base",
"in",
"self",
".",
"get_bases",
"(",
")",
":",
"if",
"base",
":",
"self",
".",
"formatter",
".",
"add_base",
"(",
"base",
")",
"self",
".",
"_chrome_queue",
... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozpack/packager/__init__.py#L289-L299 | ||
apache/kudu | 90895ce76590f10730ad7aac3613b69d89ff5422 | src/kudu/scripts/backup-perf.py | python | create_table | (opts, stats) | Create a Kudu table via impala-shell | Create a Kudu table via impala-shell | [
"Create",
"a",
"Kudu",
"table",
"via",
"impala",
"-",
"shell"
] | def create_table(opts, stats):
""" Create a Kudu table via impala-shell """
print("--------------------------------------")
print("Creating table %s" % (opts.table_name,))
print("--------------------------------------")
print(timestamp())
create_table_ddl = "CREATE TABLE %s (" % (opts.table_name,)
num_big... | [
"def",
"create_table",
"(",
"opts",
",",
"stats",
")",
":",
"print",
"(",
"\"--------------------------------------\"",
")",
"print",
"(",
"\"Creating table %s\"",
"%",
"(",
"opts",
".",
"table_name",
",",
")",
")",
"print",
"(",
"\"---------------------------------... | https://github.com/apache/kudu/blob/90895ce76590f10730ad7aac3613b69d89ff5422/src/kudu/scripts/backup-perf.py#L110-L131 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/sipconfig.py | python | _Macro.remove | (self, value) | Remove a value from the macro. It doesn't matter if the value
wasn't present.
value is the value to remove. | Remove a value from the macro. It doesn't matter if the value
wasn't present.
value is the value to remove. | [
"Remove",
"a",
"value",
"from",
"the",
"macro",
".",
"It",
"doesn",
"t",
"matter",
"if",
"the",
"value",
"wasn",
"t",
"present",
".",
"value",
"is",
"the",
"value",
"to",
"remove",
"."
] | def remove(self, value):
"""Remove a value from the macro. It doesn't matter if the value
wasn't present.
value is the value to remove.
"""
try:
self._macro.remove(value)
except:
pass | [
"def",
"remove",
"(",
"self",
",",
"value",
")",
":",
"try",
":",
"self",
".",
"_macro",
".",
"remove",
"(",
"value",
")",
"except",
":",
"pass"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/sipconfig.py#L293-L302 | ||
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPMS_ENC_SCHEME_OAEP.fromBytes | (buffer) | return TpmBuffer(buffer).createObj(TPMS_ENC_SCHEME_OAEP) | Returns new TPMS_ENC_SCHEME_OAEP object constructed from its
marshaled representation in the given byte buffer | Returns new TPMS_ENC_SCHEME_OAEP object constructed from its
marshaled representation in the given byte buffer | [
"Returns",
"new",
"TPMS_ENC_SCHEME_OAEP",
"object",
"constructed",
"from",
"its",
"marshaled",
"representation",
"in",
"the",
"given",
"byte",
"buffer"
] | def fromBytes(buffer):
""" Returns new TPMS_ENC_SCHEME_OAEP object constructed from its
marshaled representation in the given byte buffer
"""
return TpmBuffer(buffer).createObj(TPMS_ENC_SCHEME_OAEP) | [
"def",
"fromBytes",
"(",
"buffer",
")",
":",
"return",
"TpmBuffer",
"(",
"buffer",
")",
".",
"createObj",
"(",
"TPMS_ENC_SCHEME_OAEP",
")"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L6679-L6683 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/pgen2/driver.py | python | Driver.parse_stream | (self, stream, debug=False) | return self.parse_stream_raw(stream, debug) | Parse a stream and return the syntax tree. | Parse a stream and return the syntax tree. | [
"Parse",
"a",
"stream",
"and",
"return",
"the",
"syntax",
"tree",
"."
] | def parse_stream(self, stream, debug=False):
"""Parse a stream and return the syntax tree."""
return self.parse_stream_raw(stream, debug) | [
"def",
"parse_stream",
"(",
"self",
",",
"stream",
",",
"debug",
"=",
"False",
")",
":",
"return",
"self",
".",
"parse_stream_raw",
"(",
"stream",
",",
"debug",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/pgen2/driver.py#L92-L94 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/email/mime/base.py | python | MIMEBase.__init__ | (self, _maintype, _subtype, *, policy=None, **_params) | This constructor adds a Content-Type: and a MIME-Version: header.
The Content-Type: header is taken from the _maintype and _subtype
arguments. Additional parameters for this header are taken from the
keyword arguments. | This constructor adds a Content-Type: and a MIME-Version: header. | [
"This",
"constructor",
"adds",
"a",
"Content",
"-",
"Type",
":",
"and",
"a",
"MIME",
"-",
"Version",
":",
"header",
"."
] | def __init__(self, _maintype, _subtype, *, policy=None, **_params):
"""This constructor adds a Content-Type: and a MIME-Version: header.
The Content-Type: header is taken from the _maintype and _subtype
arguments. Additional parameters for this header are taken from the
keyword argumen... | [
"def",
"__init__",
"(",
"self",
",",
"_maintype",
",",
"_subtype",
",",
"*",
",",
"policy",
"=",
"None",
",",
"*",
"*",
"_params",
")",
":",
"if",
"policy",
"is",
"None",
":",
"policy",
"=",
"email",
".",
"policy",
".",
"compat32",
"message",
".",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/email/mime/base.py#L18-L30 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | Locale.GetLanguageInfo | (*args, **kwargs) | return _gdi_.Locale_GetLanguageInfo(*args, **kwargs) | GetLanguageInfo(int lang) -> LanguageInfo | GetLanguageInfo(int lang) -> LanguageInfo | [
"GetLanguageInfo",
"(",
"int",
"lang",
")",
"-",
">",
"LanguageInfo"
] | def GetLanguageInfo(*args, **kwargs):
"""GetLanguageInfo(int lang) -> LanguageInfo"""
return _gdi_.Locale_GetLanguageInfo(*args, **kwargs) | [
"def",
"GetLanguageInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Locale_GetLanguageInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L3055-L3057 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/shelve.py | python | open | (filename, flag='c', protocol=None, writeback=False) | return DbfilenameShelf(filename, flag, protocol, writeback) | Open a persistent dictionary for reading and writing.
The filename parameter is the base filename for the underlying
database. As a side-effect, an extension may be added to the
filename and more than one file may be created. The optional flag
parameter has the same interpretation as the flag paramet... | Open a persistent dictionary for reading and writing. | [
"Open",
"a",
"persistent",
"dictionary",
"for",
"reading",
"and",
"writing",
"."
] | def open(filename, flag='c', protocol=None, writeback=False):
"""Open a persistent dictionary for reading and writing.
The filename parameter is the base filename for the underlying
database. As a side-effect, an extension may be added to the
filename and more than one file may be created. The option... | [
"def",
"open",
"(",
"filename",
",",
"flag",
"=",
"'c'",
",",
"protocol",
"=",
"None",
",",
"writeback",
"=",
"False",
")",
":",
"return",
"DbfilenameShelf",
"(",
"filename",
",",
"flag",
",",
"protocol",
",",
"writeback",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/shelve.py#L226-L239 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py | python | GenerateOutput | (target_list, target_dicts, data, params) | Generate an XML settings file that can be imported into a CDT project. | Generate an XML settings file that can be imported into a CDT project. | [
"Generate",
"an",
"XML",
"settings",
"file",
"that",
"can",
"be",
"imported",
"into",
"a",
"CDT",
"project",
"."
] | def GenerateOutput(target_list, target_dicts, data, params):
"""Generate an XML settings file that can be imported into a CDT project."""
if params["options"].generator_output:
raise NotImplementedError("--generator_output not implemented for eclipse")
user_config = params.get("generator_flags", {... | [
"def",
"GenerateOutput",
"(",
"target_list",
",",
"target_dicts",
",",
"data",
",",
"params",
")",
":",
"if",
"params",
"[",
"\"options\"",
"]",
".",
"generator_output",
":",
"raise",
"NotImplementedError",
"(",
"\"--generator_output not implemented for eclipse\"",
")... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py#L450-L464 | ||
PaddlePaddle/Anakin | 5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730 | tools/external_converter_v2/parser/tensorflow/parse_med_2_ak.py | python | MedTransAK.Pad | (self, med_attr, param) | fill Pad param in ak graph
:param med_attr:
:param param:
:return: | fill Pad param in ak graph
:param med_attr:
:param param:
:return: | [
"fill",
"Pad",
"param",
"in",
"ak",
"graph",
":",
"param",
"med_attr",
":",
":",
"param",
"param",
":",
":",
"return",
":"
] | def Pad(self, med_attr, param):
'''
fill Pad param in ak graph
:param med_attr:
:param param:
:return:
'''
param.pad_c = med_attr['pad_c']
param.pad_h = med_attr['pad_h']
param.pad_w = med_attr['pad_w'] | [
"def",
"Pad",
"(",
"self",
",",
"med_attr",
",",
"param",
")",
":",
"param",
".",
"pad_c",
"=",
"med_attr",
"[",
"'pad_c'",
"]",
"param",
".",
"pad_h",
"=",
"med_attr",
"[",
"'pad_h'",
"]",
"param",
".",
"pad_w",
"=",
"med_attr",
"[",
"'pad_w'",
"]"
... | https://github.com/PaddlePaddle/Anakin/blob/5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730/tools/external_converter_v2/parser/tensorflow/parse_med_2_ak.py#L213-L222 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/unicode.py | python | _finder | (data, substr, start, end) | return -1 | Left finder. | Left finder. | [
"Left",
"finder",
"."
] | def _finder(data, substr, start, end):
"""Left finder."""
if len(substr) == 0:
return start
for i in range(start, min(len(data), end) - len(substr) + 1):
if _cmp_region(data, i, substr, 0, len(substr)) == 0:
return i
return -1 | [
"def",
"_finder",
"(",
"data",
",",
"substr",
",",
"start",
",",
"end",
")",
":",
"if",
"len",
"(",
"substr",
")",
"==",
"0",
":",
"return",
"start",
"for",
"i",
"in",
"range",
"(",
"start",
",",
"min",
"(",
"len",
"(",
"data",
")",
",",
"end",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/unicode.py#L579-L586 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/skia/tools/copyright/main.py | python | ReadFileIntoString | (filepath) | return contents | Returns the full contents of this file as a string. | Returns the full contents of this file as a string. | [
"Returns",
"the",
"full",
"contents",
"of",
"this",
"file",
"as",
"a",
"string",
"."
] | def ReadFileIntoString(filepath):
"""Returns the full contents of this file as a string.
"""
with open(filepath, 'r') as file_handle:
contents = file_handle.read()
return contents | [
"def",
"ReadFileIntoString",
"(",
"filepath",
")",
":",
"with",
"open",
"(",
"filepath",
",",
"'r'",
")",
"as",
"file_handle",
":",
"contents",
"=",
"file_handle",
".",
"read",
"(",
")",
"return",
"contents"
] | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/skia/tools/copyright/main.py#L85-L90 | |
yyzybb537/libgo | 4af17b7c67643c4d54aa354dcc77963ea07847d0 | third_party/boost.context/tools/build/src/build/virtual_target.py | python | VirtualTarget.path | (self) | If the target is generated one, returns the path where it will be
generated. Otherwise, returns empty list. | If the target is generated one, returns the path where it will be
generated. Otherwise, returns empty list. | [
"If",
"the",
"target",
"is",
"generated",
"one",
"returns",
"the",
"path",
"where",
"it",
"will",
"be",
"generated",
".",
"Otherwise",
"returns",
"empty",
"list",
"."
] | def path (self):
""" If the target is generated one, returns the path where it will be
generated. Otherwise, returns empty list.
"""
raise BaseException ("method should be defined in derived classes") | [
"def",
"path",
"(",
"self",
")",
":",
"raise",
"BaseException",
"(",
"\"method should be defined in derived classes\"",
")"
] | https://github.com/yyzybb537/libgo/blob/4af17b7c67643c4d54aa354dcc77963ea07847d0/third_party/boost.context/tools/build/src/build/virtual_target.py#L361-L365 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/requests/requests/models.py | python | Response.apparent_encoding | (self) | return chardet.detect(self.content)['encoding'] | The apparent encoding, provided by the chardet library | The apparent encoding, provided by the chardet library | [
"The",
"apparent",
"encoding",
"provided",
"by",
"the",
"chardet",
"library"
] | def apparent_encoding(self):
"""The apparent encoding, provided by the chardet library"""
return chardet.detect(self.content)['encoding'] | [
"def",
"apparent_encoding",
"(",
"self",
")",
":",
"return",
"chardet",
".",
"detect",
"(",
"self",
".",
"content",
")",
"[",
"'encoding'",
"]"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/requests/requests/models.py#L637-L639 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/boost_1_66_0/libs/metaparse/tools/benchmark/benchmark.py | python | compiler_info | (compiler) | return compiler | Determine the name + version of the compiler | Determine the name + version of the compiler | [
"Determine",
"the",
"name",
"+",
"version",
"of",
"the",
"compiler"
] | def compiler_info(compiler):
"""Determine the name + version of the compiler"""
(out, err) = subprocess.Popen(
['/bin/sh', '-c', '{0} -v'.format(compiler)],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
).communicate('')
gcc_clang = re.compile('(g... | [
"def",
"compiler_info",
"(",
"compiler",
")",
":",
"(",
"out",
",",
"err",
")",
"=",
"subprocess",
".",
"Popen",
"(",
"[",
"'/bin/sh'",
",",
"'-c'",
",",
"'{0} -v'",
".",
"format",
"(",
"compiler",
")",
"]",
",",
"stdin",
"=",
"subprocess",
".",
"PIP... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/boost_1_66_0/libs/metaparse/tools/benchmark/benchmark.py#L76-L92 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | Pen.SetCap | (*args, **kwargs) | return _gdi_.Pen_SetCap(*args, **kwargs) | SetCap(self, int cap_style) | SetCap(self, int cap_style) | [
"SetCap",
"(",
"self",
"int",
"cap_style",
")"
] | def SetCap(*args, **kwargs):
"""SetCap(self, int cap_style)"""
return _gdi_.Pen_SetCap(*args, **kwargs) | [
"def",
"SetCap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Pen_SetCap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L425-L427 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/Tkinter.py | python | Wm.wm_overrideredirect | (self, boolean=None) | return self._getboolean(self.tk.call(
'wm', 'overrideredirect', self._w, boolean)) | Instruct the window manager to ignore this widget
if BOOLEAN is given with 1. Return the current value if None
is given. | Instruct the window manager to ignore this widget
if BOOLEAN is given with 1. Return the current value if None
is given. | [
"Instruct",
"the",
"window",
"manager",
"to",
"ignore",
"this",
"widget",
"if",
"BOOLEAN",
"is",
"given",
"with",
"1",
".",
"Return",
"the",
"current",
"value",
"if",
"None",
"is",
"given",
"."
] | def wm_overrideredirect(self, boolean=None):
"""Instruct the window manager to ignore this widget
if BOOLEAN is given with 1. Return the current value if None
is given."""
return self._getboolean(self.tk.call(
'wm', 'overrideredirect', self._w, boolean)) | [
"def",
"wm_overrideredirect",
"(",
"self",
",",
"boolean",
"=",
"None",
")",
":",
"return",
"self",
".",
"_getboolean",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"'wm'",
",",
"'overrideredirect'",
",",
"self",
".",
"_w",
",",
"boolean",
")",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L1745-L1750 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/sans/algorithm_detail/single_execution.py | python | run_initial_event_slice_reduction | (reduction_alg, reduction_setting_bundle) | return EventSliceSettingBundle(state=reduction_setting_bundle.state,
data_type=reduction_setting_bundle.data_type,
reduction_mode=reduction_setting_bundle.reduction_mode,
output_parts=reduction_setting_bundle.output... | This function runs the initial core reduction for event slice data. This is essentially half
a reduction (either sample or can), and is run before event slicing has been performed.
:param reduction_alg: a handle to the initial event slice reduction algorithm.
:param reduction_setting_bundle: a ReductionSet... | This function runs the initial core reduction for event slice data. This is essentially half
a reduction (either sample or can), and is run before event slicing has been performed. | [
"This",
"function",
"runs",
"the",
"initial",
"core",
"reduction",
"for",
"event",
"slice",
"data",
".",
"This",
"is",
"essentially",
"half",
"a",
"reduction",
"(",
"either",
"sample",
"or",
"can",
")",
"and",
"is",
"run",
"before",
"event",
"slicing",
"ha... | def run_initial_event_slice_reduction(reduction_alg, reduction_setting_bundle):
"""
This function runs the initial core reduction for event slice data. This is essentially half
a reduction (either sample or can), and is run before event slicing has been performed.
:param reduction_alg: a handle to the ... | [
"def",
"run_initial_event_slice_reduction",
"(",
"reduction_alg",
",",
"reduction_setting_bundle",
")",
":",
"# Get component to reduce",
"component",
"=",
"get_component_to_reduce",
"(",
"reduction_setting_bundle",
")",
"# Set the properties on the reduction algorithms",
"serialized... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/sans/algorithm_detail/single_execution.py#L25-L63 | |
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Node/__init__.py | python | Node.push_to_cache | (self) | Try to push a node into a cache | Try to push a node into a cache | [
"Try",
"to",
"push",
"a",
"node",
"into",
"a",
"cache"
] | def push_to_cache(self):
"""Try to push a node into a cache
"""
pass | [
"def",
"push_to_cache",
"(",
"self",
")",
":",
"pass"
] | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Node/__init__.py#L680-L683 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/fractions.py | python | Fraction.__trunc__ | (a) | trunc(a) | trunc(a) | [
"trunc",
"(",
"a",
")"
] | def __trunc__(a):
"""trunc(a)"""
if a._numerator < 0:
return -(-a._numerator // a._denominator)
else:
return a._numerator // a._denominator | [
"def",
"__trunc__",
"(",
"a",
")",
":",
"if",
"a",
".",
"_numerator",
"<",
"0",
":",
"return",
"-",
"(",
"-",
"a",
".",
"_numerator",
"//",
"a",
".",
"_denominator",
")",
"else",
":",
"return",
"a",
".",
"_numerator",
"//",
"a",
".",
"_denominator"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/fractions.py#L489-L494 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/all_reduce/python/all_reduce.py | python | _build_recursive_hd_gather | (input_tensors, devices, red_op) | return chunks | Construct the gather phase of recursive halving-doubling all-reduce.
Args:
input_tensors: list of T @{tf.Tensor} to be elementwise reduced.
devices: a list of strings naming the devices hosting input_tensors,
which will also be used to host the (partial) reduction values.
red_op: a binary elementwi... | Construct the gather phase of recursive halving-doubling all-reduce. | [
"Construct",
"the",
"gather",
"phase",
"of",
"recursive",
"halving",
"-",
"doubling",
"all",
"-",
"reduce",
"."
] | def _build_recursive_hd_gather(input_tensors, devices, red_op):
"""Construct the gather phase of recursive halving-doubling all-reduce.
Args:
input_tensors: list of T @{tf.Tensor} to be elementwise reduced.
devices: a list of strings naming the devices hosting input_tensors,
which will also be used t... | [
"def",
"_build_recursive_hd_gather",
"(",
"input_tensors",
",",
"devices",
",",
"red_op",
")",
":",
"num_devices",
"=",
"len",
"(",
"devices",
")",
"num_hops",
"=",
"int",
"(",
"math",
".",
"log",
"(",
"num_devices",
",",
"2",
")",
")",
"if",
"num_devices"... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/all_reduce/python/all_reduce.py#L474-L512 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/setuptools/pep425tags.py | python | get_impl_ver | () | return impl_ver | Return implementation version. | Return implementation version. | [
"Return",
"implementation",
"version",
"."
] | def get_impl_ver():
"""Return implementation version."""
impl_ver = get_config_var("py_version_nodot")
if not impl_ver or get_abbr_impl() == 'pp':
impl_ver = ''.join(map(str, get_impl_version_info()))
return impl_ver | [
"def",
"get_impl_ver",
"(",
")",
":",
"impl_ver",
"=",
"get_config_var",
"(",
"\"py_version_nodot\"",
")",
"if",
"not",
"impl_ver",
"or",
"get_abbr_impl",
"(",
")",
"==",
"'pp'",
":",
"impl_ver",
"=",
"''",
".",
"join",
"(",
"map",
"(",
"str",
",",
"get_... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/setuptools/pep425tags.py#L43-L48 | |
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/expressions/constants/parameter.py | python | is_param_free | (expr) | return not expr.parameters() | Returns true if expression is not parametrized. | Returns true if expression is not parametrized. | [
"Returns",
"true",
"if",
"expression",
"is",
"not",
"parametrized",
"."
] | def is_param_free(expr) -> bool:
"""Returns true if expression is not parametrized."""
return not expr.parameters() | [
"def",
"is_param_free",
"(",
"expr",
")",
"->",
"bool",
":",
"return",
"not",
"expr",
".",
"parameters",
"(",
")"
] | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/expressions/constants/parameter.py#L30-L32 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/eager/python/examples/spinn/data.py | python | pad_and_reverse_word_ids | (sentences) | return sentences | Pad a list of sentences to the common maximum length + 1.
Args:
sentences: A list of sentences as a list of list of integers. Each integer
is a word ID. Each list of integer corresponds to one sentence.
Returns:
A numpy.ndarray of shape (num_sentences, max_length + 1), wherein max_length
is th... | Pad a list of sentences to the common maximum length + 1. | [
"Pad",
"a",
"list",
"of",
"sentences",
"to",
"the",
"common",
"maximum",
"length",
"+",
"1",
"."
] | def pad_and_reverse_word_ids(sentences):
"""Pad a list of sentences to the common maximum length + 1.
Args:
sentences: A list of sentences as a list of list of integers. Each integer
is a word ID. Each list of integer corresponds to one sentence.
Returns:
A numpy.ndarray of shape (num_sentences, m... | [
"def",
"pad_and_reverse_word_ids",
"(",
"sentences",
")",
":",
"max_len",
"=",
"max",
"(",
"len",
"(",
"sent",
")",
"for",
"sent",
"in",
"sentences",
")",
"for",
"sent",
"in",
"sentences",
":",
"if",
"len",
"(",
"sent",
")",
"<",
"max_len",
":",
"sent"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/eager/python/examples/spinn/data.py#L87-L107 | |
jsupancic/deep_hand_pose | 22cbeae1a8410ff5d37c060c7315719d0a5d608f | scripts/cpp_lint.py | python | _SetCountingStyle | (level) | Sets the module's counting options. | Sets the module's counting options. | [
"Sets",
"the",
"module",
"s",
"counting",
"options",
"."
] | def _SetCountingStyle(level):
"""Sets the module's counting options."""
_cpplint_state.SetCountingStyle(level) | [
"def",
"_SetCountingStyle",
"(",
"level",
")",
":",
"_cpplint_state",
".",
"SetCountingStyle",
"(",
"level",
")"
] | https://github.com/jsupancic/deep_hand_pose/blob/22cbeae1a8410ff5d37c060c7315719d0a5d608f/scripts/cpp_lint.py#L787-L789 | ||
jsupancic/deep_hand_pose | 22cbeae1a8410ff5d37c060c7315719d0a5d608f | tools/extra/parse_log.py | python | parse_line_for_net_output | (regex_obj, row, row_dict_list,
line, iteration, seconds, learning_rate) | return row_dict_list, row | Parse a single line for training or test output
Returns a a tuple with (row_dict_list, row)
row: may be either a new row or an augmented version of the current row
row_dict_list: may be either the current row_dict_list or an augmented
version of the current row_dict_list | Parse a single line for training or test output | [
"Parse",
"a",
"single",
"line",
"for",
"training",
"or",
"test",
"output"
] | def parse_line_for_net_output(regex_obj, row, row_dict_list,
line, iteration, seconds, learning_rate):
"""Parse a single line for training or test output
Returns a a tuple with (row_dict_list, row)
row: may be either a new row or an augmented version of the current row
row... | [
"def",
"parse_line_for_net_output",
"(",
"regex_obj",
",",
"row",
",",
"row_dict_list",
",",
"line",
",",
"iteration",
",",
"seconds",
",",
"learning_rate",
")",
":",
"output_match",
"=",
"regex_obj",
".",
"search",
"(",
"line",
")",
"if",
"output_match",
":",... | https://github.com/jsupancic/deep_hand_pose/blob/22cbeae1a8410ff5d37c060c7315719d0a5d608f/tools/extra/parse_log.py#L77-L116 | |
vergecurrency/verge | cc5711be0a978bcdc06c62569b129fe6ab4e4d9f | contrib/verify-commits/verify-commits.py | python | tree_sha512sum | (commit='HEAD') | return overall.hexdigest() | Calculate the Tree-sha512 for the commit.
This is copied from github-merge.py. | Calculate the Tree-sha512 for the commit. | [
"Calculate",
"the",
"Tree",
"-",
"sha512",
"for",
"the",
"commit",
"."
] | def tree_sha512sum(commit='HEAD'):
"""Calculate the Tree-sha512 for the commit.
This is copied from github-merge.py."""
# request metadata for entire tree, recursively
files = []
blob_by_name = {}
for line in subprocess.check_output([GIT, 'ls-tree', '--full-tree', '-r', commit]).splitlines():
... | [
"def",
"tree_sha512sum",
"(",
"commit",
"=",
"'HEAD'",
")",
":",
"# request metadata for entire tree, recursively",
"files",
"=",
"[",
"]",
"blob_by_name",
"=",
"{",
"}",
"for",
"line",
"in",
"subprocess",
".",
"check_output",
"(",
"[",
"GIT",
",",
"'ls-tree'",
... | https://github.com/vergecurrency/verge/blob/cc5711be0a978bcdc06c62569b129fe6ab4e4d9f/contrib/verify-commits/verify-commits.py#L15-L66 | |
LLNL/lbann | 26083e6c86050302ce33148aea70f62e61cacb92 | applications/nlp/transformer/evaluate.py | python | get_batch | (indices) | return tokens_en, tokens_de | Get a batch of samples from the evaluation dataset.
The sequences are padded to the length of the longest sequence in
the batch. | Get a batch of samples from the evaluation dataset. | [
"Get",
"a",
"batch",
"of",
"samples",
"from",
"the",
"evaluation",
"dataset",
"."
] | def get_batch(indices):
"""Get a batch of samples from the evaluation dataset.
The sequences are padded to the length of the longest sequence in
the batch.
"""
# Get data samples
indices = utils.make_iterable(indices)
tokens_list_en = []
tokens_list_de = []
for index in indices:
... | [
"def",
"get_batch",
"(",
"indices",
")",
":",
"# Get data samples",
"indices",
"=",
"utils",
".",
"make_iterable",
"(",
"indices",
")",
"tokens_list_en",
"=",
"[",
"]",
"tokens_list_de",
"=",
"[",
"]",
"for",
"index",
"in",
"indices",
":",
"tokens_en",
",",
... | https://github.com/LLNL/lbann/blob/26083e6c86050302ce33148aea70f62e61cacb92/applications/nlp/transformer/evaluate.py#L56-L90 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/coremltools_wrap/coremltools/coremltools/models/_graph_visualization.py | python | _calculate_edges | (cy_nodes, cy_edges, shape_dict=None) | return cy_nodes, cy_edges | Parameters
----------
cy_nodes: list of nodes for graph
cy_edges: list of edges to be updated for graph
shape_dict: shape_dict required for inferring shape information
Returns
-------
cy_nodes: list of nodes for graph
cy_edges: list of edges to be updated for graph | [] | def _calculate_edges(cy_nodes, cy_edges, shape_dict=None):
"""
Parameters
----------
cy_nodes: list of nodes for graph
cy_edges: list of edges to be updated for graph
shape_dict: shape_dict required for inferring shape information
Returns
-------
cy_nodes: list of nodes for graph
... | [
"def",
"_calculate_edges",
"(",
"cy_nodes",
",",
"cy_edges",
",",
"shape_dict",
"=",
"None",
")",
":",
"node_len",
"=",
"len",
"(",
"cy_nodes",
")",
"for",
"upper_index",
"in",
"range",
"(",
"0",
",",
"node_len",
")",
":",
"for",
"lower_index",
"in",
"ra... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/models/_graph_visualization.py#L18-L74 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/numeric.py | python | array_equiv | (a1, a2) | return bool(asarray(a1 == a2).all()) | Returns True if input arrays are shape consistent and all elements equal.
Shape consistent means they are either the same shape, or one input array
can be broadcasted to create the same shape as the other one.
Parameters
----------
a1, a2 : array_like
Input arrays.
Returns
-------... | Returns True if input arrays are shape consistent and all elements equal. | [
"Returns",
"True",
"if",
"input",
"arrays",
"are",
"shape",
"consistent",
"and",
"all",
"elements",
"equal",
"."
] | def array_equiv(a1, a2):
"""
Returns True if input arrays are shape consistent and all elements equal.
Shape consistent means they are either the same shape, or one input array
can be broadcasted to create the same shape as the other one.
Parameters
----------
a1, a2 : array_like
I... | [
"def",
"array_equiv",
"(",
"a1",
",",
"a2",
")",
":",
"try",
":",
"a1",
",",
"a2",
"=",
"asarray",
"(",
"a1",
")",
",",
"asarray",
"(",
"a2",
")",
"except",
"Exception",
":",
"return",
"False",
"try",
":",
"multiarray",
".",
"broadcast",
"(",
"a1",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/numeric.py#L2335-L2379 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/inspector_protocol/jinja2/environment.py | python | Template.generate | (self, *args, **kwargs) | For very large templates it can be useful to not render the whole
template at once but evaluate each statement after another and yield
piece for piece. This method basically does exactly that and returns
a generator that yields one item after another as unicode strings.
It accepts the ... | For very large templates it can be useful to not render the whole
template at once but evaluate each statement after another and yield
piece for piece. This method basically does exactly that and returns
a generator that yields one item after another as unicode strings. | [
"For",
"very",
"large",
"templates",
"it",
"can",
"be",
"useful",
"to",
"not",
"render",
"the",
"whole",
"template",
"at",
"once",
"but",
"evaluate",
"each",
"statement",
"after",
"another",
"and",
"yield",
"piece",
"for",
"piece",
".",
"This",
"method",
"... | def generate(self, *args, **kwargs):
"""For very large templates it can be useful to not render the whole
template at once but evaluate each statement after another and yield
piece for piece. This method basically does exactly that and returns
a generator that yields one item after anot... | [
"def",
"generate",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"vars",
"=",
"dict",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"try",
":",
"for",
"event",
"in",
"self",
".",
"root_render_func",
"(",
"self",
".",
"new_co... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/inspector_protocol/jinja2/environment.py#L1029-L1045 | ||
Kitware/VTK | 5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8 | Wrapping/Python/vtkmodules/wx/wxVTKRenderWindowInteractor.py | python | wxVTKRenderWindowInteractor.OnLeave | (self,event) | Handles the wx.EVT_LEAVE_WINDOW event for
wxVTKRenderWindowInteractor. | Handles the wx.EVT_LEAVE_WINDOW event for
wxVTKRenderWindowInteractor. | [
"Handles",
"the",
"wx",
".",
"EVT_LEAVE_WINDOW",
"event",
"for",
"wxVTKRenderWindowInteractor",
"."
] | def OnLeave(self,event):
"""Handles the wx.EVT_LEAVE_WINDOW event for
wxVTKRenderWindowInteractor.
"""
# event processing should continue
event.Skip()
self._Iren.SetEventInformationFlipY(event.GetX(), event.GetY(),
event.Contr... | [
"def",
"OnLeave",
"(",
"self",
",",
"event",
")",
":",
"# event processing should continue",
"event",
".",
"Skip",
"(",
")",
"self",
".",
"_Iren",
".",
"SetEventInformationFlipY",
"(",
"event",
".",
"GetX",
"(",
")",
",",
"event",
".",
"GetY",
"(",
")",
... | https://github.com/Kitware/VTK/blob/5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8/Wrapping/Python/vtkmodules/wx/wxVTKRenderWindowInteractor.py#L446-L458 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/inspect.py | python | _signature_from_callable | (obj, *,
follow_wrapper_chains=True,
skip_bound_arg=True,
sigcls) | Private helper function to get signature for arbitrary
callable objects. | Private helper function to get signature for arbitrary
callable objects. | [
"Private",
"helper",
"function",
"to",
"get",
"signature",
"for",
"arbitrary",
"callable",
"objects",
"."
] | def _signature_from_callable(obj, *,
follow_wrapper_chains=True,
skip_bound_arg=True,
sigcls):
"""Private helper function to get signature for arbitrary
callable objects.
"""
if not callable(obj):
raise Type... | [
"def",
"_signature_from_callable",
"(",
"obj",
",",
"*",
",",
"follow_wrapper_chains",
"=",
"True",
",",
"skip_bound_arg",
"=",
"True",
",",
"sigcls",
")",
":",
"if",
"not",
"callable",
"(",
"obj",
")",
":",
"raise",
"TypeError",
"(",
"'{!r} is not a callable ... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/inspect.py#L2198-L2396 | ||
fossephate/JoyCon-Driver | 857e4e76e26f05d72400ae5d9f2a22cae88f3548 | joycon-driver/full/wxWidgets-3.0.3/build/bakefiles/wxwin.py | python | getVersion | () | return wxVersion | Returns wxWidgets version as a tuple: (major,minor,release). | Returns wxWidgets version as a tuple: (major,minor,release). | [
"Returns",
"wxWidgets",
"version",
"as",
"a",
"tuple",
":",
"(",
"major",
"minor",
"release",
")",
"."
] | def getVersion():
"""Returns wxWidgets version as a tuple: (major,minor,release)."""
global wxVersion
if wxVersion == None:
f = open(VERSION_FILE, 'rt')
lines = f.readlines()
f.close()
major = minor = release = None
for l in lines:
if not l.startswith('#de... | [
"def",
"getVersion",
"(",
")",
":",
"global",
"wxVersion",
"if",
"wxVersion",
"==",
"None",
":",
"f",
"=",
"open",
"(",
"VERSION_FILE",
",",
"'rt'",
")",
"lines",
"=",
"f",
".",
"readlines",
"(",
")",
"f",
".",
"close",
"(",
")",
"major",
"=",
"min... | https://github.com/fossephate/JoyCon-Driver/blob/857e4e76e26f05d72400ae5d9f2a22cae88f3548/joycon-driver/full/wxWidgets-3.0.3/build/bakefiles/wxwin.py#L103-L125 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/xml/sax/xmlreader.py | python | XMLReader.getFeature | (self, name) | Looks up and returns the state of a SAX2 feature. | Looks up and returns the state of a SAX2 feature. | [
"Looks",
"up",
"and",
"returns",
"the",
"state",
"of",
"a",
"SAX2",
"feature",
"."
] | def getFeature(self, name):
"Looks up and returns the state of a SAX2 feature."
raise SAXNotRecognizedException("Feature '%s' not recognized" % name) | [
"def",
"getFeature",
"(",
"self",
",",
"name",
")",
":",
"raise",
"SAXNotRecognizedException",
"(",
"\"Feature '%s' not recognized\"",
"%",
"name",
")"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/xml/sax/xmlreader.py#L75-L77 | ||
clementine-player/Clementine | 111379dfd027802b59125829fcf87e3e1d0ad73b | dist/cpplint.py | python | NestingState.InAsmBlock | (self) | return self.stack and self.stack[-1].inline_asm != _NO_ASM | Check if we are currently one level inside an inline ASM block.
Returns:
True if the top of the stack is a block containing inline ASM. | Check if we are currently one level inside an inline ASM block. | [
"Check",
"if",
"we",
"are",
"currently",
"one",
"level",
"inside",
"an",
"inline",
"ASM",
"block",
"."
] | def InAsmBlock(self):
"""Check if we are currently one level inside an inline ASM block.
Returns:
True if the top of the stack is a block containing inline ASM.
"""
return self.stack and self.stack[-1].inline_asm != _NO_ASM | [
"def",
"InAsmBlock",
"(",
"self",
")",
":",
"return",
"self",
".",
"stack",
"and",
"self",
".",
"stack",
"[",
"-",
"1",
"]",
".",
"inline_asm",
"!=",
"_NO_ASM"
] | https://github.com/clementine-player/Clementine/blob/111379dfd027802b59125829fcf87e3e1d0ad73b/dist/cpplint.py#L2193-L2199 | |
lukasmonk/lucaschess | 13e2e5cb13b38a720ccf897af649054a64bcb914 | Code/SQL/DBFcache.py | python | DBFcache.skip | (self, num=1) | return self.goto(num + self.recno) | Salta un registro. | Salta un registro. | [
"Salta",
"un",
"registro",
"."
] | def skip(self, num=1):
"""
Salta un registro.
"""
return self.goto(num + self.recno) | [
"def",
"skip",
"(",
"self",
",",
"num",
"=",
"1",
")",
":",
"return",
"self",
".",
"goto",
"(",
"num",
"+",
"self",
".",
"recno",
")"
] | https://github.com/lukasmonk/lucaschess/blob/13e2e5cb13b38a720ccf897af649054a64bcb914/Code/SQL/DBFcache.py#L198-L202 | |
metashell/metashell | f4177e4854ea00c8dbc722cadab26ef413d798ea | 3rd/templight/llvm/bindings/python/llvm/object.py | python | Relocation.cache | (self) | Cache all cacheable properties on this instance. | Cache all cacheable properties on this instance. | [
"Cache",
"all",
"cacheable",
"properties",
"on",
"this",
"instance",
"."
] | def cache(self):
"""Cache all cacheable properties on this instance."""
getattr(self, 'address')
getattr(self, 'offset')
getattr(self, 'symbol')
getattr(self, 'type')
getattr(self, 'type_name')
getattr(self, 'value_string') | [
"def",
"cache",
"(",
"self",
")",
":",
"getattr",
"(",
"self",
",",
"'address'",
")",
"getattr",
"(",
"self",
",",
"'offset'",
")",
"getattr",
"(",
"self",
",",
"'symbol'",
")",
"getattr",
"(",
"self",
",",
"'type'",
")",
"getattr",
"(",
"self",
",",... | https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/llvm/bindings/python/llvm/object.py#L417-L424 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/logging/__init__.py | python | Filterer.removeFilter | (self, filter) | Remove the specified filter from this handler. | Remove the specified filter from this handler. | [
"Remove",
"the",
"specified",
"filter",
"from",
"this",
"handler",
"."
] | def removeFilter(self, filter):
"""
Remove the specified filter from this handler.
"""
if filter in self.filters:
self.filters.remove(filter) | [
"def",
"removeFilter",
"(",
"self",
",",
"filter",
")",
":",
"if",
"filter",
"in",
"self",
".",
"filters",
":",
"self",
".",
"filters",
".",
"remove",
"(",
"filter",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/logging/__init__.py#L729-L734 | ||
WeitaoVan/L-GM-loss | 598582f0631bac876b3eeb8d6c4cd1d780269e03 | 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/WeitaoVan/L-GM-loss/blob/598582f0631bac876b3eeb8d6c4cd1d780269e03/scripts/cpp_lint.py#L703-L705 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | NativeFontInfo.GetUnderlined | (*args, **kwargs) | return _gdi_.NativeFontInfo_GetUnderlined(*args, **kwargs) | GetUnderlined(self) -> bool | GetUnderlined(self) -> bool | [
"GetUnderlined",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetUnderlined(*args, **kwargs):
"""GetUnderlined(self) -> bool"""
return _gdi_.NativeFontInfo_GetUnderlined(*args, **kwargs) | [
"def",
"GetUnderlined",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"NativeFontInfo_GetUnderlined",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L1889-L1891 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/secrets.py | python | token_hex | (nbytes=None) | return binascii.hexlify(token_bytes(nbytes)).decode('ascii') | Return a random text string, in hexadecimal.
The string has *nbytes* random bytes, each byte converted to two
hex digits. If *nbytes* is ``None`` or not supplied, a reasonable
default is used.
>>> token_hex(16) #doctest:+SKIP
'f9bf78b9a18ce6d46a0cd2b0b86df9da' | Return a random text string, in hexadecimal. | [
"Return",
"a",
"random",
"text",
"string",
"in",
"hexadecimal",
"."
] | def token_hex(nbytes=None):
"""Return a random text string, in hexadecimal.
The string has *nbytes* random bytes, each byte converted to two
hex digits. If *nbytes* is ``None`` or not supplied, a reasonable
default is used.
>>> token_hex(16) #doctest:+SKIP
'f9bf78b9a18ce6d46a0cd2b0b86df9da'
... | [
"def",
"token_hex",
"(",
"nbytes",
"=",
"None",
")",
":",
"return",
"binascii",
".",
"hexlify",
"(",
"token_bytes",
"(",
"nbytes",
")",
")",
".",
"decode",
"(",
"'ascii'",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/secrets.py#L48-L59 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/ttk.py | python | LabeledScale._get_value | (self) | return self._variable.get() | Return current scale value. | Return current scale value. | [
"Return",
"current",
"scale",
"value",
"."
] | def _get_value(self):
"""Return current scale value."""
return self._variable.get() | [
"def",
"_get_value",
"(",
"self",
")",
":",
"return",
"self",
".",
"_variable",
".",
"get",
"(",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/ttk.py#L1540-L1542 | |
microsoft/EdgeML | ef9f8a77f096acbdeb941014791f8eda1c1bc35b | examples/tf/Bonsai/helpermethods.py | python | getQuantArgs | () | return parser.parse_args() | Function to parse arguments for Model Quantisation | Function to parse arguments for Model Quantisation | [
"Function",
"to",
"parse",
"arguments",
"for",
"Model",
"Quantisation"
] | def getQuantArgs():
'''
Function to parse arguments for Model Quantisation
'''
parser = argparse.ArgumentParser(
description='Arguments for quantizing Fast models. ' +
'Works only for piece-wise linear non-linearities, ' +
'like relu, quantTanh, quantSigm (check rnn.py for the de... | [
"def",
"getQuantArgs",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"'Arguments for quantizing Fast models. '",
"+",
"'Works only for piece-wise linear non-linearities, '",
"+",
"'like relu, quantTanh, quantSigm (check rnn.py for the def... | https://github.com/microsoft/EdgeML/blob/ef9f8a77f096acbdeb941014791f8eda1c1bc35b/examples/tf/Bonsai/helpermethods.py#L123-L139 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/Tkinter.py | python | Wm.wm_attributes | (self, *args) | return self.tk.call(args) | This subcommand returns or sets platform specific attributes
The first form returns a list of the platform specific flags and
their values. The second form returns the value for the specific
option. The third form sets one or more of the values. The values
are as follows:
On Wi... | This subcommand returns or sets platform specific attributes | [
"This",
"subcommand",
"returns",
"or",
"sets",
"platform",
"specific",
"attributes"
] | def wm_attributes(self, *args):
"""This subcommand returns or sets platform specific attributes
The first form returns a list of the platform specific flags and
their values. The second form returns the value for the specific
option. The third form sets one or more of the values. The va... | [
"def",
"wm_attributes",
"(",
"self",
",",
"*",
"args",
")",
":",
"args",
"=",
"(",
"'wm'",
",",
"'attributes'",
",",
"self",
".",
"_w",
")",
"+",
"args",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"args",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L1611-L1630 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/__init__.py | python | MemoizedZipManifests.load | (self, path) | return self[path].manifest | Load a manifest at path or return a suitable manifest already loaded. | Load a manifest at path or return a suitable manifest already loaded. | [
"Load",
"a",
"manifest",
"at",
"path",
"or",
"return",
"a",
"suitable",
"manifest",
"already",
"loaded",
"."
] | def load(self, path):
"""
Load a manifest at path or return a suitable manifest already loaded.
"""
path = os.path.normpath(path)
mtime = os.stat(path).st_mtime
if path not in self or self[path].mtime != mtime:
manifest = self.build(path)
self[pat... | [
"def",
"load",
"(",
"self",
",",
"path",
")",
":",
"path",
"=",
"os",
".",
"path",
".",
"normpath",
"(",
"path",
")",
"mtime",
"=",
"os",
".",
"stat",
"(",
"path",
")",
".",
"st_mtime",
"if",
"path",
"not",
"in",
"self",
"or",
"self",
"[",
"pat... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/__init__.py#L1669-L1680 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/os2emxpath.py | python | join | (a, *p) | return path | Join two or more pathname components, inserting sep as needed | Join two or more pathname components, inserting sep as needed | [
"Join",
"two",
"or",
"more",
"pathname",
"components",
"inserting",
"sep",
"as",
"needed"
] | def join(a, *p):
"""Join two or more pathname components, inserting sep as needed"""
path = a
for b in p:
if isabs(b):
path = b
elif path == '' or path[-1:] in '/\\:':
path = path + b
else:
path = path + '/' + b
return path | [
"def",
"join",
"(",
"a",
",",
"*",
"p",
")",
":",
"path",
"=",
"a",
"for",
"b",
"in",
"p",
":",
"if",
"isabs",
"(",
"b",
")",
":",
"path",
"=",
"b",
"elif",
"path",
"==",
"''",
"or",
"path",
"[",
"-",
"1",
":",
"]",
"in",
"'/\\\\:'",
":",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/os2emxpath.py#L45-L55 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/grid.py | python | GridEditorCreatedEvent.__init__ | (self, *args, **kwargs) | __init__(self, int id, EventType type, Object obj, int row, int col,
Control ctrl) -> GridEditorCreatedEvent | __init__(self, int id, EventType type, Object obj, int row, int col,
Control ctrl) -> GridEditorCreatedEvent | [
"__init__",
"(",
"self",
"int",
"id",
"EventType",
"type",
"Object",
"obj",
"int",
"row",
"int",
"col",
"Control",
"ctrl",
")",
"-",
">",
"GridEditorCreatedEvent"
] | def __init__(self, *args, **kwargs):
"""
__init__(self, int id, EventType type, Object obj, int row, int col,
Control ctrl) -> GridEditorCreatedEvent
"""
_grid.GridEditorCreatedEvent_swiginit(self,_grid.new_GridEditorCreatedEvent(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_grid",
".",
"GridEditorCreatedEvent_swiginit",
"(",
"self",
",",
"_grid",
".",
"new_GridEditorCreatedEvent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/grid.py#L2461-L2466 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site.py | python | getsitepackages | (prefixes=None) | return sitepackages | Returns a list containing all global site-packages directories.
For each directory present in ``prefixes`` (or the global ``PREFIXES``),
this function will find its `site-packages` subdirectory depending on the
system environment, and will return a list of full paths. | Returns a list containing all global site-packages directories. | [
"Returns",
"a",
"list",
"containing",
"all",
"global",
"site",
"-",
"packages",
"directories",
"."
] | def getsitepackages(prefixes=None):
"""Returns a list containing all global site-packages directories.
For each directory present in ``prefixes`` (or the global ``PREFIXES``),
this function will find its `site-packages` subdirectory depending on the
system environment, and will return a list of full pa... | [
"def",
"getsitepackages",
"(",
"prefixes",
"=",
"None",
")",
":",
"sitepackages",
"=",
"[",
"]",
"seen",
"=",
"set",
"(",
")",
"if",
"prefixes",
"is",
"None",
":",
"prefixes",
"=",
"PREFIXES",
"for",
"prefix",
"in",
"prefixes",
":",
"if",
"not",
"prefi... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site.py#L318-L343 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/command/sdist.py | python | sdist._cs_path_exists | (fspath) | return filename in os.listdir(directory) | Case-sensitive path existence check
>>> sdist._cs_path_exists(__file__)
True
>>> sdist._cs_path_exists(__file__.upper())
False | Case-sensitive path existence check | [
"Case",
"-",
"sensitive",
"path",
"existence",
"check"
] | def _cs_path_exists(fspath):
"""
Case-sensitive path existence check
>>> sdist._cs_path_exists(__file__)
True
>>> sdist._cs_path_exists(__file__.upper())
False
"""
if not os.path.exists(fspath):
return False
# make absolute so we alway... | [
"def",
"_cs_path_exists",
"(",
"fspath",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"fspath",
")",
":",
"return",
"False",
"# make absolute so we always have a directory",
"abspath",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"fspath",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/command/sdist.py#L233-L247 | |
apiaryio/snowcrash | b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3 | tools/gyp/pylib/gyp/mac_tool.py | python | MacTool.ExecMergeInfoPlist | (self, output, *inputs) | Merge multiple .plist files into a single .plist file. | Merge multiple .plist files into a single .plist file. | [
"Merge",
"multiple",
".",
"plist",
"files",
"into",
"a",
"single",
".",
"plist",
"file",
"."
] | def ExecMergeInfoPlist(self, output, *inputs):
"""Merge multiple .plist files into a single .plist file."""
merged_plist = {}
for path in inputs:
plist = self._LoadPlistMaybeBinary(path)
self._MergePlist(merged_plist, plist)
plistlib.writePlist(merged_plist, output) | [
"def",
"ExecMergeInfoPlist",
"(",
"self",
",",
"output",
",",
"*",
"inputs",
")",
":",
"merged_plist",
"=",
"{",
"}",
"for",
"path",
"in",
"inputs",
":",
"plist",
"=",
"self",
".",
"_LoadPlistMaybeBinary",
"(",
"path",
")",
"self",
".",
"_MergePlist",
"(... | https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/mac_tool.py#L363-L369 | ||
metashell/metashell | f4177e4854ea00c8dbc722cadab26ef413d798ea | 3rd/templight/llvm/bindings/python/llvm/object.py | python | Section.cache | (self) | Cache properties of this Section.
This can be called as a workaround to the single active Section
limitation. When called, the properties of the Section are fetched so
they are still available after the Section has been marked inactive. | Cache properties of this Section. | [
"Cache",
"properties",
"of",
"this",
"Section",
"."
] | def cache(self):
"""Cache properties of this Section.
This can be called as a workaround to the single active Section
limitation. When called, the properties of the Section are fetched so
they are still available after the Section has been marked inactive.
"""
getattr(se... | [
"def",
"cache",
"(",
"self",
")",
":",
"getattr",
"(",
"self",
",",
"'name'",
")",
"getattr",
"(",
"self",
",",
"'size'",
")",
"getattr",
"(",
"self",
",",
"'contents'",
")",
"getattr",
"(",
"self",
",",
"'address'",
")"
] | https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/llvm/bindings/python/llvm/object.py#L270-L280 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/turtle.py | python | RawTurtle._update | (self) | Perform a Turtle-data update. | Perform a Turtle-data update. | [
"Perform",
"a",
"Turtle",
"-",
"data",
"update",
"."
] | def _update(self):
"""Perform a Turtle-data update.
"""
screen = self.screen
if screen._tracing == 0:
return
elif screen._tracing == 1:
self._update_data()
self._drawturtle()
screen._update() # TurtleScreenBase
... | [
"def",
"_update",
"(",
"self",
")",
":",
"screen",
"=",
"self",
".",
"screen",
"if",
"screen",
".",
"_tracing",
"==",
"0",
":",
"return",
"elif",
"screen",
".",
"_tracing",
"==",
"1",
":",
"self",
".",
"_update_data",
"(",
")",
"self",
".",
"_drawtur... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/turtle.py#L2557-L2573 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py | python | Decimal.is_signed | (self) | return self._sign == 1 | Return True if self is negative; otherwise return False. | Return True if self is negative; otherwise return False. | [
"Return",
"True",
"if",
"self",
"is",
"negative",
";",
"otherwise",
"return",
"False",
"."
] | def is_signed(self):
"""Return True if self is negative; otherwise return False."""
return self._sign == 1 | [
"def",
"is_signed",
"(",
"self",
")",
":",
"return",
"self",
".",
"_sign",
"==",
"1"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py#L3043-L3045 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/share/gdb/python/gdb/command/explore.py | python | CompoundExplorer.explore_expr | (expr, value, is_child) | return False | Function to explore structs/classes and union values.
See Explorer.explore_expr for more information. | Function to explore structs/classes and union values.
See Explorer.explore_expr for more information. | [
"Function",
"to",
"explore",
"structs",
"/",
"classes",
"and",
"union",
"values",
".",
"See",
"Explorer",
".",
"explore_expr",
"for",
"more",
"information",
"."
] | def explore_expr(expr, value, is_child):
"""Function to explore structs/classes and union values.
See Explorer.explore_expr for more information.
"""
datatype = value.type
type_code = datatype.code
fields = datatype.fields()
if type_code == gdb.TYPE_CODE_STRUCT:
... | [
"def",
"explore_expr",
"(",
"expr",
",",
"value",
",",
"is_child",
")",
":",
"datatype",
"=",
"value",
".",
"type",
"type_code",
"=",
"datatype",
".",
"code",
"fields",
"=",
"datatype",
".",
"fields",
"(",
")",
"if",
"type_code",
"==",
"gdb",
".",
"TYP... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/share/gdb/python/gdb/command/explore.py#L392-L470 | |
linyouhappy/kongkongxiyou | 7a69b2913eb29f4be77f9a62fb90cdd72c4160f1 | cocosjs/frameworks/runtime-src/proj.android/build_native.py | python | check_environment_variables | () | return NDK_ROOT | Checking the environment NDK_ROOT, which will be used for building | Checking the environment NDK_ROOT, which will be used for building | [
"Checking",
"the",
"environment",
"NDK_ROOT",
"which",
"will",
"be",
"used",
"for",
"building"
] | def check_environment_variables():
''' Checking the environment NDK_ROOT, which will be used for building
'''
try:
NDK_ROOT = os.environ['NDK_ROOT']
except Exception:
print "NDK_ROOT not defined. Please define NDK_ROOT in your environment"
sys.exit(1)
return NDK_ROOT | [
"def",
"check_environment_variables",
"(",
")",
":",
"try",
":",
"NDK_ROOT",
"=",
"os",
".",
"environ",
"[",
"'NDK_ROOT'",
"]",
"except",
"Exception",
":",
"print",
"\"NDK_ROOT not defined. Please define NDK_ROOT in your environment\"",
"sys",
".",
"exit",
"(",
"1",
... | https://github.com/linyouhappy/kongkongxiyou/blob/7a69b2913eb29f4be77f9a62fb90cdd72c4160f1/cocosjs/frameworks/runtime-src/proj.android/build_native.py#L30-L40 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/svm/base.py | python | BaseLibSVM.decision_function | (self, X) | return self._decision_function(X) | Distance of the samples X to the separating hyperplane.
Parameters
----------
X : array-like, shape (n_samples, n_features)
For kernel="precomputed", the expected shape of X is
[n_samples_test, n_samples_train].
Returns
-------
X : array-like, sh... | Distance of the samples X to the separating hyperplane. | [
"Distance",
"of",
"the",
"samples",
"X",
"to",
"the",
"separating",
"hyperplane",
"."
] | def decision_function(self, X):
"""Distance of the samples X to the separating hyperplane.
Parameters
----------
X : array-like, shape (n_samples, n_features)
For kernel="precomputed", the expected shape of X is
[n_samples_test, n_samples_train].
Returns... | [
"def",
"decision_function",
"(",
"self",
",",
"X",
")",
":",
"return",
"self",
".",
"_decision_function",
"(",
"X",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/svm/base.py#L372-L387 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/math_grad.py | python | _GatherDropNegatives | (params,
ids,
zero_clipped_indices=None,
is_positive=None) | return (array_ops.where(is_positive, gathered, zero_slice),
zero_clipped_indices, is_positive) | Helper function for unsorted segment ops.
Gathers params for
positive segment ids and gathers 0 for inputs with negative segment id.
Also returns the clipped indices and a boolean mask with the same shape
as ids where a positive id is masked as true. With this, the latter two
can be passed as... | Helper function for unsorted segment ops. | [
"Helper",
"function",
"for",
"unsorted",
"segment",
"ops",
"."
] | def _GatherDropNegatives(params,
ids,
zero_clipped_indices=None,
is_positive=None):
""" Helper function for unsorted segment ops.
Gathers params for
positive segment ids and gathers 0 for inputs with negative segment id.
Also re... | [
"def",
"_GatherDropNegatives",
"(",
"params",
",",
"ids",
",",
"zero_clipped_indices",
"=",
"None",
",",
"is_positive",
"=",
"None",
")",
":",
"if",
"zero_clipped_indices",
"is",
"None",
":",
"zero_clipped_indices",
"=",
"math_ops",
".",
"maximum",
"(",
"ids",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/math_grad.py#L398-L425 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.