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
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/SANS/isis_reduction_steps.py
python
TransmissionCalc._get_run_wksps
(self, reducer)
return reducer.get_transmissions()
Retrieves the names runs that contain the user specified for calculation of the transmission @return: post_sample pre_sample workspace names
Retrieves the names runs that contain the user specified for calculation of the transmission
[ "Retrieves", "the", "names", "runs", "that", "contain", "the", "user", "specified", "for", "calculation", "of", "the", "transmission" ]
def _get_run_wksps(self, reducer): """ Retrieves the names runs that contain the user specified for calculation of the transmission @return: post_sample pre_sample workspace names """ return reducer.get_transmissions()
[ "def", "_get_run_wksps", "(", "self", ",", "reducer", ")", ":", "return", "reducer", ".", "get_transmissions", "(", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/isis_reduction_steps.py#L2251-L2257
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/distutils/command/check.py
python
check.initialize_options
(self)
Sets default values for options.
Sets default values for options.
[ "Sets", "default", "values", "for", "options", "." ]
def initialize_options(self): """Sets default values for options.""" self.restructuredtext = 0 self.metadata = 1 self.strict = 0 self._warnings = 0
[ "def", "initialize_options", "(", "self", ")", ":", "self", ".", "restructuredtext", "=", "0", "self", ".", "metadata", "=", "1", "self", ".", "strict", "=", "0", "self", ".", "_warnings", "=", "0" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/distutils/command/check.py#L48-L53
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/backward.py
python
_append_backward_ops_
(block, ops, target_block, no_grad_dict, grad_to_var, callbacks=None, input_grad_names_set=None, op_path_dict=None, ...
Create all grad ops, and insert them into given block Args: block(Block): the block where forward ops are ops(Op): the forward operators whose backward ops need to be added target_block(Block): the block which is going to hold new generated grad ops no_grad_dict(dict): k...
Create all grad ops, and insert them into given block
[ "Create", "all", "grad", "ops", "and", "insert", "them", "into", "given", "block" ]
def _append_backward_ops_(block, ops, target_block, no_grad_dict, grad_to_var, callbacks=None, input_grad_names_set=None, op_path_dict=Non...
[ "def", "_append_backward_ops_", "(", "block", ",", "ops", ",", "target_block", ",", "no_grad_dict", ",", "grad_to_var", ",", "callbacks", "=", "None", ",", "input_grad_names_set", "=", "None", ",", "op_path_dict", "=", "None", ",", "distop_context", "=", "None",...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/backward.py#L1047-L1212
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/model.py
python
ServiceModel.__init__
(self, service_description, service_name=None)
:type service_description: dict :param service_description: The service description model. This value is obtained from a botocore.loader.Loader, or from directly loading the file yourself:: service_description = json.load( open('/path/to/service-desc...
[]
def __init__(self, service_description, service_name=None): """ :type service_description: dict :param service_description: The service description model. This value is obtained from a botocore.loader.Loader, or from directly loading the file yourself:: ...
[ "def", "__init__", "(", "self", ",", "service_description", ",", "service_name", "=", "None", ")", ":", "self", ".", "_service_description", "=", "service_description", "# We want clients to be able to access metadata directly.", "self", ".", "metadata", "=", "service_des...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/model.py#L227-L255
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/aui/auibar.py
python
AuiToolBar.AddStretchSpacer
(self, proportion=1)
return self._items[-1]
Adds a stretchable spacer for spacing groups of tools. :param integer `proportion`: the stretchable spacer proportion.
Adds a stretchable spacer for spacing groups of tools.
[ "Adds", "a", "stretchable", "spacer", "for", "spacing", "groups", "of", "tools", "." ]
def AddStretchSpacer(self, proportion=1): """ Adds a stretchable spacer for spacing groups of tools. :param integer `proportion`: the stretchable spacer proportion. """ item = AuiToolBarItem() item.window = None item.label = "" item.bitmap = wx.N...
[ "def", "AddStretchSpacer", "(", "self", ",", "proportion", "=", "1", ")", ":", "item", "=", "AuiToolBarItem", "(", ")", "item", ".", "window", "=", "None", "item", ".", "label", "=", "\"\"", "item", ".", "bitmap", "=", "wx", ".", "NullBitmap", "item", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibar.py#L1985-L2011
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/core/fromnumeric.py
python
ravel
(a, order='C')
Return a contiguous flattened array. A 1-D array, containing the elements of the input, is returned. A copy is made only if needed. As of NumPy 1.10, the returned array will have the same type as the input array. (for example, a masked array will be returned for a masked array input) Paramet...
Return a contiguous flattened array.
[ "Return", "a", "contiguous", "flattened", "array", "." ]
def ravel(a, order='C'): """Return a contiguous flattened array. A 1-D array, containing the elements of the input, is returned. A copy is made only if needed. As of NumPy 1.10, the returned array will have the same type as the input array. (for example, a masked array will be returned for a mask...
[ "def", "ravel", "(", "a", ",", "order", "=", "'C'", ")", ":", "if", "isinstance", "(", "a", ",", "np", ".", "matrix", ")", ":", "return", "asarray", "(", "a", ")", ".", "ravel", "(", "order", "=", "order", ")", "else", ":", "return", "asanyarray"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/core/fromnumeric.py#L1694-L1797
grpc/grpc
27bc6fe7797e43298dc931b96dc57322d0852a9f
src/python/grpcio/grpc/_channel.py
python
_InactiveRpcError.cancelled
(self)
return False
See grpc.Future.cancelled.
See grpc.Future.cancelled.
[ "See", "grpc", ".", "Future", ".", "cancelled", "." ]
def cancelled(self): """See grpc.Future.cancelled.""" return False
[ "def", "cancelled", "(", "self", ")", ":", "return", "False" ]
https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/grpc/_channel.py#L329-L331
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/ops/init_ops.py
python
_RandomWalkInitializer.__init__
(self, nonlinearity, seed=None)
Construct a RandomWalkInitializer. Args: nonlinearity: the python tensorflow function that computes a nonlinearity in the graph, typically after a Wx+b type operation. seed: A Python integer. Used to create random seeds. See [`set_random_seed`](../../api_docs/python/constant_op.md#set_ran...
Construct a RandomWalkInitializer.
[ "Construct", "a", "RandomWalkInitializer", "." ]
def __init__(self, nonlinearity, seed=None): """Construct a RandomWalkInitializer. Args: nonlinearity: the python tensorflow function that computes a nonlinearity in the graph, typically after a Wx+b type operation. seed: A Python integer. Used to create random seeds. See [`set_random...
[ "def", "__init__", "(", "self", ",", "nonlinearity", ",", "seed", "=", "None", ")", ":", "self", ".", "_nonlinearity", "=", "nonlinearity", "self", ".", "_seed", "=", "seed" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/init_ops.py#L256-L267
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Arch/ArchFloor.py
python
_CommandFloor.IsActive
(self)
return not FreeCAD.ActiveDocument is None
Determine whether or not the Arch Floor tool is active. Inactive commands are indicated by a greyed-out icon in the menus and toolbars.
Determine whether or not the Arch Floor tool is active.
[ "Determine", "whether", "or", "not", "the", "Arch", "Floor", "tool", "is", "active", "." ]
def IsActive(self): """Determine whether or not the Arch Floor tool is active. Inactive commands are indicated by a greyed-out icon in the menus and toolbars. """ return not FreeCAD.ActiveDocument is None
[ "def", "IsActive", "(", "self", ")", ":", "return", "not", "FreeCAD", ".", "ActiveDocument", "is", "None" ]
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchFloor.py#L116-L122
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/jinja2/runtime.py
python
Context.get
(self, key, default=None)
Returns an item from the template context, if it doesn't exist `default` is returned.
Returns an item from the template context, if it doesn't exist `default` is returned.
[ "Returns", "an", "item", "from", "the", "template", "context", "if", "it", "doesn", "t", "exist", "default", "is", "returned", "." ]
def get(self, key, default=None): """Returns an item from the template context, if it doesn't exist `default` is returned. """ try: return self[key] except KeyError: return default
[ "def", "get", "(", "self", ",", "key", ",", "default", "=", "None", ")", ":", "try", ":", "return", "self", "[", "key", "]", "except", "KeyError", ":", "return", "default" ]
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/jinja2/runtime.py#L137-L144
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/zipfile.py
python
ZipInfo.FileHeader
(self, zip64=None)
return header + filename + extra
Return the per-file header as a bytes object.
Return the per-file header as a bytes object.
[ "Return", "the", "per", "-", "file", "header", "as", "a", "bytes", "object", "." ]
def FileHeader(self, zip64=None): """Return the per-file header as a bytes object.""" dt = self.date_time dosdate = (dt[0] - 1980) << 9 | dt[1] << 5 | dt[2] dostime = dt[3] << 11 | dt[4] << 5 | (dt[5] // 2) if self.flag_bits & 0x08: # Set these to zero because we writ...
[ "def", "FileHeader", "(", "self", ",", "zip64", "=", "None", ")", ":", "dt", "=", "self", ".", "date_time", "dosdate", "=", "(", "dt", "[", "0", "]", "-", "1980", ")", "<<", "9", "|", "dt", "[", "1", "]", "<<", "5", "|", "dt", "[", "2", "]"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/zipfile.py#L404-L448
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py
python
_GetXcodeEnv
( xcode_settings, built_products_dir, srcroot, configuration, additional_settings=None )
return additional_settings
Return the environment variables that Xcode would set. See http://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW153 for a full list. Args: xcode_settings: An XcodeSettings ob...
Return the environment variables that Xcode would set. See http://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW153 for a full list.
[ "Return", "the", "environment", "variables", "that", "Xcode", "would", "set", ".", "See", "http", ":", "//", "developer", ".", "apple", ".", "com", "/", "library", "/", "mac", "/", "#documentation", "/", "DeveloperTools", "/", "Reference", "/", "XcodeBuildSe...
def _GetXcodeEnv( xcode_settings, built_products_dir, srcroot, configuration, additional_settings=None ): """Return the environment variables that Xcode would set. See http://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_re...
[ "def", "_GetXcodeEnv", "(", "xcode_settings", ",", "built_products_dir", ",", "srcroot", ",", "configuration", ",", "additional_settings", "=", "None", ")", ":", "if", "not", "xcode_settings", ":", "return", "{", "}", "# This function is considered a friend of XcodeSett...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py#L1705-L1817
bareos/bareos
56a10bb368b0a81e977bb51304033fe49d59efb0
contrib/dir-plugins/nagios_icinga/BareosDirPluginNscaSender.py
python
BareosDirPluginNscaSender.handle_plugin_event
(self, context, event)
return bRCs['bRC_OK']
This method is calle for every registered event
This method is calle for every registered event
[ "This", "method", "is", "calle", "for", "every", "registered", "event" ]
def handle_plugin_event(self, context, event): ''' This method is calle for every registered event ''' # We first call the method from our superclass to get job attributes read super(BareosDirPluginNscaSender, self).handle_plugin_event(context, event) if event == bDirEv...
[ "def", "handle_plugin_event", "(", "self", ",", "context", ",", "event", ")", ":", "# We first call the method from our superclass to get job attributes read", "super", "(", "BareosDirPluginNscaSender", ",", "self", ")", ".", "handle_plugin_event", "(", "context", ",", "e...
https://github.com/bareos/bareos/blob/56a10bb368b0a81e977bb51304033fe49d59efb0/contrib/dir-plugins/nagios_icinga/BareosDirPluginNscaSender.py#L68-L81
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/optimizer_v2/utils.py
python
all_reduce_sum_gradients
(grads_and_vars)
return reduced_with_nones
Returns all-reduced gradients aggregated via summation. Args: grads_and_vars: List of (gradient, variable) pairs. Returns: List of (gradient, variable) pairs where gradients have been all-reduced.
Returns all-reduced gradients aggregated via summation.
[ "Returns", "all", "-", "reduced", "gradients", "aggregated", "via", "summation", "." ]
def all_reduce_sum_gradients(grads_and_vars): """Returns all-reduced gradients aggregated via summation. Args: grads_and_vars: List of (gradient, variable) pairs. Returns: List of (gradient, variable) pairs where gradients have been all-reduced. """ grads_and_vars = list(grads_and_vars) filtered_g...
[ "def", "all_reduce_sum_gradients", "(", "grads_and_vars", ")", ":", "grads_and_vars", "=", "list", "(", "grads_and_vars", ")", "filtered_grads_and_vars", "=", "filter_empty_gradients", "(", "grads_and_vars", ")", "if", "filtered_grads_and_vars", ":", "if", "strategy_suppo...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/optimizer_v2/utils.py#L24-L56
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
sdhash-ui/cherrypy/_cptools.py
python
CachingTool._setup
(self)
Hook caching into cherrypy.request.
Hook caching into cherrypy.request.
[ "Hook", "caching", "into", "cherrypy", ".", "request", "." ]
def _setup(self): """Hook caching into cherrypy.request.""" conf = self._merged_args() p = conf.pop("priority", None) cherrypy.serving.request.hooks.attach('before_handler', self._wrapper, priority=p, **conf)
[ "def", "_setup", "(", "self", ")", ":", "conf", "=", "self", ".", "_merged_args", "(", ")", "p", "=", "conf", ".", "pop", "(", "\"priority\"", ",", "None", ")", "cherrypy", ".", "serving", ".", "request", ".", "hooks", ".", "attach", "(", "'before_ha...
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/_cptools.py#L403-L409
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/general_fitting/general_fitting_options_view.py
python
GeneralFittingOptionsView.setup_fit_by_specifier
(self, choices: list)
Setup the fit by specifier combo box.
Setup the fit by specifier combo box.
[ "Setup", "the", "fit", "by", "specifier", "combo", "box", "." ]
def setup_fit_by_specifier(self, choices: list) -> None: """Setup the fit by specifier combo box.""" self.simul_fit_by_specifier.blockSignals(True) self.simul_fit_by_specifier.clear() self.simul_fit_by_specifier.addItems(choices) self.simul_fit_by_specifier.blockSignals(False) ...
[ "def", "setup_fit_by_specifier", "(", "self", ",", "choices", ":", "list", ")", "->", "None", ":", "self", ".", "simul_fit_by_specifier", ".", "blockSignals", "(", "True", ")", "self", ".", "simul_fit_by_specifier", ".", "clear", "(", ")", "self", ".", "simu...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/general_fitting/general_fitting_options_view.py#L88-L94
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/setuptools/_vendor/packaging/tags.py
python
compatible_tags
( python_version: Optional[PythonVersion] = None, interpreter: Optional[str] = None, platforms: Optional[Iterable[str]] = None, )
Yields the sequence of tags that are compatible with a specific version of Python. The tags consist of: - py*-none-<platform> - <interpreter>-none-any # ... if `interpreter` is provided. - py*-none-any
Yields the sequence of tags that are compatible with a specific version of Python.
[ "Yields", "the", "sequence", "of", "tags", "that", "are", "compatible", "with", "a", "specific", "version", "of", "Python", "." ]
def compatible_tags( python_version: Optional[PythonVersion] = None, interpreter: Optional[str] = None, platforms: Optional[Iterable[str]] = None, ) -> Iterator[Tag]: """ Yields the sequence of tags that are compatible with a specific version of Python. The tags consist of: - py*-none-<plat...
[ "def", "compatible_tags", "(", "python_version", ":", "Optional", "[", "PythonVersion", "]", "=", "None", ",", "interpreter", ":", "Optional", "[", "str", "]", "=", "None", ",", "platforms", ":", "Optional", "[", "Iterable", "[", "str", "]", "]", "=", "N...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_vendor/packaging/tags.py#L278-L300
notepadqq/notepadqq
d8000f256a516aa958d50bfcc19605dc296fbeb2
.travis/tools/macdeployqtfix/macdeployqtfix.py
python
fix_binary
(binary)
return True
input: binary: relative or absolute path (no @executable_path syntax) process: - first fix the rpath for the qt libs on which 'binary' depend - copy into the bundle of exepath the eventual libraries that are missing - (create the soft links) needed ? - do the same for a...
input: binary: relative or absolute path (no
[ "input", ":", "binary", ":", "relative", "or", "absolute", "path", "(", "no" ]
def fix_binary(binary): """ input: binary: relative or absolute path (no @executable_path syntax) process: - first fix the rpath for the qt libs on which 'binary' depend - copy into the bundle of exepath the eventual libraries that are missing - (create the soft lin...
[ "def", "fix_binary", "(", "binary", ")", ":", "GlobalConfig", ".", "logger", ".", "debug", "(", "'fix_binary({0})'", ".", "format", "(", "binary", ")", ")", "# loop on 'binary' dependencies", "for", "dep", "in", "get_dependencies", "(", "binary", ")", ":", "if...
https://github.com/notepadqq/notepadqq/blob/d8000f256a516aa958d50bfcc19605dc296fbeb2/.travis/tools/macdeployqtfix/macdeployqtfix.py#L293-L310
apache/qpid-proton
6bcdfebb55ea3554bc29b1901422532db331a591
python/proton/_delivery.py
python
Delivery.updated
(self)
return pn_delivery_updated(self._impl)
``True`` if the state of the delivery has been updated (e.g. it has been settled and/or accepted, rejected etc), ``False`` otherwise.
``True`` if the state of the delivery has been updated (e.g. it has been settled and/or accepted, rejected etc), ``False`` otherwise.
[ "True", "if", "the", "state", "of", "the", "delivery", "has", "been", "updated", "(", "e", ".", "g", ".", "it", "has", "been", "settled", "and", "/", "or", "accepted", "rejected", "etc", ")", "False", "otherwise", "." ]
def updated(self) -> bool: """ ``True`` if the state of the delivery has been updated (e.g. it has been settled and/or accepted, rejected etc), ``False`` otherwise. """ return pn_delivery_updated(self._impl)
[ "def", "updated", "(", "self", ")", "->", "bool", ":", "return", "pn_delivery_updated", "(", "self", ".", "_impl", ")" ]
https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_delivery.py#L344-L350
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/v8/third_party/jinja2/filters.py
python
do_mark_unsafe
(value)
return text_type(value)
Mark a value as unsafe. This is the reverse operation for :func:`safe`.
Mark a value as unsafe. This is the reverse operation for :func:`safe`.
[ "Mark", "a", "value", "as", "unsafe", ".", "This", "is", "the", "reverse", "operation", "for", ":", "func", ":", "safe", "." ]
def do_mark_unsafe(value): """Mark a value as unsafe. This is the reverse operation for :func:`safe`.""" return text_type(value)
[ "def", "do_mark_unsafe", "(", "value", ")", ":", "return", "text_type", "(", "value", ")" ]
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/v8/third_party/jinja2/filters.py#L890-L892
alexgkendall/caffe-posenet
62aafbd7c45df91acdba14f5d1406d8295c2bc6f
scripts/cpp_lint.py
python
CheckAccess
(filename, clean_lines, linenum, nesting_state, error)
Checks for improper use of DISALLOW* macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A _NestingState instance which maintains information about the current stac...
Checks for improper use of DISALLOW* macros.
[ "Checks", "for", "improper", "use", "of", "DISALLOW", "*", "macros", "." ]
def CheckAccess(filename, clean_lines, linenum, nesting_state, error): """Checks for improper use of DISALLOW* macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A _NestingState in...
[ "def", "CheckAccess", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# get rid of comments and strings", "matched", "=", "Match", "(", "(", "r'...
https://github.com/alexgkendall/caffe-posenet/blob/62aafbd7c45df91acdba14f5d1406d8295c2bc6f/scripts/cpp_lint.py#L2486-L2514
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/model/cartesian_trajectory.py
python
cartesian_move_to
(robot,constraints, delta=1e-2, method='any', solver=None, feasibilityTest=None, numSamples=1000, maximize=False)
return cartesian_interpolate_linear(robot,taskStart,taskEnd, delta=delta,method=method,solver=solver,feasibilityTest=feasibilityTest, numSamples=numSamples,maximize=maximize)
A convenience function that generates a path that performs a linear cartesian interpolation starting from the robot's current configuration and ending at the desired IK constraints. This is a bit more convenient than :meth:`cartesian_interpolate_linear` since you only need to pass in the target objecti...
A convenience function that generates a path that performs a linear cartesian interpolation starting from the robot's current configuration and ending at the desired IK constraints.
[ "A", "convenience", "function", "that", "generates", "a", "path", "that", "performs", "a", "linear", "cartesian", "interpolation", "starting", "from", "the", "robot", "s", "current", "configuration", "and", "ending", "at", "the", "desired", "IK", "constraints", ...
def cartesian_move_to(robot,constraints, delta=1e-2, method='any', solver=None, feasibilityTest=None, numSamples=1000, maximize=False): """A convenience function that generates a path that performs a linear cartesian interpolation starting from the robot's current configuration and e...
[ "def", "cartesian_move_to", "(", "robot", ",", "constraints", ",", "delta", "=", "1e-2", ",", "method", "=", "'any'", ",", "solver", "=", "None", ",", "feasibilityTest", "=", "None", ",", "numSamples", "=", "1000", ",", "maximize", "=", "False", ")", ":"...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/model/cartesian_trajectory.py#L916-L952
vigsterkr/libjingle
92dcbb1aac08c35d1c002c4dd7e978528b8173d2
talk/site_scons/site_tools/talk_noops.py
python
generate
(env)
SCons method.
SCons method.
[ "SCons", "method", "." ]
def generate(env): """SCons method.""" if not env.Bit('windows'): builder = SCons.Builder.Builder( action='' ) env.Append(BUILDERS={'RES': builder, 'Grit': builder})
[ "def", "generate", "(", "env", ")", ":", "if", "not", "env", ".", "Bit", "(", "'windows'", ")", ":", "builder", "=", "SCons", ".", "Builder", ".", "Builder", "(", "action", "=", "''", ")", "env", ".", "Append", "(", "BUILDERS", "=", "{", "'RES'", ...
https://github.com/vigsterkr/libjingle/blob/92dcbb1aac08c35d1c002c4dd7e978528b8173d2/talk/site_scons/site_tools/talk_noops.py#L11-L17
GJDuck/LowFat
ecf6a0f0fa1b73a27a626cf493cc39e477b6faea
llvm-4.0.0.src/tools/clang/bindings/python/clang/cindex.py
python
CursorKind.is_unexposed
(self)
return conf.lib.clang_isUnexposed(self)
Test if this is an unexposed kind.
Test if this is an unexposed kind.
[ "Test", "if", "this", "is", "an", "unexposed", "kind", "." ]
def is_unexposed(self): """Test if this is an unexposed kind.""" return conf.lib.clang_isUnexposed(self)
[ "def", "is_unexposed", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_isUnexposed", "(", "self", ")" ]
https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/tools/clang/bindings/python/clang/cindex.py#L633-L635
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/pgen2/conv.py
python
Converter.parse_graminit_c
(self, filename)
Parse the .c file written by pgen. (Internal) The file looks as follows. The first two lines are always this: #include "pgenheaders.h" #include "grammar.h" After that come four blocks: 1) one or more state definitions 2) a table defining dfas 3) a table defi...
Parse the .c file written by pgen. (Internal)
[ "Parse", "the", ".", "c", "file", "written", "by", "pgen", ".", "(", "Internal", ")" ]
def parse_graminit_c(self, filename): """Parse the .c file written by pgen. (Internal) The file looks as follows. The first two lines are always this: #include "pgenheaders.h" #include "grammar.h" After that come four blocks: 1) one or more state definitions ...
[ "def", "parse_graminit_c", "(", "self", ",", "filename", ")", ":", "try", ":", "f", "=", "open", "(", "filename", ")", "except", "IOError", ",", "err", ":", "print", "\"Can't open %s: %s\"", "%", "(", "filename", ",", "err", ")", "return", "False", "# Th...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/pgen2/conv.py#L84-L247
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/urllib/robotparser.py
python
RobotFileParser.mtime
(self)
return self.last_checked
Returns the time the robots.txt file was last fetched. This is useful for long-running web spiders that need to check for new robots.txt files periodically.
Returns the time the robots.txt file was last fetched.
[ "Returns", "the", "time", "the", "robots", ".", "txt", "file", "was", "last", "fetched", "." ]
def mtime(self): """Returns the time the robots.txt file was last fetched. This is useful for long-running web spiders that need to check for new robots.txt files periodically. """ return self.last_checked
[ "def", "mtime", "(", "self", ")", ":", "return", "self", ".", "last_checked" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/urllib/robotparser.py#L36-L43
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/summary/event_accumulator.py
python
EventAccumulator._MaybePurgeOrphanedData
(self, event)
Maybe purge orphaned data due to a TensorFlow crash. When TensorFlow crashes at step T+O and restarts at step T, any events written after step T are now "orphaned" and will be at best misleading if they are included in TensorBoard. This logic attempts to determine if there is orphaned data, and purge ...
Maybe purge orphaned data due to a TensorFlow crash.
[ "Maybe", "purge", "orphaned", "data", "due", "to", "a", "TensorFlow", "crash", "." ]
def _MaybePurgeOrphanedData(self, event): """Maybe purge orphaned data due to a TensorFlow crash. When TensorFlow crashes at step T+O and restarts at step T, any events written after step T are now "orphaned" and will be at best misleading if they are included in TensorBoard. This logic attempts t...
[ "def", "_MaybePurgeOrphanedData", "(", "self", ",", "event", ")", ":", "if", "not", "self", ".", "purge_orphaned_data", ":", "return", "## Check if the event happened after a crash, and purge expired tags.", "if", "self", ".", "file_version", "and", "self", ".", "file_v...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/summary/event_accumulator.py#L380-L403
microsoft/DirectXShaderCompiler
8348ff8d9e0287610ba05d3a828e10af981a1c05
utils/hct/CodeTags.py
python
UpdateEachTaggedLine
(fn, tag='GENERATED_CODE', doc=None, begin=None)
Call fn for each line of text between tag:BEGIN and tag:END
Call fn for each line of text between tag:BEGIN and tag:END
[ "Call", "fn", "for", "each", "line", "of", "text", "between", "tag", ":", "BEGIN", "and", "tag", ":", "END" ]
def UpdateEachTaggedLine(fn, tag='GENERATED_CODE', doc=None, begin=None): "Call fn for each line of text between tag:BEGIN and tag:END" UpdateTaggedLines(lambda lines: map(fn, lines), tag, doc, begin)
[ "def", "UpdateEachTaggedLine", "(", "fn", ",", "tag", "=", "'GENERATED_CODE'", ",", "doc", "=", "None", ",", "begin", "=", "None", ")", ":", "UpdateTaggedLines", "(", "lambda", "lines", ":", "map", "(", "fn", ",", "lines", ")", ",", "tag", ",", "doc", ...
https://github.com/microsoft/DirectXShaderCompiler/blob/8348ff8d9e0287610ba05d3a828e10af981a1c05/utils/hct/CodeTags.py#L114-L116
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/memory_inspector/memory_inspector/classification/native_heap_classifier.py
python
LoadRules
(content)
return rules.Load(content, _NHeapRule)
Loads and parses a native-heap rule tree from a content (string). Returns: An instance of |rules.Rule|, which nodes are |_NHeapRule| instances.
Loads and parses a native-heap rule tree from a content (string).
[ "Loads", "and", "parses", "a", "native", "-", "heap", "rule", "tree", "from", "a", "content", "(", "string", ")", "." ]
def LoadRules(content): """Loads and parses a native-heap rule tree from a content (string). Returns: An instance of |rules.Rule|, which nodes are |_NHeapRule| instances. """ return rules.Load(content, _NHeapRule)
[ "def", "LoadRules", "(", "content", ")", ":", "return", "rules", ".", "Load", "(", "content", ",", "_NHeapRule", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/memory_inspector/memory_inspector/classification/native_heap_classifier.py#L40-L46
freeorion/freeorion
c266a40eccd3a99a17de8fe57c36ef6ba3771665
default/python/common/configure_logging.py
python
_create_narrow_handler
(level)
return h
Create a handler for logger that forwards a single level of log to the appropriate stream in the C++ app.
Create a handler for logger that forwards a single level of log to the appropriate stream in the C++ app.
[ "Create", "a", "handler", "for", "logger", "that", "forwards", "a", "single", "level", "of", "log", "to", "the", "appropriate", "stream", "in", "the", "C", "++", "app", "." ]
def _create_narrow_handler(level): """Create a handler for logger that forwards a single level of log to the appropriate stream in the C++ app.""" h = _LoggerHandler(level) h.setFormatter(FOLogFormatter()) h.addFilter(_SingleLevelFilter(level)) h.setLevel(level) return h
[ "def", "_create_narrow_handler", "(", "level", ")", ":", "h", "=", "_LoggerHandler", "(", "level", ")", "h", ".", "setFormatter", "(", "FOLogFormatter", "(", ")", ")", "h", ".", "addFilter", "(", "_SingleLevelFilter", "(", "level", ")", ")", "h", ".", "s...
https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/common/configure_logging.py#L202-L209
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/pybind/mgr/orchestrator/_interface.py
python
Orchestrator.get_inventory
(self, host_filter: Optional['InventoryFilter'] = None, refresh: bool = False)
Returns something that was created by `ceph-volume inventory`. :return: list of InventoryHost
Returns something that was created by `ceph-volume inventory`.
[ "Returns", "something", "that", "was", "created", "by", "ceph", "-", "volume", "inventory", "." ]
def get_inventory(self, host_filter: Optional['InventoryFilter'] = None, refresh: bool = False) -> OrchResult[List['InventoryHost']]: """ Returns something that was created by `ceph-volume inventory`. :return: list of InventoryHost """ raise NotImplementedError()
[ "def", "get_inventory", "(", "self", ",", "host_filter", ":", "Optional", "[", "'InventoryFilter'", "]", "=", "None", ",", "refresh", ":", "bool", "=", "False", ")", "->", "OrchResult", "[", "List", "[", "'InventoryHost'", "]", "]", ":", "raise", "NotImple...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/orchestrator/_interface.py#L421-L427
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/fsspec/implementations/cached.py
python
CachingFileSystem.close_and_update
(self, f, close)
Called when a file is closing, so store the set of blocks
Called when a file is closing, so store the set of blocks
[ "Called", "when", "a", "file", "is", "closing", "so", "store", "the", "set", "of", "blocks" ]
def close_and_update(self, f, close): """Called when a file is closing, so store the set of blocks""" path = self._strip_protocol(f.path) if not path.startswith(self.target_protocol): store_path = self.target_protocol + "://" + path c = self.cached_files[-1][store_path] ...
[ "def", "close_and_update", "(", "self", ",", "f", ",", "close", ")", ":", "path", "=", "self", ".", "_strip_protocol", "(", "f", ".", "path", ")", "if", "not", "path", ".", "startswith", "(", "self", ".", "target_protocol", ")", ":", "store_path", "=",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/fsspec/implementations/cached.py#L267-L277
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/stdpy/file.py
python
listdir
(path)
return files
Implements os.listdir over vfs.
Implements os.listdir over vfs.
[ "Implements", "os", ".", "listdir", "over", "vfs", "." ]
def listdir(path): """ Implements os.listdir over vfs. """ files = [] dirlist = _vfs.scanDirectory(core.Filename.fromOsSpecific(path)) if dirlist is None: raise OSError("No such file or directory: '%s'" % (path)) for file in dirlist: files.append(file.getFilename().getBasename()) ...
[ "def", "listdir", "(", "path", ")", ":", "files", "=", "[", "]", "dirlist", "=", "_vfs", ".", "scanDirectory", "(", "core", ".", "Filename", ".", "fromOsSpecific", "(", "path", ")", ")", "if", "dirlist", "is", "None", ":", "raise", "OSError", "(", "\...
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/stdpy/file.py#L286-L295
alicevision/MeshroomMaya
5708aee2eac70606268bf7df47f3f0441521a839
src/meshroomMaya/maya/scripts/meshroomMaya/context.py
python
initHotkeySet
()
For Maya >=2016, ensure the current hotkey set is writable.
For Maya >=2016, ensure the current hotkey set is writable.
[ "For", "Maya", ">", "=", "2016", "ensure", "the", "current", "hotkey", "set", "is", "writable", "." ]
def initHotkeySet(): """ For Maya >=2016, ensure the current hotkey set is writable. """ if cmds.about(version=True) < "2016": return currentSet = cmds.hotkeySet(current=True, q=True) if currentSet == "Maya_Default": # Read-only set writableSetName = "Maya_Default_MVG" # Select ...
[ "def", "initHotkeySet", "(", ")", ":", "if", "cmds", ".", "about", "(", "version", "=", "True", ")", "<", "\"2016\"", ":", "return", "currentSet", "=", "cmds", ".", "hotkeySet", "(", "current", "=", "True", ",", "q", "=", "True", ")", "if", "currentS...
https://github.com/alicevision/MeshroomMaya/blob/5708aee2eac70606268bf7df47f3f0441521a839/src/meshroomMaya/maya/scripts/meshroomMaya/context.py#L19-L30
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/waflib/Tools/javaw.py
python
use_jar_files
(self)
Process the *use* attribute to set the build order on the tasks created by another task generator.
Process the *use* attribute to set the build order on the tasks created by another task generator.
[ "Process", "the", "*", "use", "*", "attribute", "to", "set", "the", "build", "order", "on", "the", "tasks", "created", "by", "another", "task", "generator", "." ]
def use_jar_files(self): """ Process the *use* attribute to set the build order on the tasks created by another task generator. """ lst = [] self.uselib = self.to_list(getattr(self, 'uselib', [])) names = self.to_list(getattr(self, 'use', [])) get = self.bld.get_tgen_by_name for x in names: try: y = get(x...
[ "def", "use_jar_files", "(", "self", ")", ":", "lst", "=", "[", "]", "self", ".", "uselib", "=", "self", ".", "to_list", "(", "getattr", "(", "self", ",", "'uselib'", ",", "[", "]", ")", ")", "names", "=", "self", ".", "to_list", "(", "getattr", ...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Tools/javaw.py#L192-L208
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/_vendor/pyparsing.py
python
ParserElement.addParseAction
( self, *fns, **kwargs )
return self
Add one or more parse actions to expression's list of parse actions. See L{I{setParseAction}<setParseAction>}. See examples in L{I{copy}<copy>}.
Add one or more parse actions to expression's list of parse actions. See L{I{setParseAction}<setParseAction>}. See examples in L{I{copy}<copy>}.
[ "Add", "one", "or", "more", "parse", "actions", "to", "expression", "s", "list", "of", "parse", "actions", ".", "See", "L", "{", "I", "{", "setParseAction", "}", "<setParseAction", ">", "}", ".", "See", "examples", "in", "L", "{", "I", "{", "copy", "...
def addParseAction( self, *fns, **kwargs ): """ Add one or more parse actions to expression's list of parse actions. See L{I{setParseAction}<setParseAction>}. See examples in L{I{copy}<copy>}. """ self.parseAction += list(map(_trim_arity, list(fns))) self.callDur...
[ "def", "addParseAction", "(", "self", ",", "*", "fns", ",", "*", "*", "kwargs", ")", ":", "self", ".", "parseAction", "+=", "list", "(", "map", "(", "_trim_arity", ",", "list", "(", "fns", ")", ")", ")", "self", ".", "callDuringTry", "=", "self", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/_vendor/pyparsing.py#L1288-L1296
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/stc.py
python
StyledTextCtrl.SetUseVerticalScrollBar
(*args, **kwargs)
return _stc.StyledTextCtrl_SetUseVerticalScrollBar(*args, **kwargs)
SetUseVerticalScrollBar(self, bool show) Show or hide the vertical scroll bar.
SetUseVerticalScrollBar(self, bool show)
[ "SetUseVerticalScrollBar", "(", "self", "bool", "show", ")" ]
def SetUseVerticalScrollBar(*args, **kwargs): """ SetUseVerticalScrollBar(self, bool show) Show or hide the vertical scroll bar. """ return _stc.StyledTextCtrl_SetUseVerticalScrollBar(*args, **kwargs)
[ "def", "SetUseVerticalScrollBar", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_SetUseVerticalScrollBar", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L4236-L4242
pisa-engine/pisa
0efb7926d4928c8aae672ba4d7a1419891f2676d
script/ext/baker.py
python
remove_param_docs
(docstring)
return PARAM_RE.sub("", docstring)
Finds ReStructuredText-style ":param:" lines in the docstring and returns a new string with the param documentation removed.
Finds ReStructuredText-style ":param:" lines in the docstring and returns a new string with the param documentation removed.
[ "Finds", "ReStructuredText", "-", "style", ":", "param", ":", "lines", "in", "the", "docstring", "and", "returns", "a", "new", "string", "with", "the", "param", "documentation", "removed", "." ]
def remove_param_docs(docstring): """ Finds ReStructuredText-style ":param:" lines in the docstring and returns a new string with the param documentation removed. """ return PARAM_RE.sub("", docstring)
[ "def", "remove_param_docs", "(", "docstring", ")", ":", "return", "PARAM_RE", ".", "sub", "(", "\"\"", ",", "docstring", ")" ]
https://github.com/pisa-engine/pisa/blob/0efb7926d4928c8aae672ba4d7a1419891f2676d/script/ext/baker.py#L72-L77
vgough/encfs
c444f9b9176beea1ad41a7b2e29ca26e709b57f7
vendor/github.com/google/benchmark/tools/gbench/util.py
python
remove_benchmark_flags
(prefix, benchmark_flags)
return [f for f in benchmark_flags if not f.startswith(prefix)]
Return a new list containing the specified benchmark_flags except those with the specified prefix.
Return a new list containing the specified benchmark_flags except those with the specified prefix.
[ "Return", "a", "new", "list", "containing", "the", "specified", "benchmark_flags", "except", "those", "with", "the", "specified", "prefix", "." ]
def remove_benchmark_flags(prefix, benchmark_flags): """ Return a new list containing the specified benchmark_flags except those with the specified prefix. """ assert prefix.startswith('--') and prefix.endswith('=') return [f for f in benchmark_flags if not f.startswith(prefix)]
[ "def", "remove_benchmark_flags", "(", "prefix", ",", "benchmark_flags", ")", ":", "assert", "prefix", ".", "startswith", "(", "'--'", ")", "and", "prefix", ".", "endswith", "(", "'='", ")", "return", "[", "f", "for", "f", "in", "benchmark_flags", "if", "no...
https://github.com/vgough/encfs/blob/c444f9b9176beea1ad41a7b2e29ca26e709b57f7/vendor/github.com/google/benchmark/tools/gbench/util.py#L100-L106
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/timeit.py
python
Timer.print_exc
(self, file=None)
Helper to print a traceback from the timed code. Typical use: t = Timer(...) # outside the try/except try: t.timeit(...) # or t.repeat(...) except: t.print_exc() The advantage over the standard traceback is that source lines...
Helper to print a traceback from the timed code.
[ "Helper", "to", "print", "a", "traceback", "from", "the", "timed", "code", "." ]
def print_exc(self, file=None): """Helper to print a traceback from the timed code. Typical use: t = Timer(...) # outside the try/except try: t.timeit(...) # or t.repeat(...) except: t.print_exc() The advantage over ...
[ "def", "print_exc", "(", "self", ",", "file", "=", "None", ")", ":", "import", "linecache", ",", "traceback", "if", "self", ".", "src", "is", "not", "None", ":", "linecache", ".", "cache", "[", "dummy_src_name", "]", "=", "(", "len", "(", "self", "."...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/timeit.py#L136-L161
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/toolkits/nearest_neighbors/_nearest_neighbors.py
python
NearestNeighborsModel._get_summary_struct
(self)
return (sections, section_titles)
Returns a structured description of the model, including (where relevant) the schema of the training data, description of the training data, training statistics, and model hyperparameters. Returns ------- sections : list (of list of tuples) A list of summary sections...
Returns a structured description of the model, including (where relevant) the schema of the training data, description of the training data, training statistics, and model hyperparameters.
[ "Returns", "a", "structured", "description", "of", "the", "model", "including", "(", "where", "relevant", ")", "the", "schema", "of", "the", "training", "data", "description", "of", "the", "training", "data", "training", "statistics", "and", "model", "hyperparam...
def _get_summary_struct(self): """ Returns a structured description of the model, including (where relevant) the schema of the training data, description of the training data, training statistics, and model hyperparameters. Returns ------- sections : list (of lis...
[ "def", "_get_summary_struct", "(", "self", ")", ":", "model_fields", "=", "[", "(", "\"Method\"", ",", "\"method\"", ")", ",", "(", "\"Number of distance components\"", ",", "\"num_distance_components\"", ")", ",", "(", "\"Number of examples\"", ",", "\"num_examples\"...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/nearest_neighbors/_nearest_neighbors.py#L646-L692
nest/nest-simulator
f2623eb78518cdbd55e77e0ed486bf1111bcb62f
pynest/nest/lib/hl_api_info.py
python
set_verbosity
(level)
Change verbosity level for NEST's messages. - M_ALL=0, display all messages - M_INFO=10, display information messages and above - M_DEPRECATED=18, display deprecation warnings and above - M_WARNING=20, display warning messages and above - M_ERROR=30, display error messages and above - M_FATAL=...
Change verbosity level for NEST's messages.
[ "Change", "verbosity", "level", "for", "NEST", "s", "messages", "." ]
def set_verbosity(level): """Change verbosity level for NEST's messages. - M_ALL=0, display all messages - M_INFO=10, display information messages and above - M_DEPRECATED=18, display deprecation warnings and above - M_WARNING=20, display warning messages and above - M_ERROR=30, display error ...
[ "def", "set_verbosity", "(", "level", ")", ":", "sr", "(", "\"{} setverbosity\"", ".", "format", "(", "level", ")", ")" ]
https://github.com/nest/nest-simulator/blob/f2623eb78518cdbd55e77e0ed486bf1111bcb62f/pynest/nest/lib/hl_api_info.py#L193-L210
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/PublicKey/ECC.py
python
EccKey.public_key
(self)
return EccKey(curve=self._curve.desc, point=self.pointQ)
A matching ECC public key. Returns: a new :class:`EccKey` object
A matching ECC public key.
[ "A", "matching", "ECC", "public", "key", "." ]
def public_key(self): """A matching ECC public key. Returns: a new :class:`EccKey` object """ return EccKey(curve=self._curve.desc, point=self.pointQ)
[ "def", "public_key", "(", "self", ")", ":", "return", "EccKey", "(", "curve", "=", "self", ".", "_curve", ".", "desc", ",", "point", "=", "self", ".", "pointQ", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/PublicKey/ECC.py#L528-L535
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py
python
XcodeSettings._MapLinkerFlagFilename
(self, ldflag, gyp_to_build_path)
return ldflag
Checks if ldflag contains a filename and if so remaps it from gyp-directory-relative to build-directory-relative.
Checks if ldflag contains a filename and if so remaps it from gyp-directory-relative to build-directory-relative.
[ "Checks", "if", "ldflag", "contains", "a", "filename", "and", "if", "so", "remaps", "it", "from", "gyp", "-", "directory", "-", "relative", "to", "build", "-", "directory", "-", "relative", "." ]
def _MapLinkerFlagFilename(self, ldflag, gyp_to_build_path): """Checks if ldflag contains a filename and if so remaps it from gyp-directory-relative to build-directory-relative.""" # This list is expanded on demand. # They get matched as: # -exported_symbols_list file # -...
[ "def", "_MapLinkerFlagFilename", "(", "self", ",", "ldflag", ",", "gyp_to_build_path", ")", ":", "# This list is expanded on demand.", "# They get matched as:", "# -exported_symbols_list file", "# -Wl,exported_symbols_list file", "# -Wl,exported_symbols_list,file", "LINKER_FILE",...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py#L867-L896
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/debug.py
python
DebugClassifier.predict_classes
(self, input_fn=None, batch_size=None)
return (pred[key] for pred in preds)
Returns predicted classes for given features. Args: input_fn: Input function. batch_size: Override default batch size. Returns: An iterable of predicted classes. Each predicted class is represented by its class index (i.e. integer from 0 to n_classes-1).
Returns predicted classes for given features.
[ "Returns", "predicted", "classes", "for", "given", "features", "." ]
def predict_classes(self, input_fn=None, batch_size=None): """Returns predicted classes for given features. Args: input_fn: Input function. batch_size: Override default batch size. Returns: An iterable of predicted classes. Each predicted class is represented by its class index (i....
[ "def", "predict_classes", "(", "self", ",", "input_fn", "=", "None", ",", "batch_size", "=", "None", ")", ":", "key", "=", "prediction_key", ".", "PredictionKey", ".", "CLASSES", "preds", "=", "self", ".", "predict", "(", "input_fn", "=", "input_fn", ",", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/debug.py#L209-L223
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py
python
Misc.grab_current
(self)
return self._nametowidget(name)
Return widget which has currently the grab in this application or None.
Return widget which has currently the grab in this application or None.
[ "Return", "widget", "which", "has", "currently", "the", "grab", "in", "this", "application", "or", "None", "." ]
def grab_current(self): """Return widget which has currently the grab in this application or None.""" name = self.tk.call('grab', 'current', self._w) if not name: return None return self._nametowidget(name)
[ "def", "grab_current", "(", "self", ")", ":", "name", "=", "self", ".", "tk", ".", "call", "(", "'grab'", ",", "'current'", ",", "self", ".", "_w", ")", "if", "not", "name", ":", "return", "None", "return", "self", ".", "_nametowidget", "(", "name", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L605-L610
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/aui.py
python
AuiToolBar.__init__
(self, *args)
__init__(self) -> AuiToolBar __init__(self, Window parent, int id=ID_ANY, Point pos=DefaultPosition, Size size=DefaultSize, long style=AUI_TB_DEFAULT_STYLE) -> AuiToolBar
__init__(self) -> AuiToolBar __init__(self, Window parent, int id=ID_ANY, Point pos=DefaultPosition, Size size=DefaultSize, long style=AUI_TB_DEFAULT_STYLE) -> AuiToolBar
[ "__init__", "(", "self", ")", "-", ">", "AuiToolBar", "__init__", "(", "self", "Window", "parent", "int", "id", "=", "ID_ANY", "Point", "pos", "=", "DefaultPosition", "Size", "size", "=", "DefaultSize", "long", "style", "=", "AUI_TB_DEFAULT_STYLE", ")", "-",...
def __init__(self, *args): """ __init__(self) -> AuiToolBar __init__(self, Window parent, int id=ID_ANY, Point pos=DefaultPosition, Size size=DefaultSize, long style=AUI_TB_DEFAULT_STYLE) -> AuiToolBar """ _aui.AuiToolBar_swiginit(self,_aui.new_AuiToolBar(*args))
[ "def", "__init__", "(", "self", ",", "*", "args", ")", ":", "_aui", ".", "AuiToolBar_swiginit", "(", "self", ",", "_aui", ".", "new_AuiToolBar", "(", "*", "args", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/aui.py#L1991-L1997
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py2/prompt_toolkit/output.py
python
Output.enable_bracketed_paste
(self)
For vt100 only.
For vt100 only.
[ "For", "vt100", "only", "." ]
def enable_bracketed_paste(self): " For vt100 only. "
[ "def", "enable_bracketed_paste", "(", "self", ")", ":" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/output.py#L145-L146
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/propgrid.py
python
PGProperty.GetFlags
(*args, **kwargs)
return _propgrid.PGProperty_GetFlags(*args, **kwargs)
GetFlags(self) -> FlagType
GetFlags(self) -> FlagType
[ "GetFlags", "(", "self", ")", "-", ">", "FlagType" ]
def GetFlags(*args, **kwargs): """GetFlags(self) -> FlagType""" return _propgrid.PGProperty_GetFlags(*args, **kwargs)
[ "def", "GetFlags", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGProperty_GetFlags", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L552-L554
microsoft/BlingFire
7634ad43b521ee6a596266d82c3f0c46cd43e222
ldbsrc/roberta/code.py
python
tokenize_without_bpe
(text)
return tokens
Tokenize a string.
Tokenize a string.
[ "Tokenize", "a", "string", "." ]
def tokenize_without_bpe(text): """ Tokenize a string. """ tokens = [] for token in re.findall(pat, text): token = "".join( byte_encoder[b] for b in token.encode("utf-8") ) # Maps all our bytes to unicode strings, avoiding controle tokens of the BPE (spaces in our case) ...
[ "def", "tokenize_without_bpe", "(", "text", ")", ":", "tokens", "=", "[", "]", "for", "token", "in", "re", ".", "findall", "(", "pat", ",", "text", ")", ":", "token", "=", "\"\"", ".", "join", "(", "byte_encoder", "[", "b", "]", "for", "b", "in", ...
https://github.com/microsoft/BlingFire/blob/7634ad43b521ee6a596266d82c3f0c46cd43e222/ldbsrc/roberta/code.py#L49-L57
google/clif
cab24d6a105609a65c95a36a1712ae3c20c7b5df
clif/python/pytd2proto.py
python
Postprocessor._gather_dispatch
(self, ast, **kwargs)
Given an AST node, dispatch to the appropriate handler function. Args: ast: pyparsing.ParseResults **kwargs: Additional keyword args to pass onto the dispatched-to function.
Given an AST node, dispatch to the appropriate handler function.
[ "Given", "an", "AST", "node", "dispatch", "to", "the", "appropriate", "handler", "function", "." ]
def _gather_dispatch(self, ast, **kwargs): """Given an AST node, dispatch to the appropriate handler function. Args: ast: pyparsing.ParseResults **kwargs: Additional keyword args to pass onto the dispatched-to function. """ ast_type = ast[0] # We only visit constructs that might contrib...
[ "def", "_gather_dispatch", "(", "self", ",", "ast", ",", "*", "*", "kwargs", ")", ":", "ast_type", "=", "ast", "[", "0", "]", "# We only visit constructs that might contribute type information", "if", "ast_type", "not", "in", "(", "'from'", ",", "'namespace'", "...
https://github.com/google/clif/blob/cab24d6a105609a65c95a36a1712ae3c20c7b5df/clif/python/pytd2proto.py#L233-L248
MythTV/mythtv
d282a209cb8be85d036f85a62a8ec971b67d45f4
mythtv/programs/scripts/internetcontent/nv_python_libs/bliptv/bliptv_api.py
python
Videos.massageDescription
(self, text)
return self.ampReplace(re.sub(r"(?s)<[^>]*>|&#?\w+;", fixup, self.textUtf8(text))).replace('\n',' ')
Removes HTML markup from a text string. @param text The HTML source. @return The plain text. If the HTML source contains non-ASCII entities or character references, this is a Unicode string.
Removes HTML markup from a text string.
[ "Removes", "HTML", "markup", "from", "a", "text", "string", "." ]
def massageDescription(self, text): '''Removes HTML markup from a text string. @param text The HTML source. @return The plain text. If the HTML source contains non-ASCII entities or character references, this is a Unicode string. ''' def fixup(m): text = m.gr...
[ "def", "massageDescription", "(", "self", ",", "text", ")", ":", "def", "fixup", "(", "m", ")", ":", "text", "=", "m", ".", "group", "(", "0", ")", "if", "text", "[", ":", "1", "]", "==", "\"<\"", ":", "return", "\"\"", "# ignore tags", "if", "te...
https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/internetcontent/nv_python_libs/bliptv/bliptv_api.py#L316-L346
tensorflow/io
92b44e180674a8af0e12e405530f7343e3e693e4
tensorflow_io/python/ops/kafka_deprecated_dataset_ops.py
python
KafkaOutputSequence.__init__
(self, topic, servers="localhost", configuration=None)
Create a `KafkaOutputSequence`. Args: topic: A `tf.string` tensor containing one subscription, in the format of topic:partition. servers: A list of bootstrap servers. configuration: A `tf.string` tensor containing global configuration ...
Create a `KafkaOutputSequence`.
[ "Create", "a", "KafkaOutputSequence", "." ]
def __init__(self, topic, servers="localhost", configuration=None): """Create a `KafkaOutputSequence`. Args: topic: A `tf.string` tensor containing one subscription, in the format of topic:partition. servers: A list of bootstrap servers. configuration...
[ "def", "__init__", "(", "self", ",", "topic", ",", "servers", "=", "\"localhost\"", ",", "configuration", "=", "None", ")", ":", "self", ".", "_topic", "=", "topic", "metadata", "=", "list", "(", "configuration", "or", "[", "]", ")", "if", "servers", "...
https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/tensorflow_io/python/ops/kafka_deprecated_dataset_ops.py#L153-L173
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/richtext.py
python
RichTextBuffer_GetBulletRightMargin
(*args)
return _richtext.RichTextBuffer_GetBulletRightMargin(*args)
RichTextBuffer_GetBulletRightMargin() -> int
RichTextBuffer_GetBulletRightMargin() -> int
[ "RichTextBuffer_GetBulletRightMargin", "()", "-", ">", "int" ]
def RichTextBuffer_GetBulletRightMargin(*args): """RichTextBuffer_GetBulletRightMargin() -> int""" return _richtext.RichTextBuffer_GetBulletRightMargin(*args)
[ "def", "RichTextBuffer_GetBulletRightMargin", "(", "*", "args", ")", ":", "return", "_richtext", ".", "RichTextBuffer_GetBulletRightMargin", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L2713-L2715
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/aui/framemanager.py
python
AuiManager.AddPane
(self, window, arg1=None, arg2=None, target=None)
Tells the frame manager to start managing a child window. There are four versions of this function. The first verison allows the full spectrum of pane parameter possibilities (:meth:`AddPane1`). The second version is used for simpler user interfaces which do not require as much configuration (:m...
Tells the frame manager to start managing a child window. There are four versions of this function. The first verison allows the full spectrum of pane parameter possibilities (:meth:`AddPane1`). The second version is used for simpler user interfaces which do not require as much configuration (:m...
[ "Tells", "the", "frame", "manager", "to", "start", "managing", "a", "child", "window", ".", "There", "are", "four", "versions", "of", "this", "function", ".", "The", "first", "verison", "allows", "the", "full", "spectrum", "of", "pane", "parameter", "possibi...
def AddPane(self, window, arg1=None, arg2=None, target=None): """ Tells the frame manager to start managing a child window. There are four versions of this function. The first verison allows the full spectrum of pane parameter possibilities (:meth:`AddPane1`). The second version is used ...
[ "def", "AddPane", "(", "self", ",", "window", ",", "arg1", "=", "None", ",", "arg2", "=", "None", ",", "target", "=", "None", ")", ":", "if", "target", "in", "self", ".", "_panes", ":", "return", "self", ".", "AddPane4", "(", "window", ",", "arg1",...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/framemanager.py#L4679-L4713
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_controls.py
python
TreeCtrl.GetSelection
(*args, **kwargs)
return _controls_.TreeCtrl_GetSelection(*args, **kwargs)
GetSelection(self) -> TreeItemId
GetSelection(self) -> TreeItemId
[ "GetSelection", "(", "self", ")", "-", ">", "TreeItemId" ]
def GetSelection(*args, **kwargs): """GetSelection(self) -> TreeItemId""" return _controls_.TreeCtrl_GetSelection(*args, **kwargs)
[ "def", "GetSelection", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "TreeCtrl_GetSelection", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L5363-L5365
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/html.py
python
HtmlCell.IsLinebreakAllowed
(*args, **kwargs)
return _html.HtmlCell_IsLinebreakAllowed(*args, **kwargs)
IsLinebreakAllowed(self) -> bool
IsLinebreakAllowed(self) -> bool
[ "IsLinebreakAllowed", "(", "self", ")", "-", ">", "bool" ]
def IsLinebreakAllowed(*args, **kwargs): """IsLinebreakAllowed(self) -> bool""" return _html.HtmlCell_IsLinebreakAllowed(*args, **kwargs)
[ "def", "IsLinebreakAllowed", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html", ".", "HtmlCell_IsLinebreakAllowed", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/html.py#L706-L708
GeometryCollective/boundary-first-flattening
8250e5a0e85980ec50b5e8aa8f49dd6519f915cd
deps/nanogui/docs/exhale.py
python
ExhaleRoot.generateNamespaceChildrenString
(self, nspace)
return children_string
Helper method for :func:`exhale.ExhaleRoot.generateSingleNamespace`, and :func:`exhale.ExhaleRoot.generateFileNodeDocuments`. Builds the body text for the namespace node document that links to all of the child namespaces, structs, classes, functions, typedefs, unions, and variables asso...
Helper method for :func:`exhale.ExhaleRoot.generateSingleNamespace`, and :func:`exhale.ExhaleRoot.generateFileNodeDocuments`. Builds the body text for the namespace node document that links to all of the child namespaces, structs, classes, functions, typedefs, unions, and variables asso...
[ "Helper", "method", "for", ":", "func", ":", "exhale", ".", "ExhaleRoot", ".", "generateSingleNamespace", "and", ":", "func", ":", "exhale", ".", "ExhaleRoot", ".", "generateFileNodeDocuments", ".", "Builds", "the", "body", "text", "for", "the", "namespace", "...
def generateNamespaceChildrenString(self, nspace): ''' Helper method for :func:`exhale.ExhaleRoot.generateSingleNamespace`, and :func:`exhale.ExhaleRoot.generateFileNodeDocuments`. Builds the body text for the namespace node document that links to all of the child namespaces, st...
[ "def", "generateNamespaceChildrenString", "(", "self", ",", "nspace", ")", ":", "# sort the children", "nsp_namespaces", "=", "[", "]", "nsp_nested_class_like", "=", "[", "]", "nsp_enums", "=", "[", "]", "nsp_functions", "=", "[", "]", "nsp_typedefs", "=", "[", ...
https://github.com/GeometryCollective/boundary-first-flattening/blob/8250e5a0e85980ec50b5e8aa8f49dd6519f915cd/deps/nanogui/docs/exhale.py#L2319-L2369
rsummers11/CADLab
976ed959a0b5208bb4173127a7ef732ac73a9b6f
panreas_hnn/hed-globalweight/scripts/cpp_lint.py
python
_CppLintState.IncrementErrorCount
(self, category)
Bumps the module's error statistic.
Bumps the module's error statistic.
[ "Bumps", "the", "module", "s", "error", "statistic", "." ]
def IncrementErrorCount(self, category): """Bumps the module's error statistic.""" self.error_count += 1 if self.counting in ('toplevel', 'detailed'): if self.counting != 'detailed': category = category.split('/')[0] if category not in self.errors_by_category: self.errors_by_cate...
[ "def", "IncrementErrorCount", "(", "self", ",", "category", ")", ":", "self", ".", "error_count", "+=", "1", "if", "self", ".", "counting", "in", "(", "'toplevel'", ",", "'detailed'", ")", ":", "if", "self", ".", "counting", "!=", "'detailed'", ":", "cat...
https://github.com/rsummers11/CADLab/blob/976ed959a0b5208bb4173127a7ef732ac73a9b6f/panreas_hnn/hed-globalweight/scripts/cpp_lint.py#L747-L755
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
tools/code_coverage/package/tool/parser/llvm_coverage_segment.py
python
parse_segments
(raw_segments: List[List[int]])
return ret
Creates LlvmCoverageSegment from a list of lists in llvm export json. each segment is represented by 5-element array.
Creates LlvmCoverageSegment from a list of lists in llvm export json. each segment is represented by 5-element array.
[ "Creates", "LlvmCoverageSegment", "from", "a", "list", "of", "lists", "in", "llvm", "export", "json", ".", "each", "segment", "is", "represented", "by", "5", "-", "element", "array", "." ]
def parse_segments(raw_segments: List[List[int]]) -> List[LlvmCoverageSegment]: """ Creates LlvmCoverageSegment from a list of lists in llvm export json. each segment is represented by 5-element array. """ ret: List[LlvmCoverageSegment] = [] for raw_segment in raw_segments: assert ( ...
[ "def", "parse_segments", "(", "raw_segments", ":", "List", "[", "List", "[", "int", "]", "]", ")", "->", "List", "[", "LlvmCoverageSegment", "]", ":", "ret", ":", "List", "[", "LlvmCoverageSegment", "]", "=", "[", "]", "for", "raw_segment", "in", "raw_se...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/tools/code_coverage/package/tool/parser/llvm_coverage_segment.py#L35-L60
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/cmd.py
python
Cmd.emptyline
(self)
Called when an empty line is entered in response to the prompt. If this method is not overridden, it repeats the last nonempty command entered.
Called when an empty line is entered in response to the prompt.
[ "Called", "when", "an", "empty", "line", "is", "entered", "in", "response", "to", "the", "prompt", "." ]
def emptyline(self): """Called when an empty line is entered in response to the prompt. If this method is not overridden, it repeats the last nonempty command entered. """ if self.lastcmd: return self.onecmd(self.lastcmd)
[ "def", "emptyline", "(", "self", ")", ":", "if", "self", ".", "lastcmd", ":", "return", "self", ".", "onecmd", "(", "self", ".", "lastcmd", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/cmd.py#L223-L231
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/typing.py
python
no_type_check_decorator
(decorator)
return wrapped_decorator
Decorator to give another decorator the @no_type_check effect. This wraps the decorator with something that wraps the decorated function in @no_type_check.
Decorator to give another decorator the @no_type_check effect.
[ "Decorator", "to", "give", "another", "decorator", "the", "@no_type_check", "effect", "." ]
def no_type_check_decorator(decorator): """Decorator to give another decorator the @no_type_check effect. This wraps the decorator with something that wraps the decorated function in @no_type_check. """ @functools.wraps(decorator) def wrapped_decorator(*args, **kwds): func = decorator(...
[ "def", "no_type_check_decorator", "(", "decorator", ")", ":", "@", "functools", ".", "wraps", "(", "decorator", ")", "def", "wrapped_decorator", "(", "*", "args", ",", "*", "*", "kwds", ")", ":", "func", "=", "decorator", "(", "*", "args", ",", "*", "*...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/typing.py#L1046-L1059
Samsung/veles
95ed733c2e49bc011ad98ccf2416ecec23fbf352
veles/external/prettytable.py
python
PrettyTable._get_field_names
(self)
return self._field_names
The names of the fields Arguments: fields - list or tuple of field names
The names of the fields
[ "The", "names", "of", "the", "fields" ]
def _get_field_names(self): return self._field_names """The names of the fields Arguments: fields - list or tuple of field names"""
[ "def", "_get_field_names", "(", "self", ")", ":", "return", "self", ".", "_field_names" ]
https://github.com/Samsung/veles/blob/95ed733c2e49bc011ad98ccf2416ecec23fbf352/veles/external/prettytable.py#L403-L409
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/boost_1_66_0/libs/python/config/tools/sphinx4scons.py
python
SourceInfo._get_templates
(self, confignode, config)
return templates
Returns template files defined in the project.
Returns template files defined in the project.
[ "Returns", "template", "files", "defined", "in", "the", "project", "." ]
def _get_templates(self, confignode, config): """Returns template files defined in the project.""" templates = [] for path in config.get('templates_path', []): # Check if path is dir or file. # We can't use FS.Entry since that will create nodes, and # these no...
[ "def", "_get_templates", "(", "self", ",", "confignode", ",", "config", ")", ":", "templates", "=", "[", "]", "for", "path", "in", "config", ".", "get", "(", "'templates_path'", ",", "[", "]", ")", ":", "# Check if path is dir or file.", "# We can't use FS.Ent...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/boost_1_66_0/libs/python/config/tools/sphinx4scons.py#L253-L271
microsoft/EdgeML
ef9f8a77f096acbdeb941014791f8eda1c1bc35b
tf/edgeml_tf/trainer/emirnnTrainer.py
python
EMI_Driver.getBagPredictions
(self, Y_predicted, minSubsequenceLen = 4, numClass=2, redirFile = None)
return prediction.astype(int)
Returns bag level predictions given instance level predictions. A bag is considered to belong to a non-zero class if minSubsequenceLen is satisfied. Otherwise, it is assumed to belong to class 0. class 0 is negative by default. If minSubsequenceLen is satisfied by multiple classes, the ...
Returns bag level predictions given instance level predictions.
[ "Returns", "bag", "level", "predictions", "given", "instance", "level", "predictions", "." ]
def getBagPredictions(self, Y_predicted, minSubsequenceLen = 4, numClass=2, redirFile = None): ''' Returns bag level predictions given instance level predictions. A bag is considered to belong to a non-zero class if minSubsequenceLen is satisfied. Otherwise, it...
[ "def", "getBagPredictions", "(", "self", ",", "Y_predicted", ",", "minSubsequenceLen", "=", "4", ",", "numClass", "=", "2", ",", "redirFile", "=", "None", ")", ":", "assert", "(", "Y_predicted", ".", "ndim", "==", "2", ")", "scoreList", "=", "[", "]", ...
https://github.com/microsoft/EdgeML/blob/ef9f8a77f096acbdeb941014791f8eda1c1bc35b/tf/edgeml_tf/trainer/emirnnTrainer.py#L755-L789
peterljq/OpenMMD
795d4dd660cf7e537ceb599fdb038c5388b33390
VMD 3D Pose Baseline Multi-Objects/applications/vmdlifting_multi.py
python
display_results
(in_image, data_2d, joint_visibility, data_3d)
Plot 2D and 3D poses for each of the people in the image.
Plot 2D and 3D poses for each of the people in the image.
[ "Plot", "2D", "and", "3D", "poses", "for", "each", "of", "the", "people", "in", "the", "image", "." ]
def display_results(in_image, data_2d, joint_visibility, data_3d): """Plot 2D and 3D poses for each of the people in the image.""" plt.figure() draw_limbs(in_image, data_2d, joint_visibility) plt.imshow(in_image) plt.axis('off') # Show 3D poses for single_3D in data_3d: # or plot_po...
[ "def", "display_results", "(", "in_image", ",", "data_2d", ",", "joint_visibility", ",", "data_3d", ")", ":", "plt", ".", "figure", "(", ")", "draw_limbs", "(", "in_image", ",", "data_2d", ",", "joint_visibility", ")", "plt", ".", "imshow", "(", "in_image", ...
https://github.com/peterljq/OpenMMD/blob/795d4dd660cf7e537ceb599fdb038c5388b33390/VMD 3D Pose Baseline Multi-Objects/applications/vmdlifting_multi.py#L97-L109
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/propgrid.py
python
PropertyGrid.GenerateEditorTextCtrl
(*args, **kwargs)
return _propgrid.PropertyGrid_GenerateEditorTextCtrl(*args, **kwargs)
GenerateEditorTextCtrl(self, Point pos, Size sz, String value, Window secondary, int extraStyle=0, int maxLen=0, int forColumn=1) -> Window
GenerateEditorTextCtrl(self, Point pos, Size sz, String value, Window secondary, int extraStyle=0, int maxLen=0, int forColumn=1) -> Window
[ "GenerateEditorTextCtrl", "(", "self", "Point", "pos", "Size", "sz", "String", "value", "Window", "secondary", "int", "extraStyle", "=", "0", "int", "maxLen", "=", "0", "int", "forColumn", "=", "1", ")", "-", ">", "Window" ]
def GenerateEditorTextCtrl(*args, **kwargs): """ GenerateEditorTextCtrl(self, Point pos, Size sz, String value, Window secondary, int extraStyle=0, int maxLen=0, int forColumn=1) -> Window """ return _propgrid.PropertyGrid_GenerateEditorTextCtrl(*args, **kwargs)
[ "def", "GenerateEditorTextCtrl", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGrid_GenerateEditorTextCtrl", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L2347-L2352
olliw42/storm32bgc
99d62a6130ae2950514022f50eb669c45a8cc1ba
old/betacopter/old/betacopter36dev-v005/modules/uavcan/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/pyratemp.py
python
EvalPseudoSandbox.eval
(self, expr, locals)
return x
Eval a Python-eval-expression. Sets ``self.locals_ptr`` to ``locales`` and compiles the code before evaluating.
Eval a Python-eval-expression.
[ "Eval", "a", "Python", "-", "eval", "-", "expression", "." ]
def eval(self, expr, locals): """Eval a Python-eval-expression. Sets ``self.locals_ptr`` to ``locales`` and compiles the code before evaluating. """ sav = self.locals_ptr self.locals_ptr = locals x = eval(self.compile(expr), {"__builtins__":self.eval_allowed_glob...
[ "def", "eval", "(", "self", ",", "expr", ",", "locals", ")", ":", "sav", "=", "self", ".", "locals_ptr", "self", ".", "locals_ptr", "=", "locals", "x", "=", "eval", "(", "self", ".", "compile", "(", "expr", ")", ",", "{", "\"__builtins__\"", ":", "...
https://github.com/olliw42/storm32bgc/blob/99d62a6130ae2950514022f50eb669c45a8cc1ba/old/betacopter/old/betacopter36dev-v005/modules/uavcan/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/pyratemp.py#L876-L886
luliyucoordinate/Leetcode
96afcdc54807d1d184e881a075d1dbf3371e31fb
src/0097-Interleaving-String/0097.py
python
Solution.isInterleave
(self, s1, s2, s3)
return helper(0, 0, 0, {})
:type s1: str :type s2: str :type s3: str :rtype: bool
:type s1: str :type s2: str :type s3: str :rtype: bool
[ ":", "type", "s1", ":", "str", ":", "type", "s2", ":", "str", ":", "type", "s3", ":", "str", ":", "rtype", ":", "bool" ]
def isInterleave(self, s1, s2, s3): """ :type s1: str :type s2: str :type s3: str :rtype: bool """ def helper(i, j, k, mem): if (i, j) in mem: return mem[(i, j)] if k == len(s3): return True ...
[ "def", "isInterleave", "(", "self", ",", "s1", ",", "s2", ",", "s3", ")", ":", "def", "helper", "(", "i", ",", "j", ",", "k", ",", "mem", ")", ":", "if", "(", "i", ",", "j", ")", "in", "mem", ":", "return", "mem", "[", "(", "i", ",", "j",...
https://github.com/luliyucoordinate/Leetcode/blob/96afcdc54807d1d184e881a075d1dbf3371e31fb/src/0097-Interleaving-String/0097.py#L2-L32
google/fhir
d77f57706c1a168529b0b87ca7ccb1c0113e83c2
py/google/fhir/references.py
python
split_if_relative_reference
(reference: message.Message)
If possible, parses a `Reference` `uri` into more structured fields. This is only possible for two forms of reference uris: * Relative references of the form $TYPE/$ID, e.g., "Patient/1234" In this case, this will be parsed to a proto of the form: {patient_id: {value: "1234"}} * Fragments of the form "#$...
If possible, parses a `Reference` `uri` into more structured fields.
[ "If", "possible", "parses", "a", "Reference", "uri", "into", "more", "structured", "fields", "." ]
def split_if_relative_reference(reference: message.Message) -> None: """If possible, parses a `Reference` `uri` into more structured fields. This is only possible for two forms of reference uris: * Relative references of the form $TYPE/$ID, e.g., "Patient/1234" In this case, this will be parsed to a proto of...
[ "def", "split_if_relative_reference", "(", "reference", ":", "message", ".", "Message", ")", "->", "None", ":", "_validate_reference", "(", "reference", ")", "uri_field", "=", "reference", ".", "DESCRIPTOR", ".", "fields_by_name", ".", "get", "(", "'uri'", ")", ...
https://github.com/google/fhir/blob/d77f57706c1a168529b0b87ca7ccb1c0113e83c2/py/google/fhir/references.py#L69-L131
Kitware/VTK
5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8
Wrapping/Python/vtkmodules/numpy_interface/algorithms.py
python
mean
(array, axis=None, controller=None, size=None)
Returns the mean of all values along a particular axis (dimension). Given an array of m tuples and n components: * Default is to return the mean of all values in an array. * axis=0: Return the mean values of all components and return a one tuple, n-component array. * axis=1: Return the mean values...
Returns the mean of all values along a particular axis (dimension). Given an array of m tuples and n components: * Default is to return the mean of all values in an array. * axis=0: Return the mean values of all components and return a one tuple, n-component array. * axis=1: Return the mean values...
[ "Returns", "the", "mean", "of", "all", "values", "along", "a", "particular", "axis", "(", "dimension", ")", ".", "Given", "an", "array", "of", "m", "tuples", "and", "n", "components", ":", "*", "Default", "is", "to", "return", "the", "mean", "of", "all...
def mean(array, axis=None, controller=None, size=None): """Returns the mean of all values along a particular axis (dimension). Given an array of m tuples and n components: * Default is to return the mean of all values in an array. * axis=0: Return the mean values of all components and return a one ...
[ "def", "mean", "(", "array", ",", "axis", "=", "None", ",", "controller", "=", "None", ",", "size", "=", "None", ")", ":", "if", "axis", "is", "None", "or", "axis", "==", "0", ":", "if", "size", "is", "None", ":", "size", "=", "_array_count", "("...
https://github.com/Kitware/VTK/blob/5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8/Wrapping/Python/vtkmodules/numpy_interface/algorithms.py#L747-L772
glotzerlab/hoomd-blue
f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a
hoomd/data/typeconverter.py
python
to_type_converter
(value)
The function to use for creating a structure of `TypeConverter` objects. This is the function to use when defining validation not any of the `TypeConverter` subclasses. .. code-block:: python # list take a list of tuples of 3 floats each validation = to_type_converter( {'str':...
The function to use for creating a structure of `TypeConverter` objects.
[ "The", "function", "to", "use", "for", "creating", "a", "structure", "of", "TypeConverter", "objects", "." ]
def to_type_converter(value): """The function to use for creating a structure of `TypeConverter` objects. This is the function to use when defining validation not any of the `TypeConverter` subclasses. .. code-block:: python # list take a list of tuples of 3 floats each validation = t...
[ "def", "to_type_converter", "(", "value", ")", ":", "if", "isinstance", "(", "value", ",", "tuple", ")", ":", "return", "TypeConverterFixedLengthSequence", "(", "value", ")", "if", "_is_iterable", "(", "value", ")", ":", "if", "len", "(", "value", ")", "==...
https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/data/typeconverter.py#L598-L619
microsoft/ivy
9f3c7ecc0b2383129fdd0953e10890d98d09a82d
ivy/ivy_parser.py
python
p_expr_tilda_atom
(p)
expr : TILDA expr
expr : TILDA expr
[ "expr", ":", "TILDA", "expr" ]
def p_expr_tilda_atom(p): 'expr : TILDA expr' p[0] = NamedSpace(~p[2].lit)
[ "def", "p_expr_tilda_atom", "(", "p", ")", ":", "p", "[", "0", "]", "=", "NamedSpace", "(", "~", "p", "[", "2", "]", ".", "lit", ")" ]
https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_parser.py#L2584-L2586
nest/nest-simulator
f2623eb78518cdbd55e77e0ed486bf1111bcb62f
pynest/nest/lib/hl_api_helper.py
python
restructure_data
(result, keys)
return final_result
Restructure list of status dictionaries or list of parameter values to dict with lists or single list or int. Parameters ---------- result: list list of status dictionaries or list (of lists) of parameter values. keys: string or list of strings name(s) of properties Returns ---...
Restructure list of status dictionaries or list of parameter values to dict with lists or single list or int.
[ "Restructure", "list", "of", "status", "dictionaries", "or", "list", "of", "parameter", "values", "to", "dict", "with", "lists", "or", "single", "list", "or", "int", "." ]
def restructure_data(result, keys): """ Restructure list of status dictionaries or list of parameter values to dict with lists or single list or int. Parameters ---------- result: list list of status dictionaries or list (of lists) of parameter values. keys: string or list of strings ...
[ "def", "restructure_data", "(", "result", ",", "keys", ")", ":", "if", "is_literal", "(", "keys", ")", ":", "if", "len", "(", "result", ")", "!=", "1", ":", "all_keys", "=", "sorted", "(", "{", "key", "for", "result_dict", "in", "result", "for", "key...
https://github.com/nest/nest-simulator/blob/f2623eb78518cdbd55e77e0ed486bf1111bcb62f/pynest/nest/lib/hl_api_helper.py#L466-L514
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/src/robotsim.py
python
Viewport.fromJson
(self, str: "std::string const &")
return _robotsim.Viewport_fromJson(self, str)
r""" fromJson(Viewport self, std::string const & str) -> bool
r""" fromJson(Viewport self, std::string const & str) -> bool
[ "r", "fromJson", "(", "Viewport", "self", "std", "::", "string", "const", "&", "str", ")", "-", ">", "bool" ]
def fromJson(self, str: "std::string const &") -> "bool": r""" fromJson(Viewport self, std::string const & str) -> bool """ return _robotsim.Viewport_fromJson(self, str)
[ "def", "fromJson", "(", "self", ",", "str", ":", "\"std::string const &\"", ")", "->", "\"bool\"", ":", "return", "_robotsim", ".", "Viewport_fromJson", "(", "self", ",", "str", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L3272-L3278
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/PhactoriDriver.py
python
PhactoriPipeAndViewsState.GetOperationReferredByJsonCrossPipe
(self, inOperationNameKey, inJsonDict)
return returnOperation, returnPipe
same as GetOperationReferredByJson(); however, if the operation is not\n in our self.mOperationBlocks, then we will also search all the other\n pipe and views state instances for the operation. If we find it, we\n will return it along with the pipe we found it in
same as GetOperationReferredByJson(); however, if the operation is not\n in our self.mOperationBlocks, then we will also search all the other\n pipe and views state instances for the operation. If we find it, we\n will return it along with the pipe we found it in
[ "same", "as", "GetOperationReferredByJson", "()", ";", "however", "if", "the", "operation", "is", "not", "\\", "n", "in", "our", "self", ".", "mOperationBlocks", "then", "we", "will", "also", "search", "all", "the", "other", "\\", "n", "pipe", "and", "view...
def GetOperationReferredByJsonCrossPipe(self, inOperationNameKey, inJsonDict): "same as GetOperationReferredByJson(); however, if the operation is not\n in our self.mOperationBlocks, then we will also search all the other\n pipe and views state instances for the operation. If we find it, we\n wil...
[ "def", "GetOperationReferredByJsonCrossPipe", "(", "self", ",", "inOperationNameKey", ",", "inJsonDict", ")", ":", "if", "inOperationNameKey", "in", "inJsonDict", ":", "nameOfOperationToUse", "=", "inJsonDict", "[", "inOperationNameKey", "]", "if", "nameOfOperationToUse",...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/PhactoriDriver.py#L19672-L19707
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/interpolate/interpolate.py
python
NdPPoly.construct_fast
(cls, c, x, extrapolate=None)
return self
Construct the piecewise polynomial without making checks. Takes the same parameters as the constructor. Input arguments `c` and `x` must be arrays of the correct shape and type. The `c` array can only be of dtypes float and complex, and `x` array must have dtype float.
Construct the piecewise polynomial without making checks.
[ "Construct", "the", "piecewise", "polynomial", "without", "making", "checks", "." ]
def construct_fast(cls, c, x, extrapolate=None): """ Construct the piecewise polynomial without making checks. Takes the same parameters as the constructor. Input arguments `c` and `x` must be arrays of the correct shape and type. The `c` array can only be of dtypes float and c...
[ "def", "construct_fast", "(", "cls", ",", "c", ",", "x", ",", "extrapolate", "=", "None", ")", ":", "self", "=", "object", ".", "__new__", "(", "cls", ")", "self", ".", "c", "=", "c", "self", ".", "x", "=", "x", "if", "extrapolate", "is", "None",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/interpolate/interpolate.py#L1959-L1975
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/defchararray.py
python
chararray.startswith
(self, prefix, start=0, end=None)
return startswith(self, prefix, start, end)
Returns a boolean array which is `True` where the string element in `self` starts with `prefix`, otherwise `False`. See also -------- char.startswith
Returns a boolean array which is `True` where the string element in `self` starts with `prefix`, otherwise `False`.
[ "Returns", "a", "boolean", "array", "which", "is", "True", "where", "the", "string", "element", "in", "self", "starts", "with", "prefix", "otherwise", "False", "." ]
def startswith(self, prefix, start=0, end=None): """ Returns a boolean array which is `True` where the string element in `self` starts with `prefix`, otherwise `False`. See also -------- char.startswith """ return startswith(self, prefix, start, end)
[ "def", "startswith", "(", "self", ",", "prefix", ",", "start", "=", "0", ",", "end", "=", "None", ")", ":", "return", "startswith", "(", "self", ",", "prefix", ",", "start", ",", "end", ")" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/defchararray.py#L2364-L2374
ap--/python-seabreeze
86e9145edf7a30cedd4dffd4658a142aeab2d2fc
src/seabreeze/os_setup.py
python
windows_install_drivers
()
install driver inf files via pnputil in an elevated shell
install driver inf files via pnputil in an elevated shell
[ "install", "driver", "inf", "files", "via", "pnputil", "in", "an", "elevated", "shell" ]
def windows_install_drivers(): """install driver inf files via pnputil in an elevated shell""" if not _request_confirmation("Install windows drivers?"): sys.exit(0) if not _windows_is_admin(): # Re-run the program with admin rights argv = [__file__] + sys.argv[1:] ret = ctyp...
[ "def", "windows_install_drivers", "(", ")", ":", "if", "not", "_request_confirmation", "(", "\"Install windows drivers?\"", ")", ":", "sys", ".", "exit", "(", "0", ")", "if", "not", "_windows_is_admin", "(", ")", ":", "# Re-run the program with admin rights", "argv"...
https://github.com/ap--/python-seabreeze/blob/86e9145edf7a30cedd4dffd4658a142aeab2d2fc/src/seabreeze/os_setup.py#L138-L232
echronos/echronos
c996f1d2c8af6c6536205eb319c1bf1d4d84569c
pylib/cmdline.py
python
_add_cmd_tree_to_parser
(cmd_tree, parser)
Create command-line parser from hierarchical subcmd objects.
Create command-line parser from hierarchical subcmd objects.
[ "Create", "command", "-", "line", "parser", "from", "hierarchical", "subcmd", "objects", "." ]
def _add_cmd_tree_to_parser(cmd_tree, parser): """Create command-line parser from hierarchical subcmd objects.""" cmds_parsers = parser.add_subparsers(title='commands', dest='command') for command in sorted(cmd_tree.keys()): cmd_parser = cmds_parsers.add_parser(command) subcmds = sorted(cmd_...
[ "def", "_add_cmd_tree_to_parser", "(", "cmd_tree", ",", "parser", ")", ":", "cmds_parsers", "=", "parser", ".", "add_subparsers", "(", "title", "=", "'commands'", ",", "dest", "=", "'command'", ")", "for", "command", "in", "sorted", "(", "cmd_tree", ".", "ke...
https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/pylib/cmdline.py#L164-L170
HyeonwooNoh/caffe
d9e8494a2832d67b25dee37194c7bcb9d52d0e42
scripts/cpp_lint.py
python
ReplaceAll
(pattern, rep, s)
return _regexp_compile_cache[pattern].sub(rep, s)
Replaces instances of pattern in a string with a replacement. The compiled regex is kept in a cache shared by Match and Search. Args: pattern: regex pattern rep: replacement text s: search string Returns: string with replacements made (or original string if no replacements)
Replaces instances of pattern in a string with a replacement.
[ "Replaces", "instances", "of", "pattern", "in", "a", "string", "with", "a", "replacement", "." ]
def ReplaceAll(pattern, rep, s): """Replaces instances of pattern in a string with a replacement. The compiled regex is kept in a cache shared by Match and Search. Args: pattern: regex pattern rep: replacement text s: search string Returns: string with replacements made (or original string if...
[ "def", "ReplaceAll", "(", "pattern", ",", "rep", ",", "s", ")", ":", "if", "pattern", "not", "in", "_regexp_compile_cache", ":", "_regexp_compile_cache", "[", "pattern", "]", "=", "sre_compile", ".", "compile", "(", "pattern", ")", "return", "_regexp_compile_c...
https://github.com/HyeonwooNoh/caffe/blob/d9e8494a2832d67b25dee37194c7bcb9d52d0e42/scripts/cpp_lint.py#L525-L540
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
libcxx/utils/libcxx/util.py
python
killProcessAndChildren
(pid)
This function kills a process with ``pid`` and all its running children (recursively). It is currently implemented using the psutil module which provides a simple platform neutral implementation. TODO: Reimplement this without using psutil so we can remove our dependency on it.
This function kills a process with ``pid`` and all its running children (recursively). It is currently implemented using the psutil module which provides a simple platform neutral implementation.
[ "This", "function", "kills", "a", "process", "with", "pid", "and", "all", "its", "running", "children", "(", "recursively", ")", ".", "It", "is", "currently", "implemented", "using", "the", "psutil", "module", "which", "provides", "a", "simple", "platform", ...
def killProcessAndChildren(pid): """ This function kills a process with ``pid`` and all its running children (recursively). It is currently implemented using the psutil module which provides a simple platform neutral implementation. TODO: Reimplement this without using psutil so we can ...
[ "def", "killProcessAndChildren", "(", "pid", ")", ":", "if", "platform", ".", "system", "(", ")", "==", "'AIX'", ":", "subprocess", ".", "call", "(", "'kill -kill $(ps -o pid= -L{})'", ".", "format", "(", "pid", ")", ",", "shell", "=", "True", ")", "else",...
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/libcxx/utils/libcxx/util.py#L243-L273
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/server/wsgi/serve/publish/publish_manager.py
python
PublishManager.HandleQueryRequest
(self, request, response)
Handles query requests. Args: request: request object. response: response object.
Handles query requests.
[ "Handles", "query", "requests", "." ]
def HandleQueryRequest(self, request, response): """Handles query requests. Args: request: request object. response: response object. """ logger.debug("HandleQueryRequest...") self._publish_helper.HandleQueryRequest(request, response)
[ "def", "HandleQueryRequest", "(", "self", ",", "request", ",", "response", ")", ":", "logger", ".", "debug", "(", "\"HandleQueryRequest...\"", ")", "self", ".", "_publish_helper", ".", "HandleQueryRequest", "(", "request", ",", "response", ")" ]
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/serve/publish/publish_manager.py#L162-L170
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/tools/inspector_protocol/jinja2/filters.py
python
do_batch
(value, linecount, fill_with=None)
A filter that batches items. It works pretty much like `slice` just the other way round. It returns a list of lists with the given number of items. If you provide a second parameter this is used to fill up missing items. See this example: .. sourcecode:: html+jinja <table> {%- for row ...
A filter that batches items. It works pretty much like `slice` just the other way round. It returns a list of lists with the given number of items. If you provide a second parameter this is used to fill up missing items. See this example:
[ "A", "filter", "that", "batches", "items", ".", "It", "works", "pretty", "much", "like", "slice", "just", "the", "other", "way", "round", ".", "It", "returns", "a", "list", "of", "lists", "with", "the", "given", "number", "of", "items", ".", "If", "you...
def do_batch(value, linecount, fill_with=None): """ A filter that batches items. It works pretty much like `slice` just the other way round. It returns a list of lists with the given number of items. If you provide a second parameter this is used to fill up missing items. See this example: .. s...
[ "def", "do_batch", "(", "value", ",", "linecount", ",", "fill_with", "=", "None", ")", ":", "tmp", "=", "[", "]", "for", "item", "in", "value", ":", "if", "len", "(", "tmp", ")", "==", "linecount", ":", "yield", "tmp", "tmp", "=", "[", "]", "tmp"...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/inspector_protocol/jinja2/filters.py#L737-L765
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/protobuf/python/google/protobuf/internal/enum_type_wrapper.py
python
EnumTypeWrapper.keys
(self)
return [value_descriptor.name for value_descriptor in self._enum_type.values]
Return a list of the string names in the enum. These are returned in the order they were defined in the .proto file.
Return a list of the string names in the enum.
[ "Return", "a", "list", "of", "the", "string", "names", "in", "the", "enum", "." ]
def keys(self): """Return a list of the string names in the enum. These are returned in the order they were defined in the .proto file. """ return [value_descriptor.name for value_descriptor in self._enum_type.values]
[ "def", "keys", "(", "self", ")", ":", "return", "[", "value_descriptor", ".", "name", "for", "value_descriptor", "in", "self", ".", "_enum_type", ".", "values", "]" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/protobuf/python/google/protobuf/internal/enum_type_wrapper.py#L65-L72
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/lib/ufunclike.py
python
isneginf
(x, y=None)
return y
Test element-wise for negative infinity, return result as bool array. Parameters ---------- x : array_like The input array. y : array_like, optional A boolean array with the same shape and type as `x` to store the result. Returns ------- y : ndarray A boolea...
Test element-wise for negative infinity, return result as bool array.
[ "Test", "element", "-", "wise", "for", "negative", "infinity", "return", "result", "as", "bool", "array", "." ]
def isneginf(x, y=None): """ Test element-wise for negative infinity, return result as bool array. Parameters ---------- x : array_like The input array. y : array_like, optional A boolean array with the same shape and type as `x` to store the result. Returns ---...
[ "def", "isneginf", "(", "x", ",", "y", "=", "None", ")", ":", "if", "y", "is", "None", ":", "x", "=", "nx", ".", "asarray", "(", "x", ")", "y", "=", "nx", ".", "empty", "(", "x", ".", "shape", ",", "dtype", "=", "nx", ".", "bool_", ")", "...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/lib/ufunclike.py#L113-L174
freeorion/freeorion
c266a40eccd3a99a17de8fe57c36ef6ba3771665
default/python/universe_generation/galaxy.py
python
DisjointSets.link
(self, p1, p2)
Creates a link between the sets containing p1 and p2
Creates a link between the sets containing p1 and p2
[ "Creates", "a", "link", "between", "the", "sets", "containing", "p1", "and", "p2" ]
def link(self, p1, p2): """Creates a link between the sets containing p1 and p2""" root1 = self.root(p1) if p1 == p2: # print " self link" return root2 = self.root(p2) if root1 == root2: # print " same discrete set link" return ...
[ "def", "link", "(", "self", ",", "p1", ",", "p2", ")", ":", "root1", "=", "self", ".", "root", "(", "p1", ")", "if", "p1", "==", "p2", ":", "# print \" self link\"", "return", "root2", "=", "self", ".", "root", "(", "p2", ")", "if", "root1", "=="...
https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/universe_generation/galaxy.py#L148-L171
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/polynomial/legendre.py
python
leggauss
(deg)
return x, w
Gauss-Legendre quadrature. Computes the sample points and weights for Gauss-Legendre quadrature. These sample points and weights will correctly integrate polynomials of degree :math:`2*deg - 1` or less over the interval :math:`[-1, 1]` with the weight function :math:`f(x) = 1`. Parameters ----...
Gauss-Legendre quadrature.
[ "Gauss", "-", "Legendre", "quadrature", "." ]
def leggauss(deg): """ Gauss-Legendre quadrature. Computes the sample points and weights for Gauss-Legendre quadrature. These sample points and weights will correctly integrate polynomials of degree :math:`2*deg - 1` or less over the interval :math:`[-1, 1]` with the weight function :math:`f(x)...
[ "def", "leggauss", "(", "deg", ")", ":", "ideg", "=", "pu", ".", "_deprecate_as_int", "(", "deg", ",", "\"deg\"", ")", "if", "ideg", "<=", "0", ":", "raise", "ValueError", "(", "\"deg must be a positive integer\"", ")", "# first approximation of roots. We use the ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/polynomial/legendre.py#L1514-L1579
hfinkel/llvm-project-cxxjit
91084ef018240bbb8e24235ff5cd8c355a9c1a1e
libcxx/utils/libcxx/sym_check/util.py
python
read_syms_from_list
(slist)
return [ast.literal_eval(l) for l in slist]
Read a list of symbols from a list of strings. Each string is one symbol.
Read a list of symbols from a list of strings. Each string is one symbol.
[ "Read", "a", "list", "of", "symbols", "from", "a", "list", "of", "strings", ".", "Each", "string", "is", "one", "symbol", "." ]
def read_syms_from_list(slist): """ Read a list of symbols from a list of strings. Each string is one symbol. """ return [ast.literal_eval(l) for l in slist]
[ "def", "read_syms_from_list", "(", "slist", ")", ":", "return", "[", "ast", ".", "literal_eval", "(", "l", ")", "for", "l", "in", "slist", "]" ]
https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/libcxx/utils/libcxx/sym_check/util.py#L17-L22
tangzhenyu/Scene-Text-Understanding
0f7ffc7aea5971a50cdc03d33d0a41075285948b
SynthText_Chinese/generateDataNew.py
python
random_scale
(x,y)
return gray_out
对x随机scale,生成x-y之间的一个数
对x随机scale,生成x-y之间的一个数
[ "对x随机scale", "生成x", "-", "y之间的一个数" ]
def random_scale(x,y): ''' 对x随机scale,生成x-y之间的一个数''' gray_out = r(y+1-x) + x return gray_out
[ "def", "random_scale", "(", "x", ",", "y", ")", ":", "gray_out", "=", "r", "(", "y", "+", "1", "-", "x", ")", "+", "x", "return", "gray_out" ]
https://github.com/tangzhenyu/Scene-Text-Understanding/blob/0f7ffc7aea5971a50cdc03d33d0a41075285948b/SynthText_Chinese/generateDataNew.py#L19-L22
freesurfer/freesurfer
6dbe527d43ffa611acb2cd112e9469f9bfec8e36
sscnn_skullstripping/sscnn_skullstripping/deeplearn_utils/DeepImageSynth.py
python
FeatureGenerator.get_multi_class_labels
(self, data, n_labels)
Translates a label map into a set of binary labels. :param data: numpy array containing the label map with shape: (n_samples, 1, ...). :param n_labels: number of labels. :param labels: integer values of the labels. :return: binary numpy array of shape: (n_samples, n_labels, ...)
Translates a label map into a set of binary labels. :param data: numpy array containing the label map with shape: (n_samples, 1, ...). :param n_labels: number of labels. :param labels: integer values of the labels. :return: binary numpy array of shape: (n_samples, n_labels, ...)
[ "Translates", "a", "label", "map", "into", "a", "set", "of", "binary", "labels", ".", ":", "param", "data", ":", "numpy", "array", "containing", "the", "label", "map", "with", "shape", ":", "(", "n_samples", "1", "...", ")", ".", ":", "param", "n_label...
def get_multi_class_labels(self, data, n_labels): """ Translates a label map into a set of binary labels. :param data: numpy array containing the label map with shape: (n_samples, 1, ...). :param n_labels: number of labels. :param labels: integer values of the labels. :re...
[ "def", "get_multi_class_labels", "(", "self", ",", "data", ",", "n_labels", ")", ":", "labels", "=", "range", "(", "n_labels", ")", "new_shape", "=", "list", "(", "data", ".", "shape", "[", "0", ":", "-", "1", "]", ")", "+", "[", "n_labels", "]", "...
https://github.com/freesurfer/freesurfer/blob/6dbe527d43ffa611acb2cd112e9469f9bfec8e36/sscnn_skullstripping/sscnn_skullstripping/deeplearn_utils/DeepImageSynth.py#L3503-L3530
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/config/ios/codesign.py
python
ProvisioningProfile.ValidToSignBundle
(self, bundle_identifier)
return fnmatch.fnmatch( '%s.%s' % (self.application_identifier_prefix, bundle_identifier), self.application_identifier_pattern)
Checks whether the provisioning profile can sign bundle_identifier. Args: bundle_identifier: the identifier of the bundle that needs to be signed. Returns: True if the mobile provisioning profile can be used to sign a bundle with the corresponding bundle_identifier, False otherwise.
Checks whether the provisioning profile can sign bundle_identifier.
[ "Checks", "whether", "the", "provisioning", "profile", "can", "sign", "bundle_identifier", "." ]
def ValidToSignBundle(self, bundle_identifier): """Checks whether the provisioning profile can sign bundle_identifier. Args: bundle_identifier: the identifier of the bundle that needs to be signed. Returns: True if the mobile provisioning profile can be used to sign a bundle with the cor...
[ "def", "ValidToSignBundle", "(", "self", ",", "bundle_identifier", ")", ":", "return", "fnmatch", ".", "fnmatch", "(", "'%s.%s'", "%", "(", "self", ".", "application_identifier_prefix", ",", "bundle_identifier", ")", ",", "self", ".", "application_identifier_pattern...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/config/ios/codesign.py#L212-L224
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/valid-parenthesis-string.py
python
Solution.checkValidString
(self, s)
return lower == 0
:type s: str :rtype: bool
:type s: str :rtype: bool
[ ":", "type", "s", ":", "str", ":", "rtype", ":", "bool" ]
def checkValidString(self, s): """ :type s: str :rtype: bool """ lower, upper = 0, 0 # keep lower bound and upper bound of '(' counts for c in s: lower += 1 if c == '(' else -1 upper -= 1 if c == ')' else -1 if upper < 0: break ...
[ "def", "checkValidString", "(", "self", ",", "s", ")", ":", "lower", ",", "upper", "=", "0", ",", "0", "# keep lower bound and upper bound of '(' counts", "for", "c", "in", "s", ":", "lower", "+=", "1", "if", "c", "==", "'('", "else", "-", "1", "upper", ...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/valid-parenthesis-string.py#L5-L16
s9xie/hed
94fb22f10cbfec8d84fbc0642b224022014b6bd6
python/caffe/pycaffe.py
python
_Net_blob_loss_weights
(self)
return OrderedDict(zip(self._blob_names, self._blob_loss_weights))
An OrderedDict (bottom to top, i.e., input to output) of network blob loss weights indexed by name
An OrderedDict (bottom to top, i.e., input to output) of network blob loss weights indexed by name
[ "An", "OrderedDict", "(", "bottom", "to", "top", "i", ".", "e", ".", "input", "to", "output", ")", "of", "network", "blob", "loss", "weights", "indexed", "by", "name" ]
def _Net_blob_loss_weights(self): """ An OrderedDict (bottom to top, i.e., input to output) of network blob loss weights indexed by name """ return OrderedDict(zip(self._blob_names, self._blob_loss_weights))
[ "def", "_Net_blob_loss_weights", "(", "self", ")", ":", "return", "OrderedDict", "(", "zip", "(", "self", ".", "_blob_names", ",", "self", ".", "_blob_loss_weights", ")", ")" ]
https://github.com/s9xie/hed/blob/94fb22f10cbfec8d84fbc0642b224022014b6bd6/python/caffe/pycaffe.py#L31-L36
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/platform/tf_logging.py
python
get_verbosity
()
return _logger.getEffectiveLevel()
Return how much logging output will be produced.
Return how much logging output will be produced.
[ "Return", "how", "much", "logging", "output", "will", "be", "produced", "." ]
def get_verbosity(): """Return how much logging output will be produced.""" return _logger.getEffectiveLevel()
[ "def", "get_verbosity", "(", ")", ":", "return", "_logger", ".", "getEffectiveLevel", "(", ")" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/platform/tf_logging.py#L192-L194
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/offline_debug/mi_validators.py
python
check_read_tensor_info
(method)
return new_method
Wrapper method to check the parameters of DbgServices ReadTensors.
Wrapper method to check the parameters of DbgServices ReadTensors.
[ "Wrapper", "method", "to", "check", "the", "parameters", "of", "DbgServices", "ReadTensors", "." ]
def check_read_tensor_info(method): """Wrapper method to check the parameters of DbgServices ReadTensors.""" @wraps(method) def new_method(self, *args, **kwargs): [info_list], _ = parse_user_args(method, *args, **kwargs) info_names = ["info_{0}".format(i) for i in range(len(info_list))] ...
[ "def", "check_read_tensor_info", "(", "method", ")", ":", "@", "wraps", "(", "method", ")", "def", "new_method", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "[", "info_list", "]", ",", "_", "=", "parse_user_args", "(", "method", ...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/offline_debug/mi_validators.py#L116-L128
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
xmlDoc.newGlobalNs
(self, href, prefix)
return __tmp
Creation of a Namespace, the old way using PI and without scoping DEPRECATED !!!
Creation of a Namespace, the old way using PI and without scoping DEPRECATED !!!
[ "Creation", "of", "a", "Namespace", "the", "old", "way", "using", "PI", "and", "without", "scoping", "DEPRECATED", "!!!" ]
def newGlobalNs(self, href, prefix): """Creation of a Namespace, the old way using PI and without scoping DEPRECATED !!! """ ret = libxml2mod.xmlNewGlobalNs(self._o, href, prefix) if ret is None:raise treeError('xmlNewGlobalNs() failed') __tmp = xmlNs(_obj=ret) return ...
[ "def", "newGlobalNs", "(", "self", ",", "href", ",", "prefix", ")", ":", "ret", "=", "libxml2mod", ".", "xmlNewGlobalNs", "(", "self", ".", "_o", ",", "href", ",", "prefix", ")", "if", "ret", "is", "None", ":", "raise", "treeError", "(", "'xmlNewGlobal...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L4407-L4413
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/model/trajectory.py
python
Trajectory.save
(self, fn: str)
Writes to a whitespace-separated file
Writes to a whitespace-separated file
[ "Writes", "to", "a", "whitespace", "-", "separated", "file" ]
def save(self, fn: str) -> None: """Writes to a whitespace-separated file""" fout = open(fn, 'w') for t,x in zip(self.times,self.milestones): fout.write('%f\t%d '%(t,len(x))) fout.write(' '.join([str(xi) for xi in x])) fout.write('\n') fout.close()
[ "def", "save", "(", "self", ",", "fn", ":", "str", ")", "->", "None", ":", "fout", "=", "open", "(", "fn", ",", "'w'", ")", "for", "t", ",", "x", "in", "zip", "(", "self", ".", "times", ",", "self", ".", "milestones", ")", ":", "fout", ".", ...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/model/trajectory.py#L76-L83
taichi-dev/taichi
973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6
python/taichi/lang/common_ops.py
python
TaichiOperations.atomic_or
(self, other)
return ops.atomic_or(self, other)
Return the new expression of computing atomic or between self and a given operand. Args: other (Any): Given operand. Returns: :class:`~taichi.lang.expr.Expr`: The computing expression of atomic or.
Return the new expression of computing atomic or between self and a given operand.
[ "Return", "the", "new", "expression", "of", "computing", "atomic", "or", "between", "self", "and", "a", "given", "operand", "." ]
def atomic_or(self, other): """Return the new expression of computing atomic or between self and a given operand. Args: other (Any): Given operand. Returns: :class:`~taichi.lang.expr.Expr`: The computing expression of atomic or.""" return ops.atomic_or(self, oth...
[ "def", "atomic_or", "(", "self", ",", "other", ")", ":", "return", "ops", ".", "atomic_or", "(", "self", ",", "other", ")" ]
https://github.com/taichi-dev/taichi/blob/973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6/python/taichi/lang/common_ops.py#L168-L176
shedskin/shedskin
ae88dbca7b1d9671cd8be448cb0b497122758936
examples/c64/cpu.py
python
CPU.ORA
(self, opcode = 0x1)
ORA with A
ORA with A
[ "ORA", "with", "A" ]
def ORA(self, opcode = 0x1): """ ORA with A """ reference_value = self.read_register(S_A) addressing_mode = CPU.ORA_addressing_modes[opcode] value = self.load_value_advancing(addressing_mode) result = value | reference_value self.write_register(S_A, result) self.u...
[ "def", "ORA", "(", "self", ",", "opcode", "=", "0x1", ")", ":", "reference_value", "=", "self", ".", "read_register", "(", "S_A", ")", "addressing_mode", "=", "CPU", ".", "ORA_addressing_modes", "[", "opcode", "]", "value", "=", "self", ".", "load_value_ad...
https://github.com/shedskin/shedskin/blob/ae88dbca7b1d9671cd8be448cb0b497122758936/examples/c64/cpu.py#L1354-L1361