nwo
stringlengths
5
86
sha
stringlengths
40
40
path
stringlengths
4
189
language
stringclasses
1 value
identifier
stringlengths
1
94
parameters
stringlengths
2
4.03k
argument_list
stringclasses
1 value
return_statement
stringlengths
0
11.5k
docstring
stringlengths
1
33.2k
docstring_summary
stringlengths
0
5.15k
docstring_tokens
list
function
stringlengths
34
151k
function_tokens
list
url
stringlengths
90
278
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
Rect2D.GetLeft
(*args, **kwargs)
return _core_.Rect2D_GetLeft(*args, **kwargs)
GetLeft(self) -> Double
GetLeft(self) -> Double
[ "GetLeft", "(", "self", ")", "-", ">", "Double" ]
def GetLeft(*args, **kwargs): """GetLeft(self) -> Double""" return _core_.Rect2D_GetLeft(*args, **kwargs)
[ "def", "GetLeft", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Rect2D_GetLeft", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L1855-L1857
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/third_party/Python/module/pexpect-2.4/examples/sshls.py
python
ssh_command
(user, host, password, command)
return child
This runs a command on the remote host. This could also be done with the pxssh class, but this demonstrates what that class does at a simpler level. This returns a pexpect.spawn object. This handles the case when you try to connect to a new host and ssh asks you if you want to accept the public key fingerprint and cont...
This runs a command on the remote host. This could also be done with the pxssh class, but this demonstrates what that class does at a simpler level. This returns a pexpect.spawn object. This handles the case when you try to connect to a new host and ssh asks you if you want to accept the public key fingerprint and cont...
[ "This", "runs", "a", "command", "on", "the", "remote", "host", ".", "This", "could", "also", "be", "done", "with", "the", "pxssh", "class", "but", "this", "demonstrates", "what", "that", "class", "does", "at", "a", "simpler", "level", ".", "This", "retur...
def ssh_command(user, host, password, command): """This runs a command on the remote host. This could also be done with the pxssh class, but this demonstrates what that class does at a simpler level. This returns a pexpect.spawn object. This handles the case when you try to connect to a new host and ssh asks you if...
[ "def", "ssh_command", "(", "user", ",", "host", ",", "password", ",", "command", ")", ":", "ssh_newkey", "=", "'Are you sure you want to continue connecting'", "child", "=", "pexpect", ".", "spawn", "(", "'ssh -l %s %s %s'", "%", "(", "user", ",", "host", ",", ...
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/third_party/Python/module/pexpect-2.4/examples/sshls.py#L14-L39
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/toolkits/style_transfer/_tf_model_architecture.py
python
define_instance_norm
(tf_input, tf_index, weights, prefix)
return _tf.nn.batch_normalization( tf_input, mean, variance, expanded_beta, expanded_gamma, epsilon )
This function defines the indexed instance norm node the tensorflow nn api. Parameters ---------- tf_input: tensorflow.Tensor The input tensor to the instance norm node. Data format expected to be in `NHWC` tf_index: tensorflow.Tensor The index tensor to the instance norm node....
This function defines the indexed instance norm node the tensorflow nn api.
[ "This", "function", "defines", "the", "indexed", "instance", "norm", "node", "the", "tensorflow", "nn", "api", "." ]
def define_instance_norm(tf_input, tf_index, weights, prefix): """ This function defines the indexed instance norm node the tensorflow nn api. Parameters ---------- tf_input: tensorflow.Tensor The input tensor to the instance norm node. Data format expected to be in `NHWC` tf_i...
[ "def", "define_instance_norm", "(", "tf_input", ",", "tf_index", ",", "weights", ",", "prefix", ")", ":", "epsilon", "=", "1e-5", "gamma", "=", "weights", "[", "prefix", "+", "\"gamma_weight\"", "]", "beta", "=", "weights", "[", "prefix", "+", "\"beta_weight...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/style_transfer/_tf_model_architecture.py#L67-L113
freeorion/freeorion
c266a40eccd3a99a17de8fe57c36ef6ba3771665
default/python/AI/TechsListsAI.py
python
TechGroup.get_techs
(self)
return list(self._tech_queue)
Get the ordered list of techs defining research order. :return: Research order
Get the ordered list of techs defining research order.
[ "Get", "the", "ordered", "list", "of", "techs", "defining", "research", "order", "." ]
def get_techs(self) -> List: """Get the ordered list of techs defining research order. :return: Research order """ self._add_remaining() return list(self._tech_queue)
[ "def", "get_techs", "(", "self", ")", "->", "List", ":", "self", ".", "_add_remaining", "(", ")", "return", "list", "(", "self", ".", "_tech_queue", ")" ]
https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/AI/TechsListsAI.py#L67-L73
bulletphysics/bullet3
f0f2a952e146f016096db6f85cf0c44ed75b0b9a
examples/pybullet/gym/pybullet_utils/transformations.py
python
_import_module
(module_name, warn=True, prefix='_py_', ignore='_')
Try import all public attributes from module into global namespace. Existing attributes with name clashes are renamed with prefix. Attributes starting with underscore are ignored by default. Return True on successful import.
Try import all public attributes from module into global namespace.
[ "Try", "import", "all", "public", "attributes", "from", "module", "into", "global", "namespace", "." ]
def _import_module(module_name, warn=True, prefix='_py_', ignore='_'): """Try import all public attributes from module into global namespace. Existing attributes with name clashes are renamed with prefix. Attributes starting with underscore are ignored by default. Return True on successful import. ...
[ "def", "_import_module", "(", "module_name", ",", "warn", "=", "True", ",", "prefix", "=", "'_py_'", ",", "ignore", "=", "'_'", ")", ":", "try", ":", "module", "=", "__import__", "(", "module_name", ")", "except", "ImportError", ":", "if", "warn", ":", ...
https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_utils/transformations.py#L1681-L1705
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/doc/source/_themes/sphinx_rtd_theme/__init__.py
python
get_html_theme_path
()
return cur_dir
Return list of HTML theme paths.
Return list of HTML theme paths.
[ "Return", "list", "of", "HTML", "theme", "paths", "." ]
def get_html_theme_path(): """Return list of HTML theme paths.""" cur_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) return cur_dir
[ "def", "get_html_theme_path", "(", ")", ":", "cur_dir", "=", "os", ".", "path", ".", "abspath", "(", "os", ".", "path", ".", "dirname", "(", "os", ".", "path", ".", "dirname", "(", "__file__", ")", ")", ")", "return", "cur_dir" ]
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/doc/source/_themes/sphinx_rtd_theme/__init__.py#L14-L17
google/clif
cab24d6a105609a65c95a36a1712ae3c20c7b5df
clif/pybind11/classes.py
python
generate_from
( class_decl: ast_pb2.ClassDecl, superclass_name: str, trampoline_class_names: Set[str], capsule_types: Set[str], registered_types: Set[str] )
Generates a complete py::class_<>. Args: class_decl: Class declaration in proto format. superclass_name: String name of the superclass. trampoline_class_names: A Set of class names whose member functions will be overriden in Python. capsule_types: A set of C++ types that are defined as capsules...
Generates a complete py::class_<>.
[ "Generates", "a", "complete", "py", "::", "class_<", ">", "." ]
def generate_from( class_decl: ast_pb2.ClassDecl, superclass_name: str, trampoline_class_names: Set[str], capsule_types: Set[str], registered_types: Set[str] ) -> Generator[str, None, None]: """Generates a complete py::class_<>. Args: class_decl: Class declaration in proto format. superclass_na...
[ "def", "generate_from", "(", "class_decl", ":", "ast_pb2", ".", "ClassDecl", ",", "superclass_name", ":", "str", ",", "trampoline_class_names", ":", "Set", "[", "str", "]", ",", "capsule_types", ":", "Set", "[", "str", "]", ",", "registered_types", ":", "Set...
https://github.com/google/clif/blob/cab24d6a105609a65c95a36a1712ae3c20c7b5df/clif/pybind11/classes.py#L29-L102
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
tools/idl_parser/idl_parser.py
python
IDLParser.p_OptionalIdentifier
(self, p)
OptionalIdentifier : identifier |
OptionalIdentifier : identifier |
[ "OptionalIdentifier", ":", "identifier", "|" ]
def p_OptionalIdentifier(self, p): """OptionalIdentifier : identifier |""" if len(p) > 1: p[0] = p[1] else: p[0] = '_unnamed_'
[ "def", "p_OptionalIdentifier", "(", "self", ",", "p", ")", ":", "if", "len", "(", "p", ")", ">", "1", ":", "p", "[", "0", "]", "=", "p", "[", "1", "]", "else", ":", "p", "[", "0", "]", "=", "'_unnamed_'" ]
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/tools/idl_parser/idl_parser.py#L566-L572
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
python/mxnet/symbol/symbol.py
python
Symbol.tanh
(self, *args, **kwargs)
return op.tanh(self, *args, **kwargs)
Convenience fluent method for :py:func:`tanh`. The arguments are the same as for :py:func:`tanh`, with this array as data.
Convenience fluent method for :py:func:`tanh`.
[ "Convenience", "fluent", "method", "for", ":", "py", ":", "func", ":", "tanh", "." ]
def tanh(self, *args, **kwargs): """Convenience fluent method for :py:func:`tanh`. The arguments are the same as for :py:func:`tanh`, with this array as data. """ return op.tanh(self, *args, **kwargs)
[ "def", "tanh", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "op", ".", "tanh", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/symbol/symbol.py#L2175-L2181
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
GenericDirCtrl.CollapsePath
(*args, **kwargs)
return _controls_.GenericDirCtrl_CollapsePath(*args, **kwargs)
CollapsePath(self, String path) -> bool
CollapsePath(self, String path) -> bool
[ "CollapsePath", "(", "self", "String", "path", ")", "-", ">", "bool" ]
def CollapsePath(*args, **kwargs): """CollapsePath(self, String path) -> bool""" return _controls_.GenericDirCtrl_CollapsePath(*args, **kwargs)
[ "def", "CollapsePath", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "GenericDirCtrl_CollapsePath", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L5669-L5671
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/distributed/auto_parallel/utils.py
python
append_distributed_attr_suffix
(name)
return name + core.kAutoParallelSuffix()
Append auto parallel suffix for distributed attribute name.
Append auto parallel suffix for distributed attribute name.
[ "Append", "auto", "parallel", "suffix", "for", "distributed", "attribute", "name", "." ]
def append_distributed_attr_suffix(name): """ Append auto parallel suffix for distributed attribute name. """ return name + core.kAutoParallelSuffix()
[ "def", "append_distributed_attr_suffix", "(", "name", ")", ":", "return", "name", "+", "core", ".", "kAutoParallelSuffix", "(", ")" ]
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/auto_parallel/utils.py#L117-L121
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/PolDiffILLReduction.py
python
PolDiffILLReduction._rebin_in_energy
(self, ws)
Rebins data measured in Time-of-flight mode in energy exchange units.
Rebins data measured in Time-of-flight mode in energy exchange units.
[ "Rebins", "data", "measured", "in", "Time", "-", "of", "-", "flight", "mode", "in", "energy", "exchange", "units", "." ]
def _rebin_in_energy(self, ws): """Rebins data measured in Time-of-flight mode in energy exchange units.""" if not self.getProperty('EnergyBinning').isDefault: Rebin(InputWorkspace=ws, OutputWorkspace=ws, Params=self.getProperty('EnergyBinning').value) else: self._set_def...
[ "def", "_rebin_in_energy", "(", "self", ",", "ws", ")", ":", "if", "not", "self", ".", "getProperty", "(", "'EnergyBinning'", ")", ".", "isDefault", ":", "Rebin", "(", "InputWorkspace", "=", "ws", ",", "OutputWorkspace", "=", "ws", ",", "Params", "=", "s...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/PolDiffILLReduction.py#L1428-L1433
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/graph_editor/subgraph.py
python
SubGraphView.__enter__
(self)
return self
Allow Python context to minimize the life time of a subgraph view. A subgraph view is meant to be a lightweight and transient object. A short lifetime will alleviate the "out-of-sync" issue mentioned earlier. For that reason, a SubGraphView instance can be used within a Python context. For example: ...
Allow Python context to minimize the life time of a subgraph view.
[ "Allow", "Python", "context", "to", "minimize", "the", "life", "time", "of", "a", "subgraph", "view", "." ]
def __enter__(self): """Allow Python context to minimize the life time of a subgraph view. A subgraph view is meant to be a lightweight and transient object. A short lifetime will alleviate the "out-of-sync" issue mentioned earlier. For that reason, a SubGraphView instance can be used within a Python c...
[ "def", "__enter__", "(", "self", ")", ":", "return", "self" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/graph_editor/subgraph.py#L533-L548
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/packaging/py2/packaging/specifiers.py
python
BaseSpecifier.prereleases
(self, value)
Sets whether or not pre-releases as a whole are allowed by this specifier.
Sets whether or not pre-releases as a whole are allowed by this specifier.
[ "Sets", "whether", "or", "not", "pre", "-", "releases", "as", "a", "whole", "are", "allowed", "by", "this", "specifier", "." ]
def prereleases(self, value): # type: (bool) -> None """ Sets whether or not pre-releases as a whole are allowed by this specifier. """
[ "def", "prereleases", "(", "self", ",", "value", ")", ":", "# type: (bool) -> None" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/packaging/py2/packaging/specifiers.py#L72-L77
stepcode/stepcode
2a50010e6f6b8bd4843561e48fdb0fd4e8b87f39
src/exp2python/python/SCL/AggregationDataTypes.py
python
BAG.get_value_unique
(self)
Return True if all items are different in the container, UNKNOWN if some items are indeterminate, or False otherwise
Return True if all items are different in the container, UNKNOWN if some items are indeterminate, or False otherwise
[ "Return", "True", "if", "all", "items", "are", "different", "in", "the", "container", "UNKNOWN", "if", "some", "items", "are", "indeterminate", "or", "False", "otherwise" ]
def get_value_unique(self): ''' Return True if all items are different in the container, UNKNOWN if some items are indeterminate, or False otherwise''' if None in self._container: return Unknown if self.get_size()-len(set(self._container))>0: #some items are repeated ...
[ "def", "get_value_unique", "(", "self", ")", ":", "if", "None", "in", "self", ".", "_container", ":", "return", "Unknown", "if", "self", ".", "get_size", "(", ")", "-", "len", "(", "set", "(", "self", ".", "_container", ")", ")", ">", "0", ":", "#s...
https://github.com/stepcode/stepcode/blob/2a50010e6f6b8bd4843561e48fdb0fd4e8b87f39/src/exp2python/python/SCL/AggregationDataTypes.py#L476-L484
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/stc.py
python
StyledTextCtrl.SetWrapVisualFlagsLocation
(*args, **kwargs)
return _stc.StyledTextCtrl_SetWrapVisualFlagsLocation(*args, **kwargs)
SetWrapVisualFlagsLocation(self, int wrapVisualFlagsLocation) Set the location of visual flags for wrapped lines.
SetWrapVisualFlagsLocation(self, int wrapVisualFlagsLocation)
[ "SetWrapVisualFlagsLocation", "(", "self", "int", "wrapVisualFlagsLocation", ")" ]
def SetWrapVisualFlagsLocation(*args, **kwargs): """ SetWrapVisualFlagsLocation(self, int wrapVisualFlagsLocation) Set the location of visual flags for wrapped lines. """ return _stc.StyledTextCtrl_SetWrapVisualFlagsLocation(*args, **kwargs)
[ "def", "SetWrapVisualFlagsLocation", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_SetWrapVisualFlagsLocation", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L4103-L4109
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
lldb/third_party/Python/module/pexpect-4.6/pexpect/screen.py
python
screen.clear_all_tabs
(self)
Clears all tabs.
Clears all tabs.
[ "Clears", "all", "tabs", "." ]
def clear_all_tabs (self): # <ESC>[3g '''Clears all tabs.''' pass
[ "def", "clear_all_tabs", "(", "self", ")", ":", "# <ESC>[3g", "pass" ]
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/lldb/third_party/Python/module/pexpect-4.6/pexpect/screen.py#L422-L425
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
config/configobj.py
python
Section.__init__
(self, parent, depth, main, indict=None, name=None)
* parent is the section above * depth is the depth level of this section * main is the main ConfigObj * indict is a dictionary to initialise the section with
* parent is the section above * depth is the depth level of this section * main is the main ConfigObj * indict is a dictionary to initialise the section with
[ "*", "parent", "is", "the", "section", "above", "*", "depth", "is", "the", "depth", "level", "of", "this", "section", "*", "main", "is", "the", "main", "ConfigObj", "*", "indict", "is", "a", "dictionary", "to", "initialise", "the", "section", "with" ]
def __init__(self, parent, depth, main, indict=None, name=None): """ * parent is the section above * depth is the depth level of this section * main is the main ConfigObj * indict is a dictionary to initialise the section with """ if indict is None: in...
[ "def", "__init__", "(", "self", ",", "parent", ",", "depth", ",", "main", ",", "indict", "=", "None", ",", "name", "=", "None", ")", ":", "if", "indict", "is", "None", ":", "indict", "=", "{", "}", "dict", ".", "__init__", "(", "self", ")", "# us...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/config/configobj.py#L468-L506
google/certificate-transparency
2588562fd306a447958471b6f06c1069619c1641
python/ct/crypto/tools/cert_util.py
python
print_certs
(cert_file)
Print the certificates, or parts thereof, as specified by flags.
Print the certificates, or parts thereof, as specified by flags.
[ "Print", "the", "certificates", "or", "parts", "thereof", "as", "specified", "by", "flags", "." ]
def print_certs(cert_file): """Print the certificates, or parts thereof, as specified by flags.""" # If no format is specified, try PEM first, and automatically fall back # to DER. The advantage is that usage is more convenient; the disadvantage # is that error messages are less helpful because we don't...
[ "def", "print_certs", "(", "cert_file", ")", ":", "# If no format is specified, try PEM first, and automatically fall back", "# to DER. The advantage is that usage is more convenient; the disadvantage", "# is that error messages are less helpful because we don't know the expected", "# file format....
https://github.com/google/certificate-transparency/blob/2588562fd306a447958471b6f06c1069619c1641/python/ct/crypto/tools/cert_util.py#L73-L104
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/stc.py
python
StyledTextCtrl.PageUpRectExtend
(*args, **kwargs)
return _stc.StyledTextCtrl_PageUpRectExtend(*args, **kwargs)
PageUpRectExtend(self) Move caret one page up, extending rectangular selection to new caret position.
PageUpRectExtend(self)
[ "PageUpRectExtend", "(", "self", ")" ]
def PageUpRectExtend(*args, **kwargs): """ PageUpRectExtend(self) Move caret one page up, extending rectangular selection to new caret position. """ return _stc.StyledTextCtrl_PageUpRectExtend(*args, **kwargs)
[ "def", "PageUpRectExtend", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_PageUpRectExtend", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L5425-L5431
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/richtext.py
python
RichTextPrinting.GetHeaderFooterData
(*args, **kwargs)
return _richtext.RichTextPrinting_GetHeaderFooterData(*args, **kwargs)
GetHeaderFooterData(self) -> wxRichTextHeaderFooterData
GetHeaderFooterData(self) -> wxRichTextHeaderFooterData
[ "GetHeaderFooterData", "(", "self", ")", "-", ">", "wxRichTextHeaderFooterData" ]
def GetHeaderFooterData(*args, **kwargs): """GetHeaderFooterData(self) -> wxRichTextHeaderFooterData""" return _richtext.RichTextPrinting_GetHeaderFooterData(*args, **kwargs)
[ "def", "GetHeaderFooterData", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextPrinting_GetHeaderFooterData", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L4508-L4510
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/utils.py
python
which
(executable)
return executable
Return full path of 'executable'.
Return full path of 'executable'.
[ "Return", "full", "path", "of", "executable", "." ]
def which(executable): """Return full path of 'executable'.""" if sys.platform == "win32": paths = os.environ.get("Path", "").split(";") else: paths = os.environ.get("PATH", "").split(":") for path in paths: path = os.path.expandvars(path) path = os.path.expanduser(path)...
[ "def", "which", "(", "executable", ")", ":", "if", "sys", ".", "platform", "==", "\"win32\"", ":", "paths", "=", "os", ".", "environ", ".", "get", "(", "\"Path\"", ",", "\"\"", ")", ".", "split", "(", "\";\"", ")", "else", ":", "paths", "=", "os", ...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/utils.py#L74-L89
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/oauthlib/oauth1/rfc5849/request_validator.py
python
RequestValidator.check_nonce
(self, nonce)
return (set(nonce) <= self.safe_characters and lower <= len(nonce) <= upper)
Checks that the nonce only contains only safe characters and is no shorter than lower and no longer than upper.
Checks that the nonce only contains only safe characters and is no shorter than lower and no longer than upper.
[ "Checks", "that", "the", "nonce", "only", "contains", "only", "safe", "characters", "and", "is", "no", "shorter", "than", "lower", "and", "no", "longer", "than", "upper", "." ]
def check_nonce(self, nonce): """Checks that the nonce only contains only safe characters and is no shorter than lower and no longer than upper. """ lower, upper = self.nonce_length return (set(nonce) <= self.safe_characters and lower <= len(nonce) <= upper)
[ "def", "check_nonce", "(", "self", ",", "nonce", ")", ":", "lower", ",", "upper", "=", "self", ".", "nonce_length", "return", "(", "set", "(", "nonce", ")", "<=", "self", ".", "safe_characters", "and", "lower", "<=", "len", "(", "nonce", ")", "<=", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/oauthlib/oauth1/rfc5849/request_validator.py#L182-L188
bulletphysics/bullet3
f0f2a952e146f016096db6f85cf0c44ed75b0b9a
examples/pybullet/gym/pybullet_envs/agents/tools/loop.py
python
Loop.__init__
(self, logdir, step=None, log=None, report=None, reset=None)
Execute operations in a loop and coordinate logging and checkpoints. The step, log, report, and report arguments will get created if not provided. Reset is used to indicate switching to a new phase, so that the model can start a new computation in case its computation is split over multiple training st...
Execute operations in a loop and coordinate logging and checkpoints.
[ "Execute", "operations", "in", "a", "loop", "and", "coordinate", "logging", "and", "checkpoints", "." ]
def __init__(self, logdir, step=None, log=None, report=None, reset=None): """Execute operations in a loop and coordinate logging and checkpoints. The step, log, report, and report arguments will get created if not provided. Reset is used to indicate switching to a new phase, so that the model can start...
[ "def", "__init__", "(", "self", ",", "logdir", ",", "step", "=", "None", ",", "log", "=", "None", ",", "report", "=", "None", ",", "reset", "=", "None", ")", ":", "self", ".", "_logdir", "=", "logdir", "self", ".", "_step", "=", "(", "tf", ".", ...
https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/agents/tools/loop.py#L43-L63
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/asyncio/events.py
python
AbstractEventLoopPolicy.set_child_watcher
(self, watcher)
Set the watcher for child processes.
Set the watcher for child processes.
[ "Set", "the", "watcher", "for", "child", "processes", "." ]
def set_child_watcher(self, watcher): """Set the watcher for child processes.""" raise NotImplementedError
[ "def", "set_child_watcher", "(", "self", ",", "watcher", ")", ":", "raise", "NotImplementedError" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/asyncio/events.py#L604-L606
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/backends/openmp/__init__.py
python
is_available
()
return torch._C.has_openmp
r"""Returns whether PyTorch is built with OpenMP support.
r"""Returns whether PyTorch is built with OpenMP support.
[ "r", "Returns", "whether", "PyTorch", "is", "built", "with", "OpenMP", "support", "." ]
def is_available(): r"""Returns whether PyTorch is built with OpenMP support.""" return torch._C.has_openmp
[ "def", "is_available", "(", ")", ":", "return", "torch", ".", "_C", ".", "has_openmp" ]
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/backends/openmp/__init__.py#L4-L6
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/gslib/__init__.py
python
_GetFileContents
(filename)
return (fpath, content.strip())
Tries to find the given filename on disk or via pkgutil.get_data. Args: filename: String name of the file. Returns: A tuple containing the absolute path to the requested file and the file's contents. If the file is not actually on disk, the file path will be None.
Tries to find the given filename on disk or via pkgutil.get_data.
[ "Tries", "to", "find", "the", "given", "filename", "on", "disk", "or", "via", "pkgutil", ".", "get_data", "." ]
def _GetFileContents(filename): """Tries to find the given filename on disk or via pkgutil.get_data. Args: filename: String name of the file. Returns: A tuple containing the absolute path to the requested file and the file's contents. If the file is not actually on disk, the file path will be None. ...
[ "def", "_GetFileContents", "(", "filename", ")", ":", "fpath", "=", "os", ".", "path", ".", "join", "(", "PROGRAM_FILES_DIR", ",", "filename", ")", "if", "os", ".", "path", ".", "isfile", "(", "fpath", ")", ":", "with", "open", "(", "fpath", ",", "'r...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/__init__.py#L89-L106
yan99033/CNN-SVO
d5591ea88103f8d1b26e5296129bf3b3196a14f1
rpg_vikit/vikit_py/src/vikit_py/transformations.py
python
translation_matrix
(direction)
return M
Return matrix to translate by direction vector. >>> v = numpy.random.random(3) - 0.5 >>> numpy.allclose(v, translation_matrix(v)[:3, 3]) True
Return matrix to translate by direction vector.
[ "Return", "matrix", "to", "translate", "by", "direction", "vector", "." ]
def translation_matrix(direction): """Return matrix to translate by direction vector. >>> v = numpy.random.random(3) - 0.5 >>> numpy.allclose(v, translation_matrix(v)[:3, 3]) True """ M = numpy.identity(4) M[:3, 3] = direction[:3] return M
[ "def", "translation_matrix", "(", "direction", ")", ":", "M", "=", "numpy", ".", "identity", "(", "4", ")", "M", "[", ":", "3", ",", "3", "]", "=", "direction", "[", ":", "3", "]", "return", "M" ]
https://github.com/yan99033/CNN-SVO/blob/d5591ea88103f8d1b26e5296129bf3b3196a14f1/rpg_vikit/vikit_py/src/vikit_py/transformations.py#L195-L205
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftfunctions/heal.py
python
heal
(objlist=None, delete=True, reparent=True)
heal([objlist],[delete],[reparent]) Recreate Draft objects that are damaged, for example if created from an earlier version. If ran without arguments, all the objects in the document will be healed if they are damaged. Parameters ---------- objlist : list delete : Base.Vector or list...
heal([objlist],[delete],[reparent]) Recreate Draft objects that are damaged, for example if created from an earlier version. If ran without arguments, all the objects in the document will be healed if they are damaged.
[ "heal", "(", "[", "objlist", "]", "[", "delete", "]", "[", "reparent", "]", ")", "Recreate", "Draft", "objects", "that", "are", "damaged", "for", "example", "if", "created", "from", "an", "earlier", "version", ".", "If", "ran", "without", "arguments", "a...
def heal(objlist=None, delete=True, reparent=True): """heal([objlist],[delete],[reparent]) Recreate Draft objects that are damaged, for example if created from an earlier version. If ran without arguments, all the objects in the document will be healed if they are damaged. Parameters ----...
[ "def", "heal", "(", "objlist", "=", "None", ",", "delete", "=", "True", ",", "reparent", "=", "True", ")", ":", "auto", "=", "False", "if", "not", "objlist", ":", "objlist", "=", "App", ".", "ActiveDocument", ".", "Objects", "print", "(", "\"Automatic ...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftfunctions/heal.py#L36-L114
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/auth.py
python
SigV4Auth.string_to_sign
(self, request, canonical_request)
return '\n'.join(sts)
Return the canonical StringToSign as well as a dict containing the original version of all headers that were included in the StringToSign.
Return the canonical StringToSign as well as a dict containing the original version of all headers that were included in the StringToSign.
[ "Return", "the", "canonical", "StringToSign", "as", "well", "as", "a", "dict", "containing", "the", "original", "version", "of", "all", "headers", "that", "were", "included", "in", "the", "StringToSign", "." ]
def string_to_sign(self, request, canonical_request): """ Return the canonical StringToSign as well as a dict containing the original version of all headers that were included in the StringToSign. """ sts = ['AWS4-HMAC-SHA256'] sts.append(request.context['timestam...
[ "def", "string_to_sign", "(", "self", ",", "request", ",", "canonical_request", ")", ":", "sts", "=", "[", "'AWS4-HMAC-SHA256'", "]", "sts", ".", "append", "(", "request", ".", "context", "[", "'timestamp'", "]", ")", "sts", ".", "append", "(", "self", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/auth.py#L334-L344
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
xmlDoc.parameterEntity
(self, name)
return __tmp
Do an entity lookup in the internal and external subsets and
Do an entity lookup in the internal and external subsets and
[ "Do", "an", "entity", "lookup", "in", "the", "internal", "and", "external", "subsets", "and" ]
def parameterEntity(self, name): """Do an entity lookup in the internal and external subsets and """ ret = libxml2mod.xmlGetParameterEntity(self._o, name) if ret is None:raise treeError('xmlGetParameterEntity() failed') __tmp = xmlEntity(_obj=ret) return __tmp
[ "def", "parameterEntity", "(", "self", ",", "name", ")", ":", "ret", "=", "libxml2mod", ".", "xmlGetParameterEntity", "(", "self", ".", "_o", ",", "name", ")", "if", "ret", "is", "None", ":", "raise", "treeError", "(", "'xmlGetParameterEntity() failed'", ")"...
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L4106-L4111
kushview/Element
1cc16380caa2ab79461246ba758b9de1f46db2a5
waflib/Node.py
python
Node.read
(self, flags='r', encoding='latin-1')
return Utils.readf(self.abspath(), flags, encoding)
Reads and returns the contents of the file represented by this node, see :py:func:`waflib.Utils.readf`:: def build(bld): bld.path.find_node('wscript').read() :param flags: Open mode :type flags: string :param encoding: encoding value for Python3 :type encoding: string :rtype: string or bytes :retu...
Reads and returns the contents of the file represented by this node, see :py:func:`waflib.Utils.readf`::
[ "Reads", "and", "returns", "the", "contents", "of", "the", "file", "represented", "by", "this", "node", "see", ":", "py", ":", "func", ":", "waflib", ".", "Utils", ".", "readf", "::" ]
def read(self, flags='r', encoding='latin-1'): """ Reads and returns the contents of the file represented by this node, see :py:func:`waflib.Utils.readf`:: def build(bld): bld.path.find_node('wscript').read() :param flags: Open mode :type flags: string :param encoding: encoding value for Python3 :...
[ "def", "read", "(", "self", ",", "flags", "=", "'r'", ",", "encoding", "=", "'latin-1'", ")", ":", "return", "Utils", ".", "readf", "(", "self", ".", "abspath", "(", ")", ",", "flags", ",", "encoding", ")" ]
https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Node.py#L171-L185
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/multiprocessing/context.py
python
BaseContext.JoinableQueue
(self, maxsize=0)
return JoinableQueue(maxsize, ctx=self.get_context())
Returns a queue object
Returns a queue object
[ "Returns", "a", "queue", "object" ]
def JoinableQueue(self, maxsize=0): '''Returns a queue object''' from .queues import JoinableQueue return JoinableQueue(maxsize, ctx=self.get_context())
[ "def", "JoinableQueue", "(", "self", ",", "maxsize", "=", "0", ")", ":", "from", ".", "queues", "import", "JoinableQueue", "return", "JoinableQueue", "(", "maxsize", ",", "ctx", "=", "self", ".", "get_context", "(", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/multiprocessing/context.py#L104-L107
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pkg_resources/__init__.py
python
get_entry_info
(dist, group, name)
return get_distribution(dist).get_entry_info(group, name)
Return the EntryPoint object for `group`+`name`, or ``None``
Return the EntryPoint object for `group`+`name`, or ``None``
[ "Return", "the", "EntryPoint", "object", "for", "group", "+", "name", "or", "None" ]
def get_entry_info(dist, group, name): """Return the EntryPoint object for `group`+`name`, or ``None``""" return get_distribution(dist).get_entry_info(group, name)
[ "def", "get_entry_info", "(", "dist", ",", "group", ",", "name", ")", ":", "return", "get_distribution", "(", "dist", ")", ".", "get_entry_info", "(", "group", ",", "name", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pkg_resources/__init__.py#L498-L500
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/aui/framemanager.py
python
AuiDockingHintWindow.OnPaint
(self, event)
Handles the ``wx.EVT_PAINT`` event for :class:`AuiDockingHintWindow`. :param `event`: an instance of :class:`PaintEvent` to be processed.
Handles the ``wx.EVT_PAINT`` event for :class:`AuiDockingHintWindow`.
[ "Handles", "the", "wx", ".", "EVT_PAINT", "event", "for", ":", "class", ":", "AuiDockingHintWindow", "." ]
def OnPaint(self, event): """ Handles the ``wx.EVT_PAINT`` event for :class:`AuiDockingHintWindow`. :param `event`: an instance of :class:`PaintEvent` to be processed. """ rect = wx.RectPS(wx.Point(0, 0), self.GetSize()) dc = wx.PaintDC(self) event.Skip() ...
[ "def", "OnPaint", "(", "self", ",", "event", ")", ":", "rect", "=", "wx", ".", "RectPS", "(", "wx", ".", "Point", "(", "0", ",", "0", ")", ",", "self", ".", "GetSize", "(", ")", ")", "dc", "=", "wx", ".", "PaintDC", "(", "self", ")", "event",...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/framemanager.py#L2832-L2847
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Explorer/Web_Browser_Suite.py
python
Web_Browser_Suite_Events.GetWindowInfo
(self, _object, _attributes={}, **_arguments)
GetWindowInfo: Returns a window info record (URL/Title) for the specified window. Required argument: Window Identifier of the window Keyword argument _attributes: AppleEvent attribute dictionary Returns:
GetWindowInfo: Returns a window info record (URL/Title) for the specified window. Required argument: Window Identifier of the window Keyword argument _attributes: AppleEvent attribute dictionary Returns:
[ "GetWindowInfo", ":", "Returns", "a", "window", "info", "record", "(", "URL", "/", "Title", ")", "for", "the", "specified", "window", ".", "Required", "argument", ":", "Window", "Identifier", "of", "the", "window", "Keyword", "argument", "_attributes", ":", ...
def GetWindowInfo(self, _object, _attributes={}, **_arguments): """GetWindowInfo: Returns a window info record (URL/Title) for the specified window. Required argument: Window Identifier of the window Keyword argument _attributes: AppleEvent attribute dictionary Returns: """ ...
[ "def", "GetWindowInfo", "(", "self", ",", "_object", ",", "_attributes", "=", "{", "}", ",", "*", "*", "_arguments", ")", ":", "_code", "=", "'WWW!'", "_subcode", "=", "'WNFO'", "if", "_arguments", ":", "raise", "TypeError", ",", "'No optional args expected'...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Explorer/Web_Browser_Suite.py#L83-L102
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Arch/ArchComponent.py
python
ViewProviderComponent.updateData
(self,obj,prop)
return
Method called when the host object has a property changed. If the object has a Material associated with it, match the view object's ShapeColor and Transparency to match the Material. If the object is now cloned, or is part of a compound, have the view object inherit the DiffuseColor. ...
Method called when the host object has a property changed.
[ "Method", "called", "when", "the", "host", "object", "has", "a", "property", "changed", "." ]
def updateData(self,obj,prop): """Method called when the host object has a property changed. If the object has a Material associated with it, match the view object's ShapeColor and Transparency to match the Material. If the object is now cloned, or is part of a compound, have the view ...
[ "def", "updateData", "(", "self", ",", "obj", ",", "prop", ")", ":", "#print(obj.Name,\" : updating \",prop)", "if", "prop", "==", "\"Material\"", ":", "if", "obj", ".", "Material", "and", "(", "(", "not", "hasattr", "(", "obj", ".", "ViewObject", ",", "\"...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchComponent.py#L1160-L1212
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py
python
CondContext.AddValue
(self, val)
return result
Add `val` to the current context and its outer context recursively.
Add `val` to the current context and its outer context recursively.
[ "Add", "val", "to", "the", "current", "context", "and", "its", "outer", "context", "recursively", "." ]
def AddValue(self, val): """Add `val` to the current context and its outer context recursively.""" if val.name in self._values: # Use the real value if it comes from outer context. This is needed in # particular for nested conds. result = self._external_values.get(val.name) result = val ...
[ "def", "AddValue", "(", "self", ",", "val", ")", ":", "if", "val", ".", "name", "in", "self", ".", "_values", ":", "# Use the real value if it comes from outer context. This is needed in", "# particular for nested conds.", "result", "=", "self", ".", "_external_values",...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py#L1187-L1208
MythTV/mythtv
d282a209cb8be85d036f85a62a8ec971b67d45f4
mythtv/programs/scripts/internetcontent/nv_python_libs/thewb/thewb_api.py
python
Videos.updateTheWB
(self, create=False)
return
Create or update the thewb.xml user preferences file return nothing
Create or update the thewb.xml user preferences file return nothing
[ "Create", "or", "update", "the", "thewb", ".", "xml", "user", "preferences", "file", "return", "nothing" ]
def updateTheWB(self, create=False): ''' Create or update the thewb.xml user preferences file return nothing ''' # Read the default user preferences file url = 'file://%s/nv_python_libs/configs/XML/defaultUserPrefs/thewb.xml' % (baseProcessingDir, ) if not os.path.isfile(...
[ "def", "updateTheWB", "(", "self", ",", "create", "=", "False", ")", ":", "# Read the default user preferences file", "url", "=", "'file://%s/nv_python_libs/configs/XML/defaultUserPrefs/thewb.xml'", "%", "(", "baseProcessingDir", ",", ")", "if", "not", "os", ".", "path"...
https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/internetcontent/nv_python_libs/thewb/thewb_api.py#L277-L360
papyrussolution/OpenPapyrus
bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91
Src/OSF/icu/icu4c/source/python/icutools/databuilder/filtration.py
python
apply_filters
(requests, config, io)
return requests
Runs the filters and returns a new list of requests.
Runs the filters and returns a new list of requests.
[ "Runs", "the", "filters", "and", "returns", "a", "new", "list", "of", "requests", "." ]
def apply_filters(requests, config, io): """Runs the filters and returns a new list of requests.""" requests = _apply_file_filters(requests, config, io) requests = _apply_resource_filters(requests, config, io) return requests
[ "def", "apply_filters", "(", "requests", ",", "config", ",", "io", ")", ":", "requests", "=", "_apply_file_filters", "(", "requests", ",", "config", ",", "io", ")", "requests", "=", "_apply_resource_filters", "(", "requests", ",", "config", ",", "io", ")", ...
https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/icu/icu4c/source/python/icutools/databuilder/filtration.py#L244-L248
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/factorization/python/ops/gmm_ops.py
python
GmmAlgorithm._define_prior_log_prob_operation
(self, shard_id)
Computes the prior probability of all samples. Updates a vector where each item is the prior probabibility of an input example. Args: shard_id: id of current shard_id.
Computes the prior probability of all samples.
[ "Computes", "the", "prior", "probability", "of", "all", "samples", "." ]
def _define_prior_log_prob_operation(self, shard_id): """Computes the prior probability of all samples. Updates a vector where each item is the prior probabibility of an input example. Args: shard_id: id of current shard_id. """ self._prior_probs[shard_id] = tf.log( tf.reduce_sum...
[ "def", "_define_prior_log_prob_operation", "(", "self", ",", "shard_id", ")", ":", "self", ".", "_prior_probs", "[", "shard_id", "]", "=", "tf", ".", "log", "(", "tf", ".", "reduce_sum", "(", "tf", ".", "exp", "(", "self", ".", "_probs", "[", "shard_id",...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L282-L292
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/warnings.py
python
filterwarnings
(action, message="", category=Warning, module="", lineno=0, append=False)
Insert an entry into the list of warnings filters (at the front). 'action' -- one of "error", "ignore", "always", "default", "module", or "once" 'message' -- a regex that the warning message must match 'category' -- a class that the warning must be a subclass of 'module' -- a regex that...
Insert an entry into the list of warnings filters (at the front).
[ "Insert", "an", "entry", "into", "the", "list", "of", "warnings", "filters", "(", "at", "the", "front", ")", "." ]
def filterwarnings(action, message="", category=Warning, module="", lineno=0, append=False): """Insert an entry into the list of warnings filters (at the front). 'action' -- one of "error", "ignore", "always", "default", "module", or "once" 'message' -- a regex that the w...
[ "def", "filterwarnings", "(", "action", ",", "message", "=", "\"\"", ",", "category", "=", "Warning", ",", "module", "=", "\"\"", ",", "lineno", "=", "0", ",", "append", "=", "False", ")", ":", "assert", "action", "in", "(", "\"error\"", ",", "\"ignore...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/warnings.py#L130-L163
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/control_flow_ops.py
python
_case_create_default_action
(predicates, actions)
return default_action, other_predicates, other_actions
Creates default action for a list of actions and their predicates. It uses the input actions to select an arbitrary as default and makes sure that corresponding predicates have valid values. Args: predicates: a list of bool scalar tensors actions: a list of callable objects which return tensors. Retu...
Creates default action for a list of actions and their predicates.
[ "Creates", "default", "action", "for", "a", "list", "of", "actions", "and", "their", "predicates", "." ]
def _case_create_default_action(predicates, actions): """Creates default action for a list of actions and their predicates. It uses the input actions to select an arbitrary as default and makes sure that corresponding predicates have valid values. Args: predicates: a list of bool scalar tensors action...
[ "def", "_case_create_default_action", "(", "predicates", ",", "actions", ")", ":", "k", "=", "len", "(", "predicates", ")", "-", "1", "# could pick any", "predicate", ",", "action", "=", "predicates", "[", "k", "]", ",", "actions", "[", "k", "]", "other_pr...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/control_flow_ops.py#L3038-L3068
dmtcp/dmtcp
48a23686e1ce6784829b783ced9c62a14d620507
util/cpplint.py
python
CheckCheck
(filename, clean_lines, linenum, error)
Checks the use of CHECK and EXPECT macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Checks the use of CHECK and EXPECT macros.
[ "Checks", "the", "use", "of", "CHECK", "and", "EXPECT", "macros", "." ]
def CheckCheck(filename, clean_lines, linenum, error): """Checks the use of CHECK and EXPECT macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. ...
[ "def", "CheckCheck", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "# Decide the set of replacement macros that should be suggested", "lines", "=", "clean_lines", ".", "elided", "(", "check_macro", ",", "start_pos", ")", "=", "FindCheckM...
https://github.com/dmtcp/dmtcp/blob/48a23686e1ce6784829b783ced9c62a14d620507/util/cpplint.py#L4059-L4174
nasa/fprime
595cf3682d8365943d86c1a6fe7c78f0a116acf0
Autocoders/Python/src/fprime_ac/utils/pyparsing.py
python
ParserElement.addParseAction
(self, *fns)
return self
Add parse action to expression's list of parse actions. See setParseAction_.
Add parse action to expression's list of parse actions. See setParseAction_.
[ "Add", "parse", "action", "to", "expression", "s", "list", "of", "parse", "actions", ".", "See", "setParseAction_", "." ]
def addParseAction(self, *fns): """Add parse action to expression's list of parse actions. See setParseAction_.""" self.parseAction += list(map(self.normalizeParseActionArgs, list(fns))) return self
[ "def", "addParseAction", "(", "self", ",", "*", "fns", ")", ":", "self", ".", "parseAction", "+=", "list", "(", "map", "(", "self", ".", "normalizeParseActionArgs", ",", "list", "(", "fns", ")", ")", ")", "return", "self" ]
https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/utils/pyparsing.py#L712-L715
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
python/mxnet/ndarray/ndarray.py
python
NDArray.sqrt
(self, *args, **kwargs)
return op.sqrt(self, *args, **kwargs)
Convenience fluent method for :py:func:`sqrt`. The arguments are the same as for :py:func:`sqrt`, with this array as data.
Convenience fluent method for :py:func:`sqrt`.
[ "Convenience", "fluent", "method", "for", ":", "py", ":", "func", ":", "sqrt", "." ]
def sqrt(self, *args, **kwargs): """Convenience fluent method for :py:func:`sqrt`. The arguments are the same as for :py:func:`sqrt`, with this array as data. """ return op.sqrt(self, *args, **kwargs)
[ "def", "sqrt", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "op", ".", "sqrt", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/ndarray/ndarray.py#L1468-L1474
giuspen/cherrytree
84712f206478fcf9acf30174009ad28c648c6344
pygtk2/modules/core.py
python
CherryTree.find_allmatchesdialog_restore
(self, *args)
Restore AllMatchesDialog
Restore AllMatchesDialog
[ "Restore", "AllMatchesDialog" ]
def find_allmatchesdialog_restore(self, *args): """Restore AllMatchesDialog""" self.find_handler.allmatchesdialog_show()
[ "def", "find_allmatchesdialog_restore", "(", "self", ",", "*", "args", ")", ":", "self", ".", "find_handler", ".", "allmatchesdialog_show", "(", ")" ]
https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/core.py#L3392-L3394
rsummers11/CADLab
976ed959a0b5208bb4173127a7ef732ac73a9b6f
MULAN_universal_lesion_analysis/maskrcnn/modeling/rpn/inference.py
python
RPNPostProcessor.forward
(self, anchors, objectness, box_regression, targets=None)
return boxlists
Arguments: anchors: list[list[BoxList]] objectness: list[tensor] box_regression: list[tensor] Returns: boxlists (list[BoxList]): the post-processed anchors, after applying box decoding and NMS
Arguments: anchors: list[list[BoxList]] objectness: list[tensor] box_regression: list[tensor]
[ "Arguments", ":", "anchors", ":", "list", "[", "list", "[", "BoxList", "]]", "objectness", ":", "list", "[", "tensor", "]", "box_regression", ":", "list", "[", "tensor", "]" ]
def forward(self, anchors, objectness, box_regression, targets=None): """ Arguments: anchors: list[list[BoxList]] objectness: list[tensor] box_regression: list[tensor] Returns: boxlists (list[BoxList]): the post-processed anchors, after ...
[ "def", "forward", "(", "self", ",", "anchors", ",", "objectness", ",", "box_regression", ",", "targets", "=", "None", ")", ":", "sampled_boxes", "=", "[", "]", "num_levels", "=", "len", "(", "objectness", ")", "anchors", "=", "list", "(", "zip", "(", "...
https://github.com/rsummers11/CADLab/blob/976ed959a0b5208bb4173127a7ef732ac73a9b6f/MULAN_universal_lesion_analysis/maskrcnn/modeling/rpn/inference.py#L129-L157
goldeneye-source/ges-code
2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d
thirdparty/protobuf-2.3.0/python/google/protobuf/internal/decoder.py
python
_SkipFixed32
(buffer, pos, end)
return pos
Skip a fixed32 value. Returns the new position.
Skip a fixed32 value. Returns the new position.
[ "Skip", "a", "fixed32", "value", ".", "Returns", "the", "new", "position", "." ]
def _SkipFixed32(buffer, pos, end): """Skip a fixed32 value. Returns the new position.""" pos += 4 if pos > end: raise _DecodeError('Truncated message.') return pos
[ "def", "_SkipFixed32", "(", "buffer", ",", "pos", ",", "end", ")", ":", "pos", "+=", "4", "if", "pos", ">", "end", ":", "raise", "_DecodeError", "(", "'Truncated message.'", ")", "return", "pos" ]
https://github.com/goldeneye-source/ges-code/blob/2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/decoder.py#L595-L601
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPMS_SIG_SCHEME_ECSCHNORR.fromBytes
(buffer)
return TpmBuffer(buffer).createObj(TPMS_SIG_SCHEME_ECSCHNORR)
Returns new TPMS_SIG_SCHEME_ECSCHNORR object constructed from its marshaled representation in the given byte buffer
Returns new TPMS_SIG_SCHEME_ECSCHNORR object constructed from its marshaled representation in the given byte buffer
[ "Returns", "new", "TPMS_SIG_SCHEME_ECSCHNORR", "object", "constructed", "from", "its", "marshaled", "representation", "in", "the", "given", "byte", "buffer" ]
def fromBytes(buffer): """ Returns new TPMS_SIG_SCHEME_ECSCHNORR object constructed from its marshaled representation in the given byte buffer """ return TpmBuffer(buffer).createObj(TPMS_SIG_SCHEME_ECSCHNORR)
[ "def", "fromBytes", "(", "buffer", ")", ":", "return", "TpmBuffer", "(", "buffer", ")", ".", "createObj", "(", "TPMS_SIG_SCHEME_ECSCHNORR", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L6544-L6548
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/ops/math_ops.py
python
_as_indexed_slices
(x)
return ops.IndexedSlices(x, range(0, x_shape[0]), x_shape)
Convert 'x' to IndexedSlices. Convert a dense Tensor to a block-sparse IndexedSlices. Args: x: Either a Tensor object, or an IndexedSlices object. Returns: An IndexedSlices object. Raises: TypeError: If 'x' is not a Tensor or an IndexedSlices object.
Convert 'x' to IndexedSlices.
[ "Convert", "x", "to", "IndexedSlices", "." ]
def _as_indexed_slices(x): """Convert 'x' to IndexedSlices. Convert a dense Tensor to a block-sparse IndexedSlices. Args: x: Either a Tensor object, or an IndexedSlices object. Returns: An IndexedSlices object. Raises: TypeError: If 'x' is not a Tensor or an IndexedSlices object. """ # TOD...
[ "def", "_as_indexed_slices", "(", "x", ")", ":", "# TODO(touts): op_scope", "if", "not", "isinstance", "(", "x", ",", "(", "ops", ".", "Tensor", ",", "ops", ".", "IndexedSlices", ")", ")", ":", "raise", "TypeError", "(", "\"Not a Tensor or IndexedSlices: %s\"", ...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/math_ops.py#L1390-L1410
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/remote.py
python
ApplicationError.__init__
(self, message, error_name=None)
Constructor. Args: message: Application specific error message. error_name: Application specific error name. Must be None, string or unicode string.
Constructor.
[ "Constructor", "." ]
def __init__(self, message, error_name=None): """Constructor. Args: message: Application specific error message. error_name: Application specific error name. Must be None, string or unicode string. """ super(ApplicationError, self).__init__(message) self.error_name = error_name
[ "def", "__init__", "(", "self", ",", "message", ",", "error_name", "=", "None", ")", ":", "super", "(", "ApplicationError", ",", "self", ")", ".", "__init__", "(", "message", ")", "self", ".", "error_name", "=", "error_name" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/remote.py#L254-L263
facebook/folly
744a0a698074d1b013813065fe60f545aa2c9b94
build/fbcode_builder/CMake/make_fbpy_archive.py
python
install_library
(args, path_map)
Create an installation directory a python library.
Create an installation directory a python library.
[ "Create", "an", "installation", "directory", "a", "python", "library", "." ]
def install_library(args, path_map): """Create an installation directory a python library.""" out_dir = args.output out_manifest = args.output + ".manifest" install_dir = args.install_dir if not install_dir: install_dir = out_dir os.makedirs(out_dir) with open(out_manifest, "w") as...
[ "def", "install_library", "(", "args", ",", "path_map", ")", ":", "out_dir", "=", "args", ".", "output", "out_manifest", "=", "args", ".", "output", "+", "\".manifest\"", "install_dir", "=", "args", ".", "install_dir", "if", "not", "install_dir", ":", "insta...
https://github.com/facebook/folly/blob/744a0a698074d1b013813065fe60f545aa2c9b94/build/fbcode_builder/CMake/make_fbpy_archive.py#L190-L208
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/pytables.py
python
HDFStore.close
(self)
Close the PyTables file handle
Close the PyTables file handle
[ "Close", "the", "PyTables", "file", "handle" ]
def close(self): """ Close the PyTables file handle """ if self._handle is not None: self._handle.close() self._handle = None
[ "def", "close", "(", "self", ")", ":", "if", "self", ".", "_handle", "is", "not", "None", ":", "self", ".", "_handle", ".", "close", "(", ")", "self", ".", "_handle", "=", "None" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/pytables.py#L690-L696
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/ipaddress.py
python
_collapse_addresses_internal
(addresses)
Loops through the addresses, collapsing concurrent netblocks. Example: ip1 = IPv4Network('192.0.2.0/26') ip2 = IPv4Network('192.0.2.64/26') ip3 = IPv4Network('192.0.2.128/26') ip4 = IPv4Network('192.0.2.192/26') _collapse_addresses_internal([ip1, ip2, ip3, ip4]) -> ...
Loops through the addresses, collapsing concurrent netblocks.
[ "Loops", "through", "the", "addresses", "collapsing", "concurrent", "netblocks", "." ]
def _collapse_addresses_internal(addresses): """Loops through the addresses, collapsing concurrent netblocks. Example: ip1 = IPv4Network('192.0.2.0/26') ip2 = IPv4Network('192.0.2.64/26') ip3 = IPv4Network('192.0.2.128/26') ip4 = IPv4Network('192.0.2.192/26') _collapse...
[ "def", "_collapse_addresses_internal", "(", "addresses", ")", ":", "# First merge", "to_merge", "=", "list", "(", "addresses", ")", "subnets", "=", "{", "}", "while", "to_merge", ":", "net", "=", "to_merge", ".", "pop", "(", ")", "supernet", "=", "net", "....
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/ipaddress.py#L377-L423
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
deprecated/algorithms/sfm/OpenSfM/opensfm/transformations.py
python
quaternion_matrix
(quaternion)
return numpy.array([ [1.0-q[2, 2]-q[3, 3], q[1, 2]-q[3, 0], q[1, 3]+q[2, 0], 0.0], [ q[1, 2]+q[3, 0], 1.0-q[1, 1]-q[3, 3], q[2, 3]-q[1, 0], 0.0], [ q[1, 3]-q[2, 0], q[2, 3]+q[1, 0], 1.0-q[1, 1]-q[2, 2], 0.0], [ 0.0, 0.0, ...
Return homogeneous rotation matrix from quaternion. >>> M = quaternion_matrix([0.99810947, 0.06146124, 0, 0]) >>> numpy.allclose(M, rotation_matrix(0.123, [1, 0, 0])) True >>> M = quaternion_matrix([1, 0, 0, 0]) >>> numpy.allclose(M, numpy.identity(4)) True >>> M = quaternion_matrix([0, 1, ...
Return homogeneous rotation matrix from quaternion.
[ "Return", "homogeneous", "rotation", "matrix", "from", "quaternion", "." ]
def quaternion_matrix(quaternion): """Return homogeneous rotation matrix from quaternion. >>> M = quaternion_matrix([0.99810947, 0.06146124, 0, 0]) >>> numpy.allclose(M, rotation_matrix(0.123, [1, 0, 0])) True >>> M = quaternion_matrix([1, 0, 0, 0]) >>> numpy.allclose(M, numpy.identity(4)) ...
[ "def", "quaternion_matrix", "(", "quaternion", ")", ":", "q", "=", "numpy", ".", "array", "(", "quaternion", ",", "dtype", "=", "numpy", ".", "float64", ",", "copy", "=", "True", ")", "n", "=", "numpy", ".", "dot", "(", "q", ",", "q", ")", "if", ...
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/deprecated/algorithms/sfm/OpenSfM/opensfm/transformations.py#L1249-L1273
Slicer/Slicer
ba9fadf332cb0303515b68d8d06a344c82e3e3e5
Base/Python/slicer/cli.py
python
run
(module, node = None, parameters = None, wait_for_completion = False, delete_temporary_files = True, update_display=True)
return node
Runs a CLI, optionally given a node with optional parameters, returning back the node (or the new one if created) node: existing parameter node (None by default) parameters: dictionary of parameters for cli (None by default) wait_for_completion: block if True (False by default) delete_temporary_files: remove ...
Runs a CLI, optionally given a node with optional parameters, returning back the node (or the new one if created) node: existing parameter node (None by default) parameters: dictionary of parameters for cli (None by default) wait_for_completion: block if True (False by default) delete_temporary_files: remove ...
[ "Runs", "a", "CLI", "optionally", "given", "a", "node", "with", "optional", "parameters", "returning", "back", "the", "node", "(", "or", "the", "new", "one", "if", "created", ")", "node", ":", "existing", "parameter", "node", "(", "None", "by", "default", ...
def run(module, node = None, parameters = None, wait_for_completion = False, delete_temporary_files = True, update_display=True): """Runs a CLI, optionally given a node with optional parameters, returning back the node (or the new one if created) node: existing parameter node (None by default) parameters: dicti...
[ "def", "run", "(", "module", ",", "node", "=", "None", ",", "parameters", "=", "None", ",", "wait_for_completion", "=", "False", ",", "delete_temporary_files", "=", "True", ",", "update_display", "=", "True", ")", ":", "import", "slicer", ".", "util", "if"...
https://github.com/Slicer/Slicer/blob/ba9fadf332cb0303515b68d8d06a344c82e3e3e5/Base/Python/slicer/cli.py#L58-L89
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/tpu/tensor_tracer.py
python
TensorTracer.control_flow_op
(op)
return (control_flow_util.IsSwitch(op) or control_flow_util.IsMerge(op))
Returns true if op is one of the special ops of in a while loop. Args: op: A tf.Operation. Returns: True if the given op is one of [Switch, Merge, Enter, Exit, NextIteration, LoopCond], which are all building blocks for TF while loops.
Returns true if op is one of the special ops of in a while loop.
[ "Returns", "true", "if", "op", "is", "one", "of", "the", "special", "ops", "of", "in", "a", "while", "loop", "." ]
def control_flow_op(op): """Returns true if op is one of the special ops of in a while loop. Args: op: A tf.Operation. Returns: True if the given op is one of [Switch, Merge, Enter, Exit, NextIteration, LoopCond], which are all building blocks for TF while loops. """ re...
[ "def", "control_flow_op", "(", "op", ")", ":", "return", "(", "control_flow_util", ".", "IsSwitch", "(", "op", ")", "or", "control_flow_util", ".", "IsMerge", "(", "op", ")", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/tpu/tensor_tracer.py#L490-L502
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/lambda-code/ServiceLambda/resource_types/Custom_ServiceApi.py
python
update_api_case_path_mappings
(rest_api_id, region, custom_domain_name)
return old_domain_name
Updates BasePathMapping resources. Remove the existing ones and add new mapping resources.
Updates BasePathMapping resources. Remove the existing ones and add new mapping resources.
[ "Updates", "BasePathMapping", "resources", ".", "Remove", "the", "existing", "ones", "and", "add", "new", "mapping", "resources", "." ]
def update_api_case_path_mappings(rest_api_id, region, custom_domain_name): """ Updates BasePathMapping resources. Remove the existing ones and add new mapping resources. """ response = api_gateway.get_domain_names() existing_domain_names = [item.get('domainName', '') for item in response.get('items', [])] ...
[ "def", "update_api_case_path_mappings", "(", "rest_api_id", ",", "region", ",", "custom_domain_name", ")", ":", "response", "=", "api_gateway", ".", "get_domain_names", "(", ")", "existing_domain_names", "=", "[", "item", ".", "get", "(", "'domainName'", ",", "''"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/lambda-code/ServiceLambda/resource_types/Custom_ServiceApi.py#L301-L320
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py2/prompt_toolkit/contrib/regular_languages/completion.py
python
GrammarCompleter._get_completions_for_match
(self, match, complete_event)
Yield all the possible completions for this input string. (The completer assumes that the cursor position was at the end of the input string.)
Yield all the possible completions for this input string. (The completer assumes that the cursor position was at the end of the input string.)
[ "Yield", "all", "the", "possible", "completions", "for", "this", "input", "string", ".", "(", "The", "completer", "assumes", "that", "the", "cursor", "position", "was", "at", "the", "end", "of", "the", "input", "string", ".", ")" ]
def _get_completions_for_match(self, match, complete_event): """ Yield all the possible completions for this input string. (The completer assumes that the cursor position was at the end of the input string.) """ for match_variable in match.end_nodes(): varname...
[ "def", "_get_completions_for_match", "(", "self", ",", "match", ",", "complete_event", ")", ":", "for", "match_variable", "in", "match", ".", "end_nodes", "(", ")", ":", "varname", "=", "match_variable", ".", "varname", "start", "=", "match_variable", ".", "st...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/contrib/regular_languages/completion.py#L42-L72
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/mapreduce/mapreduce/api/map_job/model_datastore_input_reader.py
python
ModelDatastoreInputReader._validate_filters_ndb
(cls, filters, model_class)
Validate ndb.Model filters.
Validate ndb.Model filters.
[ "Validate", "ndb", ".", "Model", "filters", "." ]
def _validate_filters_ndb(cls, filters, model_class): """Validate ndb.Model filters.""" if not filters: return properties = model_class._properties for f in filters: prop, _, val = f if prop not in properties: raise errors.BadReaderParamsError( "Property %s is not...
[ "def", "_validate_filters_ndb", "(", "cls", ",", "filters", ",", "model_class", ")", ":", "if", "not", "filters", ":", "return", "properties", "=", "model_class", ".", "_properties", "for", "f", "in", "filters", ":", "prop", ",", "_", ",", "val", "=", "f...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mapreduce/mapreduce/api/map_job/model_datastore_input_reader.py#L141-L160
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/distributions/dirichlet_multinomial.py
python
DirichletMultinomial._variance_scale_term
(self)
return math_ops.sqrt((1. + c0 / self.total_count) / (1. + c0))
Helper to `_covariance` and `_variance` which computes a shared scale.
Helper to `_covariance` and `_variance` which computes a shared scale.
[ "Helper", "to", "_covariance", "and", "_variance", "which", "computes", "a", "shared", "scale", "." ]
def _variance_scale_term(self): """Helper to `_covariance` and `_variance` which computes a shared scale.""" # We must take care to expand back the last dim whenever we use the # total_concentration. c0 = self.total_concentration[..., array_ops.newaxis] return math_ops.sqrt((1. + c0 / self.total_cou...
[ "def", "_variance_scale_term", "(", "self", ")", ":", "# We must take care to expand back the last dim whenever we use the", "# total_concentration.", "c0", "=", "self", ".", "total_concentration", "[", "...", ",", "array_ops", ".", "newaxis", "]", "return", "math_ops", "...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/distributions/dirichlet_multinomial.py#L315-L320
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_gdi.py
python
FontMapper.Set
(*args, **kwargs)
return _gdi_.FontMapper_Set(*args, **kwargs)
Set(FontMapper mapper) -> FontMapper
Set(FontMapper mapper) -> FontMapper
[ "Set", "(", "FontMapper", "mapper", ")", "-", ">", "FontMapper" ]
def Set(*args, **kwargs): """Set(FontMapper mapper) -> FontMapper""" return _gdi_.FontMapper_Set(*args, **kwargs)
[ "def", "Set", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "FontMapper_Set", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L2112-L2114
deeplearningais/CUV
4e920ad1304af9de3e5f755cc2e9c5c96e06c324
examples/rbm/datasets.py
python
DataSet.ensure_cm
(self)
makes sure that everything is in column-major format
makes sure that everything is in column-major format
[ "makes", "sure", "that", "everything", "is", "in", "column", "-", "major", "format" ]
def ensure_cm(self): """ makes sure that everything is in column-major format """ map( self._ensure_cm, ["data", "test_data", "teacher", "test_teacher"])
[ "def", "ensure_cm", "(", "self", ")", ":", "map", "(", "self", ".", "_ensure_cm", ",", "[", "\"data\"", ",", "\"test_data\"", ",", "\"teacher\"", ",", "\"test_teacher\"", "]", ")" ]
https://github.com/deeplearningais/CUV/blob/4e920ad1304af9de3e5f755cc2e9c5c96e06c324/examples/rbm/datasets.py#L27-L29
apache/madlib
be297fe6beada0640f93317e8948834032718e32
src/madpack/upgrade_util.py
python
TableDependency.get_depended_udt
(self)
return res
@brief Get the list of depended UDTs
[]
def get_depended_udt(self): """ @brief Get the list of depended UDTs """ res = defaultdict(bool) for table in self._table2type: for (col, typ) in self._table2type[table]: if typ not in res: res[typ] = True return res
[ "def", "get_depended_udt", "(", "self", ")", ":", "res", "=", "defaultdict", "(", "bool", ")", "for", "table", "in", "self", ".", "_table2type", ":", "for", "(", "col", ",", "typ", ")", "in", "self", ".", "_table2type", "[", "table", "]", ":", "if", ...
https://github.com/apache/madlib/blob/be297fe6beada0640f93317e8948834032718e32/src/madpack/upgrade_util.py#L922-L931
albertz/openlierox
d316c14a8eb57848ef56e9bfa7b23a56f694a51b
tools/DedicatedServerVideo/gdata/tlslite/TLSRecordLayer.py
python
TLSRecordLayer.getCipherName
(self)
return self._writeState.encContext.name
Get the name of the cipher used with this connection. @rtype: str @return: The name of the cipher used with this connection. Either 'aes128', 'aes256', 'rc4', or '3des'.
Get the name of the cipher used with this connection.
[ "Get", "the", "name", "of", "the", "cipher", "used", "with", "this", "connection", "." ]
def getCipherName(self): """Get the name of the cipher used with this connection. @rtype: str @return: The name of the cipher used with this connection. Either 'aes128', 'aes256', 'rc4', or '3des'. """ if not self._writeState.encContext: return None r...
[ "def", "getCipherName", "(", "self", ")", ":", "if", "not", "self", ".", "_writeState", ".", "encContext", ":", "return", "None", "return", "self", ".", "_writeState", ".", "encContext", ".", "name" ]
https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/tlslite/TLSRecordLayer.py#L343-L352
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/io/html.py
python
_HtmlFrameParser._text_getter
(self, obj)
Return the text of an individual DOM node. Parameters ---------- obj : node-like A DOM node. Returns ------- text : str or unicode The text from an individual DOM node.
Return the text of an individual DOM node.
[ "Return", "the", "text", "of", "an", "individual", "DOM", "node", "." ]
def _text_getter(self, obj): """ Return the text of an individual DOM node. Parameters ---------- obj : node-like A DOM node. Returns ------- text : str or unicode The text from an individual DOM node. """ raise Ab...
[ "def", "_text_getter", "(", "self", ",", "obj", ")", ":", "raise", "AbstractMethodError", "(", "self", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/html.py#L245-L259
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/botocore/docs/waiter.py
python
document_wait_method
(section, waiter_name, event_emitter, service_model, service_waiter_model, include_signature=True)
Documents a the wait method of a waiter :param section: The section to write to :param waiter_name: The name of the waiter :param event_emitter: The event emitter to use to emit events :param service_model: The service model :param service_waiter_model: The waiter model associated to the servic...
Documents a the wait method of a waiter
[ "Documents", "a", "the", "wait", "method", "of", "a", "waiter" ]
def document_wait_method(section, waiter_name, event_emitter, service_model, service_waiter_model, include_signature=True): """Documents a the wait method of a waiter :param section: The section to write to :param waiter_name: The name of the waiter :...
[ "def", "document_wait_method", "(", "section", ",", "waiter_name", ",", "event_emitter", ",", "service_model", ",", "service_waiter_model", ",", "include_signature", "=", "True", ")", ":", "waiter_model", "=", "service_waiter_model", ".", "get_waiter", "(", "waiter_na...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/docs/waiter.py#L65-L127
sphawes/index
bf0991af04f53ba16757dedd199a4e79077ae2f0
doc/scripts/create-tag.py
python
git_tag_list
(ignore_tags: Optional[List[str]] = list())
return list(set(tags) - set(ignore_tags))
Queries git for a list of tags which are then filtered according to the ignore_tags parameter. a list of git tar :param ignore_tags: an optional list of tags to filter from the returned list. :return: a list of tags in the current repository
Queries git for a list of tags which are then filtered according to the ignore_tags parameter. a list of git tar :param ignore_tags: an optional list of tags to filter from the returned list. :return: a list of tags in the current repository
[ "Queries", "git", "for", "a", "list", "of", "tags", "which", "are", "then", "filtered", "according", "to", "the", "ignore_tags", "parameter", ".", "a", "list", "of", "git", "tar", ":", "param", "ignore_tags", ":", "an", "optional", "list", "of", "tags", ...
def git_tag_list(ignore_tags: Optional[List[str]] = list()) -> List[str]: """ Queries git for a list of tags which are then filtered according to the ignore_tags parameter. a list of git tar :param ignore_tags: an optional list of tags to filter from the returned list. :return: a list of tags in th...
[ "def", "git_tag_list", "(", "ignore_tags", ":", "Optional", "[", "List", "[", "str", "]", "]", "=", "list", "(", ")", ")", "->", "List", "[", "str", "]", ":", "# Use the subprocess module to fetch the return from git tag", "p", "=", "subprocess", ".", "Popen",...
https://github.com/sphawes/index/blob/bf0991af04f53ba16757dedd199a4e79077ae2f0/doc/scripts/create-tag.py#L9-L20
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/elasticache/layer1.py
python
ElastiCacheConnection.create_cache_parameter_group
(self, cache_parameter_group_name, cache_parameter_group_family, description)
return self._make_request( action='CreateCacheParameterGroup', verb='POST', path='/', params=params)
The CreateCacheParameterGroup operation creates a new cache parameter group. A cache parameter group is a collection of parameters that you apply to all of the nodes in a cache cluster. :type cache_parameter_group_name: string :param cache_parameter_group_name: A user-specified ...
The CreateCacheParameterGroup operation creates a new cache parameter group. A cache parameter group is a collection of parameters that you apply to all of the nodes in a cache cluster.
[ "The", "CreateCacheParameterGroup", "operation", "creates", "a", "new", "cache", "parameter", "group", ".", "A", "cache", "parameter", "group", "is", "a", "collection", "of", "parameters", "that", "you", "apply", "to", "all", "of", "the", "nodes", "in", "a", ...
def create_cache_parameter_group(self, cache_parameter_group_name, cache_parameter_group_family, description): """ The CreateCacheParameterGroup operation creates a new cache parameter group. A cache parameter group is a c...
[ "def", "create_cache_parameter_group", "(", "self", ",", "cache_parameter_group_name", ",", "cache_parameter_group_family", ",", "description", ")", ":", "params", "=", "{", "'CacheParameterGroupName'", ":", "cache_parameter_group_name", ",", "'CacheParameterGroupFamily'", ":...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/elasticache/layer1.py#L289-L320
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_windows.py
python
PopupTransientWindow.Popup
(*args, **kwargs)
return _windows_.PopupTransientWindow_Popup(*args, **kwargs)
Popup(self, Window focus=None)
Popup(self, Window focus=None)
[ "Popup", "(", "self", "Window", "focus", "=", "None", ")" ]
def Popup(*args, **kwargs): """Popup(self, Window focus=None)""" return _windows_.PopupTransientWindow_Popup(*args, **kwargs)
[ "def", "Popup", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "PopupTransientWindow_Popup", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L2148-L2150
WeitaoVan/L-GM-loss
598582f0631bac876b3eeb8d6c4cd1d780269e03
scripts/cpp_lint.py
python
CheckBraces
(filename, clean_lines, linenum, error)
Looks for misplaced braces (e.g. at the end of line). Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Looks for misplaced braces (e.g. at the end of line).
[ "Looks", "for", "misplaced", "braces", "(", "e", ".", "g", ".", "at", "the", "end", "of", "line", ")", "." ]
def CheckBraces(filename, clean_lines, linenum, error): """Looks for misplaced braces (e.g. at the end of line). Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any er...
[ "def", "CheckBraces", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# get rid of comments and strings", "if", "Match", "(", "r'\\s*{\\s*$'", ",", "line", ")", ":", ...
https://github.com/WeitaoVan/L-GM-loss/blob/598582f0631bac876b3eeb8d6c4cd1d780269e03/scripts/cpp_lint.py#L3069-L3240
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Node/__init__.py
python
Node.children_are_up_to_date
(self)
return (state == 0 or state == SCons.Node.up_to_date)
Alternate check for whether the Node is current: If all of our children were up-to-date, then this Node was up-to-date, too. The SCons.Node.Alias and SCons.Node.Python.Value subclasses rebind their current() method to this method.
Alternate check for whether the Node is current: If all of our children were up-to-date, then this Node was up-to-date, too.
[ "Alternate", "check", "for", "whether", "the", "Node", "is", "current", ":", "If", "all", "of", "our", "children", "were", "up", "-", "to", "-", "date", "then", "this", "Node", "was", "up", "-", "to", "-", "date", "too", "." ]
def children_are_up_to_date(self): """Alternate check for whether the Node is current: If all of our children were up-to-date, then this Node was up-to-date, too. The SCons.Node.Alias and SCons.Node.Python.Value subclasses rebind their current() method to this method.""" # Allo...
[ "def", "children_are_up_to_date", "(", "self", ")", ":", "# Allow the children to calculate their signatures.", "self", ".", "binfo", "=", "self", ".", "get_binfo", "(", ")", "if", "self", ".", "always_build", ":", "return", "None", "state", "=", "0", "for", "ki...
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Node/__init__.py#L1516-L1531
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/html.py
python
HtmlRenderingInfo.GetState
(*args, **kwargs)
return _html.HtmlRenderingInfo_GetState(*args, **kwargs)
GetState(self) -> HtmlRenderingState
GetState(self) -> HtmlRenderingState
[ "GetState", "(", "self", ")", "-", ">", "HtmlRenderingState" ]
def GetState(*args, **kwargs): """GetState(self) -> HtmlRenderingState""" return _html.HtmlRenderingInfo_GetState(*args, **kwargs)
[ "def", "GetState", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html", ".", "HtmlRenderingInfo_GetState", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/html.py#L587-L589
crankyoldgit/IRremoteESP8266
6bc095af80e5aec47d66f8c6263f3a943ea3b4d5
tools/auto_analyse_raw_data.py
python
RawIRMessage.is_space_encoded
(self)
return len(self.spaces) > len(self.marks)
Make an educated guess if the message is space encoded.
Make an educated guess if the message is space encoded.
[ "Make", "an", "educated", "guess", "if", "the", "message", "is", "space", "encoded", "." ]
def is_space_encoded(self): """Make an educated guess if the message is space encoded.""" return len(self.spaces) > len(self.marks)
[ "def", "is_space_encoded", "(", "self", ")", ":", "return", "len", "(", "self", ".", "spaces", ")", ">", "len", "(", "self", ".", "marks", ")" ]
https://github.com/crankyoldgit/IRremoteESP8266/blob/6bc095af80e5aec47d66f8c6263f3a943ea3b4d5/tools/auto_analyse_raw_data.py#L245-L247
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftfunctions/svgshapes.py
python
_get_path_bspline
(plane, edge, edata)
return edata
Convert the edge to a BSpline and discretize it.
Convert the edge to a BSpline and discretize it.
[ "Convert", "the", "edge", "to", "a", "BSpline", "and", "discretize", "it", "." ]
def _get_path_bspline(plane, edge, edata): """Convert the edge to a BSpline and discretize it.""" bspline = edge.Curve.toBSpline(edge.FirstParameter, edge.LastParameter) if bspline.Degree > 3 or bspline.isRational(): try: bspline = bspline.approximateBSpline(0.05, 50, 3, 'C0') ex...
[ "def", "_get_path_bspline", "(", "plane", ",", "edge", ",", "edata", ")", ":", "bspline", "=", "edge", ".", "Curve", ".", "toBSpline", "(", "edge", ".", "FirstParameter", ",", "edge", ".", "LastParameter", ")", "if", "bspline", ".", "Degree", ">", "3", ...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftfunctions/svgshapes.py#L237-L270
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/waflib/Utils.py
python
to_list
(sth)
Convert a string argument to a list by splitting on spaces, and pass through a list argument unchanged:: from waflib.Utils import to_list lst = to_list("a b c d") :param sth: List or a string of items separated by spaces :rtype: list :return: Argument converted to list
Convert a string argument to a list by splitting on spaces, and pass through a list argument unchanged::
[ "Convert", "a", "string", "argument", "to", "a", "list", "by", "splitting", "on", "spaces", "and", "pass", "through", "a", "list", "argument", "unchanged", "::" ]
def to_list(sth): """ Convert a string argument to a list by splitting on spaces, and pass through a list argument unchanged:: from waflib.Utils import to_list lst = to_list("a b c d") :param sth: List or a string of items separated by spaces :rtype: list :return: Argument converted to list """ if isinst...
[ "def", "to_list", "(", "sth", ")", ":", "if", "isinstance", "(", "sth", ",", "str", ")", ":", "return", "sth", ".", "split", "(", ")", "else", ":", "return", "sth" ]
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Utils.py#L384-L400
alexozer/jankdrone
c4b403eb254b41b832ab2bdfade12ba59c99e5dc
handheld/lib/nanopb/generator/nanopb_generator.py
python
make_identifier
(headername)
return result
Make #ifndef identifier that contains uppercase A-Z and digits 0-9
Make #ifndef identifier that contains uppercase A-Z and digits 0-9
[ "Make", "#ifndef", "identifier", "that", "contains", "uppercase", "A", "-", "Z", "and", "digits", "0", "-", "9" ]
def make_identifier(headername): '''Make #ifndef identifier that contains uppercase A-Z and digits 0-9''' result = "" for c in headername.upper(): if c.isalnum(): result += c else: result += '_' return result
[ "def", "make_identifier", "(", "headername", ")", ":", "result", "=", "\"\"", "for", "c", "in", "headername", ".", "upper", "(", ")", ":", "if", "c", ".", "isalnum", "(", ")", ":", "result", "+=", "c", "else", ":", "result", "+=", "'_'", "return", ...
https://github.com/alexozer/jankdrone/blob/c4b403eb254b41b832ab2bdfade12ba59c99e5dc/handheld/lib/nanopb/generator/nanopb_generator.py#L989-L997
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/grid.py
python
Grid.GetRowLabelSize
(*args, **kwargs)
return _grid.Grid_GetRowLabelSize(*args, **kwargs)
GetRowLabelSize(self) -> int
GetRowLabelSize(self) -> int
[ "GetRowLabelSize", "(", "self", ")", "-", ">", "int" ]
def GetRowLabelSize(*args, **kwargs): """GetRowLabelSize(self) -> int""" return _grid.Grid_GetRowLabelSize(*args, **kwargs)
[ "def", "GetRowLabelSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_GetRowLabelSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L1474-L1476
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/calendar.py
python
CalendarDateAttr.HasTextColour
(*args, **kwargs)
return _calendar.CalendarDateAttr_HasTextColour(*args, **kwargs)
HasTextColour(self) -> bool
HasTextColour(self) -> bool
[ "HasTextColour", "(", "self", ")", "-", ">", "bool" ]
def HasTextColour(*args, **kwargs): """HasTextColour(self) -> bool""" return _calendar.CalendarDateAttr_HasTextColour(*args, **kwargs)
[ "def", "HasTextColour", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_calendar", ".", "CalendarDateAttr_HasTextColour", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/calendar.py#L122-L124
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/stone-game-vii.py
python
Solution.stoneGameVII
(self, stones)
return dp[0][-1]
:type stones: List[int] :rtype: int
:type stones: List[int] :rtype: int
[ ":", "type", "stones", ":", "List", "[", "int", "]", ":", "rtype", ":", "int" ]
def stoneGameVII(self, stones): """ :type stones: List[int] :rtype: int """ def score(i, j): return prefix[j+1]-prefix[i] prefix = [0] for stone in stones: prefix.append(prefix[-1]+stone) dp = [[0 for _ in xrange(len(stones))] for ...
[ "def", "stoneGameVII", "(", "self", ",", "stones", ")", ":", "def", "score", "(", "i", ",", "j", ")", ":", "return", "prefix", "[", "j", "+", "1", "]", "-", "prefix", "[", "i", "]", "prefix", "=", "[", "0", "]", "for", "stone", "in", "stones", ...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/stone-game-vii.py#L5-L20
cmu-db/noisepage
79276e68fe83322f1249e8a8be96bd63c583ae56
build-support/cpplint.py
python
PrintCategories
()
Prints a list of all the error-categories used by error messages. These are the categories used to filter messages via --filter.
Prints a list of all the error-categories used by error messages.
[ "Prints", "a", "list", "of", "all", "the", "error", "-", "categories", "used", "by", "error", "messages", "." ]
def PrintCategories(): """Prints a list of all the error-categories used by error messages. These are the categories used to filter messages via --filter. """ sys.stderr.write(''.join(' %s\n' % cat for cat in _ERROR_CATEGORIES)) sys.exit(0)
[ "def", "PrintCategories", "(", ")", ":", "sys", ".", "stderr", ".", "write", "(", "''", ".", "join", "(", "' %s\\n'", "%", "cat", "for", "cat", "in", "_ERROR_CATEGORIES", ")", ")", "sys", ".", "exit", "(", "0", ")" ]
https://github.com/cmu-db/noisepage/blob/79276e68fe83322f1249e8a8be96bd63c583ae56/build-support/cpplint.py#L6432-L6438
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/lib/histograms.py
python
_get_bin_edges
(a, bins, range, weights)
Computes the bins used internally by `histogram`. Parameters ========== a : ndarray Ravelled data array bins, range Forwarded arguments from `histogram`. weights : ndarray, optional Ravelled weights array, or None Returns ======= bin_edges : ndarray Arra...
Computes the bins used internally by `histogram`.
[ "Computes", "the", "bins", "used", "internally", "by", "histogram", "." ]
def _get_bin_edges(a, bins, range, weights): """ Computes the bins used internally by `histogram`. Parameters ========== a : ndarray Ravelled data array bins, range Forwarded arguments from `histogram`. weights : ndarray, optional Ravelled weights array, or None ...
[ "def", "_get_bin_edges", "(", "a", ",", "bins", ",", "range", ",", "weights", ")", ":", "# parse the overloaded bins argument", "n_equal_bins", "=", "None", "bin_edges", "=", "None", "if", "isinstance", "(", "bins", ",", "basestring", ")", ":", "bin_name", "="...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/lib/histograms.py#L361-L452
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/waflib/Task.py
python
Task.sig_implicit_deps
(self)
return sig
Used by :py:meth:`waflib.Task.Task.signature` hashes node signatures obtained by scanning for dependencies (:py:meth:`waflib.Task.Task.scan`). :rtype: hash value
Used by :py:meth:`waflib.Task.Task.signature` hashes node signatures obtained by scanning for dependencies (:py:meth:`waflib.Task.Task.scan`).
[ "Used", "by", ":", "py", ":", "meth", ":", "waflib", ".", "Task", ".", "Task", ".", "signature", "hashes", "node", "signatures", "obtained", "by", "scanning", "for", "dependencies", "(", ":", "py", ":", "meth", ":", "waflib", ".", "Task", ".", "Task", ...
def sig_implicit_deps(self): """ Used by :py:meth:`waflib.Task.Task.signature` hashes node signatures obtained by scanning for dependencies (:py:meth:`waflib.Task.Task.scan`). :rtype: hash value """ bld = self.generator.bld # get the task signatures from previous runs key = self.uid() prev = bld.task_...
[ "def", "sig_implicit_deps", "(", "self", ")", ":", "bld", "=", "self", ".", "generator", ".", "bld", "# get the task signatures from previous runs", "key", "=", "self", ".", "uid", "(", ")", "prev", "=", "bld", ".", "task_sigs", ".", "get", "(", "(", "key"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Task.py#L768-L826
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/dataview.py
python
DataViewItemAttr.HasBackgroundColour
(*args, **kwargs)
return _dataview.DataViewItemAttr_HasBackgroundColour(*args, **kwargs)
HasBackgroundColour(self) -> bool
HasBackgroundColour(self) -> bool
[ "HasBackgroundColour", "(", "self", ")", "-", ">", "bool" ]
def HasBackgroundColour(*args, **kwargs): """HasBackgroundColour(self) -> bool""" return _dataview.DataViewItemAttr_HasBackgroundColour(*args, **kwargs)
[ "def", "HasBackgroundColour", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewItemAttr_HasBackgroundColour", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/dataview.py#L369-L371
vslavik/poedit
f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a
deps/boost/tools/build/src/build/virtual_target.py
python
AbstractFileTarget.grist
(self)
Helper to 'actual_name', above. Compute unique prefix used to distinguish this target from other targets with the same name which create different file.
Helper to 'actual_name', above. Compute unique prefix used to distinguish this target from other targets with the same name which create different file.
[ "Helper", "to", "actual_name", "above", ".", "Compute", "unique", "prefix", "used", "to", "distinguish", "this", "target", "from", "other", "targets", "with", "the", "same", "name", "which", "create", "different", "file", "." ]
def grist (self): """Helper to 'actual_name', above. Compute unique prefix used to distinguish this target from other targets with the same name which create different file. """ # Depending on target, there may be different approaches to generating # unique prefix...
[ "def", "grist", "(", "self", ")", ":", "# Depending on target, there may be different approaches to generating", "# unique prefixes. We'll generate prefixes in the form", "# <one letter approach code> <the actual prefix>", "path", "=", "self", ".", "path", "(", ")", "if", "path", ...
https://github.com/vslavik/poedit/blob/f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a/deps/boost/tools/build/src/build/virtual_target.py#L500-L530
Ifsttar/I-Simpa
2283385f4cac769a92e265edabb9c79cb6c42d03
currentRelease/SystemScript/graphy/backends/google_chart_api/util.py
python
EncodeData
(chart, series, y_min, y_max, encoder)
return result
Format the given data series in plain or extended format. Use the chart's encoder to determine the format. The formatted data will be scaled to fit within the range of values supported by the chosen encoding. Args: chart: The chart. series: A list of the the data series to format; each list element is...
Format the given data series in plain or extended format.
[ "Format", "the", "given", "data", "series", "in", "plain", "or", "extended", "format", "." ]
def EncodeData(chart, series, y_min, y_max, encoder): """Format the given data series in plain or extended format. Use the chart's encoder to determine the format. The formatted data will be scaled to fit within the range of values supported by the chosen encoding. Args: chart: The chart. series: A ...
[ "def", "EncodeData", "(", "chart", ",", "series", ",", "y_min", ",", "y_max", ",", "encoder", ")", ":", "assert", "(", "y_min", "is", "None", ")", "==", "(", "y_max", "is", "None", ")", "if", "y_min", "is", "not", "None", ":", "def", "_ScaleAndEncode...
https://github.com/Ifsttar/I-Simpa/blob/2283385f4cac769a92e265edabb9c79cb6c42d03/currentRelease/SystemScript/graphy/backends/google_chart_api/util.py#L188-L214
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/dock/dockable_tabs.py
python
DetachableTabWidget.set_tab_warning
(self, index: int, message: str)
Adds a tooltip to a tab with a warning message.
Adds a tooltip to a tab with a warning message.
[ "Adds", "a", "tooltip", "to", "a", "tab", "with", "a", "warning", "message", "." ]
def set_tab_warning(self, index: int, message: str) -> None: """Adds a tooltip to a tab with a warning message.""" self.setTabIcon(index, self.invalid_tab_icon if message != "" else self.valid_tab_icon) self.setTabToolTip(index, message)
[ "def", "set_tab_warning", "(", "self", ",", "index", ":", "int", ",", "message", ":", "str", ")", "->", "None", ":", "self", ".", "setTabIcon", "(", "index", ",", "self", ".", "invalid_tab_icon", "if", "message", "!=", "\"\"", "else", "self", ".", "val...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/dock/dockable_tabs.py#L50-L53
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/v8/third_party/jinja2/sandbox.py
python
safe_range
(*args)
return rng
A range that can't generate ranges with a length of more than MAX_RANGE items.
A range that can't generate ranges with a length of more than MAX_RANGE items.
[ "A", "range", "that", "can", "t", "generate", "ranges", "with", "a", "length", "of", "more", "than", "MAX_RANGE", "items", "." ]
def safe_range(*args): """A range that can't generate ranges with a length of more than MAX_RANGE items. """ rng = range(*args) if len(rng) > MAX_RANGE: raise OverflowError('range too big, maximum size for range is %d' % MAX_RANGE) return rng
[ "def", "safe_range", "(", "*", "args", ")", ":", "rng", "=", "range", "(", "*", "args", ")", "if", "len", "(", "rng", ")", ">", "MAX_RANGE", ":", "raise", "OverflowError", "(", "'range too big, maximum size for range is %d'", "%", "MAX_RANGE", ")", "return",...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/v8/third_party/jinja2/sandbox.py#L147-L155
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/waflib/extras/boo.py
python
apply_booc
(self)
Create a booc task
Create a booc task
[ "Create", "a", "booc", "task" ]
def apply_booc(self): """Create a booc task """ src_nodes = self.to_nodes(self.source) out_node = self.path.find_or_declare(self.gen) self.boo_task = self.create_task('booc', src_nodes, [out_node]) # Set variables used by the 'booc' task self.boo_task.env.OUT = '-o:%s' % out_node.abspath() # type is "exe" by ...
[ "def", "apply_booc", "(", "self", ")", ":", "src_nodes", "=", "self", ".", "to_nodes", "(", "self", ".", "source", ")", "out_node", "=", "self", ".", "path", ".", "find_or_declare", "(", "self", ".", "gen", ")", "self", ".", "boo_task", "=", "self", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/extras/boo.py#L28-L40
google/shaka-packager
e1b0c7c45431327fd3ce193514a5407d07b39b22
packager/third_party/protobuf/python/mox.py
python
StrContains.__init__
(self, search_string)
Initialize. Args: # search_string: the string you are searching for search_string: str
Initialize.
[ "Initialize", "." ]
def __init__(self, search_string): """Initialize. Args: # search_string: the string you are searching for search_string: str """ self._search_string = search_string
[ "def", "__init__", "(", "self", ",", "search_string", ")", ":", "self", ".", "_search_string", "=", "search_string" ]
https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/mox.py#L874-L882
tinyobjloader/tinyobjloader
8322e00ae685ea623ab6ac5a6cebcfa2d22fbf93
deps/cpplint.py
python
_FunctionState.End
(self)
Stop analyzing function body.
Stop analyzing function body.
[ "Stop", "analyzing", "function", "body", "." ]
def End(self): """Stop analyzing function body.""" self.in_a_function = False
[ "def", "End", "(", "self", ")", ":", "self", ".", "in_a_function", "=", "False" ]
https://github.com/tinyobjloader/tinyobjloader/blob/8322e00ae685ea623ab6ac5a6cebcfa2d22fbf93/deps/cpplint.py#L964-L966
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/calendar.py
python
GenericCalendarCtrl.SetLowerDateLimit
(*args, **kwargs)
return _calendar.GenericCalendarCtrl_SetLowerDateLimit(*args, **kwargs)
SetLowerDateLimit(self, DateTime date=DefaultDateTime) -> bool set the range in which selection can occur
SetLowerDateLimit(self, DateTime date=DefaultDateTime) -> bool
[ "SetLowerDateLimit", "(", "self", "DateTime", "date", "=", "DefaultDateTime", ")", "-", ">", "bool" ]
def SetLowerDateLimit(*args, **kwargs): """ SetLowerDateLimit(self, DateTime date=DefaultDateTime) -> bool set the range in which selection can occur """ return _calendar.GenericCalendarCtrl_SetLowerDateLimit(*args, **kwargs)
[ "def", "SetLowerDateLimit", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_calendar", ".", "GenericCalendarCtrl_SetLowerDateLimit", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/calendar.py#L515-L521
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py3/IPython/core/formatters.py
python
BaseFormatter._check_return
(self, r, obj)
Check that a return value is appropriate Return the value if so, None otherwise, warning if invalid.
Check that a return value is appropriate Return the value if so, None otherwise, warning if invalid.
[ "Check", "that", "a", "return", "value", "is", "appropriate", "Return", "the", "value", "if", "so", "None", "otherwise", "warning", "if", "invalid", "." ]
def _check_return(self, r, obj): """Check that a return value is appropriate Return the value if so, None otherwise, warning if invalid. """ if r is None or isinstance(r, self._return_type) or \ (isinstance(r, tuple) and r and isinstance(r[0], self._return_type)): ...
[ "def", "_check_return", "(", "self", ",", "r", ",", "obj", ")", ":", "if", "r", "is", "None", "or", "isinstance", "(", "r", ",", "self", ".", "_return_type", ")", "or", "(", "isinstance", "(", "r", ",", "tuple", ")", "and", "r", "and", "isinstance"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/formatters.py#L359-L372
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/boost_1_66_0/tools/build/src/build/generators.py
python
find
(id)
return __generators.get (id, None)
Finds the generator with id. Returns None if not found.
Finds the generator with id. Returns None if not found.
[ "Finds", "the", "generator", "with", "id", ".", "Returns", "None", "if", "not", "found", "." ]
def find (id): """ Finds the generator with id. Returns None if not found. """ assert isinstance(id, basestring) return __generators.get (id, None)
[ "def", "find", "(", "id", ")", ":", "assert", "isinstance", "(", "id", ",", "basestring", ")", "return", "__generators", ".", "get", "(", "id", ",", "None", ")" ]
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/boost_1_66_0/tools/build/src/build/generators.py#L651-L655
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/debug/cli/base_ui.py
python
BaseUI.config
(self)
return self._config
Obtain the CLIConfig of this `BaseUI` instance.
Obtain the CLIConfig of this `BaseUI` instance.
[ "Obtain", "the", "CLIConfig", "of", "this", "BaseUI", "instance", "." ]
def config(self): """Obtain the CLIConfig of this `BaseUI` instance.""" return self._config
[ "def", "config", "(", "self", ")", ":", "return", "self", ".", "_config" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/debug/cli/base_ui.py#L196-L198
wesnoth/wesnoth
6ccac5a5e8ff75303c9190c0da60580925cb32c0
data/tools/wesnoth/libgithub.py
python
GitHub._get_local_addons
(self)
return os.listdir(self.directory)
... Returns list of local add-ons.
...
[ "..." ]
def _get_local_addons(self): """... Returns list of local add-ons. """ return os.listdir(self.directory)
[ "def", "_get_local_addons", "(", "self", ")", ":", "return", "os", ".", "listdir", "(", "self", ".", "directory", ")" ]
https://github.com/wesnoth/wesnoth/blob/6ccac5a5e8ff75303c9190c0da60580925cb32c0/data/tools/wesnoth/libgithub.py#L406-L411
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
isChar
(ch)
return ret
This function is DEPRECATED. Use xmlIsChar_ch or xmlIsCharQ instead
This function is DEPRECATED. Use xmlIsChar_ch or xmlIsCharQ instead
[ "This", "function", "is", "DEPRECATED", ".", "Use", "xmlIsChar_ch", "or", "xmlIsCharQ", "instead" ]
def isChar(ch): """This function is DEPRECATED. Use xmlIsChar_ch or xmlIsCharQ instead """ ret = libxml2mod.xmlIsChar(ch) return ret
[ "def", "isChar", "(", "ch", ")", ":", "ret", "=", "libxml2mod", ".", "xmlIsChar", "(", "ch", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L251-L255
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pkg_resources/__init__.py
python
run_script
(dist_spec, script_name)
Locate distribution `dist_spec` and run its `script_name` script
Locate distribution `dist_spec` and run its `script_name` script
[ "Locate", "distribution", "dist_spec", "and", "run", "its", "script_name", "script" ]
def run_script(dist_spec, script_name): """Locate distribution `dist_spec` and run its `script_name` script""" ns = sys._getframe(1).f_globals name = ns['__name__'] ns.clear() ns['__name__'] = name require(dist_spec)[0].run_script(script_name, ns)
[ "def", "run_script", "(", "dist_spec", ",", "script_name", ")", ":", "ns", "=", "sys", ".", "_getframe", "(", "1", ")", ".", "f_globals", "name", "=", "ns", "[", "'__name__'", "]", "ns", ".", "clear", "(", ")", "ns", "[", "'__name__'", "]", "=", "n...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pkg_resources/__init__.py#L464-L470
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/src/robotsim.py
python
RobotModelLink.isPrismatic
(self)
return _robotsim.RobotModelLink_isPrismatic(self)
isPrismatic(RobotModelLink self) -> bool Returns whether the joint is prismatic.
isPrismatic(RobotModelLink self) -> bool
[ "isPrismatic", "(", "RobotModelLink", "self", ")", "-", ">", "bool" ]
def isPrismatic(self): """ isPrismatic(RobotModelLink self) -> bool Returns whether the joint is prismatic. """ return _robotsim.RobotModelLink_isPrismatic(self)
[ "def", "isPrismatic", "(", "self", ")", ":", "return", "_robotsim", ".", "RobotModelLink_isPrismatic", "(", "self", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L3875-L3884