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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | tools/mo/openvino/tools/mo/middle/passes/infer.py | python | override_batch | (graph: Graph, batch: int) | Overrides batch for nodes with 'op' param set to 'Parameter'
Parameters
----------
graph: graph to operate on
batch: user defined integer value to override batch | Overrides batch for nodes with 'op' param set to 'Parameter'
Parameters
----------
graph: graph to operate on
batch: user defined integer value to override batch | [
"Overrides",
"batch",
"for",
"nodes",
"with",
"op",
"param",
"set",
"to",
"Parameter",
"Parameters",
"----------",
"graph",
":",
"graph",
"to",
"operate",
"on",
"batch",
":",
"user",
"defined",
"integer",
"value",
"to",
"override",
"batch"
] | def override_batch(graph: Graph, batch: int):
"""
Overrides batch for nodes with 'op' param set to 'Parameter'
Parameters
----------
graph: graph to operate on
batch: user defined integer value to override batch
"""
if batch is not None:
in_nodes = graph.get_op_nodes(op='Paramete... | [
"def",
"override_batch",
"(",
"graph",
":",
"Graph",
",",
"batch",
":",
"int",
")",
":",
"if",
"batch",
"is",
"not",
"None",
":",
"in_nodes",
"=",
"graph",
".",
"get_op_nodes",
"(",
"op",
"=",
"'Parameter'",
")",
"for",
"node",
"in",
"in_nodes",
":",
... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/middle/passes/infer.py#L216-L238 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/arrayobj.py | python | _do_concatenate | (context, builder, axis,
arrtys, arrs, arr_shapes, arr_strides,
retty, ret_shapes) | return ret | Concatenate arrays along the given axis. | Concatenate arrays along the given axis. | [
"Concatenate",
"arrays",
"along",
"the",
"given",
"axis",
"."
] | def _do_concatenate(context, builder, axis,
arrtys, arrs, arr_shapes, arr_strides,
retty, ret_shapes):
"""
Concatenate arrays along the given axis.
"""
assert len(arrtys) == len(arrs) == len(arr_shapes) == len(arr_strides)
zero = cgutils.intp_t(0)
# Allo... | [
"def",
"_do_concatenate",
"(",
"context",
",",
"builder",
",",
"axis",
",",
"arrtys",
",",
"arrs",
",",
"arr_shapes",
",",
"arr_strides",
",",
"retty",
",",
"ret_shapes",
")",
":",
"assert",
"len",
"(",
"arrtys",
")",
"==",
"len",
"(",
"arrs",
")",
"==... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/arrayobj.py#L4519-L4577 | |
apiaryio/snowcrash | b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3 | tools/gyp/pylib/gyp/generator/analyzer.py | python | CalculateVariables | (default_variables, params) | Calculate additional variables for use in the build (called by gyp). | Calculate additional variables for use in the build (called by gyp). | [
"Calculate",
"additional",
"variables",
"for",
"use",
"in",
"the",
"build",
"(",
"called",
"by",
"gyp",
")",
"."
] | def CalculateVariables(default_variables, params):
"""Calculate additional variables for use in the build (called by gyp)."""
flavor = gyp.common.GetFlavor(params)
if flavor == 'mac':
default_variables.setdefault('OS', 'mac')
elif flavor == 'win':
default_variables.setdefault('OS', 'win')
# Copy add... | [
"def",
"CalculateVariables",
"(",
"default_variables",
",",
"params",
")",
":",
"flavor",
"=",
"gyp",
".",
"common",
".",
"GetFlavor",
"(",
"params",
")",
"if",
"flavor",
"==",
"'mac'",
":",
"default_variables",
".",
"setdefault",
"(",
"'OS'",
",",
"'mac'",
... | https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/generator/analyzer.py#L575-L595 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_windows.py | python | PageSetupDialog.ShowModal | (*args, **kwargs) | return _windows_.PageSetupDialog_ShowModal(*args, **kwargs) | ShowModal(self) -> int | ShowModal(self) -> int | [
"ShowModal",
"(",
"self",
")",
"-",
">",
"int"
] | def ShowModal(*args, **kwargs):
"""ShowModal(self) -> int"""
return _windows_.PageSetupDialog_ShowModal(*args, **kwargs) | [
"def",
"ShowModal",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PageSetupDialog_ShowModal",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L5020-L5022 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py | python | _GenerateMSVSProject | (project, options, version, generator_flags) | return missing_sources | Generates a .vcproj file. It may create .rules and .user files too.
Arguments:
project: The project object we will generate the file for.
options: Global options passed to the generator.
version: The VisualStudioVersion object.
generator_flags: dict of generator-specific flags. | Generates a .vcproj file. It may create .rules and .user files too. | [
"Generates",
"a",
".",
"vcproj",
"file",
".",
"It",
"may",
"create",
".",
"rules",
"and",
".",
"user",
"files",
"too",
"."
] | def _GenerateMSVSProject(project, options, version, generator_flags):
"""Generates a .vcproj file. It may create .rules and .user files too.
Arguments:
project: The project object we will generate the file for.
options: Global options passed to the generator.
version: The VisualStudioVersion object.
... | [
"def",
"_GenerateMSVSProject",
"(",
"project",
",",
"options",
",",
"version",
",",
"generator_flags",
")",
":",
"spec",
"=",
"project",
".",
"spec",
"gyp",
".",
"common",
".",
"EnsureDirExists",
"(",
"project",
".",
"path",
")",
"platforms",
"=",
"_GetUniqu... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py#L991-L1058 | |
keyboardio/Kaleidoscope | d59604e98b2439d108647f15be52984a6837d360 | bin/cpplint.py | python | _SetCountingStyle | (level) | Sets the module's counting options. | Sets the module's counting options. | [
"Sets",
"the",
"module",
"s",
"counting",
"options",
"."
] | def _SetCountingStyle(level):
"""Sets the module's counting options."""
_cpplint_state.SetCountingStyle(level) | [
"def",
"_SetCountingStyle",
"(",
"level",
")",
":",
"_cpplint_state",
".",
"SetCountingStyle",
"(",
"level",
")"
] | https://github.com/keyboardio/Kaleidoscope/blob/d59604e98b2439d108647f15be52984a6837d360/bin/cpplint.py#L1190-L1192 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/masked/numctrl.py | python | NumCtrl.GetLimitOnFieldChange | (self) | return self.IsLimitedOnFieldChange() | (For regularization of property accessors) | (For regularization of property accessors) | [
"(",
"For",
"regularization",
"of",
"property",
"accessors",
")"
] | def GetLimitOnFieldChange(self):
""" (For regularization of property accessors) """
return self.IsLimitedOnFieldChange() | [
"def",
"GetLimitOnFieldChange",
"(",
"self",
")",
":",
"return",
"self",
".",
"IsLimitedOnFieldChange",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/masked/numctrl.py#L1455-L1457 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/train/model.py | python | Model.predict | (self, *predict_data) | return result | Generate output predictions for the input samples.
Args:
predict_data (Optional[Tensor, list[Tensor], tuple[Tensor]]): The predict data, can be a single tensor,
a list of tensor, or a tuple of tensor.
Returns:
Tensor, array(s) of predictions.
Examples:
... | Generate output predictions for the input samples. | [
"Generate",
"output",
"predictions",
"for",
"the",
"input",
"samples",
"."
] | def predict(self, *predict_data):
"""
Generate output predictions for the input samples.
Args:
predict_data (Optional[Tensor, list[Tensor], tuple[Tensor]]): The predict data, can be a single tensor,
a list of tensor, or a tuple of tensor.
Returns:
... | [
"def",
"predict",
"(",
"self",
",",
"*",
"predict_data",
")",
":",
"self",
".",
"_predict_network",
".",
"set_train",
"(",
"False",
")",
"check_input_data",
"(",
"*",
"predict_data",
",",
"data_class",
"=",
"(",
"int",
",",
"float",
",",
"str",
",",
"Non... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/train/model.py#L987-L1012 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/ndarray/ndarray.py | python | NDArray.degrees | (self, *args, **kwargs) | return op.degrees(self, *args, **kwargs) | Convenience fluent method for :py:func:`degrees`.
The arguments are the same as for :py:func:`degrees`, with
this array as data. | Convenience fluent method for :py:func:`degrees`. | [
"Convenience",
"fluent",
"method",
"for",
":",
"py",
":",
"func",
":",
"degrees",
"."
] | def degrees(self, *args, **kwargs):
"""Convenience fluent method for :py:func:`degrees`.
The arguments are the same as for :py:func:`degrees`, with
this array as data.
"""
return op.degrees(self, *args, **kwargs) | [
"def",
"degrees",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"op",
".",
"degrees",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/ndarray/ndarray.py#L1356-L1362 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/stc.py | python | StyledTextCtrl.SetVScrollBar | (*args, **kwargs) | return _stc.StyledTextCtrl_SetVScrollBar(*args, **kwargs) | SetVScrollBar(self, ScrollBar bar)
Set the vertical scrollbar to use instead of the one that's built-in. | SetVScrollBar(self, ScrollBar bar) | [
"SetVScrollBar",
"(",
"self",
"ScrollBar",
"bar",
")"
] | def SetVScrollBar(*args, **kwargs):
"""
SetVScrollBar(self, ScrollBar bar)
Set the vertical scrollbar to use instead of the one that's built-in.
"""
return _stc.StyledTextCtrl_SetVScrollBar(*args, **kwargs) | [
"def",
"SetVScrollBar",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_SetVScrollBar",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L6629-L6635 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/requests/_internal_utils.py | python | unicode_is_ascii | (u_string) | Determine if unicode string only contains ASCII characters.
:param str u_string: unicode string to check. Must be unicode
and not Python 2 `str`.
:rtype: bool | Determine if unicode string only contains ASCII characters. | [
"Determine",
"if",
"unicode",
"string",
"only",
"contains",
"ASCII",
"characters",
"."
] | def unicode_is_ascii(u_string):
"""Determine if unicode string only contains ASCII characters.
:param str u_string: unicode string to check. Must be unicode
and not Python 2 `str`.
:rtype: bool
"""
assert isinstance(u_string, str)
try:
u_string.encode('ascii')
return Tru... | [
"def",
"unicode_is_ascii",
"(",
"u_string",
")",
":",
"assert",
"isinstance",
"(",
"u_string",
",",
"str",
")",
"try",
":",
"u_string",
".",
"encode",
"(",
"'ascii'",
")",
"return",
"True",
"except",
"UnicodeEncodeError",
":",
"return",
"False"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/requests/_internal_utils.py#L30-L42 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/types/containers.py | python | UniTuple.unify | (self, typingctx, other) | Unify UniTuples with their dtype | Unify UniTuples with their dtype | [
"Unify",
"UniTuples",
"with",
"their",
"dtype"
] | def unify(self, typingctx, other):
"""
Unify UniTuples with their dtype
"""
if isinstance(other, UniTuple) and len(self) == len(other):
dtype = typingctx.unify_pairs(self.dtype, other.dtype)
if dtype is not None:
return UniTuple(dtype=dtype, count=... | [
"def",
"unify",
"(",
"self",
",",
"typingctx",
",",
"other",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"UniTuple",
")",
"and",
"len",
"(",
"self",
")",
"==",
"len",
"(",
"other",
")",
":",
"dtype",
"=",
"typingctx",
".",
"unify_pairs",
"(",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/types/containers.py#L218-L225 | ||
freeorion/freeorion | c266a40eccd3a99a17de8fe57c36ef6ba3771665 | default/python/AI/savegame_codec/_decoder.py | python | _replace_quote_placeholders | (s) | return s | Replace PLACEHOLDER with quotes if not nested within another encoded container.
To be able to use tuples as dictionary keys, to use standard json decoder,
the entire tuple with its content must be encoded as a single string.
The inner objects may no longer be quoted as that would prematurely terminate
... | Replace PLACEHOLDER with quotes if not nested within another encoded container. | [
"Replace",
"PLACEHOLDER",
"with",
"quotes",
"if",
"not",
"nested",
"within",
"another",
"encoded",
"container",
"."
] | def _replace_quote_placeholders(s):
"""Replace PLACEHOLDER with quotes if not nested within another encoded container.
To be able to use tuples as dictionary keys, to use standard json decoder,
the entire tuple with its content must be encoded as a single string.
The inner objects may no longer be quot... | [
"def",
"_replace_quote_placeholders",
"(",
"s",
")",
":",
"n",
"=",
"0",
"# counts nesting level (i.e. number of opened but not closed parentheses)",
"start",
"=",
"0",
"# starting point for string replacement",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"s",
")",
")",... | https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/AI/savegame_codec/_decoder.py#L192-L220 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/checkpoint/python/python_state.py | python | NumpyState.__getattribute__ | (self, name) | return value | Un-wrap `_NumpyWrapper` objects when accessing attributes. | Un-wrap `_NumpyWrapper` objects when accessing attributes. | [
"Un",
"-",
"wrap",
"_NumpyWrapper",
"objects",
"when",
"accessing",
"attributes",
"."
] | def __getattribute__(self, name):
"""Un-wrap `_NumpyWrapper` objects when accessing attributes."""
value = super(NumpyState, self).__getattribute__(name)
if isinstance(value, _NumpyWrapper):
return value.array
return value | [
"def",
"__getattribute__",
"(",
"self",
",",
"name",
")",
":",
"value",
"=",
"super",
"(",
"NumpyState",
",",
"self",
")",
".",
"__getattribute__",
"(",
"name",
")",
"if",
"isinstance",
"(",
"value",
",",
"_NumpyWrapper",
")",
":",
"return",
"value",
"."... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/checkpoint/python/python_state.py#L91-L96 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | remoting/tools/build/remoting_copy_locales.py | python | repack_locales | (locales) | Loop over and repack the given locales. | Loop over and repack the given locales. | [
"Loop",
"over",
"and",
"repack",
"the",
"given",
"locales",
"."
] | def repack_locales(locales):
""" Loop over and repack the given locales."""
for locale in locales:
inputs = calc_inputs(locale)
output = calc_output(locale)
data_pack.DataPack.RePack(output, inputs) | [
"def",
"repack_locales",
"(",
"locales",
")",
":",
"for",
"locale",
"in",
"locales",
":",
"inputs",
"=",
"calc_inputs",
"(",
"locale",
")",
"output",
"=",
"calc_output",
"(",
"locale",
")",
"data_pack",
".",
"DataPack",
".",
"RePack",
"(",
"output",
",",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/remoting/tools/build/remoting_copy_locales.py#L90-L95 | ||
goldeneye-source/ges-code | 2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d | thirdparty/protobuf-2.3.0/python/google/protobuf/internal/containers.py | python | BaseContainer.__init__ | (self, message_listener) | Args:
message_listener: A MessageListener implementation.
The RepeatedScalarFieldContainer will call this object's
Modified() method when it is modified. | Args:
message_listener: A MessageListener implementation.
The RepeatedScalarFieldContainer will call this object's
Modified() method when it is modified. | [
"Args",
":",
"message_listener",
":",
"A",
"MessageListener",
"implementation",
".",
"The",
"RepeatedScalarFieldContainer",
"will",
"call",
"this",
"object",
"s",
"Modified",
"()",
"method",
"when",
"it",
"is",
"modified",
"."
] | def __init__(self, message_listener):
"""
Args:
message_listener: A MessageListener implementation.
The RepeatedScalarFieldContainer will call this object's
Modified() method when it is modified.
"""
self._message_listener = message_listener
self._values = [] | [
"def",
"__init__",
"(",
"self",
",",
"message_listener",
")",
":",
"self",
".",
"_message_listener",
"=",
"message_listener",
"self",
".",
"_values",
"=",
"[",
"]"
] | https://github.com/goldeneye-source/ges-code/blob/2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/containers.py#L52-L60 | ||
gemrb/gemrb | 730206eed8d1dd358ca5e69a62f9e099aa22ffc6 | gemrb/GUIScripts/bg2/LUHLASelection.py | python | HLAMarkButton | (i, select) | return | Enables, disables, or highlights the given button.
If select is true, the button is highlighted. | Enables, disables, or highlights the given button. | [
"Enables",
"disables",
"or",
"highlights",
"the",
"given",
"button",
"."
] | def HLAMarkButton (i, select):
"""Enables, disables, or highlights the given button.
If select is true, the button is highlighted."""
j = ( GemRB.GetVar("HLATopIndex") + 1 ) * 5 - 5
if select:
state = IE_GUI_BUTTON_SELECTED
else:
if HLAAbilities[i][1]:
state = IE_GUI_BUTTON_ENABLED
else: # can't learn
... | [
"def",
"HLAMarkButton",
"(",
"i",
",",
"select",
")",
":",
"j",
"=",
"(",
"GemRB",
".",
"GetVar",
"(",
"\"HLATopIndex\"",
")",
"+",
"1",
")",
"*",
"5",
"-",
"5",
"if",
"select",
":",
"state",
"=",
"IE_GUI_BUTTON_SELECTED",
"else",
":",
"if",
"HLAAbil... | https://github.com/gemrb/gemrb/blob/730206eed8d1dd358ca5e69a62f9e099aa22ffc6/gemrb/GUIScripts/bg2/LUHLASelection.py#L270-L288 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/os.py | python | getenv | (key, default=None) | return environ.get(key, default) | Get an environment variable, return None if it doesn't exist.
The optional second argument can specify an alternate default.
key, default and the result are str. | Get an environment variable, return None if it doesn't exist.
The optional second argument can specify an alternate default.
key, default and the result are str. | [
"Get",
"an",
"environment",
"variable",
"return",
"None",
"if",
"it",
"doesn",
"t",
"exist",
".",
"The",
"optional",
"second",
"argument",
"can",
"specify",
"an",
"alternate",
"default",
".",
"key",
"default",
"and",
"the",
"result",
"are",
"str",
"."
] | def getenv(key, default=None):
"""Get an environment variable, return None if it doesn't exist.
The optional second argument can specify an alternate default.
key, default and the result are str."""
return environ.get(key, default) | [
"def",
"getenv",
"(",
"key",
",",
"default",
"=",
"None",
")",
":",
"return",
"environ",
".",
"get",
"(",
"key",
",",
"default",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/os.py#L772-L776 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | contrib/src/sceneeditor/seMopathRecorder.py | python | namePathPanel.onDestroy | (self, event) | If you have open any thing, please rewrite here! | If you have open any thing, please rewrite here! | [
"If",
"you",
"have",
"open",
"any",
"thing",
"please",
"rewrite",
"here!"
] | def onDestroy(self, event):
'''
If you have open any thing, please rewrite here!
'''
pass | [
"def",
"onDestroy",
"(",
"self",
",",
"event",
")",
":",
"pass"
] | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/contrib/src/sceneeditor/seMopathRecorder.py#L2063-L2067 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/auibook.py | python | AuiTabContainer.SetAGWFlags | (self, agwFlags) | Sets the tab art flags.
:param integer `agwFlags`: a combination of the following values:
==================================== ==================================
Flag name Description
==================================== ==================================
... | Sets the tab art flags. | [
"Sets",
"the",
"tab",
"art",
"flags",
"."
] | def SetAGWFlags(self, agwFlags):
"""
Sets the tab art flags.
:param integer `agwFlags`: a combination of the following values:
==================================== ==================================
Flag name Description
===================... | [
"def",
"SetAGWFlags",
"(",
"self",
",",
"agwFlags",
")",
":",
"self",
".",
"_agwFlags",
"=",
"agwFlags",
"# check for new close button settings",
"self",
".",
"RemoveButton",
"(",
"AUI_BUTTON_LEFT",
")",
"self",
".",
"RemoveButton",
"(",
"AUI_BUTTON_RIGHT",
")",
"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibook.py#L880-L938 | ||
apache/thrift | 0b29261a4f3c6882ef3b09aae47914f0012b0472 | lib/py/src/server/TNonblockingServer.py | python | Connection.fileno | (self) | return self.socket.fileno() | Returns the file descriptor of the associated socket. | Returns the file descriptor of the associated socket. | [
"Returns",
"the",
"file",
"descriptor",
"of",
"the",
"associated",
"socket",
"."
] | def fileno(self):
"""Returns the file descriptor of the associated socket."""
return self.socket.fileno() | [
"def",
"fileno",
"(",
"self",
")",
":",
"return",
"self",
".",
"socket",
".",
"fileno",
"(",
")"
] | https://github.com/apache/thrift/blob/0b29261a4f3c6882ef3b09aae47914f0012b0472/lib/py/src/server/TNonblockingServer.py#L223-L225 | |
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/pybind/mgr/dashboard/controllers/_permissions.py | python | CreatePermission | (func) | return func | :raises PermissionNotValid: If the permission is missing. | :raises PermissionNotValid: If the permission is missing. | [
":",
"raises",
"PermissionNotValid",
":",
"If",
"the",
"permission",
"is",
"missing",
"."
] | def CreatePermission(func): # noqa: N802
"""
:raises PermissionNotValid: If the permission is missing.
"""
_set_func_permissions(func, Permission.CREATE)
return func | [
"def",
"CreatePermission",
"(",
"func",
")",
":",
"# noqa: N802",
"_set_func_permissions",
"(",
"func",
",",
"Permission",
".",
"CREATE",
")",
"return",
"func"
] | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/dashboard/controllers/_permissions.py#L39-L44 | |
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/google/protobuf/internal/python_message.py | python | _AddHasExtensionMethod | (cls) | Helper for _AddMessageMethods(). | Helper for _AddMessageMethods(). | [
"Helper",
"for",
"_AddMessageMethods",
"()",
"."
] | def _AddHasExtensionMethod(cls):
"""Helper for _AddMessageMethods()."""
def HasExtension(self, extension_handle):
_VerifyExtensionHandle(self, extension_handle)
if extension_handle.label == _FieldDescriptor.LABEL_REPEATED:
raise KeyError('"%s" is repeated.' % extension_handle.full_name)
if extens... | [
"def",
"_AddHasExtensionMethod",
"(",
"cls",
")",
":",
"def",
"HasExtension",
"(",
"self",
",",
"extension_handle",
")",
":",
"_VerifyExtensionHandle",
"(",
"self",
",",
"extension_handle",
")",
"if",
"extension_handle",
".",
"label",
"==",
"_FieldDescriptor",
"."... | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/internal/python_message.py#L902-L914 | ||
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | lldb/utils/lui/lldbutil.py | python | which | (program) | return None | Returns the full path to a program; None otherwise. | Returns the full path to a program; None otherwise. | [
"Returns",
"the",
"full",
"path",
"to",
"a",
"program",
";",
"None",
"otherwise",
"."
] | def which(program):
"""Returns the full path to a program; None otherwise."""
fpath, fname = os.path.split(program)
if fpath:
if is_exe(program):
return program
else:
for path in os.environ["PATH"].split(os.pathsep):
exe_file = os.path.join(path, program)
... | [
"def",
"which",
"(",
"program",
")",
":",
"fpath",
",",
"fname",
"=",
"os",
".",
"path",
".",
"split",
"(",
"program",
")",
"if",
"fpath",
":",
"if",
"is_exe",
"(",
"program",
")",
":",
"return",
"program",
"else",
":",
"for",
"path",
"in",
"os",
... | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/lldb/utils/lui/lldbutil.py#L30-L41 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/api.py | python | event | (timing=True) | return evt | Create a CUDA event. Timing data is only recorded by the event if it is
created with ``timing=True``. | Create a CUDA event. Timing data is only recorded by the event if it is
created with ``timing=True``. | [
"Create",
"a",
"CUDA",
"event",
".",
"Timing",
"data",
"is",
"only",
"recorded",
"by",
"the",
"event",
"if",
"it",
"is",
"created",
"with",
"timing",
"=",
"True",
"."
] | def event(timing=True):
"""
Create a CUDA event. Timing data is only recorded by the event if it is
created with ``timing=True``.
"""
evt = current_context().create_event(timing=timing)
return evt | [
"def",
"event",
"(",
"timing",
"=",
"True",
")",
":",
"evt",
"=",
"current_context",
"(",
")",
".",
"create_event",
"(",
"timing",
"=",
"timing",
")",
"return",
"evt"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/api.py#L317-L323 | |
Kitware/VTK | 5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8 | Wrapping/Python/vtkmodules/tk/vtkTkRenderWidget.py | python | vtkTkRenderWidget.BindTkRenderWidget | (self) | Bind some default actions. | Bind some default actions. | [
"Bind",
"some",
"default",
"actions",
"."
] | def BindTkRenderWidget(self):
"""
Bind some default actions.
"""
self.bind("<ButtonPress>",
lambda e,s=self: s.StartMotion(e.x,e.y))
self.bind("<ButtonRelease>",
lambda e,s=self: s.EndMotion(e.x,e.y))
self.bind("<B1-Motion>",
... | [
"def",
"BindTkRenderWidget",
"(",
"self",
")",
":",
"self",
".",
"bind",
"(",
"\"<ButtonPress>\"",
",",
"lambda",
"e",
",",
"s",
"=",
"self",
":",
"s",
".",
"StartMotion",
"(",
"e",
".",
"x",
",",
"e",
".",
"y",
")",
")",
"self",
".",
"bind",
"("... | https://github.com/Kitware/VTK/blob/5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8/Wrapping/Python/vtkmodules/tk/vtkTkRenderWidget.py#L150-L185 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Window.GetScreenRect | (*args, **kwargs) | return _core_.Window_GetScreenRect(*args, **kwargs) | GetScreenRect(self) -> Rect
Returns the size and position of the window in screen coordinantes as
a `wx.Rect` object. | GetScreenRect(self) -> Rect | [
"GetScreenRect",
"(",
"self",
")",
"-",
">",
"Rect"
] | def GetScreenRect(*args, **kwargs):
"""
GetScreenRect(self) -> Rect
Returns the size and position of the window in screen coordinantes as
a `wx.Rect` object.
"""
return _core_.Window_GetScreenRect(*args, **kwargs) | [
"def",
"GetScreenRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_GetScreenRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L9492-L9499 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/sparse/base.py | python | spmatrix.count_nonzero | (self) | Number of non-zero entries, equivalent to
np.count_nonzero(a.toarray())
Unlike getnnz() and the nnz property, which return the number of stored
entries (the length of the data attribute), this method counts the
actual number of non-zero entries in data. | Number of non-zero entries, equivalent to | [
"Number",
"of",
"non",
"-",
"zero",
"entries",
"equivalent",
"to"
] | def count_nonzero(self):
"""Number of non-zero entries, equivalent to
np.count_nonzero(a.toarray())
Unlike getnnz() and the nnz property, which return the number of stored
entries (the length of the data attribute), this method counts the
actual number of non-zero entries in da... | [
"def",
"count_nonzero",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"count_nonzero not implemented for %s.\"",
"%",
"self",
".",
"__class__",
".",
"__name__",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/sparse/base.py#L153-L163 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/monkey.py | python | _patch_distribution_metadata | () | Patch write_pkg_file and read_pkg_file for higher metadata standards | Patch write_pkg_file and read_pkg_file for higher metadata standards | [
"Patch",
"write_pkg_file",
"and",
"read_pkg_file",
"for",
"higher",
"metadata",
"standards"
] | def _patch_distribution_metadata():
"""Patch write_pkg_file and read_pkg_file for higher metadata standards"""
for attr in ('write_pkg_file', 'read_pkg_file', 'get_metadata_version'):
new_val = getattr(setuptools.dist, attr)
setattr(distutils.dist.DistributionMetadata, attr, new_val) | [
"def",
"_patch_distribution_metadata",
"(",
")",
":",
"for",
"attr",
"in",
"(",
"'write_pkg_file'",
",",
"'read_pkg_file'",
",",
"'get_metadata_version'",
")",
":",
"new_val",
"=",
"getattr",
"(",
"setuptools",
".",
"dist",
",",
"attr",
")",
"setattr",
"(",
"d... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/monkey.py#L104-L108 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/mox3/mox3/mox.py | python | MethodSignatureChecker.Check | (self, params, named_params) | Ensures that the parameters used while recording a call are valid.
Args:
# params: A list of positional parameters.
# named_params: A dict of named parameters.
params: list
named_params: dict
Raises:
AttributeError: the given parameters don't... | Ensures that the parameters used while recording a call are valid. | [
"Ensures",
"that",
"the",
"parameters",
"used",
"while",
"recording",
"a",
"call",
"are",
"valid",
"."
] | def Check(self, params, named_params):
"""Ensures that the parameters used while recording a call are valid.
Args:
# params: A list of positional parameters.
# named_params: A dict of named parameters.
params: list
named_params: dict
Raises:
... | [
"def",
"Check",
"(",
"self",
",",
"params",
",",
"named_params",
")",
":",
"arg_status",
"=",
"dict",
"(",
"(",
"a",
",",
"MethodSignatureChecker",
".",
"_NEEDED",
")",
"for",
"a",
"in",
"self",
".",
"_required_args",
")",
"for",
"arg",
"in",
"self",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mox3/mox3/mox.py#L952-L1029 | ||
kushview/Element | 1cc16380caa2ab79461246ba758b9de1f46db2a5 | waflib/Tools/suncc.py | python | find_scc | (conf) | Detects the Sun C compiler | Detects the Sun C compiler | [
"Detects",
"the",
"Sun",
"C",
"compiler"
] | def find_scc(conf):
"""
Detects the Sun C compiler
"""
v = conf.env
cc = conf.find_program('cc', var='CC')
try:
conf.cmd_and_log(cc + ['-flags'])
except Errors.WafError:
conf.fatal('%r is not a Sun compiler' % cc)
v.CC_NAME = 'sun'
conf.get_suncc_version(cc) | [
"def",
"find_scc",
"(",
"conf",
")",
":",
"v",
"=",
"conf",
".",
"env",
"cc",
"=",
"conf",
".",
"find_program",
"(",
"'cc'",
",",
"var",
"=",
"'CC'",
")",
"try",
":",
"conf",
".",
"cmd_and_log",
"(",
"cc",
"+",
"[",
"'-flags'",
"]",
")",
"except"... | https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Tools/suncc.py#L11-L22 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/glacier/layer1.py | python | Layer1.get_vault_notifications | (self, vault_name) | return self.make_request('GET', uri) | This operation retrieves the `notification-configuration`
subresource of the specified vault.
For information about setting a notification configuration on
a vault, see SetVaultNotifications. If a notification
configuration for a vault is not set, the operation returns a
`404 No... | This operation retrieves the `notification-configuration`
subresource of the specified vault. | [
"This",
"operation",
"retrieves",
"the",
"notification",
"-",
"configuration",
"subresource",
"of",
"the",
"specified",
"vault",
"."
] | def get_vault_notifications(self, vault_name):
"""
This operation retrieves the `notification-configuration`
subresource of the specified vault.
For information about setting a notification configuration on
a vault, see SetVaultNotifications. If a notification
configurat... | [
"def",
"get_vault_notifications",
"(",
"self",
",",
"vault_name",
")",
":",
"uri",
"=",
"'vaults/%s/notification-configuration'",
"%",
"vault_name",
"return",
"self",
".",
"make_request",
"(",
"'GET'",
",",
"uri",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/glacier/layer1.py#L268-L296 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/generic.py | python | NDFrame.get_dtype_counts | (self) | return Series(self._data.get_dtype_counts()) | Return counts of unique dtypes in this object.
Returns
-------
dtype : Series
Series with the count of columns with each dtype.
See Also
--------
dtypes : Return the dtypes in this object.
Examples
--------
>>> a = [['a', 1, 1.0], ['... | Return counts of unique dtypes in this object. | [
"Return",
"counts",
"of",
"unique",
"dtypes",
"in",
"this",
"object",
"."
] | def get_dtype_counts(self):
"""
Return counts of unique dtypes in this object.
Returns
-------
dtype : Series
Series with the count of columns with each dtype.
See Also
--------
dtypes : Return the dtypes in this object.
Examples
... | [
"def",
"get_dtype_counts",
"(",
"self",
")",
":",
"from",
"pandas",
"import",
"Series",
"return",
"Series",
"(",
"self",
".",
"_data",
".",
"get_dtype_counts",
"(",
")",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/generic.py#L5382-L5412 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/refactor.py | python | RefactoringTool.refactor_file | (self, filename, write=False, doctests_only=False) | Refactors a file. | Refactors a file. | [
"Refactors",
"a",
"file",
"."
] | def refactor_file(self, filename, write=False, doctests_only=False):
"""Refactors a file."""
input, encoding = self._read_python_source(filename)
if input is None:
# Reading the file failed.
return
input += u"\n" # Silence certain parse errors
if doctests_... | [
"def",
"refactor_file",
"(",
"self",
",",
"filename",
",",
"write",
"=",
"False",
",",
"doctests_only",
"=",
"False",
")",
":",
"input",
",",
"encoding",
"=",
"self",
".",
"_read_python_source",
"(",
"filename",
")",
"if",
"input",
"is",
"None",
":",
"# ... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/refactor.py#L339-L360 | ||
fastmachinelearning/hls4ml | 58d761006250deed721d85fefea91201708f2165 | hls4ml/model/profiling.py | python | compare | (keras_model, hls_model, X, plot_type = "dist_diff") | return f | Compare each layer's output in keras and hls model. Note that the hls_model should not be compiled before using this.
Parameters
----------
keras_model :
original keras model
hls_model :
converted ModelGraph, with "Trace:True" in the configuration file.
X : array-like
Inpu... | Compare each layer's output in keras and hls model. Note that the hls_model should not be compiled before using this. | [
"Compare",
"each",
"layer",
"s",
"output",
"in",
"keras",
"and",
"hls",
"model",
".",
"Note",
"that",
"the",
"hls_model",
"should",
"not",
"be",
"compiled",
"before",
"using",
"this",
"."
] | def compare(keras_model, hls_model, X, plot_type = "dist_diff"):
"""
Compare each layer's output in keras and hls model. Note that the hls_model should not be compiled before using this.
Parameters
----------
keras_model :
original keras model
hls_model :
converted ModelGraph, ... | [
"def",
"compare",
"(",
"keras_model",
",",
"hls_model",
",",
"X",
",",
"plot_type",
"=",
"\"dist_diff\"",
")",
":",
"#Take in output from both models",
"#Note that each y is a dictionary with structure {\"layer_name\": flattened ouput array}",
"ymodel",
"=",
"get_ymodel_keras",
... | https://github.com/fastmachinelearning/hls4ml/blob/58d761006250deed721d85fefea91201708f2165/hls4ml/model/profiling.py#L655-L694 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/engine/training_v1.py | python | Model._handle_per_output_metrics | (self,
metrics_dict,
y_true,
y_pred,
mask,
weights=None) | return metric_results | Calls metric functions for a single output.
Args:
metrics_dict: A dict with metric names as keys and metric fns as values.
y_true: Target output.
y_pred: Predicted output.
mask: Computed mask value for the current output.
weights: Weights to be applied on the current output.
Retu... | Calls metric functions for a single output. | [
"Calls",
"metric",
"functions",
"for",
"a",
"single",
"output",
"."
] | def _handle_per_output_metrics(self,
metrics_dict,
y_true,
y_pred,
mask,
weights=None):
"""Calls metric functions for a single output.
Args:
... | [
"def",
"_handle_per_output_metrics",
"(",
"self",
",",
"metrics_dict",
",",
"y_true",
",",
"y_pred",
",",
"mask",
",",
"weights",
"=",
"None",
")",
":",
"metric_results",
"=",
"[",
"]",
"for",
"metric_name",
",",
"metric_fn",
"in",
"metrics_dict",
".",
"item... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/engine/training_v1.py#L1901-L1925 | |
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/series.py | python | Series.nullmask | (self) | return cudf.Series(self._column.nullmask) | The gpu buffer for the null-mask | The gpu buffer for the null-mask | [
"The",
"gpu",
"buffer",
"for",
"the",
"null",
"-",
"mask"
] | def nullmask(self):
"""The gpu buffer for the null-mask"""
return cudf.Series(self._column.nullmask) | [
"def",
"nullmask",
"(",
"self",
")",
":",
"return",
"cudf",
".",
"Series",
"(",
"self",
".",
"_column",
".",
"nullmask",
")"
] | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/series.py#L1815-L1817 | |
livecode/livecode | 4606a10ea10b16d5071d0f9f263ccdd7ede8b31d | gyp/pylib/gyp/MSVSSettings.py | python | _Same | (tool, name, setting_type) | Defines a setting that has the same name in MSVS and MSBuild.
Args:
tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
name: the name of the setting.
setting_type: the type of this setting. | Defines a setting that has the same name in MSVS and MSBuild. | [
"Defines",
"a",
"setting",
"that",
"has",
"the",
"same",
"name",
"in",
"MSVS",
"and",
"MSBuild",
"."
] | def _Same(tool, name, setting_type):
"""Defines a setting that has the same name in MSVS and MSBuild.
Args:
tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
name: the name of the setting.
setting_type: the type of this setting.
"""
_Renamed(tool, name, name, setting_type) | [
"def",
"_Same",
"(",
"tool",
",",
"name",
",",
"setting_type",
")",
":",
"_Renamed",
"(",
"tool",
",",
"name",
",",
"name",
",",
"setting_type",
")"
] | https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/MSVSSettings.py#L233-L241 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/sparse/sputils.py | python | downcast_intp_index | (arr) | return arr | Down-cast index array to np.intp dtype if it is of a larger dtype.
Raise an error if the array contains a value that is too large for
intp. | Down-cast index array to np.intp dtype if it is of a larger dtype. | [
"Down",
"-",
"cast",
"index",
"array",
"to",
"np",
".",
"intp",
"dtype",
"if",
"it",
"is",
"of",
"a",
"larger",
"dtype",
"."
] | def downcast_intp_index(arr):
"""
Down-cast index array to np.intp dtype if it is of a larger dtype.
Raise an error if the array contains a value that is too large for
intp.
"""
if arr.dtype.itemsize > np.dtype(np.intp).itemsize:
if arr.size == 0:
return arr.astype(np.intp)
... | [
"def",
"downcast_intp_index",
"(",
"arr",
")",
":",
"if",
"arr",
".",
"dtype",
".",
"itemsize",
">",
"np",
".",
"dtype",
"(",
"np",
".",
"intp",
")",
".",
"itemsize",
":",
"if",
"arr",
".",
"size",
"==",
"0",
":",
"return",
"arr",
".",
"astype",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/sparse/sputils.py#L79-L96 | |
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/constraints/exponential.py | python | ExpCone.size | (self) | return 3 * self.num_cones() | The number of entries in the combined cones. | The number of entries in the combined cones. | [
"The",
"number",
"of",
"entries",
"in",
"the",
"combined",
"cones",
"."
] | def size(self) -> int:
"""The number of entries in the combined cones.
"""
return 3 * self.num_cones() | [
"def",
"size",
"(",
"self",
")",
"->",
"int",
":",
"return",
"3",
"*",
"self",
".",
"num_cones",
"(",
")"
] | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/constraints/exponential.py#L91-L94 | |
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | clang/tools/scan-build-py/libscanbuild/analyze.py | python | create_global_ctu_extdef_map | (extdef_map_lines) | return mangled_ast_pairs | Takes iterator of individual external definition maps and creates a
global map keeping only unique names. We leave conflicting names out of
CTU.
:param extdef_map_lines: Contains the id of a definition (mangled name) and
the originating source (the corresponding AST file) name.
:type extdef_map_lin... | Takes iterator of individual external definition maps and creates a
global map keeping only unique names. We leave conflicting names out of
CTU. | [
"Takes",
"iterator",
"of",
"individual",
"external",
"definition",
"maps",
"and",
"creates",
"a",
"global",
"map",
"keeping",
"only",
"unique",
"names",
".",
"We",
"leave",
"conflicting",
"names",
"out",
"of",
"CTU",
"."
] | def create_global_ctu_extdef_map(extdef_map_lines):
""" Takes iterator of individual external definition maps and creates a
global map keeping only unique names. We leave conflicting names out of
CTU.
:param extdef_map_lines: Contains the id of a definition (mangled name) and
the originating source... | [
"def",
"create_global_ctu_extdef_map",
"(",
"extdef_map_lines",
")",
":",
"mangled_to_asts",
"=",
"defaultdict",
"(",
"set",
")",
"for",
"line",
"in",
"extdef_map_lines",
":",
"mangled_name",
",",
"ast_file",
"=",
"line",
".",
"strip",
"(",
")",
".",
"split",
... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/clang/tools/scan-build-py/libscanbuild/analyze.py#L136-L160 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_stc.py | python | EditraStc.SyntaxOnOff | (self, switch=None) | return 0 | Turn Syntax Highlighting on and off
@keyword switch: force a particular setting | Turn Syntax Highlighting on and off
@keyword switch: force a particular setting | [
"Turn",
"Syntax",
"Highlighting",
"on",
"and",
"off",
"@keyword",
"switch",
":",
"force",
"a",
"particular",
"setting"
] | def SyntaxOnOff(self, switch=None):
"""Turn Syntax Highlighting on and off
@keyword switch: force a particular setting
"""
if (switch is None and not self._config['highlight']) or switch:
self.LOG("[ed_stc][evt] Syntax Highlighting Turned On")
self._config['highl... | [
"def",
"SyntaxOnOff",
"(",
"self",
",",
"switch",
"=",
"None",
")",
":",
"if",
"(",
"switch",
"is",
"None",
"and",
"not",
"self",
".",
"_config",
"[",
"'highlight'",
"]",
")",
"or",
"switch",
":",
"self",
".",
"LOG",
"(",
"\"[ed_stc][evt] Syntax Highligh... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_stc.py#L1606-L1621 | |
openmm/openmm | cb293447c4fc8b03976dfe11399f107bab70f3d9 | wrappers/python/openmm/unit/baseunit.py | python | BaseUnit.conversion_factor_to | (self, other) | return self._conversion_factor_to_by_name[other.name] | Returns a conversion factor from this BaseUnit to another BaseUnit.
It does not matter which existing BaseUnit you define the conversion factor to.
Conversions for all other known BaseUnits will be computed at the same time.
Raises TypeError if dimension does not match.
Raises LookupEr... | Returns a conversion factor from this BaseUnit to another BaseUnit. | [
"Returns",
"a",
"conversion",
"factor",
"from",
"this",
"BaseUnit",
"to",
"another",
"BaseUnit",
"."
] | def conversion_factor_to(self, other):
"""Returns a conversion factor from this BaseUnit to another BaseUnit.
It does not matter which existing BaseUnit you define the conversion factor to.
Conversions for all other known BaseUnits will be computed at the same time.
Raises TypeError if... | [
"def",
"conversion_factor_to",
"(",
"self",
",",
"other",
")",
":",
"if",
"self",
"is",
"other",
":",
"return",
"1.0",
"if",
"self",
".",
"dimension",
"!=",
"other",
".",
"dimension",
":",
"raise",
"TypeError",
"(",
"'Cannot get conversion for BaseUnits with dif... | https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/unit/baseunit.py#L149-L164 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/v8/third_party/jinja2/parser.py | python | Parser.parse_if | (self) | return result | Parse an if construct. | Parse an if construct. | [
"Parse",
"an",
"if",
"construct",
"."
] | def parse_if(self):
"""Parse an if construct."""
node = result = nodes.If(lineno=self.stream.expect('name:if').lineno)
while 1:
node.test = self.parse_tuple(with_condexpr=False)
node.body = self.parse_statements(('name:elif', 'name:else',
... | [
"def",
"parse_if",
"(",
"self",
")",
":",
"node",
"=",
"result",
"=",
"nodes",
".",
"If",
"(",
"lineno",
"=",
"self",
".",
"stream",
".",
"expect",
"(",
"'name:if'",
")",
".",
"lineno",
")",
"while",
"1",
":",
"node",
".",
"test",
"=",
"self",
".... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/v8/third_party/jinja2/parser.py#L207-L225 | |
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/meshtools/mesh.py | python | exportHDF5Mesh | (mesh, exportname, group='mesh', indices='cell_indices',
pos='coordinates', cells='topology', marker='values') | return True | Writes given :gimliapi:`GIMLI::Mesh` in a hdf5 format file.
3D tetrahedral meshes only! Boundary markers are ignored.
Keywords are explained in :py:mod:`pygimli.meshtools.readHDFS` | Writes given :gimliapi:`GIMLI::Mesh` in a hdf5 format file. | [
"Writes",
"given",
":",
"gimliapi",
":",
"GIMLI",
"::",
"Mesh",
"in",
"a",
"hdf5",
"format",
"file",
"."
] | def exportHDF5Mesh(mesh, exportname, group='mesh', indices='cell_indices',
pos='coordinates', cells='topology', marker='values'):
"""Writes given :gimliapi:`GIMLI::Mesh` in a hdf5 format file.
3D tetrahedral meshes only! Boundary markers are ignored.
Keywords are explained in :py:mod:`p... | [
"def",
"exportHDF5Mesh",
"(",
"mesh",
",",
"exportname",
",",
"group",
"=",
"'mesh'",
",",
"indices",
"=",
"'cell_indices'",
",",
"pos",
"=",
"'coordinates'",
",",
"cells",
"=",
"'topology'",
",",
"marker",
"=",
"'values'",
")",
":",
"h5py",
"=",
"pg",
"... | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/meshtools/mesh.py#L1479-L1521 | |
nyuwireless-unipd/ns3-mmwave | 4ff9e87e8079764e04cbeccd8e85bff15ae16fb3 | src/core/examples/sample-simulator.py | python | MyModel.Start | (self) | Start model execution by scheduling a HandleEvent. | Start model execution by scheduling a HandleEvent. | [
"Start",
"model",
"execution",
"by",
"scheduling",
"a",
"HandleEvent",
"."
] | def Start(self):
"""Start model execution by scheduling a HandleEvent."""
ns.core.Simulator.Schedule(ns.core.Seconds(10.0), self.HandleEvent, ns.core.Simulator.Now().GetSeconds()) | [
"def",
"Start",
"(",
"self",
")",
":",
"ns",
".",
"core",
".",
"Simulator",
".",
"Schedule",
"(",
"ns",
".",
"core",
".",
"Seconds",
"(",
"10.0",
")",
",",
"self",
".",
"HandleEvent",
",",
"ns",
".",
"core",
".",
"Simulator",
".",
"Now",
"(",
")"... | https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/src/core/examples/sample-simulator.py#L35-L37 | ||
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | llvm/bindings/python/llvm/object.py | python | ObjectFile.get_sections | (self, cache=False) | Obtain the sections in this object file.
This is a generator for llvm.object.Section instances.
Sections are exposed as limited-use objects. See the module's
documentation on iterators for more. | Obtain the sections in this object file. | [
"Obtain",
"the",
"sections",
"in",
"this",
"object",
"file",
"."
] | def get_sections(self, cache=False):
"""Obtain the sections in this object file.
This is a generator for llvm.object.Section instances.
Sections are exposed as limited-use objects. See the module's
documentation on iterators for more.
"""
sections = lib.LLVMGetSections(... | [
"def",
"get_sections",
"(",
"self",
",",
"cache",
"=",
"False",
")",
":",
"sections",
"=",
"lib",
".",
"LLVMGetSections",
"(",
"self",
")",
"last",
"=",
"None",
"while",
"True",
":",
"if",
"lib",
".",
"LLVMIsSectionIteratorAtEnd",
"(",
"self",
",",
"sect... | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/llvm/bindings/python/llvm/object.py#L122-L148 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/linalg/_interpolative_backend.py | python | idzr_svd | (A, k) | return U, V, S | Compute SVD of a complex matrix to a specified rank.
:param A:
Matrix.
:type A: :class:`numpy.ndarray`
:param k:
Rank of SVD.
:type k: int
:return:
Left singular vectors.
:rtype: :class:`numpy.ndarray`
:return:
Right singular vectors.
:rtype: :class:`num... | Compute SVD of a complex matrix to a specified rank. | [
"Compute",
"SVD",
"of",
"a",
"complex",
"matrix",
"to",
"a",
"specified",
"rank",
"."
] | def idzr_svd(A, k):
"""
Compute SVD of a complex matrix to a specified rank.
:param A:
Matrix.
:type A: :class:`numpy.ndarray`
:param k:
Rank of SVD.
:type k: int
:return:
Left singular vectors.
:rtype: :class:`numpy.ndarray`
:return:
Right singular ... | [
"def",
"idzr_svd",
"(",
"A",
",",
"k",
")",
":",
"A",
"=",
"np",
".",
"asfortranarray",
"(",
"A",
")",
"U",
",",
"V",
",",
"S",
",",
"ier",
"=",
"_id",
".",
"idzr_svd",
"(",
"A",
",",
"k",
")",
"if",
"ier",
":",
"raise",
"_RETCODE_ERROR",
"re... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/linalg/_interpolative_backend.py#L1214-L1239 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/xrc.py | python | XmlResourceHandler.AddStyle | (*args, **kwargs) | return _xrc.XmlResourceHandler_AddStyle(*args, **kwargs) | AddStyle(self, String name, int value) | AddStyle(self, String name, int value) | [
"AddStyle",
"(",
"self",
"String",
"name",
"int",
"value",
")"
] | def AddStyle(*args, **kwargs):
"""AddStyle(self, String name, int value)"""
return _xrc.XmlResourceHandler_AddStyle(*args, **kwargs) | [
"def",
"AddStyle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_xrc",
".",
"XmlResourceHandler_AddStyle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/xrc.py#L647-L649 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/estimator.py | python | BaseEstimator._get_feature_ops_from_example | (self, examples_batch) | return tensor_signature.create_example_parser_from_signatures(
self._features_info, examples_batch) | Returns feature parser for given example batch using features info.
This function requires `fit()` has been called.
Args:
examples_batch: batch of tf.Example
Returns:
features: `Tensor` or `dict` of `Tensor` objects.
Raises:
ValueError: If `_features_info` attribute is not availabl... | Returns feature parser for given example batch using features info. | [
"Returns",
"feature",
"parser",
"for",
"given",
"example",
"batch",
"using",
"features",
"info",
"."
] | def _get_feature_ops_from_example(self, examples_batch):
"""Returns feature parser for given example batch using features info.
This function requires `fit()` has been called.
Args:
examples_batch: batch of tf.Example
Returns:
features: `Tensor` or `dict` of `Tensor` objects.
Raises:... | [
"def",
"_get_feature_ops_from_example",
"(",
"self",
",",
"examples_batch",
")",
":",
"if",
"self",
".",
"_features_info",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"'Features information missing, was fit() ever called?'",
")",
"return",
"tensor_signature",
".",
"c... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/estimator.py#L400-L418 | |
nyuwireless-unipd/ns3-mmwave | 4ff9e87e8079764e04cbeccd8e85bff15ae16fb3 | src/visualizer/visualizer/core.py | python | SimulationThread.set_nodes_of_interest | (self, nodes) | !
Set nodes of interest function.
@param self: class object.
@param nodes: class object.
@return | !
Set nodes of interest function. | [
"!",
"Set",
"nodes",
"of",
"interest",
"function",
"."
] | def set_nodes_of_interest(self, nodes):
"""!
Set nodes of interest function.
@param self: class object.
@param nodes: class object.
@return
"""
self.lock.acquire()
try:
self.sim_helper.SetNodesOfInterest(nodes)
finally:
sel... | [
"def",
"set_nodes_of_interest",
"(",
"self",
",",
"nodes",
")",
":",
"self",
".",
"lock",
".",
"acquire",
"(",
")",
"try",
":",
"self",
".",
"sim_helper",
".",
"SetNodesOfInterest",
"(",
"nodes",
")",
"finally",
":",
"self",
".",
"lock",
".",
"release",
... | https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/src/visualizer/visualizer/core.py#L637-L649 | ||
Alexhuszagh/rust-lexical | 01fcdcf8efc8850edb35d8fc65fd5f31bd0981a0 | lexical-util/etc/div128.py | python | is_valid | (x) | return (
x <= u64_max
and (u128_max / (x**2)) < x
) | Determine if the power is valid. | Determine if the power is valid. | [
"Determine",
"if",
"the",
"power",
"is",
"valid",
"."
] | def is_valid(x):
'''Determine if the power is valid.'''
return (
x <= u64_max
and (u128_max / (x**2)) < x
) | [
"def",
"is_valid",
"(",
"x",
")",
":",
"return",
"(",
"x",
"<=",
"u64_max",
"and",
"(",
"u128_max",
"/",
"(",
"x",
"**",
"2",
")",
")",
"<",
"x",
")"
] | https://github.com/Alexhuszagh/rust-lexical/blob/01fcdcf8efc8850edb35d8fc65fd5f31bd0981a0/lexical-util/etc/div128.py#L21-L26 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/icc.py | python | generate | (env) | Add Builders and construction variables for the OS/2 to an Environment. | Add Builders and construction variables for the OS/2 to an Environment. | [
"Add",
"Builders",
"and",
"construction",
"variables",
"for",
"the",
"OS",
"/",
"2",
"to",
"an",
"Environment",
"."
] | def generate(env):
"""Add Builders and construction variables for the OS/2 to an Environment."""
cc.generate(env)
env['CC'] = 'icc'
env['CCCOM'] = '$CC $CFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo$TARGET'
env['CXXCOM'] = '$CXX $CXXFLAGS $CPPFLAGS $_CPPDEFF... | [
"def",
"generate",
"(",
"env",
")",
":",
"cc",
".",
"generate",
"(",
"env",
")",
"env",
"[",
"'CC'",
"]",
"=",
"'icc'",
"env",
"[",
"'CCCOM'",
"]",
"=",
"'$CC $CFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo$TARGET'",
"env",
"[",
"'CXXCOM'",
... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/icc.py#L38-L50 | ||
freeorion/freeorion | c266a40eccd3a99a17de8fe57c36ef6ba3771665 | default/python/universe_generation/galaxy.py | python | recalc_universe_width | (positions) | return actual_width, new_positions | Recalculates the universe width. This is done by shifting all positions by a delta so too much "extra space"
beyond the uppermost, lowermost, leftmost and rightmost positions is cropped, and adjust the universe width
accordingly.
Returns the new universe width and the recalculated positions. | Recalculates the universe width. This is done by shifting all positions by a delta so too much "extra space"
beyond the uppermost, lowermost, leftmost and rightmost positions is cropped, and adjust the universe width
accordingly. | [
"Recalculates",
"the",
"universe",
"width",
".",
"This",
"is",
"done",
"by",
"shifting",
"all",
"positions",
"by",
"a",
"delta",
"so",
"too",
"much",
"extra",
"space",
"beyond",
"the",
"uppermost",
"lowermost",
"leftmost",
"and",
"rightmost",
"positions",
"is"... | def recalc_universe_width(positions):
"""
Recalculates the universe width. This is done by shifting all positions by a delta so too much "extra space"
beyond the uppermost, lowermost, leftmost and rightmost positions is cropped, and adjust the universe width
accordingly.
Returns the new universe wi... | [
"def",
"recalc_universe_width",
"(",
"positions",
")",
":",
"print",
"(",
"\"Recalculating universe width...\"",
")",
"# first, get the uppermost, lowermost, leftmost and rightmost positions",
"# (these are those with their x or y coordinate closest to or farthest away from the x or y axis)",
... | https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/universe_generation/galaxy.py#L738-L784 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/ntpath.py | python | islink | (path) | return False | Test for symbolic link.
On WindowsNT/95 and OS/2 always returns false | Test for symbolic link.
On WindowsNT/95 and OS/2 always returns false | [
"Test",
"for",
"symbolic",
"link",
".",
"On",
"WindowsNT",
"/",
"95",
"and",
"OS",
"/",
"2",
"always",
"returns",
"false"
] | def islink(path):
"""Test for symbolic link.
On WindowsNT/95 and OS/2 always returns false
"""
return False | [
"def",
"islink",
"(",
"path",
")",
":",
"return",
"False"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/ntpath.py#L210-L214 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_hybi.py | python | create_length_header | (length, mask) | Creates a length header.
Args:
length: Frame length. Must be less than 2^63.
mask: Mask bit. Must be boolean.
Raises:
ValueError: when bad data is given. | Creates a length header. | [
"Creates",
"a",
"length",
"header",
"."
] | def create_length_header(length, mask):
"""Creates a length header.
Args:
length: Frame length. Must be less than 2^63.
mask: Mask bit. Must be boolean.
Raises:
ValueError: when bad data is given.
"""
if mask:
mask_bit = 1 << 7
else:
mask_bit = 0
i... | [
"def",
"create_length_header",
"(",
"length",
",",
"mask",
")",
":",
"if",
"mask",
":",
"mask_bit",
"=",
"1",
"<<",
"7",
"else",
":",
"mask_bit",
"=",
"0",
"if",
"length",
"<",
"0",
":",
"raise",
"ValueError",
"(",
"'length must be non negative integer'",
... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_hybi.py#L74-L99 | ||
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | bindings/python/cntk/ops/__init__.py | python | reduce_max | (x, axis=None, keepdims=True, name='') | return reduce_max(x, axis, keepdims, name) | Computes the max of the input tensor's elements across a specified axis or a list of specified axes.
Example:
>>> # create 3x2x2 matrix in a sequence of length 1 in a batch of one sample
>>> data = np.array([[[5,1], [20,2]],[[30,1], [40,2]],[[55,1], [60,2]]], dtype=np.float32)
>>> C.reduce... | Computes the max of the input tensor's elements across a specified axis or a list of specified axes. | [
"Computes",
"the",
"max",
"of",
"the",
"input",
"tensor",
"s",
"elements",
"across",
"a",
"specified",
"axis",
"or",
"a",
"list",
"of",
"specified",
"axes",
"."
] | def reduce_max(x, axis=None, keepdims=True, name=''):
'''
Computes the max of the input tensor's elements across a specified axis or a list of specified axes.
Example:
>>> # create 3x2x2 matrix in a sequence of length 1 in a batch of one sample
>>> data = np.array([[[5,1], [20,2]],[[30,1], ... | [
"def",
"reduce_max",
"(",
"x",
",",
"axis",
"=",
"None",
",",
"keepdims",
"=",
"True",
",",
"name",
"=",
"''",
")",
":",
"from",
"cntk",
".",
"cntk_py",
"import",
"reduce_max",
"x",
"=",
"sanitize_input",
"(",
"x",
")",
"axis",
"=",
"sanitize_multi_axi... | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/ops/__init__.py#L3106-L3146 | |
pristineio/webrtc-mirror | 7a5bcdffaab90a05bc1146b2b1ea71c004e54d71 | tools_webrtc/sslroots/generate_sslroots.py | python | main | () | The main entrypoint. | The main entrypoint. | [
"The",
"main",
"entrypoint",
"."
] | def main():
"""The main entrypoint."""
parser = OptionParser('usage %prog FILE')
parser.add_option('-v', '--verbose', dest='verbose', action='store_true')
parser.add_option('-f', '--full_cert', dest='full_cert', action='store_true')
options, args = parser.parse_args()
if len(args) < 1:
parser.error('No ... | [
"def",
"main",
"(",
")",
":",
"parser",
"=",
"OptionParser",
"(",
"'usage %prog FILE'",
")",
"parser",
".",
"add_option",
"(",
"'-v'",
",",
"'--verbose'",
",",
"dest",
"=",
"'verbose'",
",",
"action",
"=",
"'store_true'",
")",
"parser",
".",
"add_option",
... | https://github.com/pristineio/webrtc-mirror/blob/7a5bcdffaab90a05bc1146b2b1ea71c004e54d71/tools_webrtc/sslroots/generate_sslroots.py#L43-L54 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/slim/python/slim/nets/alexnet.py | python | alexnet_v2 | (inputs,
num_classes=1000,
dropout_keep_prob=0.5,
is_training=True,
spatial_squeeze=True,
scope='alexnet_v2') | AlexNet version 2.
Described in: http://arxiv.org/pdf/1404.5997v2.pdf
Parameters from:
github.com/akrizhevsky/cuda-convnet2/blob/master/layers/
layers-imagenet-1gpu.cfg
Note: All the fully_connected layers have been transformed to conv2d layers.
To use in classification mode, resize input to 224x224... | AlexNet version 2. | [
"AlexNet",
"version",
"2",
"."
] | def alexnet_v2(inputs,
num_classes=1000,
dropout_keep_prob=0.5,
is_training=True,
spatial_squeeze=True,
scope='alexnet_v2'):
"""AlexNet version 2.
Described in: http://arxiv.org/pdf/1404.5997v2.pdf
Parameters from:
github.com/akrizhevsk... | [
"def",
"alexnet_v2",
"(",
"inputs",
",",
"num_classes",
"=",
"1000",
",",
"dropout_keep_prob",
"=",
"0.5",
",",
"is_training",
"=",
"True",
",",
"spatial_squeeze",
"=",
"True",
",",
"scope",
"=",
"'alexnet_v2'",
")",
":",
"with",
"tf",
".",
"variable_op_scop... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/slim/python/slim/nets/alexnet.py#L51-L120 | ||
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | ThirdParty/cinema/paraview/tpl/cinema_python/database/file_store.py | python | FileStore.load | (self) | loads an existing filestore | loads an existing filestore | [
"loads",
"an",
"existing",
"filestore"
] | def load(self):
"""loads an existing filestore"""
super(FileStore, self).load()
with open(self.__dbfilename, mode="r") as file:
info_json = json.load(file)
if 'arguments' in info_json:
self._set_parameter_list(info_json['arguments'])
elif 'para... | [
"def",
"load",
"(",
"self",
")",
":",
"super",
"(",
"FileStore",
",",
"self",
")",
".",
"load",
"(",
")",
"with",
"open",
"(",
"self",
".",
"__dbfilename",
",",
"mode",
"=",
"\"r\"",
")",
"as",
"file",
":",
"info_json",
"=",
"json",
".",
"load",
... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/ThirdParty/cinema/paraview/tpl/cinema_python/database/file_store.py#L45-L64 | ||
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | xmlNode.freeNodeList | (self) | Free a node and all its siblings, this is a recursive
behaviour, all the children are freed too. | Free a node and all its siblings, this is a recursive
behaviour, all the children are freed too. | [
"Free",
"a",
"node",
"and",
"all",
"its",
"siblings",
"this",
"is",
"a",
"recursive",
"behaviour",
"all",
"the",
"children",
"are",
"freed",
"too",
"."
] | def freeNodeList(self):
"""Free a node and all its siblings, this is a recursive
behaviour, all the children are freed too. """
libxml2mod.xmlFreeNodeList(self._o) | [
"def",
"freeNodeList",
"(",
"self",
")",
":",
"libxml2mod",
".",
"xmlFreeNodeList",
"(",
"self",
".",
"_o",
")"
] | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L3184-L3187 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Environment.py | python | Base._update | (self, dict) | Update an environment's values directly, bypassing the normal
checks that occur when users try to set items. | Update an environment's values directly, bypassing the normal
checks that occur when users try to set items. | [
"Update",
"an",
"environment",
"s",
"values",
"directly",
"bypassing",
"the",
"normal",
"checks",
"that",
"occur",
"when",
"users",
"try",
"to",
"set",
"items",
"."
] | def _update(self, dict):
"""Update an environment's values directly, bypassing the normal
checks that occur when users try to set items.
"""
self._dict.update(dict) | [
"def",
"_update",
"(",
"self",
",",
"dict",
")",
":",
"self",
".",
"_dict",
".",
"update",
"(",
"dict",
")"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Environment.py#L1127-L1131 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/layers/python/layers/regularizers.py | python | l1_l2_regularizer | (scale_l1=1.0, scale_l2=1.0, scope=None) | return sum_regularizer([l1_regularizer(scale_l1),
l2_regularizer(scale_l2)],
scope=scope) | Returns a function that can be used to apply L1 L2 regularizations.
Args:
scale_l1: A scalar multiplier `Tensor` for L1 regularization.
scale_l2: A scalar multiplier `Tensor` for L2 regularization.
scope: An optional scope name.
Returns:
A function with signature `l1_l2(weights)` that applies a we... | Returns a function that can be used to apply L1 L2 regularizations. | [
"Returns",
"a",
"function",
"that",
"can",
"be",
"used",
"to",
"apply",
"L1",
"L2",
"regularizations",
"."
] | def l1_l2_regularizer(scale_l1=1.0, scale_l2=1.0, scope=None):
"""Returns a function that can be used to apply L1 L2 regularizations.
Args:
scale_l1: A scalar multiplier `Tensor` for L1 regularization.
scale_l2: A scalar multiplier `Tensor` for L2 regularization.
scope: An optional scope name.
Retur... | [
"def",
"l1_l2_regularizer",
"(",
"scale_l1",
"=",
"1.0",
",",
"scale_l2",
"=",
"1.0",
",",
"scope",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"scale_l1",
",",
"numbers",
".",
"Integral",
")",
":",
"raise",
"ValueError",
"(",
"'scale_l1 cannot be an int... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/layers/python/layers/regularizers.py#L112-L138 | |
Komnomnomnom/swigibpy | cfd307fdbfaffabc69a2dc037538d7e34a8b8daf | swigibpy.py | python | SwigPyIterator.advance | (self, n) | return _swigibpy.SwigPyIterator_advance(self, n) | advance(SwigPyIterator self, ptrdiff_t n) -> SwigPyIterator | advance(SwigPyIterator self, ptrdiff_t n) -> SwigPyIterator | [
"advance",
"(",
"SwigPyIterator",
"self",
"ptrdiff_t",
"n",
")",
"-",
">",
"SwigPyIterator"
] | def advance(self, n):
"""advance(SwigPyIterator self, ptrdiff_t n) -> SwigPyIterator"""
return _swigibpy.SwigPyIterator_advance(self, n) | [
"def",
"advance",
"(",
"self",
",",
"n",
")",
":",
"return",
"_swigibpy",
".",
"SwigPyIterator_advance",
"(",
"self",
",",
"n",
")"
] | https://github.com/Komnomnomnom/swigibpy/blob/cfd307fdbfaffabc69a2dc037538d7e34a8b8daf/swigibpy.py#L178-L180 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/compiler-rt/lib/sanitizer_common/scripts/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/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L577-L579 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/signal/windows.py | python | bohman | (M, sym=True) | return _truncate(w, needs_trunc) | Return a Bohman window.
Parameters
----------
M : int
Number of points in the output window. If zero or less, an empty
array is returned.
sym : bool, optional
When True (default), generates a symmetric window, for use in filter
design.
When False, generates a per... | Return a Bohman window. | [
"Return",
"a",
"Bohman",
"window",
"."
] | def bohman(M, sym=True):
"""Return a Bohman window.
Parameters
----------
M : int
Number of points in the output window. If zero or less, an empty
array is returned.
sym : bool, optional
When True (default), generates a symmetric window, for use in filter
design.
... | [
"def",
"bohman",
"(",
"M",
",",
"sym",
"=",
"True",
")",
":",
"if",
"_len_guards",
"(",
"M",
")",
":",
"return",
"np",
".",
"ones",
"(",
"M",
")",
"M",
",",
"needs_trunc",
"=",
"_extend",
"(",
"M",
",",
"sym",
")",
"fac",
"=",
"np",
".",
"abs... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/signal/windows.py#L301-L353 | |
quarkslab/arybo | 89d9a4266fa51c1a560f6c4a66f65d1ffde5f093 | arybo/lib/mba_if.py | python | simplify | (e) | return __call_impl_func(simplify_vec, e) | Simplify the expression or variable e. | Simplify the expression or variable e. | [
"Simplify",
"the",
"expression",
"or",
"variable",
"e",
"."
] | def simplify(e):
''' Simplify the expression or variable e. '''
return __call_impl_func(simplify_vec, e) | [
"def",
"simplify",
"(",
"e",
")",
":",
"return",
"__call_impl_func",
"(",
"simplify_vec",
",",
"e",
")"
] | https://github.com/quarkslab/arybo/blob/89d9a4266fa51c1a560f6c4a66f65d1ffde5f093/arybo/lib/mba_if.py#L60-L62 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBSourceManager.__init__ | (self, *args) | __init__(self, SBSourceManager rhs) -> SBSourceManager | __init__(self, SBSourceManager rhs) -> SBSourceManager | [
"__init__",
"(",
"self",
"SBSourceManager",
"rhs",
")",
"-",
">",
"SBSourceManager"
] | def __init__(self, *args):
"""__init__(self, SBSourceManager rhs) -> SBSourceManager"""
this = _lldb.new_SBSourceManager(*args)
try: self.this.append(this)
except: self.this = this | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
")",
":",
"this",
"=",
"_lldb",
".",
"new_SBSourceManager",
"(",
"*",
"args",
")",
"try",
":",
"self",
".",
"this",
".",
"append",
"(",
"this",
")",
"except",
":",
"self",
".",
"this",
"=",
"this"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L7848-L7852 | ||
deepmodeling/deepmd-kit | 159e45d248b0429844fb6a8cb3b3a201987c8d79 | deepmd/env.py | python | get_tf_default_nthreads | () | return int(os.environ.get("TF_INTRA_OP_PARALLELISM_THREADS", "0")), int(
os.environ.get("TF_INTER_OP_PARALLELISM_THREADS", "0")
) | Get TF paralellism settings.
Returns
-------
Tuple[int, int]
number of `TF_INTRA_OP_PARALLELISM_THREADS` and
`TF_INTER_OP_PARALLELISM_THREADS` | Get TF paralellism settings. | [
"Get",
"TF",
"paralellism",
"settings",
"."
] | def get_tf_default_nthreads() -> Tuple[int, int]:
"""Get TF paralellism settings.
Returns
-------
Tuple[int, int]
number of `TF_INTRA_OP_PARALLELISM_THREADS` and
`TF_INTER_OP_PARALLELISM_THREADS`
"""
return int(os.environ.get("TF_INTRA_OP_PARALLELISM_THREADS", "0")), int(
... | [
"def",
"get_tf_default_nthreads",
"(",
")",
"->",
"Tuple",
"[",
"int",
",",
"int",
"]",
":",
"return",
"int",
"(",
"os",
".",
"environ",
".",
"get",
"(",
"\"TF_INTRA_OP_PARALLELISM_THREADS\"",
",",
"\"0\"",
")",
")",
",",
"int",
"(",
"os",
".",
"environ"... | https://github.com/deepmodeling/deepmd-kit/blob/159e45d248b0429844fb6a8cb3b3a201987c8d79/deepmd/env.py#L97-L108 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py | python | withClass | (classname, namespace='') | return withAttribute(**{classattr : classname}) | Simplified version of C{L{withAttribute}} when matching on a div class - made
difficult because C{class} is a reserved word in Python.
Example::
html = '''
<div>
Some text
<div class="grid">1 4 0 1 0</div>
<div class="graph">1,3 2,3 1,1</div>
... | Simplified version of C{L{withAttribute}} when matching on a div class - made
difficult because C{class} is a reserved word in Python. | [
"Simplified",
"version",
"of",
"C",
"{",
"L",
"{",
"withAttribute",
"}}",
"when",
"matching",
"on",
"a",
"div",
"class",
"-",
"made",
"difficult",
"because",
"C",
"{",
"class",
"}",
"is",
"a",
"reserved",
"word",
"in",
"Python",
"."
] | def withClass(classname, namespace=''):
"""
Simplified version of C{L{withAttribute}} when matching on a div class - made
difficult because C{class} is a reserved word in Python.
Example::
html = '''
<div>
Some text
<div class="grid">1 4 0 1 0</div>
... | [
"def",
"withClass",
"(",
"classname",
",",
"namespace",
"=",
"''",
")",
":",
"classattr",
"=",
"\"%s:class\"",
"%",
"namespace",
"if",
"namespace",
"else",
"\"class\"",
"return",
"withAttribute",
"(",
"*",
"*",
"{",
"classattr",
":",
"classname",
"}",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py#L4997-L5030 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | readerForDoc | (cur, URL, encoding, options) | return xmlTextReader(_obj=ret) | Create an xmltextReader for an XML in-memory document. The
parsing flags @options are a combination of xmlParserOption. | Create an xmltextReader for an XML in-memory document. The
parsing flags | [
"Create",
"an",
"xmltextReader",
"for",
"an",
"XML",
"in",
"-",
"memory",
"document",
".",
"The",
"parsing",
"flags"
] | def readerForDoc(cur, URL, encoding, options):
"""Create an xmltextReader for an XML in-memory document. The
parsing flags @options are a combination of xmlParserOption. """
ret = libxml2mod.xmlReaderForDoc(cur, URL, encoding, options)
if ret is None:raise treeError('xmlReaderForDoc() failed')
ret... | [
"def",
"readerForDoc",
"(",
"cur",
",",
"URL",
",",
"encoding",
",",
"options",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlReaderForDoc",
"(",
"cur",
",",
"URL",
",",
"encoding",
",",
"options",
")",
"if",
"ret",
"is",
"None",
":",
"raise",
"treeErro... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L1950-L1955 | |
generalized-intelligence/GAAS | 29ab17d3e8a4ba18edef3a57c36d8db6329fac73 | deprecated/algorithms/sfm/OpenSfM/opensfm/io.py | python | point_to_json | (point) | return {
'color': list(point.color),
'coordinates': list(point.coordinates),
'reprojection_error': point.reprojection_error
} | Write a point to a json object | Write a point to a json object | [
"Write",
"a",
"point",
"to",
"a",
"json",
"object"
] | def point_to_json(point):
"""
Write a point to a json object
"""
return {
'color': list(point.color),
'coordinates': list(point.coordinates),
'reprojection_error': point.reprojection_error
} | [
"def",
"point_to_json",
"(",
"point",
")",
":",
"return",
"{",
"'color'",
":",
"list",
"(",
"point",
".",
"color",
")",
",",
"'coordinates'",
":",
"list",
"(",
"point",
".",
"coordinates",
")",
",",
"'reprojection_error'",
":",
"point",
".",
"reprojection_... | https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/deprecated/algorithms/sfm/OpenSfM/opensfm/io.py#L297-L305 | |
apiaryio/snowcrash | b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3 | tools/gyp/tools/pretty_gyp.py | python | split_double_braces | (input) | return output | Masks out the quotes and comments, and then splits appropriate
lines (lines that matche the double_*_brace re's above) before
indenting them below.
These are used to split lines which have multiple braces on them, so
that the indentation looks prettier when all laid out (e.g. closing
braces make a nice diago... | Masks out the quotes and comments, and then splits appropriate
lines (lines that matche the double_*_brace re's above) before
indenting them below. | [
"Masks",
"out",
"the",
"quotes",
"and",
"comments",
"and",
"then",
"splits",
"appropriate",
"lines",
"(",
"lines",
"that",
"matche",
"the",
"double_",
"*",
"_brace",
"re",
"s",
"above",
")",
"before",
"indenting",
"them",
"below",
"."
] | def split_double_braces(input):
"""Masks out the quotes and comments, and then splits appropriate
lines (lines that matche the double_*_brace re's above) before
indenting them below.
These are used to split lines which have multiple braces on them, so
that the indentation looks prettier when all laid out (e.... | [
"def",
"split_double_braces",
"(",
"input",
")",
":",
"double_open_brace_re",
"=",
"re",
".",
"compile",
"(",
"r'(.*?[\\[\\{\\(,])(\\s*)([\\[\\{\\(])'",
")",
"double_close_brace_re",
"=",
"re",
".",
"compile",
"(",
"r'(.*?[\\]\\}\\)],?)(\\s*)([\\]\\}\\)])'",
")",
"masked_... | https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/tools/pretty_gyp.py#L62-L80 | |
epam/Indigo | 30e40b4b1eb9bae0207435a26cfcb81ddcc42be1 | api/python/indigo/__init__.py | python | IndigoObject.iterateMatches | (self, query) | return self.dispatcher.IndigoObject(
self.dispatcher,
self.dispatcher._checkResult(
Indigo._lib.indigoIterateMatches(self.id, query.id)
),
) | Matcher method returns matches iterator
Args:
query (IndigoObject): query structure
Returns:
IndigoObject: matches iterator | Matcher method returns matches iterator | [
"Matcher",
"method",
"returns",
"matches",
"iterator"
] | def iterateMatches(self, query):
"""Matcher method returns matches iterator
Args:
query (IndigoObject): query structure
Returns:
IndigoObject: matches iterator
"""
self.dispatcher._setSessionId()
return self.dispatcher.IndigoObject(
s... | [
"def",
"iterateMatches",
"(",
"self",
",",
"query",
")",
":",
"self",
".",
"dispatcher",
".",
"_setSessionId",
"(",
")",
"return",
"self",
".",
"dispatcher",
".",
"IndigoObject",
"(",
"self",
".",
"dispatcher",
",",
"self",
".",
"dispatcher",
".",
"_checkR... | https://github.com/epam/Indigo/blob/30e40b4b1eb9bae0207435a26cfcb81ddcc42be1/api/python/indigo/__init__.py#L3896-L3911 | |
cocos-creator/engine-native | 984c4c9f5838253313b44ccd429bd8fac4ec8a6a | tools/bindings-generator/clang/cindex.py | python | CursorKind.is_unexposed | (self) | return conf.lib.clang_isUnexposed(self) | Test if this is an unexposed kind. | Test if this is an unexposed kind. | [
"Test",
"if",
"this",
"is",
"an",
"unexposed",
"kind",
"."
] | def is_unexposed(self):
"""Test if this is an unexposed kind."""
return conf.lib.clang_isUnexposed(self) | [
"def",
"is_unexposed",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_isUnexposed",
"(",
"self",
")"
] | https://github.com/cocos-creator/engine-native/blob/984c4c9f5838253313b44ccd429bd8fac4ec8a6a/tools/bindings-generator/clang/cindex.py#L703-L705 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/vcs/subversion.py | python | Subversion.export | (self, location) | Export the svn repository at the url to the destination location | Export the svn repository at the url to the destination location | [
"Export",
"the",
"svn",
"repository",
"at",
"the",
"url",
"to",
"the",
"destination",
"location"
] | def export(self, location):
"""Export the svn repository at the url to the destination location"""
url, rev_options = self.get_url_rev_options(self.url)
logger.info('Exporting svn repository %s to %s', url, location)
with indent_log():
if os.path.exists(location):
... | [
"def",
"export",
"(",
"self",
",",
"location",
")",
":",
"url",
",",
"rev_options",
"=",
"self",
".",
"get_url_rev_options",
"(",
"self",
".",
"url",
")",
"logger",
".",
"info",
"(",
"'Exporting svn repository %s to %s'",
",",
"url",
",",
"location",
")",
... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/vcs/subversion.py#L31-L42 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/boost/boost_1_68_0/tools/build/src/build/targets.py | python | BasicTarget.construct | (self, name, source_targets, properties) | Constructs the virtual targets for this abstract targets and
the dependecy graph. Returns a tuple consisting of the properties and the list of virtual targets.
Should be overrided in derived classes. | Constructs the virtual targets for this abstract targets and
the dependecy graph. Returns a tuple consisting of the properties and the list of virtual targets.
Should be overrided in derived classes. | [
"Constructs",
"the",
"virtual",
"targets",
"for",
"this",
"abstract",
"targets",
"and",
"the",
"dependecy",
"graph",
".",
"Returns",
"a",
"tuple",
"consisting",
"of",
"the",
"properties",
"and",
"the",
"list",
"of",
"virtual",
"targets",
".",
"Should",
"be",
... | def construct (self, name, source_targets, properties):
""" Constructs the virtual targets for this abstract targets and
the dependecy graph. Returns a tuple consisting of the properties and the list of virtual targets.
Should be overrided in derived classes.
"""
raise Ba... | [
"def",
"construct",
"(",
"self",
",",
"name",
",",
"source_targets",
",",
"properties",
")",
":",
"raise",
"BaseException",
"(",
"\"method should be defined in derived classes\"",
")"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/boost/boost_1_68_0/tools/build/src/build/targets.py#L1372-L1377 | ||
francinexue/xuefu | b6ff79747a42e020588c0c0a921048e08fe4680c | api/ctpx/ctptd.py | python | CtpTd.onRtnFromBankToFutureByFuture | (self, RspTransferField) | 期货发起银行资金转期货通知 | 期货发起银行资金转期货通知 | [
"期货发起银行资金转期货通知"
] | def onRtnFromBankToFutureByFuture(self, RspTransferField):
"""期货发起银行资金转期货通知"""
pass | [
"def",
"onRtnFromBankToFutureByFuture",
"(",
"self",
",",
"RspTransferField",
")",
":",
"pass"
] | https://github.com/francinexue/xuefu/blob/b6ff79747a42e020588c0c0a921048e08fe4680c/api/ctpx/ctptd.py#L475-L477 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | PyApp.GetTraitsIfExists | (*args, **kwargs) | return _core_.PyApp_GetTraitsIfExists(*args, **kwargs) | GetTraitsIfExists() -> wxAppTraits
This function provides safer access to traits object than
wx.GetApp().GetTraits() during startup or termination when the global
application object itself may be unavailable. | GetTraitsIfExists() -> wxAppTraits | [
"GetTraitsIfExists",
"()",
"-",
">",
"wxAppTraits"
] | def GetTraitsIfExists(*args, **kwargs):
"""
GetTraitsIfExists() -> wxAppTraits
This function provides safer access to traits object than
wx.GetApp().GetTraits() during startup or termination when the global
application object itself may be unavailable.
"""
return... | [
"def",
"GetTraitsIfExists",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"PyApp_GetTraitsIfExists",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L7819-L7827 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/google_appengine_cloudstorage/cloudstorage/storage_api.py | python | StreamingBuffer.write | (self, data) | Write some bytes.
Args:
data: data to write. str.
Raises:
TypeError: if data is not of type str. | Write some bytes. | [
"Write",
"some",
"bytes",
"."
] | def write(self, data):
"""Write some bytes.
Args:
data: data to write. str.
Raises:
TypeError: if data is not of type str.
"""
self._check_open()
if not isinstance(data, str):
raise TypeError('Expected str but got %s.' % type(data))
if not data:
return
self._buf... | [
"def",
"write",
"(",
"self",
",",
"data",
")",
":",
"self",
".",
"_check_open",
"(",
")",
"if",
"not",
"isinstance",
"(",
"data",
",",
"str",
")",
":",
"raise",
"TypeError",
"(",
"'Expected str but got %s.'",
"%",
"type",
"(",
"data",
")",
")",
"if",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/google_appengine_cloudstorage/cloudstorage/storage_api.py#L683-L701 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/grid.py | python | GridCellBoolEditor_IsTrueValue | (*args, **kwargs) | return _grid.GridCellBoolEditor_IsTrueValue(*args, **kwargs) | GridCellBoolEditor_IsTrueValue(String value) -> bool | GridCellBoolEditor_IsTrueValue(String value) -> bool | [
"GridCellBoolEditor_IsTrueValue",
"(",
"String",
"value",
")",
"-",
">",
"bool"
] | def GridCellBoolEditor_IsTrueValue(*args, **kwargs):
"""GridCellBoolEditor_IsTrueValue(String value) -> bool"""
return _grid.GridCellBoolEditor_IsTrueValue(*args, **kwargs) | [
"def",
"GridCellBoolEditor_IsTrueValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridCellBoolEditor_IsTrueValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L477-L479 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | CloseEvent.SetCanVeto | (*args, **kwargs) | return _core_.CloseEvent_SetCanVeto(*args, **kwargs) | SetCanVeto(self, bool canVeto)
Sets the 'can veto' flag. | SetCanVeto(self, bool canVeto) | [
"SetCanVeto",
"(",
"self",
"bool",
"canVeto",
")"
] | def SetCanVeto(*args, **kwargs):
"""
SetCanVeto(self, bool canVeto)
Sets the 'can veto' flag.
"""
return _core_.CloseEvent_SetCanVeto(*args, **kwargs) | [
"def",
"SetCanVeto",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"CloseEvent_SetCanVeto",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L6542-L6548 | |
yyzybb537/libgo | 4af17b7c67643c4d54aa354dcc77963ea07847d0 | third_party/boost.context/tools/build/src/build/type.py | python | all_derived | (type) | return result | Returns type and all classes that derive from it, in the order of their distance from type. | Returns type and all classes that derive from it, in the order of their distance from type. | [
"Returns",
"type",
"and",
"all",
"classes",
"that",
"derive",
"from",
"it",
"in",
"the",
"order",
"of",
"their",
"distance",
"from",
"type",
"."
] | def all_derived (type):
""" Returns type and all classes that derive from it, in the order of their distance from type.
"""
assert isinstance(type, basestring)
result = [type]
for d in __types [type]['derived']:
result.extend (all_derived (d))
return result | [
"def",
"all_derived",
"(",
"type",
")",
":",
"assert",
"isinstance",
"(",
"type",
",",
"basestring",
")",
"result",
"=",
"[",
"type",
"]",
"for",
"d",
"in",
"__types",
"[",
"type",
"]",
"[",
"'derived'",
"]",
":",
"result",
".",
"extend",
"(",
"all_d... | https://github.com/yyzybb537/libgo/blob/4af17b7c67643c4d54aa354dcc77963ea07847d0/third_party/boost.context/tools/build/src/build/type.py#L187-L195 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/external/bazel_tools/third_party/py/concurrent/futures/_base.py | python | Future.exception | (self, timeout=None) | Return the exception raised by the call that the future represents.
Args:
timeout: The number of seconds to wait for the exception if the
future isn't done. If None, then there is no limit on the wait
time.
Returns:
The exception raised by the ca... | Return the exception raised by the call that the future represents. | [
"Return",
"the",
"exception",
"raised",
"by",
"the",
"call",
"that",
"the",
"future",
"represents",
"."
] | def exception(self, timeout=None):
"""Return the exception raised by the call that the future represents.
Args:
timeout: The number of seconds to wait for the exception if the
future isn't done. If None, then there is no limit on the wait
time.
Retur... | [
"def",
"exception",
"(",
"self",
",",
"timeout",
"=",
"None",
")",
":",
"with",
"self",
".",
"_condition",
":",
"if",
"self",
".",
"_state",
"in",
"[",
"CANCELLED",
",",
"CANCELLED_AND_NOTIFIED",
"]",
":",
"raise",
"CancelledError",
"(",
")",
"elif",
"se... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/external/bazel_tools/third_party/py/concurrent/futures/_base.py#L409-L440 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/client/session.py | python | BaseSession._make_callable_from_options | (self, callable_options) | return BaseSession._Callable(self, callable_options) | Returns a handle to a "callable" with the given options.
Args:
callable_options: A `CallableOptions` protocol buffer message describing
the computation that will be performed by the callable.
Returns:
A handle to the new callable. | Returns a handle to a "callable" with the given options. | [
"Returns",
"a",
"handle",
"to",
"a",
"callable",
"with",
"the",
"given",
"options",
"."
] | def _make_callable_from_options(self, callable_options):
"""Returns a handle to a "callable" with the given options.
Args:
callable_options: A `CallableOptions` protocol buffer message describing
the computation that will be performed by the callable.
Returns:
A handle to the new calla... | [
"def",
"_make_callable_from_options",
"(",
"self",
",",
"callable_options",
")",
":",
"self",
".",
"_extend_graph",
"(",
")",
"return",
"BaseSession",
".",
"_Callable",
"(",
"self",
",",
"callable_options",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/client/session.py#L1502-L1513 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/generalplotview.py | python | GeneralPlotWindow.do_export_plot | (self) | export plot
:return: | export plot
:return: | [
"export",
"plot",
":",
"return",
":"
] | def do_export_plot(self):
"""
export plot
:return:
"""
# get directory
file_name = QFileDialog.getSaveFileName(self, caption='File to save the plot',
directory=self._work_dir,
... | [
"def",
"do_export_plot",
"(",
"self",
")",
":",
"# get directory",
"file_name",
"=",
"QFileDialog",
".",
"getSaveFileName",
"(",
"self",
",",
"caption",
"=",
"'File to save the plot'",
",",
"directory",
"=",
"self",
".",
"_work_dir",
",",
"filter",
"=",
"'Data F... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/generalplotview.py#L51-L65 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py | python | GetJavaJars | (target_list, target_dicts, toplevel_dir) | Generates a sequence of all .jars used as inputs. | Generates a sequence of all .jars used as inputs. | [
"Generates",
"a",
"sequence",
"of",
"all",
".",
"jars",
"used",
"as",
"inputs",
"."
] | def GetJavaJars(target_list, target_dicts, toplevel_dir):
"""Generates a sequence of all .jars used as inputs."""
for target_name in target_list:
target = target_dicts[target_name]
for action in target.get("actions", []):
for input_ in action["inputs"]:
if os.path.spl... | [
"def",
"GetJavaJars",
"(",
"target_list",
",",
"target_dicts",
",",
"toplevel_dir",
")",
":",
"for",
"target_name",
"in",
"target_list",
":",
"target",
"=",
"target_dicts",
"[",
"target_name",
"]",
"for",
"action",
"in",
"target",
".",
"get",
"(",
"\"actions\"... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py#L409-L419 | ||
fifengine/fifengine | 4b62c42e85bec19893cef8e63e6855927cff2c47 | engine/python/fife/extensions/pychan/__init__.py | python | setupModalExecution | (mainLoop,breakFromMainLoop) | Setup the synchronous dialog execution feature.
You can enable synchronous dialog execution by
passing to functions to this function.
@param mainLoop: Function - This is regarded as the applications
main loop, which should be able to be called recursively.
It should not take no arguments and return the argument
... | Setup the synchronous dialog execution feature. | [
"Setup",
"the",
"synchronous",
"dialog",
"execution",
"feature",
"."
] | def setupModalExecution(mainLoop,breakFromMainLoop):
"""
Setup the synchronous dialog execution feature.
You can enable synchronous dialog execution by
passing to functions to this function.
@param mainLoop: Function - This is regarded as the applications
main loop, which should be able to be called recursively... | [
"def",
"setupModalExecution",
"(",
"mainLoop",
",",
"breakFromMainLoop",
")",
":",
"if",
"not",
"manager",
":",
"raise",
"InitializationError",
"(",
"\"PyChan is not initialized yet.\"",
")",
"manager",
".",
"setupModalExecution",
"(",
"mainLoop",
",",
"breakFromMainLoo... | https://github.com/fifengine/fifengine/blob/4b62c42e85bec19893cef8e63e6855927cff2c47/engine/python/fife/extensions/pychan/__init__.py#L405-L425 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/xrc.py | python | XmlResourceHandler.GetDimension | (*args, **kwargs) | return _xrc.XmlResourceHandler_GetDimension(*args, **kwargs) | GetDimension(self, String param, int defaultv=0) -> int | GetDimension(self, String param, int defaultv=0) -> int | [
"GetDimension",
"(",
"self",
"String",
"param",
"int",
"defaultv",
"=",
"0",
")",
"-",
">",
"int"
] | def GetDimension(*args, **kwargs):
"""GetDimension(self, String param, int defaultv=0) -> int"""
return _xrc.XmlResourceHandler_GetDimension(*args, **kwargs) | [
"def",
"GetDimension",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_xrc",
".",
"XmlResourceHandler_GetDimension",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/xrc.py#L691-L693 | |
gromacs/gromacs | 7dec3a3f99993cf5687a122de3e12de31c21c399 | docs/doxygen/gmxtree.py | python | File.get_used_define_files | (self) | return set(self._used_defines.keys()) | Return files like config.h whose defines are used in this file.
The return value is empty if find_define_file_uses() has not been called,
as well as for headers that declare these defines. | Return files like config.h whose defines are used in this file. | [
"Return",
"files",
"like",
"config",
".",
"h",
"whose",
"defines",
"are",
"used",
"in",
"this",
"file",
"."
] | def get_used_define_files(self):
"""Return files like config.h whose defines are used in this file.
The return value is empty if find_define_file_uses() has not been called,
as well as for headers that declare these defines."""
return set(self._used_defines.keys()) | [
"def",
"get_used_define_files",
"(",
"self",
")",
":",
"return",
"set",
"(",
"self",
".",
"_used_defines",
".",
"keys",
"(",
")",
")"
] | https://github.com/gromacs/gromacs/blob/7dec3a3f99993cf5687a122de3e12de31c21c399/docs/doxygen/gmxtree.py#L353-L358 | |
baidu/lac | 3e10dbed9bfd87bea927c84a6627a167c17b5617 | python/LAC/ahocorasick.py | python | Ahocorasick.__init__ | (self) | 初始化Ahocorasick的根节点__root | 初始化Ahocorasick的根节点__root | [
"初始化Ahocorasick的根节点__root"
] | def __init__(self):
"""初始化Ahocorasick的根节点__root"""
self.__root = Node() | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"__root",
"=",
"Node",
"(",
")"
] | https://github.com/baidu/lac/blob/3e10dbed9bfd87bea927c84a6627a167c17b5617/python/LAC/ahocorasick.py#L50-L52 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/linear_optimizer/python/sdca_estimator.py | python | SDCALinearRegressor.__init__ | (self,
example_id_column,
feature_columns,
weight_column_name=None,
model_dir=None,
l1_regularization=0.0,
l2_regularization=1.0,
num_loss_partitions=None,
config=None,
feature_engineer... | Construct a `SDCALinearRegressor` estimator object.
Args:
example_id_column: A string defining the feature column name representing
example ids. Used to initialize the underlying SDCA optimizer.
feature_columns: An iterable containing all the feature columns used by
the model. All item... | Construct a `SDCALinearRegressor` estimator object. | [
"Construct",
"a",
"SDCALinearRegressor",
"estimator",
"object",
"."
] | def __init__(self,
example_id_column,
feature_columns,
weight_column_name=None,
model_dir=None,
l1_regularization=0.0,
l2_regularization=1.0,
num_loss_partitions=None,
config=None,
feat... | [
"def",
"__init__",
"(",
"self",
",",
"example_id_column",
",",
"feature_columns",
",",
"weight_column_name",
"=",
"None",
",",
"model_dir",
"=",
"None",
",",
"l1_regularization",
"=",
"0.0",
",",
"l2_regularization",
"=",
"1.0",
",",
"num_loss_partitions",
"=",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/linear_optimizer/python/sdca_estimator.py#L468-L521 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/linalg_ops.py | python | batch_svd | (tensor, compute_uv=True, full_matrices=False, name=None) | Computes the singular value decompositions of a batch of matrices.
Computes the SVD of each inner matrix in `tensor` such that
`tensor[..., :, :] = u[..., :, :] * diag(s[..., :, :]) * transpose(v[..., :,
:])`
```prettyprint
# a is a tensor.
# s is a tensor of singular values.
# u is a tensor of left sin... | Computes the singular value decompositions of a batch of matrices. | [
"Computes",
"the",
"singular",
"value",
"decompositions",
"of",
"a",
"batch",
"of",
"matrices",
"."
] | def batch_svd(tensor, compute_uv=True, full_matrices=False, name=None):
"""Computes the singular value decompositions of a batch of matrices.
Computes the SVD of each inner matrix in `tensor` such that
`tensor[..., :, :] = u[..., :, :] * diag(s[..., :, :]) * transpose(v[..., :,
:])`
```prettyprint
# a is ... | [
"def",
"batch_svd",
"(",
"tensor",
",",
"compute_uv",
"=",
"True",
",",
"full_matrices",
"=",
"False",
",",
"name",
"=",
"None",
")",
":",
"s",
",",
"u",
",",
"v",
"=",
"gen_linalg_ops",
".",
"batch_svd",
"(",
"tensor",
",",
"compute_uv",
"=",
"compute... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/linalg_ops.py#L522-L563 | ||
larroy/clearskies_core | 3574ddf0edc8555454c7044126e786a6c29444dc | tools/gyp/pylib/gyp/generator/ninja.py | python | NinjaWriter.__init__ | (self, qualified_target, target_outputs, base_dir, build_dir,
output_file, toplevel_build, output_file_name, flavor,
toplevel_dir=None) | base_dir: path from source root to directory containing this gyp file,
by gyp semantics, all input paths are relative to this
build_dir: path from source root to build output
toplevel_dir: path to the toplevel directory | base_dir: path from source root to directory containing this gyp file,
by gyp semantics, all input paths are relative to this
build_dir: path from source root to build output
toplevel_dir: path to the toplevel directory | [
"base_dir",
":",
"path",
"from",
"source",
"root",
"to",
"directory",
"containing",
"this",
"gyp",
"file",
"by",
"gyp",
"semantics",
"all",
"input",
"paths",
"are",
"relative",
"to",
"this",
"build_dir",
":",
"path",
"from",
"source",
"root",
"to",
"build",
... | def __init__(self, qualified_target, target_outputs, base_dir, build_dir,
output_file, toplevel_build, output_file_name, flavor,
toplevel_dir=None):
"""
base_dir: path from source root to directory containing this gyp file,
by gyp semantics, all input paths are relati... | [
"def",
"__init__",
"(",
"self",
",",
"qualified_target",
",",
"target_outputs",
",",
"base_dir",
",",
"build_dir",
",",
"output_file",
",",
"toplevel_build",
",",
"output_file_name",
",",
"flavor",
",",
"toplevel_dir",
"=",
"None",
")",
":",
"self",
".",
"qual... | https://github.com/larroy/clearskies_core/blob/3574ddf0edc8555454c7044126e786a6c29444dc/tools/gyp/pylib/gyp/generator/ninja.py#L215-L250 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/animate.py | python | Animation.GetFramePosition | (*args, **kwargs) | return _animate.Animation_GetFramePosition(*args, **kwargs) | GetFramePosition(self, int frame) -> Point | GetFramePosition(self, int frame) -> Point | [
"GetFramePosition",
"(",
"self",
"int",
"frame",
")",
"-",
">",
"Point"
] | def GetFramePosition(*args, **kwargs):
"""GetFramePosition(self, int frame) -> Point"""
return _animate.Animation_GetFramePosition(*args, **kwargs) | [
"def",
"GetFramePosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_animate",
".",
"Animation_GetFramePosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/animate.py#L122-L124 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/dataflow.py | python | DataFlowAnalysis.op_SLICE_2 | (self, info, inst) | TOS = TOS1[:TOS] | TOS = TOS1[:TOS] | [
"TOS",
"=",
"TOS1",
"[",
":",
"TOS",
"]"
] | def op_SLICE_2(self, info, inst):
"""
TOS = TOS1[:TOS]
"""
tos = info.pop()
tos1 = info.pop()
res = info.make_temp()
slicevar = info.make_temp()
indexvar = info.make_temp()
nonevar = info.make_temp()
info.append(inst, base=tos1, stop=tos, r... | [
"def",
"op_SLICE_2",
"(",
"self",
",",
"info",
",",
"inst",
")",
":",
"tos",
"=",
"info",
".",
"pop",
"(",
")",
"tos1",
"=",
"info",
".",
"pop",
"(",
")",
"res",
"=",
"info",
".",
"make_temp",
"(",
")",
"slicevar",
"=",
"info",
".",
"make_temp",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/dataflow.py#L483-L495 | ||
fredakilla/GPlayEngine | ae6b45f4c68f696fcd171ce6996a5a4e80aee09e | thirdparty/freetype/src/tools/docmaker/content.py | python | ContentProcessor.reset | ( self ) | Reset the content processor for a new block. | Reset the content processor for a new block. | [
"Reset",
"the",
"content",
"processor",
"for",
"a",
"new",
"block",
"."
] | def reset( self ):
"""Reset the content processor for a new block."""
self.markups = []
self.markup = None
self.markup_lines = [] | [
"def",
"reset",
"(",
"self",
")",
":",
"self",
".",
"markups",
"=",
"[",
"]",
"self",
".",
"markup",
"=",
"None",
"self",
".",
"markup_lines",
"=",
"[",
"]"
] | https://github.com/fredakilla/GPlayEngine/blob/ae6b45f4c68f696fcd171ce6996a5a4e80aee09e/thirdparty/freetype/src/tools/docmaker/content.py#L427-L431 | ||
brave/brave-core | ceaa3de4735789d355b6fa80c21d4709e2c1d0e8 | script/lib/transifex.py | python | clean_triple_quoted_string | (val) | return val.strip() | Grit parses out first 3 and last 3 isngle quote chars if they exist. | Grit parses out first 3 and last 3 isngle quote chars if they exist. | [
"Grit",
"parses",
"out",
"first",
"3",
"and",
"last",
"3",
"isngle",
"quote",
"chars",
"if",
"they",
"exist",
"."
] | def clean_triple_quoted_string(val):
"""Grit parses out first 3 and last 3 isngle quote chars if they exist."""
val = val.strip()
if val.startswith("'''"):
val = val[3:]
if val.endswith("'''"):
val = val[:-3]
return val.strip() | [
"def",
"clean_triple_quoted_string",
"(",
"val",
")",
":",
"val",
"=",
"val",
".",
"strip",
"(",
")",
"if",
"val",
".",
"startswith",
"(",
"\"'''\"",
")",
":",
"val",
"=",
"val",
"[",
"3",
":",
"]",
"if",
"val",
".",
"endswith",
"(",
"\"'''\"",
")"... | https://github.com/brave/brave-core/blob/ceaa3de4735789d355b6fa80c21d4709e2c1d0e8/script/lib/transifex.py#L321-L328 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/vcs/git.py | python | Git.get_url_rev_and_auth | (cls, url) | return url, rev, user_pass | Prefixes stub URLs like 'user@hostname:user/repo.git' with 'ssh://'.
That's required because although they use SSH they sometimes don't
work with a ssh:// scheme (e.g. GitHub). But we need a scheme for
parsing. Hence we remove it again afterwards and return it as a stub. | [] | def get_url_rev_and_auth(cls, url):
# type: (str) -> Tuple[str, Optional[str], AuthInfo]
"""
Prefixes stub URLs like 'user@hostname:user/repo.git' with 'ssh://'.
That's required because although they use SSH they sometimes don't
work with a ssh:// scheme (e.g. GitHub). But w... | [
"def",
"get_url_rev_and_auth",
"(",
"cls",
",",
"url",
")",
":",
"# type: (str) -> Tuple[str, Optional[str], AuthInfo]",
"# Works around an apparent Git bug",
"# (see https://article.gmane.org/gmane.comp.version-control.git/146500)",
"scheme",
",",
"netloc",
",",
"path",
",",
"quer... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/vcs/git.py#L777-L839 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/unicode.py | python | _slice_span | (typingctx, sliceobj) | return sig, codegen | Compute the span from the given slice object. | Compute the span from the given slice object. | [
"Compute",
"the",
"span",
"from",
"the",
"given",
"slice",
"object",
"."
] | def _slice_span(typingctx, sliceobj):
"""Compute the span from the given slice object.
"""
sig = types.intp(sliceobj)
def codegen(context, builder, sig, args):
[slicetype] = sig.args
[sliceobj] = args
slice = context.make_helper(builder, slicetype, sliceobj)
result_size ... | [
"def",
"_slice_span",
"(",
"typingctx",
",",
"sliceobj",
")",
":",
"sig",
"=",
"types",
".",
"intp",
"(",
"sliceobj",
")",
"def",
"codegen",
"(",
"context",
",",
"builder",
",",
"sig",
",",
"args",
")",
":",
"[",
"slicetype",
"]",
"=",
"sig",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/unicode.py#L1537-L1549 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.