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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/physics/traveltime/modelling.py | python | TravelTimeDijkstraModelling.createStartModel | (self, dataVals) | return sm | Create a starting model from data values (gradient or constant). | Create a starting model from data values (gradient or constant). | [
"Create",
"a",
"starting",
"model",
"from",
"data",
"values",
"(",
"gradient",
"or",
"constant",
")",
"."
] | def createStartModel(self, dataVals):
"""Create a starting model from data values (gradient or constant)."""
sm = None
if self._useGradient is not None:
[vTop, vBot] = self._useGradient # something strange here!!!
pg.info('Create gradient starting model. {0}: {1}'.forma... | [
"def",
"createStartModel",
"(",
"self",
",",
"dataVals",
")",
":",
"sm",
"=",
"None",
"if",
"self",
".",
"_useGradient",
"is",
"not",
"None",
":",
"[",
"vTop",
",",
"vBot",
"]",
"=",
"self",
".",
"_useGradient",
"# something strange here!!!",
"pg",
".",
... | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/physics/traveltime/modelling.py#L57-L77 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vcs/__init__.py | python | VersionControl.check_destination | (self, dest, url, rev_options, rev_display) | return checkout | Prepare a location to receive a checkout/clone.
Return True if the location is ready for (and requires) a
checkout/clone, False otherwise. | Prepare a location to receive a checkout/clone. | [
"Prepare",
"a",
"location",
"to",
"receive",
"a",
"checkout",
"/",
"clone",
"."
] | def check_destination(self, dest, url, rev_options, rev_display):
"""
Prepare a location to receive a checkout/clone.
Return True if the location is ready for (and requires) a
checkout/clone, False otherwise.
"""
checkout = True
prompt = False
if os.path.... | [
"def",
"check_destination",
"(",
"self",
",",
"dest",
",",
"url",
",",
"rev_options",
",",
"rev_display",
")",
":",
"checkout",
"=",
"True",
"prompt",
"=",
"False",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"dest",
")",
":",
"checkout",
"=",
"False"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vcs/__init__.py#L179-L235 | |
google/clif | cab24d6a105609a65c95a36a1712ae3c20c7b5df | clif/python/proto.py | python | GenerateFrom | (messages, proto_filename, clif_hdr, proto_hdr) | Traverse ast and generate output files. | Traverse ast and generate output files. | [
"Traverse",
"ast",
"and",
"generate",
"output",
"files",
"."
] | def GenerateFrom(messages, proto_filename, clif_hdr, proto_hdr):
"""Traverse ast and generate output files."""
with open(FLAGS.header_out, 'w') as hout:
gen.WriteTo(hout, gen.Headlines(
proto_filename, [proto_hdr, 'clif/python/postconv.h']))
gen.WriteTo(hout, _GenHeader(messages))
with open(FLAGS... | [
"def",
"GenerateFrom",
"(",
"messages",
",",
"proto_filename",
",",
"clif_hdr",
",",
"proto_hdr",
")",
":",
"with",
"open",
"(",
"FLAGS",
".",
"header_out",
",",
"'w'",
")",
"as",
"hout",
":",
"gen",
".",
"WriteTo",
"(",
"hout",
",",
"gen",
".",
"Headl... | https://github.com/google/clif/blob/cab24d6a105609a65c95a36a1712ae3c20c7b5df/clif/python/proto.py#L110-L125 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/tensor_array_grad.py | python | _TensorArraySplitGrad | (op, flow) | return [None, grad, None, flow] | Gradient for TensorArraySplit.
Args:
op: Forward TensorArraySplit op.
flow: Gradient `Tensor` flow to TensorArraySplit.
Returns:
A grad `Tensor`, the gradient created in upstream ReadGrads or PackGrad. | Gradient for TensorArraySplit. | [
"Gradient",
"for",
"TensorArraySplit",
"."
] | def _TensorArraySplitGrad(op, flow):
"""Gradient for TensorArraySplit.
Args:
op: Forward TensorArraySplit op.
flow: Gradient `Tensor` flow to TensorArraySplit.
Returns:
A grad `Tensor`, the gradient created in upstream ReadGrads or PackGrad.
"""
handle = op.inputs[0]
dtype = op.get_attr("T")
... | [
"def",
"_TensorArraySplitGrad",
"(",
"op",
",",
"flow",
")",
":",
"handle",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
"dtype",
"=",
"op",
".",
"get_attr",
"(",
"\"T\"",
")",
"grad_source",
"=",
"_GetGradSource",
"(",
"flow",
")",
"g",
"=",
"tensor_array... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/tensor_array_grad.py#L196-L213 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBLaunchInfo.__init__ | (self, argv) | __init__(lldb::SBLaunchInfo self, char const ** argv) -> SBLaunchInfo | __init__(lldb::SBLaunchInfo self, char const ** argv) -> SBLaunchInfo | [
"__init__",
"(",
"lldb",
"::",
"SBLaunchInfo",
"self",
"char",
"const",
"**",
"argv",
")",
"-",
">",
"SBLaunchInfo"
] | def __init__(self, argv):
"""__init__(lldb::SBLaunchInfo self, char const ** argv) -> SBLaunchInfo"""
this = _lldb.new_SBLaunchInfo(argv)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this | [
"def",
"__init__",
"(",
"self",
",",
"argv",
")",
":",
"this",
"=",
"_lldb",
".",
"new_SBLaunchInfo",
"(",
"argv",
")",
"try",
":",
"self",
".",
"this",
".",
"append",
"(",
"this",
")",
"except",
"__builtin__",
".",
"Exception",
":",
"self",
".",
"th... | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L6443-L6449 | ||
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/pybind/mgr/rbd_support/module.py | python | Module.perf_image_stats | (self,
pool_spec: Optional[str] = None,
sort_by: Optional[ImageSortBy] = None) | Retrieve current RBD IO performance stats | Retrieve current RBD IO performance stats | [
"Retrieve",
"current",
"RBD",
"IO",
"performance",
"stats"
] | def perf_image_stats(self,
pool_spec: Optional[str] = None,
sort_by: Optional[ImageSortBy] = None) -> Tuple[int, str, str]:
"""
Retrieve current RBD IO performance stats
"""
with self.perf.lock:
sort_by_name = sort_by.name if ... | [
"def",
"perf_image_stats",
"(",
"self",
",",
"pool_spec",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"sort_by",
":",
"Optional",
"[",
"ImageSortBy",
"]",
"=",
"None",
")",
"->",
"Tuple",
"[",
"int",
",",
"str",
",",
"str",
"]",
":",
"with",
... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/rbd_support/module.py#L130-L138 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryILLAutoProcess.py | python | ReflectometryILLAutoProcess.compose_polarized_runs_list | (self, angle_index) | return run_inputs, run_names | Returns the lists of runs and names for different flipper configurations at the given angle_index | Returns the lists of runs and names for different flipper configurations at the given angle_index | [
"Returns",
"the",
"lists",
"of",
"runs",
"and",
"names",
"for",
"different",
"flipper",
"configurations",
"at",
"the",
"given",
"angle_index"
] | def compose_polarized_runs_list(self, angle_index):
"""Returns the lists of runs and names for different flipper configurations at the given angle_index"""
run_inputs = []
run_names = []
if self._rb00:
run00_name = self.make_name(self._rb00[angle_index]) + '_00'
r... | [
"def",
"compose_polarized_runs_list",
"(",
"self",
",",
"angle_index",
")",
":",
"run_inputs",
"=",
"[",
"]",
"run_names",
"=",
"[",
"]",
"if",
"self",
".",
"_rb00",
":",
"run00_name",
"=",
"self",
".",
"make_name",
"(",
"self",
".",
"_rb00",
"[",
"angle... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryILLAutoProcess.py#L792-L816 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/binding/module.py | python | ModuleRef.name | (self) | return _decode_string(ffi.lib.LLVMPY_GetModuleName(self)) | The module's identifier. | The module's identifier. | [
"The",
"module",
"s",
"identifier",
"."
] | def name(self):
"""
The module's identifier.
"""
return _decode_string(ffi.lib.LLVMPY_GetModuleName(self)) | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"_decode_string",
"(",
"ffi",
".",
"lib",
".",
"LLVMPY_GetModuleName",
"(",
"self",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/binding/module.py#L119-L123 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/layers/python/layers/layers.py | python | repeat | (inputs, repetitions, layer, *args, **kwargs) | Applies the same layer with the same arguments repeatedly.
```python
y = repeat(x, 3, conv2d, 64, [3, 3], scope='conv1')
# It is equivalent to:
x = conv2d(x, 64, [3, 3], scope='conv1/conv1_1')
x = conv2d(x, 64, [3, 3], scope='conv1/conv1_2')
y = conv2d(x, 64, [3, 3], scope='conv1/conv1_3')
```... | Applies the same layer with the same arguments repeatedly. | [
"Applies",
"the",
"same",
"layer",
"with",
"the",
"same",
"arguments",
"repeatedly",
"."
] | def repeat(inputs, repetitions, layer, *args, **kwargs):
"""Applies the same layer with the same arguments repeatedly.
```python
y = repeat(x, 3, conv2d, 64, [3, 3], scope='conv1')
# It is equivalent to:
x = conv2d(x, 64, [3, 3], scope='conv1/conv1_1')
x = conv2d(x, 64, [3, 3], scope='conv1/conv1_... | [
"def",
"repeat",
"(",
"inputs",
",",
"repetitions",
",",
"layer",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"scope",
"=",
"kwargs",
".",
"pop",
"(",
"'scope'",
",",
"None",
")",
"with",
"variable_scope",
".",
"variable_scope",
"(",
"scope",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/layers/python/layers/layers.py#L2320-L2363 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | contrib/gizmos/osx_cocoa/gizmos.py | python | DynamicSashUnifyEvent.__init__ | (self, *args, **kwargs) | __init__(self, Object target) -> DynamicSashUnifyEvent | __init__(self, Object target) -> DynamicSashUnifyEvent | [
"__init__",
"(",
"self",
"Object",
"target",
")",
"-",
">",
"DynamicSashUnifyEvent"
] | def __init__(self, *args, **kwargs):
"""__init__(self, Object target) -> DynamicSashUnifyEvent"""
_gizmos.DynamicSashUnifyEvent_swiginit(self,_gizmos.new_DynamicSashUnifyEvent(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_gizmos",
".",
"DynamicSashUnifyEvent_swiginit",
"(",
"self",
",",
"_gizmos",
".",
"new_DynamicSashUnifyEvent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/osx_cocoa/gizmos.py#L85-L87 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/android/loading/cloud/frontend/memory_logs.py | python | MemoryLogs.Flush | (self) | return result | Stops collecting the logs and returns the logs collected since Start()
was called. | Stops collecting the logs and returns the logs collected since Start()
was called. | [
"Stops",
"collecting",
"the",
"logs",
"and",
"returns",
"the",
"logs",
"collected",
"since",
"Start",
"()",
"was",
"called",
"."
] | def Flush(self):
"""Stops collecting the logs and returns the logs collected since Start()
was called.
"""
self._logger.removeHandler(self._log_handler)
self._log_handler.flush()
self._log_buffer.flush()
result = self._log_buffer.getvalue()
self._log_buffer.truncate(0)
return result | [
"def",
"Flush",
"(",
"self",
")",
":",
"self",
".",
"_logger",
".",
"removeHandler",
"(",
"self",
".",
"_log_handler",
")",
"self",
".",
"_log_handler",
".",
"flush",
"(",
")",
"self",
".",
"_log_buffer",
".",
"flush",
"(",
")",
"result",
"=",
"self",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/loading/cloud/frontend/memory_logs.py#L24-L33 | |
apple/swift-clang | d7403439fc6641751840b723e7165fb02f52db95 | bindings/python/clang/cindex.py | python | TranslationUnit.cursor | (self) | return conf.lib.clang_getTranslationUnitCursor(self) | Retrieve the cursor that represents the given translation unit. | Retrieve the cursor that represents the given translation unit. | [
"Retrieve",
"the",
"cursor",
"that",
"represents",
"the",
"given",
"translation",
"unit",
"."
] | def cursor(self):
"""Retrieve the cursor that represents the given translation unit."""
return conf.lib.clang_getTranslationUnitCursor(self) | [
"def",
"cursor",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_getTranslationUnitCursor",
"(",
"self",
")"
] | https://github.com/apple/swift-clang/blob/d7403439fc6641751840b723e7165fb02f52db95/bindings/python/clang/cindex.py#L2877-L2879 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | xpathParserContext.xpathNotFunction | (self, nargs) | Implement the not() XPath function boolean not(boolean) The
not function returns true if its argument is false, and
false otherwise. | Implement the not() XPath function boolean not(boolean) The
not function returns true if its argument is false, and
false otherwise. | [
"Implement",
"the",
"not",
"()",
"XPath",
"function",
"boolean",
"not",
"(",
"boolean",
")",
"The",
"not",
"function",
"returns",
"true",
"if",
"its",
"argument",
"is",
"false",
"and",
"false",
"otherwise",
"."
] | def xpathNotFunction(self, nargs):
"""Implement the not() XPath function boolean not(boolean) The
not function returns true if its argument is false, and
false otherwise. """
libxml2mod.xmlXPathNotFunction(self._o, nargs) | [
"def",
"xpathNotFunction",
"(",
"self",
",",
"nargs",
")",
":",
"libxml2mod",
".",
"xmlXPathNotFunction",
"(",
"self",
".",
"_o",
",",
"nargs",
")"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L6990-L6994 | ||
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/expressions/leaf.py | python | Leaf.is_pwl | (self) | return True | Leaf nodes are always piecewise linear. | Leaf nodes are always piecewise linear. | [
"Leaf",
"nodes",
"are",
"always",
"piecewise",
"linear",
"."
] | def is_pwl(self) -> bool:
"""Leaf nodes are always piecewise linear.
"""
return True | [
"def",
"is_pwl",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"True"
] | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/expressions/leaf.py#L458-L461 | |
johmathe/shotdetect | 1ecf93a695c96fd7601a41ab5834f1117b9d7d50 | tools/cpplint.py | python | FileInfo.RepositoryName | (self) | return fullname | FullName after removing the local path to the repository.
If we have a real absolute path name here we can try to do something smart:
detecting the root of the checkout and truncating /path/to/checkout from
the name so that we get header guards that don't include things like
"C:\Documents and Settings\... | FullName after removing the local path to the repository. | [
"FullName",
"after",
"removing",
"the",
"local",
"path",
"to",
"the",
"repository",
"."
] | def RepositoryName(self):
"""FullName after removing the local path to the repository.
If we have a real absolute path name here we can try to do something smart:
detecting the root of the checkout and truncating /path/to/checkout from
the name so that we get header guards that don't include things lik... | [
"def",
"RepositoryName",
"(",
"self",
")",
":",
"fullname",
"=",
"self",
".",
"FullName",
"(",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"fullname",
")",
":",
"project_dir",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"fullname",
")",
"if",
... | https://github.com/johmathe/shotdetect/blob/1ecf93a695c96fd7601a41ab5834f1117b9d7d50/tools/cpplint.py#L689-L732 | |
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Node/FS.py | python | File._morph | (self) | Turn a file system node into a File object. | Turn a file system node into a File object. | [
"Turn",
"a",
"file",
"system",
"node",
"into",
"a",
"File",
"object",
"."
] | def _morph(self):
"""Turn a file system node into a File object."""
self.scanner_paths = {}
if not hasattr(self, '_local'):
self._local = 0
if not hasattr(self, 'released_target_info'):
self.released_target_info = False
self.store_info = 1
self._f... | [
"def",
"_morph",
"(",
"self",
")",
":",
"self",
".",
"scanner_paths",
"=",
"{",
"}",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_local'",
")",
":",
"self",
".",
"_local",
"=",
"0",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'released_target_info'",
... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Node/FS.py#L2664-L2691 | ||
0ad/0ad | f58db82e0e925016d83f4e3fa7ca599e3866e2af | source/tools/fontbuilder2/Packer.py | python | CygonRectanglePacker.__init__ | (self, packingAreaWidth, packingAreaHeight) | Initializes a new rectangle packer
packingAreaWidth: Maximum width of the packing area
packingAreaHeight: Maximum height of the packing area | Initializes a new rectangle packer
packingAreaWidth: Maximum width of the packing area
packingAreaHeight: Maximum height of the packing area | [
"Initializes",
"a",
"new",
"rectangle",
"packer",
"packingAreaWidth",
":",
"Maximum",
"width",
"of",
"the",
"packing",
"area",
"packingAreaHeight",
":",
"Maximum",
"height",
"of",
"the",
"packing",
"area"
] | def __init__(self, packingAreaWidth, packingAreaHeight):
"""Initializes a new rectangle packer
packingAreaWidth: Maximum width of the packing area
packingAreaHeight: Maximum height of the packing area"""
RectanglePacker.__init__(self, packingAreaWidth, packingAreaHeight)
# St... | [
"def",
"__init__",
"(",
"self",
",",
"packingAreaWidth",
",",
"packingAreaHeight",
")",
":",
"RectanglePacker",
".",
"__init__",
"(",
"self",
",",
"packingAreaWidth",
",",
"packingAreaHeight",
")",
"# Stores the height silhouette of the rectangles",
"self",
".",
"height... | https://github.com/0ad/0ad/blob/f58db82e0e925016d83f4e3fa7ca599e3866e2af/source/tools/fontbuilder2/Packer.py#L111-L122 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_windows.py | python | MultiChoiceDialog.SetSelections | (*args, **kwargs) | return _windows_.MultiChoiceDialog_SetSelections(*args, **kwargs) | SetSelections(List selections)
Specify the items in the list that should be selected, using a list of
integers. The list should specify the indexes of the items that
should be selected. | SetSelections(List selections) | [
"SetSelections",
"(",
"List",
"selections",
")"
] | def SetSelections(*args, **kwargs):
"""
SetSelections(List selections)
Specify the items in the list that should be selected, using a list of
integers. The list should specify the indexes of the items that
should be selected.
"""
return _windows_.MultiChoiceDial... | [
"def",
"SetSelections",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"MultiChoiceDialog_SetSelections",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L3303-L3311 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/framework/error_interpolation.py | python | create_graph_debug_info_def | (func_named_operations) | return graph_debug_info_def | Construct and returns a `GraphDebugInfo` protocol buffer.
Args:
func_named_operations: An iterable of (func_name, op.Operation) tuples
where the Operation instances have a _traceback members. The func_name
should be the empty string for operations in the top-level Graph.
Returns:
GraphDebugInf... | Construct and returns a `GraphDebugInfo` protocol buffer. | [
"Construct",
"and",
"returns",
"a",
"GraphDebugInfo",
"protocol",
"buffer",
"."
] | def create_graph_debug_info_def(func_named_operations):
"""Construct and returns a `GraphDebugInfo` protocol buffer.
Args:
func_named_operations: An iterable of (func_name, op.Operation) tuples
where the Operation instances have a _traceback members. The func_name
should be the empty string for ope... | [
"def",
"create_graph_debug_info_def",
"(",
"func_named_operations",
")",
":",
"# Creates an empty GraphDebugInfoDef proto.",
"graph_debug_info_def",
"=",
"graph_debug_info_pb2",
".",
"GraphDebugInfo",
"(",
")",
"# Gets the file names and line numbers for the exported node names. Also",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/framework/error_interpolation.py#L295-L348 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/make_archive.py | python | make_tar_archive | (opts) | Given the parsed options, generates the 'opt.output_filename'
tarball containing all the files in 'opt.input_filename' renamed
according to the mappings in 'opts.transformations'.
e.g. for an input file named "a/mongo/build/DISTSRC", and an
existing transformation {"a/mongo/build": "release"}, the inpu... | Given the parsed options, generates the 'opt.output_filename'
tarball containing all the files in 'opt.input_filename' renamed
according to the mappings in 'opts.transformations'. | [
"Given",
"the",
"parsed",
"options",
"generates",
"the",
"opt",
".",
"output_filename",
"tarball",
"containing",
"all",
"the",
"files",
"in",
"opt",
".",
"input_filename",
"renamed",
"according",
"to",
"the",
"mappings",
"in",
"opts",
".",
"transformations",
"."... | def make_tar_archive(opts):
'''Given the parsed options, generates the 'opt.output_filename'
tarball containing all the files in 'opt.input_filename' renamed
according to the mappings in 'opts.transformations'.
e.g. for an input file named "a/mongo/build/DISTSRC", and an
existing transformation {"a... | [
"def",
"make_tar_archive",
"(",
"opts",
")",
":",
"tar_options",
"=",
"\"cvf\"",
"if",
"opts",
".",
"archive_format",
"is",
"'tgz'",
":",
"tar_options",
"+=",
"\"z\"",
"# clean and create a temp directory to copy files to",
"enclosing_archive_directory",
"=",
"tempfile",
... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/make_archive.py#L65-L112 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/frame.py | python | DataFrame.lookup | (self, row_labels, col_labels) | return result | Label-based "fancy indexing" function for DataFrame.
Given equal-length arrays of row and column labels, return an
array of the values corresponding to each (row, col) pair.
Parameters
----------
row_labels : sequence
The row labels to use for lookup.
col_la... | Label-based "fancy indexing" function for DataFrame. | [
"Label",
"-",
"based",
"fancy",
"indexing",
"function",
"for",
"DataFrame",
"."
] | def lookup(self, row_labels, col_labels) -> np.ndarray:
"""
Label-based "fancy indexing" function for DataFrame.
Given equal-length arrays of row and column labels, return an
array of the values corresponding to each (row, col) pair.
Parameters
----------
row_la... | [
"def",
"lookup",
"(",
"self",
",",
"row_labels",
",",
"col_labels",
")",
"->",
"np",
".",
"ndarray",
":",
"n",
"=",
"len",
"(",
"row_labels",
")",
"if",
"n",
"!=",
"len",
"(",
"col_labels",
")",
":",
"raise",
"ValueError",
"(",
"\"Row labels must have sa... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/frame.py#L3681-L3727 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/autopep8.py | python | _shorten_line_at_tokens_new | (tokens, source, indentation,
max_line_length) | Shorten the line taking its length into account.
The input is expected to be free of newlines except for inside
multiline strings and at the end. | Shorten the line taking its length into account. | [
"Shorten",
"the",
"line",
"taking",
"its",
"length",
"into",
"account",
"."
] | def _shorten_line_at_tokens_new(tokens, source, indentation,
max_line_length):
"""Shorten the line taking its length into account.
The input is expected to be free of newlines except for inside
multiline strings and at the end.
"""
# Yield the original source so to ... | [
"def",
"_shorten_line_at_tokens_new",
"(",
"tokens",
",",
"source",
",",
"indentation",
",",
"max_line_length",
")",
":",
"# Yield the original source so to see if it's a better choice than the",
"# shortened candidate lines we generate here.",
"yield",
"indentation",
"+",
"source"... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/autopep8.py#L2221-L2246 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/ops/array_ops.py | python | na_arithmetic_op | (left, right, op, str_rep: str) | return missing.dispatch_fill_zeros(op, left, right, result) | Return the result of evaluating op on the passed in values.
If native types are not compatible, try coersion to object dtype.
Parameters
----------
left : np.ndarray
right : np.ndarray or scalar
str_rep : str or None
Returns
-------
array-like
Raises
------
TypeError ... | Return the result of evaluating op on the passed in values. | [
"Return",
"the",
"result",
"of",
"evaluating",
"op",
"on",
"the",
"passed",
"in",
"values",
"."
] | def na_arithmetic_op(left, right, op, str_rep: str):
"""
Return the result of evaluating op on the passed in values.
If native types are not compatible, try coersion to object dtype.
Parameters
----------
left : np.ndarray
right : np.ndarray or scalar
str_rep : str or None
Returns... | [
"def",
"na_arithmetic_op",
"(",
"left",
",",
"right",
",",
"op",
",",
"str_rep",
":",
"str",
")",
":",
"import",
"pandas",
".",
"core",
".",
"computation",
".",
"expressions",
"as",
"expressions",
"try",
":",
"result",
"=",
"expressions",
".",
"evaluate",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/ops/array_ops.py#L126-L153 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/ndarray/ndarray.py | python | NDArray.arccos | (self, *args, **kwargs) | return op.arccos(self, *args, **kwargs) | Convenience fluent method for :py:func:`arccos`.
The arguments are the same as for :py:func:`arccos`, with
this array as data. | Convenience fluent method for :py:func:`arccos`. | [
"Convenience",
"fluent",
"method",
"for",
":",
"py",
":",
"func",
":",
"arccos",
"."
] | def arccos(self, *args, **kwargs):
"""Convenience fluent method for :py:func:`arccos`.
The arguments are the same as for :py:func:`arccos`, with
this array as data.
"""
return op.arccos(self, *args, **kwargs) | [
"def",
"arccos",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"op",
".",
"arccos",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/ndarray/ndarray.py#L1340-L1346 | |
CanalTP/navitia | cb84ce9859070187e708818b058e6a7e0b7f891b | source/jormungandr/jormungandr/authentication.py | python | get_used_coverages | () | return the list of coverages used to generate the response | return the list of coverages used to generate the response | [
"return",
"the",
"list",
"of",
"coverages",
"used",
"to",
"generate",
"the",
"response"
] | def get_used_coverages():
"""
return the list of coverages used to generate the response
"""
if request.view_args and 'region' in request.view_args:
return [request.view_args['region']]
elif hasattr(g, 'used_coverages'):
return g.used_coverages
else:
return [] | [
"def",
"get_used_coverages",
"(",
")",
":",
"if",
"request",
".",
"view_args",
"and",
"'region'",
"in",
"request",
".",
"view_args",
":",
"return",
"[",
"request",
".",
"view_args",
"[",
"'region'",
"]",
"]",
"elif",
"hasattr",
"(",
"g",
",",
"'used_covera... | https://github.com/CanalTP/navitia/blob/cb84ce9859070187e708818b058e6a7e0b7f891b/source/jormungandr/jormungandr/authentication.py#L291-L300 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/eager/python/examples/revnet/blocks.py | python | FinalBlock.__init__ | (self, config) | Initialization.
Args:
config: tf.contrib.training.HParams object; specifies hyperparameters
Raises:
ValueError: Unsupported data format | Initialization. | [
"Initialization",
"."
] | def __init__(self, config):
"""Initialization.
Args:
config: tf.contrib.training.HParams object; specifies hyperparameters
Raises:
ValueError: Unsupported data format
"""
super(FinalBlock, self).__init__(dtype=config.dtype)
self.config = config
self.axis = 1 if self.config.data... | [
"def",
"__init__",
"(",
"self",
",",
"config",
")",
":",
"super",
"(",
"FinalBlock",
",",
"self",
")",
".",
"__init__",
"(",
"dtype",
"=",
"config",
".",
"dtype",
")",
"self",
".",
"config",
"=",
"config",
"self",
".",
"axis",
"=",
"1",
"if",
"self... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/eager/python/examples/revnet/blocks.py#L459-L497 | ||
cmu-db/noisepage | 79276e68fe83322f1249e8a8be96bd63c583ae56 | build-support/cpplint.py | python | _SetVerboseLevel | (level) | return _cpplint_state.SetVerboseLevel(level) | Sets the module's verbosity, and returns the previous setting. | Sets the module's verbosity, and returns the previous setting. | [
"Sets",
"the",
"module",
"s",
"verbosity",
"and",
"returns",
"the",
"previous",
"setting",
"."
] | def _SetVerboseLevel(level):
"""Sets the module's verbosity, and returns the previous setting."""
return _cpplint_state.SetVerboseLevel(level) | [
"def",
"_SetVerboseLevel",
"(",
"level",
")",
":",
"return",
"_cpplint_state",
".",
"SetVerboseLevel",
"(",
"level",
")"
] | https://github.com/cmu-db/noisepage/blob/79276e68fe83322f1249e8a8be96bd63c583ae56/build-support/cpplint.py#L1194-L1196 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/multiprocessing/managers.py | python | Server.debug_info | (self, c) | Return some info --- useful to spot problems with refcounting | Return some info --- useful to spot problems with refcounting | [
"Return",
"some",
"info",
"---",
"useful",
"to",
"spot",
"problems",
"with",
"refcounting"
] | def debug_info(self, c):
'''
Return some info --- useful to spot problems with refcounting
'''
self.mutex.acquire()
try:
result = []
keys = self.id_to_obj.keys()
keys.sort()
for ident in keys:
if ident != '0':
... | [
"def",
"debug_info",
"(",
"self",
",",
"c",
")",
":",
"self",
".",
"mutex",
".",
"acquire",
"(",
")",
"try",
":",
"result",
"=",
"[",
"]",
"keys",
"=",
"self",
".",
"id_to_obj",
".",
"keys",
"(",
")",
"keys",
".",
"sort",
"(",
")",
"for",
"iden... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/multiprocessing/managers.py#L317-L333 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/aui.py | python | AuiToolBarItem.GetMinSize | (*args, **kwargs) | return _aui.AuiToolBarItem_GetMinSize(*args, **kwargs) | GetMinSize(self) -> Size | GetMinSize(self) -> Size | [
"GetMinSize",
"(",
"self",
")",
"-",
">",
"Size"
] | def GetMinSize(*args, **kwargs):
"""GetMinSize(self) -> Size"""
return _aui.AuiToolBarItem_GetMinSize(*args, **kwargs) | [
"def",
"GetMinSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiToolBarItem_GetMinSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L1821-L1823 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/calendar.py | python | Calendar.monthdatescalendar | (self, year, month) | return [ dates[i:i+7] for i in range(0, len(dates), 7) ] | Return a matrix (list of lists) representing a month's calendar.
Each row represents a week; week entries are datetime.date values. | Return a matrix (list of lists) representing a month's calendar.
Each row represents a week; week entries are datetime.date values. | [
"Return",
"a",
"matrix",
"(",
"list",
"of",
"lists",
")",
"representing",
"a",
"month",
"s",
"calendar",
".",
"Each",
"row",
"represents",
"a",
"week",
";",
"week",
"entries",
"are",
"datetime",
".",
"date",
"values",
"."
] | def monthdatescalendar(self, year, month):
"""
Return a matrix (list of lists) representing a month's calendar.
Each row represents a week; week entries are datetime.date values.
"""
dates = list(self.itermonthdates(year, month))
return [ dates[i:i+7] for i in range(0, le... | [
"def",
"monthdatescalendar",
"(",
"self",
",",
"year",
",",
"month",
")",
":",
"dates",
"=",
"list",
"(",
"self",
".",
"itermonthdates",
"(",
"year",
",",
"month",
")",
")",
"return",
"[",
"dates",
"[",
"i",
":",
"i",
"+",
"7",
"]",
"for",
"i",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/calendar.py#L195-L201 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/deps/v8/third_party/jinja2/parser.py | python | Parser.parse | (self) | return result | Parse the whole template into a `Template` node. | Parse the whole template into a `Template` node. | [
"Parse",
"the",
"whole",
"template",
"into",
"a",
"Template",
"node",
"."
] | def parse(self):
"""Parse the whole template into a `Template` node."""
result = nodes.Template(self.subparse(), lineno=1)
result.set_environment(self.environment)
return result | [
"def",
"parse",
"(",
"self",
")",
":",
"result",
"=",
"nodes",
".",
"Template",
"(",
"self",
".",
"subparse",
"(",
")",
",",
"lineno",
"=",
"1",
")",
"result",
".",
"set_environment",
"(",
"self",
".",
"environment",
")",
"return",
"result"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/deps/v8/third_party/jinja2/parser.py#L899-L903 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/wsgiref/simple_server.py | python | WSGIRequestHandler.handle | (self) | Handle a single HTTP request | Handle a single HTTP request | [
"Handle",
"a",
"single",
"HTTP",
"request"
] | def handle(self):
"""Handle a single HTTP request"""
self.raw_requestline = self.rfile.readline()
if not self.parse_request(): # An error code has been sent, just exit
return
handler = ServerHandler(
self.rfile, self.wfile, self.get_stderr(), self.get_environ()
... | [
"def",
"handle",
"(",
"self",
")",
":",
"self",
".",
"raw_requestline",
"=",
"self",
".",
"rfile",
".",
"readline",
"(",
")",
"if",
"not",
"self",
".",
"parse_request",
"(",
")",
":",
"# An error code has been sent, just exit",
"return",
"handler",
"=",
"Ser... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/wsgiref/simple_server.py#L127-L138 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/importlib-metadata/py3/importlib_metadata/__init__.py | python | Distribution.requires | (self) | return reqs and list(reqs) | Generated requirements specified for this Distribution | Generated requirements specified for this Distribution | [
"Generated",
"requirements",
"specified",
"for",
"this",
"Distribution"
] | def requires(self):
"""Generated requirements specified for this Distribution"""
reqs = self._read_dist_info_reqs() or self._read_egg_info_reqs()
return reqs and list(reqs) | [
"def",
"requires",
"(",
"self",
")",
":",
"reqs",
"=",
"self",
".",
"_read_dist_info_reqs",
"(",
")",
"or",
"self",
".",
"_read_egg_info_reqs",
"(",
")",
"return",
"reqs",
"and",
"list",
"(",
"reqs",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/importlib-metadata/py3/importlib_metadata/__init__.py#L661-L664 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/syntax/_flagship.py | python | SyntaxData.GetProperties | (self) | return [FOLD] | Returns a list of Extra Properties to set | Returns a list of Extra Properties to set | [
"Returns",
"a",
"list",
"of",
"Extra",
"Properties",
"to",
"set"
] | def GetProperties(self):
"""Returns a list of Extra Properties to set """
return [FOLD] | [
"def",
"GetProperties",
"(",
"self",
")",
":",
"return",
"[",
"FOLD",
"]"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/syntax/_flagship.py#L176-L178 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | FontPickerEvent.SetFont | (*args, **kwargs) | return _controls_.FontPickerEvent_SetFont(*args, **kwargs) | SetFont(self, Font c) | SetFont(self, Font c) | [
"SetFont",
"(",
"self",
"Font",
"c",
")"
] | def SetFont(*args, **kwargs):
"""SetFont(self, Font c)"""
return _controls_.FontPickerEvent_SetFont(*args, **kwargs) | [
"def",
"SetFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"FontPickerEvent_SetFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L7197-L7199 | |
bairdzhang/smallhardface | 76fa1d87a9602d9b13d7a7fe693fc7aec91cab80 | external/marcopede-face-eval-f2870fd85d48/loadData.py | python | loadDetections | (fn) | return dets | load detections from fn in the different formats | load detections from fn in the different formats | [
"load",
"detections",
"from",
"fn",
"in",
"the",
"different",
"formats"
] | def loadDetections(fn):
"""
load detections from fn in the different formats
"""
dets = []
print ("loading ", fn)
if os.path.splitext(fn)[1] == ".txt":
dets = loadDetectionsPascalFormat(fn)
elif os.path.splitext(fn)[1] == ".ramananmat":
dets = loadDetectionsRamanan(fn)
... | [
"def",
"loadDetections",
"(",
"fn",
")",
":",
"dets",
"=",
"[",
"]",
"print",
"(",
"\"loading \"",
",",
"fn",
")",
"if",
"os",
".",
"path",
".",
"splitext",
"(",
"fn",
")",
"[",
"1",
"]",
"==",
"\".txt\"",
":",
"dets",
"=",
"loadDetectionsPascalForma... | https://github.com/bairdzhang/smallhardface/blob/76fa1d87a9602d9b13d7a7fe693fc7aec91cab80/external/marcopede-face-eval-f2870fd85d48/loadData.py#L13-L33 | |
apple/swift | 469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893 | utils/gyb.py | python | split_lines | (s) | return [line + '\n' for line in s.split('\n')] | Split s into a list of lines, each of which has a trailing newline
If the lines are later concatenated, the result is s, possibly
with a single appended newline. | Split s into a list of lines, each of which has a trailing newline | [
"Split",
"s",
"into",
"a",
"list",
"of",
"lines",
"each",
"of",
"which",
"has",
"a",
"trailing",
"newline"
] | def split_lines(s):
"""Split s into a list of lines, each of which has a trailing newline
If the lines are later concatenated, the result is s, possibly
with a single appended newline.
"""
return [line + '\n' for line in s.split('\n')] | [
"def",
"split_lines",
"(",
"s",
")",
":",
"return",
"[",
"line",
"+",
"'\\n'",
"for",
"line",
"in",
"s",
".",
"split",
"(",
"'\\n'",
")",
"]"
] | https://github.com/apple/swift/blob/469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893/utils/gyb.py#L49-L55 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/stc.py | python | StyledTextCtrl.WordPartRightExtend | (*args, **kwargs) | return _stc.StyledTextCtrl_WordPartRightExtend(*args, **kwargs) | WordPartRightExtend(self)
Move to the next change in capitalisation extending selection
to new caret position. | WordPartRightExtend(self) | [
"WordPartRightExtend",
"(",
"self",
")"
] | def WordPartRightExtend(*args, **kwargs):
"""
WordPartRightExtend(self)
Move to the next change in capitalisation extending selection
to new caret position.
"""
return _stc.StyledTextCtrl_WordPartRightExtend(*args, **kwargs) | [
"def",
"WordPartRightExtend",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_WordPartRightExtend",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L5128-L5135 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/roc/hsadrv/driver.py | python | Stream.auto_synchronize | (self) | A context manager that waits for all commands in this stream to execute
and commits any pending memory transfers upon exiting the context. | A context manager that waits for all commands in this stream to execute
and commits any pending memory transfers upon exiting the context. | [
"A",
"context",
"manager",
"that",
"waits",
"for",
"all",
"commands",
"in",
"this",
"stream",
"to",
"execute",
"and",
"commits",
"any",
"pending",
"memory",
"transfers",
"upon",
"exiting",
"the",
"context",
"."
] | def auto_synchronize(self):
'''
A context manager that waits for all commands in this stream to execute
and commits any pending memory transfers upon exiting the context.
'''
yield self
self.synchronize() | [
"def",
"auto_synchronize",
"(",
"self",
")",
":",
"yield",
"self",
"self",
".",
"synchronize",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/roc/hsadrv/driver.py#L1391-L1397 | ||
BSVino/DoubleAction | c550b168a3e919926c198c30240f506538b92e75 | mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/reflection.py | python | _AddInitMethod | (message_descriptor, cls) | Adds an __init__ method to cls. | Adds an __init__ method to cls. | [
"Adds",
"an",
"__init__",
"method",
"to",
"cls",
"."
] | def _AddInitMethod(message_descriptor, cls):
"""Adds an __init__ method to cls."""
fields = message_descriptor.fields
def init(self, **kwargs):
self._cached_byte_size = 0
self._cached_byte_size_dirty = False
self._fields = {}
self._is_present_in_parent = False
self._listener = message_listener... | [
"def",
"_AddInitMethod",
"(",
"message_descriptor",
",",
"cls",
")",
":",
"fields",
"=",
"message_descriptor",
".",
"fields",
"def",
"init",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"_cached_byte_size",
"=",
"0",
"self",
".",
"_cached_b... | https://github.com/BSVino/DoubleAction/blob/c550b168a3e919926c198c30240f506538b92e75/mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/reflection.py#L359-L391 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/misc/pilutil.py | python | imfilter | (arr, ftype) | return fromimage(im.filter(_tdict[ftype])) | Simple filtering of an image.
This function is only available if Python Imaging Library (PIL) is installed.
.. warning::
This function uses `bytescale` under the hood to rescale images to use
the full (0, 255) range if ``mode`` is one of ``None, 'L', 'P', 'l'``.
It will also cast data... | Simple filtering of an image. | [
"Simple",
"filtering",
"of",
"an",
"image",
"."
] | def imfilter(arr, ftype):
"""
Simple filtering of an image.
This function is only available if Python Imaging Library (PIL) is installed.
.. warning::
This function uses `bytescale` under the hood to rescale images to use
the full (0, 255) range if ``mode`` is one of ``None, 'L', 'P',... | [
"def",
"imfilter",
"(",
"arr",
",",
"ftype",
")",
":",
"_tdict",
"=",
"{",
"'blur'",
":",
"ImageFilter",
".",
"BLUR",
",",
"'contour'",
":",
"ImageFilter",
".",
"CONTOUR",
",",
"'detail'",
":",
"ImageFilter",
".",
"DETAIL",
",",
"'edge_enhance'",
":",
"I... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/misc/pilutil.py#L572-L621 | |
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/generator/msvs.py | python | _AddActionStep | (actions_dict, inputs, outputs, description, command) | Merge action into an existing list of actions.
Care must be taken so that actions which have overlapping inputs either don't
get assigned to the same input, or get collapsed into one.
Arguments:
actions_dict: dictionary keyed on input name, which maps to a list of
dicts describing the actions attached... | Merge action into an existing list of actions. | [
"Merge",
"action",
"into",
"an",
"existing",
"list",
"of",
"actions",
"."
] | def _AddActionStep(actions_dict, inputs, outputs, description, command):
"""Merge action into an existing list of actions.
Care must be taken so that actions which have overlapping inputs either don't
get assigned to the same input, or get collapsed into one.
Arguments:
actions_dict: dictionary keyed on i... | [
"def",
"_AddActionStep",
"(",
"actions_dict",
",",
"inputs",
",",
"outputs",
",",
"description",
",",
"command",
")",
":",
"# Require there to be at least one input (call sites will ensure this).",
"assert",
"inputs",
"action",
"=",
"{",
"'inputs'",
":",
"inputs",
",",
... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/generator/msvs.py#L378-L410 | ||
alibaba/graph-learn | 54cafee9db3054dc310a28b856be7f97c7d5aee9 | examples/tf/seal/seal_link_predict.py | python | eval_hits | (y_pred_pos, y_pred_neg, k) | return {'hits@{}'.format(k): hitsK} | compute Hits@K
For each positive target node, the negative target nodes are the same.
y_pred_neg is an array.
rank y_pred_pos[i] against y_pred_neg for each i | compute Hits | [
"compute",
"Hits"
] | def eval_hits(y_pred_pos, y_pred_neg, k):
'''
compute Hits@K
For each positive target node, the negative target nodes are the same.
y_pred_neg is an array.
rank y_pred_pos[i] against y_pred_neg for each i
'''
if len(y_pred_neg) < k or len(y_pred_pos) == 0:
return {'hits@{}'.format(k): ... | [
"def",
"eval_hits",
"(",
"y_pred_pos",
",",
"y_pred_neg",
",",
"k",
")",
":",
"if",
"len",
"(",
"y_pred_neg",
")",
"<",
"k",
"or",
"len",
"(",
"y_pred_pos",
")",
"==",
"0",
":",
"return",
"{",
"'hits@{}'",
".",
"format",
"(",
"k",
")",
":",
"1.",
... | https://github.com/alibaba/graph-learn/blob/54cafee9db3054dc310a28b856be7f97c7d5aee9/examples/tf/seal/seal_link_predict.py#L45-L56 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/v8/third_party/jinja2/environment.py | python | Template.get_corresponding_lineno | (self, lineno) | return 1 | Return the source line number of a line number in the
generated bytecode as they are not in sync. | Return the source line number of a line number in the
generated bytecode as they are not in sync. | [
"Return",
"the",
"source",
"line",
"number",
"of",
"a",
"line",
"number",
"in",
"the",
"generated",
"bytecode",
"as",
"they",
"are",
"not",
"in",
"sync",
"."
] | def get_corresponding_lineno(self, lineno):
"""Return the source line number of a line number in the
generated bytecode as they are not in sync.
"""
for template_line, code_line in reversed(self.debug_info):
if code_line <= lineno:
return template_line
... | [
"def",
"get_corresponding_lineno",
"(",
"self",
",",
"lineno",
")",
":",
"for",
"template_line",
",",
"code_line",
"in",
"reversed",
"(",
"self",
".",
"debug_info",
")",
":",
"if",
"code_line",
"<=",
"lineno",
":",
"return",
"template_line",
"return",
"1"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/third_party/jinja2/environment.py#L1108-L1115 | |
smilehao/xlua-framework | a03801538be2b0e92d39332d445b22caca1ef61f | ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/build/lib/google/protobuf/internal/decoder.py | python | BytesDecoder | (field_number, is_repeated, is_packed, key, new_default) | Returns a decoder for a bytes field. | Returns a decoder for a bytes field. | [
"Returns",
"a",
"decoder",
"for",
"a",
"bytes",
"field",
"."
] | def BytesDecoder(field_number, is_repeated, is_packed, key, new_default):
"""Returns a decoder for a bytes field."""
local_DecodeVarint = _DecodeVarint
assert not is_packed
if is_repeated:
tag_bytes = encoder.TagBytes(field_number,
wire_format.WIRETYPE_LENGTH_DELIMITED)
... | [
"def",
"BytesDecoder",
"(",
"field_number",
",",
"is_repeated",
",",
"is_packed",
",",
"key",
",",
"new_default",
")",
":",
"local_DecodeVarint",
"=",
"_DecodeVarint",
"assert",
"not",
"is_packed",
"if",
"is_repeated",
":",
"tag_bytes",
"=",
"encoder",
".",
"Tag... | https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/build/lib/google/protobuf/internal/decoder.py#L415-L449 | ||
kevinlin311tw/Caffe-DeepBinaryCode | 9eaa7662be47d49f475ecbeea2bd51be105270d2 | scripts/cpp_lint.py | python | ReverseCloseExpression | (clean_lines, linenum, pos) | return (line, 0, -1) | If input points to ) or } or ] or >, finds the position that opens it.
If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the
linenum/pos that correspond to the opening of the expression.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to ... | If input points to ) or } or ] or >, finds the position that opens it. | [
"If",
"input",
"points",
"to",
")",
"or",
"}",
"or",
"]",
"or",
">",
"finds",
"the",
"position",
"that",
"opens",
"it",
"."
] | def ReverseCloseExpression(clean_lines, linenum, pos):
"""If input points to ) or } or ] or >, finds the position that opens it.
If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the
linenum/pos that correspond to the opening of the expression.
Args:
clean_lines: A CleansedLines instance ... | [
"def",
"ReverseCloseExpression",
"(",
"clean_lines",
",",
"linenum",
",",
"pos",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"endchar",
"=",
"line",
"[",
"pos",
"]",
"if",
"endchar",
"not",
"in",
"')}]>'",
":",
"return",
"("... | https://github.com/kevinlin311tw/Caffe-DeepBinaryCode/blob/9eaa7662be47d49f475ecbeea2bd51be105270d2/scripts/cpp_lint.py#L1327-L1369 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextCtrl.GetWordChars | (*args, **kwargs) | return _stc.StyledTextCtrl_GetWordChars(*args, **kwargs) | GetWordChars(self) -> String | GetWordChars(self) -> String | [
"GetWordChars",
"(",
"self",
")",
"-",
">",
"String"
] | def GetWordChars(*args, **kwargs):
"""GetWordChars(self) -> String"""
return _stc.StyledTextCtrl_GetWordChars(*args, **kwargs) | [
"def",
"GetWordChars",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_GetWordChars",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L2844-L2846 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/contrib/decoder/beam_search_decoder.py | python | BeamSearchDecoder._parent_block | (self) | return parent_block | Getter of parent block.
Returns:
The parent block of decoder. | Getter of parent block. | [
"Getter",
"of",
"parent",
"block",
"."
] | def _parent_block(self):
"""
Getter of parent block.
Returns:
The parent block of decoder.
"""
program = self._helper.main_program
parent_block_idx = program.current_block().parent_idx
if parent_block_idx < 0:
raise ValueError('Invalid blo... | [
"def",
"_parent_block",
"(",
"self",
")",
":",
"program",
"=",
"self",
".",
"_helper",
".",
"main_program",
"parent_block_idx",
"=",
"program",
".",
"current_block",
"(",
")",
".",
"parent_idx",
"if",
"parent_block_idx",
"<",
"0",
":",
"raise",
"ValueError",
... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/contrib/decoder/beam_search_decoder.py#L827-L839 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/dtypes/common.py | python | needs_i8_conversion | (arr_or_dtype) | return (
is_datetime_or_timedelta_dtype(arr_or_dtype)
or is_datetime64tz_dtype(arr_or_dtype)
or is_period_dtype(arr_or_dtype)
) | Check whether the array or dtype should be converted to int64.
An array-like or dtype "needs" such a conversion if the array-like
or dtype is of a datetime-like dtype
Parameters
----------
arr_or_dtype : array-like
The array or dtype to check.
Returns
-------
boolean
W... | Check whether the array or dtype should be converted to int64. | [
"Check",
"whether",
"the",
"array",
"or",
"dtype",
"should",
"be",
"converted",
"to",
"int64",
"."
] | def needs_i8_conversion(arr_or_dtype) -> bool:
"""
Check whether the array or dtype should be converted to int64.
An array-like or dtype "needs" such a conversion if the array-like
or dtype is of a datetime-like dtype
Parameters
----------
arr_or_dtype : array-like
The array or dty... | [
"def",
"needs_i8_conversion",
"(",
"arr_or_dtype",
")",
"->",
"bool",
":",
"if",
"arr_or_dtype",
"is",
"None",
":",
"return",
"False",
"return",
"(",
"is_datetime_or_timedelta_dtype",
"(",
"arr_or_dtype",
")",
"or",
"is_datetime64tz_dtype",
"(",
"arr_or_dtype",
")",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/dtypes/common.py#L1282-L1323 | |
Manu343726/siplasplas | 9fae7559f87087cf8ef34f04bd1e774b84b2ea9c | reference/cindex.py | python | Cursor.objc_type_encoding | (self) | return self._objc_type_encoding | Return the Objective-C type encoding as a str. | Return the Objective-C type encoding as a str. | [
"Return",
"the",
"Objective",
"-",
"C",
"type",
"encoding",
"as",
"a",
"str",
"."
] | def objc_type_encoding(self):
"""Return the Objective-C type encoding as a str."""
if not hasattr(self, '_objc_type_encoding'):
self._objc_type_encoding = \
conf.lib.clang_getDeclObjCTypeEncoding(self)
return self._objc_type_encoding | [
"def",
"objc_type_encoding",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_objc_type_encoding'",
")",
":",
"self",
".",
"_objc_type_encoding",
"=",
"conf",
".",
"lib",
".",
"clang_getDeclObjCTypeEncoding",
"(",
"self",
")",
"return",
"sel... | https://github.com/Manu343726/siplasplas/blob/9fae7559f87087cf8ef34f04bd1e774b84b2ea9c/reference/cindex.py#L1412-L1418 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | tools/coverage/pull_request.py | python | get_pull | (pull_id) | return pull | Args:
pull_id (int): Pull id.
Returns:
github.PullRequest.PullRequest | Args:
pull_id (int): Pull id. | [
"Args",
":",
"pull_id",
"(",
"int",
")",
":",
"Pull",
"id",
"."
] | def get_pull(pull_id):
"""
Args:
pull_id (int): Pull id.
Returns:
github.PullRequest.PullRequest
"""
github = Github(token, timeout=60)
repo = github.get_repo('PaddlePaddle/Paddle')
pull = repo.get_pull(pull_id)
return pull | [
"def",
"get_pull",
"(",
"pull_id",
")",
":",
"github",
"=",
"Github",
"(",
"token",
",",
"timeout",
"=",
"60",
")",
"repo",
"=",
"github",
".",
"get_repo",
"(",
"'PaddlePaddle/Paddle'",
")",
"pull",
"=",
"repo",
".",
"get_pull",
"(",
"pull_id",
")",
"r... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/tools/coverage/pull_request.py#L30-L42 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | example/ssd/dataset/pycocotools/coco.py | python | COCO.loadNumpyAnnotations | (self, data) | return ann | Convert result data from a numpy array [Nx7] where each row contains {imageID,x1,y1,w,h,score,class}
:param data (numpy.ndarray)
:return: annotations (python nested list) | Convert result data from a numpy array [Nx7] where each row contains {imageID,x1,y1,w,h,score,class}
:param data (numpy.ndarray)
:return: annotations (python nested list) | [
"Convert",
"result",
"data",
"from",
"a",
"numpy",
"array",
"[",
"Nx7",
"]",
"where",
"each",
"row",
"contains",
"{",
"imageID",
"x1",
"y1",
"w",
"h",
"score",
"class",
"}",
":",
"param",
"data",
"(",
"numpy",
".",
"ndarray",
")",
":",
"return",
":",... | def loadNumpyAnnotations(self, data):
"""
Convert result data from a numpy array [Nx7] where each row contains {imageID,x1,y1,w,h,score,class}
:param data (numpy.ndarray)
:return: annotations (python nested list)
"""
print('Converting ndarray to lists...')
assert... | [
"def",
"loadNumpyAnnotations",
"(",
"self",
",",
"data",
")",
":",
"print",
"(",
"'Converting ndarray to lists...'",
")",
"assert",
"(",
"type",
"(",
"data",
")",
"==",
"np",
".",
"ndarray",
")",
"print",
"(",
"data",
".",
"shape",
")",
"assert",
"(",
"d... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/example/ssd/dataset/pycocotools/coco.py#L398-L419 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/help.py | python | HelpParser.handle_starttag | (self, tag, attrs) | Handle starttags in help.html. | Handle starttags in help.html. | [
"Handle",
"starttags",
"in",
"help",
".",
"html",
"."
] | def handle_starttag(self, tag, attrs):
"Handle starttags in help.html."
class_ = ''
for a, v in attrs:
if a == 'class':
class_ = v
s = ''
if tag == 'div' and class_ == 'section':
self.show = True # Start main content.
elif tag ==... | [
"def",
"handle_starttag",
"(",
"self",
",",
"tag",
",",
"attrs",
")",
":",
"class_",
"=",
"''",
"for",
"a",
",",
"v",
"in",
"attrs",
":",
"if",
"a",
"==",
"'class'",
":",
"class_",
"=",
"v",
"s",
"=",
"''",
"if",
"tag",
"==",
"'div'",
"and",
"c... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/help.py#L72-L128 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextFileHandler.GetEncoding | (*args, **kwargs) | return _richtext.RichTextFileHandler_GetEncoding(*args, **kwargs) | GetEncoding(self) -> String | GetEncoding(self) -> String | [
"GetEncoding",
"(",
"self",
")",
"-",
">",
"String"
] | def GetEncoding(*args, **kwargs):
"""GetEncoding(self) -> String"""
return _richtext.RichTextFileHandler_GetEncoding(*args, **kwargs) | [
"def",
"GetEncoding",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextFileHandler_GetEncoding",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L2828-L2830 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | build/config/win/get_msvc_config_real.py | python | VisualStudioVersion.ProjectVersion | (self) | return self.project_version | Get the version number of the vcproj or vcxproj files. | Get the version number of the vcproj or vcxproj files. | [
"Get",
"the",
"version",
"number",
"of",
"the",
"vcproj",
"or",
"vcxproj",
"files",
"."
] | def ProjectVersion(self):
"""Get the version number of the vcproj or vcxproj files."""
return self.project_version | [
"def",
"ProjectVersion",
"(",
"self",
")",
":",
"return",
"self",
".",
"project_version"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/config/win/get_msvc_config_real.py#L44-L46 | |
stepcode/stepcode | 2a50010e6f6b8bd4843561e48fdb0fd4e8b87f39 | src/exp2python/python/SCL/Part21.py | python | Parser.p_exchange_file | (self, p) | exchange_file : check_p21_start_token header_section data_section_list check_p21_end_token | exchange_file : check_p21_start_token header_section data_section_list check_p21_end_token | [
"exchange_file",
":",
"check_p21_start_token",
"header_section",
"data_section_list",
"check_p21_end_token"
] | def p_exchange_file(self, p):
"""exchange_file : check_p21_start_token header_section data_section_list check_p21_end_token"""
p[0] = P21File(p[2], p[3]) | [
"def",
"p_exchange_file",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"P21File",
"(",
"p",
"[",
"2",
"]",
",",
"p",
"[",
"3",
"]",
")"
] | https://github.com/stepcode/stepcode/blob/2a50010e6f6b8bd4843561e48fdb0fd4e8b87f39/src/exp2python/python/SCL/Part21.py#L284-L286 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/wheel_builder.py | python | _build_one | (
req, # type: InstallRequirement
output_dir, # type: str
verify, # type: bool
build_options, # type: List[str]
global_options, # type: List[str]
) | return wheel_path | Build one wheel.
:return: The filename of the built wheel, or None if the build failed. | Build one wheel. | [
"Build",
"one",
"wheel",
"."
] | def _build_one(
req, # type: InstallRequirement
output_dir, # type: str
verify, # type: bool
build_options, # type: List[str]
global_options, # type: List[str]
):
# type: (...) -> Optional[str]
"""Build one wheel.
:return: The filename of the built wheel, or None if the build faile... | [
"def",
"_build_one",
"(",
"req",
",",
"# type: InstallRequirement",
"output_dir",
",",
"# type: str",
"verify",
",",
"# type: bool",
"build_options",
",",
"# type: List[str]",
"global_options",
",",
"# type: List[str]",
")",
":",
"# type: (...) -> Optional[str]",
"try",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/wheel_builder.py#L213-L245 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/requests_aws4auth/aws4auth.py | python | AWS4Auth.get_canonical_headers | (cls, req, include=None) | return (cano_headers, signed_headers) | Generate the Canonical Headers section of the Canonical Request.
Return the Canonical Headers and the Signed Headers strs as a tuple
(canonical_headers, signed_headers).
req -- Requests PreparedRequest object
include -- List of headers to include in the canonical and signed
... | Generate the Canonical Headers section of the Canonical Request. | [
"Generate",
"the",
"Canonical",
"Headers",
"section",
"of",
"the",
"Canonical",
"Request",
"."
] | def get_canonical_headers(cls, req, include=None):
"""
Generate the Canonical Headers section of the Canonical Request.
Return the Canonical Headers and the Signed Headers strs as a tuple
(canonical_headers, signed_headers).
req -- Requests PreparedRequest object
in... | [
"def",
"get_canonical_headers",
"(",
"cls",
",",
"req",
",",
"include",
"=",
"None",
")",
":",
"if",
"include",
"is",
"None",
":",
"include",
"=",
"cls",
".",
"default_include_headers",
"include",
"=",
"[",
"x",
".",
"lower",
"(",
")",
"for",
"x",
"in"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/requests_aws4auth/aws4auth.py#L523-L573 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/distributions/python/ops/mvn_linear_operator.py | python | _kl_brute_force | (a, b, name=None) | Batched KL divergence `KL(a || b)` for multivariate Normals.
With `X`, `Y` both multivariate Normals in `R^k` with means `mu_a`, `mu_b` and
covariance `C_a`, `C_b` respectively,
```
KL(a || b) = 0.5 * ( L - k + T + Q ),
L := Log[Det(C_b)] - Log[Det(C_a)]
T := trace(C_b^{-1} C_a),
Q := (mu_b - mu_a)^T C_... | Batched KL divergence `KL(a || b)` for multivariate Normals. | [
"Batched",
"KL",
"divergence",
"KL",
"(",
"a",
"||",
"b",
")",
"for",
"multivariate",
"Normals",
"."
] | def _kl_brute_force(a, b, name=None):
"""Batched KL divergence `KL(a || b)` for multivariate Normals.
With `X`, `Y` both multivariate Normals in `R^k` with means `mu_a`, `mu_b` and
covariance `C_a`, `C_b` respectively,
```
KL(a || b) = 0.5 * ( L - k + T + Q ),
L := Log[Det(C_b)] - Log[Det(C_a)]
T := tra... | [
"def",
"_kl_brute_force",
"(",
"a",
",",
"b",
",",
"name",
"=",
"None",
")",
":",
"def",
"squared_frobenius_norm",
"(",
"x",
")",
":",
"\"\"\"Helper to make KL calculation slightly more readable.\"\"\"",
"# http://mathworld.wolfram.com/FrobeniusNorm.html",
"return",
"math_o... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/distributions/python/ops/mvn_linear_operator.py#L271-L342 | ||
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TBool.GetPrimHashCd | (self) | return _snap.TBool_GetPrimHashCd(self) | GetPrimHashCd(TBool self) -> int
Parameters:
self: TBool const * | GetPrimHashCd(TBool self) -> int | [
"GetPrimHashCd",
"(",
"TBool",
"self",
")",
"-",
">",
"int"
] | def GetPrimHashCd(self):
"""
GetPrimHashCd(TBool self) -> int
Parameters:
self: TBool const *
"""
return _snap.TBool_GetPrimHashCd(self) | [
"def",
"GetPrimHashCd",
"(",
"self",
")",
":",
"return",
"_snap",
".",
"TBool_GetPrimHashCd",
"(",
"self",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L12193-L12201 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py | python | EnsureDirExists | (path) | Make sure the directory for |path| exists. | Make sure the directory for |path| exists. | [
"Make",
"sure",
"the",
"directory",
"for",
"|path|",
"exists",
"."
] | def EnsureDirExists(path):
"""Make sure the directory for |path| exists."""
try:
os.makedirs(os.path.dirname(path))
except OSError:
pass | [
"def",
"EnsureDirExists",
"(",
"path",
")",
":",
"try",
":",
"os",
".",
"makedirs",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"path",
")",
")",
"except",
"OSError",
":",
"pass"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py#L415-L420 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/ndarray/ndarray.py | python | NDArray.ndim | (self) | return len(self.shape) | Returns the number of dimensions of this array
Examples
--------
>>> x = mx.nd.array([1, 2, 3, 4])
>>> x.ndim
1
>>> x = mx.nd.array([[1, 2], [3, 4]])
>>> x.ndim
2 | Returns the number of dimensions of this array | [
"Returns",
"the",
"number",
"of",
"dimensions",
"of",
"this",
"array"
] | def ndim(self):
"""Returns the number of dimensions of this array
Examples
--------
>>> x = mx.nd.array([1, 2, 3, 4])
>>> x.ndim
1
>>> x = mx.nd.array([[1, 2], [3, 4]])
>>> x.ndim
2
"""
return len(self.shape) | [
"def",
"ndim",
"(",
"self",
")",
":",
"return",
"len",
"(",
"self",
".",
"shape",
")"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/ndarray/ndarray.py#L2430-L2442 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/showbase/Messenger.py | python | Messenger.__methodRepr | (self, method) | return functionName | return string version of class.method or method. | return string version of class.method or method. | [
"return",
"string",
"version",
"of",
"class",
".",
"method",
"or",
"method",
"."
] | def __methodRepr(self, method):
"""
return string version of class.method or method.
"""
if isinstance(method, types.MethodType):
functionName = method.__self__.__class__.__name__ + '.' + \
method.__func__.__name__
else:
if hasattr(method, ... | [
"def",
"__methodRepr",
"(",
"self",
",",
"method",
")",
":",
"if",
"isinstance",
"(",
"method",
",",
"types",
".",
"MethodType",
")",
":",
"functionName",
"=",
"method",
".",
"__self__",
".",
"__class__",
".",
"__name__",
"+",
"'.'",
"+",
"method",
".",
... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/showbase/Messenger.py#L569-L581 | |
sfzhang15/RefineDet | 52b6fe23dc1a160fe710b7734576dca509bf4fae | python/caffe/pycaffe.py | python | _Net_forward_all | (self, blobs=None, **kwargs) | return all_outs | Run net forward in batches.
Parameters
----------
blobs : list of blobs to extract as in forward()
kwargs : Keys are input blob names and values are blob ndarrays.
Refer to forward().
Returns
-------
all_outs : {blob name: list of blobs} dict. | Run net forward in batches. | [
"Run",
"net",
"forward",
"in",
"batches",
"."
] | def _Net_forward_all(self, blobs=None, **kwargs):
"""
Run net forward in batches.
Parameters
----------
blobs : list of blobs to extract as in forward()
kwargs : Keys are input blob names and values are blob ndarrays.
Refer to forward().
Returns
-------
all_outs : {blo... | [
"def",
"_Net_forward_all",
"(",
"self",
",",
"blobs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# Collect outputs from batches",
"all_outs",
"=",
"{",
"out",
":",
"[",
"]",
"for",
"out",
"in",
"set",
"(",
"self",
".",
"outputs",
"+",
"(",
"blobs... | https://github.com/sfzhang15/RefineDet/blob/52b6fe23dc1a160fe710b7734576dca509bf4fae/python/caffe/pycaffe.py#L175-L203 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pyrsistent/_field_common.py | python | _restore_seq_field_pickle | (checked_class, item_type, data) | return _restore_pickle(type_, data) | Unpickling function for auto-generated PVec/PSet field types. | Unpickling function for auto-generated PVec/PSet field types. | [
"Unpickling",
"function",
"for",
"auto",
"-",
"generated",
"PVec",
"/",
"PSet",
"field",
"types",
"."
] | def _restore_seq_field_pickle(checked_class, item_type, data):
"""Unpickling function for auto-generated PVec/PSet field types."""
type_ = _seq_field_types[checked_class, item_type]
return _restore_pickle(type_, data) | [
"def",
"_restore_seq_field_pickle",
"(",
"checked_class",
",",
"item_type",
",",
"data",
")",
":",
"type_",
"=",
"_seq_field_types",
"[",
"checked_class",
",",
"item_type",
"]",
"return",
"_restore_pickle",
"(",
"type_",
",",
"data",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pyrsistent/_field_common.py#L186-L189 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/ndarray/ndarray.py | python | NDArray.log | (self, *args, **kwargs) | return op.log(self, *args, **kwargs) | Convenience fluent method for :py:func:`log`.
The arguments are the same as for :py:func:`log`, with
this array as data. | Convenience fluent method for :py:func:`log`. | [
"Convenience",
"fluent",
"method",
"for",
":",
"py",
":",
"func",
":",
"log",
"."
] | def log(self, *args, **kwargs):
"""Convenience fluent method for :py:func:`log`.
The arguments are the same as for :py:func:`log`, with
this array as data.
"""
return op.log(self, *args, **kwargs) | [
"def",
"log",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"op",
".",
"log",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/ndarray/ndarray.py#L2142-L2148 | |
fatih/subvim | 241b6d170597857105da219c9b7d36059e9f11fb | vim/base/YouCompleteMe/third_party/bottle/bottle.py | python | BaseResponse.delete_cookie | (self, key, **kwargs) | Delete a cookie. Be sure to use the same `domain` and `path`
settings as used to create the cookie. | Delete a cookie. Be sure to use the same `domain` and `path`
settings as used to create the cookie. | [
"Delete",
"a",
"cookie",
".",
"Be",
"sure",
"to",
"use",
"the",
"same",
"domain",
"and",
"path",
"settings",
"as",
"used",
"to",
"create",
"the",
"cookie",
"."
] | def delete_cookie(self, key, **kwargs):
''' Delete a cookie. Be sure to use the same `domain` and `path`
settings as used to create the cookie. '''
kwargs['max_age'] = -1
kwargs['expires'] = 0
self.set_cookie(key, '', **kwargs) | [
"def",
"delete_cookie",
"(",
"self",
",",
"key",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"'max_age'",
"]",
"=",
"-",
"1",
"kwargs",
"[",
"'expires'",
"]",
"=",
"0",
"self",
".",
"set_cookie",
"(",
"key",
",",
"''",
",",
"*",
"*",
"kwarg... | https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/bottle/bottle.py#L1613-L1618 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_basestc.py | python | EditraBaseStc.GetFileName | (self) | return self.file.GetPath() | Returns the full path name of the current file
@return: full path name of document | Returns the full path name of the current file
@return: full path name of document | [
"Returns",
"the",
"full",
"path",
"name",
"of",
"the",
"current",
"file",
"@return",
":",
"full",
"path",
"name",
"of",
"document"
] | def GetFileName(self):
"""Returns the full path name of the current file
@return: full path name of document
"""
return self.file.GetPath() | [
"def",
"GetFileName",
"(",
"self",
")",
":",
"return",
"self",
".",
"file",
".",
"GetPath",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_basestc.py#L679-L684 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/common/form_wrap.py | python | FormWrap.getvalue_url | (self, key, default_val=None) | return val | Gets an URL value (absolute or relative).
Args:
key: requested argument.
default_val: a default value to return if requested argument is not
present.
Returns:
value for requested argument. | Gets an URL value (absolute or relative). | [
"Gets",
"an",
"URL",
"value",
"(",
"absolute",
"or",
"relative",
")",
"."
] | def getvalue_url(self, key, default_val=None):
"""Gets an URL value (absolute or relative).
Args:
key: requested argument.
default_val: a default value to return if requested argument is not
present.
Returns:
value for requested argument.
"""
logging.debug("getv... | [
"def",
"getvalue_url",
"(",
"self",
",",
"key",
",",
"default_val",
"=",
"None",
")",
":",
"logging",
".",
"debug",
"(",
"\"getvalue_url() - key: %s\"",
",",
"key",
")",
"val",
"=",
"self",
".",
"_getvalue_raw",
"(",
"key",
",",
"default_val",
")",
"if",
... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/common/form_wrap.py#L219-L239 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/encodings/punycode.py | python | selective_find | (str, char, index, pos) | Return a pair (index, pos), indicating the next occurrence of
char in str. index is the position of the character considering
only ordinals up to and including char, and pos is the position in
the full string. index/pos is the starting position in the full
string. | Return a pair (index, pos), indicating the next occurrence of
char in str. index is the position of the character considering
only ordinals up to and including char, and pos is the position in
the full string. index/pos is the starting position in the full
string. | [
"Return",
"a",
"pair",
"(",
"index",
"pos",
")",
"indicating",
"the",
"next",
"occurrence",
"of",
"char",
"in",
"str",
".",
"index",
"is",
"the",
"position",
"of",
"the",
"character",
"considering",
"only",
"ordinals",
"up",
"to",
"and",
"including",
"char... | def selective_find(str, char, index, pos):
"""Return a pair (index, pos), indicating the next occurrence of
char in str. index is the position of the character considering
only ordinals up to and including char, and pos is the position in
the full string. index/pos is the starting position in the full
... | [
"def",
"selective_find",
"(",
"str",
",",
"char",
",",
"index",
",",
"pos",
")",
":",
"l",
"=",
"len",
"(",
"str",
")",
"while",
"1",
":",
"pos",
"+=",
"1",
"if",
"pos",
"==",
"l",
":",
"return",
"(",
"-",
"1",
",",
"-",
"1",
")",
"c",
"=",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/encodings/punycode.py#L30-L46 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/distutils/command/sdist.py | python | sdist.make_release_tree | (self, base_dir, files) | Create the directory tree that will become the source
distribution archive. All directories implied by the filenames in
'files' are created under 'base_dir', and then we hard link or copy
(if hard linking is unavailable) those files into place.
Essentially, this duplicates the developer... | Create the directory tree that will become the source
distribution archive. All directories implied by the filenames in
'files' are created under 'base_dir', and then we hard link or copy
(if hard linking is unavailable) those files into place.
Essentially, this duplicates the developer... | [
"Create",
"the",
"directory",
"tree",
"that",
"will",
"become",
"the",
"source",
"distribution",
"archive",
".",
"All",
"directories",
"implied",
"by",
"the",
"filenames",
"in",
"files",
"are",
"created",
"under",
"base_dir",
"and",
"then",
"we",
"hard",
"link... | def make_release_tree(self, base_dir, files):
"""Create the directory tree that will become the source
distribution archive. All directories implied by the filenames in
'files' are created under 'base_dir', and then we hard link or copy
(if hard linking is unavailable) those files into ... | [
"def",
"make_release_tree",
"(",
"self",
",",
"base_dir",
",",
"files",
")",
":",
"# Create all the directories under 'base_dir' necessary to",
"# put 'files' there; the 'mkpath()' is just so we don't die",
"# if the manifest happens to be empty.",
"self",
".",
"mkpath",
"(",
"base... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/distutils/command/sdist.py#L401-L441 | ||
bh107/bohrium | 5b83e7117285fefc7779ed0e9acb0f8e74c7e068 | bridge/npbackend/bohrium/masking.py | python | masked_get | (ary, bool_mask) | return ary[reorganization.nonzero(bool_mask)] | Get the elements of 'ary' specified by 'bool_mask'. | Get the elements of 'ary' specified by 'bool_mask'. | [
"Get",
"the",
"elements",
"of",
"ary",
"specified",
"by",
"bool_mask",
"."
] | def masked_get(ary, bool_mask):
"""
Get the elements of 'ary' specified by 'bool_mask'.
"""
return ary[reorganization.nonzero(bool_mask)] | [
"def",
"masked_get",
"(",
"ary",
",",
"bool_mask",
")",
":",
"return",
"ary",
"[",
"reorganization",
".",
"nonzero",
"(",
"bool_mask",
")",
"]"
] | https://github.com/bh107/bohrium/blob/5b83e7117285fefc7779ed0e9acb0f8e74c7e068/bridge/npbackend/bohrium/masking.py#L140-L145 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/mhlib.py | python | MH.__init__ | (self, path = None, profile = None) | Constructor. | Constructor. | [
"Constructor",
"."
] | def __init__(self, path = None, profile = None):
"""Constructor."""
if profile is None: profile = MH_PROFILE
self.profile = os.path.expanduser(profile)
if path is None: path = self.getprofile('Path')
if not path: path = PATH
if not os.path.isabs(path) and path[0] != '~':
... | [
"def",
"__init__",
"(",
"self",
",",
"path",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"if",
"profile",
"is",
"None",
":",
"profile",
"=",
"MH_PROFILE",
"self",
".",
"profile",
"=",
"os",
".",
"path",
".",
"expanduser",
"(",
"profile",
")",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/mhlib.py#L102-L112 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/datasets/species_distributions.py | python | fetch_species_distributions | (data_home=None,
download_if_missing=True) | return bunch | Loader for species distribution dataset from Phillips et. al. (2006)
Read more in the :ref:`User Guide <datasets>`.
Parameters
----------
data_home : optional, default: None
Specify another download and cache folder for the datasets. By default
all scikit learn data is stored in '~/sci... | Loader for species distribution dataset from Phillips et. al. (2006) | [
"Loader",
"for",
"species",
"distribution",
"dataset",
"from",
"Phillips",
"et",
".",
"al",
".",
"(",
"2006",
")"
] | def fetch_species_distributions(data_home=None,
download_if_missing=True):
"""Loader for species distribution dataset from Phillips et. al. (2006)
Read more in the :ref:`User Guide <datasets>`.
Parameters
----------
data_home : optional, default: None
Specif... | [
"def",
"fetch_species_distributions",
"(",
"data_home",
"=",
"None",
",",
"download_if_missing",
"=",
"True",
")",
":",
"data_home",
"=",
"get_data_home",
"(",
"data_home",
")",
"if",
"not",
"exists",
"(",
"data_home",
")",
":",
"makedirs",
"(",
"data_home",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/datasets/species_distributions.py#L132-L256 | |
isc-projects/kea | c5836c791b63f42173bb604dd5f05d7110f3e716 | hammer.py | python | _configure_pgsql | (system, features) | Configure PostgreSQL DB | Configure PostgreSQL DB | [
"Configure",
"PostgreSQL",
"DB"
] | def _configure_pgsql(system, features):
""" Configure PostgreSQL DB """
# execute() calls will set cwd='/tmp' when switching user to postgres to
# avoid the error:
# could not change as postgres user directory to "/home/jenkins": Permission denied
if system in ['fedora', 'centos']:
# htt... | [
"def",
"_configure_pgsql",
"(",
"system",
",",
"features",
")",
":",
"# execute() calls will set cwd='/tmp' when switching user to postgres to",
"# avoid the error:",
"# could not change as postgres user directory to \"/home/jenkins\": Permission denied",
"if",
"system",
"in",
"[",
"... | https://github.com/isc-projects/kea/blob/c5836c791b63f42173bb604dd5f05d7110f3e716/hammer.py#L1213-L1297 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/plot.py | python | PlotGraphics.getYLabel | (self) | return self.yLabel | Get y axis label string | Get y axis label string | [
"Get",
"y",
"axis",
"label",
"string"
] | def getYLabel(self):
"""Get y axis label string"""
return self.yLabel | [
"def",
"getYLabel",
"(",
"self",
")",
":",
"return",
"self",
".",
"yLabel"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/plot.py#L500-L502 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBBreakpointLocation.GetQueueName | (self) | return _lldb.SBBreakpointLocation_GetQueueName(self) | GetQueueName(SBBreakpointLocation self) -> char const * | GetQueueName(SBBreakpointLocation self) -> char const * | [
"GetQueueName",
"(",
"SBBreakpointLocation",
"self",
")",
"-",
">",
"char",
"const",
"*"
] | def GetQueueName(self):
"""GetQueueName(SBBreakpointLocation self) -> char const *"""
return _lldb.SBBreakpointLocation_GetQueueName(self) | [
"def",
"GetQueueName",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBBreakpointLocation_GetQueueName",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L2118-L2120 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/Context.py | python | Context.end_msg | (self, result, color=None) | Print the end of a 'Checking for' message. See :py:meth:`waflib.Context.Context.msg` | Print the end of a 'Checking for' message. See :py:meth:`waflib.Context.Context.msg` | [
"Print",
"the",
"end",
"of",
"a",
"Checking",
"for",
"message",
".",
"See",
":",
"py",
":",
"meth",
":",
"waflib",
".",
"Context",
".",
"Context",
".",
"msg"
] | def end_msg(self, result, color=None):
"""Print the end of a 'Checking for' message. See :py:meth:`waflib.Context.Context.msg`"""
self.in_msg -= 1
if self.in_msg:
return
defcolor = 'GREEN'
if result == True:
msg = 'ok'
elif result == False:
msg = 'not found'
defcolor = 'YELLOW'
else:
msg =... | [
"def",
"end_msg",
"(",
"self",
",",
"result",
",",
"color",
"=",
"None",
")",
":",
"self",
".",
"in_msg",
"-=",
"1",
"if",
"self",
".",
"in_msg",
":",
"return",
"defcolor",
"=",
"'GREEN'",
"if",
"result",
"==",
"True",
":",
"msg",
"=",
"'ok'",
"eli... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Context.py#L570-L586 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | StaticLine.GetClassDefaultAttributes | (*args, **kwargs) | return _controls_.StaticLine_GetClassDefaultAttributes(*args, **kwargs) | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control -- which is a much better idea than hard coding specific
co... | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | [
"GetClassDefaultAttributes",
"(",
"int",
"variant",
"=",
"WINDOW_VARIANT_NORMAL",
")",
"-",
">",
"VisualAttributes"
] | def GetClassDefaultAttributes(*args, **kwargs):
"""
GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control... | [
"def",
"GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"StaticLine_GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L935-L950 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/logging/config.py | python | _install_loggers | (cp, handlers, disable_existing) | Create and install loggers | Create and install loggers | [
"Create",
"and",
"install",
"loggers"
] | def _install_loggers(cp, handlers, disable_existing):
"""Create and install loggers"""
# configure the root first
llist = cp["loggers"]["keys"]
llist = llist.split(",")
llist = list(_strip_spaces(llist))
llist.remove("root")
section = cp["logger_root"]
root = logging.root
log = root... | [
"def",
"_install_loggers",
"(",
"cp",
",",
"handlers",
",",
"disable_existing",
")",
":",
"# configure the root first",
"llist",
"=",
"cp",
"[",
"\"loggers\"",
"]",
"[",
"\"keys\"",
"]",
"llist",
"=",
"llist",
".",
"split",
"(",
"\",\"",
")",
"llist",
"=",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/logging/config.py#L184-L268 | ||
apiaryio/drafter | 4634ebd07f6c6f257cc656598ccd535492fdfb55 | tools/gyp/pylib/gyp/MSVSVersion.py | python | VisualStudioVersion.DefaultToolset | (self) | return self.default_toolset | Returns the msbuild toolset version that will be used in the absence
of a user override. | Returns the msbuild toolset version that will be used in the absence
of a user override. | [
"Returns",
"the",
"msbuild",
"toolset",
"version",
"that",
"will",
"be",
"used",
"in",
"the",
"absence",
"of",
"a",
"user",
"override",
"."
] | def DefaultToolset(self):
"""Returns the msbuild toolset version that will be used in the absence
of a user override."""
return self.default_toolset | [
"def",
"DefaultToolset",
"(",
"self",
")",
":",
"return",
"self",
".",
"default_toolset"
] | https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/MSVSVersion.py#L66-L69 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/socksipy-branch/socks.py | python | socksocket.connect | (self, destpair) | connect(self, despair)
Connects to the specified destination through a proxy.
destpar - A tuple of the IP/DNS address and the port number.
(identical to socket's connect).
To select the proxy server use setproxy(). | connect(self, despair)
Connects to the specified destination through a proxy.
destpar - A tuple of the IP/DNS address and the port number.
(identical to socket's connect).
To select the proxy server use setproxy(). | [
"connect",
"(",
"self",
"despair",
")",
"Connects",
"to",
"the",
"specified",
"destination",
"through",
"a",
"proxy",
".",
"destpar",
"-",
"A",
"tuple",
"of",
"the",
"IP",
"/",
"DNS",
"address",
"and",
"the",
"port",
"number",
".",
"(",
"identical",
"to"... | def connect(self, destpair):
"""connect(self, despair)
Connects to the specified destination through a proxy.
destpar - A tuple of the IP/DNS address and the port number.
(identical to socket's connect).
To select the proxy server use setproxy().
"""
# Do a minima... | [
"def",
"connect",
"(",
"self",
",",
"destpair",
")",
":",
"# Do a minimal input check first",
"if",
"(",
"not",
"type",
"(",
"destpair",
")",
"in",
"(",
"list",
",",
"tuple",
")",
")",
"or",
"(",
"len",
"(",
"destpair",
")",
"<",
"2",
")",
"or",
"(",... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/socksipy-branch/socks.py#L353-L387 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/s3transfer/futures.py | python | TransferFuture.__init__ | (self, meta=None, coordinator=None) | The future associated to a submitted transfer request
:type meta: TransferMeta
:param meta: The metadata associated to the request. This object
is visible to the requester.
:type coordinator: TransferCoordinator
:param coordinator: The coordinator associated to the request.... | The future associated to a submitted transfer request | [
"The",
"future",
"associated",
"to",
"a",
"submitted",
"transfer",
"request"
] | def __init__(self, meta=None, coordinator=None):
"""The future associated to a submitted transfer request
:type meta: TransferMeta
:param meta: The metadata associated to the request. This object
is visible to the requester.
:type coordinator: TransferCoordinator
:p... | [
"def",
"__init__",
"(",
"self",
",",
"meta",
"=",
"None",
",",
"coordinator",
"=",
"None",
")",
":",
"self",
".",
"_meta",
"=",
"meta",
"if",
"meta",
"is",
"None",
":",
"self",
".",
"_meta",
"=",
"TransferMeta",
"(",
")",
"self",
".",
"_coordinator",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/s3transfer/futures.py#L75-L92 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/calendar.py | python | CalendarCtrlBase.Mark | (*args, **kwargs) | return _calendar.CalendarCtrlBase_Mark(*args, **kwargs) | Mark(self, size_t day, bool mark) | Mark(self, size_t day, bool mark) | [
"Mark",
"(",
"self",
"size_t",
"day",
"bool",
"mark",
")"
] | def Mark(*args, **kwargs):
"""Mark(self, size_t day, bool mark)"""
return _calendar.CalendarCtrlBase_Mark(*args, **kwargs) | [
"def",
"Mark",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_calendar",
".",
"CalendarCtrlBase_Mark",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/calendar.py#L318-L320 | |
wesnoth/wesnoth | 6ccac5a5e8ff75303c9190c0da60580925cb32c0 | data/tools/wesnoth/wmliterator3.py | python | isMacroCloser | (elem) | return type(elem) == type("") and elem == closeMacroType | Are we looking at a macro closer? | Are we looking at a macro closer? | [
"Are",
"we",
"looking",
"at",
"a",
"macro",
"closer?"
] | def isMacroCloser(elem):
"Are we looking at a macro closer?"
if isinstance(elem, WmlIterator):
elem = elem.element
return type(elem) == type("") and elem == closeMacroType | [
"def",
"isMacroCloser",
"(",
"elem",
")",
":",
"if",
"isinstance",
"(",
"elem",
",",
"WmlIterator",
")",
":",
"elem",
"=",
"elem",
".",
"element",
"return",
"type",
"(",
"elem",
")",
"==",
"type",
"(",
"\"\"",
")",
"and",
"elem",
"==",
"closeMacroType"... | https://github.com/wesnoth/wesnoth/blob/6ccac5a5e8ff75303c9190c0da60580925cb32c0/data/tools/wesnoth/wmliterator3.py#L70-L74 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Window.SetInitialSize | (*args, **kwargs) | return _core_.Window_SetInitialSize(*args, **kwargs) | SetInitialSize(self, Size size=DefaultSize)
A 'Smart' SetSize that will fill in default size components with the
window's *best size* values. Also set's the minsize for use with sizers. | SetInitialSize(self, Size size=DefaultSize) | [
"SetInitialSize",
"(",
"self",
"Size",
"size",
"=",
"DefaultSize",
")"
] | def SetInitialSize(*args, **kwargs):
"""
SetInitialSize(self, Size size=DefaultSize)
A 'Smart' SetSize that will fill in default size components with the
window's *best size* values. Also set's the minsize for use with sizers.
"""
return _core_.Window_SetInitialSize(*ar... | [
"def",
"SetInitialSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_SetInitialSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L9390-L9397 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/frame.py | python | DataFrame.from_records | (
cls,
data,
index=None,
exclude=None,
columns=None,
coerce_float: bool = False,
nrows: int | None = None,
) | return cls(mgr) | Convert structured or record ndarray to DataFrame.
Creates a DataFrame object from a structured ndarray, sequence of
tuples or dicts, or DataFrame.
Parameters
----------
data : structured ndarray, sequence of tuples or dicts, or DataFrame
Structured input data.
... | Convert structured or record ndarray to DataFrame. | [
"Convert",
"structured",
"or",
"record",
"ndarray",
"to",
"DataFrame",
"."
] | def from_records(
cls,
data,
index=None,
exclude=None,
columns=None,
coerce_float: bool = False,
nrows: int | None = None,
) -> DataFrame:
"""
Convert structured or record ndarray to DataFrame.
Creates a DataFrame object from a structu... | [
"def",
"from_records",
"(",
"cls",
",",
"data",
",",
"index",
"=",
"None",
",",
"exclude",
"=",
"None",
",",
"columns",
"=",
"None",
",",
"coerce_float",
":",
"bool",
"=",
"False",
",",
"nrows",
":",
"int",
"|",
"None",
"=",
"None",
",",
")",
"->",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/frame.py#L1944-L2124 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pbr/packaging.py | python | override_get_script_args | (
dist, executable=os.path.normpath(sys.executable), is_wininst=False) | Override entrypoints console_script. | Override entrypoints console_script. | [
"Override",
"entrypoints",
"console_script",
"."
] | def override_get_script_args(
dist, executable=os.path.normpath(sys.executable), is_wininst=False):
"""Override entrypoints console_script."""
header = easy_install.get_script_header("", executable, is_wininst)
for group, template in ENTRY_POINTS_MAP.items():
for name, ep in dist.get_entry_m... | [
"def",
"override_get_script_args",
"(",
"dist",
",",
"executable",
"=",
"os",
".",
"path",
".",
"normpath",
"(",
"sys",
".",
"executable",
")",
",",
"is_wininst",
"=",
"False",
")",
":",
"header",
"=",
"easy_install",
".",
"get_script_header",
"(",
"\"\"",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pbr/packaging.py#L398-L404 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/numbers.py | python | Complex.imag | (self) | Retrieve the imaginary component of this number.
This should subclass Real. | Retrieve the imaginary component of this number. | [
"Retrieve",
"the",
"imaginary",
"component",
"of",
"this",
"number",
"."
] | def imag(self):
"""Retrieve the imaginary component of this number.
This should subclass Real.
"""
raise NotImplementedError | [
"def",
"imag",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/numbers.py#L64-L69 | ||
HyeonwooNoh/caffe | d9e8494a2832d67b25dee37194c7bcb9d52d0e42 | scripts/cpp_lint.py | python | _CppLintState.ResetErrorCounts | (self) | Sets the module's error statistic back to zero. | Sets the module's error statistic back to zero. | [
"Sets",
"the",
"module",
"s",
"error",
"statistic",
"back",
"to",
"zero",
"."
] | def ResetErrorCounts(self):
"""Sets the module's error statistic back to zero."""
self.error_count = 0
self.errors_by_category = {} | [
"def",
"ResetErrorCounts",
"(",
"self",
")",
":",
"self",
".",
"error_count",
"=",
"0",
"self",
".",
"errors_by_category",
"=",
"{",
"}"
] | https://github.com/HyeonwooNoh/caffe/blob/d9e8494a2832d67b25dee37194c7bcb9d52d0e42/scripts/cpp_lint.py#L742-L745 | ||
ablab/spades | 3a754192b88540524ce6fb69eef5ea9273a38465 | webvis/pydot.py | python | Dot.write | (self, path, prog=None, format='raw') | return True | Writes a graph to a file.
Given a filename 'path' it will open/create and truncate
such file and write on it a representation of the graph
defined by the dot object and in the format specified by
'format'.
The format 'raw' is used to dump the string representation
of the... | Writes a graph to a file. | [
"Writes",
"a",
"graph",
"to",
"a",
"file",
"."
] | def write(self, path, prog=None, format='raw'):
"""Writes a graph to a file.
Given a filename 'path' it will open/create and truncate
such file and write on it a representation of the graph
defined by the dot object and in the format specified by
'format'.
The format 'ra... | [
"def",
"write",
"(",
"self",
",",
"path",
",",
"prog",
"=",
"None",
",",
"format",
"=",
"'raw'",
")",
":",
"if",
"prog",
"is",
"None",
":",
"prog",
"=",
"self",
".",
"prog",
"dot_fd",
"=",
"file",
"(",
"path",
",",
"\"w+b\"",
")",
"if",
"format",... | https://github.com/ablab/spades/blob/3a754192b88540524ce6fb69eef5ea9273a38465/webvis/pydot.py#L1870-L1914 | |
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/Chem/ChemUtils/SDFToCSV.py | python | initParser | () | return parser | Initialize the parser for the CLI | Initialize the parser for the CLI | [
"Initialize",
"the",
"parser",
"for",
"the",
"CLI"
] | def initParser():
""" Initialize the parser for the CLI """
parser = argparse.ArgumentParser(description='Convert SDF file to CSV',
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument('--key', '-k', metavar='keyCol', default=None, dest='keyCol')
parser.ad... | [
"def",
"initParser",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"'Convert SDF file to CSV'",
",",
"formatter_class",
"=",
"argparse",
".",
"RawDescriptionHelpFormatter",
")",
"parser",
".",
"add_argument",
"(",
"'--key'... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/Chem/ChemUtils/SDFToCSV.py#L57-L66 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/asyncio/events.py | python | set_event_loop_policy | (policy) | Set the current event loop policy.
If policy is None, the default policy is restored. | Set the current event loop policy. | [
"Set",
"the",
"current",
"event",
"loop",
"policy",
"."
] | def set_event_loop_policy(policy):
"""Set the current event loop policy.
If policy is None, the default policy is restored."""
global _event_loop_policy
assert policy is None or isinstance(policy, AbstractEventLoopPolicy)
_event_loop_policy = policy | [
"def",
"set_event_loop_policy",
"(",
"policy",
")",
":",
"global",
"_event_loop_policy",
"assert",
"policy",
"is",
"None",
"or",
"isinstance",
"(",
"policy",
",",
"AbstractEventLoopPolicy",
")",
"_event_loop_policy",
"=",
"policy"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/asyncio/events.py#L730-L736 | ||
danxuhk/ContinuousCRF-CNN | 2b6dcaf179620f118b225ed12c890414ca828e21 | scripts/cpp_lint.py | python | Match | (pattern, s) | return _regexp_compile_cache[pattern].match(s) | Matches the string with the pattern, caching the compiled regexp. | Matches the string with the pattern, caching the compiled regexp. | [
"Matches",
"the",
"string",
"with",
"the",
"pattern",
"caching",
"the",
"compiled",
"regexp",
"."
] | def Match(pattern, s):
"""Matches the string with the pattern, caching the compiled regexp."""
# The regexp compilation caching is inlined in both Match and Search for
# performance reasons; factoring it out into a separate function turns out
# to be noticeably expensive.
if pattern not in _regexp_compile_cac... | [
"def",
"Match",
"(",
"pattern",
",",
"s",
")",
":",
"# The regexp compilation caching is inlined in both Match and Search for",
"# performance reasons; factoring it out into a separate function turns out",
"# to be noticeably expensive.",
"if",
"pattern",
"not",
"in",
"_regexp_compile_... | https://github.com/danxuhk/ContinuousCRF-CNN/blob/2b6dcaf179620f118b225ed12c890414ca828e21/scripts/cpp_lint.py#L519-L526 | |
carla-simulator/carla | 8854804f4d7748e14d937ec763a2912823a7e5f5 | PythonAPI/carla/agents/navigation/behavior_agent.py | python | BehaviorAgent.collision_and_car_avoid_manager | (self, waypoint) | return vehicle_state, vehicle, distance | This module is in charge of warning in case of a collision
and managing possible tailgating chances.
:param location: current location of the agent
:param waypoint: current waypoint of the agent
:return vehicle_state: True if there is a vehicle nearby, False if not
... | This module is in charge of warning in case of a collision
and managing possible tailgating chances. | [
"This",
"module",
"is",
"in",
"charge",
"of",
"warning",
"in",
"case",
"of",
"a",
"collision",
"and",
"managing",
"possible",
"tailgating",
"chances",
"."
] | def collision_and_car_avoid_manager(self, waypoint):
"""
This module is in charge of warning in case of a collision
and managing possible tailgating chances.
:param location: current location of the agent
:param waypoint: current waypoint of the agent
:return... | [
"def",
"collision_and_car_avoid_manager",
"(",
"self",
",",
"waypoint",
")",
":",
"vehicle_list",
"=",
"self",
".",
"_world",
".",
"get_actors",
"(",
")",
".",
"filter",
"(",
"\"*vehicle*\"",
")",
"def",
"dist",
"(",
"v",
")",
":",
"return",
"v",
".",
"g... | https://github.com/carla-simulator/carla/blob/8854804f4d7748e14d937ec763a2912823a7e5f5/PythonAPI/carla/agents/navigation/behavior_agent.py#L132-L167 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/hypertreelist.py | python | TreeListColumnInfo.SetEditable | (self, edit) | return self | Sets the column as editable or non-editable.
:param `edit`: ``True`` if the column should be editable, ``False`` otherwise. | Sets the column as editable or non-editable. | [
"Sets",
"the",
"column",
"as",
"editable",
"or",
"non",
"-",
"editable",
"."
] | def SetEditable(self, edit):
"""
Sets the column as editable or non-editable.
:param `edit`: ``True`` if the column should be editable, ``False`` otherwise.
"""
self._edit = edit
return self | [
"def",
"SetEditable",
"(",
"self",
",",
"edit",
")",
":",
"self",
".",
"_edit",
"=",
"edit",
"return",
"self"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/hypertreelist.py#L556-L564 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/turtle.py | python | RawTurtle._update | (self) | Perform a Turtle-data update. | Perform a Turtle-data update. | [
"Perform",
"a",
"Turtle",
"-",
"data",
"update",
"."
] | def _update(self):
"""Perform a Turtle-data update.
"""
screen = self.screen
if screen._tracing == 0:
return
elif screen._tracing == 1:
self._update_data()
self._drawturtle()
screen._update() # TurtleScreenBase
... | [
"def",
"_update",
"(",
"self",
")",
":",
"screen",
"=",
"self",
".",
"screen",
"if",
"screen",
".",
"_tracing",
"==",
"0",
":",
"return",
"elif",
"screen",
".",
"_tracing",
"==",
"1",
":",
"self",
".",
"_update_data",
"(",
")",
"self",
".",
"_drawtur... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/turtle.py#L2557-L2573 | ||
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Script/Main.py | python | _scons_syntax_error | (e) | Handle syntax errors. Print out a message and show where the error
occurred. | Handle syntax errors. Print out a message and show where the error
occurred. | [
"Handle",
"syntax",
"errors",
".",
"Print",
"out",
"a",
"message",
"and",
"show",
"where",
"the",
"error",
"occurred",
"."
] | def _scons_syntax_error(e):
"""Handle syntax errors. Print out a message and show where the error
occurred.
"""
etype, value, tb = sys.exc_info()
lines = traceback.format_exception_only(etype, value)
for line in lines:
sys.stderr.write(line+'\n')
sys.exit(2) | [
"def",
"_scons_syntax_error",
"(",
"e",
")",
":",
"etype",
",",
"value",
",",
"tb",
"=",
"sys",
".",
"exc_info",
"(",
")",
"lines",
"=",
"traceback",
".",
"format_exception_only",
"(",
"etype",
",",
"value",
")",
"for",
"line",
"in",
"lines",
":",
"sys... | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Script/Main.py#L542-L550 | ||
google/shaka-packager | e1b0c7c45431327fd3ce193514a5407d07b39b22 | packager/third_party/protobuf/python/google/protobuf/service_reflection.py | python | GeneratedServiceType.__init__ | (cls, name, bases, dictionary) | Creates a message service class.
Args:
name: Name of the class (ignored, but required by the metaclass
protocol).
bases: Base classes of the class being constructed.
dictionary: The class dictionary of the class being constructed.
dictionary[_DESCRIPTOR_KEY] must contain a Service... | Creates a message service class. | [
"Creates",
"a",
"message",
"service",
"class",
"."
] | def __init__(cls, name, bases, dictionary):
"""Creates a message service class.
Args:
name: Name of the class (ignored, but required by the metaclass
protocol).
bases: Base classes of the class being constructed.
dictionary: The class dictionary of the class being constructed.
... | [
"def",
"__init__",
"(",
"cls",
",",
"name",
",",
"bases",
",",
"dictionary",
")",
":",
"# Don't do anything if this class doesn't have a descriptor. This happens",
"# when a service class is subclassed.",
"if",
"GeneratedServiceType",
".",
"_DESCRIPTOR_KEY",
"not",
"in",
"dic... | https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/google/protobuf/service_reflection.py#L64-L81 | ||
freesurfer/freesurfer | 6dbe527d43ffa611acb2cd112e9469f9bfec8e36 | python/freesurfer/surface.py | python | Surface.compute_tangents | (self) | Compute and cache vertex tangents along primary curvature direction. | Compute and cache vertex tangents along primary curvature direction. | [
"Compute",
"and",
"cache",
"vertex",
"tangents",
"along",
"primary",
"curvature",
"direction",
"."
] | def compute_tangents(self):
'''Compute and cache vertex tangents along primary curvature direction.'''
bindings.surf.compute_tangents(self) | [
"def",
"compute_tangents",
"(",
"self",
")",
":",
"bindings",
".",
"surf",
".",
"compute_tangents",
"(",
"self",
")"
] | https://github.com/freesurfer/freesurfer/blob/6dbe527d43ffa611acb2cd112e9469f9bfec8e36/python/freesurfer/surface.py#L74-L76 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.