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
alibaba/weex_js_engine
2bdf4b6f020c1fc99c63f649718f6faf7e27fdde
jni/v8core/v8/build/gyp/pylib/gyp/generator/make.py
python
MakefileWriter.WriteAndroidNdkModuleRule
(self, module_name, all_sources, link_deps)
Write a set of LOCAL_XXX definitions for Android NDK. These variable definitions will be used by Android NDK but do nothing for non-Android applications. Arguments: module_name: Android NDK module name, which must be unique among all module names. all_sources: A list of source files ...
Write a set of LOCAL_XXX definitions for Android NDK.
[ "Write", "a", "set", "of", "LOCAL_XXX", "definitions", "for", "Android", "NDK", "." ]
def WriteAndroidNdkModuleRule(self, module_name, all_sources, link_deps): """Write a set of LOCAL_XXX definitions for Android NDK. These variable definitions will be used by Android NDK but do nothing for non-Android applications. Arguments: module_name: Android NDK module name, which must be un...
[ "def", "WriteAndroidNdkModuleRule", "(", "self", ",", "module_name", ",", "all_sources", ",", "link_deps", ")", ":", "if", "self", ".", "type", "not", "in", "(", "'executable'", ",", "'shared_library'", ",", "'static_library'", ")", ":", "return", "self", ".",...
https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/generator/make.py#L1714-L1794
materialx/MaterialX
77ff72f352470b5c76dddde765951a8e3bcf79fc
python/MaterialX/main.py
python
_setValue
(self, value, typeString = '')
Set the typed value of an element.
Set the typed value of an element.
[ "Set", "the", "typed", "value", "of", "an", "element", "." ]
def _setValue(self, value, typeString = ''): "Set the typed value of an element." method = getattr(self.__class__, "_setValue" + getTypeString(value)) method(self, value, typeString)
[ "def", "_setValue", "(", "self", ",", "value", ",", "typeString", "=", "''", ")", ":", "method", "=", "getattr", "(", "self", ".", "__class__", ",", "\"_setValue\"", "+", "getTypeString", "(", "value", ")", ")", "method", "(", "self", ",", "value", ","...
https://github.com/materialx/MaterialX/blob/77ff72f352470b5c76dddde765951a8e3bcf79fc/python/MaterialX/main.py#L67-L70
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_tab.py
python
EdTabBase.DoTabClosing
(self)
Called when the tab has been selected to be closed in the notebook
Called when the tab has been selected to be closed in the notebook
[ "Called", "when", "the", "tab", "has", "been", "selected", "to", "be", "closed", "in", "the", "notebook" ]
def DoTabClosing(self): """Called when the tab has been selected to be closed in the notebook""" pass
[ "def", "DoTabClosing", "(", "self", ")", ":", "pass" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_tab.py#L59-L61
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py
python
Writer.WriteIfChanged
(self)
Writes the user file.
Writes the user file.
[ "Writes", "the", "user", "file", "." ]
def WriteIfChanged(self): """Writes the user file.""" configs = ["Configurations"] for config, spec in sorted(self.configurations.items()): configs.append(spec) content = [ "VisualStudioUserFile", {"Version": self.version.ProjectVersion(), "Name": sel...
[ "def", "WriteIfChanged", "(", "self", ")", ":", "configs", "=", "[", "\"Configurations\"", "]", "for", "config", ",", "spec", "in", "sorted", "(", "self", ".", "configurations", ".", "items", "(", ")", ")", ":", "configs", ".", "append", "(", "spec", "...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py#L140-L153
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/ops/check_ops.py
python
is_non_decreasing
(x, name=None)
Returns `True` if `x` is non-decreasing. Elements of `x` are compared in row-major order. The tensor `[x[0],...]` is non-decreasing if for every adjacent pair we have `x[i] <= x[i+1]`. If `x` has less than two elements, it is trivially non-decreasing. See also: `is_strictly_increasing` Args: x: Numer...
Returns `True` if `x` is non-decreasing.
[ "Returns", "True", "if", "x", "is", "non", "-", "decreasing", "." ]
def is_non_decreasing(x, name=None): """Returns `True` if `x` is non-decreasing. Elements of `x` are compared in row-major order. The tensor `[x[0],...]` is non-decreasing if for every adjacent pair we have `x[i] <= x[i+1]`. If `x` has less than two elements, it is trivially non-decreasing. See also: `is_...
[ "def", "is_non_decreasing", "(", "x", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "op_scope", "(", "[", "x", "]", ",", "name", ",", "'is_non_decreasing'", ")", ":", "diff", "=", "_get_diff_for_monotonic_comparison", "(", "x", ")", "# When len(x...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/check_ops.py#L661-L684
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/psutil/_psbsd.py
python
cpu_count_logical
()
return cext.cpu_count_logical()
Return the number of logical CPUs in the system.
Return the number of logical CPUs in the system.
[ "Return", "the", "number", "of", "logical", "CPUs", "in", "the", "system", "." ]
def cpu_count_logical(): """Return the number of logical CPUs in the system.""" return cext.cpu_count_logical()
[ "def", "cpu_count_logical", "(", ")", ":", "return", "cext", ".", "cpu_count_logical", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/psutil/_psbsd.py#L250-L252
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/codecs.py
python
IncrementalDecoder.setstate
(self, state)
Set the current state of the decoder. state must have been returned by getstate(). The effect of setstate((b"", 0)) must be equivalent to reset().
Set the current state of the decoder.
[ "Set", "the", "current", "state", "of", "the", "decoder", "." ]
def setstate(self, state): """ Set the current state of the decoder. state must have been returned by getstate(). The effect of setstate((b"", 0)) must be equivalent to reset(). """
[ "def", "setstate", "(", "self", ",", "state", ")", ":" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/codecs.py#L295-L301
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
Caret.GetSizeTuple
(*args, **kwargs)
return _misc_.Caret_GetSizeTuple(*args, **kwargs)
GetSizeTuple() -> (width, height)
GetSizeTuple() -> (width, height)
[ "GetSizeTuple", "()", "-", ">", "(", "width", "height", ")" ]
def GetSizeTuple(*args, **kwargs): """GetSizeTuple() -> (width, height)""" return _misc_.Caret_GetSizeTuple(*args, **kwargs)
[ "def", "GetSizeTuple", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "Caret_GetSizeTuple", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L766-L768
moai/moai-dev
0ba7c678311d1fa9dbc091f60665e95e54169fdf
3rdparty/libwebp-0.4.1/swig/libwebp.py
python
wrap_WebPEncodeLosslessRGBA
(*args)
return _libwebp.wrap_WebPEncodeLosslessRGBA(*args)
private, do not call directly.
private, do not call directly.
[ "private", "do", "not", "call", "directly", "." ]
def wrap_WebPEncodeLosslessRGBA(*args): """private, do not call directly.""" return _libwebp.wrap_WebPEncodeLosslessRGBA(*args)
[ "def", "wrap_WebPEncodeLosslessRGBA", "(", "*", "args", ")", ":", "return", "_libwebp", ".", "wrap_WebPEncodeLosslessRGBA", "(", "*", "args", ")" ]
https://github.com/moai/moai-dev/blob/0ba7c678311d1fa9dbc091f60665e95e54169fdf/3rdparty/libwebp-0.4.1/swig/libwebp.py#L127-L129
protocolbuffers/protobuf
b5ab0b7a18b7336c60130f4ddb2d97c51792f896
python/google/protobuf/descriptor.py
python
EnumValueDescriptor.__init__
(self, name, index, number, type=None, # pylint: disable=redefined-builtin options=None, serialized_options=None, create_key=None)
Arguments are as described in the attribute description above.
Arguments are as described in the attribute description above.
[ "Arguments", "are", "as", "described", "in", "the", "attribute", "description", "above", "." ]
def __init__(self, name, index, number, type=None, # pylint: disable=redefined-builtin options=None, serialized_options=None, create_key=None): """Arguments are as described in the attribute description above.""" if create_key is not _internal_create_key: _Deprecated('EnumVa...
[ "def", "__init__", "(", "self", ",", "name", ",", "index", ",", "number", ",", "type", "=", "None", ",", "# pylint: disable=redefined-builtin", "options", "=", "None", ",", "serialized_options", "=", "None", ",", "create_key", "=", "None", ")", ":", "if", ...
https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/google/protobuf/descriptor.py#L738-L750
shogun-toolbox/shogun
9b8d856971af5a295dd6ad70623ae45647a6334c
examples/meta/generator/translate.py
python
Translator.dependenciesString
(self, allClasses, interfacedClasses, enums, globalFunctions)
return result
Returns dependency import string e.g. for python: "from shogun import RealFeatures\n\n"
Returns dependency import string e.g. for python: "from shogun import RealFeatures\n\n"
[ "Returns", "dependency", "import", "string", "e", ".", "g", ".", "for", "python", ":", "from", "shogun", "import", "RealFeatures", "\\", "n", "\\", "n" ]
def dependenciesString(self, allClasses, interfacedClasses, enums, globalFunctions): """ Returns dependency import string e.g. for python: "from shogun import RealFeatures\n\n" """ if "Dependencies" not in self.targetDict: # Dependency strings ...
[ "def", "dependenciesString", "(", "self", ",", "allClasses", ",", "interfacedClasses", ",", "enums", ",", "globalFunctions", ")", ":", "if", "\"Dependencies\"", "not", "in", "self", ".", "targetDict", ":", "# Dependency strings are optional so we just return empty string"...
https://github.com/shogun-toolbox/shogun/blob/9b8d856971af5a295dd6ad70623ae45647a6334c/examples/meta/generator/translate.py#L333-L367
protocolbuffers/protobuf
b5ab0b7a18b7336c60130f4ddb2d97c51792f896
python/google/protobuf/internal/encoder.py
python
MessageSizer
(field_number, is_repeated, is_packed)
Returns a sizer for a message field.
Returns a sizer for a message field.
[ "Returns", "a", "sizer", "for", "a", "message", "field", "." ]
def MessageSizer(field_number, is_repeated, is_packed): """Returns a sizer for a message field.""" tag_size = _TagSize(field_number) local_VarintSize = _VarintSize assert not is_packed if is_repeated: def RepeatedFieldSize(value): result = tag_size * len(value) for element in value: l...
[ "def", "MessageSizer", "(", "field_number", ",", "is_repeated", ",", "is_packed", ")", ":", "tag_size", "=", "_TagSize", "(", "field_number", ")", "local_VarintSize", "=", "_VarintSize", "assert", "not", "is_packed", "if", "is_repeated", ":", "def", "RepeatedField...
https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/google/protobuf/internal/encoder.py#L290-L308
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/common-code/ServiceClient_Python/cgf_service_client/path.py
python
Path.__init__
(self, url, **kwargs)
Initializes a path object. Arguments: - url: the url represented by the Path object. - kwargs: the configuration used by the Path object. The following configuration properties are supported: - session: a boto3.Session object that has the aws credentials and ...
Initializes a path object.
[ "Initializes", "a", "path", "object", "." ]
def __init__(self, url, **kwargs): """Initializes a path object. Arguments: - url: the url represented by the Path object. - kwargs: the configuration used by the Path object. The following configuration properties are supported: - session: a boto3.Session o...
[ "def", "__init__", "(", "self", ",", "url", ",", "*", "*", "kwargs", ")", ":", "# TODO: add support for a \"spec\" configuration item. A spec is a description ", "# of the child paths and operations supported by this path. A spec can be", "# generated from a swagger api description, 'com...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/ServiceClient_Python/cgf_service_client/path.py#L84-L188
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/generic.py
python
NDFrame.convert_dtypes
( self: FrameOrSeries, infer_objects: bool_t = True, convert_string: bool_t = True, convert_integer: bool_t = True, convert_boolean: bool_t = True, convert_floating: bool_t = True, )
Convert columns to best possible dtypes using dtypes supporting ``pd.NA``. .. versionadded:: 1.0.0 Parameters ---------- infer_objects : bool, default True Whether object dtypes should be converted to the best possible types. convert_string : bool, default True ...
Convert columns to best possible dtypes using dtypes supporting ``pd.NA``.
[ "Convert", "columns", "to", "best", "possible", "dtypes", "using", "dtypes", "supporting", "pd", ".", "NA", "." ]
def convert_dtypes( self: FrameOrSeries, infer_objects: bool_t = True, convert_string: bool_t = True, convert_integer: bool_t = True, convert_boolean: bool_t = True, convert_floating: bool_t = True, ) -> FrameOrSeries: """ Convert columns to best possi...
[ "def", "convert_dtypes", "(", "self", ":", "FrameOrSeries", ",", "infer_objects", ":", "bool_t", "=", "True", ",", "convert_string", ":", "bool_t", "=", "True", ",", "convert_integer", ":", "bool_t", "=", "True", ",", "convert_boolean", ":", "bool_t", "=", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/generic.py#L6034-L6190
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/check_ops.py
python
_assert_static
(condition, data)
Raises a InvalidArgumentError with as much information as possible.
Raises a InvalidArgumentError with as much information as possible.
[ "Raises", "a", "InvalidArgumentError", "with", "as", "much", "information", "as", "possible", "." ]
def _assert_static(condition, data): """Raises a InvalidArgumentError with as much information as possible.""" if not condition: data_static = [_maybe_constant_value_string(x) for x in data] raise errors.InvalidArgumentError(node_def=None, op=None, message='\n'.join(dat...
[ "def", "_assert_static", "(", "condition", ",", "data", ")", ":", "if", "not", "condition", ":", "data_static", "=", "[", "_maybe_constant_value_string", "(", "x", ")", "for", "x", "in", "data", "]", "raise", "errors", ".", "InvalidArgumentError", "(", "node...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/check_ops.py#L80-L85
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
lldb/third_party/Python/module/pexpect-4.6/pexpect/expect.py
python
Expecter.expect_loop
(self, timeout=-1)
Blocking expect
Blocking expect
[ "Blocking", "expect" ]
def expect_loop(self, timeout=-1): """Blocking expect""" spawn = self.spawn if timeout is not None: end_time = time.time() + timeout try: incoming = spawn.buffer spawn._buffer = spawn.buffer_type() spawn._before = spawn.buffer_type() ...
[ "def", "expect_loop", "(", "self", ",", "timeout", "=", "-", "1", ")", ":", "spawn", "=", "self", ".", "spawn", "if", "timeout", "is", "not", "None", ":", "end_time", "=", "time", ".", "time", "(", ")", "+", "timeout", "try", ":", "incoming", "=", ...
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/lldb/third_party/Python/module/pexpect-4.6/pexpect/expect.py#L91-L122
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Script/SConsOptions.py
python
SConsValues.set_option
(self, name, value)
Sets an option from an SConscript file.
Sets an option from an SConscript file.
[ "Sets", "an", "option", "from", "an", "SConscript", "file", "." ]
def set_option(self, name, value): """ Sets an option from an SConscript file. """ if name not in self.settable: raise SCons.Errors.UserError("This option is not settable from a SConscript file: %s"%name) if name == 'num_jobs': try: value ...
[ "def", "set_option", "(", "self", ",", "name", ",", "value", ")", ":", "if", "name", "not", "in", "self", ".", "settable", ":", "raise", "SCons", ".", "Errors", ".", "UserError", "(", "\"This option is not settable from a SConscript file: %s\"", "%", "name", "...
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Script/SConsOptions.py#L142-L200
bulletphysics/bullet3
f0f2a952e146f016096db6f85cf0c44ed75b0b9a
examples/pybullet/gym/pybullet_envs/agents/tools/streaming_mean.py
python
StreamingMean.__init__
(self, shape, dtype)
Specify the shape and dtype of the mean to be estimated. Note that a float mean to zero submitted elements is NaN, while computing the integer mean of zero elements raises a division by zero error. Args: shape: Shape of the mean to compute. dtype: Data type of the mean to compute.
Specify the shape and dtype of the mean to be estimated.
[ "Specify", "the", "shape", "and", "dtype", "of", "the", "mean", "to", "be", "estimated", "." ]
def __init__(self, shape, dtype): """Specify the shape and dtype of the mean to be estimated. Note that a float mean to zero submitted elements is NaN, while computing the integer mean of zero elements raises a division by zero error. Args: shape: Shape of the mean to compute. dtype: Data ...
[ "def", "__init__", "(", "self", ",", "shape", ",", "dtype", ")", ":", "self", ".", "_dtype", "=", "dtype", "self", ".", "_sum", "=", "tf", ".", "Variable", "(", "lambda", ":", "tf", ".", "zeros", "(", "shape", ",", "dtype", ")", ",", "False", ")"...
https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/agents/tools/streaming_mean.py#L28-L40
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/compiler-rt/lib/sanitizer_common/scripts/cpplint.py
python
ParseNolintSuppressions
(filename, raw_line, linenum, error)
Updates the global list of error-suppressions. Parses any NOLINT comments on the current line, updating the global error_suppressions store. Reports an error if the NOLINT comment was malformed. Args: filename: str, the name of the input file. raw_line: str, the line of input text, with comments. ...
Updates the global list of error-suppressions.
[ "Updates", "the", "global", "list", "of", "error", "-", "suppressions", "." ]
def ParseNolintSuppressions(filename, raw_line, linenum, error): """Updates the global list of error-suppressions. Parses any NOLINT comments on the current line, updating the global error_suppressions store. Reports an error if the NOLINT comment was malformed. Args: filename: str, the name of the inp...
[ "def", "ParseNolintSuppressions", "(", "filename", ",", "raw_line", ",", "linenum", ",", "error", ")", ":", "# FIXME(adonovan): \"NOLINT(\" is misparsed as NOLINT(*).", "matched", "=", "_RE_SUPPRESSION", ".", "search", "(", "raw_line", ")", "if", "matched", ":", "cate...
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L360-L386
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/robotsim.py
python
RobotModel.selfCollides
(self)
return _robotsim.RobotModel_selfCollides(self)
r""" Returns true if the robot is in self collision (faster than manual testing)
r""" Returns true if the robot is in self collision (faster than manual testing)
[ "r", "Returns", "true", "if", "the", "robot", "is", "in", "self", "collision", "(", "faster", "than", "manual", "testing", ")" ]
def selfCollides(self) ->bool: r""" Returns true if the robot is in self collision (faster than manual testing) """ return _robotsim.RobotModel_selfCollides(self)
[ "def", "selfCollides", "(", "self", ")", "->", "bool", ":", "return", "_robotsim", ".", "RobotModel_selfCollides", "(", "self", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L5186-L5191
jackaudio/jack2
21b293dbc37d42446141a08922cdec0d2550c6a0
waflib/Scripting.py
python
set_main_module
(file_path)
Read the main wscript file into :py:const:`waflib.Context.Context.g_module` and bind default functions such as ``init``, ``dist``, ``distclean`` if not defined. Called by :py:func:`waflib.Scripting.waf_entry_point` during the initialization. :param file_path: absolute path representing the top-level wscript file :...
Read the main wscript file into :py:const:`waflib.Context.Context.g_module` and bind default functions such as ``init``, ``dist``, ``distclean`` if not defined. Called by :py:func:`waflib.Scripting.waf_entry_point` during the initialization.
[ "Read", "the", "main", "wscript", "file", "into", ":", "py", ":", "const", ":", "waflib", ".", "Context", ".", "Context", ".", "g_module", "and", "bind", "default", "functions", "such", "as", "init", "dist", "distclean", "if", "not", "defined", ".", "Cal...
def set_main_module(file_path): """ Read the main wscript file into :py:const:`waflib.Context.Context.g_module` and bind default functions such as ``init``, ``dist``, ``distclean`` if not defined. Called by :py:func:`waflib.Scripting.waf_entry_point` during the initialization. :param file_path: absolute path repr...
[ "def", "set_main_module", "(", "file_path", ")", ":", "Context", ".", "g_module", "=", "Context", ".", "load_module", "(", "file_path", ")", "Context", ".", "g_module", ".", "root_path", "=", "file_path", "# note: to register the module globally, use the following:", ...
https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/Scripting.py#L182-L209
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/cluster/hierarchy.py
python
_copy_array_if_base_present
(a)
Copy the array if its base points to a parent array.
Copy the array if its base points to a parent array.
[ "Copy", "the", "array", "if", "its", "base", "points", "to", "a", "parent", "array", "." ]
def _copy_array_if_base_present(a): """ Copy the array if its base points to a parent array. """ if a.base is not None: return a.copy() elif np.issubsctype(a, np.float32): return np.array(a, dtype=np.double) else: return a
[ "def", "_copy_array_if_base_present", "(", "a", ")", ":", "if", "a", ".", "base", "is", "not", "None", ":", "return", "a", ".", "copy", "(", ")", "elif", "np", ".", "issubsctype", "(", "a", ",", "np", ".", "float32", ")", ":", "return", "np", ".", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/cluster/hierarchy.py#L206-L215
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/pybind/mgr/mirroring/fs/snapshot_mirror.py
python
FSSnapshotMirror.config_get
(self, key)
return val
fetch a config key value from mon config store
fetch a config key value from mon config store
[ "fetch", "a", "config", "key", "value", "from", "mon", "config", "store" ]
def config_get(self, key): """fetch a config key value from mon config store""" cmd = {'prefix': 'config-key get', 'key': key} r, outs, err = self.mgr.mon_command(cmd) if r < 0 and not r == -errno.ENOENT: log.error(f'mon command to get config-key {key} failed: {err}') ...
[ "def", "config_get", "(", "self", ",", "key", ")", ":", "cmd", "=", "{", "'prefix'", ":", "'config-key get'", ",", "'key'", ":", "key", "}", "r", ",", "outs", ",", "err", "=", "self", ".", "mgr", ".", "mon_command", "(", "cmd", ")", "if", "r", "<...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/mirroring/fs/snapshot_mirror.py#L343-L353
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
src/bindings/python/src/compatibility/ngraph/opset1/ops.py
python
binary_convolution
( data: NodeInput, filters: NodeInput, strides: List[int], pads_begin: List[int], pads_end: List[int], dilations: List[int], mode: str, pad_value: float, auto_pad: str = "EXPLICIT", name: Optional[str] = None, )
return _get_node_factory_opset1().create( "BinaryConvolution", as_nodes(data, filters), { "strides": strides, "pads_begin": pads_begin, "pads_end": pads_end, "dilations": dilations, "mode": mode, "pad_value": pad_value, ...
Create node performing convolution with binary weights, binary input and integer output. :param data: The node providing data batch tensor. :param filter: The node providing filters tensor. :param strides: The kernel window movement strides. :param pads_begin: The number of pixels to add to the beginni...
Create node performing convolution with binary weights, binary input and integer output.
[ "Create", "node", "performing", "convolution", "with", "binary", "weights", "binary", "input", "and", "integer", "output", "." ]
def binary_convolution( data: NodeInput, filters: NodeInput, strides: List[int], pads_begin: List[int], pads_end: List[int], dilations: List[int], mode: str, pad_value: float, auto_pad: str = "EXPLICIT", name: Optional[str] = None, ) -> Node: """Create node performing convolu...
[ "def", "binary_convolution", "(", "data", ":", "NodeInput", ",", "filters", ":", "NodeInput", ",", "strides", ":", "List", "[", "int", "]", ",", "pads_begin", ":", "List", "[", "int", "]", ",", "pads_end", ":", "List", "[", "int", "]", ",", "dilations"...
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/src/bindings/python/src/compatibility/ngraph/opset1/ops.py#L177-L215
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/html2.py
python
WebView.CanGoForward
(*args, **kwargs)
return _html2.WebView_CanGoForward(*args, **kwargs)
CanGoForward(self) -> bool
CanGoForward(self) -> bool
[ "CanGoForward", "(", "self", ")", "-", ">", "bool" ]
def CanGoForward(*args, **kwargs): """CanGoForward(self) -> bool""" return _html2.WebView_CanGoForward(*args, **kwargs)
[ "def", "CanGoForward", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html2", ".", "WebView_CanGoForward", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/html2.py#L242-L244
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/agilepy/lib_wx/objpanel.py
python
WidgetContainer.apply_obj_to_valuewidget
(self)
Value of obj is read and applied to value widget. To be overwritten.
Value of obj is read and applied to value widget. To be overwritten.
[ "Value", "of", "obj", "is", "read", "and", "applied", "to", "value", "widget", ".", "To", "be", "overwritten", "." ]
def apply_obj_to_valuewidget(self): """ Value of obj is read and applied to value widget. To be overwritten. """ value = self.get_value_obj() # print 'apply_obj_to_valuewidget',self._attrconf.attrname, value self.set_widgetvalue(value)
[ "def", "apply_obj_to_valuewidget", "(", "self", ")", ":", "value", "=", "self", ".", "get_value_obj", "(", ")", "# print 'apply_obj_to_valuewidget',self._attrconf.attrname, value", "self", ".", "set_widgetvalue", "(", "value", ")" ]
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/agilepy/lib_wx/objpanel.py#L439-L446
yuxng/PoseCNN
9f3dd7b7bce21dcafc05e8f18ccc90da3caabd04
lib/datasets/lov_single.py
python
lov_single.metadata_path_at
(self, i)
return self.metadata_path_from_index(self.image_index[i])
Return the absolute path to metadata i in the image sequence.
Return the absolute path to metadata i in the image sequence.
[ "Return", "the", "absolute", "path", "to", "metadata", "i", "in", "the", "image", "sequence", "." ]
def metadata_path_at(self, i): """ Return the absolute path to metadata i in the image sequence. """ return self.metadata_path_from_index(self.image_index[i])
[ "def", "metadata_path_at", "(", "self", ",", "i", ")", ":", "return", "self", ".", "metadata_path_from_index", "(", "self", ".", "image_index", "[", "i", "]", ")" ]
https://github.com/yuxng/PoseCNN/blob/9f3dd7b7bce21dcafc05e8f18ccc90da3caabd04/lib/datasets/lov_single.py#L122-L126
apache/qpid-proton
6bcdfebb55ea3554bc29b1901422532db331a591
python/proton/_transport.py
python
Transport.tick
(self, now: float)
return millis2secs(pn_transport_tick(self._impl, secs2millis(now)))
Process any pending transport timer events (like heartbeat generation). This method should be called after all pending input has been processed by the transport and before generating output. It returns the deadline for the next pending timer event, if any are present. .. note:: This fu...
Process any pending transport timer events (like heartbeat generation).
[ "Process", "any", "pending", "transport", "timer", "events", "(", "like", "heartbeat", "generation", ")", "." ]
def tick(self, now: float) -> float: """ Process any pending transport timer events (like heartbeat generation). This method should be called after all pending input has been processed by the transport and before generating output. It returns the deadline for the next pending ti...
[ "def", "tick", "(", "self", ",", "now", ":", "float", ")", "->", "float", ":", "return", "millis2secs", "(", "pn_transport_tick", "(", "self", ".", "_impl", ",", "secs2millis", "(", "now", ")", ")", ")" ]
https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_transport.py#L253-L270
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
sdhash-ui/jinja2/compiler.py
python
CodeGenerator.newline
(self, node=None, extra=0)
Add one or more newlines before the next write.
Add one or more newlines before the next write.
[ "Add", "one", "or", "more", "newlines", "before", "the", "next", "write", "." ]
def newline(self, node=None, extra=0): """Add one or more newlines before the next write.""" self._new_lines = max(self._new_lines, 1 + extra) if node is not None and node.lineno != self._last_line: self._write_debug_info = node.lineno self._last_line = node.lineno
[ "def", "newline", "(", "self", ",", "node", "=", "None", ",", "extra", "=", "0", ")", ":", "self", ".", "_new_lines", "=", "max", "(", "self", ".", "_new_lines", ",", "1", "+", "extra", ")", "if", "node", "is", "not", "None", "and", "node", ".", ...
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/jinja2/compiler.py#L514-L519
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/lib/regutil.py
python
RegisterFileExtensions
(defPyIcon, defPycIcon, runCommand)
Register the core Python file extensions. defPyIcon -- The default icon to use for .py files, in 'fname,offset' format. defPycIcon -- The default icon to use for .pyc files, in 'fname,offset' format. runCommand -- The command line to use for running .py files
Register the core Python file extensions. defPyIcon -- The default icon to use for .py files, in 'fname,offset' format. defPycIcon -- The default icon to use for .pyc files, in 'fname,offset' format. runCommand -- The command line to use for running .py files
[ "Register", "the", "core", "Python", "file", "extensions", ".", "defPyIcon", "--", "The", "default", "icon", "to", "use", "for", ".", "py", "files", "in", "fname", "offset", "format", ".", "defPycIcon", "--", "The", "default", "icon", "to", "use", "for", ...
def RegisterFileExtensions(defPyIcon, defPycIcon, runCommand): """Register the core Python file extensions. defPyIcon -- The default icon to use for .py files, in 'fname,offset' format. defPycIcon -- The default icon to use for .pyc files, in 'fname,offset' format. runCommand -- The command line to use f...
[ "def", "RegisterFileExtensions", "(", "defPyIcon", ",", "defPycIcon", ",", "runCommand", ")", ":", "# Register the file extensions.", "pythonFileId", "=", "RegistryIDPyFile", "win32api", ".", "RegSetValue", "(", "win32con", ".", "HKEY_CLASSES_ROOT", ",", "\".py\"", ",",...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/lib/regutil.py#L242-L266
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/ma/core.py
python
MaskedArray.__float__
(self)
return float(self.item())
Convert to float.
Convert to float.
[ "Convert", "to", "float", "." ]
def __float__(self): """ Convert to float. """ if self.size > 1: raise TypeError("Only length-1 arrays can be converted " "to Python scalars") elif self._mask: warnings.warn("Warning: converting a masked element to nan.", stack...
[ "def", "__float__", "(", "self", ")", ":", "if", "self", ".", "size", ">", "1", ":", "raise", "TypeError", "(", "\"Only length-1 arrays can be converted \"", "\"to Python scalars\"", ")", "elif", "self", ".", "_mask", ":", "warnings", ".", "warn", "(", "\"Warn...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/ma/core.py#L4290-L4301
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/tkSimpleDialog.py
python
Dialog.__init__
(self, parent, title = None)
Initialize a dialog. Arguments: parent -- a parent window (the application window) title -- the dialog title
Initialize a dialog.
[ "Initialize", "a", "dialog", "." ]
def __init__(self, parent, title = None): '''Initialize a dialog. Arguments: parent -- a parent window (the application window) title -- the dialog title ''' Toplevel.__init__(self, parent) self.withdraw() # remain invisible for now # If the m...
[ "def", "__init__", "(", "self", ",", "parent", ",", "title", "=", "None", ")", ":", "Toplevel", ".", "__init__", "(", "self", ",", "parent", ")", "self", ".", "withdraw", "(", ")", "# remain invisible for now", "# If the master is not viewable, don't", "# make t...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/tkSimpleDialog.py#L37-L86
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/driver.py
python
Device.COMPUTE_CAPABILITY
(self)
return self.compute_capability
For backward compatibility
For backward compatibility
[ "For", "backward", "compatibility" ]
def COMPUTE_CAPABILITY(self): """ For backward compatibility """ warnings.warn("Deprecated attribute 'COMPUTE_CAPABILITY'; use lower " "case version", DeprecationWarning) return self.compute_capability
[ "def", "COMPUTE_CAPABILITY", "(", "self", ")", ":", "warnings", ".", "warn", "(", "\"Deprecated attribute 'COMPUTE_CAPABILITY'; use lower \"", "\"case version\"", ",", "DeprecationWarning", ")", "return", "self", ".", "compute_capability" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/driver.py#L480-L486
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/framework/common_shapes.py
python
unchanged_shape
(op)
return [op.inputs[0].get_shape()]
Shape function for ops that output an tensor like their first input.
Shape function for ops that output an tensor like their first input.
[ "Shape", "function", "for", "ops", "that", "output", "an", "tensor", "like", "their", "first", "input", "." ]
def unchanged_shape(op): """Shape function for ops that output an tensor like their first input.""" return [op.inputs[0].get_shape()]
[ "def", "unchanged_shape", "(", "op", ")", ":", "return", "[", "op", ".", "inputs", "[", "0", "]", ".", "get_shape", "(", ")", "]" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/framework/common_shapes.py#L36-L38
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailbox.py
python
Mailbox.iterkeys
(self)
Return an iterator over keys.
Return an iterator over keys.
[ "Return", "an", "iterator", "over", "keys", "." ]
def iterkeys(self): """Return an iterator over keys.""" raise NotImplementedError('Method must be implemented by subclass')
[ "def", "iterkeys", "(", "self", ")", ":", "raise", "NotImplementedError", "(", "'Method must be implemented by subclass'", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailbox.py#L98-L100
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/refactor.py
python
RefactoringTool.refactor
(self, items, write=False, doctests_only=False)
Refactor a list of files and directories.
Refactor a list of files and directories.
[ "Refactor", "a", "list", "of", "files", "and", "directories", "." ]
def refactor(self, items, write=False, doctests_only=False): """Refactor a list of files and directories.""" for dir_or_file in items: if os.path.isdir(dir_or_file): self.refactor_dir(dir_or_file, write, doctests_only) else: self.refactor_file(dir...
[ "def", "refactor", "(", "self", ",", "items", ",", "write", "=", "False", ",", "doctests_only", "=", "False", ")", ":", "for", "dir_or_file", "in", "items", ":", "if", "os", ".", "path", ".", "isdir", "(", "dir_or_file", ")", ":", "self", ".", "refac...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/refactor.py#L275-L282
cathywu/Sentiment-Analysis
eb501fd1375c0c3f3ab430f963255f1bb858e659
PyML-0.7.9/PyML/utils/fasta.py
python
fasta_slice.__init__
(self, src, first, last = None)
:Parameters: - `src` - the fasta file/file handle. file can be gzipped. - `first` - the first record (either its index in the file or its identifier - `last` - the last record to be output (index in the file or identifier)
:Parameters: - `src` - the fasta file/file handle. file can be gzipped. - `first` - the first record (either its index in the file or its identifier - `last` - the last record to be output (index in the file or identifier)
[ ":", "Parameters", ":", "-", "src", "-", "the", "fasta", "file", "/", "file", "handle", ".", "file", "can", "be", "gzipped", ".", "-", "first", "-", "the", "first", "record", "(", "either", "its", "index", "in", "the", "file", "or", "its", "identifie...
def __init__(self, src, first, last = None): """ :Parameters: - `src` - the fasta file/file handle. file can be gzipped. - `first` - the first record (either its index in the file or its identifier - `last` - the last record to be output (index in the file or identifier...
[ "def", "__init__", "(", "self", ",", "src", ",", "first", ",", "last", "=", "None", ")", ":", "self", ".", "__itr", "=", "_fasta_itr", "(", "src", ")", "self", ".", "__first", "=", "first", "self", ".", "__last", "=", "last", "if", "type", "(", "...
https://github.com/cathywu/Sentiment-Analysis/blob/eb501fd1375c0c3f3ab430f963255f1bb858e659/PyML-0.7.9/PyML/utils/fasta.py#L151-L171
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/xgboost/python-package/xgboost/plotting.py
python
plot_tree
(booster, num_trees=0, rankdir='UT', ax=None, **kwargs)
return ax
Plot specified tree. Parameters ---------- booster : Booster, XGBModel Booster or XGBModel instance num_trees : int, default 0 Specify the ordinal number of target tree rankdir : str, default "UT" Passed to graphiz via graph_attr ax : matplotlib Axes, default None ...
Plot specified tree.
[ "Plot", "specified", "tree", "." ]
def plot_tree(booster, num_trees=0, rankdir='UT', ax=None, **kwargs): """Plot specified tree. Parameters ---------- booster : Booster, XGBModel Booster or XGBModel instance num_trees : int, default 0 Specify the ordinal number of target tree rankdir : str, default "UT" P...
[ "def", "plot_tree", "(", "booster", ",", "num_trees", "=", "0", ",", "rankdir", "=", "'UT'", ",", "ax", "=", "None", ",", "*", "*", "kwargs", ")", ":", "try", ":", "import", "matplotlib", ".", "pyplot", "as", "plt", "import", "matplotlib", ".", "imag...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/xgboost/python-package/xgboost/plotting.py#L206-L246
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/distutils/mingw32ccompiler.py
python
_build_import_library_x86
()
return
Build the import libraries for Mingw32-gcc on Windows
Build the import libraries for Mingw32-gcc on Windows
[ "Build", "the", "import", "libraries", "for", "Mingw32", "-", "gcc", "on", "Windows" ]
def _build_import_library_x86(): """ Build the import libraries for Mingw32-gcc on Windows """ lib_name = "python%d%d.lib" % tuple(sys.version_info[:2]) lib_file = os.path.join(sys.prefix, 'libs', lib_name) out_name = "libpython%d%d.a" % tuple(sys.version_info[:2]) out_file = os.path.join(sys.pr...
[ "def", "_build_import_library_x86", "(", ")", ":", "lib_name", "=", "\"python%d%d.lib\"", "%", "tuple", "(", "sys", ".", "version_info", "[", ":", "2", "]", ")", "lib_file", "=", "os", ".", "path", ".", "join", "(", "sys", ".", "prefix", ",", "'libs'", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/distutils/mingw32ccompiler.py#L404-L438
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/spatial/transform/rotation.py
python
Rotation.random
(cls, num=None, random_state=None)
return Rotation.from_quat(sample)
Generate uniformly distributed rotations. Parameters ---------- num : int or None, optional Number of random rotations to generate. If None (default), then a single rotation is generated. random_state : int, RandomState instance or None, optional Acce...
Generate uniformly distributed rotations.
[ "Generate", "uniformly", "distributed", "rotations", "." ]
def random(cls, num=None, random_state=None): """Generate uniformly distributed rotations. Parameters ---------- num : int or None, optional Number of random rotations to generate. If None (default), then a single rotation is generated. random_state : int...
[ "def", "random", "(", "cls", ",", "num", "=", "None", ",", "random_state", "=", "None", ")", ":", "random_state", "=", "check_random_state", "(", "random_state", ")", "if", "num", "is", "None", ":", "sample", "=", "random_state", ".", "normal", "(", "siz...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/spatial/transform/rotation.py#L1479-L1524
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/generator.py
python
LaTeX.GetId
(self)
return self._id
Returns the menu identifier for the LaTeX generator @return: id of that identifies this generator
Returns the menu identifier for the LaTeX generator @return: id of that identifies this generator
[ "Returns", "the", "menu", "identifier", "for", "the", "LaTeX", "generator", "@return", ":", "id", "of", "that", "identifies", "this", "generator" ]
def GetId(self): """Returns the menu identifier for the LaTeX generator @return: id of that identifies this generator """ return self._id
[ "def", "GetId", "(", "self", ")", ":", "return", "self", ".", "_id" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/generator.py#L655-L660
raymondlu/super-animation-samples
04234269112ff0dc32447f27a761dbbb00b8ba17
samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py
python
Index.parse
(self, path, args=None, unsaved_files=None, options = 0)
return TranslationUnit.from_source(path, args, unsaved_files, options, self)
Load the translation unit from the given source code file by running clang and generating the AST before loading. Additional command line parameters can be passed to clang via the args parameter. In-memory contents for files can be provided by passing a list of pairs to as unsaved_files...
Load the translation unit from the given source code file by running clang and generating the AST before loading. Additional command line parameters can be passed to clang via the args parameter.
[ "Load", "the", "translation", "unit", "from", "the", "given", "source", "code", "file", "by", "running", "clang", "and", "generating", "the", "AST", "before", "loading", ".", "Additional", "command", "line", "parameters", "can", "be", "passed", "to", "clang", ...
def parse(self, path, args=None, unsaved_files=None, options = 0): """Load the translation unit from the given source code file by running clang and generating the AST before loading. Additional command line parameters can be passed to clang via the args parameter. In-memory contents fo...
[ "def", "parse", "(", "self", ",", "path", ",", "args", "=", "None", ",", "unsaved_files", "=", "None", ",", "options", "=", "0", ")", ":", "return", "TranslationUnit", ".", "from_source", "(", "path", ",", "args", ",", "unsaved_files", ",", "options", ...
https://github.com/raymondlu/super-animation-samples/blob/04234269112ff0dc32447f27a761dbbb00b8ba17/samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L1923-L1937
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/profiler/pprof_profiler.py
python
Samples.__init__
(self, string_table)
Constructor. Args: string_table: A `StringTable` object.
Constructor.
[ "Constructor", "." ]
def __init__(self, string_table): """Constructor. Args: string_table: A `StringTable` object. """ self._string_table = string_table # TODO(annarev): figure out if location is unique for each node name. # If not, also key this dictionary based on location ids. self._node_name_to_sample...
[ "def", "__init__", "(", "self", ",", "string_table", ")", ":", "self", ".", "_string_table", "=", "string_table", "# TODO(annarev): figure out if location is unique for each node name.", "# If not, also key this dictionary based on location ids.", "self", ".", "_node_name_to_sample...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/profiler/pprof_profiler.py#L212-L221
microsoft/ivy
9f3c7ecc0b2383129fdd0953e10890d98d09a82d
ivy/ivy_parser.py
python
p_schdefnrhs_fmla
(p)
schdefnrhs : fmla
schdefnrhs : fmla
[ "schdefnrhs", ":", "fmla" ]
def p_schdefnrhs_fmla(p): 'schdefnrhs : fmla' p[0] = check_non_temporal(p[1])
[ "def", "p_schdefnrhs_fmla", "(", "p", ")", ":", "p", "[", "0", "]", "=", "check_non_temporal", "(", "p", "[", "1", "]", ")" ]
https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_parser.py#L527-L529
facebook/fbthrift
fb9c8562aba04c4fd9b17716eb5d970cc88a75bb
thrift/lib/py/util/asyncio.py
python
create_client
( client_klass, *, host=None, port=None, sock=None, loop=None, timeouts=None, client_type=None, ssl=None, )
return async_protocol_manager(coro)
create an asyncio thrift client and return an async context manager that can be used as follows: async with create_client(smc2_client, port=1421) as smc: await smc.getStatus() This can be used in the old way: with (await create_client(smc2_client, port=1421)) as smc: await smc.getStat...
create an asyncio thrift client and return an async context manager that can be used as follows:
[ "create", "an", "asyncio", "thrift", "client", "and", "return", "an", "async", "context", "manager", "that", "can", "be", "used", "as", "follows", ":" ]
def create_client( client_klass, *, host=None, port=None, sock=None, loop=None, timeouts=None, client_type=None, ssl=None, ): """ create an asyncio thrift client and return an async context manager that can be used as follows: asyn...
[ "def", "create_client", "(", "client_klass", ",", "*", ",", "host", "=", "None", ",", "port", "=", "None", ",", "sock", "=", "None", ",", "loop", "=", "None", ",", "timeouts", "=", "None", ",", "client_type", "=", "None", ",", "ssl", "=", "None", "...
https://github.com/facebook/fbthrift/blob/fb9c8562aba04c4fd9b17716eb5d970cc88a75bb/thrift/lib/py/util/asyncio.py#L47-L97
naver/sling
5671cd445a2caae0b4dd0332299e4cfede05062c
webkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/msgutil.py
python
MessageSender.__init__
(self, request)
Construct an instance. Args: request: mod_python request.
Construct an instance.
[ "Construct", "an", "instance", "." ]
def __init__(self, request): """Construct an instance. Args: request: mod_python request. """ threading.Thread.__init__(self) self._request = request self._queue = Queue.Queue() self.setDaemon(True) self.start()
[ "def", "__init__", "(", "self", ",", "request", ")", ":", "threading", ".", "Thread", ".", "__init__", "(", "self", ")", "self", ".", "_request", "=", "request", "self", ".", "_queue", "=", "Queue", ".", "Queue", "(", ")", "self", ".", "setDaemon", "...
https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/msgutil.py#L185-L195
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/vis/backends/qtbackend.py
python
QtGLWindow.setProgram
(self,program)
User will call this to set up the program variable
User will call this to set up the program variable
[ "User", "will", "call", "this", "to", "set", "up", "the", "program", "variable" ]
def setProgram(self,program): """User will call this to set up the program variable""" from ..glprogram import GLProgram assert isinstance(program,GLProgram) print "######### QGLWidget setProgram ###############" if hasattr(program,'name'): self.name = program.name ...
[ "def", "setProgram", "(", "self", ",", "program", ")", ":", "from", ".", ".", "glprogram", "import", "GLProgram", "assert", "isinstance", "(", "program", ",", "GLProgram", ")", "print", "\"######### QGLWidget setProgram ###############\"", "if", "hasattr", "(", "p...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/vis/backends/qtbackend.py#L127-L152
nvdla/sw
79538ba1b52b040a4a4645f630e457fa01839e90
umd/external/protobuf-2.6/python/google/protobuf/reflection.py
python
GeneratedProtocolMessageType.__new__
(cls, name, bases, dictionary)
return new_class
Custom allocation for runtime-generated class types. We override __new__ because this is apparently the only place where we can meaningfully set __slots__ on the class we're creating(?). (The interplay between metaclasses and slots is not very well-documented). Args: name: Name of the class (ign...
Custom allocation for runtime-generated class types.
[ "Custom", "allocation", "for", "runtime", "-", "generated", "class", "types", "." ]
def __new__(cls, name, bases, dictionary): """Custom allocation for runtime-generated class types. We override __new__ because this is apparently the only place where we can meaningfully set __slots__ on the class we're creating(?). (The interplay between metaclasses and slots is not very well-document...
[ "def", "__new__", "(", "cls", ",", "name", ",", "bases", ",", "dictionary", ")", ":", "descriptor", "=", "dictionary", "[", "GeneratedProtocolMessageType", ".", "_DESCRIPTOR_KEY", "]", "bases", "=", "_NewMessage", "(", "bases", ",", "descriptor", ",", "diction...
https://github.com/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/google/protobuf/reflection.py#L104-L131
PaddlePaddle/Anakin
5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730
tools/external_converter_v2/parser/logger.py
python
logger.clean_up
()
clean up all the opened file pointer
clean up all the opened file pointer
[ "clean", "up", "all", "the", "opened", "file", "pointer" ]
def clean_up(): """ clean up all the opened file pointer """ if logger.log_file_plist[0]: logger.log_file_plist[0].close()
[ "def", "clean_up", "(", ")", ":", "if", "logger", ".", "log_file_plist", "[", "0", "]", ":", "logger", ".", "log_file_plist", "[", "0", "]", ".", "close", "(", ")" ]
https://github.com/PaddlePaddle/Anakin/blob/5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730/tools/external_converter_v2/parser/logger.py#L138-L143
tum-vision/fusenet
a1451be2971b348a01b0f525c2a3a7a0e215a591
scripts/cpp_lint.py
python
CheckPosixThreading
(filename, clean_lines, linenum, error)
Checks for calls to thread-unsafe functions. Much code has been originally written without consideration of multi-threading. Also, engineers are relying on their old experience; they have learned posix before threading extensions were added. These tests guide the engineers to use thread-safe functions (when us...
Checks for calls to thread-unsafe functions.
[ "Checks", "for", "calls", "to", "thread", "-", "unsafe", "functions", "." ]
def CheckPosixThreading(filename, clean_lines, linenum, error): """Checks for calls to thread-unsafe functions. Much code has been originally written without consideration of multi-threading. Also, engineers are relying on their old experience; they have learned posix before threading extensions were added. Th...
[ "def", "CheckPosixThreading", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "for", "single_thread_function", ",", "multithread_safe_function", "in", "threading_list", ":...
https://github.com/tum-vision/fusenet/blob/a1451be2971b348a01b0f525c2a3a7a0e215a591/scripts/cpp_lint.py#L1681-L1705
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/build/upload.py
python
DoSSHCommand
(command, user, host, port=None, ssh_key=None)
Execute command on user@host using ssh. Optionally use port and ssh_key, if provided.
Execute command on user
[ "Execute", "command", "on", "user" ]
def DoSSHCommand(command, user, host, port=None, ssh_key=None): """Execute command on user@host using ssh. Optionally use port and ssh_key, if provided.""" cmdline = ["ssh"] AppendOptionalArgsToSSHCommandline(cmdline, port, ssh_key) cmdline.extend(["%s@%s" % (user, host), command]) with redo.re...
[ "def", "DoSSHCommand", "(", "command", ",", "user", ",", "host", ",", "port", "=", "None", ",", "ssh_key", "=", "None", ")", ":", "cmdline", "=", "[", "\"ssh\"", "]", "AppendOptionalArgsToSSHCommandline", "(", "cmdline", ",", "port", ",", "ssh_key", ")", ...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/build/upload.py#L80-L91
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/msgpack/fallback.py
python
unpackb
(packed, **kwargs)
return ret
Unpack an object from `packed`. Raises ``ExtraData`` when *packed* contains extra bytes. Raises ``ValueError`` when *packed* is incomplete. Raises ``FormatError`` when *packed* is not valid msgpack. Raises ``StackError`` when *packed* contains too nested. Other exceptions can be raised during unpac...
Unpack an object from `packed`.
[ "Unpack", "an", "object", "from", "packed", "." ]
def unpackb(packed, **kwargs): """ Unpack an object from `packed`. Raises ``ExtraData`` when *packed* contains extra bytes. Raises ``ValueError`` when *packed* is incomplete. Raises ``FormatError`` when *packed* is not valid msgpack. Raises ``StackError`` when *packed* contains too nested. ...
[ "def", "unpackb", "(", "packed", ",", "*", "*", "kwargs", ")", ":", "unpacker", "=", "Unpacker", "(", "None", ",", "max_buffer_size", "=", "len", "(", "packed", ")", ",", "*", "*", "kwargs", ")", "unpacker", ".", "feed", "(", "packed", ")", "try", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/msgpack/fallback.py#L114-L138
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/framework/tensor_shape.py
python
Dimension.__ge__
(self, other)
Returns True if `self` is known to be greater than or equal to `other`. Dimensions are compared as follows: Dimension(m) >= Dimension(n) == m >= n Dimension(m) >= Dimension(None) == None Dimension(None) >= Dimension(n) == None Dimension(None) >= Dimension(None) == None Arg...
Returns True if `self` is known to be greater than or equal to `other`.
[ "Returns", "True", "if", "self", "is", "known", "to", "be", "greater", "than", "or", "equal", "to", "other", "." ]
def __ge__(self, other): """Returns True if `self` is known to be greater than or equal to `other`. Dimensions are compared as follows: Dimension(m) >= Dimension(n) == m >= n Dimension(m) >= Dimension(None) == None Dimension(None) >= Dimension(n) == None Dimension(None) >= ...
[ "def", "__ge__", "(", "self", ",", "other", ")", ":", "other", "=", "as_dimension", "(", "other", ")", "if", "self", ".", "_value", "is", "None", "or", "other", ".", "value", "is", "None", ":", "return", "None", "else", ":", "return", "self", ".", ...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/framework/tensor_shape.py#L334-L355
google/ion
ef47f3b824050499ce5c6f774b366f6c4dbce0af
ion/build.py
python
TargetBuilder._ConstructGypArgs
(cls, flags, filename)
return command_line
Constructs the list of command-line arguments to pass to gyp. Flags with multiple values are unpacked into multiple flags. Short flags are rendered as two adjacent tokens in the list. Long flags are rendered as a single token, with flag and value separated by an equals sign. Args: flags: The d...
Constructs the list of command-line arguments to pass to gyp.
[ "Constructs", "the", "list", "of", "command", "-", "line", "arguments", "to", "pass", "to", "gyp", "." ]
def _ConstructGypArgs(cls, flags, filename): """Constructs the list of command-line arguments to pass to gyp. Flags with multiple values are unpacked into multiple flags. Short flags are rendered as two adjacent tokens in the list. Long flags are rendered as a single token, with flag and value separa...
[ "def", "_ConstructGypArgs", "(", "cls", ",", "flags", ",", "filename", ")", ":", "def", "FormatArgAndValue", "(", "arg", ",", "value", ")", ":", "if", "arg", ".", "startswith", "(", "'--'", ")", ":", "return", "[", "'{arg}={value}'", ".", "format", "(", ...
https://github.com/google/ion/blob/ef47f3b824050499ce5c6f774b366f6c4dbce0af/ion/build.py#L672-L715
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/ops/variables.py
python
Variable.get_shape
(self)
return self._variable.get_shape()
The `TensorShape` of this variable. Returns: A `TensorShape`.
The `TensorShape` of this variable.
[ "The", "TensorShape", "of", "this", "variable", "." ]
def get_shape(self): """The `TensorShape` of this variable. Returns: A `TensorShape`. """ return self._variable.get_shape()
[ "def", "get_shape", "(", "self", ")", ":", "return", "self", ".", "_variable", ".", "get_shape", "(", ")" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/variables.py#L674-L680
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
ConfigBase_Get
(*args, **kwargs)
return _misc_.ConfigBase_Get(*args, **kwargs)
ConfigBase_Get(bool createOnDemand=True) -> ConfigBase Returns the current global config object, creating one if neccessary.
ConfigBase_Get(bool createOnDemand=True) -> ConfigBase
[ "ConfigBase_Get", "(", "bool", "createOnDemand", "=", "True", ")", "-", ">", "ConfigBase" ]
def ConfigBase_Get(*args, **kwargs): """ ConfigBase_Get(bool createOnDemand=True) -> ConfigBase Returns the current global config object, creating one if neccessary. """ return _misc_.ConfigBase_Get(*args, **kwargs)
[ "def", "ConfigBase_Get", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "ConfigBase_Get", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L3459-L3465
baidu/Familia
958febfd5fe7a61e46a35bfb084e71f806dde6a6
tools/TopicMerge/topic_model_merge.py
python
TopicModelMerge.conv_topic_word
(self)
return topic_word, topic_sum
将词-主题格式转换为主题-词格式。 词-主题表格存放每行格式为:词ID 主题ID:个数 ... 主题ID:个数 转换成主题-词存储,格式为:主题ID 词ID:个数 ... 词ID:个数 Args: None Returns: topic_word: 转换后的主题-词模型 topic_sum: 统计每个主题下词的总数
将词-主题格式转换为主题-词格式。 词-主题表格存放每行格式为:词ID 主题ID:个数 ... 主题ID:个数 转换成主题-词存储,格式为:主题ID 词ID:个数 ... 词ID:个数
[ "将词", "-", "主题格式转换为主题", "-", "词格式。", "词", "-", "主题表格存放每行格式为:词ID", "主题ID", ":", "个数", "...", "主题ID", ":", "个数", "转换成主题", "-", "词存储,格式为:主题ID", "词ID", ":", "个数", "...", "词ID", ":", "个数" ]
def conv_topic_word(self): """ 将词-主题格式转换为主题-词格式。 词-主题表格存放每行格式为:词ID 主题ID:个数 ... 主题ID:个数 转换成主题-词存储,格式为:主题ID 词ID:个数 ... 词ID:个数 Args: None Returns: topic_word: 转换后的主题-词模型 topic_sum: 统计每个主题下词的总数 """ topic_word = [[] for _ ...
[ "def", "conv_topic_word", "(", "self", ")", ":", "topic_word", "=", "[", "[", "]", "for", "_", "in", "xrange", "(", "self", ".", "_num_topics", ")", "]", "topic_sum", "=", "[", "0", "]", "*", "self", ".", "_num_topics", "with", "open", "(", "self", ...
https://github.com/baidu/Familia/blob/958febfd5fe7a61e46a35bfb084e71f806dde6a6/tools/TopicMerge/topic_model_merge.py#L34-L57
pyne/pyne
0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3
pyne/fispact.py
python
find_ind
(data, sub)
return ind
finds index in data whic contains sub string
finds index in data whic contains sub string
[ "finds", "index", "in", "data", "whic", "contains", "sub", "string" ]
def find_ind(data, sub): """ finds index in data whic contains sub string """ for i, s in enumerate(data): if sub in s: ind = i return ind
[ "def", "find_ind", "(", "data", ",", "sub", ")", ":", "for", "i", ",", "s", "in", "enumerate", "(", "data", ")", ":", "if", "sub", "in", "s", ":", "ind", "=", "i", "return", "ind" ]
https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/fispact.py#L401-L406
freesurfer/freesurfer
6dbe527d43ffa611acb2cd112e9469f9bfec8e36
infant/freesurfer_pipeline.py
python
CommandPipeline.mkdir
(self, directory)
Alias to make a directory if it does not exist.
Alias to make a directory if it does not exist.
[ "Alias", "to", "make", "a", "directory", "if", "it", "does", "not", "exist", "." ]
def mkdir(self, directory): """ Alias to make a directory if it does not exist. """ self.run(f'mkdir -p {directory}', outputs=directory)
[ "def", "mkdir", "(", "self", ",", "directory", ")", ":", "self", ".", "run", "(", "f'mkdir -p {directory}'", ",", "outputs", "=", "directory", ")" ]
https://github.com/freesurfer/freesurfer/blob/6dbe527d43ffa611acb2cd112e9469f9bfec8e36/infant/freesurfer_pipeline.py#L179-L183
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
FWCore/ParameterSet/python/Types.py
python
LuminosityBlockID._valueFromString
(value)
return LuminosityBlockID(int(parts[0]), int(parts[1]))
only used for cfg-parsing
only used for cfg-parsing
[ "only", "used", "for", "cfg", "-", "parsing" ]
def _valueFromString(value): """only used for cfg-parsing""" parts = value.split(":") return LuminosityBlockID(int(parts[0]), int(parts[1]))
[ "def", "_valueFromString", "(", "value", ")", ":", "parts", "=", "value", ".", "split", "(", "\":\"", ")", "return", "LuminosityBlockID", "(", "int", "(", "parts", "[", "0", "]", ")", ",", "int", "(", "parts", "[", "1", "]", ")", ")" ]
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/FWCore/ParameterSet/python/Types.py#L432-L435
runtimejs/runtime
0a6e84c30823d35a4548d6634166784260ae7b74
deps/v8/tools/jsmin.py
python
JavaScriptMinifier.Push
(self)
Called when we encounter a '{'.
Called when we encounter a '{'.
[ "Called", "when", "we", "encounter", "a", "{", "." ]
def Push(self): """Called when we encounter a '{'.""" self.nesting += 1
[ "def", "Push", "(", "self", ")", ":", "self", ".", "nesting", "+=", "1" ]
https://github.com/runtimejs/runtime/blob/0a6e84c30823d35a4548d6634166784260ae7b74/deps/v8/tools/jsmin.py#L76-L78
geemaple/leetcode
68bc5032e1ee52c22ef2f2e608053484c487af54
leetcode/22.generate-parentheses.py
python
Solution.generateParenthesis
(self, n)
return res
:type n: int :rtype: List[str]
:type n: int :rtype: List[str]
[ ":", "type", "n", ":", "int", ":", "rtype", ":", "List", "[", "str", "]" ]
def generateParenthesis(self, n): """ :type n: int :rtype: List[str] """ res = [] self.helper('', 0, 0, n, res) return res
[ "def", "generateParenthesis", "(", "self", ",", "n", ")", ":", "res", "=", "[", "]", "self", ".", "helper", "(", "''", ",", "0", ",", "0", ",", "n", ",", "res", ")", "return", "res" ]
https://github.com/geemaple/leetcode/blob/68bc5032e1ee52c22ef2f2e608053484c487af54/leetcode/22.generate-parentheses.py#L2-L9
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/polynomial/laguerre.py
python
laggauss
(deg)
return x, w
Gauss-Laguerre quadrature. Computes the sample points and weights for Gauss-Laguerre quadrature. These sample points and weights will correctly integrate polynomials of degree :math:`2*deg - 1` or less over the interval :math:`[0, \\inf]` with the weight function :math:`f(x) = \\exp(-x)`. Paramete...
Gauss-Laguerre quadrature.
[ "Gauss", "-", "Laguerre", "quadrature", "." ]
def laggauss(deg): """ Gauss-Laguerre quadrature. Computes the sample points and weights for Gauss-Laguerre quadrature. These sample points and weights will correctly integrate polynomials of degree :math:`2*deg - 1` or less over the interval :math:`[0, \\inf]` with the weight function :math:`f...
[ "def", "laggauss", "(", "deg", ")", ":", "ideg", "=", "int", "(", "deg", ")", "if", "ideg", "!=", "deg", "or", "ideg", "<", "1", ":", "raise", "ValueError", "(", "\"deg must be a non-negative integer\"", ")", "# first approximation of roots. We use the fact that t...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/polynomial/laguerre.py#L1675-L1736
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/nn_ops.py
python
atrous_conv2d_transpose
(value, filters, output_shape, rate, padding, name=None)
The transpose of `atrous_conv2d`. This operation is sometimes called "deconvolution" after (Zeiler et al., 2010), but is really the transpose (gradient) of `atrous_conv2d` rather than an actual deconvolution. Args: value: A 4-D `Tensor` of type `float`. It needs to be in the default `NHWC` format. I...
The transpose of `atrous_conv2d`.
[ "The", "transpose", "of", "atrous_conv2d", "." ]
def atrous_conv2d_transpose(value, filters, output_shape, rate, padding, name=None): """The transpose of `atrous_conv2d`. This operation is sometimes called "deconvolution" af...
[ "def", "atrous_conv2d_transpose", "(", "value", ",", "filters", ",", "output_shape", ",", "rate", ",", "padding", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "\"atrous_conv2d_transpose\"", ",", "[", "value", ",", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/nn_ops.py#L2779-L2939
NervanaSystems/ngraph
f677a119765ca30636cf407009dabd118664951f
python/src/ngraph/ops.py
python
strided_slice
( data: NodeInput, begin: NodeInput, end: NodeInput, strides: NodeInput, begin_mask: List[int], end_mask: List[int], new_axis_mask: Optional[List[int]] = None, shrink_axis_mask: Optional[List[int]] = None, ellipsis_mask: Optional[List[int]] = None, name: Optional[str] = None, )
return _get_node_factory().create( "StridedSlice", as_nodes(data, begin, end, strides), attributes )
Return a node which dynamically repeats(replicates) the input data tensor. :param data: The tensor to be sliced :param begin: 1D tensor with begin indexes for input blob slicing :param end: 1D tensor with end indexes for input blob slicing :param ...
Return a node which dynamically repeats(replicates) the input data tensor.
[ "Return", "a", "node", "which", "dynamically", "repeats", "(", "replicates", ")", "the", "input", "data", "tensor", "." ]
def strided_slice( data: NodeInput, begin: NodeInput, end: NodeInput, strides: NodeInput, begin_mask: List[int], end_mask: List[int], new_axis_mask: Optional[List[int]] = None, shrink_axis_mask: Optional[List[int]] = None, ellipsis_mask: Optional[List[int]] = None, name: Optional...
[ "def", "strided_slice", "(", "data", ":", "NodeInput", ",", "begin", ":", "NodeInput", ",", "end", ":", "NodeInput", ",", "strides", ":", "NodeInput", ",", "begin_mask", ":", "List", "[", "int", "]", ",", "end_mask", ":", "List", "[", "int", "]", ",", ...
https://github.com/NervanaSystems/ngraph/blob/f677a119765ca30636cf407009dabd118664951f/python/src/ngraph/ops.py#L2539-L2582
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/compiler/symbols.py
python
Scope.check_name
(self, name)
Return scope of name. The scope of a name could be LOCAL, GLOBAL, FREE, or CELL.
Return scope of name.
[ "Return", "scope", "of", "name", "." ]
def check_name(self, name): """Return scope of name. The scope of a name could be LOCAL, GLOBAL, FREE, or CELL. """ if name in self.globals: return SC_GLOBAL_EXPLICIT if name in self.cells: return SC_CELL if name in self.defs: return S...
[ "def", "check_name", "(", "self", ",", "name", ")", ":", "if", "name", "in", "self", ".", "globals", ":", "return", "SC_GLOBAL_EXPLICIT", "if", "name", "in", "self", ".", "cells", ":", "return", "SC_CELL", "if", "name", "in", "self", ".", "defs", ":", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/compiler/symbols.py#L87-L103
mhammond/pywin32
44afd86ba8485194df93234639243252deeb40d5
win32/Demos/winprocess.py
python
Process.__close__
(self, hwnd, dummy)
EnumWindows callback - sends WM_CLOSE to any window owned by this process.
EnumWindows callback - sends WM_CLOSE to any window owned by this process.
[ "EnumWindows", "callback", "-", "sends", "WM_CLOSE", "to", "any", "window", "owned", "by", "this", "process", "." ]
def __close__(self, hwnd, dummy): """ EnumWindows callback - sends WM_CLOSE to any window owned by this process. """ TId, PId = win32process.GetWindowThreadProcessId(hwnd) if PId == self.PId: win32gui.PostMessage(hwnd, win32con.WM_CLOSE, 0, 0)
[ "def", "__close__", "(", "self", ",", "hwnd", ",", "dummy", ")", ":", "TId", ",", "PId", "=", "win32process", ".", "GetWindowThreadProcessId", "(", "hwnd", ")", "if", "PId", "==", "self", ".", "PId", ":", "win32gui", ".", "PostMessage", "(", "hwnd", ",...
https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/win32/Demos/winprocess.py#L141-L148
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
xmlDoc.htmlNodeDumpOutput
(self, buf, cur, encoding)
Dump an HTML node, recursive behaviour,children are printed too, and formatting returns/spaces are added.
Dump an HTML node, recursive behaviour,children are printed too, and formatting returns/spaces are added.
[ "Dump", "an", "HTML", "node", "recursive", "behaviour", "children", "are", "printed", "too", "and", "formatting", "returns", "/", "spaces", "are", "added", "." ]
def htmlNodeDumpOutput(self, buf, cur, encoding): """Dump an HTML node, recursive behaviour,children are printed too, and formatting returns/spaces are added. """ if buf is None: buf__o = None else: buf__o = buf._o if cur is None: cur__o = None else: cur__o = cur._o ...
[ "def", "htmlNodeDumpOutput", "(", "self", ",", "buf", ",", "cur", ",", "encoding", ")", ":", "if", "buf", "is", "None", ":", "buf__o", "=", "None", "else", ":", "buf__o", "=", "buf", ".", "_o", "if", "cur", "is", "None", ":", "cur__o", "=", "None",...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L4042-L4049
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/v7.9.317/third_party/jinja2/filters.py
python
do_xmlattr
(_eval_ctx, d, autospace=True)
return rv
Create an SGML/XML attribute string based on the items in a dict. All values that are neither `none` nor `undefined` are automatically escaped: .. sourcecode:: html+jinja <ul{{ {'class': 'my_list', 'missing': none, 'id': 'list-%d'|format(variable)}|xmlattr }}> ... <...
Create an SGML/XML attribute string based on the items in a dict. All values that are neither `none` nor `undefined` are automatically escaped:
[ "Create", "an", "SGML", "/", "XML", "attribute", "string", "based", "on", "the", "items", "in", "a", "dict", ".", "All", "values", "that", "are", "neither", "none", "nor", "undefined", "are", "automatically", "escaped", ":" ]
def do_xmlattr(_eval_ctx, d, autospace=True): """Create an SGML/XML attribute string based on the items in a dict. All values that are neither `none` nor `undefined` are automatically escaped: .. sourcecode:: html+jinja <ul{{ {'class': 'my_list', 'missing': none, 'id': 'list-%d...
[ "def", "do_xmlattr", "(", "_eval_ctx", ",", "d", ",", "autospace", "=", "True", ")", ":", "rv", "=", "u' '", ".", "join", "(", "u'%s=\"%s\"'", "%", "(", "escape", "(", "key", ")", ",", "escape", "(", "value", ")", ")", "for", "key", ",", "value", ...
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/third_party/jinja2/filters.py#L154-L186
google/iree
1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76
integrations/tensorflow/python_projects/iree_tf/iree/tf/support/module_utils.py
python
CompiledModule.create_from_signature_def_saved_model
( cls, saved_model_dir: str, saved_model_tags: Set[str], module_name: str, backend_info: "BackendInfo", exported_name: str, input_names: Sequence[str], output_names: Sequence[str], artifacts_dir: Optional[str] = None)
Compile a SignatureDef SavedModel to the target backend in backend_info. Args: saved_model_dir: Directory of the saved model. saved_model_tags: Optional set of tags to use when loading the model. module_name: A name for this compiled module. backend_info: BackendInfo with the details for co...
Compile a SignatureDef SavedModel to the target backend in backend_info.
[ "Compile", "a", "SignatureDef", "SavedModel", "to", "the", "target", "backend", "in", "backend_info", "." ]
def create_from_signature_def_saved_model( cls, saved_model_dir: str, saved_model_tags: Set[str], module_name: str, backend_info: "BackendInfo", exported_name: str, input_names: Sequence[str], output_names: Sequence[str], artifacts_dir: Optional[str] = None): ""...
[ "def", "create_from_signature_def_saved_model", "(", "cls", ",", "saved_model_dir", ":", "str", ",", "saved_model_tags", ":", "Set", "[", "str", "]", ",", "module_name", ":", "str", ",", "backend_info", ":", "\"BackendInfo\"", ",", "exported_name", ":", "str", "...
https://github.com/google/iree/blob/1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76/integrations/tensorflow/python_projects/iree_tf/iree/tf/support/module_utils.py#L252-L277
mavlink/mavros
a32232d57a5e91abf6737e454d4199cae29b369c
mavros/mavros/cmd/safety.py
python
disarm
(ctx, client)
Disarm motors.
Disarm motors.
[ "Disarm", "motors", "." ]
def disarm(ctx, client): """Disarm motors.""" _arm(ctx, client, False)
[ "def", "disarm", "(", "ctx", ",", "client", ")", ":", "_arm", "(", "ctx", ",", "client", ",", "False", ")" ]
https://github.com/mavlink/mavros/blob/a32232d57a5e91abf6737e454d4199cae29b369c/mavros/mavros/cmd/safety.py#L48-L50
RegrowthStudios/SoACode-Public
c3ddd69355b534d5e70e2e6d0c489b4e93ab1ffe
utils/git-hooks/cpplint/cpplint.py
python
_OutputFormat
()
return _cpplint_state.output_format
Gets the module's output format.
Gets the module's output format.
[ "Gets", "the", "module", "s", "output", "format", "." ]
def _OutputFormat(): """Gets the module's output format.""" return _cpplint_state.output_format
[ "def", "_OutputFormat", "(", ")", ":", "return", "_cpplint_state", ".", "output_format" ]
https://github.com/RegrowthStudios/SoACode-Public/blob/c3ddd69355b534d5e70e2e6d0c489b4e93ab1ffe/utils/git-hooks/cpplint/cpplint.py#L591-L593
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
Utilities/spack/repo/packages/paraview/package.py
python
Paraview.paraview_subdir
(self)
The paraview subdirectory name as paraview-major.minor
The paraview subdirectory name as paraview-major.minor
[ "The", "paraview", "subdirectory", "name", "as", "paraview", "-", "major", ".", "minor" ]
def paraview_subdir(self): """The paraview subdirectory name as paraview-major.minor""" if self.spec.version == Version('master'): return 'paraview-5.9' else: return 'paraview-{0}'.format(self.spec.version.up_to(2))
[ "def", "paraview_subdir", "(", "self", ")", ":", "if", "self", ".", "spec", ".", "version", "==", "Version", "(", "'master'", ")", ":", "return", "'paraview-5.9'", "else", ":", "return", "'paraview-{0}'", ".", "format", "(", "self", ".", "spec", ".", "ve...
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Utilities/spack/repo/packages/paraview/package.py#L237-L242
protocolbuffers/protobuf
b5ab0b7a18b7336c60130f4ddb2d97c51792f896
python/google/protobuf/service_reflection.py
python
_ServiceBuilder._GetResponseClass
(self, method_descriptor)
return method_descriptor.output_type._concrete_class
Returns the class of the response protocol message. Args: method_descriptor: Descriptor of the method for which to return the response protocol message class. Returns: A class that represents the output protocol message of the specified method.
Returns the class of the response protocol message.
[ "Returns", "the", "class", "of", "the", "response", "protocol", "message", "." ]
def _GetResponseClass(self, method_descriptor): """Returns the class of the response protocol message. Args: method_descriptor: Descriptor of the method for which to return the response protocol message class. Returns: A class that represents the output protocol message of the specifie...
[ "def", "_GetResponseClass", "(", "self", ",", "method_descriptor", ")", ":", "if", "method_descriptor", ".", "containing_service", "!=", "self", ".", "descriptor", ":", "raise", "RuntimeError", "(", "'GetResponseClass() given method descriptor for wrong service type.'", ")"...
https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/google/protobuf/service_reflection.py#L199-L213
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/saved_model/save.py
python
_get_outer_most_capture
(fn, capture, func_graph_map)
return outer_fn, capture
Tries to find the original captured tensor if capture more than once.
Tries to find the original captured tensor if capture more than once.
[ "Tries", "to", "find", "the", "original", "captured", "tensor", "if", "capture", "more", "than", "once", "." ]
def _get_outer_most_capture(fn, capture, func_graph_map): """Tries to find the original captured tensor if capture more than once.""" outer_fn = fn while outer_fn is not None and not isinstance(capture, ops.EagerTensor): if capture.graph is not outer_fn.graph: outer_fn = func_graph_map.get(outer_fn.grap...
[ "def", "_get_outer_most_capture", "(", "fn", ",", "capture", ",", "func_graph_map", ")", ":", "outer_fn", "=", "fn", "while", "outer_fn", "is", "not", "None", "and", "not", "isinstance", "(", "capture", ",", "ops", ".", "EagerTensor", ")", ":", "if", "capt...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/saved_model/save.py#L794-L808
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/perf/metrics/statistics.py
python
Median
(values)
return Percentile(values, 50)
Gets the median of a list of values.
Gets the median of a list of values.
[ "Gets", "the", "median", "of", "a", "list", "of", "values", "." ]
def Median(values): """Gets the median of a list of values.""" return Percentile(values, 50)
[ "def", "Median", "(", "values", ")", ":", "return", "Percentile", "(", "values", ",", "50", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/perf/metrics/statistics.py#L189-L191
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
Choice.__init__
(self, *args, **kwargs)
__init__(Window parent, int id, Point pos=DefaultPosition, Size size=DefaultSize, List choices=EmptyList, long style=0, Validator validator=DefaultValidator, String name=ChoiceNameStr) -> Choice Create and show a Choice control
__init__(Window parent, int id, Point pos=DefaultPosition, Size size=DefaultSize, List choices=EmptyList, long style=0, Validator validator=DefaultValidator, String name=ChoiceNameStr) -> Choice
[ "__init__", "(", "Window", "parent", "int", "id", "Point", "pos", "=", "DefaultPosition", "Size", "size", "=", "DefaultSize", "List", "choices", "=", "EmptyList", "long", "style", "=", "0", "Validator", "validator", "=", "DefaultValidator", "String", "name", "...
def __init__(self, *args, **kwargs): """ __init__(Window parent, int id, Point pos=DefaultPosition, Size size=DefaultSize, List choices=EmptyList, long style=0, Validator validator=DefaultValidator, String name=ChoiceNameStr) -> Choice Create and show a Choice control ...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_controls_", ".", "Choice_swiginit", "(", "self", ",", "_controls_", ".", "new_Choice", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")", "self", ".", "_setOORIn...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L493-L502
verilog-to-routing/vtr-verilog-to-routing
d9719cf7374821156c3cee31d66991cb85578562
vtr_flow/scripts/python_libs/vtr/task.py
python
shorten_task_names
(configs, common_task_prefix)
return new_configs
Shorten the task names of the configs by remove the common task prefix.
Shorten the task names of the configs by remove the common task prefix.
[ "Shorten", "the", "task", "names", "of", "the", "configs", "by", "remove", "the", "common", "task", "prefix", "." ]
def shorten_task_names(configs, common_task_prefix): """ Shorten the task names of the configs by remove the common task prefix. """ new_configs = [] for config in configs: config.task_name = config.task_name.replace(common_task_prefix, "") new_configs += [config] return new_conf...
[ "def", "shorten_task_names", "(", "configs", ",", "common_task_prefix", ")", ":", "new_configs", "=", "[", "]", "for", "config", "in", "configs", ":", "config", ".", "task_name", "=", "config", ".", "task_name", ".", "replace", "(", "common_task_prefix", ",", ...
https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/d9719cf7374821156c3cee31d66991cb85578562/vtr_flow/scripts/python_libs/vtr/task.py#L292-L300
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/gaussian_process/correlation_models.py
python
absolute_exponential
(theta, d)
Absolute exponential autocorrelation model. (Ornstein-Uhlenbeck stochastic process):: n theta, d --> r(theta, d) = exp( sum - theta_i * |d_i| ) i = 1 Parameters ---------- theta : array_like An array wi...
Absolute exponential autocorrelation model. (Ornstein-Uhlenbeck stochastic process)::
[ "Absolute", "exponential", "autocorrelation", "model", ".", "(", "Ornstein", "-", "Uhlenbeck", "stochastic", "process", ")", "::" ]
def absolute_exponential(theta, d): """ Absolute exponential autocorrelation model. (Ornstein-Uhlenbeck stochastic process):: n theta, d --> r(theta, d) = exp( sum - theta_i * |d_i| ) i = 1 Parameters -----...
[ "def", "absolute_exponential", "(", "theta", ",", "d", ")", ":", "theta", "=", "np", ".", "asarray", "(", "theta", ",", "dtype", "=", "np", ".", "float64", ")", "d", "=", "np", ".", "abs", "(", "np", ".", "asarray", "(", "d", ",", "dtype", "=", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/gaussian_process/correlation_models.py#L15-L54
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf/cudf/core/indexed_frame.py
python
IndexedFrame.first
(self, offset)
return self._first_or_last( offset, idx=0, op=operator.__add__, side="left", slice_func=lambda i: self.iloc[:i], )
Select initial periods of time series data based on a date offset. When having a DataFrame with **sorted** dates as index, this function can select the first few rows based on a date offset. Parameters ---------- offset: str The offset length of the data that will b...
Select initial periods of time series data based on a date offset.
[ "Select", "initial", "periods", "of", "time", "series", "data", "based", "on", "a", "date", "offset", "." ]
def first(self, offset): """Select initial periods of time series data based on a date offset. When having a DataFrame with **sorted** dates as index, this function can select the first few rows based on a date offset. Parameters ---------- offset: str The o...
[ "def", "first", "(", "self", ",", "offset", ")", ":", "return", "self", ".", "_first_or_last", "(", "offset", ",", "idx", "=", "0", ",", "op", "=", "operator", ".", "__add__", ",", "side", "=", "\"left\"", ",", "slice_func", "=", "lambda", "i", ":", ...
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/indexed_frame.py#L1606-L1650
yuxng/PoseCNN
9f3dd7b7bce21dcafc05e8f18ccc90da3caabd04
lib/datasets/imdb.py
python
imdb.evaluate_proposals
(self, all_boxes, output_dir=None)
all_boxes is a list of length number-of-classes. Each list element is a list of length number-of-images. Each of those list elements is either an empty list [] or a numpy array of detection. all_boxes[class][image] = [] or np.array of shape #dets x 5
all_boxes is a list of length number-of-classes. Each list element is a list of length number-of-images. Each of those list elements is either an empty list [] or a numpy array of detection.
[ "all_boxes", "is", "a", "list", "of", "length", "number", "-", "of", "-", "classes", ".", "Each", "list", "element", "is", "a", "list", "of", "length", "number", "-", "of", "-", "images", ".", "Each", "of", "those", "list", "elements", "is", "either", ...
def evaluate_proposals(self, all_boxes, output_dir=None): """ all_boxes is a list of length number-of-classes. Each list element is a list of length number-of-images. Each of those list elements is either an empty list [] or a numpy array of detection. all_boxes[class][i...
[ "def", "evaluate_proposals", "(", "self", ",", "all_boxes", ",", "output_dir", "=", "None", ")", ":", "raise", "NotImplementedError" ]
https://github.com/yuxng/PoseCNN/blob/9f3dd7b7bce21dcafc05e8f18ccc90da3caabd04/lib/datasets/imdb.py#L93-L102
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/setobj.py
python
SetInstance.symmetric_difference
(self, other)
In-place symmetric difference with *other* set.
In-place symmetric difference with *other* set.
[ "In", "-", "place", "symmetric", "difference", "with", "*", "other", "*", "set", "." ]
def symmetric_difference(self, other): """ In-place symmetric difference with *other* set. """ context = self._context builder = self._builder other_payload = other.payload with other_payload._iterate() as loop: key = loop.entry.key h = lo...
[ "def", "symmetric_difference", "(", "self", ",", "other", ")", ":", "context", "=", "self", ".", "_context", "builder", "=", "self", ".", "_builder", "other_payload", "=", "other", ".", "payload", "with", "other_payload", ".", "_iterate", "(", ")", "as", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/setobj.py#L643-L665
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/signal/filter_design.py
python
ellipord
(wp, ws, gpass, gstop, analog=False)
return ord, wn
Elliptic (Cauer) filter order selection. Return the order of the lowest order digital or analog elliptic filter that loses no more than `gpass` dB in the passband and has at least `gstop` dB attenuation in the stopband. Parameters ---------- wp, ws : float Passband and stopband edge fr...
Elliptic (Cauer) filter order selection.
[ "Elliptic", "(", "Cauer", ")", "filter", "order", "selection", "." ]
def ellipord(wp, ws, gpass, gstop, analog=False): """Elliptic (Cauer) filter order selection. Return the order of the lowest order digital or analog elliptic filter that loses no more than `gpass` dB in the passband and has at least `gstop` dB attenuation in the stopband. Parameters ----------...
[ "def", "ellipord", "(", "wp", ",", "ws", ",", "gpass", ",", "gstop", ",", "analog", "=", "False", ")", ":", "wp", "=", "atleast_1d", "(", "wp", ")", "ws", "=", "atleast_1d", "(", "ws", ")", "filter_type", "=", "2", "*", "(", "len", "(", "wp", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/signal/filter_design.py#L3018-L3138
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/discriminant_analysis.py
python
LinearDiscriminantAnalysis.transform
(self, X)
return X_new[:, :self._max_components]
Project data to maximize class separation. Parameters ---------- X : array-like, shape (n_samples, n_features) Input data. Returns ------- X_new : array, shape (n_samples, n_components) Transformed data.
Project data to maximize class separation.
[ "Project", "data", "to", "maximize", "class", "separation", "." ]
def transform(self, X): """Project data to maximize class separation. Parameters ---------- X : array-like, shape (n_samples, n_features) Input data. Returns ------- X_new : array, shape (n_samples, n_components) Transformed data. ...
[ "def", "transform", "(", "self", ",", "X", ")", ":", "if", "self", ".", "solver", "==", "'lsqr'", ":", "raise", "NotImplementedError", "(", "\"transform not implemented for 'lsqr' \"", "\"solver (use 'svd' or 'eigen').\"", ")", "check_is_fitted", "(", "self", ")", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/discriminant_analysis.py#L492-L516
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/linear_model/_stochastic_gradient.py
python
BaseSGDClassifier._fit_binary
(self, X, y, alpha, C, sample_weight, learning_rate, max_iter)
Fit a binary classifier on X and y.
Fit a binary classifier on X and y.
[ "Fit", "a", "binary", "classifier", "on", "X", "and", "y", "." ]
def _fit_binary(self, X, y, alpha, C, sample_weight, learning_rate, max_iter): """Fit a binary classifier on X and y. """ coef, intercept, n_iter_ = fit_binary(self, 1, X, y, alpha, C, learning_rate, max_iter, ...
[ "def", "_fit_binary", "(", "self", ",", "X", ",", "y", ",", "alpha", ",", "C", ",", "sample_weight", ",", "learning_rate", ",", "max_iter", ")", ":", "coef", ",", "intercept", ",", "n_iter_", "=", "fit_binary", "(", "self", ",", "1", ",", "X", ",", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/linear_model/_stochastic_gradient.py#L560-L585
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/protobuf/python/google/protobuf/proto_builder.py
python
_MakeFileDescriptorProto
(proto_file_name, full_name, field_items)
return file_proto
Populate FileDescriptorProto for MessageFactory's DescriptorPool.
Populate FileDescriptorProto for MessageFactory's DescriptorPool.
[ "Populate", "FileDescriptorProto", "for", "MessageFactory", "s", "DescriptorPool", "." ]
def _MakeFileDescriptorProto(proto_file_name, full_name, field_items): """Populate FileDescriptorProto for MessageFactory's DescriptorPool.""" package, name = full_name.rsplit('.', 1) file_proto = descriptor_pb2.FileDescriptorProto() file_proto.name = os.path.join(package.replace('.', '/'), proto_file_name) f...
[ "def", "_MakeFileDescriptorProto", "(", "proto_file_name", ",", "full_name", ",", "field_items", ")", ":", "package", ",", "name", "=", "full_name", ".", "rsplit", "(", "'.'", ",", "1", ")", "file_proto", "=", "descriptor_pb2", ".", "FileDescriptorProto", "(", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/google/protobuf/proto_builder.py#L116-L130
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
Size.IncTo
(*args, **kwargs)
return _core_.Size_IncTo(*args, **kwargs)
IncTo(self, Size sz) Increments this object so that both of its dimensions are not less than the corresponding dimensions of the size.
IncTo(self, Size sz)
[ "IncTo", "(", "self", "Size", "sz", ")" ]
def IncTo(*args, **kwargs): """ IncTo(self, Size sz) Increments this object so that both of its dimensions are not less than the corresponding dimensions of the size. """ return _core_.Size_IncTo(*args, **kwargs)
[ "def", "IncTo", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Size_IncTo", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L976-L983
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/py_compile.py
python
compile
(file, cfile=None, dfile=None, doraise=False)
Byte-compile one Python source file to Python bytecode. Arguments: file: source filename cfile: target filename; defaults to source with 'c' or 'o' appended ('c' normally, 'o' in optimizing mode, giving .pyc or .pyo) dfile: purported filename; defaults to source (this is the filena...
Byte-compile one Python source file to Python bytecode.
[ "Byte", "-", "compile", "one", "Python", "source", "file", "to", "Python", "bytecode", "." ]
def compile(file, cfile=None, dfile=None, doraise=False): """Byte-compile one Python source file to Python bytecode. Arguments: file: source filename cfile: target filename; defaults to source with 'c' or 'o' appended ('c' normally, 'o' in optimizing mode, giving .pyc or .pyo) df...
[ "def", "compile", "(", "file", ",", "cfile", "=", "None", ",", "dfile", "=", "None", ",", "doraise", "=", "False", ")", ":", "with", "open", "(", "file", ",", "'U'", ")", "as", "f", ":", "try", ":", "timestamp", "=", "long", "(", "os", ".", "fs...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/py_compile.py#L71-L129
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/nn/utils/prune.py
python
BasePruningMethod.remove
(self, module)
r"""Removes the pruning reparameterization from a module. The pruned parameter named ``name`` remains permanently pruned, and the parameter named ``name+'_orig'`` is removed from the parameter list. Similarly, the buffer named ``name+'_mask'`` is removed from the buffers. Note: ...
r"""Removes the pruning reparameterization from a module. The pruned parameter named ``name`` remains permanently pruned, and the parameter named ``name+'_orig'`` is removed from the parameter list. Similarly, the buffer named ``name+'_mask'`` is removed from the buffers.
[ "r", "Removes", "the", "pruning", "reparameterization", "from", "a", "module", ".", "The", "pruned", "parameter", "named", "name", "remains", "permanently", "pruned", "and", "the", "parameter", "named", "name", "+", "_orig", "is", "removed", "from", "the", "pa...
def remove(self, module): r"""Removes the pruning reparameterization from a module. The pruned parameter named ``name`` remains permanently pruned, and the parameter named ``name+'_orig'`` is removed from the parameter list. Similarly, the buffer named ``name+'_mask'`` is removed from th...
[ "def", "remove", "(", "self", ",", "module", ")", ":", "# before removing pruning from a tensor, it has to have been applied", "assert", "(", "self", ".", "_tensor_name", "is", "not", "None", ")", ",", "\"Module {} has to be pruned\\\n before pruning can be removed\"...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/nn/utils/prune.py#L238-L265
nasa/fprime
595cf3682d8365943d86c1a6fe7c78f0a116acf0
Autocoders/Python/src/fprime_ac/generators/visitors/ComponentVisitorBase.py
python
ComponentVisitorBase.emitPortParamsHpp
(self, indent, params)
return self.emitParams(self.portParamStrsHpp, indent, params)
Emit a list of port function parameters in a .hpp file
Emit a list of port function parameters in a .hpp file
[ "Emit", "a", "list", "of", "port", "function", "parameters", "in", "a", ".", "hpp", "file" ]
def emitPortParamsHpp(self, indent, params): """ Emit a list of port function parameters in a .hpp file """ return self.emitParams(self.portParamStrsHpp, indent, params)
[ "def", "emitPortParamsHpp", "(", "self", ",", "indent", ",", "params", ")", ":", "return", "self", ".", "emitParams", "(", "self", ".", "portParamStrsHpp", ",", "indent", ",", "params", ")" ]
https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/visitors/ComponentVisitorBase.py#L199-L203
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/decomposition/_pca.py
python
PCA.fit_transform
(self, X, y=None)
return U
Fit the model with X and apply the dimensionality reduction on X. Parameters ---------- X : array-like, shape (n_samples, n_features) Training data, where n_samples is the number of samples and n_features is the number of features. y : None Ignored v...
Fit the model with X and apply the dimensionality reduction on X.
[ "Fit", "the", "model", "with", "X", "and", "apply", "the", "dimensionality", "reduction", "on", "X", "." ]
def fit_transform(self, X, y=None): """Fit the model with X and apply the dimensionality reduction on X. Parameters ---------- X : array-like, shape (n_samples, n_features) Training data, where n_samples is the number of samples and n_features is the number of fe...
[ "def", "fit_transform", "(", "self", ",", "X", ",", "y", "=", "None", ")", ":", "U", ",", "S", ",", "V", "=", "self", ".", "_fit", "(", "X", ")", "U", "=", "U", "[", ":", ",", ":", "self", ".", "n_components_", "]", "if", "self", ".", "whit...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/decomposition/_pca.py#L347-L379
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pyparsing.py
python
nullDebugAction
(*args)
Do-nothing' debug action, to suppress debugging output during parsing.
Do-nothing' debug action, to suppress debugging output during parsing.
[ "Do", "-", "nothing", "debug", "action", "to", "suppress", "debugging", "output", "during", "parsing", "." ]
def nullDebugAction(*args): """'Do-nothing' debug action, to suppress debugging output during parsing.""" pass
[ "def", "nullDebugAction", "(", "*", "args", ")", ":", "pass" ]
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pyparsing.py#L1143-L1145
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
Window.SetDimensions
(*args, **kwargs)
return _core_.Window_SetDimensions(*args, **kwargs)
SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO) Sets the position and size of the window in pixels. The sizeFlags parameter indicates the interpretation of the other params if they are equal to -1. ======================== =======================...
SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
[ "SetDimensions", "(", "self", "int", "x", "int", "y", "int", "width", "int", "height", "int", "sizeFlags", "=", "SIZE_AUTO", ")" ]
def SetDimensions(*args, **kwargs): """ SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO) Sets the position and size of the window in pixels. The sizeFlags parameter indicates the interpretation of the other params if they are equal to -1. ...
[ "def", "SetDimensions", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_SetDimensions", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L9336-L9355
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/ma/core.py
python
_DomainGreaterEqual.__call__
(self, x)
Executes the call behavior.
Executes the call behavior.
[ "Executes", "the", "call", "behavior", "." ]
def __call__(self, x): "Executes the call behavior." with np.errstate(invalid='ignore'): return umath.less(x, self.critical_value)
[ "def", "__call__", "(", "self", ",", "x", ")", ":", "with", "np", ".", "errstate", "(", "invalid", "=", "'ignore'", ")", ":", "return", "umath", ".", "less", "(", "x", ",", "self", ".", "critical_value", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/ma/core.py#L885-L888
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBExpressionOptions.SetREPLMode
(self, enable_repl = True)
return _lldb.SBExpressionOptions_SetREPLMode(self, enable_repl)
SetREPLMode(self, bool enable_repl = True) SetREPLMode(self)
SetREPLMode(self, bool enable_repl = True) SetREPLMode(self)
[ "SetREPLMode", "(", "self", "bool", "enable_repl", "=", "True", ")", "SetREPLMode", "(", "self", ")" ]
def SetREPLMode(self, enable_repl = True): """ SetREPLMode(self, bool enable_repl = True) SetREPLMode(self) """ return _lldb.SBExpressionOptions_SetREPLMode(self, enable_repl)
[ "def", "SetREPLMode", "(", "self", ",", "enable_repl", "=", "True", ")", ":", "return", "_lldb", ".", "SBExpressionOptions_SetREPLMode", "(", "self", ",", "enable_repl", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L4189-L4194
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/codecs.py
python
StreamReader.readlines
(self, sizehint=None, keepends=True)
return data.splitlines(keepends)
Read all lines available on the input stream and return them as list of lines. Line breaks are implemented using the codec's decoder method and are included in the list entries. sizehint, if given, is ignored since there is no efficient way to finding the tr...
Read all lines available on the input stream and return them as list of lines.
[ "Read", "all", "lines", "available", "on", "the", "input", "stream", "and", "return", "them", "as", "list", "of", "lines", "." ]
def readlines(self, sizehint=None, keepends=True): """ Read all lines available on the input stream and return them as list of lines. Line breaks are implemented using the codec's decoder method and are included in the list entries. sizehint, if given, is ignor...
[ "def", "readlines", "(", "self", ",", "sizehint", "=", "None", ",", "keepends", "=", "True", ")", ":", "data", "=", "self", ".", "read", "(", ")", "return", "data", ".", "splitlines", "(", "keepends", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/codecs.py#L576-L589
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/fractions.py
python
Fraction._sub
(a, b)
return Fraction(a.numerator * b.denominator - b.numerator * a.denominator, a.denominator * b.denominator)
a - b
a - b
[ "a", "-", "b" ]
def _sub(a, b): """a - b""" return Fraction(a.numerator * b.denominator - b.numerator * a.denominator, a.denominator * b.denominator)
[ "def", "_sub", "(", "a", ",", "b", ")", ":", "return", "Fraction", "(", "a", ".", "numerator", "*", "b", ".", "denominator", "-", "b", ".", "numerator", "*", "a", ".", "denominator", ",", "a", ".", "denominator", "*", "b", ".", "denominator", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/fractions.py#L395-L399
Manu343726/siplasplas
9fae7559f87087cf8ef34f04bd1e774b84b2ea9c
reference/cindex.py
python
Type.is_restrict_qualified
(self)
return conf.lib.clang_isRestrictQualifiedType(self)
Determine whether a Type has the "restrict" qualifier set. This does not look through typedefs that may have added "restrict" at a different level.
Determine whether a Type has the "restrict" qualifier set.
[ "Determine", "whether", "a", "Type", "has", "the", "restrict", "qualifier", "set", "." ]
def is_restrict_qualified(self): """Determine whether a Type has the "restrict" qualifier set. This does not look through typedefs that may have added "restrict" at a different level. """ return conf.lib.clang_isRestrictQualifiedType(self)
[ "def", "is_restrict_qualified", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_isRestrictQualifiedType", "(", "self", ")" ]
https://github.com/Manu343726/siplasplas/blob/9fae7559f87087cf8ef34f04bd1e774b84b2ea9c/reference/cindex.py#L1877-L1883
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py
python
MaskedArray.__array__
(self, t=None, context=None)
Special hook for numeric. Converts to numeric if possible.
Special hook for numeric. Converts to numeric if possible.
[ "Special", "hook", "for", "numeric", ".", "Converts", "to", "numeric", "if", "possible", "." ]
def __array__ (self, t=None, context=None): "Special hook for numeric. Converts to numeric if possible." if self._mask is not nomask: if fromnumeric.ravel(self._mask).any(): if context is None: warnings.warn("Cannot automatically convert masked array to "\...
[ "def", "__array__", "(", "self", ",", "t", "=", "None", ",", "context", "=", "None", ")", ":", "if", "self", ".", "_mask", "is", "not", "nomask", ":", "if", "fromnumeric", ".", "ravel", "(", "self", ".", "_mask", ")", ".", "any", "(", ")", ":", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py#L620-L646
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/tools/gyp/pylib/gyp/xcodeproj_file.py
python
XCConfigurationList.SetBaseConfiguration
(self, value)
Sets the build configuration in all child XCBuildConfiguration objects.
Sets the build configuration in all child XCBuildConfiguration objects.
[ "Sets", "the", "build", "configuration", "in", "all", "child", "XCBuildConfiguration", "objects", "." ]
def SetBaseConfiguration(self, value): """Sets the build configuration in all child XCBuildConfiguration objects. """ for configuration in self._properties['buildConfigurations']: configuration.SetBaseConfiguration(value)
[ "def", "SetBaseConfiguration", "(", "self", ",", "value", ")", ":", "for", "configuration", "in", "self", ".", "_properties", "[", "'buildConfigurations'", "]", ":", "configuration", ".", "SetBaseConfiguration", "(", "value", ")" ]
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/xcodeproj_file.py#L1691-L1696