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
wx/lib/agw/hypertreelist.py
python
HyperTreeList.GetAGWWindowStyleFlag
(self)
return agwStyle
Returns the :class:`HyperTreeList` window style flag. :see: :meth:`~HyperTreeList.SetAGWWindowStyleFlag` for a list of valid window styles.
Returns the :class:`HyperTreeList` window style flag.
[ "Returns", "the", ":", "class", ":", "HyperTreeList", "window", "style", "flag", "." ]
def GetAGWWindowStyleFlag(self): """ Returns the :class:`HyperTreeList` window style flag. :see: :meth:`~HyperTreeList.SetAGWWindowStyleFlag` for a list of valid window styles. """ agwStyle = self._agwStyle if self._main_win: agwStyle |= self._main_win.GetAG...
[ "def", "GetAGWWindowStyleFlag", "(", "self", ")", ":", "agwStyle", "=", "self", ".", "_agwStyle", "if", "self", ".", "_main_win", ":", "agwStyle", "|=", "self", ".", "_main_win", ".", "GetAGWWindowStyleFlag", "(", ")", "return", "agwStyle" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/hypertreelist.py#L4323-L4334
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/debug/cli/profile_analyzer_cli.py
python
ProfileAnalyzer._get_list_profile_lines
( self, device_name, device_index, device_count, profile_datum_list, sort_by, sort_reverse, time_unit, device_name_filter=None, node_name_filter=None, op_type_filter=None, screen_cols=80)
return debugger_cli_common.rich_text_lines_from_rich_line_list(output)
Get `RichTextLines` object for list_profile command for a given device. Args: device_name: (string) Device name. device_index: (int) Device index. device_count: (int) Number of devices. profile_datum_list: List of `ProfileDatum` objects. sort_by: (string) Identifier of column to sort....
Get `RichTextLines` object for list_profile command for a given device.
[ "Get", "RichTextLines", "object", "for", "list_profile", "command", "for", "a", "given", "device", "." ]
def _get_list_profile_lines( self, device_name, device_index, device_count, profile_datum_list, sort_by, sort_reverse, time_unit, device_name_filter=None, node_name_filter=None, op_type_filter=None, screen_cols=80): """Get `RichTextLines` object for list_profile command for a given device. ...
[ "def", "_get_list_profile_lines", "(", "self", ",", "device_name", ",", "device_index", ",", "device_count", ",", "profile_datum_list", ",", "sort_by", ",", "sort_reverse", ",", "time_unit", ",", "device_name_filter", "=", "None", ",", "node_name_filter", "=", "None...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/debug/cli/profile_analyzer_cli.py#L472-L571
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
_BaseNetwork.address_exclude
(self, other)
Remove an address from a larger block. For example: addr1 = ip_network('192.0.2.0/28') addr2 = ip_network('192.0.2.1/32') list(addr1.address_exclude(addr2)) = [IPv4Network('192.0.2.0/32'), IPv4Network('192.0.2.2/31'), IPv4Network('192.0.2.4/...
Remove an address from a larger block.
[ "Remove", "an", "address", "from", "a", "larger", "block", "." ]
def address_exclude(self, other): """Remove an address from a larger block. For example: addr1 = ip_network('192.0.2.0/28') addr2 = ip_network('192.0.2.1/32') list(addr1.address_exclude(addr2)) = [IPv4Network('192.0.2.0/32'), IPv4Network('192.0.2.2/3...
[ "def", "address_exclude", "(", "self", ",", "other", ")", ":", "if", "not", "self", ".", "_version", "==", "other", ".", "_version", ":", "raise", "TypeError", "(", "\"%s and %s are not of the same version\"", "%", "(", "self", ",", "other", ")", ")", "if", ...
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#L863-L936
apache/impala
8ddac48f3428c86f2cbd037ced89cfb903298b12
shell/impala_shell.py
python
ImpalaShell.do_version
(self, args)
Prints the Impala build version
Prints the Impala build version
[ "Prints", "the", "Impala", "build", "version" ]
def do_version(self, args): """Prints the Impala build version""" print("Shell version: %s" % VERSION_STRING, file=sys.stderr) print("Server version: %s" % self.server_version, file=sys.stderr)
[ "def", "do_version", "(", "self", ",", "args", ")", ":", "print", "(", "\"Shell version: %s\"", "%", "VERSION_STRING", ",", "file", "=", "sys", ".", "stderr", ")", "print", "(", "\"Server version: %s\"", "%", "self", ".", "server_version", ",", "file", "=", ...
https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/shell/impala_shell.py#L1692-L1695
stan-dev/math
5fd79f89933269a4ca4d8dd1fde2a36d53d4768c
lib/boost_1.75.0/tools/build/src/util/__init__.py
python
value_to_jam
(value, methods=False)
return exported_name
Makes a token to refer to a Python value inside Jam language code. The token is merely a string that can be passed around in Jam code and eventually passed back. For example, we might want to pass PropertySet instance to a tag function and it might eventually call back to virtual_target.add_suffix_and_...
Makes a token to refer to a Python value inside Jam language code.
[ "Makes", "a", "token", "to", "refer", "to", "a", "Python", "value", "inside", "Jam", "language", "code", "." ]
def value_to_jam(value, methods=False): """Makes a token to refer to a Python value inside Jam language code. The token is merely a string that can be passed around in Jam code and eventually passed back. For example, we might want to pass PropertySet instance to a tag function and it might eventually ...
[ "def", "value_to_jam", "(", "value", ",", "methods", "=", "False", ")", ":", "global", "__value_id", "r", "=", "__python_to_jam", ".", "get", "(", "value", ",", "None", ")", "if", "r", ":", "return", "r", "exported_name", "=", "'###_'", "+", "str", "("...
https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/boost_1.75.0/tools/build/src/util/__init__.py#L228-L261
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/formats/style.py
python
Styler.format
(self, formatter, subset=None, na_rep: Optional[str] = None)
return self
Format the text display value of cells. Parameters ---------- formatter : str, callable, dict or None If ``formatter`` is None, the default formatter is used subset : IndexSlice An argument to ``DataFrame.loc`` that restricts which elements ``formatte...
Format the text display value of cells.
[ "Format", "the", "text", "display", "value", "of", "cells", "." ]
def format(self, formatter, subset=None, na_rep: Optional[str] = None): """ Format the text display value of cells. Parameters ---------- formatter : str, callable, dict or None If ``formatter`` is None, the default formatter is used subset : IndexSlice ...
[ "def", "format", "(", "self", ",", "formatter", ",", "subset", "=", "None", ",", "na_rep", ":", "Optional", "[", "str", "]", "=", "None", ")", ":", "if", "formatter", "is", "None", ":", "assert", "self", ".", "_display_funcs", ".", "default_factory", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/formats/style.py#L426-L497
MythTV/mythtv
d282a209cb8be85d036f85a62a8ec971b67d45f4
mythtv/programs/scripts/metadata/Music/musicbrainzngs/musicbrainz.py
python
get_recording_by_id
(id, includes=[], release_status=[], release_type=[])
return _do_mb_query("recording", id, includes, params)
Get the recording with the MusicBrainz `id` as a dict with a 'recording' key. *Available includes*: {includes}
Get the recording with the MusicBrainz `id` as a dict with a 'recording' key.
[ "Get", "the", "recording", "with", "the", "MusicBrainz", "id", "as", "a", "dict", "with", "a", "recording", "key", "." ]
def get_recording_by_id(id, includes=[], release_status=[], release_type=[]): """Get the recording with the MusicBrainz `id` as a dict with a 'recording' key. *Available includes*: {includes}""" params = _check_filter_and_make_params("recording", includes, rel...
[ "def", "get_recording_by_id", "(", "id", ",", "includes", "=", "[", "]", ",", "release_status", "=", "[", "]", ",", "release_type", "=", "[", "]", ")", ":", "params", "=", "_check_filter_and_make_params", "(", "\"recording\"", ",", "includes", ",", "release_...
https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/metadata/Music/musicbrainzngs/musicbrainz.py#L843-L850
gemrb/gemrb
730206eed8d1dd358ca5e69a62f9e099aa22ffc6
gemrb/GUIScripts/LUSpellSelection.py
python
RowIndex
()
Determines which factor to use in scrolling of spells It depends on if it is character generation where you have 4 rows of 6 spells (24), or it is sorcs level up window where there is 4 rows of 5 spells and 5th row of 4 spell, but you may also use 25th slot there and it is 5 rows of 5 with 25 spells seen at once.
Determines which factor to use in scrolling of spells
[ "Determines", "which", "factor", "to", "use", "in", "scrolling", "of", "spells" ]
def RowIndex (): """Determines which factor to use in scrolling of spells It depends on if it is character generation where you have 4 rows of 6 spells (24), or it is sorcs level up window where there is 4 rows of 5 spells and 5th row of 4 spell, but you may also use 25th slot there and it is 5 rows of 5 with 25 ...
[ "def", "RowIndex", "(", ")", ":", "SpellTopIndex", "=", "GemRB", ".", "GetVar", "(", "\"SpellTopIndex\"", ")", "if", "chargen", ":", "return", "(", "SpellTopIndex", "+", "1", ")", "*", "6", "-", "6", "elif", "IWD2", ":", "# 30 during level-up", "return", ...
https://github.com/gemrb/gemrb/blob/730206eed8d1dd358ca5e69a62f9e099aa22ffc6/gemrb/GUIScripts/LUSpellSelection.py#L683-L699
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
ToolBarToolBase.CanBeToggled
(*args, **kwargs)
return _controls_.ToolBarToolBase_CanBeToggled(*args, **kwargs)
CanBeToggled(self) -> bool
CanBeToggled(self) -> bool
[ "CanBeToggled", "(", "self", ")", "-", ">", "bool" ]
def CanBeToggled(*args, **kwargs): """CanBeToggled(self) -> bool""" return _controls_.ToolBarToolBase_CanBeToggled(*args, **kwargs)
[ "def", "CanBeToggled", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ToolBarToolBase_CanBeToggled", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L3485-L3487
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/sparsemax/python/ops/sparsemax_loss.py
python
sparsemax_loss
(logits, sparsemax, labels, name=None)
Computes sparsemax loss function [1]. [1]: https://arxiv.org/abs/1602.02068 Args: logits: A `Tensor`. Must be one of the following types: `half`, `float32`, `float64`. sparsemax: A `Tensor`. Must have the same type as `logits`. labels: A `Tensor`. Must have the same type as `logits`. name: A...
Computes sparsemax loss function [1].
[ "Computes", "sparsemax", "loss", "function", "[", "1", "]", "." ]
def sparsemax_loss(logits, sparsemax, labels, name=None): """Computes sparsemax loss function [1]. [1]: https://arxiv.org/abs/1602.02068 Args: logits: A `Tensor`. Must be one of the following types: `half`, `float32`, `float64`. sparsemax: A `Tensor`. Must have the same type as `logits`. label...
[ "def", "sparsemax_loss", "(", "logits", ",", "sparsemax", ",", "labels", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "\"sparsemax_loss\"", ",", "[", "logits", ",", "sparsemax", ",", "labels", "]", ")", "as", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/sparsemax/python/ops/sparsemax_loss.py#L28-L76
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/summary/event_multiplexer.py
python
EventMultiplexer.AddRun
(self, path, name=None)
return self
Add a run to the multiplexer. If the name is not specified, it is the same as the path. If a run by that name exists, and we are already watching the right path, do nothing. If we are watching a different path, replace the event accumulator. If `Reload` has been called, it will `Reload` the n...
Add a run to the multiplexer.
[ "Add", "a", "run", "to", "the", "multiplexer", "." ]
def AddRun(self, path, name=None): """Add a run to the multiplexer. If the name is not specified, it is the same as the path. If a run by that name exists, and we are already watching the right path, do nothing. If we are watching a different path, replace the event accumulator. If `Reloa...
[ "def", "AddRun", "(", "self", ",", "path", ",", "name", "=", "None", ")", ":", "if", "name", "is", "None", "or", "name", "is", "''", ":", "name", "=", "path", "accumulator", "=", "None", "with", "self", ".", "_accumulators_mutex", ":", "if", "name", ...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/summary/event_multiplexer.py#L106-L145
LisaAnne/lisa-caffe-public
49b8643ddef23a4f6120017968de30c45e693f59
python/caffe/io.py
python
arraylist_to_blobprotovecor_str
(arraylist)
return vec.SerializeToString()
Converts a list of arrays to a serialized blobprotovec, which could be then passed to a network for processing.
Converts a list of arrays to a serialized blobprotovec, which could be then passed to a network for processing.
[ "Converts", "a", "list", "of", "arrays", "to", "a", "serialized", "blobprotovec", "which", "could", "be", "then", "passed", "to", "a", "network", "for", "processing", "." ]
def arraylist_to_blobprotovecor_str(arraylist): """Converts a list of arrays to a serialized blobprotovec, which could be then passed to a network for processing. """ vec = caffe_pb2.BlobProtoVector() vec.blobs.extend([array_to_blobproto(arr) for arr in arraylist]) return vec.SerializeToString()
[ "def", "arraylist_to_blobprotovecor_str", "(", "arraylist", ")", ":", "vec", "=", "caffe_pb2", ".", "BlobProtoVector", "(", ")", "vec", ".", "blobs", ".", "extend", "(", "[", "array_to_blobproto", "(", "arr", ")", "for", "arr", "in", "arraylist", "]", ")", ...
https://github.com/LisaAnne/lisa-caffe-public/blob/49b8643ddef23a4f6120017968de30c45e693f59/python/caffe/io.py#L45-L51
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBUnixSignals.GetNumSignals
(self)
return _lldb.SBUnixSignals_GetNumSignals(self)
GetNumSignals(SBUnixSignals self) -> int32_t
GetNumSignals(SBUnixSignals self) -> int32_t
[ "GetNumSignals", "(", "SBUnixSignals", "self", ")", "-", ">", "int32_t" ]
def GetNumSignals(self): """GetNumSignals(SBUnixSignals self) -> int32_t""" return _lldb.SBUnixSignals_GetNumSignals(self)
[ "def", "GetNumSignals", "(", "self", ")", ":", "return", "_lldb", ".", "SBUnixSignals_GetNumSignals", "(", "self", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L15366-L15368
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/computation/eval.py
python
_convert_expression
(expr)
return s
Convert an object to an expression. This function converts an object to an expression (a unicode string) and checks to make sure it isn't empty after conversion. This is used to convert operators to their string representation for recursive calls to :func:`~pandas.eval`. Parameters ---------- ...
Convert an object to an expression.
[ "Convert", "an", "object", "to", "an", "expression", "." ]
def _convert_expression(expr) -> str: """ Convert an object to an expression. This function converts an object to an expression (a unicode string) and checks to make sure it isn't empty after conversion. This is used to convert operators to their string representation for recursive calls to :fu...
[ "def", "_convert_expression", "(", "expr", ")", "->", "str", ":", "s", "=", "pprint_thing", "(", "expr", ")", "_check_expression", "(", "s", ")", "return", "s" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/computation/eval.py#L120-L146
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/compiler/pycodegen.py
python
compile
(source, filename, mode, flags=None, dont_inherit=None)
return gen.code
Replacement for builtin compile() function
Replacement for builtin compile() function
[ "Replacement", "for", "builtin", "compile", "()", "function" ]
def compile(source, filename, mode, flags=None, dont_inherit=None): """Replacement for builtin compile() function""" if flags is not None or dont_inherit is not None: raise RuntimeError, "not implemented yet" if mode == "single": gen = Interactive(source, filename) elif mode == "exec": ...
[ "def", "compile", "(", "source", ",", "filename", ",", "mode", ",", "flags", "=", "None", ",", "dont_inherit", "=", "None", ")", ":", "if", "flags", "is", "not", "None", "or", "dont_inherit", "is", "not", "None", ":", "raise", "RuntimeError", ",", "\"n...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/compiler/pycodegen.py#L51-L66
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Tools/bgen/bgen/bgenType.py
python
Type.mkvalueArgs
(self, name)
return name
Return an argument for use with Py_BuildValue(). Example: int.mkvalueArgs("spam") returns the string "spam".
Return an argument for use with Py_BuildValue().
[ "Return", "an", "argument", "for", "use", "with", "Py_BuildValue", "()", "." ]
def mkvalueArgs(self, name): """Return an argument for use with Py_BuildValue(). Example: int.mkvalueArgs("spam") returns the string "spam". """ return name
[ "def", "mkvalueArgs", "(", "self", ",", "name", ")", ":", "return", "name" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Tools/bgen/bgen/bgenType.py#L131-L136
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py2/IPython/core/ultratb.py
python
with_patch_inspect
(f)
return wrapped
decorator for monkeypatching inspect.findsource
decorator for monkeypatching inspect.findsource
[ "decorator", "for", "monkeypatching", "inspect", ".", "findsource" ]
def with_patch_inspect(f): """decorator for monkeypatching inspect.findsource""" def wrapped(*args, **kwargs): save_findsource = inspect.findsource save_getargs = inspect.getargs inspect.findsource = findsource inspect.getargs = getargs try: return f(*args, *...
[ "def", "with_patch_inspect", "(", "f", ")", ":", "def", "wrapped", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "save_findsource", "=", "inspect", ".", "findsource", "save_getargs", "=", "inspect", ".", "getargs", "inspect", ".", "findsource", "=",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/ultratb.py#L304-L318
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
StaticText_GetClassDefaultAttributes
(*args, **kwargs)
return _controls_.StaticText_GetClassDefaultAttributes(*args, **kwargs)
StaticText_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control -- which is a much better idea than hard coding specific colours...
StaticText_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
[ "StaticText_GetClassDefaultAttributes", "(", "int", "variant", "=", "WINDOW_VARIANT_NORMAL", ")", "-", ">", "VisualAttributes" ]
def StaticText_GetClassDefaultAttributes(*args, **kwargs): """ StaticText_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control...
[ "def", "StaticText_GetClassDefaultAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "StaticText_GetClassDefaultAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L1048-L1063
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/dataview.py
python
DataViewModelNotifier.ItemChanged
(*args, **kwargs)
return _dataview.DataViewModelNotifier_ItemChanged(*args, **kwargs)
ItemChanged(self, DataViewItem item) -> bool Override this to be informed that an item's value has changed.
ItemChanged(self, DataViewItem item) -> bool
[ "ItemChanged", "(", "self", "DataViewItem", "item", ")", "-", ">", "bool" ]
def ItemChanged(*args, **kwargs): """ ItemChanged(self, DataViewItem item) -> bool Override this to be informed that an item's value has changed. """ return _dataview.DataViewModelNotifier_ItemChanged(*args, **kwargs)
[ "def", "ItemChanged", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewModelNotifier_ItemChanged", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/dataview.py#L208-L214
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/stats/morestats.py
python
mood
(x, y, axis=0)
return z, pval
Perform Mood's test for equal scale parameters. Mood's two-sample test for scale parameters is a non-parametric test for the null hypothesis that two samples are drawn from the same distribution with the same scale parameter. Parameters ---------- x, y : array_like Arrays of sample dat...
Perform Mood's test for equal scale parameters.
[ "Perform", "Mood", "s", "test", "for", "equal", "scale", "parameters", "." ]
def mood(x, y, axis=0): """ Perform Mood's test for equal scale parameters. Mood's two-sample test for scale parameters is a non-parametric test for the null hypothesis that two samples are drawn from the same distribution with the same scale parameter. Parameters ---------- x, y : arr...
[ "def", "mood", "(", "x", ",", "y", ",", "axis", "=", "0", ")", ":", "x", "=", "np", ".", "asarray", "(", "x", ",", "dtype", "=", "float", ")", "y", "=", "np", ".", "asarray", "(", "y", ",", "dtype", "=", "float", ")", "if", "axis", "is", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/stats/morestats.py#L2581-L2703
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/core/fromnumeric.py
python
shape
(a)
return result
Return the shape of an array. Parameters ---------- a : array_like Input array. Returns ------- shape : tuple of ints The elements of the shape tuple give the lengths of the corresponding array dimensions. See Also -------- alen ndarray.shape : Equivale...
Return the shape of an array.
[ "Return", "the", "shape", "of", "an", "array", "." ]
def shape(a): """ Return the shape of an array. Parameters ---------- a : array_like Input array. Returns ------- shape : tuple of ints The elements of the shape tuple give the lengths of the corresponding array dimensions. See Also -------- alen ...
[ "def", "shape", "(", "a", ")", ":", "try", ":", "result", "=", "a", ".", "shape", "except", "AttributeError", ":", "result", "=", "asarray", "(", "a", ")", ".", "shape", "return", "result" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/core/fromnumeric.py#L1786-L1828
WeitaoVan/L-GM-loss
598582f0631bac876b3eeb8d6c4cd1d780269e03
examples/pycaffe/layers/pascal_multilabel_datalayers.py
python
PascalMultilabelDataLayerSync.reshape
(self, bottom, top)
There is no need to reshape the data, since the input is of fixed size (rows and columns)
There is no need to reshape the data, since the input is of fixed size (rows and columns)
[ "There", "is", "no", "need", "to", "reshape", "the", "data", "since", "the", "input", "is", "of", "fixed", "size", "(", "rows", "and", "columns", ")" ]
def reshape(self, bottom, top): """ There is no need to reshape the data, since the input is of fixed size (rows and columns) """ pass
[ "def", "reshape", "(", "self", ",", "bottom", ",", "top", ")", ":", "pass" ]
https://github.com/WeitaoVan/L-GM-loss/blob/598582f0631bac876b3eeb8d6c4cd1d780269e03/examples/pycaffe/layers/pascal_multilabel_datalayers.py#L67-L72
facebook/folly
744a0a698074d1b013813065fe60f545aa2c9b94
build/fbcode_builder/getdeps/subcmd.py
python
SubCmd.run
(self, args)
return 0
perform the command
perform the command
[ "perform", "the", "command" ]
def run(self, args): """perform the command""" return 0
[ "def", "run", "(", "self", ",", "args", ")", ":", "return", "0" ]
https://github.com/facebook/folly/blob/744a0a698074d1b013813065fe60f545aa2c9b94/build/fbcode_builder/getdeps/subcmd.py#L11-L13
NERSC/timemory
431912b360ff50d1a160d7826e2eea04fbd1037f
timemory/trace/tracer.py
python
Tracer.__enter__
(self, *args, **kwargs)
Context manager start function
Context manager start function
[ "Context", "manager", "start", "function" ]
def __enter__(self, *args, **kwargs): """Context manager start function""" self.start()
[ "def", "__enter__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "self", ".", "start", "(", ")" ]
https://github.com/NERSC/timemory/blob/431912b360ff50d1a160d7826e2eea04fbd1037f/timemory/trace/tracer.py#L253-L256
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
PostEvent
(*args, **kwargs)
return _core_.PostEvent(*args, **kwargs)
PostEvent(EvtHandler dest, Event event) Send an event to a window or other wx.EvtHandler to be processed later.
PostEvent(EvtHandler dest, Event event)
[ "PostEvent", "(", "EvtHandler", "dest", "Event", "event", ")" ]
def PostEvent(*args, **kwargs): """ PostEvent(EvtHandler dest, Event event) Send an event to a window or other wx.EvtHandler to be processed later. """ return _core_.PostEvent(*args, **kwargs)
[ "def", "PostEvent", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "PostEvent", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L8403-L8410
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/distutils/dir_util.py
python
_build_cmdtuple
(path, cmdtuples)
Helper for remove_tree().
Helper for remove_tree().
[ "Helper", "for", "remove_tree", "()", "." ]
def _build_cmdtuple(path, cmdtuples): """Helper for remove_tree().""" for f in os.listdir(path): real_f = os.path.join(path,f) if os.path.isdir(real_f) and not os.path.islink(real_f): _build_cmdtuple(real_f, cmdtuples) else: cmdtuples.append((os.remove, real_f)) ...
[ "def", "_build_cmdtuple", "(", "path", ",", "cmdtuples", ")", ":", "for", "f", "in", "os", ".", "listdir", "(", "path", ")", ":", "real_f", "=", "os", ".", "path", ".", "join", "(", "path", ",", "f", ")", "if", "os", ".", "path", ".", "isdir", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/distutils/dir_util.py#L168-L176
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/glcanvas.py
python
GLCanvas.GetPalette
(*args, **kwargs)
return _glcanvas.GLCanvas_GetPalette(*args, **kwargs)
GetPalette(self) -> Palette
GetPalette(self) -> Palette
[ "GetPalette", "(", "self", ")", "-", ">", "Palette" ]
def GetPalette(*args, **kwargs): """GetPalette(self) -> Palette""" return _glcanvas.GLCanvas_GetPalette(*args, **kwargs)
[ "def", "GetPalette", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_glcanvas", ".", "GLCanvas_GetPalette", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/glcanvas.py#L146-L148
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
Validation/RecoTrack/python/plotting/ntupleDataFormat.py
python
TrackingVertex.nSourceTrackingParticles
(self)
return self._tree.simvtx_sourceSimIdx[self._index].size()
Returns the number of source TrackingParticles.
Returns the number of source TrackingParticles.
[ "Returns", "the", "number", "of", "source", "TrackingParticles", "." ]
def nSourceTrackingParticles(self): """Returns the number of source TrackingParticles.""" self._checkIsValid() return self._tree.simvtx_sourceSimIdx[self._index].size()
[ "def", "nSourceTrackingParticles", "(", "self", ")", ":", "self", ".", "_checkIsValid", "(", ")", "return", "self", ".", "_tree", ".", "simvtx_sourceSimIdx", "[", "self", ".", "_index", "]", ".", "size", "(", ")" ]
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Validation/RecoTrack/python/plotting/ntupleDataFormat.py#L1144-L1147
h2oai/datatable
753197c3f76041dd6468e0f6a9708af92d80f6aa
docs/_ext/xcontributors.py
python
UserRepository._compute_version_strings
(self, maxsize, newname, oldname)
self._data.sorted_versions = [<version>] # list of strings self._data.doc_versions = {<docname>: <version>}
self._data.sorted_versions = [<version>] # list of strings self._data.doc_versions = {<docname>: <version>}
[ "self", ".", "_data", ".", "sorted_versions", "=", "[", "<version", ">", "]", "#", "list", "of", "strings", "self", ".", "_data", ".", "doc_versions", "=", "{", "<docname", ">", ":", "<version", ">", "}" ]
def _compute_version_strings(self, maxsize, newname, oldname): """ self._data.sorted_versions = [<version>] # list of strings self._data.doc_versions = {<docname>: <version>} """ env = self._env assert env and isinstance(env.xchangelog, list) v2_set = set() ...
[ "def", "_compute_version_strings", "(", "self", ",", "maxsize", ",", "newname", ",", "oldname", ")", ":", "env", "=", "self", ".", "_env", "assert", "env", "and", "isinstance", "(", "env", ".", "xchangelog", ",", "list", ")", "v2_set", "=", "set", "(", ...
https://github.com/h2oai/datatable/blob/753197c3f76041dd6468e0f6a9708af92d80f6aa/docs/_ext/xcontributors.py#L61-L96
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/optimize/linesearch.py
python
_nonmonotone_line_search_cruz
(f, x_k, d, prev_fs, eta, gamma=1e-4, tau_min=0.1, tau_max=0.5)
return alpha, xp, fp, Fp
Nonmonotone backtracking line search as described in [1]_ Parameters ---------- f : callable Function returning a tuple ``(f, F)`` where ``f`` is the value of a merit function and ``F`` the residual. x_k : ndarray Initial position d : ndarray Search direction pre...
Nonmonotone backtracking line search as described in [1]_
[ "Nonmonotone", "backtracking", "line", "search", "as", "described", "in", "[", "1", "]", "_" ]
def _nonmonotone_line_search_cruz(f, x_k, d, prev_fs, eta, gamma=1e-4, tau_min=0.1, tau_max=0.5): """ Nonmonotone backtracking line search as described in [1]_ Parameters ---------- f : callable Function returning a tuple ``(f, F)`` where ``f`` is the value...
[ "def", "_nonmonotone_line_search_cruz", "(", "f", ",", "x_k", ",", "d", ",", "prev_fs", ",", "eta", ",", "gamma", "=", "1e-4", ",", "tau_min", "=", "0.1", ",", "tau_max", "=", "0.5", ")", ":", "f_k", "=", "prev_fs", "[", "-", "1", "]", "f_bar", "="...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/linesearch.py#L729-L798
rodeofx/OpenWalter
6116fbe3f04f1146c854afbfbdbe944feaee647e
walter/maya/scripts/walterPanel/walterMayaTraverser.py
python
WalterMayaImplementation.getLayersAssignationPlug
(self, nodeName)
return dependNode.findPlug("layersAssignation", False)
Return MPlug node.layersAssignation.
Return MPlug node.layersAssignation.
[ "Return", "MPlug", "node", ".", "layersAssignation", "." ]
def getLayersAssignationPlug(self, nodeName): """Return MPlug node.layersAssignation.""" # Walter Standin dependNode = self.getDependNode(nodeName) if not dependNode: return # Get walterStandin.layersAssignation return dependNode.findPlug("layersAssignation"...
[ "def", "getLayersAssignationPlug", "(", "self", ",", "nodeName", ")", ":", "# Walter Standin", "dependNode", "=", "self", ".", "getDependNode", "(", "nodeName", ")", "if", "not", "dependNode", ":", "return", "# Get walterStandin.layersAssignation", "return", "dependNo...
https://github.com/rodeofx/OpenWalter/blob/6116fbe3f04f1146c854afbfbdbe944feaee647e/walter/maya/scripts/walterPanel/walterMayaTraverser.py#L791-L800
tensorflow/deepmath
b5b721f54de1d5d6a02d78f5da5995237f9995f9
deepmath/premises/model_definition_cnn.py
python
Model.axiom_embedding
(self, axioms)
return self.make_embedding(axioms)
Compute the embedding for each of the axioms.
Compute the embedding for each of the axioms.
[ "Compute", "the", "embedding", "for", "each", "of", "the", "axioms", "." ]
def axiom_embedding(self, axioms): """Compute the embedding for each of the axioms.""" return self.make_embedding(axioms)
[ "def", "axiom_embedding", "(", "self", ",", "axioms", ")", ":", "return", "self", ".", "make_embedding", "(", "axioms", ")" ]
https://github.com/tensorflow/deepmath/blob/b5b721f54de1d5d6a02d78f5da5995237f9995f9/deepmath/premises/model_definition_cnn.py#L60-L62
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/makeutil.py
python
Makefile.create_rule
(self, targets=[])
return rule
Create a new rule in the makefile for the given targets. Returns the corresponding Rule instance.
Create a new rule in the makefile for the given targets. Returns the corresponding Rule instance.
[ "Create", "a", "new", "rule", "in", "the", "makefile", "for", "the", "given", "targets", ".", "Returns", "the", "corresponding", "Rule", "instance", "." ]
def create_rule(self, targets=[]): ''' Create a new rule in the makefile for the given targets. Returns the corresponding Rule instance. ''' rule = Rule(targets) self._statements.append(rule) return rule
[ "def", "create_rule", "(", "self", ",", "targets", "=", "[", "]", ")", ":", "rule", "=", "Rule", "(", "targets", ")", "self", ".", "_statements", ".", "append", "(", "rule", ")", "return", "rule" ]
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/makeutil.py#L21-L28
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/isotonic.py
python
IsotonicRegression._build_y
(self, X, y, sample_weight, trim_duplicates=True)
Build the y_ IsotonicRegression.
Build the y_ IsotonicRegression.
[ "Build", "the", "y_", "IsotonicRegression", "." ]
def _build_y(self, X, y, sample_weight, trim_duplicates=True): """Build the y_ IsotonicRegression.""" check_consistent_length(X, y, sample_weight) X, y = [check_array(x, ensure_2d=False) for x in [X, y]] y = as_float_array(y) self._check_fit_data(X, y, sample_weight) # ...
[ "def", "_build_y", "(", "self", ",", "X", ",", "y", ",", "sample_weight", ",", "trim_duplicates", "=", "True", ")", ":", "check_consistent_length", "(", "X", ",", "y", ",", "sample_weight", ")", "X", ",", "y", "=", "[", "check_array", "(", "x", ",", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/isotonic.py#L270-L324
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_grad/grad_implementations.py
python
bprop_tuple_getitem
(data, idx, out, dout)
return F.tuple_setitem(C.zeros_like(data), idx, dout), C.zeros_like(idx)
Backpropagator for primitive `tuple_getitem`.
Backpropagator for primitive `tuple_getitem`.
[ "Backpropagator", "for", "primitive", "tuple_getitem", "." ]
def bprop_tuple_getitem(data, idx, out, dout): """Backpropagator for primitive `tuple_getitem`.""" return F.tuple_setitem(C.zeros_like(data), idx, dout), C.zeros_like(idx)
[ "def", "bprop_tuple_getitem", "(", "data", ",", "idx", ",", "out", ",", "dout", ")", ":", "return", "F", ".", "tuple_setitem", "(", "C", ".", "zeros_like", "(", "data", ")", ",", "idx", ",", "dout", ")", ",", "C", ".", "zeros_like", "(", "idx", ")"...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_grad/grad_implementations.py#L137-L139
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tarfile.py
python
TarFile.utime
(self, tarinfo, targetpath)
Set modification time of targetpath according to tarinfo.
Set modification time of targetpath according to tarinfo.
[ "Set", "modification", "time", "of", "targetpath", "according", "to", "tarinfo", "." ]
def utime(self, tarinfo, targetpath): """Set modification time of targetpath according to tarinfo. """ if not hasattr(os, 'utime'): return try: os.utime(targetpath, (tarinfo.mtime, tarinfo.mtime)) except OSError: raise ExtractError("could not c...
[ "def", "utime", "(", "self", ",", "tarinfo", ",", "targetpath", ")", ":", "if", "not", "hasattr", "(", "os", ",", "'utime'", ")", ":", "return", "try", ":", "os", ".", "utime", "(", "targetpath", ",", "(", "tarinfo", ".", "mtime", ",", "tarinfo", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tarfile.py#L2257-L2265
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/util.py
python
get_logger
()
return _logger
Returns logger used by multiprocessing
Returns logger used by multiprocessing
[ "Returns", "logger", "used", "by", "multiprocessing" ]
def get_logger(): ''' Returns logger used by multiprocessing ''' global _logger import logging logging._acquireLock() try: if not _logger: _logger = logging.getLogger(LOGGER_NAME) _logger.propagate = 0 # XXX multiprocessing should cleanup before...
[ "def", "get_logger", "(", ")", ":", "global", "_logger", "import", "logging", "logging", ".", "_acquireLock", "(", ")", "try", ":", "if", "not", "_logger", ":", "_logger", "=", "logging", ".", "getLogger", "(", "LOGGER_NAME", ")", "_logger", ".", "propagat...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/util.py#L60-L85
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/operator_pd_cholesky.py
python
OperatorPDCholesky.get_shape
(self)
return self._chol.get_shape()
`TensorShape` giving static shape.
`TensorShape` giving static shape.
[ "TensorShape", "giving", "static", "shape", "." ]
def get_shape(self): """`TensorShape` giving static shape.""" return self._chol.get_shape()
[ "def", "get_shape", "(", "self", ")", ":", "return", "self", ".", "_chol", ".", "get_shape", "(", ")" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/operator_pd_cholesky.py#L160-L162
Slicer/Slicer
ba9fadf332cb0303515b68d8d06a344c82e3e3e5
Utilities/Templates/Modules/Scripted/TemplateKey.py
python
TemplateKeyWidget.exit
(self)
Called each time the user opens a different module.
Called each time the user opens a different module.
[ "Called", "each", "time", "the", "user", "opens", "a", "different", "module", "." ]
def exit(self): """ Called each time the user opens a different module. """ # Do not react to parameter node changes (GUI wlil be updated when the user enters into the module) self.removeObserver(self._parameterNode, vtk.vtkCommand.ModifiedEvent, self.updateGUIFromParameterNode)
[ "def", "exit", "(", "self", ")", ":", "# Do not react to parameter node changes (GUI wlil be updated when the user enters into the module)", "self", ".", "removeObserver", "(", "self", ".", "_parameterNode", ",", "vtk", ".", "vtkCommand", ".", "ModifiedEvent", ",", "self", ...
https://github.com/Slicer/Slicer/blob/ba9fadf332cb0303515b68d8d06a344c82e3e3e5/Utilities/Templates/Modules/Scripted/TemplateKey.py#L159-L164
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/util/_cloudpickle/_cloudpickle_py27.py
python
CloudPickler.save_function_tuple
(self, func)
Pickles an actual func object. A func comprises: code, globals, defaults, closure, and dict. We extract and save these, injecting reducing functions at certain points to recreate the func object. Keep in mind that some of these pieces can contain a ref to the func itself. Thus, a nai...
Pickles an actual func object.
[ "Pickles", "an", "actual", "func", "object", "." ]
def save_function_tuple(self, func): """ Pickles an actual func object. A func comprises: code, globals, defaults, closure, and dict. We extract and save these, injecting reducing functions at certain points to recreate the func object. Keep in mind that some of these pieces ...
[ "def", "save_function_tuple", "(", "self", ",", "func", ")", ":", "if", "is_tornado_coroutine", "(", "func", ")", ":", "self", ".", "save_reduce", "(", "_rebuild_tornado_coroutine", ",", "(", "func", ".", "__wrapped__", ",", ")", ",", "obj", "=", "func", "...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/util/_cloudpickle/_cloudpickle_py27.py#L530-L584
qt/qt
0a2f2382541424726168804be2c90b91381608c6
src/3rdparty/webkit/Source/ThirdParty/gyp/pylib/gyp/generator/msvs.py
python
_GetLibraries
(config, spec)
return [re.sub('^(\-l)', '', lib) for lib in libraries]
Returns the list of libraries for this configuration. Arguments: config: The dictionnary that defines the special processing to be done for this configuration. spec: The target dictionary containing the properties of the target. Returns: The list of directory paths.
Returns the list of libraries for this configuration.
[ "Returns", "the", "list", "of", "libraries", "for", "this", "configuration", "." ]
def _GetLibraries(config, spec): """Returns the list of libraries for this configuration. Arguments: config: The dictionnary that defines the special processing to be done for this configuration. spec: The target dictionary containing the properties of the target. Returns: The list of dir...
[ "def", "_GetLibraries", "(", "config", ",", "spec", ")", ":", "libraries", "=", "spec", ".", "get", "(", "'libraries'", ",", "[", "]", ")", "# Strip out -l, as it is not used on windows (but is needed so we can pass", "# in libraries that are assumed to be in the default libr...
https://github.com/qt/qt/blob/0a2f2382541424726168804be2c90b91381608c6/src/3rdparty/webkit/Source/ThirdParty/gyp/pylib/gyp/generator/msvs.py#L944-L957
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/src/motionplanning.py
python
get_plan_json_string
()
return _motionplanning.get_plan_json_string()
r""" get_plan_json_string() -> std::string Saves planner values to a JSON string.
r""" get_plan_json_string() -> std::string
[ "r", "get_plan_json_string", "()", "-", ">", "std", "::", "string" ]
def get_plan_json_string() -> "std::string": r""" get_plan_json_string() -> std::string Saves planner values to a JSON string. """ return _motionplanning.get_plan_json_string()
[ "def", "get_plan_json_string", "(", ")", "->", "\"std::string\"", ":", "return", "_motionplanning", ".", "get_plan_json_string", "(", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/motionplanning.py#L360-L368
psmoveservice/PSMoveService
22bbe20e9de53f3f3581137bce7b88e2587a27e7
misc/python/pypsmove/transformations.py
python
orthogonalization_matrix
(lengths, angles)
return numpy.array([ [ a*sinb*math.sqrt(1.0-co*co), 0.0, 0.0, 0.0], [-a*sinb*co, b*sina, 0.0, 0.0], [ a*cosb, b*cosa, c, 0.0], [ 0.0, 0.0, 0.0, 1.0]])
Return orthogonalization matrix for crystallographic cell coordinates. Angles are expected in degrees. The de-orthogonalization matrix is the inverse. >>> O = orthogonalization_matrix([10, 10, 10], [90, 90, 90]) >>> numpy.allclose(O[:3, :3], numpy.identity(3, float) * 10) True >>> O = orthogo...
Return orthogonalization matrix for crystallographic cell coordinates.
[ "Return", "orthogonalization", "matrix", "for", "crystallographic", "cell", "coordinates", "." ]
def orthogonalization_matrix(lengths, angles): """Return orthogonalization matrix for crystallographic cell coordinates. Angles are expected in degrees. The de-orthogonalization matrix is the inverse. >>> O = orthogonalization_matrix([10, 10, 10], [90, 90, 90]) >>> numpy.allclose(O[:3, :3], numpy...
[ "def", "orthogonalization_matrix", "(", "lengths", ",", "angles", ")", ":", "a", ",", "b", ",", "c", "=", "lengths", "angles", "=", "numpy", ".", "radians", "(", "angles", ")", "sina", ",", "sinb", ",", "_", "=", "numpy", ".", "sin", "(", "angles", ...
https://github.com/psmoveservice/PSMoveService/blob/22bbe20e9de53f3f3581137bce7b88e2587a27e7/misc/python/pypsmove/transformations.py#L862-L886
dmlc/nnvm
dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38
python/nnvm/symbol.py
python
Symbol.list_input_names
(self, option='all')
return [_base.py_str(sarr[i]) for i in range(size.value)]
List all the inputs in the symbol. Parameters ---------- option : {'all', 'read_only', 'aux_state'}, optional The listing option - 'all' will list all the arguments. - 'read_only' lists arguments that are readed by the graph. - 'aux_state' lists argum...
List all the inputs in the symbol.
[ "List", "all", "the", "inputs", "in", "the", "symbol", "." ]
def list_input_names(self, option='all'): """List all the inputs in the symbol. Parameters ---------- option : {'all', 'read_only', 'aux_state'}, optional The listing option - 'all' will list all the arguments. - 'read_only' lists arguments that are read...
[ "def", "list_input_names", "(", "self", ",", "option", "=", "'all'", ")", ":", "size", "=", "_ctypes", ".", "c_uint", "(", ")", "sarr", "=", "_ctypes", ".", "POINTER", "(", "_ctypes", ".", "c_char_p", ")", "(", ")", "_check_call", "(", "_LIB", ".", "...
https://github.com/dmlc/nnvm/blob/dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38/python/nnvm/symbol.py#L256-L276
plumonito/dtslam
5994bb9cf7a11981b830370db206bceb654c085d
3rdparty/eigen-3.2.2/debug/gdb/printers.py
python
EigenMatrixPrinter.__init__
(self, variety, val)
Extract all the necessary information
Extract all the necessary information
[ "Extract", "all", "the", "necessary", "information" ]
def __init__(self, variety, val): "Extract all the necessary information" # Save the variety (presumably "Matrix" or "Array") for later usage self.variety = variety # The gdb extension does not support value template arguments - need to extract them by hand type = val.type if type.code == gdb.TYPE_COD...
[ "def", "__init__", "(", "self", ",", "variety", ",", "val", ")", ":", "# Save the variety (presumably \"Matrix\" or \"Array\") for later usage", "self", ".", "variety", "=", "variety", "# The gdb extension does not support value template arguments - need to extract them by hand", "...
https://github.com/plumonito/dtslam/blob/5994bb9cf7a11981b830370db206bceb654c085d/3rdparty/eigen-3.2.2/debug/gdb/printers.py#L37-L78
PaddlePaddle/Anakin
5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730
tools/external_converter_v2/parser/graph_io.py
python
NodeProtoIO.add_attr
(self, value_name, data, data_type_str)
set tensor data: value_name : var name data : real data data_type_str : data type desc ("string" "int" "fl...
set tensor data: value_name : var name data : real data data_type_str : data type desc ("string" "int" "fl...
[ "set", "tensor", "data", ":", "value_name", ":", "var", "name", "data", ":", "real", "data", "data_type_str", ":", "data", "type", "desc", "(", "string", "int", "float", "bool", "tensor", "shape", "list_value", ")" ]
def add_attr(self, value_name, data, data_type_str): """ set tensor data: value_name : var name data : real data data_type_str : data type desc ("string" "int" ...
[ "def", "add_attr", "(", "self", ",", "value_name", ",", "data", ",", "data_type_str", ")", ":", "self", ".", "node_proto", ".", "attr", "[", "value_name", "]", ".", "CopyFrom", "(", "self", ".", "attr_warpper", "(", "data", ",", "data_type_str", ")", ")"...
https://github.com/PaddlePaddle/Anakin/blob/5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730/tools/external_converter_v2/parser/graph_io.py#L230-L244
google/mozc
7329757e1ad30e327c1ae823a8302c79482d6b9c
src/build_tools/versioning_files.py
python
_GetSha1Digest
(file_path)
return sha.digest()
Returns the sha1 hash of the file.
Returns the sha1 hash of the file.
[ "Returns", "the", "sha1", "hash", "of", "the", "file", "." ]
def _GetSha1Digest(file_path): """Returns the sha1 hash of the file.""" sha = hashlib.sha1() with open(file_path, 'rb') as f: data = f.read() sha.update(data) return sha.digest()
[ "def", "_GetSha1Digest", "(", "file_path", ")", ":", "sha", "=", "hashlib", ".", "sha1", "(", ")", "with", "open", "(", "file_path", ",", "'rb'", ")", "as", "f", ":", "data", "=", "f", ".", "read", "(", ")", "sha", ".", "update", "(", "data", ")"...
https://github.com/google/mozc/blob/7329757e1ad30e327c1ae823a8302c79482d6b9c/src/build_tools/versioning_files.py#L62-L68
ros-planning/moveit2
dd240ef6fd8b9932a7a53964140f2952786187a9
moveit_commander/src/moveit_commander/move_group.py
python
MoveGroupCommander.get_active_joints
(self)
return self._g.get_active_joints()
Get the active joints of this group
Get the active joints of this group
[ "Get", "the", "active", "joints", "of", "this", "group" ]
def get_active_joints(self): """ Get the active joints of this group """ return self._g.get_active_joints()
[ "def", "get_active_joints", "(", "self", ")", ":", "return", "self", ".", "_g", ".", "get_active_joints", "(", ")" ]
https://github.com/ros-planning/moveit2/blob/dd240ef6fd8b9932a7a53964140f2952786187a9/moveit_commander/src/moveit_commander/move_group.py#L78-L80
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/Tool/mwcc.py
python
set_vars
(env)
return 1
Set MWCW_VERSION, MWCW_VERSIONS, and some codewarrior environment vars MWCW_VERSIONS is set to a list of objects representing installed versions MWCW_VERSION is set to the version object that will be used for building. MWCW_VERSION can be set to a string during Environment ...
Set MWCW_VERSION, MWCW_VERSIONS, and some codewarrior environment vars
[ "Set", "MWCW_VERSION", "MWCW_VERSIONS", "and", "some", "codewarrior", "environment", "vars" ]
def set_vars(env): """Set MWCW_VERSION, MWCW_VERSIONS, and some codewarrior environment vars MWCW_VERSIONS is set to a list of objects representing installed versions MWCW_VERSION is set to the version object that will be used for building. MWCW_VERSION can be set to a string during Env...
[ "def", "set_vars", "(", "env", ")", ":", "desired", "=", "env", ".", "get", "(", "'MWCW_VERSION'", ",", "''", ")", "# return right away if the variables are already set", "if", "isinstance", "(", "desired", ",", "MWVersion", ")", ":", "return", "1", "elif", "d...
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Tool/mwcc.py#L40-L84
francinexue/xuefu
b6ff79747a42e020588c0c0a921048e08fe4680c
cnx/strategy/tickPosition.py
python
Position.entryActive
(self)
return self.__entryOrder is not None and self.__entryOrder.isActive()
Returns True if the entry order is active.
Returns True if the entry order is active.
[ "Returns", "True", "if", "the", "entry", "order", "is", "active", "." ]
def entryActive(self): """Returns True if the entry order is active.""" return self.__entryOrder is not None and self.__entryOrder.isActive()
[ "def", "entryActive", "(", "self", ")", ":", "return", "self", ".", "__entryOrder", "is", "not", "None", "and", "self", ".", "__entryOrder", ".", "isActive", "(", ")" ]
https://github.com/francinexue/xuefu/blob/b6ff79747a42e020588c0c0a921048e08fe4680c/cnx/strategy/tickPosition.py#L219-L221
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py3/IPython/core/history.py
python
HistoryManager.writeout_cache
(self, conn=None)
Write any entries in the cache to the database.
Write any entries in the cache to the database.
[ "Write", "any", "entries", "in", "the", "cache", "to", "the", "database", "." ]
def writeout_cache(self, conn=None): """Write any entries in the cache to the database.""" if conn is None: conn = self.db with self.db_input_cache_lock: try: self._writeout_input_cache(conn) except sqlite3.IntegrityError: self...
[ "def", "writeout_cache", "(", "self", ",", "conn", "=", "None", ")", ":", "if", "conn", "is", "None", ":", "conn", "=", "self", ".", "db", "with", "self", ".", "db_input_cache_lock", ":", "try", ":", "self", ".", "_writeout_input_cache", "(", "conn", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/history.py#L773-L802
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/framework/python/ops/variables.py
python
get_or_create_global_step
(graph=None)
return globalstep
Returns and create (if necessary) the global step variable. Args: graph: The graph in which to create the global step. If missing, use default graph. Returns: the tensor representing the global step variable.
Returns and create (if necessary) the global step variable.
[ "Returns", "and", "create", "(", "if", "necessary", ")", "the", "global", "step", "variable", "." ]
def get_or_create_global_step(graph=None): """Returns and create (if necessary) the global step variable. Args: graph: The graph in which to create the global step. If missing, use default graph. Returns: the tensor representing the global step variable. """ graph = ops.get_default_graph() i...
[ "def", "get_or_create_global_step", "(", "graph", "=", "None", ")", ":", "graph", "=", "ops", ".", "get_default_graph", "(", ")", "if", "graph", "is", "None", "else", "graph", "globalstep", "=", "get_global_step", "(", "graph", ")", "if", "globalstep", "is",...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/framework/python/ops/variables.py#L160-L174
Samsung/veles
95ed733c2e49bc011ad98ccf2416ecec23fbf352
veles/external/daemon/daemon.py
python
DaemonContext.__init__
( self, chroot_directory=None, working_directory='/', umask=0, uid=None, gid=None, prevent_core=True, detach_process=None, files_preserve=None, pidfile=None, stdin=None, stdout=None, stderr=None, signal_map=N...
Set up a new instance.
Set up a new instance.
[ "Set", "up", "a", "new", "instance", "." ]
def __init__( self, chroot_directory=None, working_directory='/', umask=0, uid=None, gid=None, prevent_core=True, detach_process=None, files_preserve=None, pidfile=None, stdin=None, stdout=None, stderr=None, ...
[ "def", "__init__", "(", "self", ",", "chroot_directory", "=", "None", ",", "working_directory", "=", "'/'", ",", "umask", "=", "0", ",", "uid", "=", "None", ",", "gid", "=", "None", ",", "prevent_core", "=", "True", ",", "detach_process", "=", "None", ...
https://github.com/Samsung/veles/blob/95ed733c2e49bc011ad98ccf2416ecec23fbf352/veles/external/daemon/daemon.py#L210-L262
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/mailbox.py
python
MHMessage.add_sequence
(self, sequence)
Add sequence to list of sequences including the message.
Add sequence to list of sequences including the message.
[ "Add", "sequence", "to", "list", "of", "sequences", "including", "the", "message", "." ]
def add_sequence(self, sequence): """Add sequence to list of sequences including the message.""" if isinstance(sequence, str): if not sequence in self._sequences: self._sequences.append(sequence) else: raise TypeError('sequence type must be str: %s' % type...
[ "def", "add_sequence", "(", "self", ",", "sequence", ")", ":", "if", "isinstance", "(", "sequence", ",", "str", ")", ":", "if", "not", "sequence", "in", "self", ".", "_sequences", ":", "self", ".", "_sequences", ".", "append", "(", "sequence", ")", "el...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/mailbox.py#L1767-L1773
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/logging/handlers.py
python
HTTPHandler.emit
(self, record)
Emit a record. Send the record to the Web server as an URL-encoded dictionary
Emit a record.
[ "Emit", "a", "record", "." ]
def emit(self, record): """ Emit a record. Send the record to the Web server as an URL-encoded dictionary """ try: import httplib, urllib host = self.host h = httplib.HTTP(host) url = self.url data = urllib.urlencode(se...
[ "def", "emit", "(", "self", ",", "record", ")", ":", "try", ":", "import", "httplib", ",", "urllib", "host", "=", "self", ".", "host", "h", "=", "httplib", ".", "HTTP", "(", "host", ")", "url", "=", "self", ".", "url", "data", "=", "urllib", ".",...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/logging/handlers.py#L1007-L1043
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/internals/array_manager.py
python
BaseArrayManager.make_empty
(self: T, axes=None)
return type(self)(arrays, axes)
Return an empty ArrayManager with the items axis of len 0 (no columns)
Return an empty ArrayManager with the items axis of len 0 (no columns)
[ "Return", "an", "empty", "ArrayManager", "with", "the", "items", "axis", "of", "len", "0", "(", "no", "columns", ")" ]
def make_empty(self: T, axes=None) -> T: """Return an empty ArrayManager with the items axis of len 0 (no columns)""" if axes is None: axes = [self.axes[1:], Index([])] arrays: list[np.ndarray | ExtensionArray] = [] return type(self)(arrays, axes)
[ "def", "make_empty", "(", "self", ":", "T", ",", "axes", "=", "None", ")", "->", "T", ":", "if", "axes", "is", "None", ":", "axes", "=", "[", "self", ".", "axes", "[", "1", ":", "]", ",", "Index", "(", "[", "]", ")", "]", "arrays", ":", "li...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/internals/array_manager.py#L133-L139
pristineio/webrtc-mirror
7a5bcdffaab90a05bc1146b2b1ea71c004e54d71
tools_webrtc/valgrind/gdb_helper.py
python
AddressTable.ResolveAll
(self)
Carry out all lookup requests.
Carry out all lookup requests.
[ "Carry", "out", "all", "lookup", "requests", "." ]
def ResolveAll(self): ''' Carry out all lookup requests. ''' self._translation = {} for binary in self._binaries.keys(): if binary != '' and binary in self._load_addresses: load_address = self._load_addresses[binary] addr = ResolveAddressesWithinABinary( binary, load_addres...
[ "def", "ResolveAll", "(", "self", ")", ":", "self", ".", "_translation", "=", "{", "}", "for", "binary", "in", "self", ".", "_binaries", ".", "keys", "(", ")", ":", "if", "binary", "!=", "''", "and", "binary", "in", "self", ".", "_load_addresses", ":...
https://github.com/pristineio/webrtc-mirror/blob/7a5bcdffaab90a05bc1146b2b1ea71c004e54d71/tools_webrtc/valgrind/gdb_helper.py#L72-L81
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/applications/workbench/workbench/plotting/plotscriptgenerator/legend.py
python
generate_title_font_commands
(legend, legend_object_var)
return title_commands
Generate commands for setting properties for the legend title font.
Generate commands for setting properties for the legend title font.
[ "Generate", "commands", "for", "setting", "properties", "for", "the", "legend", "title", "font", "." ]
def generate_title_font_commands(legend, legend_object_var): """ Generate commands for setting properties for the legend title font. """ title_commands = [] kwargs = LegendProperties.from_legend(legend) _remove_kwargs_if_default(kwargs) if 'title_font' in kwargs: title_commands.appe...
[ "def", "generate_title_font_commands", "(", "legend", ",", "legend_object_var", ")", ":", "title_commands", "=", "[", "]", "kwargs", "=", "LegendProperties", ".", "from_legend", "(", "legend", ")", "_remove_kwargs_if_default", "(", "kwargs", ")", "if", "'title_font'...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/applications/workbench/workbench/plotting/plotscriptgenerator/legend.py#L70-L85
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
python/artm/score_tracker.py
python
SparsityPhiScoreTracker.__init__
(self, score)
:Properties: * Note: every field is a list of info about score on all synchronizations. * value - values of Phi sparsity. * zero_tokens - number of zero rows in Phi. * total_tokens - number of all rows in Phi. * Note: every field has a version with prefix 'last_', means retrievin...
:Properties: * Note: every field is a list of info about score on all synchronizations. * value - values of Phi sparsity. * zero_tokens - number of zero rows in Phi. * total_tokens - number of all rows in Phi. * Note: every field has a version with prefix 'last_', means retrievin...
[ ":", "Properties", ":", "*", "Note", ":", "every", "field", "is", "a", "list", "of", "info", "about", "score", "on", "all", "synchronizations", ".", "*", "value", "-", "values", "of", "Phi", "sparsity", ".", "*", "zero_tokens", "-", "number", "of", "ze...
def __init__(self, score): """ :Properties: * Note: every field is a list of info about score on all synchronizations. * value - values of Phi sparsity. * zero_tokens - number of zero rows in Phi. * total_tokens - number of all rows in Phi. * Note: every field has...
[ "def", "__init__", "(", "self", ",", "score", ")", ":", "BaseScoreTracker", ".", "__init__", "(", "self", ",", "score", ")" ]
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/python/artm/score_tracker.py#L101-L111
intel/caffe
3f494b442ee3f9d17a07b09ecbd5fa2bbda00836
scripts/cpp_lint.py
python
FilesBelongToSameModule
(filename_cc, filename_h)
return files_belong_to_same_module, common_path
Check if these two filenames belong to the same module. The concept of a 'module' here is a as follows: foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the same 'module' if they are in the same directory. some/path/public/xyzzy and some/path/internal/xyzzy are also considered to belong to...
Check if these two filenames belong to the same module.
[ "Check", "if", "these", "two", "filenames", "belong", "to", "the", "same", "module", "." ]
def FilesBelongToSameModule(filename_cc, filename_h): """Check if these two filenames belong to the same module. The concept of a 'module' here is a as follows: foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the same 'module' if they are in the same directory. some/path/public/xyzzy and ...
[ "def", "FilesBelongToSameModule", "(", "filename_cc", ",", "filename_h", ")", ":", "if", "not", "filename_cc", ".", "endswith", "(", "'.cc'", ")", ":", "return", "(", "False", ",", "''", ")", "filename_cc", "=", "filename_cc", "[", ":", "-", "len", "(", ...
https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/scripts/cpp_lint.py#L4403-L4455
trailofbits/sienna-locomotive
09bc1a0bea7d7a33089422c62e0d3c715ecb7ce0
sl2/harness/instrument.py
python
kill
()
Ends a sequence of fuzzing runs.
Ends a sequence of fuzzing runs.
[ "Ends", "a", "sequence", "of", "fuzzing", "runs", "." ]
def kill(): """ Ends a sequence of fuzzing runs. """ global can_fuzz can_fuzz = False
[ "def", "kill", "(", ")", ":", "global", "can_fuzz", "can_fuzz", "=", "False" ]
https://github.com/trailofbits/sienna-locomotive/blob/09bc1a0bea7d7a33089422c62e0d3c715ecb7ce0/sl2/harness/instrument.py#L470-L475
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/aui.py
python
AuiManager.DetachPane
(*args, **kwargs)
return _aui.AuiManager_DetachPane(*args, **kwargs)
DetachPane(self, Window window) -> bool
DetachPane(self, Window window) -> bool
[ "DetachPane", "(", "self", "Window", "window", ")", "-", ">", "bool" ]
def DetachPane(*args, **kwargs): """DetachPane(self, Window window) -> bool""" return _aui.AuiManager_DetachPane(*args, **kwargs)
[ "def", "DetachPane", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiManager_DetachPane", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L655-L657
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
grc/core/utils/extract_docs.py
python
docstring_from_make
(key, imports, make)
return doc_strings
Extract the documentation from the python __doc__ strings By importing it and checking a truncated make Args: key: the block key imports: a list of import statements (string) to execute make: block constructor template Returns: a list of tuples (block_name, doc string)
Extract the documentation from the python __doc__ strings By importing it and checking a truncated make
[ "Extract", "the", "documentation", "from", "the", "python", "__doc__", "strings", "By", "importing", "it", "and", "checking", "a", "truncated", "make" ]
def docstring_from_make(key, imports, make): """ Extract the documentation from the python __doc__ strings By importing it and checking a truncated make Args: key: the block key imports: a list of import statements (string) to execute make: block constructor template Return...
[ "def", "docstring_from_make", "(", "key", ",", "imports", ",", "make", ")", ":", "try", ":", "blk_cls", "=", "make", ".", "partition", "(", "'('", ")", "[", "0", "]", ".", "strip", "(", ")", "if", "'$'", "in", "blk_cls", ":", "raise", "ValueError", ...
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/grc/core/utils/extract_docs.py#L69-L95
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/android/gyp/copy_ex.py
python
DoRenaming
(options, deps)
Copy and rename files given in options.renaming_sources and update deps.
Copy and rename files given in options.renaming_sources and update deps.
[ "Copy", "and", "rename", "files", "given", "in", "options", ".", "renaming_sources", "and", "update", "deps", "." ]
def DoRenaming(options, deps): """Copy and rename files given in options.renaming_sources and update deps.""" src_files = list(itertools.chain.from_iterable( build_utils.ParseGnList(f) for f in options.renaming_sources)) dest_files = list(itertools.chain.from_iterable( ...
[ "def", "DoRenaming", "(", "options", ",", "deps", ")", ":", "src_files", "=", "list", "(", "itertools", ".", "chain", ".", "from_iterable", "(", "build_utils", ".", "ParseGnList", "(", "f", ")", "for", "f", "in", "options", ".", "renaming_sources", ")", ...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/gyp/copy_ex.py#L63-L82
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/remote.py
python
RequestState.__init__
(self, remote_host=None, remote_address=None, server_host=None, server_port=None)
Constructor. Args: remote_host: Assigned to property. remote_address: Assigned to property. server_host: Assigned to property. server_port: Assigned to property.
Constructor.
[ "Constructor", "." ]
def __init__(self, remote_host=None, remote_address=None, server_host=None, server_port=None): """Constructor. Args: remote_host: Assigned to property. remote_address: Assigned to property. server_host: Assigned to property. se...
[ "def", "__init__", "(", "self", ",", "remote_host", "=", "None", ",", "remote_address", "=", "None", ",", "server_host", "=", "None", ",", "server_port", "=", "None", ")", ":", "self", ".", "__remote_host", "=", "remote_host", "self", ".", "__remote_address"...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/remote.py#L717-L733
Tarsnap/tarsnap-gui
60a1d7816747ac71a4573673df8ee1b81ef1cb99
util/generate_loading_gif.py
python
draw_frame
(framenum)
return image
Draw a frame of the animation.
Draw a frame of the animation.
[ "Draw", "a", "frame", "of", "the", "animation", "." ]
def draw_frame(framenum): """ Draw a frame of the animation. """ # Create new image and drawing surface. image = PIL.Image.new('LA', (SIZE, SIZE), (1, 255)) draw = PIL.ImageDraw.Draw(image) # Draw the dots. for i in range(VISUAL_DOTS): pos = ((framenum - i) % TOTAL_DOTS) # The ...
[ "def", "draw_frame", "(", "framenum", ")", ":", "# Create new image and drawing surface.", "image", "=", "PIL", ".", "Image", ".", "new", "(", "'LA'", ",", "(", "SIZE", ",", "SIZE", ")", ",", "(", "1", ",", "255", ")", ")", "draw", "=", "PIL", ".", "...
https://github.com/Tarsnap/tarsnap-gui/blob/60a1d7816747ac71a4573673df8ee1b81ef1cb99/util/generate_loading_gif.py#L39-L54
Slicer/Slicer
ba9fadf332cb0303515b68d8d06a344c82e3e3e5
Modules/Scripted/DICOMPlugins/DICOMImageSequencePlugin.py
python
DICOMImageSequencePluginClass.examineFiles
(self,files)
return loadables
Returns a list of DICOMLoadable instances corresponding to ways of interpreting the files parameter.
Returns a list of DICOMLoadable instances corresponding to ways of interpreting the files parameter.
[ "Returns", "a", "list", "of", "DICOMLoadable", "instances", "corresponding", "to", "ways", "of", "interpreting", "the", "files", "parameter", "." ]
def examineFiles(self,files): """ Returns a list of DICOMLoadable instances corresponding to ways of interpreting the files parameter. """ self.detailedLogging = slicer.util.settingsValue('DICOM/detailedLogging', False, converter=slicer.util.toBool) supportedSOPClassUIDs = [ '1.2.840.100...
[ "def", "examineFiles", "(", "self", ",", "files", ")", ":", "self", ".", "detailedLogging", "=", "slicer", ".", "util", ".", "settingsValue", "(", "'DICOM/detailedLogging'", ",", "False", ",", "converter", "=", "slicer", ".", "util", ".", "toBool", ")", "s...
https://github.com/Slicer/Slicer/blob/ba9fadf332cb0303515b68d8d06a344c82e3e3e5/Modules/Scripted/DICOMPlugins/DICOMImageSequencePlugin.py#L60-L214
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/generic.py
python
NDFrame._check_label_or_level_ambiguity
(self, key, axis: int = 0)
Check whether `key` is ambiguous. By ambiguous, we mean that it matches both a level of the input `axis` and a label of the other axis. Parameters ---------- key : str or object Label or level name. axis : int, default 0 Axis that levels are asso...
Check whether `key` is ambiguous.
[ "Check", "whether", "key", "is", "ambiguous", "." ]
def _check_label_or_level_ambiguity(self, key, axis: int = 0) -> None: """ Check whether `key` is ambiguous. By ambiguous, we mean that it matches both a level of the input `axis` and a label of the other axis. Parameters ---------- key : str or object ...
[ "def", "_check_label_or_level_ambiguity", "(", "self", ",", "key", ",", "axis", ":", "int", "=", "0", ")", "->", "None", ":", "axis", "=", "self", ".", "_get_axis_number", "(", "axis", ")", "other_axes", "=", "(", "ax", "for", "ax", "in", "range", "(",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/generic.py#L1692-L1733
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/distributions/distribution.py
python
Distribution.cdf
(self, value)
Returns the cumulative density/mass function evaluated at `value`. Args: value (Tensor):
Returns the cumulative density/mass function evaluated at `value`.
[ "Returns", "the", "cumulative", "density", "/", "mass", "function", "evaluated", "at", "value", "." ]
def cdf(self, value): """ Returns the cumulative density/mass function evaluated at `value`. Args: value (Tensor): """ raise NotImplementedError
[ "def", "cdf", "(", "self", ",", "value", ")", ":", "raise", "NotImplementedError" ]
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributions/distribution.py#L172-L180
albarji/proxTV
69062fe54335976e83fe9269a09d795ae37470ba
prox_tv/__init__.py
python
tvp_2d
(x, w_col, w_row, p_col, p_row, n_threads=1, max_iters=0)
return y
r"""2D proximal operator for any :math:`\ell_p` norm. Specifically, this optimizes the following program: .. math:: \mathrm{min}_y \frac{1}{2}\|x-y\|^2 + w^r \|D_\mathrm{row}(y)\|_{p_1} + w^c \|D_\mathrm{col}(y) \|_{p_2}, where :math:`\mathrm D_{row}...
r"""2D proximal operator for any :math:`\ell_p` norm.
[ "r", "2D", "proximal", "operator", "for", "any", ":", "math", ":", "\\", "ell_p", "norm", "." ]
def tvp_2d(x, w_col, w_row, p_col, p_row, n_threads=1, max_iters=0): r"""2D proximal operator for any :math:`\ell_p` norm. Specifically, this optimizes the following program: .. math:: \mathrm{min}_y \frac{1}{2}\|x-y\|^2 + w^r \|D_\mathrm{row}(y)\|_{p_1} + ...
[ "def", "tvp_2d", "(", "x", ",", "w_col", ",", "w_row", ",", "p_col", ",", "p_row", ",", "n_threads", "=", "1", ",", "max_iters", "=", "0", ")", ":", "assert", "w_col", ">=", "0", "assert", "w_row", ">=", "0", "assert", "p_col", ">=", "1", "assert",...
https://github.com/albarji/proxTV/blob/69062fe54335976e83fe9269a09d795ae37470ba/prox_tv/__init__.py#L484-L530
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/v8/third_party/jinja2/environment.py
python
_environment_sanity_check
(environment)
return environment
Perform a sanity check on the environment.
Perform a sanity check on the environment.
[ "Perform", "a", "sanity", "check", "on", "the", "environment", "." ]
def _environment_sanity_check(environment): """Perform a sanity check on the environment.""" assert issubclass(environment.undefined, Undefined), 'undefined must ' \ 'be a subclass of undefined because filters depend on it.' assert environment.block_start_string != \ environment.variable_sta...
[ "def", "_environment_sanity_check", "(", "environment", ")", ":", "assert", "issubclass", "(", "environment", ".", "undefined", ",", "Undefined", ")", ",", "'undefined must '", "'be a subclass of undefined because filters depend on it.'", "assert", "environment", ".", "bloc...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/v8/third_party/jinja2/environment.py#L100-L110
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/cygprofile/cygprofile_utils.py
python
WarningCollector.WriteEnd
(self, message)
Once all warnings have been printed, use this to print the number of elided warnings.
Once all warnings have been printed, use this to print the number of elided warnings.
[ "Once", "all", "warnings", "have", "been", "printed", "use", "this", "to", "print", "the", "number", "of", "elided", "warnings", "." ]
def WriteEnd(self, message): """Once all warnings have been printed, use this to print the number of elided warnings.""" if self._warnings > self._max_warnings: logging.log(self._level, '%d more warnings for: %s' % ( self._warnings - self._max_warnings, message))
[ "def", "WriteEnd", "(", "self", ",", "message", ")", ":", "if", "self", ".", "_warnings", ">", "self", ".", "_max_warnings", ":", "logging", ".", "log", "(", "self", ".", "_level", ",", "'%d more warnings for: %s'", "%", "(", "self", ".", "_warnings", "-...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/cygprofile/cygprofile_utils.py#L26-L31
rootm0s/Protectors
5b3f4d11687a5955caf9c3af30666c4bfc2c19ab
OWASP-ZSC/module/readline_windows/pyreadline/rlmain.py
python
BaseReadline.get_begidx
(self)
return self.mode.begidx
Get the beginning index of the readline tab-completion scope.
Get the beginning index of the readline tab-completion scope.
[ "Get", "the", "beginning", "index", "of", "the", "readline", "tab", "-", "completion", "scope", "." ]
def get_begidx(self): '''Get the beginning index of the readline tab-completion scope.''' return self.mode.begidx
[ "def", "get_begidx", "(", "self", ")", ":", "return", "self", ".", "mode", ".", "begidx" ]
https://github.com/rootm0s/Protectors/blob/5b3f4d11687a5955caf9c3af30666c4bfc2c19ab/OWASP-ZSC/module/readline_windows/pyreadline/rlmain.py#L198-L200
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
algorithms/src/LocalizationAndMapping/registration_localization/fast_gicp/thirdparty/Eigen/debug/gdb/printers.py
python
EigenMatrixPrinter.__init__
(self, variety, val)
Extract all the necessary information
Extract all the necessary information
[ "Extract", "all", "the", "necessary", "information" ]
def __init__(self, variety, val): "Extract all the necessary information" # Save the variety (presumably "Matrix" or "Array") for later usage self.variety = variety # The gdb extension does not support value template arguments - need to extract them by hand type = val.type if type.code == gdb.TYPE_COD...
[ "def", "__init__", "(", "self", ",", "variety", ",", "val", ")", ":", "# Save the variety (presumably \"Matrix\" or \"Array\") for later usage", "self", ".", "variety", "=", "variety", "# The gdb extension does not support value template arguments - need to extract them by hand", "...
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/algorithms/src/LocalizationAndMapping/registration_localization/fast_gicp/thirdparty/Eigen/debug/gdb/printers.py#L74-L115
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pydecimal.py
python
_sqrt_nearest
(n, a)
return a
Closest integer to the square root of the positive integer n. a is an initial approximation to the square root. Any positive integer will do for a, but the closer a is to the square root of n the faster convergence will be.
Closest integer to the square root of the positive integer n. a is an initial approximation to the square root. Any positive integer will do for a, but the closer a is to the square root of n the faster convergence will be.
[ "Closest", "integer", "to", "the", "square", "root", "of", "the", "positive", "integer", "n", ".", "a", "is", "an", "initial", "approximation", "to", "the", "square", "root", ".", "Any", "positive", "integer", "will", "do", "for", "a", "but", "the", "clo...
def _sqrt_nearest(n, a): """Closest integer to the square root of the positive integer n. a is an initial approximation to the square root. Any positive integer will do for a, but the closer a is to the square root of n the faster convergence will be. """ if n <= 0 or a <= 0: raise Va...
[ "def", "_sqrt_nearest", "(", "n", ",", "a", ")", ":", "if", "n", "<=", "0", "or", "a", "<=", "0", ":", "raise", "ValueError", "(", "\"Both arguments to _sqrt_nearest should be positive.\"", ")", "b", "=", "0", "while", "a", "!=", "b", ":", "b", ",", "a...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pydecimal.py#L5695-L5708
kushview/Element
1cc16380caa2ab79461246ba758b9de1f46db2a5
waflib/ConfigSet.py
python
ConfigSet.get_merged_dict
(self)
return merged_table
Computes the merged dictionary from the fusion of self and all its parent :rtype: a ConfigSet object
Computes the merged dictionary from the fusion of self and all its parent
[ "Computes", "the", "merged", "dictionary", "from", "the", "fusion", "of", "self", "and", "all", "its", "parent" ]
def get_merged_dict(self): """ Computes the merged dictionary from the fusion of self and all its parent :rtype: a ConfigSet object """ table_list = [] env = self while 1: table_list.insert(0, env.table) try: env = env.parent except AttributeError: break merged_table = {} for table i...
[ "def", "get_merged_dict", "(", "self", ")", ":", "table_list", "=", "[", "]", "env", "=", "self", "while", "1", ":", "table_list", ".", "insert", "(", "0", ",", "env", ".", "table", ")", "try", ":", "env", "=", "env", ".", "parent", "except", "Attr...
https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/ConfigSet.py#L261-L278
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/pubsub/core/kwargs/topicmgrimpl.py
python
getRootTopicSpec
()
return argsDocs, reqdArgs
If using kwargs protocol, then root topic takes no args.
If using kwargs protocol, then root topic takes no args.
[ "If", "using", "kwargs", "protocol", "then", "root", "topic", "takes", "no", "args", "." ]
def getRootTopicSpec(): """If using kwargs protocol, then root topic takes no args.""" argsDocs = {} reqdArgs = () return argsDocs, reqdArgs
[ "def", "getRootTopicSpec", "(", ")", ":", "argsDocs", "=", "{", "}", "reqdArgs", "=", "(", ")", "return", "argsDocs", ",", "reqdArgs" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pubsub/core/kwargs/topicmgrimpl.py#L8-L12
macchina-io/macchina.io
ef24ba0e18379c3dd48fb84e6dbf991101cb8db0
platform/JS/V8/tools/gyp/pylib/gyp/generator/msvs.py
python
_FixPaths
(paths)
return [_FixPath(i) for i in paths]
Fix each of the paths of the list.
Fix each of the paths of the list.
[ "Fix", "each", "of", "the", "paths", "of", "the", "list", "." ]
def _FixPaths(paths): """Fix each of the paths of the list.""" return [_FixPath(i) for i in paths]
[ "def", "_FixPaths", "(", "paths", ")", ":", "return", "[", "_FixPath", "(", "i", ")", "for", "i", "in", "paths", "]" ]
https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/tools/gyp/pylib/gyp/generator/msvs.py#L177-L179
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/stc.py
python
StyledTextCtrl.TextWidth
(*args, **kwargs)
return _stc.StyledTextCtrl_TextWidth(*args, **kwargs)
TextWidth(self, int style, String text) -> int Measure the pixel width of some text in a particular style. NUL terminated text argument. Does not handle tab or control characters.
TextWidth(self, int style, String text) -> int
[ "TextWidth", "(", "self", "int", "style", "String", "text", ")", "-", ">", "int" ]
def TextWidth(*args, **kwargs): """ TextWidth(self, int style, String text) -> int Measure the pixel width of some text in a particular style. NUL terminated text argument. Does not handle tab or control characters. """ return _stc.StyledTextCtrl_TextWidth(*args,...
[ "def", "TextWidth", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_TextWidth", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L4199-L4207
LLNL/lbann
26083e6c86050302ce33148aea70f62e61cacb92
python/lbann/launcher/batch_script.py
python
BatchScript.write
(self, overwrite=False)
Write script to file. The working directory is created if needed. Args: overwrite (bool): Whether to overwrite script file if it already exists (default: false).
Write script to file.
[ "Write", "script", "to", "file", "." ]
def write(self, overwrite=False): """Write script to file. The working directory is created if needed. Args: overwrite (bool): Whether to overwrite script file if it already exists (default: false). """ # Create directories if needed os.mak...
[ "def", "write", "(", "self", ",", "overwrite", "=", "False", ")", ":", "# Create directories if needed", "os", ".", "makedirs", "(", "self", ".", "work_dir", ",", "exist_ok", "=", "True", ")", "os", ".", "makedirs", "(", "os", ".", "path", ".", "dirname"...
https://github.com/LLNL/lbann/blob/26083e6c86050302ce33148aea70f62e61cacb92/python/lbann/launcher/batch_script.py#L108-L138
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/sets.py
python
Set.discard
(self, element)
Remove an element from a set if it is a member. If the element is not a member, do nothing.
Remove an element from a set if it is a member.
[ "Remove", "an", "element", "from", "a", "set", "if", "it", "is", "a", "member", "." ]
def discard(self, element): """Remove an element from a set if it is a member. If the element is not a member, do nothing. """ try: self.remove(element) except KeyError: pass
[ "def", "discard", "(", "self", ",", "element", ")", ":", "try", ":", "self", ".", "remove", "(", "element", ")", "except", "KeyError", ":", "pass" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/sets.py#L525-L533
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/polynomial/polynomial.py
python
polydiv
(c1, c2)
Divide one polynomial by another. Returns the quotient-with-remainder of two polynomials `c1` / `c2`. The arguments are sequences of coefficients, from lowest order term to highest, e.g., [1,2,3] represents ``1 + 2*x + 3*x**2``. Parameters ---------- c1, c2 : array_like 1-D arrays of p...
Divide one polynomial by another.
[ "Divide", "one", "polynomial", "by", "another", "." ]
def polydiv(c1, c2): """ Divide one polynomial by another. Returns the quotient-with-remainder of two polynomials `c1` / `c2`. The arguments are sequences of coefficients, from lowest order term to highest, e.g., [1,2,3] represents ``1 + 2*x + 3*x**2``. Parameters ---------- c1, c2 : a...
[ "def", "polydiv", "(", "c1", ",", "c2", ")", ":", "# c1, c2 are trimmed copies", "[", "c1", ",", "c2", "]", "=", "pu", ".", "as_series", "(", "[", "c1", ",", "c2", "]", ")", "if", "c2", "[", "-", "1", "]", "==", "0", ":", "raise", "ZeroDivisionEr...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/polynomial/polynomial.py#L367-L421
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/msgpack/__init__.py
python
pack
(o, stream, **kwargs)
Pack object `o` and write it to `stream` See :class:`Packer` for options.
Pack object `o` and write it to `stream`
[ "Pack", "object", "o", "and", "write", "it", "to", "stream" ]
def pack(o, stream, **kwargs): """ Pack object `o` and write it to `stream` See :class:`Packer` for options. """ packer = Packer(**kwargs) stream.write(packer.pack(o))
[ "def", "pack", "(", "o", ",", "stream", ",", "*", "*", "kwargs", ")", ":", "packer", "=", "Packer", "(", "*", "*", "kwargs", ")", "stream", ".", "write", "(", "packer", ".", "pack", "(", "o", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/msgpack/__init__.py#L19-L26
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
contrib/gizmos/osx_cocoa/gizmos.py
python
DynamicSashWindow.GetVScrollBar
(*args, **kwargs)
return _gizmos.DynamicSashWindow_GetVScrollBar(*args, **kwargs)
GetVScrollBar(self, Window child) -> ScrollBar
GetVScrollBar(self, Window child) -> ScrollBar
[ "GetVScrollBar", "(", "self", "Window", "child", ")", "-", ">", "ScrollBar" ]
def GetVScrollBar(*args, **kwargs): """GetVScrollBar(self, Window child) -> ScrollBar""" return _gizmos.DynamicSashWindow_GetVScrollBar(*args, **kwargs)
[ "def", "GetVScrollBar", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gizmos", ".", "DynamicSashWindow_GetVScrollBar", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/osx_cocoa/gizmos.py#L115-L117
ArduPilot/ardupilot
6e684b3496122b8158ac412b609d00004b7ac306
Tools/scripts/apj_tool.py
python
embedded_defaults.find
(self)
find defaults in firmware
find defaults in firmware
[ "find", "defaults", "in", "firmware" ]
def find(self): '''find defaults in firmware''' # these are the magic headers from AP_Param.cpp magic_str = "PARMDEF".encode('ascii') param_magic = [ 0x55, 0x37, 0xf4, 0xa0, 0x38, 0x5d, 0x48, 0x5b ] def u_ord(c): return ord(c) if sys.version_info.major < 3 else c ...
[ "def", "find", "(", "self", ")", ":", "# these are the magic headers from AP_Param.cpp", "magic_str", "=", "\"PARMDEF\"", ".", "encode", "(", "'ascii'", ")", "param_magic", "=", "[", "0x55", ",", "0x37", ",", "0xf4", ",", "0xa0", ",", "0x38", ",", "0x5d", ",...
https://github.com/ArduPilot/ardupilot/blob/6e684b3496122b8158ac412b609d00004b7ac306/Tools/scripts/apj_tool.py#L105-L128
bakwc/JamSpell
ab5ade201df3e52d99c3a1d38ec422cf4ded1795
evaluate/context_spell_prototype.py
python
edits2
(word)
return (e2 for e1 in edits1(word) for e2 in edits1(e1))
All edits that are two edits away from `word`.
All edits that are two edits away from `word`.
[ "All", "edits", "that", "are", "two", "edits", "away", "from", "word", "." ]
def edits2(word): "All edits that are two edits away from `word`." return (e2 for e1 in edits1(word) for e2 in edits1(e1))
[ "def", "edits2", "(", "word", ")", ":", "return", "(", "e2", "for", "e1", "in", "edits1", "(", "word", ")", "for", "e2", "in", "edits1", "(", "e1", ")", ")" ]
https://github.com/bakwc/JamSpell/blob/ab5ade201df3e52d99c3a1d38ec422cf4ded1795/evaluate/context_spell_prototype.py#L64-L66
MythTV/mythtv
d282a209cb8be85d036f85a62a8ec971b67d45f4
mythtv/programs/scripts/internetcontent/nv_python_libs/common/common_api.py
python
Common.initializeMythDB
(self)
Import the MythTV database bindings return nothing
Import the MythTV database bindings return nothing
[ "Import", "the", "MythTV", "database", "bindings", "return", "nothing" ]
def initializeMythDB(self): ''' Import the MythTV database bindings return nothing ''' try: from MythTV import MythDB, MythLog, MythError try: '''Create an instance of each: MythDB ''' MythLog._setlevel('none') # Som...
[ "def", "initializeMythDB", "(", "self", ")", ":", "try", ":", "from", "MythTV", "import", "MythDB", ",", "MythLog", ",", "MythError", "try", ":", "'''Create an instance of each: MythDB\n '''", "MythLog", ".", "_setlevel", "(", "'none'", ")", "# Some n...
https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/internetcontent/nv_python_libs/common/common_api.py#L925-L949
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/setuptools/sandbox.py
python
override_temp
(replacement)
Monkey-patch tempfile.tempdir with replacement, ensuring it exists
Monkey-patch tempfile.tempdir with replacement, ensuring it exists
[ "Monkey", "-", "patch", "tempfile", ".", "tempdir", "with", "replacement", "ensuring", "it", "exists" ]
def override_temp(replacement): """ Monkey-patch tempfile.tempdir with replacement, ensuring it exists """ os.makedirs(replacement, exist_ok=True) saved = tempfile.tempdir tempfile.tempdir = replacement try: yield finally: tempfile.tempdir = saved
[ "def", "override_temp", "(", "replacement", ")", ":", "os", ".", "makedirs", "(", "replacement", ",", "exist_ok", "=", "True", ")", "saved", "=", "tempfile", ".", "tempdir", "tempfile", ".", "tempdir", "=", "replacement", "try", ":", "yield", "finally", ":...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/sandbox.py#L70-L83
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
contrib/gizmos/osx_cocoa/gizmos.py
python
TreeListCtrl.GetFirstExpandedItem
(*args, **kwargs)
return _gizmos.TreeListCtrl_GetFirstExpandedItem(*args, **kwargs)
GetFirstExpandedItem(self) -> TreeItemId
GetFirstExpandedItem(self) -> TreeItemId
[ "GetFirstExpandedItem", "(", "self", ")", "-", ">", "TreeItemId" ]
def GetFirstExpandedItem(*args, **kwargs): """GetFirstExpandedItem(self) -> TreeItemId""" return _gizmos.TreeListCtrl_GetFirstExpandedItem(*args, **kwargs)
[ "def", "GetFirstExpandedItem", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gizmos", ".", "TreeListCtrl_GetFirstExpandedItem", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/osx_cocoa/gizmos.py#L802-L804
wy1iu/LargeMargin_Softmax_Loss
c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec
python/caffe/pycaffe.py
python
_Net_params
(self)
return self._params_dict
An OrderedDict (bottom to top, i.e., input to output) of network parameters indexed by name; each is a list of multiple blobs (e.g., weights and biases)
An OrderedDict (bottom to top, i.e., input to output) of network parameters indexed by name; each is a list of multiple blobs (e.g., weights and biases)
[ "An", "OrderedDict", "(", "bottom", "to", "top", "i", ".", "e", ".", "input", "to", "output", ")", "of", "network", "parameters", "indexed", "by", "name", ";", "each", "is", "a", "list", "of", "multiple", "blobs", "(", "e", ".", "g", ".", "weights", ...
def _Net_params(self): """ An OrderedDict (bottom to top, i.e., input to output) of network parameters indexed by name; each is a list of multiple blobs (e.g., weights and biases) """ if not hasattr(self, '_params_dict'): self._params_dict = OrderedDict([(name, lr.blobs) ...
[ "def", "_Net_params", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'_params_dict'", ")", ":", "self", ".", "_params_dict", "=", "OrderedDict", "(", "[", "(", "name", ",", "lr", ".", "blobs", ")", "for", "name", ",", "lr", "in", ...
https://github.com/wy1iu/LargeMargin_Softmax_Loss/blob/c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec/python/caffe/pycaffe.py#L48-L59
tensorflow/deepmath
b5b721f54de1d5d6a02d78f5da5995237f9995f9
deepmath/guidance/clause_loom.py
python
weave_fast_clauses
(clauses, embed, apply_, not_, or_, and_=None, shuffle=True, seed=None)
return tuple(clause_loom.output_tensor(ts) for ts in or_.output_type_shapes)
Weave serialized FastClauses using TensorLoom. Computes embeddings for a list of FastClause protos, which can either represent a single negated conjecture (if and_ is specified) or a batch of clauses (if and_ is None). In the description of the LoomOps below, vocab_id must be VOCAB_ID. Args: clauses: 1...
Weave serialized FastClauses using TensorLoom.
[ "Weave", "serialized", "FastClauses", "using", "TensorLoom", "." ]
def weave_fast_clauses(clauses, embed, apply_, not_, or_, and_=None, shuffle=True, seed=None): """Weave serialized FastClauses using TensorLoom. Computes ...
[ "def", "weave_fast_clauses", "(", "clauses", ",", "embed", ",", "apply_", ",", "not_", ",", "or_", ",", "and_", "=", "None", ",", "shuffle", "=", "True", ",", "seed", "=", "None", ")", ":", "def", "weaver_op", "(", "*", "*", "kwds", ")", ":", "seed...
https://github.com/tensorflow/deepmath/blob/b5b721f54de1d5d6a02d78f5da5995237f9995f9/deepmath/guidance/clause_loom.py#L84-L131
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/sparse/linalg/_norm.py
python
norm
(x, ord=None, axis=None)
Norm of a sparse matrix This function is able to return one of seven different matrix norms, depending on the value of the ``ord`` parameter. Parameters ---------- x : a sparse matrix Input sparse matrix. ord : {non-zero int, inf, -inf, 'fro'}, optional Order of the norm (see t...
Norm of a sparse matrix
[ "Norm", "of", "a", "sparse", "matrix" ]
def norm(x, ord=None, axis=None): """ Norm of a sparse matrix This function is able to return one of seven different matrix norms, depending on the value of the ``ord`` parameter. Parameters ---------- x : a sparse matrix Input sparse matrix. ord : {non-zero int, inf, -inf, 'fr...
[ "def", "norm", "(", "x", ",", "ord", "=", "None", ",", "axis", "=", "None", ")", ":", "if", "not", "issparse", "(", "x", ")", ":", "raise", "TypeError", "(", "\"input is not sparse. use numpy.linalg.norm\"", ")", "# Check the default case first and handle it immed...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/sparse/linalg/_norm.py#L22-L184
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_windows.py
python
FontData.SetAllowSymbols
(*args, **kwargs)
return _windows_.FontData_SetAllowSymbols(*args, **kwargs)
SetAllowSymbols(self, bool allowSymbols) Under MS Windows, determines whether symbol fonts can be selected. Has no effect on other platforms. The default value is true.
SetAllowSymbols(self, bool allowSymbols)
[ "SetAllowSymbols", "(", "self", "bool", "allowSymbols", ")" ]
def SetAllowSymbols(*args, **kwargs): """ SetAllowSymbols(self, bool allowSymbols) Under MS Windows, determines whether symbol fonts can be selected. Has no effect on other platforms. The default value is true. """ return _windows_.FontData_SetAllowSymbols(*args, **kwar...
[ "def", "SetAllowSymbols", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "FontData_SetAllowSymbols", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L3519-L3526
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/idl/idl/syntax.py
python
Import.__init__
(self, file_name, line, column)
Construct an Imports section.
Construct an Imports section.
[ "Construct", "an", "Imports", "section", "." ]
def __init__(self, file_name, line, column): # type: (str, int, int) -> None """Construct an Imports section.""" self.imports = [] # type: List[str] # These are not part of the IDL syntax but are produced by the parser. # List of imports with structs. self.resolved_impo...
[ "def", "__init__", "(", "self", ",", "file_name", ",", "line", ",", "column", ")", ":", "# type: (str, int, int) -> None", "self", ".", "imports", "=", "[", "]", "# type: List[str]", "# These are not part of the IDL syntax but are produced by the parser.", "# List of import...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/syntax.py#L338-L349
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/distutils/command/config.py
python
config.try_run
(self, body, headers=None, include_dirs=None, libraries=None, library_dirs=None, lang="c")
return ok
Try to compile, link to an executable, and run a program built from 'body' and 'headers'. Return true on success, false otherwise.
Try to compile, link to an executable, and run a program built from 'body' and 'headers'. Return true on success, false otherwise.
[ "Try", "to", "compile", "link", "to", "an", "executable", "and", "run", "a", "program", "built", "from", "body", "and", "headers", ".", "Return", "true", "on", "success", "false", "otherwise", "." ]
def try_run(self, body, headers=None, include_dirs=None, libraries=None, library_dirs=None, lang="c"): """Try to compile, link to an executable, and run a program built from 'body' and 'headers'. Return true on success, false otherwise. """ from distutils.ccompil...
[ "def", "try_run", "(", "self", ",", "body", ",", "headers", "=", "None", ",", "include_dirs", "=", "None", ",", "libraries", "=", "None", ",", "library_dirs", "=", "None", ",", "lang", "=", "\"c\"", ")", ":", "from", "distutils", ".", "ccompiler", "imp...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/distutils/command/config.py#L255-L273
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/ftplib.py
python
FTP.pwd
(self)
return parse257(resp)
Return current working directory.
Return current working directory.
[ "Return", "current", "working", "directory", "." ]
def pwd(self): '''Return current working directory.''' resp = self.sendcmd('PWD') return parse257(resp)
[ "def", "pwd", "(", "self", ")", ":", "resp", "=", "self", ".", "sendcmd", "(", "'PWD'", ")", "return", "parse257", "(", "resp", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/ftplib.py#L575-L578
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/server/wsgi/serve/snippets/util/sparse_tree.py
python
_GeneralRemoveAbstractPath
(parts, store)
Remove path parts from store, when store's top-layer is not repeated. I believe that removing a whole subtree is just an artifact of programmer laziness, not part of its design. Used with user-accessible 'template' stuff. Does no 'required'ness checking; use with care. Returns true if deletion deleted /som...
Remove path parts from store, when store's top-layer is not repeated.
[ "Remove", "path", "parts", "from", "store", "when", "store", "s", "top", "-", "layer", "is", "not", "repeated", "." ]
def _GeneralRemoveAbstractPath(parts, store): """Remove path parts from store, when store's top-layer is not repeated. I believe that removing a whole subtree is just an artifact of programmer laziness, not part of its design. Used with user-accessible 'template' stuff. Does no 'required'ness checking; use ...
[ "def", "_GeneralRemoveAbstractPath", "(", "parts", ",", "store", ")", ":", "# down to parent + child", "assert", "isinstance", "(", "store", ",", "dict", ")", "key", ",", "rest", "=", "parts", "[", "0", "]", ",", "parts", "[", "1", ":", "]", "if", "not",...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/serve/snippets/util/sparse_tree.py#L167-L217
google/skia
82d65d0487bd72f5f7332d002429ec2dc61d2463
tools/copyright/fileparser.py
python
CParser.CreateCopyrightBlock
(self, year, holder)
return self.COPYRIGHT_BLOCK_FORMAT % (year, holder)
Returns a copyright block suitable for this language, with the given attributes. @param year year in which to hold copyright (defaults to DEFAULT_YEAR) @param holder holder of copyright (defaults to DEFAULT_HOLDER)
Returns a copyright block suitable for this language, with the given attributes.
[ "Returns", "a", "copyright", "block", "suitable", "for", "this", "language", "with", "the", "given", "attributes", "." ]
def CreateCopyrightBlock(self, year, holder): """Returns a copyright block suitable for this language, with the given attributes. @param year year in which to hold copyright (defaults to DEFAULT_YEAR) @param holder holder of copyright (defaults to DEFAULT_HOLDER) """ if ...
[ "def", "CreateCopyrightBlock", "(", "self", ",", "year", ",", "holder", ")", ":", "if", "not", "year", ":", "year", "=", "self", ".", "DEFAULT_YEAR", "if", "not", "holder", ":", "holder", "=", "self", ".", "DEFAULT_HOLDER", "return", "self", ".", "COPYRI...
https://github.com/google/skia/blob/82d65d0487bd72f5f7332d002429ec2dc61d2463/tools/copyright/fileparser.py#L81-L92
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/sparse/spfuncs.py
python
count_blocks
(A,blocksize)
For a given blocksize=(r,c) count the number of occupied blocks in a sparse matrix A
For a given blocksize=(r,c) count the number of occupied blocks in a sparse matrix A
[ "For", "a", "given", "blocksize", "=", "(", "r", "c", ")", "count", "the", "number", "of", "occupied", "blocks", "in", "a", "sparse", "matrix", "A" ]
def count_blocks(A,blocksize): """For a given blocksize=(r,c) count the number of occupied blocks in a sparse matrix A """ r,c = blocksize if r < 1 or c < 1: raise ValueError('r and c must be positive') if isspmatrix_csr(A): M,N = A.shape return csr_count_blocks(M,N,r,c,...
[ "def", "count_blocks", "(", "A", ",", "blocksize", ")", ":", "r", ",", "c", "=", "blocksize", "if", "r", "<", "1", "or", "c", "<", "1", ":", "raise", "ValueError", "(", "'r and c must be positive'", ")", "if", "isspmatrix_csr", "(", "A", ")", ":", "M...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/sparse/spfuncs.py#L86-L100
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/mailbox.py
python
Mailbox.popitem
(self)
Delete an arbitrary (key, message) pair and return it.
Delete an arbitrary (key, message) pair and return it.
[ "Delete", "an", "arbitrary", "(", "key", "message", ")", "pair", "and", "return", "it", "." ]
def popitem(self): """Delete an arbitrary (key, message) pair and return it.""" for key in self.iterkeys(): return (key, self.pop(key)) # This is only run once. else: raise KeyError('No messages in mailbox')
[ "def", "popitem", "(", "self", ")", ":", "for", "key", "in", "self", ".", "iterkeys", "(", ")", ":", "return", "(", "key", ",", "self", ".", "pop", "(", "key", ")", ")", "# This is only run once.", "else", ":", "raise", "KeyError", "(", "'No messages i...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/mailbox.py#L156-L161