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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/sets.py | python | Set.__ixor__ | (self, other) | return self | Update a set with the symmetric difference of itself and another. | Update a set with the symmetric difference of itself and another. | [
"Update",
"a",
"set",
"with",
"the",
"symmetric",
"difference",
"of",
"itself",
"and",
"another",
"."
] | def __ixor__(self, other):
"""Update a set with the symmetric difference of itself and another."""
self._binary_sanity_check(other)
self.symmetric_difference_update(other)
return self | [
"def",
"__ixor__",
"(",
"self",
",",
"other",
")",
":",
"self",
".",
"_binary_sanity_check",
"(",
"other",
")",
"self",
".",
"symmetric_difference_update",
"(",
"other",
")",
"return",
"self"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/sets.py#L451-L455 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/PyChop/Instruments.py | python | soft_hat | (x, p) | return y | ! Soft hat function, from Herbert subroutine library.
! For rescaling t-mod at low energy to account for broader moderator term | ! Soft hat function, from Herbert subroutine library.
! For rescaling t-mod at low energy to account for broader moderator term | [
"!",
"Soft",
"hat",
"function",
"from",
"Herbert",
"subroutine",
"library",
".",
"!",
"For",
"rescaling",
"t",
"-",
"mod",
"at",
"low",
"energy",
"to",
"account",
"for",
"broader",
"moderator",
"term"
] | def soft_hat(x, p):
"""
! Soft hat function, from Herbert subroutine library.
! For rescaling t-mod at low energy to account for broader moderator term
"""
x = np.array(x)
sig2fwhh = np.sqrt(8*np.log(2))
height, grad, x1, x2 = tuple(p[:4])
sig1, sig2 = tuple(np.abs(p[4:6]/sig2fwhh))
... | [
"def",
"soft_hat",
"(",
"x",
",",
"p",
")",
":",
"x",
"=",
"np",
".",
"array",
"(",
"x",
")",
"sig2fwhh",
"=",
"np",
".",
"sqrt",
"(",
"8",
"*",
"np",
".",
"log",
"(",
"2",
")",
")",
"height",
",",
"grad",
",",
"x1",
",",
"x2",
"=",
"tupl... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/PyChop/Instruments.py#L56-L75 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/samplelogs/view.py | python | SampleLogsView.set_log_controls | (self,are_logs_filtered) | Sets log specific settings based on the log clicked on | Sets log specific settings based on the log clicked on | [
"Sets",
"log",
"specific",
"settings",
"based",
"on",
"the",
"log",
"clicked",
"on"
] | def set_log_controls(self,are_logs_filtered):
"""Sets log specific settings based on the log clicked on"""
self.show_filtered.setEnabled(are_logs_filtered) | [
"def",
"set_log_controls",
"(",
"self",
",",
"are_logs_filtered",
")",
":",
"self",
".",
"show_filtered",
".",
"setEnabled",
"(",
"are_logs_filtered",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/samplelogs/view.py#L200-L202 | ||
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/v7.9.317/third_party/jinja2/compiler.py | python | CodeGenerator.writeline | (self, x, node=None, extra=0) | Combination of newline and write. | Combination of newline and write. | [
"Combination",
"of",
"newline",
"and",
"write",
"."
] | def writeline(self, x, node=None, extra=0):
"""Combination of newline and write."""
self.newline(node, extra)
self.write(x) | [
"def",
"writeline",
"(",
"self",
",",
"x",
",",
"node",
"=",
"None",
",",
"extra",
"=",
"0",
")",
":",
"self",
".",
"newline",
"(",
"node",
",",
"extra",
")",
"self",
".",
"write",
"(",
"x",
")"
] | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/third_party/jinja2/compiler.py#L397-L400 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/pickle.py | python | _keep_alive | (x, memo) | Keeps a reference to the object x in the memo.
Because we remember objects by their id, we have
to assure that possibly temporary objects are kept
alive by referencing them.
We store a reference at the id of the memo, which should
normally not be used unless someone tries to deepcopy
the memo i... | Keeps a reference to the object x in the memo. | [
"Keeps",
"a",
"reference",
"to",
"the",
"object",
"x",
"in",
"the",
"memo",
"."
] | def _keep_alive(x, memo):
"""Keeps a reference to the object x in the memo.
Because we remember objects by their id, we have
to assure that possibly temporary objects are kept
alive by referencing them.
We store a reference at the id of the memo, which should
normally not be used unless someone... | [
"def",
"_keep_alive",
"(",
"x",
",",
"memo",
")",
":",
"try",
":",
"memo",
"[",
"id",
"(",
"memo",
")",
"]",
".",
"append",
"(",
"x",
")",
"except",
"KeyError",
":",
"# aha, this is the first one :-)",
"memo",
"[",
"id",
"(",
"memo",
")",
"]",
"=",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/pickle.py#L777-L791 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py2/prompt_toolkit/interface.py | python | CommandLineInterface.invalidate | (self) | Thread safe way of sending a repaint trigger to the input event loop. | Thread safe way of sending a repaint trigger to the input event loop. | [
"Thread",
"safe",
"way",
"of",
"sending",
"a",
"repaint",
"trigger",
"to",
"the",
"input",
"event",
"loop",
"."
] | def invalidate(self):
"""
Thread safe way of sending a repaint trigger to the input event loop.
"""
# Never schedule a second redraw, when a previous one has not yet been
# executed. (This should protect against other threads calling
# 'invalidate' many times, resulting i... | [
"def",
"invalidate",
"(",
"self",
")",
":",
"# Never schedule a second redraw, when a previous one has not yet been",
"# executed. (This should protect against other threads calling",
"# 'invalidate' many times, resulting in 100% CPU.)",
"if",
"self",
".",
"_invalidated",
":",
"return",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/interface.py#L315-L345 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/profiler/internal/flops_registry.py | python | _bias_add_grad_flops | (graph, node) | return _reduction_op_flops(graph, node, reduce_flops=1, finalize_flops=0) | Compute flops for BiasAddGrad operation. | Compute flops for BiasAddGrad operation. | [
"Compute",
"flops",
"for",
"BiasAddGrad",
"operation",
"."
] | def _bias_add_grad_flops(graph, node):
"""Compute flops for BiasAddGrad operation."""
# Implementation of BiasAddGrad, essentially it's a reduce sum and reshaping:
# So computing flops same way as for "Sum"
return _reduction_op_flops(graph, node, reduce_flops=1, finalize_flops=0) | [
"def",
"_bias_add_grad_flops",
"(",
"graph",
",",
"node",
")",
":",
"# Implementation of BiasAddGrad, essentially it's a reduce sum and reshaping:",
"# So computing flops same way as for \"Sum\"",
"return",
"_reduction_op_flops",
"(",
"graph",
",",
"node",
",",
"reduce_flops",
"=... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/profiler/internal/flops_registry.py#L277-L281 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Misc.winfo_rootx | (self) | return getint(
self.tk.call('winfo', 'rootx', self._w)) | Return x coordinate of upper left corner of this widget on the
root window. | Return x coordinate of upper left corner of this widget on the
root window. | [
"Return",
"x",
"coordinate",
"of",
"upper",
"left",
"corner",
"of",
"this",
"widget",
"on",
"the",
"root",
"window",
"."
] | def winfo_rootx(self):
"""Return x coordinate of upper left corner of this widget on the
root window."""
return getint(
self.tk.call('winfo', 'rootx', self._w)) | [
"def",
"winfo_rootx",
"(",
"self",
")",
":",
"return",
"getint",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"'winfo'",
",",
"'rootx'",
",",
"self",
".",
"_w",
")",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L838-L842 | |
PixarAnimationStudios/USD | faed18ce62c8736b02413635b584a2f637156bad | pxr/usdImaging/usdviewq/selectionDataModel.py | python | SelectionDataModel.setPrim | (self, prim, instance=ALL_INSTANCES) | Clear the prim selection then add a single prim back to the
selection. If an instance is given, only add that instance. | Clear the prim selection then add a single prim back to the
selection. If an instance is given, only add that instance. | [
"Clear",
"the",
"prim",
"selection",
"then",
"add",
"a",
"single",
"prim",
"back",
"to",
"the",
"selection",
".",
"If",
"an",
"instance",
"is",
"given",
"only",
"add",
"that",
"instance",
"."
] | def setPrim(self, prim, instance=ALL_INSTANCES):
"""Clear the prim selection then add a single prim back to the
selection. If an instance is given, only add that instance.
"""
self.setPrimPath(prim.GetPath(), instance) | [
"def",
"setPrim",
"(",
"self",
",",
"prim",
",",
"instance",
"=",
"ALL_INSTANCES",
")",
":",
"self",
".",
"setPrimPath",
"(",
"prim",
".",
"GetPath",
"(",
")",
",",
"instance",
")"
] | https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/selectionDataModel.py#L709-L714 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/hypertreelist.py | python | TreeListMainWindow.GetPrevExpanded | (self, item) | return CustomTreeCtrl.GetPrevExpanded(self, item) | Returns the previous expanded item before the input one.
:param `item`: an instance of :class:`TreeListItem`. | Returns the previous expanded item before the input one. | [
"Returns",
"the",
"previous",
"expanded",
"item",
"before",
"the",
"input",
"one",
"."
] | def GetPrevExpanded(self, item):
"""
Returns the previous expanded item before the input one.
:param `item`: an instance of :class:`TreeListItem`.
"""
return CustomTreeCtrl.GetPrevExpanded(self, item) | [
"def",
"GetPrevExpanded",
"(",
"self",
",",
"item",
")",
":",
"return",
"CustomTreeCtrl",
".",
"GetPrevExpanded",
"(",
"self",
",",
"item",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/hypertreelist.py#L2319-L2326 | |
astra-toolbox/astra-toolbox | 1e7ec8af702e595b76654f2e500f4c00344b273f | python/astra/log.py | python | disableScreen | () | Disable logging to screen. | Disable logging to screen. | [
"Disable",
"logging",
"to",
"screen",
"."
] | def disableScreen():
"""Disable logging to screen."""
l.log_disableScreen() | [
"def",
"disableScreen",
"(",
")",
":",
"l",
".",
"log_disableScreen",
"(",
")"
] | https://github.com/astra-toolbox/astra-toolbox/blob/1e7ec8af702e595b76654f2e500f4c00344b273f/python/astra/log.py#L82-L84 | ||
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/solver/solverFiniteVolume.py | python | _boundaryToCellDistances | (mesh) | return np.array(d) | TODO Documentme. | TODO Documentme. | [
"TODO",
"Documentme",
"."
] | def _boundaryToCellDistances(mesh):
"""TODO Documentme."""
d = [_boundaryToCellDistancesBound(b) for b in mesh.boundaries()]
return np.array(d) | [
"def",
"_boundaryToCellDistances",
"(",
"mesh",
")",
":",
"d",
"=",
"[",
"_boundaryToCellDistancesBound",
"(",
"b",
")",
"for",
"b",
"in",
"mesh",
".",
"boundaries",
"(",
")",
"]",
"return",
"np",
".",
"array",
"(",
"d",
")"
] | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/solver/solverFiniteVolume.py#L29-L32 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/distribute/sharded_variable.py | python | ShardedVariableMixin.batch_scatter_update | (self, sparse_delta, use_locking=False, name=None) | return self | Implements tf.Variable.batch_scatter_update. | Implements tf.Variable.batch_scatter_update. | [
"Implements",
"tf",
".",
"Variable",
".",
"batch_scatter_update",
"."
] | def batch_scatter_update(self, sparse_delta, use_locking=False, name=None):
"""Implements tf.Variable.batch_scatter_update."""
per_var_sparse_delta = self._decompose_indexed_slices(sparse_delta)
for i, v in enumerate(self._variables):
new_name = None
if name is not None:
new_name = '{}/p... | [
"def",
"batch_scatter_update",
"(",
"self",
",",
"sparse_delta",
",",
"use_locking",
"=",
"False",
",",
"name",
"=",
"None",
")",
":",
"per_var_sparse_delta",
"=",
"self",
".",
"_decompose_indexed_slices",
"(",
"sparse_delta",
")",
"for",
"i",
",",
"v",
"in",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/sharded_variable.py#L677-L685 | |
cryfs/cryfs | 5f908c641cd5854b8a347f842b996bfe76a64577 | src/gitversion/versioneer.py | python | get_version | () | return get_versions()["version"] | Get the short version string for this project. | Get the short version string for this project. | [
"Get",
"the",
"short",
"version",
"string",
"for",
"this",
"project",
"."
] | def get_version():
"""Get the short version string for this project."""
return get_versions()["version"] | [
"def",
"get_version",
"(",
")",
":",
"return",
"get_versions",
"(",
")",
"[",
"\"version\"",
"]"
] | https://github.com/cryfs/cryfs/blob/5f908c641cd5854b8a347f842b996bfe76a64577/src/gitversion/versioneer.py#L1475-L1477 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/saved_model/utils.py | python | build_signature_def | (inputs=None, outputs=None, method_name=None) | return signature_def | Utility function to build a SignatureDef protocol buffer.
Args:
inputs: Inputs of the SignatureDef defined as a proto map of string to
tensor info.
outputs: Outputs of the SignatureDef defined as a proto map of string to
tensor info.
method_name: Method name of the SignatureDef as a strin... | Utility function to build a SignatureDef protocol buffer. | [
"Utility",
"function",
"to",
"build",
"a",
"SignatureDef",
"protocol",
"buffer",
"."
] | def build_signature_def(inputs=None, outputs=None, method_name=None):
"""Utility function to build a SignatureDef protocol buffer.
Args:
inputs: Inputs of the SignatureDef defined as a proto map of string to
tensor info.
outputs: Outputs of the SignatureDef defined as a proto map of string to
... | [
"def",
"build_signature_def",
"(",
"inputs",
"=",
"None",
",",
"outputs",
"=",
"None",
",",
"method_name",
"=",
"None",
")",
":",
"signature_def",
"=",
"meta_graph_pb2",
".",
"SignatureDef",
"(",
")",
"if",
"inputs",
"is",
"not",
"None",
":",
"for",
"item"... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/saved_model/utils.py#L45-L67 | |
Cisco-Talos/moflow | ed71dfb0540d9e0d7a4c72f0881b58958d573728 | BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/descriptor.py | python | DescriptorBase.__init__ | (self, options, options_class_name) | Initialize the descriptor given its options message and the name of the
class of the options message. The name of the class is required in case
the options message is None and has to be created. | Initialize the descriptor given its options message and the name of the
class of the options message. The name of the class is required in case
the options message is None and has to be created. | [
"Initialize",
"the",
"descriptor",
"given",
"its",
"options",
"message",
"and",
"the",
"name",
"of",
"the",
"class",
"of",
"the",
"options",
"message",
".",
"The",
"name",
"of",
"the",
"class",
"is",
"required",
"in",
"case",
"the",
"options",
"message",
"... | def __init__(self, options, options_class_name):
"""Initialize the descriptor given its options message and the name of the
class of the options message. The name of the class is required in case
the options message is None and has to be created.
"""
self._options = options
self._options_class_n... | [
"def",
"__init__",
"(",
"self",
",",
"options",
",",
"options_class_name",
")",
":",
"self",
".",
"_options",
"=",
"options",
"self",
".",
"_options_class_name",
"=",
"options_class_name",
"# Does this descriptor have non-default options?",
"self",
".",
"has_options",
... | https://github.com/Cisco-Talos/moflow/blob/ed71dfb0540d9e0d7a4c72f0881b58958d573728/BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/descriptor.py#L64-L73 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/labeled_tensor/python/ops/core.py | python | Axis.__init__ | (self, name, value) | Construct an Axis.
Args:
name: Name of the axis.
value: Either None, an int or tf.Dimension giving the size of the axis,
or a sequence that is not a string additionally providing coordinate
(tick) labels.
Raises:
ValueError: If the user provides labels with duplicate values. | Construct an Axis. | [
"Construct",
"an",
"Axis",
"."
] | def __init__(self, name, value):
"""Construct an Axis.
Args:
name: Name of the axis.
value: Either None, an int or tf.Dimension giving the size of the axis,
or a sequence that is not a string additionally providing coordinate
(tick) labels.
Raises:
ValueError: If the user... | [
"def",
"__init__",
"(",
"self",
",",
"name",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"tensor_shape",
".",
"Dimension",
")",
":",
"dimension",
"=",
"value",
"labels",
"=",
"None",
"elif",
"isinstance",
"(",
"value",
",",
"int",
")... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/labeled_tensor/python/ops/core.py#L73-L110 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/function_base.py | python | median | (a, axis=None, out=None, overwrite_input=False) | return mean(part[indexer], axis=axis, out=out) | Compute the median along the specified axis.
Returns the median of the array elements.
Parameters
----------
a : array_like
Input array or object that can be converted to an array.
axis : int, optional
Axis along which the medians are computed. The default (axis=None)
is to... | Compute the median along the specified axis. | [
"Compute",
"the",
"median",
"along",
"the",
"specified",
"axis",
"."
] | def median(a, axis=None, out=None, overwrite_input=False):
"""
Compute the median along the specified axis.
Returns the median of the array elements.
Parameters
----------
a : array_like
Input array or object that can be converted to an array.
axis : int, optional
Axis alon... | [
"def",
"median",
"(",
"a",
",",
"axis",
"=",
"None",
",",
"out",
"=",
"None",
",",
"overwrite_input",
"=",
"False",
")",
":",
"a",
"=",
"np",
".",
"asanyarray",
"(",
"a",
")",
"if",
"axis",
"is",
"not",
"None",
"and",
"axis",
">=",
"a",
".",
"n... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/function_base.py#L2600-L2718 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | cmake/std/trilinosprhelpers/setenvironment/SetEnvironment.py | python | SetEnvironment.config | (self) | return self._config | The config property returns the configuration that is specified
by the configuration file. If the file has not been loaded yet,
then we will load it.
Returns:
ConfigParser object containing the contents of the configuration
that is loaded from the .ini file. This does no... | The config property returns the configuration that is specified
by the configuration file. If the file has not been loaded yet,
then we will load it. | [
"The",
"config",
"property",
"returns",
"the",
"configuration",
"that",
"is",
"specified",
"by",
"the",
"configuration",
"file",
".",
"If",
"the",
"file",
"has",
"not",
"been",
"loaded",
"yet",
"then",
"we",
"will",
"load",
"it",
"."
] | def config(self):
"""
The config property returns the configuration that is specified
by the configuration file. If the file has not been loaded yet,
then we will load it.
Returns:
ConfigParser object containing the contents of the configuration
that is l... | [
"def",
"config",
"(",
"self",
")",
":",
"if",
"self",
".",
"_config",
"is",
"None",
":",
"self",
".",
"_config",
"=",
"configparser",
".",
"ConfigParser",
"(",
")",
"# Prevent ConfigParser from lowercasing keys.",
"self",
".",
"_config",
".",
"optionxform",
"=... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/cmake/std/trilinosprhelpers/setenvironment/SetEnvironment.py#L67-L96 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | Window.InformFirstDirection | (*args, **kwargs) | return _core_.Window_InformFirstDirection(*args, **kwargs) | InformFirstDirection(self, int direction, int size, int availableOtherDir) -> bool
wxSizer and friends use this to give a chance to a component to recalc
its min size once one of the final size components is known. Override
this function when that is useful (such as for wxStaticText which can ... | InformFirstDirection(self, int direction, int size, int availableOtherDir) -> bool | [
"InformFirstDirection",
"(",
"self",
"int",
"direction",
"int",
"size",
"int",
"availableOtherDir",
")",
"-",
">",
"bool"
] | def InformFirstDirection(*args, **kwargs):
"""
InformFirstDirection(self, int direction, int size, int availableOtherDir) -> bool
wxSizer and friends use this to give a chance to a component to recalc
its min size once one of the final size components is known. Override
this fu... | [
"def",
"InformFirstDirection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_InformFirstDirection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L9861-L9872 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/ao/quantization/quantize.py | python | propagate_qconfig_ | (module, qconfig_dict=None) | r"""Propagate qconfig through the module hierarchy and assign `qconfig`
attribute on each leaf module
Args:
module: input module
qconfig_dict: dictionary that maps from name or type of submodule to
quantization configuration, qconfig applies to all submodules of a
given ... | r"""Propagate qconfig through the module hierarchy and assign `qconfig`
attribute on each leaf module | [
"r",
"Propagate",
"qconfig",
"through",
"the",
"module",
"hierarchy",
"and",
"assign",
"qconfig",
"attribute",
"on",
"each",
"leaf",
"module"
] | def propagate_qconfig_(module, qconfig_dict=None):
r"""Propagate qconfig through the module hierarchy and assign `qconfig`
attribute on each leaf module
Args:
module: input module
qconfig_dict: dictionary that maps from name or type of submodule to
quantization configuration, qc... | [
"def",
"propagate_qconfig_",
"(",
"module",
",",
"qconfig_dict",
"=",
"None",
")",
":",
"if",
"qconfig_dict",
"is",
"None",
":",
"qconfig_dict",
"=",
"{",
"}",
"_propagate_qconfig_helper",
"(",
"module",
",",
"qconfig_dict",
")"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/ao/quantization/quantize.py#L66-L82 | ||
carla-simulator/carla | 8854804f4d7748e14d937ec763a2912823a7e5f5 | PythonAPI/examples/client_bounding_boxes.py | python | BasicSynchronousClient.render | (self, display) | Transforms image from camera sensor and blits it to main pygame display. | Transforms image from camera sensor and blits it to main pygame display. | [
"Transforms",
"image",
"from",
"camera",
"sensor",
"and",
"blits",
"it",
"to",
"main",
"pygame",
"display",
"."
] | def render(self, display):
"""
Transforms image from camera sensor and blits it to main pygame display.
"""
if self.image is not None:
array = np.frombuffer(self.image.raw_data, dtype=np.dtype("uint8"))
array = np.reshape(array, (self.image.height, self.image.wid... | [
"def",
"render",
"(",
"self",
",",
"display",
")",
":",
"if",
"self",
".",
"image",
"is",
"not",
"None",
":",
"array",
"=",
"np",
".",
"frombuffer",
"(",
"self",
".",
"image",
".",
"raw_data",
",",
"dtype",
"=",
"np",
".",
"dtype",
"(",
"\"uint8\""... | https://github.com/carla-simulator/carla/blob/8854804f4d7748e14d937ec763a2912823a7e5f5/PythonAPI/examples/client_bounding_boxes.py#L324-L335 | ||
githubharald/CTCWordBeamSearch | 43567e5b06dd43bdcbec452f5099171c81f5e737 | extras/prototype/LanguageModel.py | python | LanguageModel.getUnigramProb | (self, w) | return 0 | prob of seeing word w. | prob of seeing word w. | [
"prob",
"of",
"seeing",
"word",
"w",
"."
] | def getUnigramProb(self, w):
"prob of seeing word w."
w = w.lower()
val = self.unigrams.get(w)
if val != None:
return val
return 0 | [
"def",
"getUnigramProb",
"(",
"self",
",",
"w",
")",
":",
"w",
"=",
"w",
".",
"lower",
"(",
")",
"val",
"=",
"self",
".",
"unigrams",
".",
"get",
"(",
"w",
")",
"if",
"val",
"!=",
"None",
":",
"return",
"val",
"return",
"0"
] | https://github.com/githubharald/CTCWordBeamSearch/blob/43567e5b06dd43bdcbec452f5099171c81f5e737/extras/prototype/LanguageModel.py#L87-L93 | |
telefonicaid/fiware-orion | 27c3202b9ddcfb9e3635a0af8d373f76e89b1d24 | scripts/managedb/check_location_coherence.py | python | update_ok | (doc, check_attrs) | return True | Check that entity document was updated correctly at DB.
:param doc: the doc to check
:param check_attrs: list of attributes which existente is checked | Check that entity document was updated correctly at DB. | [
"Check",
"that",
"entity",
"document",
"was",
"updated",
"correctly",
"at",
"DB",
"."
] | def update_ok(doc, check_attrs):
"""
Check that entity document was updated correctly at DB.
:param doc: the doc to check
:param check_attrs: list of attributes which existente is checked
"""
if not ATTRS in doc:
#print "debug1: no attrs"
return False
for attr in check_att... | [
"def",
"update_ok",
"(",
"doc",
",",
"check_attrs",
")",
":",
"if",
"not",
"ATTRS",
"in",
"doc",
":",
"#print \"debug1: no attrs\"",
"return",
"False",
"for",
"attr",
"in",
"check_attrs",
":",
"if",
"attr",
"not",
"in",
"doc",
"[",
"ATTRS",
"]",
":",
"#p... | https://github.com/telefonicaid/fiware-orion/blob/27c3202b9ddcfb9e3635a0af8d373f76e89b1d24/scripts/managedb/check_location_coherence.py#L80-L98 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/bindings/python/MythTV/methodheap.py | python | MythXML.getChannelIcon | (self, chanid) | return self._request('Guide/GetChannelIcon', ChanId=chanid).read() | Returns channel icon as a data string | Returns channel icon as a data string | [
"Returns",
"channel",
"icon",
"as",
"a",
"data",
"string"
] | def getChannelIcon(self, chanid):
"""Returns channel icon as a data string"""
return self._request('Guide/GetChannelIcon', ChanId=chanid).read() | [
"def",
"getChannelIcon",
"(",
"self",
",",
"chanid",
")",
":",
"return",
"self",
".",
"_request",
"(",
"'Guide/GetChannelIcon'",
",",
"ChanId",
"=",
"chanid",
")",
".",
"read",
"(",
")"
] | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/bindings/python/MythTV/methodheap.py#L1212-L1214 | |
hifiberry/hifiberry-os | 88c05213fb3e6230645cb4bf8eb8fceda8bd07d4 | buildroot/package/audiocontrol2/src/mpris.py | python | array_to_string | (arr) | Converts an array of objects to a comma separated string | Converts an array of objects to a comma separated string | [
"Converts",
"an",
"array",
"of",
"objects",
"to",
"a",
"comma",
"separated",
"string"
] | def array_to_string(arr):
"""
Converts an array of objects to a comma separated string
"""
res = ""
for part in arr:
res = res + part + ", "
if len(res) > 1:
return res[:-2]
else:
return "" | [
"def",
"array_to_string",
"(",
"arr",
")",
":",
"res",
"=",
"\"\"",
"for",
"part",
"in",
"arr",
":",
"res",
"=",
"res",
"+",
"part",
"+",
"\", \"",
"if",
"len",
"(",
"res",
")",
">",
"1",
":",
"return",
"res",
"[",
":",
"-",
"2",
"]",
"else",
... | https://github.com/hifiberry/hifiberry-os/blob/88c05213fb3e6230645cb4bf8eb8fceda8bd07d4/buildroot/package/audiocontrol2/src/mpris.py#L23-L33 | ||
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 | alltt_escape | (s) | return re.sub(r'[\\{}]', lambda mo: xlat[mo.group()], s) | Replace backslash and braces with their escaped equivalents | Replace backslash and braces with their escaped equivalents | [
"Replace",
"backslash",
"and",
"braces",
"with",
"their",
"escaped",
"equivalents"
] | def alltt_escape(s):
'Replace backslash and braces with their escaped equivalents'
xlat = {'{': r'\{', '}': r'\}', '\\': r'\textbackslash{}'}
return re.sub(r'[\\{}]', lambda mo: xlat[mo.group()], s) | [
"def",
"alltt_escape",
"(",
"s",
")",
":",
"xlat",
"=",
"{",
"'{'",
":",
"r'\\{'",
",",
"'}'",
":",
"r'\\}'",
",",
"'\\\\'",
":",
"r'\\textbackslash{}'",
"}",
"return",
"re",
".",
"sub",
"(",
"r'[\\\\{}]'",
",",
"lambda",
"mo",
":",
"xlat",
"[",
"mo"... | 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#L176-L179 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | Window.GetLayoutDirection | (*args, **kwargs) | return _core_.Window_GetLayoutDirection(*args, **kwargs) | GetLayoutDirection(self) -> int
Get the layout direction (LTR or RTL) for this window. Returns
``wx.Layout_Default`` if layout direction is not supported. | GetLayoutDirection(self) -> int | [
"GetLayoutDirection",
"(",
"self",
")",
"-",
">",
"int"
] | def GetLayoutDirection(*args, **kwargs):
"""
GetLayoutDirection(self) -> int
Get the layout direction (LTR or RTL) for this window. Returns
``wx.Layout_Default`` if layout direction is not supported.
"""
return _core_.Window_GetLayoutDirection(*args, **kwargs) | [
"def",
"GetLayoutDirection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_GetLayoutDirection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L9302-L9309 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/numbers.py | python | Complex.__eq__ | (self, other) | self == other | self == other | [
"self",
"==",
"other"
] | def __eq__(self, other):
"""self == other"""
raise NotImplementedError | [
"def",
"__eq__",
"(",
"self",
",",
"other",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/numbers.py#L140-L142 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Random/random.py | python | StrongRandom.randrange | (self, *args) | return start + (step * r) | randrange([start,] stop[, step]):
Return a randomly-selected element from range(start, stop, step). | randrange([start,] stop[, step]):
Return a randomly-selected element from range(start, stop, step). | [
"randrange",
"(",
"[",
"start",
"]",
"stop",
"[",
"step",
"]",
")",
":",
"Return",
"a",
"randomly",
"-",
"selected",
"element",
"from",
"range",
"(",
"start",
"stop",
"step",
")",
"."
] | def randrange(self, *args):
"""randrange([start,] stop[, step]):
Return a randomly-selected element from range(start, stop, step)."""
if len(args) == 3:
(start, stop, step) = args
elif len(args) == 2:
(start, stop) = args
step = 1
elif len(args... | [
"def",
"randrange",
"(",
"self",
",",
"*",
"args",
")",
":",
"if",
"len",
"(",
"args",
")",
"==",
"3",
":",
"(",
"start",
",",
"stop",
",",
"step",
")",
"=",
"args",
"elif",
"len",
"(",
"args",
")",
"==",
"2",
":",
"(",
"start",
",",
"stop",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Random/random.py#L50-L81 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/py_vulcanize/third_party/rjsmin/bench/jsmin.py | python | JavascriptMinify._next | (self) | return c | get the next character, excluding comments. peek() is used to see
if an unescaped '/' is followed by a '/' or '*'. | get the next character, excluding comments. peek() is used to see
if an unescaped '/' is followed by a '/' or '*'. | [
"get",
"the",
"next",
"character",
"excluding",
"comments",
".",
"peek",
"()",
"is",
"used",
"to",
"see",
"if",
"an",
"unescaped",
"/",
"is",
"followed",
"by",
"a",
"/",
"or",
"*",
"."
] | def _next(self):
"""get the next character, excluding comments. peek() is used to see
if an unescaped '/' is followed by a '/' or '*'.
"""
c = self._get()
if c == '/' and self.theA != '\\':
p = self._peek()
if p == '/':
c = self._get()
... | [
"def",
"_next",
"(",
"self",
")",
":",
"c",
"=",
"self",
".",
"_get",
"(",
")",
"if",
"c",
"==",
"'/'",
"and",
"self",
".",
"theA",
"!=",
"'\\\\'",
":",
"p",
"=",
"self",
".",
"_peek",
"(",
")",
"if",
"p",
"==",
"'/'",
":",
"c",
"=",
"self"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/py_vulcanize/third_party/rjsmin/bench/jsmin.py#L96-L119 | |
infinit/elle | a8154593c42743f45b9df09daf62b44630c24a02 | drake/src/drake/go/__init__.py | python | Toolkit.hash | (self) | return {
'version': self.version,
} | The hash of the Toolkit used for dependency computation.
:return: Hash of the Toolkit
:rtype: str | The hash of the Toolkit used for dependency computation. | [
"The",
"hash",
"of",
"the",
"Toolkit",
"used",
"for",
"dependency",
"computation",
"."
] | def hash(self):
"""
The hash of the Toolkit used for dependency computation.
:return: Hash of the Toolkit
:rtype: str
"""
return {
'version': self.version,
} | [
"def",
"hash",
"(",
"self",
")",
":",
"return",
"{",
"'version'",
":",
"self",
".",
"version",
",",
"}"
] | https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/go/__init__.py#L356-L365 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/subprocess.py | python | check_output | (*popenargs, timeout=None, **kwargs) | return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
**kwargs).stdout | r"""Run command with arguments and return its output.
If the exit code was non-zero it raises a CalledProcessError. The
CalledProcessError object will have the return code in the returncode
attribute and output in the output attribute.
The arguments are the same as for the Popen constructor. Example... | r"""Run command with arguments and return its output. | [
"r",
"Run",
"command",
"with",
"arguments",
"and",
"return",
"its",
"output",
"."
] | def check_output(*popenargs, timeout=None, **kwargs):
r"""Run command with arguments and return its output.
If the exit code was non-zero it raises a CalledProcessError. The
CalledProcessError object will have the return code in the returncode
attribute and output in the output attribute.
The arg... | [
"def",
"check_output",
"(",
"*",
"popenargs",
",",
"timeout",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"'stdout'",
"in",
"kwargs",
":",
"raise",
"ValueError",
"(",
"'stdout argument not allowed, it will be overridden.'",
")",
"if",
"'input'",
"in",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/subprocess.py#L377-L425 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/winpython/qthelpers.py | python | keybinding | (attr) | return from_qvariant(QKeySequence.keyBindings(ks)[0], str) | Return keybinding | Return keybinding | [
"Return",
"keybinding"
] | def keybinding(attr):
"""Return keybinding"""
ks = getattr(QKeySequence, attr)
return from_qvariant(QKeySequence.keyBindings(ks)[0], str) | [
"def",
"keybinding",
"(",
"attr",
")",
":",
"ks",
"=",
"getattr",
"(",
"QKeySequence",
",",
"attr",
")",
"return",
"from_qvariant",
"(",
"QKeySequence",
".",
"keyBindings",
"(",
"ks",
")",
"[",
"0",
"]",
",",
"str",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/winpython/qthelpers.py#L86-L89 | |
matthewsamuel95/ACM-ICPC-Algorithms | eb7050344a7f3677c0980c94f3a57b852b4f9bc0 | String/Hamming distance/hamming_distance.py | python | hamming_distance | (s1, s2) | return sum(ch1 != ch2 for ch1, ch2 in zip(s1, s2)) | Returns the Hamming distance between two equal-length sequences | Returns the Hamming distance between two equal-length sequences | [
"Returns",
"the",
"Hamming",
"distance",
"between",
"two",
"equal",
"-",
"length",
"sequences"
] | def hamming_distance(s1, s2):
"""Returns the Hamming distance between two equal-length sequences"""
if len(s1) != len(s2):
raise ValueError("Sequences of unequal length")
return sum(ch1 != ch2 for ch1, ch2 in zip(s1, s2)) | [
"def",
"hamming_distance",
"(",
"s1",
",",
"s2",
")",
":",
"if",
"len",
"(",
"s1",
")",
"!=",
"len",
"(",
"s2",
")",
":",
"raise",
"ValueError",
"(",
"\"Sequences of unequal length\"",
")",
"return",
"sum",
"(",
"ch1",
"!=",
"ch2",
"for",
"ch1",
",",
... | https://github.com/matthewsamuel95/ACM-ICPC-Algorithms/blob/eb7050344a7f3677c0980c94f3a57b852b4f9bc0/String/Hamming distance/hamming_distance.py#L1-L5 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/mozjar.py | python | JarReader._getreader | (self, entry) | return JarFileReader(header,
self._data[entry['offset'] + header.size:]) | Helper to create a JarFileReader corresponding to the given central
directory entry. | Helper to create a JarFileReader corresponding to the given central
directory entry. | [
"Helper",
"to",
"create",
"a",
"JarFileReader",
"corresponding",
"to",
"the",
"given",
"central",
"directory",
"entry",
"."
] | def _getreader(self, entry):
'''
Helper to create a JarFileReader corresponding to the given central
directory entry.
'''
header = JarLocalFileHeader(self._data[entry['offset']:])
for key, value in entry:
if key in header and header[key] != value:
... | [
"def",
"_getreader",
"(",
"self",
",",
"entry",
")",
":",
"header",
"=",
"JarLocalFileHeader",
"(",
"self",
".",
"_data",
"[",
"entry",
"[",
"'offset'",
"]",
":",
"]",
")",
"for",
"key",
",",
"value",
"in",
"entry",
":",
"if",
"key",
"in",
"header",
... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/mozjar.py#L417-L428 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/ensemble/_gb.py | python | BaseGradientBoosting._raw_predict | (self, X) | return raw_predictions | Return the sum of the trees raw predictions (+ init estimator). | Return the sum of the trees raw predictions (+ init estimator). | [
"Return",
"the",
"sum",
"of",
"the",
"trees",
"raw",
"predictions",
"(",
"+",
"init",
"estimator",
")",
"."
] | def _raw_predict(self, X):
"""Return the sum of the trees raw predictions (+ init estimator)."""
raw_predictions = self._raw_predict_init(X)
predict_stages(self.estimators_, X, self.learning_rate,
raw_predictions)
return raw_predictions | [
"def",
"_raw_predict",
"(",
"self",
",",
"X",
")",
":",
"raw_predictions",
"=",
"self",
".",
"_raw_predict_init",
"(",
"X",
")",
"predict_stages",
"(",
"self",
".",
"estimators_",
",",
"X",
",",
"self",
".",
"learning_rate",
",",
"raw_predictions",
")",
"r... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/ensemble/_gb.py#L1653-L1658 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/Utils/cgf_utils/aws_utils.py | python | ArnParser.__init__ | (self, arn) | Parameters
----------
arn : str
An AWS arn to parse | Parameters
----------
arn : str
An AWS arn to parse | [
"Parameters",
"----------",
"arn",
":",
"str",
"An",
"AWS",
"arn",
"to",
"parse"
] | def __init__(self, arn):
"""
Parameters
----------
arn : str
An AWS arn to parse
"""
try:
# Split into arn, partition, service, region, account and resource block
# But avoid splitting resource as ':' is a valid part of the resource blo... | [
"def",
"__init__",
"(",
"self",
",",
"arn",
")",
":",
"try",
":",
"# Split into arn, partition, service, region, account and resource block",
"# But avoid splitting resource as ':' is a valid part of the resource block (see below)",
"arn_components",
"=",
"str",
"(",
"arn",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/Utils/cgf_utils/aws_utils.py#L358-L395 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/xml/dom/expatbuilder.py | python | FragmentBuilder.parseFile | (self, file) | return self.parseString(file.read()) | Parse a document fragment from a file object, returning the
fragment node. | Parse a document fragment from a file object, returning the
fragment node. | [
"Parse",
"a",
"document",
"fragment",
"from",
"a",
"file",
"object",
"returning",
"the",
"fragment",
"node",
"."
] | def parseFile(self, file):
"""Parse a document fragment from a file object, returning the
fragment node."""
return self.parseString(file.read()) | [
"def",
"parseFile",
"(",
"self",
",",
"file",
")",
":",
"return",
"self",
".",
"parseString",
"(",
"file",
".",
"read",
"(",
")",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/xml/dom/expatbuilder.py#L623-L626 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/cmd.py | python | Cmd.parseline | (self, line) | return cmd, arg, line | Parse the line into a command name and a string containing
the arguments. Returns a tuple containing (command, args, line).
'command' and 'args' may be None if the line couldn't be parsed. | Parse the line into a command name and a string containing
the arguments. Returns a tuple containing (command, args, line).
'command' and 'args' may be None if the line couldn't be parsed. | [
"Parse",
"the",
"line",
"into",
"a",
"command",
"name",
"and",
"a",
"string",
"containing",
"the",
"arguments",
".",
"Returns",
"a",
"tuple",
"containing",
"(",
"command",
"args",
"line",
")",
".",
"command",
"and",
"args",
"may",
"be",
"None",
"if",
"th... | def parseline(self, line):
"""Parse the line into a command name and a string containing
the arguments. Returns a tuple containing (command, args, line).
'command' and 'args' may be None if the line couldn't be parsed.
"""
line = line.strip()
if not line:
ret... | [
"def",
"parseline",
"(",
"self",
",",
"line",
")",
":",
"line",
"=",
"line",
".",
"strip",
"(",
")",
"if",
"not",
"line",
":",
"return",
"None",
",",
"None",
",",
"line",
"elif",
"line",
"[",
"0",
"]",
"==",
"'?'",
":",
"line",
"=",
"'help '",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/cmd.py#L176-L194 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/symbol/symbol.py | python | Symbol.arctanh | (self, *args, **kwargs) | return op.arctanh(self, *args, **kwargs) | Convenience fluent method for :py:func:`arctanh`.
The arguments are the same as for :py:func:`arctanh`, with
this array as data. | Convenience fluent method for :py:func:`arctanh`. | [
"Convenience",
"fluent",
"method",
"for",
":",
"py",
":",
"func",
":",
"arctanh",
"."
] | def arctanh(self, *args, **kwargs):
"""Convenience fluent method for :py:func:`arctanh`.
The arguments are the same as for :py:func:`arctanh`, with
this array as data.
"""
return op.arctanh(self, *args, **kwargs) | [
"def",
"arctanh",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"op",
".",
"arctanh",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/symbol/symbol.py#L2422-L2428 | |
psmoveservice/PSMoveService | 22bbe20e9de53f3f3581137bce7b88e2587a27e7 | misc/python/pypsmove/transformations.py | python | reflection_matrix | (point, normal) | return M | Return matrix to mirror at plane defined by point and normal vector.
>>> v0 = numpy.random.random(4) - 0.5
>>> v0[3] = 1.
>>> v1 = numpy.random.random(3) - 0.5
>>> R = reflection_matrix(v0, v1)
>>> numpy.allclose(2, numpy.trace(R))
True
>>> numpy.allclose(v0, numpy.dot(R, v0))
True
... | Return matrix to mirror at plane defined by point and normal vector. | [
"Return",
"matrix",
"to",
"mirror",
"at",
"plane",
"defined",
"by",
"point",
"and",
"normal",
"vector",
"."
] | def reflection_matrix(point, normal):
"""Return matrix to mirror at plane defined by point and normal vector.
>>> v0 = numpy.random.random(4) - 0.5
>>> v0[3] = 1.
>>> v1 = numpy.random.random(3) - 0.5
>>> R = reflection_matrix(v0, v1)
>>> numpy.allclose(2, numpy.trace(R))
True
>>> numpy... | [
"def",
"reflection_matrix",
"(",
"point",
",",
"normal",
")",
":",
"normal",
"=",
"unit_vector",
"(",
"normal",
"[",
":",
"3",
"]",
")",
"M",
"=",
"numpy",
".",
"identity",
"(",
"4",
")",
"M",
"[",
":",
"3",
",",
":",
"3",
"]",
"-=",
"2.0",
"*"... | https://github.com/psmoveservice/PSMoveService/blob/22bbe20e9de53f3f3581137bce7b88e2587a27e7/misc/python/pypsmove/transformations.py#L247-L270 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/tracking/base.py | python | Trackable._add_variable_with_custom_getter | (self,
name,
shape=None,
dtype=dtypes.float32,
initializer=None,
getter=None,
overwrit... | Restore-on-create for a variable be saved with this `Trackable`.
If the user has requested that this object or another `Trackable` which
depends on this object be restored from a checkpoint (deferred loading
before variable object creation), `initializer` may be ignored and the value
from the checkpoin... | Restore-on-create for a variable be saved with this `Trackable`. | [
"Restore",
"-",
"on",
"-",
"create",
"for",
"a",
"variable",
"be",
"saved",
"with",
"this",
"Trackable",
"."
] | def _add_variable_with_custom_getter(self,
name,
shape=None,
dtype=dtypes.float32,
initializer=None,
getter=None,
... | [
"def",
"_add_variable_with_custom_getter",
"(",
"self",
",",
"name",
",",
"shape",
"=",
"None",
",",
"dtype",
"=",
"dtypes",
".",
"float32",
",",
"initializer",
"=",
"None",
",",
"getter",
"=",
"None",
",",
"overwrite",
"=",
"False",
",",
"*",
"*",
"kwar... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/tracking/base.py#L653-L723 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/_osx_support.py | python | _remove_original_values | (_config_vars) | Remove original unmodified values for testing | Remove original unmodified values for testing | [
"Remove",
"original",
"unmodified",
"values",
"for",
"testing"
] | def _remove_original_values(_config_vars):
"""Remove original unmodified values for testing"""
# This is needed for higher-level cross-platform tests of get_platform.
for k in list(_config_vars):
if k.startswith(_INITPRE):
del _config_vars[k] | [
"def",
"_remove_original_values",
"(",
"_config_vars",
")",
":",
"# This is needed for higher-level cross-platform tests of get_platform.",
"for",
"k",
"in",
"list",
"(",
"_config_vars",
")",
":",
"if",
"k",
".",
"startswith",
"(",
"_INITPRE",
")",
":",
"del",
"_confi... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/_osx_support.py#L113-L118 | ||
genn-team/genn | 75e1eb218cafa228bf36ae4613d1ce26e877b12c | pygenn/genn_model.py | python | GeNNModel.load | (self, path_to_model="./", num_recording_timesteps=None) | import the model as shared library and initialize it | import the model as shared library and initialize it | [
"import",
"the",
"model",
"as",
"shared",
"library",
"and",
"initialize",
"it"
] | def load(self, path_to_model="./", num_recording_timesteps=None):
"""import the model as shared library and initialize it"""
if self._loaded:
raise Exception("GeNN model already loaded")
self._path_to_model = path_to_model
self._slm.open(self._path_to_model, self.model_name,... | [
"def",
"load",
"(",
"self",
",",
"path_to_model",
"=",
"\"./\"",
",",
"num_recording_timesteps",
"=",
"None",
")",
":",
"if",
"self",
".",
"_loaded",
":",
"raise",
"Exception",
"(",
"\"GeNN model already loaded\"",
")",
"self",
".",
"_path_to_model",
"=",
"pat... | https://github.com/genn-team/genn/blob/75e1eb218cafa228bf36ae4613d1ce26e877b12c/pygenn/genn_model.py#L601-L663 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/html.py | python | HtmlWinTagHandler.__init__ | (self, *args, **kwargs) | __init__(self) -> HtmlWinTagHandler | __init__(self) -> HtmlWinTagHandler | [
"__init__",
"(",
"self",
")",
"-",
">",
"HtmlWinTagHandler"
] | def __init__(self, *args, **kwargs):
"""__init__(self) -> HtmlWinTagHandler"""
_html.HtmlWinTagHandler_swiginit(self,_html.new_HtmlWinTagHandler(*args, **kwargs))
HtmlWinTagHandler._setCallbackInfo(self, self, HtmlWinTagHandler) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_html",
".",
"HtmlWinTagHandler_swiginit",
"(",
"self",
",",
"_html",
".",
"new_HtmlWinTagHandler",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"HtmlWinTagHand... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/html.py#L424-L427 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/ndimage/interpolation.py | python | rotate | (input, angle, axes=(1, 0), reshape=True, output=None, order=3,
mode='constant', cval=0.0, prefilter=True) | return output | Rotate an array.
The array is rotated in the plane defined by the two axes given by the
`axes` parameter using spline interpolation of the requested order.
Parameters
----------
%(input)s
angle : float
The rotation angle in degrees.
axes : tuple of 2 ints, optional
The two ... | Rotate an array. | [
"Rotate",
"an",
"array",
"."
] | def rotate(input, angle, axes=(1, 0), reshape=True, output=None, order=3,
mode='constant', cval=0.0, prefilter=True):
"""
Rotate an array.
The array is rotated in the plane defined by the two axes given by the
`axes` parameter using spline interpolation of the requested order.
Parameter... | [
"def",
"rotate",
"(",
"input",
",",
"angle",
",",
"axes",
"=",
"(",
"1",
",",
"0",
")",
",",
"reshape",
"=",
"True",
",",
"output",
"=",
"None",
",",
"order",
"=",
"3",
",",
"mode",
"=",
"'constant'",
",",
"cval",
"=",
"0.0",
",",
"prefilter",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/ndimage/interpolation.py#L634-L746 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_tree_ensemble.py | python | _get_value | (scikit_value, mode="regressor", scaling=1.0, n_classes=2, tree_index=0) | return value | Get the right value from the scikit-tree | Get the right value from the scikit-tree | [
"Get",
"the",
"right",
"value",
"from",
"the",
"scikit",
"-",
"tree"
] | def _get_value(scikit_value, mode="regressor", scaling=1.0, n_classes=2, tree_index=0):
""" Get the right value from the scikit-tree
"""
# Regression
if mode == "regressor":
return scikit_value[0] * scaling
# Binary classification
if n_classes == 2:
# Decision tree
if le... | [
"def",
"_get_value",
"(",
"scikit_value",
",",
"mode",
"=",
"\"regressor\"",
",",
"scaling",
"=",
"1.0",
",",
"n_classes",
"=",
"2",
",",
"tree_index",
"=",
"0",
")",
":",
"# Regression",
"if",
"mode",
"==",
"\"regressor\"",
":",
"return",
"scikit_value",
... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_tree_ensemble.py#L17-L43 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/chrome/flags.py | python | VersionFlag.__str__ | (self) | return ' '.join(res) | Serialize the flag definitions in the same form given to each
add_definition() call. | Serialize the flag definitions in the same form given to each
add_definition() call. | [
"Serialize",
"the",
"flag",
"definitions",
"in",
"the",
"same",
"form",
"given",
"to",
"each",
"add_definition",
"()",
"call",
"."
] | def __str__(self):
'''
Serialize the flag definitions in the same form given to each
add_definition() call.
'''
res = []
for comparison, val in self.values:
if comparison == '==':
res.append('%s=%s' % (self.name, val))
else:
... | [
"def",
"__str__",
"(",
"self",
")",
":",
"res",
"=",
"[",
"]",
"for",
"comparison",
",",
"val",
"in",
"self",
".",
"values",
":",
"if",
"comparison",
"==",
"'=='",
":",
"res",
".",
"append",
"(",
"'%s=%s'",
"%",
"(",
"self",
".",
"name",
",",
"va... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/chrome/flags.py#L186-L197 | |
bigartm/bigartm | 47e37f982de87aa67bfd475ff1f39da696b181b3 | 3rdparty/protobuf-3.0.0/python/google/protobuf/message.py | python | Message.SerializeToString | (self) | Serializes the protocol message to a binary string.
Returns:
A binary string representation of the message if all of the required
fields in the message are set (i.e. the message is initialized).
Raises:
message.EncodeError if the message isn't initialized. | Serializes the protocol message to a binary string. | [
"Serializes",
"the",
"protocol",
"message",
"to",
"a",
"binary",
"string",
"."
] | def SerializeToString(self):
"""Serializes the protocol message to a binary string.
Returns:
A binary string representation of the message if all of the required
fields in the message are set (i.e. the message is initialized).
Raises:
message.EncodeError if the message isn't initialized.... | [
"def",
"SerializeToString",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/message.py#L187-L197 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/opt/python/training/model_average_optimizer.py | python | ModelAverageOptimizer.__init__ | (self,
opt,
num_worker,
is_chief,
ma_custom_getter,
interval_steps=100,
use_locking=True,
name="ModelAverageOptimizer") | Construct a new model average optimizer.
Args:
opt: The actual optimizer that will be used to update local variables
num_worker: The number of workers
is_chief: whether chief worker
ma_custom_getter: ModelAverageCustomGetter
interval_steps: An int point value to controls the frequency... | Construct a new model average optimizer. | [
"Construct",
"a",
"new",
"model",
"average",
"optimizer",
"."
] | def __init__(self,
opt,
num_worker,
is_chief,
ma_custom_getter,
interval_steps=100,
use_locking=True,
name="ModelAverageOptimizer"):
"""Construct a new model average optimizer.
Args:
opt: The actual o... | [
"def",
"__init__",
"(",
"self",
",",
"opt",
",",
"num_worker",
",",
"is_chief",
",",
"ma_custom_getter",
",",
"interval_steps",
"=",
"100",
",",
"use_locking",
"=",
"True",
",",
"name",
"=",
"\"ModelAverageOptimizer\"",
")",
":",
"super",
"(",
"ModelAverageOpt... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/opt/python/training/model_average_optimizer.py#L114-L149 | ||
sonyxperiadev/WebGL | 0299b38196f78c6d5f74bcf6fa312a3daee6de60 | Tools/Scripts/webkitpy/style/checkers/cpp.py | python | check_function_definition | (filename, file_extension, clean_lines, line_number, function_state, error) | Check that function definitions for style issues.
Specifically, check that parameter names in declarations add information.
Args:
filename: Filename of the file that is being processed.
file_extension: The current file extension, without the leading dot.
clean_lines: A CleansedLines insta... | Check that function definitions for style issues. | [
"Check",
"that",
"function",
"definitions",
"for",
"style",
"issues",
"."
] | def check_function_definition(filename, file_extension, clean_lines, line_number, function_state, error):
"""Check that function definitions for style issues.
Specifically, check that parameter names in declarations add information.
Args:
filename: Filename of the file that is being processed.
... | [
"def",
"check_function_definition",
"(",
"filename",
",",
"file_extension",
",",
"clean_lines",
",",
"line_number",
",",
"function_state",
",",
"error",
")",
":",
"if",
"line_number",
"!=",
"function_state",
".",
"body_start_position",
".",
"row",
":",
"return",
"... | https://github.com/sonyxperiadev/WebGL/blob/0299b38196f78c6d5f74bcf6fa312a3daee6de60/Tools/Scripts/webkitpy/style/checkers/cpp.py#L1569-L1616 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/rnn_common.py | python | select_last_activations | (activations, sequence_lengths) | Selects the nth set of activations for each n in `sequence_length`.
Returns a `Tensor` of shape `[batch_size, k]`. If `sequence_length` is not
`None`, then `output[i, :] = activations[i, sequence_length[i] - 1, :]`. If
`sequence_length` is `None`, then `output[i, :] = activations[i, -1, :]`.
Args:
activat... | Selects the nth set of activations for each n in `sequence_length`. | [
"Selects",
"the",
"nth",
"set",
"of",
"activations",
"for",
"each",
"n",
"in",
"sequence_length",
"."
] | def select_last_activations(activations, sequence_lengths):
"""Selects the nth set of activations for each n in `sequence_length`.
Returns a `Tensor` of shape `[batch_size, k]`. If `sequence_length` is not
`None`, then `output[i, :] = activations[i, sequence_length[i] - 1, :]`. If
`sequence_length` is `None`, ... | [
"def",
"select_last_activations",
"(",
"activations",
",",
"sequence_lengths",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"'select_last_activations'",
",",
"values",
"=",
"[",
"activations",
",",
"sequence_lengths",
"]",
")",
":",
"activations_shape",
"=",
"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/rnn_common.py#L182-L209 | ||
anestisb/oatdump_plus | ba858c1596598f0d9ae79c14d08c708cecc50af3 | tools/cpplint.py | python | _CppLintState.SetCountingStyle | (self, counting_style) | Sets the module's counting options. | Sets the module's counting options. | [
"Sets",
"the",
"module",
"s",
"counting",
"options",
"."
] | def SetCountingStyle(self, counting_style):
"""Sets the module's counting options."""
self.counting = counting_style | [
"def",
"SetCountingStyle",
"(",
"self",
",",
"counting_style",
")",
":",
"self",
".",
"counting",
"=",
"counting_style"
] | https://github.com/anestisb/oatdump_plus/blob/ba858c1596598f0d9ae79c14d08c708cecc50af3/tools/cpplint.py#L592-L594 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/core/debugger.py | python | Pdb.do_pfile | (self, arg) | Print (or run through pager) the file where an object is defined.
The debugger interface to %pfile. | Print (or run through pager) the file where an object is defined. | [
"Print",
"(",
"or",
"run",
"through",
"pager",
")",
"the",
"file",
"where",
"an",
"object",
"is",
"defined",
"."
] | def do_pfile(self, arg):
"""Print (or run through pager) the file where an object is defined.
The debugger interface to %pfile.
"""
namespaces = [('Locals', self.curframe.f_locals),
('Globals', self.curframe.f_globals)]
self.shell.find_line_magic('pfile')(a... | [
"def",
"do_pfile",
"(",
"self",
",",
"arg",
")",
":",
"namespaces",
"=",
"[",
"(",
"'Locals'",
",",
"self",
".",
"curframe",
".",
"f_locals",
")",
",",
"(",
"'Globals'",
",",
"self",
".",
"curframe",
".",
"f_globals",
")",
"]",
"self",
".",
"shell",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/debugger.py#L563-L570 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/mixture/_base.py | python | BaseMixture.predict | (self, X) | return self._estimate_weighted_log_prob(X).argmax(axis=1) | Predict the labels for the data samples in X using trained model.
Parameters
----------
X : array-like, shape (n_samples, n_features)
List of n_features-dimensional data points. Each row
corresponds to a single data point.
Returns
-------
labels ... | Predict the labels for the data samples in X using trained model. | [
"Predict",
"the",
"labels",
"for",
"the",
"data",
"samples",
"in",
"X",
"using",
"trained",
"model",
"."
] | def predict(self, X):
"""Predict the labels for the data samples in X using trained model.
Parameters
----------
X : array-like, shape (n_samples, n_features)
List of n_features-dimensional data points. Each row
corresponds to a single data point.
Return... | [
"def",
"predict",
"(",
"self",
",",
"X",
")",
":",
"check_is_fitted",
"(",
"self",
")",
"X",
"=",
"_check_X",
"(",
"X",
",",
"None",
",",
"self",
".",
"means_",
".",
"shape",
"[",
"1",
"]",
")",
"return",
"self",
".",
"_estimate_weighted_log_prob",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/mixture/_base.py#L356-L372 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/stats/mstats_basic.py | python | friedmanchisquare | (*args) | return FriedmanchisquareResult(chisq,
distributions.chi2.sf(chisq, k-1)) | Friedman Chi-Square is a non-parametric, one-way within-subjects ANOVA.
This function calculates the Friedman Chi-square test for repeated measures
and returns the result, along with the associated probability value.
Each input is considered a given group. Ideally, the number of treatments
among each g... | Friedman Chi-Square is a non-parametric, one-way within-subjects ANOVA.
This function calculates the Friedman Chi-square test for repeated measures
and returns the result, along with the associated probability value. | [
"Friedman",
"Chi",
"-",
"Square",
"is",
"a",
"non",
"-",
"parametric",
"one",
"-",
"way",
"within",
"-",
"subjects",
"ANOVA",
".",
"This",
"function",
"calculates",
"the",
"Friedman",
"Chi",
"-",
"square",
"test",
"for",
"repeated",
"measures",
"and",
"ret... | def friedmanchisquare(*args):
"""Friedman Chi-Square is a non-parametric, one-way within-subjects ANOVA.
This function calculates the Friedman Chi-square test for repeated measures
and returns the result, along with the associated probability value.
Each input is considered a given group. Ideally, the ... | [
"def",
"friedmanchisquare",
"(",
"*",
"args",
")",
":",
"data",
"=",
"argstoarray",
"(",
"*",
"args",
")",
".",
"astype",
"(",
"float",
")",
"k",
"=",
"len",
"(",
"data",
")",
"if",
"k",
"<",
"3",
":",
"raise",
"ValueError",
"(",
"\"Less than 3 group... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/stats/mstats_basic.py#L2642-L2687 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/crf/python/ops/crf.py | python | CrfDecodeForwardRnnCell.__call__ | (self, inputs, state, scope=None) | return backpointers, new_state | Build the CrfDecodeForwardRnnCell.
Args:
inputs: A [batch_size, num_tags] matrix of unary potentials.
state: A [batch_size, num_tags] matrix containing the previous step's
score values.
scope: Unused variable scope of this cell.
Returns:
backpointers: A [batch_size, num_tag... | Build the CrfDecodeForwardRnnCell. | [
"Build",
"the",
"CrfDecodeForwardRnnCell",
"."
] | def __call__(self, inputs, state, scope=None):
"""Build the CrfDecodeForwardRnnCell.
Args:
inputs: A [batch_size, num_tags] matrix of unary potentials.
state: A [batch_size, num_tags] matrix containing the previous step's
score values.
scope: Unused variable scope of this cell.
... | [
"def",
"__call__",
"(",
"self",
",",
"inputs",
",",
"state",
",",
"scope",
"=",
"None",
")",
":",
"# For simplicity, in shape comments, denote:",
"# 'batch_size' by 'B', 'max_seq_len' by 'T' , 'num_tags' by 'O' (output).",
"state",
"=",
"array_ops",
".",
"expand_dims",
"(",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/crf/python/ops/crf.py#L448-L472 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/core.py | python | MaskedArray.__pow__ | (self, other) | return power(self, other) | Raise self to the power other, masking the potential NaNs/Infs | Raise self to the power other, masking the potential NaNs/Infs | [
"Raise",
"self",
"to",
"the",
"power",
"other",
"masking",
"the",
"potential",
"NaNs",
"/",
"Infs"
] | def __pow__(self, other):
"""
Raise self to the power other, masking the potential NaNs/Infs
"""
if self._delegate_binop(other):
return NotImplemented
return power(self, other) | [
"def",
"__pow__",
"(",
"self",
",",
"other",
")",
":",
"if",
"self",
".",
"_delegate_binop",
"(",
"other",
")",
":",
"return",
"NotImplemented",
"return",
"power",
"(",
"self",
",",
"other",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/core.py#L4182-L4189 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/learn/python/learn/dataframe/transform.py | python | parameter | (func) | return property(func) | Tag functions annotated with `@parameter` for later retrieval.
Note that all `@parameter`s are automatically `@property`s as well.
Args:
func: the getter function to tag and wrap
Returns:
A `@property` whose getter function is marked with is_parameter = True | Tag functions annotated with `@parameter` for later retrieval. | [
"Tag",
"functions",
"annotated",
"with",
"@parameter",
"for",
"later",
"retrieval",
"."
] | def parameter(func):
"""Tag functions annotated with `@parameter` for later retrieval.
Note that all `@parameter`s are automatically `@property`s as well.
Args:
func: the getter function to tag and wrap
Returns:
A `@property` whose getter function is marked with is_parameter = True
"""
func.is_pa... | [
"def",
"parameter",
"(",
"func",
")",
":",
"func",
".",
"is_parameter",
"=",
"True",
"return",
"property",
"(",
"func",
")"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/learn/python/learn/dataframe/transform.py#L89-L101 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/artmanager.py | python | ArtManager.SetMenuBarColour | (self, scheme) | Sets the menu bar colour scheme to use.
:param string `scheme`: a string representing a colour scheme (i.e., 'Default',
'Dark', 'Dark Olive Green', 'Generic'). | Sets the menu bar colour scheme to use. | [
"Sets",
"the",
"menu",
"bar",
"colour",
"scheme",
"to",
"use",
"."
] | def SetMenuBarColour(self, scheme):
"""
Sets the menu bar colour scheme to use.
:param string `scheme`: a string representing a colour scheme (i.e., 'Default',
'Dark', 'Dark Olive Green', 'Generic').
"""
self._menuBarColourScheme = scheme
# set default colour
... | [
"def",
"SetMenuBarColour",
"(",
"self",
",",
"scheme",
")",
":",
"self",
".",
"_menuBarColourScheme",
"=",
"scheme",
"# set default colour",
"if",
"scheme",
"in",
"self",
".",
"_colourSchemeMap",
".",
"keys",
"(",
")",
":",
"self",
".",
"_menuBarBgColour",
"="... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/artmanager.py#L2020-L2031 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/compileall.py | python | compile_path | (skip_curdir=1, maxlevels=0, force=False, quiet=0,
legacy=False, optimize=-1,
invalidation_mode=None) | return success | Byte-compile all module on sys.path.
Arguments (all optional):
skip_curdir: if true, skip current directory (default True)
maxlevels: max recursion level (default 0)
force: as for compile_dir() (default False)
quiet: as for compile_dir() (default 0)
legacy: as for compile_dir() (default Fals... | Byte-compile all module on sys.path. | [
"Byte",
"-",
"compile",
"all",
"module",
"on",
"sys",
".",
"path",
"."
] | def compile_path(skip_curdir=1, maxlevels=0, force=False, quiet=0,
legacy=False, optimize=-1,
invalidation_mode=None):
"""Byte-compile all module on sys.path.
Arguments (all optional):
skip_curdir: if true, skip current directory (default True)
maxlevels: max recurs... | [
"def",
"compile_path",
"(",
"skip_curdir",
"=",
"1",
",",
"maxlevels",
"=",
"0",
",",
"force",
"=",
"False",
",",
"quiet",
"=",
"0",
",",
"legacy",
"=",
"False",
",",
"optimize",
"=",
"-",
"1",
",",
"invalidation_mode",
"=",
"None",
")",
":",
"succes... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/compileall.py#L192-L223 | |
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | eq | (a, b) | return a.eq(b) | Return `True` if `a` and `b` are structurally identical AST nodes.
>>> x = Int('x')
>>> y = Int('y')
>>> eq(x, y)
False
>>> eq(x + 1, x + 1)
True
>>> eq(x + 1, 1 + x)
False
>>> eq(simplify(x + 1), simplify(1 + x))
True | Return `True` if `a` and `b` are structurally identical AST nodes. | [
"Return",
"True",
"if",
"a",
"and",
"b",
"are",
"structurally",
"identical",
"AST",
"nodes",
"."
] | def eq(a, b):
"""Return `True` if `a` and `b` are structurally identical AST nodes.
>>> x = Int('x')
>>> y = Int('y')
>>> eq(x, y)
False
>>> eq(x + 1, x + 1)
True
>>> eq(x + 1, 1 + x)
False
>>> eq(simplify(x + 1), simplify(1 + x))
True
"""
if z3_debug():
_z3_... | [
"def",
"eq",
"(",
"a",
",",
"b",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"is_ast",
"(",
"a",
")",
"and",
"is_ast",
"(",
"b",
")",
",",
"\"Z3 ASTs expected\"",
")",
"return",
"a",
".",
"eq",
"(",
"b",
")"
] | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L471-L487 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/deep_memory_profiler/subcommands/upload.py | python | UploadCommand._run_gsutil | (gsutil, *args) | Run gsutil as a subprocess.
Args:
*args: Arguments to pass to gsutil. The first argument should be an
operation such as ls, cp or cat.
Returns:
The return code from the process. | Run gsutil as a subprocess. | [
"Run",
"gsutil",
"as",
"a",
"subprocess",
"."
] | def _run_gsutil(gsutil, *args):
"""Run gsutil as a subprocess.
Args:
*args: Arguments to pass to gsutil. The first argument should be an
operation such as ls, cp or cat.
Returns:
The return code from the process.
"""
command = [gsutil] + list(args)
LOGGER.info("Runni... | [
"def",
"_run_gsutil",
"(",
"gsutil",
",",
"*",
"args",
")",
":",
"command",
"=",
"[",
"gsutil",
"]",
"+",
"list",
"(",
"args",
")",
"LOGGER",
".",
"info",
"(",
"\"Running: %s\"",
",",
"command",
")",
"try",
":",
"return",
"subprocess",
".",
"call",
"... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/deep_memory_profiler/subcommands/upload.py#L64-L79 | ||
mhammond/pywin32 | 44afd86ba8485194df93234639243252deeb40d5 | com/win32comext/axdebug/gateways.py | python | RemoteDebugApplicationEvents.OnLeaveBreakPoint | (self, rdat) | rdat -- PyIRemoteDebugApplicationThread | rdat -- PyIRemoteDebugApplicationThread | [
"rdat",
"--",
"PyIRemoteDebugApplicationThread"
] | def OnLeaveBreakPoint(self, rdat):
"""rdat -- PyIRemoteDebugApplicationThread"""
RaiseNotImpl("OnLeaveBreakPoint") | [
"def",
"OnLeaveBreakPoint",
"(",
"self",
",",
"rdat",
")",
":",
"RaiseNotImpl",
"(",
"\"OnLeaveBreakPoint\"",
")"
] | https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/com/win32comext/axdebug/gateways.py#L499-L501 | ||
kevin-ssy/Optical-Flow-Guided-Feature | 07d4501a29002ee7821c38c1820e4a64c1acf6e8 | lib/caffe-action/python/caffe/pycaffe.py | python | _Net_set_input_arrays | (self, data, labels) | return self._set_input_arrays(data, labels) | Set input arrays of the in-memory MemoryDataLayer.
(Note: this is only for networks declared with the memory data layer.) | Set input arrays of the in-memory MemoryDataLayer.
(Note: this is only for networks declared with the memory data layer.) | [
"Set",
"input",
"arrays",
"of",
"the",
"in",
"-",
"memory",
"MemoryDataLayer",
".",
"(",
"Note",
":",
"this",
"is",
"only",
"for",
"networks",
"declared",
"with",
"the",
"memory",
"data",
"layer",
".",
")"
] | def _Net_set_input_arrays(self, data, labels):
"""
Set input arrays of the in-memory MemoryDataLayer.
(Note: this is only for networks declared with the memory data layer.)
"""
if labels.ndim == 1:
labels = np.ascontiguousarray(labels[:, np.newaxis, np.newaxis,
... | [
"def",
"_Net_set_input_arrays",
"(",
"self",
",",
"data",
",",
"labels",
")",
":",
"if",
"labels",
".",
"ndim",
"==",
"1",
":",
"labels",
"=",
"np",
".",
"ascontiguousarray",
"(",
"labels",
"[",
":",
",",
"np",
".",
"newaxis",
",",
"np",
".",
"newaxi... | https://github.com/kevin-ssy/Optical-Flow-Guided-Feature/blob/07d4501a29002ee7821c38c1820e4a64c1acf6e8/lib/caffe-action/python/caffe/pycaffe.py#L227-L235 | |
echronos/echronos | c996f1d2c8af6c6536205eb319c1bf1d4d84569c | external_tools/ply_info/example/yply/ylex.py | python | t_code_ignore_cppcom | (t) | r'//.* | r'//.* | [
"r",
"//",
".",
"*"
] | def t_code_ignore_cppcom(t):
r'//.*' | [
"def",
"t_code_ignore_cppcom",
"(",
"t",
")",
":"
] | https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/yply/ylex.py#L73-L74 | ||
fatih/subvim | 241b6d170597857105da219c9b7d36059e9f11fb | vim/base/YouCompleteMe/third_party/bottle/bottle.py | python | Bottle.wsgi | (self, environ, start_response) | The bottle WSGI-interface. | The bottle WSGI-interface. | [
"The",
"bottle",
"WSGI",
"-",
"interface",
"."
] | def wsgi(self, environ, start_response):
""" The bottle WSGI-interface. """
try:
out = self._cast(self._handle(environ))
# rfc2616 section 4.3
if response._status_code in (100, 101, 204, 304)\
or environ['REQUEST_METHOD'] == 'HEAD':
if hasa... | [
"def",
"wsgi",
"(",
"self",
",",
"environ",
",",
"start_response",
")",
":",
"try",
":",
"out",
"=",
"self",
".",
"_cast",
"(",
"self",
".",
"_handle",
"(",
"environ",
")",
")",
"# rfc2616 section 4.3",
"if",
"response",
".",
"_status_code",
"in",
"(",
... | https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/bottle/bottle.py#L950-L974 | ||
alibaba/MNN | c4d9566171d589c3ded23aa18ffb197016995a12 | pymnn/examples/MNNTrain/quantization_aware_training/imagenet_dataset.py | python | load_image | (filename, color=True) | return img | Load an image converting from grayscale or alpha as needed.
Parameters
----------
filename : string
color : boolean
flag for color format. True (default) loads as RGB while False
loads as intensity (if image is already grayscale).
Returns
-------
image : an image with type ... | Load an image converting from grayscale or alpha as needed. | [
"Load",
"an",
"image",
"converting",
"from",
"grayscale",
"or",
"alpha",
"as",
"needed",
"."
] | def load_image(filename, color=True):
"""
Load an image converting from grayscale or alpha as needed.
Parameters
----------
filename : string
color : boolean
flag for color format. True (default) loads as RGB while False
loads as intensity (if image is already grayscale).
R... | [
"def",
"load_image",
"(",
"filename",
",",
"color",
"=",
"True",
")",
":",
"img",
"=",
"Image",
".",
"open",
"(",
"filename",
")",
"img",
"=",
"np",
".",
"array",
"(",
"img",
")",
"if",
"img",
".",
"ndim",
"==",
"2",
":",
"img",
"=",
"img",
"["... | https://github.com/alibaba/MNN/blob/c4d9566171d589c3ded23aa18ffb197016995a12/pymnn/examples/MNNTrain/quantization_aware_training/imagenet_dataset.py#L8-L33 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | dom/bindings/parser/WebIDL.py | python | Parser.p_InterfaceMembers | (self, p) | InterfaceMembers : ExtendedAttributeList InterfaceMember InterfaceMembers | InterfaceMembers : ExtendedAttributeList InterfaceMember InterfaceMembers | [
"InterfaceMembers",
":",
"ExtendedAttributeList",
"InterfaceMember",
"InterfaceMembers"
] | def p_InterfaceMembers(self, p):
"""
InterfaceMembers : ExtendedAttributeList InterfaceMember InterfaceMembers
"""
p[0] = [p[2]] if p[2] else []
assert not p[1] or p[2]
p[2].addExtendedAttributes(p[1])
p[0].extend(p[3]) | [
"def",
"p_InterfaceMembers",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"[",
"p",
"[",
"2",
"]",
"]",
"if",
"p",
"[",
"2",
"]",
"else",
"[",
"]",
"assert",
"not",
"p",
"[",
"1",
"]",
"or",
"p",
"[",
"2",
"]",
"p",
"[",
"2... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/dom/bindings/parser/WebIDL.py#L4384-L4393 | ||
lukasmonk/lucaschess | 13e2e5cb13b38a720ccf897af649054a64bcb914 | Code/QT/Columnas.py | python | ListaColumnas.columnasMostrables | (self) | return oColumnasR | Crea un nuevo objeto con solo las columnas mostrables. | Crea un nuevo objeto con solo las columnas mostrables. | [
"Crea",
"un",
"nuevo",
"objeto",
"con",
"solo",
"las",
"columnas",
"mostrables",
"."
] | def columnasMostrables(self):
"""
Crea un nuevo objeto con solo las columnas mostrables.
"""
cols = [columna for columna in self.liColumnas if columna.siMostrar]
cols.sort(lambda x, y: cmp(x.posicion, y.posicion))
oColumnasR = ListaColumnas()
oColumnasR.liColumnas... | [
"def",
"columnasMostrables",
"(",
"self",
")",
":",
"cols",
"=",
"[",
"columna",
"for",
"columna",
"in",
"self",
".",
"liColumnas",
"if",
"columna",
".",
"siMostrar",
"]",
"cols",
".",
"sort",
"(",
"lambda",
"x",
",",
"y",
":",
"cmp",
"(",
"x",
".",
... | https://github.com/lukasmonk/lucaschess/blob/13e2e5cb13b38a720ccf897af649054a64bcb914/Code/QT/Columnas.py#L274-L282 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/timeseries/python/timeseries/input_pipeline.py | python | NumpyReader.read | (self) | return estimator_lib.inputs.numpy_input_fn(
x=features,
# The first dimensions of features are the series length, since we have
# removed the batch dimension above. We now pull out
# self._read_num_records_hint steps of this single time series to pass
# to the TimeSeriesInputFn.
... | Returns a large chunk of the Numpy arrays for later re-chunking. | Returns a large chunk of the Numpy arrays for later re-chunking. | [
"Returns",
"a",
"large",
"chunk",
"of",
"the",
"Numpy",
"arrays",
"for",
"later",
"re",
"-",
"chunking",
"."
] | def read(self):
"""Returns a large chunk of the Numpy arrays for later re-chunking."""
# Remove the batch dimension from all features
features = {key: numpy.squeeze(value, axis=0)
for key, value in self._features.items()}
return estimator_lib.inputs.numpy_input_fn(
x=features,
... | [
"def",
"read",
"(",
"self",
")",
":",
"# Remove the batch dimension from all features",
"features",
"=",
"{",
"key",
":",
"numpy",
".",
"squeeze",
"(",
"value",
",",
"axis",
"=",
"0",
")",
"for",
"key",
",",
"value",
"in",
"self",
".",
"_features",
".",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/timeseries/python/timeseries/input_pipeline.py#L254-L267 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/draftguitools/gui_trackers.py | python | boxTracker.height | (self, h=None) | Set the height. | Set the height. | [
"Set",
"the",
"height",
"."
] | def height(self, h=None):
"""Set the height."""
if h:
self.cube.depth.setValue(h)
self.update()
else:
return self.cube.depth.getValue() | [
"def",
"height",
"(",
"self",
",",
"h",
"=",
"None",
")",
":",
"if",
"h",
":",
"self",
".",
"cube",
".",
"depth",
".",
"setValue",
"(",
"h",
")",
"self",
".",
"update",
"(",
")",
"else",
":",
"return",
"self",
".",
"cube",
".",
"depth",
".",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_trackers.py#L1297-L1303 | ||
MegEngine/MegEngine | ce9ad07a27ec909fb8db4dd67943d24ba98fb93a | imperative/python/megengine/functional/vision.py | python | interpolate | (
inp: Tensor,
size: Optional[Union[int, Tuple[int, int]]] = None,
scale_factor: Optional[Union[float, Tuple[float, float]]] = None,
mode: str = "bilinear",
align_corners: Optional[bool] = None,
) | return ret | r"""Down/up samples the input tensor to either the given size or with the given scale_factor. ``size`` can not coexist with ``scale_factor``.
Args:
inp: input tensor.
size: size of the output tensor. Default: None
scale_factor: scaling factor of the output tensor. Default: None
mode... | r"""Down/up samples the input tensor to either the given size or with the given scale_factor. ``size`` can not coexist with ``scale_factor``. | [
"r",
"Down",
"/",
"up",
"samples",
"the",
"input",
"tensor",
"to",
"either",
"the",
"given",
"size",
"or",
"with",
"the",
"given",
"scale_factor",
".",
"size",
"can",
"not",
"coexist",
"with",
"scale_factor",
"."
] | def interpolate(
inp: Tensor,
size: Optional[Union[int, Tuple[int, int]]] = None,
scale_factor: Optional[Union[float, Tuple[float, float]]] = None,
mode: str = "bilinear",
align_corners: Optional[bool] = None,
) -> Tensor:
r"""Down/up samples the input tensor to either the given size or with the... | [
"def",
"interpolate",
"(",
"inp",
":",
"Tensor",
",",
"size",
":",
"Optional",
"[",
"Union",
"[",
"int",
",",
"Tuple",
"[",
"int",
",",
"int",
"]",
"]",
"]",
"=",
"None",
",",
"scale_factor",
":",
"Optional",
"[",
"Union",
"[",
"float",
",",
"Tuple... | https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/functional/vision.py#L522-L683 | |
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | lldb/third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py | python | spawn._spawn | (self, command, args=[], preexec_fn=None, dimensions=None) | This starts the given command in a child process. This does all the
fork/exec type of stuff for a pty. This is called by __init__. If args
is empty then command will be parsed (split on spaces) and args will be
set to parsed arguments. | This starts the given command in a child process. This does all the
fork/exec type of stuff for a pty. This is called by __init__. If args
is empty then command will be parsed (split on spaces) and args will be
set to parsed arguments. | [
"This",
"starts",
"the",
"given",
"command",
"in",
"a",
"child",
"process",
".",
"This",
"does",
"all",
"the",
"fork",
"/",
"exec",
"type",
"of",
"stuff",
"for",
"a",
"pty",
".",
"This",
"is",
"called",
"by",
"__init__",
".",
"If",
"args",
"is",
"emp... | def _spawn(self, command, args=[], preexec_fn=None, dimensions=None):
'''This starts the given command in a child process. This does all the
fork/exec type of stuff for a pty. This is called by __init__. If args
is empty then command will be parsed (split on spaces) and args will be
set ... | [
"def",
"_spawn",
"(",
"self",
",",
"command",
",",
"args",
"=",
"[",
"]",
",",
"preexec_fn",
"=",
"None",
",",
"dimensions",
"=",
"None",
")",
":",
"# The pid and child_fd of this object get set by this method.",
"# Note that it is difficult for this method to fail.",
"... | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/lldb/third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py#L239-L310 | ||
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/esptool/espsecure.py | python | extract_public_key | (args) | Load an ECDSA private key and extract the embedded public key as raw binary data. | Load an ECDSA private key and extract the embedded public key as raw binary data. | [
"Load",
"an",
"ECDSA",
"private",
"key",
"and",
"extract",
"the",
"embedded",
"public",
"key",
"as",
"raw",
"binary",
"data",
"."
] | def extract_public_key(args):
""" Load an ECDSA private key and extract the embedded public key as raw binary data. """
sk = _load_ecdsa_signing_key(args)
vk = sk.get_verifying_key()
args.public_keyfile.write(vk.to_string())
print("%s public key extracted to %s" % (args.keyfile.name, args.public_key... | [
"def",
"extract_public_key",
"(",
"args",
")",
":",
"sk",
"=",
"_load_ecdsa_signing_key",
"(",
"args",
")",
"vk",
"=",
"sk",
".",
"get_verifying_key",
"(",
")",
"args",
".",
"public_keyfile",
".",
"write",
"(",
"vk",
".",
"to_string",
"(",
")",
")",
"pri... | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/esptool/espsecure.py#L213-L218 | ||
Komnomnomnom/swigibpy | cfd307fdbfaffabc69a2dc037538d7e34a8b8daf | examples/customerror.py | python | CustomErrorExample.managedAccounts | (self, openOrderEnd) | Called by TWS but not relevant for our example | Called by TWS but not relevant for our example | [
"Called",
"by",
"TWS",
"but",
"not",
"relevant",
"for",
"our",
"example"
] | def managedAccounts(self, openOrderEnd):
'''Called by TWS but not relevant for our example'''
pass | [
"def",
"managedAccounts",
"(",
"self",
",",
"openOrderEnd",
")",
":",
"pass"
] | https://github.com/Komnomnomnom/swigibpy/blob/cfd307fdbfaffabc69a2dc037538d7e34a8b8daf/examples/customerror.py#L47-L49 | ||
sirikata/sirikata | 3a0d54a8c4778ad6e25ef031d461b2bc3e264860 | scripts/bench/bandwidth_by_load.py | python | BandwidthByLoad.__init__ | (self, cc, cs, local_messages=True, remote_messages=True) | cc - ClusterConfig
cs - ClusterSimSettings
local_messages - if True, generate messages to objects connected to the same space server
remote_messages - if True, generate messages to objects connected to other space servers | cc - ClusterConfig
cs - ClusterSimSettings
local_messages - if True, generate messages to objects connected to the same space server
remote_messages - if True, generate messages to objects connected to other space servers | [
"cc",
"-",
"ClusterConfig",
"cs",
"-",
"ClusterSimSettings",
"local_messages",
"-",
"if",
"True",
"generate",
"messages",
"to",
"objects",
"connected",
"to",
"the",
"same",
"space",
"server",
"remote_messages",
"-",
"if",
"True",
"generate",
"messages",
"to",
"o... | def __init__(self, cc, cs, local_messages=True, remote_messages=True):
"""
cc - ClusterConfig
cs - ClusterSimSettings
local_messages - if True, generate messages to objects connected to the same space server
remote_messages - if True, generate messages to objects connected to oth... | [
"def",
"__init__",
"(",
"self",
",",
"cc",
",",
"cs",
",",
"local_messages",
"=",
"True",
",",
"remote_messages",
"=",
"True",
")",
":",
"self",
".",
"cc",
"=",
"cc",
"self",
".",
"cs",
"=",
"cs",
"self",
".",
"local_messages",
"=",
"local_messages",
... | https://github.com/sirikata/sirikata/blob/3a0d54a8c4778ad6e25ef031d461b2bc3e264860/scripts/bench/bandwidth_by_load.py#L45-L57 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/PyChop/PyChopGui.py | python | PyChopGui.calculate | (self) | Performs the resolution and flux calculations. | Performs the resolution and flux calculations. | [
"Performs",
"the",
"resolution",
"and",
"flux",
"calculations",
"."
] | def calculate(self):
"""
Performs the resolution and flux calculations.
"""
self.errormess = None
if self.engine.getEi() is None:
self.setEi()
if self.widgets['MultiRepCheck'].isChecked():
en = np.linspace(0, 0.95, 200)
self.eis = self.... | [
"def",
"calculate",
"(",
"self",
")",
":",
"self",
".",
"errormess",
"=",
"None",
"if",
"self",
".",
"engine",
".",
"getEi",
"(",
")",
"is",
"None",
":",
"self",
".",
"setEi",
"(",
")",
"if",
"self",
".",
"widgets",
"[",
"'MultiRepCheck'",
"]",
"."... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/PyChop/PyChopGui.py#L289-L313 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/signal/filter_design.py | python | zpk2tf | (z, p, k) | return b, a | Return polynomial transfer function representation from zeros and poles
Parameters
----------
z : array_like
Zeros of the transfer function.
p : array_like
Poles of the transfer function.
k : float
System gain.
Returns
-------
b : ndarray
Numerator polyn... | Return polynomial transfer function representation from zeros and poles | [
"Return",
"polynomial",
"transfer",
"function",
"representation",
"from",
"zeros",
"and",
"poles"
] | def zpk2tf(z, p, k):
"""
Return polynomial transfer function representation from zeros and poles
Parameters
----------
z : array_like
Zeros of the transfer function.
p : array_like
Poles of the transfer function.
k : float
System gain.
Returns
-------
b ... | [
"def",
"zpk2tf",
"(",
"z",
",",
"p",
",",
"k",
")",
":",
"z",
"=",
"atleast_1d",
"(",
"z",
")",
"k",
"=",
"atleast_1d",
"(",
"k",
")",
"if",
"len",
"(",
"z",
".",
"shape",
")",
">",
"1",
":",
"temp",
"=",
"poly",
"(",
"z",
"[",
"0",
"]",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/signal/filter_design.py#L724-L780 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/commands.py | python | getstatusoutput | (cmd) | return sts, text | Return (status, output) of executing cmd in a shell. | Return (status, output) of executing cmd in a shell. | [
"Return",
"(",
"status",
"output",
")",
"of",
"executing",
"cmd",
"in",
"a",
"shell",
"."
] | def getstatusoutput(cmd):
"""Return (status, output) of executing cmd in a shell."""
import os
pipe = os.popen('{ ' + cmd + '; } 2>&1', 'r')
text = pipe.read()
sts = pipe.close()
if sts is None: sts = 0
if text[-1:] == '\n': text = text[:-1]
return sts, text | [
"def",
"getstatusoutput",
"(",
"cmd",
")",
":",
"import",
"os",
"pipe",
"=",
"os",
".",
"popen",
"(",
"'{ '",
"+",
"cmd",
"+",
"'; } 2>&1'",
",",
"'r'",
")",
"text",
"=",
"pipe",
".",
"read",
"(",
")",
"sts",
"=",
"pipe",
".",
"close",
"(",
")",
... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/commands.py#L52-L60 | |
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | bindings/pyroot/pythonizations/python/ROOT/_pythonization/_roofit/_rooglobalfunc.py | python | Frame | (*args, **kwargs) | return RooFit._Frame(*args, **kwargs) | r"""The Frame() function is pythonized with the command argument pythonization.
The keywords must correspond to the CmdArg of the function. | r"""The Frame() function is pythonized with the command argument pythonization.
The keywords must correspond to the CmdArg of the function. | [
"r",
"The",
"Frame",
"()",
"function",
"is",
"pythonized",
"with",
"the",
"command",
"argument",
"pythonization",
".",
"The",
"keywords",
"must",
"correspond",
"to",
"the",
"CmdArg",
"of",
"the",
"function",
"."
] | def Frame(*args, **kwargs):
r"""The Frame() function is pythonized with the command argument pythonization.
The keywords must correspond to the CmdArg of the function.
"""
# Redefinition of `Frame` for keyword arguments.
from cppyy.gbl import RooFit
args, kwargs = _kwargs_to_roocmdargs(*args, *... | [
"def",
"Frame",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Redefinition of `Frame` for keyword arguments.",
"from",
"cppyy",
".",
"gbl",
"import",
"RooFit",
"args",
",",
"kwargs",
"=",
"_kwargs_to_roocmdargs",
"(",
"*",
"args",
",",
"*",
"*",
"k... | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/bindings/pyroot/pythonizations/python/ROOT/_pythonization/_roofit/_rooglobalfunc.py#L98-L106 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/xml/sax/handler.py | python | DTDHandler.unparsedEntityDecl | (self, name, publicId, systemId, ndata) | Handle an unparsed entity declaration event. | Handle an unparsed entity declaration event. | [
"Handle",
"an",
"unparsed",
"entity",
"declaration",
"event",
"."
] | def unparsedEntityDecl(self, name, publicId, systemId, ndata):
"Handle an unparsed entity declaration event." | [
"def",
"unparsedEntityDecl",
"(",
"self",
",",
"name",
",",
"publicId",
",",
"systemId",
",",
"ndata",
")",
":"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/xml/sax/handler.py#L217-L218 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Scanner/Fortran.py | python | FortranScan | (path_variable="FORTRANPATH") | return scanner | Return a prototype Scanner instance for scanning source files
for Fortran USE & INCLUDE statements | Return a prototype Scanner instance for scanning source files
for Fortran USE & INCLUDE statements | [
"Return",
"a",
"prototype",
"Scanner",
"instance",
"for",
"scanning",
"source",
"files",
"for",
"Fortran",
"USE",
"&",
"INCLUDE",
"statements"
] | def FortranScan(path_variable="FORTRANPATH"):
"""Return a prototype Scanner instance for scanning source files
for Fortran USE & INCLUDE statements"""
# The USE statement regex matches the following:
#
# USE module_name
# USE :: module_name
# USE, INTRINSIC :: module_name
# USE, NON_INTRINSIC :: modu... | [
"def",
"FortranScan",
"(",
"path_variable",
"=",
"\"FORTRANPATH\"",
")",
":",
"# The USE statement regex matches the following:",
"#",
"# USE module_name",
"# USE :: module_name",
"# USE, INTRINSIC :: module_name",
"# USE, NON_INTRINSIC :: module_name",
"#",
"# Limitations"... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Scanner/Fortran.py#L126-L318 | |
llvm-mirror/lldb | d01083a850f577b85501a0902b52fd0930de72c7 | examples/python/crashlog.py | python | Interactive.do_image | (self, line) | return False | Dump information about one or more binary images in the crash log given an image basename, or all images if no arguments are provided. | Dump information about one or more binary images in the crash log given an image basename, or all images if no arguments are provided. | [
"Dump",
"information",
"about",
"one",
"or",
"more",
"binary",
"images",
"in",
"the",
"crash",
"log",
"given",
"an",
"image",
"basename",
"or",
"all",
"images",
"if",
"no",
"arguments",
"are",
"provided",
"."
] | def do_image(self, line):
'''Dump information about one or more binary images in the crash log given an image basename, or all images if no arguments are provided.'''
usage = "usage: %prog [options] <PATH> [PATH ...]"
description = '''Dump information about one or more images in all crash logs. ... | [
"def",
"do_image",
"(",
"self",
",",
"line",
")",
":",
"usage",
"=",
"\"usage: %prog [options] <PATH> [PATH ...]\"",
"description",
"=",
"'''Dump information about one or more images in all crash logs. The <PATH> can be a full path, image basename, or partial path. Searches are done in thi... | https://github.com/llvm-mirror/lldb/blob/d01083a850f577b85501a0902b52fd0930de72c7/examples/python/crashlog.py#L648-L692 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge3.py | python | ExodusModel._get_element_edge_indices | (self, element_type) | return unique_edges | Return a list of element edges for the given element type.
The returned list is a list of 2-tuples of local element node indices. | Return a list of element edges for the given element type. | [
"Return",
"a",
"list",
"of",
"element",
"edges",
"for",
"the",
"given",
"element",
"type",
"."
] | def _get_element_edge_indices(self, element_type):
"""
Return a list of element edges for the given element type.
The returned list is a list of 2-tuples of local element node indices.
"""
element_type = self._get_standard_element_type(element_type)
# if not a standard ... | [
"def",
"_get_element_edge_indices",
"(",
"self",
",",
"element_type",
")",
":",
"element_type",
"=",
"self",
".",
"_get_standard_element_type",
"(",
"element_type",
")",
"# if not a standard type, then we don't know the edge indices",
"if",
"not",
"self",
".",
"_is_standard... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge3.py#L8108-L8150 | |
BestSonny/SSTD | 174d452189f6bf9cf4b6957719392008bd974069 | python/caffe/coord_map.py | python | coord_map_from_to | (top_from, top_to) | Determine the coordinate mapping betweeen a top (from) and a top (to).
Walk the graph to find a common ancestor while composing the coord maps for
from and to until they meet. As a last step the from map is inverted. | Determine the coordinate mapping betweeen a top (from) and a top (to).
Walk the graph to find a common ancestor while composing the coord maps for
from and to until they meet. As a last step the from map is inverted. | [
"Determine",
"the",
"coordinate",
"mapping",
"betweeen",
"a",
"top",
"(",
"from",
")",
"and",
"a",
"top",
"(",
"to",
")",
".",
"Walk",
"the",
"graph",
"to",
"find",
"a",
"common",
"ancestor",
"while",
"composing",
"the",
"coord",
"maps",
"for",
"from",
... | def coord_map_from_to(top_from, top_to):
"""
Determine the coordinate mapping betweeen a top (from) and a top (to).
Walk the graph to find a common ancestor while composing the coord maps for
from and to until they meet. As a last step the from map is inverted.
"""
# We need to find a common anc... | [
"def",
"coord_map_from_to",
"(",
"top_from",
",",
"top_to",
")",
":",
"# We need to find a common ancestor of top_from and top_to.",
"# We'll assume that all ancestors are equivalent here (otherwise the graph",
"# is an inconsistent state (which we could improve this to check for)).",
"# For n... | https://github.com/BestSonny/SSTD/blob/174d452189f6bf9cf4b6957719392008bd974069/python/caffe/coord_map.py#L115-L169 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBDebugger.GetScriptLanguage | (self) | return _lldb.SBDebugger_GetScriptLanguage(self) | GetScriptLanguage(SBDebugger self) -> lldb::ScriptLanguage | GetScriptLanguage(SBDebugger self) -> lldb::ScriptLanguage | [
"GetScriptLanguage",
"(",
"SBDebugger",
"self",
")",
"-",
">",
"lldb",
"::",
"ScriptLanguage"
] | def GetScriptLanguage(self):
"""GetScriptLanguage(SBDebugger self) -> lldb::ScriptLanguage"""
return _lldb.SBDebugger_GetScriptLanguage(self) | [
"def",
"GetScriptLanguage",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBDebugger_GetScriptLanguage",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L4214-L4216 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/logging/__init__.py | python | Handler.format | (self, record) | return fmt.format(record) | Format the specified record.
If a formatter is set, use it. Otherwise, use the default formatter
for the module. | Format the specified record. | [
"Format",
"the",
"specified",
"record",
"."
] | def format(self, record):
"""
Format the specified record.
If a formatter is set, use it. Otherwise, use the default formatter
for the module.
"""
if self.formatter:
fmt = self.formatter
else:
fmt = _defaultFormatter
return fmt.for... | [
"def",
"format",
"(",
"self",
",",
"record",
")",
":",
"if",
"self",
".",
"formatter",
":",
"fmt",
"=",
"self",
".",
"formatter",
"else",
":",
"fmt",
"=",
"_defaultFormatter",
"return",
"fmt",
".",
"format",
"(",
"record",
")"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/logging/__init__.py#L637-L648 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/saved_model/registration/registration.py | python | get_save_function | (registered_name) | return _saver_registry.name_lookup(registered_name)[0] | Returns save function registered to name. | Returns save function registered to name. | [
"Returns",
"save",
"function",
"registered",
"to",
"name",
"."
] | def get_save_function(registered_name):
"""Returns save function registered to name."""
return _saver_registry.name_lookup(registered_name)[0] | [
"def",
"get_save_function",
"(",
"registered_name",
")",
":",
"return",
"_saver_registry",
".",
"name_lookup",
"(",
"registered_name",
")",
"[",
"0",
"]"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/saved_model/registration/registration.py#L328-L330 | |
livecode/livecode | 4606a10ea10b16d5071d0f9f263ccdd7ede8b31d | gyp/tools/pretty_vcproj.py | python | FlattenFilter | (node) | return node_list | Returns a list of all the node and sub nodes. | Returns a list of all the node and sub nodes. | [
"Returns",
"a",
"list",
"of",
"all",
"the",
"node",
"and",
"sub",
"nodes",
"."
] | def FlattenFilter(node):
"""Returns a list of all the node and sub nodes."""
node_list = []
if (node.attributes and
node.getAttribute('Name') == '_excluded_files'):
# We don't add the "_excluded_files" filter.
return []
for current in node.childNodes:
if current.nodeName == 'Filter':
... | [
"def",
"FlattenFilter",
"(",
"node",
")",
":",
"node_list",
"=",
"[",
"]",
"if",
"(",
"node",
".",
"attributes",
"and",
"node",
".",
"getAttribute",
"(",
"'Name'",
")",
"==",
"'_excluded_files'",
")",
":",
"# We don't add the \"_excluded_files\" filter.",
"retur... | https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/tools/pretty_vcproj.py#L95-L110 | |
xiaolonw/caffe-video_triplet | c39ea1ad6e937ccf7deba4510b7e555165abf05f | python/draw_net.py | python | parse_args | () | return args | Parse input arguments | Parse input arguments | [
"Parse",
"input",
"arguments"
] | def parse_args():
"""Parse input arguments
"""
parser = ArgumentParser(description=__doc__,
formatter_class=ArgumentDefaultsHelpFormatter)
parser.add_argument('input_net_proto_file',
help='Input network prototxt file')
parser.add_argument('output... | [
"def",
"parse_args",
"(",
")",
":",
"parser",
"=",
"ArgumentParser",
"(",
"description",
"=",
"__doc__",
",",
"formatter_class",
"=",
"ArgumentDefaultsHelpFormatter",
")",
"parser",
".",
"add_argument",
"(",
"'input_net_proto_file'",
",",
"help",
"=",
"'Input networ... | https://github.com/xiaolonw/caffe-video_triplet/blob/c39ea1ad6e937ccf7deba4510b7e555165abf05f/python/draw_net.py#L13-L33 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/series.py | python | Series.combine | (self, other, func, fill_value=None) | return self._constructor(new_values, index=new_index, name=new_name) | Combine the Series with a Series or scalar according to `func`.
Combine the Series and `other` using `func` to perform elementwise
selection for combined Series.
`fill_value` is assumed when value is missing at some index
from one of the two objects being combined.
Parameters
... | Combine the Series with a Series or scalar according to `func`. | [
"Combine",
"the",
"Series",
"with",
"a",
"Series",
"or",
"scalar",
"according",
"to",
"func",
"."
] | def combine(self, other, func, fill_value=None):
"""
Combine the Series with a Series or scalar according to `func`.
Combine the Series and `other` using `func` to perform elementwise
selection for combined Series.
`fill_value` is assumed when value is missing at some index
... | [
"def",
"combine",
"(",
"self",
",",
"other",
",",
"func",
",",
"fill_value",
"=",
"None",
")",
":",
"if",
"fill_value",
"is",
"None",
":",
"fill_value",
"=",
"na_value_for_dtype",
"(",
"self",
".",
"dtype",
",",
"compat",
"=",
"False",
")",
"if",
"isin... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/series.py#L2624-L2719 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/grid_search.py | python | BaseSearchCV.inverse_transform | (self, Xt) | return self.best_estimator_.transform(Xt) | Call inverse_transform on the estimator with the best found parameters.
Only available if the underlying estimator implements ``inverse_transform`` and
``refit=True``.
Parameters
-----------
Xt : indexable, length n_samples
Must fulfill the input assumptions of the
... | Call inverse_transform on the estimator with the best found parameters. | [
"Call",
"inverse_transform",
"on",
"the",
"estimator",
"with",
"the",
"best",
"found",
"parameters",
"."
] | def inverse_transform(self, Xt):
"""Call inverse_transform on the estimator with the best found parameters.
Only available if the underlying estimator implements ``inverse_transform`` and
``refit=True``.
Parameters
-----------
Xt : indexable, length n_samples
... | [
"def",
"inverse_transform",
"(",
"self",
",",
"Xt",
")",
":",
"return",
"self",
".",
"best_estimator_",
".",
"transform",
"(",
"Xt",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/grid_search.py#L522-L535 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | MenuItem.SetKind | (*args, **kwargs) | return _core_.MenuItem_SetKind(*args, **kwargs) | SetKind(self, int kind) | SetKind(self, int kind) | [
"SetKind",
"(",
"self",
"int",
"kind",
")"
] | def SetKind(*args, **kwargs):
"""SetKind(self, int kind)"""
return _core_.MenuItem_SetKind(*args, **kwargs) | [
"def",
"SetKind",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MenuItem_SetKind",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L12489-L12491 | |
NeoGeographyToolkit/StereoPipeline | eedf54a919fb5cce1ab0e280bb0df4050763aa11 | src/asp/Python/asp_string_utils.py | python | isString | (a) | return isinstance(a, basestring) | Returns true if the object is a string | Returns true if the object is a string | [
"Returns",
"true",
"if",
"the",
"object",
"is",
"a",
"string"
] | def isString(a):
"""Returns true if the object is a string"""
# Python 2/3 compatibilty
try:
basestring
except NameError:
basestring = str
return isinstance(a, basestring) | [
"def",
"isString",
"(",
"a",
")",
":",
"# Python 2/3 compatibilty",
"try",
":",
"basestring",
"except",
"NameError",
":",
"basestring",
"=",
"str",
"return",
"isinstance",
"(",
"a",
",",
"basestring",
")"
] | https://github.com/NeoGeographyToolkit/StereoPipeline/blob/eedf54a919fb5cce1ab0e280bb0df4050763aa11/src/asp/Python/asp_string_utils.py#L103-L112 | |
carla-simulator/carla | 8854804f4d7748e14d937ec763a2912823a7e5f5 | PythonAPI/carla/agents/navigation/local_planner.py | python | LocalPlanner._init_controller | (self) | Controller initialization | Controller initialization | [
"Controller",
"initialization"
] | def _init_controller(self):
"""Controller initialization"""
self._vehicle_controller = VehiclePIDController(self._vehicle,
args_lateral=self._args_lateral_dict,
args_longitudinal=self._args_lo... | [
"def",
"_init_controller",
"(",
"self",
")",
":",
"self",
".",
"_vehicle_controller",
"=",
"VehiclePIDController",
"(",
"self",
".",
"_vehicle",
",",
"args_lateral",
"=",
"self",
".",
"_args_lateral_dict",
",",
"args_longitudinal",
"=",
"self",
".",
"_args_longitu... | https://github.com/carla-simulator/carla/blob/8854804f4d7748e14d937ec763a2912823a7e5f5/PythonAPI/carla/agents/navigation/local_planner.py#L114-L127 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/integer.py | python | _IntegerDtype.construct_array_type | (cls) | return IntegerArray | Return the array type associated with this dtype.
Returns
-------
type | Return the array type associated with this dtype. | [
"Return",
"the",
"array",
"type",
"associated",
"with",
"this",
"dtype",
"."
] | def construct_array_type(cls):
"""
Return the array type associated with this dtype.
Returns
-------
type
"""
return IntegerArray | [
"def",
"construct_array_type",
"(",
"cls",
")",
":",
"return",
"IntegerArray"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/integer.py#L82-L90 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Canvas.find_withtag | (self, tagOrId) | return self.find('withtag', tagOrId) | Return all items with TAGORID. | Return all items with TAGORID. | [
"Return",
"all",
"items",
"with",
"TAGORID",
"."
] | def find_withtag(self, tagOrId):
"""Return all items with TAGORID."""
return self.find('withtag', tagOrId) | [
"def",
"find_withtag",
"(",
"self",
",",
"tagOrId",
")",
":",
"return",
"self",
".",
"find",
"(",
"'withtag'",
",",
"tagOrId",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2317-L2319 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/propgrid.py | python | PGEditorDialogAdapter.ShowDialog | (*args, **kwargs) | return _propgrid.PGEditorDialogAdapter_ShowDialog(*args, **kwargs) | ShowDialog(self, PropertyGrid propGrid, PGProperty property) -> bool | ShowDialog(self, PropertyGrid propGrid, PGProperty property) -> bool | [
"ShowDialog",
"(",
"self",
"PropertyGrid",
"propGrid",
"PGProperty",
"property",
")",
"-",
">",
"bool"
] | def ShowDialog(*args, **kwargs):
"""ShowDialog(self, PropertyGrid propGrid, PGProperty property) -> bool"""
return _propgrid.PGEditorDialogAdapter_ShowDialog(*args, **kwargs) | [
"def",
"ShowDialog",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGEditorDialogAdapter_ShowDialog",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L2792-L2794 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.