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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/pyserial/serial/rfc2217.py | python | Serial.ri | (self) | return bool(self.get_modem_state() & MODEMSTATE_MASK_RI) | Read terminal status line: Ring Indicator. | Read terminal status line: Ring Indicator. | [
"Read",
"terminal",
"status",
"line",
":",
"Ring",
"Indicator",
"."
] | def ri(self):
"""Read terminal status line: Ring Indicator."""
if not self.is_open:
raise portNotOpenError
return bool(self.get_modem_state() & MODEMSTATE_MASK_RI) | [
"def",
"ri",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"is_open",
":",
"raise",
"portNotOpenError",
"return",
"bool",
"(",
"self",
".",
"get_modem_state",
"(",
")",
"&",
"MODEMSTATE_MASK_RI",
")"
] | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/pyserial/serial/rfc2217.py#L707-L711 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TNEANet.IsOk | (self, ThrowExcept=True) | return _snap.TNEANet_IsOk(self, ThrowExcept) | IsOk(TNEANet self, bool const & ThrowExcept=True) -> bool
Parameters:
ThrowExcept: bool const &
IsOk(TNEANet self) -> bool
Parameters:
self: TNEANet const * | IsOk(TNEANet self, bool const & ThrowExcept=True) -> bool | [
"IsOk",
"(",
"TNEANet",
"self",
"bool",
"const",
"&",
"ThrowExcept",
"=",
"True",
")",
"-",
">",
"bool"
] | def IsOk(self, ThrowExcept=True):
"""
IsOk(TNEANet self, bool const & ThrowExcept=True) -> bool
Parameters:
ThrowExcept: bool const &
IsOk(TNEANet self) -> bool
Parameters:
self: TNEANet const *
"""
return _snap.TNEANet_IsOk(self, Throw... | [
"def",
"IsOk",
"(",
"self",
",",
"ThrowExcept",
"=",
"True",
")",
":",
"return",
"_snap",
".",
"TNEANet_IsOk",
"(",
"self",
",",
"ThrowExcept",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L22010-L22023 | |
Cisco-Talos/moflow | ed71dfb0540d9e0d7a4c72f0881b58958d573728 | BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/python_message.py | python | _AddPropertiesForRepeatedField | (field, cls) | Adds a public property for a "repeated" protocol message field. Clients
can use this property to get the value of the field, which will be either a
_RepeatedScalarFieldContainer or _RepeatedCompositeFieldContainer (see
below).
Note that when clients add values to these containers, we perform
type-checking i... | Adds a public property for a "repeated" protocol message field. Clients
can use this property to get the value of the field, which will be either a
_RepeatedScalarFieldContainer or _RepeatedCompositeFieldContainer (see
below). | [
"Adds",
"a",
"public",
"property",
"for",
"a",
"repeated",
"protocol",
"message",
"field",
".",
"Clients",
"can",
"use",
"this",
"property",
"to",
"get",
"the",
"value",
"of",
"the",
"field",
"which",
"will",
"be",
"either",
"a",
"_RepeatedScalarFieldContainer... | def _AddPropertiesForRepeatedField(field, cls):
"""Adds a public property for a "repeated" protocol message field. Clients
can use this property to get the value of the field, which will be either a
_RepeatedScalarFieldContainer or _RepeatedCompositeFieldContainer (see
below).
Note that when clients add val... | [
"def",
"_AddPropertiesForRepeatedField",
"(",
"field",
",",
"cls",
")",
":",
"proto_field_name",
"=",
"field",
".",
"name",
"property_name",
"=",
"_PropertyName",
"(",
"proto_field_name",
")",
"def",
"getter",
"(",
"self",
")",
":",
"field_value",
"=",
"self",
... | https://github.com/Cisco-Talos/moflow/blob/ed71dfb0540d9e0d7a4c72f0881b58958d573728/BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/python_message.py#L369-L410 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/json_schema_compiler/dart_generator.py | python | _Generator._GenerateGetter | (self, type_, prop) | return c | Given a Type and Property, returns the Code object for the getter for
that property.
Also adds the documentation for this property before the method. | Given a Type and Property, returns the Code object for the getter for
that property. | [
"Given",
"a",
"Type",
"and",
"Property",
"returns",
"the",
"Code",
"object",
"for",
"the",
"getter",
"for",
"that",
"property",
"."
] | def _GenerateGetter(self, type_, prop):
"""Given a Type and Property, returns the Code object for the getter for
that property.
Also adds the documentation for this property before the method.
"""
c = Code()
c.Concat(self._GenerateDocumentation(prop))
type_name = self._GetDartType(prop.typ... | [
"def",
"_GenerateGetter",
"(",
"self",
",",
"type_",
",",
"prop",
")",
":",
"c",
"=",
"Code",
"(",
")",
"c",
".",
"Concat",
"(",
"self",
".",
"_GenerateDocumentation",
"(",
"prop",
")",
")",
"type_name",
"=",
"self",
".",
"_GetDartType",
"(",
"prop",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/json_schema_compiler/dart_generator.py#L197-L242 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/index/package_finder.py | python | CandidateEvaluator._sort_key | (self, candidate) | return (
has_allowed_hash, yank_value, binary_preference, candidate.version,
build_tag, pri,
) | Function to pass as the `key` argument to a call to sorted() to sort
InstallationCandidates by preference.
Returns a tuple such that tuples sorting as greater using Python's
default comparison operator are more preferred.
The preference is as follows:
First and foremost, candi... | Function to pass as the `key` argument to a call to sorted() to sort
InstallationCandidates by preference. | [
"Function",
"to",
"pass",
"as",
"the",
"key",
"argument",
"to",
"a",
"call",
"to",
"sorted",
"()",
"to",
"sort",
"InstallationCandidates",
"by",
"preference",
"."
] | def _sort_key(self, candidate):
# type: (InstallationCandidate) -> CandidateSortingKey
"""
Function to pass as the `key` argument to a call to sorted() to sort
InstallationCandidates by preference.
Returns a tuple such that tuples sorting as greater using Python's
defaul... | [
"def",
"_sort_key",
"(",
"self",
",",
"candidate",
")",
":",
"# type: (InstallationCandidate) -> CandidateSortingKey",
"valid_tags",
"=",
"self",
".",
"_supported_tags",
"support_num",
"=",
"len",
"(",
"valid_tags",
")",
"build_tag",
"=",
"(",
")",
"# type: BuildTag",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/index/package_finder.py#L482-L540 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | GraphicsContext.SetBrush | (*args) | return _gdi_.GraphicsContext_SetBrush(*args) | SetBrush(self, GraphicsBrush brush)
SetBrush(self, Brush brush)
Sets the brush for filling | SetBrush(self, GraphicsBrush brush)
SetBrush(self, Brush brush) | [
"SetBrush",
"(",
"self",
"GraphicsBrush",
"brush",
")",
"SetBrush",
"(",
"self",
"Brush",
"brush",
")"
] | def SetBrush(*args):
"""
SetBrush(self, GraphicsBrush brush)
SetBrush(self, Brush brush)
Sets the brush for filling
"""
return _gdi_.GraphicsContext_SetBrush(*args) | [
"def",
"SetBrush",
"(",
"*",
"args",
")",
":",
"return",
"_gdi_",
".",
"GraphicsContext_SetBrush",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L6500-L6507 | |
apache/singa | 93fd9da72694e68bfe3fb29d0183a65263d238a1 | examples/cnn/autograd/xceptionnet.py | python | Xception.__init__ | (self, num_classes=1000) | Constructor
Args:
num_classes: number of classes | Constructor
Args:
num_classes: number of classes | [
"Constructor",
"Args",
":",
"num_classes",
":",
"number",
"of",
"classes"
] | def __init__(self, num_classes=1000):
""" Constructor
Args:
num_classes: number of classes
"""
super(Xception, self).__init__()
self.num_classes = num_classes
self.conv1 = layer.Conv2d(3, 32, 3, 2, 0, bias=False)
self.bn1 = layer.BatchNorm2d(32)
... | [
"def",
"__init__",
"(",
"self",
",",
"num_classes",
"=",
"1000",
")",
":",
"super",
"(",
"Xception",
",",
"self",
")",
".",
"__init__",
"(",
")",
"self",
".",
"num_classes",
"=",
"num_classes",
"self",
".",
"conv1",
"=",
"layer",
".",
"Conv2d",
"(",
... | https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/examples/cnn/autograd/xceptionnet.py#L128-L235 | ||
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Node/FS.py | python | Base.srcnode | (self) | return self | If this node is in a build path, return the node
corresponding to its source file. Otherwise, return
ourself. | If this node is in a build path, return the node
corresponding to its source file. Otherwise, return
ourself. | [
"If",
"this",
"node",
"is",
"in",
"a",
"build",
"path",
"return",
"the",
"node",
"corresponding",
"to",
"its",
"source",
"file",
".",
"Otherwise",
"return",
"ourself",
"."
] | def srcnode(self):
"""If this node is in a build path, return the node
corresponding to its source file. Otherwise, return
ourself.
"""
srcdir_list = self.dir.srcdir_list()
if srcdir_list:
srcnode = srcdir_list[0].Entry(self.name)
srcnode.must_be_... | [
"def",
"srcnode",
"(",
"self",
")",
":",
"srcdir_list",
"=",
"self",
".",
"dir",
".",
"srcdir_list",
"(",
")",
"if",
"srcdir_list",
":",
"srcnode",
"=",
"srcdir_list",
"[",
"0",
"]",
".",
"Entry",
"(",
"self",
".",
"name",
")",
"srcnode",
".",
"must_... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Node/FS.py#L776-L786 | |
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/physics/em/tdem.py | python | TDEM.plotTransients | (self, ax=None, **kwargs) | return fig, ax | Plot all transients into one window | Plot all transients into one window | [
"Plot",
"all",
"transients",
"into",
"one",
"window"
] | def plotTransients(self, ax=None, **kwargs):
"""Plot all transients into one window"""
if ax is None:
fig, ax = plt.subplots()
else:
fig = ax.get_figure()
kwargs.setdefault('marker', '.')
plotlegend = kwargs.pop('legend', True)
cols = 'rgbmcyk'
... | [
"def",
"plotTransients",
"(",
"self",
",",
"ax",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"ax",
"is",
"None",
":",
"fig",
",",
"ax",
"=",
"plt",
".",
"subplots",
"(",
")",
"else",
":",
"fig",
"=",
"ax",
".",
"get_figure",
"(",
")",... | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/physics/em/tdem.py#L369-L402 | |
xenia-project/xenia | 9b1fdac98665ac091b9660a5d0fbb259ed79e578 | third_party/google-styleguide/cpplint/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/xenia-project/xenia/blob/9b1fdac98665ac091b9660a5d0fbb259ed79e578/third_party/google-styleguide/cpplint/cpplint.py#L703-L705 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/stc.py | python | StyledTextEvent.GetPosition | (*args, **kwargs) | return _stc.StyledTextEvent_GetPosition(*args, **kwargs) | GetPosition(self) -> int | GetPosition(self) -> int | [
"GetPosition",
"(",
"self",
")",
"-",
">",
"int"
] | def GetPosition(*args, **kwargs):
"""GetPosition(self) -> int"""
return _stc.StyledTextEvent_GetPosition(*args, **kwargs) | [
"def",
"GetPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextEvent_GetPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L7122-L7124 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Text.see | (self, index) | Scroll such that the character at INDEX is visible. | Scroll such that the character at INDEX is visible. | [
"Scroll",
"such",
"that",
"the",
"character",
"at",
"INDEX",
"is",
"visible",
"."
] | def see(self, index):
"""Scroll such that the character at INDEX is visible."""
self.tk.call(self._w, 'see', index) | [
"def",
"see",
"(",
"self",
",",
"index",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'see'",
",",
"index",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py#L3097-L3099 | ||
Studio3T/robomongo | 2411cd032e2e69b968dadda13ac91ca4ef3483b0 | src/third-party/qscintilla-2.8.4/sources/Python/configure.py | python | _run_qmake | (target_config, verbose, pro_name, module_config) | Run qmake against a .pro file. target_config is the target
configuration. verbose is set if the output is to be displayed. pro_name
is the name of the .pro file. module_config is the module configuration. | Run qmake against a .pro file. target_config is the target
configuration. verbose is set if the output is to be displayed. pro_name
is the name of the .pro file. module_config is the module configuration. | [
"Run",
"qmake",
"against",
"a",
".",
"pro",
"file",
".",
"target_config",
"is",
"the",
"target",
"configuration",
".",
"verbose",
"is",
"set",
"if",
"the",
"output",
"is",
"to",
"be",
"displayed",
".",
"pro_name",
"is",
"the",
"name",
"of",
"the",
".",
... | def _run_qmake(target_config, verbose, pro_name, module_config):
""" Run qmake against a .pro file. target_config is the target
configuration. verbose is set if the output is to be displayed. pro_name
is the name of the .pro file. module_config is the module configuration.
"""
inform("Creating ... | [
"def",
"_run_qmake",
"(",
"target_config",
",",
"verbose",
",",
"pro_name",
",",
"module_config",
")",
":",
"inform",
"(",
"\"Creating the Makefile for the %s module...\"",
"%",
"module_config",
".",
"name",
")",
"# qmake doesn't behave consistently if it is not run from the ... | https://github.com/Studio3T/robomongo/blob/2411cd032e2e69b968dadda13ac91ca4ef3483b0/src/third-party/qscintilla-2.8.4/sources/Python/configure.py#L1471-L1509 | ||
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/api/settlement_api.py | python | SettlementApi.settlement_get | (self, **kwargs) | Get settlement history. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.settlement_get(async_req=True)
>>> result = thread.get()
:param async_req bool
:param str sym... | Get settlement history. # noqa: E501 | [
"Get",
"settlement",
"history",
".",
"#",
"noqa",
":",
"E501"
] | def settlement_get(self, **kwargs): # noqa: E501
"""Get settlement history. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.settlement_get(async_req=True)
>>> result = threa... | [
"def",
"settlement_get",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"# noqa: E501",
"kwargs",
"[",
"'_return_http_data_only'",
"]",
"=",
"True",
"if",
"kwargs",
".",
"get",
"(",
"'async_req'",
")",
":",
"return",
"self",
".",
"settlement_get_with_http_inf... | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/api/settlement_api.py#L36-L62 | ||
assimp/assimp | 97c7e084c2f7f8c9355ea42f73605890481bddc5 | port/PyAssimp/scripts/3d_viewer_py3.py | python | PyAssimp3DViewer.get_hovered_node | (self, mousex, mousey) | Attention: The performances of this method relies heavily on the size of the display! | Attention: The performances of this method relies heavily on the size of the display! | [
"Attention",
":",
"The",
"performances",
"of",
"this",
"method",
"relies",
"heavily",
"on",
"the",
"size",
"of",
"the",
"display!"
] | def get_hovered_node(self, mousex, mousey):
"""
Attention: The performances of this method relies heavily on the size of the display!
"""
# mouse out of the window?
if mousex < 0 or mousex >= self.w or mousey < 0 or mousey >= self.h:
return None
self.render_... | [
"def",
"get_hovered_node",
"(",
"self",
",",
"mousex",
",",
"mousey",
")",
":",
"# mouse out of the window?",
"if",
"mousex",
"<",
"0",
"or",
"mousex",
">=",
"self",
".",
"w",
"or",
"mousey",
"<",
"0",
"or",
"mousey",
">=",
"self",
".",
"h",
":",
"retu... | https://github.com/assimp/assimp/blob/97c7e084c2f7f8c9355ea42f73605890481bddc5/port/PyAssimp/scripts/3d_viewer_py3.py#L768-L793 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/eager/python/network.py | python | Network.__init__ | (self, name=None) | Configure the `Network`.
Args:
name: The name to use for this `Network`. If specified, it must be unique
in the context where this `Network` is first (1) added to another
`Network` (in which case it must not share a name with other `Layers`
added to that `Network`), or (2) built/calle... | Configure the `Network`. | [
"Configure",
"the",
"Network",
"."
] | def __init__(self, name=None):
"""Configure the `Network`.
Args:
name: The name to use for this `Network`. If specified, it must be unique
in the context where this `Network` is first (1) added to another
`Network` (in which case it must not share a name with other `Layers`
added ... | [
"def",
"__init__",
"(",
"self",
",",
"name",
"=",
"None",
")",
":",
"if",
"context",
".",
"executing_eagerly",
"(",
")",
":",
"logging",
".",
"warning",
"(",
"(",
"\"** tfe.Network is deprecated and will be removed in a future \"",
"\"version.\\n\\n%s\"",
")",
",",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/eager/python/network.py#L152-L192 | ||
qt/qt | 0a2f2382541424726168804be2c90b91381608c6 | src/3rdparty/webkit/Source/ThirdParty/gyp/pylib/gyp/generator/scons.py | python | GenerateSConscript | (output_filename, spec, build_file, build_file_data) | Generates a SConscript file for a specific target.
This generates a SConscript file suitable for building any or all of
the target's configurations.
A SConscript file may be called multiple times to generate targets for
multiple configurations. Consequently, it needs to be ready to build
the target for any... | Generates a SConscript file for a specific target. | [
"Generates",
"a",
"SConscript",
"file",
"for",
"a",
"specific",
"target",
"."
] | def GenerateSConscript(output_filename, spec, build_file, build_file_data):
"""
Generates a SConscript file for a specific target.
This generates a SConscript file suitable for building any or all of
the target's configurations.
A SConscript file may be called multiple times to generate targets for
multip... | [
"def",
"GenerateSConscript",
"(",
"output_filename",
",",
"spec",
",",
"build_file",
",",
"build_file_data",
")",
":",
"scons_target",
"=",
"SCons",
".",
"Target",
"(",
"spec",
")",
"gyp_dir",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"output_filename",
"... | https://github.com/qt/qt/blob/0a2f2382541424726168804be2c90b91381608c6/src/3rdparty/webkit/Source/ThirdParty/gyp/pylib/gyp/generator/scons.py#L251-L572 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/_app_ex.py | python | PyOnDemandOutputWindow.SetParent | (self, parent) | Set the window to be used as the popup Frame's parent. | Set the window to be used as the popup Frame's parent. | [
"Set",
"the",
"window",
"to",
"be",
"used",
"as",
"the",
"popup",
"Frame",
"s",
"parent",
"."
] | def SetParent(self, parent):
"""Set the window to be used as the popup Frame's parent."""
self.parent = parent | [
"def",
"SetParent",
"(",
"self",
",",
"parent",
")",
":",
"self",
".",
"parent",
"=",
"parent"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/_app_ex.py#L18-L20 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/response.py | python | HTTPResponse.stream | (self, amt=2**16, decode_content=None) | A generator wrapper for the read() method. A call will block until
``amt`` bytes have been read from the connection or until the
connection is closed.
:param amt:
How much of the content to read. The generator will return up to
much data per iteration, but may return les... | A generator wrapper for the read() method. A call will block until
``amt`` bytes have been read from the connection or until the
connection is closed. | [
"A",
"generator",
"wrapper",
"for",
"the",
"read",
"()",
"method",
".",
"A",
"call",
"will",
"block",
"until",
"amt",
"bytes",
"have",
"been",
"read",
"from",
"the",
"connection",
"or",
"until",
"the",
"connection",
"is",
"closed",
"."
] | def stream(self, amt=2**16, decode_content=None):
"""
A generator wrapper for the read() method. A call will block until
``amt`` bytes have been read from the connection or until the
connection is closed.
:param amt:
How much of the content to read. The generator wil... | [
"def",
"stream",
"(",
"self",
",",
"amt",
"=",
"2",
"**",
"16",
",",
"decode_content",
"=",
"None",
")",
":",
"if",
"self",
".",
"chunked",
"and",
"self",
".",
"supports_chunked_reads",
"(",
")",
":",
"for",
"line",
"in",
"self",
".",
"read_chunked",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/response.py#L415-L439 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/ma/extras.py | python | notmasked_contiguous | (a, axis=None) | return result | Find contiguous unmasked data in a masked array along the given axis.
Parameters
----------
a : array_like
The input array.
axis : int, optional
Axis along which to perform the operation.
If None (default), applies to a flattened version of the array, and this
is the sam... | Find contiguous unmasked data in a masked array along the given axis. | [
"Find",
"contiguous",
"unmasked",
"data",
"in",
"a",
"masked",
"array",
"along",
"the",
"given",
"axis",
"."
] | def notmasked_contiguous(a, axis=None):
"""
Find contiguous unmasked data in a masked array along the given axis.
Parameters
----------
a : array_like
The input array.
axis : int, optional
Axis along which to perform the operation.
If None (default), applies to a flatten... | [
"def",
"notmasked_contiguous",
"(",
"a",
",",
"axis",
"=",
"None",
")",
":",
"a",
"=",
"asarray",
"(",
"a",
")",
"nd",
"=",
"a",
".",
"ndim",
"if",
"nd",
">",
"2",
":",
"raise",
"NotImplementedError",
"(",
"\"Currently limited to atmost 2D array.\"",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/ma/extras.py#L1686-L1760 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/core/fromnumeric.py | python | argmax | (a, axis=None) | return argmax(axis) | Indices of the maximum values along an axis.
Parameters
----------
a : array_like
Input array.
axis : int, optional
By default, the index is into the flattened array, otherwise
along the specified axis.
Returns
-------
index_array : ndarray of ints
Array of ... | Indices of the maximum values along an axis. | [
"Indices",
"of",
"the",
"maximum",
"values",
"along",
"an",
"axis",
"."
] | def argmax(a, axis=None):
"""
Indices of the maximum values along an axis.
Parameters
----------
a : array_like
Input array.
axis : int, optional
By default, the index is into the flattened array, otherwise
along the specified axis.
Returns
-------
index_arr... | [
"def",
"argmax",
"(",
"a",
",",
"axis",
"=",
"None",
")",
":",
"try",
":",
"argmax",
"=",
"a",
".",
"argmax",
"except",
"AttributeError",
":",
"return",
"_wrapit",
"(",
"a",
",",
"'argmax'",
",",
"axis",
")",
"return",
"argmax",
"(",
"axis",
")"
] | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/core/fromnumeric.py#L683-L737 | |
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Wrapping/Python/paraview/smtrace.py | python | _stop_trace_internal | () | return trace | **internal** stops trace. Called by vtkSMTrace::StopTrace(). | **internal** stops trace. Called by vtkSMTrace::StopTrace(). | [
"**",
"internal",
"**",
"stops",
"trace",
".",
"Called",
"by",
"vtkSMTrace",
"::",
"StopTrace",
"()",
"."
] | def _stop_trace_internal():
"""**internal** stops trace. Called by vtkSMTrace::StopTrace()."""
if not _get_skip_rendering():
# ensure we trace the active view, so camera changes will be recorded.
Trace.get_accessor(simple.GetActiveView())
Trace.Output.append_separated([\
"#=... | [
"def",
"_stop_trace_internal",
"(",
")",
":",
"if",
"not",
"_get_skip_rendering",
"(",
")",
":",
"# ensure we trace the active view, so camera changes will be recorded.",
"Trace",
".",
"get_accessor",
"(",
"simple",
".",
"GetActiveView",
"(",
")",
")",
"Trace",
".",
"... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/smtrace.py#L1792-L1833 | |
WeitaoVan/L-GM-loss | 598582f0631bac876b3eeb8d6c4cd1d780269e03 | scripts/cpp_lint.py | python | FileInfo.FullName | (self) | return os.path.abspath(self._filename).replace('\\', '/') | Make Windows paths like Unix. | Make Windows paths like Unix. | [
"Make",
"Windows",
"paths",
"like",
"Unix",
"."
] | def FullName(self):
"""Make Windows paths like Unix."""
return os.path.abspath(self._filename).replace('\\', '/') | [
"def",
"FullName",
"(",
"self",
")",
":",
"return",
"os",
".",
"path",
".",
"abspath",
"(",
"self",
".",
"_filename",
")",
".",
"replace",
"(",
"'\\\\'",
",",
"'/'",
")"
] | https://github.com/WeitaoVan/L-GM-loss/blob/598582f0631bac876b3eeb8d6c4cd1d780269e03/scripts/cpp_lint.py#L881-L883 | |
facebook/folly | 744a0a698074d1b013813065fe60f545aa2c9b94 | build/fbcode_builder/fbcode_builder.py | python | FBCodeBuilder.set_env | (self, key, value) | Set the environment "key" to value "value" | Set the environment "key" to value "value" | [
"Set",
"the",
"environment",
"key",
"to",
"value",
"value"
] | def set_env(self, key, value):
'Set the environment "key" to value "value"'
raise NotImplementedError | [
"def",
"set_env",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/facebook/folly/blob/744a0a698074d1b013813065fe60f545aa2c9b94/build/fbcode_builder/fbcode_builder.py#L176-L178 | ||
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | .ci/openvino-onnx/watchdog/src/watchdog.py | python | Watchdog._retrieve_build_number | (self, url) | Retrieve Jenkins CI job build number from URL address coming from GitHub commit status.
:param url: URL address from GitHub commit status
:type url: String
:return: Returns build number
:rtype: int | Retrieve Jenkins CI job build number from URL address coming from GitHub commit status. | [
"Retrieve",
"Jenkins",
"CI",
"job",
"build",
"number",
"from",
"URL",
"address",
"coming",
"from",
"GitHub",
"commit",
"status",
"."
] | def _retrieve_build_number(self, url):
"""Retrieve Jenkins CI job build number from URL address coming from GitHub commit status.
:param url: URL address from GitHub commit status
:type url: String
:return: Returns build number
:rtype: in... | [
"def",
"_retrieve_build_number",
"(",
"self",
",",
"url",
")",
":",
"# Retrieve the build number from url string",
"match_obj",
"=",
"re",
".",
"search",
"(",
"'(?:/PR-[0-9]+/)([0-9]+)'",
",",
"url",
")",
"try",
":",
"number",
"=",
"int",
"(",
"match_obj",
".",
... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/.ci/openvino-onnx/watchdog/src/watchdog.py#L371-L387 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/training/saver.py | python | _GetCheckpointFilename | (save_dir, latest_filename) | return os.path.join(save_dir, latest_filename) | Returns a filename for storing the CheckpointState.
Args:
save_dir: The directory for saving and restoring checkpoints.
latest_filename: Name of the file in 'save_dir' that is used
to store the CheckpointState.
Returns:
The path of the file that contains the CheckpointState proto. | Returns a filename for storing the CheckpointState. | [
"Returns",
"a",
"filename",
"for",
"storing",
"the",
"CheckpointState",
"."
] | def _GetCheckpointFilename(save_dir, latest_filename):
"""Returns a filename for storing the CheckpointState.
Args:
save_dir: The directory for saving and restoring checkpoints.
latest_filename: Name of the file in 'save_dir' that is used
to store the CheckpointState.
Returns:
The path of the ... | [
"def",
"_GetCheckpointFilename",
"(",
"save_dir",
",",
"latest_filename",
")",
":",
"if",
"latest_filename",
"is",
"None",
":",
"latest_filename",
"=",
"\"checkpoint\"",
"return",
"os",
".",
"path",
".",
"join",
"(",
"save_dir",
",",
"latest_filename",
")"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/training/saver.py#L739-L752 | |
google/certificate-transparency | 2588562fd306a447958471b6f06c1069619c1641 | python/ct/crypto/in_memory_merkle_tree.py | python | InMemoryMerkleTree._calculate_inclusion_proof | (self, leaves, leaf_index) | return path | Merkle audit path, RFC6962 Section 2.1.1. | Merkle audit path, RFC6962 Section 2.1.1. | [
"Merkle",
"audit",
"path",
"RFC6962",
"Section",
"2",
".",
"1",
".",
"1",
"."
] | def _calculate_inclusion_proof(self, leaves, leaf_index):
"""Merkle audit path, RFC6962 Section 2.1.1."""
n = len(leaves)
if n == 0 or n == 1:
return []
k = _down_to_power_of_two(n)
m = leaf_index
if m < k:
mth_k_to_n = self.__hasher.hash_full_tre... | [
"def",
"_calculate_inclusion_proof",
"(",
"self",
",",
"leaves",
",",
"leaf_index",
")",
":",
"n",
"=",
"len",
"(",
"leaves",
")",
"if",
"n",
"==",
"0",
"or",
"n",
"==",
"1",
":",
"return",
"[",
"]",
"k",
"=",
"_down_to_power_of_two",
"(",
"n",
")",
... | https://github.com/google/certificate-transparency/blob/2588562fd306a447958471b6f06c1069619c1641/python/ct/crypto/in_memory_merkle_tree.py#L98-L114 | |
NVIDIA/TensorRT | 42805f078052daad1a98bc5965974fcffaad0960 | tools/Polygraphy/polygraphy/util/util.py | python | invoke_if_callable | (func, *args, **kwargs) | return func, False | Attempts to invoke a function with arguments. If `func` is not callable, then returns `func`
The second return value of this function indicates whether the argument was a callable. | Attempts to invoke a function with arguments. If `func` is not callable, then returns `func`
The second return value of this function indicates whether the argument was a callable. | [
"Attempts",
"to",
"invoke",
"a",
"function",
"with",
"arguments",
".",
"If",
"func",
"is",
"not",
"callable",
"then",
"returns",
"func",
"The",
"second",
"return",
"value",
"of",
"this",
"function",
"indicates",
"whether",
"the",
"argument",
"was",
"a",
"cal... | def invoke_if_callable(func, *args, **kwargs):
"""
Attempts to invoke a function with arguments. If `func` is not callable, then returns `func`
The second return value of this function indicates whether the argument was a callable.
"""
if callable(func):
ret = func(*args, **kwargs)
r... | [
"def",
"invoke_if_callable",
"(",
"func",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"callable",
"(",
"func",
")",
":",
"ret",
"=",
"func",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"return",
"ret",
",",
"True",
"return",
"f... | https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/tools/Polygraphy/polygraphy/util/util.py#L574-L582 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/pyfakefs/pyfakefs/fake_filesystem.py | python | FakeDirectory.GetEntry | (self, pathname_name) | return self.contents[pathname_name] | Retrieves the specified child file or directory.
Args:
pathname_name: basename of the child object to retrieve
Returns:
string, file contents
Raises:
KeyError: if no child exists by the specified name | Retrieves the specified child file or directory. | [
"Retrieves",
"the",
"specified",
"child",
"file",
"or",
"directory",
"."
] | def GetEntry(self, pathname_name):
"""Retrieves the specified child file or directory.
Args:
pathname_name: basename of the child object to retrieve
Returns:
string, file contents
Raises:
KeyError: if no child exists by the specified name
"""
return self.contents[pathname_name... | [
"def",
"GetEntry",
"(",
"self",
",",
"pathname_name",
")",
":",
"return",
"self",
".",
"contents",
"[",
"pathname_name",
"]"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/pyfakefs/pyfakefs/fake_filesystem.py#L306-L316 | |
Cisco-Talos/moflow | ed71dfb0540d9e0d7a4c72f0881b58958d573728 | BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/mox.py | python | MockMethod.__ne__ | (self, rhs) | return not self == rhs | Test whether this MockMethod is not equivalent to another MockMethod.
Args:
# rhs: the right hand side of the test
rhs: MockMethod | Test whether this MockMethod is not equivalent to another MockMethod. | [
"Test",
"whether",
"this",
"MockMethod",
"is",
"not",
"equivalent",
"to",
"another",
"MockMethod",
"."
] | def __ne__(self, rhs):
"""Test whether this MockMethod is not equivalent to another MockMethod.
Args:
# rhs: the right hand side of the test
rhs: MockMethod
"""
return not self == rhs | [
"def",
"__ne__",
"(",
"self",
",",
"rhs",
")",
":",
"return",
"not",
"self",
"==",
"rhs"
] | https://github.com/Cisco-Talos/moflow/blob/ed71dfb0540d9e0d7a4c72f0881b58958d573728/BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/mox.py#L635-L643 | |
mozilla/DeepSpeech | aa1d28530d531d0d92289bf5f11a49fe516fdc86 | bin/import_fisher.py | python | _split_sets | (filelist) | return (
filelist[train_beg:train_end],
filelist[dev_beg:dev_end],
filelist[test_beg:test_end],
) | randomply split the datasets into train, validation, and test sets where the size of the
validation and test sets are determined by the `get_sample_size` function. | randomply split the datasets into train, validation, and test sets where the size of the
validation and test sets are determined by the `get_sample_size` function. | [
"randomply",
"split",
"the",
"datasets",
"into",
"train",
"validation",
"and",
"test",
"sets",
"where",
"the",
"size",
"of",
"the",
"validation",
"and",
"test",
"sets",
"are",
"determined",
"by",
"the",
"get_sample_size",
"function",
"."
] | def _split_sets(filelist):
"""
randomply split the datasets into train, validation, and test sets where the size of the
validation and test sets are determined by the `get_sample_size` function.
"""
random.shuffle(filelist)
sample_size = get_sample_size(len(filelist))
train_beg = 0
tra... | [
"def",
"_split_sets",
"(",
"filelist",
")",
":",
"random",
".",
"shuffle",
"(",
"filelist",
")",
"sample_size",
"=",
"get_sample_size",
"(",
"len",
"(",
"filelist",
")",
")",
"train_beg",
"=",
"0",
"train_end",
"=",
"len",
"(",
"filelist",
")",
"-",
"2",... | https://github.com/mozilla/DeepSpeech/blob/aa1d28530d531d0d92289bf5f11a49fe516fdc86/bin/import_fisher.py#L239-L260 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/cluster/vq.py | python | _kmeans | (obs, guess, thresh=1e-5) | return code_book, prev_avg_dists[1] | "raw" version of k-means.
Returns
-------
code_book
the lowest distortion codebook found.
avg_dist
the average distance a observation is from a code in the book.
Lower means the code_book matches the data better.
See Also
--------
kmeans : wrapper around k-means
... | "raw" version of k-means. | [
"raw",
"version",
"of",
"k",
"-",
"means",
"."
] | def _kmeans(obs, guess, thresh=1e-5):
""" "raw" version of k-means.
Returns
-------
code_book
the lowest distortion codebook found.
avg_dist
the average distance a observation is from a code in the book.
Lower means the code_book matches the data better.
See Also
--... | [
"def",
"_kmeans",
"(",
"obs",
",",
"guess",
",",
"thresh",
"=",
"1e-5",
")",
":",
"code_book",
"=",
"np",
".",
"asarray",
"(",
"guess",
")",
"diff",
"=",
"np",
".",
"inf",
"prev_avg_dists",
"=",
"deque",
"(",
"[",
"diff",
"]",
",",
"maxlen",
"=",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/cluster/vq.py#L271-L317 | |
fengbingchun/NN_Test | d6305825d5273e4569ccd1eda9ffa2a9c72e18d2 | src/tiny-dnn/third_party/cpplint.py | python | ExpectingFunctionArgs | (clean_lines, linenum) | return (Match(r'^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(', line) or
(linenum >= 2 and
(Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\((?:\S+,)?\s*$',
clean_lines.elided[linenum - 1]) or
Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\(\s*$',
clean_lines.elided[... | Checks whether where function type arguments are expected.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if the line at 'linenum' is inside something that expects arguments
of function types. | Checks whether where function type arguments are expected. | [
"Checks",
"whether",
"where",
"function",
"type",
"arguments",
"are",
"expected",
"."
] | def ExpectingFunctionArgs(clean_lines, linenum):
"""Checks whether where function type arguments are expected.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if the line at 'linenum' is inside something that expects arguments
... | [
"def",
"ExpectingFunctionArgs",
"(",
"clean_lines",
",",
"linenum",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"return",
"(",
"Match",
"(",
"r'^\\s*MOCK_(CONST_)?METHOD\\d+(_T)?\\('",
",",
"line",
")",
"or",
"(",
"linenum",
">=",
... | https://github.com/fengbingchun/NN_Test/blob/d6305825d5273e4569ccd1eda9ffa2a9c72e18d2/src/tiny-dnn/third_party/cpplint.py#L5479-L5498 | |
Atarity/Lightpack | 4dee73a443cba4c4073291febe450e6c1941f3af | Software/apiexamples/liOSC/OSC.py | python | OSCServer._unsubscribe | (self, data, client_address) | Handle the actual unsubscription. the provided 'data' is concatenated together to form a
'<host>:<port>[<prefix>]' string, which is then passed to
parseUrlStr() to actually retreive <host>, <port> & <prefix>.
This 'long way 'round' approach (almost) guarantees that the unsubscription works,
regardless of h... | Handle the actual unsubscription. the provided 'data' is concatenated together to form a
'<host>:<port>[<prefix>]' string, which is then passed to
parseUrlStr() to actually retreive <host>, <port> & <prefix>.
This 'long way 'round' approach (almost) guarantees that the unsubscription works,
regardless of h... | [
"Handle",
"the",
"actual",
"unsubscription",
".",
"the",
"provided",
"data",
"is",
"concatenated",
"together",
"to",
"form",
"a",
"<host",
">",
":",
"<port",
">",
"[",
"<prefix",
">",
"]",
"string",
"which",
"is",
"then",
"passed",
"to",
"parseUrlStr",
"()... | def _unsubscribe(self, data, client_address):
"""Handle the actual unsubscription. the provided 'data' is concatenated together to form a
'<host>:<port>[<prefix>]' string, which is then passed to
parseUrlStr() to actually retreive <host>, <port> & <prefix>.
This 'long way 'round' approach (almost) guarantee... | [
"def",
"_unsubscribe",
"(",
"self",
",",
"data",
",",
"client_address",
")",
":",
"url",
"=",
"\"\"",
"have_port",
"=",
"False",
"for",
"item",
"in",
"data",
":",
"if",
"(",
"type",
"(",
"item",
")",
"==",
"types",
".",
"IntType",
")",
"and",
"not",
... | https://github.com/Atarity/Lightpack/blob/4dee73a443cba4c4073291febe450e6c1941f3af/Software/apiexamples/liOSC/OSC.py#L2156-L2197 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/graph_editor/subgraph.py | python | SubGraphView.remap_outputs_make_unique | (self) | return res | Remap the outputs so that all the tensors appears only once. | Remap the outputs so that all the tensors appears only once. | [
"Remap",
"the",
"outputs",
"so",
"that",
"all",
"the",
"tensors",
"appears",
"only",
"once",
"."
] | def remap_outputs_make_unique(self):
"""Remap the outputs so that all the tensors appears only once."""
res = copy.copy(self)
res._remap_outputs_make_unique() # pylint: disable=protected-access
return res | [
"def",
"remap_outputs_make_unique",
"(",
"self",
")",
":",
"res",
"=",
"copy",
".",
"copy",
"(",
"self",
")",
"res",
".",
"_remap_outputs_make_unique",
"(",
")",
"# pylint: disable=protected-access",
"return",
"res"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/graph_editor/subgraph.py#L293-L297 | |
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | clang/tools/scan-build-py/libscanbuild/clang.py | python | is_ctu_capable | (extdef_map_cmd) | return True | Detects if the current (or given) clang and external definition mapping
executables are CTU compatible. | Detects if the current (or given) clang and external definition mapping
executables are CTU compatible. | [
"Detects",
"if",
"the",
"current",
"(",
"or",
"given",
")",
"clang",
"and",
"external",
"definition",
"mapping",
"executables",
"are",
"CTU",
"compatible",
"."
] | def is_ctu_capable(extdef_map_cmd):
""" Detects if the current (or given) clang and external definition mapping
executables are CTU compatible. """
try:
run_command([extdef_map_cmd, '-version'])
except (OSError, subprocess.CalledProcessError):
return False
return True | [
"def",
"is_ctu_capable",
"(",
"extdef_map_cmd",
")",
":",
"try",
":",
"run_command",
"(",
"[",
"extdef_map_cmd",
",",
"'-version'",
"]",
")",
"except",
"(",
"OSError",
",",
"subprocess",
".",
"CalledProcessError",
")",
":",
"return",
"False",
"return",
"True"
... | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/clang/tools/scan-build-py/libscanbuild/clang.py#L158-L166 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/execution.py | python | Execution.last_mkt | (self) | return self._last_mkt | Gets the last_mkt of this Execution. # noqa: E501
:return: The last_mkt of this Execution. # noqa: E501
:rtype: str | Gets the last_mkt of this Execution. # noqa: E501 | [
"Gets",
"the",
"last_mkt",
"of",
"this",
"Execution",
".",
"#",
"noqa",
":",
"E501"
] | def last_mkt(self):
"""Gets the last_mkt of this Execution. # noqa: E501
:return: The last_mkt of this Execution. # noqa: E501
:rtype: str
"""
return self._last_mkt | [
"def",
"last_mkt",
"(",
"self",
")",
":",
"return",
"self",
".",
"_last_mkt"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/execution.py#L492-L499 | |
borglab/gtsam | a5bee157efce6a0563704bce6a5d188c29817f39 | gtsam/3rdparty/GeographicLib/python/geographiclib/geodesic.py | python | Geodesic.Line | (self, lat1, lon1, azi1,
caps = GeodesicCapability.STANDARD |
GeodesicCapability.DISTANCE_IN) | return GeodesicLine(self, lat1, lon1, azi1, caps) | Return a GeodesicLine object
:param lat1: latitude of the first point in degrees
:param lon1: longitude of the first point in degrees
:param azi1: azimuth at the first point in degrees
:param caps: the :ref:`capabilities <outmask>`
:return: a :class:`~geographiclib.geodesicline.GeodesicLine`
T... | Return a GeodesicLine object | [
"Return",
"a",
"GeodesicLine",
"object"
] | def Line(self, lat1, lon1, azi1,
caps = GeodesicCapability.STANDARD |
GeodesicCapability.DISTANCE_IN):
"""Return a GeodesicLine object
:param lat1: latitude of the first point in degrees
:param lon1: longitude of the first point in degrees
:param azi1: azimuth at the first point i... | [
"def",
"Line",
"(",
"self",
",",
"lat1",
",",
"lon1",
",",
"azi1",
",",
"caps",
"=",
"GeodesicCapability",
".",
"STANDARD",
"|",
"GeodesicCapability",
".",
"DISTANCE_IN",
")",
":",
"from",
"geographiclib",
".",
"geodesicline",
"import",
"GeodesicLine",
"return... | https://github.com/borglab/gtsam/blob/a5bee157efce6a0563704bce6a5d188c29817f39/gtsam/3rdparty/GeographicLib/python/geographiclib/geodesic.py#L1142-L1161 | |
tpfister/caffe-heatmap | 4db69ef53e6b8a0b3b4ebb29328b0ab3dbf67c4e | scripts/cpp_lint.py | python | CheckSpacingForFunctionCall | (filename, line, linenum, error) | Checks for the correctness of various spacing around function calls.
Args:
filename: The name of the current file.
line: The text of the line to check.
linenum: The number of the line to check.
error: The function to call with any errors found. | Checks for the correctness of various spacing around function calls. | [
"Checks",
"for",
"the",
"correctness",
"of",
"various",
"spacing",
"around",
"function",
"calls",
"."
] | def CheckSpacingForFunctionCall(filename, line, linenum, error):
"""Checks for the correctness of various spacing around function calls.
Args:
filename: The name of the current file.
line: The text of the line to check.
linenum: The number of the line to check.
error: The function to call with any ... | [
"def",
"CheckSpacingForFunctionCall",
"(",
"filename",
",",
"line",
",",
"linenum",
",",
"error",
")",
":",
"# Since function calls often occur inside if/for/while/switch",
"# expressions - which have their own, more liberal conventions - we",
"# first see if we should be looking inside ... | https://github.com/tpfister/caffe-heatmap/blob/4db69ef53e6b8a0b3b4ebb29328b0ab3dbf67c4e/scripts/cpp_lint.py#L2301-L2366 | ||
plumonito/dtslam | 5994bb9cf7a11981b830370db206bceb654c085d | 3rdparty/opencv-git/3rdparty/jinja2/parser.py | python | Parser.parse_statements | (self, end_tokens, drop_needle=False) | return result | Parse multiple statements into a list until one of the end tokens
is reached. This is used to parse the body of statements as it also
parses template data if appropriate. The parser checks first if the
current token is a colon and skips it if there is one. Then it checks
for the block... | Parse multiple statements into a list until one of the end tokens
is reached. This is used to parse the body of statements as it also
parses template data if appropriate. The parser checks first if the
current token is a colon and skips it if there is one. Then it checks
for the block... | [
"Parse",
"multiple",
"statements",
"into",
"a",
"list",
"until",
"one",
"of",
"the",
"end",
"tokens",
"is",
"reached",
".",
"This",
"is",
"used",
"to",
"parse",
"the",
"body",
"of",
"statements",
"as",
"it",
"also",
"parses",
"template",
"data",
"if",
"a... | def parse_statements(self, end_tokens, drop_needle=False):
"""Parse multiple statements into a list until one of the end tokens
is reached. This is used to parse the body of statements as it also
parses template data if appropriate. The parser checks first if the
current token is a col... | [
"def",
"parse_statements",
"(",
"self",
",",
"end_tokens",
",",
"drop_needle",
"=",
"False",
")",
":",
"# the first token may be a colon for python compatibility",
"self",
".",
"stream",
".",
"skip_if",
"(",
"'colon'",
")",
"# in the future it would be possible to add whole... | https://github.com/plumonito/dtslam/blob/5994bb9cf7a11981b830370db206bceb654c085d/3rdparty/opencv-git/3rdparty/jinja2/parser.py#L141-L166 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ebmlib/searcheng.py | python | SearchEngine.SetMatchCase | (self, case=True) | Set whether the engine will use case sensative searches
@keyword case: bool | Set whether the engine will use case sensative searches
@keyword case: bool | [
"Set",
"whether",
"the",
"engine",
"will",
"use",
"case",
"sensative",
"searches",
"@keyword",
"case",
":",
"bool"
] | def SetMatchCase(self, case=True):
"""Set whether the engine will use case sensative searches
@keyword case: bool
"""
self._matchcase = case
self._CompileRegex() | [
"def",
"SetMatchCase",
"(",
"self",
",",
"case",
"=",
"True",
")",
":",
"self",
".",
"_matchcase",
"=",
"case",
"self",
".",
"_CompileRegex",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ebmlib/searcheng.py#L378-L384 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/nn_ops.py | python | _MaxPool3DGradShape | (op) | return [orig_input_shape] | Shape function for the MaxPoolGrad op. | Shape function for the MaxPoolGrad op. | [
"Shape",
"function",
"for",
"the",
"MaxPoolGrad",
"op",
"."
] | def _MaxPool3DGradShape(op):
"""Shape function for the MaxPoolGrad op."""
orig_input_shape = op.inputs[0].get_shape().with_rank(5)
return [orig_input_shape] | [
"def",
"_MaxPool3DGradShape",
"(",
"op",
")",
":",
"orig_input_shape",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
".",
"get_shape",
"(",
")",
".",
"with_rank",
"(",
"5",
")",
"return",
"[",
"orig_input_shape",
"]"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/nn_ops.py#L1007-L1010 | |
llvm-mirror/lldb | d01083a850f577b85501a0902b52fd0930de72c7 | examples/python/mach_o.py | python | TerminalColors.italics | (self, on=True) | return '' | Enable or disable italics depending on the "on" parameter. | Enable or disable italics depending on the "on" parameter. | [
"Enable",
"or",
"disable",
"italics",
"depending",
"on",
"the",
"on",
"parameter",
"."
] | def italics(self, on=True):
'''Enable or disable italics depending on the "on" parameter.'''
if self.enabled:
if on:
return "\x1b[3m"
else:
return "\x1b[23m"
return '' | [
"def",
"italics",
"(",
"self",
",",
"on",
"=",
"True",
")",
":",
"if",
"self",
".",
"enabled",
":",
"if",
"on",
":",
"return",
"\"\\x1b[3m\"",
"else",
":",
"return",
"\"\\x1b[23m\"",
"return",
"''"
] | https://github.com/llvm-mirror/lldb/blob/d01083a850f577b85501a0902b52fd0930de72c7/examples/python/mach_o.py#L235-L242 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/input_lib.py | python | DistributedDatasetsFromFunctionV1._make_initializable_iterator | (self, shared_name=None) | return self._get_iterator() | Get an initializable iterator for DistributedDatasetsFromFunctionV1. | Get an initializable iterator for DistributedDatasetsFromFunctionV1. | [
"Get",
"an",
"initializable",
"iterator",
"for",
"DistributedDatasetsFromFunctionV1",
"."
] | def _make_initializable_iterator(self, shared_name=None):
"""Get an initializable iterator for DistributedDatasetsFromFunctionV1."""
del shared_name # Unused
# Eager mode generates already initialized iterators. Hence we cannot create
# an initializable iterator.
if context.executing_eagerly():
... | [
"def",
"_make_initializable_iterator",
"(",
"self",
",",
"shared_name",
"=",
"None",
")",
":",
"del",
"shared_name",
"# Unused",
"# Eager mode generates already initialized iterators. Hence we cannot create",
"# an initializable iterator.",
"if",
"context",
".",
"executing_eagerl... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/input_lib.py#L660-L668 | |
mandiant/flare-wmi | b0a5a094ff9ca7d7a1c4fc711dc00c74dec4b6b1 | python-cim/cim/cim.py | python | LogicalIndexStore.__init__ | (self, cim, file_path, mapping) | Args:
cim (CIM): the CIM repository
file_path (str): the file containing the index
mapping (Mapping): the page mapping | Args:
cim (CIM): the CIM repository
file_path (str): the file containing the index
mapping (Mapping): the page mapping | [
"Args",
":",
"cim",
"(",
"CIM",
")",
":",
"the",
"CIM",
"repository",
"file_path",
"(",
"str",
")",
":",
"the",
"file",
"containing",
"the",
"index",
"mapping",
"(",
"Mapping",
")",
":",
"the",
"page",
"mapping"
] | def __init__(self, cim, file_path, mapping):
"""
Args:
cim (CIM): the CIM repository
file_path (str): the file containing the index
mapping (Mapping): the page mapping
"""
super(LogicalIndexStore, self).__init__()
self._cim = cim
... | [
"def",
"__init__",
"(",
"self",
",",
"cim",
",",
"file_path",
",",
"mapping",
")",
":",
"super",
"(",
"LogicalIndexStore",
",",
"self",
")",
".",
"__init__",
"(",
")",
"self",
".",
"_cim",
"=",
"cim",
"self",
".",
"_file_path",
"=",
"file_path",
"self"... | https://github.com/mandiant/flare-wmi/blob/b0a5a094ff9ca7d7a1c4fc711dc00c74dec4b6b1/python-cim/cim/cim.py#L702-L715 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/operator.py | python | imul | (a, b) | return a | Same as a *= b. | Same as a *= b. | [
"Same",
"as",
"a",
"*",
"=",
"b",
"."
] | def imul(a, b):
"Same as a *= b."
a *= b
return a | [
"def",
"imul",
"(",
"a",
",",
"b",
")",
":",
"a",
"*=",
"b",
"return",
"a"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/operator.py#L370-L373 | |
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/core/math.py | python | symlogInv | (y, tol=1e-12, linearSpread=0) | return (10**(np.abs(y)-linearSpread/2) - 1.) * tol * np.sign(y) | Inverse symlog transformation.
.. math::
f(y) = sign(y) * (10^(abs(y)-s/2) - 1) * tol
Parameters
----------
y : iterable
array to be transformed
tol : float [None]
tolerance for minimum values to be treated zero (or linear)
linearSpread : float
define how wide ... | Inverse symlog transformation. | [
"Inverse",
"symlog",
"transformation",
"."
] | def symlogInv(y, tol=1e-12, linearSpread=0):
"""Inverse symlog transformation.
.. math::
f(y) = sign(y) * (10^(abs(y)-s/2) - 1) * tol
Parameters
----------
y : iterable
array to be transformed
tol : float [None]
tolerance for minimum values to be treated zero (or linea... | [
"def",
"symlogInv",
"(",
"y",
",",
"tol",
"=",
"1e-12",
",",
"linearSpread",
"=",
"0",
")",
":",
"return",
"(",
"10",
"**",
"(",
"np",
".",
"abs",
"(",
"y",
")",
"-",
"linearSpread",
"/",
"2",
")",
"-",
"1.",
")",
"*",
"tol",
"*",
"np",
".",
... | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/core/math.py#L46-L71 | |
intel/caffe | 3f494b442ee3f9d17a07b09ecbd5fa2bbda00836 | python/caffe/coord_map.py | python | crop | (top_from, top_to) | return L.Crop(top_from, top_to,
crop_param=dict(axis=ax + 1, # +1 for first cropping dim.
offset=list(-np.round(b).astype(int)))) | Define a Crop layer to crop a top (from) to another top (to) by
determining the coordinate mapping between the two and net spec'ing
the axis and shift parameters of the crop. | Define a Crop layer to crop a top (from) to another top (to) by
determining the coordinate mapping between the two and net spec'ing
the axis and shift parameters of the crop. | [
"Define",
"a",
"Crop",
"layer",
"to",
"crop",
"a",
"top",
"(",
"from",
")",
"to",
"another",
"top",
"(",
"to",
")",
"by",
"determining",
"the",
"coordinate",
"mapping",
"between",
"the",
"two",
"and",
"net",
"spec",
"ing",
"the",
"axis",
"and",
"shift"... | def crop(top_from, top_to):
"""
Define a Crop layer to crop a top (from) to another top (to) by
determining the coordinate mapping between the two and net spec'ing
the axis and shift parameters of the crop.
"""
ax, a, b = coord_map_from_to(top_from, top_to)
assert (a == 1).all(), 'scale mism... | [
"def",
"crop",
"(",
"top_from",
",",
"top_to",
")",
":",
"ax",
",",
"a",
",",
"b",
"=",
"coord_map_from_to",
"(",
"top_from",
",",
"top_to",
")",
"assert",
"(",
"a",
"==",
"1",
")",
".",
"all",
"(",
")",
",",
"'scale mismatch on crop (a = {})'",
".",
... | https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/python/caffe/coord_map.py#L208-L221 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/dataview.py | python | DataViewModel.ItemsDeleted | (*args, **kwargs) | return _dataview.DataViewModel_ItemsDeleted(*args, **kwargs) | ItemsDeleted(self, DataViewItem parent, DataViewItemArray items) -> bool
Call this to inform the registered notifiers that multiple items have
been deleted from the data model. | ItemsDeleted(self, DataViewItem parent, DataViewItemArray items) -> bool | [
"ItemsDeleted",
"(",
"self",
"DataViewItem",
"parent",
"DataViewItemArray",
"items",
")",
"-",
">",
"bool"
] | def ItemsDeleted(*args, **kwargs):
"""
ItemsDeleted(self, DataViewItem parent, DataViewItemArray items) -> bool
Call this to inform the registered notifiers that multiple items have
been deleted from the data model.
"""
return _dataview.DataViewModel_ItemsDeleted(*args, ... | [
"def",
"ItemsDeleted",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewModel_ItemsDeleted",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L580-L587 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/optimizer.py | python | get_updater | (optimizer) | return Updater(optimizer) | Returns a closure of the updater needed for kvstore.
Parameters
----------
optimizer: Optimizer
The optimizer.
Returns
-------
updater: function
The closure of the updater. | Returns a closure of the updater needed for kvstore. | [
"Returns",
"a",
"closure",
"of",
"the",
"updater",
"needed",
"for",
"kvstore",
"."
] | def get_updater(optimizer):
"""Returns a closure of the updater needed for kvstore.
Parameters
----------
optimizer: Optimizer
The optimizer.
Returns
-------
updater: function
The closure of the updater.
"""
return Updater(optimizer) | [
"def",
"get_updater",
"(",
"optimizer",
")",
":",
"return",
"Updater",
"(",
"optimizer",
")"
] | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/optimizer.py#L1197-L1210 | |
google/fhir | d77f57706c1a168529b0b87ca7ccb1c0113e83c2 | py/google/fhir/json_format/wrappers/_primitive_wrappers.py | python | PrimitiveWrapper.from_primitive | (cls, primitive: message.Message,
context: Context) | return result | Instantiates a new version of PrimitiveWrapper wrapping primitive.
Args:
primitive: The FHIR primitive message to wrap and validate.
context: Related primitive information to use for printing/parsing a
wrapped primitive.
Returns:
An instance of PrimitiveWrapper. | Instantiates a new version of PrimitiveWrapper wrapping primitive. | [
"Instantiates",
"a",
"new",
"version",
"of",
"PrimitiveWrapper",
"wrapping",
"primitive",
"."
] | def from_primitive(cls, primitive: message.Message,
context: Context) -> 'PrimitiveWrapper':
"""Instantiates a new version of PrimitiveWrapper wrapping primitive.
Args:
primitive: The FHIR primitive message to wrap and validate.
context: Related primitive information to use for... | [
"def",
"from_primitive",
"(",
"cls",
",",
"primitive",
":",
"message",
".",
"Message",
",",
"context",
":",
"Context",
")",
"->",
"'PrimitiveWrapper'",
":",
"result",
"=",
"cls",
"(",
"primitive",
",",
"context",
")",
"result",
".",
"validate_wrapped",
"(",
... | https://github.com/google/fhir/blob/d77f57706c1a168529b0b87ca7ccb1c0113e83c2/py/google/fhir/json_format/wrappers/_primitive_wrappers.py#L140-L154 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/ccompiler.py | python | CCompiler.runtime_library_dir_option | (self, dir) | Return the compiler option to add 'dir' to the list of
directories searched for runtime libraries. | Return the compiler option to add 'dir' to the list of
directories searched for runtime libraries. | [
"Return",
"the",
"compiler",
"option",
"to",
"add",
"dir",
"to",
"the",
"list",
"of",
"directories",
"searched",
"for",
"runtime",
"libraries",
"."
] | def runtime_library_dir_option(self, dir):
"""Return the compiler option to add 'dir' to the list of
directories searched for runtime libraries.
"""
raise NotImplementedError | [
"def",
"runtime_library_dir_option",
"(",
"self",
",",
"dir",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/ccompiler.py#L714-L718 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/copy.py | python | _keep_alive | (x, memo) | Keeps a reference to the object x in the memo.
Because we remember objects by their id, we have
to assure that possibly temporary objects are kept
alive by referencing them.
We store a reference at the id of the memo, which should
normally not be used unless someone tries to deepcopy
the memo i... | Keeps a reference to the object x in the memo. | [
"Keeps",
"a",
"reference",
"to",
"the",
"object",
"x",
"in",
"the",
"memo",
"."
] | def _keep_alive(x, memo):
"""Keeps a reference to the object x in the memo.
Because we remember objects by their id, we have
to assure that possibly temporary objects are kept
alive by referencing them.
We store a reference at the id of the memo, which should
normally not be used unless someone... | [
"def",
"_keep_alive",
"(",
"x",
",",
"memo",
")",
":",
"try",
":",
"memo",
"[",
"id",
"(",
"memo",
")",
"]",
".",
"append",
"(",
"x",
")",
"except",
"KeyError",
":",
"# aha, this is the first one :-)",
"memo",
"[",
"id",
"(",
"memo",
")",
"]",
"=",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/copy.py#L253-L267 | ||
fasiondog/hikyuu | 842751aa25283f9fdafc6f560ea262f79e67a307 | hikyuu/draw/drawplot/bokeh_draw.py | python | iplot | (
indicator,
new=True,
axes=None,
kref=None,
legend_on=False,
text_on=False,
text_color='k',
zero_on=False,
label=None,
*args,
**kwargs
) | return gcf() | 绘制indicator曲线
:param Indicator indicator: indicator实例
:param axes: 指定的坐标轴
:param new: 是否在新窗口中显示,只在没有指定axes时生效
:param kref: 参考的K线数据,以便绘制日期X坐标
:param legend_on: 是否打开图例
:param text_on: 是否在左上角显示指标名称及其参数
:param text_color: 指标名称解释文字的颜色,默认为黑... | 绘制indicator曲线
:param Indicator indicator: indicator实例
:param axes: 指定的坐标轴
:param new: 是否在新窗口中显示,只在没有指定axes时生效
:param kref: 参考的K线数据,以便绘制日期X坐标
:param legend_on: 是否打开图例
:param text_on: 是否在左上角显示指标名称及其参数
:param text_color: 指标名称解释文字的颜色,默认为黑... | [
"绘制indicator曲线",
":",
"param",
"Indicator",
"indicator",
":",
"indicator实例",
":",
"param",
"axes",
":",
"指定的坐标轴",
":",
"param",
"new",
":",
"是否在新窗口中显示,只在没有指定axes时生效",
":",
"param",
"kref",
":",
"参考的K线数据,以便绘制日期X坐标",
":",
"param",
"legend_on",
":",
"是否打开图例",
":",
... | def iplot(
indicator,
new=True,
axes=None,
kref=None,
legend_on=False,
text_on=False,
text_color='k',
zero_on=False,
label=None,
*args,
**kwargs
):
"""绘制indicator曲线
:param Indicator indicator: indicator实例
:param axes: 指定的坐标轴
:param new: ... | [
"def",
"iplot",
"(",
"indicator",
",",
"new",
"=",
"True",
",",
"axes",
"=",
"None",
",",
"kref",
"=",
"None",
",",
"legend_on",
"=",
"False",
",",
"text_on",
"=",
"False",
",",
"text_color",
"=",
"'k'",
",",
"zero_on",
"=",
"False",
",",
"label",
... | https://github.com/fasiondog/hikyuu/blob/842751aa25283f9fdafc6f560ea262f79e67a307/hikyuu/draw/drawplot/bokeh_draw.py#L232-L320 | |
keyboardio/Kaleidoscope | d59604e98b2439d108647f15be52984a6837d360 | bin/cpplint.py | python | CheckIncludeLine | (filename, clean_lines, linenum, include_state, error) | Check rules that are applicable to #include lines.
Strings on #include lines are NOT removed from elided line, to make
certain tasks easier. However, to prevent false positives, checks
applicable to #include lines in CheckLanguage must be put here.
Args:
filename: The name of the current file.
clean_l... | Check rules that are applicable to #include lines. | [
"Check",
"rules",
"that",
"are",
"applicable",
"to",
"#include",
"lines",
"."
] | def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
"""Check rules that are applicable to #include lines.
Strings on #include lines are NOT removed from elided line, to make
certain tasks easier. However, to prevent false positives, checks
applicable to #include lines in CheckLanguage m... | [
"def",
"CheckIncludeLine",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"include_state",
",",
"error",
")",
":",
"fileinfo",
"=",
"FileInfo",
"(",
"filename",
")",
"line",
"=",
"clean_lines",
".",
"lines",
"[",
"linenum",
"]",
"# \"include\" shoul... | https://github.com/keyboardio/Kaleidoscope/blob/d59604e98b2439d108647f15be52984a6837d360/bin/cpplint.py#L4768-L4843 | ||
raymondlu/super-animation-samples | 04234269112ff0dc32447f27a761dbbb00b8ba17 | samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | Diagnostic.disable_option | (self) | return conf.lib.clang_getCString(disable) | The command-line option that disables this diagnostic. | The command-line option that disables this diagnostic. | [
"The",
"command",
"-",
"line",
"option",
"that",
"disables",
"this",
"diagnostic",
"."
] | def disable_option(self):
"""The command-line option that disables this diagnostic."""
disable = _CXString()
conf.lib.clang_getDiagnosticOption(self, byref(disable))
return conf.lib.clang_getCString(disable) | [
"def",
"disable_option",
"(",
"self",
")",
":",
"disable",
"=",
"_CXString",
"(",
")",
"conf",
".",
"lib",
".",
"clang_getDiagnosticOption",
"(",
"self",
",",
"byref",
"(",
"disable",
")",
")",
"return",
"conf",
".",
"lib",
".",
"clang_getCString",
"(",
... | https://github.com/raymondlu/super-animation-samples/blob/04234269112ff0dc32447f27a761dbbb00b8ba17/samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L355-L360 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py | python | _format_number | (is_negative, intpart, fracpart, exp, spec) | return _format_align(sign, intpart+fracpart, spec) | Format a number, given the following data:
is_negative: true if the number is negative, else false
intpart: string of digits that must appear before the decimal point
fracpart: string of digits that must come after the point
exp: exponent, as an integer
spec: dictionary resulting from parsing the f... | Format a number, given the following data: | [
"Format",
"a",
"number",
"given",
"the",
"following",
"data",
":"
] | def _format_number(is_negative, intpart, fracpart, exp, spec):
"""Format a number, given the following data:
is_negative: true if the number is negative, else false
intpart: string of digits that must appear before the decimal point
fracpart: string of digits that must come after the point
exp: exp... | [
"def",
"_format_number",
"(",
"is_negative",
",",
"intpart",
",",
"fracpart",
",",
"exp",
",",
"spec",
")",
":",
"sign",
"=",
"_format_sign",
"(",
"is_negative",
",",
"spec",
")",
"if",
"fracpart",
":",
"fracpart",
"=",
"spec",
"[",
"'decimal_point'",
"]",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py#L6143-L6178 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/nn/functional.py | python | tanhshrink | (input) | return input - input.tanh() | r"""tanhshrink(input) -> Tensor
Applies element-wise, :math:`\text{Tanhshrink}(x) = x - \text{Tanh}(x)`
See :class:`~torch.nn.Tanhshrink` for more details. | r"""tanhshrink(input) -> Tensor | [
"r",
"tanhshrink",
"(",
"input",
")",
"-",
">",
"Tensor"
] | def tanhshrink(input):
r"""tanhshrink(input) -> Tensor
Applies element-wise, :math:`\text{Tanhshrink}(x) = x - \text{Tanh}(x)`
See :class:`~torch.nn.Tanhshrink` for more details.
"""
if has_torch_function_unary(input):
return handle_torch_function(tanhshrink, (input,), input)
return in... | [
"def",
"tanhshrink",
"(",
"input",
")",
":",
"if",
"has_torch_function_unary",
"(",
"input",
")",
":",
"return",
"handle_torch_function",
"(",
"tanhshrink",
",",
"(",
"input",
",",
")",
",",
"input",
")",
"return",
"input",
"-",
"input",
".",
"tanh",
"(",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/nn/functional.py#L1710-L1719 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatmenu.py | python | FMRendererXP.GetTextColourEnable | (self) | return wx.BLACK | Returns the colour used for text colour when enabled. | Returns the colour used for text colour when enabled. | [
"Returns",
"the",
"colour",
"used",
"for",
"text",
"colour",
"when",
"enabled",
"."
] | def GetTextColourEnable(self):
""" Returns the colour used for text colour when enabled. """
return wx.BLACK | [
"def",
"GetTextColourEnable",
"(",
"self",
")",
":",
"return",
"wx",
".",
"BLACK"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L1852-L1855 | |
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/pyserial/serial/tools/list_ports_windows.py | python | comports | (include_links=False) | return list(iterate_comports()) | Return a list of info objects about serial ports | Return a list of info objects about serial ports | [
"Return",
"a",
"list",
"of",
"info",
"objects",
"about",
"serial",
"ports"
] | def comports(include_links=False):
"""Return a list of info objects about serial ports"""
return list(iterate_comports()) | [
"def",
"comports",
"(",
"include_links",
"=",
"False",
")",
":",
"return",
"list",
"(",
"iterate_comports",
"(",
")",
")"
] | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/pyserial/serial/tools/list_ports_windows.py#L297-L299 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBBreakpointName.SetQueueName | (self, queue_name) | return _lldb.SBBreakpointName_SetQueueName(self, queue_name) | SetQueueName(SBBreakpointName self, char const * queue_name) | SetQueueName(SBBreakpointName self, char const * queue_name) | [
"SetQueueName",
"(",
"SBBreakpointName",
"self",
"char",
"const",
"*",
"queue_name",
")"
] | def SetQueueName(self, queue_name):
"""SetQueueName(SBBreakpointName self, char const * queue_name)"""
return _lldb.SBBreakpointName_SetQueueName(self, queue_name) | [
"def",
"SetQueueName",
"(",
"self",
",",
"queue_name",
")",
":",
"return",
"_lldb",
".",
"SBBreakpointName_SetQueueName",
"(",
"self",
",",
"queue_name",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L2289-L2291 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/plat-mac/findertools.py | python | _setwindowsize | (folder_alias, (w, h)) | return (w, h) | Set the size of a Finder window for folder to (w, h) | Set the size of a Finder window for folder to (w, h) | [
"Set",
"the",
"size",
"of",
"a",
"Finder",
"window",
"for",
"folder",
"to",
"(",
"w",
"h",
")"
] | def _setwindowsize(folder_alias, (w, h)):
"""Set the size of a Finder window for folder to (w, h)"""
finder = _getfinder()
args = {}
attrs = {}
_code = 'core'
_subcode = 'setd'
aevar00 = [w, h]
aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'),
form="alis", seld=fol... | [
"def",
"_setwindowsize",
"(",
"folder_alias",
",",
"(",
"w",
",",
"h",
")",
")",
":",
"finder",
"=",
"_getfinder",
"(",
")",
"args",
"=",
"{",
"}",
"attrs",
"=",
"{",
"}",
"_code",
"=",
"'core'",
"_subcode",
"=",
"'setd'",
"aevar00",
"=",
"[",
"w",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/findertools.py#L445-L464 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/etree/ElementTree.py | python | TreeBuilder.close | (self) | return self._last | Flush builder buffers and return toplevel document Element. | Flush builder buffers and return toplevel document Element. | [
"Flush",
"builder",
"buffers",
"and",
"return",
"toplevel",
"document",
"Element",
"."
] | def close(self):
"""Flush builder buffers and return toplevel document Element."""
assert len(self._elem) == 0, "missing end tags"
assert self._last is not None, "missing toplevel element"
return self._last | [
"def",
"close",
"(",
"self",
")",
":",
"assert",
"len",
"(",
"self",
".",
"_elem",
")",
"==",
"0",
",",
"\"missing end tags\"",
"assert",
"self",
".",
"_last",
"is",
"not",
"None",
",",
"\"missing toplevel element\"",
"return",
"self",
".",
"_last"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/etree/ElementTree.py#L1383-L1387 | |
livecode/livecode | 4606a10ea10b16d5071d0f9f263ccdd7ede8b31d | gyp/pylib/gyp/xcode_emulation.py | python | MacPrefixHeader.GetObjDependencies | (self, sources, objs, arch=None) | return result | Given a list of source files and the corresponding object files, returns
a list of (source, object, gch) tuples, where |gch| is the build-directory
relative path to the gch file each object file depends on. |compilable[i]|
has to be the source file belonging to |objs[i]|. | Given a list of source files and the corresponding object files, returns
a list of (source, object, gch) tuples, where |gch| is the build-directory
relative path to the gch file each object file depends on. |compilable[i]|
has to be the source file belonging to |objs[i]|. | [
"Given",
"a",
"list",
"of",
"source",
"files",
"and",
"the",
"corresponding",
"object",
"files",
"returns",
"a",
"list",
"of",
"(",
"source",
"object",
"gch",
")",
"tuples",
"where",
"|gch|",
"is",
"the",
"build",
"-",
"directory",
"relative",
"path",
"to"... | def GetObjDependencies(self, sources, objs, arch=None):
"""Given a list of source files and the corresponding object files, returns
a list of (source, object, gch) tuples, where |gch| is the build-directory
relative path to the gch file each object file depends on. |compilable[i]|
has to be the source ... | [
"def",
"GetObjDependencies",
"(",
"self",
",",
"sources",
",",
"objs",
",",
"arch",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"header",
"or",
"not",
"self",
".",
"compile_headers",
":",
"return",
"[",
"]",
"result",
"=",
"[",
"]",
"for",
"sour... | https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/xcode_emulation.py#L1181-L1200 | |
facebookresearch/habitat-sim | 63b6c71d9ca8adaefb140b198196f5d0ca1f1e34 | src_python/habitat_sim/utils/data/pose_extractor.py | python | PoseExtractor._compute_quat | (self, cam_normal: ndarray) | return quat_from_two_vectors(habitat_sim.geo.FRONT, cam_normal) | Rotations start from -z axis | Rotations start from -z axis | [
"Rotations",
"start",
"from",
"-",
"z",
"axis"
] | def _compute_quat(self, cam_normal: ndarray) -> quaternion:
"""Rotations start from -z axis"""
return quat_from_two_vectors(habitat_sim.geo.FRONT, cam_normal) | [
"def",
"_compute_quat",
"(",
"self",
",",
"cam_normal",
":",
"ndarray",
")",
"->",
"quaternion",
":",
"return",
"quat_from_two_vectors",
"(",
"habitat_sim",
".",
"geo",
".",
"FRONT",
",",
"cam_normal",
")"
] | https://github.com/facebookresearch/habitat-sim/blob/63b6c71d9ca8adaefb140b198196f5d0ca1f1e34/src_python/habitat_sim/utils/data/pose_extractor.py#L84-L86 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/dragscroller.py | python | DragScroller.Start | (self, pos) | Start a drag scroll operation | Start a drag scroll operation | [
"Start",
"a",
"drag",
"scroll",
"operation"
] | def Start(self, pos):
""" Start a drag scroll operation """
if not self.scrollwin:
raise Exception, 'No ScrollWindow defined'
self.pos = pos
self.scrollwin.SetCursor(wx.StockCursor(wx.CURSOR_SIZING))
if not self.scrollwin.HasCapture():
self.scroll... | [
"def",
"Start",
"(",
"self",
",",
"pos",
")",
":",
"if",
"not",
"self",
".",
"scrollwin",
":",
"raise",
"Exception",
",",
"'No ScrollWindow defined'",
"self",
".",
"pos",
"=",
"pos",
"self",
".",
"scrollwin",
".",
"SetCursor",
"(",
"wx",
".",
"StockCurso... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/dragscroller.py#L43-L55 | ||
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/ndarray/ndarray.py | python | minimum | (lhs, rhs) | return _ufunc_helper(
lhs,
rhs,
op.broadcast_minimum,
lambda x, y: x if x < y else y,
_internal._minimum_scalar,
None) | Returns element-wise minimum of the input arrays with broadcasting.
Equivalent to ``mx.nd.broadcast_minimum(lhs, rhs)``.
.. note::
If the corresponding dimensions of two arrays have the same size or one of them has size 1,
then the arrays are broadcastable to a common shape.
Parameters
... | Returns element-wise minimum of the input arrays with broadcasting. | [
"Returns",
"element",
"-",
"wise",
"minimum",
"of",
"the",
"input",
"arrays",
"with",
"broadcasting",
"."
] | def minimum(lhs, rhs):
"""Returns element-wise minimum of the input arrays with broadcasting.
Equivalent to ``mx.nd.broadcast_minimum(lhs, rhs)``.
.. note::
If the corresponding dimensions of two arrays have the same size or one of them has size 1,
then the arrays are broadcastable to a com... | [
"def",
"minimum",
"(",
"lhs",
",",
"rhs",
")",
":",
"# pylint: disable= no-member, protected-access",
"return",
"_ufunc_helper",
"(",
"lhs",
",",
"rhs",
",",
"op",
".",
"broadcast_minimum",
",",
"lambda",
"x",
",",
"y",
":",
"x",
"if",
"x",
"<",
"y",
"else... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/ndarray/ndarray.py#L2803-L2856 | |
swift/swift | 12d031cf8177fdec0137f9aa7e2912fa23c4416b | 3rdParty/SCons/scons-3.0.1/engine/SCons/Taskmaster.py | python | Task.exc_clear | (self) | Clears any recorded exception.
This also changes the "exception_raise" attribute to point
to the appropriate do-nothing method. | Clears any recorded exception. | [
"Clears",
"any",
"recorded",
"exception",
"."
] | def exc_clear(self):
"""
Clears any recorded exception.
This also changes the "exception_raise" attribute to point
to the appropriate do-nothing method.
"""
self.exception = (None, None, None)
self.exception_raise = self._no_exception_to_raise | [
"def",
"exc_clear",
"(",
"self",
")",
":",
"self",
".",
"exception",
"=",
"(",
"None",
",",
"None",
",",
"None",
")",
"self",
".",
"exception_raise",
"=",
"self",
".",
"_no_exception_to_raise"
] | https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Taskmaster.py#L511-L519 | ||
vergecurrency/verge | cc5711be0a978bcdc06c62569b129fe6ab4e4d9f | contrib/devtools/update-translations.py | python | sanitize_string | (s) | return s.replace('\n',' ') | Sanitize string for printing | Sanitize string for printing | [
"Sanitize",
"string",
"for",
"printing"
] | def sanitize_string(s):
'''Sanitize string for printing'''
return s.replace('\n',' ') | [
"def",
"sanitize_string",
"(",
"s",
")",
":",
"return",
"s",
".",
"replace",
"(",
"'\\n'",
",",
"' '",
")"
] | https://github.com/vergecurrency/verge/blob/cc5711be0a978bcdc06c62569b129fe6ab4e4d9f/contrib/devtools/update-translations.py#L80-L82 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/generic.py | python | NDFrame.__setattr__ | (self, name: str, value) | After regular attribute access, try setting the name
This allows simpler access to columns for interactive use. | After regular attribute access, try setting the name
This allows simpler access to columns for interactive use. | [
"After",
"regular",
"attribute",
"access",
"try",
"setting",
"the",
"name",
"This",
"allows",
"simpler",
"access",
"to",
"columns",
"for",
"interactive",
"use",
"."
] | def __setattr__(self, name: str, value) -> None:
"""After regular attribute access, try setting the name
This allows simpler access to columns for interactive use.
"""
# first try regular attribute access via __getattribute__, so that
# e.g. ``obj.x`` and ``obj.x = 4`` will alwa... | [
"def",
"__setattr__",
"(",
"self",
",",
"name",
":",
"str",
",",
"value",
")",
"->",
"None",
":",
"# first try regular attribute access via __getattribute__, so that",
"# e.g. ``obj.x`` and ``obj.x = 4`` will always reference/modify",
"# the same attribute.",
"try",
":",
"objec... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/generic.py#L5276-L5315 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/gslib/commands/setmeta.py | python | SetMetaCommand.RunCommand | (self) | return 0 | Command entry point for the setmeta command. | Command entry point for the setmeta command. | [
"Command",
"entry",
"point",
"for",
"the",
"setmeta",
"command",
"."
] | def RunCommand(self):
"""Command entry point for the setmeta command."""
headers = []
if self.sub_opts:
for o, a in self.sub_opts:
if o == '-h':
if 'x-goog-acl' in a or 'x-amz-acl' in a:
raise CommandException(
'gsutil setmeta no longer allows canned ACLs.... | [
"def",
"RunCommand",
"(",
"self",
")",
":",
"headers",
"=",
"[",
"]",
"if",
"self",
".",
"sub_opts",
":",
"for",
"o",
",",
"a",
"in",
"self",
".",
"sub_opts",
":",
"if",
"o",
"==",
"'-h'",
":",
"if",
"'x-goog-acl'",
"in",
"a",
"or",
"'x-amz-acl'",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/commands/setmeta.py#L152-L199 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/control_flow_ops.py | python | ControlFlowContext.Enter | (self) | Enter this control flow context. | Enter this control flow context. | [
"Enter",
"this",
"control",
"flow",
"context",
"."
] | def Enter(self):
"""Enter this control flow context."""
graph = ops.get_default_graph()
self._context_stack.append(graph._get_control_flow_context())
graph._set_control_flow_context(self) | [
"def",
"Enter",
"(",
"self",
")",
":",
"graph",
"=",
"ops",
".",
"get_default_graph",
"(",
")",
"self",
".",
"_context_stack",
".",
"append",
"(",
"graph",
".",
"_get_control_flow_context",
"(",
")",
")",
"graph",
".",
"_set_control_flow_context",
"(",
"self... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/control_flow_ops.py#L1399-L1403 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/auibook.py | python | AuiTabContainer.Render | (self, raw_dc, wnd) | Renders the tab catalog to the specified :class:`DC`.
It is a virtual function and can be overridden to provide custom drawing
capabilities.
:param `raw_dc`: a :class:`DC` device context;
:param `wnd`: an instance of :class:`Window`. | Renders the tab catalog to the specified :class:`DC`. | [
"Renders",
"the",
"tab",
"catalog",
"to",
"the",
"specified",
":",
"class",
":",
"DC",
"."
] | def Render(self, raw_dc, wnd):
"""
Renders the tab catalog to the specified :class:`DC`.
It is a virtual function and can be overridden to provide custom drawing
capabilities.
:param `raw_dc`: a :class:`DC` device context;
:param `wnd`: an instance of :class:`Window`.
... | [
"def",
"Render",
"(",
"self",
",",
"raw_dc",
",",
"wnd",
")",
":",
"if",
"not",
"raw_dc",
"or",
"not",
"raw_dc",
".",
"IsOk",
"(",
")",
":",
"return",
"dc",
"=",
"wx",
".",
"MemoryDC",
"(",
")",
"# use the same layout direction as the window DC uses to ensur... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibook.py#L1300-L1566 | ||
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/nyan/import_tree.py | python | ImportTree.get_alias_fqon | (self, fqon, namespace=None) | return tuple(sfqon) | Find the (shortened) fqon by traversing the tree to the fqon node and
then going upwards until an alias is found.
:param fqon: Object reference for which an alias should be found.
:type fqon: tuple
:param namespace: Identifier of a namespace. If this is a (nested) object,
... | Find the (shortened) fqon by traversing the tree to the fqon node and
then going upwards until an alias is found. | [
"Find",
"the",
"(",
"shortened",
")",
"fqon",
"by",
"traversing",
"the",
"tree",
"to",
"the",
"fqon",
"node",
"and",
"then",
"going",
"upwards",
"until",
"an",
"alias",
"is",
"found",
"."
] | def get_alias_fqon(self, fqon, namespace=None):
"""
Find the (shortened) fqon by traversing the tree to the fqon node and
then going upwards until an alias is found.
:param fqon: Object reference for which an alias should be found.
:type fqon: tuple
:param namespace: Ide... | [
"def",
"get_alias_fqon",
"(",
"self",
",",
"fqon",
",",
"namespace",
"=",
"None",
")",
":",
"if",
"namespace",
":",
"current_node",
"=",
"self",
".",
"root",
"if",
"len",
"(",
"namespace",
")",
"<=",
"len",
"(",
"fqon",
")",
":",
"# Check if the fqon is ... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/nyan/import_tree.py#L173-L220 | |
gamekit-developers/gamekit | 74c896af5826ebe8fb72f2911015738f38ab7bb2 | Dependencies/Source/FreeType/src/tools/docmaker/tohtml.py | python | HtmlFormatter.make_html_word | ( self, word ) | return html_quote( word ) | analyze a simple word to detect cross-references and styling | analyze a simple word to detect cross-references and styling | [
"analyze",
"a",
"simple",
"word",
"to",
"detect",
"cross",
"-",
"references",
"and",
"styling"
] | def make_html_word( self, word ):
"""analyze a simple word to detect cross-references and styling"""
# look for cross-references
m = re_crossref.match( word )
if m:
try:
name = m.group( 1 )
rest = m.group( 2 )
block = self.iden... | [
"def",
"make_html_word",
"(",
"self",
",",
"word",
")",
":",
"# look for cross-references",
"m",
"=",
"re_crossref",
".",
"match",
"(",
"word",
")",
"if",
"m",
":",
"try",
":",
"name",
"=",
"m",
".",
"group",
"(",
"1",
")",
"rest",
"=",
"m",
".",
"... | https://github.com/gamekit-developers/gamekit/blob/74c896af5826ebe8fb72f2911015738f38ab7bb2/Dependencies/Source/FreeType/src/tools/docmaker/tohtml.py#L255-L285 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/src/robotsim.py | python | PointCloud.getPoints | (self) | return _robotsim.PointCloud_getPoints(self) | r"""
getPoints(PointCloud self)
Returns a view of the points as an nx3 Numpy array. | r"""
getPoints(PointCloud self) | [
"r",
"getPoints",
"(",
"PointCloud",
"self",
")"
] | def getPoints(self) -> "void":
r"""
getPoints(PointCloud self)
Returns a view of the points as an nx3 Numpy array.
"""
return _robotsim.PointCloud_getPoints(self) | [
"def",
"getPoints",
"(",
"self",
")",
"->",
"\"void\"",
":",
"return",
"_robotsim",
".",
"PointCloud_getPoints",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L1200-L1208 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py | python | Button.flash | (self) | Flash the button.
This is accomplished by redisplaying
the button several times, alternating between active and
normal colors. At the end of the flash the button is left
in the same normal/active state as when the command was
invoked. This command is ignored if the button's stat... | Flash the button. | [
"Flash",
"the",
"button",
"."
] | def flash(self):
"""Flash the button.
This is accomplished by redisplaying
the button several times, alternating between active and
normal colors. At the end of the flash the button is left
in the same normal/active state as when the command was
invoked. This command is ... | [
"def",
"flash",
"(",
"self",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'flash'",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L2371-L2381 | ||
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/HDF5Application/python_scripts/core/xdmf.py | python | UniformGrid.__init__ | (self, name, geom, topology) | Construct the object.
Keyword arguments:
name -- the grid name (normally the element or condition name)
geom -- the XDMF Geometry (nodal coordinates, see Geometry)
topology -- the XDMF Topology (mesh connectivities, see Topology) | Construct the object. | [
"Construct",
"the",
"object",
"."
] | def __init__(self, name, geom, topology):
"""Construct the object.
Keyword arguments:
name -- the grid name (normally the element or condition name)
geom -- the XDMF Geometry (nodal coordinates, see Geometry)
topology -- the XDMF Topology (mesh connectivities, see Topology)
... | [
"def",
"__init__",
"(",
"self",
",",
"name",
",",
"geom",
",",
"topology",
")",
":",
"self",
".",
"name",
"=",
"name",
"self",
".",
"geometry",
"=",
"geom",
"self",
".",
"topology",
"=",
"topology",
"self",
".",
"attributes",
"=",
"[",
"]"
] | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/HDF5Application/python_scripts/core/xdmf.py#L483-L494 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/handlers.py | python | NTEventLogHandler.close | (self) | Clean up this handler.
You can remove the application name from the registry as a
source of event log entries. However, if you do this, you will
not be able to see the events as you intended in the Event Log
Viewer - it needs to be able to access the registry to get the
DLL name... | Clean up this handler. | [
"Clean",
"up",
"this",
"handler",
"."
] | def close(self):
"""
Clean up this handler.
You can remove the application name from the registry as a
source of event log entries. However, if you do this, you will
not be able to see the events as you intended in the Event Log
Viewer - it needs to be able to access the... | [
"def",
"close",
"(",
"self",
")",
":",
"#self._welu.RemoveSourceFromRegistry(self.appname, self.logtype)",
"logging",
".",
"Handler",
".",
"close",
"(",
"self",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/handlers.py#L1035-L1046 | ||
KLayout/klayout | d764adb1016f74d3e9cc8059cb183f5fc29b2a25 | src/pymod/distutils_src/klayout/db/pcell_declaration_helper.py | python | _PCellDeclarationHelper.coerce_parameters_impl | (self) | default implementation | default implementation | [
"default",
"implementation"
] | def coerce_parameters_impl(self):
"""
default implementation
"""
pass | [
"def",
"coerce_parameters_impl",
"(",
"self",
")",
":",
"pass"
] | https://github.com/KLayout/klayout/blob/d764adb1016f74d3e9cc8059cb183f5fc29b2a25/src/pymod/distutils_src/klayout/db/pcell_declaration_helper.py#L241-L245 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/tempfile.py | python | _candidate_tempdir_list | () | return dirlist | Generate a list of candidate temporary directories which
_get_default_tempdir will try. | Generate a list of candidate temporary directories which
_get_default_tempdir will try. | [
"Generate",
"a",
"list",
"of",
"candidate",
"temporary",
"directories",
"which",
"_get_default_tempdir",
"will",
"try",
"."
] | def _candidate_tempdir_list():
"""Generate a list of candidate temporary directories which
_get_default_tempdir will try."""
dirlist = []
# First, try the environment.
for envname in 'TMPDIR', 'TEMP', 'TMP':
dirname = _os.getenv(envname)
if dirname: dirlist.append(dirname)
# F... | [
"def",
"_candidate_tempdir_list",
"(",
")",
":",
"dirlist",
"=",
"[",
"]",
"# First, try the environment.",
"for",
"envname",
"in",
"'TMPDIR'",
",",
"'TEMP'",
",",
"'TMP'",
":",
"dirname",
"=",
"_os",
".",
"getenv",
"(",
"envname",
")",
"if",
"dirname",
":",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/tempfile.py#L148-L174 | |
avast/retdec | b9879088a5f0278508185ec645494e6c5c57a455 | scripts/type_extractor/type_extractor/header_text_filters.py | python | unify_ends_of_lines | (text) | return re.sub('\r\n|\r', '\n', text) | Converts CRLF (DOS) and CR (MacOS) to LF (UNIX).
This is needed to simplify other filtering functions (they can assume that
lines end with LF). | Converts CRLF (DOS) and CR (MacOS) to LF (UNIX). | [
"Converts",
"CRLF",
"(",
"DOS",
")",
"and",
"CR",
"(",
"MacOS",
")",
"to",
"LF",
"(",
"UNIX",
")",
"."
] | def unify_ends_of_lines(text):
"""Converts CRLF (DOS) and CR (MacOS) to LF (UNIX).
This is needed to simplify other filtering functions (they can assume that
lines end with LF).
"""
return re.sub('\r\n|\r', '\n', text) | [
"def",
"unify_ends_of_lines",
"(",
"text",
")",
":",
"return",
"re",
".",
"sub",
"(",
"'\\r\\n|\\r'",
",",
"'\\n'",
",",
"text",
")"
] | https://github.com/avast/retdec/blob/b9879088a5f0278508185ec645494e6c5c57a455/scripts/type_extractor/type_extractor/header_text_filters.py#L23-L29 | |
opengm/opengm | decdacf4caad223b0ab5478d38a855f8767a394f | src/interfaces/python/opengm/_misc.py | python | defaultAccumulator | (gm=None,operator=None) | return the default accumulator for a given gm or operator | return the default accumulator for a given gm or operator | [
"return",
"the",
"default",
"accumulator",
"for",
"a",
"given",
"gm",
"or",
"operator"
] | def defaultAccumulator(gm=None,operator=None):
"""
return the default accumulator for a given gm or operator
"""
if gm is not None:
operator=gm.operator
elif operator is None and gm is None:
raise NameError("at least a gm or an operator must be given")
if operator=='adder':
return 'm... | [
"def",
"defaultAccumulator",
"(",
"gm",
"=",
"None",
",",
"operator",
"=",
"None",
")",
":",
"if",
"gm",
"is",
"not",
"None",
":",
"operator",
"=",
"gm",
".",
"operator",
"elif",
"operator",
"is",
"None",
"and",
"gm",
"is",
"None",
":",
"raise",
"Nam... | https://github.com/opengm/opengm/blob/decdacf4caad223b0ab5478d38a855f8767a394f/src/interfaces/python/opengm/_misc.py#L1-L14 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/six.py | python | ensure_binary | (s, encoding="utf-8", errors="strict") | Coerce **s** to six.binary_type.
For Python 2:
- `unicode` -> encoded to `str`
- `str` -> `str`
For Python 3:
- `str` -> encoded to `bytes`
- `bytes` -> `bytes` | Coerce **s** to six.binary_type. | [
"Coerce",
"**",
"s",
"**",
"to",
"six",
".",
"binary_type",
"."
] | def ensure_binary(s, encoding="utf-8", errors="strict"):
"""Coerce **s** to six.binary_type.
For Python 2:
- `unicode` -> encoded to `str`
- `str` -> `str`
For Python 3:
- `str` -> encoded to `bytes`
- `bytes` -> `bytes`
"""
if isinstance(s, text_type):
return s.enc... | [
"def",
"ensure_binary",
"(",
"s",
",",
"encoding",
"=",
"\"utf-8\"",
",",
"errors",
"=",
"\"strict\"",
")",
":",
"if",
"isinstance",
"(",
"s",
",",
"text_type",
")",
":",
"return",
"s",
".",
"encode",
"(",
"encoding",
",",
"errors",
")",
"elif",
"isins... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/six.py#L920-L936 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/text/validators.py | python | check_from_file_vectors | (method) | return new_method | A wrapper that wraps a parameter checker to from_file of class Vectors. | A wrapper that wraps a parameter checker to from_file of class Vectors. | [
"A",
"wrapper",
"that",
"wraps",
"a",
"parameter",
"checker",
"to",
"from_file",
"of",
"class",
"Vectors",
"."
] | def check_from_file_vectors(method):
"""A wrapper that wraps a parameter checker to from_file of class Vectors."""
@wraps(method)
def new_method(self, *args, **kwargs):
[file_path, max_vectors], _ = parse_user_args(method, *args, **kwargs)
type_check(file_path, (str,), "file_path")
... | [
"def",
"check_from_file_vectors",
"(",
"method",
")",
":",
"@",
"wraps",
"(",
"method",
")",
"def",
"new_method",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"[",
"file_path",
",",
"max_vectors",
"]",
",",
"_",
"=",
"parse_user_ar... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/text/validators.py#L583-L598 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/peacock/ExodusViewer/plugins/VTKWindowPlugin.py | python | VTKWindowPlugin.onRemoveFilter | (self, filter_) | Removes the supplied filter from the result object. | Removes the supplied filter from the result object. | [
"Removes",
"the",
"supplied",
"filter",
"from",
"the",
"result",
"object",
"."
] | def onRemoveFilter(self, filter_):
"""
Removes the supplied filter from the result object.
"""
if self._result:
filters = self._result.getOption('filters')
if filter_ in filters:
filters.remove(filter_)
self.onResultOptionsChanged({... | [
"def",
"onRemoveFilter",
"(",
"self",
",",
"filter_",
")",
":",
"if",
"self",
".",
"_result",
":",
"filters",
"=",
"self",
".",
"_result",
".",
"getOption",
"(",
"'filters'",
")",
"if",
"filter_",
"in",
"filters",
":",
"filters",
".",
"remove",
"(",
"f... | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/ExodusViewer/plugins/VTKWindowPlugin.py#L280-L288 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/dataset/imdb.py | python | train | (word_idx) | return reader_creator(
re.compile(r"aclImdb/train/pos/.*\.txt$"),
re.compile(r"aclImdb/train/neg/.*\.txt$"), word_idx) | IMDB training set creator.
It returns a reader creator, each sample in the reader is an zero-based ID
sequence and label in [0, 1].
:param word_idx: word dictionary
:type word_idx: dict
:return: Training reader creator
:rtype: callable | IMDB training set creator. | [
"IMDB",
"training",
"set",
"creator",
"."
] | def train(word_idx):
"""
IMDB training set creator.
It returns a reader creator, each sample in the reader is an zero-based ID
sequence and label in [0, 1].
:param word_idx: word dictionary
:type word_idx: dict
:return: Training reader creator
:rtype: callable
"""
return reader... | [
"def",
"train",
"(",
"word_idx",
")",
":",
"return",
"reader_creator",
"(",
"re",
".",
"compile",
"(",
"r\"aclImdb/train/pos/.*\\.txt$\"",
")",
",",
"re",
".",
"compile",
"(",
"r\"aclImdb/train/neg/.*\\.txt$\"",
")",
",",
"word_idx",
")"
] | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/dataset/imdb.py#L108-L122 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/persist/persist_handlers.py | python | PyDate2wxDate | (date) | return wx.DateTimeFromDMY(*dmy) | Transforms a datetime.date object into a :class:`DateTime` one.
:param `date`: a `datetime.date` object. | Transforms a datetime.date object into a :class:`DateTime` one. | [
"Transforms",
"a",
"datetime",
".",
"date",
"object",
"into",
"a",
":",
"class",
":",
"DateTime",
"one",
"."
] | def PyDate2wxDate(date):
"""
Transforms a datetime.date object into a :class:`DateTime` one.
:param `date`: a `datetime.date` object.
"""
tt = date.timetuple()
dmy = (tt[2], tt[1]-1, tt[0])
return wx.DateTimeFromDMY(*dmy) | [
"def",
"PyDate2wxDate",
"(",
"date",
")",
":",
"tt",
"=",
"date",
".",
"timetuple",
"(",
")",
"dmy",
"=",
"(",
"tt",
"[",
"2",
"]",
",",
"tt",
"[",
"1",
"]",
"-",
"1",
",",
"tt",
"[",
"0",
"]",
")",
"return",
"wx",
".",
"DateTimeFromDMY",
"("... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/persist/persist_handlers.py#L50-L59 | |
papyrussolution/OpenPapyrus | bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91 | Src/OSF/LIBXML/python/libxml.py | python | parserCtxtCore.getErrorHandler | (self) | return libxml2mod.xmlParserCtxtGetErrorHandler(self._o) | Return (f,arg) as previously registered with setErrorHandler
or (None,None). | Return (f,arg) as previously registered with setErrorHandler
or (None,None). | [
"Return",
"(",
"f",
"arg",
")",
"as",
"previously",
"registered",
"with",
"setErrorHandler",
"or",
"(",
"None",
"None",
")",
"."
] | def getErrorHandler(self):
"""Return (f,arg) as previously registered with setErrorHandler
or (None,None)."""
return libxml2mod.xmlParserCtxtGetErrorHandler(self._o) | [
"def",
"getErrorHandler",
"(",
"self",
")",
":",
"return",
"libxml2mod",
".",
"xmlParserCtxtGetErrorHandler",
"(",
"self",
".",
"_o",
")"
] | https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/LIBXML/python/libxml.py#L666-L669 | |
dartsim/dart | 495c82120c836005f2d136d4a50c8cc997fb879b | tools/cpplint.py | python | ResetNolintSuppressions | () | Resets the set of NOLINT suppressions to empty. | Resets the set of NOLINT suppressions to empty. | [
"Resets",
"the",
"set",
"of",
"NOLINT",
"suppressions",
"to",
"empty",
"."
] | def ResetNolintSuppressions():
"Resets the set of NOLINT suppressions to empty."
_error_suppressions.clear() | [
"def",
"ResetNolintSuppressions",
"(",
")",
":",
"_error_suppressions",
".",
"clear",
"(",
")"
] | https://github.com/dartsim/dart/blob/495c82120c836005f2d136d4a50c8cc997fb879b/tools/cpplint.py#L472-L474 | ||
Tencent/mars | 54969ba56b402a622db123e780a4f760b38c5c36 | mars/lint/cpplint.py | python | _GetTextInside | (text, start_pattern) | return text[start_position:position - 1] | r"""Retrieves all the text between matching open and close parentheses.
Given a string of lines and a regular expression string, retrieve all the text
following the expression and between opening punctuation symbols like
(, [, or {, and the matching close-punctuation symbol. This properly nested
occurrences of... | r"""Retrieves all the text between matching open and close parentheses. | [
"r",
"Retrieves",
"all",
"the",
"text",
"between",
"matching",
"open",
"and",
"close",
"parentheses",
"."
] | def _GetTextInside(text, start_pattern):
r"""Retrieves all the text between matching open and close parentheses.
Given a string of lines and a regular expression string, retrieve all the text
following the expression and between opening punctuation symbols like
(, [, or {, and the matching close-punctuation sy... | [
"def",
"_GetTextInside",
"(",
"text",
",",
"start_pattern",
")",
":",
"# TODO(unknown): Audit cpplint.py to see what places could be profitably",
"# rewritten to use _GetTextInside (and use inferior regexp matching today).",
"# Give opening punctuations to get the matching close-punctuations.",
... | https://github.com/Tencent/mars/blob/54969ba56b402a622db123e780a4f760b38c5c36/mars/lint/cpplint.py#L4684-L4737 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/draftguitools/gui_edit_base_object.py | python | GuiTools.update_object_from_edit_points | (self, obj, node_idx, v, alt_edit_mode=0) | Update the object from modified Draft_Edit point.
No need to recompute at the end.
Parameters:
obj: the object
node_idx: number of the edited node
v: target vector of the node in object local coordinates system
alt_edit_mode: alternative edit mode to perform different op... | Update the object from modified Draft_Edit point.
No need to recompute at the end. | [
"Update",
"the",
"object",
"from",
"modified",
"Draft_Edit",
"point",
".",
"No",
"need",
"to",
"recompute",
"at",
"the",
"end",
"."
] | def update_object_from_edit_points(self, obj, node_idx, v, alt_edit_mode=0):
"""Update the object from modified Draft_Edit point.
No need to recompute at the end.
Parameters:
obj: the object
node_idx: number of the edited node
v: target vector of the node in object local... | [
"def",
"update_object_from_edit_points",
"(",
"self",
",",
"obj",
",",
"node_idx",
",",
"v",
",",
"alt_edit_mode",
"=",
"0",
")",
":",
"pass"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_edit_base_object.py#L50-L62 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/math_grad.py | python | _MaxGrad | (op, grad) | return _MinOrMaxGrad(op, grad) | Gradient for Max. | Gradient for Max. | [
"Gradient",
"for",
"Max",
"."
] | def _MaxGrad(op, grad):
"""Gradient for Max."""
return _MinOrMaxGrad(op, grad) | [
"def",
"_MaxGrad",
"(",
"op",
",",
"grad",
")",
":",
"return",
"_MinOrMaxGrad",
"(",
"op",
",",
"grad",
")"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/math_grad.py#L88-L90 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/gslib/commands/rm.py | python | _RemoveFoldersExceptionHandler | (cls, e) | When removing folders, we don't mind if none exist. | When removing folders, we don't mind if none exist. | [
"When",
"removing",
"folders",
"we",
"don",
"t",
"mind",
"if",
"none",
"exist",
"."
] | def _RemoveFoldersExceptionHandler(cls, e):
"""When removing folders, we don't mind if none exist."""
if (isinstance(e, CommandException.__class__) and
'No URLs matched' in e.message) or isinstance(e, NotFoundException):
pass
else:
raise e | [
"def",
"_RemoveFoldersExceptionHandler",
"(",
"cls",
",",
"e",
")",
":",
"if",
"(",
"isinstance",
"(",
"e",
",",
"CommandException",
".",
"__class__",
")",
"and",
"'No URLs matched'",
"in",
"e",
".",
"message",
")",
"or",
"isinstance",
"(",
"e",
",",
"NotF... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/commands/rm.py#L155-L161 | ||
ros-perception/vision_opencv | c791220cefd0abf02c6719e2ce0fea465857a88e | image_geometry/src/image_geometry/cameramodels.py | python | PinholeCameraModel.rotationMatrix | (self) | return self.R | Returns :math:`R` | Returns :math:`R` | [
"Returns",
":",
"math",
":",
"R"
] | def rotationMatrix(self):
""" Returns :math:`R` """
return self.R | [
"def",
"rotationMatrix",
"(",
"self",
")",
":",
"return",
"self",
".",
"R"
] | https://github.com/ros-perception/vision_opencv/blob/c791220cefd0abf02c6719e2ce0fea465857a88e/image_geometry/src/image_geometry/cameramodels.py#L217-L219 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | GDIObject.IsOk | (*args, **kwargs) | return _gdi_.GDIObject_IsOk(*args, **kwargs) | IsOk(self) -> bool | IsOk(self) -> bool | [
"IsOk",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsOk(*args, **kwargs):
"""IsOk(self) -> bool"""
return _gdi_.GDIObject_IsOk(*args, **kwargs) | [
"def",
"IsOk",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"GDIObject_IsOk",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L69-L71 | |
giuspen/cherrytree | 84712f206478fcf9acf30174009ad28c648c6344 | pygtk2/modules/imports.py | python | KeynoteHandler.parse_string_lines | (self, file_descriptor) | Parse the string line by line | Parse the string line by line | [
"Parse",
"the",
"string",
"line",
"by",
"line"
] | def parse_string_lines(self, file_descriptor):
"""Parse the string line by line"""
self.curr_state = 0
self.curr_node_name = ""
self.curr_node_id = None
self.curr_node_content = ""
self.curr_node_level = 0
self.former_node_level = -1
self.img_tmp_path = os... | [
"def",
"parse_string_lines",
"(",
"self",
",",
"file_descriptor",
")",
":",
"self",
".",
"curr_state",
"=",
"0",
"self",
".",
"curr_node_name",
"=",
"\"\"",
"self",
".",
"curr_node_id",
"=",
"None",
"self",
".",
"curr_node_content",
"=",
"\"\"",
"self",
".",... | https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/imports.py#L1787-L1846 | ||
google/or-tools | 2cb85b4eead4c38e1c54b48044f92087cf165bce | ortools/constraint_solver/samples/vrp_resources.py | python | create_data_model | () | return data | Stores the data for the problem. | Stores the data for the problem. | [
"Stores",
"the",
"data",
"for",
"the",
"problem",
"."
] | def create_data_model():
"""Stores the data for the problem."""
data = {}
data['time_matrix'] = [
[0, 6, 9, 8, 7, 3, 6, 2, 3, 2, 6, 6, 4, 4, 5, 9, 7],
[6, 0, 8, 3, 2, 6, 8, 4, 8, 8, 13, 7, 5, 8, 12, 10, 14],
[9, 8, 0, 11, 10, 6, 3, 9, 5, 8, 4, 15, 14, 13, 9, 18, 9],
[8, 3, 11... | [
"def",
"create_data_model",
"(",
")",
":",
"data",
"=",
"{",
"}",
"data",
"[",
"'time_matrix'",
"]",
"=",
"[",
"[",
"0",
",",
"6",
",",
"9",
",",
"8",
",",
"7",
",",
"3",
",",
"6",
",",
"2",
",",
"3",
",",
"2",
",",
"6",
",",
"6",
",",
... | https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/ortools/constraint_solver/samples/vrp_resources.py#L24-L72 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/model_selection/_search.py | python | BaseSearchCV._fit | (self, X, y, groups, parameter_iterable) | return self | Actual fitting, performing the search over parameters. | Actual fitting, performing the search over parameters. | [
"Actual",
"fitting",
"performing",
"the",
"search",
"over",
"parameters",
"."
] | def _fit(self, X, y, groups, parameter_iterable):
"""Actual fitting, performing the search over parameters."""
estimator = self.estimator
cv = check_cv(self.cv, y, classifier=is_classifier(estimator))
self.scorer_ = check_scoring(self.estimator, scoring=self.scoring)
X, y, gro... | [
"def",
"_fit",
"(",
"self",
",",
"X",
",",
"y",
",",
"groups",
",",
"parameter_iterable",
")",
":",
"estimator",
"=",
"self",
".",
"estimator",
"cv",
"=",
"check_cv",
"(",
"self",
".",
"cv",
",",
"y",
",",
"classifier",
"=",
"is_classifier",
"(",
"es... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/model_selection/_search.py#L535-L649 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/showbase/ShowBase.py | python | ShowBase.loadSfx | (self, name) | return self.loader.loadSfx(name) | :deprecated: Use `.Loader.Loader.loadSfx()` instead. | :deprecated: Use `.Loader.Loader.loadSfx()` instead. | [
":",
"deprecated",
":",
"Use",
".",
"Loader",
".",
"Loader",
".",
"loadSfx",
"()",
"instead",
"."
] | def loadSfx(self, name):
"""
:deprecated: Use `.Loader.Loader.loadSfx()` instead.
"""
if __debug__:
warnings.warn("base.loadSfx is deprecated, use base.loader.loadSfx instead.", DeprecationWarning, stacklevel=2)
return self.loader.loadSfx(name) | [
"def",
"loadSfx",
"(",
"self",
",",
"name",
")",
":",
"if",
"__debug__",
":",
"warnings",
".",
"warn",
"(",
"\"base.loadSfx is deprecated, use base.loader.loadSfx instead.\"",
",",
"DeprecationWarning",
",",
"stacklevel",
"=",
"2",
")",
"return",
"self",
".",
"loa... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/showbase/ShowBase.py#L2035-L2041 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.