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
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_gdi.py
python
Brush.GetStyle
(*args, **kwargs)
return _gdi_.Brush_GetStyle(*args, **kwargs)
GetStyle(self) -> int Returns the style of the brush. See `__init__` for a listing of styles.
GetStyle(self) -> int
[ "GetStyle", "(", "self", ")", "-", ">", "int" ]
def GetStyle(*args, **kwargs): """ GetStyle(self) -> int Returns the style of the brush. See `__init__` for a listing of styles. """ return _gdi_.Brush_GetStyle(*args, **kwargs)
[ "def", "GetStyle", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "Brush_GetStyle", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L567-L574
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/lib/function_base.py
python
average
(a, axis=None, weights=None, returned=False)
Compute the weighted average along the specified axis. Parameters ---------- a : array_like Array containing data to be averaged. If `a` is not an array, a conversion is attempted. axis : None or int or tuple of ints, optional Axis or axes along which to average `a`. The defaul...
Compute the weighted average along the specified axis.
[ "Compute", "the", "weighted", "average", "along", "the", "specified", "axis", "." ]
def average(a, axis=None, weights=None, returned=False): """ Compute the weighted average along the specified axis. Parameters ---------- a : array_like Array containing data to be averaged. If `a` is not an array, a conversion is attempted. axis : None or int or tuple of ints, ...
[ "def", "average", "(", "a", ",", "axis", "=", "None", ",", "weights", "=", "None", ",", "returned", "=", "False", ")", ":", "a", "=", "np", ".", "asanyarray", "(", "a", ")", "if", "weights", "is", "None", ":", "avg", "=", "a", ".", "mean", "(",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/lib/function_base.py#L295-L431
neopenx/Dragon
0e639a7319035ddc81918bd3df059230436ee0a1
Dragon/python/dragon/vm/theano/tensor/nnet.py
python
tanh
(x)
return ops.Tanh(x)
TanH function. Parameters ---------- inputs : Tensor The input tensor. Returns ------- Tensor The output tensor.
TanH function.
[ "TanH", "function", "." ]
def tanh(x): """TanH function. Parameters ---------- inputs : Tensor The input tensor. Returns ------- Tensor The output tensor. """ return ops.Tanh(x)
[ "def", "tanh", "(", "x", ")", ":", "return", "ops", ".", "Tanh", "(", "x", ")" ]
https://github.com/neopenx/Dragon/blob/0e639a7319035ddc81918bd3df059230436ee0a1/Dragon/python/dragon/vm/theano/tensor/nnet.py#L112-L126
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/datetimelike.py
python
DatetimeLikeArrayMixin.min
(self, axis=None, skipna=True, *args, **kwargs)
return self._box_func(result)
Return the minimum value of the Array or minimum along an axis. See Also -------- numpy.ndarray.min Index.min : Return the minimum value in an Index. Series.min : Return the minimum value in a Series.
Return the minimum value of the Array or minimum along an axis.
[ "Return", "the", "minimum", "value", "of", "the", "Array", "or", "minimum", "along", "an", "axis", "." ]
def min(self, axis=None, skipna=True, *args, **kwargs): """ Return the minimum value of the Array or minimum along an axis. See Also -------- numpy.ndarray.min Index.min : Return the minimum value in an Index. Series.min : Return the minimum value in a Se...
[ "def", "min", "(", "self", ",", "axis", "=", "None", ",", "skipna", "=", "True", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "nv", ".", "validate_min", "(", "args", ",", "kwargs", ")", "nv", ".", "validate_minmax_axis", "(", "axis", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/datetimelike.py#L1488-L1506
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
ClipboardEvent.SupportsFormat
(*args, **kwargs)
return _misc_.ClipboardEvent_SupportsFormat(*args, **kwargs)
SupportsFormat(self, DataFormat format) -> bool
SupportsFormat(self, DataFormat format) -> bool
[ "SupportsFormat", "(", "self", "DataFormat", "format", ")", "-", ">", "bool" ]
def SupportsFormat(*args, **kwargs): """SupportsFormat(self, DataFormat format) -> bool""" return _misc_.ClipboardEvent_SupportsFormat(*args, **kwargs)
[ "def", "SupportsFormat", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "ClipboardEvent_SupportsFormat", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L5983-L5985
microsoft/onnxruntime
f92e47e95b13a240e37caf7b36577983544f98fc
onnxruntime/python/tools/quantization/calibrate.py
python
MinMaxCalibrater.compute_range
(self)
return self.calibrate_tensors_range
Compute the min-max range of tensor :return: dictionary mapping: {added node names: (ReduceMin, ReduceMax) pairs }
Compute the min-max range of tensor :return: dictionary mapping: {added node names: (ReduceMin, ReduceMax) pairs }
[ "Compute", "the", "min", "-", "max", "range", "of", "tensor", ":", "return", ":", "dictionary", "mapping", ":", "{", "added", "node", "names", ":", "(", "ReduceMin", "ReduceMax", ")", "pairs", "}" ]
def compute_range(self): ''' Compute the min-max range of tensor :return: dictionary mapping: {added node names: (ReduceMin, ReduceMax) pairs } ''' if len(self.intermediate_outputs) == 0: return self.calibrate_tensors_range output_names = [self.infer_sessio...
[ "def", "compute_range", "(", "self", ")", ":", "if", "len", "(", "self", ".", "intermediate_outputs", ")", "==", "0", ":", "return", "self", ".", "calibrate_tensors_range", "output_names", "=", "[", "self", ".", "infer_session", ".", "get_outputs", "(", ")",...
https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/onnxruntime/python/tools/quantization/calibrate.py#L225-L270
yyzybb537/libgo
4af17b7c67643c4d54aa354dcc77963ea07847d0
third_party/boost.context/tools/build/src/build/generators.py
python
override
(overrider_id, overridee_id)
Make generator 'overrider-id' be preferred to 'overridee-id'. If, when searching for generators that could produce a target of certain type, both those generators are amoung viable generators, the overridden generator is immediately discarded. The overridden generators are discarded immediately ...
Make generator 'overrider-id' be preferred to 'overridee-id'. If, when searching for generators that could produce a target of certain type, both those generators are amoung viable generators, the overridden generator is immediately discarded.
[ "Make", "generator", "overrider", "-", "id", "be", "preferred", "to", "overridee", "-", "id", ".", "If", "when", "searching", "for", "generators", "that", "could", "produce", "a", "target", "of", "certain", "type", "both", "those", "generators", "are", "amou...
def override (overrider_id, overridee_id): """Make generator 'overrider-id' be preferred to 'overridee-id'. If, when searching for generators that could produce a target of certain type, both those generators are amoung viable generators, the overridden generator is immediately discarded. The o...
[ "def", "override", "(", "overrider_id", ",", "overridee_id", ")", ":", "assert", "isinstance", "(", "overrider_id", ",", "basestring", ")", "assert", "isinstance", "(", "overridee_id", ",", "basestring", ")", "__overrides", ".", "setdefault", "(", "overrider_id", ...
https://github.com/yyzybb537/libgo/blob/4af17b7c67643c4d54aa354dcc77963ea07847d0/third_party/boost.context/tools/build/src/build/generators.py#L754-L767
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/grid.py
python
Grid.SetLabelBackgroundColour
(*args, **kwargs)
return _grid.Grid_SetLabelBackgroundColour(*args, **kwargs)
SetLabelBackgroundColour(self, Colour ?)
SetLabelBackgroundColour(self, Colour ?)
[ "SetLabelBackgroundColour", "(", "self", "Colour", "?", ")" ]
def SetLabelBackgroundColour(*args, **kwargs): """SetLabelBackgroundColour(self, Colour ?)""" return _grid.Grid_SetLabelBackgroundColour(*args, **kwargs)
[ "def", "SetLabelBackgroundColour", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_SetLabelBackgroundColour", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L1554-L1556
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/model/DrillSample.py
python
DrillSample.delParameter
(self, name)
Delete a parameter from its name. Args: name (str): name of the parameter
Delete a parameter from its name.
[ "Delete", "a", "parameter", "from", "its", "name", "." ]
def delParameter(self, name): """ Delete a parameter from its name. Args: name (str): name of the parameter """ if name in self._parameters: del self._parameters[name] if self._status is not None: self._status = None ...
[ "def", "delParameter", "(", "self", ",", "name", ")", ":", "if", "name", "in", "self", ".", "_parameters", ":", "del", "self", ".", "_parameters", "[", "name", "]", "if", "self", ".", "_status", "is", "not", "None", ":", "self", ".", "_status", "=", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/model/DrillSample.py#L194-L205
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py
python
check_extras
(dist, attr, value)
Verify that extras_require mapping is valid
Verify that extras_require mapping is valid
[ "Verify", "that", "extras_require", "mapping", "is", "valid" ]
def check_extras(dist, attr, value): """Verify that extras_require mapping is valid""" try: list(itertools.starmap(_check_extra, value.items())) except (TypeError, ValueError, AttributeError): raise DistutilsSetupError( "'extras_require' must be a dictionary whose values are " ...
[ "def", "check_extras", "(", "dist", ",", "attr", ",", "value", ")", ":", "try", ":", "list", "(", "itertools", ".", "starmap", "(", "_check_extra", ",", "value", ".", "items", "(", ")", ")", ")", "except", "(", "TypeError", ",", "ValueError", ",", "A...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py#L246-L255
nlohmann/json
eb2182414749825be086c825edb5229e5c28503d
third_party/cpplint/cpplint.py
python
CheckPrintf
(filename, clean_lines, linenum, error)
Check for printf related issues. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Check for printf related issues.
[ "Check", "for", "printf", "related", "issues", "." ]
def CheckPrintf(filename, clean_lines, linenum, error): """Check for printf related issues. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. """ l...
[ "def", "CheckPrintf", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# When snprintf is used, the second argument shouldn't be a literal.", "match", "=", "Search", "(", "r...
https://github.com/nlohmann/json/blob/eb2182414749825be086c825edb5229e5c28503d/third_party/cpplint/cpplint.py#L5445-L5471
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/deps/protobuf/python/mox.py
python
MockObject.__call__
(self, *params, **named_params)
return mock_method(*params, **named_params)
Provide custom logic for mocking classes that are callable.
Provide custom logic for mocking classes that are callable.
[ "Provide", "custom", "logic", "for", "mocking", "classes", "that", "are", "callable", "." ]
def __call__(self, *params, **named_params): """Provide custom logic for mocking classes that are callable.""" # Verify the class we are mocking is callable callable = self._class_to_mock.__dict__.get('__call__', None) if callable is None: raise TypeError('Not callable') # Because the call i...
[ "def", "__call__", "(", "self", ",", "*", "params", ",", "*", "*", "named_params", ")", ":", "# Verify the class we are mocking is callable", "callable", "=", "self", ".", "_class_to_mock", ".", "__dict__", ".", "get", "(", "'__call__'", ",", "None", ")", "if"...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/deps/protobuf/python/mox.py#L490-L501
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
v8_7_5/tools/sanitizers/sancov_formatter.py
python
process_symbolizer_output
(output, build_dir)
return {k: sorted(file_map[k]) for k in file_map if keep(k)}
Post-process llvm symbolizer output. Excludes files outside the v8 checkout or given in exclusion list above from further processing. Drops the character index in each line. Returns: A mapping of file names to lists of line numbers. The file names have relative paths to the v8 base directory. The lis...
Post-process llvm symbolizer output.
[ "Post", "-", "process", "llvm", "symbolizer", "output", "." ]
def process_symbolizer_output(output, build_dir): """Post-process llvm symbolizer output. Excludes files outside the v8 checkout or given in exclusion list above from further processing. Drops the character index in each line. Returns: A mapping of file names to lists of line numbers. The file names ...
[ "def", "process_symbolizer_output", "(", "output", ",", "build_dir", ")", ":", "# Path prefix added by the llvm symbolizer including trailing slash.", "output_path_prefix", "=", "os", ".", "path", ".", "join", "(", "build_dir", ",", "'..'", ",", "'..'", ",", "''", ")"...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/v8_7_5/tools/sanitizers/sancov_formatter.py#L116-L155
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
Sizer.GetItem
(*args, **kwargs)
return _core_.Sizer_GetItem(*args, **kwargs)
GetItem(self, item, recursive=False) -> wx.SizerItem Returns the `wx.SizerItem` which holds the *item* given. The *item* parameter can be either a window, a sizer, or the zero-based index of the item to be found.
GetItem(self, item, recursive=False) -> wx.SizerItem
[ "GetItem", "(", "self", "item", "recursive", "=", "False", ")", "-", ">", "wx", ".", "SizerItem" ]
def GetItem(*args, **kwargs): """ GetItem(self, item, recursive=False) -> wx.SizerItem Returns the `wx.SizerItem` which holds the *item* given. The *item* parameter can be either a window, a sizer, or the zero-based index of the item to be found. """ return _cor...
[ "def", "GetItem", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Sizer_GetItem", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L14535-L14543
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.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/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py#L3249-L3261
qgis/QGIS
15a77662d4bb712184f6aa60d0bd663010a76a75
python/plugins/MetaSearch/dialogs/manageconnectionsdialog.py
python
ManageConnectionsDialog.reject
(self)
back out of manage connections dialogue
back out of manage connections dialogue
[ "back", "out", "of", "manage", "connections", "dialogue" ]
def reject(self): """back out of manage connections dialogue""" QDialog.reject(self)
[ "def", "reject", "(", "self", ")", ":", "QDialog", ".", "reject", "(", "self", ")" ]
https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/MetaSearch/dialogs/manageconnectionsdialog.py#L193-L196
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/ecs/item.py
python
Item.__init__
(self, connection=None)
Initialize this Item
Initialize this Item
[ "Initialize", "this", "Item" ]
def __init__(self, connection=None): """Initialize this Item""" ResponseGroup.__init__(self, connection, "Item")
[ "def", "__init__", "(", "self", ",", "connection", "=", "None", ")", ":", "ResponseGroup", ".", "__init__", "(", "self", ",", "connection", ",", "\"Item\"", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/ecs/item.py#L91-L93
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/oauth2client/oauth2client/django_orm.py
python
Storage.__init__
(self, model_class, key_name, key_value, property_name)
Constructor for Storage. Args: model: db.Model, model class key_name: string, key name for the entity that has the credentials key_value: string, key value for the entity that has the credentials property_name: string, name of the property that is an CredentialsProperty
Constructor for Storage.
[ "Constructor", "for", "Storage", "." ]
def __init__(self, model_class, key_name, key_value, property_name): """Constructor for Storage. Args: model: db.Model, model class key_name: string, key name for the entity that has the credentials key_value: string, key value for the entity that has the credentials property_name: stri...
[ "def", "__init__", "(", "self", ",", "model_class", ",", "key_name", ",", "key_value", ",", "property_name", ")", ":", "self", ".", "model_class", "=", "model_class", "self", ".", "key_name", "=", "key_name", "self", ".", "key_value", "=", "key_value", "self...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/oauth2client/oauth2client/django_orm.py#L89-L101
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Fem/feminout/writeFenicsXML.py
python
write_fenics_mesh_xml
(fem_mesh_obj, outputfile)
For the export, we only have to use the highest dimensional entities and their vertices to be exported. For second order elements, we have to delete the mid element nodes.
For the export, we only have to use the highest dimensional entities and their vertices to be exported. For second order elements, we have to delete the mid element nodes.
[ "For", "the", "export", "we", "only", "have", "to", "use", "the", "highest", "dimensional", "entities", "and", "their", "vertices", "to", "be", "exported", ".", "For", "second", "order", "elements", "we", "have", "to", "delete", "the", "mid", "element", "n...
def write_fenics_mesh_xml(fem_mesh_obj, outputfile): """ For the export, we only have to use the highest dimensional entities and their vertices to be exported. For second order elements, we have to delete the mid element nodes. """ # TODO: check for second order elements # (red...
[ "def", "write_fenics_mesh_xml", "(", "fem_mesh_obj", ",", "outputfile", ")", ":", "# TODO: check for second order elements", "# (reduce element order would be ok - all elements have at least the first", "# necessary nodes)", "FreeCAD_to_Fenics_dict", "=", "{", "\"Triangle\"", ":", "\...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Fem/feminout/writeFenicsXML.py#L42-L127
epiqc/ScaffCC
66a79944ee4cd116b27bc1a69137276885461db8
clang/utils/check_cfc/check_cfc.py
python
is_output_specified
(args)
return get_output_file(args) is not None
Return true is output file is specified in args.
Return true is output file is specified in args.
[ "Return", "true", "is", "output", "file", "is", "specified", "in", "args", "." ]
def is_output_specified(args): """Return true is output file is specified in args.""" return get_output_file(args) is not None
[ "def", "is_output_specified", "(", "args", ")", ":", "return", "get_output_file", "(", "args", ")", "is", "not", "None" ]
https://github.com/epiqc/ScaffCC/blob/66a79944ee4cd116b27bc1a69137276885461db8/clang/utils/check_cfc/check_cfc.py#L147-L149
plumonito/dtslam
5994bb9cf7a11981b830370db206bceb654c085d
3rdparty/opencv-git/3rdparty/jinja2/environment.py
python
Template.make_module
(self, vars=None, shared=False, locals=None)
return TemplateModule(self, self.new_context(vars, shared, locals))
This method works like the :attr:`module` attribute when called without arguments but it will evaluate the template on every call rather than caching it. It's also possible to provide a dict which is then used as context. The arguments are the same as for the :meth:`new_context` method...
This method works like the :attr:`module` attribute when called without arguments but it will evaluate the template on every call rather than caching it. It's also possible to provide a dict which is then used as context. The arguments are the same as for the :meth:`new_context` method...
[ "This", "method", "works", "like", "the", ":", "attr", ":", "module", "attribute", "when", "called", "without", "arguments", "but", "it", "will", "evaluate", "the", "template", "on", "every", "call", "rather", "than", "caching", "it", ".", "It", "s", "also...
def make_module(self, vars=None, shared=False, locals=None): """This method works like the :attr:`module` attribute when called without arguments but it will evaluate the template on every call rather than caching it. It's also possible to provide a dict which is then used as context. ...
[ "def", "make_module", "(", "self", ",", "vars", "=", "None", ",", "shared", "=", "False", ",", "locals", "=", "None", ")", ":", "return", "TemplateModule", "(", "self", ",", "self", ".", "new_context", "(", "vars", ",", "shared", ",", "locals", ")", ...
https://github.com/plumonito/dtslam/blob/5994bb9cf7a11981b830370db206bceb654c085d/3rdparty/opencv-git/3rdparty/jinja2/environment.py#L1006-L1013
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
libcxx/utils/gdb/libcxx/printers.py
python
AbstractRBTreePrinter._traverse
(self)
Traverses the binary search tree in order.
Traverses the binary search tree in order.
[ "Traverses", "the", "binary", "search", "tree", "in", "order", "." ]
def _traverse(self): """Traverses the binary search tree in order.""" current = self.util.root skip_left_child = False while True: if not skip_left_child and self.util.left_child(current): current = self.util.left_child(current) continue ...
[ "def", "_traverse", "(", "self", ")", ":", "current", "=", "self", ".", "util", ".", "root", "skip_left_child", "=", "False", "while", "True", ":", "if", "not", "skip_left_child", "and", "self", ".", "util", ".", "left_child", "(", "current", ")", ":", ...
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/libcxx/utils/gdb/libcxx/printers.py#L660-L681
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/jinja2/environment.py
python
get_spontaneous_environment
(*args)
return env
Return a new spontaneous environment. A spontaneous environment is an unnamed and unaccessible (in theory) environment that is used for templates generated from a string and not from the file system.
Return a new spontaneous environment. A spontaneous environment is an unnamed and unaccessible (in theory) environment that is used for templates generated from a string and not from the file system.
[ "Return", "a", "new", "spontaneous", "environment", ".", "A", "spontaneous", "environment", "is", "an", "unnamed", "and", "unaccessible", "(", "in", "theory", ")", "environment", "that", "is", "used", "for", "templates", "generated", "from", "a", "string", "an...
def get_spontaneous_environment(*args): """Return a new spontaneous environment. A spontaneous environment is an unnamed and unaccessible (in theory) environment that is used for templates generated from a string and not from the file system. """ try: env = _spontaneous_environments.get(arg...
[ "def", "get_spontaneous_environment", "(", "*", "args", ")", ":", "try", ":", "env", "=", "_spontaneous_environments", ".", "get", "(", "args", ")", "except", "TypeError", ":", "return", "Environment", "(", "*", "args", ")", "if", "env", "is", "not", "None...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/jinja2/environment.py#L44-L57
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/CGIHTTPServer.py
python
CGIHTTPRequestHandler.is_executable
(self, path)
return executable(path)
Test whether argument path is an executable file.
Test whether argument path is an executable file.
[ "Test", "whether", "argument", "path", "is", "an", "executable", "file", "." ]
def is_executable(self, path): """Test whether argument path is an executable file.""" return executable(path)
[ "def", "is_executable", "(", "self", ",", "path", ")", ":", "return", "executable", "(", "path", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/CGIHTTPServer.py#L98-L100
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/grid.py
python
GridCellAttrProvider.GetAttr
(*args, **kwargs)
return _grid.GridCellAttrProvider_GetAttr(*args, **kwargs)
GetAttr(self, int row, int col, int kind) -> GridCellAttr
GetAttr(self, int row, int col, int kind) -> GridCellAttr
[ "GetAttr", "(", "self", "int", "row", "int", "col", "int", "kind", ")", "-", ">", "GridCellAttr" ]
def GetAttr(*args, **kwargs): """GetAttr(self, int row, int col, int kind) -> GridCellAttr""" return _grid.GridCellAttrProvider_GetAttr(*args, **kwargs)
[ "def", "GetAttr", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "GridCellAttrProvider_GetAttr", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L686-L688
google/shaka-packager
e1b0c7c45431327fd3ce193514a5407d07b39b22
packager/third_party/protobuf/python/mox.py
python
MockMethod.AndRaise
(self, exception)
Set the exception to raise when this method is called. Args: # exception: the exception to raise when this method is called. exception: Exception
Set the exception to raise when this method is called.
[ "Set", "the", "exception", "to", "raise", "when", "this", "method", "is", "called", "." ]
def AndRaise(self, exception): """Set the exception to raise when this method is called. Args: # exception: the exception to raise when this method is called. exception: Exception """ self._exception = exception
[ "def", "AndRaise", "(", "self", ",", "exception", ")", ":", "self", ".", "_exception", "=", "exception" ]
https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/mox.py#L728-L736
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exodus3.in.py
python
internal_transfer_variables
(exoFrom, exo_to, obj_type, additionalVariables, debugPrint)
Internal support function for `exodus.transfer_variables`
Internal support function for `exodus.transfer_variables`
[ "Internal", "support", "function", "for", "exodus", ".", "transfer_variables" ]
def internal_transfer_variables(exoFrom, exo_to, obj_type, additionalVariables, debugPrint): """ Internal support function for `exodus.transfer_variables` """ if debugPrint: print("Construct Truth Table for additionalVariables") blkIds = exoFrom.get_ids(obj_type) numBlks = len(blkIds) newVar...
[ "def", "internal_transfer_variables", "(", "exoFrom", ",", "exo_to", ",", "obj_type", ",", "additionalVariables", ",", "debugPrint", ")", ":", "if", "debugPrint", ":", "print", "(", "\"Construct Truth Table for additionalVariables\"", ")", "blkIds", "=", "exoFrom", "....
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus3.in.py#L6547-L6611
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/Tool/FortranCommon.py
python
add_all_to_env
(env)
Add builders and construction variables for all supported fortran dialects.
Add builders and construction variables for all supported fortran dialects.
[ "Add", "builders", "and", "construction", "variables", "for", "all", "supported", "fortran", "dialects", "." ]
def add_all_to_env(env): """Add builders and construction variables for all supported fortran dialects.""" add_fortran_to_env(env) add_f77_to_env(env) add_f90_to_env(env) add_f95_to_env(env) add_f03_to_env(env) add_f08_to_env(env)
[ "def", "add_all_to_env", "(", "env", ")", ":", "add_fortran_to_env", "(", "env", ")", "add_f77_to_env", "(", "env", ")", "add_f90_to_env", "(", "env", ")", "add_f95_to_env", "(", "env", ")", "add_f03_to_env", "(", "env", ")", "add_f08_to_env", "(", "env", ")...
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Tool/FortranCommon.py#L265-L273
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
samples/ide/activegrid/tool/AbstractEditor.py
python
CanvasView.OnClear
(self, event)
Deletion of selected objects from view. *Must Override*
Deletion of selected objects from view. *Must Override*
[ "Deletion", "of", "selected", "objects", "from", "view", ".", "*", "Must", "Override", "*" ]
def OnClear(self, event): """ Deletion of selected objects from view. *Must Override* """ self.SetPropertyModel(None)
[ "def", "OnClear", "(", "self", ",", "event", ")", ":", "self", ".", "SetPropertyModel", "(", "None", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/samples/ide/activegrid/tool/AbstractEditor.py#L193-L197
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/inverse_gamma.py
python
InverseGamma.dtype
(self)
return self._alpha.dtype
dtype of samples from this distribution.
dtype of samples from this distribution.
[ "dtype", "of", "samples", "from", "this", "distribution", "." ]
def dtype(self): """dtype of samples from this distribution.""" return self._alpha.dtype
[ "def", "dtype", "(", "self", ")", ":", "return", "self", ".", "_alpha", ".", "dtype" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/inverse_gamma.py#L123-L125
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/curses/textpad.py
python
rectangle
(win, uly, ulx, lry, lrx)
Draw a rectangle with corners at the provided upper-left and lower-right coordinates.
Draw a rectangle with corners at the provided upper-left and lower-right coordinates.
[ "Draw", "a", "rectangle", "with", "corners", "at", "the", "provided", "upper", "-", "left", "and", "lower", "-", "right", "coordinates", "." ]
def rectangle(win, uly, ulx, lry, lrx): """Draw a rectangle with corners at the provided upper-left and lower-right coordinates. """ win.vline(uly+1, ulx, curses.ACS_VLINE, lry - uly - 1) win.hline(uly, ulx+1, curses.ACS_HLINE, lrx - ulx - 1) win.hline(lry, ulx+1, curses.ACS_HLINE, lrx - ulx - 1...
[ "def", "rectangle", "(", "win", ",", "uly", ",", "ulx", ",", "lry", ",", "lrx", ")", ":", "win", ".", "vline", "(", "uly", "+", "1", ",", "ulx", ",", "curses", ".", "ACS_VLINE", ",", "lry", "-", "uly", "-", "1", ")", "win", ".", "hline", "(",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/curses/textpad.py#L6-L17
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_presenter.py
python
BasicFittingPresenter.handle_minimizer_changed
(self)
Handle when a minimizer is changed.
Handle when a minimizer is changed.
[ "Handle", "when", "a", "minimizer", "is", "changed", "." ]
def handle_minimizer_changed(self) -> None: """Handle when a minimizer is changed.""" self.model.minimizer = self.view.minimizer
[ "def", "handle_minimizer_changed", "(", "self", ")", "->", "None", ":", "self", ".", "model", ".", "minimizer", "=", "self", ".", "view", ".", "minimizer" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_presenter.py#L237-L239
toggl-open-source/toggldesktop
91865205885531cc8fd9e8d613dad49d625d56e7
third_party/cpplint/cpplint.py
python
CheckBracesSpacing
(filename, clean_lines, linenum, error)
Checks for horizontal spacing near commas. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Checks for horizontal spacing near commas.
[ "Checks", "for", "horizontal", "spacing", "near", "commas", "." ]
def CheckBracesSpacing(filename, clean_lines, linenum, error): """Checks for horizontal spacing near commas. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors...
[ "def", "CheckBracesSpacing", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Except after an opening paren, or after another opening brace (in case of", "# an initializer list, f...
https://github.com/toggl-open-source/toggldesktop/blob/91865205885531cc8fd9e8d613dad49d625d56e7/third_party/cpplint/cpplint.py#L3316-L3392
xiw/stack
60370c0025022988d497a177348373f838bb8525
lib/lit/lit/Util.py
python
detectCPUs
()
return 1
Detects the number of CPUs on a system. Cribbed from pp.
Detects the number of CPUs on a system. Cribbed from pp.
[ "Detects", "the", "number", "of", "CPUs", "on", "a", "system", ".", "Cribbed", "from", "pp", "." ]
def detectCPUs(): """ Detects the number of CPUs on a system. Cribbed from pp. """ # Linux, Unix and MacOS: if hasattr(os, "sysconf"): if os.sysconf_names.has_key("SC_NPROCESSORS_ONLN"): # Linux & Unix: ncpus = os.sysconf("SC_NPROCESSORS_ONLN") if isinstan...
[ "def", "detectCPUs", "(", ")", ":", "# Linux, Unix and MacOS:", "if", "hasattr", "(", "os", ",", "\"sysconf\"", ")", ":", "if", "os", ".", "sysconf_names", ".", "has_key", "(", "\"SC_NPROCESSORS_ONLN\"", ")", ":", "# Linux & Unix:", "ncpus", "=", "os", ".", ...
https://github.com/xiw/stack/blob/60370c0025022988d497a177348373f838bb8525/lib/lit/lit/Util.py#L3-L21
esa/pagmo
80281d549c8f1b470e1489a5d37c8f06b2e429c0
PyGMO/util/__init__.py
python
_race_algo_ctor
(self, algo_list, probs, pop_size=100, seed=0)
Construct the racing object responsible for racing algorithms * algo_list: The algorithms to be raced * probs: Can be a single PyGMO problem or a list of them * pop_size: All the algorithms will be evolving internally some random population of this size * seed: Seed of the race
Construct the racing object responsible for racing algorithms
[ "Construct", "the", "racing", "object", "responsible", "for", "racing", "algorithms" ]
def _race_algo_ctor(self, algo_list, probs, pop_size=100, seed=0): """ Construct the racing object responsible for racing algorithms * algo_list: The algorithms to be raced * probs: Can be a single PyGMO problem or a list of them * pop_size: All the algorithms will be evolving internally some rando...
[ "def", "_race_algo_ctor", "(", "self", ",", "algo_list", ",", "probs", ",", "pop_size", "=", "100", ",", "seed", "=", "0", ")", ":", "# We set the defaults or the kwargs", "arg_list", "=", "[", "]", "#algo_vec = vector_of_algorithm_base_ptr()", "#algo_vec.extend(algo_...
https://github.com/esa/pagmo/blob/80281d549c8f1b470e1489a5d37c8f06b2e429c0/PyGMO/util/__init__.py#L681-L708
nasa/fprime
595cf3682d8365943d86c1a6fe7c78f0a116acf0
Autocoders/Python/src/fprime_ac/generators/visitors/SerialHVisitor.py
python
SerialHVisitor.includes2Visit
(self, obj)
Defined to generate internal includes within a file. Usually used for data type includes and system includes. @param args: the instance of the concrete element to operation on.
Defined to generate internal includes within a file. Usually used for data type includes and system includes.
[ "Defined", "to", "generate", "internal", "includes", "within", "a", "file", ".", "Usually", "used", "for", "data", "type", "includes", "and", "system", "includes", "." ]
def includes2Visit(self, obj): """ Defined to generate internal includes within a file. Usually used for data type includes and system includes. @param args: the instance of the concrete element to operation on. """ c = includes2SerialH.includes2SerialH() c.xml_in...
[ "def", "includes2Visit", "(", "self", ",", "obj", ")", ":", "c", "=", "includes2SerialH", ".", "includes2SerialH", "(", ")", "c", ".", "xml_includes_list", "=", "obj", ".", "get_xml_includes", "(", ")", "if", "False", "in", "[", "x", "[", "-", "6", ":"...
https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/visitors/SerialHVisitor.py#L282-L305
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/learn/python/learn/experiment.py
python
Experiment.__init__
(self, estimator, train_input_fn, eval_input_fn, eval_metrics=None, train_steps=None, eval_steps=100, train_monitors=None, local_eval_frequency=None, eval_delay_secs=120, ...
Constructor for `Experiment`. Args: estimator: Object implementing `Trainable` and `Evaluable`. train_input_fn: function, returns features and targets for training. eval_input_fn: function, returns features and targets for evaluation. If `eval_steps` is `None`, this should be configured o...
Constructor for `Experiment`.
[ "Constructor", "for", "Experiment", "." ]
def __init__(self, estimator, train_input_fn, eval_input_fn, eval_metrics=None, train_steps=None, eval_steps=100, train_monitors=None, local_eval_frequency=None, eval_delay_secs=120, ...
[ "def", "__init__", "(", "self", ",", "estimator", ",", "train_input_fn", ",", "eval_input_fn", ",", "eval_metrics", "=", "None", ",", "train_steps", "=", "None", ",", "eval_steps", "=", "100", ",", "train_monitors", "=", "None", ",", "local_eval_frequency", "=...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/experiment.py#L38-L90
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/SANS/ISISCommandInterface.py
python
DeleteZeroErrorFreeClonedWorkspace
(input_workspace_name)
Deletes a zero-error-free workspace @param input_workspace_name : name of the workspace which might contain zero-error values @return: success message
Deletes a zero-error-free workspace
[ "Deletes", "a", "zero", "-", "error", "-", "free", "workspace" ]
def DeleteZeroErrorFreeClonedWorkspace(input_workspace_name): """ Deletes a zero-error-free workspace @param input_workspace_name : name of the workspace which might contain zero-error values @return: success message """ message, complete = su.delete_zero_error_free_workspace(input_...
[ "def", "DeleteZeroErrorFreeClonedWorkspace", "(", "input_workspace_name", ")", ":", "message", ",", "complete", "=", "su", ".", "delete_zero_error_free_workspace", "(", "input_workspace_name", "=", "input_workspace_name", ")", "if", "not", "complete", ":", "return", "me...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/ISISCommandInterface.py#L1252-L1262
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Misc.tk_strictMotif
(self, boolean=None)
return self.tk.getboolean(self.tk.call( 'set', 'tk_strictMotif', boolean))
Set Tcl internal variable, whether the look and feel should adhere to Motif. A parameter of 1 means adhere to Motif (e.g. no color change if mouse passes over slider). Returns the set value.
Set Tcl internal variable, whether the look and feel should adhere to Motif.
[ "Set", "Tcl", "internal", "variable", "whether", "the", "look", "and", "feel", "should", "adhere", "to", "Motif", "." ]
def tk_strictMotif(self, boolean=None): """Set Tcl internal variable, whether the look and feel should adhere to Motif. A parameter of 1 means adhere to Motif (e.g. no color change if mouse passes over slider). Returns the set value.""" return self.tk.getboolean(self.tk....
[ "def", "tk_strictMotif", "(", "self", ",", "boolean", "=", "None", ")", ":", "return", "self", ".", "tk", ".", "getboolean", "(", "self", ".", "tk", ".", "call", "(", "'set'", ",", "'tk_strictMotif'", ",", "boolean", ")", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py#L399-L407
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/cuda/memory.py
python
reset_peak_memory_stats
(device: Union[Device, int] = None)
return torch._C._cuda_resetPeakMemoryStats(device)
r"""Resets the "peak" stats tracked by the CUDA memory allocator. See :func:`~torch.cuda.memory_stats` for details. Peak stats correspond to the `"peak"` key in each individual stat dict. Args: device (torch.device or int, optional): selected device. Returns statistic for the current d...
r"""Resets the "peak" stats tracked by the CUDA memory allocator.
[ "r", "Resets", "the", "peak", "stats", "tracked", "by", "the", "CUDA", "memory", "allocator", "." ]
def reset_peak_memory_stats(device: Union[Device, int] = None) -> None: r"""Resets the "peak" stats tracked by the CUDA memory allocator. See :func:`~torch.cuda.memory_stats` for details. Peak stats correspond to the `"peak"` key in each individual stat dict. Args: device (torch.device or int,...
[ "def", "reset_peak_memory_stats", "(", "device", ":", "Union", "[", "Device", ",", "int", "]", "=", "None", ")", "->", "None", ":", "device", "=", "_get_device_index", "(", "device", ",", "optional", "=", "True", ")", "return", "torch", ".", "_C", ".", ...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/cuda/memory.py#L233-L249
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
algorithms/src/LocalizationAndMapping/registration_localization/fast_gicp/thirdparty/Sophus/py/sophus/se3.py
python
Se3.exp
(v)
return Se3(so3, V * upsilon)
exponential map
exponential map
[ "exponential", "map" ]
def exp(v): """ exponential map """ upsilon = v[0:3, :] omega = sophus.Vector3(v[3], v[4], v[5]) so3 = sophus.So3.exp(omega) Omega = sophus.So3.hat(omega) Omega_sq = Omega * Omega theta = sympy.sqrt(sophus.squared_norm(omega)) V = (sympy.Matrix.eye(3) + ...
[ "def", "exp", "(", "v", ")", ":", "upsilon", "=", "v", "[", "0", ":", "3", ",", ":", "]", "omega", "=", "sophus", ".", "Vector3", "(", "v", "[", "3", "]", ",", "v", "[", "4", "]", ",", "v", "[", "5", "]", ")", "so3", "=", "sophus", ".",...
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/algorithms/src/LocalizationAndMapping/registration_localization/fast_gicp/thirdparty/Sophus/py/sophus/se3.py#L22-L33
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/_extends/parallel_compile/tbe_compiler/tbe_adapter.py
python
_remove_cache
(job: TbeJob)
:param job: remove cache file:[*.json, *.o, *.info, *.cce] when "op_debug_level" is "0" op_debug_level: representation the env MS_COMPILER_OP_LEVEL :return:
:param job: remove cache file:[*.json, *.o, *.info, *.cce] when "op_debug_level" is "0" op_debug_level: representation the env MS_COMPILER_OP_LEVEL :return:
[ ":", "param", "job", ":", "remove", "cache", "file", ":", "[", "*", ".", "json", "*", ".", "o", "*", ".", "info", "*", ".", "cce", "]", "when", "op_debug_level", "is", "0", "op_debug_level", ":", "representation", "the", "env", "MS_COMPILER_OP_LEVEL", ...
def _remove_cache(job: TbeJob): """ :param job: remove cache file:[*.json, *.o, *.info, *.cce] when "op_debug_level" is "0" op_debug_level: representation the env MS_COMPILER_OP_LEVEL :return: """ op_debug_level = job.content["SocInfo"]["op_debug_level"] op_debug_dir = job.conten...
[ "def", "_remove_cache", "(", "job", ":", "TbeJob", ")", ":", "op_debug_level", "=", "job", ".", "content", "[", "\"SocInfo\"", "]", "[", "\"op_debug_level\"", "]", "op_debug_dir", "=", "job", ".", "content", "[", "\"SocInfo\"", "]", "[", "\"op_debug_dir\"", ...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_extends/parallel_compile/tbe_compiler/tbe_adapter.py#L106-L119
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
External/pymol/modules/pymol/rpc.py
python
rpcHide
(objs)
return res
hides (disables) an object (or objects)
hides (disables) an object (or objects)
[ "hides", "(", "disables", ")", "an", "object", "(", "or", "objects", ")" ]
def rpcHide(objs): """ hides (disables) an object (or objects) """ if type(objs) not in (types.ListType, types.TupleType): objs = (objs, ) for objName in objs: try: cmd.disable(objName) except Exception: res = 0 break else: res = 1 return res
[ "def", "rpcHide", "(", "objs", ")", ":", "if", "type", "(", "objs", ")", "not", "in", "(", "types", ".", "ListType", ",", "types", ".", "TupleType", ")", ":", "objs", "=", "(", "objs", ",", ")", "for", "objName", "in", "objs", ":", "try", ":", ...
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/External/pymol/modules/pymol/rpc.py#L287-L300
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/thumbnailctrl.py
python
Thumb.BreakCaption
(self, width)
Breaks the caption in several lines of text (if needed). :param `width`: the maximum width, in pixels, available for the caption text.
Breaks the caption in several lines of text (if needed).
[ "Breaks", "the", "caption", "in", "several", "lines", "of", "text", "(", "if", "needed", ")", "." ]
def BreakCaption(self, width): """ Breaks the caption in several lines of text (if needed). :param `width`: the maximum width, in pixels, available for the caption text. """ if len(self._captionbreaks) > 0 or width < 16: return self._caption...
[ "def", "BreakCaption", "(", "self", ",", "width", ")", ":", "if", "len", "(", "self", ".", "_captionbreaks", ")", ">", "0", "or", "width", "<", "16", ":", "return", "self", ".", "_captionbreaks", ".", "append", "(", "0", ")", "if", "len", "(", "sel...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/thumbnailctrl.py#L832-L885
facebookincubator/BOLT
88c70afe9d388ad430cc150cc158641701397f70
clang/bindings/python/clang/cindex.py
python
TranslationUnit.get_file
(self, filename)
return File.from_name(self, filename)
Obtain a File from this translation unit.
Obtain a File from this translation unit.
[ "Obtain", "a", "File", "from", "this", "translation", "unit", "." ]
def get_file(self, filename): """Obtain a File from this translation unit.""" return File.from_name(self, filename)
[ "def", "get_file", "(", "self", ",", "filename", ")", ":", "return", "File", ".", "from_name", "(", "self", ",", "filename", ")" ]
https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/clang/bindings/python/clang/cindex.py#L2908-L2911
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
TreeCtrl.InsertItemBefore
(*args, **kwargs)
return _controls_.TreeCtrl_InsertItemBefore(*args, **kwargs)
InsertItemBefore(self, TreeItemId parent, size_t index, String text, int image=-1, int selectedImage=-1, TreeItemData data=None) -> TreeItemId
InsertItemBefore(self, TreeItemId parent, size_t index, String text, int image=-1, int selectedImage=-1, TreeItemData data=None) -> TreeItemId
[ "InsertItemBefore", "(", "self", "TreeItemId", "parent", "size_t", "index", "String", "text", "int", "image", "=", "-", "1", "int", "selectedImage", "=", "-", "1", "TreeItemData", "data", "=", "None", ")", "-", ">", "TreeItemId" ]
def InsertItemBefore(*args, **kwargs): """ InsertItemBefore(self, TreeItemId parent, size_t index, String text, int image=-1, int selectedImage=-1, TreeItemData data=None) -> TreeItemId """ return _controls_.TreeCtrl_InsertItemBefore(*args, **kwargs)
[ "def", "InsertItemBefore", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "TreeCtrl_InsertItemBefore", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L5437-L5442
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/roc/stubs.py
python
get_local_size
(*args, **kargs)
OpenCL get_local_size()
OpenCL get_local_size()
[ "OpenCL", "get_local_size", "()" ]
def get_local_size(*args, **kargs): """ OpenCL get_local_size() """ raise _stub_error
[ "def", "get_local_size", "(", "*", "args", ",", "*", "*", "kargs", ")", ":", "raise", "_stub_error" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/roc/stubs.py#L29-L33
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/aui/auibar.py
python
AuiDefaultToolBarArt.SetOrientation
(self, orientation)
Sets the toolbar tool orientation. :param integer `orientation`: one of ``AUI_TBTOOL_HORIZONTAL``, ``AUI_TBTOOL_VERT_CLOCKWISE`` or ``AUI_TBTOOL_VERT_COUNTERCLOCKWISE``.
Sets the toolbar tool orientation.
[ "Sets", "the", "toolbar", "tool", "orientation", "." ]
def SetOrientation(self, orientation): """ Sets the toolbar tool orientation. :param integer `orientation`: one of ``AUI_TBTOOL_HORIZONTAL``, ``AUI_TBTOOL_VERT_CLOCKWISE`` or ``AUI_TBTOOL_VERT_COUNTERCLOCKWISE``. """ self._orientation = orientation
[ "def", "SetOrientation", "(", "self", ",", "orientation", ")", ":", "self", ".", "_orientation", "=", "orientation" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/auibar.py#L872-L880
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/pkg_resources/_vendor/appdirs.py
python
user_state_dir
(appname=None, appauthor=None, version=None, roaming=False)
return path
r"""Return full path to the user-specific state dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically ...
r"""Return full path to the user-specific state dir for this application.
[ "r", "Return", "full", "path", "to", "the", "user", "-", "specific", "state", "dir", "for", "this", "application", "." ]
def user_state_dir(appname=None, appauthor=None, version=None, roaming=False): r"""Return full path to the user-specific state dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name o...
[ "def", "user_state_dir", "(", "appname", "=", "None", ",", "appauthor", "=", "None", ",", "version", "=", "None", ",", "roaming", "=", "False", ")", ":", "if", "system", "in", "[", "\"win32\"", ",", "\"darwin\"", "]", ":", "path", "=", "user_data_dir", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/pkg_resources/_vendor/appdirs.py#L314-L353
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
URI.setUser
(self, user)
Set the user part of an URI.
Set the user part of an URI.
[ "Set", "the", "user", "part", "of", "an", "URI", "." ]
def setUser(self, user): """Set the user part of an URI. """ libxml2mod.xmlURISetUser(self._o, user)
[ "def", "setUser", "(", "self", ",", "user", ")", ":", "libxml2mod", ".", "xmlURISetUser", "(", "self", ".", "_o", ",", "user", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L6261-L6263
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_gdi.py
python
PseudoDC.DrawEllipticArc
(*args, **kwargs)
return _gdi_.PseudoDC_DrawEllipticArc(*args, **kwargs)
DrawEllipticArc(self, int x, int y, int w, int h, double start, double end) Draws an arc of an ellipse, with the given rectangle defining the bounds of the ellipse. The current pen is used for drawing the arc and the current brush is used for drawing the pie. The *start* and *end* para...
DrawEllipticArc(self, int x, int y, int w, int h, double start, double end)
[ "DrawEllipticArc", "(", "self", "int", "x", "int", "y", "int", "w", "int", "h", "double", "start", "double", "end", ")" ]
def DrawEllipticArc(*args, **kwargs): """ DrawEllipticArc(self, int x, int y, int w, int h, double start, double end) Draws an arc of an ellipse, with the given rectangle defining the bounds of the ellipse. The current pen is used for drawing the arc and the current brush is use...
[ "def", "DrawEllipticArc", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "PseudoDC_DrawEllipticArc", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L8027-L8041
zhaoweicai/hwgq
ebc706bee3e2d145de1da4be446ce8de8740738f
python/caffe/io.py
python
array_to_blobproto
(arr, diff=None)
return blob
Converts a N-dimensional array to blob proto. If diff is given, also convert the diff. You need to make sure that arr and diff have the same shape, and this function does not do sanity check.
Converts a N-dimensional array to blob proto. If diff is given, also convert the diff. You need to make sure that arr and diff have the same shape, and this function does not do sanity check.
[ "Converts", "a", "N", "-", "dimensional", "array", "to", "blob", "proto", ".", "If", "diff", "is", "given", "also", "convert", "the", "diff", ".", "You", "need", "to", "make", "sure", "that", "arr", "and", "diff", "have", "the", "same", "shape", "and",...
def array_to_blobproto(arr, diff=None): """Converts a N-dimensional array to blob proto. If diff is given, also convert the diff. You need to make sure that arr and diff have the same shape, and this function does not do sanity check. """ blob = caffe_pb2.BlobProto() blob.shape.dim.extend(arr.sh...
[ "def", "array_to_blobproto", "(", "arr", ",", "diff", "=", "None", ")", ":", "blob", "=", "caffe_pb2", ".", "BlobProto", "(", ")", "blob", ".", "shape", ".", "dim", ".", "extend", "(", "arr", ".", "shape", ")", "blob", ".", "data", ".", "extend", "...
https://github.com/zhaoweicai/hwgq/blob/ebc706bee3e2d145de1da4be446ce8de8740738f/python/caffe/io.py#L36-L46
MythTV/mythtv
d282a209cb8be85d036f85a62a8ec971b67d45f4
mythtv/programs/scripts/internetcontent/nv_python_libs/xsltfunctions/tedtalksXSL_api.py
python
xpathFunctions.tedtalksTitleRSS
(self, context, *arg)
return title[:index].strip()
Return item elements that were previously created in "tedtalksMakeItem" call Call example: 'mnvXpath:tedtalksTitleRSS(string(title))' return a massaged title string
Return item elements that were previously created in "tedtalksMakeItem" call Call example: 'mnvXpath:tedtalksTitleRSS(string(title))' return a massaged title string
[ "Return", "item", "elements", "that", "were", "previously", "created", "in", "tedtalksMakeItem", "call", "Call", "example", ":", "mnvXpath", ":", "tedtalksTitleRSS", "(", "string", "(", "title", "))", "return", "a", "massaged", "title", "string" ]
def tedtalksTitleRSS(self, context, *arg): '''Return item elements that were previously created in "tedtalksMakeItem" call Call example: 'mnvXpath:tedtalksTitleRSS(string(title))' return a massaged title string ''' title = arg[0] index = title.rfind('-') if index ...
[ "def", "tedtalksTitleRSS", "(", "self", ",", "context", ",", "*", "arg", ")", ":", "title", "=", "arg", "[", "0", "]", "index", "=", "title", ".", "rfind", "(", "'-'", ")", "if", "index", "==", "-", "1", ":", "return", "title", "return", "title", ...
https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/internetcontent/nv_python_libs/xsltfunctions/tedtalksXSL_api.py#L219-L228
ablab/spades
3a754192b88540524ce6fb69eef5ea9273a38465
assembler/ext/src/python_libs/joblib3/pool.py
python
delete_folder
(folder_path)
Utility function to cleanup a temporary folder if still existing
Utility function to cleanup a temporary folder if still existing
[ "Utility", "function", "to", "cleanup", "a", "temporary", "folder", "if", "still", "existing" ]
def delete_folder(folder_path): """Utility function to cleanup a temporary folder if still existing""" if os.path.exists(folder_path): shutil.rmtree(folder_path)
[ "def", "delete_folder", "(", "folder_path", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "folder_path", ")", ":", "shutil", ".", "rmtree", "(", "folder_path", ")" ]
https://github.com/ablab/spades/blob/3a754192b88540524ce6fb69eef5ea9273a38465/assembler/ext/src/python_libs/joblib3/pool.py#L431-L434
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/framework/importer.py
python
import_graph_def_for_function
( # pylint: disable=invalid-name graph_def, name=None)
return _import_graph_def_internal( graph_def, validate_colocation_constraints=False, name=name)
Like import_graph_def but does not validate colocation constraints.
Like import_graph_def but does not validate colocation constraints.
[ "Like", "import_graph_def", "but", "does", "not", "validate", "colocation", "constraints", "." ]
def import_graph_def_for_function( # pylint: disable=invalid-name graph_def, name=None): """Like import_graph_def but does not validate colocation constraints.""" return _import_graph_def_internal( graph_def, validate_colocation_constraints=False, name=name)
[ "def", "import_graph_def_for_function", "(", "# pylint: disable=invalid-name", "graph_def", ",", "name", "=", "None", ")", ":", "return", "_import_graph_def_internal", "(", "graph_def", ",", "validate_colocation_constraints", "=", "False", ",", "name", "=", "name", ")" ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/framework/importer.py#L411-L415
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/propgrid.py
python
PGArrayEditorDialog.OnUpClick
(*args, **kwargs)
return _propgrid.PGArrayEditorDialog_OnUpClick(*args, **kwargs)
OnUpClick(self, CommandEvent event)
OnUpClick(self, CommandEvent event)
[ "OnUpClick", "(", "self", "CommandEvent", "event", ")" ]
def OnUpClick(*args, **kwargs): """OnUpClick(self, CommandEvent event)""" return _propgrid.PGArrayEditorDialog_OnUpClick(*args, **kwargs)
[ "def", "OnUpClick", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGArrayEditorDialog_OnUpClick", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L3218-L3220
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Node/__init__.py
python
Node.get_contents
(self)
return _get_contents_map[self._func_get_contents](self)
Fetch the contents of the entry.
Fetch the contents of the entry.
[ "Fetch", "the", "contents", "of", "the", "entry", "." ]
def get_contents(self): """Fetch the contents of the entry.""" return _get_contents_map[self._func_get_contents](self)
[ "def", "get_contents", "(", "self", ")", ":", "return", "_get_contents_map", "[", "self", ".", "_func_get_contents", "]", "(", "self", ")" ]
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Node/__init__.py#L1258-L1260
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/http/client.py
python
parse_headers
(fp, _class=HTTPMessage)
return email.parser.Parser(_class=_class).parsestr(hstring)
Parses only RFC2822 headers from a file pointer. email Parser wants to see strings rather than bytes. But a TextIOWrapper around self.rfile would buffer too many bytes from the stream, bytes which we later need to read as bytes. So we read the correct bytes here, as bytes, for email Parser to parse...
Parses only RFC2822 headers from a file pointer.
[ "Parses", "only", "RFC2822", "headers", "from", "a", "file", "pointer", "." ]
def parse_headers(fp, _class=HTTPMessage): """Parses only RFC2822 headers from a file pointer. email Parser wants to see strings rather than bytes. But a TextIOWrapper around self.rfile would buffer too many bytes from the stream, bytes which we later need to read as bytes. So we read the correct b...
[ "def", "parse_headers", "(", "fp", ",", "_class", "=", "HTTPMessage", ")", ":", "headers", "=", "[", "]", "while", "True", ":", "line", "=", "fp", ".", "readline", "(", "_MAXLINE", "+", "1", ")", "if", "len", "(", "line", ")", ">", "_MAXLINE", ":",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/http/client.py#L207-L228
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
PrintDialogData.SetToPage
(*args, **kwargs)
return _windows_.PrintDialogData_SetToPage(*args, **kwargs)
SetToPage(self, int v)
SetToPage(self, int v)
[ "SetToPage", "(", "self", "int", "v", ")" ]
def SetToPage(*args, **kwargs): """SetToPage(self, int v)""" return _windows_.PrintDialogData_SetToPage(*args, **kwargs)
[ "def", "SetToPage", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "PrintDialogData_SetToPage", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L5082-L5084
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Show/mTempoVis.py
python
TempoVis._value_after
(self, detail, query_scene = False)
_value_current(detail): returns (tv, detail1). SceneDetail instance holds "current" value of scene detail (current from the context of this TV; i.e. either the current scene status, or the saved state from upper TVs). If no upper TV has saved the detail value, returns either (None, None), or ...
_value_current(detail): returns (tv, detail1). SceneDetail instance holds "current" value of scene detail (current from the context of this TV; i.e. either the current scene status, or the saved state from upper TVs). If no upper TV has saved the detail value, returns either (None, None), or ...
[ "_value_current", "(", "detail", ")", ":", "returns", "(", "tv", "detail1", ")", ".", "SceneDetail", "instance", "holds", "current", "value", "of", "scene", "detail", "(", "current", "from", "the", "context", "of", "this", "TV", ";", "i", ".", "e", ".", ...
def _value_after(self, detail, query_scene = False): '''_value_current(detail): returns (tv, detail1). SceneDetail instance holds "current" value of scene detail (current from the context of this TV; i.e. either the current scene status, or the saved state from upper TVs). If no upper ...
[ "def", "_value_after", "(", "self", ",", "detail", ",", "query_scene", "=", "False", ")", ":", "def", "scene_value", "(", ")", ":", "if", "query_scene", ":", "cpy", "=", "copy", "(", "detail", ")", "cpy", ".", "data", "=", "cpy", ".", "scene_value", ...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Show/mTempoVis.py#L498-L519
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/src/robotsim.py
python
ContactQueryResult.__init__
(self)
r""" __init__(ContactQueryResult self) -> ContactQueryResult
r""" __init__(ContactQueryResult self) -> ContactQueryResult
[ "r", "__init__", "(", "ContactQueryResult", "self", ")", "-", ">", "ContactQueryResult" ]
def __init__(self): r""" __init__(ContactQueryResult self) -> ContactQueryResult """ _robotsim.ContactQueryResult_swiginit(self, _robotsim.new_ContactQueryResult())
[ "def", "__init__", "(", "self", ")", ":", "_robotsim", ".", "ContactQueryResult_swiginit", "(", "self", ",", "_robotsim", ".", "new_ContactQueryResult", "(", ")", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L1925-L1931
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tempfile.py
python
mkstemp
(suffix=None, prefix=None, dir=None, text=False)
return _mkstemp_inner(dir, prefix, suffix, flags, output_type)
User-callable function to create and return a unique temporary file. The return value is a pair (fd, name) where fd is the file descriptor returned by os.open, and name is the filename. If 'suffix' is not None, the file name will end with that suffix, otherwise there will be no suffix. If 'prefix...
User-callable function to create and return a unique temporary file. The return value is a pair (fd, name) where fd is the file descriptor returned by os.open, and name is the filename.
[ "User", "-", "callable", "function", "to", "create", "and", "return", "a", "unique", "temporary", "file", ".", "The", "return", "value", "is", "a", "pair", "(", "fd", "name", ")", "where", "fd", "is", "the", "file", "descriptor", "returned", "by", "os", ...
def mkstemp(suffix=None, prefix=None, dir=None, text=False): """User-callable function to create and return a unique temporary file. The return value is a pair (fd, name) where fd is the file descriptor returned by os.open, and name is the filename. If 'suffix' is not None, the file name will end with...
[ "def", "mkstemp", "(", "suffix", "=", "None", ",", "prefix", "=", "None", ",", "dir", "=", "None", ",", "text", "=", "False", ")", ":", "prefix", ",", "suffix", ",", "dir", ",", "output_type", "=", "_sanitize_params", "(", "prefix", ",", "suffix", ",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tempfile.py#L303-L340
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/perf/profile_creators/fast_navigation_profile_extender.py
python
FastNavigationProfileExtender.VerifyProfileWasExtended
(self)
Verifies that the profile was correctly extended. Can be overridden by subclasses.
Verifies that the profile was correctly extended.
[ "Verifies", "that", "the", "profile", "was", "correctly", "extended", "." ]
def VerifyProfileWasExtended(self): """Verifies that the profile was correctly extended. Can be overridden by subclasses. """ pass
[ "def", "VerifyProfileWasExtended", "(", "self", ")", ":", "pass" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/perf/profile_creators/fast_navigation_profile_extender.py#L65-L70
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/cgi.py
python
FieldStorage.__contains__
(self, key)
return any(item.name == key for item in self.list)
Dictionary style __contains__ method.
Dictionary style __contains__ method.
[ "Dictionary", "style", "__contains__", "method", "." ]
def __contains__(self, key): """Dictionary style __contains__ method.""" if self.list is None: raise TypeError("not indexable") return any(item.name == key for item in self.list)
[ "def", "__contains__", "(", "self", ",", "key", ")", ":", "if", "self", ".", "list", "is", "None", ":", "raise", "TypeError", "(", "\"not indexable\"", ")", "return", "any", "(", "item", ".", "name", "==", "key", "for", "item", "in", "self", ".", "li...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/cgi.py#L570-L574
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/optimize/optimize.py
python
golden
(func, args=(), brack=None, tol=_epsilon, full_output=0, maxiter=5000)
Return the minimum of a function of one variable using golden section method. Given a function of one variable and a possible bracketing interval, return the minimum of the function isolated to a fractional precision of tol. Parameters ---------- func : callable func(x,*args) Objec...
Return the minimum of a function of one variable using golden section method.
[ "Return", "the", "minimum", "of", "a", "function", "of", "one", "variable", "using", "golden", "section", "method", "." ]
def golden(func, args=(), brack=None, tol=_epsilon, full_output=0, maxiter=5000): """ Return the minimum of a function of one variable using golden section method. Given a function of one variable and a possible bracketing interval, return the minimum of the function isolated to a fracti...
[ "def", "golden", "(", "func", ",", "args", "=", "(", ")", ",", "brack", "=", "None", ",", "tol", "=", "_epsilon", ",", "full_output", "=", "0", ",", "maxiter", "=", "5000", ")", ":", "options", "=", "{", "'xtol'", ":", "tol", ",", "'maxiter'", ":...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/optimize.py#L2121-L2185
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/estimator/estimator.py
python
Estimator._create_global_step
(self, graph)
return training.create_global_step(graph)
Creates the global step tensor in graph. The global step tensor must be an integer type with name 'global_step' and be added to the collection ${tf.GraphKeys.GLOBAL_STEP}. Args: graph: The graph in which to create the global step tensor. Returns: The global step `Tensor`.
Creates the global step tensor in graph.
[ "Creates", "the", "global", "step", "tensor", "in", "graph", "." ]
def _create_global_step(self, graph): """Creates the global step tensor in graph. The global step tensor must be an integer type with name 'global_step' and be added to the collection ${tf.GraphKeys.GLOBAL_STEP}. Args: graph: The graph in which to create the global step tensor. Returns: ...
[ "def", "_create_global_step", "(", "self", ",", "graph", ")", ":", "return", "training", ".", "create_global_step", "(", "graph", ")" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/estimator/estimator.py#L534-L546
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/all_reduce/python/all_reduce.py
python
_build_ring_scatter
(pred_by_s_d, rank_by_s_d, chunks_by_dev)
return output
Construct subgraph for second (scatter) pass of ring all-reduce. Args: pred_by_s_d: as produced by _ring_permutations rank_by_s_d: as produced by _ring_permutations chunks_by_dev: list of list of T @{tf.Tensor} indexed by ints (device, chunk) Raises: ValueError: chunks_by_dev is not well-for...
Construct subgraph for second (scatter) pass of ring all-reduce.
[ "Construct", "subgraph", "for", "second", "(", "scatter", ")", "pass", "of", "ring", "all", "-", "reduce", "." ]
def _build_ring_scatter(pred_by_s_d, rank_by_s_d, chunks_by_dev): """Construct subgraph for second (scatter) pass of ring all-reduce. Args: pred_by_s_d: as produced by _ring_permutations rank_by_s_d: as produced by _ring_permutations chunks_by_dev: list of list of T @{tf.Tensor}...
[ "def", "_build_ring_scatter", "(", "pred_by_s_d", ",", "rank_by_s_d", ",", "chunks_by_dev", ")", ":", "num_devices", "=", "len", "(", "chunks_by_dev", ")", "num_chunks", "=", "len", "(", "chunks_by_dev", "[", "0", "]", ")", "if", "0", "!=", "num_chunks", "%"...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/all_reduce/python/all_reduce.py#L377-L423
qt/qt
0a2f2382541424726168804be2c90b91381608c6
src/3rdparty/webkit/Source/ThirdParty/gyp/pylib/gyp/generator/make.py
python
StringToMakefileVariable
(string)
return string.replace(' ', '_')
Convert a string to a value that is acceptable as a make variable name.
Convert a string to a value that is acceptable as a make variable name.
[ "Convert", "a", "string", "to", "a", "value", "that", "is", "acceptable", "as", "a", "make", "variable", "name", "." ]
def StringToMakefileVariable(string): """Convert a string to a value that is acceptable as a make variable name.""" # TODO: replace other metacharacters that we encounter. return string.replace(' ', '_')
[ "def", "StringToMakefileVariable", "(", "string", ")", ":", "# TODO: replace other metacharacters that we encounter.", "return", "string", ".", "replace", "(", "' '", ",", "'_'", ")" ]
https://github.com/qt/qt/blob/0a2f2382541424726168804be2c90b91381608c6/src/3rdparty/webkit/Source/ThirdParty/gyp/pylib/gyp/generator/make.py#L476-L479
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/subprocess.py
python
_args_from_interpreter_flags
()
return args
Return a list of command-line arguments reproducing the current settings in sys.flags, sys.warnoptions and sys._xoptions.
Return a list of command-line arguments reproducing the current settings in sys.flags, sys.warnoptions and sys._xoptions.
[ "Return", "a", "list", "of", "command", "-", "line", "arguments", "reproducing", "the", "current", "settings", "in", "sys", ".", "flags", "sys", ".", "warnoptions", "and", "sys", ".", "_xoptions", "." ]
def _args_from_interpreter_flags(): """Return a list of command-line arguments reproducing the current settings in sys.flags, sys.warnoptions and sys._xoptions.""" flag_opt_map = { 'debug': 'd', # 'inspect': 'i', # 'interactive': 'i', 'dont_write_bytecode': 'B', 'no_s...
[ "def", "_args_from_interpreter_flags", "(", ")", ":", "flag_opt_map", "=", "{", "'debug'", ":", "'d'", ",", "# 'inspect': 'i',", "# 'interactive': 'i',", "'dont_write_bytecode'", ":", "'B'", ",", "'no_site'", ":", "'S'", ",", "'verbose'", ":", "'v'", ",", "'bytes_...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/subprocess.py#L272-L328
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/text_file.py
python
TextFile.readline
(self)
Read and return a single logical line from the current file (or from an internal buffer if lines have previously been "unread" with 'unreadline()'). If the 'join_lines' option is true, this may involve reading multiple physical lines concatenated into a single string. Updat...
Read and return a single logical line from the current file (or from an internal buffer if lines have previously been "unread" with 'unreadline()'). If the 'join_lines' option is true, this may involve reading multiple physical lines concatenated into a single string. Updat...
[ "Read", "and", "return", "a", "single", "logical", "line", "from", "the", "current", "file", "(", "or", "from", "an", "internal", "buffer", "if", "lines", "have", "previously", "been", "unread", "with", "unreadline", "()", ")", ".", "If", "the", "join_line...
def readline (self): """Read and return a single logical line from the current file (or from an internal buffer if lines have previously been "unread" with 'unreadline()'). If the 'join_lines' option is true, this may involve reading multiple physical lines concatenated into a ...
[ "def", "readline", "(", "self", ")", ":", "# If any \"unread\" lines waiting in 'linebuf', return the top", "# one. (We don't actually buffer read-ahead data -- lines only", "# get put in 'linebuf' if the client explicitly does an", "# 'unreadline()'.", "if", "self", ".", "linebuf", ":"...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/text_file.py#L161-L282
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/stc.py
python
StyledTextEvent.GetLength
(*args, **kwargs)
return _stc.StyledTextEvent_GetLength(*args, **kwargs)
GetLength(self) -> int
GetLength(self) -> int
[ "GetLength", "(", "self", ")", "-", ">", "int" ]
def GetLength(*args, **kwargs): """GetLength(self) -> int""" return _stc.StyledTextEvent_GetLength(*args, **kwargs)
[ "def", "GetLength", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextEvent_GetLength", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L7142-L7144
freesurfer/freesurfer
6dbe527d43ffa611acb2cd112e9469f9bfec8e36
python/freesurfer/subfields/brainstem.py
python
BrainstemSubstructures.get_label_groups
(self)
return labelGroups
Return a group (list of lists) of label names that determine the class reductions for the primary image-fitting stage.
Return a group (list of lists) of label names that determine the class reductions for the primary image-fitting stage.
[ "Return", "a", "group", "(", "list", "of", "lists", ")", "of", "label", "names", "that", "determine", "the", "class", "reductions", "for", "the", "primary", "image", "-", "fitting", "stage", "." ]
def get_label_groups(self): """ Return a group (list of lists) of label names that determine the class reductions for the primary image-fitting stage. """ labelGroups = [ ['MAC_Medulla', 'MAC_Pons', 'MAC_Midbrain', 'MAC_Sup_Cerebellum_Ped', 'Left-VentralDC', 'Medulla'...
[ "def", "get_label_groups", "(", "self", ")", ":", "labelGroups", "=", "[", "[", "'MAC_Medulla'", ",", "'MAC_Pons'", ",", "'MAC_Midbrain'", ",", "'MAC_Sup_Cerebellum_Ped'", ",", "'Left-VentralDC'", ",", "'Medulla'", ",", "'Pons'", ",", "'SCP'", ",", "'Midbrain'", ...
https://github.com/freesurfer/freesurfer/blob/6dbe527d43ffa611acb2cd112e9469f9bfec8e36/python/freesurfer/subfields/brainstem.py#L140-L160
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/ipc_messages_log.py
python
_FindMessageHeaderFiles
()
return _ReadLines(pipe.stdout)
Look through the source directory for *_messages.h.
Look through the source directory for *_messages.h.
[ "Look", "through", "the", "source", "directory", "for", "*", "_messages", ".", "h", "." ]
def _FindMessageHeaderFiles(): """Look through the source directory for *_messages.h.""" os.chdir(_SourceDir()) pipe = subprocess.Popen(['git', 'ls-files', '--', '*_messages.h'], stdout=subprocess.PIPE) return _ReadLines(pipe.stdout)
[ "def", "_FindMessageHeaderFiles", "(", ")", ":", "os", ".", "chdir", "(", "_SourceDir", "(", ")", ")", "pipe", "=", "subprocess", ".", "Popen", "(", "[", "'git'", ",", "'ls-files'", ",", "'--'", ",", "'*_messages.h'", "]", ",", "stdout", "=", "subprocess...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/ipc_messages_log.py#L73-L78
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/numpy/logic_ops.py
python
logical_not
(a, dtype=None)
return _apply_tensor_op(F.logical_not, a, dtype=dtype)
Computes the truth value of NOT `a` element-wise. Note: Numpy arguments `out`, `where`, `casting`, `order`, `subok`, `signature`, and `extobj` are not supported. Args: a (Tensor): The input tensor whose dtype is bool. dtype (:class:`mindspore.dtype`, optional): Default: :class:...
Computes the truth value of NOT `a` element-wise.
[ "Computes", "the", "truth", "value", "of", "NOT", "a", "element", "-", "wise", "." ]
def logical_not(a, dtype=None): """ Computes the truth value of NOT `a` element-wise. Note: Numpy arguments `out`, `where`, `casting`, `order`, `subok`, `signature`, and `extobj` are not supported. Args: a (Tensor): The input tensor whose dtype is bool. dtype (:class:`m...
[ "def", "logical_not", "(", "a", ",", "dtype", "=", "None", ")", ":", "return", "_apply_tensor_op", "(", "F", ".", "logical_not", ",", "a", ",", "dtype", "=", "dtype", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/numpy/logic_ops.py#L606-L637
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/model/ik.py
python
objects
(objectives)
Returns a list of all objects touched by the given objective(s). Not currently implemented.
Returns a list of all objects touched by the given objective(s). Not currently implemented.
[ "Returns", "a", "list", "of", "all", "objects", "touched", "by", "the", "given", "objective", "(", "s", ")", ".", "Not", "currently", "implemented", "." ]
def objects(objectives): """Returns a list of all objects touched by the given objective(s). Not currently implemented.""" raise NotImplementedError() pass
[ "def", "objects", "(", "objectives", ")", ":", "raise", "NotImplementedError", "(", ")", "pass" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/model/ik.py#L286-L290
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/clinic/clinic.py
python
CConverter.render
(self, parameter, data)
parameter is a clinic.Parameter instance. data is a CRenderData instance.
parameter is a clinic.Parameter instance. data is a CRenderData instance.
[ "parameter", "is", "a", "clinic", ".", "Parameter", "instance", ".", "data", "is", "a", "CRenderData", "instance", "." ]
def render(self, parameter, data): """ parameter is a clinic.Parameter instance. data is a CRenderData instance. """ self._render_self(parameter, data) self._render_non_self(parameter, data)
[ "def", "render", "(", "self", ",", "parameter", ",", "data", ")", ":", "self", ".", "_render_self", "(", "parameter", ",", "data", ")", "self", ".", "_render_non_self", "(", "parameter", ",", "data", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/clinic/clinic.py#L2434-L2440
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/clang/bindings/python/clang/cindex.py
python
Cursor.underlying_typedef_type
(self)
return self._underlying_type
Return the underlying type of a typedef declaration. Returns a Type for the typedef this cursor is a declaration for. If the current cursor is not a typedef, this raises.
Return the underlying type of a typedef declaration.
[ "Return", "the", "underlying", "type", "of", "a", "typedef", "declaration", "." ]
def underlying_typedef_type(self): """Return the underlying type of a typedef declaration. Returns a Type for the typedef this cursor is a declaration for. If the current cursor is not a typedef, this raises. """ if not hasattr(self, '_underlying_type'): assert self....
[ "def", "underlying_typedef_type", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'_underlying_type'", ")", ":", "assert", "self", ".", "kind", ".", "is_declaration", "(", ")", "self", ".", "_underlying_type", "=", "conf", ".", "lib", "."...
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/clang/bindings/python/clang/cindex.py#L1535-L1546
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
PyApp.FilterEvent
(*args, **kwargs)
return _core_.PyApp_FilterEvent(*args, **kwargs)
FilterEvent(self, Event event) -> int Filters all events. `SetCallFilterEvent` controls whether or not your override is called.
FilterEvent(self, Event event) -> int
[ "FilterEvent", "(", "self", "Event", "event", ")", "-", ">", "int" ]
def FilterEvent(*args, **kwargs): """ FilterEvent(self, Event event) -> int Filters all events. `SetCallFilterEvent` controls whether or not your override is called. """ return _core_.PyApp_FilterEvent(*args, **kwargs)
[ "def", "FilterEvent", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "PyApp_FilterEvent", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L7988-L7995
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_stc.py
python
EditraStc.GotoIndentPos
(self, line=None)
Move the caret to the end of the indentation on the given line. @param line: line to go to
Move the caret to the end of the indentation on the given line. @param line: line to go to
[ "Move", "the", "caret", "to", "the", "end", "of", "the", "indentation", "on", "the", "given", "line", ".", "@param", "line", ":", "line", "to", "go", "to" ]
def GotoIndentPos(self, line=None): """Move the caret to the end of the indentation on the given line. @param line: line to go to """ if line is None: line = self.GetCurrentLine() self.GotoPos(self.GetLineIndentPosition(line))
[ "def", "GotoIndentPos", "(", "self", ",", "line", "=", "None", ")", ":", "if", "line", "is", "None", ":", "line", "=", "self", ".", "GetCurrentLine", "(", ")", "self", ".", "GotoPos", "(", "self", ".", "GetLineIndentPosition", "(", "line", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_stc.py#L571-L579
taichi-dev/taichi
973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6
python/taichi/lang/snode.py
python
SNode.get_children
(self)
return children
Gets all children components of `self`. Returns: List[SNode]: All children components of `self`.
Gets all children components of `self`.
[ "Gets", "all", "children", "components", "of", "self", "." ]
def get_children(self): """Gets all children components of `self`. Returns: List[SNode]: All children components of `self`. """ children = [] for i in range(self.ptr.get_num_ch()): children.append(SNode(self.ptr.get_ch(i))) return children
[ "def", "get_children", "(", "self", ")", ":", "children", "=", "[", "]", "for", "i", "in", "range", "(", "self", ".", "ptr", ".", "get_num_ch", "(", ")", ")", ":", "children", ".", "append", "(", "SNode", "(", "self", ".", "ptr", ".", "get_ch", "...
https://github.com/taichi-dev/taichi/blob/973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6/python/taichi/lang/snode.py#L268-L277
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/_bootstrap_external.py
python
_LoaderBasics.is_package
(self, fullname)
return filename_base == '__init__' and tail_name != '__init__'
Concrete implementation of InspectLoader.is_package by checking if the path returned by get_filename has a filename of '__init__.py'.
Concrete implementation of InspectLoader.is_package by checking if the path returned by get_filename has a filename of '__init__.py'.
[ "Concrete", "implementation", "of", "InspectLoader", ".", "is_package", "by", "checking", "if", "the", "path", "returned", "by", "get_filename", "has", "a", "filename", "of", "__init__", ".", "py", "." ]
def is_package(self, fullname): """Concrete implementation of InspectLoader.is_package by checking if the path returned by get_filename has a filename of '__init__.py'.""" filename = _path_split(self.get_filename(fullname))[1] filename_base = filename.rsplit('.', 1)[0] tail_name ...
[ "def", "is_package", "(", "self", ",", "fullname", ")", ":", "filename", "=", "_path_split", "(", "self", ".", "get_filename", "(", "fullname", ")", ")", "[", "1", "]", "filename_base", "=", "filename", ".", "rsplit", "(", "'.'", ",", "1", ")", "[", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/_bootstrap_external.py#L711-L717
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/docutils/nodes.py
python
TreeCopyVisitor.default_visit
(self, node)
Copy the current node, and make it the new acting parent.
Copy the current node, and make it the new acting parent.
[ "Copy", "the", "current", "node", "and", "make", "it", "the", "new", "acting", "parent", "." ]
def default_visit(self, node): """Copy the current node, and make it the new acting parent.""" newnode = node.copy() self.parent.append(newnode) self.parent_stack.append(self.parent) self.parent = newnode
[ "def", "default_visit", "(", "self", ",", "node", ")", ":", "newnode", "=", "node", ".", "copy", "(", ")", "self", ".", "parent", ".", "append", "(", "newnode", ")", "self", ".", "parent_stack", ".", "append", "(", "self", ".", "parent", ")", "self",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/nodes.py#L1992-L1997
moderngl/moderngl
32fe79927e02b0fa893b3603d677bdae39771e14
moderngl/program.py
python
Program.__iter__
(self)
Yields the internal members names as strings. This includes all members such as uniforms, attributes etc. Example:: # Print member information for name in program: member = program[name] print(name, type(member), member) Output:: ...
Yields the internal members names as strings. This includes all members such as uniforms, attributes etc.
[ "Yields", "the", "internal", "members", "names", "as", "strings", ".", "This", "includes", "all", "members", "such", "as", "uniforms", "attributes", "etc", "." ]
def __iter__(self) -> Generator[str, None, None]: """Yields the internal members names as strings. This includes all members such as uniforms, attributes etc. Example:: # Print member information for name in program: member = program[name] ...
[ "def", "__iter__", "(", "self", ")", "->", "Generator", "[", "str", ",", "None", ",", "None", "]", ":", "yield", "from", "self", ".", "_members" ]
https://github.com/moderngl/moderngl/blob/32fe79927e02b0fa893b3603d677bdae39771e14/moderngl/program.py#L108-L145
baidu/tera
dbcd28af792d879d961bf9fc7eb60de81b437646
src/sdk/python/TeraSdk.py
python
Table.PutInt64
(self, rowkey, cf, qu, value)
类同Put()方法,区别是这里的参数value可以是一个数字(能够用int64表示)计数器 Args: rowkey(string): Rowkey的值 cf(string): ColumnFamily名 qu(string): Qualifier名 value(long): cell的数值,能够用int64表示 Raises: TeraSdkException: 写操作失败
类同Put()方法,区别是这里的参数value可以是一个数字(能够用int64表示)计数器
[ "类同Put", "()", "方法,区别是这里的参数value可以是一个数字(能够用int64表示)计数器" ]
def PutInt64(self, rowkey, cf, qu, value): """ 类同Put()方法,区别是这里的参数value可以是一个数字(能够用int64表示)计数器 Args: rowkey(string): Rowkey的值 cf(string): ColumnFamily名 qu(string): Qualifier名 value(long): cell的数值,能够用int64表示 Raises: TeraSdkException: 写操作失...
[ "def", "PutInt64", "(", "self", ",", "rowkey", ",", "cf", ",", "qu", ",", "value", ")", ":", "err", "=", "c_char_p", "(", ")", "result", "=", "lib", ".", "tera_table_putint64", "(", "self", ".", "table", ",", "rowkey", ",", "c_uint64", "(", "len", ...
https://github.com/baidu/tera/blob/dbcd28af792d879d961bf9fc7eb60de81b437646/src/sdk/python/TeraSdk.py#L627-L644
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/config.py
python
ConfigHandler._parse_section_to_dict
(cls, section_options, values_parser=None)
return value
Parses section options into a dictionary. Optionally applies a given parser to values. :param dict section_options: :param callable values_parser: :rtype: dict
Parses section options into a dictionary.
[ "Parses", "section", "options", "into", "a", "dictionary", "." ]
def _parse_section_to_dict(cls, section_options, values_parser=None): """Parses section options into a dictionary. Optionally applies a given parser to values. :param dict section_options: :param callable values_parser: :rtype: dict """ value = {} values...
[ "def", "_parse_section_to_dict", "(", "cls", ",", "section_options", ",", "values_parser", "=", "None", ")", ":", "value", "=", "{", "}", "values_parser", "=", "values_parser", "or", "(", "lambda", "val", ":", "val", ")", "for", "key", ",", "(", "_", ","...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/config.py#L418-L431
gnina/gnina
b9ae032f52fc7a8153987bde09c0efa3620d8bb6
caffe/scripts/cpp_lint.py
python
IsCppString
(line)
return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1
Does line terminate so, that the next symbol is in string constant. This function does not consider single-line nor multi-line comments. Args: line: is a partial line of code starting from the 0..n. Returns: True, if next character appended to 'line' is inside a string constant.
Does line terminate so, that the next symbol is in string constant.
[ "Does", "line", "terminate", "so", "that", "the", "next", "symbol", "is", "in", "string", "constant", "." ]
def IsCppString(line): """Does line terminate so, that the next symbol is in string constant. This function does not consider single-line nor multi-line comments. Args: line: is a partial line of code starting from the 0..n. Returns: True, if next character appended to 'line' is inside a string c...
[ "def", "IsCppString", "(", "line", ")", ":", "line", "=", "line", ".", "replace", "(", "r'\\\\'", ",", "'XX'", ")", "# after this, \\\\\" does not match to \\\"", "return", "(", "(", "line", ".", "count", "(", "'\"'", ")", "-", "line", ".", "count", "(", ...
https://github.com/gnina/gnina/blob/b9ae032f52fc7a8153987bde09c0efa3620d8bb6/caffe/scripts/cpp_lint.py#L1049-L1063
NVIDIAGameWorks/kaolin
e5148d05e9c1e2ce92a07881ce3593b1c5c3f166
kaolin/visualize/timelapse.py
python
TimelapseParser.parse_filepath_info
(filepaths)
return result
Parses a directory of checkpoints written by Timelapse module into a summary format. Args: filepaths: dictionary output by get_filepaths Returns: dictionary keyed by checkpoint type ("mesh", "pointcloud", "voxelgrid") with each value a list of (serializabl...
Parses a directory of checkpoints written by Timelapse module into a summary format.
[ "Parses", "a", "directory", "of", "checkpoints", "written", "by", "Timelapse", "module", "into", "a", "summary", "format", "." ]
def parse_filepath_info(filepaths): """Parses a directory of checkpoints written by Timelapse module into a summary format. Args: filepaths: dictionary output by get_filepaths Returns: dictionary keyed by checkpoint type ("mesh", "pointcloud", "voxelgrid") ...
[ "def", "parse_filepath_info", "(", "filepaths", ")", ":", "info", "=", "{", "}", "# { \"mesh\" : { \"category\": CategoryInfo} }", "for", "k", ",", "fpath", "in", "filepaths", ".", "items", "(", ")", ":", "stage", "=", "Usd", ".", "Stage", ".", "Open", "(", ...
https://github.com/NVIDIAGameWorks/kaolin/blob/e5148d05e9c1e2ce92a07881ce3593b1c5c3f166/kaolin/visualize/timelapse.py#L371-L408
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
samples/networking/04-distributed-model/AIRepository.py
python
AIRepository.lostConnection
(self)
This should be overridden by a derived class to handle an unexpectedly lost connection to the gameserver.
This should be overridden by a derived class to handle an unexpectedly lost connection to the gameserver.
[ "This", "should", "be", "overridden", "by", "a", "derived", "class", "to", "handle", "an", "unexpectedly", "lost", "connection", "to", "the", "gameserver", "." ]
def lostConnection(self): """ This should be overridden by a derived class to handle an unexpectedly lost connection to the gameserver. """ exit()
[ "def", "lostConnection", "(", "self", ")", ":", "exit", "(", ")" ]
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/samples/networking/04-distributed-model/AIRepository.py#L53-L56
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/showbase/ShowBase.py
python
ShowBase.enableAllAudio
(self)
Reenables the SFX and music managers that were active at the time `disableAllAudio()` was called. Meant to be called when the app regains audio focus.
Reenables the SFX and music managers that were active at the time `disableAllAudio()` was called. Meant to be called when the app regains audio focus.
[ "Reenables", "the", "SFX", "and", "music", "managers", "that", "were", "active", "at", "the", "time", "disableAllAudio", "()", "was", "called", ".", "Meant", "to", "be", "called", "when", "the", "app", "regains", "audio", "focus", "." ]
def enableAllAudio(self): """ Reenables the SFX and music managers that were active at the time `disableAllAudio()` was called. Meant to be called when the app regains audio focus. """ self.AppHasAudioFocus = 1 self.SetAllSfxEnables(self.sfxActive) if sel...
[ "def", "enableAllAudio", "(", "self", ")", ":", "self", ".", "AppHasAudioFocus", "=", "1", "self", ".", "SetAllSfxEnables", "(", "self", ".", "sfxActive", ")", "if", "self", ".", "musicManagerIsValid", ":", "self", ".", "musicManager", ".", "setActive", "(",...
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/showbase/ShowBase.py#L2020-L2030
nest/nest-simulator
f2623eb78518cdbd55e77e0ed486bf1111bcb62f
pynest/nest/lib/hl_api_spatial.py
python
FindCenterElement
(layer)
return layer[index:index+1]
Return `NodeCollection` of node closest to center of `layer`. Parameters ---------- layer : NodeCollection `NodeCollection` with spatially distributed node IDs Returns ------- NodeCollection: `NodeCollection` of the node closest to the center of the `layer`, as specified by `la...
Return `NodeCollection` of node closest to center of `layer`.
[ "Return", "NodeCollection", "of", "node", "closest", "to", "center", "of", "layer", "." ]
def FindCenterElement(layer): """ Return `NodeCollection` of node closest to center of `layer`. Parameters ---------- layer : NodeCollection `NodeCollection` with spatially distributed node IDs Returns ------- NodeCollection: `NodeCollection` of the node closest to the ...
[ "def", "FindCenterElement", "(", "layer", ")", ":", "if", "not", "isinstance", "(", "layer", ",", "NodeCollection", ")", ":", "raise", "TypeError", "(", "\"layer must be a NodeCollection\"", ")", "nearest_to_center", "=", "FindNearestElement", "(", "layer", ",", "...
https://github.com/nest/nest-simulator/blob/f2623eb78518cdbd55e77e0ed486bf1111bcb62f/pynest/nest/lib/hl_api_spatial.py#L615-L653
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryILLPolarizationCor.py
python
ReflectometryILLPolarizationCor._flipperConfiguration
(self, wss)
return '00, 01, 10, 11'
Return flipper configuration string and reorder wss for PolarizationEfficiencyCor compatibility.
Return flipper configuration string and reorder wss for PolarizationEfficiencyCor compatibility.
[ "Return", "flipper", "configuration", "string", "and", "reorder", "wss", "for", "PolarizationEfficiencyCor", "compatibility", "." ]
def _flipperConfiguration(self, wss): """Return flipper configuration string and reorder wss for PolarizationEfficiencyCor compatibility.""" if len(wss) == 1: # It's direct beam. self.log().notice('Performing direct beam polarization corrections.') return '0' ...
[ "def", "_flipperConfiguration", "(", "self", ",", "wss", ")", ":", "if", "len", "(", "wss", ")", "==", "1", ":", "# It's direct beam.", "self", ".", "log", "(", ")", ".", "notice", "(", "'Performing direct beam polarization corrections.'", ")", "return", "'0'"...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryILLPolarizationCor.py#L138-L201
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/autograd/function.py
python
FunctionCtx.mark_non_differentiable
(self, *args: torch.Tensor)
r"""Marks outputs as non-differentiable. **This should be called at most once, only from inside the** :func:`forward` **method, and all arguments should be tensor outputs.** This will mark outputs as not requiring gradients, increasing the efficiency of backward computation. You still ...
r"""Marks outputs as non-differentiable.
[ "r", "Marks", "outputs", "as", "non", "-", "differentiable", "." ]
def mark_non_differentiable(self, *args: torch.Tensor): r"""Marks outputs as non-differentiable. **This should be called at most once, only from inside the** :func:`forward` **method, and all arguments should be tensor outputs.** This will mark outputs as not requiring gradients, incre...
[ "def", "mark_non_differentiable", "(", "self", ",", "*", "args", ":", "torch", ".", "Tensor", ")", ":", "self", ".", "non_differentiable", "=", "args" ]
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/autograd/function.py#L152-L182
NVlabs/fermat
06e8c03ac59ab440cbb13897f90631ef1861e769
contrib/assimp-4.1.0/port/PyAssimp/pyassimp/core.py
python
load
(filename, file_type = None, processing = postprocess.aiProcess_Triangulate)
return scene
Load a model into a scene. On failure throws AssimpError. Arguments --------- filename: Either a filename or a file object to load model from. If a file object is passed, file_type MUST be specified Otherwise Assimp has no idea which importer to use. This i...
Load a model into a scene. On failure throws AssimpError.
[ "Load", "a", "model", "into", "a", "scene", ".", "On", "failure", "throws", "AssimpError", "." ]
def load(filename, file_type = None, processing = postprocess.aiProcess_Triangulate): ''' Load a model into a scene. On failure throws AssimpError. Arguments --------- filename: Either a filename or a file object to load model from. If a file object is passed, f...
[ "def", "load", "(", "filename", ",", "file_type", "=", "None", ",", "processing", "=", "postprocess", ".", "aiProcess_Triangulate", ")", ":", "if", "hasattr", "(", "filename", ",", "'read'", ")", ":", "'''\n This is the case where a file object has been passed ...
https://github.com/NVlabs/fermat/blob/06e8c03ac59ab440cbb13897f90631ef1861e769/contrib/assimp-4.1.0/port/PyAssimp/pyassimp/core.py#L272-L321
nodejs/nan
8db8c8f544f2b6ce1b0859ef6ecdd0a3873a9e62
cpplint.py
python
_IsSourceExtension
(s)
return s in GetNonHeaderExtensions()
File extension (excluding dot) matches a source file extension.
File extension (excluding dot) matches a source file extension.
[ "File", "extension", "(", "excluding", "dot", ")", "matches", "a", "source", "file", "extension", "." ]
def _IsSourceExtension(s): """File extension (excluding dot) matches a source file extension.""" return s in GetNonHeaderExtensions()
[ "def", "_IsSourceExtension", "(", "s", ")", ":", "return", "s", "in", "GetNonHeaderExtensions", "(", ")" ]
https://github.com/nodejs/nan/blob/8db8c8f544f2b6ce1b0859ef6ecdd0a3873a9e62/cpplint.py#L832-L834
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/_backport/shutil.py
python
get_unpack_formats
()
return formats
Returns a list of supported formats for unpacking. Each element of the returned sequence is a tuple (name, extensions, description)
Returns a list of supported formats for unpacking.
[ "Returns", "a", "list", "of", "supported", "formats", "for", "unpacking", "." ]
def get_unpack_formats(): """Returns a list of supported formats for unpacking. Each element of the returned sequence is a tuple (name, extensions, description) """ formats = [(name, info[0], info[3]) for name, info in _UNPACK_FORMATS.items()] formats.sort() return formats
[ "def", "get_unpack_formats", "(", ")", ":", "formats", "=", "[", "(", "name", ",", "info", "[", "0", "]", ",", "info", "[", "3", "]", ")", "for", "name", ",", "info", "in", "_UNPACK_FORMATS", ".", "items", "(", ")", "]", "formats", ".", "sort", "...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/_backport/shutil.py#L599-L608
verilog-to-routing/vtr-verilog-to-routing
d9719cf7374821156c3cee31d66991cb85578562
vtr_flow/scripts/python_libs/vtr/log_parse.py
python
PassRequirement.type
(self)
Return the type of requirement checking
Return the type of requirement checking
[ "Return", "the", "type", "of", "requirement", "checking" ]
def type(self): """Return the type of requirement checking"""
[ "def", "type", "(", "self", ")", ":" ]
https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/d9719cf7374821156c3cee31d66991cb85578562/vtr_flow/scripts/python_libs/vtr/log_parse.py#L58-L59
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py
python
Babyl._install_message
(self, message)
return (start, stop)
Write message contents and return (start, stop).
Write message contents and return (start, stop).
[ "Write", "message", "contents", "and", "return", "(", "start", "stop", ")", "." ]
def _install_message(self, message): """Write message contents and return (start, stop).""" start = self._file.tell() if isinstance(message, BabylMessage): special_labels = [] labels = [] for label in message.get_labels(): if label in self._spe...
[ "def", "_install_message", "(", "self", ",", "message", ")", ":", "start", "=", "self", ".", "_file", ".", "tell", "(", ")", "if", "isinstance", "(", "message", ",", "BabylMessage", ")", ":", "special_labels", "=", "[", "]", "labels", "=", "[", "]", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py#L1350-L1436
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/richtext.py
python
RichTextObject.DrawBoxAttributes
(*args, **kwargs)
return _richtext.RichTextObject_DrawBoxAttributes(*args, **kwargs)
DrawBoxAttributes(DC dc, RichTextBuffer buffer, RichTextAttr attr, Rect boxRect, int flags=0) -> bool
DrawBoxAttributes(DC dc, RichTextBuffer buffer, RichTextAttr attr, Rect boxRect, int flags=0) -> bool
[ "DrawBoxAttributes", "(", "DC", "dc", "RichTextBuffer", "buffer", "RichTextAttr", "attr", "Rect", "boxRect", "int", "flags", "=", "0", ")", "-", ">", "bool" ]
def DrawBoxAttributes(*args, **kwargs): """ DrawBoxAttributes(DC dc, RichTextBuffer buffer, RichTextAttr attr, Rect boxRect, int flags=0) -> bool """ return _richtext.RichTextObject_DrawBoxAttributes(*args, **kwargs)
[ "def", "DrawBoxAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextObject_DrawBoxAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L1408-L1413
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/trade.py
python
Trade.home_notional
(self, home_notional)
Sets the home_notional of this Trade. :param home_notional: The home_notional of this Trade. # noqa: E501 :type: float
Sets the home_notional of this Trade.
[ "Sets", "the", "home_notional", "of", "this", "Trade", "." ]
def home_notional(self, home_notional): """Sets the home_notional of this Trade. :param home_notional: The home_notional of this Trade. # noqa: E501 :type: float """ self._home_notional = home_notional
[ "def", "home_notional", "(", "self", ",", "home_notional", ")", ":", "self", ".", "_home_notional", "=", "home_notional" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/trade.py#L276-L284
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ipaddress.py
python
IPv6Address.teredo
(self)
return (IPv4Address((self._ip >> 64) & 0xFFFFFFFF), IPv4Address(~self._ip & 0xFFFFFFFF))
Tuple of embedded teredo IPs. Returns: Tuple of the (server, client) IPs or None if the address doesn't appear to be a teredo address (doesn't start with 2001::/32)
Tuple of embedded teredo IPs.
[ "Tuple", "of", "embedded", "teredo", "IPs", "." ]
def teredo(self): """Tuple of embedded teredo IPs. Returns: Tuple of the (server, client) IPs or None if the address doesn't appear to be a teredo address (doesn't start with 2001::/32) """ if (self._ip >> 96) != 0x20010000: return None ...
[ "def", "teredo", "(", "self", ")", ":", "if", "(", "self", ".", "_ip", ">>", "96", ")", "!=", "0x20010000", ":", "return", "None", "return", "(", "IPv4Address", "(", "(", "self", ".", "_ip", ">>", "64", ")", "&", "0xFFFFFFFF", ")", ",", "IPv4Addres...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ipaddress.py#L2023-L2035