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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cmu-db/noisepage | 79276e68fe83322f1249e8a8be96bd63c583ae56 | build-support/cpplint.py | python | _SetQuiet | (quiet) | return _cpplint_state.SetQuiet(quiet) | Set the module's quiet status, and return previous setting. | Set the module's quiet status, and return previous setting. | [
"Set",
"the",
"module",
"s",
"quiet",
"status",
"and",
"return",
"previous",
"setting",
"."
] | def _SetQuiet(quiet):
"""Set the module's quiet status, and return previous setting."""
return _cpplint_state.SetQuiet(quiet) | [
"def",
"_SetQuiet",
"(",
"quiet",
")",
":",
"return",
"_cpplint_state",
".",
"SetQuiet",
"(",
"quiet",
")"
] | https://github.com/cmu-db/noisepage/blob/79276e68fe83322f1249e8a8be96bd63c583ae56/build-support/cpplint.py#L1184-L1186 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/util/timeout.py | python | Timeout.from_float | (cls, timeout) | return Timeout(read=timeout, connect=timeout) | Create a new Timeout from a legacy timeout value.
The timeout value used by httplib.py sets the same timeout on the
connect(), and recv() socket requests. This creates a :class:`Timeout`
object that sets the individual timeouts to the ``timeout`` value
passed to this function.
... | Create a new Timeout from a legacy timeout value. | [
"Create",
"a",
"new",
"Timeout",
"from",
"a",
"legacy",
"timeout",
"value",
"."
] | def from_float(cls, timeout):
"""Create a new Timeout from a legacy timeout value.
The timeout value used by httplib.py sets the same timeout on the
connect(), and recv() socket requests. This creates a :class:`Timeout`
object that sets the individual timeouts to the ``timeout`` value
... | [
"def",
"from_float",
"(",
"cls",
",",
"timeout",
")",
":",
"return",
"Timeout",
"(",
"read",
"=",
"timeout",
",",
"connect",
"=",
"timeout",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/util/timeout.py#L166-L179 | |
bigartm/bigartm | 47e37f982de87aa67bfd475ff1f39da696b181b3 | python/artm/regularizers.py | python | DecorrelatorPhiRegularizer.__init__ | (self, name=None, tau=1.0, gamma=None, class_ids=None,
topic_names=None, topic_pairs=None, config=None) | :param str name: the identifier of regularizer, will be auto-generated if not specified
:param float tau: the coefficient of regularization for this regularizer\
See SmoothSparsePhiRegularizer documentation for further details.
:param float gamma: coefficient of topics individu... | :param str name: the identifier of regularizer, will be auto-generated if not specified
:param float tau: the coefficient of regularization for this regularizer\
See SmoothSparsePhiRegularizer documentation for further details.
:param float gamma: coefficient of topics individu... | [
":",
"param",
"str",
"name",
":",
"the",
"identifier",
"of",
"regularizer",
"will",
"be",
"auto",
"-",
"generated",
"if",
"not",
"specified",
":",
"param",
"float",
"tau",
":",
"the",
"coefficient",
"of",
"regularization",
"for",
"this",
"regularizer",
"\\",... | def __init__(self, name=None, tau=1.0, gamma=None, class_ids=None,
topic_names=None, topic_pairs=None, config=None):
"""
:param str name: the identifier of regularizer, will be auto-generated if not specified
:param float tau: the coefficient of regularization for this regulariz... | [
"def",
"__init__",
"(",
"self",
",",
"name",
"=",
"None",
",",
"tau",
"=",
"1.0",
",",
"gamma",
"=",
"None",
",",
"class_ids",
"=",
"None",
",",
"topic_names",
"=",
"None",
",",
"topic_pairs",
"=",
"None",
",",
"config",
"=",
"None",
")",
":",
"Bas... | https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/python/artm/regularizers.py#L527-L562 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | FindWindowByLabel | (*args, **kwargs) | return _core_.FindWindowByLabel(*args, **kwargs) | FindWindowByLabel(String label, Window parent=None) -> Window
Find a window by its label. Depending on the type of window, the label
may be a window title or panel item label. If parent is None, the
search will start from all top-level frames and dialog boxes; if
non-None, the search will be limited to... | FindWindowByLabel(String label, Window parent=None) -> Window | [
"FindWindowByLabel",
"(",
"String",
"label",
"Window",
"parent",
"=",
"None",
")",
"-",
">",
"Window"
] | def FindWindowByLabel(*args, **kwargs):
"""
FindWindowByLabel(String label, Window parent=None) -> Window
Find a window by its label. Depending on the type of window, the label
may be a window title or panel item label. If parent is None, the
search will start from all top-level frames and dialog box... | [
"def",
"FindWindowByLabel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"FindWindowByLabel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L11827-L11837 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/graph_editor/select.py | python | check_cios | (control_inputs=False, control_outputs=None, control_ios=None) | return control_inputs, control_outputs | Do various check on control_inputs and control_outputs.
Args:
control_inputs: A boolean indicating whether control inputs are enabled.
control_outputs: An instance of util.ControlOutputs or None. If not None,
control outputs are enabled.
control_ios: An instance of util.ControlOutputs or None. If ... | Do various check on control_inputs and control_outputs. | [
"Do",
"various",
"check",
"on",
"control_inputs",
"and",
"control_outputs",
"."
] | def check_cios(control_inputs=False, control_outputs=None, control_ios=None):
"""Do various check on control_inputs and control_outputs.
Args:
control_inputs: A boolean indicating whether control inputs are enabled.
control_outputs: An instance of util.ControlOutputs or None. If not None,
control out... | [
"def",
"check_cios",
"(",
"control_inputs",
"=",
"False",
",",
"control_outputs",
"=",
"None",
",",
"control_ios",
"=",
"None",
")",
":",
"if",
"control_ios",
"is",
"not",
"None",
":",
"if",
"not",
"isinstance",
"(",
"control_ios",
",",
"util",
".",
"Contr... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/graph_editor/select.py#L188-L221 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/toolkits/_tf_utils.py | python | convert_conv1d_tf_to_coreml | (conv_weights) | return conv_weights | Convolutional weights from TensorFlow in the format [kernelWidth, kernelChannels, outputChannels]
are converted back in CoreML specifications [outputChannels, kernelChannels, kernelHeight, kernelWidth].
Parameters
----------
conv_weights: 3d numpy array of shape
[kernelWidth, kernelChannels, out... | Convolutional weights from TensorFlow in the format [kernelWidth, kernelChannels, outputChannels]
are converted back in CoreML specifications [outputChannels, kernelChannels, kernelHeight, kernelWidth]. | [
"Convolutional",
"weights",
"from",
"TensorFlow",
"in",
"the",
"format",
"[",
"kernelWidth",
"kernelChannels",
"outputChannels",
"]",
"are",
"converted",
"back",
"in",
"CoreML",
"specifications",
"[",
"outputChannels",
"kernelChannels",
"kernelHeight",
"kernelWidth",
"]... | def convert_conv1d_tf_to_coreml(conv_weights):
"""
Convolutional weights from TensorFlow in the format [kernelWidth, kernelChannels, outputChannels]
are converted back in CoreML specifications [outputChannels, kernelChannels, kernelHeight, kernelWidth].
Parameters
----------
conv_weights: 3d nu... | [
"def",
"convert_conv1d_tf_to_coreml",
"(",
"conv_weights",
")",
":",
"conv_weights",
"=",
"np",
".",
"expand_dims",
"(",
"conv_weights",
",",
"axis",
"=",
"2",
")",
"conv_weights",
"=",
"np",
".",
"transpose",
"(",
"conv_weights",
",",
"(",
"3",
",",
"1",
... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/_tf_utils.py#L161-L180 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/learn/python/learn/supervised_session.py | python | Scaffold._get_or_default | (arg_name, collection_key, default_constructor) | return op | Get from cache or create a default operation. | Get from cache or create a default operation. | [
"Get",
"from",
"cache",
"or",
"create",
"a",
"default",
"operation",
"."
] | def _get_or_default(arg_name, collection_key, default_constructor):
"""Get from cache or create a default operation."""
elements = ops.get_collection(collection_key)
if elements:
if len(elements) > 1:
raise RuntimeError('More than one item in the collection "%s". '
'... | [
"def",
"_get_or_default",
"(",
"arg_name",
",",
"collection_key",
",",
"default_constructor",
")",
":",
"elements",
"=",
"ops",
".",
"get_collection",
"(",
"collection_key",
")",
"if",
"elements",
":",
"if",
"len",
"(",
"elements",
")",
">",
"1",
":",
"raise... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/supervised_session.py#L202-L216 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/stc.py | python | StyledTextCtrl.LineUpExtend | (*args, **kwargs) | return _stc.StyledTextCtrl_LineUpExtend(*args, **kwargs) | LineUpExtend(self)
Move caret up one line extending selection to new caret position. | LineUpExtend(self) | [
"LineUpExtend",
"(",
"self",
")"
] | def LineUpExtend(*args, **kwargs):
"""
LineUpExtend(self)
Move caret up one line extending selection to new caret position.
"""
return _stc.StyledTextCtrl_LineUpExtend(*args, **kwargs) | [
"def",
"LineUpExtend",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_LineUpExtend",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L4352-L4358 | |
jakobkogler/Algorithm-DataStructures | b7cc8bb7326385a983d2a03f2bfe45223783278b | RangeQuery/BinaryIndexedTree.py | python | BIT.__init__ | (self, list) | Initialize BIT with list in O(n) | Initialize BIT with list in O(n) | [
"Initialize",
"BIT",
"with",
"list",
"in",
"O",
"(",
"n",
")"
] | def __init__(self, list):
""""Initialize BIT with list in O(n)"""
self.array = [0] + list
for idx in range(1, len(self.array)):
idx2 = idx + (idx & -idx)
if idx2 < len(self.array):
self.array[idx2] += self.array[idx] | [
"def",
"__init__",
"(",
"self",
",",
"list",
")",
":",
"self",
".",
"array",
"=",
"[",
"0",
"]",
"+",
"list",
"for",
"idx",
"in",
"range",
"(",
"1",
",",
"len",
"(",
"self",
".",
"array",
")",
")",
":",
"idx2",
"=",
"idx",
"+",
"(",
"idx",
... | https://github.com/jakobkogler/Algorithm-DataStructures/blob/b7cc8bb7326385a983d2a03f2bfe45223783278b/RangeQuery/BinaryIndexedTree.py#L10-L16 | ||
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/pyserial/serial/serialposix.py | python | Serial.fileno | (self) | return self.fd | \
For easier use of the serial port instance with select.
WARNING: this function is not portable to different platforms! | \
For easier use of the serial port instance with select.
WARNING: this function is not portable to different platforms! | [
"\\",
"For",
"easier",
"use",
"of",
"the",
"serial",
"port",
"instance",
"with",
"select",
".",
"WARNING",
":",
"this",
"function",
"is",
"not",
"portable",
"to",
"different",
"platforms!"
] | def fileno(self):
"""\
For easier use of the serial port instance with select.
WARNING: this function is not portable to different platforms!
"""
if not self.is_open:
raise portNotOpenError
return self.fd | [
"def",
"fileno",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"is_open",
":",
"raise",
"portNotOpenError",
"return",
"self",
".",
"fd"
] | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/pyserial/serial/serialposix.py#L679-L686 | |
alibaba/weex_js_engine | 2bdf4b6f020c1fc99c63f649718f6faf7e27fdde | jni/v8core/v8/build/gyp/pylib/gyp/generator/eclipse.py | python | GetAllDefines | (target_list, target_dicts, data, config_name) | return all_defines | Calculate the defines for a project.
Returns:
A dict that includes explict defines declared in gyp files along with all of
the default defines that the compiler uses. | Calculate the defines for a project. | [
"Calculate",
"the",
"defines",
"for",
"a",
"project",
"."
] | def GetAllDefines(target_list, target_dicts, data, config_name):
"""Calculate the defines for a project.
Returns:
A dict that includes explict defines declared in gyp files along with all of
the default defines that the compiler uses.
"""
# Get defines declared in the gyp files.
all_defines = {}
f... | [
"def",
"GetAllDefines",
"(",
"target_list",
",",
"target_dicts",
",",
"data",
",",
"config_name",
")",
":",
"# Get defines declared in the gyp files.",
"all_defines",
"=",
"{",
"}",
"for",
"target_name",
"in",
"target_list",
":",
"target",
"=",
"target_dicts",
"[",
... | https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/generator/eclipse.py#L148-L193 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/cpplint.py | python | CheckSectionSpacing | (filename, clean_lines, class_info, linenum, error) | Checks for additional blank line issues related to sections.
Currently the only thing checked here is blank line before protected/private.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
class_info: A _ClassInfo objects.
linenum: The number ... | Checks for additional blank line issues related to sections. | [
"Checks",
"for",
"additional",
"blank",
"line",
"issues",
"related",
"to",
"sections",
"."
] | def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error):
"""Checks for additional blank line issues related to sections.
Currently the only thing checked here is blank line before protected/private.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance co... | [
"def",
"CheckSectionSpacing",
"(",
"filename",
",",
"clean_lines",
",",
"class_info",
",",
"linenum",
",",
"error",
")",
":",
"# Skip checks if the class is small, where small means 25 lines or less.",
"# 25 lines seems like a good cutoff since that's the usual height of",
"# termina... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/cpplint.py#L3792-L3844 | ||
rootm0s/Protectors | 5b3f4d11687a5955caf9c3af30666c4bfc2c19ab | OWASP-ZSC/module/readline_windows/pyreadline/modes/notemacs.py | python | NotEmacsMode.kill_whole_line | (self, e) | Kill all characters on the current line, no matter where point
is. By default, this is unbound. | Kill all characters on the current line, no matter where point
is. By default, this is unbound. | [
"Kill",
"all",
"characters",
"on",
"the",
"current",
"line",
"no",
"matter",
"where",
"point",
"is",
".",
"By",
"default",
"this",
"is",
"unbound",
"."
] | def kill_whole_line(self, e): # ()
'''Kill all characters on the current line, no matter where point
is. By default, this is unbound.'''
self.l_buffer.kill_whole_line() | [
"def",
"kill_whole_line",
"(",
"self",
",",
"e",
")",
":",
"# ()",
"self",
".",
"l_buffer",
".",
"kill_whole_line",
"(",
")"
] | https://github.com/rootm0s/Protectors/blob/5b3f4d11687a5955caf9c3af30666c4bfc2c19ab/OWASP-ZSC/module/readline_windows/pyreadline/modes/notemacs.py#L342-L345 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/toolkits/drawing_classifier/drawing_classifier.py | python | _raise_error_if_not_drawing_classifier_input_sframe | (dataset, feature, target) | Performs some sanity checks on the SFrame provided as input to
`turicreate.drawing_classifier.create` and raises a ToolkitError
if something in the dataset is missing or wrong. | Performs some sanity checks on the SFrame provided as input to
`turicreate.drawing_classifier.create` and raises a ToolkitError
if something in the dataset is missing or wrong. | [
"Performs",
"some",
"sanity",
"checks",
"on",
"the",
"SFrame",
"provided",
"as",
"input",
"to",
"turicreate",
".",
"drawing_classifier",
".",
"create",
"and",
"raises",
"a",
"ToolkitError",
"if",
"something",
"in",
"the",
"dataset",
"is",
"missing",
"or",
"wro... | def _raise_error_if_not_drawing_classifier_input_sframe(dataset, feature, target):
"""
Performs some sanity checks on the SFrame provided as input to
`turicreate.drawing_classifier.create` and raises a ToolkitError
if something in the dataset is missing or wrong.
"""
from turicreate.toolkits._in... | [
"def",
"_raise_error_if_not_drawing_classifier_input_sframe",
"(",
"dataset",
",",
"feature",
",",
"target",
")",
":",
"from",
"turicreate",
".",
"toolkits",
".",
"_internal_utils",
"import",
"_raise_error_if_not_sframe",
"_raise_error_if_not_sframe",
"(",
"dataset",
")",
... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/drawing_classifier/drawing_classifier.py#L25-L53 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Path/PathFeedRate.py | python | setFeedRate | (commandlist, ToolController) | return commandlist | Set the appropriate feed rate for a list of Path commands using the information from a Tool Controller
Every motion command in the list will have a feed rate parameter added or overwritten based
on the information stored in the tool controller. If a motion is a plunge (vertical) motion, the
VertFeed value ... | Set the appropriate feed rate for a list of Path commands using the information from a Tool Controller | [
"Set",
"the",
"appropriate",
"feed",
"rate",
"for",
"a",
"list",
"of",
"Path",
"commands",
"using",
"the",
"information",
"from",
"a",
"Tool",
"Controller"
] | def setFeedRate(commandlist, ToolController):
"""Set the appropriate feed rate for a list of Path commands using the information from a Tool Controller
Every motion command in the list will have a feed rate parameter added or overwritten based
on the information stored in the tool controller. If a motion i... | [
"def",
"setFeedRate",
"(",
"commandlist",
",",
"ToolController",
")",
":",
"def",
"_isVertical",
"(",
"currentposition",
",",
"command",
")",
":",
"x",
"=",
"(",
"command",
".",
"Parameters",
"[",
"\"X\"",
"]",
"if",
"\"X\"",
"in",
"command",
".",
"Paramet... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathFeedRate.py#L46-L99 | |
NeoGeographyToolkit/StereoPipeline | eedf54a919fb5cce1ab0e280bb0df4050763aa11 | src/asp/IceBridge/icebridge_common.py | python | nonBlockingRawInput | (prompt='', timeout=20) | return '' | Return a key if pressed or an empty string otherwise.
Waits for timeout, non-blocking. | Return a key if pressed or an empty string otherwise.
Waits for timeout, non-blocking. | [
"Return",
"a",
"key",
"if",
"pressed",
"or",
"an",
"empty",
"string",
"otherwise",
".",
"Waits",
"for",
"timeout",
"non",
"-",
"blocking",
"."
] | def nonBlockingRawInput(prompt='', timeout=20):
'''Return a key if pressed or an empty string otherwise.
Waits for timeout, non-blocking.'''
signal.signal(signal.SIGALRM, alarmHandler)
signal.alarm(timeout)
try:
text = raw_input(prompt)
signal.alarm(0)
return text
exce... | [
"def",
"nonBlockingRawInput",
"(",
"prompt",
"=",
"''",
",",
"timeout",
"=",
"20",
")",
":",
"signal",
".",
"signal",
"(",
"signal",
".",
"SIGALRM",
",",
"alarmHandler",
")",
"signal",
".",
"alarm",
"(",
"timeout",
")",
"try",
":",
"text",
"=",
"raw_in... | https://github.com/NeoGeographyToolkit/StereoPipeline/blob/eedf54a919fb5cce1ab0e280bb0df4050763aa11/src/asp/IceBridge/icebridge_common.py#L1389-L1401 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/symbol/symbol.py | python | Symbol.exp | (self, *args, **kwargs) | return op.exp(self, *args, **kwargs) | Convenience fluent method for :py:func:`exp`.
The arguments are the same as for :py:func:`exp`, with
this array as data. | Convenience fluent method for :py:func:`exp`. | [
"Convenience",
"fluent",
"method",
"for",
":",
"py",
":",
"func",
":",
"exp",
"."
] | def exp(self, *args, **kwargs):
"""Convenience fluent method for :py:func:`exp`.
The arguments are the same as for :py:func:`exp`, with
this array as data.
"""
return op.exp(self, *args, **kwargs) | [
"def",
"exp",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"op",
".",
"exp",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/symbol/symbol.py#L2477-L2483 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/types/containers.py | python | BaseTuple.from_types | (cls, tys, pyclass=None) | Instantiate the right tuple type for the given element types. | Instantiate the right tuple type for the given element types. | [
"Instantiate",
"the",
"right",
"tuple",
"type",
"for",
"the",
"given",
"element",
"types",
"."
] | def from_types(cls, tys, pyclass=None):
"""
Instantiate the right tuple type for the given element types.
"""
if pyclass is not None and pyclass is not tuple:
# A subclass => is it a namedtuple?
assert issubclass(pyclass, tuple)
if hasattr(pyclass, "_a... | [
"def",
"from_types",
"(",
"cls",
",",
"tys",
",",
"pyclass",
"=",
"None",
")",
":",
"if",
"pyclass",
"is",
"not",
"None",
"and",
"pyclass",
"is",
"not",
"tuple",
":",
"# A subclass => is it a namedtuple?",
"assert",
"issubclass",
"(",
"pyclass",
",",
"tuple"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/types/containers.py#L125-L145 | ||
rsummers11/CADLab | 976ed959a0b5208bb4173127a7ef732ac73a9b6f | lesion_detector_3DCE/rcnn/dataset/pascal_voc_eval.py | python | voc_eval | (detpath, annopath, imageset_file, classname, annocache, ovthresh=0.5, use_07_metric=False) | return rec, prec, ap | pascal voc evaluation
:param detpath: detection results detpath.format(classname)
:param annopath: annotations annopath.format(classname)
:param imageset_file: text file containing list of images
:param classname: category name
:param annocache: caching annotations
:param ovthresh: overlap thres... | pascal voc evaluation
:param detpath: detection results detpath.format(classname)
:param annopath: annotations annopath.format(classname)
:param imageset_file: text file containing list of images
:param classname: category name
:param annocache: caching annotations
:param ovthresh: overlap thres... | [
"pascal",
"voc",
"evaluation",
":",
"param",
"detpath",
":",
"detection",
"results",
"detpath",
".",
"format",
"(",
"classname",
")",
":",
"param",
"annopath",
":",
"annotations",
"annopath",
".",
"format",
"(",
"classname",
")",
":",
"param",
"imageset_file",... | def voc_eval(detpath, annopath, imageset_file, classname, annocache, ovthresh=0.5, use_07_metric=False):
"""
pascal voc evaluation
:param detpath: detection results detpath.format(classname)
:param annopath: annotations annopath.format(classname)
:param imageset_file: text file containing list of im... | [
"def",
"voc_eval",
"(",
"detpath",
",",
"annopath",
",",
"imageset_file",
",",
"classname",
",",
"annocache",
",",
"ovthresh",
"=",
"0.5",
",",
"use_07_metric",
"=",
"False",
")",
":",
"with",
"open",
"(",
"imageset_file",
",",
"'r'",
")",
"as",
"f",
":"... | https://github.com/rsummers11/CADLab/blob/976ed959a0b5208bb4173127a7ef732ac73a9b6f/lesion_detector_3DCE/rcnn/dataset/pascal_voc_eval.py#L67-L175 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | python | ComputeOutputDir | (params) | return os.path.normpath(os.path.join(generator_dir, output_dir)) | Returns the path from the toplevel_dir to the build output directory. | Returns the path from the toplevel_dir to the build output directory. | [
"Returns",
"the",
"path",
"from",
"the",
"toplevel_dir",
"to",
"the",
"build",
"output",
"directory",
"."
] | def ComputeOutputDir(params):
"""Returns the path from the toplevel_dir to the build output directory."""
# generator_dir: relative path from pwd to where make puts build files.
# Makes migrating from make to ninja easier, ninja doesn't put anything here.
generator_dir = os.path.relpath(params["options"... | [
"def",
"ComputeOutputDir",
"(",
"params",
")",
":",
"# generator_dir: relative path from pwd to where make puts build files.",
"# Makes migrating from make to ninja easier, ninja doesn't put anything here.",
"generator_dir",
"=",
"os",
".",
"path",
".",
"relpath",
"(",
"params",
"[... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py#L2047-L2057 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.GetIdentifier | (*args, **kwargs) | return _stc.StyledTextCtrl_GetIdentifier(*args, **kwargs) | GetIdentifier(self) -> int | GetIdentifier(self) -> int | [
"GetIdentifier",
"(",
"self",
")",
"-",
">",
"int"
] | def GetIdentifier(*args, **kwargs):
"""GetIdentifier(self) -> int"""
return _stc.StyledTextCtrl_GetIdentifier(*args, **kwargs) | [
"def",
"GetIdentifier",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_GetIdentifier",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L6357-L6359 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Util/number.py | python | inverse | (u, v) | return u1 | The inverse of :data:`u` *mod* :data:`v`. | The inverse of :data:`u` *mod* :data:`v`. | [
"The",
"inverse",
"of",
":",
"data",
":",
"u",
"*",
"mod",
"*",
":",
"data",
":",
"v",
"."
] | def inverse(u, v):
"""The inverse of :data:`u` *mod* :data:`v`."""
u3, v3 = u, v
u1, v1 = 1, 0
while v3 > 0:
q = u3 // v3
u1, v1 = v1, u1 - v1*q
u3, v3 = v3, u3 - v3*q
while u1<0:
u1 = u1 + v
return u1 | [
"def",
"inverse",
"(",
"u",
",",
"v",
")",
":",
"u3",
",",
"v3",
"=",
"u",
",",
"v",
"u1",
",",
"v1",
"=",
"1",
",",
"0",
"while",
"v3",
">",
"0",
":",
"q",
"=",
"u3",
"//",
"v3",
"u1",
",",
"v1",
"=",
"v1",
",",
"u1",
"-",
"v1",
"*",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Util/number.py#L122-L133 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/linecache.py | python | checkcache | (filename=None) | Discard cache entries that are out of date.
(This is not checked upon each call!) | Discard cache entries that are out of date.
(This is not checked upon each call!) | [
"Discard",
"cache",
"entries",
"that",
"are",
"out",
"of",
"date",
".",
"(",
"This",
"is",
"not",
"checked",
"upon",
"each",
"call!",
")"
] | def checkcache(filename=None):
"""Discard cache entries that are out of date.
(This is not checked upon each call!)"""
if filename is None:
filenames = list(cache.keys())
elif filename in cache:
filenames = [filename]
else:
return
for filename in filenames:
entr... | [
"def",
"checkcache",
"(",
"filename",
"=",
"None",
")",
":",
"if",
"filename",
"is",
"None",
":",
"filenames",
"=",
"list",
"(",
"cache",
".",
"keys",
"(",
")",
")",
"elif",
"filename",
"in",
"cache",
":",
"filenames",
"=",
"[",
"filename",
"]",
"els... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/linecache.py#L52-L77 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/xcode_emulation.py | python | _AddIOSDeviceConfigurations | (targets) | return targets | Clone all targets and append -iphoneos to the name. Configure these targets
to build for iOS devices and use correct architectures for those builds. | Clone all targets and append -iphoneos to the name. Configure these targets
to build for iOS devices and use correct architectures for those builds. | [
"Clone",
"all",
"targets",
"and",
"append",
"-",
"iphoneos",
"to",
"the",
"name",
".",
"Configure",
"these",
"targets",
"to",
"build",
"for",
"iOS",
"devices",
"and",
"use",
"correct",
"architectures",
"for",
"those",
"builds",
"."
] | def _AddIOSDeviceConfigurations(targets):
"""Clone all targets and append -iphoneos to the name. Configure these targets
to build for iOS devices and use correct architectures for those builds."""
for target_dict in targets.itervalues():
toolset = target_dict['toolset']
configs = target_dict['configuratio... | [
"def",
"_AddIOSDeviceConfigurations",
"(",
"targets",
")",
":",
"for",
"target_dict",
"in",
"targets",
".",
"itervalues",
"(",
")",
":",
"toolset",
"=",
"target_dict",
"[",
"'toolset'",
"]",
"configs",
"=",
"target_dict",
"[",
"'configurations'",
"]",
"for",
"... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/xcode_emulation.py#L1609-L1621 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | PyEnumProperty.__init__ | (self, *args, **kwargs) | __init__(self, String label=(*wxPGProperty::sm_wxPG_LABEL), String name=(*wxPGProperty::sm_wxPG_LABEL),
wxArrayString labels=wxArrayString(),
wxArrayInt values=wxArrayInt(),
int value=0) -> PyEnumProperty | __init__(self, String label=(*wxPGProperty::sm_wxPG_LABEL), String name=(*wxPGProperty::sm_wxPG_LABEL),
wxArrayString labels=wxArrayString(),
wxArrayInt values=wxArrayInt(),
int value=0) -> PyEnumProperty | [
"__init__",
"(",
"self",
"String",
"label",
"=",
"(",
"*",
"wxPGProperty",
"::",
"sm_wxPG_LABEL",
")",
"String",
"name",
"=",
"(",
"*",
"wxPGProperty",
"::",
"sm_wxPG_LABEL",
")",
"wxArrayString",
"labels",
"=",
"wxArrayString",
"()",
"wxArrayInt",
"values",
"... | def __init__(self, *args, **kwargs):
"""
__init__(self, String label=(*wxPGProperty::sm_wxPG_LABEL), String name=(*wxPGProperty::sm_wxPG_LABEL),
wxArrayString labels=wxArrayString(),
wxArrayInt values=wxArrayInt(),
int value=0) -> PyEnumProperty
"""
... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_propgrid",
".",
"PyEnumProperty_swiginit",
"(",
"self",
",",
"_propgrid",
".",
"new_PyEnumProperty",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"self",
"."... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L3873-L3881 | ||
KDE/krita | 10ea63984e00366865769c193ab298de73a59c5c | plugins/python/scripter/ui_scripter/editor/linenumberarea.py | python | LineNumberArea.paintEvent | (self, event) | It Invokes the draw method(lineNumberAreaPaintEvent) in CodeEditor | It Invokes the draw method(lineNumberAreaPaintEvent) in CodeEditor | [
"It",
"Invokes",
"the",
"draw",
"method",
"(",
"lineNumberAreaPaintEvent",
")",
"in",
"CodeEditor"
] | def paintEvent(self, event):
"""It Invokes the draw method(lineNumberAreaPaintEvent) in CodeEditor"""
self.codeEditor.lineNumberAreaPaintEvent(event) | [
"def",
"paintEvent",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"codeEditor",
".",
"lineNumberAreaPaintEvent",
"(",
"event",
")"
] | https://github.com/KDE/krita/blob/10ea63984e00366865769c193ab298de73a59c5c/plugins/python/scripter/ui_scripter/editor/linenumberarea.py#L19-L21 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/boto3/resources/response.py | python | build_empty_response | (search_path, operation_name, service_model) | return response | Creates an appropriate empty response for the type that is expected,
based on the service model's shape type. For example, a value that
is normally a list would then return an empty list. A structure would
return an empty dict, and a number would return None.
:type search_path: string
:param search... | Creates an appropriate empty response for the type that is expected,
based on the service model's shape type. For example, a value that
is normally a list would then return an empty list. A structure would
return an empty dict, and a number would return None. | [
"Creates",
"an",
"appropriate",
"empty",
"response",
"for",
"the",
"type",
"that",
"is",
"expected",
"based",
"on",
"the",
"service",
"model",
"s",
"shape",
"type",
".",
"For",
"example",
"a",
"value",
"that",
"is",
"normally",
"a",
"list",
"would",
"then"... | def build_empty_response(search_path, operation_name, service_model):
"""
Creates an appropriate empty response for the type that is expected,
based on the service model's shape type. For example, a value that
is normally a list would then return an empty list. A structure would
return an empty dict... | [
"def",
"build_empty_response",
"(",
"search_path",
",",
"operation_name",
",",
"service_model",
")",
":",
"response",
"=",
"None",
"operation_model",
"=",
"service_model",
".",
"operation_model",
"(",
"operation_name",
")",
"shape",
"=",
"operation_model",
".",
"out... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/boto3/resources/response.py#L79-L125 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | samples/networking/03-distributed-node/client.py | python | GameClientRepository.syncReady | (self) | Now we've got the TimeManager manifested, and we're in
sync with the server time. Now we can enter the world. Check
to see if we've received our doIdBase yet. | Now we've got the TimeManager manifested, and we're in
sync with the server time. Now we can enter the world. Check
to see if we've received our doIdBase yet. | [
"Now",
"we",
"ve",
"got",
"the",
"TimeManager",
"manifested",
"and",
"we",
"re",
"in",
"sync",
"with",
"the",
"server",
"time",
".",
"Now",
"we",
"can",
"enter",
"the",
"world",
".",
"Check",
"to",
"see",
"if",
"we",
"ve",
"received",
"our",
"doIdBase"... | def syncReady(self):
""" Now we've got the TimeManager manifested, and we're in
sync with the server time. Now we can enter the world. Check
to see if we've received our doIdBase yet. """
# This method checks whether we actually have a valid doID range
# to create distributed ... | [
"def",
"syncReady",
"(",
"self",
")",
":",
"# This method checks whether we actually have a valid doID range",
"# to create distributed objects yet",
"if",
"self",
".",
"haveCreateAuthority",
"(",
")",
":",
"# we already have one",
"self",
".",
"gotCreateReady",
"(",
")",
"... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/samples/networking/03-distributed-node/client.py#L103-L115 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/plotting/markers.py | python | RangeMarker.set_lower_bound | (self, minimum) | Sets the minimum bound for the range marker.
:param minimum: The minimum bound for the range marker. | Sets the minimum bound for the range marker.
:param minimum: The minimum bound for the range marker. | [
"Sets",
"the",
"minimum",
"bound",
"for",
"the",
"range",
"marker",
".",
":",
"param",
"minimum",
":",
"The",
"minimum",
"bound",
"for",
"the",
"range",
"marker",
"."
] | def set_lower_bound(self, minimum):
"""
Sets the minimum bound for the range marker.
:param minimum: The minimum bound for the range marker.
"""
self.min_marker.set_lower_bound(minimum)
self.max_marker.set_lower_bound(minimum) | [
"def",
"set_lower_bound",
"(",
"self",
",",
"minimum",
")",
":",
"self",
".",
"min_marker",
".",
"set_lower_bound",
"(",
"minimum",
")",
"self",
".",
"max_marker",
".",
"set_lower_bound",
"(",
"minimum",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/plotting/markers.py#L1074-L1080 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pluggy/py2/pluggy/manager.py | python | PluginManager.get_plugins | (self) | return set(self._plugin2hookcallers) | return the set of registered plugins. | return the set of registered plugins. | [
"return",
"the",
"set",
"of",
"registered",
"plugins",
"."
] | def get_plugins(self):
""" return the set of registered plugins. """
return set(self._plugin2hookcallers) | [
"def",
"get_plugins",
"(",
"self",
")",
":",
"return",
"set",
"(",
"self",
".",
"_plugin2hookcallers",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pluggy/py2/pluggy/manager.py#L210-L212 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/ndimage/filters.py | python | _gaussian_kernel1d | (sigma, order, radius) | return phi_x | Computes a 1D Gaussian convolution kernel. | Computes a 1D Gaussian convolution kernel. | [
"Computes",
"a",
"1D",
"Gaussian",
"convolution",
"kernel",
"."
] | def _gaussian_kernel1d(sigma, order, radius):
"""
Computes a 1D Gaussian convolution kernel.
"""
if order < 0:
raise ValueError('order must be non-negative')
p = numpy.polynomial.Polynomial([0, 0, -0.5 / (sigma * sigma)])
x = numpy.arange(-radius, radius + 1)
phi_x = numpy.exp(p(x), ... | [
"def",
"_gaussian_kernel1d",
"(",
"sigma",
",",
"order",
",",
"radius",
")",
":",
"if",
"order",
"<",
"0",
":",
"raise",
"ValueError",
"(",
"'order must be non-negative'",
")",
"p",
"=",
"numpy",
".",
"polynomial",
".",
"Polynomial",
"(",
"[",
"0",
",",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/ndimage/filters.py#L136-L154 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/_pyio.py | python | IOBase.__enter__ | (self) | return self | Context management protocol. Returns self. | Context management protocol. Returns self. | [
"Context",
"management",
"protocol",
".",
"Returns",
"self",
"."
] | def __enter__(self):
"""Context management protocol. Returns self."""
self._checkClosed()
return self | [
"def",
"__enter__",
"(",
"self",
")",
":",
"self",
".",
"_checkClosed",
"(",
")",
"return",
"self"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/_pyio.py#L432-L435 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/Image.py | python | Image.tobitmap | (self, name="image") | return b"".join(
[
("#define %s_width %d\n" % (name, self.size[0])).encode("ascii"),
("#define %s_height %d\n" % (name, self.size[1])).encode("ascii"),
("static char %s_bits[] = {\n" % name).encode("ascii"),
data,
b"};",
... | Returns the image converted to an X11 bitmap.
.. note:: This method only works for mode "1" images.
:param name: The name prefix to use for the bitmap variables.
:returns: A string containing an X11 bitmap.
:raises ValueError: If the mode is not "1" | Returns the image converted to an X11 bitmap. | [
"Returns",
"the",
"image",
"converted",
"to",
"an",
"X11",
"bitmap",
"."
] | def tobitmap(self, name="image"):
"""
Returns the image converted to an X11 bitmap.
.. note:: This method only works for mode "1" images.
:param name: The name prefix to use for the bitmap variables.
:returns: A string containing an X11 bitmap.
:raises ValueError: If th... | [
"def",
"tobitmap",
"(",
"self",
",",
"name",
"=",
"\"image\"",
")",
":",
"self",
".",
"load",
"(",
")",
"if",
"self",
".",
"mode",
"!=",
"\"1\"",
":",
"raise",
"ValueError",
"(",
"\"not a bitmap\"",
")",
"data",
"=",
"self",
".",
"tobytes",
"(",
"\"x... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/Image.py#L753-L776 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/grep.py | python | walk_error | (msg) | Handle os.walk error. | Handle os.walk error. | [
"Handle",
"os",
".",
"walk",
"error",
"."
] | def walk_error(msg):
"Handle os.walk error."
print(msg) | [
"def",
"walk_error",
"(",
"msg",
")",
":",
"print",
"(",
"msg",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/grep.py#L43-L45 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/utils/extmath.py | python | row_norms | (X, squared=False) | return norms | Row-wise (squared) Euclidean norm of X.
Equivalent to np.sqrt((X * X).sum(axis=1)), but also supports sparse
matrices and does not create an X.shape-sized temporary.
Performs no input validation.
Parameters
----------
X : array_like
The input array
squared : bool, optional (defaul... | Row-wise (squared) Euclidean norm of X. | [
"Row",
"-",
"wise",
"(",
"squared",
")",
"Euclidean",
"norm",
"of",
"X",
"."
] | def row_norms(X, squared=False):
"""Row-wise (squared) Euclidean norm of X.
Equivalent to np.sqrt((X * X).sum(axis=1)), but also supports sparse
matrices and does not create an X.shape-sized temporary.
Performs no input validation.
Parameters
----------
X : array_like
The input ar... | [
"def",
"row_norms",
"(",
"X",
",",
"squared",
"=",
"False",
")",
":",
"if",
"sparse",
".",
"issparse",
"(",
"X",
")",
":",
"if",
"not",
"isinstance",
"(",
"X",
",",
"sparse",
".",
"csr_matrix",
")",
":",
"X",
"=",
"sparse",
".",
"csr_matrix",
"(",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/utils/extmath.py#L49-L78 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/combo.py | python | OwnerDrawnComboBox.__init__ | (self, *args, **kwargs) | __init__(self, Window parent, int id=-1, String value=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
wxArrayString choices=wxPyEmptyStringArray,
long style=0, Validator validator=DefaultValidator,
String name=ComboBoxNameStr) -> OwnerDrawnComboBox
... | __init__(self, Window parent, int id=-1, String value=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
wxArrayString choices=wxPyEmptyStringArray,
long style=0, Validator validator=DefaultValidator,
String name=ComboBoxNameStr) -> OwnerDrawnComboBox | [
"__init__",
"(",
"self",
"Window",
"parent",
"int",
"id",
"=",
"-",
"1",
"String",
"value",
"=",
"EmptyString",
"Point",
"pos",
"=",
"DefaultPosition",
"Size",
"size",
"=",
"DefaultSize",
"wxArrayString",
"choices",
"=",
"wxPyEmptyStringArray",
"long",
"style",
... | def __init__(self, *args, **kwargs):
"""
__init__(self, Window parent, int id=-1, String value=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
wxArrayString choices=wxPyEmptyStringArray,
long style=0, Validator validator=DefaultValidator,
... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_combo",
".",
"OwnerDrawnComboBox_swiginit",
"(",
"self",
",",
"_combo",
".",
"new_OwnerDrawnComboBox",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"self",
"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/combo.py#L820-L831 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_stc.py | python | EditraStc.GetLineStartPosition | (self, line) | return spos | Get the starting position of the given line
@param line: int
@return: int | Get the starting position of the given line
@param line: int
@return: int | [
"Get",
"the",
"starting",
"position",
"of",
"the",
"given",
"line",
"@param",
"line",
":",
"int",
"@return",
":",
"int"
] | def GetLineStartPosition(self, line):
"""Get the starting position of the given line
@param line: int
@return: int
"""
if line > 0:
spos = self.GetLineEndPosition(line-1)
if self.GetLine(line).endswith("\r\n"):
spos += 2
else:
... | [
"def",
"GetLineStartPosition",
"(",
"self",
",",
"line",
")",
":",
"if",
"line",
">",
"0",
":",
"spos",
"=",
"self",
".",
"GetLineEndPosition",
"(",
"line",
"-",
"1",
")",
"if",
"self",
".",
"GetLine",
"(",
"line",
")",
".",
"endswith",
"(",
"\"\\r\\... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_stc.py#L471-L485 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | SizerFlags.FixedMinSize | (*args, **kwargs) | return _core_.SizerFlags_FixedMinSize(*args, **kwargs) | FixedMinSize(self) -> SizerFlags
Sets the wx.FIXED_MINSIZE flag. | FixedMinSize(self) -> SizerFlags | [
"FixedMinSize",
"(",
"self",
")",
"-",
">",
"SizerFlags"
] | def FixedMinSize(*args, **kwargs):
"""
FixedMinSize(self) -> SizerFlags
Sets the wx.FIXED_MINSIZE flag.
"""
return _core_.SizerFlags_FixedMinSize(*args, **kwargs) | [
"def",
"FixedMinSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"SizerFlags_FixedMinSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L13854-L13860 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/TiffImagePlugin.py | python | ImageFileDirectory_v2.named | (self) | return {TiffTags.lookup(code).name: value for code, value in self.items()} | :returns: dict of name|key: value
Returns the complete tag dictionary, with named tags where possible. | :returns: dict of name|key: value | [
":",
"returns",
":",
"dict",
"of",
"name|key",
":",
"value"
] | def named(self):
"""
:returns: dict of name|key: value
Returns the complete tag dictionary, with named tags where possible.
"""
return {TiffTags.lookup(code).name: value for code, value in self.items()} | [
"def",
"named",
"(",
"self",
")",
":",
"return",
"{",
"TiffTags",
".",
"lookup",
"(",
"code",
")",
".",
"name",
":",
"value",
"for",
"code",
",",
"value",
"in",
"self",
".",
"items",
"(",
")",
"}"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/TiffImagePlugin.py#L497-L503 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py | python | TarFile.extract | (self, member, path="", set_attrs=True) | Extract a member from the archive to the current working directory,
using its full name. Its file information is extracted as accurately
as possible. `member' may be a filename or a TarInfo object. You can
specify a different directory using `path'. File attributes (owner,
... | Extract a member from the archive to the current working directory, | [
"Extract",
"a",
"member",
"from",
"the",
"archive",
"to",
"the",
"current",
"working",
"directory"
] | def extract(self, member, path="", set_attrs=True):
"""Extract a member from the archive to the current working directory,
using its full name. Its file information is extracted as accurately
as possible. `member' may be a filename or a TarInfo object. You can
specify a diff... | [
"def",
"extract",
"(",
"self",
",",
"member",
",",
"path",
"=",
"\"\"",
",",
"set_attrs",
"=",
"True",
")",
":",
"self",
".",
"_check",
"(",
"\"r\"",
")",
"if",
"isinstance",
"(",
"member",
",",
"str",
")",
":",
"tarinfo",
"=",
"self",
".",
"getmem... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py#L4327-L4393 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | Caret.GetSizeTuple | (*args, **kwargs) | return _misc_.Caret_GetSizeTuple(*args, **kwargs) | GetSizeTuple() -> (width, height) | GetSizeTuple() -> (width, height) | [
"GetSizeTuple",
"()",
"-",
">",
"(",
"width",
"height",
")"
] | def GetSizeTuple(*args, **kwargs):
"""GetSizeTuple() -> (width, height)"""
return _misc_.Caret_GetSizeTuple(*args, **kwargs) | [
"def",
"GetSizeTuple",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"Caret_GetSizeTuple",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L766-L768 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/calendar.py | python | isleap | (year) | return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0) | Return True for leap years, False for non-leap years. | Return True for leap years, False for non-leap years. | [
"Return",
"True",
"for",
"leap",
"years",
"False",
"for",
"non",
"-",
"leap",
"years",
"."
] | def isleap(year):
"""Return True for leap years, False for non-leap years."""
return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0) | [
"def",
"isleap",
"(",
"year",
")",
":",
"return",
"year",
"%",
"4",
"==",
"0",
"and",
"(",
"year",
"%",
"100",
"!=",
"0",
"or",
"year",
"%",
"400",
"==",
"0",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/calendar.py#L100-L102 | |
NVIDIA/TensorRT | 42805f078052daad1a98bc5965974fcffaad0960 | tools/pytorch-quantization/pytorch_quantization/tensor_quant.py | python | ScaledQuantDescriptor.to_yaml | (self) | return yaml.dump(obj_dict, width=120) | Create yaml serialization
Some attributes need special treatment to have human readable form, including amax, axis. | Create yaml serialization
Some attributes need special treatment to have human readable form, including amax, axis. | [
"Create",
"yaml",
"serialization",
"Some",
"attributes",
"need",
"special",
"treatment",
"to",
"have",
"human",
"readable",
"form",
"including",
"amax",
"axis",
"."
] | def to_yaml(self):
"""Create yaml serialization
Some attributes need special treatment to have human readable form, including amax, axis.
"""
obj_dict = self.dict()
if "axis" in obj_dict:
obj_dict['axis'] = list(obj_dict['axis'])
return yaml.dump(obj_dict, wi... | [
"def",
"to_yaml",
"(",
"self",
")",
":",
"obj_dict",
"=",
"self",
".",
"dict",
"(",
")",
"if",
"\"axis\"",
"in",
"obj_dict",
":",
"obj_dict",
"[",
"'axis'",
"]",
"=",
"list",
"(",
"obj_dict",
"[",
"'axis'",
"]",
")",
"return",
"yaml",
".",
"dump",
... | https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/tools/pytorch-quantization/pytorch_quantization/tensor_quant.py#L197-L205 | |
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/dask_cudf/dask_cudf/core.py | python | DataFrame.to_orc | (self, path, **kwargs) | return to_orc(self, path, **kwargs) | Calls dask_cudf.io.to_orc | Calls dask_cudf.io.to_orc | [
"Calls",
"dask_cudf",
".",
"io",
".",
"to_orc"
] | def to_orc(self, path, **kwargs):
"""Calls dask_cudf.io.to_orc"""
from dask_cudf.io import to_orc
return to_orc(self, path, **kwargs) | [
"def",
"to_orc",
"(",
"self",
",",
"path",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
"dask_cudf",
".",
"io",
"import",
"to_orc",
"return",
"to_orc",
"(",
"self",
",",
"path",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/dask_cudf/dask_cudf/core.py#L270-L274 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/android/loading/cloud/backend/clovis_task_handler.py | python | ClovisTaskHandler.Finalize | (self) | Called once before the handler is destroyed. | Called once before the handler is destroyed. | [
"Called",
"once",
"before",
"the",
"handler",
"is",
"destroyed",
"."
] | def Finalize(self):
"""Called once before the handler is destroyed."""
for handler in self._handlers.values():
handler.Finalize() | [
"def",
"Finalize",
"(",
"self",
")",
":",
"for",
"handler",
"in",
"self",
".",
"_handlers",
".",
"values",
"(",
")",
":",
"handler",
".",
"Finalize",
"(",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/loading/cloud/backend/clovis_task_handler.py#L57-L60 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SimulatedDensityOfStates.py | python | SimulatedDensityOfStates._draw_sticks | (self, peaks, dos_shape) | return dos | Draw a stick diagram for peaks.
@param hist - array of counts for each bin
@param peaks - the indicies of each non-zero point in the data
@param dos_shape - shape of the DOS array with broadened peaks
@return the y data | Draw a stick diagram for peaks. | [
"Draw",
"a",
"stick",
"diagram",
"for",
"peaks",
"."
] | def _draw_sticks(self, peaks, dos_shape):
"""
Draw a stick diagram for peaks.
@param hist - array of counts for each bin
@param peaks - the indicies of each non-zero point in the data
@param dos_shape - shape of the DOS array with broadened peaks
@return the y data
... | [
"def",
"_draw_sticks",
"(",
"self",
",",
"peaks",
",",
"dos_shape",
")",
":",
"dos",
"=",
"np",
".",
"zeros",
"(",
"dos_shape",
")",
"stick_intensity",
"=",
"self",
".",
"getProperty",
"(",
"'StickHeight'",
")",
".",
"value",
"for",
"index",
"in",
"peaks... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SimulatedDensityOfStates.py#L463-L478 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/dtypes/cast.py | python | maybe_downcast_numeric | (result, dtype, do_round: bool = False) | return result | Subset of maybe_downcast_to_dtype restricted to numeric dtypes.
Parameters
----------
result : ndarray or ExtensionArray
dtype : np.dtype or ExtensionDtype
do_round : bool
Returns
-------
ndarray or ExtensionArray | Subset of maybe_downcast_to_dtype restricted to numeric dtypes. | [
"Subset",
"of",
"maybe_downcast_to_dtype",
"restricted",
"to",
"numeric",
"dtypes",
"."
] | def maybe_downcast_numeric(result, dtype, do_round: bool = False):
"""
Subset of maybe_downcast_to_dtype restricted to numeric dtypes.
Parameters
----------
result : ndarray or ExtensionArray
dtype : np.dtype or ExtensionDtype
do_round : bool
Returns
-------
ndarray or Extensio... | [
"def",
"maybe_downcast_numeric",
"(",
"result",
",",
"dtype",
",",
"do_round",
":",
"bool",
"=",
"False",
")",
":",
"if",
"not",
"isinstance",
"(",
"dtype",
",",
"np",
".",
"dtype",
")",
":",
"# e.g. SparseDtype has no itemsize attr",
"return",
"result",
"if",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/dtypes/cast.py#L167-L238 | |
su2code/SU2 | 72b2fa977b64b9683a388920f05298a40d39e5c5 | SU2_PY/FSI_tools/FSIInterface.py | python | Interface.UnsteadyFSI | (self,FSI_config, FluidSolver, SolidSolver) | Run the unsteady FSI computation by synchronizing the fluid and solid solvers.
F/s interface data are exchanged through interface mapping and interpolation (if non mathcing meshes). | Run the unsteady FSI computation by synchronizing the fluid and solid solvers.
F/s interface data are exchanged through interface mapping and interpolation (if non mathcing meshes). | [
"Run",
"the",
"unsteady",
"FSI",
"computation",
"by",
"synchronizing",
"the",
"fluid",
"and",
"solid",
"solvers",
".",
"F",
"/",
"s",
"interface",
"data",
"are",
"exchanged",
"through",
"interface",
"mapping",
"and",
"interpolation",
"(",
"if",
"non",
"mathcin... | def UnsteadyFSI(self,FSI_config, FluidSolver, SolidSolver):
"""
Run the unsteady FSI computation by synchronizing the fluid and solid solvers.
F/s interface data are exchanged through interface mapping and interpolation (if non mathcing meshes).
"""
if self.have_MPI:
... | [
"def",
"UnsteadyFSI",
"(",
"self",
",",
"FSI_config",
",",
"FluidSolver",
",",
"SolidSolver",
")",
":",
"if",
"self",
".",
"have_MPI",
":",
"myid",
"=",
"self",
".",
"comm",
".",
"Get_rank",
"(",
")",
"numberPart",
"=",
"self",
".",
"comm",
".",
"Get_s... | https://github.com/su2code/SU2/blob/72b2fa977b64b9683a388920f05298a40d39e5c5/SU2_PY/FSI_tools/FSIInterface.py#L1880-L2039 | ||
bairdzhang/smallhardface | 76fa1d87a9602d9b13d7a7fe693fc7aec91cab80 | caffe/scripts/cpp_lint.py | python | FindPreviousMatchingAngleBracket | (clean_lines, linenum, init_prefix) | return False | Find the corresponding < that started a template.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: Current line number.
init_prefix: Part of the current line before the initial >.
Returns:
True if a matching bracket exists. | Find the corresponding < that started a template. | [
"Find",
"the",
"corresponding",
"<",
"that",
"started",
"a",
"template",
"."
] | def FindPreviousMatchingAngleBracket(clean_lines, linenum, init_prefix):
"""Find the corresponding < that started a template.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: Current line number.
init_prefix: Part of the current line before the initial >.
Returns:
True i... | [
"def",
"FindPreviousMatchingAngleBracket",
"(",
"clean_lines",
",",
"linenum",
",",
"init_prefix",
")",
":",
"line",
"=",
"init_prefix",
"nesting_stack",
"=",
"[",
"'>'",
"]",
"while",
"True",
":",
"# Find the previous operator",
"match",
"=",
"Search",
"(",
"r'^(... | https://github.com/bairdzhang/smallhardface/blob/76fa1d87a9602d9b13d7a7fe693fc7aec91cab80/caffe/scripts/cpp_lint.py#L2590-L2644 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/dtypes/common.py | python | is_signed_integer_dtype | (arr_or_dtype) | return _is_dtype_type(arr_or_dtype, classes_and_not_datetimelike(np.signedinteger)) | Check whether the provided array or dtype is of a signed integer dtype.
Unlike in `in_any_int_dtype`, timedelta64 instances will return False.
The nullable Integer dtypes (e.g. pandas.Int64Dtype) are also considered
as integer by this function.
Parameters
----------
arr_or_dtype : array-like
... | Check whether the provided array or dtype is of a signed integer dtype. | [
"Check",
"whether",
"the",
"provided",
"array",
"or",
"dtype",
"is",
"of",
"a",
"signed",
"integer",
"dtype",
"."
] | def is_signed_integer_dtype(arr_or_dtype) -> bool:
"""
Check whether the provided array or dtype is of a signed integer dtype.
Unlike in `in_any_int_dtype`, timedelta64 instances will return False.
The nullable Integer dtypes (e.g. pandas.Int64Dtype) are also considered
as integer by this function... | [
"def",
"is_signed_integer_dtype",
"(",
"arr_or_dtype",
")",
"->",
"bool",
":",
"return",
"_is_dtype_type",
"(",
"arr_or_dtype",
",",
"classes_and_not_datetimelike",
"(",
"np",
".",
"signedinteger",
")",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/dtypes/common.py#L725-L776 | |
falkTX/Carla | 74a1ae82c90db85f20550ddcdc8a927b8fb7e414 | source/modules/lilv/lilv-0.24.0/bindings/python/lilv.py | python | World.new_file_uri | (self, host, path) | return Node.wrap(_lib.lilv_new_file_uri(self.world, host, path)) | Create a new file URI node. The host may be None. | Create a new file URI node. The host may be None. | [
"Create",
"a",
"new",
"file",
"URI",
"node",
".",
"The",
"host",
"may",
"be",
"None",
"."
] | def new_file_uri(self, host, path):
"""Create a new file URI node. The host may be None."""
return Node.wrap(_lib.lilv_new_file_uri(self.world, host, path)) | [
"def",
"new_file_uri",
"(",
"self",
",",
"host",
",",
"path",
")",
":",
"return",
"Node",
".",
"wrap",
"(",
"_lib",
".",
"lilv_new_file_uri",
"(",
"self",
".",
"world",
",",
"host",
",",
"path",
")",
")"
] | https://github.com/falkTX/Carla/blob/74a1ae82c90db85f20550ddcdc8a927b8fb7e414/source/modules/lilv/lilv-0.24.0/bindings/python/lilv.py#L1159-L1161 | |
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/ogr.py | python | Geometry.GetPointCount | (self, *args) | return _ogr.Geometry_GetPointCount(self, *args) | r"""GetPointCount(Geometry self) -> int | r"""GetPointCount(Geometry self) -> int | [
"r",
"GetPointCount",
"(",
"Geometry",
"self",
")",
"-",
">",
"int"
] | def GetPointCount(self, *args):
r"""GetPointCount(Geometry self) -> int"""
return _ogr.Geometry_GetPointCount(self, *args) | [
"def",
"GetPointCount",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_ogr",
".",
"Geometry_GetPointCount",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/ogr.py#L5966-L5968 | |
Tencent/PhoenixGo | fbf67f9aec42531bff9569c44b85eb4c3f37b7be | configure.py | python | cygpath | (path) | return os.path.abspath(path).replace('\\', '/') | Convert path from posix to windows. | Convert path from posix to windows. | [
"Convert",
"path",
"from",
"posix",
"to",
"windows",
"."
] | def cygpath(path):
"""Convert path from posix to windows."""
return os.path.abspath(path).replace('\\', '/') | [
"def",
"cygpath",
"(",
"path",
")",
":",
"return",
"os",
".",
"path",
".",
"abspath",
"(",
"path",
")",
".",
"replace",
"(",
"'\\\\'",
",",
"'/'",
")"
] | https://github.com/Tencent/PhoenixGo/blob/fbf67f9aec42531bff9569c44b85eb4c3f37b7be/configure.py#L151-L153 | |
PX4/PX4-Autopilot | 0b9f60a0370be53d683352c63fd92db3d6586e18 | Tools/ecl_ekf/analysis/metrics.py | python | calculate_stat_from_signal | (
data: Dict[str, np.ndarray], dataset: str, variable: str,
in_air_det: InAirDetector, stat_function: Callable) | return stat_function(data[variable][in_air_det.get_airtime(dataset)]) | :param data:
:param variable:
:param in_air_detector:
:return: | :param data:
:param variable:
:param in_air_detector:
:return: | [
":",
"param",
"data",
":",
":",
"param",
"variable",
":",
":",
"param",
"in_air_detector",
":",
":",
"return",
":"
] | def calculate_stat_from_signal(
data: Dict[str, np.ndarray], dataset: str, variable: str,
in_air_det: InAirDetector, stat_function: Callable) -> float:
"""
:param data:
:param variable:
:param in_air_detector:
:return:
"""
return stat_function(data[variable][in_air_det.get_a... | [
"def",
"calculate_stat_from_signal",
"(",
"data",
":",
"Dict",
"[",
"str",
",",
"np",
".",
"ndarray",
"]",
",",
"dataset",
":",
"str",
",",
"variable",
":",
"str",
",",
"in_air_det",
":",
"InAirDetector",
",",
"stat_function",
":",
"Callable",
")",
"->",
... | https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/Tools/ecl_ekf/analysis/metrics.py#L172-L182 | |
apache/mesos | 97d9a4063332aae3825d78de71611657e05cf5e2 | support/cpplint.py | python | FileInfo.BaseName | (self) | return self.Split()[1] | File base name - text after the final slash, before the final period. | File base name - text after the final slash, before the final period. | [
"File",
"base",
"name",
"-",
"text",
"after",
"the",
"final",
"slash",
"before",
"the",
"final",
"period",
"."
] | def BaseName(self):
"""File base name - text after the final slash, before the final period."""
return self.Split()[1] | [
"def",
"BaseName",
"(",
"self",
")",
":",
"return",
"self",
".",
"Split",
"(",
")",
"[",
"1",
"]"
] | https://github.com/apache/mesos/blob/97d9a4063332aae3825d78de71611657e05cf5e2/support/cpplint.py#L1176-L1178 | |
moflow/moflow | 2dfb27c799c90c6caf1477508eca3eec616ef7d2 | bap/libtracewrap/libtrace/protobuf/python/google/protobuf/text_format.py | python | ParseFloat | (text) | Parse a floating point number.
Args:
text: Text to parse.
Returns:
The number parsed.
Raises:
ValueError: If a floating point number couldn't be parsed. | Parse a floating point number. | [
"Parse",
"a",
"floating",
"point",
"number",
"."
] | def ParseFloat(text):
"""Parse a floating point number.
Args:
text: Text to parse.
Returns:
The number parsed.
Raises:
ValueError: If a floating point number couldn't be parsed.
"""
try:
# Assume Python compatible syntax.
return float(text)
except ValueError:
# Check alternative... | [
"def",
"ParseFloat",
"(",
"text",
")",
":",
"try",
":",
"# Assume Python compatible syntax.",
"return",
"float",
"(",
"text",
")",
"except",
"ValueError",
":",
"# Check alternative spellings.",
"if",
"_FLOAT_INFINITY",
".",
"match",
"(",
"text",
")",
":",
"if",
... | https://github.com/moflow/moflow/blob/2dfb27c799c90c6caf1477508eca3eec616ef7d2/bap/libtracewrap/libtrace/protobuf/python/google/protobuf/text_format.py#L654-L683 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/pexpect/pexpect.py | python | spawn.write | (self, s) | This is similar to send() except that there is no return value. | This is similar to send() except that there is no return value. | [
"This",
"is",
"similar",
"to",
"send",
"()",
"except",
"that",
"there",
"is",
"no",
"return",
"value",
"."
] | def write(self, s):
"""This is similar to send() except that there is no return value.
"""
self.send(s) | [
"def",
"write",
"(",
"self",
",",
"s",
")",
":",
"self",
".",
"send",
"(",
"s",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/pexpect/pexpect.py#L976-L981 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/robotsim.py | python | RobotModelLink.parent | (self) | return _robotsim.RobotModelLink_parent(self) | parent(RobotModelLink self) -> RobotModelLink
Returns a reference to the link's parent, or a NULL link if it has no parent. | parent(RobotModelLink self) -> RobotModelLink | [
"parent",
"(",
"RobotModelLink",
"self",
")",
"-",
">",
"RobotModelLink"
] | def parent(self):
"""
parent(RobotModelLink self) -> RobotModelLink
Returns a reference to the link's parent, or a NULL link if it has no parent.
"""
return _robotsim.RobotModelLink_parent(self) | [
"def",
"parent",
"(",
"self",
")",
":",
"return",
"_robotsim",
".",
"RobotModelLink_parent",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L3746-L3755 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | DC.LogicalToDeviceY | (*args, **kwargs) | return _gdi_.DC_LogicalToDeviceY(*args, **kwargs) | LogicalToDeviceY(self, int y) -> int
Converts logical Y coordinate to device coordinate, using the current
mapping mode. | LogicalToDeviceY(self, int y) -> int | [
"LogicalToDeviceY",
"(",
"self",
"int",
"y",
")",
"-",
">",
"int"
] | def LogicalToDeviceY(*args, **kwargs):
"""
LogicalToDeviceY(self, int y) -> int
Converts logical Y coordinate to device coordinate, using the current
mapping mode.
"""
return _gdi_.DC_LogicalToDeviceY(*args, **kwargs) | [
"def",
"LogicalToDeviceY",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"DC_LogicalToDeviceY",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L4355-L4362 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/math_ops.py | python | _calc_mat_mul_flops | (graph, node) | return ops.OpStats("flops", (k * output_count * 2)) | Calculates the compute resources needed for MatMul. | Calculates the compute resources needed for MatMul. | [
"Calculates",
"the",
"compute",
"resources",
"needed",
"for",
"MatMul",
"."
] | def _calc_mat_mul_flops(graph, node):
"""Calculates the compute resources needed for MatMul."""
transpose_a = node.attr["transpose_a"].b
a_shape = graph_util.tensor_shape_from_node_def_name(graph, node.input[0])
a_shape.assert_is_fully_defined()
if transpose_a:
k = int(a_shape[0])
else:
k = int(a_sh... | [
"def",
"_calc_mat_mul_flops",
"(",
"graph",
",",
"node",
")",
":",
"transpose_a",
"=",
"node",
".",
"attr",
"[",
"\"transpose_a\"",
"]",
".",
"b",
"a_shape",
"=",
"graph_util",
".",
"tensor_shape_from_node_def_name",
"(",
"graph",
",",
"node",
".",
"input",
... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/math_ops.py#L1362-L1374 | |
ros-planning/moveit | ee48dc5cedc981d0869352aa3db0b41469c2735c | moveit_commander/src/moveit_commander/move_group.py | python | MoveGroupCommander.remember_joint_values | (self, name, values=None) | Record the specified joint configuration of the group under the specified name. If no values are specified, the current state of the group is recorded. | Record the specified joint configuration of the group under the specified name. If no values are specified, the current state of the group is recorded. | [
"Record",
"the",
"specified",
"joint",
"configuration",
"of",
"the",
"group",
"under",
"the",
"specified",
"name",
".",
"If",
"no",
"values",
"are",
"specified",
"the",
"current",
"state",
"of",
"the",
"group",
"is",
"recorded",
"."
] | def remember_joint_values(self, name, values=None):
""" Record the specified joint configuration of the group under the specified name. If no values are specified, the current state of the group is recorded. """
if values is None:
values = self.get_current_joint_values()
self._g.reme... | [
"def",
"remember_joint_values",
"(",
"self",
",",
"name",
",",
"values",
"=",
"None",
")",
":",
"if",
"values",
"is",
"None",
":",
"values",
"=",
"self",
".",
"get_current_joint_values",
"(",
")",
"self",
".",
"_g",
".",
"remember_joint_values",
"(",
"name... | https://github.com/ros-planning/moveit/blob/ee48dc5cedc981d0869352aa3db0b41469c2735c/moveit_commander/src/moveit_commander/move_group.py#L414-L418 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/framework/function.py | python | _DefinedFunction.name | (self) | return self._func_name | Function name. | Function name. | [
"Function",
"name",
"."
] | def name(self):
"""Function name."""
self._create_definition_if_needed()
return self._func_name | [
"def",
"name",
"(",
"self",
")",
":",
"self",
".",
"_create_definition_if_needed",
"(",
")",
"return",
"self",
".",
"_func_name"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/function.py#L267-L270 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/protobuf/python/mox.py | python | Regex.equals | (self, rhs) | return self.regex.search(rhs) is not None | Check to see if rhs matches regular expression pattern.
Returns:
bool | Check to see if rhs matches regular expression pattern. | [
"Check",
"to",
"see",
"if",
"rhs",
"matches",
"regular",
"expression",
"pattern",
"."
] | def equals(self, rhs):
"""Check to see if rhs matches regular expression pattern.
Returns:
bool
"""
return self.regex.search(rhs) is not None | [
"def",
"equals",
"(",
"self",
",",
"rhs",
")",
":",
"return",
"self",
".",
"regex",
".",
"search",
"(",
"rhs",
")",
"is",
"not",
"None"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/protobuf/python/mox.py#L922-L929 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/imaplib.py | python | IMAP4._CRAM_MD5_AUTH | (self, challenge) | return self.user + " " + hmac.HMAC(pwd, challenge, 'md5').hexdigest() | Authobject to use with CRAM-MD5 authentication. | Authobject to use with CRAM-MD5 authentication. | [
"Authobject",
"to",
"use",
"with",
"CRAM",
"-",
"MD5",
"authentication",
"."
] | def _CRAM_MD5_AUTH(self, challenge):
""" Authobject to use with CRAM-MD5 authentication. """
import hmac
pwd = (self.password.encode('utf-8') if isinstance(self.password, str)
else self.password)
return self.user + " " + hmac.HMAC(pwd, challen... | [
"def",
"_CRAM_MD5_AUTH",
"(",
"self",
",",
"challenge",
")",
":",
"import",
"hmac",
"pwd",
"=",
"(",
"self",
".",
"password",
".",
"encode",
"(",
"'utf-8'",
")",
"if",
"isinstance",
"(",
"self",
".",
"password",
",",
"str",
")",
"else",
"self",
".",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/imaplib.py#L626-L631 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/ConfigSet.py | python | ConfigSet.get_flat | (self, key) | return ' '.join(s) | Return a value as a string. If the input is a list, the value returned is space-separated.
:param key: key to use
:type key: string | Return a value as a string. If the input is a list, the value returned is space-separated. | [
"Return",
"a",
"value",
"as",
"a",
"string",
".",
"If",
"the",
"input",
"is",
"a",
"list",
"the",
"value",
"returned",
"is",
"space",
"-",
"separated",
"."
] | def get_flat(self, key):
"""
Return a value as a string. If the input is a list, the value returned is space-separated.
:param key: key to use
:type key: string
"""
s = self[key]
if isinstance(s, str): return s
return ' '.join(s) | [
"def",
"get_flat",
"(",
"self",
",",
"key",
")",
":",
"s",
"=",
"self",
"[",
"key",
"]",
"if",
"isinstance",
"(",
"s",
",",
"str",
")",
":",
"return",
"s",
"return",
"' '",
".",
"join",
"(",
"s",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/ConfigSet.py#L171-L180 | |
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/serial/tools/miniterm.py | python | Transform.echo | (self, text) | return text | text to be sent but displayed on console | text to be sent but displayed on console | [
"text",
"to",
"be",
"sent",
"but",
"displayed",
"on",
"console"
] | def echo(self, text):
"""text to be sent but displayed on console"""
return text | [
"def",
"echo",
"(",
"self",
",",
"text",
")",
":",
"return",
"text"
] | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/serial/tools/miniterm.py#L187-L189 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/layers/python/layers/feature_column.py | python | _FeatureColumn.key | (self) | Returns a string which will be used as a key when we do sorting. | Returns a string which will be used as a key when we do sorting. | [
"Returns",
"a",
"string",
"which",
"will",
"be",
"used",
"as",
"a",
"key",
"when",
"we",
"do",
"sorting",
"."
] | def key(self):
"""Returns a string which will be used as a key when we do sorting."""
pass | [
"def",
"key",
"(",
"self",
")",
":",
"pass"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/layers/python/layers/feature_column.py#L225-L227 | ||
Evolving-AI-Lab/fooling | 66f097dd6bd2eb6794ade3e187a7adfdf1887688 | caffe/scripts/cpp_lint.py | python | CheckSpacing | (filename, clean_lines, linenum, nesting_state, error) | Checks for the correctness of various spacing issues in the code.
Things we check for: spaces around operators, spaces after
if/for/while/switch, no spaces around parens in function calls, two
spaces between code and comment, don't start a block with a blank
line, don't end a function with a blank line, don't ... | Checks for the correctness of various spacing issues in the code. | [
"Checks",
"for",
"the",
"correctness",
"of",
"various",
"spacing",
"issues",
"in",
"the",
"code",
"."
] | def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
"""Checks for the correctness of various spacing issues in the code.
Things we check for: spaces around operators, spaces after
if/for/while/switch, no spaces around parens in function calls, two
spaces between code and comment, don't star... | [
"def",
"CheckSpacing",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"# Don't use \"elided\" lines here, otherwise we can't check commented lines.",
"# Don't want to use \"raw\" either, because we don't want to check inside C++11",
... | https://github.com/Evolving-AI-Lab/fooling/blob/66f097dd6bd2eb6794ade3e187a7adfdf1887688/caffe/scripts/cpp_lint.py#L2573-L2918 | ||
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/cherrypy/wsgiserver/wsgiserver2.py | python | HTTPServer.start | (self) | Run the server forever. | Run the server forever. | [
"Run",
"the",
"server",
"forever",
"."
] | def start(self):
"""Run the server forever."""
# We don't have to trap KeyboardInterrupt or SystemExit here,
# because cherrpy.server already does so, calling self.stop() for us.
# If you're using this server with another framework, you should
# trap those exceptions in whatever ... | [
"def",
"start",
"(",
"self",
")",
":",
"# We don't have to trap KeyboardInterrupt or SystemExit here,",
"# because cherrpy.server already does so, calling self.stop() for us.",
"# If you're using this server with another framework, you should",
"# trap those exceptions in whatever code block calls... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/wsgiserver/wsgiserver2.py#L1753-L1849 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | chrome_frame/combine_libs.py | python | Shell | (*args) | return output | Runs the program and args in args, returns the output from the program. | Runs the program and args in args, returns the output from the program. | [
"Runs",
"the",
"program",
"and",
"args",
"in",
"args",
"returns",
"the",
"output",
"from",
"the",
"program",
"."
] | def Shell(*args):
'''Runs the program and args in args, returns the output from the program.'''
process = subprocess.Popen(args,
stdin = None,
stdout = subprocess.PIPE,
stderr = subprocess.STDOUT)
output = process.stdout.readli... | [
"def",
"Shell",
"(",
"*",
"args",
")",
":",
"process",
"=",
"subprocess",
".",
"Popen",
"(",
"args",
",",
"stdin",
"=",
"None",
",",
"stdout",
"=",
"subprocess",
".",
"PIPE",
",",
"stderr",
"=",
"subprocess",
".",
"STDOUT",
")",
"output",
"=",
"proce... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/chrome_frame/combine_libs.py#L20-L31 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/layers/python/layers/feature_column.py | python | _WeightedSparseColumn.weight_tensor | (self, input_tensor) | return input_tensor[1] | Returns the weight tensor from the given transformed input_tensor. | Returns the weight tensor from the given transformed input_tensor. | [
"Returns",
"the",
"weight",
"tensor",
"from",
"the",
"given",
"transformed",
"input_tensor",
"."
] | def weight_tensor(self, input_tensor):
"""Returns the weight tensor from the given transformed input_tensor."""
return input_tensor[1] | [
"def",
"weight_tensor",
"(",
"self",
",",
"input_tensor",
")",
":",
"return",
"input_tensor",
"[",
"1",
"]"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/layers/python/layers/feature_column.py#L805-L807 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/ops/mask_ops.py | python | kleene_xor | (
left: Union[bool, np.ndarray],
right: Union[bool, np.ndarray],
left_mask: Optional[np.ndarray],
right_mask: Optional[np.ndarray],
) | return result, mask | Boolean ``xor`` using Kleene logic.
This is the same as ``or``, with the following adjustments
* True, True -> False
* True, NA -> NA
Parameters
----------
left, right : ndarray, NA, or bool
The values of the array.
left_mask, right_mask : ndarray, optional
The masks. On... | Boolean ``xor`` using Kleene logic. | [
"Boolean",
"xor",
"using",
"Kleene",
"logic",
"."
] | def kleene_xor(
left: Union[bool, np.ndarray],
right: Union[bool, np.ndarray],
left_mask: Optional[np.ndarray],
right_mask: Optional[np.ndarray],
):
"""
Boolean ``xor`` using Kleene logic.
This is the same as ``or``, with the following adjustments
* True, True -> False
* True, NA ... | [
"def",
"kleene_xor",
"(",
"left",
":",
"Union",
"[",
"bool",
",",
"np",
".",
"ndarray",
"]",
",",
"right",
":",
"Union",
"[",
"bool",
",",
"np",
".",
"ndarray",
"]",
",",
"left_mask",
":",
"Optional",
"[",
"np",
".",
"ndarray",
"]",
",",
"right_mas... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/ops/mask_ops.py#L72-L116 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailbox.py | python | _mboxMMDFMessage.get_from | (self) | return self._from | Return contents of "From " line. | Return contents of "From " line. | [
"Return",
"contents",
"of",
"From",
"line",
"."
] | def get_from(self):
"""Return contents of "From " line."""
return self._from | [
"def",
"get_from",
"(",
"self",
")",
":",
"return",
"self",
".",
"_from"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailbox.py#L1646-L1648 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/scripts/highlight.py | python | latex_highlight | (classified_text, title = 'python',
commands = default_latex_commands,
document = default_latex_document) | return default_latex_document % dict(title=title, macros=macros, body=''.join(result)) | Create a complete LaTeX document with colorized source code | Create a complete LaTeX document with colorized source code | [
"Create",
"a",
"complete",
"LaTeX",
"document",
"with",
"colorized",
"source",
"code"
] | def latex_highlight(classified_text, title = 'python',
commands = default_latex_commands,
document = default_latex_document):
'Create a complete LaTeX document with colorized source code'
macros = '\n'.join(r'\newcommand{\py%s}[1]{%s}' % c for c in commands.items())
r... | [
"def",
"latex_highlight",
"(",
"classified_text",
",",
"title",
"=",
"'python'",
",",
"commands",
"=",
"default_latex_commands",
",",
"document",
"=",
"default_latex_document",
")",
":",
"macros",
"=",
"'\\n'",
".",
"join",
"(",
"r'\\newcommand{\\py%s}[1]{%s}'",
"%"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/scripts/highlight.py#L181-L193 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/encodings/base64_codec.py | python | base64_decode | (input,errors='strict') | return (output, len(input)) | Decodes the object input and returns a tuple (output
object, length consumed).
input must be an object which provides the bf_getreadbuf
buffer slot. Python strings, buffer objects and memory
mapped files are examples of objects providing this slot.
errors defines the error hand... | Decodes the object input and returns a tuple (output
object, length consumed). | [
"Decodes",
"the",
"object",
"input",
"and",
"returns",
"a",
"tuple",
"(",
"output",
"object",
"length",
"consumed",
")",
"."
] | def base64_decode(input,errors='strict'):
""" Decodes the object input and returns a tuple (output
object, length consumed).
input must be an object which provides the bf_getreadbuf
buffer slot. Python strings, buffer objects and memory
mapped files are examples of objects providin... | [
"def",
"base64_decode",
"(",
"input",
",",
"errors",
"=",
"'strict'",
")",
":",
"assert",
"errors",
"==",
"'strict'",
"output",
"=",
"base64",
".",
"decodestring",
"(",
"input",
")",
"return",
"(",
"output",
",",
"len",
"(",
"input",
")",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/encodings/base64_codec.py#L27-L43 | |
deepmind/streetlearn | ccf1d60b9c45154894d45a897748aee85d7eb69b | streetlearn/python/environment/batched_streetlearn.py | python | BatchedStreetLearn.prev_action | (self) | return [env.prev_action() for env in self._envs] | Returns the list of actions for the previous time step. | Returns the list of actions for the previous time step. | [
"Returns",
"the",
"list",
"of",
"actions",
"for",
"the",
"previous",
"time",
"step",
"."
] | def prev_action(self):
"""Returns the list of actions for the previous time step."""
return [env.prev_action() for env in self._envs] | [
"def",
"prev_action",
"(",
"self",
")",
":",
"return",
"[",
"env",
".",
"prev_action",
"(",
")",
"for",
"env",
"in",
"self",
".",
"_envs",
"]"
] | https://github.com/deepmind/streetlearn/blob/ccf1d60b9c45154894d45a897748aee85d7eb69b/streetlearn/python/environment/batched_streetlearn.py#L227-L229 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/rospy/src/rospy/topics.py | python | _TopicImpl.get_stats | (self) | Get the stats for this topic (API stub) | Get the stats for this topic (API stub) | [
"Get",
"the",
"stats",
"for",
"this",
"topic",
"(",
"API",
"stub",
")"
] | def get_stats(self): # STATS
"""Get the stats for this topic (API stub)"""
raise Exception("subclasses must override") | [
"def",
"get_stats",
"(",
"self",
")",
":",
"# STATS",
"raise",
"Exception",
"(",
"\"subclasses must override\"",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rospy/src/rospy/topics.py#L499-L501 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/aui.py | python | AuiManager.GetAllPanes | (*args, **kwargs) | return _aui.AuiManager_GetAllPanes(*args, **kwargs) | GetAllPanes(self) -> wxAuiPaneInfoArray | GetAllPanes(self) -> wxAuiPaneInfoArray | [
"GetAllPanes",
"(",
"self",
")",
"-",
">",
"wxAuiPaneInfoArray"
] | def GetAllPanes(*args, **kwargs):
"""GetAllPanes(self) -> wxAuiPaneInfoArray"""
return _aui.AuiManager_GetAllPanes(*args, **kwargs) | [
"def",
"GetAllPanes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiManager_GetAllPanes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L635-L637 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/jinja2/environment.py | python | Template.get_corresponding_lineno | (self, lineno) | return 1 | Return the source line number of a line number in the
generated bytecode as they are not in sync. | Return the source line number of a line number in the
generated bytecode as they are not in sync. | [
"Return",
"the",
"source",
"line",
"number",
"of",
"a",
"line",
"number",
"in",
"the",
"generated",
"bytecode",
"as",
"they",
"are",
"not",
"in",
"sync",
"."
] | def get_corresponding_lineno(self, lineno):
"""Return the source line number of a line number in the
generated bytecode as they are not in sync.
"""
for template_line, code_line in reversed(self.debug_info):
if code_line <= lineno:
return template_line
... | [
"def",
"get_corresponding_lineno",
"(",
"self",
",",
"lineno",
")",
":",
"for",
"template_line",
",",
"code_line",
"in",
"reversed",
"(",
"self",
".",
"debug_info",
")",
":",
"if",
"code_line",
"<=",
"lineno",
":",
"return",
"template_line",
"return",
"1"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/jinja2/environment.py#L1032-L1039 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/categorical.py | python | Categorical.remove_unused_categories | (self, inplace=False) | Remove categories which are not used.
Parameters
----------
inplace : bool, default False
Whether or not to drop unused categories inplace or return a copy of
this categorical with unused categories dropped.
Returns
-------
cat : Categorical with u... | Remove categories which are not used. | [
"Remove",
"categories",
"which",
"are",
"not",
"used",
"."
] | def remove_unused_categories(self, inplace=False):
"""
Remove categories which are not used.
Parameters
----------
inplace : bool, default False
Whether or not to drop unused categories inplace or return a copy of
this categorical with unused categories dro... | [
"def",
"remove_unused_categories",
"(",
"self",
",",
"inplace",
"=",
"False",
")",
":",
"inplace",
"=",
"validate_bool_kwarg",
"(",
"inplace",
",",
"\"inplace\"",
")",
"cat",
"=",
"self",
"if",
"inplace",
"else",
"self",
".",
"copy",
"(",
")",
"idx",
",",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/categorical.py#L1091-L1128 | ||
goldeneye-source/ges-code | 2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d | thirdparty/protobuf-2.3.0/python/google/protobuf/internal/wire_format.py | python | UnpackTag | (tag) | return (tag >> TAG_TYPE_BITS), (tag & TAG_TYPE_MASK) | The inverse of PackTag(). Given an unsigned 32-bit number,
returns a (field_number, wire_type) tuple. | The inverse of PackTag(). Given an unsigned 32-bit number,
returns a (field_number, wire_type) tuple. | [
"The",
"inverse",
"of",
"PackTag",
"()",
".",
"Given",
"an",
"unsigned",
"32",
"-",
"bit",
"number",
"returns",
"a",
"(",
"field_number",
"wire_type",
")",
"tuple",
"."
] | def UnpackTag(tag):
"""The inverse of PackTag(). Given an unsigned 32-bit number,
returns a (field_number, wire_type) tuple.
"""
return (tag >> TAG_TYPE_BITS), (tag & TAG_TYPE_MASK) | [
"def",
"UnpackTag",
"(",
"tag",
")",
":",
"return",
"(",
"tag",
">>",
"TAG_TYPE_BITS",
")",
",",
"(",
"tag",
"&",
"TAG_TYPE_MASK",
")"
] | https://github.com/goldeneye-source/ges-code/blob/2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/wire_format.py#L93-L97 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/framework/ops.py | python | Operation.graph | (self) | return self._graph | The `Graph` that contains this operation. | The `Graph` that contains this operation. | [
"The",
"Graph",
"that",
"contains",
"this",
"operation",
"."
] | def graph(self):
"""The `Graph` that contains this operation."""
return self._graph | [
"def",
"graph",
"(",
"self",
")",
":",
"return",
"self",
".",
"_graph"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/framework/ops.py#L1542-L1544 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py | python | CrossedColumn.name | (self) | return '_X_'.join(sorted(feature_names)) | See `FeatureColumn` base class. | See `FeatureColumn` base class. | [
"See",
"FeatureColumn",
"base",
"class",
"."
] | def name(self):
"""See `FeatureColumn` base class."""
feature_names = []
for key in _collect_leaf_level_keys(self):
if isinstance(key, (FeatureColumn, fc_old._FeatureColumn)): # pylint: disable=protected-access
feature_names.append(key.name)
else: # key must be a string
feature... | [
"def",
"name",
"(",
"self",
")",
":",
"feature_names",
"=",
"[",
"]",
"for",
"key",
"in",
"_collect_leaf_level_keys",
"(",
"self",
")",
":",
"if",
"isinstance",
"(",
"key",
",",
"(",
"FeatureColumn",
",",
"fc_old",
".",
"_FeatureColumn",
")",
")",
":",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py#L4058-L4066 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/email/_header_value_parser.py | python | get_no_fold_literal | (value) | return no_fold_literal, value[1:] | no-fold-literal = "[" *dtext "]" | no-fold-literal = "[" *dtext "]" | [
"no",
"-",
"fold",
"-",
"literal",
"=",
"[",
"*",
"dtext",
"]"
] | def get_no_fold_literal(value):
""" no-fold-literal = "[" *dtext "]"
"""
no_fold_literal = NoFoldLiteral()
if not value:
raise errors.HeaderParseError(
"expected no-fold-literal but found '{}'".format(value))
if value[0] != '[':
raise errors.HeaderParseError(
... | [
"def",
"get_no_fold_literal",
"(",
"value",
")",
":",
"no_fold_literal",
"=",
"NoFoldLiteral",
"(",
")",
"if",
"not",
"value",
":",
"raise",
"errors",
".",
"HeaderParseError",
"(",
"\"expected no-fold-literal but found '{}'\"",
".",
"format",
"(",
"value",
")",
")... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/email/_header_value_parser.py#L2030-L2050 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/base64.py | python | standard_b64decode | (s) | return b64decode(s) | Decode a string encoded with the standard Base64 alphabet.
s is the string to decode. The decoded string is returned. A TypeError
is raised if the string is incorrectly padded or if there are non-alphabet
characters present in the string. | Decode a string encoded with the standard Base64 alphabet. | [
"Decode",
"a",
"string",
"encoded",
"with",
"the",
"standard",
"Base64",
"alphabet",
"."
] | def standard_b64decode(s):
"""Decode a string encoded with the standard Base64 alphabet.
s is the string to decode. The decoded string is returned. A TypeError
is raised if the string is incorrectly padded or if there are non-alphabet
characters present in the string.
"""
return b64decode(s) | [
"def",
"standard_b64decode",
"(",
"s",
")",
":",
"return",
"b64decode",
"(",
"s",
")"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/base64.py#L86-L93 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/lib/pretty.py | python | _PrettyPrinterBase.indent | (self, indent) | with statement support for indenting/dedenting. | with statement support for indenting/dedenting. | [
"with",
"statement",
"support",
"for",
"indenting",
"/",
"dedenting",
"."
] | def indent(self, indent):
"""with statement support for indenting/dedenting."""
self.indentation += indent
try:
yield
finally:
self.indentation -= indent | [
"def",
"indent",
"(",
"self",
",",
"indent",
")",
":",
"self",
".",
"indentation",
"+=",
"indent",
"try",
":",
"yield",
"finally",
":",
"self",
".",
"indentation",
"-=",
"indent"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/lib/pretty.py#L160-L166 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/ensemble/_forest.py | python | RandomTreesEmbedding.transform | (self, X) | return self.one_hot_encoder_.transform(self.apply(X)) | Transform dataset.
Parameters
----------
X : array-like or sparse matrix, shape=(n_samples, n_features)
Input data to be transformed. Use ``dtype=np.float32`` for maximum
efficiency. Sparse matrices are also supported, use sparse
``csr_matrix`` for maximum ef... | Transform dataset. | [
"Transform",
"dataset",
"."
] | def transform(self, X):
"""
Transform dataset.
Parameters
----------
X : array-like or sparse matrix, shape=(n_samples, n_features)
Input data to be transformed. Use ``dtype=np.float32`` for maximum
efficiency. Sparse matrices are also supported, use spar... | [
"def",
"transform",
"(",
"self",
",",
"X",
")",
":",
"check_is_fitted",
"(",
"self",
")",
"return",
"self",
".",
"one_hot_encoder_",
".",
"transform",
"(",
"self",
".",
"apply",
"(",
"X",
")",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/ensemble/_forest.py#L2236-L2253 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | demo/DPU-for-RNN/rnn_u25_u50lv/apps/customer_satisfaction/utils/hdf5_format.py | python | load_weights_from_hdf5_group_by_name | (f, layers) | Implements name-based weight loading.
(instead of topological weight loading).
Layers that have no matching name are skipped.
Arguments:
f: A pointer to a HDF5 group.
layers: a list of target layers.
Raises:
ValueError: in case of mismatch between provided layers
and weights file... | Implements name-based weight loading. | [
"Implements",
"name",
"-",
"based",
"weight",
"loading",
"."
] | def load_weights_from_hdf5_group_by_name(f, layers):
"""Implements name-based weight loading.
(instead of topological weight loading).
Layers that have no matching name are skipped.
Arguments:
f: A pointer to a HDF5 group.
layers: a list of target layers.
Raises:
ValueError: in case of m... | [
"def",
"load_weights_from_hdf5_group_by_name",
"(",
"f",
",",
"layers",
")",
":",
"if",
"'keras_version'",
"in",
"f",
".",
"attrs",
":",
"original_keras_version",
"=",
"f",
".",
"attrs",
"[",
"'keras_version'",
"]",
"else",
":",
"original_keras_version",
"=",
"'... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/demo/DPU-for-RNN/rnn_u25_u50lv/apps/customer_satisfaction/utils/hdf5_format.py#L716-L778 | ||
MRPT/mrpt | b0be3557a4cded6bafff03feb28f7fa1f75762a3 | scripts/clang_git_format/clang_git_format/clang_format.py | python | ClangFormat.__init__ | (self, clang_path, cache_dir) | Initialization method. | Initialization method. | [
"Initialization",
"method",
"."
] | def __init__(self, clang_path, cache_dir):
"""Initialization method.
"""
self.clang_path = None
self.clang_format_progname_ext = ""
if sys.platform == "win32":
self.clang_format_progname_ext += ".exe"
# Check the clang-format the user specified
if cl... | [
"def",
"__init__",
"(",
"self",
",",
"clang_path",
",",
"cache_dir",
")",
":",
"self",
".",
"clang_path",
"=",
"None",
"self",
".",
"clang_format_progname_ext",
"=",
"\"\"",
"if",
"sys",
".",
"platform",
"==",
"\"win32\"",
":",
"self",
".",
"clang_format_pro... | https://github.com/MRPT/mrpt/blob/b0be3557a4cded6bafff03feb28f7fa1f75762a3/scripts/clang_git_format/clang_git_format/clang_format.py#L23-L97 | ||
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/jinja2/utils.py | python | LRUCache.__len__ | (self) | return len(self._mapping) | Return the current size of the cache. | Return the current size of the cache. | [
"Return",
"the",
"current",
"size",
"of",
"the",
"cache",
"."
] | def __len__(self):
"""Return the current size of the cache."""
return len(self._mapping) | [
"def",
"__len__",
"(",
"self",
")",
":",
"return",
"len",
"(",
"self",
".",
"_mapping",
")"
] | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/jinja2/utils.py#L370-L372 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/__init__.py | python | Logger.removeHandler | (self, hdlr) | Remove the specified handler from this logger. | Remove the specified handler from this logger. | [
"Remove",
"the",
"specified",
"handler",
"from",
"this",
"logger",
"."
] | def removeHandler(self, hdlr):
"""
Remove the specified handler from this logger.
"""
_acquireLock()
try:
if hdlr in self.handlers:
self.handlers.remove(hdlr)
finally:
_releaseLock() | [
"def",
"removeHandler",
"(",
"self",
",",
"hdlr",
")",
":",
"_acquireLock",
"(",
")",
"try",
":",
"if",
"hdlr",
"in",
"self",
".",
"handlers",
":",
"self",
".",
"handlers",
".",
"remove",
"(",
"hdlr",
")",
"finally",
":",
"_releaseLock",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/__init__.py#L1537-L1546 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py | python | Text.edit_redo | (self) | return self.edit("redo") | Redo the last undone edit
When the undo option is true, reapplies the last
undone edits provided no other edits were done since
then. Generates an error when the redo stack is empty.
Does nothing when the undo option is false. | Redo the last undone edit | [
"Redo",
"the",
"last",
"undone",
"edit"
] | def edit_redo(self):
"""Redo the last undone edit
When the undo option is true, reapplies the last
undone edits provided no other edits were done since
then. Generates an error when the redo stack is empty.
Does nothing when the undo option is false.
"""
return s... | [
"def",
"edit_redo",
"(",
"self",
")",
":",
"return",
"self",
".",
"edit",
"(",
"\"redo\"",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L3211-L3219 | |
fatih/subvim | 241b6d170597857105da219c9b7d36059e9f11fb | vim/base/YouCompleteMe/third_party/requests/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/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/requests/requests/packages/urllib3/packages/six.py#L67-L69 | ||
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | PhysicsTools/HeppyCore/python/utils/castorBaseDir.py | python | castorBaseDir | ( user=os.environ['USER'], area = None) | Gets the top level directory to use for writing for 'user | Gets the top level directory to use for writing for 'user | [
"Gets",
"the",
"top",
"level",
"directory",
"to",
"use",
"for",
"writing",
"for",
"user"
] | def castorBaseDir( user=os.environ['USER'], area = None):
"""Gets the top level directory to use for writing for 'user'"""
if area is None:
user, area = getUserAndArea(user)
d = 'root://eoscms.cern.ch//eos/cms/store/cmst3/%s/%s/CMG' % (area,user)
exists = castortools.isDirectory( casto... | [
"def",
"castorBaseDir",
"(",
"user",
"=",
"os",
".",
"environ",
"[",
"'USER'",
"]",
",",
"area",
"=",
"None",
")",
":",
"if",
"area",
"is",
"None",
":",
"user",
",",
"area",
"=",
"getUserAndArea",
"(",
"user",
")",
"d",
"=",
"'root://eoscms.cern.ch//eo... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/PhysicsTools/HeppyCore/python/utils/castorBaseDir.py#L18-L31 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/propgrid.py | python | PGProperty.SetFlagRecursively | (*args, **kwargs) | return _propgrid.PGProperty_SetFlagRecursively(*args, **kwargs) | SetFlagRecursively(self, int flag, bool set) | SetFlagRecursively(self, int flag, bool set) | [
"SetFlagRecursively",
"(",
"self",
"int",
"flag",
"bool",
"set",
")"
] | def SetFlagRecursively(*args, **kwargs):
"""SetFlagRecursively(self, int flag, bool set)"""
return _propgrid.PGProperty_SetFlagRecursively(*args, **kwargs) | [
"def",
"SetFlagRecursively",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGProperty_SetFlagRecursively",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L743-L745 | |
clementine-player/Clementine | 111379dfd027802b59125829fcf87e3e1d0ad73b | dist/cpplint.py | python | _SetCountingStyle | (level) | Sets the module's counting options. | Sets the module's counting options. | [
"Sets",
"the",
"module",
"s",
"counting",
"options",
"."
] | def _SetCountingStyle(level):
"""Sets the module's counting options."""
_cpplint_state.SetCountingStyle(level) | [
"def",
"_SetCountingStyle",
"(",
"level",
")",
":",
"_cpplint_state",
".",
"SetCountingStyle",
"(",
"level",
")"
] | https://github.com/clementine-player/Clementine/blob/111379dfd027802b59125829fcf87e3e1d0ad73b/dist/cpplint.py#L865-L867 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | samples/ide/activegrid/tool/process.py | python | _FileWrapper.close | (self) | Close all associated file objects and handles. | Close all associated file objects and handles. | [
"Close",
"all",
"associated",
"file",
"objects",
"and",
"handles",
"."
] | def close(self):
"""Close all associated file objects and handles."""
log.debug("[%s] _FileWrapper.close()", id(self))
if not self._closed:
self._closed = 1
if self._file is not None:
log.debug("[%s] _FileWrapper.close: close file", id(self))
... | [
"def",
"close",
"(",
"self",
")",
":",
"log",
".",
"debug",
"(",
"\"[%s] _FileWrapper.close()\"",
",",
"id",
"(",
"self",
")",
")",
"if",
"not",
"self",
".",
"_closed",
":",
"self",
".",
"_closed",
"=",
"1",
"if",
"self",
".",
"_file",
"is",
"not",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/samples/ide/activegrid/tool/process.py#L748-L778 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/distributions/python/ops/bijector.py | python | _ShiftAndScale._process_scale | (self, scale, event_ndims) | return scale, batch_ndims | Helper to __init__ which gets scale in batch-ready form.
This function expands dimensions of `scale` according to the following
table:
event_ndims
scale.ndims 0 1
0 [1]+S+[1,1] "silent error"
1 [ ]+S+[1,1] "silent error"
2 [... | Helper to __init__ which gets scale in batch-ready form. | [
"Helper",
"to",
"__init__",
"which",
"gets",
"scale",
"in",
"batch",
"-",
"ready",
"form",
"."
] | def _process_scale(self, scale, event_ndims):
"""Helper to __init__ which gets scale in batch-ready form.
This function expands dimensions of `scale` according to the following
table:
event_ndims
scale.ndims 0 1
0 [1]+S+[1,1] "silent error"
... | [
"def",
"_process_scale",
"(",
"self",
",",
"scale",
",",
"event_ndims",
")",
":",
"ndims",
"=",
"array_ops",
".",
"rank",
"(",
"scale",
")",
"left",
"=",
"math_ops",
".",
"select",
"(",
"math_ops",
".",
"reduce_any",
"(",
"[",
"math_ops",
".",
"reduce_al... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/distributions/python/ops/bijector.py#L523-L565 | |
netket/netket | 0d534e54ecbf25b677ea72af6b85947979420652 | netket/operator/_pauli_strings.py | python | _make_new_pauli_string | (op1, w1, op2, w2) | return new_op, new_weight | Compute the (symbolic) tensor product of two pauli strings with weights
Args:
op1, op2 (str): Pauli strings (e.g. IIXIIXZ).
w1, w2 (complex): The corresponding weights
Returns:
new_op (str): the new pauli string (result of the tensor product)
new_weight (complex): the weight of ... | Compute the (symbolic) tensor product of two pauli strings with weights
Args:
op1, op2 (str): Pauli strings (e.g. IIXIIXZ).
w1, w2 (complex): The corresponding weights | [
"Compute",
"the",
"(",
"symbolic",
")",
"tensor",
"product",
"of",
"two",
"pauli",
"strings",
"with",
"weights",
"Args",
":",
"op1",
"op2",
"(",
"str",
")",
":",
"Pauli",
"strings",
"(",
"e",
".",
"g",
".",
"IIXIIXZ",
")",
".",
"w1",
"w2",
"(",
"co... | def _make_new_pauli_string(op1, w1, op2, w2):
"""Compute the (symbolic) tensor product of two pauli strings with weights
Args:
op1, op2 (str): Pauli strings (e.g. IIXIIXZ).
w1, w2 (complex): The corresponding weights
Returns:
new_op (str): the new pauli string (result of the tensor ... | [
"def",
"_make_new_pauli_string",
"(",
"op1",
",",
"w1",
",",
"op2",
",",
"w2",
")",
":",
"assert",
"len",
"(",
"op1",
")",
"==",
"len",
"(",
"op2",
")",
"op1",
"=",
"_split_string",
"(",
"op1",
")",
"op2",
"=",
"_split_string",
"(",
"op2",
")",
"o_... | https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/operator/_pauli_strings.py#L555-L574 | |
NVIDIA/DALI | bf16cc86ba8f091b145f91962f21fe1b6aff243d | dali/python/nvidia/dali/_debug_mode.py | python | _PipelineDebug.run | (self) | return tuple([val.get() if isinstance(val, DataNodeDebug) else _tensors.TensorListCPU(
np.tile(val, (self._max_batch_size, *[1]*np.array(val).ndim))) for val in res]) | Run the pipeline and return the result. | Run the pipeline and return the result. | [
"Run",
"the",
"pipeline",
"and",
"return",
"the",
"result",
"."
] | def run(self):
"""Run the pipeline and return the result."""
import numpy as np
if not self._built:
raise RuntimeError('Pipeline must be built first.')
self._debug_on = True
self._cur_subpipeline_id = -1
_pipeline.Pipeline.push_current(self)
res = se... | [
"def",
"run",
"(",
"self",
")",
":",
"import",
"numpy",
"as",
"np",
"if",
"not",
"self",
".",
"_built",
":",
"raise",
"RuntimeError",
"(",
"'Pipeline must be built first.'",
")",
"self",
".",
"_debug_on",
"=",
"True",
"self",
".",
"_cur_subpipeline_id",
"=",... | https://github.com/NVIDIA/DALI/blob/bf16cc86ba8f091b145f91962f21fe1b6aff243d/dali/python/nvidia/dali/_debug_mode.py#L275-L298 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.