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
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/irc/irclib.py
python
ServerConnection._get_socket
(self)
return self.socket
[Internal]
[Internal]
[ "[", "Internal", "]" ]
def _get_socket(self): """[Internal]""" return self.socket
[ "def", "_get_socket", "(", "self", ")", ":", "return", "self", ".", "socket" ]
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/irc/irclib.py#L461-L463
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_vim.py
python
EditraCommander.Redo
(self, repeat)
Redo actions in the buffer @param repeat: int
Redo actions in the buffer @param repeat: int
[ "Redo", "actions", "in", "the", "buffer", "@param", "repeat", ":", "int" ]
def Redo(self, repeat): """Redo actions in the buffer @param repeat: int """ for i in range(repeat): self.stc.Redo()
[ "def", "Redo", "(", "self", ",", "repeat", ")", ":", "for", "i", "in", "range", "(", "repeat", ")", ":", "self", ".", "stc", ".", "Redo", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_vim.py#L147-L153
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/summary_ops_v2.py
python
never_record_summaries
()
return record_if(False)
Sets the should_record_summaries Tensor to always false.
Sets the should_record_summaries Tensor to always false.
[ "Sets", "the", "should_record_summaries", "Tensor", "to", "always", "false", "." ]
def never_record_summaries(): """Sets the should_record_summaries Tensor to always false.""" return record_if(False)
[ "def", "never_record_summaries", "(", ")", ":", "return", "record_if", "(", "False", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/summary_ops_v2.py#L200-L202
notepadqq/notepadqq
d8000f256a516aa958d50bfcc19605dc296fbeb2
.travis/tools/macdeployqtfix/macdeployqtfix.py
python
is_qt_lib
(filename)
return qtlib_name_rgx.match(filename) is not None
Checks if a given file is a qt library. Accepts absolute path as well as path containing @executable_path
Checks if a given file is a qt library. Accepts absolute path as well as path containing
[ "Checks", "if", "a", "given", "file", "is", "a", "qt", "library", ".", "Accepts", "absolute", "path", "as", "well", "as", "path", "containing" ]
def is_qt_lib(filename): """ Checks if a given file is a qt library. Accepts absolute path as well as path containing @executable_path """ qtlib_name_rgx = re.compile(QTLIB_NAME_REGEX) return qtlib_name_rgx.match(filename) is not None
[ "def", "is_qt_lib", "(", "filename", ")", ":", "qtlib_name_rgx", "=", "re", ".", "compile", "(", "QTLIB_NAME_REGEX", ")", "return", "qtlib_name_rgx", ".", "match", "(", "filename", ")", "is", "not", "None" ]
https://github.com/notepadqq/notepadqq/blob/d8000f256a516aa958d50bfcc19605dc296fbeb2/.travis/tools/macdeployqtfix/macdeployqtfix.py#L78-L84
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py2/IPython/core/completer.py
python
has_open_quotes
(s)
Return whether a string has open quotes. This simply counts whether the number of quote characters of either type in the string is odd. Returns ------- If there is an open quote, the quote character is returned. Else, return False.
Return whether a string has open quotes.
[ "Return", "whether", "a", "string", "has", "open", "quotes", "." ]
def has_open_quotes(s): """Return whether a string has open quotes. This simply counts whether the number of quote characters of either type in the string is odd. Returns ------- If there is an open quote, the quote character is returned. Else, return False. """ # We check " first...
[ "def", "has_open_quotes", "(", "s", ")", ":", "# We check \" first, then ', so complex cases with nested quotes will get", "# the \" to take precedence.", "if", "s", ".", "count", "(", "'\"'", ")", "%", "2", ":", "return", "'\"'", "elif", "s", ".", "count", "(", "\"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/completer.py#L54-L72
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/turtle.py
python
TPen.penup
(self)
Pull the pen up -- no drawing when moving. Aliases: penup | pu | up No argument Example (for a Turtle instance named turtle): >>> turtle.penup()
Pull the pen up -- no drawing when moving.
[ "Pull", "the", "pen", "up", "--", "no", "drawing", "when", "moving", "." ]
def penup(self): """Pull the pen up -- no drawing when moving. Aliases: penup | pu | up No argument Example (for a Turtle instance named turtle): >>> turtle.penup() """ if not self._drawing: return self.pen(pendown=False)
[ "def", "penup", "(", "self", ")", ":", "if", "not", "self", ".", "_drawing", ":", "return", "self", ".", "pen", "(", "pendown", "=", "False", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/turtle.py#L2095-L2107
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/linalg_grad.py
python
_MatrixDeterminantGrad
(op, grad)
return multipliers * a_adj_inv
Gradient for MatrixDeterminant.
Gradient for MatrixDeterminant.
[ "Gradient", "for", "MatrixDeterminant", "." ]
def _MatrixDeterminantGrad(op, grad): """Gradient for MatrixDeterminant.""" a = op.inputs[0] c = op.outputs[0] a_adj_inv = linalg_ops.matrix_inverse(a, adjoint=True) multipliers = array_ops.reshape(grad * c, array_ops.concat([array_ops.shape(c), [1, 1]], ...
[ "def", "_MatrixDeterminantGrad", "(", "op", ",", "grad", ")", ":", "a", "=", "op", ".", "inputs", "[", "0", "]", "c", "=", "op", ".", "outputs", "[", "0", "]", "a_adj_inv", "=", "linalg_ops", ".", "matrix_inverse", "(", "a", ",", "adjoint", "=", "T...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/linalg_grad.py#L48-L56
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/peacock/BasePeacockMainWindow.py
python
BasePeacockMainWindow._clearSettings
(self)
Just clears all peacock settings.
Just clears all peacock settings.
[ "Just", "clears", "all", "peacock", "settings", "." ]
def _clearSettings(self): """ Just clears all peacock settings. """ settings = QSettings() settings.clear() settings.sync()
[ "def", "_clearSettings", "(", "self", ")", ":", "settings", "=", "QSettings", "(", ")", "settings", ".", "clear", "(", ")", "settings", ".", "sync", "(", ")" ]
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/BasePeacockMainWindow.py#L162-L168
MhLiao/TextBoxes_plusplus
39d4898de1504c53a2ed3d67966a57b3595836d0
scripts/cpp_lint.py
python
CheckInvalidIncrement
(filename, clean_lines, linenum, error)
Checks for invalid increment *count++. For example following function: void increment_counter(int* count) { *count++; } is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*count, (*count)++ or *count += 1. Args: filename: The name of the current file. ...
Checks for invalid increment *count++.
[ "Checks", "for", "invalid", "increment", "*", "count", "++", "." ]
def CheckInvalidIncrement(filename, clean_lines, linenum, error): """Checks for invalid increment *count++. For example following function: void increment_counter(int* count) { *count++; } is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*count, (*count)++ ...
[ "def", "CheckInvalidIncrement", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "if", "_RE_PATTERN_INVALID_INCREMENT", ".", "match", "(", "line", ")", ":", "error", ...
https://github.com/MhLiao/TextBoxes_plusplus/blob/39d4898de1504c53a2ed3d67966a57b3595836d0/scripts/cpp_lint.py#L1737-L1756
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/internal/tensor_encoding/utils/tf_utils.py
python
_cmwc_random_sequence
(num_elements, seed)
return values
Implements a version of the Complementary Multiply with Carry algorithm. http://en.wikipedia.org/wiki/Multiply-with-carry This implementation serves as a purely TensorFlow implementation of a fully deterministic source of pseudo-random number sequence. That is given a `Tensor` `seed`, this method will output ...
Implements a version of the Complementary Multiply with Carry algorithm.
[ "Implements", "a", "version", "of", "the", "Complementary", "Multiply", "with", "Carry", "algorithm", "." ]
def _cmwc_random_sequence(num_elements, seed): """Implements a version of the Complementary Multiply with Carry algorithm. http://en.wikipedia.org/wiki/Multiply-with-carry This implementation serves as a purely TensorFlow implementation of a fully deterministic source of pseudo-random number sequence. That is...
[ "def", "_cmwc_random_sequence", "(", "num_elements", ",", "seed", ")", ":", "if", "not", "isinstance", "(", "num_elements", ",", "int", ")", ":", "raise", "TypeError", "(", "'The num_elements argument must be a Python integer.'", ")", "if", "num_elements", "<=", "0"...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/internal/tensor_encoding/utils/tf_utils.py#L116-L222
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPMS_SCHEME_XOR.fromTpm
(buf)
return buf.createObj(TPMS_SCHEME_XOR)
Returns new TPMS_SCHEME_XOR object constructed from its marshaled representation in the given TpmBuffer buffer
Returns new TPMS_SCHEME_XOR object constructed from its marshaled representation in the given TpmBuffer buffer
[ "Returns", "new", "TPMS_SCHEME_XOR", "object", "constructed", "from", "its", "marshaled", "representation", "in", "the", "given", "TpmBuffer", "buffer" ]
def fromTpm(buf): """ Returns new TPMS_SCHEME_XOR object constructed from its marshaled representation in the given TpmBuffer buffer """ return buf.createObj(TPMS_SCHEME_XOR)
[ "def", "fromTpm", "(", "buf", ")", ":", "return", "buf", ".", "createObj", "(", "TPMS_SCHEME_XOR", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L6316-L6320
grame-cncm/faust
ffee6904612a1f908b7343a2c43b0c87bc36719c
tools/physicalModeling/inkscape2scad/paths2openscad.py
python
OpenSCAD.recursivelyGetEnclosingTransform
( self, node )
Determine the cumulative transform which node inherits from its chain of ancestors.
Determine the cumulative transform which node inherits from its chain of ancestors.
[ "Determine", "the", "cumulative", "transform", "which", "node", "inherits", "from", "its", "chain", "of", "ancestors", "." ]
def recursivelyGetEnclosingTransform( self, node ): ''' Determine the cumulative transform which node inherits from its chain of ancestors. ''' node = node.getparent() if node is not None: parent_transform = self.recursivelyGetEnclosingTransform( node ) node_transform = node.get( 'transform', None ) ...
[ "def", "recursivelyGetEnclosingTransform", "(", "self", ",", "node", ")", ":", "node", "=", "node", ".", "getparent", "(", ")", "if", "node", "is", "not", "None", ":", "parent_transform", "=", "self", ".", "recursivelyGetEnclosingTransform", "(", "node", ")", ...
https://github.com/grame-cncm/faust/blob/ffee6904612a1f908b7343a2c43b0c87bc36719c/tools/physicalModeling/inkscape2scad/paths2openscad.py#L860-L879
facebookresearch/habitat-sim
63b6c71d9ca8adaefb140b198196f5d0ca1f1e34
examples/fairmotion_interface.py
python
FairmotionInterface.set_data
( self, urdf_path: Optional[str] = None, amass_path: Optional[str] = None, bm_path: Optional[str] = None, rotation: Optional[mn.Quaternion] = None, translation: Optional[mn.Vector3] = None, )
A method that will take attributes of the model data sets as arguments, filling in empty args with the default set of data, and adds the data to the meta_data library.
A method that will take attributes of the model data sets as arguments, filling in empty args with the default set of data, and adds the data to the meta_data library.
[ "A", "method", "that", "will", "take", "attributes", "of", "the", "model", "data", "sets", "as", "arguments", "filling", "in", "empty", "args", "with", "the", "default", "set", "of", "data", "and", "adds", "the", "data", "to", "the", "meta_data", "library"...
def set_data( self, urdf_path: Optional[str] = None, amass_path: Optional[str] = None, bm_path: Optional[str] = None, rotation: Optional[mn.Quaternion] = None, translation: Optional[mn.Vector3] = None, ) -> None: """ A method that will take attributes ...
[ "def", "set_data", "(", "self", ",", "urdf_path", ":", "Optional", "[", "str", "]", "=", "None", ",", "amass_path", ":", "Optional", "[", "str", "]", "=", "None", ",", "bm_path", ":", "Optional", "[", "str", "]", "=", "None", ",", "rotation", ":", ...
https://github.com/facebookresearch/habitat-sim/blob/63b6c71d9ca8adaefb140b198196f5d0ca1f1e34/examples/fairmotion_interface.py#L168-L185
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/__init__.py
python
PackageFinder._find_packages_iter
(cls, where, exclude, include)
All the packages found in 'where' that pass the 'include' filter, but not the 'exclude' filter.
All the packages found in 'where' that pass the 'include' filter, but not the 'exclude' filter.
[ "All", "the", "packages", "found", "in", "where", "that", "pass", "the", "include", "filter", "but", "not", "the", "exclude", "filter", "." ]
def _find_packages_iter(cls, where, exclude, include): """ All the packages found in 'where' that pass the 'include' filter, but not the 'exclude' filter. """ for root, dirs, files in os.walk(where, followlinks=True): # Copy dirs to iterate over it, then empty dirs. ...
[ "def", "_find_packages_iter", "(", "cls", ",", "where", ",", "exclude", ",", "include", ")", ":", "for", "root", ",", "dirs", ",", "files", "in", "os", ".", "walk", "(", "where", ",", "followlinks", "=", "True", ")", ":", "# Copy dirs to iterate over it, t...
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/__init__.py#L75-L100
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py
python
MainWindow.do_select_merged_scans
(self)
Select or deselect all rows in the merged scan table :return:
Select or deselect all rows in the merged scan table :return:
[ "Select", "or", "deselect", "all", "rows", "in", "the", "merged", "scan", "table", ":", "return", ":" ]
def do_select_merged_scans(self): """ Select or deselect all rows in the merged scan table :return: """ # get current status curr_state = str(self.ui.pushButton_selectAllScans2Merge.text()).startswith('Select') # select/deselect all self.ui.tableWidget_mergeScans...
[ "def", "do_select_merged_scans", "(", "self", ")", ":", "# get current status", "curr_state", "=", "str", "(", "self", ".", "ui", ".", "pushButton_selectAllScans2Merge", ".", "text", "(", ")", ")", ".", "startswith", "(", "'Select'", ")", "# select/deselect all", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py#L2424-L2438
stellar-deprecated/stellard
67eabb2217bdfa9a6ea317f62338fb6bca458c90
src/protobuf/python/google/protobuf/descriptor.py
python
DescriptorBase.GetOptions
(self)
return self._options
Retrieves descriptor options. This method returns the options set or creates the default options for the descriptor.
Retrieves descriptor options.
[ "Retrieves", "descriptor", "options", "." ]
def GetOptions(self): """Retrieves descriptor options. This method returns the options set or creates the default options for the descriptor. """ if self._options: return self._options from google.protobuf import descriptor_pb2 try: options_class = getattr(descriptor_pb2, self._...
[ "def", "GetOptions", "(", "self", ")", ":", "if", "self", ".", "_options", ":", "return", "self", ".", "_options", "from", "google", ".", "protobuf", "import", "descriptor_pb2", "try", ":", "options_class", "=", "getattr", "(", "descriptor_pb2", ",", "self",...
https://github.com/stellar-deprecated/stellard/blob/67eabb2217bdfa9a6ea317f62338fb6bca458c90/src/protobuf/python/google/protobuf/descriptor.py#L94-L109
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/jinja2/utils.py
python
LRUCache.iteritems
(self)
return iter(self.items())
Iterate over all items.
Iterate over all items.
[ "Iterate", "over", "all", "items", "." ]
def iteritems(self): """Iterate over all items.""" return iter(self.items())
[ "def", "iteritems", "(", "self", ")", ":", "return", "iter", "(", "self", ".", "items", "(", ")", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/jinja2/utils.py#L438-L440
deepdrive/deepdrive-sim
5c260ee7948f38f3ac50be796d2368bfdbf167be
Plugins/DeepDrivePlugin/Source/DeepDrivePython/build/build.py
python
get_centos_py_versions
()
return ' '.join(['%s' % d for d in dirs])
Executed within the centos manylinux container to dynamically add new python versions as they become available in the container :return (str): String that is a space separated list version bins, i.e. /opt/python/cp35-cp35m/bin /opt/python/cp36-cp36m/bin
Executed within the centos manylinux container to dynamically add new python versions as they become available in the container :return (str): String that is a space separated list version bins, i.e. /opt/python/cp35-cp35m/bin /opt/python/cp36-cp36m/bin
[ "Executed", "within", "the", "centos", "manylinux", "container", "to", "dynamically", "add", "new", "python", "versions", "as", "they", "become", "available", "in", "the", "container", ":", "return", "(", "str", ")", ":", "String", "that", "is", "a", "space"...
def get_centos_py_versions(): """ Executed within the centos manylinux container to dynamically add new python versions as they become available in the container :return (str): String that is a space separated list version bins, i.e. /opt/python/cp35-cp35m/bin /opt/python/cp36-cp36m/bin """ ...
[ "def", "get_centos_py_versions", "(", ")", ":", "dirs", "=", "glob", ".", "glob", "(", "'/opt/python/cp3*-cp3*m/bin'", ")", "if", "not", "dir", ":", "raise", "RuntimeError", "(", "\"No python versions found\"", ")", "return", "' '", ".", "join", "(", "[", "'%s...
https://github.com/deepdrive/deepdrive-sim/blob/5c260ee7948f38f3ac50be796d2368bfdbf167be/Plugins/DeepDrivePlugin/Source/DeepDrivePython/build/build.py#L179-L189
esa/pagmo
80281d549c8f1b470e1489a5d37c8f06b2e429c0
PyGMO/problem/__init__.py
python
_luksan_vlcek_3_ctor
(self, dim=8)
Constructs the third Luksan Vlcek problem (Constrained Continuous Single-Objective) NOTE: L. Luksan and J. Vlcek, "Sparse and Parially Separable Test Problems for Unconstrained and Equality Constrained Optimization" USAGE: problem.luksan_vlcek_3(dim=8) * dim: problem dimension
Constructs the third Luksan Vlcek problem (Constrained Continuous Single-Objective)
[ "Constructs", "the", "third", "Luksan", "Vlcek", "problem", "(", "Constrained", "Continuous", "Single", "-", "Objective", ")" ]
def _luksan_vlcek_3_ctor(self, dim=8): """ Constructs the third Luksan Vlcek problem (Constrained Continuous Single-Objective) NOTE: L. Luksan and J. Vlcek, "Sparse and Parially Separable Test Problems for Unconstrained and Equality Constrained Optimization" USAGE: problem.luksan_vlcek_3(dim=8) *...
[ "def", "_luksan_vlcek_3_ctor", "(", "self", ",", "dim", "=", "8", ")", ":", "# We construct the arg list for the original constructor exposed by", "# boost_python", "arg_list", "=", "[", "]", "arg_list", ".", "append", "(", "dim", ")", "self", ".", "_orig_init", "("...
https://github.com/esa/pagmo/blob/80281d549c8f1b470e1489a5d37c8f06b2e429c0/PyGMO/problem/__init__.py#L505-L520
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/kms/layer1.py
python
KMSConnection.generate_random
(self, number_of_bytes=None)
return response
Generates an unpredictable byte string. :type number_of_bytes: integer :param number_of_bytes: Integer that contains the number of bytes to generate. Common values are 128, 256, 512, 1024 and so on. The current limit is 1024 bytes.
Generates an unpredictable byte string.
[ "Generates", "an", "unpredictable", "byte", "string", "." ]
def generate_random(self, number_of_bytes=None): """ Generates an unpredictable byte string. :type number_of_bytes: integer :param number_of_bytes: Integer that contains the number of bytes to generate. Common values are 128, 256, 512, 1024 and so on. The current...
[ "def", "generate_random", "(", "self", ",", "number_of_bytes", "=", "None", ")", ":", "params", "=", "{", "}", "if", "number_of_bytes", "is", "not", "None", ":", "params", "[", "'NumberOfBytes'", "]", "=", "number_of_bytes", "response", "=", "self", ".", "...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/kms/layer1.py#L517-L535
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/api.py
python
request
(method, url, **kwargs)
Constructs and sends a :class:`Request <Request>`. :param method: method for the new :class:`Request` object: ``GET``, ``OPTIONS``, ``HEAD``, ``POST``, ``PUT``, ``PATCH``, or ``DELETE``. :param url: URL for the new :class:`Request` object. :param params: (optional) Dictionary, list of tuples or bytes to se...
Constructs and sends a :class:`Request <Request>`.
[ "Constructs", "and", "sends", "a", ":", "class", ":", "Request", "<Request", ">", "." ]
def request(method, url, **kwargs): """Constructs and sends a :class:`Request <Request>`. :param method: method for the new :class:`Request` object: ``GET``, ``OPTIONS``, ``HEAD``, ``POST``, ``PUT``, ``PATCH``, or ``DELETE``. :param url: URL for the new :class:`Request` object. :param params: (optional...
[ "def", "request", "(", "method", ",", "url", ",", "*", "*", "kwargs", ")", ":", "# By using the 'with' statement we are sure the session is closed, thus we", "# avoid leaving sockets open which can trigger a ResourceWarning in some", "# cases, and look like a memory leak in others.", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/api.py#L16-L61
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
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/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/tensor_array_ops.py#L152-L154
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/google/protobuf-py/google/protobuf/text_format.py
python
_Tokenizer.ConsumeInt64
(self)
return result
Consumes a signed 64bit integer number. Returns: The integer parsed. Raises: ParseError: If a signed 64bit integer couldn't be consumed.
Consumes a signed 64bit integer number.
[ "Consumes", "a", "signed", "64bit", "integer", "number", "." ]
def ConsumeInt64(self): """Consumes a signed 64bit integer number. Returns: The integer parsed. Raises: ParseError: If a signed 64bit integer couldn't be consumed. """ try: result = self._ParseInteger(self.token, is_signed=True, is_long=True) except ValueError, e: raise...
[ "def", "ConsumeInt64", "(", "self", ")", ":", "try", ":", "result", "=", "self", ".", "_ParseInteger", "(", "self", ".", "token", ",", "is_signed", "=", "True", ",", "is_long", "=", "True", ")", "except", "ValueError", ",", "e", ":", "raise", "self", ...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/google/protobuf/text_format.py#L454-L468
stan-dev/math
5fd79f89933269a4ca4d8dd1fde2a36d53d4768c
lib/cpplint_1.4.5/cpplint.py
python
NestingState.InExternC
(self)
return self.stack and isinstance(self.stack[-1], _ExternCInfo)
Check if we are currently one level inside an 'extern "C"' block. Returns: True if top of the stack is an extern block, False otherwise.
Check if we are currently one level inside an 'extern "C"' block.
[ "Check", "if", "we", "are", "currently", "one", "level", "inside", "an", "extern", "C", "block", "." ]
def InExternC(self): """Check if we are currently one level inside an 'extern "C"' block. Returns: True if top of the stack is an extern block, False otherwise. """ return self.stack and isinstance(self.stack[-1], _ExternCInfo)
[ "def", "InExternC", "(", "self", ")", ":", "return", "self", ".", "stack", "and", "isinstance", "(", "self", ".", "stack", "[", "-", "1", "]", ",", "_ExternCInfo", ")" ]
https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/cpplint_1.4.5/cpplint.py#L2681-L2687
amd/OpenCL-caffe
638543108517265366c18ae5821f3096cf5cf34a
scripts/cpp_lint.py
python
_IncludeState.CheckNextIncludeOrder
(self, header_type)
return ''
Returns a non-empty error message if the next header is out of order. This function also updates the internal state to be ready to check the next include. Args: header_type: One of the _XXX_HEADER constants defined above. Returns: The empty string if the header is in the right order, or a...
Returns a non-empty error message if the next header is out of order.
[ "Returns", "a", "non", "-", "empty", "error", "message", "if", "the", "next", "header", "is", "out", "of", "order", "." ]
def CheckNextIncludeOrder(self, header_type): """Returns a non-empty error message if the next header is out of order. This function also updates the internal state to be ready to check the next include. Args: header_type: One of the _XXX_HEADER constants defined above. Returns: The e...
[ "def", "CheckNextIncludeOrder", "(", "self", ",", "header_type", ")", ":", "error_message", "=", "(", "'Found %s after %s'", "%", "(", "self", ".", "_TYPE_NAMES", "[", "header_type", "]", ",", "self", ".", "_SECTION_NAMES", "[", "self", ".", "_section", "]", ...
https://github.com/amd/OpenCL-caffe/blob/638543108517265366c18ae5821f3096cf5cf34a/scripts/cpp_lint.py#L633-L684
Z3Prover/z3
d745d03afdfdf638d66093e2bfbacaf87187f35b
src/api/python/z3/z3.py
python
RotateLeft
(a, b)
return BitVecRef(Z3_mk_ext_rotate_left(a.ctx_ref(), a.as_ast(), b.as_ast()), a.ctx)
Return an expression representing `a` rotated to the left `b` times. >>> a, b = BitVecs('a b', 16) >>> RotateLeft(a, b) RotateLeft(a, b) >>> simplify(RotateLeft(a, 0)) a >>> simplify(RotateLeft(a, 16)) a
Return an expression representing `a` rotated to the left `b` times.
[ "Return", "an", "expression", "representing", "a", "rotated", "to", "the", "left", "b", "times", "." ]
def RotateLeft(a, b): """Return an expression representing `a` rotated to the left `b` times. >>> a, b = BitVecs('a b', 16) >>> RotateLeft(a, b) RotateLeft(a, b) >>> simplify(RotateLeft(a, 0)) a >>> simplify(RotateLeft(a, 16)) a """ _check_bv_args(a, b) a, b = _coerce_exprs(...
[ "def", "RotateLeft", "(", "a", ",", "b", ")", ":", "_check_bv_args", "(", "a", ",", "b", ")", "a", ",", "b", "=", "_coerce_exprs", "(", "a", ",", "b", ")", "return", "BitVecRef", "(", "Z3_mk_ext_rotate_left", "(", "a", ".", "ctx_ref", "(", ")", ","...
https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L4296-L4309
Netflix/NfWebCrypto
499faf4eb9f9ccf0b21dc728e974970f54bd6c52
plugin/ppapi/ppapi/generators/idl_gen_pnacl.py
python
PnaclGen.MemberNeedsWrapping
(self, member, release)
return self.TypeNeedsWrapping(ret, []) or self.ArgsNeedWrapping(args_spec)
Return true if a particular member function at a particular release needs wrapping.
Return true if a particular member function at a particular release needs wrapping.
[ "Return", "true", "if", "a", "particular", "member", "function", "at", "a", "particular", "release", "needs", "wrapping", "." ]
def MemberNeedsWrapping(self, member, release): """Return true if a particular member function at a particular release needs wrapping. """ if self._skip_opt: return True if not member.InReleases([release]): return False ret, name, array, args_spec = self.cgen.GetComponents(member, ...
[ "def", "MemberNeedsWrapping", "(", "self", ",", "member", ",", "release", ")", ":", "if", "self", ".", "_skip_opt", ":", "return", "True", "if", "not", "member", ".", "InReleases", "(", "[", "release", "]", ")", ":", "return", "False", "ret", ",", "nam...
https://github.com/Netflix/NfWebCrypto/blob/499faf4eb9f9ccf0b21dc728e974970f54bd6c52/plugin/ppapi/ppapi/generators/idl_gen_pnacl.py#L86-L97
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/python-gflags/gflags.py
python
_GetCallingModule
()
return _GetCallingModuleObjectAndName()[1]
Returns the name of the module that's calling into this module.
Returns the name of the module that's calling into this module.
[ "Returns", "the", "name", "of", "the", "module", "that", "s", "calling", "into", "this", "module", "." ]
def _GetCallingModule(): """Returns the name of the module that's calling into this module.""" return _GetCallingModuleObjectAndName()[1]
[ "def", "_GetCallingModule", "(", ")", ":", "return", "_GetCallingModuleObjectAndName", "(", ")", "[", "1", "]" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/python-gflags/gflags.py#L432-L434
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/ceph_manager.py
python
CephManager.get_mon_quorum
(self)
return j['quorum']
Extract monitor quorum information from the cluster
Extract monitor quorum information from the cluster
[ "Extract", "monitor", "quorum", "information", "from", "the", "cluster" ]
def get_mon_quorum(self): """ Extract monitor quorum information from the cluster """ out = self.raw_cluster_cmd('quorum_status') j = json.loads(out) return j['quorum']
[ "def", "get_mon_quorum", "(", "self", ")", ":", "out", "=", "self", ".", "raw_cluster_cmd", "(", "'quorum_status'", ")", "j", "=", "json", ".", "loads", "(", "out", ")", "return", "j", "[", "'quorum'", "]" ]
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/ceph_manager.py#L3100-L3106
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/grid.py
python
Grid.XToCol
(*args, **kwargs)
return _grid.Grid_XToCol(*args, **kwargs)
XToCol(self, int x, bool clipToMinMax=False) -> int
XToCol(self, int x, bool clipToMinMax=False) -> int
[ "XToCol", "(", "self", "int", "x", "bool", "clipToMinMax", "=", "False", ")", "-", ">", "int" ]
def XToCol(*args, **kwargs): """XToCol(self, int x, bool clipToMinMax=False) -> int""" return _grid.Grid_XToCol(*args, **kwargs)
[ "def", "XToCol", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_XToCol", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L1390-L1392
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
uCSIsPrivateUse
(code)
return ret
Check whether the character is part of PrivateUse UCS Block
Check whether the character is part of PrivateUse UCS Block
[ "Check", "whether", "the", "character", "is", "part", "of", "PrivateUse", "UCS", "Block" ]
def uCSIsPrivateUse(code): """Check whether the character is part of PrivateUse UCS Block """ ret = libxml2mod.xmlUCSIsPrivateUse(code) return ret
[ "def", "uCSIsPrivateUse", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsPrivateUse", "(", "code", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L2035-L2038
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/rospkg/stack.py
python
_check
(name)
Generic validator for text-based tags.
Generic validator for text-based tags.
[ "Generic", "validator", "for", "text", "-", "based", "tags", "." ]
def _check(name): """ Generic validator for text-based tags. """ if name in REQUIRED: return _check_required(name, name in ALLOWXHTML) elif name in OPTIONAL: return _check_optional(name, name in ALLOWXHTML)
[ "def", "_check", "(", "name", ")", ":", "if", "name", "in", "REQUIRED", ":", "return", "_check_required", "(", "name", ",", "name", "in", "ALLOWXHTML", ")", "elif", "name", "in", "OPTIONAL", ":", "return", "_check_optional", "(", "name", ",", "name", "in...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/rospkg/stack.py#L119-L126
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
python/mxnet/executor.py
python
Executor.reshape
(self, partial_shaping=False, allow_up_sizing=False, **kwargs)
return self._symbol.bind(self._ctx, args=new_arg_dict, args_grad=new_grad_dict, grad_req=self._grad_req, aux_states=new_aux_dict, group2ctx=self._group2ctx...
Return a new executor with the same symbol and shared memory, but different input/output shapes. For runtime reshaping, variable length sequences, etc. The returned executor shares state with the current one, and cannot be used in parallel with it. Parameters ---------- ...
Return a new executor with the same symbol and shared memory, but different input/output shapes. For runtime reshaping, variable length sequences, etc. The returned executor shares state with the current one, and cannot be used in parallel with it.
[ "Return", "a", "new", "executor", "with", "the", "same", "symbol", "and", "shared", "memory", "but", "different", "input", "/", "output", "shapes", ".", "For", "runtime", "reshaping", "variable", "length", "sequences", "etc", ".", "The", "returned", "executor"...
def reshape(self, partial_shaping=False, allow_up_sizing=False, **kwargs): """Return a new executor with the same symbol and shared memory, but different input/output shapes. For runtime reshaping, variable length sequences, etc. The returned executor shares state with the current one, ...
[ "def", "reshape", "(", "self", ",", "partial_shaping", "=", "False", ",", "allow_up_sizing", "=", "False", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=too-many-branches", "arg_shapes", ",", "_", ",", "aux_shapes", "=", "self", ".", "_symbol", ".", ...
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/executor.py#L371-L457
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/sparse/generate_sparsetools.py
python
parse_routine
(name, args, types)
return thunk_code, method_code
Generate thunk and method code for a given routine. Parameters ---------- name : str Name of the C++ routine args : str Argument list specification (in format explained above) types : list List of types to instantiate, as returned `get_thunk_type_set`
Generate thunk and method code for a given routine.
[ "Generate", "thunk", "and", "method", "code", "for", "a", "given", "routine", "." ]
def parse_routine(name, args, types): """ Generate thunk and method code for a given routine. Parameters ---------- name : str Name of the C++ routine args : str Argument list specification (in format explained above) types : list List of types to instantiate, as ret...
[ "def", "parse_routine", "(", "name", ",", "args", ",", "types", ")", ":", "ret_spec", "=", "args", "[", "0", "]", "arg_spec", "=", "args", "[", "1", ":", "]", "def", "get_arglist", "(", "I_type", ",", "T_type", ")", ":", "\"\"\"\n Generate argumen...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/sparse/generate_sparsetools.py#L240-L334
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py2/setuptools/_vendor/packaging/specifiers.py
python
BaseSpecifier.prereleases
(self, value)
Sets whether or not pre-releases as a whole are allowed by this specifier.
Sets whether or not pre-releases as a whole are allowed by this specifier.
[ "Sets", "whether", "or", "not", "pre", "-", "releases", "as", "a", "whole", "are", "allowed", "by", "this", "specifier", "." ]
def prereleases(self, value): """ Sets whether or not pre-releases as a whole are allowed by this specifier. """
[ "def", "prereleases", "(", "self", ",", "value", ")", ":" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/_vendor/packaging/specifiers.py#L57-L61
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/dashboard/dashboard/auto_bisect.py
python
_ChooseTest
(anomalies, index=0)
return None
Chooses a test to use for a bisect job. The particular TestMetadata chosen determines the command and metric name that is chosen. The test to choose could depend on which of the anomalies has the largest regression size. Ideally, the choice of bisect bot to use should be based on bisect bot queue length, an...
Chooses a test to use for a bisect job.
[ "Chooses", "a", "test", "to", "use", "for", "a", "bisect", "job", "." ]
def _ChooseTest(anomalies, index=0): """Chooses a test to use for a bisect job. The particular TestMetadata chosen determines the command and metric name that is chosen. The test to choose could depend on which of the anomalies has the largest regression size. Ideally, the choice of bisect bot to use should...
[ "def", "_ChooseTest", "(", "anomalies", ",", "index", "=", "0", ")", ":", "if", "not", "anomalies", ":", "return", "None", "index", "%=", "len", "(", "anomalies", ")", "anomalies", ".", "sort", "(", "cmp", "=", "_CompareAnomalyBisectability", ")", "for", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/auto_bisect.py#L209-L243
microsoft/AirSim
8057725712c0cd46979135396381784075ffc0f3
PythonClient/airsim/client.py
python
MultirotorClient.moveByRollPitchYawrateThrottleAsync
(self, roll, pitch, yaw_rate, throttle, duration, vehicle_name = '')
return self.client.call_async('moveByRollPitchYawrateThrottle', roll, -pitch, -yaw_rate, throttle, duration, vehicle_name)
- Desired throttle is between 0.0 to 1.0 - Roll angle, pitch angle, and yaw rate set points are given in **radians**, in the body frame. - The body frame follows the Front Left Up (FLU) convention, and right-handedness. - Frame Convention: - X axis is along the **Front** direction o...
- Desired throttle is between 0.0 to 1.0 - Roll angle, pitch angle, and yaw rate set points are given in **radians**, in the body frame. - The body frame follows the Front Left Up (FLU) convention, and right-handedness.
[ "-", "Desired", "throttle", "is", "between", "0", ".", "0", "to", "1", ".", "0", "-", "Roll", "angle", "pitch", "angle", "and", "yaw", "rate", "set", "points", "are", "given", "in", "**", "radians", "**", "in", "the", "body", "frame", ".", "-", "Th...
def moveByRollPitchYawrateThrottleAsync(self, roll, pitch, yaw_rate, throttle, duration, vehicle_name = ''): """ - Desired throttle is between 0.0 to 1.0 - Roll angle, pitch angle, and yaw rate set points are given in **radians**, in the body frame. - The body frame follows the Front Lef...
[ "def", "moveByRollPitchYawrateThrottleAsync", "(", "self", ",", "roll", ",", "pitch", ",", "yaw_rate", ",", "throttle", ",", "duration", ",", "vehicle_name", "=", "''", ")", ":", "return", "self", ".", "client", ".", "call_async", "(", "'moveByRollPitchYawrateTh...
https://github.com/microsoft/AirSim/blob/8057725712c0cd46979135396381784075ffc0f3/PythonClient/airsim/client.py#L1354-L1387
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/grid.py
python
GridCellAttr.GetAlignment
(*args, **kwargs)
return _grid.GridCellAttr_GetAlignment(*args, **kwargs)
GetAlignment() -> (hAlign, vAlign)
GetAlignment() -> (hAlign, vAlign)
[ "GetAlignment", "()", "-", ">", "(", "hAlign", "vAlign", ")" ]
def GetAlignment(*args, **kwargs): """GetAlignment() -> (hAlign, vAlign)""" return _grid.GridCellAttr_GetAlignment(*args, **kwargs)
[ "def", "GetAlignment", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "GridCellAttr_GetAlignment", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L627-L629
deepmodeling/deepmd-kit
159e45d248b0429844fb6a8cb3b3a201987c8d79
deepmd/fit/ener.py
python
EnerFitting.__init__
(self, descrpt : tf.Tensor, neuron : List[int] = [120,120,120], resnet_dt : bool = True, numb_fparam : int = 0, numb_aparam : int = 0, rcond : float = 1e-3, tot_ener_zero : bool = False, ...
Constructor
Constructor
[ "Constructor" ]
def __init__ (self, descrpt : tf.Tensor, neuron : List[int] = [120,120,120], resnet_dt : bool = True, numb_fparam : int = 0, numb_aparam : int = 0, rcond : float = 1e-3, tot_ener_zero : bool = ...
[ "def", "__init__", "(", "self", ",", "descrpt", ":", "tf", ".", "Tensor", ",", "neuron", ":", "List", "[", "int", "]", "=", "[", "120", ",", "120", ",", "120", "]", ",", "resnet_dt", ":", "bool", "=", "True", ",", "numb_fparam", ":", "int", "=", ...
https://github.com/deepmodeling/deepmd-kit/blob/159e45d248b0429844fb6a8cb3b3a201987c8d79/deepmd/fit/ener.py#L81-L152
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
PyApp.GetMainLoop
(*args, **kwargs)
return _core_.PyApp_GetMainLoop(*args, **kwargs)
GetMainLoop(self) -> EventLoopBase Returns the main event loop instance, i.e. the event loop which is started by OnRun() and which dispatches all events sent from the native toolkit to the application (except when new event loops are temporarily set-up). The returned value maybe None. P...
GetMainLoop(self) -> EventLoopBase
[ "GetMainLoop", "(", "self", ")", "-", ">", "EventLoopBase" ]
def GetMainLoop(*args, **kwargs): """ GetMainLoop(self) -> EventLoopBase Returns the main event loop instance, i.e. the event loop which is started by OnRun() and which dispatches all events sent from the native toolkit to the application (except when new event loops are tempora...
[ "def", "GetMainLoop", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "PyApp_GetMainLoop", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L7830-L7840
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/client/session.py
python
Session.__init__
(self, target='', graph=None, config=None)
Creates a new TensorFlow session. If no `graph` argument is specified when constructing the session, the default graph will be launched in the session. If you are using more than one graph (created with `tf.Graph()` in the same process, you will have to use different sessions for each graph, but ea...
Creates a new TensorFlow session.
[ "Creates", "a", "new", "TensorFlow", "session", "." ]
def __init__(self, target='', graph=None, config=None): """Creates a new TensorFlow session. If no `graph` argument is specified when constructing the session, the default graph will be launched in the session. If you are using more than one graph (created with `tf.Graph()` in the same process, you...
[ "def", "__init__", "(", "self", ",", "target", "=", "''", ",", "graph", "=", "None", ",", "config", "=", "None", ")", ":", "super", "(", "Session", ",", "self", ")", ".", "__init__", "(", "target", ",", "graph", ",", "config", "=", "config", ")", ...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/client/session.py#L1110-L1132
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/wsgiref/headers.py
python
Headers.keys
(self)
return [k for k, v in self._headers]
Return a list of all the header field names. These will be sorted in the order they appeared in the original header list, or were added to this instance, and may contain duplicates. Any fields deleted and re-inserted are always appended to the header list.
Return a list of all the header field names.
[ "Return", "a", "list", "of", "all", "the", "header", "field", "names", "." ]
def keys(self): """Return a list of all the header field names. These will be sorted in the order they appeared in the original header list, or were added to this instance, and may contain duplicates. Any fields deleted and re-inserted are always appended to the header list. ...
[ "def", "keys", "(", "self", ")", ":", "return", "[", "k", "for", "k", ",", "v", "in", "self", ".", "_headers", "]" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/wsgiref/headers.py#L111-L119
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Part/BOPTools/__init__.py
python
addCommands
()
addCommands(): add all GUI commands of BOPTools package to FreeCAD command manager.
addCommands(): add all GUI commands of BOPTools package to FreeCAD command manager.
[ "addCommands", "()", ":", "add", "all", "GUI", "commands", "of", "BOPTools", "package", "to", "FreeCAD", "command", "manager", "." ]
def addCommands(): "addCommands(): add all GUI commands of BOPTools package to FreeCAD command manager." JoinFeatures.addCommands() SplitFeatures.addCommands()
[ "def", "addCommands", "(", ")", ":", "JoinFeatures", ".", "addCommands", "(", ")", "SplitFeatures", ".", "addCommands", "(", ")" ]
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Part/BOPTools/__init__.py#L60-L63
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/autocomp/pycomp.py
python
Completer._GetCompletionInfo
(self, command, calltip=False)
Get Completion list or Calltip @return: list or string
Get Completion list or Calltip @return: list or string
[ "Get", "Completion", "list", "or", "Calltip", "@return", ":", "list", "or", "string" ]
def _GetCompletionInfo(self, command, calltip=False): """Get Completion list or Calltip @return: list or string """ if command is None or (len(command) and command[0].isdigit()): if calltip: return u"" return list() try: cmpl ...
[ "def", "_GetCompletionInfo", "(", "self", ",", "command", ",", "calltip", "=", "False", ")", ":", "if", "command", "is", "None", "or", "(", "len", "(", "command", ")", "and", "command", "[", "0", "]", ".", "isdigit", "(", ")", ")", ":", "if", "call...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/autocomp/pycomp.py#L68-L128
rrwick/Unicycler
96ffea71e3a78d63ade19d6124946773e65cf129
unicycler/alignment.py
python
Alignment.is_very_similar
(self, other)
return overlap_size / smaller_alignment_length >= 0.9
Returns true if this alignment and the other alignment seem to be redundant. Specifically, the have to be from the same read, the same reference and overlap by 90% or more.
Returns true if this alignment and the other alignment seem to be redundant. Specifically, the have to be from the same read, the same reference and overlap by 90% or more.
[ "Returns", "true", "if", "this", "alignment", "and", "the", "other", "alignment", "seem", "to", "be", "redundant", ".", "Specifically", "the", "have", "to", "be", "from", "the", "same", "read", "the", "same", "reference", "and", "overlap", "by", "90%", "or...
def is_very_similar(self, other): """ Returns true if this alignment and the other alignment seem to be redundant. Specifically, the have to be from the same read, the same reference and overlap by 90% or more. """ if self.read.name != other.read.name: return ...
[ "def", "is_very_similar", "(", "self", ",", "other", ")", ":", "if", "self", ".", "read", ".", "name", "!=", "other", ".", "read", ".", "name", ":", "return", "False", "if", "self", ".", "ref", ".", "name", "!=", "other", ".", "ref", ".", "name", ...
https://github.com/rrwick/Unicycler/blob/96ffea71e3a78d63ade19d6124946773e65cf129/unicycler/alignment.py#L335-L358
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/math/symbolic.py
python
Expression.returnConstant
(self,context=None)
Returns true if the evaluation of the expression in the given context results in a constant. If so, then evalf() can safely be applied without error.
Returns true if the evaluation of the expression in the given context results in a constant. If so, then evalf() can safely be applied without error.
[ "Returns", "true", "if", "the", "evaluation", "of", "the", "expression", "in", "the", "given", "context", "results", "in", "a", "constant", ".", "If", "so", "then", "evalf", "()", "can", "safely", "be", "applied", "without", "error", "." ]
def returnConstant(self,context=None): """Returns true if the evaluation of the expression in the given context results in a constant. If so, then evalf() can safely be applied without error.""" raise NotImplementedError()
[ "def", "returnConstant", "(", "self", ",", "context", "=", "None", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/math/symbolic.py#L2159-L2162
husixu1/HUST-Homeworks
fbf6ed749eacab6e14bffea83703aadaf9324828
JOS/jos/gradelib.py
python
run_tests
()
Set up for testing and run the registered test functions.
Set up for testing and run the registered test functions.
[ "Set", "up", "for", "testing", "and", "run", "the", "registered", "test", "functions", "." ]
def run_tests(): """Set up for testing and run the registered test functions.""" # Handle command line global options parser = OptionParser(usage="usage: %prog [-v] [filters...]") parser.add_option("-v", "--verbose", action="store_true", help="print commands") parser.add_o...
[ "def", "run_tests", "(", ")", ":", "# Handle command line", "global", "options", "parser", "=", "OptionParser", "(", "usage", "=", "\"usage: %prog [-v] [filters...]\"", ")", "parser", ".", "add_option", "(", "\"-v\"", ",", "\"--verbose\"", ",", "action", "=", "\"s...
https://github.com/husixu1/HUST-Homeworks/blob/fbf6ed749eacab6e14bffea83703aadaf9324828/JOS/jos/gradelib.py#L89-L118
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py
python
Context._raise_error
(self, condition, explanation = None, *args)
Handles an error If the flag is in _ignored_flags, returns the default response. Otherwise, it sets the flag, then, if the corresponding trap_enabler is set, it reraises the exception. Otherwise, it returns the default value after setting the flag.
Handles an error
[ "Handles", "an", "error" ]
def _raise_error(self, condition, explanation = None, *args): """Handles an error If the flag is in _ignored_flags, returns the default response. Otherwise, it sets the flag, then, if the corresponding trap_enabler is set, it reraises the exception. Otherwise, it returns the de...
[ "def", "_raise_error", "(", "self", ",", "condition", ",", "explanation", "=", "None", ",", "*", "args", ")", ":", "error", "=", "_condition_map", ".", "get", "(", "condition", ",", "condition", ")", "if", "error", "in", "self", ".", "_ignored_flags", ":...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py#L3852-L3872
AojunZhou/Incremental-Network-Quantization
c7f6a609d5817d8424ce224209cf4c50f1e4de50
scripts/cpp_lint.py
python
CheckForNonStandardConstructs
(filename, clean_lines, linenum, nesting_state, error)
r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2. Complain about several constructs which gcc-2 accepts, but which are not standard C++. Warning about these in lint is one way to ease the transition to new compilers. - put storage class first (e.g. "static const" instead of "const stat...
r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
[ "r", "Logs", "an", "error", "if", "we", "see", "certain", "non", "-", "ANSI", "constructs", "ignored", "by", "gcc", "-", "2", "." ]
def CheckForNonStandardConstructs(filename, clean_lines, linenum, nesting_state, error): r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2. Complain about several constructs which gcc-2 accepts, but which are not standard C++. Warning about these in lint ...
[ "def", "CheckForNonStandardConstructs", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "# Remove comments from the line, but leave in strings for now.", "line", "=", "clean_lines", ".", "lines", "[", "linenum", "]", "i...
https://github.com/AojunZhou/Incremental-Network-Quantization/blob/c7f6a609d5817d8424ce224209cf4c50f1e4de50/scripts/cpp_lint.py#L2194-L2298
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
caffe2/python/checkpoint.py
python
MultiNodeCheckpointManager.load_blobs_locally
(self, nodes, blob_names, epoch, session)
return True
Loads the necessary blobs from the checkpoints to the current node. Args: blob_names: A list of strings. Each string is the name of a blob. epoch: An integer. The checkpoint epoch to load from. session: A Session object to execute the Load ops.
Loads the necessary blobs from the checkpoints to the current node.
[ "Loads", "the", "necessary", "blobs", "from", "the", "checkpoints", "to", "the", "current", "node", "." ]
def load_blobs_locally(self, nodes, blob_names, epoch, session): """Loads the necessary blobs from the checkpoints to the current node. Args: blob_names: A list of strings. Each string is the name of a blob. epoch: An integer. The checkpoint epoch to load from. ...
[ "def", "load_blobs_locally", "(", "self", ",", "nodes", ",", "blob_names", ",", "epoch", ",", "session", ")", ":", "if", "self", ".", "_node_managers", "is", "not", "None", ":", "assert", "[", "node", "for", "node", ",", "_", "in", "self", ".", "_node_...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/caffe2/python/checkpoint.py#L497-L529
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/checkdeps/checkdeps.py
python
DepsChecker.__init__
(self, base_directory=None, verbose=False, being_tested=False, ignore_temp_rules=False, skip_tests=False)
Creates a new DepsChecker. Args: base_directory: OS-compatible path to root of checkout, e.g. C:\chr\src. verbose: Set to true for debug output. being_tested: Set to true to ignore the DEPS file at tools/checkdeps/DEPS. ignore_temp_rules: Ignore rules that start with Rule.TEMP_ALLOW ("!").
Creates a new DepsChecker.
[ "Creates", "a", "new", "DepsChecker", "." ]
def __init__(self, base_directory=None, verbose=False, being_tested=False, ignore_temp_rules=False, skip_tests=False): """Creates a new DepsChecker. Args: base_directory: OS-compatible path to root of checkout, e.g. C:\chr\src. ...
[ "def", "__init__", "(", "self", ",", "base_directory", "=", "None", ",", "verbose", "=", "False", ",", "being_tested", "=", "False", ",", "ignore_temp_rules", "=", "False", ",", "skip_tests", "=", "False", ")", ":", "DepsBuilder", ".", "__init__", "(", "se...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/checkdeps/checkdeps.py#L40-L58
intel/caffe
3f494b442ee3f9d17a07b09ecbd5fa2bbda00836
examples/faster-rcnn/lib/rpn/proposal_target_layer.py
python
_get_bbox_regression_labels
(bbox_target_data, num_classes)
return bbox_targets, bbox_inside_weights
Bounding-box regression targets (bbox_target_data) are stored in a compact form N x (class, tx, ty, tw, th) This function expands those targets into the 4-of-4*K representation used by the network (i.e. only one class has non-zero targets). Returns: bbox_target (ndarray): N x 4K blob of regres...
Bounding-box regression targets (bbox_target_data) are stored in a compact form N x (class, tx, ty, tw, th)
[ "Bounding", "-", "box", "regression", "targets", "(", "bbox_target_data", ")", "are", "stored", "in", "a", "compact", "form", "N", "x", "(", "class", "tx", "ty", "tw", "th", ")" ]
def _get_bbox_regression_labels(bbox_target_data, num_classes): """Bounding-box regression targets (bbox_target_data) are stored in a compact form N x (class, tx, ty, tw, th) This function expands those targets into the 4-of-4*K representation used by the network (i.e. only one class has non-zero targe...
[ "def", "_get_bbox_regression_labels", "(", "bbox_target_data", ",", "num_classes", ")", ":", "clss", "=", "bbox_target_data", "[", ":", ",", "0", "]", "bbox_targets", "=", "np", ".", "zeros", "(", "(", "clss", ".", "size", ",", "4", "*", "num_classes", ")"...
https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/examples/faster-rcnn/lib/rpn/proposal_target_layer.py#L107-L129
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/environment.py
python
Environment.list_templates
(self, extensions=None, filter_func=None)
return x
Returns a list of templates for this environment. This requires that the loader supports the loader's :meth:`~BaseLoader.list_templates` method. If there are other files in the template folder besides the actual templates, the returned list can be filtered. There are two ways:...
Returns a list of templates for this environment. This requires that the loader supports the loader's :meth:`~BaseLoader.list_templates` method.
[ "Returns", "a", "list", "of", "templates", "for", "this", "environment", ".", "This", "requires", "that", "the", "loader", "supports", "the", "loader", "s", ":", "meth", ":", "~BaseLoader", ".", "list_templates", "method", "." ]
def list_templates(self, extensions=None, filter_func=None): """Returns a list of templates for this environment. This requires that the loader supports the loader's :meth:`~BaseLoader.list_templates` method. If there are other files in the template folder besides the actual te...
[ "def", "list_templates", "(", "self", ",", "extensions", "=", "None", ",", "filter_func", "=", "None", ")", ":", "x", "=", "self", ".", "loader", ".", "list_templates", "(", ")", "if", "extensions", "is", "not", "None", ":", "if", "filter_func", "is", ...
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/environment.py#L707-L732
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/command/register.py
python
register.check_metadata
(self)
Deprecated API.
Deprecated API.
[ "Deprecated", "API", "." ]
def check_metadata(self): """Deprecated API.""" warn("distutils.command.register.check_metadata is deprecated, \ use the check command instead", PendingDeprecationWarning) check = self.distribution.get_command_obj('check') check.ensure_finalized() check.strict = sel...
[ "def", "check_metadata", "(", "self", ")", ":", "warn", "(", "\"distutils.command.register.check_metadata is deprecated, \\\n use the check command instead\"", ",", "PendingDeprecationWarning", ")", "check", "=", "self", ".", "distribution", ".", "get_command_obj", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/command/register.py#L59-L67
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/MatchPeaks.py
python
MatchPeaks._get_peak_position
(input_ws)
return peak_bin
Gives bin of the peak of each spectrum in the input_ws @param input_ws :: input workspace @return :: bin numbers of the peak positions
Gives bin of the peak of each spectrum in the input_ws
[ "Gives", "bin", "of", "the", "peak", "of", "each", "spectrum", "in", "the", "input_ws" ]
def _get_peak_position(input_ws): """ Gives bin of the peak of each spectrum in the input_ws @param input_ws :: input workspace @return :: bin numbers of the peak positions """ fit_table_name = input_ws.name() + '_epp' if isinstance(input_ws, MatrixWor...
[ "def", "_get_peak_position", "(", "input_ws", ")", ":", "fit_table_name", "=", "input_ws", ".", "name", "(", ")", "+", "'_epp'", "if", "isinstance", "(", "input_ws", ",", "MatrixWorkspace", ")", ":", "fit_table", "=", "FindEPP", "(", "InputWorkspace", "=", "...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/MatchPeaks.py#L231-L291
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/mac/symbolicate_crash.py
python
CrashReport._AddSymbolsToFrames
(self, symbols, address_tuples)
Takes a single value (the list) from _CollectAddressesForImages and does a smart-zip with the data returned by atos in |symbols|. Note that the indices must match for this to succeed.
Takes a single value (the list) from _CollectAddressesForImages and does a smart-zip with the data returned by atos in |symbols|. Note that the indices must match for this to succeed.
[ "Takes", "a", "single", "value", "(", "the", "list", ")", "from", "_CollectAddressesForImages", "and", "does", "a", "smart", "-", "zip", "with", "the", "data", "returned", "by", "atos", "in", "|symbols|", ".", "Note", "that", "the", "indices", "must", "mat...
def _AddSymbolsToFrames(self, symbols, address_tuples): """Takes a single value (the list) from _CollectAddressesForImages and does a smart-zip with the data returned by atos in |symbols|. Note that the indices must match for this to succeed.""" if len(symbols) != len(address_tuples): print 'symbo...
[ "def", "_AddSymbolsToFrames", "(", "self", ",", "symbols", ",", "address_tuples", ")", ":", "if", "len", "(", "symbols", ")", "!=", "len", "(", "address_tuples", ")", ":", "print", "'symbols do not match'", "# Each line of output from atos is in this format:", "# |<sy...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/mac/symbolicate_crash.py#L349-L369
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
EvtHandler.__init__
(self, *args, **kwargs)
__init__(self) -> EvtHandler
__init__(self) -> EvtHandler
[ "__init__", "(", "self", ")", "-", ">", "EvtHandler" ]
def __init__(self, *args, **kwargs): """__init__(self) -> EvtHandler""" _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs)) self._setOORInfo(self)
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_core_", ".", "EvtHandler_swiginit", "(", "self", ",", "_core_", ".", "new_EvtHandler", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")", "self", ".", "_setOORIn...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L4115-L4118
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/ir/values.py
python
Block.replace
(self, old, new)
Replace an instruction
Replace an instruction
[ "Replace", "an", "instruction" ]
def replace(self, old, new): """Replace an instruction""" if old.type != new.type: raise TypeError("new instruction has a different type") pos = self.instructions.index(old) self.instructions.remove(old) self.instructions.insert(pos, new) for bb in self.paren...
[ "def", "replace", "(", "self", ",", "old", ",", "new", ")", ":", "if", "old", ".", "type", "!=", "new", ".", "type", ":", "raise", "TypeError", "(", "\"new instruction has a different type\"", ")", "pos", "=", "self", ".", "instructions", ".", "index", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/ir/values.py#L799-L809
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/learn/python/learn/datasets/mnist.py
python
dense_to_one_hot
(labels_dense, num_classes)
return labels_one_hot
Convert class labels from scalars to one-hot vectors.
Convert class labels from scalars to one-hot vectors.
[ "Convert", "class", "labels", "from", "scalars", "to", "one", "-", "hot", "vectors", "." ]
def dense_to_one_hot(labels_dense, num_classes): """Convert class labels from scalars to one-hot vectors.""" num_labels = labels_dense.shape[0] index_offset = numpy.arange(num_labels) * num_classes labels_one_hot = numpy.zeros((num_labels, num_classes)) labels_one_hot.flat[index_offset + labels_dense.ravel()]...
[ "def", "dense_to_one_hot", "(", "labels_dense", ",", "num_classes", ")", ":", "num_labels", "=", "labels_dense", ".", "shape", "[", "0", "]", "index_offset", "=", "numpy", ".", "arange", "(", "num_labels", ")", "*", "num_classes", "labels_one_hot", "=", "numpy...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/datasets/mnist.py#L56-L62
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
Point2D.__init__
(self, *args, **kwargs)
__init__(self, double x=0.0, double y=0.0) -> Point2D Create a w.Point2D object.
__init__(self, double x=0.0, double y=0.0) -> Point2D
[ "__init__", "(", "self", "double", "x", "=", "0", ".", "0", "double", "y", "=", "0", ".", "0", ")", "-", ">", "Point2D" ]
def __init__(self, *args, **kwargs): """ __init__(self, double x=0.0, double y=0.0) -> Point2D Create a w.Point2D object. """ _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_core_", ".", "Point2D_swiginit", "(", "self", ",", "_core_", ".", "new_Point2D", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L1647-L1653
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/email/_header_value_parser.py
python
get_invalid_parameter
(value)
return invalid_parameter, value
Read everything up to the next ';'. This is outside the formal grammar. The InvalidParameter TokenList that is returned acts like a Parameter, but the data attributes are None.
Read everything up to the next ';'.
[ "Read", "everything", "up", "to", "the", "next", ";", "." ]
def get_invalid_parameter(value): """ Read everything up to the next ';'. This is outside the formal grammar. The InvalidParameter TokenList that is returned acts like a Parameter, but the data attributes are None. """ invalid_parameter = InvalidParameter() while value and value[0] != ';': ...
[ "def", "get_invalid_parameter", "(", "value", ")", ":", "invalid_parameter", "=", "InvalidParameter", "(", ")", "while", "value", "and", "value", "[", "0", "]", "!=", "';'", ":", "if", "value", "[", "0", "]", "in", "PHRASE_ENDS", ":", "invalid_parameter", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/email/_header_value_parser.py#L2098-L2114
H-uru/Plasma
c2140ea046e82e9c199e257a7f2e7edb42602871
Scripts/Python/plasma/Plasma.py
python
PtGetDefaultSpawnPoint
()
Returns the default spawnpoint definition (as a ptSpawnPointInfo)
Returns the default spawnpoint definition (as a ptSpawnPointInfo)
[ "Returns", "the", "default", "spawnpoint", "definition", "(", "as", "a", "ptSpawnPointInfo", ")" ]
def PtGetDefaultSpawnPoint(): """Returns the default spawnpoint definition (as a ptSpawnPointInfo)""" pass
[ "def", "PtGetDefaultSpawnPoint", "(", ")", ":", "pass" ]
https://github.com/H-uru/Plasma/blob/c2140ea046e82e9c199e257a7f2e7edb42602871/Scripts/Python/plasma/Plasma.py#L418-L420
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/mimify.py
python
unmimify
(infile, outfile, decode_base64 = 0)
Convert quoted-printable parts of a MIME mail message to 8bit.
Convert quoted-printable parts of a MIME mail message to 8bit.
[ "Convert", "quoted", "-", "printable", "parts", "of", "a", "MIME", "mail", "message", "to", "8bit", "." ]
def unmimify(infile, outfile, decode_base64 = 0): """Convert quoted-printable parts of a MIME mail message to 8bit.""" if type(infile) == type(''): ifile = open(infile) if type(outfile) == type('') and infile == outfile: import os d, f = os.path.split(infile) ...
[ "def", "unmimify", "(", "infile", ",", "outfile", ",", "decode_base64", "=", "0", ")", ":", "if", "type", "(", "infile", ")", "==", "type", "(", "''", ")", ":", "ifile", "=", "open", "(", "infile", ")", "if", "type", "(", "outfile", ")", "==", "t...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/mimify.py#L207-L223
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/tools/build_info/gen_build_info.py
python
write_build_info
(filename, build_config, key_value_list)
Writes a Python that describes the build. Args: filename: filename to write to. build_config: A string that represents the config used in this build (e.g. "cuda"). key_value_list: A list of "key=value" strings that will be added to the module as additional fields. Raises: ValueError: I...
Writes a Python that describes the build.
[ "Writes", "a", "Python", "that", "describes", "the", "build", "." ]
def write_build_info(filename, build_config, key_value_list): """Writes a Python that describes the build. Args: filename: filename to write to. build_config: A string that represents the config used in this build (e.g. "cuda"). key_value_list: A list of "key=value" strings that will be added to ...
[ "def", "write_build_info", "(", "filename", ",", "build_config", ",", "key_value_list", ")", ":", "module_docstring", "=", "\"\\\"\\\"\\\"Generates a Python module containing information \"", "module_docstring", "+=", "\"about the build.\\\"\\\"\\\"\"", "if", "build_config", "=="...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/tools/build_info/gen_build_info.py#L23-L78
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_controls.py
python
Choice.__init__
(self, *args, **kwargs)
__init__(Window parent, int id, Point pos=DefaultPosition, Size size=DefaultSize, List choices=EmptyList, long style=0, Validator validator=DefaultValidator, String name=ChoiceNameStr) -> Choice Create and show a Choice control
__init__(Window parent, int id, Point pos=DefaultPosition, Size size=DefaultSize, List choices=EmptyList, long style=0, Validator validator=DefaultValidator, String name=ChoiceNameStr) -> Choice
[ "__init__", "(", "Window", "parent", "int", "id", "Point", "pos", "=", "DefaultPosition", "Size", "size", "=", "DefaultSize", "List", "choices", "=", "EmptyList", "long", "style", "=", "0", "Validator", "validator", "=", "DefaultValidator", "String", "name", "...
def __init__(self, *args, **kwargs): """ __init__(Window parent, int id, Point pos=DefaultPosition, Size size=DefaultSize, List choices=EmptyList, long style=0, Validator validator=DefaultValidator, String name=ChoiceNameStr) -> Choice Create and show a Choice control ...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_controls_", ".", "Choice_swiginit", "(", "self", ",", "_controls_", ".", "new_Choice", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")", "self", ".", "_setOORIn...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L493-L502
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/msvc.py
python
validate_vars
(env)
Validate the PCH and PCHSTOP construction variables.
Validate the PCH and PCHSTOP construction variables.
[ "Validate", "the", "PCH", "and", "PCHSTOP", "construction", "variables", "." ]
def validate_vars(env): """Validate the PCH and PCHSTOP construction variables.""" if 'PCH' in env and env['PCH']: if 'PCHSTOP' not in env: raise SCons.Errors.UserError("The PCHSTOP construction must be defined if PCH is defined.") if not SCons.Util.is_String(env['PCHSTOP']): ...
[ "def", "validate_vars", "(", "env", ")", ":", "if", "'PCH'", "in", "env", "and", "env", "[", "'PCH'", "]", ":", "if", "'PCHSTOP'", "not", "in", "env", ":", "raise", "SCons", ".", "Errors", ".", "UserError", "(", "\"The PCHSTOP construction must be defined if...
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/msvc.py#L55-L61
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
Window.ClearBackground
(*args, **kwargs)
return _core_.Window_ClearBackground(*args, **kwargs)
ClearBackground(self) Clears the window by filling it with the current background colour. Does not cause an erase background event to be generated.
ClearBackground(self)
[ "ClearBackground", "(", "self", ")" ]
def ClearBackground(*args, **kwargs): """ ClearBackground(self) Clears the window by filling it with the current background colour. Does not cause an erase background event to be generated. """ return _core_.Window_ClearBackground(*args, **kwargs)
[ "def", "ClearBackground", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_ClearBackground", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L10698-L10705
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/locale.py
python
getdefaultlocale
(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE'))
return _parse_localename(localename)
Tries to determine the default locale settings and returns them as tuple (language code, encoding). According to POSIX, a program which has not called setlocale(LC_ALL, "") runs using the portable 'C' locale. Calling setlocale(LC_ALL, "") lets it use the default locale as define...
Tries to determine the default locale settings and returns them as tuple (language code, encoding).
[ "Tries", "to", "determine", "the", "default", "locale", "settings", "and", "returns", "them", "as", "tuple", "(", "language", "code", "encoding", ")", "." ]
def getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')): """ Tries to determine the default locale settings and returns them as tuple (language code, encoding). According to POSIX, a program which has not called setlocale(LC_ALL, "") runs using the portable 'C' locale. ...
[ "def", "getdefaultlocale", "(", "envvars", "=", "(", "'LC_ALL'", ",", "'LC_CTYPE'", ",", "'LANG'", ",", "'LANGUAGE'", ")", ")", ":", "try", ":", "# check if it's supported by the _locale module", "import", "_locale", "code", ",", "encoding", "=", "_locale", ".", ...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/locale.py#L428-L478
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/tools/cpplint.py
python
_BlockInfo.CheckBegin
(self, filename, clean_lines, linenum, error)
Run checks that applies to text up to the opening brace. This is mostly for checking the text after the class identifier and the "{", usually where the base class is specified. For other blocks, there isn't much to check, so we always pass. Args: filename: The name of the current file. cl...
Run checks that applies to text up to the opening brace.
[ "Run", "checks", "that", "applies", "to", "text", "up", "to", "the", "opening", "brace", "." ]
def CheckBegin(self, filename, clean_lines, linenum, error): """Run checks that applies to text up to the opening brace. This is mostly for checking the text after the class identifier and the "{", usually where the base class is specified. For other blocks, there isn't much to check, so we always pas...
[ "def", "CheckBegin", "(", "self", ",", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "pass" ]
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/cpplint.py#L2734-L2747
PixarAnimationStudios/USD
faed18ce62c8736b02413635b584a2f637156bad
pxr/usdImaging/usdviewq/usdviewContextMenuItem.py
python
UsdviewContextMenuItem.isValid
(self)
return not hasattr(self, "_item") or self._item is not None
Menu items which have an invalid internal item are considered invalid. Header menus don't contain an internal _item attribute, so we return true in the case of the attribute being undefined. We use this function to give this state a clearer name.
Menu items which have an invalid internal item are considered invalid. Header menus don't contain an internal _item attribute, so we return true in the case of the attribute being undefined. We use this function to give this state a clearer name.
[ "Menu", "items", "which", "have", "an", "invalid", "internal", "item", "are", "considered", "invalid", ".", "Header", "menus", "don", "t", "contain", "an", "internal", "_item", "attribute", "so", "we", "return", "true", "in", "the", "case", "of", "the", "a...
def isValid(self): ''' Menu items which have an invalid internal item are considered invalid. Header menus don't contain an internal _item attribute, so we return true in the case of the attribute being undefined. We use this function to give this state a clearer name. ...
[ "def", "isValid", "(", "self", ")", ":", "return", "not", "hasattr", "(", "self", ",", "\"_item\"", ")", "or", "self", ".", "_item", "is", "not", "None" ]
https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/usdviewContextMenuItem.py#L32-L38
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_windows.py
python
Frame.SetStatusWidths
(*args, **kwargs)
return _windows_.Frame_SetStatusWidths(*args, **kwargs)
SetStatusWidths(self, int widths)
SetStatusWidths(self, int widths)
[ "SetStatusWidths", "(", "self", "int", "widths", ")" ]
def SetStatusWidths(*args, **kwargs): """SetStatusWidths(self, int widths)""" return _windows_.Frame_SetStatusWidths(*args, **kwargs)
[ "def", "SetStatusWidths", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "Frame_SetStatusWidths", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L629-L631
google/certificate-transparency
2588562fd306a447958471b6f06c1069619c1641
python/ct/crypto/cert.py
python
Certificate.tbscertificate
(self)
return self._asn1_cert["tbsCertificate"]
Returns the underlying tbsCertificate Returns: An x509.TBSCertificate instance.
Returns the underlying tbsCertificate
[ "Returns", "the", "underlying", "tbsCertificate" ]
def tbscertificate(self): """Returns the underlying tbsCertificate Returns: An x509.TBSCertificate instance. """ return self._asn1_cert["tbsCertificate"]
[ "def", "tbscertificate", "(", "self", ")", ":", "return", "self", ".", "_asn1_cert", "[", "\"tbsCertificate\"", "]" ]
https://github.com/google/certificate-transparency/blob/2588562fd306a447958471b6f06c1069619c1641/python/ct/crypto/cert.py#L224-L230
dmlc/xgboost
2775c2a1abd4b5b759ff517617434c8b9aeb4cc0
python-package/xgboost/core.py
python
Booster.inplace_predict
( self, data: Any, iteration_range: Tuple[int, int] = (0, 0), predict_type: str = "value", missing: float = np.nan, validate_features: bool = True, base_margin: Any = None, strict_shape: bool = False )
Run prediction in-place, Unlike :py:meth:`predict` method, inplace prediction does not cache the prediction result. Calling only ``inplace_predict`` in multiple threads is safe and lock free. But the safety does not hold when used in conjunction with other methods. E.g. you can't train...
Run prediction in-place, Unlike :py:meth:`predict` method, inplace prediction does not cache the prediction result.
[ "Run", "prediction", "in", "-", "place", "Unlike", ":", "py", ":", "meth", ":", "predict", "method", "inplace", "prediction", "does", "not", "cache", "the", "prediction", "result", "." ]
def inplace_predict( self, data: Any, iteration_range: Tuple[int, int] = (0, 0), predict_type: str = "value", missing: float = np.nan, validate_features: bool = True, base_margin: Any = None, strict_shape: bool = False ): """Run prediction in-p...
[ "def", "inplace_predict", "(", "self", ",", "data", ":", "Any", ",", "iteration_range", ":", "Tuple", "[", "int", ",", "int", "]", "=", "(", "0", ",", "0", ")", ",", "predict_type", ":", "str", "=", "\"value\"", ",", "missing", ":", "float", "=", "...
https://github.com/dmlc/xgboost/blob/2775c2a1abd4b5b759ff517617434c8b9aeb4cc0/python-package/xgboost/core.py#L1950-L2134
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/datetime.py
python
date.fromordinal
(cls, n)
return cls(y, m, d)
Construct a date from a proleptic Gregorian ordinal. January 1 of year 1 is day 1. Only the year, month and day are non-zero in the result.
Construct a date from a proleptic Gregorian ordinal.
[ "Construct", "a", "date", "from", "a", "proleptic", "Gregorian", "ordinal", "." ]
def fromordinal(cls, n): """Construct a date from a proleptic Gregorian ordinal. January 1 of year 1 is day 1. Only the year, month and day are non-zero in the result. """ y, m, d = _ord2ymd(n) return cls(y, m, d)
[ "def", "fromordinal", "(", "cls", ",", "n", ")", ":", "y", ",", "m", ",", "d", "=", "_ord2ymd", "(", "n", ")", "return", "cls", "(", "y", ",", "m", ",", "d", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/datetime.py#L870-L877
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf/cudf/core/dataframe.py
python
DataFrame.select_dtypes
(self, include=None, exclude=None)
return df
Return a subset of the DataFrame’s columns based on the column dtypes. Parameters ---------- include : str or list which columns to include based on dtypes exclude : str or list which columns to exclude based on dtypes Returns ------- Dat...
Return a subset of the DataFrame’s columns based on the column dtypes.
[ "Return", "a", "subset", "of", "the", "DataFrame’s", "columns", "based", "on", "the", "column", "dtypes", "." ]
def select_dtypes(self, include=None, exclude=None): """Return a subset of the DataFrame’s columns based on the column dtypes. Parameters ---------- include : str or list which columns to include based on dtypes exclude : str or list which columns to excl...
[ "def", "select_dtypes", "(", "self", ",", "include", "=", "None", ",", "exclude", "=", "None", ")", ":", "# code modified from:", "# https://github.com/pandas-dev/pandas/blob/master/pandas/core/frame.py#L3196", "if", "not", "isinstance", "(", "include", ",", "(", "list"...
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/dataframe.py#L5490-L5620
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
mojo/public/bindings/pylib/parse/mojo_parser.py
python
Parser.p_root
(self, p)
root : import root | module
root : import root | module
[ "root", ":", "import", "root", "|", "module" ]
def p_root(self, p): """root : import root | module""" if len(p) > 2: p[0] = ListFromConcat(p[1], p[2]) else: p[0] = [p[1]]
[ "def", "p_root", "(", "self", ",", "p", ")", ":", "if", "len", "(", "p", ")", ">", "2", ":", "p", "[", "0", "]", "=", "ListFromConcat", "(", "p", "[", "1", "]", ",", "p", "[", "2", "]", ")", "else", ":", "p", "[", "0", "]", "=", "[", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/mojo/public/bindings/pylib/parse/mojo_parser.py#L50-L56
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/stc.py
python
StyledTextCtrl.SetAdditionalSelAlpha
(*args, **kwargs)
return _stc.StyledTextCtrl_SetAdditionalSelAlpha(*args, **kwargs)
SetAdditionalSelAlpha(self, int alpha) Set the alpha of the selection.
SetAdditionalSelAlpha(self, int alpha)
[ "SetAdditionalSelAlpha", "(", "self", "int", "alpha", ")" ]
def SetAdditionalSelAlpha(*args, **kwargs): """ SetAdditionalSelAlpha(self, int alpha) Set the alpha of the selection. """ return _stc.StyledTextCtrl_SetAdditionalSelAlpha(*args, **kwargs)
[ "def", "SetAdditionalSelAlpha", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_SetAdditionalSelAlpha", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L6285-L6291
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/contrib/slim/quantization/post_training_quantization.py
python
WeightQuantization._conv_channel_wise_quantization
(self, weight_data, quantize_range, save_weight_dtype)
return scales, quantized_weight_data
Get channel wise scale for the weights of conv2d and depthwise_conv2d, and quantize the weights.
Get channel wise scale for the weights of conv2d and depthwise_conv2d, and quantize the weights.
[ "Get", "channel", "wise", "scale", "for", "the", "weights", "of", "conv2d", "and", "depthwise_conv2d", "and", "quantize", "the", "weights", "." ]
def _conv_channel_wise_quantization(self, weight_data, quantize_range, save_weight_dtype): ''' Get channel wise scale for the weights of conv2d and depthwise_conv2d, and quantize the weights. ''' scales = [] quantized_weight_data = ...
[ "def", "_conv_channel_wise_quantization", "(", "self", ",", "weight_data", ",", "quantize_range", ",", "save_weight_dtype", ")", ":", "scales", "=", "[", "]", "quantized_weight_data", "=", "np", ".", "zeros_like", "(", "weight_data", ",", "dtype", "=", "save_weigh...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/contrib/slim/quantization/post_training_quantization.py#L1279-L1294
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/aui.py
python
AuiTabArt.ShowDropDown
(*args, **kwargs)
return _aui.AuiTabArt_ShowDropDown(*args, **kwargs)
ShowDropDown(self, Window wnd, AuiNotebookPageArray items, int activeIdx) -> int
ShowDropDown(self, Window wnd, AuiNotebookPageArray items, int activeIdx) -> int
[ "ShowDropDown", "(", "self", "Window", "wnd", "AuiNotebookPageArray", "items", "int", "activeIdx", ")", "-", ">", "int" ]
def ShowDropDown(*args, **kwargs): """ShowDropDown(self, Window wnd, AuiNotebookPageArray items, int activeIdx) -> int""" return _aui.AuiTabArt_ShowDropDown(*args, **kwargs)
[ "def", "ShowDropDown", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiTabArt_ShowDropDown", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/aui.py#L2322-L2324
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
3rdparty/protobuf-3.0.0/python/google/protobuf/internal/well_known_types.py
python
FieldMask.IsValidForDescriptor
(self, message_descriptor)
return True
Checks whether the FieldMask is valid for Message Descriptor.
Checks whether the FieldMask is valid for Message Descriptor.
[ "Checks", "whether", "the", "FieldMask", "is", "valid", "for", "Message", "Descriptor", "." ]
def IsValidForDescriptor(self, message_descriptor): """Checks whether the FieldMask is valid for Message Descriptor.""" for path in self.paths: if not _IsValidPath(message_descriptor, path): return False return True
[ "def", "IsValidForDescriptor", "(", "self", ",", "message_descriptor", ")", ":", "for", "path", "in", "self", ".", "paths", ":", "if", "not", "_IsValidPath", "(", "message_descriptor", ",", "path", ")", ":", "return", "False", "return", "True" ]
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/internal/well_known_types.py#L390-L395
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/run-bisect-perf-regression.py
python
_RunPerformanceTest
(config)
Runs a performance test with and without the current patch. Args: config: Contents of the config file, a dictionary. Attempts to build and run the current revision with and without the current patch, with the parameters passed in.
Runs a performance test with and without the current patch.
[ "Runs", "a", "performance", "test", "with", "and", "without", "the", "current", "patch", "." ]
def _RunPerformanceTest(config): """Runs a performance test with and without the current patch. Args: config: Contents of the config file, a dictionary. Attempts to build and run the current revision with and without the current patch, with the parameters passed in. """ # Bisect script expects to be r...
[ "def", "_RunPerformanceTest", "(", "config", ")", ":", "# Bisect script expects to be run from the src directory", "os", ".", "chdir", "(", "SRC_DIR", ")", "opts", "=", "_CreateBisectOptionsFromConfig", "(", "config", ")", "revisions", "=", "_ResolveRevisionsFromConfig", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/run-bisect-perf-regression.py#L413-L460
NicknineTheEagle/TF2-Base
20459c5a7fbc995b6bf54fa85c2f62a101e9fb64
src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/encoder.py
python
GroupSizer
(field_number, is_repeated, is_packed)
Returns a sizer for a group field.
Returns a sizer for a group field.
[ "Returns", "a", "sizer", "for", "a", "group", "field", "." ]
def GroupSizer(field_number, is_repeated, is_packed): """Returns a sizer for a group field.""" tag_size = _TagSize(field_number) * 2 assert not is_packed if is_repeated: def RepeatedFieldSize(value): result = tag_size * len(value) for element in value: result += element.ByteSize() ...
[ "def", "GroupSizer", "(", "field_number", ",", "is_repeated", ",", "is_packed", ")", ":", "tag_size", "=", "_TagSize", "(", "field_number", ")", "*", "2", "assert", "not", "is_packed", "if", "is_repeated", ":", "def", "RepeatedFieldSize", "(", "value", ")", ...
https://github.com/NicknineTheEagle/TF2-Base/blob/20459c5a7fbc995b6bf54fa85c2f62a101e9fb64/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/encoder.py#L265-L280
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/interpolate/_bsplines.py
python
BSpline.derivative
(self, nu=1)
return self.construct_fast(*tck, extrapolate=self.extrapolate, axis=self.axis)
Return a b-spline representing the derivative. Parameters ---------- nu : int, optional Derivative order. Default is 1. Returns ------- b : BSpline object A new instance representing the derivative. See Also -------- ...
Return a b-spline representing the derivative.
[ "Return", "a", "b", "-", "spline", "representing", "the", "derivative", "." ]
def derivative(self, nu=1): """Return a b-spline representing the derivative. Parameters ---------- nu : int, optional Derivative order. Default is 1. Returns ------- b : BSpline object A new instance representing the derivati...
[ "def", "derivative", "(", "self", ",", "nu", "=", "1", ")", ":", "c", "=", "self", ".", "c", "# pad the c array if needed", "ct", "=", "len", "(", "self", ".", "t", ")", "-", "len", "(", "c", ")", "if", "ct", ">", "0", ":", "c", "=", "np", "....
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/interpolate/_bsplines.py#L372-L398
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/keras/python/keras/backend.py
python
sqrt
(x)
return math_ops.sqrt(x)
Element-wise square root. Arguments: x: Tensor or variable. Returns: A tensor.
Element-wise square root.
[ "Element", "-", "wise", "square", "root", "." ]
def sqrt(x): """Element-wise square root. Arguments: x: Tensor or variable. Returns: A tensor. """ zero = _to_tensor(0., x.dtype.base_dtype) inf = _to_tensor(np.inf, x.dtype.base_dtype) x = clip_ops.clip_by_value(x, zero, inf) return math_ops.sqrt(x)
[ "def", "sqrt", "(", "x", ")", ":", "zero", "=", "_to_tensor", "(", "0.", ",", "x", ".", "dtype", ".", "base_dtype", ")", "inf", "=", "_to_tensor", "(", "np", ".", "inf", ",", "x", ".", "dtype", ".", "base_dtype", ")", "x", "=", "clip_ops", ".", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/keras/python/keras/backend.py#L1545-L1557
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/waflib/extras/review.py
python
ReviewContext.__init__
(self, **kw)
Path to the build directory
Path to the build directory
[ "Path", "to", "the", "build", "directory" ]
def __init__(self, **kw): super(self.__class__, self).__init__(**kw) out = Options.options.out if not out: out = getattr(Context.g_module, Context.OUT, None) if not out: out = Options.lockfile.replace('.lock-waf', '') self.build_path = (os.path.isabs(out) and self.root or self.path).make_node(out).absp...
[ "def", "__init__", "(", "self", ",", "*", "*", "kw", ")", ":", "super", "(", "self", ".", "__class__", ",", "self", ")", ".", "__init__", "(", "*", "*", "kw", ")", "out", "=", "Options", ".", "options", ".", "out", "if", "not", "out", ":", "out...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/extras/review.py#L146-L161
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/crywaflib/compile_settings_clang.py
python
load_debug_clang_settings
(conf)
Setup all compiler/linker flags with are shared over all targets using the clang compiler for the "debug" configuration
Setup all compiler/linker flags with are shared over all targets using the clang compiler for the "debug" configuration
[ "Setup", "all", "compiler", "/", "linker", "flags", "with", "are", "shared", "over", "all", "targets", "using", "the", "clang", "compiler", "for", "the", "debug", "configuration" ]
def load_debug_clang_settings(conf): """ Setup all compiler/linker flags with are shared over all targets using the clang compiler for the "debug" configuration """ v = conf.env load_clang_common_settings(v) COMPILER_FLAGS = [ '-O0', # No optimization ] v['CFLAGS'] += COMPILER_FLAGS v['CXXFLAGS'] += CO...
[ "def", "load_debug_clang_settings", "(", "conf", ")", ":", "v", "=", "conf", ".", "env", "load_clang_common_settings", "(", "v", ")", "COMPILER_FLAGS", "=", "[", "'-O0'", ",", "# No optimization", "]", "v", "[", "'CFLAGS'", "]", "+=", "COMPILER_FLAGS", "v", ...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/crywaflib/compile_settings_clang.py#L165-L178
seqan/seqan
f5f658343c366c9c3d44ba358ffc9317e78a09ed
util/py_lib/pyratemp.py
python
EvalPseudoSandbox.f_default
(self, expr, default=None)
``default()`` for the sandboxed code. Try to evaluate an expression and return the result or a fallback-/default-value; the `default`-value is used if `expr` does not exist/is invalid/results in None. This is very useful for optional data. :Parameter: - exp...
``default()`` for the sandboxed code. Try to evaluate an expression and return the result or a fallback-/default-value; the `default`-value is used if `expr` does not exist/is invalid/results in None.
[ "default", "()", "for", "the", "sandboxed", "code", ".", "Try", "to", "evaluate", "an", "expression", "and", "return", "the", "result", "or", "a", "fallback", "-", "/", "default", "-", "value", ";", "the", "default", "-", "value", "is", "used", "if", "...
def f_default(self, expr, default=None): """``default()`` for the sandboxed code. Try to evaluate an expression and return the result or a fallback-/default-value; the `default`-value is used if `expr` does not exist/is invalid/results in None. This is very useful for o...
[ "def", "f_default", "(", "self", ",", "expr", ",", "default", "=", "None", ")", ":", "try", ":", "r", "=", "self", ".", "eval", "(", "expr", ",", "self", ".", "locals_ptr", ")", "if", "r", "is", "None", ":", "return", "default", "return", "r", "#...
https://github.com/seqan/seqan/blob/f5f658343c366c9c3d44ba358ffc9317e78a09ed/util/py_lib/pyratemp.py#L913-L938
cmu-db/noisepage
79276e68fe83322f1249e8a8be96bd63c583ae56
build-support/cpplint.py
python
CleanseComments
(line)
return _RE_PATTERN_CLEANSE_LINE_C_COMMENTS.sub('', line)
Removes //-comments and single-line C-style /* */ comments. Args: line: A line of C++ source. Returns: The line with single-line comments removed.
Removes //-comments and single-line C-style /* */ comments.
[ "Removes", "//", "-", "comments", "and", "single", "-", "line", "C", "-", "style", "/", "*", "*", "/", "comments", "." ]
def CleanseComments(line): """Removes //-comments and single-line C-style /* */ comments. Args: line: A line of C++ source. Returns: The line with single-line comments removed. """ commentpos = line.find('//') if commentpos != -1 and not IsCppString(line[:commentpos]): line = line[:c...
[ "def", "CleanseComments", "(", "line", ")", ":", "commentpos", "=", "line", ".", "find", "(", "'//'", ")", "if", "commentpos", "!=", "-", "1", "and", "not", "IsCppString", "(", "line", "[", ":", "commentpos", "]", ")", ":", "line", "=", "line", "[", ...
https://github.com/cmu-db/noisepage/blob/79276e68fe83322f1249e8a8be96bd63c583ae56/build-support/cpplint.py#L1633-L1646
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/jinja2/compiler.py
python
FrameIdentifierVisitor.visit_Scope
(self, node)
Stop visiting at scopes.
Stop visiting at scopes.
[ "Stop", "visiting", "at", "scopes", "." ]
def visit_Scope(self, node): """Stop visiting at scopes."""
[ "def", "visit_Scope", "(", "self", ",", "node", ")", ":" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/jinja2/compiler.py#L350-L351
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/dataview.py
python
DataViewRenderer.CreateEditorCtrl
(*args, **kwargs)
return _dataview.DataViewRenderer_CreateEditorCtrl(*args, **kwargs)
CreateEditorCtrl(self, Window parent, Rect labelRect, wxVariant value) -> Window
CreateEditorCtrl(self, Window parent, Rect labelRect, wxVariant value) -> Window
[ "CreateEditorCtrl", "(", "self", "Window", "parent", "Rect", "labelRect", "wxVariant", "value", ")", "-", ">", "Window" ]
def CreateEditorCtrl(*args, **kwargs): """CreateEditorCtrl(self, Window parent, Rect labelRect, wxVariant value) -> Window""" return _dataview.DataViewRenderer_CreateEditorCtrl(*args, **kwargs)
[ "def", "CreateEditorCtrl", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewRenderer_CreateEditorCtrl", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/dataview.py#L1213-L1215
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/plugins/codebrowser/codebrowser/gentag/xmltags.py
python
XmlTagsBuilder.BuildTags
(self, buff, lexer)
return rtags
@param buff: code buffer @param lexer: xml lexer @return: taglib.DocStruct instance for the given buff
[]
def BuildTags(self, buff, lexer): """ @param buff: code buffer @param lexer: xml lexer @return: taglib.DocStruct instance for the given buff """ rtags = taglib.DocStruct() rtags.SetElementDescription(self.TAG_ID, '/') line_count = 0 current_line = ...
[ "def", "BuildTags", "(", "self", ",", "buff", ",", "lexer", ")", ":", "rtags", "=", "taglib", ".", "DocStruct", "(", ")", "rtags", ".", "SetElementDescription", "(", "self", ".", "TAG_ID", ",", "'/'", ")", "line_count", "=", "0", "current_line", "=", "...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/plugins/codebrowser/codebrowser/gentag/xmltags.py#L39-L64
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/eclib/platebtn.py
python
PlateButton.GetBackgroundBrush
(self, dc)
return brush
Get the brush for drawing the background of the button @return: wx.Brush @note: used internally when on gtk
Get the brush for drawing the background of the button @return: wx.Brush @note: used internally when on gtk
[ "Get", "the", "brush", "for", "drawing", "the", "background", "of", "the", "button", "@return", ":", "wx", ".", "Brush", "@note", ":", "used", "internally", "when", "on", "gtk" ]
def GetBackgroundBrush(self, dc): """Get the brush for drawing the background of the button @return: wx.Brush @note: used internally when on gtk """ if wx.Platform == '__WXMAC__' or self._style & PB_STYLE_NOBG: return wx.TRANSPARENT_BRUSH bkgrd = self.GetBac...
[ "def", "GetBackgroundBrush", "(", "self", ",", "dc", ")", ":", "if", "wx", ".", "Platform", "==", "'__WXMAC__'", "or", "self", ".", "_style", "&", "PB_STYLE_NOBG", ":", "return", "wx", ".", "TRANSPARENT_BRUSH", "bkgrd", "=", "self", ".", "GetBackgroundColour...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/eclib/platebtn.py#L429-L447
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/datetimes.py
python
tz_to_dtype
(tz)
Return a datetime64[ns] dtype appropriate for the given timezone. Parameters ---------- tz : tzinfo or None Returns ------- np.dtype or Datetime64TZDType
Return a datetime64[ns] dtype appropriate for the given timezone.
[ "Return", "a", "datetime64", "[", "ns", "]", "dtype", "appropriate", "for", "the", "given", "timezone", "." ]
def tz_to_dtype(tz): """ Return a datetime64[ns] dtype appropriate for the given timezone. Parameters ---------- tz : tzinfo or None Returns ------- np.dtype or Datetime64TZDType """ if tz is None: return _NS_DTYPE else: return DatetimeTZDtype(tz=tz)
[ "def", "tz_to_dtype", "(", "tz", ")", ":", "if", "tz", "is", "None", ":", "return", "_NS_DTYPE", "else", ":", "return", "DatetimeTZDtype", "(", "tz", "=", "tz", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/datetimes.py#L55-L70
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
Joystick.GetZMin
(*args, **kwargs)
return _misc_.Joystick_GetZMin(*args, **kwargs)
GetZMin(self) -> int
GetZMin(self) -> int
[ "GetZMin", "(", "self", ")", "-", ">", "int" ]
def GetZMin(*args, **kwargs): """GetZMin(self) -> int""" return _misc_.Joystick_GetZMin(*args, **kwargs)
[ "def", "GetZMin", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "Joystick_GetZMin", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L2194-L2196
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TNEANet.GetNodeAttrValue
(self, *args)
return _snap.TNEANet_GetNodeAttrValue(self, *args)
GetNodeAttrValue(TNEANet self, int const & NId, TStrIntPrH::TIter const & NodeHI) -> TStr Parameters: NId: int const & NodeHI: TStrIntPrH::TIter const &
GetNodeAttrValue(TNEANet self, int const & NId, TStrIntPrH::TIter const & NodeHI) -> TStr
[ "GetNodeAttrValue", "(", "TNEANet", "self", "int", "const", "&", "NId", "TStrIntPrH", "::", "TIter", "const", "&", "NodeHI", ")", "-", ">", "TStr" ]
def GetNodeAttrValue(self, *args): """ GetNodeAttrValue(TNEANet self, int const & NId, TStrIntPrH::TIter const & NodeHI) -> TStr Parameters: NId: int const & NodeHI: TStrIntPrH::TIter const & """ return _snap.TNEANet_GetNodeAttrValue(self, *args)
[ "def", "GetNodeAttrValue", "(", "self", ",", "*", "args", ")", ":", "return", "_snap", ".", "TNEANet_GetNodeAttrValue", "(", "self", ",", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L22494-L22503
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/CallTipWindow.py
python
CallTip.position_window
(self)
Check if needs to reposition the window, and if so - do it.
Check if needs to reposition the window, and if so - do it.
[ "Check", "if", "needs", "to", "reposition", "the", "window", "and", "if", "so", "-", "do", "it", "." ]
def position_window(self): """Check if needs to reposition the window, and if so - do it.""" curline = int(self.widget.index("insert").split('.')[0]) if curline == self.lastline: return self.lastline = curline self.widget.see("insert") if curline == self.paren...
[ "def", "position_window", "(", "self", ")", ":", "curline", "=", "int", "(", "self", ".", "widget", ".", "index", "(", "\"insert\"", ")", ".", "split", "(", "'.'", ")", "[", "0", "]", ")", "if", "curline", "==", "self", ".", "lastline", ":", "retur...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/CallTipWindow.py#L27-L46
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/config/configobj.py
python
Section.rename
(self, oldkey, newkey)
Change a keyname to another, without changing position in sequence. Implemented so that transformations can be made on keys, as well as on values. (used by encode and decode) Also renames comments.
Change a keyname to another, without changing position in sequence. Implemented so that transformations can be made on keys, as well as on values. (used by encode and decode) Also renames comments.
[ "Change", "a", "keyname", "to", "another", "without", "changing", "position", "in", "sequence", ".", "Implemented", "so", "that", "transformations", "can", "be", "made", "on", "keys", "as", "well", "as", "on", "values", ".", "(", "used", "by", "encode", "a...
def rename(self, oldkey, newkey): """ Change a keyname to another, without changing position in sequence. Implemented so that transformations can be made on keys, as well as on values. (used by encode and decode) Also renames comments. """ if old...
[ "def", "rename", "(", "self", ",", "oldkey", ",", "newkey", ")", ":", "if", "oldkey", "in", "self", ".", "scalars", ":", "the_list", "=", "self", ".", "scalars", "elif", "oldkey", "in", "self", ".", "sections", ":", "the_list", "=", "self", ".", "sec...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/config/configobj.py#L754-L781
google/shaka-packager
e1b0c7c45431327fd3ce193514a5407d07b39b22
packager/third_party/protobuf/python/google/protobuf/text_format.py
python
_Parser._ParseOrMerge
(self, lines, message)
Converts a text representation of a protocol message into a message. Args: lines: Lines of a message's text representation. message: A protocol buffer message to merge into. Raises: ParseError: On text parsing problems.
Converts a text representation of a protocol message into a message.
[ "Converts", "a", "text", "representation", "of", "a", "protocol", "message", "into", "a", "message", "." ]
def _ParseOrMerge(self, lines, message): """Converts a text representation of a protocol message into a message. Args: lines: Lines of a message's text representation. message: A protocol buffer message to merge into. Raises: ParseError: On text parsing problems. """ tokenizer = ...
[ "def", "_ParseOrMerge", "(", "self", ",", "lines", ",", "message", ")", ":", "tokenizer", "=", "Tokenizer", "(", "lines", ")", "while", "not", "tokenizer", ".", "AtEnd", "(", ")", ":", "self", ".", "_MergeField", "(", "tokenizer", ",", "message", ")" ]
https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/google/protobuf/text_format.py#L571-L583
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/chigger/graphs/Graph.py
python
Graph._setAxisOptions
(self, vtkaxis, opt)
Helper method for updating vtkAxis settings. (protected) Args: axis[vtkAxis]: The axis to update. opt[Options]: The options to apply to the axis.
Helper method for updating vtkAxis settings. (protected)
[ "Helper", "method", "for", "updating", "vtkAxis", "settings", ".", "(", "protected", ")" ]
def _setAxisOptions(self, vtkaxis, opt): """ Helper method for updating vtkAxis settings. (protected) Args: axis[vtkAxis]: The axis to update. opt[Options]: The options to apply to the axis. """ utils.AxisOptions.set_options(vtkaxis, opt) # Adjus...
[ "def", "_setAxisOptions", "(", "self", ",", "vtkaxis", ",", "opt", ")", ":", "utils", ".", "AxisOptions", ".", "set_options", "(", "vtkaxis", ",", "opt", ")", "# Adjust hidden border size (changes made here are overridden by the 'hidden_border' option)", "if", "self", "...
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/chigger/graphs/Graph.py#L169-L181
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/jinja2/parser.py
python
Parser.parse_statement
(self)
Parse a single statement.
Parse a single statement.
[ "Parse", "a", "single", "statement", "." ]
def parse_statement(self): """Parse a single statement.""" token = self.stream.current if token.type != 'name': self.fail('tag name expected', token.lineno) self._tag_stack.append(token.value) pop_tag = True try: if token.value in _statement_keywor...
[ "def", "parse_statement", "(", "self", ")", ":", "token", "=", "self", ".", "stream", ".", "current", "if", "token", ".", "type", "!=", "'name'", ":", "self", ".", "fail", "(", "'tag name expected'", ",", "token", ".", "lineno", ")", "self", ".", "_tag...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/jinja2/parser.py#L121-L147