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
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/qcdb/orient.py
python
OrientMols.transform_gradient
(self, arr)
return arr
Applies to *arr* the transformation appropriate to bring a gradient in *molChangeable* orientation into *molPermanent* orientation. In particular, applies a rotation to place it in the inertial frame, a column exchange and phasing to place it in the axis system, a row exchange to place i...
Applies to *arr* the transformation appropriate to bring a gradient in *molChangeable* orientation into *molPermanent* orientation. In particular, applies a rotation to place it in the inertial frame, a column exchange and phasing to place it in the axis system, a row exchange to place i...
[ "Applies", "to", "*", "arr", "*", "the", "transformation", "appropriate", "to", "bring", "a", "gradient", "in", "*", "molChangeable", "*", "orientation", "into", "*", "molPermanent", "*", "orientation", ".", "In", "particular", "applies", "a", "rotation", "to"...
def transform_gradient(self, arr): """Applies to *arr* the transformation appropriate to bring a gradient in *molChangeable* orientation into *molPermanent* orientation. In particular, applies a rotation to place it in the inertial frame, a column exchange and phasing to place it...
[ "def", "transform_gradient", "(", "self", ",", "arr", ")", ":", "arr", "=", "mult", "(", "arr", ",", "self", ".", "Crotate", ")", "# print \"Rotate\"", "# for item in arr:", "# print(' %16.8f %16.8f %16.8f' % (item[0], item[1], item[2]))", "ar...
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/orient.py#L386-L418
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/pyfakefs/pyfakefs/fake_filesystem.py
python
FakePathModule.exists
(self, path)
return self.filesystem.Exists(path)
Determines whether the file object exists within the fake filesystem. Args: path: path to the file object Returns: bool (if file exists)
Determines whether the file object exists within the fake filesystem.
[ "Determines", "whether", "the", "file", "object", "exists", "within", "the", "fake", "filesystem", "." ]
def exists(self, path): """Determines whether the file object exists within the fake filesystem. Args: path: path to the file object Returns: bool (if file exists) """ return self.filesystem.Exists(path)
[ "def", "exists", "(", "self", ",", "path", ")", ":", "return", "self", ".", "filesystem", ".", "Exists", "(", "path", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/pyfakefs/pyfakefs/fake_filesystem.py#L1017-L1026
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
IsBusy
(*args)
return _misc_.IsBusy(*args)
IsBusy() -> bool
IsBusy() -> bool
[ "IsBusy", "()", "-", ">", "bool" ]
def IsBusy(*args): """IsBusy() -> bool""" return _misc_.IsBusy(*args)
[ "def", "IsBusy", "(", "*", "args", ")", ":", "return", "_misc_", ".", "IsBusy", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L324-L326
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Canvas.itemconfigure
(self, tagOrId, cnf=None, **kw)
return self._configure(('itemconfigure', tagOrId), cnf, kw)
Configure resources of an item TAGORID. The values for resources are specified as keyword arguments. To get an overview about the allowed keyword arguments call the method without arguments.
Configure resources of an item TAGORID.
[ "Configure", "resources", "of", "an", "item", "TAGORID", "." ]
def itemconfigure(self, tagOrId, cnf=None, **kw): """Configure resources of an item TAGORID. The values for resources are specified as keyword arguments. To get an overview about the allowed keyword arguments call the method without arguments. """ return self._configure(...
[ "def", "itemconfigure", "(", "self", ",", "tagOrId", ",", "cnf", "=", "None", ",", "*", "*", "kw", ")", ":", "return", "self", ".", "_configure", "(", "(", "'itemconfigure'", ",", "tagOrId", ")", ",", "cnf", ",", "kw", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2342-L2349
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/control_flow_ops.py
python
ControlFlowContext.Enter
(self)
Enter this control flow context.
Enter this control flow context.
[ "Enter", "this", "control", "flow", "context", "." ]
def Enter(self): """Enter this control flow context.""" graph = ops.get_default_graph() self._context_stack.append(graph._get_control_flow_context()) graph._set_control_flow_context(self)
[ "def", "Enter", "(", "self", ")", ":", "graph", "=", "ops", ".", "get_default_graph", "(", ")", "self", ".", "_context_stack", ".", "append", "(", "graph", ".", "_get_control_flow_context", "(", ")", ")", "graph", ".", "_set_control_flow_context", "(", "self...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/control_flow_ops.py#L744-L748
verilog-to-routing/vtr-verilog-to-routing
d9719cf7374821156c3cee31d66991cb85578562
vtr_flow/scripts/python_libs/vtr/log_parse.py
python
RangeAbsPassRequirement.max_value
(self)
return self._max_value
Return max value of ratio range
Return max value of ratio range
[ "Return", "max", "value", "of", "ratio", "range" ]
def max_value(self): """Return max value of ratio range""" return self._max_value
[ "def", "max_value", "(", "self", ")", ":", "return", "self", ".", "_max_value" ]
https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/d9719cf7374821156c3cee31d66991cb85578562/vtr_flow/scripts/python_libs/vtr/log_parse.py#L188-L190
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Taskmaster.py
python
Task.failed
(self)
Default action when a task fails: stop the build. Note: Although this function is normally invoked on nodes in the executing state, it might also be invoked on up-to-date nodes when using Configure().
Default action when a task fails: stop the build.
[ "Default", "action", "when", "a", "task", "fails", ":", "stop", "the", "build", "." ]
def failed(self): """ Default action when a task fails: stop the build. Note: Although this function is normally invoked on nodes in the executing state, it might also be invoked on up-to-date nodes when using Configure(). """ self.fail_stop()
[ "def", "failed", "(", "self", ")", ":", "self", ".", "fail_stop", "(", ")" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Taskmaster.py#L323-L331
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py
python
Spinbox.icursor
(self, index)
return self.tk.call(self._w, 'icursor', index)
Alter the position of the insertion cursor. The insertion cursor will be displayed just before the character given by index. Returns an empty string
Alter the position of the insertion cursor.
[ "Alter", "the", "position", "of", "the", "insertion", "cursor", "." ]
def icursor(self, index): """Alter the position of the insertion cursor. The insertion cursor will be displayed just before the character given by index. Returns an empty string """ return self.tk.call(self._w, 'icursor', index)
[ "def", "icursor", "(", "self", ",", "index", ")", ":", "return", "self", ".", "tk", ".", "call", "(", "self", ".", "_w", ",", "'icursor'", ",", "index", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L3677-L3683
rootm0s/Protectors
5b3f4d11687a5955caf9c3af30666c4bfc2c19ab
OWASP-ZSC/module/readline_windows/pyreadline/modes/basemode.py
python
BaseMode.redraw_current_line
(self, e)
Refresh the current line. By default, this is unbound.
Refresh the current line. By default, this is unbound.
[ "Refresh", "the", "current", "line", ".", "By", "default", "this", "is", "unbound", "." ]
def redraw_current_line(self, e): # () """Refresh the current line. By default, this is unbound.""" self.finalize()
[ "def", "redraw_current_line", "(", "self", ",", "e", ")", ":", "# ()", "self", ".", "finalize", "(", ")" ]
https://github.com/rootm0s/Protectors/blob/5b3f4d11687a5955caf9c3af30666c4bfc2c19ab/OWASP-ZSC/module/readline_windows/pyreadline/modes/basemode.py#L438-L440
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/framework/python/framework/tensor_util.py
python
assert_scalar_int
(tensor)
return tensor
Assert `tensor` is 0-D, of type `tf.int32` or `tf.int64`. Args: tensor: Tensor to test. Returns: `tensor`, for chaining. Raises: ValueError: if `tensor` is not 0-D, of type `tf.int32` or `tf.int64`.
Assert `tensor` is 0-D, of type `tf.int32` or `tf.int64`.
[ "Assert", "tensor", "is", "0", "-", "D", "of", "type", "tf", ".", "int32", "or", "tf", ".", "int64", "." ]
def assert_scalar_int(tensor): """Assert `tensor` is 0-D, of type `tf.int32` or `tf.int64`. Args: tensor: Tensor to test. Returns: `tensor`, for chaining. Raises: ValueError: if `tensor` is not 0-D, of type `tf.int32` or `tf.int64`. """ data_type = tensor.dtype if data_type.base_dtype not in ...
[ "def", "assert_scalar_int", "(", "tensor", ")", ":", "data_type", "=", "tensor", ".", "dtype", "if", "data_type", ".", "base_dtype", "not", "in", "[", "dtypes", ".", "int32", ",", "dtypes", ".", "int64", "]", ":", "raise", "ValueError", "(", "'Unexpected t...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/framework/python/framework/tensor_util.py#L99-L115
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/propgrid.py
python
NumericPropertyValidator.Validate
(*args, **kwargs)
return _propgrid.NumericPropertyValidator_Validate(*args, **kwargs)
Validate(self, Window parent) -> bool
Validate(self, Window parent) -> bool
[ "Validate", "(", "self", "Window", "parent", ")", "-", ">", "bool" ]
def Validate(*args, **kwargs): """Validate(self, Window parent) -> bool""" return _propgrid.NumericPropertyValidator_Validate(*args, **kwargs)
[ "def", "Validate", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "NumericPropertyValidator_Validate", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L2888-L2890
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/symbol/contrib.py
python
foreach
(body, data, init_states, name="foreach")
return (outs, states)
Run a for loop with user-defined computation over Symbols on dimension 0. This operator simulates a for loop and body has the computation for an iteration of the for loop. It runs the computation in body on each slice from the input NDArrays. body takes two arguments as input and outputs a tuple of tw...
Run a for loop with user-defined computation over Symbols on dimension 0.
[ "Run", "a", "for", "loop", "with", "user", "-", "defined", "computation", "over", "Symbols", "on", "dimension", "0", "." ]
def foreach(body, data, init_states, name="foreach"): """Run a for loop with user-defined computation over Symbols on dimension 0. This operator simulates a for loop and body has the computation for an iteration of the for loop. It runs the computation in body on each slice from the input NDArrays. ...
[ "def", "foreach", "(", "body", ",", "data", ",", "init_states", ",", "name", "=", "\"foreach\"", ")", ":", "flatten_data", ",", "data_fmt", "=", "_flatten", "(", "data", ",", "\"foreach input\"", ")", "_check_data", "(", "flatten_data", ",", "symbol", ".", ...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/symbol/contrib.py#L212-L373
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/composite/math_ops.py
python
count_nonzero
(x, axis=(), keep_dims=False, dtype=mstype.int32)
return nonzero_num
r""" Count number of nonzero elements across axis of input tensor Args: x (Tensor): Input data is used to count non-zero numbers. :math:`(N,*)` where :math:`*` means, any number of additional dimensions. axis (Union[int, tuple(int), list(int)]): The dimensions to reduce. Only constant...
r""" Count number of nonzero elements across axis of input tensor
[ "r", "Count", "number", "of", "nonzero", "elements", "across", "axis", "of", "input", "tensor" ]
def count_nonzero(x, axis=(), keep_dims=False, dtype=mstype.int32): r""" Count number of nonzero elements across axis of input tensor Args: x (Tensor): Input data is used to count non-zero numbers. :math:`(N,*)` where :math:`*` means, any number of additional dimensions. axis (Uni...
[ "def", "count_nonzero", "(", "x", ",", "axis", "=", "(", ")", ",", "keep_dims", "=", "False", ",", "dtype", "=", "mstype", ".", "int32", ")", ":", "const_utils", ".", "check_type_valid", "(", "F", ".", "dtype", "(", "x", ")", ",", "mstype", ".", "n...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/composite/math_ops.py#L47-L110
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/_pydecimal.py
python
Decimal._islogical
(self)
return True
Return True if self is a logical operand. For being logical, it must be a finite number with a sign of 0, an exponent of 0, and a coefficient whose digits must all be either 0 or 1.
Return True if self is a logical operand.
[ "Return", "True", "if", "self", "is", "a", "logical", "operand", "." ]
def _islogical(self): """Return True if self is a logical operand. For being logical, it must be a finite number with a sign of 0, an exponent of 0, and a coefficient whose digits must all be either 0 or 1. """ if self._sign != 0 or self._exp != 0: return Fal...
[ "def", "_islogical", "(", "self", ")", ":", "if", "self", ".", "_sign", "!=", "0", "or", "self", ".", "_exp", "!=", "0", ":", "return", "False", "for", "dig", "in", "self", ".", "_int", ":", "if", "dig", "not", "in", "'01'", ":", "return", "False...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/_pydecimal.py#L3353-L3365
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/pycparser/ply/cpp.py
python
t_CPP_COMMENT1
(t)
return t
r'(/\*(.|\n)*?\*/)
r'(/\*(.|\n)*?\*/)
[ "r", "(", "/", "\\", "*", "(", ".", "|", "\\", "n", ")", "*", "?", "\\", "*", "/", ")" ]
def t_CPP_COMMENT1(t): r'(/\*(.|\n)*?\*/)' ncr = t.value.count("\n") t.lexer.lineno += ncr # replace with one space or a number of '\n' t.type = 'CPP_WS'; t.value = '\n' * ncr if ncr else ' ' return t
[ "def", "t_CPP_COMMENT1", "(", "t", ")", ":", "ncr", "=", "t", ".", "value", ".", "count", "(", "\"\\n\"", ")", "t", ".", "lexer", ".", "lineno", "+=", "ncr", "# replace with one space or a number of '\\n'", "t", ".", "type", "=", "'CPP_WS'", "t", ".", "v...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/pycparser/ply/cpp.py#L65-L71
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/ML/Descriptors/CompoundDescriptors.py
python
CompoundDescriptorCalculator.CalcDescriptorsForComposition
(self, composVect, propDict)
return tuple(res)
calculates all descriptors for a given composition **Arguments** - compos: a string representation of the composition - propDict: a dictionary containing the properties of the composition as a whole (e.g. structural variables, etc.). These are used to generate Compound Descr...
calculates all descriptors for a given composition
[ "calculates", "all", "descriptors", "for", "a", "given", "composition" ]
def CalcDescriptorsForComposition(self, composVect, propDict): """ calculates all descriptors for a given composition **Arguments** - compos: a string representation of the composition - propDict: a dictionary containing the properties of the composition as a whole (e.g. structura...
[ "def", "CalcDescriptorsForComposition", "(", "self", ",", "composVect", ",", "propDict", ")", ":", "composList", "=", "chemutils", ".", "SplitComposition", "(", "composVect", "[", "0", "]", ")", "try", ":", "r1", "=", "self", ".", "CalcSimpleDescriptorsForCompos...
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/ML/Descriptors/CompoundDescriptors.py#L347-L376
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBExpressionOptions.SetStopOthers
(self, stop_others=True)
return _lldb.SBExpressionOptions_SetStopOthers(self, stop_others)
SetStopOthers(SBExpressionOptions self, bool stop_others=True) SetStopOthers(SBExpressionOptions self)
SetStopOthers(SBExpressionOptions self, bool stop_others=True) SetStopOthers(SBExpressionOptions self)
[ "SetStopOthers", "(", "SBExpressionOptions", "self", "bool", "stop_others", "=", "True", ")", "SetStopOthers", "(", "SBExpressionOptions", "self", ")" ]
def SetStopOthers(self, stop_others=True): """ SetStopOthers(SBExpressionOptions self, bool stop_others=True) SetStopOthers(SBExpressionOptions self) """ return _lldb.SBExpressionOptions_SetStopOthers(self, stop_others)
[ "def", "SetStopOthers", "(", "self", ",", "stop_others", "=", "True", ")", ":", "return", "_lldb", ".", "SBExpressionOptions_SetStopOthers", "(", "self", ",", "stop_others", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L5026-L5031
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py
python
MHMessage.add_sequence
(self, sequence)
Add sequence to list of sequences including the message.
Add sequence to list of sequences including the message.
[ "Add", "sequence", "to", "list", "of", "sequences", "including", "the", "message", "." ]
def add_sequence(self, sequence): """Add sequence to list of sequences including the message.""" if isinstance(sequence, str): if not sequence in self._sequences: self._sequences.append(sequence) else: raise TypeError('sequence must be a string: %s' % type...
[ "def", "add_sequence", "(", "self", ",", "sequence", ")", ":", "if", "isinstance", "(", "sequence", ",", "str", ")", ":", "if", "not", "sequence", "in", "self", ".", "_sequences", ":", "self", ".", "_sequences", ".", "append", "(", "sequence", ")", "el...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py#L1709-L1715
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/s3/multipart.py
python
part_lister
(mpupload, part_number_marker=None)
A generator function for listing parts of a multipart upload.
A generator function for listing parts of a multipart upload.
[ "A", "generator", "function", "for", "listing", "parts", "of", "a", "multipart", "upload", "." ]
def part_lister(mpupload, part_number_marker=None): """ A generator function for listing parts of a multipart upload. """ more_results = True part = None while more_results: parts = mpupload.get_all_parts(None, part_number_marker) for part in parts: yield part ...
[ "def", "part_lister", "(", "mpupload", ",", "part_number_marker", "=", "None", ")", ":", "more_results", "=", "True", "part", "=", "None", "while", "more_results", ":", "parts", "=", "mpupload", ".", "get_all_parts", "(", "None", ",", "part_number_marker", ")"...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/s3/multipart.py#L114-L125
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Tool/tex.py
python
TeXLaTeXFunction
(target = None, source= None, env=None)
return result
A builder for TeX and LaTeX that scans the source file to decide the "flavor" of the source and then executes the appropriate program.
A builder for TeX and LaTeX that scans the source file to decide the "flavor" of the source and then executes the appropriate program.
[ "A", "builder", "for", "TeX", "and", "LaTeX", "that", "scans", "the", "source", "file", "to", "decide", "the", "flavor", "of", "the", "source", "and", "then", "executes", "the", "appropriate", "program", "." ]
def TeXLaTeXFunction(target = None, source= None, env=None): """A builder for TeX and LaTeX that scans the source file to decide the "flavor" of the source and then executes the appropriate program.""" # find these paths for use in is_LaTeX to search for included files basedir = os.path.split(str(s...
[ "def", "TeXLaTeXFunction", "(", "target", "=", "None", ",", "source", "=", "None", ",", "env", "=", "None", ")", ":", "# find these paths for use in is_LaTeX to search for included files", "basedir", "=", "os", ".", "path", ".", "split", "(", "str", "(", "source...
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Tool/tex.py#L571-L588
pyne/pyne
0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3
pyne/cccc.py
python
Rtflux.to_mesh
(self, m, tag_name)
This member function tags supplied PyNE Mesh object with the fluxes contained in the rtflux file. Parameters ---------- m: PyNE Mesh A PyNE Mesh object with same x, y, z intervals used to generate the rtflux file. tag_name: str The tag name t...
This member function tags supplied PyNE Mesh object with the fluxes contained in the rtflux file.
[ "This", "member", "function", "tags", "supplied", "PyNE", "Mesh", "object", "with", "the", "fluxes", "contained", "in", "the", "rtflux", "file", "." ]
def to_mesh(self, m, tag_name): """This member function tags supplied PyNE Mesh object with the fluxes contained in the rtflux file. Parameters ---------- m: PyNE Mesh A PyNE Mesh object with same x, y, z intervals used to generate the rtflux file. ...
[ "def", "to_mesh", "(", "self", ",", "m", ",", "tag_name", ")", ":", "from", "pyne", ".", "mesh", "import", "HAVE_PYMOAB", "if", "HAVE_PYMOAB", ":", "from", "pyne", ".", "mesh", "import", "Mesh", ",", "NativeMeshTag", "else", ":", "warn", "(", "\"The PyMO...
https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/cccc.py#L657-L689
ablab/spades
3a754192b88540524ce6fb69eef5ea9273a38465
assembler/ext/src/python_libs/joblib3/parallel.py
python
Parallel._print
(self, msg, msg_args)
Display the message on stout or stderr depending on verbosity
Display the message on stout or stderr depending on verbosity
[ "Display", "the", "message", "on", "stout", "or", "stderr", "depending", "on", "verbosity" ]
def _print(self, msg, msg_args): """Display the message on stout or stderr depending on verbosity""" # XXX: Not using the logger framework: need to # learn to use logger better. if not self.verbose: return if self.verbose < 50: writer = sys.stderr.write ...
[ "def", "_print", "(", "self", ",", "msg", ",", "msg_args", ")", ":", "# XXX: Not using the logger framework: need to", "# learn to use logger better.", "if", "not", "self", ".", "verbose", ":", "return", "if", "self", ".", "verbose", "<", "50", ":", "writer", "=...
https://github.com/ablab/spades/blob/3a754192b88540524ce6fb69eef5ea9273a38465/assembler/ext/src/python_libs/joblib3/parallel.py#L665-L676
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/idlelib/config_key.py
python
GetKeysDialog.bind_ok
(self, keys)
Return True if Tcl accepts the new keys else show message.
Return True if Tcl accepts the new keys else show message.
[ "Return", "True", "if", "Tcl", "accepts", "the", "new", "keys", "else", "show", "message", "." ]
def bind_ok(self, keys): "Return True if Tcl accepts the new keys else show message." try: binding = self.bind(keys, lambda: None) except TclError as err: self.showerror( title=self.keyerror_title, parent=self, message=(f'The entere...
[ "def", "bind_ok", "(", "self", ",", "keys", ")", ":", "try", ":", "binding", "=", "self", ".", "bind", "(", "keys", ",", "lambda", ":", "None", ")", "except", "TclError", "as", "err", ":", "self", ".", "showerror", "(", "title", "=", "self", ".", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/config_key.py#L305-L317
naver/sling
5671cd445a2caae0b4dd0332299e4cfede05062c
webkit/Tools/Scripts/webkitpy/port/base.py
python
Port.test_dirs
(self)
return filter(lambda x: self._filesystem.isdir(self._filesystem.join(layout_tests_dir, x)), self._filesystem.listdir(layout_tests_dir))
Returns the list of top-level test directories.
Returns the list of top-level test directories.
[ "Returns", "the", "list", "of", "top", "-", "level", "test", "directories", "." ]
def test_dirs(self): """Returns the list of top-level test directories.""" layout_tests_dir = self.layout_tests_dir() return filter(lambda x: self._filesystem.isdir(self._filesystem.join(layout_tests_dir, x)), self._filesystem.listdir(layout_tests_dir))
[ "def", "test_dirs", "(", "self", ")", ":", "layout_tests_dir", "=", "self", ".", "layout_tests_dir", "(", ")", "return", "filter", "(", "lambda", "x", ":", "self", ".", "_filesystem", ".", "isdir", "(", "self", ".", "_filesystem", ".", "join", "(", "layo...
https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/port/base.py#L619-L623
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
python/psutil/examples/iotop.py
python
bytes2human
(n)
return '%.2f B/s' % (n)
>>> bytes2human(10000) '9.8 K/s' >>> bytes2human(100001221) '95.4 M/s'
>>> bytes2human(10000) '9.8 K/s' >>> bytes2human(100001221) '95.4 M/s'
[ ">>>", "bytes2human", "(", "10000", ")", "9", ".", "8", "K", "/", "s", ">>>", "bytes2human", "(", "100001221", ")", "95", ".", "4", "M", "/", "s" ]
def bytes2human(n): """ >>> bytes2human(10000) '9.8 K/s' >>> bytes2human(100001221) '95.4 M/s' """ symbols = ('K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y') prefix = {} for i, s in enumerate(symbols): prefix[s] = 1 << (i+1)*10 for s in reversed(symbols): if n >= prefix[s...
[ "def", "bytes2human", "(", "n", ")", ":", "symbols", "=", "(", "'K'", ",", "'M'", ",", "'G'", ",", "'T'", ",", "'P'", ",", "'E'", ",", "'Z'", ",", "'Y'", ")", "prefix", "=", "{", "}", "for", "i", ",", "s", "in", "enumerate", "(", "symbols", "...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/psutil/examples/iotop.py#L58-L73
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
DragImage.__init__
(self, *args, **kwargs)
__init__(self, Bitmap image, Cursor cursor=wxNullCursor) -> DragImage
__init__(self, Bitmap image, Cursor cursor=wxNullCursor) -> DragImage
[ "__init__", "(", "self", "Bitmap", "image", "Cursor", "cursor", "=", "wxNullCursor", ")", "-", ">", "DragImage" ]
def __init__(self, *args, **kwargs): """__init__(self, Bitmap image, Cursor cursor=wxNullCursor) -> DragImage""" _controls_.DragImage_swiginit(self,_controls_.new_DragImage(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_controls_", ".", "DragImage_swiginit", "(", "self", ",", "_controls_", ".", "new_DragImage", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L6344-L6346
protocolbuffers/protobuf
b5ab0b7a18b7336c60130f4ddb2d97c51792f896
python/mox.py
python
IsA.__init__
(self, class_name)
Initialize IsA Args: class_name: basic python type or a class
Initialize IsA
[ "Initialize", "IsA" ]
def __init__(self, class_name): """Initialize IsA Args: class_name: basic python type or a class """ self._class_name = class_name
[ "def", "__init__", "(", "self", ",", "class_name", ")", ":", "self", ".", "_class_name", "=", "class_name" ]
https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/mox.py#L798-L805
glotzerlab/hoomd-blue
f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a
hoomd/write/gsd.py
python
GSD.log
(self)
return self._log
hoomd.logging.Logger: Provide log quantities to write. May be `None`.
hoomd.logging.Logger: Provide log quantities to write.
[ "hoomd", ".", "logging", ".", "Logger", ":", "Provide", "log", "quantities", "to", "write", "." ]
def log(self): """hoomd.logging.Logger: Provide log quantities to write. May be `None`. """ return self._log
[ "def", "log", "(", "self", ")", ":", "return", "self", ".", "_log" ]
https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/write/gsd.py#L222-L227
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/utils/virtualenv.py
python
_running_under_venv
()
return sys.prefix != getattr(sys, "base_prefix", sys.prefix)
Checks if sys.base_prefix and sys.prefix match. This handles PEP 405 compliant virtual environments.
Checks if sys.base_prefix and sys.prefix match.
[ "Checks", "if", "sys", ".", "base_prefix", "and", "sys", ".", "prefix", "match", "." ]
def _running_under_venv(): # type: () -> bool """Checks if sys.base_prefix and sys.prefix match. This handles PEP 405 compliant virtual environments. """ return sys.prefix != getattr(sys, "base_prefix", sys.prefix)
[ "def", "_running_under_venv", "(", ")", ":", "# type: () -> bool", "return", "sys", ".", "prefix", "!=", "getattr", "(", "sys", ",", "\"base_prefix\"", ",", "sys", ".", "prefix", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/utils/virtualenv.py#L18-L24
KratosMultiphysics/Kratos
0000833054ed0503424eb28205d6508d9ca6cbbc
applications/FluidTransportApplication/python_scripts/fluid_transport_analysis.py
python
FluidTransportAnalysis._SetUpGiDOutput
(self)
return output
Initialize a GiD output instance.
Initialize a GiD output instance.
[ "Initialize", "a", "GiD", "output", "instance", "." ]
def _SetUpGiDOutput(self): '''Initialize a GiD output instance.''' if self.parallel_type == "OpenMP": from KratosMultiphysics.FluidTransportApplication import fluid_transport_cleaning_utility fluid_transport_cleaning_utility.CleanPreviousFiles(os.getcwd()) # Clean previous post f...
[ "def", "_SetUpGiDOutput", "(", "self", ")", ":", "if", "self", ".", "parallel_type", "==", "\"OpenMP\"", ":", "from", "KratosMultiphysics", ".", "FluidTransportApplication", "import", "fluid_transport_cleaning_utility", "fluid_transport_cleaning_utility", ".", "CleanPreviou...
https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/FluidTransportApplication/python_scripts/fluid_transport_analysis.py#L85-L98
echronos/echronos
c996f1d2c8af6c6536205eb319c1bf1d4d84569c
external_tools/ply_info/example/yply/ylex.py
python
t_code_rbrace
(t)
r'\}
r'\}
[ "r", "\\", "}" ]
def t_code_rbrace(t): r'\}' t.lexer.level -= 1 if t.lexer.level == 0: t.type = 'CODE' t.value = t.lexer.lexdata[t.lexer.codestart:t.lexpos+1] t.lexer.begin('INITIAL') t.lexer.lineno += t.value.count('\n') return t
[ "def", "t_code_rbrace", "(", "t", ")", ":", "t", ".", "lexer", ".", "level", "-=", "1", "if", "t", ".", "lexer", ".", "level", "==", "0", ":", "t", ".", "type", "=", "'CODE'", "t", ".", "value", "=", "t", ".", "lexer", ".", "lexdata", "[", "t...
https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/yply/ylex.py#L80-L88
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/xml/etree/ElementTree.py
python
Element.find
(self, path, namespaces=None)
return ElementPath.find(self, path, namespaces)
Find first matching element by tag name or path. *path* is a string having either an element tag or an XPath, *namespaces* is an optional mapping from namespace prefix to full name. Return the first matching element, or None if no element was found.
Find first matching element by tag name or path.
[ "Find", "first", "matching", "element", "by", "tag", "name", "or", "path", "." ]
def find(self, path, namespaces=None): """Find first matching element by tag name or path. *path* is a string having either an element tag or an XPath, *namespaces* is an optional mapping from namespace prefix to full name. Return the first matching element, or None if no element was f...
[ "def", "find", "(", "self", ",", "path", ",", "namespaces", "=", "None", ")", ":", "return", "ElementPath", ".", "find", "(", "self", ",", "path", ",", "namespaces", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/xml/etree/ElementTree.py#L283-L292
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
media/webrtc/trunk/build/android/emulator.py
python
Emulator.__init__
(self, new_avd_name, fast_and_loose)
Init an Emulator. Args: nwe_avd_name: If set, will create a new temporary AVD. fast_and_loose: Loosen up the rules for reliable running for speed. Intended for quick testing or re-testing.
Init an Emulator.
[ "Init", "an", "Emulator", "." ]
def __init__(self, new_avd_name, fast_and_loose): """Init an Emulator. Args: nwe_avd_name: If set, will create a new temporary AVD. fast_and_loose: Loosen up the rules for reliable running for speed. Intended for quick testing or re-testing. """ try: android_sdk_root = os.env...
[ "def", "__init__", "(", "self", ",", "new_avd_name", ",", "fast_and_loose", ")", ":", "try", ":", "android_sdk_root", "=", "os", ".", "environ", "[", "'ANDROID_SDK_ROOT'", "]", "except", "KeyError", ":", "logging", ".", "critical", "(", "'The ANDROID_SDK_ROOT mu...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/build/android/emulator.py#L132-L160
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_windows.py
python
VarHVScrollHelper.SetRowColumnCount
(*args, **kwargs)
return _windows_.VarHVScrollHelper_SetRowColumnCount(*args, **kwargs)
SetRowColumnCount(self, size_t rowCount, size_t columnCount)
SetRowColumnCount(self, size_t rowCount, size_t columnCount)
[ "SetRowColumnCount", "(", "self", "size_t", "rowCount", "size_t", "columnCount", ")" ]
def SetRowColumnCount(*args, **kwargs): """SetRowColumnCount(self, size_t rowCount, size_t columnCount)""" return _windows_.VarHVScrollHelper_SetRowColumnCount(*args, **kwargs)
[ "def", "SetRowColumnCount", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "VarHVScrollHelper_SetRowColumnCount", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L2367-L2369
lmb-freiburg/ogn
974f72ef4bf840d6f6693d22d1843a79223e77ce
scripts/cpp_lint.py
python
_NestingState.InNamespaceBody
(self)
return self.stack and isinstance(self.stack[-1], _NamespaceInfo)
Check if we are currently one level inside a namespace body. Returns: True if top of the stack is a namespace block, False otherwise.
Check if we are currently one level inside a namespace body.
[ "Check", "if", "we", "are", "currently", "one", "level", "inside", "a", "namespace", "body", "." ]
def InNamespaceBody(self): """Check if we are currently one level inside a namespace body. Returns: True if top of the stack is a namespace block, False otherwise. """ return self.stack and isinstance(self.stack[-1], _NamespaceInfo)
[ "def", "InNamespaceBody", "(", "self", ")", ":", "return", "self", ".", "stack", "and", "isinstance", "(", "self", ".", "stack", "[", "-", "1", "]", ",", "_NamespaceInfo", ")" ]
https://github.com/lmb-freiburg/ogn/blob/974f72ef4bf840d6f6693d22d1843a79223e77ce/scripts/cpp_lint.py#L1940-L1946
KratosMultiphysics/Kratos
0000833054ed0503424eb28205d6508d9ca6cbbc
applications/TrilinosApplication/python_scripts/trilinos_linear_solver_factory.py
python
_CheckIfTypeIsDeprecated
(config)
function to translate old/deprecated names to new names needed for backwards-compatibility
function to translate old/deprecated names to new names needed for backwards-compatibility
[ "function", "to", "translate", "old", "/", "deprecated", "names", "to", "new", "names", "needed", "for", "backwards", "-", "compatibility" ]
def _CheckIfTypeIsDeprecated(config): '''function to translate old/deprecated names to new names needed for backwards-compatibility ''' solver_type = config["solver_type"].GetString() old_new_name_map = { "CGSolver" : "cg", "BICGSTABSolver" : "bicgstab", "GMRESSolver" : "gmr...
[ "def", "_CheckIfTypeIsDeprecated", "(", "config", ")", ":", "solver_type", "=", "config", "[", "\"solver_type\"", "]", ".", "GetString", "(", ")", "old_new_name_map", "=", "{", "\"CGSolver\"", ":", "\"cg\"", ",", "\"BICGSTABSolver\"", ":", "\"bicgstab\"", ",", "...
https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/TrilinosApplication/python_scripts/trilinos_linear_solver_factory.py#L6-L30
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/utils/misc.py
python
remove_auth_from_url
(url)
return _transform_url(url, _get_netloc)[0]
Return a copy of url with 'username:password@' removed.
Return a copy of url with 'username:password
[ "Return", "a", "copy", "of", "url", "with", "username", ":", "password" ]
def remove_auth_from_url(url): # type: (str) -> str """Return a copy of url with 'username:password@' removed.""" # username/pass params are passed to subversion through flags # and are not recognized in the url. return _transform_url(url, _get_netloc)[0]
[ "def", "remove_auth_from_url", "(", "url", ")", ":", "# type: (str) -> str", "# username/pass params are passed to subversion through flags", "# and are not recognized in the url.", "return", "_transform_url", "(", "url", ",", "_get_netloc", ")", "[", "0", "]" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/utils/misc.py#L1571-L1581
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/turtle.py
python
TPen.isdown
(self)
return self._drawing
Return True if pen is down, False if it's up. No argument. Example (for a Turtle instance named turtle): >>> turtle.penup() >>> turtle.isdown() False >>> turtle.pendown() >>> turtle.isdown() True
Return True if pen is down, False if it's up.
[ "Return", "True", "if", "pen", "is", "down", "False", "if", "it", "s", "up", "." ]
def isdown(self): """Return True if pen is down, False if it's up. No argument. Example (for a Turtle instance named turtle): >>> turtle.penup() >>> turtle.isdown() False >>> turtle.pendown() >>> turtle.isdown() True """ return se...
[ "def", "isdown", "(", "self", ")", ":", "return", "self", ".", "_drawing" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/turtle.py#L2037-L2050
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py2/setuptools/command/develop.py
python
develop._resolve_setup_path
(egg_base, install_dir, egg_path)
return path_to_setup
Generate a path from egg_base back to '.' where the setup script resides and ensure that path points to the setup path from $install_dir/$egg_path.
Generate a path from egg_base back to '.' where the setup script resides and ensure that path points to the setup path from $install_dir/$egg_path.
[ "Generate", "a", "path", "from", "egg_base", "back", "to", ".", "where", "the", "setup", "script", "resides", "and", "ensure", "that", "path", "points", "to", "the", "setup", "path", "from", "$install_dir", "/", "$egg_path", "." ]
def _resolve_setup_path(egg_base, install_dir, egg_path): """ Generate a path from egg_base back to '.' where the setup script resides and ensure that path points to the setup path from $install_dir/$egg_path. """ path_to_setup = egg_base.replace(os.sep, '/').rstrip('/') ...
[ "def", "_resolve_setup_path", "(", "egg_base", ",", "install_dir", ",", "egg_path", ")", ":", "path_to_setup", "=", "egg_base", ".", "replace", "(", "os", ".", "sep", ",", "'/'", ")", ".", "rstrip", "(", "'/'", ")", "if", "path_to_setup", "!=", "os", "."...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/command/develop.py#L91-L108
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
example/ssd/config/utils.py
python
merge_dict
(a, b)
return c
merge dict a, b, with b overriding keys in a
merge dict a, b, with b overriding keys in a
[ "merge", "dict", "a", "b", "with", "b", "overriding", "keys", "in", "a" ]
def merge_dict(a, b): """ merge dict a, b, with b overriding keys in a """ c = a.copy() c.update(b) return c
[ "def", "merge_dict", "(", "a", ",", "b", ")", ":", "c", "=", "a", ".", "copy", "(", ")", "c", ".", "update", "(", "b", ")", "return", "c" ]
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/example/ssd/config/utils.py#L72-L76
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/pdb.py
python
Pdb.do_source
(self, arg)
source expression Try to get source code for the given object and display it.
source expression Try to get source code for the given object and display it.
[ "source", "expression", "Try", "to", "get", "source", "code", "for", "the", "given", "object", "and", "display", "it", "." ]
def do_source(self, arg): """source expression Try to get source code for the given object and display it. """ try: obj = self._getval(arg) except: return try: lines, lineno = getsourcelines(obj) except (OSError, TypeError) as e...
[ "def", "do_source", "(", "self", ",", "arg", ")", ":", "try", ":", "obj", "=", "self", ".", "_getval", "(", "arg", ")", "except", ":", "return", "try", ":", "lines", ",", "lineno", "=", "getsourcelines", "(", "obj", ")", "except", "(", "OSError", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/pdb.py#L1277-L1290
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
example/gluon/lipnet/utils/preprocess_data.py
python
Video.from_frames
(self, path)
return self
Read from frames
Read from frames
[ "Read", "from", "frames" ]
def from_frames(self, path): """ Read from frames """ frames_path = sorted([os.path.join(path, x) for x in os.listdir(path)]) frames = [ndimage.imread(frame_path) for frame_path in frames_path] self.handle_type(frames) return self
[ "def", "from_frames", "(", "self", ",", "path", ")", ":", "frames_path", "=", "sorted", "(", "[", "os", ".", "path", ".", "join", "(", "path", ",", "x", ")", "for", "x", "in", "os", ".", "listdir", "(", "path", ")", "]", ")", "frames", "=", "["...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/gluon/lipnet/utils/preprocess_data.py#L71-L78
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBBreakpoint.SetEnabled
(self, enable)
return _lldb.SBBreakpoint_SetEnabled(self, enable)
SetEnabled(SBBreakpoint self, bool enable)
SetEnabled(SBBreakpoint self, bool enable)
[ "SetEnabled", "(", "SBBreakpoint", "self", "bool", "enable", ")" ]
def SetEnabled(self, enable): """SetEnabled(SBBreakpoint self, bool enable)""" return _lldb.SBBreakpoint_SetEnabled(self, enable)
[ "def", "SetEnabled", "(", "self", ",", "enable", ")", ":", "return", "_lldb", ".", "SBBreakpoint_SetEnabled", "(", "self", ",", "enable", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L1566-L1568
google/llvm-propeller
45c226984fe8377ebfb2ad7713c680d652ba678d
lldb/third_party/Python/module/six/six.py
python
_SixMetaPathImporter.is_package
(self, fullname)
return hasattr(self.__get_module(fullname), "__path__")
Return true, if the named module is a package. We need this method to get correct spec objects with Python 3.4 (see PEP451)
Return true, if the named module is a package.
[ "Return", "true", "if", "the", "named", "module", "is", "a", "package", "." ]
def is_package(self, fullname): """ Return true, if the named module is a package. We need this method to get correct spec objects with Python 3.4 (see PEP451) """ return hasattr(self.__get_module(fullname), "__path__")
[ "def", "is_package", "(", "self", ",", "fullname", ")", ":", "return", "hasattr", "(", "self", ".", "__get_module", "(", "fullname", ")", ",", "\"__path__\"", ")" ]
https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/lldb/third_party/Python/module/six/six.py#L209-L216
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py
python
FlagValues.FlagsByModuleDict
(self)
return self.__dict__['__flags_by_module']
Returns the dictionary of module_name -> list of defined flags. Returns: A dictionary. Its keys are module names (strings). Its values are lists of Flag objects.
Returns the dictionary of module_name -> list of defined flags.
[ "Returns", "the", "dictionary", "of", "module_name", "-", ">", "list", "of", "defined", "flags", "." ]
def FlagsByModuleDict(self): """Returns the dictionary of module_name -> list of defined flags. Returns: A dictionary. Its keys are module names (strings). Its values are lists of Flag objects. """ return self.__dict__['__flags_by_module']
[ "def", "FlagsByModuleDict", "(", "self", ")", ":", "return", "self", ".", "__dict__", "[", "'__flags_by_module'", "]" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py#L849-L856
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/lib/io/tf_record.py
python
TFRecordWriter.__enter__
(self)
return self
Enter a `with` block.
Enter a `with` block.
[ "Enter", "a", "with", "block", "." ]
def __enter__(self): """Enter a `with` block.""" return self
[ "def", "__enter__", "(", "self", ")", ":", "return", "self" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/lib/io/tf_record.py#L108-L110
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/logging/__init__.py
python
getLevelName
(level)
return "Level %s" % level
Return the textual or numeric representation of logging level 'level'. If the level is one of the predefined levels (CRITICAL, ERROR, WARNING, INFO, DEBUG) then you get the corresponding string. If you have associated levels with names using addLevelName then the name you have associated with 'level' i...
Return the textual or numeric representation of logging level 'level'.
[ "Return", "the", "textual", "or", "numeric", "representation", "of", "logging", "level", "level", "." ]
def getLevelName(level): """ Return the textual or numeric representation of logging level 'level'. If the level is one of the predefined levels (CRITICAL, ERROR, WARNING, INFO, DEBUG) then you get the corresponding string. If you have associated levels with names using addLevelName then the name y...
[ "def", "getLevelName", "(", "level", ")", ":", "# See Issues #22386, #27937 and #29220 for why it's this way", "result", "=", "_levelToName", ".", "get", "(", "level", ")", "if", "result", "is", "not", "None", ":", "return", "result", "result", "=", "_nameToLevel", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/logging/__init__.py#L119-L144
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBType.GetDisplayTypeName
(self)
return _lldb.SBType_GetDisplayTypeName(self)
GetDisplayTypeName(SBType self) -> char const *
GetDisplayTypeName(SBType self) -> char const *
[ "GetDisplayTypeName", "(", "SBType", "self", ")", "-", ">", "char", "const", "*" ]
def GetDisplayTypeName(self): """GetDisplayTypeName(SBType self) -> char const *""" return _lldb.SBType_GetDisplayTypeName(self)
[ "def", "GetDisplayTypeName", "(", "self", ")", ":", "return", "_lldb", ".", "SBType_GetDisplayTypeName", "(", "self", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L12765-L12767
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
Joystick.GetRudderPosition
(*args, **kwargs)
return _misc_.Joystick_GetRudderPosition(*args, **kwargs)
GetRudderPosition(self) -> int
GetRudderPosition(self) -> int
[ "GetRudderPosition", "(", "self", ")", "-", ">", "int" ]
def GetRudderPosition(*args, **kwargs): """GetRudderPosition(self) -> int""" return _misc_.Joystick_GetRudderPosition(*args, **kwargs)
[ "def", "GetRudderPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "Joystick_GetRudderPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L2146-L2148
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py
python
MainWindow.do_export_to_fp
(self)
Export selected reflections to Fullprof single crystal data file for analysis :return:
Export selected reflections to Fullprof single crystal data file for analysis :return:
[ "Export", "selected", "reflections", "to", "Fullprof", "single", "crystal", "data", "file", "for", "analysis", ":", "return", ":" ]
def do_export_to_fp(self): """ Export selected reflections to Fullprof single crystal data file for analysis :return: """ # get selected lines selected_rows = self.ui.tableWidget_mergeScans.get_selected_rows(True) if len(selected_rows) == 0: self.pop_one_butto...
[ "def", "do_export_to_fp", "(", "self", ")", ":", "# get selected lines", "selected_rows", "=", "self", ".", "ui", ".", "tableWidget_mergeScans", ".", "get_selected_rows", "(", "True", ")", "if", "len", "(", "selected_rows", ")", "==", "0", ":", "self", ".", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py#L1246-L1289
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/indexing.py
python
_LocIndexer._get_partial_string_timestamp_match_key
(self, key, labels)
return key
Translate any partial string timestamp matches in key, returning the new key (GH 10331)
Translate any partial string timestamp matches in key, returning the new key (GH 10331)
[ "Translate", "any", "partial", "string", "timestamp", "matches", "in", "key", "returning", "the", "new", "key", "(", "GH", "10331", ")" ]
def _get_partial_string_timestamp_match_key(self, key, labels): """Translate any partial string timestamp matches in key, returning the new key (GH 10331)""" if isinstance(labels, MultiIndex): if (isinstance(key, compat.string_types) and labels.levels[0].is_all_da...
[ "def", "_get_partial_string_timestamp_match_key", "(", "self", ",", "key", ",", "labels", ")", ":", "if", "isinstance", "(", "labels", ",", "MultiIndex", ")", ":", "if", "(", "isinstance", "(", "key", ",", "compat", ".", "string_types", ")", "and", "labels",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/indexing.py#L1831-L1853
rdiankov/openrave
d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7
python/ikfast_generator_cpp.py
python
CodeGenerator.WriteDictEquations
(self, dictequations, code=None)
return code
writes the dict equations (sym,var) If first parameter is not a symbol or in self._globalvariables, will skip the equation
writes the dict equations (sym,var) If first parameter is not a symbol or in self._globalvariables, will skip the equation
[ "writes", "the", "dict", "equations", "(", "sym", "var", ")", "If", "first", "parameter", "is", "not", "a", "symbol", "or", "in", "self", ".", "_globalvariables", "will", "skip", "the", "equation" ]
def WriteDictEquations(self, dictequations, code=None): """writes the dict equations (sym,var) If first parameter is not a symbol or in self._globalvariables, will skip the equation """ if code is None: code = StringIO() if len(dictequations) == 0: return ...
[ "def", "WriteDictEquations", "(", "self", ",", "dictequations", ",", "code", "=", "None", ")", ":", "if", "code", "is", "None", ":", "code", "=", "StringIO", "(", ")", "if", "len", "(", "dictequations", ")", "==", "0", ":", "return", "code", "# calling...
https://github.com/rdiankov/openrave/blob/d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7/python/ikfast_generator_cpp.py#L1786-L1808
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/deps/v8/third_party/jinja2/filters.py
python
do_unique
(environment, value, case_sensitive=False, attribute=None)
Returns a list of unique items from the the given iterable. .. sourcecode:: jinja {{ ['foo', 'bar', 'foobar', 'FooBar']|unique }} -> ['foo', 'bar', 'foobar'] The unique items are yielded in the same order as their first occurrence in the iterable passed to the filter. :param case...
Returns a list of unique items from the the given iterable.
[ "Returns", "a", "list", "of", "unique", "items", "from", "the", "the", "given", "iterable", "." ]
def do_unique(environment, value, case_sensitive=False, attribute=None): """Returns a list of unique items from the the given iterable. .. sourcecode:: jinja {{ ['foo', 'bar', 'foobar', 'FooBar']|unique }} -> ['foo', 'bar', 'foobar'] The unique items are yielded in the same order as t...
[ "def", "do_unique", "(", "environment", ",", "value", ",", "case_sensitive", "=", "False", ",", "attribute", "=", "None", ")", ":", "getter", "=", "make_attrgetter", "(", "environment", ",", "attribute", ",", "postprocess", "=", "ignore_case", "if", "not", "...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/deps/v8/third_party/jinja2/filters.py#L282-L307
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/locators.py
python
Locator.score_url
(self, url)
return (t.scheme == 'https', 'pypi.org' in t.netloc, is_downloadable, is_wheel, compatible, basename)
Give an url a score which can be used to choose preferred URLs for a given project release.
Give an url a score which can be used to choose preferred URLs for a given project release.
[ "Give", "an", "url", "a", "score", "which", "can", "be", "used", "to", "choose", "preferred", "URLs", "for", "a", "given", "project", "release", "." ]
def score_url(self, url): """ Give an url a score which can be used to choose preferred URLs for a given project release. """ t = urlparse(url) basename = posixpath.basename(t.path) compatible = True is_wheel = basename.endswith('.whl') is_download...
[ "def", "score_url", "(", "self", ",", "url", ")", ":", "t", "=", "urlparse", "(", "url", ")", "basename", "=", "posixpath", ".", "basename", "(", "t", ".", "path", ")", "compatible", "=", "True", "is_wheel", "=", "basename", ".", "endswith", "(", "'....
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/locators.py#L188-L201
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/deps/v8/third_party/jinja2/debug.py
python
make_traceback
(exc_info, source_hint=None)
return translate_exception(exc_info, initial_skip)
Creates a processed traceback object from the exc_info.
Creates a processed traceback object from the exc_info.
[ "Creates", "a", "processed", "traceback", "object", "from", "the", "exc_info", "." ]
def make_traceback(exc_info, source_hint=None): """Creates a processed traceback object from the exc_info.""" exc_type, exc_value, tb = exc_info if isinstance(exc_value, TemplateSyntaxError): exc_info = translate_syntax_error(exc_value, source_hint) initial_skip = 0 else: initial...
[ "def", "make_traceback", "(", "exc_info", ",", "source_hint", "=", "None", ")", ":", "exc_type", ",", "exc_value", ",", "tb", "=", "exc_info", "if", "isinstance", "(", "exc_value", ",", "TemplateSyntaxError", ")", ":", "exc_info", "=", "translate_syntax_error", ...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/deps/v8/third_party/jinja2/debug.py#L132-L140
netket/netket
0d534e54ecbf25b677ea72af6b85947979420652
netket/jax/utils.py
python
is_complex
(x)
return jnp.issubdtype(x.dtype, jnp.complexfloating)
Returns True if x has a complex dtype
Returns True if x has a complex dtype
[ "Returns", "True", "if", "x", "has", "a", "complex", "dtype" ]
def is_complex(x): """ Returns True if x has a complex dtype """ return jnp.issubdtype(x.dtype, jnp.complexfloating)
[ "def", "is_complex", "(", "x", ")", ":", "return", "jnp", ".", "issubdtype", "(", "x", ".", "dtype", ",", "jnp", ".", "complexfloating", ")" ]
https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/jax/utils.py#L76-L80
scribusproject/scribus
41ec7c775a060912cf251682a8b1437f753f80f4
scribus/plugins/scripter/python/sceditor/indenter.py
python
PythonCodeIndenter.correct_indentation
(self, lineno)
Correct the indentation of the line containing the given index
Correct the indentation of the line containing the given index
[ "Correct", "the", "indentation", "of", "the", "line", "containing", "the", "given", "index" ]
def correct_indentation(self, lineno): """Correct the indentation of the line containing the given index""" self._set_line_indents(lineno, self._get_correct_indentation(lineno))
[ "def", "correct_indentation", "(", "self", ",", "lineno", ")", ":", "self", ".", "_set_line_indents", "(", "lineno", ",", "self", ".", "_get_correct_indentation", "(", "lineno", ")", ")" ]
https://github.com/scribusproject/scribus/blob/41ec7c775a060912cf251682a8b1437f753f80f4/scribus/plugins/scripter/python/sceditor/indenter.py#L175-L177
google/google-api-cpp-client
3df15df632bef43eb320645ac3329d872aabf5ad
prepare_dependencies.py
python
ConfigInfo.SetOptions
(self, options)
Sets custom options. Args: options: (list[string, string]) name, value pairs of options given
Sets custom options.
[ "Sets", "custom", "options", "." ]
def SetOptions(self, options): """Sets custom options. Args: options: (list[string, string]) name, value pairs of options given """ do_all = True for opt, arg in options: if opt == '-b': do_all = False self._build_packages = True elif opt == '-d': do_all =...
[ "def", "SetOptions", "(", "self", ",", "options", ")", ":", "do_all", "=", "True", "for", "opt", ",", "arg", "in", "options", ":", "if", "opt", "==", "'-b'", ":", "do_all", "=", "False", "self", ".", "_build_packages", "=", "True", "elif", "opt", "==...
https://github.com/google/google-api-cpp-client/blob/3df15df632bef43eb320645ac3329d872aabf5ad/prepare_dependencies.py#L113-L164
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
python/mozbuild/mozpack/copier.py
python
FileRegistry.add
(self, path, content)
Add a BaseFile instance to the container, under the given path.
Add a BaseFile instance to the container, under the given path.
[ "Add", "a", "BaseFile", "instance", "to", "the", "container", "under", "the", "given", "path", "." ]
def add(self, path, content): ''' Add a BaseFile instance to the container, under the given path. ''' assert isinstance(content, BaseFile) if path in self._files: return errors.error("%s already added" % path) if self._required_directories[path] > 0: ...
[ "def", "add", "(", "self", ",", "path", ",", "content", ")", ":", "assert", "isinstance", "(", "content", ",", "BaseFile", ")", "if", "path", "in", "self", ".", "_files", ":", "return", "errors", ".", "error", "(", "\"%s already added\"", "%", "path", ...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozpack/copier.py#L49-L66
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/distributed/fsdp/flatten_params_wrapper.py
python
FlattenParamsWrapper._unflatten_params_as_views
(self)
Unlike ``_unflatten_params``, this function unflatten into views and keep self.flat_param unchanged.
Unlike ``_unflatten_params``, this function unflatten into views and keep self.flat_param unchanged.
[ "Unlike", "_unflatten_params", "this", "function", "unflatten", "into", "views", "and", "keep", "self", ".", "flat_param", "unchanged", "." ]
def _unflatten_params_as_views(self) -> None: """Unlike ``_unflatten_params``, this function unflatten into views and keep self.flat_param unchanged. """ assert ( self.flat_param is not None ), "Can not unflatten params as views when flat_param is None." ps = ...
[ "def", "_unflatten_params_as_views", "(", "self", ")", "->", "None", ":", "assert", "(", "self", ".", "flat_param", "is", "not", "None", ")", ",", "\"Can not unflatten params as views when flat_param is None.\"", "ps", "=", "self", ".", "_get_param_views", "(", ")",...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/fsdp/flatten_params_wrapper.py#L309-L321
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/usb_gadget/usb_descriptors.py
python
Descriptor.__init__
(self, **kwargs)
Constructs a new instance of this descriptor. All fields which do not have a default value and are not fixed or computed from a property must be specified as keyword arguments. Args: **kwargs: Field values. Raises: TypeError: A required field was missing or an unexpected field was given.
Constructs a new instance of this descriptor.
[ "Constructs", "a", "new", "instance", "of", "this", "descriptor", "." ]
def __init__(self, **kwargs): """Constructs a new instance of this descriptor. All fields which do not have a default value and are not fixed or computed from a property must be specified as keyword arguments. Args: **kwargs: Field values. Raises: TypeError: A required field was missi...
[ "def", "__init__", "(", "self", ",", "*", "*", "kwargs", ")", ":", "fields", "=", "{", "field", ".", "name", "for", "field", "in", "self", ".", "_fields", "}", "required_fields", "=", "{", "field", ".", "name", "for", "field", "in", "self", ".", "_...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/usb_gadget/usb_descriptors.py#L136-L159
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/sping/SVG/pidSVG.py
python
SVGCanvas._findExternalFontName
(self, font)
return name
Attempts to return proper font name. PDF uses a standard 14 fonts referred to by name. Default to self.defaultFont('Helvetica'). The dictionary allows a layer of indirection to support a standard set of sping.pid font names.
Attempts to return proper font name. PDF uses a standard 14 fonts referred to by name. Default to self.defaultFont('Helvetica'). The dictionary allows a layer of indirection to support a standard set of sping.pid font names.
[ "Attempts", "to", "return", "proper", "font", "name", ".", "PDF", "uses", "a", "standard", "14", "fonts", "referred", "to", "by", "name", ".", "Default", "to", "self", ".", "defaultFont", "(", "Helvetica", ")", ".", "The", "dictionary", "allows", "a", "l...
def _findExternalFontName(self, font): #copied from piddlePDF by cwl- hack away! """Attempts to return proper font name. PDF uses a standard 14 fonts referred to by name. Default to self.defaultFont('Helvetica'). The dictionary allows a layer of indirection to support a standard set...
[ "def", "_findExternalFontName", "(", "self", ",", "font", ")", ":", "#copied from piddlePDF by cwl- hack away!", "piddle_font_map", "=", "{", "'Times'", ":", "'Times'", ",", "'times'", ":", "'Times'", ",", "'Courier'", ":", "'Courier'", ",", "'courier'", ":", "'Co...
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/sping/SVG/pidSVG.py#L106-L150
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/cross_validation.py
python
check_cv
(cv, X=None, y=None, classifier=False)
return cv
Input checker utility for building a CV in a user friendly way. .. deprecated:: 0.18 This module will be removed in 0.20. Use :func:`sklearn.model_selection.check_cv` instead. Parameters ---------- cv : int, cross-validation generator or an iterable, optional Determines the cro...
Input checker utility for building a CV in a user friendly way.
[ "Input", "checker", "utility", "for", "building", "a", "CV", "in", "a", "user", "friendly", "way", "." ]
def check_cv(cv, X=None, y=None, classifier=False): """Input checker utility for building a CV in a user friendly way. .. deprecated:: 0.18 This module will be removed in 0.20. Use :func:`sklearn.model_selection.check_cv` instead. Parameters ---------- cv : int, cross-validation ge...
[ "def", "check_cv", "(", "cv", ",", "X", "=", "None", ",", "y", "=", "None", ",", "classifier", "=", "False", ")", ":", "is_sparse", "=", "sp", ".", "issparse", "(", "X", ")", "if", "cv", "is", "None", ":", "cv", "=", "3", "if", "isinstance", "(...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/cross_validation.py#L1776-L1832
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/waiter.py
python
create_waiter_with_client
(waiter_name, waiter_model, client)
return documented_waiter_cls( waiter_name, single_waiter_config, operation_method )
:type waiter_name: str :param waiter_name: The name of the waiter. The name should match the name (including the casing) of the key name in the waiter model file (typically this is CamelCasing). :type waiter_model: botocore.waiter.WaiterModel :param waiter_model: The model for the waiter c...
[]
def create_waiter_with_client(waiter_name, waiter_model, client): """ :type waiter_name: str :param waiter_name: The name of the waiter. The name should match the name (including the casing) of the key name in the waiter model file (typically this is CamelCasing). :type waiter_model: ...
[ "def", "create_waiter_with_client", "(", "waiter_name", ",", "waiter_model", ",", "client", ")", ":", "single_waiter_config", "=", "waiter_model", ".", "get_waiter", "(", "waiter_name", ")", "operation_name", "=", "xform_name", "(", "single_waiter_config", ".", "opera...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/waiter.py#L26-L75
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
doc/apigen.py
python
ApiDocWriter._uri2path
(self, uri)
return path
Convert uri to absolute filepath Parameters ---------- uri : string URI of python module to return path for Returns ------- path : None or string Returns None if there is no valid path for this URI Otherwise returns absolute file syst...
Convert uri to absolute filepath
[ "Convert", "uri", "to", "absolute", "filepath" ]
def _uri2path(self, uri): """ Convert uri to absolute filepath Parameters ---------- uri : string URI of python module to return path for Returns ------- path : None or string Returns None if there is no valid path for this URI ...
[ "def", "_uri2path", "(", "self", ",", "uri", ")", ":", "if", "uri", "==", "self", ".", "package_name", ":", "return", "os", ".", "path", ".", "join", "(", "self", ".", "root_path", ",", "'__init__.py'", ")", "path", "=", "uri", ".", "replace", "(", ...
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/doc/apigen.py#L138-L178
XiaoMi/mace
8c75d39fdacd6328d2a03a30f999bf104fd30546
tools/accuracy_validator.py
python
AccuracyValidator.result
(self)
print or show the result :return: None
print or show the result :return: None
[ "print", "or", "show", "the", "result", ":", "return", ":", "None" ]
def result(self): """ print or show the result :return: None """ print("==========================================") print("Top 1 accuracy: %f" % (self._correct_count * 1.0 / self.sample_size())) print("==========================================")
[ "def", "result", "(", "self", ")", ":", "print", "(", "\"==========================================\"", ")", "print", "(", "\"Top 1 accuracy: %f\"", "%", "(", "self", ".", "_correct_count", "*", "1.0", "/", "self", ".", "sample_size", "(", ")", ")", ")", "prin...
https://github.com/XiaoMi/mace/blob/8c75d39fdacd6328d2a03a30f999bf104fd30546/tools/accuracy_validator.py#L128-L136
alrightchiu/SecondRound
56f7603ed87b6db2326fcc7a67ec015e820d57e4
fabfile.py
python
cf_upload
()
Publish to Rackspace Cloud Files
Publish to Rackspace Cloud Files
[ "Publish", "to", "Rackspace", "Cloud", "Files" ]
def cf_upload(): """Publish to Rackspace Cloud Files""" rebuild() with lcd(DEPLOY_PATH): local('swift -v -A https://auth.api.rackspacecloud.com/v1.0 ' '-U {cloudfiles_username} ' '-K {cloudfiles_api_key} ' 'upload -c {cloudfiles_container} .'.format(**env))
[ "def", "cf_upload", "(", ")", ":", "rebuild", "(", ")", "with", "lcd", "(", "DEPLOY_PATH", ")", ":", "local", "(", "'swift -v -A https://auth.api.rackspacecloud.com/v1.0 '", "'-U {cloudfiles_username} '", "'-K {cloudfiles_api_key} '", "'upload -c {cloudfiles_container} .'", "...
https://github.com/alrightchiu/SecondRound/blob/56f7603ed87b6db2326fcc7a67ec015e820d57e4/fabfile.py#L69-L76
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/licenses.py
python
ScanThirdPartyDirs
(root=None)
return len(errors) == 0
Scan a list of directories and report on any problems we find.
Scan a list of directories and report on any problems we find.
[ "Scan", "a", "list", "of", "directories", "and", "report", "on", "any", "problems", "we", "find", "." ]
def ScanThirdPartyDirs(root=None): """Scan a list of directories and report on any problems we find.""" if root is None: root = os.getcwd() third_party_dirs = FindThirdPartyDirs(PRUNE_PATHS, root) third_party_dirs = FilterDirsWithFiles(third_party_dirs, root) errors = [] for path in sorte...
[ "def", "ScanThirdPartyDirs", "(", "root", "=", "None", ")", ":", "if", "root", "is", "None", ":", "root", "=", "os", ".", "getcwd", "(", ")", "third_party_dirs", "=", "FindThirdPartyDirs", "(", "PRUNE_PATHS", ",", "root", ")", "third_party_dirs", "=", "Fil...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/licenses.py#L368-L386
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/coremltools/converters/onnx/_operators_nd.py
python
_convert_scatter
(builder, node, graph, err)
convert to CoreML Scatter Along Axis Layer: https://github.com/apple/coremltools/blob/655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492/mlmodel/format/NeuralNetwork.proto#L4308
convert to CoreML Scatter Along Axis Layer: https://github.com/apple/coremltools/blob/655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492/mlmodel/format/NeuralNetwork.proto#L4308
[ "convert", "to", "CoreML", "Scatter", "Along", "Axis", "Layer", ":", "https", ":", "//", "github", ".", "com", "/", "apple", "/", "coremltools", "/", "blob", "/", "655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492", "/", "mlmodel", "/", "format", "/", "NeuralNetwork", ...
def _convert_scatter(builder, node, graph, err): """ convert to CoreML Scatter Along Axis Layer: https://github.com/apple/coremltools/blob/655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492/mlmodel/format/NeuralNetwork.proto#L4308 """ axis = node.attrs.get("axis", 0) builder.add_scatter_along_axis( ...
[ "def", "_convert_scatter", "(", "builder", ",", "node", ",", "graph", ",", "err", ")", ":", "axis", "=", "node", ".", "attrs", ".", "get", "(", "\"axis\"", ",", "0", ")", "builder", ".", "add_scatter_along_axis", "(", "name", "=", "node", ".", "name", ...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/converters/onnx/_operators_nd.py#L2203-L2211
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
Locale.AddLanguage
(*args, **kwargs)
return _gdi_.Locale_AddLanguage(*args, **kwargs)
AddLanguage(LanguageInfo info)
AddLanguage(LanguageInfo info)
[ "AddLanguage", "(", "LanguageInfo", "info", ")" ]
def AddLanguage(*args, **kwargs): """AddLanguage(LanguageInfo info)""" return _gdi_.Locale_AddLanguage(*args, **kwargs)
[ "def", "AddLanguage", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "Locale_AddLanguage", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L3083-L3085
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/_pyio.py
python
TextIOBase.encoding
(self)
return None
Subclasses should override.
Subclasses should override.
[ "Subclasses", "should", "override", "." ]
def encoding(self): """Subclasses should override.""" return None
[ "def", "encoding", "(", "self", ")", ":", "return", "None" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/_pyio.py#L1338-L1340
seqan/seqan
f5f658343c366c9c3d44ba358ffc9317e78a09ed
util/py_lib/seqan/dddoc/core.py
python
processInlineSummaries
(tree, paths)
Move inline documentation to .summary subpaths. The nodes matching the values in path are such that inline values are moved to .summary subnodes for greater consistency and lower variance. E.g. the following: .Function.f.param.x:This is param x. will be transformed into .Function.f....
Move inline documentation to .summary subpaths.
[ "Move", "inline", "documentation", "to", ".", "summary", "subpaths", "." ]
def processInlineSummaries(tree, paths): """Move inline documentation to .summary subpaths. The nodes matching the values in path are such that inline values are moved to .summary subnodes for greater consistency and lower variance. E.g. the following: .Function.f.param.x:This is param x. ...
[ "def", "processInlineSummaries", "(", "tree", ",", "paths", ")", ":", "# First, collect nodes for the summary transfer.", "collected_nodes", "=", "set", "(", ")", "def", "f", "(", "node", ")", ":", "if", "node", ".", "texts", ":", "collected_nodes", ".", "add", ...
https://github.com/seqan/seqan/blob/f5f658343c366c9c3d44ba358ffc9317e78a09ed/util/py_lib/seqan/dddoc/core.py#L770-L798
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/App/FreeCADInit.py
python
FCADLogger._catch
(self,level,msg,func,args=None,kargs=None)
Internal function to log exception of any callable. * level: integer log level * msg: message string. Unlike _log(), this argument must not contain any string formatter. * func: a callable object * args: tuple of positional arguments to be passed to...
Internal function to log exception of any callable.
[ "Internal", "function", "to", "log", "exception", "of", "any", "callable", "." ]
def _catch(self,level,msg,func,args=None,kargs=None): '''Internal function to log exception of any callable. * level: integer log level * msg: message string. Unlike _log(), this argument must not contain any string formatter. * func: a callable object ...
[ "def", "_catch", "(", "self", ",", "level", ",", "msg", ",", "func", ",", "args", "=", "None", ",", "kargs", "=", "None", ")", ":", "try", ":", "if", "not", "args", ":", "args", "=", "[", "]", "if", "not", "kargs", ":", "kargs", "=", "{", "}"...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/App/FreeCADInit.py#L534-L556
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/structured/structured_tensor.py
python
StructuredTensor._from_pyscalar
(cls, pyval, typespec, path_so_far)
Converts python scalar value `pyval` to a Tensor.
Converts python scalar value `pyval` to a Tensor.
[ "Converts", "python", "scalar", "value", "pyval", "to", "a", "Tensor", "." ]
def _from_pyscalar(cls, pyval, typespec, path_so_far): """Converts python scalar value `pyval` to a Tensor.""" if typespec is None: try: return constant_op.constant(pyval) except Exception as exc: raise ValueError('Error parsing path %r' % (path_so_far,)) from exc else: if ...
[ "def", "_from_pyscalar", "(", "cls", ",", "pyval", ",", "typespec", ",", "path_so_far", ")", ":", "if", "typespec", "is", "None", ":", "try", ":", "return", "constant_op", ".", "constant", "(", "pyval", ")", "except", "Exception", "as", "exc", ":", "rais...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/structured/structured_tensor.py#L1027-L1040
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/boto3/resources/model.py
python
ResourceModel.waiters
(self)
return waiters
Get a list of waiters for this resource. :type: list(:py:class:`Waiter`)
Get a list of waiters for this resource.
[ "Get", "a", "list", "of", "waiters", "for", "this", "resource", "." ]
def waiters(self): """ Get a list of waiters for this resource. :type: list(:py:class:`Waiter`) """ waiters = [] for name, item in self._definition.get('waiters', {}).items(): name = self._get_name('waiter', Waiter.PREFIX + name) waiters.append(W...
[ "def", "waiters", "(", "self", ")", ":", "waiters", "=", "[", "]", "for", "name", ",", "item", "in", "self", ".", "_definition", ".", "get", "(", "'waiters'", ",", "{", "}", ")", ".", "items", "(", ")", ":", "name", "=", "self", ".", "_get_name",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/boto3/resources/model.py#L610-L622
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/configuration.py
python
Configuration._load_config_files
(self)
Loads configuration from configuration files
Loads configuration from configuration files
[ "Loads", "configuration", "from", "configuration", "files" ]
def _load_config_files(self): # type: () -> None """Loads configuration from configuration files """ config_files = dict(self.iter_config_files()) if config_files[kinds.ENV][0:1] == [os.devnull]: logger.debug( "Skipping loading configuration files due ...
[ "def", "_load_config_files", "(", "self", ")", ":", "# type: () -> None", "config_files", "=", "dict", "(", "self", ".", "iter_config_files", "(", ")", ")", "if", "config_files", "[", "kinds", ".", "ENV", "]", "[", "0", ":", "1", "]", "==", "[", "os", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/configuration.py#L255-L280
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/mvn.py
python
MultivariateNormalOperatorPD.sigma
(self)
Dense (batch) covariance matrix, if available.
Dense (batch) covariance matrix, if available.
[ "Dense", "(", "batch", ")", "covariance", "matrix", "if", "available", "." ]
def sigma(self): """Dense (batch) covariance matrix, if available.""" with ops.name_scope(self.name): return self._cov.to_dense()
[ "def", "sigma", "(", "self", ")", ":", "with", "ops", ".", "name_scope", "(", "self", ".", "name", ")", ":", "return", "self", ".", "_cov", ".", "to_dense", "(", ")" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/mvn.py#L216-L219
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/command/build_py.py
python
build_py.__getattr__
(self, attr)
return orig.build_py.__getattr__(self, attr)
lazily compute data files
lazily compute data files
[ "lazily", "compute", "data", "files" ]
def __getattr__(self, attr): "lazily compute data files" if attr == 'data_files': self.data_files = self._get_data_files() return self.data_files return orig.build_py.__getattr__(self, attr)
[ "def", "__getattr__", "(", "self", ",", "attr", ")", ":", "if", "attr", "==", "'data_files'", ":", "self", ".", "data_files", "=", "self", ".", "_get_data_files", "(", ")", "return", "self", ".", "data_files", "return", "orig", ".", "build_py", ".", "__g...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/command/build_py.py#L68-L73
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/lmbrwaflib/lumberyard_modules.py
python
AliasProcessing.preprocess_value
(self, ctx, value, additional_aliases)
Process a value and evaluate any aliases :param ctx: Context :param value: The value to process the alias :param additional_aliases: Any additional aliases to consider :return:
Process a value and evaluate any aliases :param ctx: Context :param value: The value to process the alias :param additional_aliases: Any additional aliases to consider :return:
[ "Process", "a", "value", "and", "evaluate", "any", "aliases", ":", "param", "ctx", ":", "Context", ":", "param", "value", ":", "The", "value", "to", "process", "the", "alias", ":", "param", "additional_aliases", ":", "Any", "additional", "aliases", "to", "...
def preprocess_value(self, ctx, value, additional_aliases): """ Process a value and evaluate any aliases :param ctx: Context :param value: The value to process the alias :param additional_aliases: Any additional aliases to consider :return: ...
[ "def", "preprocess_value", "(", "self", ",", "ctx", ",", "value", ",", "additional_aliases", ")", ":", "if", "isinstance", "(", "value", ",", "Node", ".", "Node", ")", ":", "return", "value", "if", "'@'", "not", "in", "value", ":", "return", "value", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/lumberyard_modules.py#L604-L650
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/auto_bisect/bisect_printer.py
python
BisectPrinter._PrintTableRow
(column_widths, row_data)
Prints out a row in a formatted table that has columns aligned. Args: column_widths: A list of column width numbers. row_data: A list of items for each column in this row.
Prints out a row in a formatted table that has columns aligned.
[ "Prints", "out", "a", "row", "in", "a", "formatted", "table", "that", "has", "columns", "aligned", "." ]
def _PrintTableRow(column_widths, row_data): """Prints out a row in a formatted table that has columns aligned. Args: column_widths: A list of column width numbers. row_data: A list of items for each column in this row. """ assert len(column_widths) == len(row_data) text = '' for i ...
[ "def", "_PrintTableRow", "(", "column_widths", ",", "row_data", ")", ":", "assert", "len", "(", "column_widths", ")", "==", "len", "(", "row_data", ")", "text", "=", "''", "for", "i", "in", "xrange", "(", "len", "(", "column_widths", ")", ")", ":", "cu...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/auto_bisect/bisect_printer.py#L198-L210
taichi-dev/taichi
973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6
python/taichi/linalg/sparse_matrix.py
python
SparseMatrix.__add__
(self, other)
return SparseMatrix(sm=sm)
Addition operation for sparse matrix. Returns: The result sparse matrix of the addition.
Addition operation for sparse matrix.
[ "Addition", "operation", "for", "sparse", "matrix", "." ]
def __add__(self, other): """Addition operation for sparse matrix. Returns: The result sparse matrix of the addition. """ assert self.n == other.n and self.m == other.m, f"Dimension mismatch between sparse matrices ({self.n}, {self.m}) and ({other.n}, {other.m})" sm ...
[ "def", "__add__", "(", "self", ",", "other", ")", ":", "assert", "self", ".", "n", "==", "other", ".", "n", "and", "self", ".", "m", "==", "other", ".", "m", ",", "f\"Dimension mismatch between sparse matrices ({self.n}, {self.m}) and ({other.n}, {other.m})\"", "s...
https://github.com/taichi-dev/taichi/blob/973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6/python/taichi/linalg/sparse_matrix.py#L27-L35
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pyio.py
python
TextIOBase.readline
(self)
Read until newline or EOF. Returns an empty string if EOF is hit immediately.
Read until newline or EOF.
[ "Read", "until", "newline", "or", "EOF", "." ]
def readline(self): """Read until newline or EOF. Returns an empty string if EOF is hit immediately. """ self._unsupported("readline")
[ "def", "readline", "(", "self", ")", ":", "self", ".", "_unsupported", "(", "\"readline\"", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pyio.py#L1796-L1801
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/ir/types.py
python
IdentifiedStructType.__init__
(self, context, name, packed=False)
*context* is a llvmlite.ir.Context. *name* is the identifier for the new struct type. *packed* controls the use of packed layout.
*context* is a llvmlite.ir.Context. *name* is the identifier for the new struct type. *packed* controls the use of packed layout.
[ "*", "context", "*", "is", "a", "llvmlite", ".", "ir", ".", "Context", ".", "*", "name", "*", "is", "the", "identifier", "for", "the", "new", "struct", "type", ".", "*", "packed", "*", "controls", "the", "use", "of", "packed", "layout", "." ]
def __init__(self, context, name, packed=False): """ *context* is a llvmlite.ir.Context. *name* is the identifier for the new struct type. *packed* controls the use of packed layout. """ assert name self.context = context self.name = name self.elem...
[ "def", "__init__", "(", "self", ",", "context", ",", "name", ",", "packed", "=", "False", ")", ":", "assert", "name", "self", ".", "context", "=", "context", "self", ".", "name", "=", "name", "self", ".", "elements", "=", "None", "self", ".", "packed...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/ir/types.py#L573-L583
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/v8/third_party/jinja2/environment.py
python
Environment._compile
(self, source, filename)
return compile(source, filename, 'exec')
Internal hook that can be overridden to hook a different compile method in. .. versionadded:: 2.5
Internal hook that can be overridden to hook a different compile method in.
[ "Internal", "hook", "that", "can", "be", "overridden", "to", "hook", "a", "different", "compile", "method", "in", "." ]
def _compile(self, source, filename): """Internal hook that can be overridden to hook a different compile method in. .. versionadded:: 2.5 """ return compile(source, filename, 'exec')
[ "def", "_compile", "(", "self", ",", "source", ",", "filename", ")", ":", "return", "compile", "(", "source", ",", "filename", ",", "'exec'", ")" ]
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/third_party/jinja2/environment.py#L545-L551
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/eventstream.py
python
EventStream.close
(self)
Closes the underlying streaming body.
Closes the underlying streaming body.
[ "Closes", "the", "underlying", "streaming", "body", "." ]
def close(self): """Closes the underlying streaming body. """ self._raw_stream.close()
[ "def", "close", "(", "self", ")", ":", "self", ".", "_raw_stream", ".", "close", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/eventstream.py#L600-L602
tensorflow/io
92b44e180674a8af0e12e405530f7343e3e693e4
tensorflow_io/python/experimental/pulsar_writer_ops.py
python
PulsarWriter.__init__
(self, service_url, topic)
Creates a `PulsarWriter` for writing messages to a pulsar topic Args: service_url: A `tf.string` tensor containing the service url of pulsar broker. For example: "pulsar://localhost:6650". topic: A `tf.string` tensor containing the topic name.
Creates a `PulsarWriter` for writing messages to a pulsar topic
[ "Creates", "a", "PulsarWriter", "for", "writing", "messages", "to", "a", "pulsar", "topic" ]
def __init__(self, service_url, topic): """Creates a `PulsarWriter` for writing messages to a pulsar topic Args: service_url: A `tf.string` tensor containing the service url of pulsar broker. For example: "pulsar://localhost:6650". topic: A `tf.string` tensor containing ...
[ "def", "__init__", "(", "self", ",", "service_url", ",", "topic", ")", ":", "with", "tf", ".", "name_scope", "(", "\"PulsarWriter\"", ")", ":", "resource", "=", "core_ops", ".", "io_pulsar_writable_init", "(", "service_url", ",", "topic", ")", "self", ".", ...
https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/tensorflow_io/python/experimental/pulsar_writer_ops.py#L24-L34
seqan/seqan
f5f658343c366c9c3d44ba358ffc9317e78a09ed
util/py_lib/seqan/paths.py
python
repositoryRoot
()
return os.path.relpath(abs_path, os.getcwd())
Return path to directory root.
Return path to directory root.
[ "Return", "path", "to", "directory", "root", "." ]
def repositoryRoot(): """Return path to directory root.""" abs_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../..')) return os.path.relpath(abs_path, os.getcwd())
[ "def", "repositoryRoot", "(", ")", ":", "abs_path", "=", "os", ".", "path", ".", "abspath", "(", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "dirname", "(", "__file__", ")", ",", "'../../..'", ")", ")", "return", "os", ".", "path",...
https://github.com/seqan/seqan/blob/f5f658343c366c9c3d44ba358ffc9317e78a09ed/util/py_lib/seqan/paths.py#L21-L24
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py
python
Bits._readue
(self, pos)
return codenum, pos
Return interpretation of next bits as unsigned exponential-Golomb code. Raises ReadError if the end of the bitstring is encountered while reading the code.
Return interpretation of next bits as unsigned exponential-Golomb code.
[ "Return", "interpretation", "of", "next", "bits", "as", "unsigned", "exponential", "-", "Golomb", "code", "." ]
def _readue(self, pos): """Return interpretation of next bits as unsigned exponential-Golomb code. Raises ReadError if the end of the bitstring is encountered while reading the code. """ oldpos = pos try: while not self[pos]: pos += 1 ...
[ "def", "_readue", "(", "self", ",", "pos", ")", ":", "oldpos", "=", "pos", "try", ":", "while", "not", "self", "[", "pos", "]", ":", "pos", "+=", "1", "except", "IndexError", ":", "raise", "ReadError", "(", "\"Read off end of bitstring trying to read code.\"...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py#L1636-L1659
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/markdown/__init__.py
python
Markdown.registerExtension
(self, extension)
return self
This gets called by the extension
This gets called by the extension
[ "This", "gets", "called", "by", "the", "extension" ]
def registerExtension(self, extension): """ This gets called by the extension """ self.registeredExtensions.append(extension) return self
[ "def", "registerExtension", "(", "self", ",", "extension", ")", ":", "self", ".", "registeredExtensions", ".", "append", "(", "extension", ")", "return", "self" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/markdown/__init__.py#L252-L255
CaoWGG/TensorRT-YOLOv4
4d7c2edce99e8794a4cb4ea3540d51ce91158a36
onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py
python
Cursor.spelling
(self)
return self._spelling
Return the spelling of the entity pointed at by the cursor.
Return the spelling of the entity pointed at by the cursor.
[ "Return", "the", "spelling", "of", "the", "entity", "pointed", "at", "by", "the", "cursor", "." ]
def spelling(self): """Return the spelling of the entity pointed at by the cursor.""" if not hasattr(self, '_spelling'): self._spelling = conf.lib.clang_getCursorSpelling(self) return self._spelling
[ "def", "spelling", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'_spelling'", ")", ":", "self", ".", "_spelling", "=", "conf", ".", "lib", ".", "clang_getCursorSpelling", "(", "self", ")", "return", "self", ".", "_spelling" ]
https://github.com/CaoWGG/TensorRT-YOLOv4/blob/4d7c2edce99e8794a4cb4ea3540d51ce91158a36/onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py#L1398-L1403
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/mailbox.py
python
Mailbox.clear
(self)
Delete all messages.
Delete all messages.
[ "Delete", "all", "messages", "." ]
def clear(self): """Delete all messages.""" for key in self.iterkeys(): self.discard(key)
[ "def", "clear", "(", "self", ")", ":", "for", "key", "in", "self", ".", "iterkeys", "(", ")", ":", "self", ".", "discard", "(", "key", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/mailbox.py#L140-L143
NVIDIA/TensorRT
42805f078052daad1a98bc5965974fcffaad0960
demo/Tacotron2/train.py
python
evaluating
(model)
Temporarily switch to evaluation mode.
Temporarily switch to evaluation mode.
[ "Temporarily", "switch", "to", "evaluation", "mode", "." ]
def evaluating(model): '''Temporarily switch to evaluation mode.''' istrain = model.training try: model.eval() yield model finally: if istrain: model.train()
[ "def", "evaluating", "(", "model", ")", ":", "istrain", "=", "model", ".", "training", "try", ":", "model", ".", "eval", "(", ")", "yield", "model", "finally", ":", "if", "istrain", ":", "model", ".", "train", "(", ")" ]
https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/demo/Tacotron2/train.py#L249-L257
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
native_client_sdk/src/build_tools/build_utils.py
python
JoinPathToNaClRepo
(*args, **kwargs)
return os.path.join(root_path, nacl_path) if root_path else nacl_path
Use os.path.join() to join the argument list to the NaCl repo location. Assumes that the Native Client repo is DEPSed into this repo under third_party/native_client. This has to match the target dirs in the DEPS file. If the key 'root_dir' is set, then this path is prepended to the NaCl repo path. Args:...
Use os.path.join() to join the argument list to the NaCl repo location.
[ "Use", "os", ".", "path", ".", "join", "()", "to", "join", "the", "argument", "list", "to", "the", "NaCl", "repo", "location", "." ]
def JoinPathToNaClRepo(*args, **kwargs): '''Use os.path.join() to join the argument list to the NaCl repo location. Assumes that the Native Client repo is DEPSed into this repo under third_party/native_client. This has to match the target dirs in the DEPS file. If the key 'root_dir' is set, then this path ...
[ "def", "JoinPathToNaClRepo", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "nacl_path", "=", "os", ".", "path", ".", "join", "(", "'third_party'", ",", "'native_client'", ",", "*", "args", ")", "root_path", "=", "kwargs", ".", "get", "(", "'root...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/native_client_sdk/src/build_tools/build_utils.py#L195-L214
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
CertifyX509Response.fromBytes
(buffer)
return TpmBuffer(buffer).createObj(CertifyX509Response)
Returns new CertifyX509Response object constructed from its marshaled representation in the given byte buffer
Returns new CertifyX509Response object constructed from its marshaled representation in the given byte buffer
[ "Returns", "new", "CertifyX509Response", "object", "constructed", "from", "its", "marshaled", "representation", "in", "the", "given", "byte", "buffer" ]
def fromBytes(buffer): """ Returns new CertifyX509Response object constructed from its marshaled representation in the given byte buffer """ return TpmBuffer(buffer).createObj(CertifyX509Response)
[ "def", "fromBytes", "(", "buffer", ")", ":", "return", "TpmBuffer", "(", "buffer", ")", ".", "createObj", "(", "CertifyX509Response", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L13240-L13244
facebook/wangle
2e7e3fbb3a15c4986d6fe0e36c31daeeba614ce3
build/fbcode_builder/CMake/make_fbpy_archive.py
python
install_library
(args, path_map)
Create an installation directory a python library.
Create an installation directory a python library.
[ "Create", "an", "installation", "directory", "a", "python", "library", "." ]
def install_library(args, path_map): """Create an installation directory a python library.""" out_dir = args.output out_manifest = args.output + ".manifest" install_dir = args.install_dir if not install_dir: install_dir = out_dir os.makedirs(out_dir) with open(out_manifest, "w") as...
[ "def", "install_library", "(", "args", ",", "path_map", ")", ":", "out_dir", "=", "args", ".", "output", "out_manifest", "=", "args", ".", "output", "+", "\".manifest\"", "install_dir", "=", "args", ".", "install_dir", "if", "not", "install_dir", ":", "insta...
https://github.com/facebook/wangle/blob/2e7e3fbb3a15c4986d6fe0e36c31daeeba614ce3/build/fbcode_builder/CMake/make_fbpy_archive.py#L190-L208
open-webrtc-toolkit/owt-client-native
ae73d99dd2e33a7b743829068efab4bab3b80c52
scripts/roll_webrtc.py
python
webrtc_revision
()
Return current owt-deps-webrtc revision in DEPS.
Return current owt-deps-webrtc revision in DEPS.
[ "Return", "current", "owt", "-", "deps", "-", "webrtc", "revision", "in", "DEPS", "." ]
def webrtc_revision(): '''Return current owt-deps-webrtc revision in DEPS.''' with open(DEPS_PATH, 'r') as f: deps = f.read() return re.search(REVISION_RE, deps).group(0)
[ "def", "webrtc_revision", "(", ")", ":", "with", "open", "(", "DEPS_PATH", ",", "'r'", ")", "as", "f", ":", "deps", "=", "f", ".", "read", "(", ")", "return", "re", ".", "search", "(", "REVISION_RE", ",", "deps", ")", ".", "group", "(", "0", ")" ...
https://github.com/open-webrtc-toolkit/owt-client-native/blob/ae73d99dd2e33a7b743829068efab4bab3b80c52/scripts/roll_webrtc.py#L29-L33
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/position.py
python
Position.pos_cost
(self, pos_cost)
Sets the pos_cost of this Position. :param pos_cost: The pos_cost of this Position. # noqa: E501 :type: float
Sets the pos_cost of this Position.
[ "Sets", "the", "pos_cost", "of", "this", "Position", "." ]
def pos_cost(self, pos_cost): """Sets the pos_cost of this Position. :param pos_cost: The pos_cost of this Position. # noqa: E501 :type: float """ self._pos_cost = pos_cost
[ "def", "pos_cost", "(", "self", ",", "pos_cost", ")", ":", "self", ".", "_pos_cost", "=", "pos_cost" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/position.py#L1543-L1551
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/lib2to3/refactor.py
python
_get_head_types
(pat)
Accepts a pytree Pattern Node and returns a set of the pattern types which will match first.
Accepts a pytree Pattern Node and returns a set of the pattern types which will match first.
[ "Accepts", "a", "pytree", "Pattern", "Node", "and", "returns", "a", "set", "of", "the", "pattern", "types", "which", "will", "match", "first", "." ]
def _get_head_types(pat): """ Accepts a pytree Pattern Node and returns a set of the pattern types which will match first. """ if isinstance(pat, (pytree.NodePattern, pytree.LeafPattern)): # NodePatters must either have no type and no content # or a type and content -- so they don't g...
[ "def", "_get_head_types", "(", "pat", ")", ":", "if", "isinstance", "(", "pat", ",", "(", "pytree", ".", "NodePattern", ",", "pytree", ".", "LeafPattern", ")", ")", ":", "# NodePatters must either have no type and no content", "# or a type and content -- so they don't...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/lib2to3/refactor.py#L47-L72
trailofbits/llvm-sanitizer-tutorial
d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99
llvm/tools/clang/bindings/python/clang/cindex.py
python
Type.get_canonical
(self)
return conf.lib.clang_getCanonicalType(self)
Return the canonical type for a Type. Clang's type system explicitly models typedefs and all the ways a specific type can be represented. The canonical type is the underlying type with all the "sugar" removed. For example, if 'T' is a typedef for 'int', the canonical type for ...
Return the canonical type for a Type.
[ "Return", "the", "canonical", "type", "for", "a", "Type", "." ]
def get_canonical(self): """ Return the canonical type for a Type. Clang's type system explicitly models typedefs and all the ways a specific type can be represented. The canonical type is the underlying type with all the "sugar" removed. For example, if 'T' is a typed...
[ "def", "get_canonical", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getCanonicalType", "(", "self", ")" ]
https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/tools/clang/bindings/python/clang/cindex.py#L2278-L2288
tkn-tub/ns3-gym
19bfe0a583e641142609939a090a09dfc63a095f
utils/grid.py
python
TimelineEvent.add_event
(self, event)
! Add Event @param self this object @param event event to add @return none
! Add Event
[ "!", "Add", "Event" ]
def add_event(self, event): """! Add Event @param self this object @param event event to add @return none """ self.events.append(event)
[ "def", "add_event", "(", "self", ",", "event", ")", ":", "self", ".", "events", ".", "append", "(", "event", ")" ]
https://github.com/tkn-tub/ns3-gym/blob/19bfe0a583e641142609939a090a09dfc63a095f/utils/grid.py#L219-L225