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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
OpenLightingProject/ola | d1433a1bed73276fbe55ce18c03b1c208237decc | tools/rdm/DMXSender.py | python | DMXSender.SendComplete | (self, state) | Called when the DMX send completes. | Called when the DMX send completes. | [
"Called",
"when",
"the",
"DMX",
"send",
"completes",
"."
] | def SendComplete(self, state):
"""Called when the DMX send completes.""" | [
"def",
"SendComplete",
"(",
"self",
",",
"state",
")",
":"
] | https://github.com/OpenLightingProject/ola/blob/d1433a1bed73276fbe55ce18c03b1c208237decc/tools/rdm/DMXSender.py#L62-L63 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/math/autodiff/ad.py | python | ADFunctionCall.eval | (self,**kwargs) | return self._eval([],kwargs) | Evaluate a function call with bound values given by the keyword
arguments. Example::
print((3*var('x')**2 - 2*var('x')).eval(x=1.5)) | Evaluate a function call with bound values given by the keyword
arguments. Example:: | [
"Evaluate",
"a",
"function",
"call",
"with",
"bound",
"values",
"given",
"by",
"the",
"keyword",
"arguments",
".",
"Example",
"::"
] | def eval(self,**kwargs):
"""Evaluate a function call with bound values given by the keyword
arguments. Example::
print((3*var('x')**2 - 2*var('x')).eval(x=1.5))
"""
self._clear_cache('eval_result','eval_context','eval_instantiated_args')
return self._eval([],kwargs... | [
"def",
"eval",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"_clear_cache",
"(",
"'eval_result'",
",",
"'eval_context'",
",",
"'eval_instantiated_args'",
")",
"return",
"self",
".",
"_eval",
"(",
"[",
"]",
",",
"kwargs",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/math/autodiff/ad.py#L491-L499 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/ParticleMechanicsApplication/python_scripts/particle_gid_output_process.py | python | ParticleGiDOutputProcess._get_variable | (self, my_string) | return self._get_attribute(my_string, KratosMultiphysics.KratosGlobals.GetVariable, "Variable") | Return the python object of a Variable named by the string argument.
Examples:
recommended usage:
variable = self._get_variable("MP_VELOCITY")
deprecated:
variable = self._get_variables("KratosMultiphysics.ParticleMechanicsApplication.MP_VELOCITY") | Return the python object of a Variable named by the string argument. | [
"Return",
"the",
"python",
"object",
"of",
"a",
"Variable",
"named",
"by",
"the",
"string",
"argument",
"."
] | def _get_variable(self, my_string):
"""Return the python object of a Variable named by the string argument.
Examples:
recommended usage:
variable = self._get_variable("MP_VELOCITY")
deprecated:
variable = self._get_variables("KratosMultiphysics.ParticleMechanicsApplicati... | [
"def",
"_get_variable",
"(",
"self",
",",
"my_string",
")",
":",
"return",
"self",
".",
"_get_attribute",
"(",
"my_string",
",",
"KratosMultiphysics",
".",
"KratosGlobals",
".",
"GetVariable",
",",
"\"Variable\"",
")"
] | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/ParticleMechanicsApplication/python_scripts/particle_gid_output_process.py#L201-L210 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/keras/_impl/keras/engine/training.py | python | Model.predict | (self, x, batch_size=None, verbose=0, steps=None) | return self._predict_loop(
f, ins, batch_size=batch_size, verbose=verbose, steps=steps) | Generates output predictions for the input samples.
Computation is done in batches.
Arguments:
x: The input data, as a Numpy array
(or list of Numpy arrays if the model has multiple outputs).
batch_size: Integer. If unspecified, it will default to 32.
verbose: Verbosity mod... | Generates output predictions for the input samples. | [
"Generates",
"output",
"predictions",
"for",
"the",
"input",
"samples",
"."
] | def predict(self, x, batch_size=None, verbose=0, steps=None):
"""Generates output predictions for the input samples.
Computation is done in batches.
Arguments:
x: The input data, as a Numpy array
(or list of Numpy arrays if the model has multiple outputs).
batch_size: Integer. ... | [
"def",
"predict",
"(",
"self",
",",
"x",
",",
"batch_size",
"=",
"None",
",",
"verbose",
"=",
"0",
",",
"steps",
"=",
"None",
")",
":",
"# Backwards compatibility.",
"if",
"batch_size",
"is",
"None",
"and",
"steps",
"is",
"None",
":",
"batch_size",
"=",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/keras/_impl/keras/engine/training.py#L1686-L1739 | |
amd/OpenCL-caffe | 638543108517265366c18ae5821f3096cf5cf34a | tools/extra/resize_and_crop_images.py | python | PILResizeCrop.resize_and_crop_image | (self, input_file, output_file, output_side_length = 256, fit = True) | Downsample the image. | Downsample the image. | [
"Downsample",
"the",
"image",
"."
] | def resize_and_crop_image(self, input_file, output_file, output_side_length = 256, fit = True):
'''Downsample the image.
'''
img = Image.open(input_file)
box = (output_side_length, output_side_length)
#preresize image with factor 2, 4, 8 and fast algorithm
factor = 1
... | [
"def",
"resize_and_crop_image",
"(",
"self",
",",
"input_file",
",",
"output_file",
",",
"output_side_length",
"=",
"256",
",",
"fit",
"=",
"True",
")",
":",
"img",
"=",
"Image",
".",
"open",
"(",
"input_file",
")",
"box",
"=",
"(",
"output_side_length",
"... | https://github.com/amd/OpenCL-caffe/blob/638543108517265366c18ae5821f3096cf5cf34a/tools/extra/resize_and_crop_images.py#L40-L71 | ||
protocolbuffers/protobuf | b5ab0b7a18b7336c60130f4ddb2d97c51792f896 | python/google/protobuf/internal/well_known_types.py | python | FieldMask.Union | (self, mask1, mask2) | Merges mask1 and mask2 into this FieldMask. | Merges mask1 and mask2 into this FieldMask. | [
"Merges",
"mask1",
"and",
"mask2",
"into",
"this",
"FieldMask",
"."
] | def Union(self, mask1, mask2):
"""Merges mask1 and mask2 into this FieldMask."""
_CheckFieldMaskMessage(mask1)
_CheckFieldMaskMessage(mask2)
tree = _FieldMaskTree(mask1)
tree.MergeFromFieldMask(mask2)
tree.ToFieldMask(self) | [
"def",
"Union",
"(",
"self",
",",
"mask1",
",",
"mask2",
")",
":",
"_CheckFieldMaskMessage",
"(",
"mask1",
")",
"_CheckFieldMaskMessage",
"(",
"mask2",
")",
"tree",
"=",
"_FieldMaskTree",
"(",
"mask1",
")",
"tree",
".",
"MergeFromFieldMask",
"(",
"mask2",
")... | https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/google/protobuf/internal/well_known_types.py#L461-L467 | ||
vusec/vuzzer64 | 2b1b0ed757a3dca114db0192fa4ab1add92348bc | fuzzer-code/gautils.py | python | create_files | (num) | return 0 | This function creates num number of files in the input directory. This is called if we do not have enough initial population.
Addition: once a new file is created by mutation/cossover, we query MOSTCOMMON dict to find offsets that replace values at those offsets in the new files. Int he case of mutation, we also us... | This function creates num number of files in the input directory. This is called if we do not have enough initial population.
Addition: once a new file is created by mutation/cossover, we query MOSTCOMMON dict to find offsets that replace values at those offsets in the new files. Int he case of mutation, we also us... | [
"This",
"function",
"creates",
"num",
"number",
"of",
"files",
"in",
"the",
"input",
"directory",
".",
"This",
"is",
"called",
"if",
"we",
"do",
"not",
"have",
"enough",
"initial",
"population",
".",
"Addition",
":",
"once",
"a",
"new",
"file",
"is",
"cr... | def create_files(num):
''' This function creates num number of files in the input directory. This is called if we do not have enough initial population.
Addition: once a new file is created by mutation/cossover, we query MOSTCOMMON dict to find offsets that replace values at those offsets in the new files. Int ... | [
"def",
"create_files",
"(",
"num",
")",
":",
"#files=os.listdir(config.INPUTD)",
"files",
"=",
"os",
".",
"listdir",
"(",
"config",
".",
"INITIALD",
")",
"ga",
"=",
"operators",
".",
"GAoperator",
"(",
"random",
".",
"Random",
"(",
")",
",",
"config",
".",... | https://github.com/vusec/vuzzer64/blob/2b1b0ed757a3dca114db0192fa4ab1add92348bc/fuzzer-code/gautils.py#L197-L235 | |
PX4/PX4-Autopilot | 0b9f60a0370be53d683352c63fd92db3d6586e18 | Tools/px4airframes/srcparser.py | python | SourceParser.Validate | (self) | return True | Validates the airframe meta data. | Validates the airframe meta data. | [
"Validates",
"the",
"airframe",
"meta",
"data",
"."
] | def Validate(self):
"""
Validates the airframe meta data.
"""
seenParamNames = []
for group in self.GetParamGroups():
for param in group.GetParams():
name = param.GetName()
board = param.GetFieldValue("board")
# Check f... | [
"def",
"Validate",
"(",
"self",
")",
":",
"seenParamNames",
"=",
"[",
"]",
"for",
"group",
"in",
"self",
".",
"GetParamGroups",
"(",
")",
":",
"for",
"param",
"in",
"group",
".",
"GetParams",
"(",
")",
":",
"name",
"=",
"param",
".",
"GetName",
"(",
... | https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/Tools/px4airframes/srcparser.py#L471-L488 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBAttachInfo.SetWaitForLaunch | (self, *args) | return _lldb.SBAttachInfo_SetWaitForLaunch(self, *args) | SetWaitForLaunch(self, bool b)
SetWaitForLaunch(self, bool b, bool async) | SetWaitForLaunch(self, bool b)
SetWaitForLaunch(self, bool b, bool async) | [
"SetWaitForLaunch",
"(",
"self",
"bool",
"b",
")",
"SetWaitForLaunch",
"(",
"self",
"bool",
"b",
"bool",
"async",
")"
] | def SetWaitForLaunch(self, *args):
"""
SetWaitForLaunch(self, bool b)
SetWaitForLaunch(self, bool b, bool async)
"""
return _lldb.SBAttachInfo_SetWaitForLaunch(self, *args) | [
"def",
"SetWaitForLaunch",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBAttachInfo_SetWaitForLaunch",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L1051-L1056 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/training/training_util.py | python | get_or_create_global_step | (graph=None) | return global_step_tensor | Returns and create (if necessary) the global step tensor.
Args:
graph: The graph in which to create the global step tensor. If missing, use
default graph.
Returns:
The global step tensor.
@compatibility(TF2)
With the deprecation of global graphs, TF no longer tracks variables in
collections. ... | Returns and create (if necessary) the global step tensor. | [
"Returns",
"and",
"create",
"(",
"if",
"necessary",
")",
"the",
"global",
"step",
"tensor",
"."
] | def get_or_create_global_step(graph=None):
"""Returns and create (if necessary) the global step tensor.
Args:
graph: The graph in which to create the global step tensor. If missing, use
default graph.
Returns:
The global step tensor.
@compatibility(TF2)
With the deprecation of global graphs, ... | [
"def",
"get_or_create_global_step",
"(",
"graph",
"=",
"None",
")",
":",
"graph",
"=",
"graph",
"or",
"ops",
".",
"get_default_graph",
"(",
")",
"global_step_tensor",
"=",
"get_global_step",
"(",
"graph",
")",
"if",
"global_step_tensor",
"is",
"None",
":",
"gl... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/training/training_util.py#L256-L323 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/models/link.py | python | Link.is_artifact | (self) | return True | Determines if this points to an actual artifact (e.g. a tarball) or if
it points to an "abstract" thing like a path or a VCS location. | Determines if this points to an actual artifact (e.g. a tarball) or if
it points to an "abstract" thing like a path or a VCS location. | [
"Determines",
"if",
"this",
"points",
"to",
"an",
"actual",
"artifact",
"(",
"e",
".",
"g",
".",
"a",
"tarball",
")",
"or",
"if",
"it",
"points",
"to",
"an",
"abstract",
"thing",
"like",
"a",
"path",
"or",
"a",
"VCS",
"location",
"."
] | def is_artifact(self):
# type: () -> bool
"""
Determines if this points to an actual artifact (e.g. a tarball) or if
it points to an "abstract" thing like a path or a VCS location.
"""
from pip._internal.vcs import vcs
if self.scheme in vcs.all_schemes:
... | [
"def",
"is_artifact",
"(",
"self",
")",
":",
"# type: () -> bool",
"from",
"pip",
".",
"_internal",
".",
"vcs",
"import",
"vcs",
"if",
"self",
".",
"scheme",
"in",
"vcs",
".",
"all_schemes",
":",
"return",
"False",
"return",
"True"
] | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/models/link.py#L152-L163 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/asyncio/locks.py | python | Condition.wait | (self) | Wait until notified.
If the calling coroutine has not acquired the lock when this
method is called, a RuntimeError is raised.
This method releases the underlying lock, and then blocks
until it is awakened by a notify() or notify_all() call for
the same condition variable in ano... | Wait until notified. | [
"Wait",
"until",
"notified",
"."
] | async def wait(self):
"""Wait until notified.
If the calling coroutine has not acquired the lock when this
method is called, a RuntimeError is raised.
This method releases the underlying lock, and then blocks
until it is awakened by a notify() or notify_all() call for
t... | [
"async",
"def",
"wait",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"locked",
"(",
")",
":",
"raise",
"RuntimeError",
"(",
"'cannot wait on un-acquired lock'",
")",
"self",
".",
"release",
"(",
")",
"try",
":",
"fut",
"=",
"self",
".",
"_loop",
".... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/asyncio/locks.py#L271-L306 | ||
stellar-deprecated/stellard | 67eabb2217bdfa9a6ea317f62338fb6bca458c90 | src/protobuf/python/google/protobuf/message_factory.py | python | MessageFactory.__init__ | (self) | Initializes a new factory. | Initializes a new factory. | [
"Initializes",
"a",
"new",
"factory",
"."
] | def __init__(self):
"""Initializes a new factory."""
self._classes = {} | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"_classes",
"=",
"{",
"}"
] | https://github.com/stellar-deprecated/stellard/blob/67eabb2217bdfa9a6ea317f62338fb6bca458c90/src/protobuf/python/google/protobuf/message_factory.py#L44-L46 | ||
msitt/blpapi-python | bebcf43668c9e5f5467b1f685f9baebbfc45bc87 | src/blpapi/element.py | python | Element.getChoice | (self) | return Element(res[1], self._getDataHolder()) | Returns:
Element: The selection name of this element as :class:`Element`.
Raises:
Exception: If ``datatype() != DataType.CHOICE`` | Returns:
Element: The selection name of this element as :class:`Element`. | [
"Returns",
":",
"Element",
":",
"The",
"selection",
"name",
"of",
"this",
"element",
"as",
":",
"class",
":",
"Element",
"."
] | def getChoice(self):
"""
Returns:
Element: The selection name of this element as :class:`Element`.
Raises:
Exception: If ``datatype() != DataType.CHOICE``
"""
self.__assertIsValid()
res = internals.blpapi_Element_getChoice(self.__handle)
... | [
"def",
"getChoice",
"(",
"self",
")",
":",
"self",
".",
"__assertIsValid",
"(",
")",
"res",
"=",
"internals",
".",
"blpapi_Element_getChoice",
"(",
"self",
".",
"__handle",
")",
"_ExceptionUtil",
".",
"raiseOnError",
"(",
"res",
"[",
"0",
"]",
")",
"return... | https://github.com/msitt/blpapi-python/blob/bebcf43668c9e5f5467b1f685f9baebbfc45bc87/src/blpapi/element.py#L637-L649 | |
intel/caffe | 3f494b442ee3f9d17a07b09ecbd5fa2bbda00836 | examples/faster-rcnn/lib/fast_rcnn/config.py | python | cfg_from_file | (filename) | Load a config file and merge it into the default options. | Load a config file and merge it into the default options. | [
"Load",
"a",
"config",
"file",
"and",
"merge",
"it",
"into",
"the",
"default",
"options",
"."
] | def cfg_from_file(filename):
"""Load a config file and merge it into the default options."""
import yaml
with open(filename, 'r') as f:
yaml_cfg = edict(yaml.load(f))
_merge_a_into_b(yaml_cfg, __C) | [
"def",
"cfg_from_file",
"(",
"filename",
")",
":",
"import",
"yaml",
"with",
"open",
"(",
"filename",
",",
"'r'",
")",
"as",
"f",
":",
"yaml_cfg",
"=",
"edict",
"(",
"yaml",
".",
"load",
"(",
"f",
")",
")",
"_merge_a_into_b",
"(",
"yaml_cfg",
",",
"_... | https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/examples/faster-rcnn/lib/fast_rcnn/config.py#L257-L263 | ||
yuxng/PoseCNN | 9f3dd7b7bce21dcafc05e8f18ccc90da3caabd04 | lib/gt_data_layer/layer.py | python | GtDataLayer.forward | (self) | return blobs | Get blobs and copy them into this layer's top blob vector. | Get blobs and copy them into this layer's top blob vector. | [
"Get",
"blobs",
"and",
"copy",
"them",
"into",
"this",
"layer",
"s",
"top",
"blob",
"vector",
"."
] | def forward(self):
"""Get blobs and copy them into this layer's top blob vector."""
blobs = self._get_next_minibatch()
return blobs | [
"def",
"forward",
"(",
"self",
")",
":",
"blobs",
"=",
"self",
".",
"_get_next_minibatch",
"(",
")",
"return",
"blobs"
] | https://github.com/yuxng/PoseCNN/blob/9f3dd7b7bce21dcafc05e8f18ccc90da3caabd04/lib/gt_data_layer/layer.py#L63-L67 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/specs/python/params_ops.py | python | Li | (lo, hi) | return int(math.floor(math.exp(random.uniform(math.log(lo),
math.log(hi+1-1e-5))))) | Log-uniform distributed integer, inclusive limits. | Log-uniform distributed integer, inclusive limits. | [
"Log",
"-",
"uniform",
"distributed",
"integer",
"inclusive",
"limits",
"."
] | def Li(lo, hi):
"""Log-uniform distributed integer, inclusive limits."""
return int(math.floor(math.exp(random.uniform(math.log(lo),
math.log(hi+1-1e-5))))) | [
"def",
"Li",
"(",
"lo",
",",
"hi",
")",
":",
"return",
"int",
"(",
"math",
".",
"floor",
"(",
"math",
".",
"exp",
"(",
"random",
".",
"uniform",
"(",
"math",
".",
"log",
"(",
"lo",
")",
",",
"math",
".",
"log",
"(",
"hi",
"+",
"1",
"-",
"1e... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/specs/python/params_ops.py#L76-L79 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/FluidDynamicsApplication/python_scripts/navier_stokes_compressible_explicit_solver.py | python | NavierStokesCompressibleExplicitSolver._CreateEstimateDtUtility | (self) | return estimate_dt_utility | This method overloads FluidSolver in order to enforce:
```
self.settings["time_stepping"]["consider_compressibility_in_CFL"] == True
``` | This method overloads FluidSolver in order to enforce:
```
self.settings["time_stepping"]["consider_compressibility_in_CFL"] == True
``` | [
"This",
"method",
"overloads",
"FluidSolver",
"in",
"order",
"to",
"enforce",
":",
"self",
".",
"settings",
"[",
"time_stepping",
"]",
"[",
"consider_compressibility_in_CFL",
"]",
"==",
"True"
] | def _CreateEstimateDtUtility(self):
"""This method overloads FluidSolver in order to enforce:
```
self.settings["time_stepping"]["consider_compressibility_in_CFL"] == True
```
"""
if self.settings["time_stepping"].Has("consider_compressibility_in_CFL"):
Kratos... | [
"def",
"_CreateEstimateDtUtility",
"(",
"self",
")",
":",
"if",
"self",
".",
"settings",
"[",
"\"time_stepping\"",
"]",
".",
"Has",
"(",
"\"consider_compressibility_in_CFL\"",
")",
":",
"KratosMultiphysics",
".",
"Logger",
".",
"PrintWarning",
"(",
"\"\"",
",",
... | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/FluidDynamicsApplication/python_scripts/navier_stokes_compressible_explicit_solver.py#L151-L168 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/getpass.py | python | unix_getpass | (prompt='Password: ', stream=None) | return passwd | Prompt for a password, with echo turned off.
Args:
prompt: Written on stream to ask for the input. Default: 'Password: '
stream: A writable file object to display the prompt. Defaults to
the tty. If no tty is available defaults to sys.stderr.
Returns:
The seKr3t input.
Ra... | Prompt for a password, with echo turned off. | [
"Prompt",
"for",
"a",
"password",
"with",
"echo",
"turned",
"off",
"."
] | def unix_getpass(prompt='Password: ', stream=None):
"""Prompt for a password, with echo turned off.
Args:
prompt: Written on stream to ask for the input. Default: 'Password: '
stream: A writable file object to display the prompt. Defaults to
the tty. If no tty is available defaults... | [
"def",
"unix_getpass",
"(",
"prompt",
"=",
"'Password: '",
",",
"stream",
"=",
"None",
")",
":",
"fd",
"=",
"None",
"tty",
"=",
"None",
"try",
":",
"# Always try reading and writing directly on the tty first.",
"fd",
"=",
"os",
".",
"open",
"(",
"'/dev/tty'",
... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/getpass.py#L26-L86 | |
dmlc/treelite | df56babb6a4a2d7c29d719c28ce53acfa7dbab3c | python/treelite/sklearn/common.py | python | SKLConverterBase.process_tree | (cls, sklearn_tree, sklearn_model) | return treelite_tree | Process a scikit-learn Tree object | Process a scikit-learn Tree object | [
"Process",
"a",
"scikit",
"-",
"learn",
"Tree",
"object"
] | def process_tree(cls, sklearn_tree, sklearn_model):
"""Process a scikit-learn Tree object"""
treelite_tree = treelite.ModelBuilder.Tree(
threshold_type='float64', leaf_output_type='float64')
# Iterate over each node: node ID ranges from 0 to [node_count]-1
for node_id in ran... | [
"def",
"process_tree",
"(",
"cls",
",",
"sklearn_tree",
",",
"sklearn_model",
")",
":",
"treelite_tree",
"=",
"treelite",
".",
"ModelBuilder",
".",
"Tree",
"(",
"threshold_type",
"=",
"'float64'",
",",
"leaf_output_type",
"=",
"'float64'",
")",
"# Iterate over eac... | https://github.com/dmlc/treelite/blob/df56babb6a4a2d7c29d719c28ce53acfa7dbab3c/python/treelite/sklearn/common.py#L10-L22 | |
nyuwireless-unipd/ns3-mmwave | 4ff9e87e8079764e04cbeccd8e85bff15ae16fb3 | utils/grid.py | python | GraphicRenderer.__x_pixel | (self, x, width) | return new_x | ! X Pixel
@param self this object
@param x x
@param width width
@return x pixel | ! X Pixel | [
"!",
"X",
"Pixel"
] | def __x_pixel(self, x, width):
"""! X Pixel
@param self this object
@param x x
@param width width
@return x pixel
"""
new_x = (x - self.__start) * width / (self.__end - self.__start)
return new_x | [
"def",
"__x_pixel",
"(",
"self",
",",
"x",
",",
"width",
")",
":",
"new_x",
"=",
"(",
"x",
"-",
"self",
".",
"__start",
")",
"*",
"width",
"/",
"(",
"self",
".",
"__end",
"-",
"self",
".",
"__start",
")",
"return",
"new_x"
] | https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/utils/grid.py#L1121-L1129 | |
ArduPilot/ardupilot | 6e684b3496122b8158ac412b609d00004b7ac306 | Tools/scripts/build_sizes/build_sizes.py | python | write_footer | (h) | write html footer | write html footer | [
"write",
"html",
"footer"
] | def write_footer(h):
'''write html footer'''
h.write('''
</div>
</body>
</html>
''') | [
"def",
"write_footer",
"(",
"h",
")",
":",
"h",
".",
"write",
"(",
"'''\n</div>\n</body>\n</html>\n'''",
")"
] | https://github.com/ArduPilot/ardupilot/blob/6e684b3496122b8158ac412b609d00004b7ac306/Tools/scripts/build_sizes/build_sizes.py#L105-L111 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/dataview.py | python | DataViewIndexListModel.RowsDeleted | (*args, **kwargs) | return _dataview.DataViewIndexListModel_RowsDeleted(*args, **kwargs) | RowsDeleted(self, wxArrayInt rows)
Call this after rows have been deleted. The array will internally get
copied and sorted in descending order so that the rows with the
highest position will be deleted first. | RowsDeleted(self, wxArrayInt rows) | [
"RowsDeleted",
"(",
"self",
"wxArrayInt",
"rows",
")"
] | def RowsDeleted(*args, **kwargs):
"""
RowsDeleted(self, wxArrayInt rows)
Call this after rows have been deleted. The array will internally get
copied and sorted in descending order so that the rows with the
highest position will be deleted first.
"""
return _data... | [
"def",
"RowsDeleted",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewIndexListModel_RowsDeleted",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/dataview.py#L874-L882 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/nntplib.py | python | _NNTPBase._getline | (self, strip_crlf=True) | return line | Internal: return one line from the server, stripping _CRLF.
Raise EOFError if the connection is closed.
Returns a bytes object. | Internal: return one line from the server, stripping _CRLF.
Raise EOFError if the connection is closed.
Returns a bytes object. | [
"Internal",
":",
"return",
"one",
"line",
"from",
"the",
"server",
"stripping",
"_CRLF",
".",
"Raise",
"EOFError",
"if",
"the",
"connection",
"is",
"closed",
".",
"Returns",
"a",
"bytes",
"object",
"."
] | def _getline(self, strip_crlf=True):
"""Internal: return one line from the server, stripping _CRLF.
Raise EOFError if the connection is closed.
Returns a bytes object."""
line = self.file.readline(_MAXLINE +1)
if len(line) > _MAXLINE:
raise NNTPDataError('line too lon... | [
"def",
"_getline",
"(",
"self",
",",
"strip_crlf",
"=",
"True",
")",
":",
"line",
"=",
"self",
".",
"file",
".",
"readline",
"(",
"_MAXLINE",
"+",
"1",
")",
"if",
"len",
"(",
"line",
")",
">",
"_MAXLINE",
":",
"raise",
"NNTPDataError",
"(",
"'line to... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/nntplib.py#L428-L443 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/tabart.py | python | AuiDefaultTabArt.DrawTab | (self, dc, wnd, page, in_rect, close_button_state, paint_control=False) | return out_tab_rect, out_button_rect, x_extent | Draws a single tab.
:param `dc`: a :class:`DC` device context;
:param `wnd`: a :class:`Window` instance object;
:param `page`: the tab control page associated with the tab;
:param Rect `in_rect`: rectangle the tab should be confined to;
:param integer `close_button_state`: the s... | Draws a single tab. | [
"Draws",
"a",
"single",
"tab",
"."
] | def DrawTab(self, dc, wnd, page, in_rect, close_button_state, paint_control=False):
"""
Draws a single tab.
:param `dc`: a :class:`DC` device context;
:param `wnd`: a :class:`Window` instance object;
:param `page`: the tab control page associated with the tab;
:param Rec... | [
"def",
"DrawTab",
"(",
"self",
",",
"dc",
",",
"wnd",
",",
"page",
",",
"in_rect",
",",
"close_button_state",
",",
"paint_control",
"=",
"False",
")",
":",
"# if the caption is empty, measure some temporary text",
"caption",
"=",
"page",
".",
"caption",
"if",
"n... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/tabart.py#L343-L611 | |
CanalTP/navitia | cb84ce9859070187e708818b058e6a7e0b7f891b | source/jormungandr/jormungandr/interfaces/v1/JSONSchema.py | python | Schema.get | (self) | return JsonSchemaEndpointsSerializer(path).data, 200 | endpoint to get the swagger schema of Navitia | endpoint to get the swagger schema of Navitia | [
"endpoint",
"to",
"get",
"the",
"swagger",
"schema",
"of",
"Navitia"
] | def get(self):
"""
endpoint to get the swagger schema of Navitia
"""
path = get_all_described_paths()
return JsonSchemaEndpointsSerializer(path).data, 200 | [
"def",
"get",
"(",
"self",
")",
":",
"path",
"=",
"get_all_described_paths",
"(",
")",
"return",
"JsonSchemaEndpointsSerializer",
"(",
"path",
")",
".",
"data",
",",
"200"
] | https://github.com/CanalTP/navitia/blob/cb84ce9859070187e708818b058e6a7e0b7f891b/source/jormungandr/jormungandr/interfaces/v1/JSONSchema.py#L137-L143 | |
google/pienoon | a721180de4d9de3696af3b3734d1ad269975b111 | scripts/export.py | python | main | () | return 0 | Zips up all files needed to run the game.
Zips up all files listed in EXPORT_FILES, all directories listed in
EXPORT_DIRECTORIES, and the binary executables `pie_noon` and `flatc`, which
have different locations when built using different tool chains.
Returns:
0 on success, 1 otherwise. | Zips up all files needed to run the game. | [
"Zips",
"up",
"all",
"files",
"needed",
"to",
"run",
"the",
"game",
"."
] | def main():
"""Zips up all files needed to run the game.
Zips up all files listed in EXPORT_FILES, all directories listed in
EXPORT_DIRECTORIES, and the binary executables `pie_noon` and `flatc`, which
have different locations when built using different tool chains.
Returns:
0 on success, 1 otherwise.
... | [
"def",
"main",
"(",
")",
":",
"dir_name",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"os",
".",
"getcwd",
"(",
")",
")",
"zip_file_name",
"=",
"dir_name",
"+",
"'.zip'",
"try",
":",
"zip_file",
"=",
"zipfile",
".",
"ZipFile",
"(",
"zip_file_name",
... | https://github.com/google/pienoon/blob/a721180de4d9de3696af3b3734d1ad269975b111/scripts/export.py#L93-L146 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/ftplib.py | python | FTP.retrlines | (self, cmd, callback = None) | return self.voidresp() | Retrieve data in line mode. A new port is created for you.
Args:
cmd: A RETR, LIST, NLST, or MLSD command.
callback: An optional single parameter callable that is called
for each line with the trailing CRLF stripped.
[default: print_line()]
... | Retrieve data in line mode. A new port is created for you. | [
"Retrieve",
"data",
"in",
"line",
"mode",
".",
"A",
"new",
"port",
"is",
"created",
"for",
"you",
"."
] | def retrlines(self, cmd, callback = None):
"""Retrieve data in line mode. A new port is created for you.
Args:
cmd: A RETR, LIST, NLST, or MLSD command.
callback: An optional single parameter callable that is called
for each line with the trailing CRLF stripped.... | [
"def",
"retrlines",
"(",
"self",
",",
"cmd",
",",
"callback",
"=",
"None",
")",
":",
"if",
"callback",
"is",
"None",
":",
"callback",
"=",
"print_line",
"resp",
"=",
"self",
".",
"sendcmd",
"(",
"'TYPE A'",
")",
"conn",
"=",
"self",
".",
"transfercmd",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/ftplib.py#L418-L446 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBFrame.IsEqual | (self, *args) | return _lldb.SBFrame_IsEqual(self, *args) | IsEqual(self, SBFrame rhs) -> bool | IsEqual(self, SBFrame rhs) -> bool | [
"IsEqual",
"(",
"self",
"SBFrame",
"rhs",
")",
"-",
">",
"bool"
] | def IsEqual(self, *args):
"""IsEqual(self, SBFrame rhs) -> bool"""
return _lldb.SBFrame_IsEqual(self, *args) | [
"def",
"IsEqual",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBFrame_IsEqual",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L4500-L4502 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/backend.py | python | set_learning_phase | (value) | Sets the learning phase to a fixed value.
The backend learning phase affects any code that calls
`backend.learning_phase()`
In particular, all Keras built-in layers use the learning phase as the default
for the `training` arg to `Layer.__call__`.
User-written layers and models can achieve the same behavior ... | Sets the learning phase to a fixed value. | [
"Sets",
"the",
"learning",
"phase",
"to",
"a",
"fixed",
"value",
"."
] | def set_learning_phase(value):
"""Sets the learning phase to a fixed value.
The backend learning phase affects any code that calls
`backend.learning_phase()`
In particular, all Keras built-in layers use the learning phase as the default
for the `training` arg to `Layer.__call__`.
User-written layers and m... | [
"def",
"set_learning_phase",
"(",
"value",
")",
":",
"warnings",
".",
"warn",
"(",
"'`tf.keras.backend.set_learning_phase` is deprecated and '",
"'will be removed after 2020-10-11. To update it, simply '",
"'pass a True/False value to the `training` argument of the '",
"'`__call__` method ... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/backend.py#L413-L441 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | ThreadEvent.SetExtraLong | (*args, **kwargs) | return _core_.ThreadEvent_SetExtraLong(*args, **kwargs) | SetExtraLong(self, long extraLong) | SetExtraLong(self, long extraLong) | [
"SetExtraLong",
"(",
"self",
"long",
"extraLong",
")"
] | def SetExtraLong(*args, **kwargs):
"""SetExtraLong(self, long extraLong)"""
return _core_.ThreadEvent_SetExtraLong(*args, **kwargs) | [
"def",
"SetExtraLong",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"ThreadEvent_SetExtraLong",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L5394-L5396 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pathlib.py | python | _Flavour.join_parsed_parts | (self, drv, root, parts, drv2, root2, parts2) | return drv2, root2, parts2 | Join the two paths represented by the respective
(drive, root, parts) tuples. Return a new (drive, root, parts) tuple. | Join the two paths represented by the respective
(drive, root, parts) tuples. Return a new (drive, root, parts) tuple. | [
"Join",
"the",
"two",
"paths",
"represented",
"by",
"the",
"respective",
"(",
"drive",
"root",
"parts",
")",
"tuples",
".",
"Return",
"a",
"new",
"(",
"drive",
"root",
"parts",
")",
"tuple",
"."
] | def join_parsed_parts(self, drv, root, parts, drv2, root2, parts2):
"""
Join the two paths represented by the respective
(drive, root, parts) tuples. Return a new (drive, root, parts) tuple.
"""
if root2:
if not drv2 and drv:
return drv, root2, [drv +... | [
"def",
"join_parsed_parts",
"(",
"self",
",",
"drv",
",",
"root",
",",
"parts",
",",
"drv2",
",",
"root2",
",",
"parts2",
")",
":",
"if",
"root2",
":",
"if",
"not",
"drv2",
"and",
"drv",
":",
"return",
"drv",
",",
"root2",
",",
"[",
"drv",
"+",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pathlib.py#L101-L116 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/graph_editor/transform.py | python | Transformer.__init__ | (self) | Transformer constructor.
The following members can be modified:
transform_op_handler: handle the transformation of a `tf.Operation`.
This handler defaults to a simple copy.
assign_collections_handler: handle the assignment of collections.
This handler defaults to assigning new collections creat... | Transformer constructor. | [
"Transformer",
"constructor",
"."
] | def __init__(self):
"""Transformer constructor.
The following members can be modified:
transform_op_handler: handle the transformation of a `tf.Operation`.
This handler defaults to a simple copy.
assign_collections_handler: handle the assignment of collections.
This handler defaults to assi... | [
"def",
"__init__",
"(",
"self",
")",
":",
"# handlers",
"self",
".",
"transform_op_handler",
"=",
"copy_op_handler",
"self",
".",
"transform_control_input_handler",
"=",
"transform_op_if_inside_handler",
"self",
".",
"assign_collections_handler",
"=",
"assign_renamed_collec... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/graph_editor/transform.py#L360-L388 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/toolkits/sound_classifier/sound_classifier.py | python | SoundClassifier.__repr__ | (self) | return out | Print a string description of the model when the model name is entered
in the terminal. | Print a string description of the model when the model name is entered
in the terminal. | [
"Print",
"a",
"string",
"description",
"of",
"the",
"model",
"when",
"the",
"model",
"name",
"is",
"entered",
"in",
"the",
"terminal",
"."
] | def __repr__(self):
"""
Print a string description of the model when the model name is entered
in the terminal.
"""
import turicreate.toolkits._internal_utils as tkutl
width = 40
sections, section_titles = self._get_summary_struct()
out = tkutl._toolkit_... | [
"def",
"__repr__",
"(",
"self",
")",
":",
"import",
"turicreate",
".",
"toolkits",
".",
"_internal_utils",
"as",
"tkutl",
"width",
"=",
"40",
"sections",
",",
"section_titles",
"=",
"self",
".",
"_get_summary_struct",
"(",
")",
"out",
"=",
"tkutl",
".",
"_... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/sound_classifier/sound_classifier.py#L580-L591 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/data/experimental/ops/map_defun.py | python | map_defun | (fn,
elems,
output_dtypes,
output_shapes,
max_intra_op_parallelism=1) | return gen_dataset_ops.map_defun(elems, concrete_fn.captured_inputs,
output_dtypes, output_shapes, concrete_fn,
max_intra_op_parallelism) | Map a function on the list of tensors unpacked from `elems` on dimension 0.
Args:
fn: A function (`function.defun`) that takes a list of tensors and returns
another list of tensors. The output list has the same types as
output_dtypes. The elements of the output list have the same dimension 0
as... | Map a function on the list of tensors unpacked from `elems` on dimension 0. | [
"Map",
"a",
"function",
"on",
"the",
"list",
"of",
"tensors",
"unpacked",
"from",
"elems",
"on",
"dimension",
"0",
"."
] | def map_defun(fn,
elems,
output_dtypes,
output_shapes,
max_intra_op_parallelism=1):
"""Map a function on the list of tensors unpacked from `elems` on dimension 0.
Args:
fn: A function (`function.defun`) that takes a list of tensors and returns
anoth... | [
"def",
"map_defun",
"(",
"fn",
",",
"elems",
",",
"output_dtypes",
",",
"output_shapes",
",",
"max_intra_op_parallelism",
"=",
"1",
")",
":",
"if",
"not",
"isinstance",
"(",
"elems",
",",
"list",
")",
":",
"raise",
"ValueError",
"(",
"f\"`elems` must be a list... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/data/experimental/ops/map_defun.py#L22-L65 | |
lyxok1/Tiny-DSOD | 94d15450699bea0dd3720e75e2d273e476174fba | scripts/cpp_lint.py | python | FileInfo.Split | (self) | return (project,) + os.path.splitext(rest) | Splits the file into the directory, basename, and extension.
For 'chrome/browser/browser.cc', Split() would
return ('chrome/browser', 'browser', '.cc')
Returns:
A tuple of (directory, basename, extension). | Splits the file into the directory, basename, and extension. | [
"Splits",
"the",
"file",
"into",
"the",
"directory",
"basename",
"and",
"extension",
"."
] | def Split(self):
"""Splits the file into the directory, basename, and extension.
For 'chrome/browser/browser.cc', Split() would
return ('chrome/browser', 'browser', '.cc')
Returns:
A tuple of (directory, basename, extension).
"""
googlename = self.RepositoryName()
project, rest = os... | [
"def",
"Split",
"(",
"self",
")",
":",
"googlename",
"=",
"self",
".",
"RepositoryName",
"(",
")",
"project",
",",
"rest",
"=",
"os",
".",
"path",
".",
"split",
"(",
"googlename",
")",
"return",
"(",
"project",
",",
")",
"+",
"os",
".",
"path",
"."... | https://github.com/lyxok1/Tiny-DSOD/blob/94d15450699bea0dd3720e75e2d273e476174fba/scripts/cpp_lint.py#L930-L942 | |
protocolbuffers/protobuf | b5ab0b7a18b7336c60130f4ddb2d97c51792f896 | python/google/protobuf/text_format.py | python | ParseInteger | (text, is_signed=False, is_long=False) | return result | Parses an integer.
Args:
text: The text to parse.
is_signed: True if a signed integer must be parsed.
is_long: True if a long integer must be parsed.
Returns:
The integer value.
Raises:
ValueError: Thrown Iff the text is not a valid integer. | Parses an integer. | [
"Parses",
"an",
"integer",
"."
] | def ParseInteger(text, is_signed=False, is_long=False):
"""Parses an integer.
Args:
text: The text to parse.
is_signed: True if a signed integer must be parsed.
is_long: True if a long integer must be parsed.
Returns:
The integer value.
Raises:
ValueError: Thrown Iff the text is not a val... | [
"def",
"ParseInteger",
"(",
"text",
",",
"is_signed",
"=",
"False",
",",
"is_long",
"=",
"False",
")",
":",
"# Do the actual parsing. Exception handling is propagated to caller.",
"result",
"=",
"_ParseAbstractInteger",
"(",
"text",
")",
"# Check if the integer is sane. Exc... | https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/google/protobuf/text_format.py#L1659-L1679 | |
apiaryio/drafter | 4634ebd07f6c6f257cc656598ccd535492fdfb55 | tools/gyp/pylib/gyp/generator/ninja.py | python | NinjaWriter.WriteMacInfoPlist | (self, partial_info_plist, bundle_depends) | Write build rules for bundle Info.plist files. | Write build rules for bundle Info.plist files. | [
"Write",
"build",
"rules",
"for",
"bundle",
"Info",
".",
"plist",
"files",
"."
] | def WriteMacInfoPlist(self, partial_info_plist, bundle_depends):
"""Write build rules for bundle Info.plist files."""
info_plist, out, defines, extra_env = gyp.xcode_emulation.GetMacInfoPlist(
generator_default_variables['PRODUCT_DIR'],
self.xcode_settings, self.GypPathToNinja)
if not info_p... | [
"def",
"WriteMacInfoPlist",
"(",
"self",
",",
"partial_info_plist",
",",
"bundle_depends",
")",
":",
"info_plist",
",",
"out",
",",
"defines",
",",
"extra_env",
"=",
"gyp",
".",
"xcode_emulation",
".",
"GetMacInfoPlist",
"(",
"generator_default_variables",
"[",
"'... | https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/generator/ninja.py#L835-L867 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBValue.SetPreferDynamicValue | (self, use_dynamic) | return _lldb.SBValue_SetPreferDynamicValue(self, use_dynamic) | SetPreferDynamicValue(SBValue self, lldb::DynamicValueType use_dynamic) | SetPreferDynamicValue(SBValue self, lldb::DynamicValueType use_dynamic) | [
"SetPreferDynamicValue",
"(",
"SBValue",
"self",
"lldb",
"::",
"DynamicValueType",
"use_dynamic",
")"
] | def SetPreferDynamicValue(self, use_dynamic):
"""SetPreferDynamicValue(SBValue self, lldb::DynamicValueType use_dynamic)"""
return _lldb.SBValue_SetPreferDynamicValue(self, use_dynamic) | [
"def",
"SetPreferDynamicValue",
"(",
"self",
",",
"use_dynamic",
")",
":",
"return",
"_lldb",
".",
"SBValue_SetPreferDynamicValue",
"(",
"self",
",",
"use_dynamic",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L14299-L14301 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/Tpm.py | python | Tpm.VerifySignature | (self, keyHandle, digest, signature) | return res.validation if res else None | This command uses loaded keys to validate a signature on a message
with the message digest passed to the TPM.
Args:
keyHandle (TPM_HANDLE): Handle of public key that will be used in
the validation
Auth Index: None
digest (bytes): Digest of the sig... | This command uses loaded keys to validate a signature on a message
with the message digest passed to the TPM. | [
"This",
"command",
"uses",
"loaded",
"keys",
"to",
"validate",
"a",
"signature",
"on",
"a",
"message",
"with",
"the",
"message",
"digest",
"passed",
"to",
"the",
"TPM",
"."
] | def VerifySignature(self, keyHandle, digest, signature):
""" This command uses loaded keys to validate a signature on a message
with the message digest passed to the TPM.
Args:
keyHandle (TPM_HANDLE): Handle of public key that will be used in
the validation
... | [
"def",
"VerifySignature",
"(",
"self",
",",
"keyHandle",
",",
"digest",
",",
"signature",
")",
":",
"req",
"=",
"TPM2_VerifySignature_REQUEST",
"(",
"keyHandle",
",",
"digest",
",",
"signature",
")",
"respBuf",
"=",
"self",
".",
"dispatchCommand",
"(",
"TPM_CC... | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/Tpm.py#L1195-L1220 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | catboost/python-package/catboost/core.py | python | Pool._check_data_type | (self, data) | Check type of data. | Check type of data. | [
"Check",
"type",
"of",
"data",
"."
] | def _check_data_type(self, data):
"""
Check type of data.
"""
if not isinstance(data, (PATH_TYPES, ARRAY_TYPES, SPARSE_MATRIX_TYPES, FeaturesData)):
raise CatBoostError(
"Invalid data type={}: data must be list(), np.ndarray(), DataFrame(), Series(), FeaturesD... | [
"def",
"_check_data_type",
"(",
"self",
",",
"data",
")",
":",
"if",
"not",
"isinstance",
"(",
"data",
",",
"(",
"PATH_TYPES",
",",
"ARRAY_TYPES",
",",
"SPARSE_MATRIX_TYPES",
",",
"FeaturesData",
")",
")",
":",
"raise",
"CatBoostError",
"(",
"\"Invalid data ty... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/catboost/python-package/catboost/core.py#L814-L822 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/eager/context.py | python | Context.enable_xla_devices | (self) | Enables XLA:CPU and XLA:GPU devices registration. | Enables XLA:CPU and XLA:GPU devices registration. | [
"Enables",
"XLA",
":",
"CPU",
"and",
"XLA",
":",
"GPU",
"devices",
"registration",
"."
] | def enable_xla_devices(self):
"""Enables XLA:CPU and XLA:GPU devices registration."""
pywrap_tfe.TF_EnableXlaDevices() | [
"def",
"enable_xla_devices",
"(",
"self",
")",
":",
"pywrap_tfe",
".",
"TF_EnableXlaDevices",
"(",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/eager/context.py#L1702-L1704 | ||
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/ceph-volume/ceph_volume/devices/lvm/zap.py | python | Zap.zap_raw_device | (self, device) | Any whole (raw) device passed in as input will be processed here,
checking for LVM membership and partitions (if any).
Device example: /dev/sda
Requirements: None | Any whole (raw) device passed in as input will be processed here,
checking for LVM membership and partitions (if any). | [
"Any",
"whole",
"(",
"raw",
")",
"device",
"passed",
"in",
"as",
"input",
"will",
"be",
"processed",
"here",
"checking",
"for",
"LVM",
"membership",
"and",
"partitions",
"(",
"if",
"any",
")",
"."
] | def zap_raw_device(self, device):
"""
Any whole (raw) device passed in as input will be processed here,
checking for LVM membership and partitions (if any).
Device example: /dev/sda
Requirements: None
"""
if not self.args.destroy:
# the use of dd on a... | [
"def",
"zap_raw_device",
"(",
"self",
",",
"device",
")",
":",
"if",
"not",
"self",
".",
"args",
".",
"destroy",
":",
"# the use of dd on a raw device causes the partition table to be",
"# destroyed",
"mlogger",
".",
"warning",
"(",
"'--destroy was not specified, but zapp... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/ceph-volume/ceph_volume/devices/lvm/zap.py#L241-L261 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py | python | indentedBlock | (blockStatementExpr, indentStack, indent=True) | return smExpr.setName('indented block') | Helper method for defining space-delimited indentation blocks, such as
those used to define block statements in Python source code.
Parameters:
- blockStatementExpr - expression defining syntax of statement that
is repeated within the indented block
- indentStack - list created by c... | [] | def indentedBlock(blockStatementExpr, indentStack, indent=True):
"""
Helper method for defining space-delimited indentation blocks, such as
those used to define block statements in Python source code.
Parameters:
- blockStatementExpr - expression defining syntax of statement that
... | [
"def",
"indentedBlock",
"(",
"blockStatementExpr",
",",
"indentStack",
",",
"indent",
"=",
"True",
")",
":",
"def",
"checkPeerIndent",
"(",
"s",
",",
"l",
",",
"t",
")",
":",
"if",
"l",
">=",
"len",
"(",
"s",
")",
":",
"return",
"curCol",
"=",
"col",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py#L10493-L10717 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/recordio.py | python | MXIndexedRecordIO.read_idx | (self, idx) | return self.read() | Returns the record at given index.
Examples
---------
>>> record = mx.recordio.MXIndexedRecordIO('tmp.idx', 'tmp.rec', 'w')
>>> for i in range(5):
... record.write_idx(i, 'record_%d'%i)
>>> record.close()
>>> record = mx.recordio.MXIndexedRecordIO('tmp.idx', ... | Returns the record at given index. | [
"Returns",
"the",
"record",
"at",
"given",
"index",
"."
] | def read_idx(self, idx):
"""Returns the record at given index.
Examples
---------
>>> record = mx.recordio.MXIndexedRecordIO('tmp.idx', 'tmp.rec', 'w')
>>> for i in range(5):
... record.write_idx(i, 'record_%d'%i)
>>> record.close()
>>> record = mx.re... | [
"def",
"read_idx",
"(",
"self",
",",
"idx",
")",
":",
"self",
".",
"seek",
"(",
"idx",
")",
"return",
"self",
".",
"read",
"(",
")"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/recordio.py#L304-L318 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/summary/event_accumulator.py | python | EventAccumulator.CompressedHistograms | (self, tag) | return self._compressed_histograms.Items(tag) | Given a summary tag, return all associated compressed histograms.
Args:
tag: A string tag associated with the events.
Raises:
KeyError: If the tag is not found.
Returns:
An array of `CompressedHistogramEvent`s. | Given a summary tag, return all associated compressed histograms. | [
"Given",
"a",
"summary",
"tag",
"return",
"all",
"associated",
"compressed",
"histograms",
"."
] | def CompressedHistograms(self, tag):
"""Given a summary tag, return all associated compressed histograms.
Args:
tag: A string tag associated with the events.
Raises:
KeyError: If the tag is not found.
Returns:
An array of `CompressedHistogramEvent`s.
"""
return self._compres... | [
"def",
"CompressedHistograms",
"(",
"self",
",",
"tag",
")",
":",
"return",
"self",
".",
"_compressed_histograms",
".",
"Items",
"(",
"tag",
")"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/summary/event_accumulator.py#L338-L350 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings.GetDefFile | (self, gyp_to_build_path) | return None | Returns the .def file from sources, if any. Otherwise returns None. | Returns the .def file from sources, if any. Otherwise returns None. | [
"Returns",
"the",
".",
"def",
"file",
"from",
"sources",
"if",
"any",
".",
"Otherwise",
"returns",
"None",
"."
] | def GetDefFile(self, gyp_to_build_path):
"""Returns the .def file from sources, if any. Otherwise returns None."""
spec = self.spec
if spec['type'] in ('shared_library', 'loadable_module', 'executable'):
def_files = [s for s in spec.get('sources', []) if s.endswith('.def')]
if len(def_files) ==... | [
"def",
"GetDefFile",
"(",
"self",
",",
"gyp_to_build_path",
")",
":",
"spec",
"=",
"self",
".",
"spec",
"if",
"spec",
"[",
"'type'",
"]",
"in",
"(",
"'shared_library'",
",",
"'loadable_module'",
",",
"'executable'",
")",
":",
"def_files",
"=",
"[",
"s",
... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py#L527-L536 | |
MegEngine/MegEngine | ce9ad07a27ec909fb8db4dd67943d24ba98fb93a | imperative/python/megengine/quantization/quantize.py | python | enable_fake_quant | (module: Module) | r"""Recursively enable ``module`` fake quantization in QATModule through :meth:`~.Module.apply`
Args:
module: root module to do enable fake quantization recursively. | r"""Recursively enable ``module`` fake quantization in QATModule through :meth:`~.Module.apply` | [
"r",
"Recursively",
"enable",
"module",
"fake",
"quantization",
"in",
"QATModule",
"through",
":",
"meth",
":",
"~",
".",
"Module",
".",
"apply"
] | def enable_fake_quant(module: Module):
r"""Recursively enable ``module`` fake quantization in QATModule through :meth:`~.Module.apply`
Args:
module: root module to do enable fake quantization recursively.
"""
_propagate(module, "set_fake_quant", True) | [
"def",
"enable_fake_quant",
"(",
"module",
":",
"Module",
")",
":",
"_propagate",
"(",
"module",
",",
"\"set_fake_quant\"",
",",
"True",
")"
] | https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/quantization/quantize.py#L288-L295 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/eclib/colorsetter.py | python | HexValidator.Clone | (self) | return HexValidator() | Clones the current validator
@return: clone of this object | Clones the current validator
@return: clone of this object | [
"Clones",
"the",
"current",
"validator",
"@return",
":",
"clone",
"of",
"this",
"object"
] | def Clone(self):
"""Clones the current validator
@return: clone of this object
"""
return HexValidator() | [
"def",
"Clone",
"(",
"self",
")",
":",
"return",
"HexValidator",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/eclib/colorsetter.py#L231-L236 | |
IntelRealSense/librealsense | c94410a420b74e5fb6a414bd12215c05ddd82b69 | wrappers/python/examples/box_dimensioner_multicam/calculate_rmsd_kabsch.py | python | kabsch_rotate | (P, Q) | return P | Rotate matrix P unto matrix Q using Kabsch algorithm.
Parameters
----------
P : array
(N,D) matrix, where N is points and D is dimension.
Q : array
(N,D) matrix, where N is points and D is dimension.
Returns
-------
P : array
(N,D) matrix, where N is points and D is... | Rotate matrix P unto matrix Q using Kabsch algorithm. | [
"Rotate",
"matrix",
"P",
"unto",
"matrix",
"Q",
"using",
"Kabsch",
"algorithm",
"."
] | def kabsch_rotate(P, Q):
"""
Rotate matrix P unto matrix Q using Kabsch algorithm.
Parameters
----------
P : array
(N,D) matrix, where N is points and D is dimension.
Q : array
(N,D) matrix, where N is points and D is dimension.
Returns
-------
P : array
(N,... | [
"def",
"kabsch_rotate",
"(",
"P",
",",
"Q",
")",
":",
"U",
"=",
"kabsch",
"(",
"P",
",",
"Q",
")",
"# Rotate P",
"P",
"=",
"np",
".",
"dot",
"(",
"P",
",",
"U",
")",
"return",
"P"
] | https://github.com/IntelRealSense/librealsense/blob/c94410a420b74e5fb6a414bd12215c05ddd82b69/wrappers/python/examples/box_dimensioner_multicam/calculate_rmsd_kabsch.py#L52-L74 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/kokkos-kernels/scripts/analysis/batched/pd.py | python | flop_lu | (n) | return 2.0/3*(n-1)**3 + (n-1)**2 + 1.0/3*(n-1) + n**2/2.0 + n/2.0 | # of + and * for LU of nxn matrix. | # of + and * for LU of nxn matrix. | [
"#",
"of",
"+",
"and",
"*",
"for",
"LU",
"of",
"nxn",
"matrix",
"."
] | def flop_lu(n):
"# of + and * for LU of nxn matrix."
return 2.0/3*(n-1)**3 + (n-1)**2 + 1.0/3*(n-1) + n**2/2.0 + n/2.0 | [
"def",
"flop_lu",
"(",
"n",
")",
":",
"return",
"2.0",
"/",
"3",
"*",
"(",
"n",
"-",
"1",
")",
"**",
"3",
"+",
"(",
"n",
"-",
"1",
")",
"**",
"2",
"+",
"1.0",
"/",
"3",
"*",
"(",
"n",
"-",
"1",
")",
"+",
"n",
"**",
"2",
"/",
"2.0",
... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/kokkos-kernels/scripts/analysis/batched/pd.py#L88-L90 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/cfour.py | python | harvest_zmat | (zmat) | return mol | Parses the contents of the Cfour ZMAT file into array and
coordinate information. The coordinate info is converted into a
rather dinky Molecule (no fragment, but does read charge, mult,
unit). Return qcdb.Molecule. Written for findif zmat* where
geometry always Cartesian and Bohr. | Parses the contents of the Cfour ZMAT file into array and
coordinate information. The coordinate info is converted into a
rather dinky Molecule (no fragment, but does read charge, mult,
unit). Return qcdb.Molecule. Written for findif zmat* where
geometry always Cartesian and Bohr. | [
"Parses",
"the",
"contents",
"of",
"the",
"Cfour",
"ZMAT",
"file",
"into",
"array",
"and",
"coordinate",
"information",
".",
"The",
"coordinate",
"info",
"is",
"converted",
"into",
"a",
"rather",
"dinky",
"Molecule",
"(",
"no",
"fragment",
"but",
"does",
"re... | def harvest_zmat(zmat):
"""Parses the contents of the Cfour ZMAT file into array and
coordinate information. The coordinate info is converted into a
rather dinky Molecule (no fragment, but does read charge, mult,
unit). Return qcdb.Molecule. Written for findif zmat* where
geometry always Cartesian a... | [
"def",
"harvest_zmat",
"(",
"zmat",
")",
":",
"zmat",
"=",
"zmat",
".",
"splitlines",
"(",
")",
"[",
"1",
":",
"]",
"# skip comment line",
"Nat",
"=",
"0",
"readCoord",
"=",
"True",
"isBohr",
"=",
"''",
"charge",
"=",
"0",
"mult",
"=",
"1",
"molxyz",... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/cfour.py#L731-L775 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/markdown/extensions/__init__.py | python | Extension.setConfig | (self, key, value) | Set a config setting for `key` with the given `value`. | Set a config setting for `key` with the given `value`. | [
"Set",
"a",
"config",
"setting",
"for",
"key",
"with",
"the",
"given",
"value",
"."
] | def setConfig(self, key, value):
""" Set a config setting for `key` with the given `value`. """
self.config[key][0] = value | [
"def",
"setConfig",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"self",
".",
"config",
"[",
"key",
"]",
"[",
"0",
"]",
"=",
"value"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/markdown/extensions/__init__.py#L66-L68 | ||
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | openmp/runtime/tools/summarizeStats.py | python | readCounters | (f) | return readData(f) | This can be just the same! | This can be just the same! | [
"This",
"can",
"be",
"just",
"the",
"same!"
] | def readCounters(f):
"""This can be just the same!"""
return readData(f) | [
"def",
"readCounters",
"(",
"f",
")",
":",
"return",
"readData",
"(",
"f",
")"
] | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/openmp/runtime/tools/summarizeStats.py#L133-L135 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/grid.py | python | GridCellWorker.SetParameters | (*args, **kwargs) | return _grid.GridCellWorker_SetParameters(*args, **kwargs) | SetParameters(self, String params) | SetParameters(self, String params) | [
"SetParameters",
"(",
"self",
"String",
"params",
")"
] | def SetParameters(*args, **kwargs):
"""SetParameters(self, String params)"""
return _grid.GridCellWorker_SetParameters(*args, **kwargs) | [
"def",
"SetParameters",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridCellWorker_SetParameters",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L95-L97 | |
perilouswithadollarsign/cstrike15_src | f82112a2388b841d72cb62ca48ab1846dfcc11c8 | thirdparty/protobuf-2.5.0/python/google/protobuf/text_format.py | python | _Tokenizer.ConsumeByteString | (self) | return "".join(list) | Consumes a byte array value.
Returns:
The array parsed (as a string).
Raises:
ParseError: If a byte array value couldn't be consumed. | Consumes a byte array value. | [
"Consumes",
"a",
"byte",
"array",
"value",
"."
] | def ConsumeByteString(self):
"""Consumes a byte array value.
Returns:
The array parsed (as a string).
Raises:
ParseError: If a byte array value couldn't be consumed.
"""
list = [self._ConsumeSingleByteString()]
while len(self.token) > 0 and self.token[0] in ('\'', '"'):
list.... | [
"def",
"ConsumeByteString",
"(",
"self",
")",
":",
"list",
"=",
"[",
"self",
".",
"_ConsumeSingleByteString",
"(",
")",
"]",
"while",
"len",
"(",
"self",
".",
"token",
")",
">",
"0",
"and",
"self",
".",
"token",
"[",
"0",
"]",
"in",
"(",
"'\\''",
"... | https://github.com/perilouswithadollarsign/cstrike15_src/blob/f82112a2388b841d72cb62ca48ab1846dfcc11c8/thirdparty/protobuf-2.5.0/python/google/protobuf/text_format.py#L506-L518 | |
wallix/redemption | fb4ceefb39e11e1ae250bce17e878e1dc7d195d2 | tools/sesman/sesmanworker/parsers.py | python | resolve_scenario_account | (enginei, field, param, force_device=True, default=None) | return acc_infos.get(field.lower()) | Get password or login field from scenario account
:param enginei: engine interface
must implement:
- get_target_login_info
- get_username
- get_account_infos_by_type
:param field: str
requested field of scenario account, must be "password" or "login"
:param param: st... | Get password or login field from scenario account | [
"Get",
"password",
"or",
"login",
"field",
"from",
"scenario",
"account"
] | def resolve_scenario_account(enginei, field, param, force_device=True, default=None):
"""
Get password or login field from scenario account
:param enginei: engine interface
must implement:
- get_target_login_info
- get_username
- get_account_infos_by_type
:param field: s... | [
"def",
"resolve_scenario_account",
"(",
"enginei",
",",
"field",
",",
"param",
",",
"force_device",
"=",
"True",
",",
"default",
"=",
"None",
")",
":",
"if",
"default",
"is",
"None",
":",
"default",
"=",
"param",
"session_infos",
"=",
"enginei",
".",
"get_... | https://github.com/wallix/redemption/blob/fb4ceefb39e11e1ae250bce17e878e1dc7d195d2/tools/sesman/sesmanworker/parsers.py#L68-L112 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/tlslite/tlslite/utils/cipherfactory.py | python | createAES | (key, IV, implList=None) | Create a new AES object.
@type key: str
@param key: A 16, 24, or 32 byte string.
@type IV: str
@param IV: A 16 byte string
@rtype: L{tlslite.utils.AES}
@return: An AES object. | Create a new AES object. | [
"Create",
"a",
"new",
"AES",
"object",
"."
] | def createAES(key, IV, implList=None):
"""Create a new AES object.
@type key: str
@param key: A 16, 24, or 32 byte string.
@type IV: str
@param IV: A 16 byte string
@rtype: L{tlslite.utils.AES}
@return: An AES object.
"""
if implList == None:
implList = ["cryptlib", "opens... | [
"def",
"createAES",
"(",
"key",
",",
"IV",
",",
"implList",
"=",
"None",
")",
":",
"if",
"implList",
"==",
"None",
":",
"implList",
"=",
"[",
"\"cryptlib\"",
",",
"\"openssl\"",
",",
"\"pycrypto\"",
",",
"\"python\"",
"]",
"for",
"impl",
"in",
"implList"... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/tlslite/tlslite/utils/cipherfactory.py#L34-L58 | ||
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/peacock/ExodusViewer/plugins/ContourPlugin.py | python | ContourPlugin._callbackContourLevels | (self) | Called when contour levels are changed. | Called when contour levels are changed. | [
"Called",
"when",
"contour",
"levels",
"are",
"changed",
"."
] | def _callbackContourLevels(self):
"""
Called when contour levels are changed.
"""
self.store(self.ContourLevels)
self.updateOptions()
self.windowRequiresUpdate.emit() | [
"def",
"_callbackContourLevels",
"(",
"self",
")",
":",
"self",
".",
"store",
"(",
"self",
".",
"ContourLevels",
")",
"self",
".",
"updateOptions",
"(",
")",
"self",
".",
"windowRequiresUpdate",
".",
"emit",
"(",
")"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/ExodusViewer/plugins/ContourPlugin.py#L174-L180 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/xrc.py | python | XmlResourceHandler.GetParamValue | (*args, **kwargs) | return _xrc.XmlResourceHandler_GetParamValue(*args, **kwargs) | GetParamValue(self, String param) -> String | GetParamValue(self, String param) -> String | [
"GetParamValue",
"(",
"self",
"String",
"param",
")",
"-",
">",
"String"
] | def GetParamValue(*args, **kwargs):
"""GetParamValue(self, String param) -> String"""
return _xrc.XmlResourceHandler_GetParamValue(*args, **kwargs) | [
"def",
"GetParamValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_xrc",
".",
"XmlResourceHandler_GetParamValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/xrc.py#L643-L645 | |
llvm-mirror/lldb | d01083a850f577b85501a0902b52fd0930de72c7 | third_party/Python/module/pexpect-4.6/pexpect/exceptions.py | python | ExceptionPexpect.get_trace | (self) | return ''.join(tblist) | This returns an abbreviated stack trace with lines that only concern
the caller. In other words, the stack trace inside the Pexpect module
is not included. | This returns an abbreviated stack trace with lines that only concern
the caller. In other words, the stack trace inside the Pexpect module
is not included. | [
"This",
"returns",
"an",
"abbreviated",
"stack",
"trace",
"with",
"lines",
"that",
"only",
"concern",
"the",
"caller",
".",
"In",
"other",
"words",
"the",
"stack",
"trace",
"inside",
"the",
"Pexpect",
"module",
"is",
"not",
"included",
"."
] | def get_trace(self):
'''This returns an abbreviated stack trace with lines that only concern
the caller. In other words, the stack trace inside the Pexpect module
is not included. '''
tblist = traceback.extract_tb(sys.exc_info()[2])
tblist = [item for item in tblist if ('pexpect... | [
"def",
"get_trace",
"(",
"self",
")",
":",
"tblist",
"=",
"traceback",
".",
"extract_tb",
"(",
"sys",
".",
"exc_info",
"(",
")",
"[",
"2",
"]",
")",
"tblist",
"=",
"[",
"item",
"for",
"item",
"in",
"tblist",
"if",
"(",
"'pexpect/__init__'",
"not",
"i... | https://github.com/llvm-mirror/lldb/blob/d01083a850f577b85501a0902b52fd0930de72c7/third_party/Python/module/pexpect-4.6/pexpect/exceptions.py#L17-L26 | |
rsummers11/CADLab | 976ed959a0b5208bb4173127a7ef732ac73a9b6f | lesion_detector_3DCE/rcnn/symbol/proposal.py | python | ProposalOperator._filter_boxes | (boxes, min_size) | return keep | Remove all boxes with any side smaller than min_size | Remove all boxes with any side smaller than min_size | [
"Remove",
"all",
"boxes",
"with",
"any",
"side",
"smaller",
"than",
"min_size"
] | def _filter_boxes(boxes, min_size):
""" Remove all boxes with any side smaller than min_size """
ws = boxes[:, 2] - boxes[:, 0] + 1
hs = boxes[:, 3] - boxes[:, 1] + 1
keep = np.where((ws >= min_size) & (hs >= min_size))[0]
return keep | [
"def",
"_filter_boxes",
"(",
"boxes",
",",
"min_size",
")",
":",
"ws",
"=",
"boxes",
"[",
":",
",",
"2",
"]",
"-",
"boxes",
"[",
":",
",",
"0",
"]",
"+",
"1",
"hs",
"=",
"boxes",
"[",
":",
",",
"3",
"]",
"-",
"boxes",
"[",
":",
",",
"1",
... | https://github.com/rsummers11/CADLab/blob/976ed959a0b5208bb4173127a7ef732ac73a9b6f/lesion_detector_3DCE/rcnn/symbol/proposal.py#L168-L173 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextCtrl.BeginItalic | (*args, **kwargs) | return _richtext.RichTextCtrl_BeginItalic(*args, **kwargs) | BeginItalic(self) -> bool
Begin using italic | BeginItalic(self) -> bool | [
"BeginItalic",
"(",
"self",
")",
"-",
">",
"bool"
] | def BeginItalic(*args, **kwargs):
"""
BeginItalic(self) -> bool
Begin using italic
"""
return _richtext.RichTextCtrl_BeginItalic(*args, **kwargs) | [
"def",
"BeginItalic",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_BeginItalic",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L3355-L3361 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/v8/third_party/jinja2/environment.py | python | Environment.join_path | (self, template, parent) | return template | Join a template with the parent. By default all the lookups are
relative to the loader root so this method returns the `template`
parameter unchanged, but if the paths should be relative to the
parent template, this function can be used to calculate the real
template name.
Subc... | Join a template with the parent. By default all the lookups are
relative to the loader root so this method returns the `template`
parameter unchanged, but if the paths should be relative to the
parent template, this function can be used to calculate the real
template name. | [
"Join",
"a",
"template",
"with",
"the",
"parent",
".",
"By",
"default",
"all",
"the",
"lookups",
"are",
"relative",
"to",
"the",
"loader",
"root",
"so",
"this",
"method",
"returns",
"the",
"template",
"parameter",
"unchanged",
"but",
"if",
"the",
"paths",
... | def join_path(self, template, parent):
"""Join a template with the parent. By default all the lookups are
relative to the loader root so this method returns the `template`
parameter unchanged, but if the paths should be relative to the
parent template, this function can be used to calcu... | [
"def",
"join_path",
"(",
"self",
",",
"template",
",",
"parent",
")",
":",
"return",
"template"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/third_party/jinja2/environment.py#L782-L792 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/plugins/mapmatching/wxgui.py | python | WxGui.on_plot_connectionresults | (self, event=None) | Plot connection results of route analysis in Matplotlib plotting envitonment. | Plot connection results of route analysis in Matplotlib plotting envitonment. | [
"Plot",
"connection",
"results",
"of",
"route",
"analysis",
"in",
"Matplotlib",
"plotting",
"envitonment",
"."
] | def on_plot_connectionresults(self, event=None):
"""
Plot connection results of route analysis in Matplotlib plotting envitonment.
"""
if is_mpl:
resultplotter = results_mpl.ConnectionresultPlotter(self._results,
... | [
"def",
"on_plot_connectionresults",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"if",
"is_mpl",
":",
"resultplotter",
"=",
"results_mpl",
".",
"ConnectionresultPlotter",
"(",
"self",
".",
"_results",
",",
"logger",
"=",
"self",
".",
"_mainframe",
".",
... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/plugins/mapmatching/wxgui.py#L818-L842 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/metric/metrics.py | python | Accuracy.name | (self) | return self._name | Return name of metric instance. | Return name of metric instance. | [
"Return",
"name",
"of",
"metric",
"instance",
"."
] | def name(self):
"""
Return name of metric instance.
"""
return self._name | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
".",
"_name"
] | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/metric/metrics.py#L322-L326 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/pyserial/serial/rfc2217.py | python | RFC2217Serial.fromURL | (self, url) | return (host, port) | extract host and port from an URL string | extract host and port from an URL string | [
"extract",
"host",
"and",
"port",
"from",
"an",
"URL",
"string"
] | def fromURL(self, url):
"""extract host and port from an URL string"""
if url.lower().startswith("rfc2217://"): url = url[10:]
try:
# is there a "path" (our options)?
if '/' in url:
# cut away options
url, options = url.split('/', 1)
... | [
"def",
"fromURL",
"(",
"self",
",",
"url",
")",
":",
"if",
"url",
".",
"lower",
"(",
")",
".",
"startswith",
"(",
"\"rfc2217://\"",
")",
":",
"url",
"=",
"url",
"[",
"10",
":",
"]",
"try",
":",
"# is there a \"path\" (our options)?",
"if",
"'/'",
"in",... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/pyserial/serial/rfc2217.py#L526-L559 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/vcs/versioncontrol.py | python | VersionControl.get_src_requirement | (cls, repo_dir, project_name) | return req | Return the requirement string to use to redownload the files
currently at the given repository directory.
Args:
project_name: the (unescaped) project name.
The return value has a form similar to the following:
{repository_url}@{revision}#egg={project_name} | [] | def get_src_requirement(cls, repo_dir, project_name):
# type: (str, str) -> str
"""
Return the requirement string to use to redownload the files
currently at the given repository directory.
Args:
project_name: the (unescaped) project name.
The return ... | [
"def",
"get_src_requirement",
"(",
"cls",
",",
"repo_dir",
",",
"project_name",
")",
":",
"# type: (str, str) -> str",
"repo_url",
"=",
"cls",
".",
"get_remote_url",
"(",
"repo_dir",
")",
"if",
"cls",
".",
"should_add_vcs_url_prefix",
"(",
"repo_url",
")",
":",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/vcs/versioncontrol.py#L629-L675 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/groupby/generic.py | python | _recast_datetimelike_result | (result: DataFrame) | return result | If we have date/time like in the original, then coerce dates
as we are stacking can easily have object dtypes here.
Parameters
----------
result : DataFrame
Returns
-------
DataFrame
Notes
-----
- Assumes Groupby._selected_obj has ndim==2 and at least one
datetimelike colu... | If we have date/time like in the original, then coerce dates
as we are stacking can easily have object dtypes here. | [
"If",
"we",
"have",
"date",
"/",
"time",
"like",
"in",
"the",
"original",
"then",
"coerce",
"dates",
"as",
"we",
"are",
"stacking",
"can",
"easily",
"have",
"object",
"dtypes",
"here",
"."
] | def _recast_datetimelike_result(result: DataFrame) -> DataFrame:
"""
If we have date/time like in the original, then coerce dates
as we are stacking can easily have object dtypes here.
Parameters
----------
result : DataFrame
Returns
-------
DataFrame
Notes
-----
- Ass... | [
"def",
"_recast_datetimelike_result",
"(",
"result",
":",
"DataFrame",
")",
"->",
"DataFrame",
":",
"result",
"=",
"result",
".",
"copy",
"(",
")",
"obj_cols",
"=",
"[",
"idx",
"for",
"idx",
"in",
"range",
"(",
"len",
"(",
"result",
".",
"columns",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/groupby/generic.py#L2057-L2090 | |
Slicer/SlicerGitSVNArchive | 65e92bb16c2b32ea47a1a66bee71f238891ee1ca | Base/Python/tpycl/tpycl.py | python | tpycl.tcl_putenv | (self, key, value) | Set environment variable | Set environment variable | [
"Set",
"environment",
"variable"
] | def tcl_putenv(self, key, value):
""" Set environment variable
"""
import re
self.tcl.eval("global env; set env(%s) \"%s\""%(key, re.escape(value))) | [
"def",
"tcl_putenv",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"import",
"re",
"self",
".",
"tcl",
".",
"eval",
"(",
"\"global env; set env(%s) \\\"%s\\\"\"",
"%",
"(",
"key",
",",
"re",
".",
"escape",
"(",
"value",
")",
")",
")"
] | https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Base/Python/tpycl/tpycl.py#L206-L210 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/pkgutil.py | python | get_data | (package, resource) | return loader.get_data(resource_name) | Get a resource from a package.
This is a wrapper round the PEP 302 loader get_data API. The package
argument should be the name of a package, in standard module format
(foo.bar). The resource argument should be in the form of a relative
filename, using '/' as the path separator. The parent directory na... | Get a resource from a package. | [
"Get",
"a",
"resource",
"from",
"a",
"package",
"."
] | def get_data(package, resource):
"""Get a resource from a package.
This is a wrapper round the PEP 302 loader get_data API. The package
argument should be the name of a package, in standard module format
(foo.bar). The resource argument should be in the form of a relative
filename, using '/' as the... | [
"def",
"get_data",
"(",
"package",
",",
"resource",
")",
":",
"loader",
"=",
"get_loader",
"(",
"package",
")",
"if",
"loader",
"is",
"None",
"or",
"not",
"hasattr",
"(",
"loader",
",",
"'get_data'",
")",
":",
"return",
"None",
"mod",
"=",
"sys",
".",
... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/pkgutil.py#L548-L583 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/jinja2/filters.py | python | make_attrgetter | (environment, attribute) | return attrgetter | Returns a callable that looks up the given attribute from a
passed object with the rules of the environment. Dots are allowed
to access attributes of attributes. Integer parts in paths are
looked up as integers. | Returns a callable that looks up the given attribute from a
passed object with the rules of the environment. Dots are allowed
to access attributes of attributes. Integer parts in paths are
looked up as integers. | [
"Returns",
"a",
"callable",
"that",
"looks",
"up",
"the",
"given",
"attribute",
"from",
"a",
"passed",
"object",
"with",
"the",
"rules",
"of",
"the",
"environment",
".",
"Dots",
"are",
"allowed",
"to",
"access",
"attributes",
"of",
"attributes",
".",
"Intege... | def make_attrgetter(environment, attribute):
"""Returns a callable that looks up the given attribute from a
passed object with the rules of the environment. Dots are allowed
to access attributes of attributes. Integer parts in paths are
looked up as integers.
"""
if not isinstance(attribute, s... | [
"def",
"make_attrgetter",
"(",
"environment",
",",
"attribute",
")",
":",
"if",
"not",
"isinstance",
"(",
"attribute",
",",
"string_types",
")",
"or",
"(",
"'.'",
"not",
"in",
"attribute",
"and",
"not",
"attribute",
".",
"isdigit",
"(",
")",
")",
":",
"r... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/jinja2/filters.py#L54-L70 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/SSL.py | python | Context.set_tmp_ecdh | (self, curve) | Select a curve to use for ECDHE key exchange.
:param curve: A curve object to use as returned by either
:meth:`OpenSSL.crypto.get_elliptic_curve` or
:meth:`OpenSSL.crypto.get_elliptic_curves`.
:return: None | Select a curve to use for ECDHE key exchange. | [
"Select",
"a",
"curve",
"to",
"use",
"for",
"ECDHE",
"key",
"exchange",
"."
] | def set_tmp_ecdh(self, curve):
"""
Select a curve to use for ECDHE key exchange.
:param curve: A curve object to use as returned by either
:meth:`OpenSSL.crypto.get_elliptic_curve` or
:meth:`OpenSSL.crypto.get_elliptic_curves`.
:return: None
"""
... | [
"def",
"set_tmp_ecdh",
"(",
"self",
",",
"curve",
")",
":",
"_lib",
".",
"SSL_CTX_set_tmp_ecdh",
"(",
"self",
".",
"_context",
",",
"curve",
".",
"_to_EC_KEY",
"(",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/SSL.py#L1174-L1184 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/extras.py | python | vander | (x, n=None) | return _vander | Masked values in the input array result in rows of zeros. | Masked values in the input array result in rows of zeros. | [
"Masked",
"values",
"in",
"the",
"input",
"array",
"result",
"in",
"rows",
"of",
"zeros",
"."
] | def vander(x, n=None):
"""
Masked values in the input array result in rows of zeros.
"""
_vander = np.vander(x, n)
m = getmask(x)
if m is not nomask:
_vander[m] = 0
return _vander | [
"def",
"vander",
"(",
"x",
",",
"n",
"=",
"None",
")",
":",
"_vander",
"=",
"np",
".",
"vander",
"(",
"x",
",",
"n",
")",
"m",
"=",
"getmask",
"(",
"x",
")",
"if",
"m",
"is",
"not",
"nomask",
":",
"_vander",
"[",
"m",
"]",
"=",
"0",
"return... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/extras.py#L1882-L1891 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/code.py | python | InteractiveConsole.resetbuffer | (self) | Reset the input buffer. | Reset the input buffer. | [
"Reset",
"the",
"input",
"buffer",
"."
] | def resetbuffer(self):
"""Reset the input buffer."""
self.buffer = [] | [
"def",
"resetbuffer",
"(",
"self",
")",
":",
"self",
".",
"buffer",
"=",
"[",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/code.py#L184-L186 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | DC.GetImpl | (*args, **kwargs) | return _gdi_.DC_GetImpl(*args, **kwargs) | GetImpl(self) -> DCImpl | GetImpl(self) -> DCImpl | [
"GetImpl",
"(",
"self",
")",
"-",
">",
"DCImpl"
] | def GetImpl(*args, **kwargs):
"""GetImpl(self) -> DCImpl"""
return _gdi_.DC_GetImpl(*args, **kwargs) | [
"def",
"GetImpl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"DC_GetImpl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L3312-L3314 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/multiprocessing/managers.py | python | Server.number_of_objects | (self, c) | return len(self.id_to_obj) - 1 | Number of shared objects | Number of shared objects | [
"Number",
"of",
"shared",
"objects"
] | def number_of_objects(self, c):
'''
Number of shared objects
'''
return len(self.id_to_obj) - 1 | [
"def",
"number_of_objects",
"(",
"self",
",",
"c",
")",
":",
"return",
"len",
"(",
"self",
".",
"id_to_obj",
")",
"-",
"1"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/multiprocessing/managers.py#L335-L339 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/jinja2/optimizer.py | python | Optimizer.visit_If | (self, node) | return result | Eliminate dead code. | Eliminate dead code. | [
"Eliminate",
"dead",
"code",
"."
] | def visit_If(self, node):
"""Eliminate dead code."""
# do not optimize ifs that have a block inside so that it doesn't
# break super().
if node.find(nodes.Block) is not None:
return self.generic_visit(node)
try:
val = self.visit(node.test).as_const()
... | [
"def",
"visit_If",
"(",
"self",
",",
"node",
")",
":",
"# do not optimize ifs that have a block inside so that it doesn't",
"# break super().",
"if",
"node",
".",
"find",
"(",
"nodes",
".",
"Block",
")",
"is",
"not",
"None",
":",
"return",
"self",
".",
"generic_vi... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/jinja2/optimizer.py#L35-L52 | |
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/multiindex.py | python | MultiIndex.append | (self, other) | return MultiIndex._concat(to_concat) | Append a collection of MultiIndex objects together
Parameters
----------
other : MultiIndex or list/tuple of MultiIndex objects
Returns
-------
appended : Index
Examples
--------
>>> import cudf
>>> idx1 = cudf.MultiIndex(
... ... | Append a collection of MultiIndex objects together | [
"Append",
"a",
"collection",
"of",
"MultiIndex",
"objects",
"together"
] | def append(self, other):
"""
Append a collection of MultiIndex objects together
Parameters
----------
other : MultiIndex or list/tuple of MultiIndex objects
Returns
-------
appended : Index
Examples
--------
>>> import cudf
... | [
"def",
"append",
"(",
"self",
",",
"other",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"to_concat",
"=",
"[",
"self",
"]",
"to_concat",
".",
"extend",
"(",
"other",
")",
"else",
":",
"to_concat",
"=",... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/multiindex.py#L1429-L1489 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/email/__init__.py | python | message_from_file | (fp, *args, **kws) | return Parser(*args, **kws).parse(fp) | Read a file and parse its contents into a Message object model.
Optional _class and strict are passed to the Parser constructor. | Read a file and parse its contents into a Message object model. | [
"Read",
"a",
"file",
"and",
"parse",
"its",
"contents",
"into",
"a",
"Message",
"object",
"model",
"."
] | def message_from_file(fp, *args, **kws):
"""Read a file and parse its contents into a Message object model.
Optional _class and strict are passed to the Parser constructor.
"""
from email.parser import Parser
return Parser(*args, **kws).parse(fp) | [
"def",
"message_from_file",
"(",
"fp",
",",
"*",
"args",
",",
"*",
"*",
"kws",
")",
":",
"from",
"email",
".",
"parser",
"import",
"Parser",
"return",
"Parser",
"(",
"*",
"args",
",",
"*",
"*",
"kws",
")",
".",
"parse",
"(",
"fp",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/email/__init__.py#L48-L54 | |
facebookresearch/mvfst-rl | 778bc4259ae7277e67c2ead593a493845c93db83 | scripts/plotting/plot_sweep.py | python | get_label | (key) | Return a single string representing the given key (which has same format as in `get_kdims()`). | Return a single string representing the given key (which has same format as in `get_kdims()`). | [
"Return",
"a",
"single",
"string",
"representing",
"the",
"given",
"key",
"(",
"which",
"has",
"same",
"format",
"as",
"in",
"get_kdims",
"()",
")",
"."
] | def get_label(key):
"""
Return a single string representing the given key (which has same format as in `get_kdims()`).
"""
if key is None:
return "exp"
elif isinstance(key, str):
return key
else:
return "|".join(key) | [
"def",
"get_label",
"(",
"key",
")",
":",
"if",
"key",
"is",
"None",
":",
"return",
"\"exp\"",
"elif",
"isinstance",
"(",
"key",
",",
"str",
")",
":",
"return",
"key",
"else",
":",
"return",
"\"|\"",
".",
"join",
"(",
"key",
")"
] | https://github.com/facebookresearch/mvfst-rl/blob/778bc4259ae7277e67c2ead593a493845c93db83/scripts/plotting/plot_sweep.py#L268-L277 | ||
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/chigger/base/ColorMap.py | python | ColorMap.names | (self) | return names | Return all the possible colormap names. | Return all the possible colormap names. | [
"Return",
"all",
"the",
"possible",
"colormap",
"names",
"."
] | def names(self):
"""
Return all the possible colormap names.
"""
names = ['default']
if USE_MATPLOTLIB:
names += dir(cm)
names += self._data.keys()
return names | [
"def",
"names",
"(",
"self",
")",
":",
"names",
"=",
"[",
"'default'",
"]",
"if",
"USE_MATPLOTLIB",
":",
"names",
"+=",
"dir",
"(",
"cm",
")",
"names",
"+=",
"self",
".",
"_data",
".",
"keys",
"(",
")",
"return",
"names"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/chigger/base/ColorMap.py#L71-L79 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/_pyio.py | python | RawIOBase.write | (self, b) | Write the given buffer to the IO stream.
Returns the number of bytes written, which may be less than len(b). | Write the given buffer to the IO stream. | [
"Write",
"the",
"given",
"buffer",
"to",
"the",
"IO",
"stream",
"."
] | def write(self, b):
"""Write the given buffer to the IO stream.
Returns the number of bytes written, which may be less than len(b).
"""
self._unsupported("write") | [
"def",
"write",
"(",
"self",
",",
"b",
")",
":",
"self",
".",
"_unsupported",
"(",
"\"write\"",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/_pyio.py#L580-L585 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/filedialog.py | python | askopenfilename | (**options) | return Open(**options).show() | Ask for a filename to open | Ask for a filename to open | [
"Ask",
"for",
"a",
"filename",
"to",
"open"
] | def askopenfilename(**options):
"Ask for a filename to open"
return Open(**options).show() | [
"def",
"askopenfilename",
"(",
"*",
"*",
"options",
")",
":",
"return",
"Open",
"(",
"*",
"*",
"options",
")",
".",
"show",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/filedialog.py#L372-L375 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | gr-utils/modtool/core/makeyaml.py | python | ModToolMakeYAML._make_grc_yaml_from_block_data | (self, params, iosig, blockname) | Take the return values from the parser and call the YAML
generator. Also, check the makefile if the .yml file is in there.
If necessary, add. | Take the return values from the parser and call the YAML
generator. Also, check the makefile if the .yml file is in there.
If necessary, add. | [
"Take",
"the",
"return",
"values",
"from",
"the",
"parser",
"and",
"call",
"the",
"YAML",
"generator",
".",
"Also",
"check",
"the",
"makefile",
"if",
"the",
".",
"yml",
"file",
"is",
"in",
"there",
".",
"If",
"necessary",
"add",
"."
] | def _make_grc_yaml_from_block_data(self, params, iosig, blockname):
""" Take the return values from the parser and call the YAML
generator. Also, check the makefile if the .yml file is in there.
If necessary, add. """
fname_yml = f'{self.info["modname"]}_{blockname}.block.yml'
pa... | [
"def",
"_make_grc_yaml_from_block_data",
"(",
"self",
",",
"params",
",",
"iosig",
",",
"blockname",
")",
":",
"fname_yml",
"=",
"f'{self.info[\"modname\"]}_{blockname}.block.yml'",
"path_to_yml",
"=",
"os",
".",
"path",
".",
"join",
"(",
"'grc'",
",",
"fname_yml",
... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-utils/modtool/core/makeyaml.py#L124-L165 | ||
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/distutils/command/install.py | python | install.setuptools_run | (self) | The setuptools version of the .run() method.
We must pull in the entire code so we can override the level used in the
_getframe() call since we wrap this call by one more level. | The setuptools version of the .run() method. | [
"The",
"setuptools",
"version",
"of",
"the",
".",
"run",
"()",
"method",
"."
] | def setuptools_run(self):
""" The setuptools version of the .run() method.
We must pull in the entire code so we can override the level used in the
_getframe() call since we wrap this call by one more level.
"""
# Explicit request for old-style install? Just do it
if se... | [
"def",
"setuptools_run",
"(",
"self",
")",
":",
"# Explicit request for old-style install? Just do it",
"if",
"self",
".",
"old_and_unmanageable",
"or",
"self",
".",
"single_version_externally_managed",
":",
"return",
"old_install_mod",
".",
"_install",
".",
"run",
"(",
... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/distutils/command/install.py#L23-L51 | ||
eomahony/Numberjack | 53fa9e994a36f881ffd320d8d04158097190aad8 | Numberjack/Decomp.py | python | MyConstraint.decompose | (self) | return (variable, constraint_list) | Decompose must return either a list containing a list of expressions | Decompose must return either a list containing a list of expressions | [
"Decompose",
"must",
"return",
"either",
"a",
"list",
"containing",
"a",
"list",
"of",
"expressions"
] | def decompose(self):
'''
Decompose must return either a list containing a list of expressions
'''
constraint_list = []
variable = Variable(0, 1)
return (variable, constraint_list) | [
"def",
"decompose",
"(",
"self",
")",
":",
"constraint_list",
"=",
"[",
"]",
"variable",
"=",
"Variable",
"(",
"0",
",",
"1",
")",
"return",
"(",
"variable",
",",
"constraint_list",
")"
] | https://github.com/eomahony/Numberjack/blob/53fa9e994a36f881ffd320d8d04158097190aad8/Numberjack/Decomp.py#L20-L28 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/_bootstrap_external.py | python | PathFinder._path_hooks | (cls, path) | Search sys.path_hooks for a finder for 'path'. | Search sys.path_hooks for a finder for 'path'. | [
"Search",
"sys",
".",
"path_hooks",
"for",
"a",
"finder",
"for",
"path",
"."
] | def _path_hooks(cls, path):
"""Search sys.path_hooks for a finder for 'path'."""
if sys.path_hooks is not None and not sys.path_hooks:
_warnings.warn('sys.path_hooks is empty', ImportWarning)
for hook in sys.path_hooks:
try:
return hook(path)
e... | [
"def",
"_path_hooks",
"(",
"cls",
",",
"path",
")",
":",
"if",
"sys",
".",
"path_hooks",
"is",
"not",
"None",
"and",
"not",
"sys",
".",
"path_hooks",
":",
"_warnings",
".",
"warn",
"(",
"'sys.path_hooks is empty'",
",",
"ImportWarning",
")",
"for",
"hook",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/_bootstrap_external.py#L1191-L1201 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/twodim_base.py | python | diag | (v, k=0) | Extract a diagonal or construct a diagonal array.
See the more detailed documentation for ``numpy.diagonal`` if you use this
function to extract a diagonal and wish to write to the resulting array;
whether it returns a copy or a view depends on what version of numpy you
are using.
Parameters
-... | Extract a diagonal or construct a diagonal array. | [
"Extract",
"a",
"diagonal",
"or",
"construct",
"a",
"diagonal",
"array",
"."
] | def diag(v, k=0):
"""
Extract a diagonal or construct a diagonal array.
See the more detailed documentation for ``numpy.diagonal`` if you use this
function to extract a diagonal and wish to write to the resulting array;
whether it returns a copy or a view depends on what version of numpy you
ar... | [
"def",
"diag",
"(",
"v",
",",
"k",
"=",
"0",
")",
":",
"v",
"=",
"asanyarray",
"(",
"v",
")",
"s",
"=",
"v",
".",
"shape",
"if",
"len",
"(",
"s",
")",
"==",
"1",
":",
"n",
"=",
"s",
"[",
"0",
"]",
"+",
"abs",
"(",
"k",
")",
"res",
"="... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/twodim_base.py#L217-L285 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/tensor/manipulation.py | python | gather | (x, index, axis=None, name=None) | return out | Output is obtained by gathering entries of ``axis``
of ``x`` indexed by ``index`` and concatenate them together.
.. code-block:: text
Given:
x = [[1, 2],
[3, 4],
[5, 6]]
index = [1, 2]
axis=[0]
... | Output is obtained by gathering entries of ``axis``
of ``x`` indexed by ``index`` and concatenate them together. | [
"Output",
"is",
"obtained",
"by",
"gathering",
"entries",
"of",
"axis",
"of",
"x",
"indexed",
"by",
"index",
"and",
"concatenate",
"them",
"together",
"."
] | def gather(x, index, axis=None, name=None):
"""
Output is obtained by gathering entries of ``axis``
of ``x`` indexed by ``index`` and concatenate them together.
.. code-block:: text
Given:
x = [[1, 2],
[3, 4],
[5, 6]]
... | [
"def",
"gather",
"(",
"x",
",",
"index",
",",
"axis",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"if",
"axis",
"is",
"None",
":",
"axis",
"=",
"0",
"if",
"in_dygraph_mode",
"(",
")",
":",
"axis",
"=",
"axis",
".",
"item",
"(",
")",
"if",
... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/tensor/manipulation.py#L1350-L1430 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/perf/metrics/memory.py | python | MemoryMetric.Stop | (self, page, tab) | Prepare the results for this page.
The results are the differences between the current histogram values
and the values when Start() was called. | Prepare the results for this page. | [
"Prepare",
"the",
"results",
"for",
"this",
"page",
"."
] | def Stop(self, page, tab):
"""Prepare the results for this page.
The results are the differences between the current histogram values
and the values when Start() was called.
"""
if not self._browser.supports_memory_metrics:
return
assert self._started, 'Must call Start() first'
for h... | [
"def",
"Stop",
"(",
"self",
",",
"page",
",",
"tab",
")",
":",
"if",
"not",
"self",
".",
"_browser",
".",
"supports_memory_metrics",
":",
"return",
"assert",
"self",
".",
"_started",
",",
"'Must call Start() first'",
"for",
"h",
"in",
"_HISTOGRAMS",
":",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/perf/metrics/memory.py#L106-L123 | ||
intel/linux-sgx | 2ee53db4e8fd25437a817612d3bcb94b66a28373 | sdk/debugger_interface/linux/gdb-sgx-plugin/printers.py | python | StdDequePrinter._calculate_block_size | (self, element_type) | return 4096 / size if size < 256 else 16 | Calculates the number of elements in a full block. | Calculates the number of elements in a full block. | [
"Calculates",
"the",
"number",
"of",
"elements",
"in",
"a",
"full",
"block",
"."
] | def _calculate_block_size(self, element_type):
"""Calculates the number of elements in a full block."""
size = element_type.sizeof
# Copied from struct __deque_block_size implementation of libcxx.
return 4096 / size if size < 256 else 16 | [
"def",
"_calculate_block_size",
"(",
"self",
",",
"element_type",
")",
":",
"size",
"=",
"element_type",
".",
"sizeof",
"# Copied from struct __deque_block_size implementation of libcxx.",
"return",
"4096",
"/",
"size",
"if",
"size",
"<",
"256",
"else",
"16"
] | https://github.com/intel/linux-sgx/blob/2ee53db4e8fd25437a817612d3bcb94b66a28373/sdk/debugger_interface/linux/gdb-sgx-plugin/printers.py#L509-L513 | |
MegaGlest/megaglest-source | e3af470288a3c9cc179f63b5a1eb414a669e3772 | mk/windoze/symbolstore.py | python | Dumper.Process | (self, file_or_dir) | Process a file or all the (valid) files in a directory; processing is performed
asynchronously, and Finish must be called to wait for it complete and cleanup. | Process a file or all the (valid) files in a directory; processing is performed
asynchronously, and Finish must be called to wait for it complete and cleanup. | [
"Process",
"a",
"file",
"or",
"all",
"the",
"(",
"valid",
")",
"files",
"in",
"a",
"directory",
";",
"processing",
"is",
"performed",
"asynchronously",
"and",
"Finish",
"must",
"be",
"called",
"to",
"wait",
"for",
"it",
"complete",
"and",
"cleanup",
"."
] | def Process(self, file_or_dir):
"""Process a file or all the (valid) files in a directory; processing is performed
asynchronously, and Finish must be called to wait for it complete and cleanup."""
if os.path.isdir(file_or_dir) and not self.ShouldSkipDir(file_or_dir):
self.ProcessDir(... | [
"def",
"Process",
"(",
"self",
",",
"file_or_dir",
")",
":",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"file_or_dir",
")",
"and",
"not",
"self",
".",
"ShouldSkipDir",
"(",
"file_or_dir",
")",
":",
"self",
".",
"ProcessDir",
"(",
"file_or_dir",
")",
"... | https://github.com/MegaGlest/megaglest-source/blob/e3af470288a3c9cc179f63b5a1eb414a669e3772/mk/windoze/symbolstore.py#L504-L510 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py2/pkg_resources/__init__.py | python | EggMetadata.__init__ | (self, importer) | Create a metadata provider from a zipimporter | Create a metadata provider from a zipimporter | [
"Create",
"a",
"metadata",
"provider",
"from",
"a",
"zipimporter"
] | def __init__(self, importer):
"""Create a metadata provider from a zipimporter"""
self.zip_pre = importer.archive + os.sep
self.loader = importer
if importer.prefix:
self.module_path = os.path.join(importer.archive, importer.prefix)
else:
self.module_path... | [
"def",
"__init__",
"(",
"self",
",",
"importer",
")",
":",
"self",
".",
"zip_pre",
"=",
"importer",
".",
"archive",
"+",
"os",
".",
"sep",
"self",
".",
"loader",
"=",
"importer",
"if",
"importer",
".",
"prefix",
":",
"self",
".",
"module_path",
"=",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/pkg_resources/__init__.py#L1942-L1951 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/dataset.py | python | DatasetBase.set_download_cmd | (self, download_cmd) | Set customized download cmd: download_cmd
Examples:
.. code-block:: python
import paddle.fluid as fluid
dataset = fluid.DatasetFactory().create_dataset()
dataset.set_download_cmd("./read_from_afs")
Args:
download_cmd(str): customized d... | Set customized download cmd: download_cmd | [
"Set",
"customized",
"download",
"cmd",
":",
"download_cmd"
] | def set_download_cmd(self, download_cmd):
"""
Set customized download cmd: download_cmd
Examples:
.. code-block:: python
import paddle.fluid as fluid
dataset = fluid.DatasetFactory().create_dataset()
dataset.set_download_cmd("./read_from_af... | [
"def",
"set_download_cmd",
"(",
"self",
",",
"download_cmd",
")",
":",
"self",
".",
"dataset",
".",
"set_download_cmd",
"(",
"download_cmd",
")"
] | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/dataset.py#L297-L311 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | addon-sdk/source/python-lib/simplejson/__init__.py | python | loads | (s, encoding=None, cls=None, object_hook=None, parse_float=None,
parse_int=None, parse_constant=None, **kw) | return cls(encoding=encoding, **kw).decode(s) | Deserialize ``s`` (a ``str`` or ``unicode`` instance containing a JSON
document) to a Python object.
If ``s`` is a ``str`` instance and is encoded with an ASCII based encoding
other than utf-8 (e.g. latin-1) then an appropriate ``encoding`` name
must be specified. Encodings that are not ASCII based (su... | Deserialize ``s`` (a ``str`` or ``unicode`` instance containing a JSON
document) to a Python object. | [
"Deserialize",
"s",
"(",
"a",
"str",
"or",
"unicode",
"instance",
"containing",
"a",
"JSON",
"document",
")",
"to",
"a",
"Python",
"object",
"."
] | def loads(s, encoding=None, cls=None, object_hook=None, parse_float=None,
parse_int=None, parse_constant=None, **kw):
"""
Deserialize ``s`` (a ``str`` or ``unicode`` instance containing a JSON
document) to a Python object.
If ``s`` is a ``str`` instance and is encoded with an ASCII based encodi... | [
"def",
"loads",
"(",
"s",
",",
"encoding",
"=",
"None",
",",
"cls",
"=",
"None",
",",
"object_hook",
"=",
"None",
",",
"parse_float",
"=",
"None",
",",
"parse_int",
"=",
"None",
",",
"parse_constant",
"=",
"None",
",",
"*",
"*",
"kw",
")",
":",
"if... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/addon-sdk/source/python-lib/simplejson/__init__.py#L276-L324 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/_collections_abc.py | python | MutableSequence.extend | (self, values) | S.extend(iterable) -- extend sequence by appending elements from the iterable | S.extend(iterable) -- extend sequence by appending elements from the iterable | [
"S",
".",
"extend",
"(",
"iterable",
")",
"--",
"extend",
"sequence",
"by",
"appending",
"elements",
"from",
"the",
"iterable"
] | def extend(self, values):
'S.extend(iterable) -- extend sequence by appending elements from the iterable'
for v in values:
self.append(v) | [
"def",
"extend",
"(",
"self",
",",
"values",
")",
":",
"for",
"v",
"in",
"values",
":",
"self",
".",
"append",
"(",
"v",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/_collections_abc.py#L987-L990 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | example/image-classification/symbols/resnet.py | python | residual_unit | (data, num_filter, stride, dim_match, name, bottle_neck=True, bn_mom=0.9, workspace=256, memonger=False) | Return ResNet Unit symbol for building ResNet
Parameters
----------
data : str
Input data
num_filter : int
Number of output channels
bnf : int
Bottle neck channels factor with regard to num_filter
stride : tuple
Stride used in convolution
dim_match : Boolean
... | Return ResNet Unit symbol for building ResNet
Parameters
----------
data : str
Input data
num_filter : int
Number of output channels
bnf : int
Bottle neck channels factor with regard to num_filter
stride : tuple
Stride used in convolution
dim_match : Boolean
... | [
"Return",
"ResNet",
"Unit",
"symbol",
"for",
"building",
"ResNet",
"Parameters",
"----------",
"data",
":",
"str",
"Input",
"data",
"num_filter",
":",
"int",
"Number",
"of",
"output",
"channels",
"bnf",
":",
"int",
"Bottle",
"neck",
"channels",
"factor",
"with... | def residual_unit(data, num_filter, stride, dim_match, name, bottle_neck=True, bn_mom=0.9, workspace=256, memonger=False):
"""Return ResNet Unit symbol for building ResNet
Parameters
----------
data : str
Input data
num_filter : int
Number of output channels
bnf : int
Bot... | [
"def",
"residual_unit",
"(",
"data",
",",
"num_filter",
",",
"stride",
",",
"dim_match",
",",
"name",
",",
"bottle_neck",
"=",
"True",
",",
"bn_mom",
"=",
"0.9",
",",
"workspace",
"=",
"256",
",",
"memonger",
"=",
"False",
")",
":",
"if",
"bottle_neck",
... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/image-classification/symbols/resnet.py#L29-L86 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_windows.py | python | PyPreviewFrame.SetControlBar | (*args, **kwargs) | return _windows_.PyPreviewFrame_SetControlBar(*args, **kwargs) | SetControlBar(self, PreviewControlBar bar) | SetControlBar(self, PreviewControlBar bar) | [
"SetControlBar",
"(",
"self",
"PreviewControlBar",
"bar",
")"
] | def SetControlBar(*args, **kwargs):
"""SetControlBar(self, PreviewControlBar bar)"""
return _windows_.PyPreviewFrame_SetControlBar(*args, **kwargs) | [
"def",
"SetControlBar",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PyPreviewFrame_SetControlBar",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L5752-L5754 | |
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/udf/utils.py | python | _mask_get | (mask, pos) | return (mask[pos // MASK_BITSIZE] >> (pos % MASK_BITSIZE)) & 1 | Return the validity of mask[pos] as a word. | Return the validity of mask[pos] as a word. | [
"Return",
"the",
"validity",
"of",
"mask",
"[",
"pos",
"]",
"as",
"a",
"word",
"."
] | def _mask_get(mask, pos):
"""Return the validity of mask[pos] as a word."""
return (mask[pos // MASK_BITSIZE] >> (pos % MASK_BITSIZE)) & 1 | [
"def",
"_mask_get",
"(",
"mask",
",",
"pos",
")",
":",
"return",
"(",
"mask",
"[",
"pos",
"//",
"MASK_BITSIZE",
"]",
">>",
"(",
"pos",
"%",
"MASK_BITSIZE",
")",
")",
"&",
"1"
] | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/udf/utils.py#L146-L148 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.