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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/ndarray/utils.py | python | load_frombuffer | (buf) | Loads an array dictionary or list from a buffer
See more details in ``save``.
Parameters
----------
buf : str
Buffer containing contents of a file as a string or bytes.
Returns
-------
list of NDArray, RowSparseNDArray or CSRNDArray, or \
dict of str to NDArray, RowSparseNDArr... | Loads an array dictionary or list from a buffer | [
"Loads",
"an",
"array",
"dictionary",
"or",
"list",
"from",
"a",
"buffer"
] | def load_frombuffer(buf):
"""Loads an array dictionary or list from a buffer
See more details in ``save``.
Parameters
----------
buf : str
Buffer containing contents of a file as a string or bytes.
Returns
-------
list of NDArray, RowSparseNDArray or CSRNDArray, or \
dict ... | [
"def",
"load_frombuffer",
"(",
"buf",
")",
":",
"if",
"not",
"isinstance",
"(",
"buf",
",",
"string_types",
"+",
"tuple",
"(",
"[",
"bytes",
"]",
")",
")",
":",
"raise",
"TypeError",
"(",
"'buf required to be a string or bytes'",
")",
"out_size",
"=",
"mx_ui... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/ndarray/utils.py#L185-L219 | ||
networkit/networkit | 695b7a786a894a303fa8587597d5ef916e797729 | networkit/profiling/plot.py | python | Theme.get | (self) | return (self.__style, self.__color) | return style and color | return style and color | [
"return",
"style",
"and",
"color"
] | def get(self):
""" return style and color """
return (self.__style, self.__color) | [
"def",
"get",
"(",
"self",
")",
":",
"return",
"(",
"self",
".",
"__style",
",",
"self",
".",
"__color",
")"
] | https://github.com/networkit/networkit/blob/695b7a786a894a303fa8587597d5ef916e797729/networkit/profiling/plot.py#L81-L83 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/jinja2/runtime.py | python | LoopContextBase.changed | (self, *value) | return False | Checks whether the value has changed since the last call. | Checks whether the value has changed since the last call. | [
"Checks",
"whether",
"the",
"value",
"has",
"changed",
"since",
"the",
"last",
"call",
"."
] | def changed(self, *value):
"""Checks whether the value has changed since the last call."""
if self._last_checked_value != value:
self._last_checked_value = value
return True
return False | [
"def",
"changed",
"(",
"self",
",",
"*",
"value",
")",
":",
"if",
"self",
".",
"_last_checked_value",
"!=",
"value",
":",
"self",
".",
"_last_checked_value",
"=",
"value",
"return",
"True",
"return",
"False"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/jinja2/runtime.py#L372-L377 | |
Cisco-Talos/moflow | ed71dfb0540d9e0d7a4c72f0881b58958d573728 | BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/mox.py | python | ContainsKeyValue.__init__ | (self, key, value) | Initialize.
Args:
# key: a key in a dict
# value: the corresponding value | Initialize. | [
"Initialize",
"."
] | def __init__(self, key, value):
"""Initialize.
Args:
# key: a key in a dict
# value: the corresponding value
"""
self._key = key
self._value = value | [
"def",
"__init__",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"self",
".",
"_key",
"=",
"key",
"self",
".",
"_value",
"=",
"value"
] | https://github.com/Cisco-Talos/moflow/blob/ed71dfb0540d9e0d7a4c72f0881b58958d573728/BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/mox.py#L978-L987 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings.BuildCygwinBashCommandLine | (self, args, path_to_base) | return cmd | Build a command line that runs args via cygwin bash. We assume that all
incoming paths are in Windows normpath'd form, so they need to be
converted to posix style for the part of the command line that's passed to
bash. We also have to do some Visual Studio macro emulation here because
various rules use ... | Build a command line that runs args via cygwin bash. We assume that all
incoming paths are in Windows normpath'd form, so they need to be
converted to posix style for the part of the command line that's passed to
bash. We also have to do some Visual Studio macro emulation here because
various rules use ... | [
"Build",
"a",
"command",
"line",
"that",
"runs",
"args",
"via",
"cygwin",
"bash",
".",
"We",
"assume",
"that",
"all",
"incoming",
"paths",
"are",
"in",
"Windows",
"normpath",
"d",
"form",
"so",
"they",
"need",
"to",
"be",
"converted",
"to",
"posix",
"sty... | def BuildCygwinBashCommandLine(self, args, path_to_base):
"""Build a command line that runs args via cygwin bash. We assume that all
incoming paths are in Windows normpath'd form, so they need to be
converted to posix style for the part of the command line that's passed to
bash. We also have to do some ... | [
"def",
"BuildCygwinBashCommandLine",
"(",
"self",
",",
"args",
",",
"path_to_base",
")",
":",
"cygwin_dir",
"=",
"os",
".",
"path",
".",
"normpath",
"(",
"os",
".",
"path",
".",
"join",
"(",
"path_to_base",
",",
"self",
".",
"msvs_cygwin_dirs",
"[",
"0",
... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/msvs_emulation.py#L814-L832 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/grit/grit/gather/tr_html.py | python | TrHtml.SubstituteMessages | (self, substituter) | Applies substitutions to all messages in the tree.
Goes through the skeleton and finds all MessageCliques.
Args:
substituter: a grit.util.Substituter object. | Applies substitutions to all messages in the tree. | [
"Applies",
"substitutions",
"to",
"all",
"messages",
"in",
"the",
"tree",
"."
] | def SubstituteMessages(self, substituter):
'''Applies substitutions to all messages in the tree.
Goes through the skeleton and finds all MessageCliques.
Args:
substituter: a grit.util.Substituter object.
'''
new_skel = []
for chunk in self.skeleton_:
if isinstance(chunk, clique.Mes... | [
"def",
"SubstituteMessages",
"(",
"self",
",",
"substituter",
")",
":",
"new_skel",
"=",
"[",
"]",
"for",
"chunk",
"in",
"self",
".",
"skeleton_",
":",
"if",
"isinstance",
"(",
"chunk",
",",
"clique",
".",
"MessageClique",
")",
":",
"old_message",
"=",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/gather/tr_html.py#L727-L744 | ||
google/shaka-packager | e1b0c7c45431327fd3ce193514a5407d07b39b22 | packager/third_party/protobuf/python/google/protobuf/message.py | python | Message.MergeFromString | (self, serialized) | Merges serialized protocol buffer data into this message.
When we find a field in |serialized| that is already present
in this message:
- If it's a "repeated" field, we append to the end of our list.
- Else, if it's a scalar, we overwrite our field.
- Else, (it's a nonrepeated composite), we ... | Merges serialized protocol buffer data into this message. | [
"Merges",
"serialized",
"protocol",
"buffer",
"data",
"into",
"this",
"message",
"."
] | def MergeFromString(self, serialized):
"""Merges serialized protocol buffer data into this message.
When we find a field in |serialized| that is already present
in this message:
- If it's a "repeated" field, we append to the end of our list.
- Else, if it's a scalar, we overwrite our field.
... | [
"def",
"MergeFromString",
"(",
"self",
",",
"serialized",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/google/protobuf/message.py#L148-L176 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | AboutDialogInfo.HasIcon | (*args, **kwargs) | return _misc_.AboutDialogInfo_HasIcon(*args, **kwargs) | HasIcon(self) -> bool
Returns ``True`` if the icon property has been set. | HasIcon(self) -> bool | [
"HasIcon",
"(",
"self",
")",
"-",
">",
"bool"
] | def HasIcon(*args, **kwargs):
"""
HasIcon(self) -> bool
Returns ``True`` if the icon property has been set.
"""
return _misc_.AboutDialogInfo_HasIcon(*args, **kwargs) | [
"def",
"HasIcon",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"AboutDialogInfo_HasIcon",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L6746-L6752 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/botocore/parsers.py | python | ResponseParser.parse | (self, response, shape) | return parsed | Parse the HTTP response given a shape.
:param response: The HTTP response dictionary. This is a dictionary
that represents the HTTP request. The dictionary must have the
following keys, ``body``, ``headers``, and ``status_code``.
:param shape: The model shape describing the e... | Parse the HTTP response given a shape. | [
"Parse",
"the",
"HTTP",
"response",
"given",
"a",
"shape",
"."
] | def parse(self, response, shape):
"""Parse the HTTP response given a shape.
:param response: The HTTP response dictionary. This is a dictionary
that represents the HTTP request. The dictionary must have the
following keys, ``body``, ``headers``, and ``status_code``.
:... | [
"def",
"parse",
"(",
"self",
",",
"response",
",",
"shape",
")",
":",
"LOG",
".",
"debug",
"(",
"'Response headers: %s'",
",",
"response",
"[",
"'headers'",
"]",
")",
"LOG",
".",
"debug",
"(",
"'Response body:\\n%s'",
",",
"response",
"[",
"'body'",
"]",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/parsers.py#L187-L221 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/gradients.py | python | _maybe_colocate_with | (op, colocate_gradients_with_ops) | Context to colocate with `op` if `colocate_gradients_with_ops`. | Context to colocate with `op` if `colocate_gradients_with_ops`. | [
"Context",
"to",
"colocate",
"with",
"op",
"if",
"colocate_gradients_with_ops",
"."
] | def _maybe_colocate_with(op, colocate_gradients_with_ops):
"""Context to colocate with `op` if `colocate_gradients_with_ops`."""
if colocate_gradients_with_ops:
with ops.colocate_with(op):
yield
else:
yield | [
"def",
"_maybe_colocate_with",
"(",
"op",
",",
"colocate_gradients_with_ops",
")",
":",
"if",
"colocate_gradients_with_ops",
":",
"with",
"ops",
".",
"colocate_with",
"(",
"op",
")",
":",
"yield",
"else",
":",
"yield"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/gradients.py#L298-L304 | ||
TGAC/KAT | e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216 | deps/jellyfish-2.2.0/swig/python/jellyfish.py | python | HashSet.get | (self, *args) | return _jellyfish.HashSet_get(self, *args) | Read a Jellyfish database sequentially | Read a Jellyfish database sequentially | [
"Read",
"a",
"Jellyfish",
"database",
"sequentially"
] | def get(self, *args):
"""Read a Jellyfish database sequentially"""
return _jellyfish.HashSet_get(self, *args) | [
"def",
"get",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_jellyfish",
".",
"HashSet_get",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/TGAC/KAT/blob/e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216/deps/jellyfish-2.2.0/swig/python/jellyfish.py#L330-L332 | |
jubatus/jubatus | 1251ce551bac980488a6313728e72b3fe0b79a9f | tools/codestyle/cpplint/cpplint.py | python | GetLineWidth | (line) | Determines the width of the line in column positions.
Args:
line: A string, which may be a Unicode string.
Returns:
The width of the line in column positions, accounting for Unicode
combining characters and wide characters. | Determines the width of the line in column positions. | [
"Determines",
"the",
"width",
"of",
"the",
"line",
"in",
"column",
"positions",
"."
] | def GetLineWidth(line):
"""Determines the width of the line in column positions.
Args:
line: A string, which may be a Unicode string.
Returns:
The width of the line in column positions, accounting for Unicode
combining characters and wide characters.
"""
if isinstance(line, unicode):
width =... | [
"def",
"GetLineWidth",
"(",
"line",
")",
":",
"if",
"isinstance",
"(",
"line",
",",
"unicode",
")",
":",
"width",
"=",
"0",
"for",
"uc",
"in",
"unicodedata",
".",
"normalize",
"(",
"'NFC'",
",",
"line",
")",
":",
"if",
"unicodedata",
".",
"east_asian_w... | https://github.com/jubatus/jubatus/blob/1251ce551bac980488a6313728e72b3fe0b79a9f/tools/codestyle/cpplint/cpplint.py#L2150-L2169 | ||
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Taskmaster.py | python | Taskmaster.cleanup | (self) | Check for dependency cycles. | Check for dependency cycles. | [
"Check",
"for",
"dependency",
"cycles",
"."
] | def cleanup(self):
"""
Check for dependency cycles.
"""
if not self.pending_children:
return
nclist = [(n, find_cycle([n], set())) for n in self.pending_children]
genuine_cycles = [
node for node,cycle in nclist
if cycle or n... | [
"def",
"cleanup",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"pending_children",
":",
"return",
"nclist",
"=",
"[",
"(",
"n",
",",
"find_cycle",
"(",
"[",
"n",
"]",
",",
"set",
"(",
")",
")",
")",
"for",
"n",
"in",
"self",
".",
"pending_chi... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Taskmaster.py#L1016-L1043 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/gluon/parameter.py | python | Parameter.dtype | (self) | return self._dtype | The type of the parameter.
Setting the dtype value is equivalent to casting the value of the parameter | The type of the parameter. | [
"The",
"type",
"of",
"the",
"parameter",
"."
] | def dtype(self):
"""The type of the parameter.
Setting the dtype value is equivalent to casting the value of the parameter
"""
return self._dtype | [
"def",
"dtype",
"(",
"self",
")",
":",
"return",
"self",
".",
"_dtype"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/gluon/parameter.py#L167-L172 | |
stitchEm/stitchEm | 0f399501d41ab77933677f2907f41f80ceb704d7 | lib/bindings/samples/server/glfw.py | python | get_monitors | () | return monitors | Returns the currently connected monitors.
Wrapper for:
GLFWmonitor** glfwGetMonitors(int* count); | Returns the currently connected monitors. | [
"Returns",
"the",
"currently",
"connected",
"monitors",
"."
] | def get_monitors():
"""
Returns the currently connected monitors.
Wrapper for:
GLFWmonitor** glfwGetMonitors(int* count);
"""
count_value = ctypes.c_int(0)
count = ctypes.pointer(count_value)
result = _glfw.glfwGetMonitors(count)
monitors = [result[i] for i in range(count_value.... | [
"def",
"get_monitors",
"(",
")",
":",
"count_value",
"=",
"ctypes",
".",
"c_int",
"(",
"0",
")",
"count",
"=",
"ctypes",
".",
"pointer",
"(",
"count_value",
")",
"result",
"=",
"_glfw",
".",
"glfwGetMonitors",
"(",
"count",
")",
"monitors",
"=",
"[",
"... | https://github.com/stitchEm/stitchEm/blob/0f399501d41ab77933677f2907f41f80ceb704d7/lib/bindings/samples/server/glfw.py#L781-L792 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/compiler/syntax.py | python | SyntaxErrorChecker.__init__ | (self, multi=None) | Create new visitor object.
If optional argument multi is not None, then print messages
for each error rather than raising a SyntaxError for the
first. | Create new visitor object. | [
"Create",
"new",
"visitor",
"object",
"."
] | def __init__(self, multi=None):
"""Create new visitor object.
If optional argument multi is not None, then print messages
for each error rather than raising a SyntaxError for the
first.
"""
self.multi = multi
self.errors = 0 | [
"def",
"__init__",
"(",
"self",
",",
"multi",
"=",
"None",
")",
":",
"self",
".",
"multi",
"=",
"multi",
"self",
".",
"errors",
"=",
"0"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/compiler/syntax.py#L22-L30 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/engine/training_v1.py | python | Model._update_sample_weight_modes | (self, sample_weights=None) | Updates sample weight modes based on training/eval inputs.
Sample weight placeholders will be created for all or no outputs
based on whether sample_weight is provided for any output.
If model contains `_sample_weight_modes` we check if the input
`sample_weights` corresponds to the sample weight modes.... | Updates sample weight modes based on training/eval inputs. | [
"Updates",
"sample",
"weight",
"modes",
"based",
"on",
"training",
"/",
"eval",
"inputs",
"."
] | def _update_sample_weight_modes(self, sample_weights=None):
"""Updates sample weight modes based on training/eval inputs.
Sample weight placeholders will be created for all or no outputs
based on whether sample_weight is provided for any output.
If model contains `_sample_weight_modes` we check if the... | [
"def",
"_update_sample_weight_modes",
"(",
"self",
",",
"sample_weights",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"_is_compiled",
":",
"return",
"if",
"sample_weights",
"and",
"any",
"(",
"s",
"is",
"not",
"None",
"for",
"s",
"in",
"sample_weights",... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/engine/training_v1.py#L1469-L1498 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/multi_threads_helpers.py | python | MergePeaksThread.__del__ | (self) | return | Delete signal
:return: | Delete signal | [
"Delete",
"signal"
] | def __del__(self):
"""Delete signal
:return:
"""
self.wait()
return | [
"def",
"__del__",
"(",
"self",
")",
":",
"self",
".",
"wait",
"(",
")",
"return"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/multi_threads_helpers.py#L405-L412 | |
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/expressions/constants/parameter.py | python | Parameter.get_data | (self) | return [self.shape, self._name, self.value, self.id, self.attributes] | Returns info needed to reconstruct the expression besides the args. | Returns info needed to reconstruct the expression besides the args. | [
"Returns",
"info",
"needed",
"to",
"reconstruct",
"the",
"expression",
"besides",
"the",
"args",
"."
] | def get_data(self):
"""Returns info needed to reconstruct the expression besides the args.
"""
return [self.shape, self._name, self.value, self.id, self.attributes] | [
"def",
"get_data",
"(",
"self",
")",
":",
"return",
"[",
"self",
".",
"shape",
",",
"self",
".",
"_name",
",",
"self",
".",
"value",
",",
"self",
".",
"id",
",",
"self",
".",
"attributes",
"]"
] | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/expressions/constants/parameter.py#L64-L67 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/framework/dtypes.py | python | DType.max | (self) | Returns the maximum representable value in this data type.
Raises:
TypeError: if this is a non-numeric, unordered, or quantized type. | Returns the maximum representable value in this data type. | [
"Returns",
"the",
"maximum",
"representable",
"value",
"in",
"this",
"data",
"type",
"."
] | def max(self):
"""Returns the maximum representable value in this data type.
Raises:
TypeError: if this is a non-numeric, unordered, or quantized type.
"""
if (self.is_quantized or self.base_dtype in
(bool, string, complex64, complex128)):
raise TypeError("Cannot find maximum value... | [
"def",
"max",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"is_quantized",
"or",
"self",
".",
"base_dtype",
"in",
"(",
"bool",
",",
"string",
",",
"complex64",
",",
"complex128",
")",
")",
":",
"raise",
"TypeError",
"(",
"\"Cannot find maximum value of %... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/framework/dtypes.py#L197-L216 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/command/easy_install.py | python | easy_install.write_script | (self, script_name, contents, mode="t", blockers=()) | Write an executable file to the scripts directory | Write an executable file to the scripts directory | [
"Write",
"an",
"executable",
"file",
"to",
"the",
"scripts",
"directory"
] | def write_script(self, script_name, contents, mode="t", blockers=()):
"""Write an executable file to the scripts directory"""
self.delete_blockers( # clean up old .py/.pyw w/o a script
[os.path.join(self.script_dir, x) for x in blockers]
)
log.info("Installing %s script to %... | [
"def",
"write_script",
"(",
"self",
",",
"script_name",
",",
"contents",
",",
"mode",
"=",
"\"t\"",
",",
"blockers",
"=",
"(",
")",
")",
":",
"self",
".",
"delete_blockers",
"(",
"# clean up old .py/.pyw w/o a script",
"[",
"os",
".",
"path",
".",
"join",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/command/easy_install.py#L822-L840 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextEvent.SetLinesAdded | (*args, **kwargs) | return _stc.StyledTextEvent_SetLinesAdded(*args, **kwargs) | SetLinesAdded(self, int num) | SetLinesAdded(self, int num) | [
"SetLinesAdded",
"(",
"self",
"int",
"num",
")"
] | def SetLinesAdded(*args, **kwargs):
"""SetLinesAdded(self, int num)"""
return _stc.StyledTextEvent_SetLinesAdded(*args, **kwargs) | [
"def",
"SetLinesAdded",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextEvent_SetLinesAdded",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L7050-L7052 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/six.py | python | _add_doc | (func, doc) | Add documentation to a function. | Add documentation to a function. | [
"Add",
"documentation",
"to",
"a",
"function",
"."
] | def _add_doc(func, doc):
"""Add documentation to a function."""
func.__doc__ = doc | [
"def",
"_add_doc",
"(",
"func",
",",
"doc",
")",
":",
"func",
".",
"__doc__",
"=",
"doc"
] | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/six.py#L67-L69 | ||
fabianschenk/REVO | eb949c0fdbcdf0be09a38464eb0592a90803947f | thirdparty/Sophus/py/sophus/so2.py | python | So2.__init__ | (self, z) | internally represented by a unit complex number z | internally represented by a unit complex number z | [
"internally",
"represented",
"by",
"a",
"unit",
"complex",
"number",
"z"
] | def __init__(self, z):
""" internally represented by a unit complex number z """
self.z = z | [
"def",
"__init__",
"(",
"self",
",",
"z",
")",
":",
"self",
".",
"z",
"=",
"z"
] | https://github.com/fabianschenk/REVO/blob/eb949c0fdbcdf0be09a38464eb0592a90803947f/thirdparty/Sophus/py/sophus/so2.py#L11-L13 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/requests/sessions.py | python | Session.close | (self) | Closes all adapters and as such the session | Closes all adapters and as such the session | [
"Closes",
"all",
"adapters",
"and",
"as",
"such",
"the",
"session"
] | def close(self):
"""Closes all adapters and as such the session"""
for v in self.adapters.values():
v.close() | [
"def",
"close",
"(",
"self",
")",
":",
"for",
"v",
"in",
"self",
".",
"adapters",
".",
"values",
"(",
")",
":",
"v",
".",
"close",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/requests/sessions.py#L744-L747 | ||
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/v7.9.317/third_party/jinja2/debug.py | python | ProcessedTraceback.standard_exc_info | (self) | return self.exc_type, self.exc_value, tb | Standard python exc_info for re-raising | Standard python exc_info for re-raising | [
"Standard",
"python",
"exc_info",
"for",
"re",
"-",
"raising"
] | def standard_exc_info(self):
"""Standard python exc_info for re-raising"""
tb = self.frames[0]
# the frame will be an actual traceback (or transparent proxy) if
# we are on pypy or a python implementation with support for tproxy
if type(tb) is not TracebackType:
tb = ... | [
"def",
"standard_exc_info",
"(",
"self",
")",
":",
"tb",
"=",
"self",
".",
"frames",
"[",
"0",
"]",
"# the frame will be an actual traceback (or transparent proxy) if",
"# we are on pypy or a python implementation with support for tproxy",
"if",
"type",
"(",
"tb",
")",
"is"... | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/third_party/jinja2/debug.py#L122-L129 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/factorization/python/ops/gmm_ops.py | python | gmm | (inp,
initial_clusters,
num_clusters,
random_seed,
covariance_type=FULL_COVARIANCE,
params='wmc') | return (loss, scores, [assignments], gmm_tool.training_ops(),
gmm_tool.init_ops(), gmm_tool.is_initialized()) | Creates the graph for Gaussian mixture model (GMM) clustering.
Args:
inp: An input tensor or list of input tensors
initial_clusters: Specifies the clusters used during
initialization. Can be a tensor or numpy array, or a function
that generates the clusters. Can also be "random" to specify
... | Creates the graph for Gaussian mixture model (GMM) clustering. | [
"Creates",
"the",
"graph",
"for",
"Gaussian",
"mixture",
"model",
"(",
"GMM",
")",
"clustering",
"."
] | def gmm(inp,
initial_clusters,
num_clusters,
random_seed,
covariance_type=FULL_COVARIANCE,
params='wmc'):
"""Creates the graph for Gaussian mixture model (GMM) clustering.
Args:
inp: An input tensor or list of input tensors
initial_clusters: Specifies the clusters us... | [
"def",
"gmm",
"(",
"inp",
",",
"initial_clusters",
",",
"num_clusters",
",",
"random_seed",
",",
"covariance_type",
"=",
"FULL_COVARIANCE",
",",
"params",
"=",
"'wmc'",
")",
":",
"initial_means",
"=",
"None",
"if",
"initial_clusters",
"!=",
"'random'",
"and",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L462-L506 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/wheel/vendored/packaging/tags.py | python | sys_tags | (**kwargs) | Returns the sequence of tag triples for the running interpreter.
The order of the sequence corresponds to priority order for the
interpreter, from most to least important. | Returns the sequence of tag triples for the running interpreter. | [
"Returns",
"the",
"sequence",
"of",
"tag",
"triples",
"for",
"the",
"running",
"interpreter",
"."
] | def sys_tags(**kwargs):
# type: (bool) -> Iterator[Tag]
"""
Returns the sequence of tag triples for the running interpreter.
The order of the sequence corresponds to priority order for the
interpreter, from most to least important.
"""
warn = _warn_keyword_parameter("sys_tags", kwargs)
... | [
"def",
"sys_tags",
"(",
"*",
"*",
"kwargs",
")",
":",
"# type: (bool) -> Iterator[Tag]",
"warn",
"=",
"_warn_keyword_parameter",
"(",
"\"sys_tags\"",
",",
"kwargs",
")",
"interp_name",
"=",
"interpreter_name",
"(",
")",
"if",
"interp_name",
"==",
"\"cp\"",
":",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/wheel/vendored/packaging/tags.py#L833-L852 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/encodings/punycode.py | python | generate_generalized_integer | (N, bias) | 3.3 Generalized variable-length integers | 3.3 Generalized variable-length integers | [
"3",
".",
"3",
"Generalized",
"variable",
"-",
"length",
"integers"
] | def generate_generalized_integer(N, bias):
"""3.3 Generalized variable-length integers"""
result = bytearray()
j = 0
while 1:
t = T(j, bias)
if N < t:
result.append(digits[N])
return bytes(result)
result.append(digits[t + ((N - t) % (36 - t))])
N =... | [
"def",
"generate_generalized_integer",
"(",
"N",
",",
"bias",
")",
":",
"result",
"=",
"bytearray",
"(",
")",
"j",
"=",
"0",
"while",
"1",
":",
"t",
"=",
"T",
"(",
"j",
",",
"bias",
")",
"if",
"N",
"<",
"t",
":",
"result",
".",
"append",
"(",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/encodings/punycode.py#L78-L89 | ||
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/position.py | python | Position.long_bankrupt | (self, long_bankrupt) | Sets the long_bankrupt of this Position.
:param long_bankrupt: The long_bankrupt of this Position. # noqa: E501
:type: float | Sets the long_bankrupt of this Position. | [
"Sets",
"the",
"long_bankrupt",
"of",
"this",
"Position",
"."
] | def long_bankrupt(self, long_bankrupt):
"""Sets the long_bankrupt of this Position.
:param long_bankrupt: The long_bankrupt of this Position. # noqa: E501
:type: float
"""
self._long_bankrupt = long_bankrupt | [
"def",
"long_bankrupt",
"(",
"self",
",",
"long_bankrupt",
")",
":",
"self",
".",
"_long_bankrupt",
"=",
"long_bankrupt"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/position.py#L1942-L1950 | ||
danxuhk/ContinuousCRF-CNN | 2b6dcaf179620f118b225ed12c890414ca828e21 | python/caffe/pycaffe.py | python | _Net_blobs | (self) | return self._blobs_dict | An OrderedDict (bottom to top, i.e., input to output) of network
blobs indexed by name | An OrderedDict (bottom to top, i.e., input to output) of network
blobs indexed by name | [
"An",
"OrderedDict",
"(",
"bottom",
"to",
"top",
"i",
".",
"e",
".",
"input",
"to",
"output",
")",
"of",
"network",
"blobs",
"indexed",
"by",
"name"
] | def _Net_blobs(self):
"""
An OrderedDict (bottom to top, i.e., input to output) of network
blobs indexed by name
"""
if not hasattr(self, '_blobs_dict'):
self._blobs_dict = OrderedDict(zip(self._blob_names, self._blobs))
return self._blobs_dict | [
"def",
"_Net_blobs",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_blobs_dict'",
")",
":",
"self",
".",
"_blobs_dict",
"=",
"OrderedDict",
"(",
"zip",
"(",
"self",
".",
"_blob_names",
",",
"self",
".",
"_blobs",
")",
")",
"return"... | https://github.com/danxuhk/ContinuousCRF-CNN/blob/2b6dcaf179620f118b225ed12c890414ca828e21/python/caffe/pycaffe.py#L25-L32 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/msvc.py | python | SystemInfo.VCInstallDir | (self) | return path | Microsoft Visual C++ directory. | Microsoft Visual C++ directory. | [
"Microsoft",
"Visual",
"C",
"++",
"directory",
"."
] | def VCInstallDir(self):
"""
Microsoft Visual C++ directory.
"""
self.VSInstallDir
guess_vc = self._guess_vc() or self._guess_vc_legacy()
# Try to get "VC++ for Python" path from registry as default path
reg_path = os.path.join(self.ri.vc_for_python, '%0.1f' % se... | [
"def",
"VCInstallDir",
"(",
"self",
")",
":",
"self",
".",
"VSInstallDir",
"guess_vc",
"=",
"self",
".",
"_guess_vc",
"(",
")",
"or",
"self",
".",
"_guess_vc_legacy",
"(",
")",
"# Try to get \"VC++ for Python\" path from registry as default path",
"reg_path",
"=",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/msvc.py#L538-L558 | |
nyuwireless-unipd/ns3-mmwave | 4ff9e87e8079764e04cbeccd8e85bff15ae16fb3 | src/visualizer/visualizer/plugins/olsr.py | python | ShowOlsrRoutingTable.update | (self) | !
Update function
@param self this object
@return none | !
Update function | [
"!",
"Update",
"function"
] | def update(self):
"""!
Update function
@param self this object
@return none
"""
node = ns.network.NodeList.GetNode(self.node_index)
olsr = node.GetObject(ns.olsr.olsr.RoutingProtocol.GetTypeId())
ipv4 = node.GetObject(ns.internet.Ipv4.GetTypeId())
... | [
"def",
"update",
"(",
"self",
")",
":",
"node",
"=",
"ns",
".",
"network",
".",
"NodeList",
".",
"GetNode",
"(",
"self",
".",
"node_index",
")",
"olsr",
"=",
"node",
".",
"GetObject",
"(",
"ns",
".",
"olsr",
".",
"olsr",
".",
"RoutingProtocol",
".",
... | https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/src/visualizer/visualizer/plugins/olsr.py#L92-L117 | ||
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/controls/DevWalker.py | python | DevWalker.enableAvatarControls | (self) | Activate the arrow keys, etc. | Activate the arrow keys, etc. | [
"Activate",
"the",
"arrow",
"keys",
"etc",
"."
] | def enableAvatarControls(self):
"""
Activate the arrow keys, etc.
"""
assert self.debugPrint("enableAvatarControls")
if self.task:
# remove any old
self.task.remove(self.task)
# spawn the new task
self.task = taskMgr.add(
self.... | [
"def",
"enableAvatarControls",
"(",
"self",
")",
":",
"assert",
"self",
".",
"debugPrint",
"(",
"\"enableAvatarControls\"",
")",
"if",
"self",
".",
"task",
":",
"# remove any old",
"self",
".",
"task",
".",
"remove",
"(",
"self",
".",
"task",
")",
"# spawn t... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/controls/DevWalker.py#L166-L177 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | ImageList.Replace | (*args, **kwargs) | return _gdi_.ImageList_Replace(*args, **kwargs) | Replace(self, int index, Bitmap bitmap, Bitmap mask=NullBitmap) -> bool | Replace(self, int index, Bitmap bitmap, Bitmap mask=NullBitmap) -> bool | [
"Replace",
"(",
"self",
"int",
"index",
"Bitmap",
"bitmap",
"Bitmap",
"mask",
"=",
"NullBitmap",
")",
"-",
">",
"bool"
] | def Replace(*args, **kwargs):
"""Replace(self, int index, Bitmap bitmap, Bitmap mask=NullBitmap) -> bool"""
return _gdi_.ImageList_Replace(*args, **kwargs) | [
"def",
"Replace",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"ImageList_Replace",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L6776-L6778 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/xrc.py | python | XmlNode.GetAttribute | (*args, **kwargs) | return _xrc.XmlNode_GetAttribute(*args, **kwargs) | GetAttribute(self, String attrName, String defaultVal) -> String | GetAttribute(self, String attrName, String defaultVal) -> String | [
"GetAttribute",
"(",
"self",
"String",
"attrName",
"String",
"defaultVal",
")",
"-",
">",
"String"
] | def GetAttribute(*args, **kwargs):
"""GetAttribute(self, String attrName, String defaultVal) -> String"""
return _xrc.XmlNode_GetAttribute(*args, **kwargs) | [
"def",
"GetAttribute",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_xrc",
".",
"XmlNode_GetAttribute",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/xrc.py#L481-L483 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/sans/algorithm_detail/calibration.py | python | do_apply_calibration | (full_file_path, workspaces_to_calibrate, use_loaded, publish_to_ads, parent_alg) | Applies calibration to a data workspace
:param full_file_path: the file path to the calibration file.
:param workspaces_to_calibrate: the workspace which is to be calibrated.
:param use_loaded: if already loaded calibration workspace is to be used.
:param publish_to_ads: if calibration workspace is to ... | Applies calibration to a data workspace | [
"Applies",
"calibration",
"to",
"a",
"data",
"workspace"
] | def do_apply_calibration(full_file_path, workspaces_to_calibrate, use_loaded, publish_to_ads, parent_alg):
"""
Applies calibration to a data workspace
:param full_file_path: the file path to the calibration file.
:param workspaces_to_calibrate: the workspace which is to be calibrated.
:param use_lo... | [
"def",
"do_apply_calibration",
"(",
"full_file_path",
",",
"workspaces_to_calibrate",
",",
"use_loaded",
",",
"publish_to_ads",
",",
"parent_alg",
")",
":",
"# Load calibration workspace",
"calibration_workspace",
"=",
"get_calibration_workspace",
"(",
"full_file_path",
",",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/sans/algorithm_detail/calibration.py#L60-L106 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/pkgutil.py | python | get_importer | (path_item) | return importer | Retrieve a PEP 302 importer for the given path item
The returned importer is cached in sys.path_importer_cache
if it was newly created by a path hook.
If there is no importer, a wrapper around the basic import
machinery is returned. This wrapper is never inserted into
the importer cache (None is i... | Retrieve a PEP 302 importer for the given path item | [
"Retrieve",
"a",
"PEP",
"302",
"importer",
"for",
"the",
"given",
"path",
"item"
] | def get_importer(path_item):
"""Retrieve a PEP 302 importer for the given path item
The returned importer is cached in sys.path_importer_cache
if it was newly created by a path hook.
If there is no importer, a wrapper around the basic import
machinery is returned. This wrapper is never inserted in... | [
"def",
"get_importer",
"(",
"path_item",
")",
":",
"try",
":",
"importer",
"=",
"sys",
".",
"path_importer_cache",
"[",
"path_item",
"]",
"except",
"KeyError",
":",
"for",
"path_hook",
"in",
"sys",
".",
"path_hooks",
":",
"try",
":",
"importer",
"=",
"path... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/pkgutil.py#L366-L397 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py | python | _RNNCellWrapperV1._call_wrapped_cell | (self, inputs, state, cell_call_fn, **kwargs) | Calls the wrapped cell and performs the wrapping logic.
This method is called from the wrapper's `call` or `__call__` methods.
Args:
inputs: A tensor with wrapped cell's input.
state: A tensor or tuple of tensors with wrapped cell's state.
cell_call_fn: Wrapped cell's method to use for step ... | Calls the wrapped cell and performs the wrapping logic. | [
"Calls",
"the",
"wrapped",
"cell",
"and",
"performs",
"the",
"wrapping",
"logic",
"."
] | def _call_wrapped_cell(self, inputs, state, cell_call_fn, **kwargs):
"""Calls the wrapped cell and performs the wrapping logic.
This method is called from the wrapper's `call` or `__call__` methods.
Args:
inputs: A tensor with wrapped cell's input.
state: A tensor or tuple of tensors with wrap... | [
"def",
"_call_wrapped_cell",
"(",
"self",
",",
"inputs",
",",
"state",
",",
"cell_call_fn",
",",
"*",
"*",
"kwargs",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py#L1127-L1144 | ||
microsoft/onnxruntime | f92e47e95b13a240e37caf7b36577983544f98fc | onnxruntime/python/tools/quantization/calibrate.py | python | CalibrationDataCollector.compute_collection_result | (self) | Get the optimal result among collection data. | Get the optimal result among collection data. | [
"Get",
"the",
"optimal",
"result",
"among",
"collection",
"data",
"."
] | def compute_collection_result(self):
"""
Get the optimal result among collection data.
"""
raise NotImplementedError | [
"def",
"compute_collection_result",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/onnxruntime/python/tools/quantization/calibrate.py#L423-L427 | ||
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/idl/idl/cpp_types.py | python | CppTypeBase.is_const_type | (self) | Return True if the type should be returned by const. | Return True if the type should be returned by const. | [
"Return",
"True",
"if",
"the",
"type",
"should",
"be",
"returned",
"by",
"const",
"."
] | def is_const_type(self):
# type: () -> bool
"""Return True if the type should be returned by const."""
pass | [
"def",
"is_const_type",
"(",
"self",
")",
":",
"# type: () -> bool",
"pass"
] | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/idl/idl/cpp_types.py#L107-L110 | ||
mapsme/omim | 1892903b63f2c85b16ed4966d21fe76aba06b9ba | tools/python/planet_checks/validate_big_cities.py | python | read_reference_cities | (reference_geojson_filename) | return geojson['features'] | Returns list of cities as objects with fields 'id',
'properties', 'geometry' (as geojson features generated by overpass-api). | Returns list of cities as objects with fields 'id',
'properties', 'geometry' (as geojson features generated by overpass-api). | [
"Returns",
"list",
"of",
"cities",
"as",
"objects",
"with",
"fields",
"id",
"properties",
"geometry",
"(",
"as",
"geojson",
"features",
"generated",
"by",
"overpass",
"-",
"api",
")",
"."
] | def read_reference_cities(reference_geojson_filename):
"""Returns list of cities as objects with fields 'id',
'properties', 'geometry' (as geojson features generated by overpass-api).
"""
with open(reference_geojson_filename) as f:
geojson = json.load(f)
return geojson['features'] | [
"def",
"read_reference_cities",
"(",
"reference_geojson_filename",
")",
":",
"with",
"open",
"(",
"reference_geojson_filename",
")",
"as",
"f",
":",
"geojson",
"=",
"json",
".",
"load",
"(",
"f",
")",
"return",
"geojson",
"[",
"'features'",
"]"
] | https://github.com/mapsme/omim/blob/1892903b63f2c85b16ed4966d21fe76aba06b9ba/tools/python/planet_checks/validate_big_cities.py#L87-L93 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py | python | CrossedColumn._from_config | (cls, config, custom_objects=None, columns_by_name=None) | return cls(**kwargs) | See 'FeatureColumn` base class. | See 'FeatureColumn` base class. | [
"See",
"FeatureColumn",
"base",
"class",
"."
] | def _from_config(cls, config, custom_objects=None, columns_by_name=None):
"""See 'FeatureColumn` base class."""
from tensorflow.python.feature_column.serialization import deserialize_feature_column # pylint: disable=g-import-not-at-top
_check_config_keys(config, cls._fields)
kwargs = _standardize_and_c... | [
"def",
"_from_config",
"(",
"cls",
",",
"config",
",",
"custom_objects",
"=",
"None",
",",
"columns_by_name",
"=",
"None",
")",
":",
"from",
"tensorflow",
".",
"python",
".",
"feature_column",
".",
"serialization",
"import",
"deserialize_feature_column",
"# pylint... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py#L4170-L4179 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextCtrl.StyleGetSizeFractional | (*args, **kwargs) | return _stc.StyledTextCtrl_StyleGetSizeFractional(*args, **kwargs) | StyleGetSizeFractional(self, int style) -> int | StyleGetSizeFractional(self, int style) -> int | [
"StyleGetSizeFractional",
"(",
"self",
"int",
"style",
")",
"-",
">",
"int"
] | def StyleGetSizeFractional(*args, **kwargs):
"""StyleGetSizeFractional(self, int style) -> int"""
return _stc.StyledTextCtrl_StyleGetSizeFractional(*args, **kwargs) | [
"def",
"StyleGetSizeFractional",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_StyleGetSizeFractional",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L2703-L2705 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2class.py | python | xpathContext.xpathRegisterVariable | (self, name, ns_uri, value) | return ret | Register a variable with the XPath context | Register a variable with the XPath context | [
"Register",
"a",
"variable",
"with",
"the",
"XPath",
"context"
] | def xpathRegisterVariable(self, name, ns_uri, value):
"""Register a variable with the XPath context """
ret = libxml2mod.xmlXPathRegisterVariable(self._o, name, ns_uri, value)
return ret | [
"def",
"xpathRegisterVariable",
"(",
"self",
",",
"name",
",",
"ns_uri",
",",
"value",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlXPathRegisterVariable",
"(",
"self",
".",
"_o",
",",
"name",
",",
"ns_uri",
",",
"value",
")",
"return",
"ret"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L6526-L6529 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/external/bazel_tools/tools/android/merge_manifests.py | python | MergeManifests._FindElementComment | (self, node) | return None | Find element's comment.
Assumes that element's comment can be just above the element.
Searches previous siblings and looks for the first non text element
that is of a nodeType of comment node.
Args:
node: Node for which to find a comment.
Returns:
Elements's comment node, None if not f... | Find element's comment. | [
"Find",
"element",
"s",
"comment",
"."
] | def _FindElementComment(self, node):
"""Find element's comment.
Assumes that element's comment can be just above the element.
Searches previous siblings and looks for the first non text element
that is of a nodeType of comment node.
Args:
node: Node for which to find a comment.
Returns:
... | [
"def",
"_FindElementComment",
"(",
"self",
",",
"node",
")",
":",
"while",
"node",
".",
"previousSibling",
":",
"node",
"=",
"node",
".",
"previousSibling",
"if",
"node",
".",
"nodeType",
"is",
"node",
".",
"COMMENT_NODE",
":",
"return",
"node",
"if",
"nod... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/external/bazel_tools/tools/android/merge_manifests.py#L233-L251 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.CountCharacters | (*args, **kwargs) | return _stc.StyledTextCtrl_CountCharacters(*args, **kwargs) | CountCharacters(self, int startPos, int endPos) -> int | CountCharacters(self, int startPos, int endPos) -> int | [
"CountCharacters",
"(",
"self",
"int",
"startPos",
"int",
"endPos",
")",
"-",
">",
"int"
] | def CountCharacters(*args, **kwargs):
"""CountCharacters(self, int startPos, int endPos) -> int"""
return _stc.StyledTextCtrl_CountCharacters(*args, **kwargs) | [
"def",
"CountCharacters",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_CountCharacters",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L3335-L3337 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/indexes/multi.py | python | MultiIndex.delete | (self, loc) | return MultiIndex(
levels=self.levels,
codes=new_codes,
names=self.names,
verify_integrity=False,
) | Make new index with passed location deleted
Returns
-------
new_index : MultiIndex | Make new index with passed location deleted | [
"Make",
"new",
"index",
"with",
"passed",
"location",
"deleted"
] | def delete(self, loc) -> MultiIndex:
"""
Make new index with passed location deleted
Returns
-------
new_index : MultiIndex
"""
new_codes = [np.delete(level_codes, loc) for level_codes in self.codes]
return MultiIndex(
levels=self.levels,
... | [
"def",
"delete",
"(",
"self",
",",
"loc",
")",
"->",
"MultiIndex",
":",
"new_codes",
"=",
"[",
"np",
".",
"delete",
"(",
"level_codes",
",",
"loc",
")",
"for",
"level_codes",
"in",
"self",
".",
"codes",
"]",
"return",
"MultiIndex",
"(",
"levels",
"=",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/indexes/multi.py#L3705-L3719 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/gyp/pylib/gyp/generator/make.py | python | MakefileWriter.Objectify | (self, path) | return path | Convert a path to its output directory form. | Convert a path to its output directory form. | [
"Convert",
"a",
"path",
"to",
"its",
"output",
"directory",
"form",
"."
] | def Objectify(self, path):
"""Convert a path to its output directory form."""
if '$(' in path:
path = path.replace('$(obj)/', '$(obj).%s/$(TARGET)/' % self.toolset)
if not '$(obj)' in path:
path = '$(obj).%s/$(TARGET)/%s' % (self.toolset, path)
return path | [
"def",
"Objectify",
"(",
"self",
",",
"path",
")",
":",
"if",
"'$('",
"in",
"path",
":",
"path",
"=",
"path",
".",
"replace",
"(",
"'$(obj)/'",
",",
"'$(obj).%s/$(TARGET)/'",
"%",
"self",
".",
"toolset",
")",
"if",
"not",
"'$(obj)'",
"in",
"path",
":",... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/generator/make.py#L1910-L1916 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/src/robotsim.py | python | SimRobotSensor.setEnabled | (self, enabled: "bool") | return _robotsim.SimRobotSensor_setEnabled(self, enabled) | r"""
setEnabled(SimRobotSensor self, bool enabled)
Sets whether the sensor is enabled (helper for setSetting) | r"""
setEnabled(SimRobotSensor self, bool enabled) | [
"r",
"setEnabled",
"(",
"SimRobotSensor",
"self",
"bool",
"enabled",
")"
] | def setEnabled(self, enabled: "bool") -> "void":
r"""
setEnabled(SimRobotSensor self, bool enabled)
Sets whether the sensor is enabled (helper for setSetting)
"""
return _robotsim.SimRobotSensor_setEnabled(self, enabled) | [
"def",
"setEnabled",
"(",
"self",
",",
"enabled",
":",
"\"bool\"",
")",
"->",
"\"void\"",
":",
"return",
"_robotsim",
".",
"SimRobotSensor_setEnabled",
"(",
"self",
",",
"enabled",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L7231-L7239 | |
bingwin/MicroChat | 81d9a71a212c1cbca5bba497ec42659a7d25dccf | mars/lint/cpplint.py | python | IsDerivedFunction | (clean_lines, linenum) | return False | Check if current line contains an inherited function.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if current line contains a function with "override"
virt-specifier. | Check if current line contains an inherited function. | [
"Check",
"if",
"current",
"line",
"contains",
"an",
"inherited",
"function",
"."
] | def IsDerivedFunction(clean_lines, linenum):
"""Check if current line contains an inherited function.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if current line contains a function with "override"
virt-specifier.
"""
... | [
"def",
"IsDerivedFunction",
"(",
"clean_lines",
",",
"linenum",
")",
":",
"# Scan back a few lines for start of current function",
"for",
"i",
"in",
"xrange",
"(",
"linenum",
",",
"max",
"(",
"-",
"1",
",",
"linenum",
"-",
"10",
")",
",",
"-",
"1",
")",
":",... | https://github.com/bingwin/MicroChat/blob/81d9a71a212c1cbca5bba497ec42659a7d25dccf/mars/lint/cpplint.py#L5005-L5024 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | benchmarks/distributed/rpc/parameter_server/launcher.py | python | get_server_metrics | (server_rrefs) | return rank_metrics | r"""
A function that calls the remote server to obtain metrics
collected during the benchmark run.
Args:
server_rrefs (dict): a dictionary containing server RRefs | r"""
A function that calls the remote server to obtain metrics
collected during the benchmark run.
Args:
server_rrefs (dict): a dictionary containing server RRefs | [
"r",
"A",
"function",
"that",
"calls",
"the",
"remote",
"server",
"to",
"obtain",
"metrics",
"collected",
"during",
"the",
"benchmark",
"run",
".",
"Args",
":",
"server_rrefs",
"(",
"dict",
")",
":",
"a",
"dictionary",
"containing",
"server",
"RRefs"
] | def get_server_metrics(server_rrefs):
r"""
A function that calls the remote server to obtain metrics
collected during the benchmark run.
Args:
server_rrefs (dict): a dictionary containing server RRefs
"""
rank_metrics = []
for rank, server_rref in server_rrefs.items():
metric... | [
"def",
"get_server_metrics",
"(",
"server_rrefs",
")",
":",
"rank_metrics",
"=",
"[",
"]",
"for",
"rank",
",",
"server_rref",
"in",
"server_rrefs",
".",
"items",
"(",
")",
":",
"metrics",
"=",
"server_rref",
".",
"rpc_sync",
"(",
")",
".",
"get_metrics",
"... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/benchmarks/distributed/rpc/parameter_server/launcher.py#L240-L251 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/SConsign.py | python | Reset | () | Reset global state. Used by unit tests that end up using
SConsign multiple times to get a clean slate for each test. | Reset global state. Used by unit tests that end up using
SConsign multiple times to get a clean slate for each test. | [
"Reset",
"global",
"state",
".",
"Used",
"by",
"unit",
"tests",
"that",
"end",
"up",
"using",
"SConsign",
"multiple",
"times",
"to",
"get",
"a",
"clean",
"slate",
"for",
"each",
"test",
"."
] | def Reset():
"""Reset global state. Used by unit tests that end up using
SConsign multiple times to get a clean slate for each test."""
global sig_files, DB_sync_list
sig_files = []
DB_sync_list = [] | [
"def",
"Reset",
"(",
")",
":",
"global",
"sig_files",
",",
"DB_sync_list",
"sig_files",
"=",
"[",
"]",
"DB_sync_list",
"=",
"[",
"]"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/SConsign.py#L97-L102 | ||
KhronosGroup/SPIR | f33c27876d9f3d5810162b60fa89cc13d2b55725 | bindings/python/clang/cindex.py | python | TranslationUnit.save | (self, filename) | Saves the TranslationUnit to a file.
This is equivalent to passing -emit-ast to the clang frontend. The
saved file can be loaded back into a TranslationUnit. Or, if it
corresponds to a header, it can be used as a pre-compiled header file.
If an error occurs while saving, a TranslationU... | Saves the TranslationUnit to a file. | [
"Saves",
"the",
"TranslationUnit",
"to",
"a",
"file",
"."
] | def save(self, filename):
"""Saves the TranslationUnit to a file.
This is equivalent to passing -emit-ast to the clang frontend. The
saved file can be loaded back into a TranslationUnit. Or, if it
corresponds to a header, it can be used as a pre-compiled header file.
If an erro... | [
"def",
"save",
"(",
"self",
",",
"filename",
")",
":",
"options",
"=",
"conf",
".",
"lib",
".",
"clang_defaultSaveOptions",
"(",
"self",
")",
"result",
"=",
"int",
"(",
"conf",
".",
"lib",
".",
"clang_saveTranslationUnit",
"(",
"self",
",",
"filename",
"... | https://github.com/KhronosGroup/SPIR/blob/f33c27876d9f3d5810162b60fa89cc13d2b55725/bindings/python/clang/cindex.py#L2148-L2168 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/common/parameter.py | python | Parameter.set_param_ps | (self, init_in_server=False) | Set whether the trainable parameter is updated by parameter server and whether the
trainable parameter is initialized on server.
Note:
It only works when a running task is in the parameter server mode.
Args:
init_in_server (bool): Whether trainable parameter updated by ... | Set whether the trainable parameter is updated by parameter server and whether the
trainable parameter is initialized on server. | [
"Set",
"whether",
"the",
"trainable",
"parameter",
"is",
"updated",
"by",
"parameter",
"server",
"and",
"whether",
"the",
"trainable",
"parameter",
"is",
"initialized",
"on",
"server",
"."
] | def set_param_ps(self, init_in_server=False):
"""
Set whether the trainable parameter is updated by parameter server and whether the
trainable parameter is initialized on server.
Note:
It only works when a running task is in the parameter server mode.
Args:
... | [
"def",
"set_param_ps",
"(",
"self",
",",
"init_in_server",
"=",
"False",
")",
":",
"if",
"not",
"(",
"_is_role_worker",
"(",
")",
"or",
"_is_role_pserver",
"(",
")",
"or",
"_is_role_sched",
"(",
")",
")",
":",
"raise",
"RuntimeError",
"(",
"\"Must complete f... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/common/parameter.py#L256-L275 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/metrics/python/ops/metric_ops.py | python | _count_condition | (values, ignore_mask=None, metrics_collections=None,
updates_collections=None) | return value_tensor, update_op | Computes the total number of cases where the given values are True.
Args:
values: A binary `Tensor` of arbitrary size.
ignore_mask: An optional, binary tensor whose size matches 'values'.
metrics_collections: An optional list of collections that the metric
value variable should be added to.
upd... | Computes the total number of cases where the given values are True. | [
"Computes",
"the",
"total",
"number",
"of",
"cases",
"where",
"the",
"given",
"values",
"are",
"True",
"."
] | def _count_condition(values, ignore_mask=None, metrics_collections=None,
updates_collections=None):
"""Computes the total number of cases where the given values are True.
Args:
values: A binary `Tensor` of arbitrary size.
ignore_mask: An optional, binary tensor whose size matches 'valu... | [
"def",
"_count_condition",
"(",
"values",
",",
"ignore_mask",
"=",
"None",
",",
"metrics_collections",
"=",
"None",
",",
"updates_collections",
"=",
"None",
")",
":",
"check_ops",
".",
"assert_type",
"(",
"values",
",",
"dtypes",
".",
"bool",
")",
"count",
"... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/metrics/python/ops/metric_ops.py#L82-L123 | |
shogun-toolbox/shogun | 9b8d856971af5a295dd6ad70623ae45647a6334c | examples/meta/generator/translate.py | python | Translator.translateArgumentList | (self, argumentList, returnKwargs=False) | return translation | Translate argument list AST
Args:
argumentList: object like None, {"Expr": exprAST},
[{"Expr": exprAST}, {"Expr": exprAST}],
[{"KeywordArgument":[identifier, expr]], etc. | Translate argument list AST
Args:
argumentList: object like None, {"Expr": exprAST},
[{"Expr": exprAST}, {"Expr": exprAST}],
[{"KeywordArgument":[identifier, expr]], etc. | [
"Translate",
"argument",
"list",
"AST",
"Args",
":",
"argumentList",
":",
"object",
"like",
"None",
"{",
"Expr",
":",
"exprAST",
"}",
"[",
"{",
"Expr",
":",
"exprAST",
"}",
"{",
"Expr",
":",
"exprAST",
"}",
"]",
"[",
"{",
"KeywordArgument",
":",
"[",
... | def translateArgumentList(self, argumentList, returnKwargs=False):
""" Translate argument list AST
Args:
argumentList: object like None, {"Expr": exprAST},
[{"Expr": exprAST}, {"Expr": exprAST}],
[{"KeywordArgument":[identifier, expr]], etc... | [
"def",
"translateArgumentList",
"(",
"self",
",",
"argumentList",
",",
"returnKwargs",
"=",
"False",
")",
":",
"kwargs",
"=",
"[",
"]",
"translation",
"=",
"\"\"",
"initialArg",
"=",
"True",
"for",
"el",
"in",
"argumentList",
"[",
"\"ArgumentList\"",
"]",
":... | https://github.com/shogun-toolbox/shogun/blob/9b8d856971af5a295dd6ad70623ae45647a6334c/examples/meta/generator/translate.py#L759-L781 | |
google/shaka-packager | e1b0c7c45431327fd3ce193514a5407d07b39b22 | packager/third_party/protobuf/python/mox.py | python | MockObject.__eq__ | (self, rhs) | return (isinstance(rhs, MockObject) and
self._class_to_mock == rhs._class_to_mock and
self._replay_mode == rhs._replay_mode and
self._expected_calls_queue == rhs._expected_calls_queue) | Provide custom logic to compare objects. | Provide custom logic to compare objects. | [
"Provide",
"custom",
"logic",
"to",
"compare",
"objects",
"."
] | def __eq__(self, rhs):
"""Provide custom logic to compare objects."""
return (isinstance(rhs, MockObject) and
self._class_to_mock == rhs._class_to_mock and
self._replay_mode == rhs._replay_mode and
self._expected_calls_queue == rhs._expected_calls_queue) | [
"def",
"__eq__",
"(",
"self",
",",
"rhs",
")",
":",
"return",
"(",
"isinstance",
"(",
"rhs",
",",
"MockObject",
")",
"and",
"self",
".",
"_class_to_mock",
"==",
"rhs",
".",
"_class_to_mock",
"and",
"self",
".",
"_replay_mode",
"==",
"rhs",
".",
"_replay_... | https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/mox.py#L419-L425 | |
shader-slang/slang | b8982fcf43b86c1e39dcc3dd19bff2821633eda6 | external/vulkan/registry/vkconventions.py | python | VulkanConventions.special_use_section_anchor | (self) | return 'extendingvulkan-compatibility-specialuse' | Return asciidoctor anchor name in the API Specification of the
section describing extension special uses in detail. | Return asciidoctor anchor name in the API Specification of the
section describing extension special uses in detail. | [
"Return",
"asciidoctor",
"anchor",
"name",
"in",
"the",
"API",
"Specification",
"of",
"the",
"section",
"describing",
"extension",
"special",
"uses",
"in",
"detail",
"."
] | def special_use_section_anchor(self):
"""Return asciidoctor anchor name in the API Specification of the
section describing extension special uses in detail."""
return 'extendingvulkan-compatibility-specialuse' | [
"def",
"special_use_section_anchor",
"(",
"self",
")",
":",
"return",
"'extendingvulkan-compatibility-specialuse'"
] | https://github.com/shader-slang/slang/blob/b8982fcf43b86c1e39dcc3dd19bff2821633eda6/external/vulkan/registry/vkconventions.py#L181-L184 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tpu/profiler/profiler_analysis_pb2_grpc.py | python | ProfileAnalysisServicer.GetSessionToolData | (self, request, context) | Retrieve specific tool's data for specific session. | Retrieve specific tool's data for specific session. | [
"Retrieve",
"specific",
"tool",
"s",
"data",
"for",
"specific",
"session",
"."
] | def GetSessionToolData(self, request, context):
"""Retrieve specific tool's data for specific session."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!') | [
"def",
"GetSessionToolData",
"(",
"self",
",",
"request",
",",
"context",
")",
":",
"context",
".",
"set_code",
"(",
"grpc",
".",
"StatusCode",
".",
"UNIMPLEMENTED",
")",
"context",
".",
"set_details",
"(",
"'Method not implemented!'",
")",
"raise",
"NotImplemen... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tpu/profiler/profiler_analysis_pb2_grpc.py#L89-L93 | ||
RoboJackets/robocup-software | bce13ce53ddb2ecb9696266d980722c34617dc15 | rj_gameplay/stp/rc.py | python | Ball.visible | (self) | return self.__visible | :return: True if the ball can currently be seen by the global vision system.
Note that with filtering or additional sensors like whiskers we may still know where the ball is located | :return: True if the ball can currently be seen by the global vision system. | [
":",
"return",
":",
"True",
"if",
"the",
"ball",
"can",
"currently",
"be",
"seen",
"by",
"the",
"global",
"vision",
"system",
"."
] | def visible(self) -> bool:
"""
:return: True if the ball can currently be seen by the global vision system.
Note that with filtering or additional sensors like whiskers we may still know where the ball is located
"""
return self.__visible | [
"def",
"visible",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"self",
".",
"__visible"
] | https://github.com/RoboJackets/robocup-software/blob/bce13ce53ddb2ecb9696266d980722c34617dc15/rj_gameplay/stp/rc.py#L244-L250 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AzCodeGenerator/bin/windows/az_code_gen/clang_cpp.py | python | store_annotation | (annotations, tag, value, overwrite=False) | Adds an annotation specified in C++ namespace format to an annotation dictionary
using the namespaces to specify dict hierarchy
@param annotations The root annotation dict to store into
@param tag The C++ formatted tag (using either :: or . as a separator)
@param value The value to store | Adds an annotation specified in C++ namespace format to an annotation dictionary
using the namespaces to specify dict hierarchy | [
"Adds",
"an",
"annotation",
"specified",
"in",
"C",
"++",
"namespace",
"format",
"to",
"an",
"annotation",
"dictionary",
"using",
"the",
"namespaces",
"to",
"specify",
"dict",
"hierarchy"
] | def store_annotation(annotations, tag, value, overwrite=False):
""" Adds an annotation specified in C++ namespace format to an annotation dictionary
using the namespaces to specify dict hierarchy
@param annotations The root annotation dict to store into
@param tag The C++ formatted tag (using either... | [
"def",
"store_annotation",
"(",
"annotations",
",",
"tag",
",",
"value",
",",
"overwrite",
"=",
"False",
")",
":",
"tag_parts",
"=",
"re",
".",
"split",
"(",
"TAG_SPLIT_PATTERN",
",",
"tag",
")",
"namespace",
"=",
"annotations",
"for",
"part",
"in",
"tag_p... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AzCodeGenerator/bin/windows/az_code_gen/clang_cpp.py#L46-L65 | ||
intel/linux-sgx | 2ee53db4e8fd25437a817612d3bcb94b66a28373 | sdk/debugger_interface/linux/gdb-sgx-plugin/printers.py | python | StdDequePrinter._list_it | (self) | Primary iteration worker. | Primary iteration worker. | [
"Primary",
"iteration",
"worker",
"."
] | def _list_it(self):
"""Primary iteration worker."""
num_emitted = 0
current_addr = self.start_ptr
start_index = self.first_block_start_index
while num_emitted < self.size:
end_index = min(start_index + self.size -
num_emitted, self.block_si... | [
"def",
"_list_it",
"(",
"self",
")",
":",
"num_emitted",
"=",
"0",
"current_addr",
"=",
"self",
".",
"start_ptr",
"start_index",
"=",
"self",
".",
"first_block_start_index",
"while",
"num_emitted",
"<",
"self",
".",
"size",
":",
"end_index",
"=",
"min",
"(",... | https://github.com/intel/linux-sgx/blob/2ee53db4e8fd25437a817612d3bcb94b66a28373/sdk/debugger_interface/linux/gdb-sgx-plugin/printers.py#L519-L532 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py | python | Entry.__init__ | (self, master=None, cnf={}, **kw) | Construct an entry widget with the parent MASTER.
Valid resource names: background, bd, bg, borderwidth, cursor,
exportselection, fg, font, foreground, highlightbackground,
highlightcolor, highlightthickness, insertbackground,
insertborderwidth, insertofftime, insertontime, insertwidth,... | Construct an entry widget with the parent MASTER. | [
"Construct",
"an",
"entry",
"widget",
"with",
"the",
"parent",
"MASTER",
"."
] | def __init__(self, master=None, cnf={}, **kw):
"""Construct an entry widget with the parent MASTER.
Valid resource names: background, bd, bg, borderwidth, cursor,
exportselection, fg, font, foreground, highlightbackground,
highlightcolor, highlightthickness, insertbackground,
in... | [
"def",
"__init__",
"(",
"self",
",",
"master",
"=",
"None",
",",
"cnf",
"=",
"{",
"}",
",",
"*",
"*",
"kw",
")",
":",
"Widget",
".",
"__init__",
"(",
"self",
",",
"master",
",",
"'entry'",
",",
"cnf",
",",
"kw",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L2665-L2676 | ||
apache/singa | 93fd9da72694e68bfe3fb29d0183a65263d238a1 | python/singa/sonnx.py | python | SingaFrontend._create_cast | (cls, op, op_t) | return node | get a onnx node from singa cast
Args:
op: a given operator
Args:
op_t: the tensor of the operator
Returns:
the onnx node | get a onnx node from singa cast
Args:
op: a given operator
Args:
op_t: the tensor of the operator
Returns:
the onnx node | [
"get",
"a",
"onnx",
"node",
"from",
"singa",
"cast",
"Args",
":",
"op",
":",
"a",
"given",
"operator",
"Args",
":",
"op_t",
":",
"the",
"tensor",
"of",
"the",
"operator",
"Returns",
":",
"the",
"onnx",
"node"
] | def _create_cast(cls, op, op_t):
"""
get a onnx node from singa cast
Args:
op: a given operator
Args:
op_t: the tensor of the operator
Returns:
the onnx node
"""
node = cls._common_singa_tensor_to_onnx_node(op, op_t)
m... | [
"def",
"_create_cast",
"(",
"cls",
",",
"op",
",",
"op_t",
")",
":",
"node",
"=",
"cls",
".",
"_common_singa_tensor_to_onnx_node",
"(",
"op",
",",
"op_t",
")",
"map_dict",
"=",
"{",
"tensor",
".",
"float32",
":",
"TensorProto",
".",
"FLOAT",
",",
"# FLOA... | https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/sonnx.py#L238-L257 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/prefdlg.py | python | DocGenPanel._DoLayout | (self) | Layout the controls
@note: Do not call this after __init__ | Layout the controls
@note: Do not call this after __init__ | [
"Layout",
"the",
"controls",
"@note",
":",
"Do",
"not",
"call",
"this",
"after",
"__init__"
] | def _DoLayout(self):
"""Layout the controls
@note: Do not call this after __init__
"""
# Format Section
tabsz = wx.BoxSizer(wx.HORIZONTAL)
tabsz.AddMany([(wx.StaticText(self, label=_("Tab Width") + u": "),
0, wx.ALIGN_CENTER_VERTICAL), ((5, 5), 0)... | [
"def",
"_DoLayout",
"(",
"self",
")",
":",
"# Format Section",
"tabsz",
"=",
"wx",
".",
"BoxSizer",
"(",
"wx",
".",
"HORIZONTAL",
")",
"tabsz",
".",
"AddMany",
"(",
"[",
"(",
"wx",
".",
"StaticText",
"(",
"self",
",",
"label",
"=",
"_",
"(",
"\"Tab W... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/prefdlg.py#L755-L867 | ||
alibaba/MNN | c4d9566171d589c3ded23aa18ffb197016995a12 | pymnn/pip_package/MNN/expr/__init__.py | python | pad | (x, paddings, mode=_F.CONSTANT) | return _F.pad(x, paddings, mode) | pad(x, paddings, mode=_F.CONSTANT)
Padding the `x` whith `paddings` size.
Parameters
----------
x : var_like, input value.
paddings : var_like, input value, shape is [x.ndim, 2], dtype is int.
mode : PadValue_Mode, input value, [CONSTANT, REFLECT, SYMMETRIC]. Default is CONSTANT.
Returns
... | pad(x, paddings, mode=_F.CONSTANT)
Padding the `x` whith `paddings` size.
Parameters
----------
x : var_like, input value.
paddings : var_like, input value, shape is [x.ndim, 2], dtype is int.
mode : PadValue_Mode, input value, [CONSTANT, REFLECT, SYMMETRIC]. Default is CONSTANT. | [
"pad",
"(",
"x",
"paddings",
"mode",
"=",
"_F",
".",
"CONSTANT",
")",
"Padding",
"the",
"x",
"whith",
"paddings",
"size",
".",
"Parameters",
"----------",
"x",
":",
"var_like",
"input",
"value",
".",
"paddings",
":",
"var_like",
"input",
"value",
"shape",
... | def pad(x, paddings, mode=_F.CONSTANT):
'''
pad(x, paddings, mode=_F.CONSTANT)
Padding the `x` whith `paddings` size.
Parameters
----------
x : var_like, input value.
paddings : var_like, input value, shape is [x.ndim, 2], dtype is int.
mode : PadValue_Mode, input value, [CONSTANT, REF... | [
"def",
"pad",
"(",
"x",
",",
"paddings",
",",
"mode",
"=",
"_F",
".",
"CONSTANT",
")",
":",
"x",
"=",
"_to_var",
"(",
"x",
")",
"paddings",
"=",
"_to_var",
"(",
"paddings",
")",
"if",
"paddings",
".",
"dtype",
"!=",
"_F",
".",
"int",
":",
"raise"... | https://github.com/alibaba/MNN/blob/c4d9566171d589c3ded23aa18ffb197016995a12/pymnn/pip_package/MNN/expr/__init__.py#L2397-L2425 | |
freeorion/freeorion | c266a40eccd3a99a17de8fe57c36ef6ba3771665 | default/python/AI/PlanetUtilsAI.py | python | get_populated_planet_ids | (planet_ids: Sequence[PlanetId]) | return [pid for pid in planet_ids if universe.getPlanet(pid).initialMeterValue(fo.meterType.population) > 0] | Filter planets with population.
:param planet_ids: list of planets ids
:return: list of planets ids | Filter planets with population.
:param planet_ids: list of planets ids
:return: list of planets ids | [
"Filter",
"planets",
"with",
"population",
".",
":",
"param",
"planet_ids",
":",
"list",
"of",
"planets",
"ids",
":",
"return",
":",
"list",
"of",
"planets",
"ids"
] | def get_populated_planet_ids(planet_ids: Sequence[PlanetId]) -> Sequence[PlanetId]:
"""
Filter planets with population.
:param planet_ids: list of planets ids
:return: list of planets ids
"""
universe = fo.getUniverse()
return [pid for pid in planet_ids if universe.getPlanet(pid).initialMete... | [
"def",
"get_populated_planet_ids",
"(",
"planet_ids",
":",
"Sequence",
"[",
"PlanetId",
"]",
")",
"->",
"Sequence",
"[",
"PlanetId",
"]",
":",
"universe",
"=",
"fo",
".",
"getUniverse",
"(",
")",
"return",
"[",
"pid",
"for",
"pid",
"in",
"planet_ids",
"if"... | https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/AI/PlanetUtilsAI.py#L152-L159 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBQueueItem.GetExtendedBacktraceThread | (self, type) | return _lldb.SBQueueItem_GetExtendedBacktraceThread(self, type) | GetExtendedBacktraceThread(SBQueueItem self, char const * type) -> SBThread | GetExtendedBacktraceThread(SBQueueItem self, char const * type) -> SBThread | [
"GetExtendedBacktraceThread",
"(",
"SBQueueItem",
"self",
"char",
"const",
"*",
"type",
")",
"-",
">",
"SBThread"
] | def GetExtendedBacktraceThread(self, type):
"""GetExtendedBacktraceThread(SBQueueItem self, char const * type) -> SBThread"""
return _lldb.SBQueueItem_GetExtendedBacktraceThread(self, type) | [
"def",
"GetExtendedBacktraceThread",
"(",
"self",
",",
"type",
")",
":",
"return",
"_lldb",
".",
"SBQueueItem_GetExtendedBacktraceThread",
"(",
"self",
",",
"type",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L9196-L9198 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/distributions/python/ops/normal.py | python | Normal.sample_n | (self, n, seed=None, name="sample_n") | Sample `n` observations from the Normal Distributions.
Args:
n: `Scalar`, type int32, the number of observations to sample.
seed: Python integer, the random seed.
name: The name to give this op.
Returns:
samples: `[n, ...]`, a `Tensor` of `n` samples for each
of the distributio... | Sample `n` observations from the Normal Distributions. | [
"Sample",
"n",
"observations",
"from",
"the",
"Normal",
"Distributions",
"."
] | def sample_n(self, n, seed=None, name="sample_n"):
"""Sample `n` observations from the Normal Distributions.
Args:
n: `Scalar`, type int32, the number of observations to sample.
seed: Python integer, the random seed.
name: The name to give this op.
Returns:
samples: `[n, ...]`, a `... | [
"def",
"sample_n",
"(",
"self",
",",
"n",
",",
"seed",
"=",
"None",
",",
"name",
"=",
"\"sample_n\"",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"self",
".",
"name",
")",
":",
"with",
"ops",
".",
"op_scope",
"(",
"[",
"self",
".",
"_mu",
",... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/normal.py#L308-L333 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/linalg/_interpolative_backend.py | python | iddr_id | (A, k) | return idx, proj | Compute ID of a real matrix to a specified rank.
:param A:
Matrix.
:type A: :class:`numpy.ndarray`
:param k:
Rank of ID.
:type k: int
:return:
Column index array.
:rtype: :class:`numpy.ndarray`
:return:
Interpolation coefficients.
:rtype: :class:`numpy.n... | Compute ID of a real matrix to a specified rank. | [
"Compute",
"ID",
"of",
"a",
"real",
"matrix",
"to",
"a",
"specified",
"rank",
"."
] | def iddr_id(A, k):
"""
Compute ID of a real matrix to a specified rank.
:param A:
Matrix.
:type A: :class:`numpy.ndarray`
:param k:
Rank of ID.
:type k: int
:return:
Column index array.
:rtype: :class:`numpy.ndarray`
:return:
Interpolation coefficien... | [
"def",
"iddr_id",
"(",
"A",
",",
"k",
")",
":",
"A",
"=",
"np",
".",
"asfortranarray",
"(",
"A",
")",
"idx",
",",
"rnorms",
"=",
"_id",
".",
"iddr_id",
"(",
"A",
",",
"k",
")",
"n",
"=",
"A",
".",
"shape",
"[",
"1",
"]",
"proj",
"=",
"A",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/linalg/_interpolative_backend.py#L213-L235 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/linalg/_interpolative_backend.py | python | idzp_id | (eps, A) | return k, idx, proj | Compute ID of a complex matrix to a specified relative precision.
:param eps:
Relative precision.
:type eps: float
:param A:
Matrix.
:type A: :class:`numpy.ndarray`
:return:
Rank of ID.
:rtype: int
:return:
Column index array.
:rtype: :class:`numpy.ndarr... | Compute ID of a complex matrix to a specified relative precision. | [
"Compute",
"ID",
"of",
"a",
"complex",
"matrix",
"to",
"a",
"specified",
"relative",
"precision",
"."
] | def idzp_id(eps, A):
"""
Compute ID of a complex matrix to a specified relative precision.
:param eps:
Relative precision.
:type eps: float
:param A:
Matrix.
:type A: :class:`numpy.ndarray`
:return:
Rank of ID.
:rtype: int
:return:
Column index array... | [
"def",
"idzp_id",
"(",
"eps",
",",
"A",
")",
":",
"A",
"=",
"np",
".",
"asfortranarray",
"(",
"A",
")",
"k",
",",
"idx",
",",
"rnorms",
"=",
"_id",
".",
"idzp_id",
"(",
"eps",
",",
"A",
")",
"n",
"=",
"A",
".",
"shape",
"[",
"1",
"]",
"proj... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/linalg/_interpolative_backend.py#L979-L1004 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/setuptools/command/setopt.py | python | edit_config | (filename, settings, dry_run=False) | Edit a configuration file to include `settings`
`settings` is a dictionary of dictionaries or ``None`` values, keyed by
command/section name. A ``None`` value means to delete the entire section,
while a dictionary lists settings to be changed or deleted in that section.
A setting of ``None`` means to ... | Edit a configuration file to include `settings` | [
"Edit",
"a",
"configuration",
"file",
"to",
"include",
"settings"
] | def edit_config(filename, settings, dry_run=False):
"""Edit a configuration file to include `settings`
`settings` is a dictionary of dictionaries or ``None`` values, keyed by
command/section name. A ``None`` value means to delete the entire section,
while a dictionary lists settings to be changed or d... | [
"def",
"edit_config",
"(",
"filename",
",",
"settings",
",",
"dry_run",
"=",
"False",
")",
":",
"log",
".",
"debug",
"(",
"\"Reading configuration from %s\"",
",",
"filename",
")",
"opts",
"=",
"configparser",
".",
"RawConfigParser",
"(",
")",
"opts",
".",
"... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/setuptools/command/setopt.py#L33-L73 | ||
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | ArithRef.__lt__ | (self, other) | return BoolRef(Z3_mk_lt(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx) | Create the Z3 expression `other < self`.
>>> x, y = Ints('x y')
>>> x < y
x < y
>>> y = Real('y')
>>> x < y
ToReal(x) < y | Create the Z3 expression `other < self`. | [
"Create",
"the",
"Z3",
"expression",
"other",
"<",
"self",
"."
] | def __lt__(self, other):
"""Create the Z3 expression `other < self`.
>>> x, y = Ints('x y')
>>> x < y
x < y
>>> y = Real('y')
>>> x < y
ToReal(x) < y
"""
a, b = _coerce_exprs(self, other)
return BoolRef(Z3_mk_lt(self.ctx_ref(), a.as_ast(),... | [
"def",
"__lt__",
"(",
"self",
",",
"other",
")",
":",
"a",
",",
"b",
"=",
"_coerce_exprs",
"(",
"self",
",",
"other",
")",
"return",
"BoolRef",
"(",
"Z3_mk_lt",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"a",
".",
"as_ast",
"(",
")",
",",
"b",
... | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L2590-L2601 | |
google/or-tools | 2cb85b4eead4c38e1c54b48044f92087cf165bce | ortools/sat/python/cp_model.py | python | IntVar.Index | (self) | return self.__index | Returns the index of the variable in the model. | Returns the index of the variable in the model. | [
"Returns",
"the",
"index",
"of",
"the",
"variable",
"in",
"the",
"model",
"."
] | def Index(self):
"""Returns the index of the variable in the model."""
return self.__index | [
"def",
"Index",
"(",
"self",
")",
":",
"return",
"self",
".",
"__index"
] | https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/ortools/sat/python/cp_model.py#L648-L650 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/boto3/session.py | python | Session.client | (self, service_name, region_name=None, api_version=None,
use_ssl=True, verify=None, endpoint_url=None,
aws_access_key_id=None, aws_secret_access_key=None,
aws_session_token=None, config=None) | return self._session.create_client(
service_name, region_name=region_name, api_version=api_version,
use_ssl=use_ssl, verify=verify, endpoint_url=endpoint_url,
aws_access_key_id=aws_access_key_id,
aws_secret_access_key=aws_secret_access_key,
aws_session_token=a... | Create a low-level service client by name.
:type service_name: string
:param service_name: The name of a service, e.g. 's3' or 'ec2'. You
can get a list of available services via
:py:meth:`get_available_services`.
:type region_name: string
:param region_name: Th... | Create a low-level service client by name. | [
"Create",
"a",
"low",
"-",
"level",
"service",
"client",
"by",
"name",
"."
] | def client(self, service_name, region_name=None, api_version=None,
use_ssl=True, verify=None, endpoint_url=None,
aws_access_key_id=None, aws_secret_access_key=None,
aws_session_token=None, config=None):
"""
Create a low-level service client by name.
... | [
"def",
"client",
"(",
"self",
",",
"service_name",
",",
"region_name",
"=",
"None",
",",
"api_version",
"=",
"None",
",",
"use_ssl",
"=",
"True",
",",
"verify",
"=",
"None",
",",
"endpoint_url",
"=",
"None",
",",
"aws_access_key_id",
"=",
"None",
",",
"a... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/boto3/session.py#L185-L263 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/genericmessagedialog.py | python | GenericMessageDialog.GetDefaultYesLabel | (self) | return _("Yes") | Returns the default label for the ``Yes`` button.
:note: this method may be overridden to provide different defaults for the
default button labels.
.. versionadded:: 0.9.3 | Returns the default label for the ``Yes`` button. | [
"Returns",
"the",
"default",
"label",
"for",
"the",
"Yes",
"button",
"."
] | def GetDefaultYesLabel(self):
"""
Returns the default label for the ``Yes`` button.
:note: this method may be overridden to provide different defaults for the
default button labels.
.. versionadded:: 0.9.3
"""
return _("Yes") | [
"def",
"GetDefaultYesLabel",
"(",
"self",
")",
":",
"return",
"_",
"(",
"\"Yes\"",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/genericmessagedialog.py#L1010-L1020 | |
facebookresearch/minirts | 859e747a5e2fab2355bea083daffa6a36820a7f2 | scripts/behavior_clone/conv_module.py | python | ConvFeatNet._select_feat_with_loc | (feat, x, y) | return selected_feat | select feature given locations
feat: [batch, nc, h, w]
x: [batch, pnum_unit], range: [0, 1)
y: [batch, pnum_unit], range: [0, 1)
return:
selected_feat: [batch, pnum_unit, nc(feat_dim)]
Note: returned feature is not masked at all | select feature given locations | [
"select",
"feature",
"given",
"locations"
] | def _select_feat_with_loc(feat, x, y):
"""select feature given locations
feat: [batch, nc, h, w]
x: [batch, pnum_unit], range: [0, 1)
y: [batch, pnum_unit], range: [0, 1)
return:
selected_feat: [batch, pnum_unit, nc(feat_dim)]
Note: returned feature is not maske... | [
"def",
"_select_feat_with_loc",
"(",
"feat",
",",
"x",
",",
"y",
")",
":",
"# feat: [batch, nc, h, w]",
"x",
"=",
"x",
".",
"long",
"(",
")",
"y",
"=",
"y",
".",
"long",
"(",
")",
"if",
"not",
"x",
".",
"max",
"(",
")",
"<",
"gc",
".",
"MAP_X",
... | https://github.com/facebookresearch/minirts/blob/859e747a5e2fab2355bea083daffa6a36820a7f2/scripts/behavior_clone/conv_module.py#L115-L149 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/polynomial/hermite.py | python | hermval3d | (x, y, z, c) | return pu._valnd(hermval, c, x, y, z) | Evaluate a 3-D Hermite series at points (x, y, z).
This function returns the values:
.. math:: p(x,y,z) = \\sum_{i,j,k} c_{i,j,k} * H_i(x) * H_j(y) * H_k(z)
The parameters `x`, `y`, and `z` are converted to arrays only if
they are tuples or a lists, otherwise they are treated as a scalars and
the... | Evaluate a 3-D Hermite series at points (x, y, z). | [
"Evaluate",
"a",
"3",
"-",
"D",
"Hermite",
"series",
"at",
"points",
"(",
"x",
"y",
"z",
")",
"."
] | def hermval3d(x, y, z, c):
"""
Evaluate a 3-D Hermite series at points (x, y, z).
This function returns the values:
.. math:: p(x,y,z) = \\sum_{i,j,k} c_{i,j,k} * H_i(x) * H_j(y) * H_k(z)
The parameters `x`, `y`, and `z` are converted to arrays only if
they are tuples or a lists, otherwise th... | [
"def",
"hermval3d",
"(",
"x",
",",
"y",
",",
"z",
",",
"c",
")",
":",
"return",
"pu",
".",
"_valnd",
"(",
"hermval",
",",
"c",
",",
"x",
",",
"y",
",",
"z",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/polynomial/hermite.py#L978-L1026 | |
freeorion/freeorion | c266a40eccd3a99a17de8fe57c36ef6ba3771665 | default/python/universe_generation/galaxy.py | python | DSet.inc_rank | (self) | Increment rank. | Increment rank. | [
"Increment",
"rank",
"."
] | def inc_rank(self):
"""Increment rank."""
self.rank += 1 | [
"def",
"inc_rank",
"(",
"self",
")",
":",
"self",
".",
"rank",
"+=",
"1"
] | https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/universe_generation/galaxy.py#L120-L122 | ||
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | bindings/python/cntk/io/__init__.py | python | MinibatchData.shape | (self) | return self.data.shape | The shape of the data in this minibatch as tuple. | The shape of the data in this minibatch as tuple. | [
"The",
"shape",
"of",
"the",
"data",
"in",
"this",
"minibatch",
"as",
"tuple",
"."
] | def shape(self):
'''
The shape of the data in this minibatch as tuple.
'''
return self.data.shape | [
"def",
"shape",
"(",
"self",
")",
":",
"return",
"self",
".",
"data",
".",
"shape"
] | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/io/__init__.py#L68-L72 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/calendar.py | python | Calendar.iterweekdays | (self) | Return a iterator for one week of weekday numbers starting with the
configured first one. | Return a iterator for one week of weekday numbers starting with the
configured first one. | [
"Return",
"a",
"iterator",
"for",
"one",
"week",
"of",
"weekday",
"numbers",
"starting",
"with",
"the",
"configured",
"first",
"one",
"."
] | def iterweekdays(self):
"""
Return a iterator for one week of weekday numbers starting with the
configured first one.
"""
for i in range(self.firstweekday, self.firstweekday + 7):
yield i%7 | [
"def",
"iterweekdays",
"(",
"self",
")",
":",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"firstweekday",
",",
"self",
".",
"firstweekday",
"+",
"7",
")",
":",
"yield",
"i",
"%",
"7"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/calendar.py#L143-L149 | ||
nasa/meshNetwork | ff4bd66e0ca6bd424fd8897a97252bb3925d8b3c | python/mesh/generic/nodeController.py | python | NodeController.monitorNodeUpdates | (self) | Monitors time since last state update from other nodes. | Monitors time since last state update from other nodes. | [
"Monitors",
"time",
"since",
"last",
"state",
"update",
"from",
"other",
"nodes",
"."
] | def monitorNodeUpdates(self):
"""Monitors time since last state update from other nodes."""
# Check that other nodes' states are updating
if 'nodeStatus' not in self.nodeParams.__dict__ or 'clock' not in self.nodeParams.__dict__:
return
for node in self.nodeParams.no... | [
"def",
"monitorNodeUpdates",
"(",
"self",
")",
":",
"# Check that other nodes' states are updating",
"if",
"'nodeStatus'",
"not",
"in",
"self",
".",
"nodeParams",
".",
"__dict__",
"or",
"'clock'",
"not",
"in",
"self",
".",
"nodeParams",
".",
"__dict__",
":",
"retu... | https://github.com/nasa/meshNetwork/blob/ff4bd66e0ca6bd424fd8897a97252bb3925d8b3c/python/mesh/generic/nodeController.py#L65-L75 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/sheet.py | python | CCellEditor.Show | (self, show, attr) | Show or hide the edit control. Use the attr (if not None)
to set colors or fonts for the control.
NOTE: There is no need to everride this if you don't need
to do something out of the ordinary. | Show or hide the edit control. Use the attr (if not None)
to set colors or fonts for the control. | [
"Show",
"or",
"hide",
"the",
"edit",
"control",
".",
"Use",
"the",
"attr",
"(",
"if",
"not",
"None",
")",
"to",
"set",
"colors",
"or",
"fonts",
"for",
"the",
"control",
"."
] | def Show(self, show, attr):
""" Show or hide the edit control. Use the attr (if not None)
to set colors or fonts for the control.
NOTE: There is no need to everride this if you don't need
to do something out of the ordinary.
"""
super(CCellEditor, self).Show... | [
"def",
"Show",
"(",
"self",
",",
"show",
",",
"attr",
")",
":",
"super",
"(",
"CCellEditor",
",",
"self",
")",
".",
"Show",
"(",
"show",
",",
"attr",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/sheet.py#L64-L71 | ||
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/gdal.py | python | Band.Checksum | (self, *args, **kwargs) | return _gdal.Band_Checksum(self, *args, **kwargs) | r"""Checksum(Band self, int xoff=0, int yoff=0, int * xsize=None, int * ysize=None) -> int | r"""Checksum(Band self, int xoff=0, int yoff=0, int * xsize=None, int * ysize=None) -> int | [
"r",
"Checksum",
"(",
"Band",
"self",
"int",
"xoff",
"=",
"0",
"int",
"yoff",
"=",
"0",
"int",
"*",
"xsize",
"=",
"None",
"int",
"*",
"ysize",
"=",
"None",
")",
"-",
">",
"int"
] | def Checksum(self, *args, **kwargs):
r"""Checksum(Band self, int xoff=0, int yoff=0, int * xsize=None, int * ysize=None) -> int"""
return _gdal.Band_Checksum(self, *args, **kwargs) | [
"def",
"Checksum",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdal",
".",
"Band_Checksum",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gdal.py#L3484-L3486 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | Pen.GetStyle | (*args, **kwargs) | return _gdi_.Pen_GetStyle(*args, **kwargs) | GetStyle(self) -> int | GetStyle(self) -> int | [
"GetStyle",
"(",
"self",
")",
"-",
">",
"int"
] | def GetStyle(*args, **kwargs):
"""GetStyle(self) -> int"""
return _gdi_.Pen_GetStyle(*args, **kwargs) | [
"def",
"GetStyle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Pen_GetStyle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L412-L414 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/ConvectionDiffusionApplication/python_scripts/convection_diffusion_stationary_matrix_solver.py | python | ConvectionDiffusionStationaryMatrixSolver.SolveSolutionStep | (self) | return True | Assembles the system and stores the system matrix and vector as member variables. | Assembles the system and stores the system matrix and vector as member variables. | [
"Assembles",
"the",
"system",
"and",
"stores",
"the",
"system",
"matrix",
"and",
"vector",
"as",
"member",
"variables",
"."
] | def SolveSolutionStep(self):
"""Assembles the system and stores the system matrix and vector as member variables."""
self.K, self.p = self._SystemComputation()
# example of a solution with the extracted matrix and vector
# ----
# import scipy.sparse.linalg
# x = scipy.sp... | [
"def",
"SolveSolutionStep",
"(",
"self",
")",
":",
"self",
".",
"K",
",",
"self",
".",
"p",
"=",
"self",
".",
"_SystemComputation",
"(",
")",
"# example of a solution with the extracted matrix and vector",
"# ----",
"# import scipy.sparse.linalg",
"# x = scipy.sparse.lina... | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/ConvectionDiffusionApplication/python_scripts/convection_diffusion_stationary_matrix_solver.py#L29-L44 | |
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/sping/stringformat.py | python | stringWidth | (canvas, s, font=None) | return sum | Return the logical width of the string if it were drawn \
in the current font (defaults to canvas.font). | Return the logical width of the string if it were drawn \
in the current font (defaults to canvas.font). | [
"Return",
"the",
"logical",
"width",
"of",
"the",
"string",
"if",
"it",
"were",
"drawn",
"\\",
"in",
"the",
"current",
"font",
"(",
"defaults",
"to",
"canvas",
".",
"font",
")",
"."
] | def stringWidth(canvas, s, font=None):
"Return the logical width of the string if it were drawn \
in the current font (defaults to canvas.font)."
sformatter = StringFormatter()
segmentlist = sformatter.parseSegments(s)
# to calculate a new font the segments must be given an actual font
if not font:... | [
"def",
"stringWidth",
"(",
"canvas",
",",
"s",
",",
"font",
"=",
"None",
")",
":",
"sformatter",
"=",
"StringFormatter",
"(",
")",
"segmentlist",
"=",
"sformatter",
".",
"parseSegments",
"(",
"s",
")",
"# to calculate a new font the segments must be given an actual ... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/sping/stringformat.py#L332-L348 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py2/setuptools/msvc.py | python | RegistryInfo.visualstudio | (self) | return 'VisualStudio' | Microsoft Visual Studio root registry key.
Return
------
str
Registry key | Microsoft Visual Studio root registry key. | [
"Microsoft",
"Visual",
"Studio",
"root",
"registry",
"key",
"."
] | def visualstudio(self):
"""
Microsoft Visual Studio root registry key.
Return
------
str
Registry key
"""
return 'VisualStudio' | [
"def",
"visualstudio",
"(",
"self",
")",
":",
"return",
"'VisualStudio'"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/msvc.py#L359-L368 | |
liulei01/DRBox | b5c76e033c555c9009590ab384e1f7bd3c66c237 | python/caffe/io.py | python | array_to_blobproto | (arr, diff=None) | return blob | Converts a N-dimensional array to blob proto. If diff is given, also
convert the diff. You need to make sure that arr and diff have the same
shape, and this function does not do sanity check. | Converts a N-dimensional array to blob proto. If diff is given, also
convert the diff. You need to make sure that arr and diff have the same
shape, and this function does not do sanity check. | [
"Converts",
"a",
"N",
"-",
"dimensional",
"array",
"to",
"blob",
"proto",
".",
"If",
"diff",
"is",
"given",
"also",
"convert",
"the",
"diff",
".",
"You",
"need",
"to",
"make",
"sure",
"that",
"arr",
"and",
"diff",
"have",
"the",
"same",
"shape",
"and",... | def array_to_blobproto(arr, diff=None):
"""Converts a N-dimensional array to blob proto. If diff is given, also
convert the diff. You need to make sure that arr and diff have the same
shape, and this function does not do sanity check.
"""
blob = caffe_pb2.BlobProto()
blob.shape.dim.extend(arr.sh... | [
"def",
"array_to_blobproto",
"(",
"arr",
",",
"diff",
"=",
"None",
")",
":",
"blob",
"=",
"caffe_pb2",
".",
"BlobProto",
"(",
")",
"blob",
".",
"shape",
".",
"dim",
".",
"extend",
"(",
"arr",
".",
"shape",
")",
"blob",
".",
"data",
".",
"extend",
"... | https://github.com/liulei01/DRBox/blob/b5c76e033c555c9009590ab384e1f7bd3c66c237/python/caffe/io.py#L36-L46 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/apiclient/googleapiclient/discovery.py | python | _fix_up_media_upload | (method_desc, root_desc, path_url, parameters) | return accept, max_size, media_path_url | Updates parameters of API by adding 'media_body' if supported by method.
SIDE EFFECTS: If the method supports media upload and has a required body,
sets body to be optional (required=False) instead. Also, if there is a
'mediaUpload' in the method description, adds 'media_upload' key to
parameters.
Args:
... | Updates parameters of API by adding 'media_body' if supported by method. | [
"Updates",
"parameters",
"of",
"API",
"by",
"adding",
"media_body",
"if",
"supported",
"by",
"method",
"."
] | def _fix_up_media_upload(method_desc, root_desc, path_url, parameters):
"""Updates parameters of API by adding 'media_body' if supported by method.
SIDE EFFECTS: If the method supports media upload and has a required body,
sets body to be optional (required=False) instead. Also, if there is a
'mediaUpload' in ... | [
"def",
"_fix_up_media_upload",
"(",
"method_desc",
",",
"root_desc",
",",
"path_url",
",",
"parameters",
")",
":",
"media_upload",
"=",
"method_desc",
".",
"get",
"(",
"'mediaUpload'",
",",
"{",
"}",
")",
"accept",
"=",
"media_upload",
".",
"get",
"(",
"'acc... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/apiclient/googleapiclient/discovery.py#L408-L449 | |
epam/Indigo | 30e40b4b1eb9bae0207435a26cfcb81ddcc42be1 | api/python/indigo/__init__.py | python | IndigoObject.countRSites | (self) | return self.dispatcher._checkResult(
Indigo._lib.indigoCountRSites(self.id)
) | Molecule method returns the number of r-sites
Returns:
int: number of r-sites | Molecule method returns the number of r-sites | [
"Molecule",
"method",
"returns",
"the",
"number",
"of",
"r",
"-",
"sites"
] | def countRSites(self):
"""Molecule method returns the number of r-sites
Returns:
int: number of r-sites
"""
self.dispatcher._setSessionId()
return self.dispatcher._checkResult(
Indigo._lib.indigoCountRSites(self.id)
) | [
"def",
"countRSites",
"(",
"self",
")",
":",
"self",
".",
"dispatcher",
".",
"_setSessionId",
"(",
")",
"return",
"self",
".",
"dispatcher",
".",
"_checkResult",
"(",
"Indigo",
".",
"_lib",
".",
"indigoCountRSites",
"(",
"self",
".",
"id",
")",
")"
] | https://github.com/epam/Indigo/blob/30e40b4b1eb9bae0207435a26cfcb81ddcc42be1/api/python/indigo/__init__.py#L2519-L2528 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/audio/validators.py | python | check_dc_shift | (method) | return new_method | Wrapper method to check the parameters of DCShift. | Wrapper method to check the parameters of DCShift. | [
"Wrapper",
"method",
"to",
"check",
"the",
"parameters",
"of",
"DCShift",
"."
] | def check_dc_shift(method):
"""Wrapper method to check the parameters of DCShift."""
@wraps(method)
def new_method(self, *args, **kwargs):
[shift, limiter_gain], _ = parse_user_args(method, *args, **kwargs)
type_check(shift, (float, int), "shift")
check_value(shift, [-2.0, 2.0], "sh... | [
"def",
"check_dc_shift",
"(",
"method",
")",
":",
"@",
"wraps",
"(",
"method",
")",
"def",
"new_method",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"[",
"shift",
",",
"limiter_gain",
"]",
",",
"_",
"=",
"parse_user_args",
"(",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/audio/validators.py#L213-L225 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/tools/grit/grit/node/base.py | python | Node.ToRealPath | (self, path_from_basedir) | return util.normpath(os.path.join(self.GetRoot().GetBaseDir(),
os.path.expandvars(path_from_basedir))) | Returns a real path (which can be absolute or relative to the current
working directory), given a path that is relative to the base directory
set for the GRIT input file.
Args:
path_from_basedir: '..'
Return:
'resource' | Returns a real path (which can be absolute or relative to the current
working directory), given a path that is relative to the base directory
set for the GRIT input file. | [
"Returns",
"a",
"real",
"path",
"(",
"which",
"can",
"be",
"absolute",
"or",
"relative",
"to",
"the",
"current",
"working",
"directory",
")",
"given",
"a",
"path",
"that",
"is",
"relative",
"to",
"the",
"base",
"directory",
"set",
"for",
"the",
"GRIT",
"... | def ToRealPath(self, path_from_basedir):
'''Returns a real path (which can be absolute or relative to the current
working directory), given a path that is relative to the base directory
set for the GRIT input file.
Args:
path_from_basedir: '..'
Return:
'resource'
'''
return uti... | [
"def",
"ToRealPath",
"(",
"self",
",",
"path_from_basedir",
")",
":",
"return",
"util",
".",
"normpath",
"(",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"GetRoot",
"(",
")",
".",
"GetBaseDir",
"(",
")",
",",
"os",
".",
"path",
".",
"expandvars... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/tools/grit/grit/node/base.py#L391-L403 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/eager/monitoring.py | python | IntGauge.get_cell | (self, *labels) | return IntGaugeCell(super(IntGauge, self).get_cell(*labels)) | Retrieves the cell. | Retrieves the cell. | [
"Retrieves",
"the",
"cell",
"."
] | def get_cell(self, *labels):
"""Retrieves the cell."""
return IntGaugeCell(super(IntGauge, self).get_cell(*labels)) | [
"def",
"get_cell",
"(",
"self",
",",
"*",
"labels",
")",
":",
"return",
"IntGaugeCell",
"(",
"super",
"(",
"IntGauge",
",",
"self",
")",
".",
"get_cell",
"(",
"*",
"labels",
")",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/eager/monitoring.py#L251-L253 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/protobuf/python/google/protobuf/service_reflection.py | python | _ServiceBuilder.BuildService | (self, cls) | Constructs the service class.
Args:
cls: The class that will be constructed. | Constructs the service class. | [
"Constructs",
"the",
"service",
"class",
"."
] | def BuildService(self, cls):
"""Constructs the service class.
Args:
cls: The class that will be constructed.
"""
# CallMethod needs to operate with an instance of the Service class. This
# internal wrapper function exists only to be able to pass the service
# instance to the method that ... | [
"def",
"BuildService",
"(",
"self",
",",
"cls",
")",
":",
"# CallMethod needs to operate with an instance of the Service class. This",
"# internal wrapper function exists only to be able to pass the service",
"# instance to the method that does the real CallMethod work.",
"def",
"_WrapCallMe... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/google/protobuf/service_reflection.py#L133-L154 | ||
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | external/tools/build/v2/build/property_set.py | python | refine_from_user_input | (parent_requirements, specification, jamfile_module,
location) | return parent_requirements.refine(requirements) | Refines requirements with requirements provided by the user.
Specially handles "-<property>value" syntax in specification
to remove given requirements.
- parent-requirements -- property-set object with requirements
to refine
- specification -- string list of requirements provided by the use
... | Refines requirements with requirements provided by the user.
Specially handles "-<property>value" syntax in specification
to remove given requirements.
- parent-requirements -- property-set object with requirements
to refine
- specification -- string list of requirements provided by the use
... | [
"Refines",
"requirements",
"with",
"requirements",
"provided",
"by",
"the",
"user",
".",
"Specially",
"handles",
"-",
"<property",
">",
"value",
"syntax",
"in",
"specification",
"to",
"remove",
"given",
"requirements",
".",
"-",
"parent",
"-",
"requirements",
"-... | def refine_from_user_input(parent_requirements, specification, jamfile_module,
location):
"""Refines requirements with requirements provided by the user.
Specially handles "-<property>value" syntax in specification
to remove given requirements.
- parent-requirements -- prope... | [
"def",
"refine_from_user_input",
"(",
"parent_requirements",
",",
"specification",
",",
"jamfile_module",
",",
"location",
")",
":",
"if",
"not",
"specification",
":",
"return",
"parent_requirements",
"add_requirements",
"=",
"[",
"]",
"remove_requirements",
"=",
"[",... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/external/tools/build/v2/build/property_set.py#L84-L124 | |
baidu/bigflow | 449245016c0df7d1252e85581e588bfc60cefad3 | bigflow_python/python/bigflow/pipeline/spark_pipeline.py | python | SparkPipeline.run | (self) | 立刻运行Pipeline并等待结束
Raises:
BigflowRuntimeException: 若运行期出错抛出此异常 | 立刻运行Pipeline并等待结束 | [
"立刻运行Pipeline并等待结束"
] | def run(self):
"""
立刻运行Pipeline并等待结束
Raises:
BigflowRuntimeException: 若运行期出错抛出此异常
"""
self._before_run()
try:
commit_args = []
for key, value in self._hadoop_config.iteritems():
commit_args.extend(["-D", key + "=" + valu... | [
"def",
"run",
"(",
"self",
")",
":",
"self",
".",
"_before_run",
"(",
")",
"try",
":",
"commit_args",
"=",
"[",
"]",
"for",
"key",
",",
"value",
"in",
"self",
".",
"_hadoop_config",
".",
"iteritems",
"(",
")",
":",
"commit_args",
".",
"extend",
"(",
... | https://github.com/baidu/bigflow/blob/449245016c0df7d1252e85581e588bfc60cefad3/bigflow_python/python/bigflow/pipeline/spark_pipeline.py#L483-L500 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_windows.py | python | Printer.__init__ | (self, *args, **kwargs) | __init__(self, PrintDialogData data=None) -> Printer | __init__(self, PrintDialogData data=None) -> Printer | [
"__init__",
"(",
"self",
"PrintDialogData",
"data",
"=",
"None",
")",
"-",
">",
"Printer"
] | def __init__(self, *args, **kwargs):
"""__init__(self, PrintDialogData data=None) -> Printer"""
_windows_.Printer_swiginit(self,_windows_.new_Printer(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_windows_",
".",
"Printer_swiginit",
"(",
"self",
",",
"_windows_",
".",
"new_Printer",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L5210-L5212 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/plan/robotcspace.py | python | EmbeddedRobotCSpace.disableInactiveCollisions | (self) | This modifies the collider in ambientspace to only check collisions
between moving pairs. Should be called before `setup()` in most cases. | This modifies the collider in ambientspace to only check collisions
between moving pairs. Should be called before `setup()` in most cases. | [
"This",
"modifies",
"the",
"collider",
"in",
"ambientspace",
"to",
"only",
"check",
"collisions",
"between",
"moving",
"pairs",
".",
"Should",
"be",
"called",
"before",
"setup",
"()",
"in",
"most",
"cases",
"."
] | def disableInactiveCollisions(self):
"""This modifies the collider in ambientspace to only check collisions
between moving pairs. Should be called before `setup()` in most cases.
"""
robot = self.robot
collider = self.ambientspace.collider
subset = self.mapping
... | [
"def",
"disableInactiveCollisions",
"(",
"self",
")",
":",
"robot",
"=",
"self",
".",
"robot",
"collider",
"=",
"self",
".",
"ambientspace",
".",
"collider",
"subset",
"=",
"self",
".",
"mapping",
"active",
"=",
"[",
"False",
"]",
"*",
"robot",
".",
"num... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/plan/robotcspace.py#L399-L427 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.