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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | DC.LogicalToDeviceXRel | (*args, **kwargs) | return _gdi_.DC_LogicalToDeviceXRel(*args, **kwargs) | LogicalToDeviceXRel(self, int x) -> int
Converts logical X coordinate to relative device coordinate, using the
current mapping mode but ignoring the x axis orientation. Use this for
converting a width, for example. | LogicalToDeviceXRel(self, int x) -> int | [
"LogicalToDeviceXRel",
"(",
"self",
"int",
"x",
")",
"-",
">",
"int"
] | def LogicalToDeviceXRel(*args, **kwargs):
"""
LogicalToDeviceXRel(self, int x) -> int
Converts logical X coordinate to relative device coordinate, using the
current mapping mode but ignoring the x axis orientation. Use this for
converting a width, for example.
"""
... | [
"def",
"LogicalToDeviceXRel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"DC_LogicalToDeviceXRel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L4267-L4275 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/auibook.py | python | AuiNotebook.OnTabMiddleUp | (self, event) | Handles the ``EVT_AUINOTEBOOK_TAB_MIDDLE_UP`` event for :class:`AuiNotebook`.
:param `event`: a :class:`AuiNotebookEvent` event to be processed. | Handles the ``EVT_AUINOTEBOOK_TAB_MIDDLE_UP`` event for :class:`AuiNotebook`. | [
"Handles",
"the",
"EVT_AUINOTEBOOK_TAB_MIDDLE_UP",
"event",
"for",
":",
"class",
":",
"AuiNotebook",
"."
] | def OnTabMiddleUp(self, event):
"""
Handles the ``EVT_AUINOTEBOOK_TAB_MIDDLE_UP`` event for :class:`AuiNotebook`.
:param `event`: a :class:`AuiNotebookEvent` event to be processed.
"""
tabs = event.GetEventObject()
if not tabs.GetEnabled(event.GetSelection()):
... | [
"def",
"OnTabMiddleUp",
"(",
"self",
",",
"event",
")",
":",
"tabs",
"=",
"event",
".",
"GetEventObject",
"(",
")",
"if",
"not",
"tabs",
".",
"GetEnabled",
"(",
"event",
".",
"GetSelection",
"(",
")",
")",
":",
"return",
"# if the AUI_NB_MIDDLE_CLICK_CLOSE i... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibook.py#L5433-L5465 | ||
cocos-creator/engine-native | 984c4c9f5838253313b44ccd429bd8fac4ec8a6a | tools/bindings-generator/clang/cindex.py | python | Cursor.enum_type | (self) | return self._enum_type | Return the integer type of an enum declaration.
Returns a Type corresponding to an integer. If the cursor is not for an
enum, this raises. | Return the integer type of an enum declaration. | [
"Return",
"the",
"integer",
"type",
"of",
"an",
"enum",
"declaration",
"."
] | def enum_type(self):
"""Return the integer type of an enum declaration.
Returns a Type corresponding to an integer. If the cursor is not for an
enum, this raises.
"""
if not hasattr(self, '_enum_type'):
assert self.kind == CursorKind.ENUM_DECL
self._enum_... | [
"def",
"enum_type",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_enum_type'",
")",
":",
"assert",
"self",
".",
"kind",
"==",
"CursorKind",
".",
"ENUM_DECL",
"self",
".",
"_enum_type",
"=",
"conf",
".",
"lib",
".",
"clang_getEnumDec... | https://github.com/cocos-creator/engine-native/blob/984c4c9f5838253313b44ccd429bd8fac4ec8a6a/tools/bindings-generator/clang/cindex.py#L1702-L1712 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/base.py | python | ExtensionArray.shape | (self) | return (len(self),) | Return a tuple of the array dimensions. | Return a tuple of the array dimensions. | [
"Return",
"a",
"tuple",
"of",
"the",
"array",
"dimensions",
"."
] | def shape(self) -> Tuple[int, ...]:
"""
Return a tuple of the array dimensions.
"""
return (len(self),) | [
"def",
"shape",
"(",
"self",
")",
"->",
"Tuple",
"[",
"int",
",",
"...",
"]",
":",
"return",
"(",
"len",
"(",
"self",
")",
",",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/base.py#L399-L403 | |
Chia-Network/bls-signatures | a61089d653fa3653ac94452c73e97efcd461bdf2 | python-impl/hd_keys.py | python | derive_child_sk_unhardened | (parent_sk: PrivateKey, index: int) | return PrivateKey.aggregate([PrivateKey.from_bytes(h), parent_sk]) | Derives an unhardened BIP-32 child private key, from a parent private key,
at the specified index. WARNING: this key is not as secure as a hardened key. | Derives an unhardened BIP-32 child private key, from a parent private key,
at the specified index. WARNING: this key is not as secure as a hardened key. | [
"Derives",
"an",
"unhardened",
"BIP",
"-",
"32",
"child",
"private",
"key",
"from",
"a",
"parent",
"private",
"key",
"at",
"the",
"specified",
"index",
".",
"WARNING",
":",
"this",
"key",
"is",
"not",
"as",
"secure",
"as",
"a",
"hardened",
"key",
"."
] | def derive_child_sk_unhardened(parent_sk: PrivateKey, index: int) -> PrivateKey:
"""
Derives an unhardened BIP-32 child private key, from a parent private key,
at the specified index. WARNING: this key is not as secure as a hardened key.
"""
h = hash256(bytes(parent_sk.get_g1()) + index.to_bytes(4, ... | [
"def",
"derive_child_sk_unhardened",
"(",
"parent_sk",
":",
"PrivateKey",
",",
"index",
":",
"int",
")",
"->",
"PrivateKey",
":",
"h",
"=",
"hash256",
"(",
"bytes",
"(",
"parent_sk",
".",
"get_g1",
"(",
")",
")",
"+",
"index",
".",
"to_bytes",
"(",
"4",
... | https://github.com/Chia-Network/bls-signatures/blob/a61089d653fa3653ac94452c73e97efcd461bdf2/python-impl/hd_keys.py#L49-L55 | |
fengbingchun/NN_Test | d6305825d5273e4569ccd1eda9ffa2a9c72e18d2 | src/tiny-dnn/third_party/gemmlowp/meta/generators/gemv_1xMxK.py | python | GenerateMulCols | (emitter, result_type, lhs_add, rhs_add, aligned, cols,
leftovers) | Emits code responsible for multiplication of one horizontal lhs strip. | Emits code responsible for multiplication of one horizontal lhs strip. | [
"Emits",
"code",
"responsible",
"for",
"multiplication",
"of",
"one",
"horizontal",
"lhs",
"strip",
"."
] | def GenerateMulCols(emitter, result_type, lhs_add, rhs_add, aligned, cols,
leftovers):
"""Emits code responsible for multiplication of one horizontal lhs strip."""
emitter.EmitOpenBracket('for (int i = 0; i < col_chunks; ++i)')
emitter.EmitCall(
zip_Nx8_neon.BuildName(4, leftovers, align... | [
"def",
"GenerateMulCols",
"(",
"emitter",
",",
"result_type",
",",
"lhs_add",
",",
"rhs_add",
",",
"aligned",
",",
"cols",
",",
"leftovers",
")",
":",
"emitter",
".",
"EmitOpenBracket",
"(",
"'for (int i = 0; i < col_chunks; ++i)'",
")",
"emitter",
".",
"EmitCall"... | https://github.com/fengbingchun/NN_Test/blob/d6305825d5273e4569ccd1eda9ffa2a9c72e18d2/src/tiny-dnn/third_party/gemmlowp/meta/generators/gemv_1xMxK.py#L83-L124 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/configHandler.py | python | IdleConfParser.Load | (self) | Load the configuration file from disk | Load the configuration file from disk | [
"Load",
"the",
"configuration",
"file",
"from",
"disk"
] | def Load(self):
"""
Load the configuration file from disk
"""
self.read(self.file) | [
"def",
"Load",
"(",
"self",
")",
":",
"self",
".",
"read",
"(",
"self",
".",
"file",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/configHandler.py#L65-L69 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | gpu/command_buffer/build_gles2_cmd_buffer.py | python | SizeArgument.WriteValidationCode | (self, file, func) | overridden from Argument. | overridden from Argument. | [
"overridden",
"from",
"Argument",
"."
] | def WriteValidationCode(self, file, func):
"""overridden from Argument."""
file.Write(" if (%s < 0) {\n" % self.name)
file.Write(" SetGLError(GL_INVALID_VALUE, \"gl%s: %s < 0\");\n" %
(func.original_name, self.name))
file.Write(" return error::kNoError;\n")
file.Write(" }\n") | [
"def",
"WriteValidationCode",
"(",
"self",
",",
"file",
",",
"func",
")",
":",
"file",
".",
"Write",
"(",
"\" if (%s < 0) {\\n\"",
"%",
"self",
".",
"name",
")",
"file",
".",
"Write",
"(",
"\" SetGLError(GL_INVALID_VALUE, \\\"gl%s: %s < 0\\\");\\n\"",
"%",
"("... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/gpu/command_buffer/build_gles2_cmd_buffer.py#L4705-L4711 | ||
ppwwyyxx/speaker-recognition | 15d7bf32ad4ba2f1543e1287b03f3f2e6791d4dd | src/gui/interface.py | python | ModelInterface.init_noise | (self, fs, signal) | init vad from environment noise | init vad from environment noise | [
"init",
"vad",
"from",
"environment",
"noise"
] | def init_noise(self, fs, signal):
"""
init vad from environment noise
"""
self.vad.init_noise(fs, signal) | [
"def",
"init_noise",
"(",
"self",
",",
"fs",
",",
"signal",
")",
":",
"self",
".",
"vad",
".",
"init_noise",
"(",
"fs",
",",
"signal",
")"
] | https://github.com/ppwwyyxx/speaker-recognition/blob/15d7bf32ad4ba2f1543e1287b03f3f2e6791d4dd/src/gui/interface.py#L37-L41 | ||
RobotLocomotion/drake | 0e18a34604c45ed65bc9018a54f7610f91cdad5b | tools/lint/buildifier.py | python | _help | (command) | return process.returncode | Perform the --help operation (display output) and return an exitcode. | Perform the --help operation (display output) and return an exitcode. | [
"Perform",
"the",
"--",
"help",
"operation",
"(",
"display",
"output",
")",
"and",
"return",
"an",
"exitcode",
"."
] | def _help(command):
"""Perform the --help operation (display output) and return an exitcode."""
process = Popen(command, stdout=PIPE, stderr=STDOUT)
stdout, _ = process.communicate()
lines = stdout.splitlines()
# Edit the first line to allow "--all" as a disjunction from "files...",
# and make o... | [
"def",
"_help",
"(",
"command",
")",
":",
"process",
"=",
"Popen",
"(",
"command",
",",
"stdout",
"=",
"PIPE",
",",
"stderr",
"=",
"STDOUT",
")",
"stdout",
",",
"_",
"=",
"process",
".",
"communicate",
"(",
")",
"lines",
"=",
"stdout",
".",
"splitlin... | https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/tools/lint/buildifier.py#L31-L48 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/tlslite/tlslite/integration/AsyncStateMachine.py | python | AsyncStateMachine.wantsReadEvent | (self) | return None | If the state machine wants to read.
If an operation is active, this returns whether or not the
operation wants to read from the socket. If an operation is
not active, this returns None.
@rtype: bool or None
@return: If the state machine wants to read. | If the state machine wants to read. | [
"If",
"the",
"state",
"machine",
"wants",
"to",
"read",
"."
] | def wantsReadEvent(self):
"""If the state machine wants to read.
If an operation is active, this returns whether or not the
operation wants to read from the socket. If an operation is
not active, this returns None.
@rtype: bool or None
@return: If the state machine wan... | [
"def",
"wantsReadEvent",
"(",
"self",
")",
":",
"if",
"self",
".",
"result",
"!=",
"None",
":",
"return",
"self",
".",
"result",
"==",
"0",
"return",
"None"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/tlslite/tlslite/integration/AsyncStateMachine.py#L64-L76 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Fem/ObjectsFem.py | python | makeEquationFlow | (
doc,
base_solver=None,
name="Flow"
) | return obj | makeEquationFlow(document, [base_solver], [name]):
creates a FEM flow equation for a solver | makeEquationFlow(document, [base_solver], [name]):
creates a FEM flow equation for a solver | [
"makeEquationFlow",
"(",
"document",
"[",
"base_solver",
"]",
"[",
"name",
"]",
")",
":",
"creates",
"a",
"FEM",
"flow",
"equation",
"for",
"a",
"solver"
] | def makeEquationFlow(
doc,
base_solver=None,
name="Flow"
):
"""makeEquationFlow(document, [base_solver], [name]):
creates a FEM flow equation for a solver"""
from femsolver.elmer.equations import flow
obj = flow.create(doc, name)
if base_solver:
base_solver.addObject(obj)
ret... | [
"def",
"makeEquationFlow",
"(",
"doc",
",",
"base_solver",
"=",
"None",
",",
"name",
"=",
"\"Flow\"",
")",
":",
"from",
"femsolver",
".",
"elmer",
".",
"equations",
"import",
"flow",
"obj",
"=",
"flow",
".",
"create",
"(",
"doc",
",",
"name",
")",
"if"... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Fem/ObjectsFem.py#L733-L744 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/optimize/_linprog.py | python | _solve_simplex | (T, n, basis, maxiter=1000, phase=2, callback=None,
tol=1.0E-12, nit0=0, bland=False) | return nit, status | Solve a linear programming problem in "standard maximization form" using
the Simplex Method.
Minimize :math:`f = c^T x`
subject to
.. math::
Ax = b
x_i >= 0
b_j >= 0
Parameters
----------
T : array_like
A 2-D array representing the simplex T corresponding... | Solve a linear programming problem in "standard maximization form" using
the Simplex Method. | [
"Solve",
"a",
"linear",
"programming",
"problem",
"in",
"standard",
"maximization",
"form",
"using",
"the",
"Simplex",
"Method",
"."
] | def _solve_simplex(T, n, basis, maxiter=1000, phase=2, callback=None,
tol=1.0E-12, nit0=0, bland=False):
"""
Solve a linear programming problem in "standard maximization form" using
the Simplex Method.
Minimize :math:`f = c^T x`
subject to
.. math::
Ax = b
... | [
"def",
"_solve_simplex",
"(",
"T",
",",
"n",
",",
"basis",
",",
"maxiter",
"=",
"1000",
",",
"phase",
"=",
"2",
",",
"callback",
"=",
"None",
",",
"tol",
"=",
"1.0E-12",
",",
"nit0",
"=",
"0",
",",
"bland",
"=",
"False",
")",
":",
"nit",
"=",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/optimize/_linprog.py#L212-L388 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_windows.py | python | FindReplaceDialog.GetData | (*args, **kwargs) | return _windows_.FindReplaceDialog_GetData(*args, **kwargs) | GetData(self) -> FindReplaceData
Get the FindReplaceData object used by this dialog. | GetData(self) -> FindReplaceData | [
"GetData",
"(",
"self",
")",
"-",
">",
"FindReplaceData"
] | def GetData(*args, **kwargs):
"""
GetData(self) -> FindReplaceData
Get the FindReplaceData object used by this dialog.
"""
return _windows_.FindReplaceDialog_GetData(*args, **kwargs) | [
"def",
"GetData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"FindReplaceDialog_GetData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L3972-L3978 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | VideoMode.IsOk | (*args, **kwargs) | return _misc_.VideoMode_IsOk(*args, **kwargs) | IsOk(self) -> bool
returns true if the object has been initialized | IsOk(self) -> bool | [
"IsOk",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsOk(*args, **kwargs):
"""
IsOk(self) -> bool
returns true if the object has been initialized
"""
return _misc_.VideoMode_IsOk(*args, **kwargs) | [
"def",
"IsOk",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"VideoMode_IsOk",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L6050-L6056 | |
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/v7.9.317/third_party/jinja2/compiler.py | python | CodeGenerator.visit_Include | (self, node, frame) | Handles includes. | Handles includes. | [
"Handles",
"includes",
"."
] | def visit_Include(self, node, frame):
"""Handles includes."""
if node.ignore_missing:
self.writeline('try:')
self.indent()
func_name = 'get_or_select_template'
if isinstance(node.template, nodes.Const):
if isinstance(node.template.value, string_types)... | [
"def",
"visit_Include",
"(",
"self",
",",
"node",
",",
"frame",
")",
":",
"if",
"node",
".",
"ignore_missing",
":",
"self",
".",
"writeline",
"(",
"'try:'",
")",
"self",
".",
"indent",
"(",
")",
"func_name",
"=",
"'get_or_select_template'",
"if",
"isinstan... | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/third_party/jinja2/compiler.py#L890-L942 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/framework/tensor_shape.py | python | TensorShape.merge_with | (self, other) | Returns a `TensorShape` combining the information in `self` and `other`.
The dimensions in `self` and `other` are merged elementwise,
according to the rules defined for `Dimension.merge_with()`.
Args:
other: Another `TensorShape`.
Returns:
A `TensorShape` containing the combined informati... | Returns a `TensorShape` combining the information in `self` and `other`. | [
"Returns",
"a",
"TensorShape",
"combining",
"the",
"information",
"in",
"self",
"and",
"other",
"."
] | def merge_with(self, other):
"""Returns a `TensorShape` combining the information in `self` and `other`.
The dimensions in `self` and `other` are merged elementwise,
according to the rules defined for `Dimension.merge_with()`.
Args:
other: Another `TensorShape`.
Returns:
A `TensorShap... | [
"def",
"merge_with",
"(",
"self",
",",
"other",
")",
":",
"other",
"=",
"as_shape",
"(",
"other",
")",
"if",
"self",
".",
"_dims",
"is",
"None",
":",
"return",
"other",
"else",
":",
"try",
":",
"self",
".",
"assert_same_rank",
"(",
"other",
")",
"new... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/framework/tensor_shape.py#L542-L570 | ||
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/server/wsgi/serve/publish/publish_manager_helper.py | python | PublishManagerHelper.IsDefaultDatabase | (self, publish_context_id) | return False | Checks whether the passed-in database is the default database or not. When
upgrading from older releases such as 5.1.2, the publish_context_table may
not have an entry for a published database, so we have to perform two
queries: one to get the list of databases and one to check if each database
is the d... | Checks whether the passed-in database is the default database or not. When
upgrading from older releases such as 5.1.2, the publish_context_table may
not have an entry for a published database, so we have to perform two
queries: one to get the list of databases and one to check if each database
is the d... | [
"Checks",
"whether",
"the",
"passed",
"-",
"in",
"database",
"is",
"the",
"default",
"database",
"or",
"not",
".",
"When",
"upgrading",
"from",
"older",
"releases",
"such",
"as",
"5",
".",
"1",
".",
"2",
"the",
"publish_context_table",
"may",
"not",
"have"... | def IsDefaultDatabase(self, publish_context_id):
"""
Checks whether the passed-in database is the default database or not. When
upgrading from older releases such as 5.1.2, the publish_context_table may
not have an entry for a published database, so we have to perform two
queries: one to get the lis... | [
"def",
"IsDefaultDatabase",
"(",
"self",
",",
"publish_context_id",
")",
":",
"if",
"publish_context_id",
"!=",
"0",
":",
"# Ensure the publish_context_id is valid",
"query_string",
"=",
"(",
"\"\"\"\n SELECT publish_context_table.ec_default_db\n FROM publish_cont... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/serve/publish/publish_manager_helper.py#L152-L176 | |
KhronosGroup/SPIRV-Tools | 940127a77d3ad795a4a1422fbeaad50c9f19f2ea | utils/generate_registry_tables.py | python | mkdir_p | (directory) | Make the directory, and all its ancestors as required. Any of the
directories are allowed to already exist.
This is compatible with Python down to 3.0. | Make the directory, and all its ancestors as required. Any of the
directories are allowed to already exist.
This is compatible with Python down to 3.0. | [
"Make",
"the",
"directory",
"and",
"all",
"its",
"ancestors",
"as",
"required",
".",
"Any",
"of",
"the",
"directories",
"are",
"allowed",
"to",
"already",
"exist",
".",
"This",
"is",
"compatible",
"with",
"Python",
"down",
"to",
"3",
".",
"0",
"."
] | def mkdir_p(directory):
"""Make the directory, and all its ancestors as required. Any of the
directories are allowed to already exist.
This is compatible with Python down to 3.0.
"""
if directory == "":
# We're being asked to make the current directory.
return
try:
os.... | [
"def",
"mkdir_p",
"(",
"directory",
")",
":",
"if",
"directory",
"==",
"\"\"",
":",
"# We're being asked to make the current directory.",
"return",
"try",
":",
"os",
".",
"makedirs",
"(",
"directory",
")",
"except",
"OSError",
"as",
"e",
":",
"if",
"e",
".",
... | https://github.com/KhronosGroup/SPIRV-Tools/blob/940127a77d3ad795a4a1422fbeaad50c9f19f2ea/utils/generate_registry_tables.py#L22-L38 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/setup.py | python | is_npy_no_smp | () | return 'NPY_NOSMP' in os.environ | Return True if the NPY_NO_SMP symbol must be defined in public
header (when SMP support cannot be reliably enabled). | Return True if the NPY_NO_SMP symbol must be defined in public
header (when SMP support cannot be reliably enabled). | [
"Return",
"True",
"if",
"the",
"NPY_NO_SMP",
"symbol",
"must",
"be",
"defined",
"in",
"public",
"header",
"(",
"when",
"SMP",
"support",
"cannot",
"be",
"reliably",
"enabled",
")",
"."
] | def is_npy_no_smp():
"""Return True if the NPY_NO_SMP symbol must be defined in public
header (when SMP support cannot be reliably enabled)."""
# Perhaps a fancier check is in order here.
# so that threads are only enabled if there
# are actually multiple CPUS? -- but
# threaded code can be n... | [
"def",
"is_npy_no_smp",
"(",
")",
":",
"# Perhaps a fancier check is in order here.",
"# so that threads are only enabled if there",
"# are actually multiple CPUS? -- but",
"# threaded code can be nice even on a single",
"# CPU so that long-calculating code doesn't",
"# block.",
"return",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/setup.py#L83-L92 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/dtypes/common.py | python | is_interval_dtype | (arr_or_dtype) | return IntervalDtype.is_dtype(arr_or_dtype) | Check whether an array-like or dtype is of the Interval dtype.
Parameters
----------
arr_or_dtype : array-like
The array-like or dtype to check.
Returns
-------
boolean
Whether or not the array-like or dtype is of the Interval dtype.
Examples
--------
>>> is_interv... | Check whether an array-like or dtype is of the Interval dtype. | [
"Check",
"whether",
"an",
"array",
"-",
"like",
"or",
"dtype",
"is",
"of",
"the",
"Interval",
"dtype",
"."
] | def is_interval_dtype(arr_or_dtype) -> bool:
"""
Check whether an array-like or dtype is of the Interval dtype.
Parameters
----------
arr_or_dtype : array-like
The array-like or dtype to check.
Returns
-------
boolean
Whether or not the array-like or dtype is of the Int... | [
"def",
"is_interval_dtype",
"(",
"arr_or_dtype",
")",
"->",
"bool",
":",
"# TODO: Consider making Interval an instance of IntervalDtype",
"if",
"arr_or_dtype",
"is",
"None",
":",
"return",
"False",
"return",
"IntervalDtype",
".",
"is_dtype",
"(",
"arr_or_dtype",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/dtypes/common.py#L506-L539 | |
intel/caffe | 3f494b442ee3f9d17a07b09ecbd5fa2bbda00836 | examples/rfcn/lib/roi_data_layer/layer.py | python | RoIDataLayer.reshape | (self, bottom, top) | Reshaping happens during the call to forward. | Reshaping happens during the call to forward. | [
"Reshaping",
"happens",
"during",
"the",
"call",
"to",
"forward",
"."
] | def reshape(self, bottom, top):
"""Reshaping happens during the call to forward."""
pass | [
"def",
"reshape",
"(",
"self",
",",
"bottom",
",",
"top",
")",
":",
"pass"
] | https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/examples/rfcn/lib/roi_data_layer/layer.py#L162-L164 | ||
falkTX/Carla | 74a1ae82c90db85f20550ddcdc8a927b8fb7e414 | source/modules/lilv/lilv-0.24.0/bindings/python/lilv.py | python | Instance.get_handle | (self) | return self.instance[0].lv2_handle | Get the LV2_Handle of the plugin instance.
Normally hosts should not need to access the LV2_Handle directly,
use the lilv_instance_* functions. | Get the LV2_Handle of the plugin instance. | [
"Get",
"the",
"LV2_Handle",
"of",
"the",
"plugin",
"instance",
"."
] | def get_handle(self):
"""Get the LV2_Handle of the plugin instance.
Normally hosts should not need to access the LV2_Handle directly,
use the lilv_instance_* functions.
"""
return self.instance[0].lv2_handle | [
"def",
"get_handle",
"(",
"self",
")",
":",
"return",
"self",
".",
"instance",
"[",
"0",
"]",
".",
"lv2_handle"
] | https://github.com/falkTX/Carla/blob/74a1ae82c90db85f20550ddcdc8a927b8fb7e414/source/modules/lilv/lilv-0.24.0/bindings/python/lilv.py#L1264-L1270 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/data/python/ops/readers.py | python | read_batch_features | (file_pattern,
batch_size,
features,
reader,
reader_args=None,
randomize_input=True,
num_epochs=None,
capacity=10000) | return result | Reads batches of Examples.
Example:
```
serialized_examples = [
features {
feature { key: "age" value { int64_list { value: [ 0 ] } } }
feature { key: "gender" value { bytes_list { value: [ "f" ] } } }
feature { key: "kws" value { bytes_list { value: [ "code", "art" ] } } }
},
feat... | Reads batches of Examples. | [
"Reads",
"batches",
"of",
"Examples",
"."
] | def read_batch_features(file_pattern,
batch_size,
features,
reader,
reader_args=None,
randomize_input=True,
num_epochs=None,
capacity=10000):
"""Reads... | [
"def",
"read_batch_features",
"(",
"file_pattern",
",",
"batch_size",
",",
"features",
",",
"reader",
",",
"reader_args",
"=",
"None",
",",
"randomize_input",
"=",
"True",
",",
"num_epochs",
"=",
"None",
",",
"capacity",
"=",
"10000",
")",
":",
"filenames",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/data/python/ops/readers.py#L101-L202 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | Utilities/RelMon/python/utils_v2.py | python | check_disk_for_space | (work_path, size_needed) | Checks afs file system for space. | Checks afs file system for space. | [
"Checks",
"afs",
"file",
"system",
"for",
"space",
"."
] | def check_disk_for_space(work_path, size_needed):
'''Checks afs file system for space.'''
pass | [
"def",
"check_disk_for_space",
"(",
"work_path",
",",
"size_needed",
")",
":",
"pass"
] | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Utilities/RelMon/python/utils_v2.py#L462-L464 | ||
intel/libxcam | f0909548fce2245dc5e95922a51f709ec05b98f4 | modules/dnn/feathernet/main.py | python | accuracy | (output, target, topk=(1,)) | return res | Computes the precision@k for the specified values of k | Computes the precision | [
"Computes",
"the",
"precision"
] | def accuracy(output, target, topk=(1,)):
"""Computes the precision@k for the specified values of k"""
maxk = max(topk)
batch_size = target.size(0)
_, pred = output.topk(maxk, 1, True, True)
pred = pred.t()
correct = pred.eq(target.view(1, -1).expand_as(pred))
res = []
for k in topk:
... | [
"def",
"accuracy",
"(",
"output",
",",
"target",
",",
"topk",
"=",
"(",
"1",
",",
")",
")",
":",
"maxk",
"=",
"max",
"(",
"topk",
")",
"batch_size",
"=",
"target",
".",
"size",
"(",
"0",
")",
"_",
",",
"pred",
"=",
"output",
".",
"topk",
"(",
... | https://github.com/intel/libxcam/blob/f0909548fce2245dc5e95922a51f709ec05b98f4/modules/dnn/feathernet/main.py#L424-L437 | |
MhLiao/TextBoxes_plusplus | 39d4898de1504c53a2ed3d67966a57b3595836d0 | python/caffe/draw.py | python | draw_net_to_file | (caffe_net, filename, rankdir='LR', phase=None) | Draws a caffe net, and saves it to file using the format given as the
file extension. Use '.raw' to output raw text that you can manually feed
to graphviz to draw graphs.
Parameters
----------
caffe_net : a caffe.proto.caffe_pb2.NetParameter protocol buffer.
filename : string
The path t... | Draws a caffe net, and saves it to file using the format given as the
file extension. Use '.raw' to output raw text that you can manually feed
to graphviz to draw graphs. | [
"Draws",
"a",
"caffe",
"net",
"and",
"saves",
"it",
"to",
"file",
"using",
"the",
"format",
"given",
"as",
"the",
"file",
"extension",
".",
"Use",
".",
"raw",
"to",
"output",
"raw",
"text",
"that",
"you",
"can",
"manually",
"feed",
"to",
"graphviz",
"t... | def draw_net_to_file(caffe_net, filename, rankdir='LR', phase=None):
"""Draws a caffe net, and saves it to file using the format given as the
file extension. Use '.raw' to output raw text that you can manually feed
to graphviz to draw graphs.
Parameters
----------
caffe_net : a caffe.proto.caff... | [
"def",
"draw_net_to_file",
"(",
"caffe_net",
",",
"filename",
",",
"rankdir",
"=",
"'LR'",
",",
"phase",
"=",
"None",
")",
":",
"ext",
"=",
"filename",
"[",
"filename",
".",
"rfind",
"(",
"'.'",
")",
"+",
"1",
":",
"]",
"with",
"open",
"(",
"filename... | https://github.com/MhLiao/TextBoxes_plusplus/blob/39d4898de1504c53a2ed3d67966a57b3595836d0/python/caffe/draw.py#L226-L244 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_cmdbar.py | python | PopupListBase.SetSelection | (self, index) | Set the selection in the list by index
@param index: zero based index to set selection by | Set the selection in the list by index
@param index: zero based index to set selection by | [
"Set",
"the",
"selection",
"in",
"the",
"list",
"by",
"index",
"@param",
"index",
":",
"zero",
"based",
"index",
"to",
"set",
"selection",
"by"
] | def SetSelection(self, index):
"""Set the selection in the list by index
@param index: zero based index to set selection by
"""
self._list.SetSelection(index) | [
"def",
"SetSelection",
"(",
"self",
",",
"index",
")",
":",
"self",
".",
"_list",
".",
"SetSelection",
"(",
"index",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_cmdbar.py#L1096-L1101 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | tools/caffe_converter/convert_mean.py | python | convert_mean | (binaryproto_fname, output=None) | return nd | Convert caffe mean
Parameters
----------
binaryproto_fname : str
Filename of the mean
output : str, optional
Save the mean into mxnet's format
Returns
-------
NDArray
Mean in ndarray | Convert caffe mean | [
"Convert",
"caffe",
"mean"
] | def convert_mean(binaryproto_fname, output=None):
"""Convert caffe mean
Parameters
----------
binaryproto_fname : str
Filename of the mean
output : str, optional
Save the mean into mxnet's format
Returns
-------
NDArray
Mean in ndarray
"""
mean_blob = ca... | [
"def",
"convert_mean",
"(",
"binaryproto_fname",
",",
"output",
"=",
"None",
")",
":",
"mean_blob",
"=",
"caffe_parser",
".",
"caffe_pb2",
".",
"BlobProto",
"(",
")",
"with",
"open",
"(",
"binaryproto_fname",
",",
"'rb'",
")",
"as",
"f",
":",
"mean_blob",
... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/tools/caffe_converter/convert_mean.py#L25-L53 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/xrc.py | python | XmlProperty.GetValue | (*args, **kwargs) | return _xrc.XmlProperty_GetValue(*args, **kwargs) | GetValue(self) -> String | GetValue(self) -> String | [
"GetValue",
"(",
"self",
")",
"-",
">",
"String"
] | def GetValue(*args, **kwargs):
"""GetValue(self) -> String"""
return _xrc.XmlProperty_GetValue(*args, **kwargs) | [
"def",
"GetValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_xrc",
".",
"XmlProperty_GetValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/xrc.py#L320-L322 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | PropertyGrid.ClearActionTriggers | (*args, **kwargs) | return _propgrid.PropertyGrid_ClearActionTriggers(*args, **kwargs) | ClearActionTriggers(self, int action) | ClearActionTriggers(self, int action) | [
"ClearActionTriggers",
"(",
"self",
"int",
"action",
")"
] | def ClearActionTriggers(*args, **kwargs):
"""ClearActionTriggers(self, int action)"""
return _propgrid.PropertyGrid_ClearActionTriggers(*args, **kwargs) | [
"def",
"ClearActionTriggers",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGrid_ClearActionTriggers",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L2003-L2005 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/numbers.py | python | Integral.__rand__ | (self, other) | other & self | other & self | [
"other",
"&",
"self"
] | def __rand__(self, other):
"""other & self"""
raise NotImplementedError | [
"def",
"__rand__",
"(",
"self",
",",
"other",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/numbers.py#L346-L348 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/extras/review.py | python | ReviewContext.refresh_review_set | (self) | Obtain the old review set and the new review set, and import the new set. | Obtain the old review set and the new review set, and import the new set. | [
"Obtain",
"the",
"old",
"review",
"set",
"and",
"the",
"new",
"review",
"set",
"and",
"import",
"the",
"new",
"set",
"."
] | def refresh_review_set(self):
"""
Obtain the old review set and the new review set, and import the new set.
"""
global old_review_set, new_review_set
old_review_set = self.load_review_set()
new_review_set = self.update_review_set(old_review_set)
self.import_review_set(new_review_set) | [
"def",
"refresh_review_set",
"(",
"self",
")",
":",
"global",
"old_review_set",
",",
"new_review_set",
"old_review_set",
"=",
"self",
".",
"load_review_set",
"(",
")",
"new_review_set",
"=",
"self",
".",
"update_review_set",
"(",
"old_review_set",
")",
"self",
"."... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/extras/review.py#L180-L187 | ||
smartdevicelink/sdl_core | 68f082169e0a40fccd9eb0db3c83911c28870f07 | tools/InterfaceGenerator/MsgVersionGenerate.py | python | prepare_data_for_storage | (major_version, minor_version, patch_version, minimum_major_version, minimum_minor_version, minimum_patch_version) | return data_to_file | Prepares data to store to file. | Prepares data to store to file. | [
"Prepares",
"data",
"to",
"store",
"to",
"file",
"."
] | def prepare_data_for_storage(major_version, minor_version, patch_version, minimum_major_version, minimum_minor_version, minimum_patch_version):
"""Prepares data to store to file.
"""
temp = Template(
u'''/*Copyright (c) 2019, SmartDeviceLink Consortium, Inc.\n'''
u'''All rights reserved.\n'''
u'... | [
"def",
"prepare_data_for_storage",
"(",
"major_version",
",",
"minor_version",
",",
"patch_version",
",",
"minimum_major_version",
",",
"minimum_minor_version",
",",
"minimum_patch_version",
")",
":",
"temp",
"=",
"Template",
"(",
"u'''/*Copyright (c) 2019, SmartDeviceLink Co... | https://github.com/smartdevicelink/sdl_core/blob/68f082169e0a40fccd9eb0db3c83911c28870f07/tools/InterfaceGenerator/MsgVersionGenerate.py#L70-L113 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/gyp/pylib/gyp/MSVSVersion.py | python | _ConvertToCygpath | (path) | return path | Convert to cygwin path if we are using cygwin. | Convert to cygwin path if we are using cygwin. | [
"Convert",
"to",
"cygwin",
"path",
"if",
"we",
"are",
"using",
"cygwin",
"."
] | def _ConvertToCygpath(path):
"""Convert to cygwin path if we are using cygwin."""
if sys.platform == 'cygwin':
p = subprocess.Popen(['cygpath', path], stdout=subprocess.PIPE)
path = p.communicate()[0].strip()
if PY3:
path = path.decode('utf-8')
return path | [
"def",
"_ConvertToCygpath",
"(",
"path",
")",
":",
"if",
"sys",
".",
"platform",
"==",
"'cygwin'",
":",
"p",
"=",
"subprocess",
".",
"Popen",
"(",
"[",
"'cygpath'",
",",
"path",
"]",
",",
"stdout",
"=",
"subprocess",
".",
"PIPE",
")",
"path",
"=",
"p... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/MSVSVersion.py#L387-L394 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/traitlets/py2/traitlets/config/configurable.py | python | SingletonConfigurable.initialized | (cls) | return hasattr(cls, "_instance") and cls._instance is not None | Has an instance been created? | Has an instance been created? | [
"Has",
"an",
"instance",
"been",
"created?"
] | def initialized(cls):
"""Has an instance been created?"""
return hasattr(cls, "_instance") and cls._instance is not None | [
"def",
"initialized",
"(",
"cls",
")",
":",
"return",
"hasattr",
"(",
"cls",
",",
"\"_instance\"",
")",
"and",
"cls",
".",
"_instance",
"is",
"not",
"None"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/traitlets/py2/traitlets/config/configurable.py#L427-L429 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/window/rolling.py | python | _Window._get_window_indexer | (self, window: int) | return FixedWindowIndexer(window_size=window) | Return an indexer class that will compute the window start and end bounds | Return an indexer class that will compute the window start and end bounds | [
"Return",
"an",
"indexer",
"class",
"that",
"will",
"compute",
"the",
"window",
"start",
"and",
"end",
"bounds"
] | def _get_window_indexer(self, window: int) -> BaseIndexer:
"""
Return an indexer class that will compute the window start and end bounds
"""
if isinstance(self.window, BaseIndexer):
return self.window
if self.is_freq_type:
return VariableWindowIndexer(inde... | [
"def",
"_get_window_indexer",
"(",
"self",
",",
"window",
":",
"int",
")",
"->",
"BaseIndexer",
":",
"if",
"isinstance",
"(",
"self",
".",
"window",
",",
"BaseIndexer",
")",
":",
"return",
"self",
".",
"window",
"if",
"self",
".",
"is_freq_type",
":",
"r... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/window/rolling.py#L399-L407 | |
seqan/seqan | f5f658343c366c9c3d44ba358ffc9317e78a09ed | util/py_lib/seqan/paths.py | python | pathToInclude | (location) | return os.path.join(repositoryRoot(), location, 'include') | Return path to the include dir in the given location/repository. | Return path to the include dir in the given location/repository. | [
"Return",
"path",
"to",
"the",
"include",
"dir",
"in",
"the",
"given",
"location",
"/",
"repository",
"."
] | def pathToInclude(location):
"""Return path to the include dir in the given location/repository."""
return os.path.join(repositoryRoot(), location, 'include') | [
"def",
"pathToInclude",
"(",
"location",
")",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"repositoryRoot",
"(",
")",
",",
"location",
",",
"'include'",
")"
] | https://github.com/seqan/seqan/blob/f5f658343c366c9c3d44ba358ffc9317e78a09ed/util/py_lib/seqan/paths.py#L38-L40 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | PGProperty.OnCustomPaint | (*args, **kwargs) | return _propgrid.PGProperty_OnCustomPaint(*args, **kwargs) | OnCustomPaint(self, DC dc, Rect rect, PGPaintData paintdata) | OnCustomPaint(self, DC dc, Rect rect, PGPaintData paintdata) | [
"OnCustomPaint",
"(",
"self",
"DC",
"dc",
"Rect",
"rect",
"PGPaintData",
"paintdata",
")"
] | def OnCustomPaint(*args, **kwargs):
"""OnCustomPaint(self, DC dc, Rect rect, PGPaintData paintdata)"""
return _propgrid.PGProperty_OnCustomPaint(*args, **kwargs) | [
"def",
"OnCustomPaint",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGProperty_OnCustomPaint",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L401-L403 | |
vnpy/vnpy | f50f2535ed39dd33272e0985ed40c7078e4c19f6 | vnpy/trader/engine.py | python | MainEngine.get_all_gateway_names | (self) | return list(self.gateways.keys()) | Get all names of gatewasy added in main engine. | Get all names of gatewasy added in main engine. | [
"Get",
"all",
"names",
"of",
"gatewasy",
"added",
"in",
"main",
"engine",
"."
] | def get_all_gateway_names(self) -> List[str]:
"""
Get all names of gatewasy added in main engine.
"""
return list(self.gateways.keys()) | [
"def",
"get_all_gateway_names",
"(",
"self",
")",
"->",
"List",
"[",
"str",
"]",
":",
"return",
"list",
"(",
"self",
".",
"gateways",
".",
"keys",
"(",
")",
")"
] | https://github.com/vnpy/vnpy/blob/f50f2535ed39dd33272e0985ed40c7078e4c19f6/vnpy/trader/engine.py#L145-L149 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | PyDataObjectSimple.__init__ | (self, *args, **kwargs) | __init__(self, DataFormat format=FormatInvalid) -> PyDataObjectSimple
wx.PyDataObjectSimple is a version of `wx.DataObjectSimple` that is
Python-aware and knows how to reflect calls to its C++ virtual methods
to methods in the Python derived class. You should derive from this
class and... | __init__(self, DataFormat format=FormatInvalid) -> PyDataObjectSimple | [
"__init__",
"(",
"self",
"DataFormat",
"format",
"=",
"FormatInvalid",
")",
"-",
">",
"PyDataObjectSimple"
] | def __init__(self, *args, **kwargs):
"""
__init__(self, DataFormat format=FormatInvalid) -> PyDataObjectSimple
wx.PyDataObjectSimple is a version of `wx.DataObjectSimple` that is
Python-aware and knows how to reflect calls to its C++ virtual methods
to methods in the Python der... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_misc_",
".",
"PyDataObjectSimple_swiginit",
"(",
"self",
",",
"_misc_",
".",
"new_PyDataObjectSimple",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"PyDataObje... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L5078-L5090 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/py/dispatcher.py | python | disconnect | (receiver, signal=Any, sender=Any, weak=True) | Disconnect receiver from sender for signal.
Disconnecting is not required. The use of disconnect is the same as for
connect, only in reverse. Think of it as undoing a previous connection. | Disconnect receiver from sender for signal.
Disconnecting is not required. The use of disconnect is the same as for
connect, only in reverse. Think of it as undoing a previous connection. | [
"Disconnect",
"receiver",
"from",
"sender",
"for",
"signal",
".",
"Disconnecting",
"is",
"not",
"required",
".",
"The",
"use",
"of",
"disconnect",
"is",
"the",
"same",
"as",
"for",
"connect",
"only",
"in",
"reverse",
".",
"Think",
"of",
"it",
"as",
"undoin... | def disconnect(receiver, signal=Any, sender=Any, weak=True):
"""Disconnect receiver from sender for signal.
Disconnecting is not required. The use of disconnect is the same as for
connect, only in reverse. Think of it as undoing a previous connection."""
if signal is None:
raise DispatcherE... | [
"def",
"disconnect",
"(",
"receiver",
",",
"signal",
"=",
"Any",
",",
"sender",
"=",
"Any",
",",
"weak",
"=",
"True",
")",
":",
"if",
"signal",
"is",
"None",
":",
"raise",
"DispatcherError",
",",
"'signal cannot be None'",
"if",
"weak",
":",
"receiver",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/py/dispatcher.py#L79-L100 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/sans/common/file_information.py | python | get_geometry_information_isis_added_nexus | (file_name) | return height, width, thickness, shape | Gets geometry information from the sample folder in an added nexus file
:param file_name: the file name
:return: height, width, thickness, shape | Gets geometry information from the sample folder in an added nexus file | [
"Gets",
"geometry",
"information",
"from",
"the",
"sample",
"folder",
"in",
"an",
"added",
"nexus",
"file"
] | def get_geometry_information_isis_added_nexus(file_name):
"""
Gets geometry information from the sample folder in an added nexus file
:param file_name: the file name
:return: height, width, thickness, shape
"""
with h5.File(file_name, 'r') as h5_file:
# Open first entry
keys = l... | [
"def",
"get_geometry_information_isis_added_nexus",
"(",
"file_name",
")",
":",
"with",
"h5",
".",
"File",
"(",
"file_name",
",",
"'r'",
")",
"as",
"h5_file",
":",
"# Open first entry",
"keys",
"=",
"list",
"(",
"h5_file",
".",
"keys",
"(",
")",
")",
"top_le... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/sans/common/file_information.py#L560-L577 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distro.py | python | LinuxDistribution._parse_os_release_content | (lines) | return props | Parse the lines of an os-release file.
Parameters:
* lines: Iterable through the lines in the os-release file.
Each line must be a unicode string or a UTF-8 encoded byte
string.
Returns:
A dictionary containing all information items. | [] | def _parse_os_release_content(lines):
"""
Parse the lines of an os-release file.
Parameters:
* lines: Iterable through the lines in the os-release file.
Each line must be a unicode string or a UTF-8 encoded byte
string.
Returns:
... | [
"def",
"_parse_os_release_content",
"(",
"lines",
")",
":",
"props",
"=",
"{",
"}",
"lexer",
"=",
"shlex",
".",
"shlex",
"(",
"lines",
",",
"posix",
"=",
"True",
")",
"lexer",
".",
"whitespace_split",
"=",
"True",
"# The shlex module defines its `wordchars` vari... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distro.py#L1873-L1997 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/stats/_distn_infrastructure.py | python | rv_continuous.nnlf | (self, theta, x) | return self._nnlf(x, *args) + n_log_scale | Return negative loglikelihood function.
Notes
-----
This is ``-sum(log pdf(x, theta), axis=0)`` where `theta` are the
parameters (including loc and scale). | Return negative loglikelihood function. | [
"Return",
"negative",
"loglikelihood",
"function",
"."
] | def nnlf(self, theta, x):
'''Return negative loglikelihood function.
Notes
-----
This is ``-sum(log pdf(x, theta), axis=0)`` where `theta` are the
parameters (including loc and scale).
'''
loc, scale, args = self._unpack_loc_scale(theta)
if not self._argc... | [
"def",
"nnlf",
"(",
"self",
",",
"theta",
",",
"x",
")",
":",
"loc",
",",
"scale",
",",
"args",
"=",
"self",
".",
"_unpack_loc_scale",
"(",
"theta",
")",
"if",
"not",
"self",
".",
"_argcheck",
"(",
"*",
"args",
")",
"or",
"scale",
"<=",
"0",
":",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/stats/_distn_infrastructure.py#L1990-L2005 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Tools/gdb/libpython.py | python | Frame.is_other_python_frame | (self) | return False | Is this frame worth displaying in python backtraces?
Examples:
- waiting on the GIL
- garbage-collecting
- within a CFunction
If it is, return a descriptive string
For other frames, return False | Is this frame worth displaying in python backtraces?
Examples:
- waiting on the GIL
- garbage-collecting
- within a CFunction
If it is, return a descriptive string
For other frames, return False | [
"Is",
"this",
"frame",
"worth",
"displaying",
"in",
"python",
"backtraces?",
"Examples",
":",
"-",
"waiting",
"on",
"the",
"GIL",
"-",
"garbage",
"-",
"collecting",
"-",
"within",
"a",
"CFunction",
"If",
"it",
"is",
"return",
"a",
"descriptive",
"string",
... | def is_other_python_frame(self):
'''Is this frame worth displaying in python backtraces?
Examples:
- waiting on the GIL
- garbage-collecting
- within a CFunction
If it is, return a descriptive string
For other frames, return False
'''
if s... | [
"def",
"is_other_python_frame",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_waiting_for_gil",
"(",
")",
":",
"return",
"'Waiting for the GIL'",
"if",
"self",
".",
"is_gc_collect",
"(",
")",
":",
"return",
"'Garbage-collecting'",
"# Detect invocations of PyCFunction ... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Tools/gdb/libpython.py#L1359-L1409 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/roc/hsadrv/devicearray.py | python | DeviceNDArray.is_c_contiguous | (self) | return self._dummy.is_c_contig | Return true if the array is C-contiguous. | Return true if the array is C-contiguous. | [
"Return",
"true",
"if",
"the",
"array",
"is",
"C",
"-",
"contiguous",
"."
] | def is_c_contiguous(self):
'''
Return true if the array is C-contiguous.
'''
return self._dummy.is_c_contig | [
"def",
"is_c_contiguous",
"(",
"self",
")",
":",
"return",
"self",
".",
"_dummy",
".",
"is_c_contig"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/roc/hsadrv/devicearray.py#L262-L266 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/models/embedding/word2vec_optimized.py | python | Word2Vec.train | (self) | Train the model. | Train the model. | [
"Train",
"the",
"model",
"."
] | def train(self):
"""Train the model."""
opts = self._options
initial_epoch, initial_words = self._session.run([self._epoch, self._words])
workers = []
for _ in xrange(opts.concurrent_steps):
t = threading.Thread(target=self._train_thread_body)
t.start()
workers.append(t)
las... | [
"def",
"train",
"(",
"self",
")",
":",
"opts",
"=",
"self",
".",
"_options",
"initial_epoch",
",",
"initial_words",
"=",
"self",
".",
"_session",
".",
"run",
"(",
"[",
"self",
".",
"_epoch",
",",
"self",
".",
"_words",
"]",
")",
"workers",
"=",
"[",
... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/models/embedding/word2vec_optimized.py#L310-L338 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/extras/run_m_script.py | python | apply_run_m_script | (tg) | Task generator customising the options etc. to call Matlab in batch
mode for running a m-script. | Task generator customising the options etc. to call Matlab in batch
mode for running a m-script. | [
"Task",
"generator",
"customising",
"the",
"options",
"etc",
".",
"to",
"call",
"Matlab",
"in",
"batch",
"mode",
"for",
"running",
"a",
"m",
"-",
"script",
"."
] | def apply_run_m_script(tg):
"""Task generator customising the options etc. to call Matlab in batch
mode for running a m-script.
"""
# Convert sources and targets to nodes
src_node = tg.path.find_resource(tg.source)
tgt_nodes = [tg.path.find_or_declare(t) for t in tg.to_list(tg.target)]
tsk = tg.create_task('r... | [
"def",
"apply_run_m_script",
"(",
"tg",
")",
":",
"# Convert sources and targets to nodes ",
"src_node",
"=",
"tg",
".",
"path",
".",
"find_resource",
"(",
"tg",
".",
"source",
")",
"tgt_nodes",
"=",
"[",
"tg",
".",
"path",
".",
"find_or_declare",
"(",
"t",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/extras/run_m_script.py#L66-L89 | ||
google-ar/WebARonTango | e86965d2cbc652156b480e0fcf77c716745578cd | chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py | python | DataHandler.WriteGetDataSizeCode | (self, func, f) | Overrriden from TypeHandler. | Overrriden from TypeHandler. | [
"Overrriden",
"from",
"TypeHandler",
"."
] | def WriteGetDataSizeCode(self, func, f):
"""Overrriden from TypeHandler."""
# TODO: Move this data to _FUNCTION_INFO?
name = func.name
if name.endswith("Immediate"):
name = name[0:-9]
if name == 'BufferData' or name == 'BufferSubData':
f.write(" uint32_t data_size = size;\n")
elif n... | [
"def",
"WriteGetDataSizeCode",
"(",
"self",
",",
"func",
",",
"f",
")",
":",
"# TODO: Move this data to _FUNCTION_INFO?",
"name",
"=",
"func",
".",
"name",
"if",
"name",
".",
"endswith",
"(",
"\"Immediate\"",
")",
":",
"name",
"=",
"name",
"[",
"0",
":",
"... | https://github.com/google-ar/WebARonTango/blob/e86965d2cbc652156b480e0fcf77c716745578cd/chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py#L5748-L5766 | ||
moflow/moflow | 2dfb27c799c90c6caf1477508eca3eec616ef7d2 | bap/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/cpp_message.py | python | _AddMessageMethods | (message_descriptor, cls) | Adds the methods to a protocol message class. | Adds the methods to a protocol message class. | [
"Adds",
"the",
"methods",
"to",
"a",
"protocol",
"message",
"class",
"."
] | def _AddMessageMethods(message_descriptor, cls):
"""Adds the methods to a protocol message class."""
if message_descriptor.is_extendable:
def ClearExtension(self, extension):
self.Extensions.ClearExtension(extension)
def HasExtension(self, extension):
return self.Extensions.HasExtension(extens... | [
"def",
"_AddMessageMethods",
"(",
"message_descriptor",
",",
"cls",
")",
":",
"if",
"message_descriptor",
".",
"is_extendable",
":",
"def",
"ClearExtension",
"(",
"self",
",",
"extension",
")",
":",
"self",
".",
"Extensions",
".",
"ClearExtension",
"(",
"extensi... | https://github.com/moflow/moflow/blob/2dfb27c799c90c6caf1477508eca3eec616ef7d2/bap/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/cpp_message.py#L508-L654 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/datetimes.py | python | DatetimeArray.to_pydatetime | (self) | return tslib.ints_to_pydatetime(self.asi8, tz=self.tz) | Return Datetime Array/Index as object ndarray of datetime.datetime
objects.
Returns
-------
datetimes : ndarray | Return Datetime Array/Index as object ndarray of datetime.datetime
objects. | [
"Return",
"Datetime",
"Array",
"/",
"Index",
"as",
"object",
"ndarray",
"of",
"datetime",
".",
"datetime",
"objects",
"."
] | def to_pydatetime(self):
"""
Return Datetime Array/Index as object ndarray of datetime.datetime
objects.
Returns
-------
datetimes : ndarray
"""
return tslib.ints_to_pydatetime(self.asi8, tz=self.tz) | [
"def",
"to_pydatetime",
"(",
"self",
")",
":",
"return",
"tslib",
".",
"ints_to_pydatetime",
"(",
"self",
".",
"asi8",
",",
"tz",
"=",
"self",
".",
"tz",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/datetimes.py#L995-L1004 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/preprocessing/_data.py | python | QuantileTransformer.fit | (self, X, y=None) | return self | Compute the quantiles used for transforming.
Parameters
----------
X : ndarray or sparse matrix, shape (n_samples, n_features)
The data used to scale along the features axis. If a sparse
matrix is provided, it will be converted into a sparse
``csc_matrix``. A... | Compute the quantiles used for transforming. | [
"Compute",
"the",
"quantiles",
"used",
"for",
"transforming",
"."
] | def fit(self, X, y=None):
"""Compute the quantiles used for transforming.
Parameters
----------
X : ndarray or sparse matrix, shape (n_samples, n_features)
The data used to scale along the features axis. If a sparse
matrix is provided, it will be converted into a... | [
"def",
"fit",
"(",
"self",
",",
"X",
",",
"y",
"=",
"None",
")",
":",
"if",
"self",
".",
"n_quantiles",
"<=",
"0",
":",
"raise",
"ValueError",
"(",
"\"Invalid value for 'n_quantiles': %d. \"",
"\"The number of quantiles must be at least one.\"",
"%",
"self",
".",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/preprocessing/_data.py#L2319-L2370 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/draftguitools/gui_mirror.py | python | Mirror.GetResources | (self) | return {'Pixmap': 'Draft_Mirror',
'Accel': "M, I",
'MenuText': QT_TRANSLATE_NOOP("Draft_Mirror", "Mirror"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Mirror", "Mirrors the selected objects along a line defined by two points.")} | Set icon, menu and tooltip. | Set icon, menu and tooltip. | [
"Set",
"icon",
"menu",
"and",
"tooltip",
"."
] | def GetResources(self):
"""Set icon, menu and tooltip."""
return {'Pixmap': 'Draft_Mirror',
'Accel': "M, I",
'MenuText': QT_TRANSLATE_NOOP("Draft_Mirror", "Mirror"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Mirror", "Mirrors the selected objects along a line d... | [
"def",
"GetResources",
"(",
"self",
")",
":",
"return",
"{",
"'Pixmap'",
":",
"'Draft_Mirror'",
",",
"'Accel'",
":",
"\"M, I\"",
",",
"'MenuText'",
":",
"QT_TRANSLATE_NOOP",
"(",
"\"Draft_Mirror\"",
",",
"\"Mirror\"",
")",
",",
"'ToolTip'",
":",
"QT_TRANSLATE_NO... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_mirror.py#L58-L64 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/lmbrwaflib/project_settings.py | python | get_bootstrap_remote_ip | (self) | return remote_ip | :param self:
:return: remote_ip set in bootstrap.cfg | :param self:
:return: remote_ip set in bootstrap.cfg | [
":",
"param",
"self",
":",
":",
"return",
":",
"remote_ip",
"set",
"in",
"bootstrap",
".",
"cfg"
] | def get_bootstrap_remote_ip(self):
"""
:param self:
:return: remote_ip set in bootstrap.cfg
"""
project_folder_node = getattr(self, 'srcnode', self.path)
bootstrap_cfg = project_folder_node.make_node('bootstrap.cfg')
bootstrap_contents = bootstrap_cfg.read()
remote_ip = '127.0.0.1'
t... | [
"def",
"get_bootstrap_remote_ip",
"(",
"self",
")",
":",
"project_folder_node",
"=",
"getattr",
"(",
"self",
",",
"'srcnode'",
",",
"self",
".",
"path",
")",
"bootstrap_cfg",
"=",
"project_folder_node",
".",
"make_node",
"(",
"'bootstrap.cfg'",
")",
"bootstrap_con... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/project_settings.py#L657-L670 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/dashboard/dashboard/add_point.py | python | _GetSupplementalColumns | (row) | return columns | Gets a dict of supplemental columns.
If any columns are invalid, a warning is logged and they just aren't included,
but no exception is raised.
Individual rows may specify up to _MAX_NUM_COLUMNS extra data, revision,
and annotation columns. These columns must follow formatting rules for
their type. Invalid ... | Gets a dict of supplemental columns. | [
"Gets",
"a",
"dict",
"of",
"supplemental",
"columns",
"."
] | def _GetSupplementalColumns(row):
"""Gets a dict of supplemental columns.
If any columns are invalid, a warning is logged and they just aren't included,
but no exception is raised.
Individual rows may specify up to _MAX_NUM_COLUMNS extra data, revision,
and annotation columns. These columns must follow form... | [
"def",
"_GetSupplementalColumns",
"(",
"row",
")",
":",
"columns",
"=",
"{",
"}",
"for",
"(",
"name",
",",
"value",
")",
"in",
"row",
".",
"get",
"(",
"'supplemental_columns'",
",",
"{",
"}",
")",
".",
"iteritems",
"(",
")",
":",
"# Don't allow too many ... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/add_point.py#L751-L778 | |
Constellation/iv | 64c3a9c7c517063f29d90d449180ea8f6f4d946f | tools/cpplint.py | python | _IncludeState.CanonicalizeAlphabeticalOrder | (self, header_path) | return header_path.replace('-inl.h', '.h').replace('-', '_').lower() | Returns a path canonicalized for alphabetical comparison.
- replaces "-" with "_" so they both cmp the same.
- removes '-inl' since we don't require them to be after the main header.
- lowercase everything, just in case.
Args:
header_path: Path to be canonicalized.
Returns:
Canonicali... | Returns a path canonicalized for alphabetical comparison. | [
"Returns",
"a",
"path",
"canonicalized",
"for",
"alphabetical",
"comparison",
"."
] | def CanonicalizeAlphabeticalOrder(self, header_path):
"""Returns a path canonicalized for alphabetical comparison.
- replaces "-" with "_" so they both cmp the same.
- removes '-inl' since we don't require them to be after the main header.
- lowercase everything, just in case.
Args:
header_p... | [
"def",
"CanonicalizeAlphabeticalOrder",
"(",
"self",
",",
"header_path",
")",
":",
"return",
"header_path",
".",
"replace",
"(",
"'-inl.h'",
",",
"'.h'",
")",
".",
"replace",
"(",
"'-'",
",",
"'_'",
")",
".",
"lower",
"(",
")"
] | https://github.com/Constellation/iv/blob/64c3a9c7c517063f29d90d449180ea8f6f4d946f/tools/cpplint.py#L585-L598 | |
protocolbuffers/protobuf | b5ab0b7a18b7336c60130f4ddb2d97c51792f896 | python/mox.py | python | IgnoreArg.equals | (self, unused_rhs) | return True | Ignores arguments and returns True.
Args:
unused_rhs: any python object
Returns:
always returns True | Ignores arguments and returns True. | [
"Ignores",
"arguments",
"and",
"returns",
"True",
"."
] | def equals(self, unused_rhs):
"""Ignores arguments and returns True.
Args:
unused_rhs: any python object
Returns:
always returns True
"""
return True | [
"def",
"equals",
"(",
"self",
",",
"unused_rhs",
")",
":",
"return",
"True"
] | https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/mox.py#L1166-L1176 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | ConfigBase.RenameGroup | (*args, **kwargs) | return _misc_.ConfigBase_RenameGroup(*args, **kwargs) | RenameGroup(self, String oldName, String newName) -> bool
Rename a group. Returns False on failure (probably because the new
name is already taken by an existing entry) | RenameGroup(self, String oldName, String newName) -> bool | [
"RenameGroup",
"(",
"self",
"String",
"oldName",
"String",
"newName",
")",
"-",
">",
"bool"
] | def RenameGroup(*args, **kwargs):
"""
RenameGroup(self, String oldName, String newName) -> bool
Rename a group. Returns False on failure (probably because the new
name is already taken by an existing entry)
"""
return _misc_.ConfigBase_RenameGroup(*args, **kwargs) | [
"def",
"RenameGroup",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"ConfigBase_RenameGroup",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L3336-L3343 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/symbol/symbol.py | python | Symbol.list_auxiliary_states | (self) | return [py_str(sarr[i]) for i in range(size.value)] | Lists all the auxiliary states in the symbol.
Example
-------
>>> a = mx.sym.var('a')
>>> b = mx.sym.var('b')
>>> c = a + b
>>> c.list_auxiliary_states()
[]
Example of auxiliary states in `BatchNorm`.
>>> data = mx.symbol.Variable('data')
... | Lists all the auxiliary states in the symbol. | [
"Lists",
"all",
"the",
"auxiliary",
"states",
"in",
"the",
"symbol",
"."
] | def list_auxiliary_states(self):
"""Lists all the auxiliary states in the symbol.
Example
-------
>>> a = mx.sym.var('a')
>>> b = mx.sym.var('b')
>>> c = a + b
>>> c.list_auxiliary_states()
[]
Example of auxiliary states in `BatchNorm`.
... | [
"def",
"list_auxiliary_states",
"(",
"self",
")",
":",
"size",
"=",
"ctypes",
".",
"c_uint",
"(",
")",
"sarr",
"=",
"ctypes",
".",
"POINTER",
"(",
"ctypes",
".",
"c_char_p",
")",
"(",
")",
"check_call",
"(",
"_LIB",
".",
"MXSymbolListAuxiliaryStates",
"(",... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/symbol/symbol.py#L748-L784 | |
yrnkrn/zapcc | c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50 | tools/clang/bindings/python/clang/cindex.py | python | Cursor.exception_specification_kind | (self) | return self._exception_specification_kind | Retrieve the exception specification kind, which is one of the values
from the ExceptionSpecificationKind enumeration. | Retrieve the exception specification kind, which is one of the values
from the ExceptionSpecificationKind enumeration. | [
"Retrieve",
"the",
"exception",
"specification",
"kind",
"which",
"is",
"one",
"of",
"the",
"values",
"from",
"the",
"ExceptionSpecificationKind",
"enumeration",
"."
] | def exception_specification_kind(self):
'''
Retrieve the exception specification kind, which is one of the values
from the ExceptionSpecificationKind enumeration.
'''
if not hasattr(self, '_exception_specification_kind'):
exc_kind = conf.lib.clang_getCursorExceptionSp... | [
"def",
"exception_specification_kind",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_exception_specification_kind'",
")",
":",
"exc_kind",
"=",
"conf",
".",
"lib",
".",
"clang_getCursorExceptionSpecificationType",
"(",
"self",
")",
"self",
".... | https://github.com/yrnkrn/zapcc/blob/c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50/tools/clang/bindings/python/clang/cindex.py#L1652-L1661 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/sparse/linalg/_expm_multiply.py | python | LazyOperatorNormInfo.__init__ | (self, A, A_1_norm=None, ell=2, scale=1) | Provide the operator and some norm-related information.
Parameters
----------
A : linear operator
The operator of interest.
A_1_norm : float, optional
The exact 1-norm of A.
ell : int, optional
A technical parameter controlling norm estimation... | Provide the operator and some norm-related information. | [
"Provide",
"the",
"operator",
"and",
"some",
"norm",
"-",
"related",
"information",
"."
] | def __init__(self, A, A_1_norm=None, ell=2, scale=1):
"""
Provide the operator and some norm-related information.
Parameters
----------
A : linear operator
The operator of interest.
A_1_norm : float, optional
The exact 1-norm of A.
ell : i... | [
"def",
"__init__",
"(",
"self",
",",
"A",
",",
"A_1_norm",
"=",
"None",
",",
"ell",
"=",
"2",
",",
"scale",
"=",
"1",
")",
":",
"self",
".",
"_A",
"=",
"A",
"self",
".",
"_A_1_norm",
"=",
"A_1_norm",
"self",
".",
"_ell",
"=",
"ell",
"self",
"."... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/sparse/linalg/_expm_multiply.py#L316-L336 | ||
msracver/Deep-Image-Analogy | 632b9287b42552e32dad64922967c8c9ec7fc4d3 | python/caffe/io.py | python | Transformer.set_raw_scale | (self, in_, scale) | Set the scale of raw features s.t. the input blob = input * scale.
While Python represents images in [0, 1], certain Caffe models
like CaffeNet and AlexNet represent images in [0, 255] so the raw_scale
of these models must be 255.
Parameters
----------
in_ : which input ... | Set the scale of raw features s.t. the input blob = input * scale.
While Python represents images in [0, 1], certain Caffe models
like CaffeNet and AlexNet represent images in [0, 255] so the raw_scale
of these models must be 255. | [
"Set",
"the",
"scale",
"of",
"raw",
"features",
"s",
".",
"t",
".",
"the",
"input",
"blob",
"=",
"input",
"*",
"scale",
".",
"While",
"Python",
"represents",
"images",
"in",
"[",
"0",
"1",
"]",
"certain",
"Caffe",
"models",
"like",
"CaffeNet",
"and",
... | def set_raw_scale(self, in_, scale):
"""
Set the scale of raw features s.t. the input blob = input * scale.
While Python represents images in [0, 1], certain Caffe models
like CaffeNet and AlexNet represent images in [0, 255] so the raw_scale
of these models must be 255.
... | [
"def",
"set_raw_scale",
"(",
"self",
",",
"in_",
",",
"scale",
")",
":",
"self",
".",
"__check_input",
"(",
"in_",
")",
"self",
".",
"raw_scale",
"[",
"in_",
"]",
"=",
"scale"
] | https://github.com/msracver/Deep-Image-Analogy/blob/632b9287b42552e32dad64922967c8c9ec7fc4d3/python/caffe/io.py#L221-L234 | ||
scribusproject/scribus | 41ec7c775a060912cf251682a8b1437f753f80f4 | scribus/plugins/scriptplugin_py2x/scripts/color2csv.py | python | main_wrapper | (argv) | The main_wrapper() function disables redrawing, sets a sensible generic
status bar message, and optionally sets up the progress bar. It then runs
the main() function. Once everything finishes it cleans up after the main()
function, making sure everything is sane before the script terminates. | The main_wrapper() function disables redrawing, sets a sensible generic
status bar message, and optionally sets up the progress bar. It then runs
the main() function. Once everything finishes it cleans up after the main()
function, making sure everything is sane before the script terminates. | [
"The",
"main_wrapper",
"()",
"function",
"disables",
"redrawing",
"sets",
"a",
"sensible",
"generic",
"status",
"bar",
"message",
"and",
"optionally",
"sets",
"up",
"the",
"progress",
"bar",
".",
"It",
"then",
"runs",
"the",
"main",
"()",
"function",
".",
"O... | def main_wrapper(argv):
"""The main_wrapper() function disables redrawing, sets a sensible generic
status bar message, and optionally sets up the progress bar. It then runs
the main() function. Once everything finishes it cleans up after the main()
function, making sure everything is sane before the scr... | [
"def",
"main_wrapper",
"(",
"argv",
")",
":",
"try",
":",
"#scribus.statusMessage(\"Running script...\")",
"#scribus.progressReset()",
"main",
"(",
"argv",
")",
"finally",
":",
"# Exit neatly even if the script terminated with an exception,",
"# so we leave the progress bar and sta... | https://github.com/scribusproject/scribus/blob/41ec7c775a060912cf251682a8b1437f753f80f4/scribus/plugins/scriptplugin_py2x/scripts/color2csv.py#L138-L154 | ||
geemaple/leetcode | 68bc5032e1ee52c22ef2f2e608053484c487af54 | leetcode/407.trapping-rain-water-ii.py | python | Solution.trapRainWater | (self, heightMap) | return result | :type heightMap: List[List[int]]
:rtype: int | :type heightMap: List[List[int]]
:rtype: int | [
":",
"type",
"heightMap",
":",
"List",
"[",
"List",
"[",
"int",
"]]",
":",
"rtype",
":",
"int"
] | def trapRainWater(self, heightMap):
"""
:type heightMap: List[List[int]]
:rtype: int
"""
if heightMap is None or len(heightMap) < 3 or len(heightMap[0]) < 3:
return 0
row = len(heightMap)
col = len(heightMap[0])
self.initialize(heightMap, row... | [
"def",
"trapRainWater",
"(",
"self",
",",
"heightMap",
")",
":",
"if",
"heightMap",
"is",
"None",
"or",
"len",
"(",
"heightMap",
")",
"<",
"3",
"or",
"len",
"(",
"heightMap",
"[",
"0",
"]",
")",
"<",
"3",
":",
"return",
"0",
"row",
"=",
"len",
"(... | https://github.com/geemaple/leetcode/blob/68bc5032e1ee52c22ef2f2e608053484c487af54/leetcode/407.trapping-rain-water-ii.py#L10-L34 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/closure_linter/closure_linter/statetracker.py | python | DocComment.ordered_params | (self) | return params | Gives the list of parameter names as a list of strings. | Gives the list of parameter names as a list of strings. | [
"Gives",
"the",
"list",
"of",
"parameter",
"names",
"as",
"a",
"list",
"of",
"strings",
"."
] | def ordered_params(self):
"""Gives the list of parameter names as a list of strings."""
params = []
for flag in self.__flags:
if flag.flag_type == 'param' and flag.name:
params.append(flag.name)
return params | [
"def",
"ordered_params",
"(",
"self",
")",
":",
"params",
"=",
"[",
"]",
"for",
"flag",
"in",
"self",
".",
"__flags",
":",
"if",
"flag",
".",
"flag_type",
"==",
"'param'",
"and",
"flag",
".",
"name",
":",
"params",
".",
"append",
"(",
"flag",
".",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/statetracker.py#L329-L335 | |
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/gyp/buildtime_helpers/mac_tool.py | python | MacTool._GetSubstitutions | (self, bundle_identifier, app_identifier_prefix) | return {
'CFBundleIdentifier': bundle_identifier,
'AppIdentifierPrefix': app_identifier_prefix,
} | Constructs a dictionary of variable substitutions for Entitlements.plist.
Args:
bundle_identifier: string, value of CFBundleIdentifier from Info.plist
app_identifier_prefix: string, value for AppIdentifierPrefix
Returns:
Dictionary of substitutions to apply when generating Entitlements.plist... | Constructs a dictionary of variable substitutions for Entitlements.plist. | [
"Constructs",
"a",
"dictionary",
"of",
"variable",
"substitutions",
"for",
"Entitlements",
".",
"plist",
"."
] | def _GetSubstitutions(self, bundle_identifier, app_identifier_prefix):
"""Constructs a dictionary of variable substitutions for Entitlements.plist.
Args:
bundle_identifier: string, value of CFBundleIdentifier from Info.plist
app_identifier_prefix: string, value for AppIdentifierPrefix
Returns:... | [
"def",
"_GetSubstitutions",
"(",
"self",
",",
"bundle_identifier",
",",
"app_identifier_prefix",
")",
":",
"return",
"{",
"'CFBundleIdentifier'",
":",
"bundle_identifier",
",",
"'AppIdentifierPrefix'",
":",
"app_identifier_prefix",
",",
"}"
] | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/buildtime_helpers/mac_tool.py#L569-L582 | |
PixarAnimationStudios/USD | faed18ce62c8736b02413635b584a2f637156bad | pxr/usdImaging/usdviewq/selectionDataModel.py | python | Blocker.__exit__ | (self, *args) | Exit the 'blocked' state. | Exit the 'blocked' state. | [
"Exit",
"the",
"blocked",
"state",
"."
] | def __exit__(self, *args):
"""Exit the 'blocked' state."""
self._count -= 1
if not self.blocked():
self._exitCallback() | [
"def",
"__exit__",
"(",
"self",
",",
"*",
"args",
")",
":",
"self",
".",
"_count",
"-=",
"1",
"if",
"not",
"self",
".",
"blocked",
"(",
")",
":",
"self",
".",
"_exitCallback",
"(",
")"
] | https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/selectionDataModel.py#L59-L65 | ||
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/lfu-cache.py | python | LFUCache2.put | (self, key, value) | :type key: int
:type value: int
:rtype: void | :type key: int
:type value: int
:rtype: void | [
":",
"type",
"key",
":",
"int",
":",
"type",
"value",
":",
"int",
":",
"rtype",
":",
"void"
] | def put(self, key, value):
"""
:type key: int
:type value: int
:rtype: void
"""
if self.__capa <= 0:
return
if key not in self.__key_to_node and self.__size == self.__capa:
del self.__key_to_node[self.__freq_to_nodes[self.__min_freq].head.... | [
"def",
"put",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"if",
"self",
".",
"__capa",
"<=",
"0",
":",
"return",
"if",
"key",
"not",
"in",
"self",
".",
"__key_to_node",
"and",
"self",
".",
"__size",
"==",
"self",
".",
"__capa",
":",
"del",
"... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/lfu-cache.py#L128-L143 | ||
neoml-lib/neoml | a0d370fba05269a1b2258cef126f77bbd2054a3e | NeoML/Python/neoml/DifferentialEvolution.py | python | DifferentialEvolution.population | (self) | return self.internal.get_population() | Gets the resulting population.
:return: the population on the current step.
:rtype: *array-like of shape {population, vector_length}* | Gets the resulting population. | [
"Gets",
"the",
"resulting",
"population",
"."
] | def population(self):
"""Gets the resulting population.
:return: the population on the current step.
:rtype: *array-like of shape {population, vector_length}*
"""
return self.internal.get_population() | [
"def",
"population",
"(",
"self",
")",
":",
"return",
"self",
".",
"internal",
".",
"get_population",
"(",
")"
] | https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/DifferentialEvolution.py#L295-L301 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/platform.py | python | win32_ver | (release='',version='',csd='',ptype='') | return release,version,csd,ptype | Get additional version information from the Windows Registry
and return a tuple (version,csd,ptype) referring to version
number, CSD level (service pack), and OS type (multi/single
processor).
As a hint: ptype returns 'Uniprocessor Free' on single
processor NT machines and 'Mult... | Get additional version information from the Windows Registry
and return a tuple (version,csd,ptype) referring to version
number, CSD level (service pack), and OS type (multi/single
processor). | [
"Get",
"additional",
"version",
"information",
"from",
"the",
"Windows",
"Registry",
"and",
"return",
"a",
"tuple",
"(",
"version",
"csd",
"ptype",
")",
"referring",
"to",
"version",
"number",
"CSD",
"level",
"(",
"service",
"pack",
")",
"and",
"OS",
"type",... | def win32_ver(release='',version='',csd='',ptype=''):
""" Get additional version information from the Windows Registry
and return a tuple (version,csd,ptype) referring to version
number, CSD level (service pack), and OS type (multi/single
processor).
As a hint: ptype returns 'Unipr... | [
"def",
"win32_ver",
"(",
"release",
"=",
"''",
",",
"version",
"=",
"''",
",",
"csd",
"=",
"''",
",",
"ptype",
"=",
"''",
")",
":",
"# XXX Is there any way to find out the processor type on WinXX ?",
"# XXX Is win32 available on Windows CE ?",
"#",
"# Adapted from code ... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/platform.py#L553-L716 | |
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | bindings/python/cntk/ops/functions.py | python | Function.__getattr__ | (self, name) | return getattr(outputs[0], name) | Access a member inside this object.
Members of ``Function`` can be accessed directly.
In addition, members of the Function's output, if only one, are accessed here.
Lastly, this also gives access to Functions and Variables inside this Function's
graph by their user-specified name, e.g. `... | Access a member inside this object.
Members of ``Function`` can be accessed directly.
In addition, members of the Function's output, if only one, are accessed here.
Lastly, this also gives access to Functions and Variables inside this Function's
graph by their user-specified name, e.g. `... | [
"Access",
"a",
"member",
"inside",
"this",
"object",
".",
"Members",
"of",
"Function",
"can",
"be",
"accessed",
"directly",
".",
"In",
"addition",
"members",
"of",
"the",
"Function",
"s",
"output",
"if",
"only",
"one",
"are",
"accessed",
"here",
".",
"Last... | def __getattr__(self, name):
'''
Access a member inside this object.
Members of ``Function`` can be accessed directly.
In addition, members of the Function's output, if only one, are accessed here.
Lastly, this also gives access to Functions and Variables inside this Function's
... | [
"def",
"__getattr__",
"(",
"self",
",",
"name",
")",
":",
"# If name is not a member of Function or Variable, first look for",
"# a user-named item in the graph.",
"# (Known member names cannot be overridden by user-named items,",
"# to ensure that the API functions.)",
"if",
"not",
"has... | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/ops/functions.py#L478-L524 | |
kushview/Element | 1cc16380caa2ab79461246ba758b9de1f46db2a5 | waflib/extras/ticgt.py | python | c_hook | (self, node) | Bind the c file extension to the creation of a :py:class:`waflib.Tools.c.c` instance | Bind the c file extension to the creation of a :py:class:`waflib.Tools.c.c` instance | [
"Bind",
"the",
"c",
"file",
"extension",
"to",
"the",
"creation",
"of",
"a",
":",
"py",
":",
"class",
":",
"waflib",
".",
"Tools",
".",
"c",
".",
"c",
"instance"
] | def c_hook(self, node):
"Bind the c file extension to the creation of a :py:class:`waflib.Tools.c.c` instance"
if self.env.CC_NAME == 'ticc':
return create_compiled_task(self, 'ti_c', node)
else:
return self.create_compiled_task('c', node) | [
"def",
"c_hook",
"(",
"self",
",",
"node",
")",
":",
"if",
"self",
".",
"env",
".",
"CC_NAME",
"==",
"'ticc'",
":",
"return",
"create_compiled_task",
"(",
"self",
",",
"'ti_c'",
",",
"node",
")",
"else",
":",
"return",
"self",
".",
"create_compiled_task"... | https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/extras/ticgt.py#L218-L223 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/fastparquet/writer.py | python | find_max_part | (row_groups) | Find the highest integer matching "**part.*.parquet" in referenced paths. | Find the highest integer matching "**part.*.parquet" in referenced paths. | [
"Find",
"the",
"highest",
"integer",
"matching",
"**",
"part",
".",
"*",
".",
"parquet",
"in",
"referenced",
"paths",
"."
] | def find_max_part(row_groups):
"""
Find the highest integer matching "**part.*.parquet" in referenced paths.
"""
paths = [c.file_path or "" for rg in row_groups for c in rg.columns]
s = re.compile(r'.*part.(?P<i>[\d]+).parquet$')
matches = [s.match(path) for path in paths]
nums = [int(match.... | [
"def",
"find_max_part",
"(",
"row_groups",
")",
":",
"paths",
"=",
"[",
"c",
".",
"file_path",
"or",
"\"\"",
"for",
"rg",
"in",
"row_groups",
"for",
"c",
"in",
"rg",
".",
"columns",
"]",
"s",
"=",
"re",
".",
"compile",
"(",
"r'.*part.(?P<i>[\\d]+).parque... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/fastparquet/writer.py#L924-L935 | ||
CoolProp/CoolProp | 381c8535e5dec3eec27ad430ebbfff8bc9dfc008 | dev/scripts/ECS_fitter.py | python | viscosity_dilute | (fluid, T, e_k, sigma) | return eta_star | T in [K], e_K in [K], sigma in [nm]
viscosity returned is in [Pa-s] | T in [K], e_K in [K], sigma in [nm]
viscosity returned is in [Pa-s] | [
"T",
"in",
"[",
"K",
"]",
"e_K",
"in",
"[",
"K",
"]",
"sigma",
"in",
"[",
"nm",
"]",
"viscosity",
"returned",
"is",
"in",
"[",
"Pa",
"-",
"s",
"]"
] | def viscosity_dilute(fluid, T, e_k, sigma):
"""
T in [K], e_K in [K], sigma in [nm]
viscosity returned is in [Pa-s]
"""
Tstar = T / e_k
molemass = CoolProp.CoolProp.PropsSI(fluid, 'molemass') * 1000
# From Neufeld, 1972, Journal of Chemical Physics - checked coefficients
OMEGA_2_2 = 1.1... | [
"def",
"viscosity_dilute",
"(",
"fluid",
",",
"T",
",",
"e_k",
",",
"sigma",
")",
":",
"Tstar",
"=",
"T",
"/",
"e_k",
"molemass",
"=",
"CoolProp",
".",
"CoolProp",
".",
"PropsSI",
"(",
"fluid",
",",
"'molemass'",
")",
"*",
"1000",
"# From Neufeld, 1972, ... | https://github.com/CoolProp/CoolProp/blob/381c8535e5dec3eec27ad430ebbfff8bc9dfc008/dev/scripts/ECS_fitter.py#L11-L23 | |
lmb-freiburg/flownet2 | b92e198b56b0e52e1ba0a5a98dc0e39fa5ae70cc | scripts/cpp_lint.py | python | FileInfo.IsSource | (self) | return self.Extension()[1:] in ('c', 'cc', 'cpp', 'cxx') | File has a source file extension. | File has a source file extension. | [
"File",
"has",
"a",
"source",
"file",
"extension",
"."
] | def IsSource(self):
"""File has a source file extension."""
return self.Extension()[1:] in ('c', 'cc', 'cpp', 'cxx') | [
"def",
"IsSource",
"(",
"self",
")",
":",
"return",
"self",
".",
"Extension",
"(",
")",
"[",
"1",
":",
"]",
"in",
"(",
"'c'",
",",
"'cc'",
",",
"'cpp'",
",",
"'cxx'",
")"
] | https://github.com/lmb-freiburg/flownet2/blob/b92e198b56b0e52e1ba0a5a98dc0e39fa5ae70cc/scripts/cpp_lint.py#L956-L958 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextParagraph_GetDefaultTabs | (*args) | return _richtext.RichTextParagraph_GetDefaultTabs(*args) | RichTextParagraph_GetDefaultTabs() -> wxArrayInt | RichTextParagraph_GetDefaultTabs() -> wxArrayInt | [
"RichTextParagraph_GetDefaultTabs",
"()",
"-",
">",
"wxArrayInt"
] | def RichTextParagraph_GetDefaultTabs(*args):
"""RichTextParagraph_GetDefaultTabs() -> wxArrayInt"""
return _richtext.RichTextParagraph_GetDefaultTabs(*args) | [
"def",
"RichTextParagraph_GetDefaultTabs",
"(",
"*",
"args",
")",
":",
"return",
"_richtext",
".",
"RichTextParagraph_GetDefaultTabs",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L2076-L2078 | |
shedskin/shedskin | ae88dbca7b1d9671cd8be448cb0b497122758936 | examples/mm/code.py | python | Code.compare | (self,code) | return Code(resultPegs) | Black pegs first: correct colour in correct position | Black pegs first: correct colour in correct position | [
"Black",
"pegs",
"first",
":",
"correct",
"colour",
"in",
"correct",
"position"
] | def compare(self,code):
resultPegs = []
secretUsed = []
guessUsed = []
count = 0
codeLength = len(self.__pegList)
for i in range(codeLength):
secretUsed.append(False)
guessUsed.append(False)
"""
Black pegs first: correct colour... | [
"def",
"compare",
"(",
"self",
",",
"code",
")",
":",
"resultPegs",
"=",
"[",
"]",
"secretUsed",
"=",
"[",
"]",
"guessUsed",
"=",
"[",
"]",
"count",
"=",
"0",
"codeLength",
"=",
"len",
"(",
"self",
".",
"__pegList",
")",
"for",
"i",
"in",
"range",
... | https://github.com/shedskin/shedskin/blob/ae88dbca7b1d9671cd8be448cb0b497122758936/examples/mm/code.py#L40-L84 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/idlelib/HyperParser.py | python | HyperParser.__init__ | (self, editwin, index) | To initialize, analyze the surroundings of the given index. | To initialize, analyze the surroundings of the given index. | [
"To",
"initialize",
"analyze",
"the",
"surroundings",
"of",
"the",
"given",
"index",
"."
] | def __init__(self, editwin, index):
"To initialize, analyze the surroundings of the given index."
self.editwin = editwin
self.text = text = editwin.text
parser = PyParse.Parser(editwin.indentwidth, editwin.tabwidth)
def index2line(index):
return int(float(index))
... | [
"def",
"__init__",
"(",
"self",
",",
"editwin",
",",
"index",
")",
":",
"self",
".",
"editwin",
"=",
"editwin",
"self",
".",
"text",
"=",
"text",
"=",
"editwin",
".",
"text",
"parser",
"=",
"PyParse",
".",
"Parser",
"(",
"editwin",
".",
"indentwidth",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/idlelib/HyperParser.py#L14-L67 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/closure_linter/closure_linter/javascriptlintrules.py | python | JavaScriptLintRules.GetLongLineExceptions | (self) | return [
re.compile('goog\.require\(.+\);?\s*$'),
re.compile('goog\.provide\(.+\);?\s*$')
] | Gets a list of regexps for lines which can be longer than the limit. | Gets a list of regexps for lines which can be longer than the limit. | [
"Gets",
"a",
"list",
"of",
"regexps",
"for",
"lines",
"which",
"can",
"be",
"longer",
"than",
"the",
"limit",
"."
] | def GetLongLineExceptions(self):
"""Gets a list of regexps for lines which can be longer than the limit."""
return [
re.compile('goog\.require\(.+\);?\s*$'),
re.compile('goog\.provide\(.+\);?\s*$')
] | [
"def",
"GetLongLineExceptions",
"(",
"self",
")",
":",
"return",
"[",
"re",
".",
"compile",
"(",
"'goog\\.require\\(.+\\);?\\s*$'",
")",
",",
"re",
".",
"compile",
"(",
"'goog\\.provide\\(.+\\);?\\s*$'",
")",
"]"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/closure_linter/closure_linter/javascriptlintrules.py#L533-L538 | |
scylladb/seastar | 0cdd2329beb1cc4c0af8828598c26114397ffa9c | scripts/perftune.py | python | DiskPerfTuner.__get_io_scheduler | (self, dev_node) | return next((scheduler for scheduler in self.__io_schedulers if scheduler in supported_schedulers), None) | Return a supported scheduler that is also present in the required schedulers list (__io_schedulers).
If there isn't such a supported scheduler - return None. | Return a supported scheduler that is also present in the required schedulers list (__io_schedulers). | [
"Return",
"a",
"supported",
"scheduler",
"that",
"is",
"also",
"present",
"in",
"the",
"required",
"schedulers",
"list",
"(",
"__io_schedulers",
")",
"."
] | def __get_io_scheduler(self, dev_node):
"""
Return a supported scheduler that is also present in the required schedulers list (__io_schedulers).
If there isn't such a supported scheduler - return None.
"""
feature_file, feature_node = self.__get_feature_file(dev_node, lambda p :... | [
"def",
"__get_io_scheduler",
"(",
"self",
",",
"dev_node",
")",
":",
"feature_file",
",",
"feature_node",
"=",
"self",
".",
"__get_feature_file",
"(",
"dev_node",
",",
"lambda",
"p",
":",
"os",
".",
"path",
".",
"join",
"(",
"p",
",",
"'queue'",
",",
"'s... | https://github.com/scylladb/seastar/blob/0cdd2329beb1cc4c0af8828598c26114397ffa9c/scripts/perftune.py#L1254-L1274 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/cffi/api.py | python | FFI.cast | (self, cdecl, source) | return self._backend.cast(cdecl, source) | Similar to a C cast: returns an instance of the named C
type initialized with the given 'source'. The source is
casted between integers or pointers of any type. | Similar to a C cast: returns an instance of the named C
type initialized with the given 'source'. The source is
casted between integers or pointers of any type. | [
"Similar",
"to",
"a",
"C",
"cast",
":",
"returns",
"an",
"instance",
"of",
"the",
"named",
"C",
"type",
"initialized",
"with",
"the",
"given",
"source",
".",
"The",
"source",
"is",
"casted",
"between",
"integers",
"or",
"pointers",
"of",
"any",
"type",
"... | def cast(self, cdecl, source):
"""Similar to a C cast: returns an instance of the named C
type initialized with the given 'source'. The source is
casted between integers or pointers of any type.
"""
if isinstance(cdecl, basestring):
cdecl = self._typeof(cdecl)
... | [
"def",
"cast",
"(",
"self",
",",
"cdecl",
",",
"source",
")",
":",
"if",
"isinstance",
"(",
"cdecl",
",",
"basestring",
")",
":",
"cdecl",
"=",
"self",
".",
"_typeof",
"(",
"cdecl",
")",
"return",
"self",
".",
"_backend",
".",
"cast",
"(",
"cdecl",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/cffi/api.py#L293-L300 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/math/optimize.py | python | OptimizationProblemBuilder.unbind | (self,**kwargs) | return res | Binds the variables specified by the keyword arguments | Binds the variables specified by the keyword arguments | [
"Binds",
"the",
"variables",
"specified",
"by",
"the",
"keyword",
"arguments"
] | def unbind(self,**kwargs):
"""Binds the variables specified by the keyword arguments"""
for (k,v) in kwargs:
self.context.variableDict[k].unbind()
return res | [
"def",
"unbind",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"for",
"(",
"k",
",",
"v",
")",
"in",
"kwargs",
":",
"self",
".",
"context",
".",
"variableDict",
"[",
"k",
"]",
".",
"unbind",
"(",
")",
"return",
"res"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/math/optimize.py#L860-L864 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AzCodeGenerator/bin/osx/az_code_gen/clang_cpp.py | python | extract_parameters | (string_data) | Extract and return the parameters contained in parenthesis
of a parametrized JSON entry in a string.
For example:
"Token(Parameter)" would return "Parameter"
Note: The incoming string must be validated by is_parametrized_token
@param string_data - The incoming string to extract parameters from
@... | Extract and return the parameters contained in parenthesis
of a parametrized JSON entry in a string.
For example:
"Token(Parameter)" would return "Parameter"
Note: The incoming string must be validated by is_parametrized_token | [
"Extract",
"and",
"return",
"the",
"parameters",
"contained",
"in",
"parenthesis",
"of",
"a",
"parametrized",
"JSON",
"entry",
"in",
"a",
"string",
".",
"For",
"example",
":",
"Token",
"(",
"Parameter",
")",
"would",
"return",
"Parameter",
"Note",
":",
"The"... | def extract_parameters(string_data):
"""Extract and return the parameters contained in parenthesis
of a parametrized JSON entry in a string.
For example:
"Token(Parameter)" would return "Parameter"
Note: The incoming string must be validated by is_parametrized_token
@param string_data - The inco... | [
"def",
"extract_parameters",
"(",
"string_data",
")",
":",
"parenthesis_depth",
"=",
"0",
"open_index",
"=",
"0",
"close_index",
"=",
"0",
"index",
"=",
"0",
"string_checker",
"=",
"string_detector",
"(",
"string_data",
")",
"for",
"c",
"in",
"string_data",
":... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AzCodeGenerator/bin/osx/az_code_gen/clang_cpp.py#L506-L541 | ||
netease-youdao/hex | d7b8773dae8dde63f3807cef1d48c017077db727 | tools/git_util.py | python | get_changed_files | (path=".") | return [] | Retrieves the list of changed files. | Retrieves the list of changed files. | [
"Retrieves",
"the",
"list",
"of",
"changed",
"files",
"."
] | def get_changed_files(path="."):
""" Retrieves the list of changed files. """
# not implemented
return [] | [
"def",
"get_changed_files",
"(",
"path",
"=",
"\".\"",
")",
":",
"# not implemented",
"return",
"[",
"]"
] | https://github.com/netease-youdao/hex/blob/d7b8773dae8dde63f3807cef1d48c017077db727/tools/git_util.py#L21-L24 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/debug/cli/command_parser.py | python | parse_readable_time_str | (time_str) | return int(parse_positive_float(time_str)) | Parses a time string in the format N, Nus, Nms, Ns.
Args:
time_str: (`str`) string consisting of an integer time value optionally
followed by 'us', 'ms', or 's' suffix. If suffix is not specified,
value is assumed to be in microseconds. (e.g. 100us, 8ms, 5s, 100).
Returns:
Microseconds value. | Parses a time string in the format N, Nus, Nms, Ns. | [
"Parses",
"a",
"time",
"string",
"in",
"the",
"format",
"N",
"Nus",
"Nms",
"Ns",
"."
] | def parse_readable_time_str(time_str):
"""Parses a time string in the format N, Nus, Nms, Ns.
Args:
time_str: (`str`) string consisting of an integer time value optionally
followed by 'us', 'ms', or 's' suffix. If suffix is not specified,
value is assumed to be in microseconds. (e.g. 100us, 8ms, 5s... | [
"def",
"parse_readable_time_str",
"(",
"time_str",
")",
":",
"def",
"parse_positive_float",
"(",
"value_str",
")",
":",
"value",
"=",
"float",
"(",
"value_str",
")",
"if",
"value",
"<",
"0",
":",
"raise",
"ValueError",
"(",
"\"Invalid time %s. Time value must be p... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/debug/cli/command_parser.py#L442-L467 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | DateSpan.GetYears | (*args, **kwargs) | return _misc_.DateSpan_GetYears(*args, **kwargs) | GetYears(self) -> int | GetYears(self) -> int | [
"GetYears",
"(",
"self",
")",
"-",
">",
"int"
] | def GetYears(*args, **kwargs):
"""GetYears(self) -> int"""
return _misc_.DateSpan_GetYears(*args, **kwargs) | [
"def",
"GetYears",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateSpan_GetYears",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L4669-L4671 | |
trailofbits/llvm-sanitizer-tutorial | d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99 | llvm/tools/clang/bindings/python/clang/cindex.py | python | BaseEnumeration.name | (self) | return self._name_map[self] | Get the enumeration name of this cursor kind. | Get the enumeration name of this cursor kind. | [
"Get",
"the",
"enumeration",
"name",
"of",
"this",
"cursor",
"kind",
"."
] | def name(self):
"""Get the enumeration name of this cursor kind."""
if self._name_map is None:
self._name_map = {}
for key, value in self.__class__.__dict__.items():
if isinstance(value, self.__class__):
self._name_map[value] = key
retu... | [
"def",
"name",
"(",
"self",
")",
":",
"if",
"self",
".",
"_name_map",
"is",
"None",
":",
"self",
".",
"_name_map",
"=",
"{",
"}",
"for",
"key",
",",
"value",
"in",
"self",
".",
"__class__",
".",
"__dict__",
".",
"items",
"(",
")",
":",
"if",
"isi... | https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/tools/clang/bindings/python/clang/cindex.py#L639-L646 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | FileCtrl.GetFilenames | (*args, **kwargs) | return _controls_.FileCtrl_GetFilenames(*args, **kwargs) | GetFilenames(self) -> wxArrayString | GetFilenames(self) -> wxArrayString | [
"GetFilenames",
"(",
"self",
")",
"-",
">",
"wxArrayString"
] | def GetFilenames(*args, **kwargs):
"""GetFilenames(self) -> wxArrayString"""
return _controls_.FileCtrl_GetFilenames(*args, **kwargs) | [
"def",
"GetFilenames",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"FileCtrl_GetFilenames",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L7608-L7610 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/logging/handlers.py | python | BaseRotatingHandler.rotate | (self, source, dest) | When rotating, rotate the current log.
The default implementation calls the 'rotator' attribute of the
handler, if it's callable, passing the source and dest arguments to
it. If the attribute isn't callable (the default is None), the source
is simply renamed to the destination.
... | When rotating, rotate the current log. | [
"When",
"rotating",
"rotate",
"the",
"current",
"log",
"."
] | def rotate(self, source, dest):
"""
When rotating, rotate the current log.
The default implementation calls the 'rotator' attribute of the
handler, if it's callable, passing the source and dest arguments to
it. If the attribute isn't callable (the default is None), the source
... | [
"def",
"rotate",
"(",
"self",
",",
"source",
",",
"dest",
")",
":",
"if",
"not",
"callable",
"(",
"self",
".",
"rotator",
")",
":",
"# Issue 18940: A file may not have been created if delay is True.",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"source",
")",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/logging/handlers.py#L94-L113 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/cython/Cython/Debugger/libpython.py | python | PyFrameObjectPtr.iter_globals | (self) | return pyop_globals.iteritems() | Yield a sequence of (name,value) pairs of PyObjectPtr instances, for
the global variables of this frame | Yield a sequence of (name,value) pairs of PyObjectPtr instances, for
the global variables of this frame | [
"Yield",
"a",
"sequence",
"of",
"(",
"name",
"value",
")",
"pairs",
"of",
"PyObjectPtr",
"instances",
"for",
"the",
"global",
"variables",
"of",
"this",
"frame"
] | def iter_globals(self):
'''
Yield a sequence of (name,value) pairs of PyObjectPtr instances, for
the global variables of this frame
'''
if self.is_optimized_out():
return ()
pyop_globals = self.pyop_field('f_globals')
return pyop_globals.iteritems() | [
"def",
"iter_globals",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_optimized_out",
"(",
")",
":",
"return",
"(",
")",
"pyop_globals",
"=",
"self",
".",
"pyop_field",
"(",
"'f_globals'",
")",
"return",
"pyop_globals",
".",
"iteritems",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/cython/Cython/Debugger/libpython.py#L878-L887 | |
rodeofx/OpenWalter | 6116fbe3f04f1146c854afbfbdbe944feaee647e | walter/maya/scripts/walterPanel/mergeExpressions.py | python | MergeExpressions.__call__ | (self) | return self.diff(self.firstLen, self.secondLen) | Compare saved strings and return the expression that matches both
strings.
:returns: The expression that matches both strings.
:rtype: string | Compare saved strings and return the expression that matches both
strings. | [
"Compare",
"saved",
"strings",
"and",
"return",
"the",
"expression",
"that",
"matches",
"both",
"strings",
"."
] | def __call__(self):
"""
Compare saved strings and return the expression that matches both
strings.
:returns: The expression that matches both strings.
:rtype: string
"""
return self.diff(self.firstLen, self.secondLen) | [
"def",
"__call__",
"(",
"self",
")",
":",
"return",
"self",
".",
"diff",
"(",
"self",
".",
"firstLen",
",",
"self",
".",
"secondLen",
")"
] | https://github.com/rodeofx/OpenWalter/blob/6116fbe3f04f1146c854afbfbdbe944feaee647e/walter/maya/scripts/walterPanel/mergeExpressions.py#L67-L75 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/saving/saved_model/load.py | python | _restore_layer_unconditional_losses | (layer) | Restore unconditional losses from SavedModel. | Restore unconditional losses from SavedModel. | [
"Restore",
"unconditional",
"losses",
"from",
"SavedModel",
"."
] | def _restore_layer_unconditional_losses(layer):
"""Restore unconditional losses from SavedModel."""
if hasattr(_get_keras_attr(layer), 'layer_regularization_losses'):
losses = getattr(_get_keras_attr(layer), 'layer_regularization_losses', [])
else:
# Some earlier SavedModels may not have layer_regularizat... | [
"def",
"_restore_layer_unconditional_losses",
"(",
"layer",
")",
":",
"if",
"hasattr",
"(",
"_get_keras_attr",
"(",
"layer",
")",
",",
"'layer_regularization_losses'",
")",
":",
"losses",
"=",
"getattr",
"(",
"_get_keras_attr",
"(",
"layer",
")",
",",
"'layer_regu... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/saving/saved_model/load.py#L921-L931 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/html.py | python | PreHtmlHelpFrame | (*args, **kwargs) | return val | PreHtmlHelpFrame(HtmlHelpData data=None) -> HtmlHelpFrame | PreHtmlHelpFrame(HtmlHelpData data=None) -> HtmlHelpFrame | [
"PreHtmlHelpFrame",
"(",
"HtmlHelpData",
"data",
"=",
"None",
")",
"-",
">",
"HtmlHelpFrame"
] | def PreHtmlHelpFrame(*args, **kwargs):
"""PreHtmlHelpFrame(HtmlHelpData data=None) -> HtmlHelpFrame"""
val = _html.new_PreHtmlHelpFrame(*args, **kwargs)
self._setOORInfo(self)
return val | [
"def",
"PreHtmlHelpFrame",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"val",
"=",
"_html",
".",
"new_PreHtmlHelpFrame",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"self",
".",
"_setOORInfo",
"(",
"self",
")",
"return",
"val"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/html.py#L1803-L1807 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/gslib/command.py | python | ShutDownGsutil | () | Shut down all processes in consumer pools in preparation for exiting. | Shut down all processes in consumer pools in preparation for exiting. | [
"Shut",
"down",
"all",
"processes",
"in",
"consumer",
"pools",
"in",
"preparation",
"for",
"exiting",
"."
] | def ShutDownGsutil():
"""Shut down all processes in consumer pools in preparation for exiting."""
for q in queues:
try:
q.cancel_join_thread()
except: # pylint: disable=bare-except
pass
for consumer_pool in consumer_pools:
consumer_pool.ShutDown() | [
"def",
"ShutDownGsutil",
"(",
")",
":",
"for",
"q",
"in",
"queues",
":",
"try",
":",
"q",
".",
"cancel_join_thread",
"(",
")",
"except",
":",
"# pylint: disable=bare-except",
"pass",
"for",
"consumer_pool",
"in",
"consumer_pools",
":",
"consumer_pool",
".",
"S... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/command.py#L1818-L1826 | ||
swift/swift | 12d031cf8177fdec0137f9aa7e2912fa23c4416b | 3rdParty/SCons/scons-3.0.1/engine/SCons/compat/__init__.py | python | rename_module | (new, old) | Attempts to import the old module and load it under the new name.
Used for purely cosmetic name changes in Python 3.x. | Attempts to import the old module and load it under the new name.
Used for purely cosmetic name changes in Python 3.x. | [
"Attempts",
"to",
"import",
"the",
"old",
"module",
"and",
"load",
"it",
"under",
"the",
"new",
"name",
".",
"Used",
"for",
"purely",
"cosmetic",
"name",
"changes",
"in",
"Python",
"3",
".",
"x",
"."
] | def rename_module(new, old):
"""
Attempts to import the old module and load it under the new name.
Used for purely cosmetic name changes in Python 3.x.
"""
try:
sys.modules[new] = imp.load_module(old, *imp.find_module(old))
return True
except ImportError:
return False | [
"def",
"rename_module",
"(",
"new",
",",
"old",
")",
":",
"try",
":",
"sys",
".",
"modules",
"[",
"new",
"]",
"=",
"imp",
".",
"load_module",
"(",
"old",
",",
"*",
"imp",
".",
"find_module",
"(",
"old",
")",
")",
"return",
"True",
"except",
"Import... | https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/compat/__init__.py#L78-L87 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/rnn_cell.py | python | BasicLSTMCell.__init__ | (self, num_units, forget_bias=1.0, input_size=None,
state_is_tuple=True, activation=tanh) | Initialize the basic LSTM cell.
Args:
num_units: int, The number of units in the LSTM cell.
forget_bias: float, The bias added to forget gates (see above).
input_size: Deprecated and unused.
state_is_tuple: If True, accepted and returned states are 2-tuples of
the `c_state` and `m_s... | Initialize the basic LSTM cell. | [
"Initialize",
"the",
"basic",
"LSTM",
"cell",
"."
] | def __init__(self, num_units, forget_bias=1.0, input_size=None,
state_is_tuple=True, activation=tanh):
"""Initialize the basic LSTM cell.
Args:
num_units: int, The number of units in the LSTM cell.
forget_bias: float, The bias added to forget gates (see above).
input_size: Depr... | [
"def",
"__init__",
"(",
"self",
",",
"num_units",
",",
"forget_bias",
"=",
"1.0",
",",
"input_size",
"=",
"None",
",",
"state_is_tuple",
"=",
"True",
",",
"activation",
"=",
"tanh",
")",
":",
"if",
"not",
"state_is_tuple",
":",
"logging",
".",
"warn",
"(... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/rnn_cell.py#L271-L292 | ||
meritlabs/merit | 49dc96043f882b982175fb66934e2bf1e6b1920c | contrib/devtools/security-check.py | python | check_ELF_RELRO | (executable) | return have_gnu_relro and have_bindnow | Check for read-only relocations.
GNU_RELRO program header must exist
Dynamic section must have BIND_NOW flag | Check for read-only relocations.
GNU_RELRO program header must exist
Dynamic section must have BIND_NOW flag | [
"Check",
"for",
"read",
"-",
"only",
"relocations",
".",
"GNU_RELRO",
"program",
"header",
"must",
"exist",
"Dynamic",
"section",
"must",
"have",
"BIND_NOW",
"flag"
] | def check_ELF_RELRO(executable):
'''
Check for read-only relocations.
GNU_RELRO program header must exist
Dynamic section must have BIND_NOW flag
'''
have_gnu_relro = False
for (typ, flags) in get_ELF_program_headers(executable):
# Note: not checking flags == 'R': here as linkers set... | [
"def",
"check_ELF_RELRO",
"(",
"executable",
")",
":",
"have_gnu_relro",
"=",
"False",
"for",
"(",
"typ",
",",
"flags",
")",
"in",
"get_ELF_program_headers",
"(",
"executable",
")",
":",
"# Note: not checking flags == 'R': here as linkers set the permission differently",
... | https://github.com/meritlabs/merit/blob/49dc96043f882b982175fb66934e2bf1e6b1920c/contrib/devtools/security-check.py#L78-L103 | |
xiaohaoChen/rrc_detection | 4f2b110cd122da7f55e8533275a9b4809a88785a | scripts/cpp_lint.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/xiaohaoChen/rrc_detection/blob/4f2b110cd122da7f55e8533275a9b4809a88785a/scripts/cpp_lint.py#L713-L715 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/neural_network/_multilayer_perceptron.py | python | MLPClassifier.predict_log_proba | (self, X) | return np.log(y_prob, out=y_prob) | Return the log of probability estimates.
Parameters
----------
X : ndarray of shape (n_samples, n_features)
The input data.
Returns
-------
log_y_prob : ndarray of shape (n_samples, n_classes)
The predicted log-probability of the sample for each ... | Return the log of probability estimates. | [
"Return",
"the",
"log",
"of",
"probability",
"estimates",
"."
] | def predict_log_proba(self, X):
"""Return the log of probability estimates.
Parameters
----------
X : ndarray of shape (n_samples, n_features)
The input data.
Returns
-------
log_y_prob : ndarray of shape (n_samples, n_classes)
The predic... | [
"def",
"predict_log_proba",
"(",
"self",
",",
"X",
")",
":",
"y_prob",
"=",
"self",
".",
"predict_proba",
"(",
"X",
")",
"return",
"np",
".",
"log",
"(",
"y_prob",
",",
"out",
"=",
"y_prob",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/neural_network/_multilayer_perceptron.py#L1039-L1055 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.