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
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/py_vulcanize/third_party/rjsmin/_setup/py3/commands.py
python
BuildExt.build_extension
(self, ext)
return _build_ext.build_ext.build_extension(self, ext)
Build C extension - with extended functionality The following features are added here: - ``ext.check_prerequisites`` is called before the extension is being built. See `Extension` for details. If the method does not exist, simply no check will be run. - The macros ``EXT_PAC...
Build C extension - with extended functionality
[ "Build", "C", "extension", "-", "with", "extended", "functionality" ]
def build_extension(self, ext): """ Build C extension - with extended functionality The following features are added here: - ``ext.check_prerequisites`` is called before the extension is being built. See `Extension` for details. If the method does not exist, simply ...
[ "def", "build_extension", "(", "self", ",", "ext", ")", ":", "# handle name macros", "macros", "=", "dict", "(", "ext", ".", "define_macros", "or", "(", ")", ")", "tup", "=", "ext", ".", "name", ".", "split", "(", "'.'", ")", "if", "len", "(", "tup",...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/py_vulcanize/third_party/rjsmin/_setup/py3/commands.py#L198-L246
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/generic.py
python
NDFrame._add_series_or_dataframe_operations
(cls)
Add the series or dataframe only operations to the cls; evaluate the doc strings again.
Add the series or dataframe only operations to the cls; evaluate the doc strings again.
[ "Add", "the", "series", "or", "dataframe", "only", "operations", "to", "the", "cls", ";", "evaluate", "the", "doc", "strings", "again", "." ]
def _add_series_or_dataframe_operations(cls): """ Add the series or dataframe only operations to the cls; evaluate the doc strings again. """ from pandas.core.window import EWM, Expanding, Rolling, Window @Appender(Rolling.__doc__) def rolling( self,...
[ "def", "_add_series_or_dataframe_operations", "(", "cls", ")", ":", "from", "pandas", ".", "core", ".", "window", "import", "EWM", ",", "Expanding", ",", "Rolling", ",", "Window", "@", "Appender", "(", "Rolling", ".", "__doc__", ")", "def", "rolling", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/generic.py#L10343-L10421
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/telnetlib.py
python
Telnet.process_rawq
(self)
Transfer from raw queue to cooked queue. Set self.eof when connection is closed. Don't block unless in the midst of an IAC sequence.
Transfer from raw queue to cooked queue.
[ "Transfer", "from", "raw", "queue", "to", "cooked", "queue", "." ]
def process_rawq(self): """Transfer from raw queue to cooked queue. Set self.eof when connection is closed. Don't block unless in the midst of an IAC sequence. """ buf = ['', ''] try: while self.rawq: c = self.rawq_getchar() ...
[ "def", "process_rawq", "(", "self", ")", ":", "buf", "=", "[", "''", ",", "''", "]", "try", ":", "while", "self", ".", "rawq", ":", "c", "=", "self", ".", "rawq_getchar", "(", ")", "if", "not", "self", ".", "iacseq", ":", "if", "c", "==", "theN...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/telnetlib.py#L471-L541
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/specs/python/summaries.py
python
_truncate_structure
(x)
return False
A helper function that disables recursion in tf_structure. Some constructs (e.g., HorizontalLstm) are complex unrolled structures and don't need to be represented in the output of tf_structure or tf_print. This helper function defines which tree branches should be pruned. This is a very imperfect way of deal...
A helper function that disables recursion in tf_structure.
[ "A", "helper", "function", "that", "disables", "recursion", "in", "tf_structure", "." ]
def _truncate_structure(x): """A helper function that disables recursion in tf_structure. Some constructs (e.g., HorizontalLstm) are complex unrolled structures and don't need to be represented in the output of tf_structure or tf_print. This helper function defines which tree branches should be pruned. This ...
[ "def", "_truncate_structure", "(", "x", ")", ":", "if", "\"/HorizontalLstm/\"", "in", "x", ".", "name", ":", "return", "True", "return", "False" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/specs/python/summaries.py#L52-L70
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBWatchpoint.GetError
(self)
return _lldb.SBWatchpoint_GetError(self)
GetError(self) -> SBError
GetError(self) -> SBError
[ "GetError", "(", "self", ")", "-", ">", "SBError" ]
def GetError(self): """GetError(self) -> SBError""" return _lldb.SBWatchpoint_GetError(self)
[ "def", "GetError", "(", "self", ")", ":", "return", "_lldb", ".", "SBWatchpoint_GetError", "(", "self", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L12594-L12596
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailbox.py
python
Babyl.get_bytes
(self, key)
return headers + data
Return a string representation or raise a KeyError.
Return a string representation or raise a KeyError.
[ "Return", "a", "string", "representation", "or", "raise", "a", "KeyError", "." ]
def get_bytes(self, key): """Return a string representation or raise a KeyError.""" start, stop = self._lookup(key) self._file.seek(start) self._file.readline() # Skip b'1,' line specifying labels. original_headers = io.BytesIO() while True: line = self._fil...
[ "def", "get_bytes", "(", "self", ",", "key", ")", ":", "start", ",", "stop", "=", "self", ".", "_lookup", "(", "key", ")", "self", ".", "_file", ".", "seek", "(", "start", ")", "self", ".", "_file", ".", "readline", "(", ")", "# Skip b'1,' line speci...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailbox.py#L1295-L1315
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/cpplint.py
python
CheckEmptyBlockBody
(filename, clean_lines, linenum, error)
Look for empty loop/conditional body with only a single semicolon. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Look for empty loop/conditional body with only a single semicolon.
[ "Look", "for", "empty", "loop", "/", "conditional", "body", "with", "only", "a", "single", "semicolon", "." ]
def CheckEmptyBlockBody(filename, clean_lines, linenum, error): """Look for empty loop/conditional body with only a single semicolon. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The functio...
[ "def", "CheckEmptyBlockBody", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "# Search for loop keywords at the beginning of the line. Because only", "# whitespaces are allowed before the keywords, this will also ignore most", "# do-while-loops, since those...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/cpplint.py#L4136-L4237
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
tools/mo/openvino/tools/mo/front/subgraph_matcher.py
python
SubgraphMatch.input_nodes
(self, port: int)
return self._input_nodes_map[port]
Returns list of tuples where the first element is a Node of the sub-graph and the second is the input port for that node. Each node of this list gets the same input tensor through the input port with number 'port' of the sub-graph. For example, if the returned list requested for port 'portSG' i...
Returns list of tuples where the first element is a Node of the sub-graph and the second is the input port for that node. Each node of this list gets the same input tensor through the input port with number 'port' of the sub-graph.
[ "Returns", "list", "of", "tuples", "where", "the", "first", "element", "is", "a", "Node", "of", "the", "sub", "-", "graph", "and", "the", "second", "is", "the", "input", "port", "for", "that", "node", ".", "Each", "node", "of", "this", "list", "gets", ...
def input_nodes(self, port: int): """ Returns list of tuples where the first element is a Node of the sub-graph and the second is the input port for that node. Each node of this list gets the same input tensor through the input port with number 'port' of the sub-graph. For examp...
[ "def", "input_nodes", "(", "self", ",", "port", ":", "int", ")", ":", "return", "self", ".", "_input_nodes_map", "[", "port", "]" ]
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/front/subgraph_matcher.py#L81-L93
bairdzhang/smallhardface
76fa1d87a9602d9b13d7a7fe693fc7aec91cab80
external/marcopede-face-eval-f2870fd85d48/util.py
python
boxHOG
(px, py, dx, dy, col, lw)
bbox one the HOG weights
bbox one the HOG weights
[ "bbox", "one", "the", "HOG", "weights" ]
def boxHOG(px, py, dx, dy, col, lw): """ bbox one the HOG weights """ k = 1 d = 15 pylab.plot([px * d + 0 - k, px * d + 0 - k], [py * d + 0 - k, py * d + dy * d - k], col, lw=lw) pylab.plot([px * d + 0 - k, px * d + dx * d - k], [py * d + 0 - k, py * d + 0 -...
[ "def", "boxHOG", "(", "px", ",", "py", ",", "dx", ",", "dy", ",", "col", ",", "lw", ")", ":", "k", "=", "1", "d", "=", "15", "pylab", ".", "plot", "(", "[", "px", "*", "d", "+", "0", "-", "k", ",", "px", "*", "d", "+", "0", "-", "k", ...
https://github.com/bairdzhang/smallhardface/blob/76fa1d87a9602d9b13d7a7fe693fc7aec91cab80/external/marcopede-face-eval-f2870fd85d48/util.py#L270-L284
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/input.py
python
range_input_producer
(limit, num_epochs=None, shuffle=True, seed=None, capacity=32, shared_name=None, name=None)
Produces the integers from 0 to limit-1 in a queue. Note: if `num_epochs` is not `None`, this function creates local counter `epochs`. Use `local_variables_initializer()` to initialize local variables. Args: limit: An int32 scalar tensor. num_epochs: An integer (optional). If specified, `range_input_pro...
Produces the integers from 0 to limit-1 in a queue.
[ "Produces", "the", "integers", "from", "0", "to", "limit", "-", "1", "in", "a", "queue", "." ]
def range_input_producer(limit, num_epochs=None, shuffle=True, seed=None, capacity=32, shared_name=None, name=None): """Produces the integers from 0 to limit-1 in a queue. Note: if `num_epochs` is not `None`, this function creates local counter `epochs`. Use `local_variables_initializer(...
[ "def", "range_input_producer", "(", "limit", ",", "num_epochs", "=", "None", ",", "shuffle", "=", "True", ",", "seed", "=", "None", ",", "capacity", "=", "32", ",", "shared_name", "=", "None", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/input.py#L285-L319
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/aui/auibook.py
python
AuiNotebook.ReparentControl
(self, control, dest_tabs)
Reparents a control added inside a tab. :param Window `control`: almost any :class:`Window` -derived instance to be located inside a tab; :param `dest_tabs`: the destination :class:`AuiTabCtrl`.
Reparents a control added inside a tab.
[ "Reparents", "a", "control", "added", "inside", "a", "tab", "." ]
def ReparentControl(self, control, dest_tabs): """ Reparents a control added inside a tab. :param Window `control`: almost any :class:`Window` -derived instance to be located inside a tab; :param `dest_tabs`: the destination :class:`AuiTabCtrl`. """ control.Hid...
[ "def", "ReparentControl", "(", "self", ",", "control", ",", "dest_tabs", ")", ":", "control", ".", "Hide", "(", ")", "control", ".", "Reparent", "(", "dest_tabs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibook.py#L4366-L4376
netket/netket
0d534e54ecbf25b677ea72af6b85947979420652
netket/operator/spin.py
python
sigmap
( hilbert: _AbstractHilbert, site: int, dtype: _DType = float )
return _LocalOperator(hilbert, mat, [site], dtype=dtype)
Builds the :math:`\\sigma^{+} = \\frac{1}{2}(\\sigma^x + i \\sigma^y)` operator acting on the `site`-th of the Hilbert space `hilbert`. If `hilbert` is a non-Spin space of local dimension M, it is considered as a (M-1)/2 - spin space. :param hilbert: The hilbert space :param site: the site on whic...
Builds the :math:`\\sigma^{+} = \\frac{1}{2}(\\sigma^x + i \\sigma^y)` operator acting on the `site`-th of the Hilbert space `hilbert`.
[ "Builds", "the", ":", "math", ":", "\\\\", "sigma^", "{", "+", "}", "=", "\\\\", "frac", "{", "1", "}", "{", "2", "}", "(", "\\\\", "sigma^x", "+", "i", "\\\\", "sigma^y", ")", "operator", "acting", "on", "the", "site", "-", "th", "of", "the", ...
def sigmap( hilbert: _AbstractHilbert, site: int, dtype: _DType = float ) -> _LocalOperator: """ Builds the :math:`\\sigma^{+} = \\frac{1}{2}(\\sigma^x + i \\sigma^y)` operator acting on the `site`-th of the Hilbert space `hilbert`. If `hilbert` is a non-Spin space of local dimension M, it is consi...
[ "def", "sigmap", "(", "hilbert", ":", "_AbstractHilbert", ",", "site", ":", "int", ",", "dtype", ":", "_DType", "=", "float", ")", "->", "_LocalOperator", ":", "import", "numpy", "as", "np", "N", "=", "hilbert", ".", "size_at_index", "(", "site", ")", ...
https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/operator/spin.py#L119-L141
lammps/lammps
b75c3065430a75b1b5543a10e10f46d9b4c91913
tools/i-pi/ipi/inputs/atoms.py
python
InputAtoms.write
(self, name="", indent="")
Overloads Input write() function so that nothing is written if no atoms are present. This occurs if the beads object has been specified, so that the classical atoms object is not initialized. Returns: A string giving the appropriate xml tags for the checkpoint file.
Overloads Input write() function so that nothing is written if no atoms are present. This occurs if the beads object has been specified, so that the classical atoms object is not initialized.
[ "Overloads", "Input", "write", "()", "function", "so", "that", "nothing", "is", "written", "if", "no", "atoms", "are", "present", ".", "This", "occurs", "if", "the", "beads", "object", "has", "been", "specified", "so", "that", "the", "classical", "atoms", ...
def write(self, name="", indent=""): """Overloads Input write() function so that nothing is written if no atoms are present. This occurs if the beads object has been specified, so that the classical atoms object is not initialized. Returns: A string giving the appropriate xml tags for...
[ "def", "write", "(", "self", ",", "name", "=", "\"\"", ",", "indent", "=", "\"\"", ")", ":", "if", "self", ".", "natoms", ".", "fetch", "(", ")", ">", "0", ":", "return", "super", "(", "InputAtoms", ",", "self", ")", ".", "write", "(", "name", ...
https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/inputs/atoms.py#L109-L121
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/numpy/multiarray.py
python
max
(a, axis=None, out=None, keepdims=False)
return _mx_nd_np.max(a, axis=axis, out=out, keepdims=keepdims)
Return the maximum of an array or maximum along an axis. Parameters ---------- a : ndarray Input data. axis : int, optional Axis along which to operate. By default, flattened input is used. out : ndarray, optional Alternative output array in which to place the result. Must...
Return the maximum of an array or maximum along an axis.
[ "Return", "the", "maximum", "of", "an", "array", "or", "maximum", "along", "an", "axis", "." ]
def max(a, axis=None, out=None, keepdims=False): """ Return the maximum of an array or maximum along an axis. Parameters ---------- a : ndarray Input data. axis : int, optional Axis along which to operate. By default, flattened input is used. out : ndarray, optional ...
[ "def", "max", "(", "a", ",", "axis", "=", "None", ",", "out", "=", "None", ",", "keepdims", "=", "False", ")", ":", "return", "_mx_nd_np", ".", "max", "(", "a", ",", "axis", "=", "axis", ",", "out", "=", "out", ",", "keepdims", "=", "keepdims", ...
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/numpy/multiarray.py#L7824-L7885
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_windows.py
python
PrintPreview.SetPrintout
(*args, **kwargs)
return _windows_.PrintPreview_SetPrintout(*args, **kwargs)
SetPrintout(self, Printout printout)
SetPrintout(self, Printout printout)
[ "SetPrintout", "(", "self", "Printout", "printout", ")" ]
def SetPrintout(*args, **kwargs): """SetPrintout(self, Printout printout)""" return _windows_.PrintPreview_SetPrintout(*args, **kwargs)
[ "def", "SetPrintout", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "PrintPreview_SetPrintout", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L5573-L5575
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/imaplib.py
python
IMAP4_stream.read
(self, size)
return self.readfile.read(size)
Read 'size' bytes from remote.
Read 'size' bytes from remote.
[ "Read", "size", "bytes", "from", "remote", "." ]
def read(self, size): """Read 'size' bytes from remote.""" return self.readfile.read(size)
[ "def", "read", "(", "self", ",", "size", ")", ":", "return", "self", ".", "readfile", ".", "read", "(", "size", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/imaplib.py#L1242-L1244
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/psutil/_pssunos.py
python
users
()
return retlist
Return currently connected users as a list of namedtuples.
Return currently connected users as a list of namedtuples.
[ "Return", "currently", "connected", "users", "as", "a", "list", "of", "namedtuples", "." ]
def users(): """Return currently connected users as a list of namedtuples.""" retlist = [] rawlist = cext.users() localhost = (':0.0', ':0') for item in rawlist: user, tty, hostname, tstamp, user_process, pid = item # note: the underlying C function includes entries about # s...
[ "def", "users", "(", ")", ":", "retlist", "=", "[", "]", "rawlist", "=", "cext", ".", "users", "(", ")", "localhost", "=", "(", "':0.0'", ",", "':0'", ")", "for", "item", "in", "rawlist", ":", "user", ",", "tty", ",", "hostname", ",", "tstamp", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/psutil/_pssunos.py#L308-L324
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPMS_ACT_DATA.toTpm
(self, buf)
TpmMarshaller method
TpmMarshaller method
[ "TpmMarshaller", "method" ]
def toTpm(self, buf): """ TpmMarshaller method """ self.handle.toTpm(buf) buf.writeInt(self.timeout) buf.writeInt(self.attributes)
[ "def", "toTpm", "(", "self", ",", "buf", ")", ":", "self", ".", "handle", ".", "toTpm", "(", "buf", ")", "buf", ".", "writeInt", "(", "self", ".", "timeout", ")", "buf", ".", "writeInt", "(", "self", ".", "attributes", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L4417-L4421
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/autograph/pyct/static_analysis/reaching_definitions.py
python
resolve
(node, source_info, graphs, definition_factory=Definition)
return node
Resolves reaching definitions for each symbol. Args: node: ast.AST source_info: transformer.SourceInfo graphs: Dict[ast.FunctionDef, cfg.Graph] definition_factory: Callable[[], Definition] Returns: ast.AST
Resolves reaching definitions for each symbol.
[ "Resolves", "reaching", "definitions", "for", "each", "symbol", "." ]
def resolve(node, source_info, graphs, definition_factory=Definition): """Resolves reaching definitions for each symbol. Args: node: ast.AST source_info: transformer.SourceInfo graphs: Dict[ast.FunctionDef, cfg.Graph] definition_factory: Callable[[], Definition] Returns: ast.AST """ visit...
[ "def", "resolve", "(", "node", ",", "source_info", ",", "graphs", ",", "definition_factory", "=", "Definition", ")", ":", "visitor", "=", "TreeAnnotator", "(", "source_info", ",", "graphs", ",", "definition_factory", ")", "node", "=", "visitor", ".", "visit", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/autograph/pyct/static_analysis/reaching_definitions.py#L275-L288
google/mozc
7329757e1ad30e327c1ae823a8302c79482d6b9c
src/win32/installer/postbuilds_win.py
python
PrintErrorAndExit
(error_message)
Prints the error message and exists.
Prints the error message and exists.
[ "Prints", "the", "error", "message", "and", "exists", "." ]
def PrintErrorAndExit(error_message): """Prints the error message and exists.""" print(error_message) sys.exit(1)
[ "def", "PrintErrorAndExit", "(", "error_message", ")", ":", "print", "(", "error_message", ")", "sys", ".", "exit", "(", "1", ")" ]
https://github.com/google/mozc/blob/7329757e1ad30e327c1ae823a8302c79482d6b9c/src/win32/installer/postbuilds_win.py#L128-L131
acbull/Unbiased_LambdaMart
7c39abe5caa18ca07df2d23c2db392916d92956c
Unbias_LightGBM/python-package/lightgbm/plotting.py
python
plot_metric
(booster, metric=None, dataset_names=None, ax=None, xlim=None, ylim=None, title='Metric during training', xlabel='Iterations', ylabel='auto', figsize=None, grid=True)
return ax
Plot one metric during training. Parameters ---------- booster : dict or LGBMModel Dictionary returned from ``lightgbm.train()`` or LGBMModel instance. metric : string or None, optional (default=None) The metric name to plot. Only one metric supported because different metrics h...
Plot one metric during training.
[ "Plot", "one", "metric", "during", "training", "." ]
def plot_metric(booster, metric=None, dataset_names=None, ax=None, xlim=None, ylim=None, title='Metric during training', xlabel='Iterations', ylabel='auto', figsize=None, grid=True): """Plot one metric during training. Parameters ---------- ...
[ "def", "plot_metric", "(", "booster", ",", "metric", "=", "None", ",", "dataset_names", "=", "None", ",", "ax", "=", "None", ",", "xlim", "=", "None", ",", "ylim", "=", "None", ",", "title", "=", "'Metric during training'", ",", "xlabel", "=", "'Iteratio...
https://github.com/acbull/Unbiased_LambdaMart/blob/7c39abe5caa18ca07df2d23c2db392916d92956c/Unbias_LightGBM/python-package/lightgbm/plotting.py#L131-L252
nvdla/sw
79538ba1b52b040a4a4645f630e457fa01839e90
umd/external/protobuf-2.6/python/google/protobuf/internal/python_message.py
python
_GetFieldByName
(message_descriptor, field_name)
Returns a field descriptor by field name. Args: message_descriptor: A Descriptor describing all fields in message. field_name: The name of the field to retrieve. Returns: The field descriptor associated with the field name.
Returns a field descriptor by field name.
[ "Returns", "a", "field", "descriptor", "by", "field", "name", "." ]
def _GetFieldByName(message_descriptor, field_name): """Returns a field descriptor by field name. Args: message_descriptor: A Descriptor describing all fields in message. field_name: The name of the field to retrieve. Returns: The field descriptor associated with the field name. """ try: retu...
[ "def", "_GetFieldByName", "(", "message_descriptor", ",", "field_name", ")", ":", "try", ":", "return", "message_descriptor", ".", "fields_by_name", "[", "field_name", "]", "except", "KeyError", ":", "raise", "ValueError", "(", "'Protocol message has no \"%s\" field.'",...
https://github.com/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/google/protobuf/internal/python_message.py#L351-L363
kevinlin311tw/cvpr16-deepbit
c60fb3233d7d534cfcee9d3ed47d77af437ee32a
python/caffe/draw.py
python
choose_color_by_layertype
(layertype)
return color
Define colors for nodes based on the layer type.
Define colors for nodes based on the layer type.
[ "Define", "colors", "for", "nodes", "based", "on", "the", "layer", "type", "." ]
def choose_color_by_layertype(layertype): """Define colors for nodes based on the layer type. """ color = '#6495ED' # Default if layertype == 'Convolution': color = '#FF5050' elif layertype == 'Pooling': color = '#FF9900' elif layertype == 'InnerProduct': color = '#CC33F...
[ "def", "choose_color_by_layertype", "(", "layertype", ")", ":", "color", "=", "'#6495ED'", "# Default", "if", "layertype", "==", "'Convolution'", ":", "color", "=", "'#FF5050'", "elif", "layertype", "==", "'Pooling'", ":", "color", "=", "'#FF9900'", "elif", "lay...
https://github.com/kevinlin311tw/cvpr16-deepbit/blob/c60fb3233d7d534cfcee9d3ed47d77af437ee32a/python/caffe/draw.py#L108-L118
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/command/build_ext.py
python
build_ext.links_to_dynamic
(self, ext)
return any(pkg + libname in libnames for libname in ext.libraries)
Return true if 'ext' links to a dynamic lib in the same package
Return true if 'ext' links to a dynamic lib in the same package
[ "Return", "true", "if", "ext", "links", "to", "a", "dynamic", "lib", "in", "the", "same", "package" ]
def links_to_dynamic(self, ext): """Return true if 'ext' links to a dynamic lib in the same package""" # XXX this should check to ensure the lib is actually being built # XXX as dynamic, and not just using a locally-found version or a # XXX static-compiled version libnames = dict...
[ "def", "links_to_dynamic", "(", "self", ",", "ext", ")", ":", "# XXX this should check to ensure the lib is actually being built", "# XXX as dynamic, and not just using a locally-found version or a", "# XXX static-compiled version", "libnames", "=", "dict", ".", "fromkeys", "(", "[...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/command/build_ext.py#L215-L222
naver/sling
5671cd445a2caae0b4dd0332299e4cfede05062c
webkit/Tools/Scripts/webkitpy/thirdparty/irc/irclib.py
python
ServerConnection.ping
(self, target, target2="")
Send a PING command.
Send a PING command.
[ "Send", "a", "PING", "command", "." ]
def ping(self, target, target2=""): """Send a PING command.""" self.send_raw("PING %s%s" % (target, target2 and (" " + target2)))
[ "def", "ping", "(", "self", ",", "target", ",", "target2", "=", "\"\"", ")", ":", "self", ".", "send_raw", "(", "\"PING %s%s\"", "%", "(", "target", ",", "target2", "and", "(", "\" \"", "+", "target2", ")", ")", ")" ]
https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/thirdparty/irc/irclib.py#L755-L757
stellar-deprecated/stellard
67eabb2217bdfa9a6ea317f62338fb6bca458c90
src/protobuf/python/google/protobuf/internal/containers.py
python
RepeatedCompositeFieldContainer.remove
(self, elem)
Removes an item from the list. Similar to list.remove().
Removes an item from the list. Similar to list.remove().
[ "Removes", "an", "item", "from", "the", "list", ".", "Similar", "to", "list", ".", "remove", "()", "." ]
def remove(self, elem): """Removes an item from the list. Similar to list.remove().""" self._values.remove(elem) self._message_listener.Modified()
[ "def", "remove", "(", "self", ",", "elem", ")", ":", "self", ".", "_values", ".", "remove", "(", "elem", ")", "self", ".", "_message_listener", ".", "Modified", "(", ")" ]
https://github.com/stellar-deprecated/stellard/blob/67eabb2217bdfa9a6ea317f62338fb6bca458c90/src/protobuf/python/google/protobuf/internal/containers.py#L243-L246
KratosMultiphysics/Kratos
0000833054ed0503424eb28205d6508d9ca6cbbc
applications/GeoMechanicsApplication/python_scripts/geomechanics_solver.py
python
GeoMechanicalSolver.Initialize
(self)
Perform initialization after adding nodal variables and dofs to the main model part.
Perform initialization after adding nodal variables and dofs to the main model part.
[ "Perform", "initialization", "after", "adding", "nodal", "variables", "and", "dofs", "to", "the", "main", "model", "part", "." ]
def Initialize(self): """Perform initialization after adding nodal variables and dofs to the main model part. """ pass
[ "def", "Initialize", "(", "self", ")", ":", "pass" ]
https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/GeoMechanicsApplication/python_scripts/geomechanics_solver.py#L106-L108
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/utils/tf_utils.py
python
shape_type_conversion
(fn)
return wrapper
Decorator that handles tuple/TensorShape conversion. Used in `compute_output_shape` and `build`. Arguments: fn: function to wrap. Returns: Wrapped function.
Decorator that handles tuple/TensorShape conversion.
[ "Decorator", "that", "handles", "tuple", "/", "TensorShape", "conversion", "." ]
def shape_type_conversion(fn): """Decorator that handles tuple/TensorShape conversion. Used in `compute_output_shape` and `build`. Arguments: fn: function to wrap. Returns: Wrapped function. """ def wrapper(instance, input_shape): # Pass shapes as tuples to `fn` # This preserves compatib...
[ "def", "shape_type_conversion", "(", "fn", ")", ":", "def", "wrapper", "(", "instance", ",", "input_shape", ")", ":", "# Pass shapes as tuples to `fn`", "# This preserves compatibility with external Keras.", "if", "input_shape", "is", "not", "None", ":", "input_shape", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/utils/tf_utils.py#L289-L312
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPMT_ASYM_SCHEME.fromTpm
(buf)
return buf.createObj(TPMT_ASYM_SCHEME)
Returns new TPMT_ASYM_SCHEME object constructed from its marshaled representation in the given TpmBuffer buffer
Returns new TPMT_ASYM_SCHEME object constructed from its marshaled representation in the given TpmBuffer buffer
[ "Returns", "new", "TPMT_ASYM_SCHEME", "object", "constructed", "from", "its", "marshaled", "representation", "in", "the", "given", "TpmBuffer", "buffer" ]
def fromTpm(buf): """ Returns new TPMT_ASYM_SCHEME object constructed from its marshaled representation in the given TpmBuffer buffer """ return buf.createObj(TPMT_ASYM_SCHEME)
[ "def", "fromTpm", "(", "buf", ")", ":", "return", "buf", ".", "createObj", "(", "TPMT_ASYM_SCHEME", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L7026-L7030
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/graph_editor/select.py
python
select_ts
(*args, **kwargs)
return ts
Helper to select tensors. Args: *args: list of 1) regular expressions (compiled or not) or 2) (array of) tf.Tensor. tf.Operation instances are silently ignored. **kwargs: 'graph': tf.Graph in which to perform the regex query.This is required when using regex. 'positive_filter': an elem if ...
Helper to select tensors.
[ "Helper", "to", "select", "tensors", "." ]
def select_ts(*args, **kwargs): """Helper to select tensors. Args: *args: list of 1) regular expressions (compiled or not) or 2) (array of) tf.Tensor. tf.Operation instances are silently ignored. **kwargs: 'graph': tf.Graph in which to perform the regex query.This is required when using regex....
[ "def", "select_ts", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# get keywords arguments", "graph", "=", "None", "positive_filter", "=", "None", "restrict_ts_regex", "=", "False", "for", "k", ",", "v", "in", "iteritems", "(", "kwargs", ")", ":", ...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/graph_editor/select.py#L638-L701
vnpy/vnpy
f50f2535ed39dd33272e0985ed40c7078e4c19f6
vnpy/chart/widget.py
python
ChartWidget._on_key_up
(self)
Zoom in the chart.
Zoom in the chart.
[ "Zoom", "in", "the", "chart", "." ]
def _on_key_up(self) -> None: """ Zoom in the chart. """ self._bar_count /= 1.2 self._bar_count = max(int(self._bar_count), self.MIN_BAR_COUNT) self._update_x_range() self._cursor.update_info()
[ "def", "_on_key_up", "(", "self", ")", "->", "None", ":", "self", ".", "_bar_count", "/=", "1.2", "self", ".", "_bar_count", "=", "max", "(", "int", "(", "self", ".", "_bar_count", ")", ",", "self", ".", "MIN_BAR_COUNT", ")", "self", ".", "_update_x_ra...
https://github.com/vnpy/vnpy/blob/f50f2535ed39dd33272e0985ed40c7078e4c19f6/vnpy/chart/widget.py#L287-L295
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
media/tools/bug_hunter/bug_hunter.py
python
BugHunterUtils.SendEmail
(message, sender_email_address, receivers_email_address, subject)
return False
Send email using localhost's mail server. Args: message: Email message to be sent. sender_email_address: Sender's email address. receivers_email_address: Receiver's email address. subject: Email subject. Returns: True if successful; False, otherwise.
Send email using localhost's mail server.
[ "Send", "email", "using", "localhost", "s", "mail", "server", "." ]
def SendEmail(message, sender_email_address, receivers_email_address, subject): """Send email using localhost's mail server. Args: message: Email message to be sent. sender_email_address: Sender's email address. receivers_email_address: Receiver's email address. subject:...
[ "def", "SendEmail", "(", "message", ",", "sender_email_address", ",", "receivers_email_address", ",", "subject", ")", ":", "try", ":", "html", "=", "'<html><head></head><body>%s</body></html>'", "%", "message", "msg", "=", "MIMEMultipart", "(", "'alternative'", ")", ...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/media/tools/bug_hunter/bug_hunter.py#L336-L366
qboticslabs/mastering_ros
d83e78f30acc45b0f18522c1d5fae3a7f52974b9
chapter_9_codes/chefbot/chefbot/chefbot_bringup/scripts/bkup_working/GoalsSequencer.py
python
SimpleGoalsFileParser._ParseFrameId
(self, trimmedLine)
return nameValueParts[1].strip()
Takes as input text like this: frame_id: /map
Takes as input text like this: frame_id: /map
[ "Takes", "as", "input", "text", "like", "this", ":", "frame_id", ":", "/", "map" ]
def _ParseFrameId(self, trimmedLine): ''' Takes as input text like this: frame_id: /map ''' nameValueParts = trimmedLine.split(':') if nameValueParts[0].strip() != 'frame_id': raise NameError('Expected variable name frame_id but found ' + nameValueParts[0].strip()) return nameValueParts[1].strip()
[ "def", "_ParseFrameId", "(", "self", ",", "trimmedLine", ")", ":", "nameValueParts", "=", "trimmedLine", ".", "split", "(", "':'", ")", "if", "nameValueParts", "[", "0", "]", ".", "strip", "(", ")", "!=", "'frame_id'", ":", "raise", "NameError", "(", "'E...
https://github.com/qboticslabs/mastering_ros/blob/d83e78f30acc45b0f18522c1d5fae3a7f52974b9/chapter_9_codes/chefbot/chefbot/chefbot_bringup/scripts/bkup_working/GoalsSequencer.py#L303-L312
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/robotsim.py
python
IKObjective.link
(self)
return _robotsim.IKObjective_link(self)
link(IKObjective self) -> int The index of the robot link that is constrained.
link(IKObjective self) -> int
[ "link", "(", "IKObjective", "self", ")", "-", ">", "int" ]
def link(self): """ link(IKObjective self) -> int The index of the robot link that is constrained. """ return _robotsim.IKObjective_link(self)
[ "def", "link", "(", "self", ")", ":", "return", "_robotsim", ".", "IKObjective_link", "(", "self", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L6184-L6193
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
TreeCtrl.GetBoundingRect
(*args, **kwargs)
return _controls_.TreeCtrl_GetBoundingRect(*args, **kwargs)
GetBoundingRect(self, TreeItemId item, bool textOnly=False) -> PyObject
GetBoundingRect(self, TreeItemId item, bool textOnly=False) -> PyObject
[ "GetBoundingRect", "(", "self", "TreeItemId", "item", "bool", "textOnly", "=", "False", ")", "-", ">", "PyObject" ]
def GetBoundingRect(*args, **kwargs): """GetBoundingRect(self, TreeItemId item, bool textOnly=False) -> PyObject""" return _controls_.TreeCtrl_GetBoundingRect(*args, **kwargs)
[ "def", "GetBoundingRect", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "TreeCtrl_GetBoundingRect", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L5550-L5552
greenheartgames/greenworks
3ea4ab490b56676de3f0a237c74bcfdb17323e60
deps/cpplint/cpplint.py
python
ParseArguments
(args)
return filenames
Parses the command line arguments. This may set the output format and verbosity level as side-effects. Args: args: The command line arguments: Returns: The list of filenames to lint.
Parses the command line arguments.
[ "Parses", "the", "command", "line", "arguments", "." ]
def ParseArguments(args): """Parses the command line arguments. This may set the output format and verbosity level as side-effects. Args: args: The command line arguments: Returns: The list of filenames to lint. """ try: (opts, filenames) = getopt.getopt(args, '', ['help', 'output=', 'verbose...
[ "def", "ParseArguments", "(", "args", ")", ":", "try", ":", "(", "opts", ",", "filenames", ")", "=", "getopt", ".", "getopt", "(", "args", ",", "''", ",", "[", "'help'", ",", "'output='", ",", "'verbose='", ",", "'counting='", ",", "'filter='", ",", ...
https://github.com/greenheartgames/greenworks/blob/3ea4ab490b56676de3f0a237c74bcfdb17323e60/deps/cpplint/cpplint.py#L6062-L6132
root-project/root
fcd3583bb14852bf2e8cd2415717cbaac0e75896
interpreter/llvm/src/tools/clang/bindings/python/clang/cindex.py
python
TypeKind.spelling
(self)
return conf.lib.clang_getTypeKindSpelling(self.value)
Retrieve the spelling of this TypeKind.
Retrieve the spelling of this TypeKind.
[ "Retrieve", "the", "spelling", "of", "this", "TypeKind", "." ]
def spelling(self): """Retrieve the spelling of this TypeKind.""" return conf.lib.clang_getTypeKindSpelling(self.value)
[ "def", "spelling", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getTypeKindSpelling", "(", "self", ".", "value", ")" ]
https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/interpreter/llvm/src/tools/clang/bindings/python/clang/cindex.py#L2023-L2025
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/symbol/symbol.py
python
Symbol.infer_type_partial
(self, *args, **kwargs)
return self._infer_type_impl(True, *args, **kwargs)
Infers the type partially. This functions works the same way as `infer_type`, except that this function can return partial results. In the following example, information about fc2 is not available. So, `infer_shape` will return a tuple of `None` values but `infer_shape_partial` will re...
Infers the type partially.
[ "Infers", "the", "type", "partially", "." ]
def infer_type_partial(self, *args, **kwargs): """Infers the type partially. This functions works the same way as `infer_type`, except that this function can return partial results. In the following example, information about fc2 is not available. So, `infer_shape` will return ...
[ "def", "infer_type_partial", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "_infer_type_impl", "(", "True", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/symbol/symbol.py#L967-L1013
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/gslib/commands/rsync.py
python
_RootListingExceptionHandler
(cls, e)
Simple exception handler for exceptions during listing URLs to sync.
Simple exception handler for exceptions during listing URLs to sync.
[ "Simple", "exception", "handler", "for", "exceptions", "during", "listing", "URLs", "to", "sync", "." ]
def _RootListingExceptionHandler(cls, e): """Simple exception handler for exceptions during listing URLs to sync.""" cls.logger.error(str(e))
[ "def", "_RootListingExceptionHandler", "(", "cls", ",", "e", ")", ":", "cls", ".", "logger", ".", "error", "(", "str", "(", "e", ")", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/commands/rsync.py#L912-L914
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/diagonal-traverse-ii.py
python
Solution2.findDiagonalOrder
(self, nums)
return [num for row in result for num in reversed(row)]
:type nums: List[List[int]] :rtype: List[int]
:type nums: List[List[int]] :rtype: List[int]
[ ":", "type", "nums", ":", "List", "[", "List", "[", "int", "]]", ":", "rtype", ":", "List", "[", "int", "]" ]
def findDiagonalOrder(self, nums): """ :type nums: List[List[int]] :rtype: List[int] """ result = [] for r, row in enumerate(nums): for c, num in enumerate(row): if len(result) <= r+c: result.append([]) resul...
[ "def", "findDiagonalOrder", "(", "self", ",", "nums", ")", ":", "result", "=", "[", "]", "for", "r", ",", "row", "in", "enumerate", "(", "nums", ")", ":", "for", "c", ",", "num", "in", "enumerate", "(", "row", ")", ":", "if", "len", "(", "result"...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/diagonal-traverse-ii.py#L30-L41
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/framework/ops.py
python
name_scope
(name)
return get_default_graph().name_scope(name)
Wrapper for `Graph.name_scope()` using the default graph. See [`Graph.name_scope()`](../../api_docs/python/framework.md#Graph.name_scope) for more details. Args: name: A name for the scope. Returns: A context manager that installs `name` as a new name scope in the default graph.
Wrapper for `Graph.name_scope()` using the default graph.
[ "Wrapper", "for", "Graph", ".", "name_scope", "()", "using", "the", "default", "graph", "." ]
def name_scope(name): """Wrapper for `Graph.name_scope()` using the default graph. See [`Graph.name_scope()`](../../api_docs/python/framework.md#Graph.name_scope) for more details. Args: name: A name for the scope. Returns: A context manager that installs `name` as a new name scope in the def...
[ "def", "name_scope", "(", "name", ")", ":", "return", "get_default_graph", "(", ")", ".", "name_scope", "(", "name", ")" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/framework/ops.py#L3467-L3481
microsoft/BlingFire
7634ad43b521ee6a596266d82c3f0c46cd43e222
ldbsrc/bert_base_tok/tokenization.py
python
BasicTokenizer.__init__
(self, do_lower_case=True)
Constructs a BasicTokenizer. Args: do_lower_case: Whether to lower case the input.
Constructs a BasicTokenizer.
[ "Constructs", "a", "BasicTokenizer", "." ]
def __init__(self, do_lower_case=True): """Constructs a BasicTokenizer. Args: do_lower_case: Whether to lower case the input. """ self.do_lower_case = do_lower_case
[ "def", "__init__", "(", "self", ",", "do_lower_case", "=", "True", ")", ":", "self", ".", "do_lower_case", "=", "do_lower_case" ]
https://github.com/microsoft/BlingFire/blob/7634ad43b521ee6a596266d82c3f0c46cd43e222/ldbsrc/bert_base_tok/tokenization.py#L188-L194
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/utils.py
python
LRUCache.itervalue
(self)
return iter(self.values())
Iterate over all values.
Iterate over all values.
[ "Iterate", "over", "all", "values", "." ]
def itervalue(self): """Iterate over all values.""" return iter(self.values())
[ "def", "itervalue", "(", "self", ")", ":", "return", "iter", "(", "self", ".", "values", "(", ")", ")" ]
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/utils.py#L457-L459
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/compiler.py
python
CUDAKernelBase._serialize_config
(self)
return self.griddim, self.blockdim, self.sharedmem
Helper for serializing the grid, block and shared memory configuration. CUDA stream config is not serialized.
Helper for serializing the grid, block and shared memory configuration. CUDA stream config is not serialized.
[ "Helper", "for", "serializing", "the", "grid", "block", "and", "shared", "memory", "configuration", ".", "CUDA", "stream", "config", "is", "not", "serialized", "." ]
def _serialize_config(self): """ Helper for serializing the grid, block and shared memory configuration. CUDA stream config is not serialized. """ return self.griddim, self.blockdim, self.sharedmem
[ "def", "_serialize_config", "(", "self", ")", ":", "return", "self", ".", "griddim", ",", "self", ".", "blockdim", ",", "self", ".", "sharedmem" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/compiler.py#L362-L367
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/maximum-number-of-events-that-can-be-attended.py
python
Solution.maxEvents
(self, events)
return result
:type events: List[List[int]] :rtype: int
:type events: List[List[int]] :rtype: int
[ ":", "type", "events", ":", "List", "[", "List", "[", "int", "]]", ":", "rtype", ":", "int" ]
def maxEvents(self, events): """ :type events: List[List[int]] :rtype: int """ events.sort(reverse=True) min_heap = [] result = 0 for d in xrange(1, max(events, key=lambda x:x[1])[1]+1): while events and events[-1][0] == d: heap...
[ "def", "maxEvents", "(", "self", ",", "events", ")", ":", "events", ".", "sort", "(", "reverse", "=", "True", ")", "min_heap", "=", "[", "]", "result", "=", "0", "for", "d", "in", "xrange", "(", "1", ",", "max", "(", "events", ",", "key", "=", ...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/maximum-number-of-events-that-can-be-attended.py#L8-L25
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py3/IPython/core/completerlib.py
python
quick_completer
(cmd, completions)
r""" Easily create a trivial completer for a command. Takes either a list of completions, or all completions in string (that will be split on whitespace). Example:: [d:\ipython]|1> import ipy_completers [d:\ipython]|2> ipy_completers.quick_completer('foo', ['bar','baz']) [d:\ipyth...
r""" Easily create a trivial completer for a command.
[ "r", "Easily", "create", "a", "trivial", "completer", "for", "a", "command", "." ]
def quick_completer(cmd, completions): r""" Easily create a trivial completer for a command. Takes either a list of completions, or all completions in string (that will be split on whitespace). Example:: [d:\ipython]|1> import ipy_completers [d:\ipython]|2> ipy_completers.quick_comple...
[ "def", "quick_completer", "(", "cmd", ",", "completions", ")", ":", "if", "isinstance", "(", "completions", ",", "str", ")", ":", "completions", "=", "completions", ".", "split", "(", ")", "def", "do_complete", "(", "self", ",", "event", ")", ":", "retur...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/completerlib.py#L235-L256
numworks/epsilon
8952d2f8b1de1c3f064eec8ffcea804c5594ba4c
build/device/usb/legacy.py
python
DeviceHandle.interruptRead
(self, endpoint, size, timeout = 100)
return self.dev.read(endpoint, size, timeout)
r"""Performs a interrupt read request to the endpoint specified. Arguments: endpoint: endpoint number. size: number of bytes to read. timeout: operation timeout in milliseconds. (default: 100) Returns a tuple with the data read.
r"""Performs a interrupt read request to the endpoint specified.
[ "r", "Performs", "a", "interrupt", "read", "request", "to", "the", "endpoint", "specified", "." ]
def interruptRead(self, endpoint, size, timeout = 100): r"""Performs a interrupt read request to the endpoint specified. Arguments: endpoint: endpoint number. size: number of bytes to read. timeout: operation timeout in milliseconds. (default: 100) ...
[ "def", "interruptRead", "(", "self", ",", "endpoint", ",", "size", ",", "timeout", "=", "100", ")", ":", "return", "self", ".", "dev", ".", "read", "(", "endpoint", ",", "size", ",", "timeout", ")" ]
https://github.com/numworks/epsilon/blob/8952d2f8b1de1c3f064eec8ffcea804c5594ba4c/build/device/usb/legacy.py#L181-L190
ispc/ispc
0a7ee59b6ec50e54d545eb2a31056e54c4891d51
common.py
python
TestTable.__init__
(self)
This dictionary contains {rev: [test1, test2, ...], ...}, where 'rev' is a string (revision name) and 'test#' is a Test() object instance
This dictionary contains {rev: [test1, test2, ...], ...}, where 'rev' is a string (revision name) and 'test#' is a Test() object instance
[ "This", "dictionary", "contains", "{", "rev", ":", "[", "test1", "test2", "...", "]", "...", "}", "where", "rev", "is", "a", "string", "(", "revision", "name", ")", "and", "test#", "is", "a", "Test", "()", "object", "instance" ]
def __init__(self): """ This dictionary contains {rev: [test1, test2, ...], ...}, where 'rev' is a string (revision name) and 'test#' is a Test() object instance """ self.table = {}
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "table", "=", "{", "}" ]
https://github.com/ispc/ispc/blob/0a7ee59b6ec50e54d545eb2a31056e54c4891d51/common.py#L315-L318
scylladb/seastar
0cdd2329beb1cc4c0af8828598c26114397ffa9c
scripts/perftune.py
python
PerfTunerBase.irqs_cpu_mask
(self)
return self.__irq_cpu_mask
Return the mask of CPUs used for IRQs distribution.
Return the mask of CPUs used for IRQs distribution.
[ "Return", "the", "mask", "of", "CPUs", "used", "for", "IRQs", "distribution", "." ]
def irqs_cpu_mask(self): """ Return the mask of CPUs used for IRQs distribution. """ # see the __set_mode_and_masks() description if self.__irq_cpu_mask is None: self.__set_mode_and_masks() return self.__irq_cpu_mask
[ "def", "irqs_cpu_mask", "(", "self", ")", ":", "# see the __set_mode_and_masks() description", "if", "self", ".", "__irq_cpu_mask", "is", "None", ":", "self", ".", "__set_mode_and_masks", "(", ")", "return", "self", ".", "__irq_cpu_mask" ]
https://github.com/scylladb/seastar/blob/0cdd2329beb1cc4c0af8828598c26114397ffa9c/scripts/perftune.py#L395-L403
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/ast.py
python
fix_missing_locations
(node)
return node
When you compile a node tree with compile(), the compiler expects lineno and col_offset attributes for every node that supports them. This is rather tedious to fill in for generated nodes, so this helper adds these attributes recursively where not already set, by setting them to the values of the paren...
When you compile a node tree with compile(), the compiler expects lineno and col_offset attributes for every node that supports them. This is rather tedious to fill in for generated nodes, so this helper adds these attributes recursively where not already set, by setting them to the values of the paren...
[ "When", "you", "compile", "a", "node", "tree", "with", "compile", "()", "the", "compiler", "expects", "lineno", "and", "col_offset", "attributes", "for", "every", "node", "that", "supports", "them", ".", "This", "is", "rather", "tedious", "to", "fill", "in",...
def fix_missing_locations(node): """ When you compile a node tree with compile(), the compiler expects lineno and col_offset attributes for every node that supports them. This is rather tedious to fill in for generated nodes, so this helper adds these attributes recursively where not already set, b...
[ "def", "fix_missing_locations", "(", "node", ")", ":", "def", "_fix", "(", "node", ",", "lineno", ",", "col_offset", ")", ":", "if", "'lineno'", "in", "node", ".", "_attributes", ":", "if", "not", "hasattr", "(", "node", ",", "'lineno'", ")", ":", "nod...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/ast.py#L125-L147
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/auto_bisect/builder.py
python
BuildWithVisualStudio
(targets, build_type='Release')
return not return_code
Runs a command to build the given targets with Visual Studio.
Runs a command to build the given targets with Visual Studio.
[ "Runs", "a", "command", "to", "build", "the", "given", "targets", "with", "Visual", "Studio", "." ]
def BuildWithVisualStudio(targets, build_type='Release'): """Runs a command to build the given targets with Visual Studio.""" path_to_devenv = os.path.abspath( os.path.join(os.environ['VS100COMNTOOLS'], '..', 'IDE', 'devenv.com')) path_to_sln = os.path.join(os.getcwd(), 'chrome', 'chrome.sln') cmd = [path...
[ "def", "BuildWithVisualStudio", "(", "targets", ",", "build_type", "=", "'Release'", ")", ":", "path_to_devenv", "=", "os", ".", "path", ".", "abspath", "(", "os", ".", "path", ".", "join", "(", "os", ".", "environ", "[", "'VS100COMNTOOLS'", "]", ",", "'...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/auto_bisect/builder.py#L282-L291
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/framework/errors.py
python
PermissionDeniedError.__init__
(self, node_def, op, message)
Creates a `PermissionDeniedError`.
Creates a `PermissionDeniedError`.
[ "Creates", "a", "PermissionDeniedError", "." ]
def __init__(self, node_def, op, message): """Creates a `PermissionDeniedError`.""" super(PermissionDeniedError, self).__init__(node_def, op, message, PERMISSION_DENIED)
[ "def", "__init__", "(", "self", ",", "node_def", ",", "op", ",", "message", ")", ":", "super", "(", "PermissionDeniedError", ",", "self", ")", ".", "__init__", "(", "node_def", ",", "op", ",", "message", ",", "PERMISSION_DENIED", ")" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/framework/errors.py#L265-L268
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pyparsing.py
python
dictOf
( key, value )
return Dict(OneOrMore(Group(key + value)))
Helper to easily and clearly define a dictionary by specifying the respective patterns for the key and value. Takes care of defining the :class:`Dict`, :class:`ZeroOrMore`, and :class:`Group` tokens in the proper order. The key pattern can include delimiting markers or punctuation, as long as they are...
Helper to easily and clearly define a dictionary by specifying the respective patterns for the key and value. Takes care of defining the :class:`Dict`, :class:`ZeroOrMore`, and :class:`Group` tokens in the proper order. The key pattern can include delimiting markers or punctuation, as long as they are...
[ "Helper", "to", "easily", "and", "clearly", "define", "a", "dictionary", "by", "specifying", "the", "respective", "patterns", "for", "the", "key", "and", "value", ".", "Takes", "care", "of", "defining", "the", ":", "class", ":", "Dict", ":", "class", ":", ...
def dictOf( key, value ): """Helper to easily and clearly define a dictionary by specifying the respective patterns for the key and value. Takes care of defining the :class:`Dict`, :class:`ZeroOrMore`, and :class:`Group` tokens in the proper order. The key pattern can include delimiting markers or...
[ "def", "dictOf", "(", "key", ",", "value", ")", ":", "return", "Dict", "(", "OneOrMore", "(", "Group", "(", "key", "+", "value", ")", ")", ")" ]
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pyparsing.py#L5107-L5144
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
caffe2/python/data_parallel_model.py
python
_GroupByDevice
(model, devices, params, non_data_params)
return grouped
Groups blobs by device, returning a map of [blobname] = {0: BlobRef, 1: ..}. Returns ordered dictionary, ensuring the original order.
Groups blobs by device, returning a map of [blobname] = {0: BlobRef, 1: ..}. Returns ordered dictionary, ensuring the original order.
[ "Groups", "blobs", "by", "device", "returning", "a", "map", "of", "[", "blobname", "]", "=", "{", "0", ":", "BlobRef", "1", ":", "..", "}", ".", "Returns", "ordered", "dictionary", "ensuring", "the", "original", "order", "." ]
def _GroupByDevice(model, devices, params, non_data_params): ''' Groups blobs by device, returning a map of [blobname] = {0: BlobRef, 1: ..}. Returns ordered dictionary, ensuring the original order. ''' grouped = OrderedDict() # Only consider params that were created to be "data parallel" p...
[ "def", "_GroupByDevice", "(", "model", ",", "devices", ",", "params", ",", "non_data_params", ")", ":", "grouped", "=", "OrderedDict", "(", ")", "# Only consider params that were created to be \"data parallel\"", "params", "=", "params", "[", "len", "(", "non_data_pa...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/caffe2/python/data_parallel_model.py#L1644-L1676
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
js/xpconnect/src/qsgen.py
python
isSpecificInterfaceType
(t, name)
return t.kind in ('interface', 'forward') and t.name == name
True if `t` is an interface type with the given name, or a forward declaration or typedef aliasing it. `name` must not be the name of a typedef but the actual name of the interface.
True if `t` is an interface type with the given name, or a forward declaration or typedef aliasing it.
[ "True", "if", "t", "is", "an", "interface", "type", "with", "the", "given", "name", "or", "a", "forward", "declaration", "or", "typedef", "aliasing", "it", "." ]
def isSpecificInterfaceType(t, name): """ True if `t` is an interface type with the given name, or a forward declaration or typedef aliasing it. `name` must not be the name of a typedef but the actual name of the interface. """ t = unaliasType(t) return t.kind in ('interface', 'forward') an...
[ "def", "isSpecificInterfaceType", "(", "t", ",", "name", ")", ":", "t", "=", "unaliasType", "(", "t", ")", "return", "t", ".", "kind", "in", "(", "'interface'", ",", "'forward'", ")", "and", "t", ".", "name", "==", "name" ]
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/js/xpconnect/src/qsgen.py#L111-L119
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/util.py
python
EventMixin.get_subscribers
(self, event)
return iter(self._subscribers.get(event, ()))
Return an iterator for the subscribers for an event. :param event: The event to return subscribers for.
[]
def get_subscribers(self, event): """ Return an iterator for the subscribers for an event. :param event: The event to return subscribers for. """ return iter(self._subscribers.get(event, ()))
[ "def", "get_subscribers", "(", "self", ",", "event", ")", ":", "return", "iter", "(", "self", ".", "_subscribers", ".", "get", "(", "event", ",", "(", ")", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/util.py#L2047-L2057
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/ConfigParser.py
python
RawConfigParser.sections
(self)
return self._sections.keys()
Return a list of section names, excluding [DEFAULT]
Return a list of section names, excluding [DEFAULT]
[ "Return", "a", "list", "of", "section", "names", "excluding", "[", "DEFAULT", "]" ]
def sections(self): """Return a list of section names, excluding [DEFAULT]""" # self._sections will never have [DEFAULT] in it return self._sections.keys()
[ "def", "sections", "(", "self", ")", ":", "# self._sections will never have [DEFAULT] in it", "return", "self", ".", "_sections", ".", "keys", "(", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/ConfigParser.py#L248-L251
Slicer/SlicerGitSVNArchive
65e92bb16c2b32ea47a1a66bee71f238891ee1ca
Modules/Scripted/EditorLib/MakeModelEffect.py
python
MakeModelEffectOptions.updateParameterNode
(self, caller, event)
note: this method needs to be implemented exactly as defined in the leaf classes in EditOptions.py in each leaf subclass so that "self" in the observer is of the correct type
note: this method needs to be implemented exactly as defined in the leaf classes in EditOptions.py in each leaf subclass so that "self" in the observer is of the correct type
[ "note", ":", "this", "method", "needs", "to", "be", "implemented", "exactly", "as", "defined", "in", "the", "leaf", "classes", "in", "EditOptions", ".", "py", "in", "each", "leaf", "subclass", "so", "that", "self", "in", "the", "observer", "is", "of", "t...
def updateParameterNode(self, caller, event): """ note: this method needs to be implemented exactly as defined in the leaf classes in EditOptions.py in each leaf subclass so that "self" in the observer is of the correct type """ node = EditUtil.getParameterNode() if node != self.parameterNod...
[ "def", "updateParameterNode", "(", "self", ",", "caller", ",", "event", ")", ":", "node", "=", "EditUtil", ".", "getParameterNode", "(", ")", "if", "node", "!=", "self", ".", "parameterNode", ":", "if", "self", ".", "parameterNode", ":", "node", ".", "Re...
https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Modules/Scripted/EditorLib/MakeModelEffect.py#L97-L108
raymondlu/super-animation-samples
04234269112ff0dc32447f27a761dbbb00b8ba17
samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py
python
TranslationUnit.get_extent
(self, filename, locations)
return SourceRange.from_locations(start_location, end_location)
Obtain a SourceRange from this translation unit. The bounds of the SourceRange must ultimately be defined by a start and end SourceLocation. For the locations argument, you can pass: - 2 SourceLocation instances in a 2-tuple or list. - 2 int file offsets via a 2-tuple or list. ...
Obtain a SourceRange from this translation unit.
[ "Obtain", "a", "SourceRange", "from", "this", "translation", "unit", "." ]
def get_extent(self, filename, locations): """Obtain a SourceRange from this translation unit. The bounds of the SourceRange must ultimately be defined by a start and end SourceLocation. For the locations argument, you can pass: - 2 SourceLocation instances in a 2-tuple or list. ...
[ "def", "get_extent", "(", "self", ",", "filename", ",", "locations", ")", ":", "f", "=", "self", ".", "get_file", "(", "filename", ")", "if", "len", "(", "locations", ")", "<", "2", ":", "raise", "Exception", "(", "'Must pass object with at least 2 elements'...
https://github.com/raymondlu/super-animation-samples/blob/04234269112ff0dc32447f27a761dbbb00b8ba17/samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L2139-L2177
KratosMultiphysics/Kratos
0000833054ed0503424eb28205d6508d9ca6cbbc
kratos/python_scripts/check_scalar_to_nodes_process.py
python
CheckScalarToNodesProcess.__init__
(self, Model, settings )
The default constructor of the class Keyword arguments: self -- It signifies an instance of a class. Model -- the container of the different model parts. settings -- Kratos parameters containing solver settings.
The default constructor of the class
[ "The", "default", "constructor", "of", "the", "class" ]
def __init__(self, Model, settings ): """ The default constructor of the class Keyword arguments: self -- It signifies an instance of a class. Model -- the container of the different model parts. settings -- Kratos parameters containing solver settings. """ defa...
[ "def", "__init__", "(", "self", ",", "Model", ",", "settings", ")", ":", "default_settings", "=", "KratosMultiphysics", ".", "Parameters", "(", "\"\"\"\n {\n \"help\" : \"This process checks analytically from a function the solution (scalar) in a set of n...
https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/kratos/python_scripts/check_scalar_to_nodes_process.py#L23-L102
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/connection.py
python
HTTPConnection.host
(self)
return self._dns_host.rstrip(".")
Getter method to remove any trailing dots that indicate the hostname is an FQDN. In general, SSL certificates don't include the trailing dot indicating a fully-qualified domain name, and thus, they don't validate properly when checked against a domain name that includes the dot. In addition, so...
Getter method to remove any trailing dots that indicate the hostname is an FQDN.
[ "Getter", "method", "to", "remove", "any", "trailing", "dots", "that", "indicate", "the", "hostname", "is", "an", "FQDN", "." ]
def host(self): """ Getter method to remove any trailing dots that indicate the hostname is an FQDN. In general, SSL certificates don't include the trailing dot indicating a fully-qualified domain name, and thus, they don't validate properly when checked against a domain name th...
[ "def", "host", "(", "self", ")", ":", "return", "self", ".", "_dns_host", ".", "rstrip", "(", "\".\"", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/connection.py#L115-L131
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_gdi.py
python
Region.UnionBitmap
(*args, **kwargs)
return _gdi_.Region_UnionBitmap(*args, **kwargs)
UnionBitmap(self, Bitmap bmp) -> bool
UnionBitmap(self, Bitmap bmp) -> bool
[ "UnionBitmap", "(", "self", "Bitmap", "bmp", ")", "-", ">", "bool" ]
def UnionBitmap(*args, **kwargs): """UnionBitmap(self, Bitmap bmp) -> bool""" return _gdi_.Region_UnionBitmap(*args, **kwargs)
[ "def", "UnionBitmap", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "Region_UnionBitmap", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L1635-L1637
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/script_ops.py
python
FuncRegistry.remove
(self, token)
Removes the registered function corresponding to `token`.
Removes the registered function corresponding to `token`.
[ "Removes", "the", "registered", "function", "corresponding", "to", "token", "." ]
def remove(self, token): """Removes the registered function corresponding to `token`.""" self._funcs.pop(token, None)
[ "def", "remove", "(", "self", ",", "token", ")", ":", "self", ".", "_funcs", ".", "pop", "(", "token", ",", "None", ")" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/script_ops.py#L173-L175
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/types/misc.py
python
NoneType.unify
(self, typingctx, other)
return Optional(other)
Turn anything to a Optional type;
Turn anything to a Optional type;
[ "Turn", "anything", "to", "a", "Optional", "type", ";" ]
def unify(self, typingctx, other): """ Turn anything to a Optional type; """ if isinstance(other, (Optional, NoneType)): return other return Optional(other)
[ "def", "unify", "(", "self", ",", "typingctx", ",", "other", ")", ":", "if", "isinstance", "(", "other", ",", "(", "Optional", ",", "NoneType", ")", ")", ":", "return", "other", "return", "Optional", "(", "other", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/types/misc.py#L260-L266
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/peacock/base/MooseWidget.py
python
MooseWidget.stateKey
(self)
return 'default'
Return a unique "key" for saving widget state, see ExodusPlugin.
Return a unique "key" for saving widget state, see ExodusPlugin.
[ "Return", "a", "unique", "key", "for", "saving", "widget", "state", "see", "ExodusPlugin", "." ]
def stateKey(self): """ Return a unique "key" for saving widget state, see ExodusPlugin. """ return 'default'
[ "def", "stateKey", "(", "self", ")", ":", "return", "'default'" ]
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/base/MooseWidget.py#L71-L75
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/resample.py
python
DatetimeIndexResampler._downsample
(self, how, **kwargs)
return self._wrap_result(result)
Downsample the cython defined function. Parameters ---------- how : string / cython mapped function **kwargs : kw args passed to how function
Downsample the cython defined function.
[ "Downsample", "the", "cython", "defined", "function", "." ]
def _downsample(self, how, **kwargs): """ Downsample the cython defined function. Parameters ---------- how : string / cython mapped function **kwargs : kw args passed to how function """ how = com.get_cython_func(how) or how ax = self.ax ...
[ "def", "_downsample", "(", "self", ",", "how", ",", "*", "*", "kwargs", ")", ":", "how", "=", "com", ".", "get_cython_func", "(", "how", ")", "or", "how", "ax", "=", "self", ".", "ax", "obj", "=", "self", ".", "_selected_obj", "if", "not", "len", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/resample.py#L1115-L1152
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/layers/python/layers/feature_column.py
python
_RealValuedVarLenColumn._normalized_input_tensor
(self, input_tensor)
Returns the input tensor after custom normalization is applied.
Returns the input tensor after custom normalization is applied.
[ "Returns", "the", "input", "tensor", "after", "custom", "normalization", "is", "applied", "." ]
def _normalized_input_tensor(self, input_tensor): """Returns the input tensor after custom normalization is applied.""" if self.normalizer is None: return input_tensor if self.is_sparse: return sparse_tensor_py.SparseTensor(input_tensor.indices, self.no...
[ "def", "_normalized_input_tensor", "(", "self", ",", "input_tensor", ")", ":", "if", "self", ".", "normalizer", "is", "None", ":", "return", "input_tensor", "if", "self", ".", "is_sparse", ":", "return", "sparse_tensor_py", ".", "SparseTensor", "(", "input_tenso...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/layers/python/layers/feature_column.py#L1725-L1734
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/aui/tabart.py
python
AuiDefaultTabArt.DrawFocusRectangle
(self, dc, page, wnd, draw_text, text_offset, bitmap_offset, drawn_tab_yoff, drawn_tab_height, textx, texty)
Draws the focus rectangle on a tab. :param `dc`: a :class:`DC` device context; :param `page`: the page associated with the tab; :param `wnd`: a :class:`Window` instance object; :param string `draw_text`: the text that has been drawn on the tab; :param integer `text_offset`: the ...
Draws the focus rectangle on a tab.
[ "Draws", "the", "focus", "rectangle", "on", "a", "tab", "." ]
def DrawFocusRectangle(self, dc, page, wnd, draw_text, text_offset, bitmap_offset, drawn_tab_yoff, drawn_tab_height, textx, texty): """ Draws the focus rectangle on a tab. :param `dc`: a :class:`DC` device context; :param `page`: the page associated with the tab; :param `wnd`: a...
[ "def", "DrawFocusRectangle", "(", "self", ",", "dc", ",", "page", ",", "wnd", ",", "draw_text", ",", "text_offset", ",", "bitmap_offset", ",", "drawn_tab_yoff", ",", "drawn_tab_height", ",", "textx", ",", "texty", ")", ":", "if", "self", ".", "GetAGWFlags", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/tabart.py#L787-L826
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/dockerfiles/assembler.py
python
upload_in_background
(hub_repository, dock, image, tag)
Upload a docker image (to be used by multiprocessing).
Upload a docker image (to be used by multiprocessing).
[ "Upload", "a", "docker", "image", "(", "to", "be", "used", "by", "multiprocessing", ")", "." ]
def upload_in_background(hub_repository, dock, image, tag): """Upload a docker image (to be used by multiprocessing).""" image.tag(hub_repository, tag=tag) print(dock.images.push(hub_repository, tag=tag))
[ "def", "upload_in_background", "(", "hub_repository", ",", "dock", ",", "image", ",", "tag", ")", ":", "image", ".", "tag", "(", "hub_repository", ",", "tag", "=", "tag", ")", "print", "(", "dock", ".", "images", ".", "push", "(", "hub_repository", ",", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/dockerfiles/assembler.py#L432-L435
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/model/coordinates.py
python
Point.worldCoordinates
(self)
return se3.apply(self._frame.worldCoordinates(),self._localCoordinates)
Returns the coordinates of this point in the world Frame
Returns the coordinates of this point in the world Frame
[ "Returns", "the", "coordinates", "of", "this", "point", "in", "the", "world", "Frame" ]
def worldCoordinates(self): """Returns the coordinates of this point in the world Frame""" if self._frame ==None: return self._localCoordinates[:] return se3.apply(self._frame.worldCoordinates(),self._localCoordinates)
[ "def", "worldCoordinates", "(", "self", ")", ":", "if", "self", ".", "_frame", "==", "None", ":", "return", "self", ".", "_localCoordinates", "[", ":", "]", "return", "se3", ".", "apply", "(", "self", ".", "_frame", ".", "worldCoordinates", "(", ")", "...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/model/coordinates.py#L140-L144
zhaoweicai/cascade-rcnn
2252f46158ea6555868ca6fa5c221ea71d9b5e6c
scripts/cpp_lint.py
python
PrintUsage
(message)
Prints a brief usage string and exits, optionally with an error message. Args: message: The optional error message.
Prints a brief usage string and exits, optionally with an error message.
[ "Prints", "a", "brief", "usage", "string", "and", "exits", "optionally", "with", "an", "error", "message", "." ]
def PrintUsage(message): """Prints a brief usage string and exits, optionally with an error message. Args: message: The optional error message. """ sys.stderr.write(_USAGE) if message: sys.exit('\nFATAL ERROR: ' + message) else: sys.exit(1)
[ "def", "PrintUsage", "(", "message", ")", ":", "sys", ".", "stderr", ".", "write", "(", "_USAGE", ")", "if", "message", ":", "sys", ".", "exit", "(", "'\\nFATAL ERROR: '", "+", "message", ")", "else", ":", "sys", ".", "exit", "(", "1", ")" ]
https://github.com/zhaoweicai/cascade-rcnn/blob/2252f46158ea6555868ca6fa5c221ea71d9b5e6c/scripts/cpp_lint.py#L4761-L4771
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/buildscripts/ciconfig/evergreen.py
python
Variant.run_on
(self)
return run_on if run_on is not None else []
The build variant run_on parameter as a list of distro names.
The build variant run_on parameter as a list of distro names.
[ "The", "build", "variant", "run_on", "parameter", "as", "a", "list", "of", "distro", "names", "." ]
def run_on(self): """The build variant run_on parameter as a list of distro names.""" run_on = self.raw.get("run_on") return run_on if run_on is not None else []
[ "def", "run_on", "(", "self", ")", ":", "run_on", "=", "self", ".", "raw", ".", "get", "(", "\"run_on\"", ")", "return", "run_on", "if", "run_on", "is", "not", "None", "else", "[", "]" ]
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/ciconfig/evergreen.py#L138-L141
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/idl/idl/struct_types.py
python
StructTypeInfoBase.get_deserializer_static_method
(self)
Get the public static deserializer method for a struct.
Get the public static deserializer method for a struct.
[ "Get", "the", "public", "static", "deserializer", "method", "for", "a", "struct", "." ]
def get_deserializer_static_method(self): # type: () -> MethodInfo """Get the public static deserializer method for a struct.""" pass
[ "def", "get_deserializer_static_method", "(", "self", ")", ":", "# type: () -> MethodInfo", "pass" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/struct_types.py#L181-L184
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/boxing.py
python
box_enum
(typ, val, c)
return c.pyapi.call_function_objargs(cls_obj, (valobj,))
Fetch an enum member given its native value.
Fetch an enum member given its native value.
[ "Fetch", "an", "enum", "member", "given", "its", "native", "value", "." ]
def box_enum(typ, val, c): """ Fetch an enum member given its native value. """ valobj = c.box(typ.dtype, val) # Call the enum class with the value object cls_obj = c.pyapi.unserialize(c.pyapi.serialize_object(typ.instance_class)) return c.pyapi.call_function_objargs(cls_obj, (valobj,))
[ "def", "box_enum", "(", "typ", ",", "val", ",", "c", ")", ":", "valobj", "=", "c", ".", "box", "(", "typ", ".", "dtype", ",", "val", ")", "# Call the enum class with the value object", "cls_obj", "=", "c", ".", "pyapi", ".", "unserialize", "(", "c", "....
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/boxing.py#L162-L169
tensorflow/io
92b44e180674a8af0e12e405530f7343e3e693e4
tensorflow_io/python/ops/image_ops.py
python
encode_gif
(image, name=None)
return core_ops.io_encode_gif(image, name=name)
Encode a uint8 tensor to gif image. Args: image: A Tensor. 3-D uint8 with shape [N, H, W, C]. name: A name for the operation (optional). Returns: A `Tensor` of type `string`.
Encode a uint8 tensor to gif image.
[ "Encode", "a", "uint8", "tensor", "to", "gif", "image", "." ]
def encode_gif(image, name=None): """ Encode a uint8 tensor to gif image. Args: image: A Tensor. 3-D uint8 with shape [N, H, W, C]. name: A name for the operation (optional). Returns: A `Tensor` of type `string`. """ return core_ops.io_encode_gif(image, name=name)
[ "def", "encode_gif", "(", "image", ",", "name", "=", "None", ")", ":", "return", "core_ops", ".", "io_encode_gif", "(", "image", ",", "name", "=", "name", ")" ]
https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/tensorflow_io/python/ops/image_ops.py#L48-L59
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/jinja2/compiler.py
python
Frame.soft
(self)
return rv
Return a soft frame. A soft frame may not be modified as standalone thing as it shares the resources with the frame it was created of, but it's not a rootlevel frame any longer. This is only used to implement if-statements.
Return a soft frame. A soft frame may not be modified as standalone thing as it shares the resources with the frame it was created of, but it's not a rootlevel frame any longer.
[ "Return", "a", "soft", "frame", ".", "A", "soft", "frame", "may", "not", "be", "modified", "as", "standalone", "thing", "as", "it", "shares", "the", "resources", "with", "the", "frame", "it", "was", "created", "of", "but", "it", "s", "not", "a", "rootl...
def soft(self): """Return a soft frame. A soft frame may not be modified as standalone thing as it shares the resources with the frame it was created of, but it's not a rootlevel frame any longer. This is only used to implement if-statements. """ rv = self.copy() ...
[ "def", "soft", "(", "self", ")", ":", "rv", "=", "self", ".", "copy", "(", ")", "rv", ".", "rootlevel", "=", "False", "return", "rv" ]
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/jinja2/compiler.py#L178-L187
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/EasyDialogs.py
python
AskFolder
( message=None, # From here on the order is not documented version=None, defaultLocation=None, dialogOptionFlags=None, location=None, clientName=None, windowTitle=None, actionButtonLabel=None, cancelButtonLabel=None, preferenceKey=N...
Display a dialog asking the user for select a folder. wanted is the return type wanted: FSSpec, FSRef, unicode or string (default) the other arguments can be looked up in Apple's Navigation Services documentation
Display a dialog asking the user for select a folder.
[ "Display", "a", "dialog", "asking", "the", "user", "for", "select", "a", "folder", "." ]
def AskFolder( message=None, # From here on the order is not documented version=None, defaultLocation=None, dialogOptionFlags=None, location=None, clientName=None, windowTitle=None, actionButtonLabel=None, cancelButtonLabel=None, pr...
[ "def", "AskFolder", "(", "message", "=", "None", ",", "# From here on the order is not documented", "version", "=", "None", ",", "defaultLocation", "=", "None", ",", "dialogOptionFlags", "=", "None", ",", "location", "=", "None", ",", "clientName", "=", "None", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/EasyDialogs.py#L736-L784
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/seq2seq/python/ops/decoder.py
python
dynamic_decode
(decoder, output_time_major=False, impute_finished=False, maximum_iterations=None, parallel_iterations=32, swap_memory=False, scope=None, **kwargs)
return final_outputs, final_state, final_sequence_lengths
Perform dynamic decoding with `decoder`. Calls initialize() once and step() repeatedly on the Decoder object. Args: decoder: A `Decoder` instance. output_time_major: Python boolean. Default: `False` (batch major). If `True`, outputs are returned as time major tensors (this mode is faster). O...
Perform dynamic decoding with `decoder`.
[ "Perform", "dynamic", "decoding", "with", "decoder", "." ]
def dynamic_decode(decoder, output_time_major=False, impute_finished=False, maximum_iterations=None, parallel_iterations=32, swap_memory=False, scope=None, **kwargs): """Perform dynamic...
[ "def", "dynamic_decode", "(", "decoder", ",", "output_time_major", "=", "False", ",", "impute_finished", "=", "False", ",", "maximum_iterations", "=", "None", ",", "parallel_iterations", "=", "32", ",", "swap_memory", "=", "False", ",", "scope", "=", "None", "...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/seq2seq/python/ops/decoder.py#L282-L486
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBDebugger.Clear
(self)
return _lldb.SBDebugger_Clear(self)
Clear(self)
Clear(self)
[ "Clear", "(", "self", ")" ]
def Clear(self): """Clear(self)""" return _lldb.SBDebugger_Clear(self)
[ "def", "Clear", "(", "self", ")", ":", "return", "_lldb", ".", "SBDebugger_Clear", "(", "self", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L3214-L3216
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/setuptools/_distutils/util.py
python
rfc822_escape
(header)
return sep.join(lines)
Return a version of the string escaped for inclusion in an RFC-822 header, by ensuring there are 8 spaces space after each newline.
Return a version of the string escaped for inclusion in an RFC-822 header, by ensuring there are 8 spaces space after each newline.
[ "Return", "a", "version", "of", "the", "string", "escaped", "for", "inclusion", "in", "an", "RFC", "-", "822", "header", "by", "ensuring", "there", "are", "8", "spaces", "space", "after", "each", "newline", "." ]
def rfc822_escape (header): """Return a version of the string escaped for inclusion in an RFC-822 header, by ensuring there are 8 spaces space after each newline. """ lines = header.split('\n') sep = '\n' + 8 * ' ' return sep.join(lines)
[ "def", "rfc822_escape", "(", "header", ")", ":", "lines", "=", "header", ".", "split", "(", "'\\n'", ")", "sep", "=", "'\\n'", "+", "8", "*", "' '", "return", "sep", ".", "join", "(", "lines", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_distutils/util.py#L542-L548
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/indexes/multi.py
python
MultiIndex.equals
(self, other)
return True
Determines if two MultiIndex objects have the same labeling information (the levels themselves do not necessarily have to be the same) See Also -------- equal_levels
Determines if two MultiIndex objects have the same labeling information (the levels themselves do not necessarily have to be the same)
[ "Determines", "if", "two", "MultiIndex", "objects", "have", "the", "same", "labeling", "information", "(", "the", "levels", "themselves", "do", "not", "necessarily", "have", "to", "be", "the", "same", ")" ]
def equals(self, other) -> bool: """ Determines if two MultiIndex objects have the same labeling information (the levels themselves do not necessarily have to be the same) See Also -------- equal_levels """ if self.is_(other): return True ...
[ "def", "equals", "(", "self", ",", "other", ")", "->", "bool", ":", "if", "self", ".", "is_", "(", "other", ")", ":", "return", "True", "if", "not", "isinstance", "(", "other", ",", "Index", ")", ":", "return", "False", "if", "not", "isinstance", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/indexes/multi.py#L3101-L3155
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Tool/msvs.py
python
_generateGUID
(slnfile, name, namespace=external_makefile_guid)
return '{' + str(solution).upper() + '}'
Generates a GUID for the sln file to use. The uuid5 function is used to combine an existing namespace uuid - the one VS uses for C projects (external_makedile_guid) - and a combination of the solution file name (slnfile) and the project name (name). We just need uniqueness/repeatability. Returns ...
Generates a GUID for the sln file to use.
[ "Generates", "a", "GUID", "for", "the", "sln", "file", "to", "use", "." ]
def _generateGUID(slnfile, name, namespace=external_makefile_guid): """Generates a GUID for the sln file to use. The uuid5 function is used to combine an existing namespace uuid - the one VS uses for C projects (external_makedile_guid) - and a combination of the solution file name (slnfile) and the ...
[ "def", "_generateGUID", "(", "slnfile", ",", "name", ",", "namespace", "=", "external_makefile_guid", ")", ":", "# Normalize the slnfile path to a Windows path (\\ separators) so", "# the generated file has a consistent GUID even if we generate", "# it on a non-Windows platform.", "sln...
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Tool/msvs.py#L109-L125
bulletphysics/bullet3
f0f2a952e146f016096db6f85cf0c44ed75b0b9a
examples/pybullet/gym/pybullet_envs/baselines/enjoy_kuka_diverse_object_grasping.py
python
ContinuousDownwardBiasPolicy.sample_action
(self, obs, explore_prob)
return [dx, dy, dz, da, 0]
Implements height hack and grasping threshold hack.
Implements height hack and grasping threshold hack.
[ "Implements", "height", "hack", "and", "grasping", "threshold", "hack", "." ]
def sample_action(self, obs, explore_prob): """Implements height hack and grasping threshold hack. """ dx, dy, dz, da, close = self._action_space.sample() if np.random.random() < self._height_hack_prob: dz = -1 return [dx, dy, dz, da, 0]
[ "def", "sample_action", "(", "self", ",", "obs", ",", "explore_prob", ")", ":", "dx", ",", "dy", ",", "dz", ",", "da", ",", "close", "=", "self", ".", "_action_space", ".", "sample", "(", ")", "if", "np", ".", "random", ".", "random", "(", ")", "...
https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/baselines/enjoy_kuka_diverse_object_grasping.py#L29-L35
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/signal/signaltools.py
python
convolve2d
(in1, in2, mode='full', boundary='fill', fillvalue=0)
return out
Convolve two 2-dimensional arrays. Convolve `in1` and `in2` with output size determined by `mode`, and boundary conditions determined by `boundary` and `fillvalue`. Parameters ---------- in1 : array_like First input. in2 : array_like Second input. Should have the same number of...
Convolve two 2-dimensional arrays.
[ "Convolve", "two", "2", "-", "dimensional", "arrays", "." ]
def convolve2d(in1, in2, mode='full', boundary='fill', fillvalue=0): """ Convolve two 2-dimensional arrays. Convolve `in1` and `in2` with output size determined by `mode`, and boundary conditions determined by `boundary` and `fillvalue`. Parameters ---------- in1 : array_like First...
[ "def", "convolve2d", "(", "in1", ",", "in2", ",", "mode", "=", "'full'", ",", "boundary", "=", "'fill'", ",", "fillvalue", "=", "0", ")", ":", "in1", "=", "asarray", "(", "in1", ")", "in2", "=", "asarray", "(", "in2", ")", "if", "not", "in1", "."...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/signal/signaltools.py#L973-L1059
nlohmann/json
eb2182414749825be086c825edb5229e5c28503d
third_party/cpplint/cpplint.py
python
CheckForHeaderGuard
(filename, clean_lines, error)
Checks that the file contains a header guard. Logs an error if no #ifndef header guard is present. For other headers, checks that the full pathname is used. Args: filename: The name of the C++ header file. clean_lines: A CleansedLines instance containing the file. error: The function to call with a...
Checks that the file contains a header guard.
[ "Checks", "that", "the", "file", "contains", "a", "header", "guard", "." ]
def CheckForHeaderGuard(filename, clean_lines, error): """Checks that the file contains a header guard. Logs an error if no #ifndef header guard is present. For other headers, checks that the full pathname is used. Args: filename: The name of the C++ header file. clean_lines: A CleansedLines instance...
[ "def", "CheckForHeaderGuard", "(", "filename", ",", "clean_lines", ",", "error", ")", ":", "# Don't check for header guards if there are error suppression", "# comments somewhere in this file.", "#", "# Because this is silencing a warning for a nonexistent line, we", "# only support the ...
https://github.com/nlohmann/json/blob/eb2182414749825be086c825edb5229e5c28503d/third_party/cpplint/cpplint.py#L2363-L2463
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/math_grad.py
python
_SparseSegmentSumGrad
(op, grad)
return (math_ops.unsorted_segment_sum( array_ops.gather(grad, op.inputs[2]), op.inputs[1], input_rows), None, None)
Gradient for SparseSegmentSum.
Gradient for SparseSegmentSum.
[ "Gradient", "for", "SparseSegmentSum", "." ]
def _SparseSegmentSumGrad(op, grad): """Gradient for SparseSegmentSum.""" input_rows = array_ops.shape(op.inputs[0])[0] return (math_ops.unsorted_segment_sum( array_ops.gather(grad, op.inputs[2]), op.inputs[1], input_rows), None, None)
[ "def", "_SparseSegmentSumGrad", "(", "op", ",", "grad", ")", ":", "input_rows", "=", "array_ops", ".", "shape", "(", "op", ".", "inputs", "[", "0", "]", ")", "[", "0", "]", "return", "(", "math_ops", ".", "unsorted_segment_sum", "(", "array_ops", ".", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/math_grad.py#L169-L174
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/ops/tensor_array_ops.py
python
TensorArray.dtype
(self)
return self._dtype
The data type of this TensorArray.
The data type of this TensorArray.
[ "The", "data", "type", "of", "this", "TensorArray", "." ]
def dtype(self): """The data type of this TensorArray.""" return self._dtype
[ "def", "dtype", "(", "self", ")", ":", "return", "self", ".", "_dtype" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/tensor_array_ops.py#L152-L154
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/pytables.py
python
Table.validate_version
(self, where=None)
are we trying to operate on an old version?
are we trying to operate on an old version?
[ "are", "we", "trying", "to", "operate", "on", "an", "old", "version?" ]
def validate_version(self, where=None): """ are we trying to operate on an old version? """ if where is not None: if self.version[0] <= 0 and self.version[1] <= 10 and self.version[2] < 1: ws = incompatibility_doc % ".".join([str(x) for x in self.version]) war...
[ "def", "validate_version", "(", "self", ",", "where", "=", "None", ")", ":", "if", "where", "is", "not", "None", ":", "if", "self", ".", "version", "[", "0", "]", "<=", "0", "and", "self", ".", "version", "[", "1", "]", "<=", "10", "and", "self",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/pytables.py#L3379-L3384
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/tseries/offsets.py
python
BusinessHourMixin.next_bday
(self)
Used for moving to next business day.
Used for moving to next business day.
[ "Used", "for", "moving", "to", "next", "business", "day", "." ]
def next_bday(self): """ Used for moving to next business day. """ if self.n >= 0: nb_offset = 1 else: nb_offset = -1 if self._prefix.startswith("C"): # CustomBusinessHour return CustomBusinessDay( n=nb_offse...
[ "def", "next_bday", "(", "self", ")", ":", "if", "self", ".", "n", ">=", "0", ":", "nb_offset", "=", "1", "else", ":", "nb_offset", "=", "-", "1", "if", "self", ".", "_prefix", ".", "startswith", "(", "\"C\"", ")", ":", "# CustomBusinessHour", "retur...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/tseries/offsets.py#L704-L721
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/tarfile.py
python
TarFile.open
(cls, name=None, mode="r", fileobj=None, bufsize=RECORDSIZE, **kwargs)
Open a tar archive for reading, writing or appending. Return an appropriate TarFile class. mode: 'r' or 'r:*' open for reading with transparent compression 'r:' open for reading exclusively uncompressed 'r:gz' open for reading with gzip compression ...
Open a tar archive for reading, writing or appending. Return an appropriate TarFile class.
[ "Open", "a", "tar", "archive", "for", "reading", "writing", "or", "appending", ".", "Return", "an", "appropriate", "TarFile", "class", "." ]
def open(cls, name=None, mode="r", fileobj=None, bufsize=RECORDSIZE, **kwargs): """Open a tar archive for reading, writing or appending. Return an appropriate TarFile class. mode: 'r' or 'r:*' open for reading with transparent compression 'r:' open for readin...
[ "def", "open", "(", "cls", ",", "name", "=", "None", ",", "mode", "=", "\"r\"", ",", "fileobj", "=", "None", ",", "bufsize", "=", "RECORDSIZE", ",", "*", "*", "kwargs", ")", ":", "if", "not", "name", "and", "not", "fileobj", ":", "raise", "ValueErr...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tarfile.py#L1527-L1615
arkenthera/electron-vibrancy
383153ef9ccb23a6c7517150d6bb0794dff3115e
scripts/cpplint.py
python
_ShouldPrintError
(category, confidence, linenum)
return True
If confidence >= verbose, category passes filter and is not suppressed.
If confidence >= verbose, category passes filter and is not suppressed.
[ "If", "confidence", ">", "=", "verbose", "category", "passes", "filter", "and", "is", "not", "suppressed", "." ]
def _ShouldPrintError(category, confidence, linenum): """If confidence >= verbose, category passes filter and is not suppressed.""" # There are three ways we might decide not to print an error message: # a "NOLINT(category)" comment appears in the source, # the verbosity level isn't high enough, or the filters...
[ "def", "_ShouldPrintError", "(", "category", ",", "confidence", ",", "linenum", ")", ":", "# There are three ways we might decide not to print an error message:", "# a \"NOLINT(category)\" comment appears in the source,", "# the verbosity level isn't high enough, or the filters filter it out...
https://github.com/arkenthera/electron-vibrancy/blob/383153ef9ccb23a6c7517150d6bb0794dff3115e/scripts/cpplint.py#L929-L954
macchina-io/macchina.io
ef24ba0e18379c3dd48fb84e6dbf991101cb8db0
platform/JS/V8/tools/gyp/pylib/gyp/msvs_emulation.py
python
MsvsSettings.GetNoImportLibrary
(self, config)
return noimplib == 'true'
If NoImportLibrary: true, ninja will not expect the output to include an import library.
If NoImportLibrary: true, ninja will not expect the output to include an import library.
[ "If", "NoImportLibrary", ":", "true", "ninja", "will", "not", "expect", "the", "output", "to", "include", "an", "import", "library", "." ]
def GetNoImportLibrary(self, config): """If NoImportLibrary: true, ninja will not expect the output to include an import library.""" config = self._TargetConfig(config) noimplib = self._Setting(('NoImportLibrary',), config) return noimplib == 'true'
[ "def", "GetNoImportLibrary", "(", "self", ",", "config", ")", ":", "config", "=", "self", ".", "_TargetConfig", "(", "config", ")", "noimplib", "=", "self", ".", "_Setting", "(", "(", "'NoImportLibrary'", ",", ")", ",", "config", ")", "return", "noimplib",...
https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/tools/gyp/pylib/gyp/msvs_emulation.py#L418-L423
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/random.py
python
Random.vonmisesvariate
(self, mu, kappa)
return theta
Circular data distribution. mu is the mean angle, expressed in radians between 0 and 2*pi, and kappa is the concentration parameter, which must be greater than or equal to zero. If kappa is equal to zero, this distribution reduces to a uniform random angle over the range 0 to 2*pi.
Circular data distribution.
[ "Circular", "data", "distribution", "." ]
def vonmisesvariate(self, mu, kappa): """Circular data distribution. mu is the mean angle, expressed in radians between 0 and 2*pi, and kappa is the concentration parameter, which must be greater than or equal to zero. If kappa is equal to zero, this distribution reduces to a u...
[ "def", "vonmisesvariate", "(", "self", ",", "mu", ",", "kappa", ")", ":", "# mu: mean angle (in radians between 0 and 2*pi)", "# kappa: concentration parameter kappa (>= 0)", "# if kappa = 0 generate uniform random angle", "# Based upon an algorithm published in: Fisher, N.I.,", "# \"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/random.py#L456-L500
mhammond/pywin32
44afd86ba8485194df93234639243252deeb40d5
win32/Lib/regutil.py
python
GetRegistryDefaultValue
(subkey, rootkey=None)
return win32api.RegQueryValue(rootkey, subkey)
A helper to return the default value for a key in the registry.
A helper to return the default value for a key in the registry.
[ "A", "helper", "to", "return", "the", "default", "value", "for", "a", "key", "in", "the", "registry", "." ]
def GetRegistryDefaultValue(subkey, rootkey=None): """A helper to return the default value for a key in the registry.""" if rootkey is None: rootkey = GetRootKey() return win32api.RegQueryValue(rootkey, subkey)
[ "def", "GetRegistryDefaultValue", "(", "subkey", ",", "rootkey", "=", "None", ")", ":", "if", "rootkey", "is", "None", ":", "rootkey", "=", "GetRootKey", "(", ")", "return", "win32api", ".", "RegQueryValue", "(", "rootkey", ",", "subkey", ")" ]
https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/win32/Lib/regutil.py#L37-L41
BSVino/DoubleAction
c550b168a3e919926c198c30240f506538b92e75
mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/text_format.py
python
_Tokenizer.ConsumeByteString
(self)
return "".join(list)
Consumes a byte array value. Returns: The array parsed (as a string). Raises: ParseError: If a byte array value couldn't be consumed.
Consumes a byte array value.
[ "Consumes", "a", "byte", "array", "value", "." ]
def ConsumeByteString(self): """Consumes a byte array value. Returns: The array parsed (as a string). Raises: ParseError: If a byte array value couldn't be consumed. """ list = [self._ConsumeSingleByteString()] while len(self.token) > 0 and self.token[0] in ('\'', '"'): list....
[ "def", "ConsumeByteString", "(", "self", ")", ":", "list", "=", "[", "self", ".", "_ConsumeSingleByteString", "(", ")", "]", "while", "len", "(", "self", ".", "token", ")", ">", "0", "and", "self", ".", "token", "[", "0", "]", "in", "(", "'\\''", "...
https://github.com/BSVino/DoubleAction/blob/c550b168a3e919926c198c30240f506538b92e75/mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/text_format.py#L530-L542
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Node/FS.py
python
Base.get_labspath
(self)
return self.dir.entry_labspath(self.name)
Get the absolute path of the file.
Get the absolute path of the file.
[ "Get", "the", "absolute", "path", "of", "the", "file", "." ]
def get_labspath(self): """Get the absolute path of the file.""" return self.dir.entry_labspath(self.name)
[ "def", "get_labspath", "(", "self", ")", ":", "return", "self", ".", "dir", ".", "entry_labspath", "(", "self", ".", "name", ")" ]
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Node/FS.py#L830-L832
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/dirichlet.py
python
Dirichlet.std
(self, name="std")
Standard deviation of the distribution.
Standard deviation of the distribution.
[ "Standard", "deviation", "of", "the", "distribution", "." ]
def std(self, name="std"): """Standard deviation of the distribution.""" with ops.name_scope(self.name): with ops.op_scope([], name): return math_ops.sqrt(self.variance())
[ "def", "std", "(", "self", ",", "name", "=", "\"std\"", ")", ":", "with", "ops", ".", "name_scope", "(", "self", ".", "name", ")", ":", "with", "ops", ".", "op_scope", "(", "[", "]", ",", "name", ")", ":", "return", "math_ops", ".", "sqrt", "(", ...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/dirichlet.py#L252-L256
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/joblib/joblib/externals/loky/process_executor.py
python
_get_chunks
(chunksize, *iterables)
Iterates over zip()ed iterables in chunks.
Iterates over zip()ed iterables in chunks.
[ "Iterates", "over", "zip", "()", "ed", "iterables", "in", "chunks", "." ]
def _get_chunks(chunksize, *iterables): """Iterates over zip()ed iterables in chunks. """ if sys.version_info < (3, 3): it = itertools.izip(*iterables) else: it = zip(*iterables) while True: chunk = tuple(itertools.islice(it, chunksize)) if not chunk: return ...
[ "def", "_get_chunks", "(", "chunksize", ",", "*", "iterables", ")", ":", "if", "sys", ".", "version_info", "<", "(", "3", ",", "3", ")", ":", "it", "=", "itertools", ".", "izip", "(", "*", "iterables", ")", "else", ":", "it", "=", "zip", "(", "*"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/joblib/joblib/externals/loky/process_executor.py#L331-L341
luliyucoordinate/Leetcode
96afcdc54807d1d184e881a075d1dbf3371e31fb
src/0341-Flatten-Nested-List-Iterator/0341.py
python
NestedInteger.getInteger
(self)
@return the single integer that this NestedInteger holds, if it holds a single integer Return None if this NestedInteger holds a nested list :rtype int
[]
def getInteger(self): """ @return the single integer that this NestedInteger holds, if it holds a single integer Return None if this NestedInteger holds a nested list :rtype int """
[ "def", "getInteger", "(", "self", ")", ":" ]
https://github.com/luliyucoordinate/Leetcode/blob/96afcdc54807d1d184e881a075d1dbf3371e31fb/src/0341-Flatten-Nested-List-Iterator/0341.py#L8-L13
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/grid.py
python
PyGridTableBase.Destroy
(*args, **kwargs)
return _grid.PyGridTableBase_Destroy(*args, **kwargs)
Destroy(self) Deletes the C++ object this Python object is a proxy for.
Destroy(self)
[ "Destroy", "(", "self", ")" ]
def Destroy(*args, **kwargs): """ Destroy(self) Deletes the C++ object this Python object is a proxy for. """ args[0].this.own(False) return _grid.PyGridTableBase_Destroy(*args, **kwargs)
[ "def", "Destroy", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "args", "[", "0", "]", ".", "this", ".", "own", "(", "False", ")", "return", "_grid", ".", "PyGridTableBase_Destroy", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/grid.py#L941-L948