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
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py2/setuptools/config.py
python
ConfigHandler._parse_file
(cls, value)
return '\n'.join( cls._read_file(path) for path in filepaths if (cls._assert_local(path) or True) and os.path.isfile(path) )
Represents value as a string, allowing including text from nearest files using `file:` directive. Directive is sandboxed and won't reach anything outside directory with setup.py. Examples: file: README.rst, CHANGELOG.md, src/file.txt :param str value: :rtyp...
Represents value as a string, allowing including text from nearest files using `file:` directive.
[ "Represents", "value", "as", "a", "string", "allowing", "including", "text", "from", "nearest", "files", "using", "file", ":", "directive", "." ]
def _parse_file(cls, value): """Represents value as a string, allowing including text from nearest files using `file:` directive. Directive is sandboxed and won't reach anything outside directory with setup.py. Examples: file: README.rst, CHANGELOG.md, src/file.txt ...
[ "def", "_parse_file", "(", "cls", ",", "value", ")", ":", "include_directive", "=", "'file:'", "if", "not", "isinstance", "(", "value", ",", "string_types", ")", ":", "return", "value", "if", "not", "value", ".", "startswith", "(", "include_directive", ")", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/config.py#L271-L299
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/waflib/Node.py
python
Node.bldpath
(self)
return self.path_from(self.ctx.bldnode)
Path seen from the build directory default/src/foo.cpp
Path seen from the build directory default/src/foo.cpp
[ "Path", "seen", "from", "the", "build", "directory", "default", "/", "src", "/", "foo", ".", "cpp" ]
def bldpath(self): "Path seen from the build directory default/src/foo.cpp" return self.path_from(self.ctx.bldnode)
[ "def", "bldpath", "(", "self", ")", ":", "return", "self", ".", "path_from", "(", "self", ".", "ctx", ".", "bldnode", ")" ]
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Node.py#L766-L768
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
xpcom/idl-parser/xpidl.py
python
IDLParser.p_number_add
(self, p)
number : number '+' number | number '-' number | number '*' number
number : number '+' number | number '-' number | number '*' number
[ "number", ":", "number", "+", "number", "|", "number", "-", "number", "|", "number", "*", "number" ]
def p_number_add(self, p): """number : number '+' number | number '-' number | number '*' number""" n1 = p[1] n2 = p[3] if p[2] == '+': p[0] = lambda i: n1(i) + n2(i) elif p[2] == '-': p[0] = lambda i: n1(i) - n2(i) ...
[ "def", "p_number_add", "(", "self", ",", "p", ")", ":", "n1", "=", "p", "[", "1", "]", "n2", "=", "p", "[", "3", "]", "if", "p", "[", "2", "]", "==", "'+'", ":", "p", "[", "0", "]", "=", "lambda", "i", ":", "n1", "(", "i", ")", "+", "...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/xpcom/idl-parser/xpidl.py#L1258-L1269
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
Rect2D.IsEmpty
(*args, **kwargs)
return _core_.Rect2D_IsEmpty(*args, **kwargs)
IsEmpty(self) -> bool
IsEmpty(self) -> bool
[ "IsEmpty", "(", "self", ")", "-", ">", "bool" ]
def IsEmpty(*args, **kwargs): """IsEmpty(self) -> bool""" return _core_.Rect2D_IsEmpty(*args, **kwargs)
[ "def", "IsEmpty", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Rect2D_IsEmpty", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L1975-L1977
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
ThirdParty/cinema/paraview/tpl/cinema_python/database/store.py
python
Store.iterate
(self, parameters=None, fixedargs=None, progressObject=None)
Run through all combinations of parameter/value pairs without visiting any combinations that do not satisfy dependencies among them. Parameters, if supplied, is a list of parameter names to enforce an ordering. Fixed arguments, if supplied, are parameter/value pairs that we want to hold ...
Run through all combinations of parameter/value pairs without visiting any combinations that do not satisfy dependencies among them. Parameters, if supplied, is a list of parameter names to enforce an ordering. Fixed arguments, if supplied, are parameter/value pairs that we want to hold ...
[ "Run", "through", "all", "combinations", "of", "parameter", "/", "value", "pairs", "without", "visiting", "any", "combinations", "that", "do", "not", "satisfy", "dependencies", "among", "them", ".", "Parameters", "if", "supplied", "is", "a", "list", "of", "par...
def iterate(self, parameters=None, fixedargs=None, progressObject=None): """ Run through all combinations of parameter/value pairs without visiting any combinations that do not satisfy dependencies among them. Parameters, if supplied, is a list of parameter names to enforce an or...
[ "def", "iterate", "(", "self", ",", "parameters", "=", "None", ",", "fixedargs", "=", "None", ",", "progressObject", "=", "None", ")", ":", "# optimization - cache and reuse to avoid expensive search", "argstr", "=", "json", ".", "dumps", "(", "(", "parameters", ...
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/ThirdParty/cinema/paraview/tpl/cinema_python/database/store.py#L551-L624
deepmind/spiral
5ee538cedf1d9cc827ced93fe86a44f8b8742ac0
spiral/environments/libmypaint.py
python
LibMyPaint.step
(self, action)
return time_step
Performs an environment step.
Performs an environment step.
[ "Performs", "an", "environment", "step", "." ]
def step(self, action): """Performs an environment step.""" # If the environment has just been created or finished an episode # we should reset it (ignoring the action). if self._prev_step_type in {None, environment.StepType.LAST}: return self.reset() for k in action.keys(): self._actio...
[ "def", "step", "(", "self", ",", "action", ")", ":", "# If the environment has just been created or finished an episode", "# we should reset it (ignoring the action).", "if", "self", ".", "_prev_step_type", "in", "{", "None", ",", "environment", ".", "StepType", ".", "LAS...
https://github.com/deepmind/spiral/blob/5ee538cedf1d9cc827ced93fe86a44f8b8742ac0/spiral/environments/libmypaint.py#L420-L468
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/s3transfer/bandwidth.py
python
RequestExceededException.__init__
(self, requested_amt, retry_time)
Error when requested amount exceeds what is allowed The request that raised this error should be retried after waiting the time specified by ``retry_time``. :type requested_amt: int :param requested_amt: The originally requested byte amount :type retry_time: float :par...
Error when requested amount exceeds what is allowed
[ "Error", "when", "requested", "amount", "exceeds", "what", "is", "allowed" ]
def __init__(self, requested_amt, retry_time): """Error when requested amount exceeds what is allowed The request that raised this error should be retried after waiting the time specified by ``retry_time``. :type requested_amt: int :param requested_amt: The originally requested...
[ "def", "__init__", "(", "self", ",", "requested_amt", ",", "retry_time", ")", ":", "self", ".", "requested_amt", "=", "requested_amt", "self", ".", "retry_time", "=", "retry_time", "msg", "=", "(", "'Request amount %s exceeded the amount available. Retry in %s'", "%",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/s3transfer/bandwidth.py#L18-L37
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/packages/urllib3/packages/six.py
python
iteritems
(d)
return iter(getattr(d, _iteritems)())
Return an iterator over the (key, value) pairs of a dictionary.
Return an iterator over the (key, value) pairs of a dictionary.
[ "Return", "an", "iterator", "over", "the", "(", "key", "value", ")", "pairs", "of", "a", "dictionary", "." ]
def iteritems(d): """Return an iterator over the (key, value) pairs of a dictionary.""" return iter(getattr(d, _iteritems)())
[ "def", "iteritems", "(", "d", ")", ":", "return", "iter", "(", "getattr", "(", "d", ",", "_iteritems", ")", "(", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/packages/urllib3/packages/six.py#L271-L273
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py
python
Spinbox.__init__
(self, master=None, cnf={}, **kw)
Construct a spinbox widget with the parent MASTER. STANDARD OPTIONS activebackground, background, borderwidth, cursor, exportselection, font, foreground, highlightbackground, highlightcolor, highlightthickness, insertbackground, insertborderwidth, in...
Construct a spinbox widget with the parent MASTER.
[ "Construct", "a", "spinbox", "widget", "with", "the", "parent", "MASTER", "." ]
def __init__(self, master=None, cnf={}, **kw): """Construct a spinbox widget with the parent MASTER. STANDARD OPTIONS activebackground, background, borderwidth, cursor, exportselection, font, foreground, highlightbackground, highlightcolor, highlightthic...
[ "def", "__init__", "(", "self", ",", "master", "=", "None", ",", "cnf", "=", "{", "}", ",", "*", "*", "kw", ")", ":", "Widget", ".", "__init__", "(", "self", ",", "master", ",", "'spinbox'", ",", "cnf", ",", "kw", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L3619-L3646
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/lambda-code/ServiceLambda/api/service_upload.py
python
__generate_uuid
()
return str(uuid.uuid4())
Generates universally unique identifier using uuid4 to guarantee uniqueness without exposing computer network address.
Generates universally unique identifier using uuid4 to guarantee uniqueness without exposing computer network address.
[ "Generates", "universally", "unique", "identifier", "using", "uuid4", "to", "guarantee", "uniqueness", "without", "exposing", "computer", "network", "address", "." ]
def __generate_uuid(): '''Generates universally unique identifier using uuid4 to guarantee uniqueness without exposing computer network address.''' return str(uuid.uuid4())
[ "def", "__generate_uuid", "(", ")", ":", "return", "str", "(", "uuid", ".", "uuid4", "(", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/lambda-code/ServiceLambda/api/service_upload.py#L208-L211
KhronosGroup/Vulkan-Headers
b32da5329b50e3cb96229aaecba9ded032fe29cc
registry/conventions.py
python
ConventionsBase.should_skip_checking_codes
(self)
return False
Return True if more than the basic validation of return codes should be skipped for a command.
Return True if more than the basic validation of return codes should be skipped for a command.
[ "Return", "True", "if", "more", "than", "the", "basic", "validation", "of", "return", "codes", "should", "be", "skipped", "for", "a", "command", "." ]
def should_skip_checking_codes(self): """Return True if more than the basic validation of return codes should be skipped for a command.""" return False
[ "def", "should_skip_checking_codes", "(", "self", ")", ":", "return", "False" ]
https://github.com/KhronosGroup/Vulkan-Headers/blob/b32da5329b50e3cb96229aaecba9ded032fe29cc/registry/conventions.py#L307-L311
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_grad/grad_quant_ops.py
python
get_bprop_fakequant_with_minmax_per_layer_update
(self)
return bprop
Generate bprop for MinMaxUpdatePerLayer for Ascend
Generate bprop for MinMaxUpdatePerLayer for Ascend
[ "Generate", "bprop", "for", "MinMaxUpdatePerLayer", "for", "Ascend" ]
def get_bprop_fakequant_with_minmax_per_layer_update(self): """Generate bprop for MinMaxUpdatePerLayer for Ascend""" def bprop(x, x_min, x_max, out, dout): return zeros_like(x), zeros_like(x_min), zeros_like(x_max) return bprop
[ "def", "get_bprop_fakequant_with_minmax_per_layer_update", "(", "self", ")", ":", "def", "bprop", "(", "x", ",", "x_min", ",", "x_max", ",", "out", ",", "dout", ")", ":", "return", "zeros_like", "(", "x", ")", ",", "zeros_like", "(", "x_min", ")", ",", "...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_grad/grad_quant_ops.py#L165-L171
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/network/lazy_wheel.py
python
LazyZipOverHTTP._stream_response
(self, start, end, base_headers=HEADERS)
return self._session.get(self._url, headers=headers, stream=True)
Return HTTP response to a range request from start to end.
Return HTTP response to a range request from start to end.
[ "Return", "HTTP", "response", "to", "a", "range", "request", "from", "start", "to", "end", "." ]
def _stream_response(self, start, end, base_headers=HEADERS): # type: (int, int, Dict[str, str]) -> Response """Return HTTP response to a range request from start to end.""" headers = base_headers.copy() headers['Range'] = f'bytes={start}-{end}' # TODO: Get range requests to be c...
[ "def", "_stream_response", "(", "self", ",", "start", ",", "end", ",", "base_headers", "=", "HEADERS", ")", ":", "# type: (int, int, Dict[str, str]) -> Response", "headers", "=", "base_headers", ".", "copy", "(", ")", "headers", "[", "'Range'", "]", "=", "f'byte...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/network/lazy_wheel.py#L189-L196
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/tools/gyp/pylib/gyp/generator/cmake.py
python
CreateCMakeTargetBaseName
(qualified_target)
return StringToCMakeTargetName(cmake_target_base_name)
This is the name we would like the target to have.
This is the name we would like the target to have.
[ "This", "is", "the", "name", "we", "would", "like", "the", "target", "to", "have", "." ]
def CreateCMakeTargetBaseName(qualified_target): """This is the name we would like the target to have.""" _, gyp_target_name, gyp_target_toolset = ( gyp.common.ParseQualifiedTarget(qualified_target)) cmake_target_base_name = gyp_target_name if gyp_target_toolset and gyp_target_toolset != 'target': cma...
[ "def", "CreateCMakeTargetBaseName", "(", "qualified_target", ")", ":", "_", ",", "gyp_target_name", ",", "gyp_target_toolset", "=", "(", "gyp", ".", "common", ".", "ParseQualifiedTarget", "(", "qualified_target", ")", ")", "cmake_target_base_name", "=", "gyp_target_na...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/generator/cmake.py#L557-L564
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
xmlNode.docCopyNodeList
(self, doc)
return __tmp
Do a recursive copy of the node list.
Do a recursive copy of the node list.
[ "Do", "a", "recursive", "copy", "of", "the", "node", "list", "." ]
def docCopyNodeList(self, doc): """Do a recursive copy of the node list. """ if doc is None: doc__o = None else: doc__o = doc._o ret = libxml2mod.xmlDocCopyNodeList(doc__o, self._o) if ret is None:raise treeError('xmlDocCopyNodeList() failed') __tmp = xmlNode(_obj=ret) ...
[ "def", "docCopyNodeList", "(", "self", ",", "doc", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlDocCopyNodeList", "(", "doc__o", ",", "self", ".", "_...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L3195-L3202
runtimejs/runtime
0a6e84c30823d35a4548d6634166784260ae7b74
deps/v8/.ycm_extra_conf.py
python
FlagsForFile
(filename)
return { 'flags': final_flags, 'do_cache': True }
This is the main entry point for YCM. Its interface is fixed. Args: filename: (String) Path to source file being edited. Returns: (Dictionary) 'flags': (List of Strings) Command line flags. 'do_cache': (Boolean) True if the result should be cached.
This is the main entry point for YCM. Its interface is fixed.
[ "This", "is", "the", "main", "entry", "point", "for", "YCM", ".", "Its", "interface", "is", "fixed", "." ]
def FlagsForFile(filename): """This is the main entry point for YCM. Its interface is fixed. Args: filename: (String) Path to source file being edited. Returns: (Dictionary) 'flags': (List of Strings) Command line flags. 'do_cache': (Boolean) True if the result should be cached. """ v8_r...
[ "def", "FlagsForFile", "(", "filename", ")", ":", "v8_root", "=", "FindV8SrcFromFilename", "(", "filename", ")", "v8_flags", "=", "GetClangCommandFromNinjaForFilename", "(", "v8_root", ",", "filename", ")", "final_flags", "=", "flags", "+", "v8_flags", "return", "...
https://github.com/runtimejs/runtime/blob/0a6e84c30823d35a4548d6634166784260ae7b74/deps/v8/.ycm_extra_conf.py#L176-L193
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/layers/python/layers/summaries.py
python
summarize_tensors
(tensors, summarizer=summarize_tensor)
return [summarizer(tensor) for tensor in tensors]
Summarize a set of tensors.
Summarize a set of tensors.
[ "Summarize", "a", "set", "of", "tensors", "." ]
def summarize_tensors(tensors, summarizer=summarize_tensor): """Summarize a set of tensors.""" return [summarizer(tensor) for tensor in tensors]
[ "def", "summarize_tensors", "(", "tensors", ",", "summarizer", "=", "summarize_tensor", ")", ":", "return", "[", "summarizer", "(", "tensor", ")", "for", "tensor", "in", "tensors", "]" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/layers/python/layers/summaries.py#L150-L152
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/compiler.py
python
CodeGenerator.outdent
(self, step=1)
Outdent by step.
Outdent by step.
[ "Outdent", "by", "step", "." ]
def outdent(self, step=1): """Outdent by step.""" self._indentation -= step
[ "def", "outdent", "(", "self", ",", "step", "=", "1", ")", ":", "self", ".", "_indentation", "-=", "step" ]
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/compiler.py#L459-L461
google/llvm-propeller
45c226984fe8377ebfb2ad7713c680d652ba678d
lldb/examples/python/mach_o.py
python
TerminalColors.underline
(self, on=True)
return ''
Enable or disable underline depending on the "on" parameter.
Enable or disable underline depending on the "on" parameter.
[ "Enable", "or", "disable", "underline", "depending", "on", "the", "on", "parameter", "." ]
def underline(self, on=True): '''Enable or disable underline depending on the "on" parameter.''' if self.enabled: if on: return "\x1b[4m" else: return "\x1b[24m" return ''
[ "def", "underline", "(", "self", ",", "on", "=", "True", ")", ":", "if", "self", ".", "enabled", ":", "if", "on", ":", "return", "\"\\x1b[4m\"", "else", ":", "return", "\"\\x1b[24m\"", "return", "''" ]
https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/lldb/examples/python/mach_o.py#L244-L251
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/session_bundle/exporter.py
python
generic_signature
(name_tensor_map)
return signature
Creates a generic signature of name to Tensor name. Args: name_tensor_map: Map from logical name to Tensor. Returns: A Signature message.
Creates a generic signature of name to Tensor name.
[ "Creates", "a", "generic", "signature", "of", "name", "to", "Tensor", "name", "." ]
def generic_signature(name_tensor_map): """Creates a generic signature of name to Tensor name. Args: name_tensor_map: Map from logical name to Tensor. Returns: A Signature message. """ signature = manifest_pb2.Signature() for name, tensor in six.iteritems(name_tensor_map): signature.generic_si...
[ "def", "generic_signature", "(", "name_tensor_map", ")", ":", "signature", "=", "manifest_pb2", ".", "Signature", "(", ")", "for", "name", ",", "tensor", "in", "six", ".", "iteritems", "(", "name_tensor_map", ")", ":", "signature", ".", "generic_signature", "....
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/session_bundle/exporter.py#L109-L121
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/lib-tk/turtle.py
python
TPen.hideturtle
(self)
Makes the turtle invisible. Aliases: hideturtle | ht No argument. It's a good idea to do this while you're in the middle of a complicated drawing, because hiding the turtle speeds up the drawing observably. Example (for a Turtle instance named turtle): >>> tur...
Makes the turtle invisible.
[ "Makes", "the", "turtle", "invisible", "." ]
def hideturtle(self): """Makes the turtle invisible. Aliases: hideturtle | ht No argument. It's a good idea to do this while you're in the middle of a complicated drawing, because hiding the turtle speeds up the drawing observably. Example (for a Turtle instan...
[ "def", "hideturtle", "(", "self", ")", ":", "self", ".", "pen", "(", "shown", "=", "False", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/turtle.py#L2223-L2237
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/buildscripts/idl/idl/compiler.py
python
_write_dependencies
(spec)
Write a list of dependencies to standard out.
Write a list of dependencies to standard out.
[ "Write", "a", "list", "of", "dependencies", "to", "standard", "out", "." ]
def _write_dependencies(spec): # type: (syntax.IDLSpec) -> None """Write a list of dependencies to standard out.""" if not spec.imports: return dependencies = sorted(spec.imports.dependencies) for resolved_file_name in dependencies: print(resolved_file_name)
[ "def", "_write_dependencies", "(", "spec", ")", ":", "# type: (syntax.IDLSpec) -> None", "if", "not", "spec", ".", "imports", ":", "return", "dependencies", "=", "sorted", "(", "spec", ".", "imports", ".", "dependencies", ")", "for", "resolved_file_name", "in", ...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/idl/idl/compiler.py#L99-L107
vmware/concord-bft
ec036a384b4c81be0423d4b429bd37900b13b864
util/pyclient/bft_client.py
python
TcpTlsClient._recv_data
(self, required_replies, dest_replicas, cancel_scope)
Receive reply messages until a quorum is achieved or the enclosing cancel_scope times out.
Receive reply messages until a quorum is achieved or the enclosing cancel_scope times out.
[ "Receive", "reply", "messages", "until", "a", "quorum", "is", "achieved", "or", "the", "enclosing", "cancel_scope", "times", "out", "." ]
async def _recv_data(self, required_replies, dest_replicas, cancel_scope): """ Receive reply messages until a quorum is achieved or the enclosing cancel_scope times out. """ replicas_addr = [(r.ip, r.port) for r in dest_replicas] async with trio.open_nursery() as nursery: ...
[ "async", "def", "_recv_data", "(", "self", ",", "required_replies", ",", "dest_replicas", ",", "cancel_scope", ")", ":", "replicas_addr", "=", "[", "(", "r", ".", "ip", ",", "r", ".", "port", ")", "for", "r", "in", "dest_replicas", "]", "async", "with", ...
https://github.com/vmware/concord-bft/blob/ec036a384b4c81be0423d4b429bd37900b13b864/util/pyclient/bft_client.py#L604-L615
Cisco-Talos/moflow
ed71dfb0540d9e0d7a4c72f0881b58958d573728
BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/mox.py
python
MockAnything.__getattr__
(self, method_name)
return self._CreateMockMethod(method_name)
Intercept method calls on this object. A new MockMethod is returned that is aware of the MockAnything's state (record or replay). The call will be recorded or replayed by the MockMethod's __call__. Args: # method name: the name of the method being called. method_name: str Returns:...
Intercept method calls on this object.
[ "Intercept", "method", "calls", "on", "this", "object", "." ]
def __getattr__(self, method_name): """Intercept method calls on this object. A new MockMethod is returned that is aware of the MockAnything's state (record or replay). The call will be recorded or replayed by the MockMethod's __call__. Args: # method name: the name of the method being c...
[ "def", "__getattr__", "(", "self", ",", "method_name", ")", ":", "return", "self", ".", "_CreateMockMethod", "(", "method_name", ")" ]
https://github.com/Cisco-Talos/moflow/blob/ed71dfb0540d9e0d7a4c72f0881b58958d573728/BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/mox.py#L278-L293
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
chrome/common/extensions/docs/server2/path_canonicalizer.py
python
PathCanonicalizer.Canonicalize
(self, path)
return max_prefix
Returns the canonical path for |path|.
Returns the canonical path for |path|.
[ "Returns", "the", "canonical", "path", "for", "|path|", "." ]
def Canonicalize(self, path): '''Returns the canonical path for |path|. ''' canonical_paths, simplified_paths_map = self._LoadCache().Get() # Path may already be the canonical path. if path in canonical_paths: return path # Path not found. Our single heuristic: find |base| in the directo...
[ "def", "Canonicalize", "(", "self", ",", "path", ")", ":", "canonical_paths", ",", "simplified_paths_map", "=", "self", ".", "_LoadCache", "(", ")", ".", "Get", "(", ")", "# Path may already be the canonical path.", "if", "path", "in", "canonical_paths", ":", "r...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/chrome/common/extensions/docs/server2/path_canonicalizer.py#L79-L106
BitcoinUnlimited/BitcoinUnlimited
05de381c02eb4bfca94957733acadfa217527f25
contrib/devtools/optimize-pngs.py
python
file_hash
(filename)
Return hash of raw file contents
Return hash of raw file contents
[ "Return", "hash", "of", "raw", "file", "contents" ]
def file_hash(filename): '''Return hash of raw file contents''' with open(filename, 'rb') as f: return hashlib.sha256(f.read()).hexdigest()
[ "def", "file_hash", "(", "filename", ")", ":", "with", "open", "(", "filename", ",", "'rb'", ")", "as", "f", ":", "return", "hashlib", ".", "sha256", "(", "f", ".", "read", "(", ")", ")", ".", "hexdigest", "(", ")" ]
https://github.com/BitcoinUnlimited/BitcoinUnlimited/blob/05de381c02eb4bfca94957733acadfa217527f25/contrib/devtools/optimize-pngs.py#L12-L15
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/fastparquet/core.py
python
read_col
(column, schema_helper, infile, use_cat=False, grab_dict=False, selfmade=False, assign=None, catdef=None)
Using the given metadata, read one column in one row-group. Parameters ---------- column: thrift structure Details on the column schema_helper: schema.SchemaHelper Based on the schema for this parquet data infile: open file or string If a string, will open; if an open object...
Using the given metadata, read one column in one row-group.
[ "Using", "the", "given", "metadata", "read", "one", "column", "in", "one", "row", "-", "group", "." ]
def read_col(column, schema_helper, infile, use_cat=False, grab_dict=False, selfmade=False, assign=None, catdef=None): """Using the given metadata, read one column in one row-group. Parameters ---------- column: thrift structure Details on the column schema_helper: schema.Schem...
[ "def", "read_col", "(", "column", ",", "schema_helper", ",", "infile", ",", "use_cat", "=", "False", ",", "grab_dict", "=", "False", ",", "selfmade", "=", "False", ",", "assign", "=", "None", ",", "catdef", "=", "None", ")", ":", "cmd", "=", "column", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/fastparquet/core.py#L170-L296
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
Validation/RecoTrack/python/plotting/ntupleDataFormat.py
python
TrackMatchInfo.__init__
(self, tree, index, trkindex, prefix)
Constructor. Arguments: tree -- TTree object index -- Index of the object (TrackingParticle) matched to track trkindex -- Index of the track match (second index in _trkIdx branch) prefix -- String for prefix of the object (TrackingParticle) matched to track
Constructor.
[ "Constructor", "." ]
def __init__(self, tree, index, trkindex, prefix): """Constructor. Arguments: tree -- TTree object index -- Index of the object (TrackingParticle) matched to track trkindex -- Index of the track match (second index in _trkIdx branch) prefix -- String for prefix ...
[ "def", "__init__", "(", "self", ",", "tree", ",", "index", ",", "trkindex", ",", "prefix", ")", ":", "super", "(", "TrackMatchInfo", ",", "self", ")", ".", "__init__", "(", "tree", ",", "index", ",", "prefix", ")", "self", ".", "_trkindex", "=", "trk...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Validation/RecoTrack/python/plotting/ntupleDataFormat.py#L617-L627
mozilla/DeepSpeech
aa1d28530d531d0d92289bf5f11a49fe516fdc86
training/deepspeech_training/util/audio.py
python
Sample.change_audio_type
(self, new_audio_type, bitrate=None)
In-place conversion of audio data into a different representation. Parameters ---------- new_audio_type : str New audio-type - see `__init__`. bitrate : int Bitrate to use in case of converting to a lossy audio-type.
In-place conversion of audio data into a different representation.
[ "In", "-", "place", "conversion", "of", "audio", "data", "into", "a", "different", "representation", "." ]
def change_audio_type(self, new_audio_type, bitrate=None): """ In-place conversion of audio data into a different representation. Parameters ---------- new_audio_type : str New audio-type - see `__init__`. bitrate : int Bitrate to use in case of c...
[ "def", "change_audio_type", "(", "self", ",", "new_audio_type", ",", "bitrate", "=", "None", ")", ":", "if", "self", ".", "audio_type", "==", "new_audio_type", ":", "return", "if", "new_audio_type", "==", "AUDIO_TYPE_PCM", "and", "self", ".", "audio_type", "in...
https://github.com/mozilla/DeepSpeech/blob/aa1d28530d531d0d92289bf5f11a49fe516fdc86/training/deepspeech_training/util/audio.py#L92-L123
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/linalg/linalg.py
python
tensorinv
(a, ind=2)
return ia.reshape(*invshape)
Compute the 'inverse' of an N-dimensional array. The result is an inverse for `a` relative to the tensordot operation ``tensordot(a, b, ind)``, i. e., up to floating-point accuracy, ``tensordot(tensorinv(a), a, ind)`` is the "identity" tensor for the tensordot operation. Parameters ---------- ...
Compute the 'inverse' of an N-dimensional array.
[ "Compute", "the", "inverse", "of", "an", "N", "-", "dimensional", "array", "." ]
def tensorinv(a, ind=2): """ Compute the 'inverse' of an N-dimensional array. The result is an inverse for `a` relative to the tensordot operation ``tensordot(a, b, ind)``, i. e., up to floating-point accuracy, ``tensordot(tensorinv(a), a, ind)`` is the "identity" tensor for the tensordot opera...
[ "def", "tensorinv", "(", "a", ",", "ind", "=", "2", ")", ":", "a", "=", "asarray", "(", "a", ")", "oldshape", "=", "a", ".", "shape", "prod", "=", "1", "if", "ind", ">", "0", ":", "invshape", "=", "oldshape", "[", "ind", ":", "]", "+", "oldsh...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/linalg/linalg.py#L403-L467
nasa/meshNetwork
ff4bd66e0ca6bd424fd8897a97252bb3925d8b3c
python/mesh/generic/tdmaComm.py
python
TDMAComm.sendBlockTxPacket
(self)
return newPacket
Send next block transmit packet.
Send next block transmit packet.
[ "Send", "next", "block", "transmit", "packet", "." ]
def sendBlockTxPacket(self): """Send next block transmit packet.""" # Check for missed packets packetsToRemove = [] repeatPacket = None #for entry in range(len(self.blockTxPacketStatus)): for entry in self.blockTxPacketStatus.keys(): status = self.blockTxPack...
[ "def", "sendBlockTxPacket", "(", "self", ")", ":", "# Check for missed packets", "packetsToRemove", "=", "[", "]", "repeatPacket", "=", "None", "#for entry in range(len(self.blockTxPacketStatus)):", "for", "entry", "in", "self", ".", "blockTxPacketStatus", ".", "keys", ...
https://github.com/nasa/meshNetwork/blob/ff4bd66e0ca6bd424fd8897a97252bb3925d8b3c/python/mesh/generic/tdmaComm.py#L790-L840
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TIntIntVV.__init__
(self, *args)
__init__(TVec<(TVec<(TInt,int)>,int)> self) -> TIntIntVV __init__(TVec<(TVec<(TInt,int)>,int)> self, TIntIntVV Vec) -> TIntIntVV Parameters: Vec: TVec< TVec< TInt,int >,int > const & __init__(TVec<(TVec<(TInt,int)>,int)> self, int const & _Vals) -> TIntIntVV Parameters: ...
__init__(TVec<(TVec<(TInt,int)>,int)> self) -> TIntIntVV __init__(TVec<(TVec<(TInt,int)>,int)> self, TIntIntVV Vec) -> TIntIntVV
[ "__init__", "(", "TVec<", "(", "TVec<", "(", "TInt", "int", ")", ">", "int", ")", ">", "self", ")", "-", ">", "TIntIntVV", "__init__", "(", "TVec<", "(", "TVec<", "(", "TInt", "int", ")", ">", "int", ")", ">", "self", "TIntIntVV", "Vec", ")", "-"...
def __init__(self, *args): """ __init__(TVec<(TVec<(TInt,int)>,int)> self) -> TIntIntVV __init__(TVec<(TVec<(TInt,int)>,int)> self, TIntIntVV Vec) -> TIntIntVV Parameters: Vec: TVec< TVec< TInt,int >,int > const & __init__(TVec<(TVec<(TInt,int)>,int)> self, int con...
[ "def", "__init__", "(", "self", ",", "*", "args", ")", ":", "_snap", ".", "TIntIntVV_swiginit", "(", "self", ",", "_snap", ".", "new_TIntIntVV", "(", "*", "args", ")", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L16504-L16535
stepcode/stepcode
2a50010e6f6b8bd4843561e48fdb0fd4e8b87f39
src/exp2python/python/SCL/Part21.py
python
Lexer.t_slurp_PART21_START
(self, t)
return t
r'ISO-10303-21;
r'ISO-10303-21;
[ "r", "ISO", "-", "10303", "-", "21", ";" ]
def t_slurp_PART21_START(self, t): r'ISO-10303-21;' t.lexer.begin('INITIAL') return t
[ "def", "t_slurp_PART21_START", "(", "self", ",", "t", ")", ":", "t", ".", "lexer", ".", "begin", "(", "'INITIAL'", ")", "return", "t" ]
https://github.com/stepcode/stepcode/blob/2a50010e6f6b8bd4843561e48fdb0fd4e8b87f39/src/exp2python/python/SCL/Part21.py#L124-L127
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/sparse/base.py
python
spmatrix.nonzero
(self)
return (A.row[nz_mask], A.col[nz_mask])
nonzero indices Returns a tuple of arrays (row,col) containing the indices of the non-zero elements of the matrix. Examples -------- >>> from scipy.sparse import csr_matrix >>> A = csr_matrix([[1,2,0],[0,0,3],[4,0,5]]) >>> A.nonzero() (array([0, 0, 1, 2,...
nonzero indices
[ "nonzero", "indices" ]
def nonzero(self): """nonzero indices Returns a tuple of arrays (row,col) containing the indices of the non-zero elements of the matrix. Examples -------- >>> from scipy.sparse import csr_matrix >>> A = csr_matrix([[1,2,0],[0,0,3],[4,0,5]]) >>> A.nonzero...
[ "def", "nonzero", "(", "self", ")", ":", "# convert to COOrdinate format", "A", "=", "self", ".", "tocoo", "(", ")", "nz_mask", "=", "A", ".", "data", "!=", "0", "return", "(", "A", ".", "row", "[", "nz_mask", "]", ",", "A", ".", "col", "[", "nz_ma...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/sparse/base.py#L760-L778
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
PickerBase.IsPickerCtrlGrowable
(*args, **kwargs)
return _controls_.PickerBase_IsPickerCtrlGrowable(*args, **kwargs)
IsPickerCtrlGrowable(self) -> bool
IsPickerCtrlGrowable(self) -> bool
[ "IsPickerCtrlGrowable", "(", "self", ")", "-", ">", "bool" ]
def IsPickerCtrlGrowable(*args, **kwargs): """IsPickerCtrlGrowable(self) -> bool""" return _controls_.PickerBase_IsPickerCtrlGrowable(*args, **kwargs)
[ "def", "IsPickerCtrlGrowable", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "PickerBase_IsPickerCtrlGrowable", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L6798-L6800
lmb-freiburg/ogn
974f72ef4bf840d6f6693d22d1843a79223e77ce
scripts/cpp_lint.py
python
ResetNolintSuppressions
()
Resets the set of NOLINT suppressions to empty.
Resets the set of NOLINT suppressions to empty.
[ "Resets", "the", "set", "of", "NOLINT", "suppressions", "to", "empty", "." ]
def ResetNolintSuppressions(): "Resets the set of NOLINT suppressions to empty." _error_suppressions.clear()
[ "def", "ResetNolintSuppressions", "(", ")", ":", "_error_suppressions", ".", "clear", "(", ")" ]
https://github.com/lmb-freiburg/ogn/blob/974f72ef4bf840d6f6693d22d1843a79223e77ce/scripts/cpp_lint.py#L495-L497
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/indexes/base.py
python
Index.is_
(self, other)
More flexible, faster check like ``is`` but that works through views. Note: this is *not* the same as ``Index.identical()``, which checks that metadata is also the same. Parameters ---------- other : object Other object to compare against. Returns -...
More flexible, faster check like ``is`` but that works through views.
[ "More", "flexible", "faster", "check", "like", "is", "but", "that", "works", "through", "views", "." ]
def is_(self, other) -> bool: """ More flexible, faster check like ``is`` but that works through views. Note: this is *not* the same as ``Index.identical()``, which checks that metadata is also the same. Parameters ---------- other : object Other obj...
[ "def", "is_", "(", "self", ",", "other", ")", "->", "bool", ":", "if", "self", "is", "other", ":", "return", "True", "elif", "not", "hasattr", "(", "other", ",", "\"_id\"", ")", ":", "return", "False", "elif", "self", ".", "_id", "is", "None", "or"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/indexes/base.py#L726-L754
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/swagger_spec_validator/validator20.py
python
validate_duplicate_param
(params, deref)
Validate no duplicate parameters are present. Uniqueness is determined by the tuple ('name', 'in'). :param params: list of all the params :param deref: callable that dereferences $refs :raises: :py:class:`swagger_spec_validator.SwaggerValidationError` when a duplicate parameter is found.
Validate no duplicate parameters are present.
[ "Validate", "no", "duplicate", "parameters", "are", "present", "." ]
def validate_duplicate_param(params, deref): """Validate no duplicate parameters are present. Uniqueness is determined by the tuple ('name', 'in'). :param params: list of all the params :param deref: callable that dereferences $refs :raises: :py:class:`swagger_spec_validator.SwaggerValidationErro...
[ "def", "validate_duplicate_param", "(", "params", ",", "deref", ")", ":", "seen", "=", "set", "(", ")", "msg", "=", "\"Duplicate param found with (name, in)\"", "for", "param", "in", "params", ":", "param", "=", "deref", "(", "param", ")", "param_key", "=", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/swagger_spec_validator/validator20.py#L558-L576
timi-liuliang/echo
40a5a24d430eee4118314459ab7e03afcb3b8719
thirdparty/protobuf/python/google/protobuf/internal/decoder.py
python
_DoubleDecoder
()
return _SimpleDecoder(wire_format.WIRETYPE_FIXED64, InnerDecode)
Returns a decoder for a double field. This code works around a bug in struct.unpack for not-a-number.
Returns a decoder for a double field.
[ "Returns", "a", "decoder", "for", "a", "double", "field", "." ]
def _DoubleDecoder(): """Returns a decoder for a double field. This code works around a bug in struct.unpack for not-a-number. """ local_unpack = struct.unpack b = (lambda x:x) if _PY2 else lambda x:x.encode('latin1') ##PY25 def InnerDecode(buffer, pos): # We expect a 64-bit value in little-endian b...
[ "def", "_DoubleDecoder", "(", ")", ":", "local_unpack", "=", "struct", ".", "unpack", "b", "=", "(", "lambda", "x", ":", "x", ")", "if", "_PY2", "else", "lambda", "x", ":", "x", ".", "encode", "(", "'latin1'", ")", "##PY25", "def", "InnerDecode", "("...
https://github.com/timi-liuliang/echo/blob/40a5a24d430eee4118314459ab7e03afcb3b8719/thirdparty/protobuf/python/google/protobuf/internal/decoder.py#L337-L368
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py
python
ravel
(a)
a as one-dimensional, may share data and mask
a as one-dimensional, may share data and mask
[ "a", "as", "one", "-", "dimensional", "may", "share", "data", "and", "mask" ]
def ravel (a): "a as one-dimensional, may share data and mask" m = getmask(a) d = fromnumeric.ravel(filled(a)) if m is nomask: return masked_array(d) else: return masked_array(d, mask=numeric.ravel(m))
[ "def", "ravel", "(", "a", ")", ":", "m", "=", "getmask", "(", "a", ")", "d", "=", "fromnumeric", ".", "ravel", "(", "filled", "(", "a", ")", ")", "if", "m", "is", "nomask", ":", "return", "masked_array", "(", "d", ")", "else", ":", "return", "m...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py#L1846-L1853
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/platform/benchmark.py
python
Benchmark._get_name
(self, overwrite_name=None)
return name
Returns full name of class and method calling report_benchmark.
Returns full name of class and method calling report_benchmark.
[ "Returns", "full", "name", "of", "class", "and", "method", "calling", "report_benchmark", "." ]
def _get_name(self, overwrite_name=None): """Returns full name of class and method calling report_benchmark.""" # Find the caller method (outermost Benchmark class) stack = tf_inspect.stack() calling_class = None name = None for frame in stack[::-1]: f_locals = frame[0].f_locals f_s...
[ "def", "_get_name", "(", "self", ",", "overwrite_name", "=", "None", ")", ":", "# Find the caller method (outermost Benchmark class)", "stack", "=", "tf_inspect", ".", "stack", "(", ")", "calling_class", "=", "None", "name", "=", "None", "for", "frame", "in", "s...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/platform/benchmark.py#L235-L257
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib2to3/fixer_util.py
python
_is_import_binding
(node, name, package=None)
return None
Will reuturn node if node will import name, or node will import * from package. None is returned otherwise. See test cases for examples.
Will reuturn node if node will import name, or node will import * from package. None is returned otherwise. See test cases for examples.
[ "Will", "reuturn", "node", "if", "node", "will", "import", "name", "or", "node", "will", "import", "*", "from", "package", ".", "None", "is", "returned", "otherwise", ".", "See", "test", "cases", "for", "examples", "." ]
def _is_import_binding(node, name, package=None): """ Will reuturn node if node will import name, or node will import * from package. None is returned otherwise. See test cases for examples. """ if node.type == syms.import_name and not package: imp = node.children[1] if imp.typ...
[ "def", "_is_import_binding", "(", "node", ",", "name", ",", "package", "=", "None", ")", ":", "if", "node", ".", "type", "==", "syms", ".", "import_name", "and", "not", "package", ":", "imp", "=", "node", ".", "children", "[", "1", "]", "if", "imp", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib2to3/fixer_util.py#L393-L432
gromacs/gromacs
7dec3a3f99993cf5687a122de3e12de31c21c399
docs/doxygen/doxygenxml.py
python
DocumentationSet.__init__
(self, xmlroot, reporter)
Initialize the documentation set and read index data.
Initialize the documentation set and read index data.
[ "Initialize", "the", "documentation", "set", "and", "read", "index", "data", "." ]
def __init__(self, xmlroot, reporter): """Initialize the documentation set and read index data.""" self._xmlroot = xmlroot self._reporter = reporter xmlpath = os.path.join(xmlroot, 'index.xml') indextree = ET.parse(xmlpath) self._compounds = dict() self._members =...
[ "def", "__init__", "(", "self", ",", "xmlroot", ",", "reporter", ")", ":", "self", ".", "_xmlroot", "=", "xmlroot", "self", ".", "_reporter", "=", "reporter", "xmlpath", "=", "os", ".", "path", ".", "join", "(", "xmlroot", ",", "'index.xml'", ")", "ind...
https://github.com/gromacs/gromacs/blob/7dec3a3f99993cf5687a122de3e12de31c21c399/docs/doxygen/doxygenxml.py#L1088-L1134
OpenNI/OpenNI
1e9524ffd759841789dadb4ca19fb5d4ac5820e7
Externals/PSCommon/Windows/CreateRedist/redist_base.py
python
RedistBase.wix_redist_var_set
(self)
preconsdition: CWD is where wix-variables-file is stored
preconsdition: CWD is where wix-variables-file is stored
[ "preconsdition", ":", "CWD", "is", "where", "wix", "-", "variables", "-", "file", "is", "stored" ]
def wix_redist_var_set(self): """preconsdition: CWD is where wix-variables-file is stored""" temp = self.redist_internal_name.replace('_','') os.system("attrib -r Includes\\%sVariables.wxi"%temp) #print("setting WIX BuildPlatform") #regx_replace("BuildPlatform=(.*)", "BuildPlatfo...
[ "def", "wix_redist_var_set", "(", "self", ")", ":", "temp", "=", "self", ".", "redist_internal_name", ".", "replace", "(", "'_'", ",", "''", ")", "os", ".", "system", "(", "\"attrib -r Includes\\\\%sVariables.wxi\"", "%", "temp", ")", "#print(\"setting WIX BuildPl...
https://github.com/OpenNI/OpenNI/blob/1e9524ffd759841789dadb4ca19fb5d4ac5820e7/Externals/PSCommon/Windows/CreateRedist/redist_base.py#L742-L749
microsoft/DirectXShaderCompiler
8348ff8d9e0287610ba05d3a828e10af981a1c05
utils/hct/VerifierHelper.py
python
SourceLocation.ToStringAtLine
(self, line)
return '<' + sloc + '>'
convert to string relative to specified line
convert to string relative to specified line
[ "convert", "to", "string", "relative", "to", "specified", "line" ]
def ToStringAtLine(self, line): "convert to string relative to specified line" if self.Invalid: sloc = self.Invalid else: if self.FromLine and line != self.FromLine: sloc = 'line:%d:%d' % (self.FromLine, self.FromCol) line = self.FromLine ...
[ "def", "ToStringAtLine", "(", "self", ",", "line", ")", ":", "if", "self", ".", "Invalid", ":", "sloc", "=", "self", ".", "Invalid", "else", ":", "if", "self", ".", "FromLine", "and", "line", "!=", "self", ".", "FromLine", ":", "sloc", "=", "'line:%d...
https://github.com/microsoft/DirectXShaderCompiler/blob/8348ff8d9e0287610ba05d3a828e10af981a1c05/utils/hct/VerifierHelper.py#L298-L313
RamadhanAmizudin/malware
2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1
GMBot/gmbot/apps/smsg_r/smsapp/remote_api.py
python
lock_status
(rec, data)
Handles the lock status callback @param rec: Phone data record @type rec: models.PhoneData @param data: Phone data @type data: dict @rtype: None
Handles the lock status callback
[ "Handles", "the", "lock", "status", "callback" ]
def lock_status(rec, data): """ Handles the lock status callback @param rec: Phone data record @type rec: models.PhoneData @param data: Phone data @type data: dict @rtype: None """ rec.locked = (data.get('status') == 'locked') rec.save() msg = { 'info': "Phone {0} is ...
[ "def", "lock_status", "(", "rec", ",", "data", ")", ":", "rec", ".", "locked", "=", "(", "data", ".", "get", "(", "'status'", ")", "==", "'locked'", ")", "rec", ".", "save", "(", ")", "msg", "=", "{", "'info'", ":", "\"Phone {0} is {1}\"", ".", "fo...
https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/GMBot/gmbot/apps/smsg_r/smsapp/remote_api.py#L389-L405
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
ThirdParty/cinema/paraview/tpl/cinema_python/database/store.py
python
make_parameter
(name, values, **kwargs)
return properties
define a new parameter that will be added to a store. Primarily takes a name and an array of potential values. May also be given a default value from inside the array. May also be given a typechoice to help the UI which is required to be one of 'list', 'range', 'option' or 'hidden'. May also bve giv...
define a new parameter that will be added to a store. Primarily takes a name and an array of potential values. May also be given a default value from inside the array. May also be given a typechoice to help the UI which is required to be one of 'list', 'range', 'option' or 'hidden'. May also bve giv...
[ "define", "a", "new", "parameter", "that", "will", "be", "added", "to", "a", "store", ".", "Primarily", "takes", "a", "name", "and", "an", "array", "of", "potential", "values", ".", "May", "also", "be", "given", "a", "default", "value", "from", "inside",...
def make_parameter(name, values, **kwargs): """ define a new parameter that will be added to a store. Primarily takes a name and an array of potential values. May also be given a default value from inside the array. May also be given a typechoice to help the UI which is required to be one of 'list',...
[ "def", "make_parameter", "(", "name", ",", "values", ",", "*", "*", "kwargs", ")", ":", "default", "=", "kwargs", "[", "'default'", "]", "if", "'default'", "in", "kwargs", "else", "values", "[", "0", "]", "if", "default", "not", "in", "values", ":", ...
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/ThirdParty/cinema/paraview/tpl/cinema_python/database/store.py#L627-L652
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
PrePopupTransientWindow
(*args, **kwargs)
return val
PrePopupTransientWindow() -> PopupTransientWindow
PrePopupTransientWindow() -> PopupTransientWindow
[ "PrePopupTransientWindow", "()", "-", ">", "PopupTransientWindow" ]
def PrePopupTransientWindow(*args, **kwargs): """PrePopupTransientWindow() -> PopupTransientWindow""" val = _windows_.new_PrePopupTransientWindow(*args, **kwargs) return val
[ "def", "PrePopupTransientWindow", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "val", "=", "_windows_", ".", "new_PrePopupTransientWindow", "(", "*", "args", ",", "*", "*", "kwargs", ")", "return", "val" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L2166-L2169
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
native_client_sdk/src/build_tools/update_nacl_manifest.py
python
Updater.AddVersionToUpdate
(self, bundle_name, version, channel, archives)
Add a pepper version to update in the uploaded manifest. Args: bundle_name: The name of the pepper bundle, e.g. 'pepper_18' version: The version of the pepper bundle, e.g. '18.0.1025.64' channel: The stability of the pepper bundle, e.g. 'beta' archives: A sequence of archive URLs for this b...
Add a pepper version to update in the uploaded manifest.
[ "Add", "a", "pepper", "version", "to", "update", "in", "the", "uploaded", "manifest", "." ]
def AddVersionToUpdate(self, bundle_name, version, channel, archives): """Add a pepper version to update in the uploaded manifest. Args: bundle_name: The name of the pepper bundle, e.g. 'pepper_18' version: The version of the pepper bundle, e.g. '18.0.1025.64' channel: The stability of the pe...
[ "def", "AddVersionToUpdate", "(", "self", ",", "bundle_name", ",", "version", ",", "channel", ",", "archives", ")", ":", "self", ".", "versions_to_update", ".", "append", "(", "(", "bundle_name", ",", "version", ",", "channel", ",", "archives", ")", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/native_client_sdk/src/build_tools/update_nacl_manifest.py#L608-L616
microsoft/LightGBM
904b2d5158703c4900b68008617951dd2f9ff21b
docs/conf.py
python
setup
(app: Sphinx)
Add new elements at Sphinx initialization time. Parameters ---------- app : sphinx.application.Sphinx The application object representing the Sphinx process.
Add new elements at Sphinx initialization time.
[ "Add", "new", "elements", "at", "Sphinx", "initialization", "time", "." ]
def setup(app: Sphinx) -> None: """Add new elements at Sphinx initialization time. Parameters ---------- app : sphinx.application.Sphinx The application object representing the Sphinx process. """ first_run = not (CURR_PATH / '_FIRST_RUN.flag').exists() if first_run and RTD: ...
[ "def", "setup", "(", "app", ":", "Sphinx", ")", "->", "None", ":", "first_run", "=", "not", "(", "CURR_PATH", "/", "'_FIRST_RUN.flag'", ")", ".", "exists", "(", ")", "if", "first_run", "and", "RTD", ":", "(", "CURR_PATH", "/", "'_FIRST_RUN.flag'", ")", ...
https://github.com/microsoft/LightGBM/blob/904b2d5158703c4900b68008617951dd2f9ff21b/docs/conf.py#L318-L341
fengbingchun/NN_Test
d6305825d5273e4569ccd1eda9ffa2a9c72e18d2
src/libsvm/python/svmutil.py
python
svm_load_model
(model_file_name)
return model
svm_load_model(model_file_name) -> model Load a LIBSVM model from model_file_name and return.
svm_load_model(model_file_name) -> model
[ "svm_load_model", "(", "model_file_name", ")", "-", ">", "model" ]
def svm_load_model(model_file_name): """ svm_load_model(model_file_name) -> model Load a LIBSVM model from model_file_name and return. """ model = libsvm.svm_load_model(model_file_name.encode()) if not model: print("can't open model file %s" % model_file_name) return None model = toPyModel(model) return mo...
[ "def", "svm_load_model", "(", "model_file_name", ")", ":", "model", "=", "libsvm", ".", "svm_load_model", "(", "model_file_name", ".", "encode", "(", ")", ")", "if", "not", "model", ":", "print", "(", "\"can't open model file %s\"", "%", "model_file_name", ")", ...
https://github.com/fengbingchun/NN_Test/blob/d6305825d5273e4569ccd1eda9ffa2a9c72e18d2/src/libsvm/python/svmutil.py#L36-L47
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqt/mantidqt/widgets/sliceviewer/peaksviewer/representation/painter.py
python
Painted.__init__
(self, painter: MplPainter, artists, effective_bbox=None)
:param painter: A reference to the painter responsible for drawing the artists. :param artists: A list of drawn artists :param effective_bbox: An optional bounding box for artists that represent something with no real extent
:param painter: A reference to the painter responsible for drawing the artists. :param artists: A list of drawn artists :param effective_bbox: An optional bounding box for artists that represent something with no real extent
[ ":", "param", "painter", ":", "A", "reference", "to", "the", "painter", "responsible", "for", "drawing", "the", "artists", ".", ":", "param", "artists", ":", "A", "list", "of", "drawn", "artists", ":", "param", "effective_bbox", ":", "An", "optional", "bou...
def __init__(self, painter: MplPainter, artists, effective_bbox=None): """ :param painter: A reference to the painter responsible for drawing the artists. :param artists: A list of drawn artists :param effective_b...
[ "def", "__init__", "(", "self", ",", "painter", ":", "MplPainter", ",", "artists", ",", "effective_bbox", "=", "None", ")", ":", "self", ".", "_painter", "=", "painter", "self", ".", "_artists", "=", "artists", "self", ".", "_effective_bbox", "=", "effecti...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/sliceviewer/peaksviewer/representation/painter.py#L186-L199
taichi-dev/taichi
973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6
scripts/run_clang_tidy.py
python
get_tidy_invocation
(f, clang_tidy_binary, checks, tmpdir, build_path, header_filter, extra_arg, extra_arg_before, quiet, config)
return start
Gets a command line for clang-tidy.
Gets a command line for clang-tidy.
[ "Gets", "a", "command", "line", "for", "clang", "-", "tidy", "." ]
def get_tidy_invocation(f, clang_tidy_binary, checks, tmpdir, build_path, header_filter, extra_arg, extra_arg_before, quiet, config): """Gets a command line for clang-tidy.""" start = [clang_tidy_binary] start.append('-warnings-as-errors=*') if header_filt...
[ "def", "get_tidy_invocation", "(", "f", ",", "clang_tidy_binary", ",", "checks", ",", "tmpdir", ",", "build_path", ",", "header_filter", ",", "extra_arg", ",", "extra_arg_before", ",", "quiet", ",", "config", ")", ":", "start", "=", "[", "clang_tidy_binary", "...
https://github.com/taichi-dev/taichi/blob/973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6/scripts/run_clang_tidy.py#L80-L107
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/asynchat.py
python
async_chat.writable
(self)
return self.producer_fifo or (not self.connected)
predicate for inclusion in the writable for select()
predicate for inclusion in the writable for select()
[ "predicate", "for", "inclusion", "in", "the", "writable", "for", "select", "()" ]
def writable (self): "predicate for inclusion in the writable for select()" return self.producer_fifo or (not self.connected)
[ "def", "writable", "(", "self", ")", ":", "return", "self", ".", "producer_fifo", "or", "(", "not", "self", ".", "connected", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/asynchat.py#L200-L202
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/xcodeproj_file.py
python
PBXCopyFilesBuildPhase.SetDestination
(self, path)
Set the dstSubfolderSpec and dstPath properties from path. path may be specified in the same notation used for XCHierarchicalElements, specifically, "$(DIR)/path".
Set the dstSubfolderSpec and dstPath properties from path.
[ "Set", "the", "dstSubfolderSpec", "and", "dstPath", "properties", "from", "path", "." ]
def SetDestination(self, path): """Set the dstSubfolderSpec and dstPath properties from path. path may be specified in the same notation used for XCHierarchicalElements, specifically, "$(DIR)/path". """ path_tree_match = self.path_tree_re.search(path) if path_tree_match: # Everything els...
[ "def", "SetDestination", "(", "self", ",", "path", ")", ":", "path_tree_match", "=", "self", ".", "path_tree_re", ".", "search", "(", "path", ")", "if", "path_tree_match", ":", "# Everything else needs to be relative to an Xcode variable.", "path_tree", "=", "path_tre...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/xcodeproj_file.py#L1976-L2008
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/linalg/matfuncs.py
python
funm
(A, func, disp=True)
Evaluate a matrix function specified by a callable. Returns the value of matrix-valued function ``f`` at `A`. The function ``f`` is an extension of the scalar-valued function `func` to matrices. Parameters ---------- A : (N, N) array_like Matrix at which to evaluate the function fu...
Evaluate a matrix function specified by a callable.
[ "Evaluate", "a", "matrix", "function", "specified", "by", "a", "callable", "." ]
def funm(A, func, disp=True): """ Evaluate a matrix function specified by a callable. Returns the value of matrix-valued function ``f`` at `A`. The function ``f`` is an extension of the scalar-valued function `func` to matrices. Parameters ---------- A : (N, N) array_like Matri...
[ "def", "funm", "(", "A", ",", "func", ",", "disp", "=", "True", ")", ":", "A", "=", "_asarray_square", "(", "A", ")", "# Perform Shur decomposition (lapack ?gees)", "T", ",", "Z", "=", "schur", "(", "A", ")", "T", ",", "Z", "=", "rsf2csf", "(", "T", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/linalg/matfuncs.py#L559-L660
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/dataview.py
python
DataViewCtrl.EditItem
(*args, **kwargs)
return _dataview.DataViewCtrl_EditItem(*args, **kwargs)
EditItem(self, DataViewItem item, DataViewColumn column)
EditItem(self, DataViewItem item, DataViewColumn column)
[ "EditItem", "(", "self", "DataViewItem", "item", "DataViewColumn", "column", ")" ]
def EditItem(*args, **kwargs): """EditItem(self, DataViewItem item, DataViewColumn column)""" return _dataview.DataViewCtrl_EditItem(*args, **kwargs)
[ "def", "EditItem", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewCtrl_EditItem", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/dataview.py#L1832-L1834
facebook/wangle
2e7e3fbb3a15c4986d6fe0e36c31daeeba614ce3
build/fbcode_builder/getdeps/builder.py
python
CargoBuilder._extract_crates
(cargo_toml_file, dep_to_git)
return deps_to_crates
This functions reads content of provided cargo toml file and extracts crate names per each dependency. The extraction is done by a heuristic so it might be incorrect.
This functions reads content of provided cargo toml file and extracts crate names per each dependency. The extraction is done by a heuristic so it might be incorrect.
[ "This", "functions", "reads", "content", "of", "provided", "cargo", "toml", "file", "and", "extracts", "crate", "names", "per", "each", "dependency", ".", "The", "extraction", "is", "done", "by", "a", "heuristic", "so", "it", "might", "be", "incorrect", "." ...
def _extract_crates(cargo_toml_file, dep_to_git): """ This functions reads content of provided cargo toml file and extracts crate names per each dependency. The extraction is done by a heuristic so it might be incorrect. """ deps_to_crates = {} with open(cargo_tom...
[ "def", "_extract_crates", "(", "cargo_toml_file", ",", "dep_to_git", ")", ":", "deps_to_crates", "=", "{", "}", "with", "open", "(", "cargo_toml_file", ",", "\"r\"", ")", "as", "f", ":", "for", "line", "in", "f", ".", "readlines", "(", ")", ":", "if", ...
https://github.com/facebook/wangle/blob/2e7e3fbb3a15c4986d6fe0e36c31daeeba614ce3/build/fbcode_builder/getdeps/builder.py#L1419-L1440
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/jinja2/environment.py
python
Template.make_module_async
(self, vars=None, shared=False, locals=None)
As template module creation can invoke template code for asynchronous exections this method must be used instead of the normal :meth:`make_module` one. Likewise the module attribute becomes unavailable in async mode.
As template module creation can invoke template code for asynchronous exections this method must be used instead of the normal :meth:`make_module` one. Likewise the module attribute becomes unavailable in async mode.
[ "As", "template", "module", "creation", "can", "invoke", "template", "code", "for", "asynchronous", "exections", "this", "method", "must", "be", "used", "instead", "of", "the", "normal", ":", "meth", ":", "make_module", "one", ".", "Likewise", "the", "module",...
def make_module_async(self, vars=None, shared=False, locals=None): """As template module creation can invoke template code for asynchronous exections this method must be used instead of the normal :meth:`make_module` one. Likewise the module attribute becomes unavailable in async mode. ...
[ "def", "make_module_async", "(", "self", ",", "vars", "=", "None", ",", "shared", "=", "False", ",", "locals", "=", "None", ")", ":", "# see asyncsupport for the actual implementation", "raise", "NotImplementedError", "(", "'This feature is not available for this '", "'...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/jinja2/environment.py#L1075-L1083
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/client/session.py
python
BaseSession.list_devices
(self)
return device_list
Lists available devices in this session. ```python devices = sess.list_devices() for d in devices: print(d.name) ``` Where: Each element in the list has the following properties name: A string with the full name of the device. ex: `/job:worker/replica:0/task:3/device:CP...
Lists available devices in this session.
[ "Lists", "available", "devices", "in", "this", "session", "." ]
def list_devices(self): """Lists available devices in this session. ```python devices = sess.list_devices() for d in devices: print(d.name) ``` Where: Each element in the list has the following properties name: A string with the full name of the device. ex: `/job:wo...
[ "def", "list_devices", "(", "self", ")", ":", "raw_device_list", "=", "tf_session", ".", "TF_SessionListDevices", "(", "self", ".", "_session", ")", "device_list", "=", "[", "]", "size", "=", "tf_session", ".", "TF_DeviceListCount", "(", "raw_device_list", ")", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/client/session.py#L716-L752
OpenXRay/xray-15
1390dfb08ed20997d7e8c95147ea8e8cb71f5e86
cs/sdk/3d_sdk/maya/ver-2008/devkit/plug-ins/scripted/torusField.py
python
TorusField.__ownerPosition
(self, block)
return ownerPosArray
If this field has an owner, get the owner's position array or centroid, then assign it to the ownerPosArray. If it does not have owner, get the field position in the world space, and assign it to the given array, ownerPosArray.
If this field has an owner, get the owner's position array or centroid, then assign it to the ownerPosArray. If it does not have owner, get the field position in the world space, and assign it to the given array, ownerPosArray.
[ "If", "this", "field", "has", "an", "owner", "get", "the", "owner", "s", "position", "array", "or", "centroid", "then", "assign", "it", "to", "the", "ownerPosArray", ".", "If", "it", "does", "not", "have", "owner", "get", "the", "field", "position", "in"...
def __ownerPosition(self, block): """ If this field has an owner, get the owner's position array or centroid, then assign it to the ownerPosArray. If it does not have owner, get the field position in the world space, and assign it to the given array, ownerPosArray. """ ownerPosArray = OpenMaya.MVectorArra...
[ "def", "__ownerPosition", "(", "self", ",", "block", ")", ":", "ownerPosArray", "=", "OpenMaya", ".", "MVectorArray", "(", ")", "if", "self", ".", "__applyPerVertexValue", "(", "block", ")", ":", "ownerPos", "=", "OpenMayaMPx", ".", "cvar", ".", "MPxFieldNod...
https://github.com/OpenXRay/xray-15/blob/1390dfb08ed20997d7e8c95147ea8e8cb71f5e86/cs/sdk/3d_sdk/maya/ver-2008/devkit/plug-ins/scripted/torusField.py#L458-L500
lzhang10/maxent
3560c94b737d4272ed86de529e50d823200e6d8e
example/postagger/postagger.py
python
choose_context
(type = None)
Choose context type, default is for English.
Choose context type, default is for English.
[ "Choose", "context", "type", "default", "is", "for", "English", "." ]
def choose_context(type = None): """Choose context type, default is for English.""" if type: return eval('get_context' + str(type)) else: return get_context_english
[ "def", "choose_context", "(", "type", "=", "None", ")", ":", "if", "type", ":", "return", "eval", "(", "'get_context'", "+", "str", "(", "type", ")", ")", "else", ":", "return", "get_context_english" ]
https://github.com/lzhang10/maxent/blob/3560c94b737d4272ed86de529e50d823200e6d8e/example/postagger/postagger.py#L35-L40
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/aui/framemanager.py
python
AuiManagerEvent.GetDC
(self)
return self.dc
Returns the associated :class:`DC` device context (if any).
Returns the associated :class:`DC` device context (if any).
[ "Returns", "the", "associated", ":", "class", ":", "DC", "device", "context", "(", "if", "any", ")", "." ]
def GetDC(self): """ Returns the associated :class:`DC` device context (if any). """ return self.dc
[ "def", "GetDC", "(", "self", ")", ":", "return", "self", ".", "dc" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/framemanager.py#L418-L421
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/PyChop/ISISFermi.py
python
ISISFermi.getFlux
(self, Ei_in=None, frequency=None)
return flux
Calculates the flux at the sample position in n / cm**2 . uA.s flux = getFlux() flux = getFlux(ei) flux = getFlux(ei, omega) Inputs: ei - incident energy in meV [default: preset energy] omega - chopper frequency in Hz [default: preset frequency] Outpu...
Calculates the flux at the sample position in n / cm**2 . uA.s
[ "Calculates", "the", "flux", "at", "the", "sample", "position", "in", "n", "/", "cm", "**", "2", ".", "uA", ".", "s" ]
def getFlux(self, Ei_in=None, frequency=None): """ Calculates the flux at the sample position in n / cm**2 . uA.s flux = getFlux() flux = getFlux(ei) flux = getFlux(ei, omega) Inputs: ei - incident energy in meV [default: preset energy] omega - ...
[ "def", "getFlux", "(", "self", ",", "Ei_in", "=", "None", ",", "frequency", "=", "None", ")", ":", "Ei", "=", "self", ".", "Ei", "if", "Ei_in", "is", "None", "else", "Ei_in", "if", "Ei", "is", "None", ":", "raise", "ValueError", "(", "'Incident energ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/PyChop/ISISFermi.py#L378-L412
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/locale.py
python
setlocale
(category, locale=None)
return _setlocale(category, locale)
Set the locale for the given category. The locale can be a string, an iterable of two strings (language code and encoding), or None. Iterables are converted to strings using the locale aliasing engine. Locale strings are passed directly to the C lib. category may be given as ...
Set the locale for the given category. The locale can be a string, an iterable of two strings (language code and encoding), or None.
[ "Set", "the", "locale", "for", "the", "given", "category", ".", "The", "locale", "can", "be", "a", "string", "an", "iterable", "of", "two", "strings", "(", "language", "code", "and", "encoding", ")", "or", "None", "." ]
def setlocale(category, locale=None): """ Set the locale for the given category. The locale can be a string, an iterable of two strings (language code and encoding), or None. Iterables are converted to strings using the locale aliasing engine. Locale strings are passed directly t...
[ "def", "setlocale", "(", "category", ",", "locale", "=", "None", ")", ":", "if", "locale", "and", "not", "isinstance", "(", "locale", ",", "_builtin_str", ")", ":", "# convert to string", "locale", "=", "normalize", "(", "_build_localename", "(", "locale", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/locale.py#L595-L610
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/multi.py
python
MultiIndex.__setstate__
(self, state)
Necessary for making this object picklable
Necessary for making this object picklable
[ "Necessary", "for", "making", "this", "object", "picklable" ]
def __setstate__(self, state): """Necessary for making this object picklable""" if isinstance(state, dict): levels = state.get("levels") codes = state.get("codes") sortorder = state.get("sortorder") names = state.get("names") elif isinstance(stat...
[ "def", "__setstate__", "(", "self", ",", "state", ")", ":", "if", "isinstance", "(", "state", ",", "dict", ")", ":", "levels", "=", "state", ".", "get", "(", "\"levels\"", ")", "codes", "=", "state", ".", "get", "(", "\"codes\"", ")", "sortorder", "=...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/multi.py#L1905-L1925
TGAC/KAT
e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216
deps/boost/tools/build/src/build/generators.py
python
Generator.construct_result
(self, consumed, project, name, prop_set)
return result
Constructs the dependency graph that will be returned by this generator. consumed: Already prepared list of consumable targets If generator requires several source files will contain exactly len $(self.source_types_) ta...
Constructs the dependency graph that will be returned by this generator. consumed: Already prepared list of consumable targets If generator requires several source files will contain exactly len $(self.source_types_) ta...
[ "Constructs", "the", "dependency", "graph", "that", "will", "be", "returned", "by", "this", "generator", ".", "consumed", ":", "Already", "prepared", "list", "of", "consumable", "targets", "If", "generator", "requires", "several", "source", "files", "will", "con...
def construct_result (self, consumed, project, name, prop_set): """ Constructs the dependency graph that will be returned by this generator. consumed: Already prepared list of consumable targets If generator requires several source files will c...
[ "def", "construct_result", "(", "self", ",", "consumed", ",", "project", ",", "name", ",", "prop_set", ")", ":", "if", "__debug__", ":", "from", ".", "targets", "import", "ProjectTarget", "assert", "is_iterable_typed", "(", "consumed", ",", "virtual_target", "...
https://github.com/TGAC/KAT/blob/e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216/deps/boost/tools/build/src/build/generators.py#L403-L430
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/html5lib/treebuilders/base.py
python
Node.cloneNode
(self)
Return a shallow copy of the current node i.e. a node with the same name and attributes but with no parent or child nodes
Return a shallow copy of the current node i.e. a node with the same
[ "Return", "a", "shallow", "copy", "of", "the", "current", "node", "i", ".", "e", ".", "a", "node", "with", "the", "same" ]
def cloneNode(self): """Return a shallow copy of the current node i.e. a node with the same name and attributes but with no parent or child nodes """ raise NotImplementedError
[ "def", "cloneNode", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/html5lib/treebuilders/base.py#L219-L227
MegEngine/MegEngine
ce9ad07a27ec909fb8db4dd67943d24ba98fb93a
imperative/python/megengine/dtr/dtr.py
python
disable
()
r"""Stop recording computing path of tensors and performing DTR policy.
r"""Stop recording computing path of tensors and performing DTR policy.
[ "r", "Stop", "recording", "computing", "path", "of", "tensors", "and", "performing", "DTR", "policy", "." ]
def disable(): r"""Stop recording computing path of tensors and performing DTR policy.""" _set_option("enable_dtr_auto_drop", 0) _set_option("enable_drop", 0) _set_option("record_computing_path", 0) _clear_candidates()
[ "def", "disable", "(", ")", ":", "_set_option", "(", "\"enable_dtr_auto_drop\"", ",", "0", ")", "_set_option", "(", "\"enable_drop\"", ",", "0", ")", "_set_option", "(", "\"record_computing_path\"", ",", "0", ")", "_clear_candidates", "(", ")" ]
https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/dtr/dtr.py#L127-L132
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Arch/ArchAxisSystem.py
python
makeAxisSystem
(axes,name="Axis System")
return obj
makeAxisSystem(axes): makes a system from the given list of axes
makeAxisSystem(axes): makes a system from the given list of axes
[ "makeAxisSystem", "(", "axes", ")", ":", "makes", "a", "system", "from", "the", "given", "list", "of", "axes" ]
def makeAxisSystem(axes,name="Axis System"): '''makeAxisSystem(axes): makes a system from the given list of axes''' if not isinstance(axes,list): axes = [axes] obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython","AxisSystem") obj.Label = translate("Arch",name) _AxisSystem(obj) ...
[ "def", "makeAxisSystem", "(", "axes", ",", "name", "=", "\"Axis System\"", ")", ":", "if", "not", "isinstance", "(", "axes", ",", "list", ")", ":", "axes", "=", "[", "axes", "]", "obj", "=", "FreeCAD", ".", "ActiveDocument", ".", "addObject", "(", "\"A...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchAxisSystem.py#L49-L62
H-uru/Plasma
c2140ea046e82e9c199e257a7f2e7edb42602871
Scripts/Python/xAvatarCustomization.py
python
xAvatarCustomization.ISliderToMorph
(self,slider)
return morph
convert slider value (0.0 to 12.0) to morph value (1.0 to 1.0)
convert slider value (0.0 to 12.0) to morph value (1.0 to 1.0)
[ "convert", "slider", "value", "(", "0", ".", "0", "to", "12", ".", "0", ")", "to", "morph", "value", "(", "1", ".", "0", "to", "1", ".", "0", ")" ]
def ISliderToMorph(self,slider): "convert slider value (0.0 to 12.0) to morph value (1.0 to 1.0)" morph = slider / 6.0 # convert to 0 to 2 range morph -= 1.0 # convert to -1 to 1 range morph = -morph # flip the value since it seems to be backwards return morph
[ "def", "ISliderToMorph", "(", "self", ",", "slider", ")", ":", "morph", "=", "slider", "/", "6.0", "# convert to 0 to 2 range", "morph", "-=", "1.0", "# convert to -1 to 1 range", "morph", "=", "-", "morph", "# flip the value since it seems to be backwards", "return", ...
https://github.com/H-uru/Plasma/blob/c2140ea046e82e9c199e257a7f2e7edb42602871/Scripts/Python/xAvatarCustomization.py#L1919-L1924
qgis/QGIS
15a77662d4bb712184f6aa60d0bd663010a76a75
python/plugins/processing/algs/qgis/voronoi.py
python
computeDelaunayTriangulation
(points)
return context.triangles
Takes a list of point objects (which must have x and y fields). Returns a list of 3-tuples: the indices of the points that form a Delaunay triangle.
Takes a list of point objects (which must have x and y fields). Returns a list of 3-tuples: the indices of the points that form a Delaunay triangle.
[ "Takes", "a", "list", "of", "point", "objects", "(", "which", "must", "have", "x", "and", "y", "fields", ")", ".", "Returns", "a", "list", "of", "3", "-", "tuples", ":", "the", "indices", "of", "the", "points", "that", "form", "a", "Delaunay", "trian...
def computeDelaunayTriangulation(points): """ Takes a list of point objects (which must have x and y fields). Returns a list of 3-tuples: the indices of the points that form a Delaunay triangle. """ siteList = SiteList(points) context = Context() context.triangulate = True vorono...
[ "def", "computeDelaunayTriangulation", "(", "points", ")", ":", "siteList", "=", "SiteList", "(", "points", ")", "context", "=", "Context", "(", ")", "context", ".", "triangulate", "=", "True", "voronoi", "(", "siteList", ",", "context", ")", "return", "cont...
https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/processing/algs/qgis/voronoi.py#L836-L845
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/sndhdr.py
python
what
(filename)
return res
Guess the type of a sound file
Guess the type of a sound file
[ "Guess", "the", "type", "of", "a", "sound", "file" ]
def what(filename): """Guess the type of a sound file""" res = whathdr(filename) return res
[ "def", "what", "(", "filename", ")", ":", "res", "=", "whathdr", "(", "filename", ")", "return", "res" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/sndhdr.py#L35-L38
kismetwireless/kismet
a7c0dc270c960fb1f58bd9cec4601c201885fd4e
capture_freaklabs_zigbee/KismetCaptureFreaklabsZigbee/kismetexternal/__init__.py
python
ExternalInterface.kill
(self)
Shutdown the external interface service :return: None
Shutdown the external interface service
[ "Shutdown", "the", "external", "interface", "service" ]
def kill(self): """ Shutdown the external interface service :return: None """ self.bufferlock.acquire() try: self.kill_ioloop = True finally: self.bufferlock.release()
[ "def", "kill", "(", "self", ")", ":", "self", ".", "bufferlock", ".", "acquire", "(", ")", "try", ":", "self", ".", "kill_ioloop", "=", "True", "finally", ":", "self", ".", "bufferlock", ".", "release", "(", ")" ]
https://github.com/kismetwireless/kismet/blob/a7c0dc270c960fb1f58bd9cec4601c201885fd4e/capture_freaklabs_zigbee/KismetCaptureFreaklabsZigbee/kismetexternal/__init__.py#L353-L363
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_aarch64/python2.7/dist-packages/rospkg/manifest.py
python
_get_text
(nodes)
return "".join([n.data for n in nodes if n.nodeType == n.TEXT_NODE])
DOM utility routine for getting contents of text nodes
DOM utility routine for getting contents of text nodes
[ "DOM", "utility", "routine", "for", "getting", "contents", "of", "text", "nodes" ]
def _get_text(nodes): """ DOM utility routine for getting contents of text nodes """ return "".join([n.data for n in nodes if n.nodeType == n.TEXT_NODE])
[ "def", "_get_text", "(", "nodes", ")", ":", "return", "\"\"", ".", "join", "(", "[", "n", ".", "data", "for", "n", "in", "nodes", "if", "n", ".", "nodeType", "==", "n", ".", "TEXT_NODE", "]", ")" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/rospkg/manifest.py#L346-L350
yue/yue
619d62c191b13c51c01be451dc48917c34a5aefc
building/tools/cpplint.py
python
CloseExpression
(clean_lines, linenum, pos)
return (line, clean_lines.NumLines(), -1)
If input points to ( or { or [ or <, finds the position that closes it. If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the linenum/pos that correspond to the closing of the expression. TODO(unknown): cpplint spends a fair bit of time matching parentheses. Ideally we would want to index all...
If input points to ( or { or [ or <, finds the position that closes it.
[ "If", "input", "points", "to", "(", "or", "{", "or", "[", "or", "<", "finds", "the", "position", "that", "closes", "it", "." ]
def CloseExpression(clean_lines, linenum, pos): """If input points to ( or { or [ or <, finds the position that closes it. If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the linenum/pos that correspond to the closing of the expression. TODO(unknown): cpplint spends a fair bit of time match...
[ "def", "CloseExpression", "(", "clean_lines", ",", "linenum", ",", "pos", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "if", "(", "line", "[", "pos", "]", "not", "in", "'({[<'", ")", "or", "Match", "(", "r'<[<=]'", ",", "...
https://github.com/yue/yue/blob/619d62c191b13c51c01be451dc48917c34a5aefc/building/tools/cpplint.py#L1591-L1632
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBTypeCategory.GetTypeNameSpecifierForSyntheticAtIndex
(self, *args)
return _lldb.SBTypeCategory_GetTypeNameSpecifierForSyntheticAtIndex(self, *args)
GetTypeNameSpecifierForSyntheticAtIndex(self, uint32_t arg0) -> SBTypeNameSpecifier
GetTypeNameSpecifierForSyntheticAtIndex(self, uint32_t arg0) -> SBTypeNameSpecifier
[ "GetTypeNameSpecifierForSyntheticAtIndex", "(", "self", "uint32_t", "arg0", ")", "-", ">", "SBTypeNameSpecifier" ]
def GetTypeNameSpecifierForSyntheticAtIndex(self, *args): """GetTypeNameSpecifierForSyntheticAtIndex(self, uint32_t arg0) -> SBTypeNameSpecifier""" return _lldb.SBTypeCategory_GetTypeNameSpecifierForSyntheticAtIndex(self, *args)
[ "def", "GetTypeNameSpecifierForSyntheticAtIndex", "(", "self", ",", "*", "args", ")", ":", "return", "_lldb", ".", "SBTypeCategory_GetTypeNameSpecifierForSyntheticAtIndex", "(", "self", ",", "*", "args", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L10796-L10798
xenia-project/xenia
9b1fdac98665ac091b9660a5d0fbb259ed79e578
third_party/google-styleguide/cpplint/cpplint.py
python
_VerboseLevel
()
return _cpplint_state.verbose_level
Returns the module's verbosity setting.
Returns the module's verbosity setting.
[ "Returns", "the", "module", "s", "verbosity", "setting", "." ]
def _VerboseLevel(): """Returns the module's verbosity setting.""" return _cpplint_state.verbose_level
[ "def", "_VerboseLevel", "(", ")", ":", "return", "_cpplint_state", ".", "verbose_level" ]
https://github.com/xenia-project/xenia/blob/9b1fdac98665ac091b9660a5d0fbb259ed79e578/third_party/google-styleguide/cpplint/cpplint.py#L767-L769
KhronosGroup/SPIRV-LLVM
1eb85593f3fe2c39379b9a9b088d51eda4f42b8b
bindings/python/llvm/object.py
python
Symbol.cache
(self)
Cache all cacheable properties.
Cache all cacheable properties.
[ "Cache", "all", "cacheable", "properties", "." ]
def cache(self): """Cache all cacheable properties.""" getattr(self, 'name') getattr(self, 'address') getattr(self, 'size')
[ "def", "cache", "(", "self", ")", ":", "getattr", "(", "self", ",", "'name'", ")", "getattr", "(", "self", ",", "'address'", ")", "getattr", "(", "self", ",", "'size'", ")" ]
https://github.com/KhronosGroup/SPIRV-LLVM/blob/1eb85593f3fe2c39379b9a9b088d51eda4f42b8b/bindings/python/llvm/object.py#L344-L348
priyankchheda/algorithms
c361aa9071573fa9966d5b02d05e524815abcf2b
sort/quick.py
python
quick
(data, low, high)
QuickSort is a Divide and Conquer algorithm. It picks an element as pivot and partitions the given array around the picked pivot. It uses last element as pivot element :param array: list of elements that needs to be sorted :param low: lower index of sub-array :param high: higher index of sub-array
QuickSort is a Divide and Conquer algorithm. It picks an element as pivot and partitions the given array around the picked pivot. It uses last element as pivot element
[ "QuickSort", "is", "a", "Divide", "and", "Conquer", "algorithm", ".", "It", "picks", "an", "element", "as", "pivot", "and", "partitions", "the", "given", "array", "around", "the", "picked", "pivot", ".", "It", "uses", "last", "element", "as", "pivot", "ele...
def quick(data, low, high): """ QuickSort is a Divide and Conquer algorithm. It picks an element as pivot and partitions the given array around the picked pivot. It uses last element as pivot element :param array: list of elements that needs to be sorted :param low: lower index of sub-array :pa...
[ "def", "quick", "(", "data", ",", "low", ",", "high", ")", ":", "if", "high", "<=", "low", ":", "return", "j", "=", "partition", "(", "data", ",", "low", ",", "high", ")", "quick", "(", "data", ",", "low", ",", "j", "-", "1", ")", "quick", "(...
https://github.com/priyankchheda/algorithms/blob/c361aa9071573fa9966d5b02d05e524815abcf2b/sort/quick.py#L24-L37
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pkg_resources/__init__.py
python
WorkingSet.__contains__
(self, dist)
return self.by_key.get(dist.key) == dist
True if `dist` is the active distribution for its project
True if `dist` is the active distribution for its project
[ "True", "if", "dist", "is", "the", "active", "distribution", "for", "its", "project" ]
def __contains__(self, dist): """True if `dist` is the active distribution for its project""" return self.by_key.get(dist.key) == dist
[ "def", "__contains__", "(", "self", ",", "dist", ")", ":", "return", "self", ".", "by_key", ".", "get", "(", "dist", ".", "key", ")", "==", "dist" ]
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/pkg_resources/__init__.py#L624-L626
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/lib-tk/Tkinter.py
python
Misc.clipboard_clear
(self, **kw)
Clear the data in the Tk clipboard. A widget specified for the optional displayof keyword argument specifies the target display.
Clear the data in the Tk clipboard.
[ "Clear", "the", "data", "in", "the", "Tk", "clipboard", "." ]
def clipboard_clear(self, **kw): """Clear the data in the Tk clipboard. A widget specified for the optional displayof keyword argument specifies the target display.""" if 'displayof' not in kw: kw['displayof'] = self._w self.tk.call(('clipboard', 'clear') + self._options(kw))
[ "def", "clipboard_clear", "(", "self", ",", "*", "*", "kw", ")", ":", "if", "'displayof'", "not", "in", "kw", ":", "kw", "[", "'displayof'", "]", "=", "self", ".", "_w", "self", ".", "tk", ".", "call", "(", "(", "'clipboard'", ",", "'clear'", ")", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L656-L662
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pyparsing.py
python
matchOnlyAtCol
(n)
return verifyCol
Helper method for defining parse actions that require matching at a specific column in the input text.
Helper method for defining parse actions that require matching at
[ "Helper", "method", "for", "defining", "parse", "actions", "that", "require", "matching", "at" ]
def matchOnlyAtCol(n): """Helper method for defining parse actions that require matching at a specific column in the input text. """ def verifyCol(strg, locn, toks): if col(locn, strg) != n: raise ParseException(strg, locn, "matched token not at column %d" % n) return veri...
[ "def", "matchOnlyAtCol", "(", "n", ")", ":", "def", "verifyCol", "(", "strg", ",", "locn", ",", "toks", ")", ":", "if", "col", "(", "locn", ",", "strg", ")", "!=", "n", ":", "raise", "ParseException", "(", "strg", ",", "locn", ",", "\"matched token n...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pyparsing.py#L11421-L11435
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
PaletteChangedEvent.GetChangedWindow
(*args, **kwargs)
return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
GetChangedWindow(self) -> Window
GetChangedWindow(self) -> Window
[ "GetChangedWindow", "(", "self", ")", "-", ">", "Window" ]
def GetChangedWindow(*args, **kwargs): """GetChangedWindow(self) -> Window""" return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
[ "def", "GetChangedWindow", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "PaletteChangedEvent_GetChangedWindow", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L7174-L7176
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_gdi.py
python
Font.SetDefaultEncoding
(*args, **kwargs)
return _gdi_.Font_SetDefaultEncoding(*args, **kwargs)
SetDefaultEncoding(int encoding) Sets the default font encoding.
SetDefaultEncoding(int encoding)
[ "SetDefaultEncoding", "(", "int", "encoding", ")" ]
def SetDefaultEncoding(*args, **kwargs): """ SetDefaultEncoding(int encoding) Sets the default font encoding. """ return _gdi_.Font_SetDefaultEncoding(*args, **kwargs)
[ "def", "SetDefaultEncoding", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "Font_SetDefaultEncoding", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L2607-L2613
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/asyncio/tasks.py
python
_wait
(fs, timeout, return_when, loop)
return done, pending
Internal helper for wait(). The fs argument must be a collection of Futures.
Internal helper for wait().
[ "Internal", "helper", "for", "wait", "()", "." ]
async def _wait(fs, timeout, return_when, loop): """Internal helper for wait(). The fs argument must be a collection of Futures. """ assert fs, 'Set of Futures is empty.' waiter = loop.create_future() timeout_handle = None if timeout is not None: timeout_handle = loop.call_later(tim...
[ "async", "def", "_wait", "(", "fs", ",", "timeout", ",", "return_when", ",", "loop", ")", ":", "assert", "fs", ",", "'Set of Futures is empty.'", "waiter", "=", "loop", ".", "create_future", "(", ")", "timeout_handle", "=", "None", "if", "timeout", "is", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/asyncio/tasks.py#L497-L538
neoml-lib/neoml
a0d370fba05269a1b2258cef126f77bbd2054a3e
NeoML/Python/neoml/Dnn/Pooling.py
python
MaxOverTimePooling.stride_len
(self)
return self._internal.get_stride_len()
Gets the window stride.
Gets the window stride.
[ "Gets", "the", "window", "stride", "." ]
def stride_len(self): """Gets the window stride. """ return self._internal.get_stride_len()
[ "def", "stride_len", "(", "self", ")", ":", "return", "self", ".", "_internal", ".", "get_stride_len", "(", ")" ]
https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Pooling.py#L359-L362
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
TextCtrl.write
(*args, **kwargs)
return _controls_.TextCtrl_write(*args, **kwargs)
write(self, String text)
write(self, String text)
[ "write", "(", "self", "String", "text", ")" ]
def write(*args, **kwargs): """write(self, String text)""" return _controls_.TextCtrl_write(*args, **kwargs)
[ "def", "write", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "TextCtrl_write", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L2051-L2053
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/docs/sharedexample.py
python
SharedExampleDocumenter.document_shared_example
(self, example, prefix, section, operation_model)
Documents a single shared example based on its definition. :param example: The model of the example :param prefix: The prefix to use in the method example. :param section: The section to write to. :param operation_model: The model of the operation used in the example
Documents a single shared example based on its definition.
[ "Documents", "a", "single", "shared", "example", "based", "on", "its", "definition", "." ]
def document_shared_example(self, example, prefix, section, operation_model): """Documents a single shared example based on its definition. :param example: The model of the example :param prefix: The prefix to use in the method example. :param section: ...
[ "def", "document_shared_example", "(", "self", ",", "example", ",", "prefix", ",", "section", ",", "operation_model", ")", ":", "section", ".", "style", ".", "new_paragraph", "(", ")", "section", ".", "write", "(", "example", ".", "get", "(", "'description'"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/docs/sharedexample.py#L21-L38
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_windows.py
python
DirDialog.GetMessage
(*args, **kwargs)
return _windows_.DirDialog_GetMessage(*args, **kwargs)
GetMessage(self) -> String Returns the message that will be displayed on the dialog.
GetMessage(self) -> String
[ "GetMessage", "(", "self", ")", "-", ">", "String" ]
def GetMessage(*args, **kwargs): """ GetMessage(self) -> String Returns the message that will be displayed on the dialog. """ return _windows_.DirDialog_GetMessage(*args, **kwargs)
[ "def", "GetMessage", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "DirDialog_GetMessage", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L3078-L3084
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/functional_ops.py
python
_LoopBodyCaptureWrapper
(func)
return Wrapper
Returns a wrapper for `func` that handles loop-carried captured inputs.
Returns a wrapper for `func` that handles loop-carried captured inputs.
[ "Returns", "a", "wrapper", "for", "func", "that", "handles", "loop", "-", "carried", "captured", "inputs", "." ]
def _LoopBodyCaptureWrapper(func): """Returns a wrapper for `func` that handles loop-carried captured inputs.""" @function.Defun( *func.declared_input_types, func_name="%s_Wrapper" % func.name) def Wrapper(*args): """A wrapper that handles loop-carried captured inputs.""" result = func(*args) e...
[ "def", "_LoopBodyCaptureWrapper", "(", "func", ")", ":", "@", "function", ".", "Defun", "(", "*", "func", ".", "declared_input_types", ",", "func_name", "=", "\"%s_Wrapper\"", "%", "func", ".", "name", ")", "def", "Wrapper", "(", "*", "args", ")", ":", "...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/functional_ops.py#L587-L607
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftobjects/patharray.py
python
PathArray.set_general_properties
(self, obj, properties)
Set general properties only if they don't exist.
Set general properties only if they don't exist.
[ "Set", "general", "properties", "only", "if", "they", "don", "t", "exist", "." ]
def set_general_properties(self, obj, properties): """Set general properties only if they don't exist.""" if "Base" not in properties: _tip = QT_TRANSLATE_NOOP("App::Property","The base object that will be duplicated") obj.addProperty("App::PropertyLinkGlobal", ...
[ "def", "set_general_properties", "(", "self", ",", "obj", ",", "properties", ")", ":", "if", "\"Base\"", "not", "in", "properties", ":", "_tip", "=", "QT_TRANSLATE_NOOP", "(", "\"App::Property\"", ",", "\"The base object that will be duplicated\"", ")", "obj", ".", ...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftobjects/patharray.py#L165-L213
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/analogclock/analogclock.py
python
AnalogClock.SetTickStyle
(self, style, target=ALL)
Set the tick style, according to the options below. ================= ====================================== TICKS_NONE Don't show tick marks. TICKS_SQUARE Use squares as tick marks. TICKS_CIRCLE Use circles as tick marks. TICKS_POLY ...
Set the tick style, according to the options below.
[ "Set", "the", "tick", "style", "according", "to", "the", "options", "below", "." ]
def SetTickStyle(self, style, target=ALL): """ Set the tick style, according to the options below. ================= ====================================== TICKS_NONE Don't show tick marks. TICKS_SQUARE Use squares as tick marks. TICKS_C...
[ "def", "SetTickStyle", "(", "self", ",", "style", ",", "target", "=", "ALL", ")", ":", "self", ".", "Box", ".", "SetTickStyle", "(", "style", ",", "target", ")", "self", ".", "Reset", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/analogclock/analogclock.py#L474-L494
p4lang/PI
38d87e81253feff9fff0660d662c885be78fb719
tools/cpplint.py
python
_SetQuiet
(quiet)
return _cpplint_state.SetQuiet(quiet)
Set the module's quiet status, and return previous setting.
Set the module's quiet status, and return previous setting.
[ "Set", "the", "module", "s", "quiet", "status", "and", "return", "previous", "setting", "." ]
def _SetQuiet(quiet): """Set the module's quiet status, and return previous setting.""" return _cpplint_state.SetQuiet(quiet)
[ "def", "_SetQuiet", "(", "quiet", ")", ":", "return", "_cpplint_state", ".", "SetQuiet", "(", "quiet", ")" ]
https://github.com/p4lang/PI/blob/38d87e81253feff9fff0660d662c885be78fb719/tools/cpplint.py#L1429-L1431
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py
python
_cf_data_from_bytes
(bytestring)
return CoreFoundation.CFDataCreate( CoreFoundation.kCFAllocatorDefault, bytestring, len(bytestring) )
Given a bytestring, create a CFData object from it. This CFData object must be CFReleased by the caller.
Given a bytestring, create a CFData object from it. This CFData object must be CFReleased by the caller.
[ "Given", "a", "bytestring", "create", "a", "CFData", "object", "from", "it", ".", "This", "CFData", "object", "must", "be", "CFReleased", "by", "the", "caller", "." ]
def _cf_data_from_bytes(bytestring): """ Given a bytestring, create a CFData object from it. This CFData object must be CFReleased by the caller. """ return CoreFoundation.CFDataCreate( CoreFoundation.kCFAllocatorDefault, bytestring, len(bytestring) )
[ "def", "_cf_data_from_bytes", "(", "bytestring", ")", ":", "return", "CoreFoundation", ".", "CFDataCreate", "(", "CoreFoundation", ".", "kCFAllocatorDefault", ",", "bytestring", ",", "len", "(", "bytestring", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py#L27-L34
KratosMultiphysics/Kratos
0000833054ed0503424eb28205d6508d9ca6cbbc
applications/ChimeraApplication/python_scripts/chimera_setup_utils.py
python
SetChimeraInternalPartsFlag
(model, chimera_internal_parts)
This function sets the bool variable CHIMERA_INTERNAL_BOUNDARY to true on the specified modelparts so that they are excluded from the extract surface operation later on.
This function sets the bool variable CHIMERA_INTERNAL_BOUNDARY to true on the specified modelparts so that they are excluded from the extract surface operation later on.
[ "This", "function", "sets", "the", "bool", "variable", "CHIMERA_INTERNAL_BOUNDARY", "to", "true", "on", "the", "specified", "modelparts", "so", "that", "they", "are", "excluded", "from", "the", "extract", "surface", "operation", "later", "on", "." ]
def SetChimeraInternalPartsFlag(model, chimera_internal_parts): ''' This function sets the bool variable CHIMERA_INTERNAL_BOUNDARY to true on the specified modelparts so that they are excluded from the extract surface operation later on. ''' for mp_name in chimera_internal_parts: Kra...
[ "def", "SetChimeraInternalPartsFlag", "(", "model", ",", "chimera_internal_parts", ")", ":", "for", "mp_name", "in", "chimera_internal_parts", ":", "KratosMultiphysics", ".", "VariableUtils", "(", ")", ".", "SetNonHistoricalVariable", "(", "KratosChimera", ".", "CHIMERA...
https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/ChimeraApplication/python_scripts/chimera_setup_utils.py#L97-L103
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/SaveYDA.py
python
SaveYDA.PyExec
(self)
Main execution body
Main execution body
[ "Main", "execution", "body" ]
def PyExec(self): """ Main execution body """ # Properties ws = self.getProperty("InputWorkspace").value filename = self.getProperty("Filename").value run = ws.getRun() ax = ws.getAxis(1) nHist = ws.getNumberHistograms() # check sample logs exist...
[ "def", "PyExec", "(", "self", ")", ":", "# Properties", "ws", "=", "self", ".", "getProperty", "(", "\"InputWorkspace\"", ")", ".", "value", "filename", "=", "self", ".", "getProperty", "(", "\"Filename\"", ")", ".", "value", "run", "=", "ws", ".", "getR...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/SaveYDA.py#L74-L247
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
DC.DrawBitmap
(*args, **kwargs)
return _gdi_.DC_DrawBitmap(*args, **kwargs)
DrawBitmap(self, Bitmap bmp, int x, int y, bool useMask=False) Draw a bitmap on the device context at the specified point. If *transparent* is true and the bitmap has a transparency mask, (or alpha channel on the platforms that support it) then the bitmap will be drawn transparently.
DrawBitmap(self, Bitmap bmp, int x, int y, bool useMask=False)
[ "DrawBitmap", "(", "self", "Bitmap", "bmp", "int", "x", "int", "y", "bool", "useMask", "=", "False", ")" ]
def DrawBitmap(*args, **kwargs): """ DrawBitmap(self, Bitmap bmp, int x, int y, bool useMask=False) Draw a bitmap on the device context at the specified point. If *transparent* is true and the bitmap has a transparency mask, (or alpha channel on the platforms that support it) th...
[ "def", "DrawBitmap", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "DC_DrawBitmap", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L3697-L3706
larroy/clearskies_core
3574ddf0edc8555454c7044126e786a6c29444dc
tools/gyp/pylib/gyp/win_tool.py
python
WinTool.ExecRcWrapper
(self, arch, *args)
return popen.returncode
Filter logo banner from invocations of rc.exe. Older versions of RC don't support the /nologo flag.
Filter logo banner from invocations of rc.exe. Older versions of RC don't support the /nologo flag.
[ "Filter", "logo", "banner", "from", "invocations", "of", "rc", ".", "exe", ".", "Older", "versions", "of", "RC", "don", "t", "support", "the", "/", "nologo", "flag", "." ]
def ExecRcWrapper(self, arch, *args): """Filter logo banner from invocations of rc.exe. Older versions of RC don't support the /nologo flag.""" env = self._GetEnv(arch) popen = subprocess.Popen(args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) ...
[ "def", "ExecRcWrapper", "(", "self", ",", "arch", ",", "*", "args", ")", ":", "env", "=", "self", ".", "_GetEnv", "(", "arch", ")", "popen", "=", "subprocess", ".", "Popen", "(", "args", ",", "shell", "=", "True", ",", "env", "=", "env", ",", "st...
https://github.com/larroy/clearskies_core/blob/3574ddf0edc8555454c7044126e786a6c29444dc/tools/gyp/pylib/gyp/win_tool.py#L264-L276
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/ML/Cluster/Clusters.py
python
Cluster.AddChild
(self, child)
Adds a child to our list **Arguments** - child: a Cluster
Adds a child to our list
[ "Adds", "a", "child", "to", "our", "list" ]
def AddChild(self, child): """Adds a child to our list **Arguments** - child: a Cluster """ self.children.append(child) self._GenPoints() self._UpdateLength()
[ "def", "AddChild", "(", "self", ",", "child", ")", ":", "self", ".", "children", ".", "append", "(", "child", ")", "self", ".", "_GenPoints", "(", ")", "self", ".", "_UpdateLength", "(", ")" ]
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/ML/Cluster/Clusters.py#L150-L160