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
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/framework/python/ops/variables.py
python
get_variable_full_name
(var)
Returns the full name of a variable. For normal Variables, this is the same as the var.op.name. For sliced or PartitionedVariables, this name is the same for all the slices/partitions. In both cases, this is normally the name used in a checkpoint file. Args: var: A `Variable` object. Returns: A ...
Returns the full name of a variable.
[ "Returns", "the", "full", "name", "of", "a", "variable", "." ]
def get_variable_full_name(var): """Returns the full name of a variable. For normal Variables, this is the same as the var.op.name. For sliced or PartitionedVariables, this name is the same for all the slices/partitions. In both cases, this is normally the name used in a checkpoint file. Args: var: A...
[ "def", "get_variable_full_name", "(", "var", ")", ":", "if", "var", ".", "_save_slice_info", ":", "return", "var", ".", "_save_slice_info", ".", "full_name", "else", ":", "return", "var", ".", "op", ".", "name" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/framework/python/ops/variables.py#L597-L614
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
bindings/python/cntk/contrib/crosstalkcaffe/adapter/bvlccaffe/caffeadapter.py
python
SetupCaffeParameters.lrn
(caffe_parameters, inputs_info, cntk_layer_def)
The lrn parameter setup from Caffe to CNTK Args: caffe_parameters (:class:`caffe.Parameters`): the parameters of Caffe inputs_info ('class':`cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkTensorDefinition`): The input information of current layer cntk_lay...
The lrn parameter setup from Caffe to CNTK
[ "The", "lrn", "parameter", "setup", "from", "Caffe", "to", "CNTK" ]
def lrn(caffe_parameters, inputs_info, cntk_layer_def): ''' The lrn parameter setup from Caffe to CNTK Args: caffe_parameters (:class:`caffe.Parameters`): the parameters of Caffe inputs_info ('class':`cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkTensorDefinition`)...
[ "def", "lrn", "(", "caffe_parameters", ",", "inputs_info", ",", "cntk_layer_def", ")", ":", "cntk_layer_def", ".", "parameters", "=", "cntkmodel", ".", "CntkLRNParameters", "(", ")", "cntk_layer_def", ".", "parameters", ".", "kernel_size", "=", "(", "caffe_paramet...
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/contrib/crosstalkcaffe/adapter/bvlccaffe/caffeadapter.py#L281-L300
deepmodeling/deepmd-kit
159e45d248b0429844fb6a8cb3b3a201987c8d79
deepmd/infer/model_devi.py
python
write_model_devi_out
(devi: np.ndarray, fname: str)
return devi
Parameters ---------- devi : numpy.ndarray the first column is the steps index fname : str the file name to dump
Parameters ---------- devi : numpy.ndarray the first column is the steps index fname : str the file name to dump
[ "Parameters", "----------", "devi", ":", "numpy", ".", "ndarray", "the", "first", "column", "is", "the", "steps", "index", "fname", ":", "str", "the", "file", "name", "to", "dump" ]
def write_model_devi_out(devi: np.ndarray, fname: str): ''' Parameters ---------- devi : numpy.ndarray the first column is the steps index fname : str the file name to dump ''' assert devi.shape[1] == 7 header = "%10s" % "step" for item in 'vf': header += "%19...
[ "def", "write_model_devi_out", "(", "devi", ":", "np", ".", "ndarray", ",", "fname", ":", "str", ")", ":", "assert", "devi", ".", "shape", "[", "1", "]", "==", "7", "header", "=", "\"%10s\"", "%", "\"step\"", "for", "item", "in", "'vf'", ":", "header...
https://github.com/deepmodeling/deepmd-kit/blob/159e45d248b0429844fb6a8cb3b3a201987c8d79/deepmd/infer/model_devi.py#L46-L64
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/asyncio/transports.py
python
WriteTransport.write
(self, data)
Write some data bytes to the transport. This does not block; it buffers the data and arranges for it to be sent out asynchronously.
Write some data bytes to the transport.
[ "Write", "some", "data", "bytes", "to", "the", "transport", "." ]
def write(self, data): """Write some data bytes to the transport. This does not block; it buffers the data and arranges for it to be sent out asynchronously. """ raise NotImplementedError
[ "def", "write", "(", "self", ",", "data", ")", ":", "raise", "NotImplementedError" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/asyncio/transports.py#L102-L108
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/quantize/python/fold_batch_norms.py
python
_HasScaling
(graph, input_to_ops_map, bn)
return sum(1 for op in rsqrt_consumers if op.type == 'Mul') == 1
r"""Checks if batch norm has scaling enabled. Difference between batch norm with scaling and without is that with scaling: Rsqrt -> mul -> mul_1 \-> mul_2 where mul multiplies gamma by inverse square root of EMA of batch variance, mul_1 multiplies output of mul with output from the base ...
r"""Checks if batch norm has scaling enabled.
[ "r", "Checks", "if", "batch", "norm", "has", "scaling", "enabled", "." ]
def _HasScaling(graph, input_to_ops_map, bn): r"""Checks if batch norm has scaling enabled. Difference between batch norm with scaling and without is that with scaling: Rsqrt -> mul -> mul_1 \-> mul_2 where mul multiplies gamma by inverse square root of EMA of batch variance, mul_1 mul...
[ "def", "_HasScaling", "(", "graph", ",", "input_to_ops_map", ",", "bn", ")", ":", "rsqrt_op", "=", "graph", ".", "get_operation_by_name", "(", "bn", "+", "'/BatchNorm/batchnorm/Rsqrt'", ")", "rsqrt_consumers", "=", "input_to_ops_map", ".", "ConsumerOperations", "(",...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/quantize/python/fold_batch_norms.py#L336-L372
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
contrib/gizmos/msw/gizmos.py
python
TreeListCtrl.SetItemPyData
(*args, **kwargs)
return _gizmos.TreeListCtrl_SetItemPyData(*args, **kwargs)
SetItemPyData(self, TreeItemId item, PyObject obj)
SetItemPyData(self, TreeItemId item, PyObject obj)
[ "SetItemPyData", "(", "self", "TreeItemId", "item", "PyObject", "obj", ")" ]
def SetItemPyData(*args, **kwargs): """SetItemPyData(self, TreeItemId item, PyObject obj)""" return _gizmos.TreeListCtrl_SetItemPyData(*args, **kwargs)
[ "def", "SetItemPyData", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gizmos", ".", "TreeListCtrl_SetItemPyData", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/msw/gizmos.py#L679-L681
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/string.py
python
count
(s, *args)
return s.count(*args)
count(s, sub[, start[,end]]) -> int Return the number of occurrences of substring sub in string s[start:end]. Optional arguments start and end are interpreted as in slice notation.
count(s, sub[, start[,end]]) -> int
[ "count", "(", "s", "sub", "[", "start", "[", "end", "]]", ")", "-", ">", "int" ]
def count(s, *args): """count(s, sub[, start[,end]]) -> int Return the number of occurrences of substring sub in string s[start:end]. Optional arguments start and end are interpreted as in slice notation. """ return s.count(*args)
[ "def", "count", "(", "s", ",", "*", "args", ")", ":", "return", "s", ".", "count", "(", "*", "args", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/string.py#L340-L348
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/idl/idl/generator.py
python
_CppHeaderFileWriter.gen_validators
(self, field)
Generate the C++ validators definition for a field.
Generate the C++ validators definition for a field.
[ "Generate", "the", "C", "++", "validators", "definition", "for", "a", "field", "." ]
def gen_validators(self, field): # type: (ast.Field) -> None """Generate the C++ validators definition for a field.""" assert field.validator cpp_type_info = cpp_types.get_cpp_type_without_optional(field) param_type = cpp_type_info.get_storage_type() if not cpp_types.is...
[ "def", "gen_validators", "(", "self", ",", "field", ")", ":", "# type: (ast.Field) -> None", "assert", "field", ".", "validator", "cpp_type_info", "=", "cpp_types", ".", "get_cpp_type_without_optional", "(", "field", ")", "param_type", "=", "cpp_type_info", ".", "ge...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/generator.py#L560-L582
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/convert/processor/conversion/aoc/upgrade_resource_subprocessor.py
python
AoCUpgradeResourceSubprocessor.starting_villagers_upgrade
(converter_group, value, operator, team=False)
return patches
Creates a patch for the starting villagers modify effect (ID: 84). :param converter_group: Tech/Civ that gets the patch. :type converter_group: ...dataformat.converter_object.ConverterObjectGroup :param value: Value used for patching the member. :type value: MemberOperator :para...
Creates a patch for the starting villagers modify effect (ID: 84).
[ "Creates", "a", "patch", "for", "the", "starting", "villagers", "modify", "effect", "(", "ID", ":", "84", ")", "." ]
def starting_villagers_upgrade(converter_group, value, operator, team=False): """ Creates a patch for the starting villagers modify effect (ID: 84). :param converter_group: Tech/Civ that gets the patch. :type converter_group: ...dataformat.converter_object.ConverterObjectGroup :...
[ "def", "starting_villagers_upgrade", "(", "converter_group", ",", "value", ",", "operator", ",", "team", "=", "False", ")", ":", "patches", "=", "[", "]", "# TODO: Implement", "return", "patches" ]
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/aoc/upgrade_resource_subprocessor.py#L1144-L1161
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/pybind/mgr/balancer/module.py
python
Module.plan_optimize
(self, plan: str, pools: List[str] = [])
return (r, '', detail)
Run optimizer to create a new plan
Run optimizer to create a new plan
[ "Run", "optimizer", "to", "create", "a", "new", "plan" ]
def plan_optimize(self, plan: str, pools: List[str] = []) -> Tuple[int, str, str]: """ Run optimizer to create a new plan """ # The GIL can be release by the active balancer, so disallow when active if self.active: return (-errno.EINVAL, '', 'Balancer enabled, disable...
[ "def", "plan_optimize", "(", "self", ",", "plan", ":", "str", ",", "pools", ":", "List", "[", "str", "]", "=", "[", "]", ")", "->", "Tuple", "[", "int", ",", "str", ",", "str", "]", ":", "# The GIL can be release by the active balancer, so disallow when acti...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/balancer/module.py#L518-L548
h2oai/datatable
753197c3f76041dd6468e0f6a9708af92d80f6aa
ci/xbuild/extension.py
python
Extension.destination_dir
(self)
return self._destination_dir
The directory where the final .so file should be stored.
The directory where the final .so file should be stored.
[ "The", "directory", "where", "the", "final", ".", "so", "file", "should", "be", "stored", "." ]
def destination_dir(self): """ The directory where the final .so file should be stored. """ if self._destination_dir is None: self.destination_dir = self.build_dir return self._destination_dir
[ "def", "destination_dir", "(", "self", ")", ":", "if", "self", ".", "_destination_dir", "is", "None", ":", "self", ".", "destination_dir", "=", "self", ".", "build_dir", "return", "self", ".", "_destination_dir" ]
https://github.com/h2oai/datatable/blob/753197c3f76041dd6468e0f6a9708af92d80f6aa/ci/xbuild/extension.py#L230-L236
dmlc/nnvm
dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38
python/nnvm/frontend/onnx.py
python
GraphProto._fix_outputs
(self, op_name, outputs)
return outputs
A hack to handle dropout or similar operator that have more than one out in ONNX.
A hack to handle dropout or similar operator that have more than one out in ONNX.
[ "A", "hack", "to", "handle", "dropout", "or", "similar", "operator", "that", "have", "more", "than", "one", "out", "in", "ONNX", "." ]
def _fix_outputs(self, op_name, outputs): """A hack to handle dropout or similar operator that have more than one out in ONNX. """ if op_name == 'Dropout': if len(outputs) == 1: return outputs # TODO(zhreshold): support dropout mask? ou...
[ "def", "_fix_outputs", "(", "self", ",", "op_name", ",", "outputs", ")", ":", "if", "op_name", "==", "'Dropout'", ":", "if", "len", "(", "outputs", ")", "==", "1", ":", "return", "outputs", "# TODO(zhreshold): support dropout mask?", "outputs", "=", "outputs",...
https://github.com/dmlc/nnvm/blob/dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38/python/nnvm/frontend/onnx.py#L673-L682
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_grad/grad_array_ops.py
python
get_bprop_eye
(self)
return bprop
Generate bprop for Eye
Generate bprop for Eye
[ "Generate", "bprop", "for", "Eye" ]
def get_bprop_eye(self): """Generate bprop for Eye""" def bprop(n, m, t, out, dout): return zeros_like(n), zeros_like(m), zeros_like(t) return bprop
[ "def", "get_bprop_eye", "(", "self", ")", ":", "def", "bprop", "(", "n", ",", "m", ",", "t", ",", "out", ",", "dout", ")", ":", "return", "zeros_like", "(", "n", ")", ",", "zeros_like", "(", "m", ")", ",", "zeros_like", "(", "t", ")", "return", ...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_grad/grad_array_ops.py#L707-L713
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
python/psutil/psutil/__init__.py
python
Process.get_nice
(self)
return self._platform_impl.get_process_nice()
Get process niceness (priority).
Get process niceness (priority).
[ "Get", "process", "niceness", "(", "priority", ")", "." ]
def get_nice(self): """Get process niceness (priority).""" return self._platform_impl.get_process_nice()
[ "def", "get_nice", "(", "self", ")", ":", "return", "self", ".", "_platform_impl", ".", "get_process_nice", "(", ")" ]
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/psutil/psutil/__init__.py#L412-L414
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/codecs.py
python
getreader
(encoding)
return lookup(encoding).streamreader
Lookup up the codec for the given encoding and return its StreamReader class or factory function. Raises a LookupError in case the encoding cannot be found.
Lookup up the codec for the given encoding and return its StreamReader class or factory function.
[ "Lookup", "up", "the", "codec", "for", "the", "given", "encoding", "and", "return", "its", "StreamReader", "class", "or", "factory", "function", "." ]
def getreader(encoding): """ Lookup up the codec for the given encoding and return its StreamReader class or factory function. Raises a LookupError in case the encoding cannot be found. """ return lookup(encoding).streamreader
[ "def", "getreader", "(", "encoding", ")", ":", "return", "lookup", "(", "encoding", ")", ".", "streamreader" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/codecs.py#L1004-L1012
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
python/artm/master_component.py
python
MasterComponent.export_dictionary
(self, filename, dictionary_name)
:param str filename: full name of dictionary file :param str dictionary_name: name of exported dictionary
:param str filename: full name of dictionary file :param str dictionary_name: name of exported dictionary
[ ":", "param", "str", "filename", ":", "full", "name", "of", "dictionary", "file", ":", "param", "str", "dictionary_name", ":", "name", "of", "exported", "dictionary" ]
def export_dictionary(self, filename, dictionary_name): """ :param str filename: full name of dictionary file :param str dictionary_name: name of exported dictionary """ args = messages.ExportDictionaryArgs(dictionary_name=dictionary_name, file_name=filename) self._lib.Ar...
[ "def", "export_dictionary", "(", "self", ",", "filename", ",", "dictionary_name", ")", ":", "args", "=", "messages", ".", "ExportDictionaryArgs", "(", "dictionary_name", "=", "dictionary_name", ",", "file_name", "=", "filename", ")", "self", ".", "_lib", ".", ...
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/python/artm/master_component.py#L325-L331
nileshkulkarni/csm
0e6e0e7d4f725fd36f2414c0be4b9d83197aa1fc
csm/utils/transformations.py
python
shear_from_matrix
(matrix)
return angle, direction, point, normal
Return shear angle, direction and plane from shear matrix. >>> angle = (random.random() - 0.5) * 4*math.pi >>> direct = numpy.random.random(3) - 0.5 >>> point = numpy.random.random(3) - 0.5 >>> normal = numpy.cross(direct, numpy.random.random(3)) >>> S0 = shear_matrix(angle, direct, point, normal) ...
Return shear angle, direction and plane from shear matrix.
[ "Return", "shear", "angle", "direction", "and", "plane", "from", "shear", "matrix", "." ]
def shear_from_matrix(matrix): """Return shear angle, direction and plane from shear matrix. >>> angle = (random.random() - 0.5) * 4*math.pi >>> direct = numpy.random.random(3) - 0.5 >>> point = numpy.random.random(3) - 0.5 >>> normal = numpy.cross(direct, numpy.random.random(3)) >>> S0 = shear...
[ "def", "shear_from_matrix", "(", "matrix", ")", ":", "M", "=", "numpy", ".", "array", "(", "matrix", ",", "dtype", "=", "numpy", ".", "float64", ",", "copy", "=", "False", ")", "M33", "=", "M", "[", ":", "3", ",", ":", "3", "]", "# normal: cross in...
https://github.com/nileshkulkarni/csm/blob/0e6e0e7d4f725fd36f2414c0be4b9d83197aa1fc/csm/utils/transformations.py#L679-L721
intel-iot-devkit/how-to-code-samples
b4ea616f36bbfa2e042beb1698f968cfd651d79f
doorbell/python/iot_doorbell/scheduler.py
python
ms
(mills)
return mills * 0.001
Converts milliseconds to seconds
Converts milliseconds to seconds
[ "Converts", "milliseconds", "to", "seconds" ]
def ms(mills): """ Converts milliseconds to seconds """ return mills * 0.001
[ "def", "ms", "(", "mills", ")", ":", "return", "mills", "*", "0.001" ]
https://github.com/intel-iot-devkit/how-to-code-samples/blob/b4ea616f36bbfa2e042beb1698f968cfd651d79f/doorbell/python/iot_doorbell/scheduler.py#L32-L38
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/turtle.py
python
RawTurtle.stamp
(self)
return stitem
Stamp a copy of the turtleshape onto the canvas and return its id. No argument. Stamp a copy of the turtle shape onto the canvas at the current turtle position. Return a stamp_id for that stamp, which can be used to delete it by calling clearstamp(stamp_id). Example (for a Tur...
Stamp a copy of the turtleshape onto the canvas and return its id.
[ "Stamp", "a", "copy", "of", "the", "turtleshape", "onto", "the", "canvas", "and", "return", "its", "id", "." ]
def stamp(self): """Stamp a copy of the turtleshape onto the canvas and return its id. No argument. Stamp a copy of the turtle shape onto the canvas at the current turtle position. Return a stamp_id for that stamp, which can be used to delete it by calling clearstamp(stamp_id)....
[ "def", "stamp", "(", "self", ")", ":", "screen", "=", "self", ".", "screen", "shape", "=", "screen", ".", "_shapes", "[", "self", ".", "turtle", ".", "shapeIndex", "]", "ttype", "=", "shape", ".", "_type", "tshape", "=", "shape", ".", "_data", "if", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/turtle.py#L3034-L3077
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/aui/auibook.py
python
TabNavigatorWindow.OnPanelEraseBg
(self, event)
Handles the ``wx.EVT_ERASE_BACKGROUND`` event for :class:`TabNavigatorWindow` top panel. :param `event`: a :class:`EraseEvent` event to be processed. :note: This is intentionally empty, to reduce flicker.
Handles the ``wx.EVT_ERASE_BACKGROUND`` event for :class:`TabNavigatorWindow` top panel.
[ "Handles", "the", "wx", ".", "EVT_ERASE_BACKGROUND", "event", "for", ":", "class", ":", "TabNavigatorWindow", "top", "panel", "." ]
def OnPanelEraseBg(self, event): """ Handles the ``wx.EVT_ERASE_BACKGROUND`` event for :class:`TabNavigatorWindow` top panel. :param `event`: a :class:`EraseEvent` event to be processed. :note: This is intentionally empty, to reduce flicker. """ pass
[ "def", "OnPanelEraseBg", "(", "self", ",", "event", ")", ":", "pass" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/auibook.py#L813-L822
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/base.py
python
BaseContext.get_returned_value
(self, builder, ty, val)
return self.data_model_manager[ty].from_return(builder, val)
Return value representation to local value representation
Return value representation to local value representation
[ "Return", "value", "representation", "to", "local", "value", "representation" ]
def get_returned_value(self, builder, ty, val): """ Return value representation to local value representation """ return self.data_model_manager[ty].from_return(builder, val)
[ "def", "get_returned_value", "(", "self", ",", "builder", ",", "ty", ",", "val", ")", ":", "return", "self", ".", "data_model_manager", "[", "ty", "]", ".", "from_return", "(", "builder", ",", "val", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/base.py#L655-L659
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/buttonpanel.py
python
ButtonInfo.GetId
(self)
return self._id
Returns the :class:`ButtonInfo` id. :return: An integer representing the button id.
Returns the :class:`ButtonInfo` id.
[ "Returns", "the", ":", "class", ":", "ButtonInfo", "id", "." ]
def GetId(self): """ Returns the :class:`ButtonInfo` id. :return: An integer representing the button id. """ return self._id
[ "def", "GetId", "(", "self", ")", ":", "return", "self", ".", "_id" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/buttonpanel.py#L1553-L1560
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/psutil/__init__.py
python
_cpu_busy_time
(times)
return busy
Given a cpu_time() ntuple calculates the busy CPU time. We do so by subtracting all idle CPU times.
Given a cpu_time() ntuple calculates the busy CPU time. We do so by subtracting all idle CPU times.
[ "Given", "a", "cpu_time", "()", "ntuple", "calculates", "the", "busy", "CPU", "time", ".", "We", "do", "so", "by", "subtracting", "all", "idle", "CPU", "times", "." ]
def _cpu_busy_time(times): """Given a cpu_time() ntuple calculates the busy CPU time. We do so by subtracting all idle CPU times. """ busy = _cpu_tot_time(times) busy -= times.idle # Linux: "iowait" is time during which the CPU does not do anything # (waits for IO to complete). On Linux IO w...
[ "def", "_cpu_busy_time", "(", "times", ")", ":", "busy", "=", "_cpu_tot_time", "(", "times", ")", "busy", "-=", "times", ".", "idle", "# Linux: \"iowait\" is time during which the CPU does not do anything", "# (waits for IO to complete). On Linux IO wait is *not* accounted", "#...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/psutil/__init__.py#L1662-L1675
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/MSVSVersion.py
python
_RegistryQuery
(key, value=None)
return text
Use reg.exe to read a particular key through _RegistryQueryBase. First tries to launch from %WinDir%\Sysnative to avoid WoW64 redirection. If that fails, it falls back to System32. Sysnative is available on Vista and up and available on Windows Server 2003 and XP through KB patch 942589. Note that Sysnative w...
Use reg.exe to read a particular key through _RegistryQueryBase.
[ "Use", "reg", ".", "exe", "to", "read", "a", "particular", "key", "through", "_RegistryQueryBase", "." ]
def _RegistryQuery(key, value=None): """Use reg.exe to read a particular key through _RegistryQueryBase. First tries to launch from %WinDir%\Sysnative to avoid WoW64 redirection. If that fails, it falls back to System32. Sysnative is available on Vista and up and available on Windows Server 2003 and XP throug...
[ "def", "_RegistryQuery", "(", "key", ",", "value", "=", "None", ")", ":", "text", "=", "None", "try", ":", "text", "=", "_RegistryQueryBase", "(", "'Sysnative'", ",", "key", ",", "value", ")", "except", "OSError", ",", "e", ":", "if", "e", ".", "errn...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/MSVSVersion.py#L130-L155
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/urllib.py
python
proxy_bypass_environment
(host)
return 0
Test if proxies should not be used for a particular host. Checks the environment for a variable named no_proxy, which should be a list of DNS suffixes separated by commas, or '*' for all hosts.
Test if proxies should not be used for a particular host.
[ "Test", "if", "proxies", "should", "not", "be", "used", "for", "a", "particular", "host", "." ]
def proxy_bypass_environment(host): """Test if proxies should not be used for a particular host. Checks the environment for a variable named no_proxy, which should be a list of DNS suffixes separated by commas, or '*' for all hosts. """ no_proxy = os.environ.get('no_proxy', '') or os.environ.get('N...
[ "def", "proxy_bypass_environment", "(", "host", ")", ":", "no_proxy", "=", "os", ".", "environ", ".", "get", "(", "'no_proxy'", ",", "''", ")", "or", "os", ".", "environ", ".", "get", "(", "'NO_PROXY'", ",", "''", ")", "# '*' is special case for always bypas...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/urllib.py#L1371-L1389
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py
python
MsvsSettings.AdjustMidlIncludeDirs
(self, midl_include_dirs, config)
return [self.ConvertVSMacros(p, config=config) for p in includes]
Updates midl_include_dirs to expand VS specific paths, and adds the system include dirs used for platform SDK and similar.
Updates midl_include_dirs to expand VS specific paths, and adds the system include dirs used for platform SDK and similar.
[ "Updates", "midl_include_dirs", "to", "expand", "VS", "specific", "paths", "and", "adds", "the", "system", "include", "dirs", "used", "for", "platform", "SDK", "and", "similar", "." ]
def AdjustMidlIncludeDirs(self, midl_include_dirs, config): """Updates midl_include_dirs to expand VS specific paths, and adds the system include dirs used for platform SDK and similar.""" config = self._TargetConfig(config) includes = midl_include_dirs + self.msvs_system_include_dirs[config] includ...
[ "def", "AdjustMidlIncludeDirs", "(", "self", ",", "midl_include_dirs", ",", "config", ")", ":", "config", "=", "self", ".", "_TargetConfig", "(", "config", ")", "includes", "=", "midl_include_dirs", "+", "self", ".", "msvs_system_include_dirs", "[", "config", "]...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py#L341-L348
apache/singa
93fd9da72694e68bfe3fb29d0183a65263d238a1
python/singa/initializer.py
python
glorot
(t)
Initialize the matrix parameter follow a Gaussian distribution with mean = 0 and std = sqrt(2.0 / (nb_row + nb_col)) Args: t (Tensor): the parater tensor
Initialize the matrix parameter follow a Gaussian distribution with mean = 0 and std = sqrt(2.0 / (nb_row + nb_col))
[ "Initialize", "the", "matrix", "parameter", "follow", "a", "Gaussian", "distribution", "with", "mean", "=", "0", "and", "std", "=", "sqrt", "(", "2", ".", "0", "/", "(", "nb_row", "+", "nb_col", "))" ]
def glorot(t): '''Initialize the matrix parameter follow a Gaussian distribution with mean = 0 and std = sqrt(2.0 / (nb_row + nb_col)) Args: t (Tensor): the parater tensor ''' scale = math.sqrt(2.0 / (t.shape[0] + t.shape[1])) t.gaussian(0, 1) t *= scale
[ "def", "glorot", "(", "t", ")", ":", "scale", "=", "math", ".", "sqrt", "(", "2.0", "/", "(", "t", ".", "shape", "[", "0", "]", "+", "t", ".", "shape", "[", "1", "]", ")", ")", "t", ".", "gaussian", "(", "0", ",", "1", ")", "t", "*=", "...
https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/initializer.py#L222-L231
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/cummin.py
python
_cummin_tbe
()
return
Cummin TBE register
Cummin TBE register
[ "Cummin", "TBE", "register" ]
def _cummin_tbe(): """Cummin TBE register""" return
[ "def", "_cummin_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/cummin.py#L39-L41
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/internals/api.py
python
make_block
( values, placement, klass=None, ndim=None, dtype: Dtype | None = None )
return klass(values, ndim=ndim, placement=placement)
This is a pseudo-public analogue to blocks.new_block. We ask that downstream libraries use this rather than any fully-internal APIs, including but not limited to: - core.internals.blocks.make_block - Block.make_block - Block.make_block_same_class - Block.__init__
This is a pseudo-public analogue to blocks.new_block.
[ "This", "is", "a", "pseudo", "-", "public", "analogue", "to", "blocks", ".", "new_block", "." ]
def make_block( values, placement, klass=None, ndim=None, dtype: Dtype | None = None ) -> Block: """ This is a pseudo-public analogue to blocks.new_block. We ask that downstream libraries use this rather than any fully-internal APIs, including but not limited to: - core.internals.blocks.make_b...
[ "def", "make_block", "(", "values", ",", "placement", ",", "klass", "=", "None", ",", "ndim", "=", "None", ",", "dtype", ":", "Dtype", "|", "None", "=", "None", ")", "->", "Block", ":", "if", "dtype", "is", "not", "None", ":", "dtype", "=", "pandas...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/internals/api.py#L34-L72
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
TreeCtrl.GetLastChild
(*args, **kwargs)
return _controls_.TreeCtrl_GetLastChild(*args, **kwargs)
GetLastChild(self, TreeItemId item) -> TreeItemId
GetLastChild(self, TreeItemId item) -> TreeItemId
[ "GetLastChild", "(", "self", "TreeItemId", "item", ")", "-", ">", "TreeItemId" ]
def GetLastChild(*args, **kwargs): """GetLastChild(self, TreeItemId item) -> TreeItemId""" return _controls_.TreeCtrl_GetLastChild(*args, **kwargs)
[ "def", "GetLastChild", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "TreeCtrl_GetLastChild", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L5395-L5397
infinit/elle
a8154593c42743f45b9df09daf62b44630c24a02
drake/src/drake/__init__.py
python
Builder.add_dynsrc
(self, name, node, data=None, source=True)
Add a dynamic source node.
Add a dynamic source node.
[ "Add", "a", "dynamic", "source", "node", "." ]
def add_dynsrc(self, name, node, data=None, source=True): """Add a dynamic source node.""" self.depfile(name).register(node, source=source) if source: drake.Drake.current._Drake__register_dependency([node], self.__targets) self.__sources_dyn[node.path()] = node
[ "def", "add_dynsrc", "(", "self", ",", "name", ",", "node", ",", "data", "=", "None", ",", "source", "=", "True", ")", ":", "self", ".", "depfile", "(", "name", ")", ".", "register", "(", "node", ",", "source", "=", "source", ")", "if", "source", ...
https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/__init__.py#L2136-L2141
fatih/subvim
241b6d170597857105da219c9b7d36059e9f11fb
vim/base/YouCompleteMe/third_party/jedi/jedi/api.py
python
Script.goto_definitions
(self)
return self._sorted_defs(d)
Return the definitions of a the path under the cursor. goto function! This follows complicated paths and returns the end, not the first definition. The big difference between :meth:`goto_assignments` and :meth:`goto_definitions` is that :meth:`goto_assignments` doesn't follow imports an...
Return the definitions of a the path under the cursor. goto function! This follows complicated paths and returns the end, not the first definition. The big difference between :meth:`goto_assignments` and :meth:`goto_definitions` is that :meth:`goto_assignments` doesn't follow imports an...
[ "Return", "the", "definitions", "of", "a", "the", "path", "under", "the", "cursor", ".", "goto", "function!", "This", "follows", "complicated", "paths", "and", "returns", "the", "end", "not", "the", "first", "definition", ".", "The", "big", "difference", "be...
def goto_definitions(self): """ Return the definitions of a the path under the cursor. goto function! This follows complicated paths and returns the end, not the first definition. The big difference between :meth:`goto_assignments` and :meth:`goto_definitions` is that :meth:`got...
[ "def", "goto_definitions", "(", "self", ")", ":", "def", "resolve_import_paths", "(", "scopes", ")", ":", "for", "s", "in", "scopes", ".", "copy", "(", ")", ":", "if", "isinstance", "(", "s", ",", "imports", ".", "ImportPath", ")", ":", "scopes", ".", ...
https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/jedi/jedi/api.py#L320-L381
MVIG-SJTU/RMPE
5188c230ec800c12be7369c3619615bc9b020aa4
scripts/cpp_lint.py
python
CheckCStyleCast
(filename, linenum, line, raw_line, cast_type, pattern, error)
return True
Checks for a C-style cast by looking for the pattern. Args: filename: The name of the current file. linenum: The number of the line to check. line: The line of code to check. raw_line: The raw line of code to check, with comments. cast_type: The string for the C++ cast to recommend. This is eith...
Checks for a C-style cast by looking for the pattern.
[ "Checks", "for", "a", "C", "-", "style", "cast", "by", "looking", "for", "the", "pattern", "." ]
def CheckCStyleCast(filename, linenum, line, raw_line, cast_type, pattern, error): """Checks for a C-style cast by looking for the pattern. Args: filename: The name of the current file. linenum: The number of the line to check. line: The line of code to check. raw_line: The raw ...
[ "def", "CheckCStyleCast", "(", "filename", ",", "linenum", ",", "line", ",", "raw_line", ",", "cast_type", ",", "pattern", ",", "error", ")", ":", "match", "=", "Search", "(", "pattern", ",", "line", ")", "if", "not", "match", ":", "return", "False", "...
https://github.com/MVIG-SJTU/RMPE/blob/5188c230ec800c12be7369c3619615bc9b020aa4/scripts/cpp_lint.py#L4251-L4342
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib2to3/patcomp.py
python
PatternCompiler.compile_node
(self, node)
return pattern.optimize()
Compiles a node, recursively. This is one big switch on the node type.
Compiles a node, recursively.
[ "Compiles", "a", "node", "recursively", "." ]
def compile_node(self, node): """Compiles a node, recursively. This is one big switch on the node type. """ # XXX Optimize certain Wildcard-containing-Wildcard patterns # that can be merged if node.type == self.syms.Matcher: node = node.children[0] # Avoid un...
[ "def", "compile_node", "(", "self", ",", "node", ")", ":", "# XXX Optimize certain Wildcard-containing-Wildcard patterns", "# that can be merged", "if", "node", ".", "type", "==", "self", ".", "syms", ".", "Matcher", ":", "node", "=", "node", ".", "children", "[",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib2to3/patcomp.py#L68-L137
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/gyp/MakefileWriter.py
python
MakefileWriter.WriteSubMake
(self, output_filename, makefile_path, targets, build_dir)
Write a "sub-project" Makefile. This is a small, wrapper Makefile that calls the top-level Makefile to build the targets from a single gyp file (i.e. a sub-project). Arguments: output_filename: sub-project Makefile name to write makefile_path: path to the top-level Makefile targets: list...
Write a "sub-project" Makefile.
[ "Write", "a", "sub", "-", "project", "Makefile", "." ]
def WriteSubMake(self, output_filename, makefile_path, targets, build_dir): """Write a "sub-project" Makefile. This is a small, wrapper Makefile that calls the top-level Makefile to build the targets from a single gyp file (i.e. a sub-project). Arguments: output_filename: sub-project Makefile na...
[ "def", "WriteSubMake", "(", "self", ",", "output_filename", ",", "makefile_path", ",", "targets", ",", "build_dir", ")", ":", "gyp", ".", "common", ".", "EnsureDirExists", "(", "output_filename", ")", "self", ".", "fp", "=", "open", "(", "output_filename", "...
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/MakefileWriter.py#L347-L371
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/toolkits/recommender/util.py
python
_Recommender._get_summary_struct
(self)
return (sections, section_titles)
Returns a structured description of the model, including (where relevant) the schema of the training data, description of the training data, training statistics, and model hyperparameters. Returns ------- sections : list (of list of tuples) A list of summary sections...
Returns a structured description of the model, including (where relevant) the schema of the training data, description of the training data, training statistics, and model hyperparameters.
[ "Returns", "a", "structured", "description", "of", "the", "model", "including", "(", "where", "relevant", ")", "the", "schema", "of", "the", "training", "data", "description", "of", "the", "training", "data", "training", "statistics", "and", "model", "hyperparam...
def _get_summary_struct(self): """ Returns a structured description of the model, including (where relevant) the schema of the training data, description of the training data, training statistics, and model hyperparameters. Returns ------- sections : list (of lis...
[ "def", "_get_summary_struct", "(", "self", ")", ":", "stats", "=", "self", ".", "_list_fields", "(", ")", "options", "=", "self", ".", "_get_current_options", "(", ")", "section_titles", "=", "[", "]", "sections", "=", "[", "]", "observation_columns", "=", ...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/recommender/util.py#L641-L791
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py
python
AndroidMkWriter.WriteActions
(self, actions, extra_sources, extra_outputs)
Write Makefile code for any 'actions' from the gyp input. extra_sources: a list that will be filled in with newly generated source files, if any extra_outputs: a list that will be filled in with any outputs of these actions (used to make other pieces dependent on these ...
Write Makefile code for any 'actions' from the gyp input.
[ "Write", "Makefile", "code", "for", "any", "actions", "from", "the", "gyp", "input", "." ]
def WriteActions(self, actions, extra_sources, extra_outputs): """Write Makefile code for any 'actions' from the gyp input. extra_sources: a list that will be filled in with newly generated source files, if any extra_outputs: a list that will be filled in with any outputs of these ...
[ "def", "WriteActions", "(", "self", ",", "actions", ",", "extra_sources", ",", "extra_outputs", ")", ":", "for", "action", "in", "actions", ":", "name", "=", "make", ".", "StringToMakefileVariable", "(", "'%s_%s'", "%", "(", "self", ".", "relative_target", "...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py#L232-L323
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/vis/visualization.py
python
VisAppearance.drawText
(self,text,point)
Draws the given text at the given point
Draws the given text at the given point
[ "Draws", "the", "given", "text", "at", "the", "given", "point" ]
def drawText(self,text,point): """Draws the given text at the given point""" if len(point) != 3: warnings.warn("drawText INCORRECT POINT SIZE {} {}".format(point,text)) return if not all(math.isfinite(v) for v in point): warnings.warn("drawText INVALID POINT {...
[ "def", "drawText", "(", "self", ",", "text", ",", "point", ")", ":", "if", "len", "(", "point", ")", "!=", "3", ":", "warnings", ".", "warn", "(", "\"drawText INCORRECT POINT SIZE {} {}\"", ".", "format", "(", "point", ",", "text", ")", ")", "return", ...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/vis/visualization.py#L2445-L2453
protocolbuffers/protobuf
b5ab0b7a18b7336c60130f4ddb2d97c51792f896
python/google/protobuf/descriptor.py
python
MethodDescriptor.__init__
(self, name, full_name, index, containing_service, input_type, output_type, options=None, serialized_options=None, create_key=None)
The arguments are as described in the description of MethodDescriptor attributes above. Note that containing_service may be None, and may be set later if necessary.
The arguments are as described in the description of MethodDescriptor attributes above.
[ "The", "arguments", "are", "as", "described", "in", "the", "description", "of", "MethodDescriptor", "attributes", "above", "." ]
def __init__(self, name, full_name, index, containing_service, input_type, output_type, options=None, serialized_options=None, create_key=None): """The arguments are as described in the description of MethodDescriptor attributes above. Note that containing_service may be None,...
[ "def", "__init__", "(", "self", ",", "name", ",", "full_name", ",", "index", ",", "containing_service", ",", "input_type", ",", "output_type", ",", "options", "=", "None", ",", "serialized_options", "=", "None", ",", "create_key", "=", "None", ")", ":", "i...
https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/google/protobuf/descriptor.py#L895-L913
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
python/configobj/configobj.py
python
InterpolationEngine._fetch
(self, key)
return val, current_section
Helper function to fetch values from owning section. Returns a 2-tuple: the value, and the section where it was found.
Helper function to fetch values from owning section.
[ "Helper", "function", "to", "fetch", "values", "from", "owning", "section", "." ]
def _fetch(self, key): """Helper function to fetch values from owning section. Returns a 2-tuple: the value, and the section where it was found. """ # switch off interpolation before we try and fetch anything ! save_interp = self.section.main.interpolation self.section.m...
[ "def", "_fetch", "(", "self", ",", "key", ")", ":", "# switch off interpolation before we try and fetch anything !", "save_interp", "=", "self", ".", "section", ".", "main", ".", "interpolation", "self", ".", "section", ".", "main", ".", "interpolation", "=", "Fal...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/configobj/configobj.py#L369-L400
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py
python
get_cuda_compute_capability
(source_from_url=False)
return
Retrieves CUDA compute capability based on the detected GPU type. This function uses the `cuda_compute_capability` module to retrieve the corresponding CUDA compute capability for the given GPU type. Args: source_from_url: Boolean deciding whether to source compute capability from NVIDI...
Retrieves CUDA compute capability based on the detected GPU type.
[ "Retrieves", "CUDA", "compute", "capability", "based", "on", "the", "detected", "GPU", "type", "." ]
def get_cuda_compute_capability(source_from_url=False): """Retrieves CUDA compute capability based on the detected GPU type. This function uses the `cuda_compute_capability` module to retrieve the corresponding CUDA compute capability for the given GPU type. Args: source_from_url: Boolean deciding whether...
[ "def", "get_cuda_compute_capability", "(", "source_from_url", "=", "False", ")", ":", "if", "not", "GPU_TYPE", ":", "if", "FLAGS", ".", "debug", ":", "print", "(", "\"Warning: GPU_TYPE is empty. \"", "\"Make sure to call `get_gpu_type()` first.\"", ")", "elif", "GPU_TYP...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py#L365-L396
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/artmanager.py
python
ArtManager.GetFont
(self)
return renderer.GetFont()
Returns the font used by this theme. :return: An instance of :class:`Font`.
Returns the font used by this theme.
[ "Returns", "the", "font", "used", "by", "this", "theme", "." ]
def GetFont(self): """ Returns the font used by this theme. :return: An instance of :class:`Font`. """ renderer = self._renderers[self.GetMenuTheme()] return renderer.GetFont()
[ "def", "GetFont", "(", "self", ")", ":", "renderer", "=", "self", ".", "_renderers", "[", "self", ".", "GetMenuTheme", "(", ")", "]", "return", "renderer", ".", "GetFont", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/artmanager.py#L1769-L1777
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
media/webrtc/trunk/tools/gyp/pylib/gyp/generator/make.py
python
MakefileWriter.ComputeMacBundleOutput
(self, spec)
return os.path.join(path, self.xcode_settings.GetWrapperName())
Return the 'output' (full output path) to a bundle output directory.
Return the 'output' (full output path) to a bundle output directory.
[ "Return", "the", "output", "(", "full", "output", "path", ")", "to", "a", "bundle", "output", "directory", "." ]
def ComputeMacBundleOutput(self, spec): """Return the 'output' (full output path) to a bundle output directory.""" assert self.is_mac_bundle path = generator_default_variables['PRODUCT_DIR'] return os.path.join(path, self.xcode_settings.GetWrapperName())
[ "def", "ComputeMacBundleOutput", "(", "self", ",", "spec", ")", ":", "assert", "self", ".", "is_mac_bundle", "path", "=", "generator_default_variables", "[", "'PRODUCT_DIR'", "]", "return", "os", ".", "path", ".", "join", "(", "path", ",", "self", ".", "xcod...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/make.py#L1350-L1354
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/jinja2/environment.py
python
Environment.overlay
(self, block_start_string=missing, block_end_string=missing, variable_start_string=missing, variable_end_string=missing, comment_start_string=missing, comment_end_string=missing, line_statement_prefix=missing, line_comment_prefix=missing, trim_blocks=missi...
return _environment_sanity_check(rv)
Create a new overlay environment that shares all the data with the current environment except of cache and the overridden attributes. Extensions cannot be removed for an overlayed environment. An overlayed environment automatically gets all the extensions of the environment it is linked...
Create a new overlay environment that shares all the data with the current environment except of cache and the overridden attributes. Extensions cannot be removed for an overlayed environment. An overlayed environment automatically gets all the extensions of the environment it is linked...
[ "Create", "a", "new", "overlay", "environment", "that", "shares", "all", "the", "data", "with", "the", "current", "environment", "except", "of", "cache", "and", "the", "overridden", "attributes", ".", "Extensions", "cannot", "be", "removed", "for", "an", "over...
def overlay(self, block_start_string=missing, block_end_string=missing, variable_start_string=missing, variable_end_string=missing, comment_start_string=missing, comment_end_string=missing, line_statement_prefix=missing, line_comment_prefix=missing, trim_b...
[ "def", "overlay", "(", "self", ",", "block_start_string", "=", "missing", ",", "block_end_string", "=", "missing", ",", "variable_start_string", "=", "missing", ",", "variable_end_string", "=", "missing", ",", "comment_start_string", "=", "missing", ",", "comment_en...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/jinja2/environment.py#L323-L366
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/logging/__init__.py
python
LoggerAdapter.__init__
(self, logger, extra)
Initialize the adapter with a logger and a dict-like object which provides contextual information. This constructor signature allows easy stacking of LoggerAdapters, if so desired. You can effectively pass keyword arguments as shown in the following example: adapter = LoggerAda...
Initialize the adapter with a logger and a dict-like object which provides contextual information. This constructor signature allows easy stacking of LoggerAdapters, if so desired.
[ "Initialize", "the", "adapter", "with", "a", "logger", "and", "a", "dict", "-", "like", "object", "which", "provides", "contextual", "information", ".", "This", "constructor", "signature", "allows", "easy", "stacking", "of", "LoggerAdapters", "if", "so", "desire...
def __init__(self, logger, extra): """ Initialize the adapter with a logger and a dict-like object which provides contextual information. This constructor signature allows easy stacking of LoggerAdapters, if so desired. You can effectively pass keyword arguments as shown in the ...
[ "def", "__init__", "(", "self", ",", "logger", ",", "extra", ")", ":", "self", ".", "logger", "=", "logger", "self", ".", "extra", "=", "extra" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/logging/__init__.py#L1264-L1276
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/protobuf/python/google/protobuf/internal/containers.py
python
RepeatedCompositeFieldContainer.__getslice__
(self, start, stop)
return self._values[start:stop]
Retrieves the subset of items from between the specified indices.
Retrieves the subset of items from between the specified indices.
[ "Retrieves", "the", "subset", "of", "items", "from", "between", "the", "specified", "indices", "." ]
def __getslice__(self, start, stop): """Retrieves the subset of items from between the specified indices.""" return self._values[start:stop]
[ "def", "__getslice__", "(", "self", ",", "start", ",", "stop", ")", ":", "return", "self", ".", "_values", "[", "start", ":", "stop", "]" ]
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/protobuf/python/google/protobuf/internal/containers.py#L238-L240
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/decimal.py
python
Decimal.copy_sign
(self, other)
return _dec_from_triple(other._sign, self._int, self._exp, self._is_special)
Returns self with the sign of other.
Returns self with the sign of other.
[ "Returns", "self", "with", "the", "sign", "of", "other", "." ]
def copy_sign(self, other): """Returns self with the sign of other.""" other = _convert_other(other, raiseit=True) return _dec_from_triple(other._sign, self._int, self._exp, self._is_special)
[ "def", "copy_sign", "(", "self", ",", "other", ")", ":", "other", "=", "_convert_other", "(", "other", ",", "raiseit", "=", "True", ")", "return", "_dec_from_triple", "(", "other", ".", "_sign", ",", "self", ".", "_int", ",", "self", ".", "_exp", ",", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/decimal.py#L2924-L2928
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/gluon/rnn/rnn_cell.py
python
RecurrentCell.begin_state
(self, batch_size=0, func=ndarray.zeros, **kwargs)
return states
Initial state for this cell. Parameters ---------- func : callable, default symbol.zeros Function for creating initial state. For Symbol API, func can be `symbol.zeros`, `symbol.uniform`, `symbol.var etc`. Use `symbol.var` if you want to directly ...
Initial state for this cell.
[ "Initial", "state", "for", "this", "cell", "." ]
def begin_state(self, batch_size=0, func=ndarray.zeros, **kwargs): """Initial state for this cell. Parameters ---------- func : callable, default symbol.zeros Function for creating initial state. For Symbol API, func can be `symbol.zeros`, `symbol.uniform`, ...
[ "def", "begin_state", "(", "self", ",", "batch_size", "=", "0", ",", "func", "=", "ndarray", ".", "zeros", ",", "*", "*", "kwargs", ")", ":", "assert", "not", "self", ".", "_modified", ",", "\"After applying modifier cells (e.g. ZoneoutCell) the base \"", "\"cel...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/gluon/rnn/rnn_cell.py#L154-L193
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/schema_wrapper.py
python
run_json_qcschema
(json_data, clean, json_serialization, keep_wfn=False)
return json_data
An implementation of the QC JSON Schema (molssi-qc-schema.readthedocs.io/en/latest/index.html#) implementation in Psi4. Parameters ---------- json_data : JSON Please see molssi-qc-schema.readthedocs.io/en/latest/spec_components.html for further details. Notes ----- !Warning! This func...
An implementation of the QC JSON Schema (molssi-qc-schema.readthedocs.io/en/latest/index.html#) implementation in Psi4.
[ "An", "implementation", "of", "the", "QC", "JSON", "Schema", "(", "molssi", "-", "qc", "-", "schema", ".", "readthedocs", ".", "io", "/", "en", "/", "latest", "/", "index", ".", "html#", ")", "implementation", "in", "Psi4", "." ]
def run_json_qcschema(json_data, clean, json_serialization, keep_wfn=False): """ An implementation of the QC JSON Schema (molssi-qc-schema.readthedocs.io/en/latest/index.html#) implementation in Psi4. Parameters ---------- json_data : JSON Please see molssi-qc-schema.readthedocs.io/en/late...
[ "def", "run_json_qcschema", "(", "json_data", ",", "clean", ",", "json_serialization", ",", "keep_wfn", "=", "False", ")", ":", "# Clean a few things", "_clean_psi_environ", "(", "clean", ")", "# This is currently a forced override", "if", "json_data", "[", "\"schema_na...
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/schema_wrapper.py#L494-L651
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/imaplib.py
python
IMAP4.create
(self, mailbox)
return self._simple_command('CREATE', mailbox)
Create new mailbox. (typ, [data]) = <instance>.create(mailbox)
Create new mailbox.
[ "Create", "new", "mailbox", "." ]
def create(self, mailbox): """Create new mailbox. (typ, [data]) = <instance>.create(mailbox) """ return self._simple_command('CREATE', mailbox)
[ "def", "create", "(", "self", ",", "mailbox", ")", ":", "return", "self", ".", "_simple_command", "(", "'CREATE'", ",", "mailbox", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/imaplib.py#L412-L417
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
3rdparty/protobuf-3.0.0/python/google/protobuf/descriptor.py
python
DescriptorBase.GetOptions
(self)
return self._options
Retrieves descriptor options. This method returns the options set or creates the default options for the descriptor.
Retrieves descriptor options.
[ "Retrieves", "descriptor", "options", "." ]
def GetOptions(self): """Retrieves descriptor options. This method returns the options set or creates the default options for the descriptor. """ if self._options: return self._options from google.protobuf import descriptor_pb2 try: options_class = getattr(descriptor_pb2, self._...
[ "def", "GetOptions", "(", "self", ")", ":", "if", "self", ".", "_options", ":", "return", "self", ".", "_options", "from", "google", ".", "protobuf", "import", "descriptor_pb2", "try", ":", "options_class", "=", "getattr", "(", "descriptor_pb2", ",", "self",...
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/descriptor.py#L118-L133
eric1688/sphinx
514317761b35c07eb9f36db55a1ff365c4a9f0bc
api/sphinxapi.py
python
SphinxClient.__init__
(self)
Create a new client object, and fill defaults.
Create a new client object, and fill defaults.
[ "Create", "a", "new", "client", "object", "and", "fill", "defaults", "." ]
def __init__ (self): """ Create a new client object, and fill defaults. """ self._host = 'localhost' # searchd host (default is "localhost") self._port = 9312 # searchd port (default is 9312) self._path = None # searchd unix-domain socket path self._socket = None self._offset = 0...
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "_host", "=", "'localhost'", "# searchd host (default is \"localhost\")", "self", ".", "_port", "=", "9312", "# searchd port (default is 9312)", "self", ".", "_path", "=", "None", "# searchd unix-domain socket path"...
https://github.com/eric1688/sphinx/blob/514317761b35c07eb9f36db55a1ff365c4a9f0bc/api/sphinxapi.py#L121-L164
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/protobuf/py2/google/protobuf/internal/well_known_types.py
python
_FieldMaskTree.IntersectPath
(self, path, intersection)
Calculates the intersection part of a field path with this tree. Args: path: The field path to calculates. intersection: The out tree to record the intersection part.
Calculates the intersection part of a field path with this tree.
[ "Calculates", "the", "intersection", "part", "of", "a", "field", "path", "with", "this", "tree", "." ]
def IntersectPath(self, path, intersection): """Calculates the intersection part of a field path with this tree. Args: path: The field path to calculates. intersection: The out tree to record the intersection part. """ node = self._root for name in path.split('.'): if name not in ...
[ "def", "IntersectPath", "(", "self", ",", "path", ",", "intersection", ")", ":", "node", "=", "self", ".", "_root", "for", "name", "in", "path", ".", "split", "(", "'.'", ")", ":", "if", "name", "not", "in", "node", ":", "return", "elif", "not", "n...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/internal/well_known_types.py#L621-L636
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_presenter.py
python
BasicFittingPresenter.update_fit_function_in_model
(self, fit_function: IFunction)
Updates the fit function stored in the model. This is used after a fit.
Updates the fit function stored in the model. This is used after a fit.
[ "Updates", "the", "fit", "function", "stored", "in", "the", "model", ".", "This", "is", "used", "after", "a", "fit", "." ]
def update_fit_function_in_model(self, fit_function: IFunction) -> None: """Updates the fit function stored in the model. This is used after a fit.""" self.model.current_single_fit_function = fit_function
[ "def", "update_fit_function_in_model", "(", "self", ",", "fit_function", ":", "IFunction", ")", "->", "None", ":", "self", ".", "model", ".", "current_single_fit_function", "=", "fit_function" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_presenter.py#L406-L408
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/src/rootfind.py
python
setXTolerance
(tolx)
return _rootfind.setXTolerance(tolx)
setXTolerance(double tolx) Sets the termination threshold for the change in x.
setXTolerance(double tolx)
[ "setXTolerance", "(", "double", "tolx", ")" ]
def setXTolerance(tolx): """ setXTolerance(double tolx) Sets the termination threshold for the change in x. """ return _rootfind.setXTolerance(tolx)
[ "def", "setXTolerance", "(", "tolx", ")", ":", "return", "_rootfind", ".", "setXTolerance", "(", "tolx", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/rootfind.py#L107-L116
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/ultimatelistctrl.py
python
UltimateListItemAttr.SetFooterTextColour
(self, colText)
Sets a new footer item text colour. :param `colText`: an instance of :class:`Colour`.
Sets a new footer item text colour.
[ "Sets", "a", "new", "footer", "item", "text", "colour", "." ]
def SetFooterTextColour(self, colText): """ Sets a new footer item text colour. :param `colText`: an instance of :class:`Colour`. """ self._footerColText = colText
[ "def", "SetFooterTextColour", "(", "self", ",", "colText", ")", ":", "self", ".", "_footerColText", "=", "colText" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L1219-L1226
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py
python
htmlHandleOmittedElem
(val)
return ret
Set and return the previous value for handling HTML omitted tags.
Set and return the previous value for handling HTML omitted tags.
[ "Set", "and", "return", "the", "previous", "value", "for", "handling", "HTML", "omitted", "tags", "." ]
def htmlHandleOmittedElem(val): """Set and return the previous value for handling HTML omitted tags. """ ret = libxml2mod.htmlHandleOmittedElem(val) return ret
[ "def", "htmlHandleOmittedElem", "(", "val", ")", ":", "ret", "=", "libxml2mod", ".", "htmlHandleOmittedElem", "(", "val", ")", "return", "ret" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L11-L15
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Subst.py
python
StringSubber.substitute
(self, args, lvars)
Substitute expansions in an argument or list of arguments. This serves as a wrapper for splitting up a string into separate tokens.
Substitute expansions in an argument or list of arguments.
[ "Substitute", "expansions", "in", "an", "argument", "or", "list", "of", "arguments", "." ]
def substitute(self, args, lvars): """Substitute expansions in an argument or list of arguments. This serves as a wrapper for splitting up a string into separate tokens. """ if is_String(args) and not isinstance(args, CmdStringHolder): args = str(args) # In ca...
[ "def", "substitute", "(", "self", ",", "args", ",", "lvars", ")", ":", "if", "is_String", "(", "args", ")", "and", "not", "isinstance", "(", "args", ",", "CmdStringHolder", ")", ":", "args", "=", "str", "(", "args", ")", "# In case it's a UserString.", "...
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Subst.py#L441-L469
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/diagnostic_updater/_diagnostic_updater.py
python
Updater.force_update
(self)
Forces the diagnostics to update. Useful if the node has undergone a drastic state change that should be published immediately.
Forces the diagnostics to update.
[ "Forces", "the", "diagnostics", "to", "update", "." ]
def force_update(self): """Forces the diagnostics to update. Useful if the node has undergone a drastic state change that should be published immediately. """ self.last_time = rospy.Time.now() warn_nohwid = len(self.hwid)==0 status_vec = [] with self.l...
[ "def", "force_update", "(", "self", ")", ":", "self", ".", "last_time", "=", "rospy", ".", "Time", ".", "now", "(", ")", "warn_nohwid", "=", "len", "(", "self", ".", "hwid", ")", "==", "0", "status_vec", "=", "[", "]", "with", "self", ".", "lock", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/diagnostic_updater/_diagnostic_updater.py#L249-L284
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/data/util/nest.py
python
_packed_nest_with_indices
(structure, flat, index)
return index, packed
Helper function for pack_nest_as. Args: structure: Substructure (tuple of elements and/or tuples) to mimic flat: Flattened values to output substructure for. index: Index at which to start reading from flat. Returns: The tuple (new_index, child), where: * new_index - the updated index into `...
Helper function for pack_nest_as.
[ "Helper", "function", "for", "pack_nest_as", "." ]
def _packed_nest_with_indices(structure, flat, index): """Helper function for pack_nest_as. Args: structure: Substructure (tuple of elements and/or tuples) to mimic flat: Flattened values to output substructure for. index: Index at which to start reading from flat. Returns: The tuple (new_index,...
[ "def", "_packed_nest_with_indices", "(", "structure", ",", "flat", ",", "index", ")", ":", "packed", "=", "[", "]", "for", "s", "in", "_yield_value", "(", "structure", ")", ":", "if", "is_sequence", "(", "s", ")", ":", "new_index", ",", "child", "=", "...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/data/util/nest.py#L183-L211
google/amber
4bbce8528cc2a4258302e4df710a344f405a0fa4
tools/copyright.py
python
comment
(text, prefix)
return '\n'.join(accum)
Returns commented-out text. Each line of text will be prefixed by prefix and a space character. Any trailing whitespace will be trimmed.
Returns commented-out text.
[ "Returns", "commented", "-", "out", "text", "." ]
def comment(text, prefix): """Returns commented-out text. Each line of text will be prefixed by prefix and a space character. Any trailing whitespace will be trimmed. """ accum = [] for line in text.split('\n'): accum.append((prefix + ' ' + line).rstrip()) return '\n'.join(accum)
[ "def", "comment", "(", "text", ",", "prefix", ")", ":", "accum", "=", "[", "]", "for", "line", "in", "text", ".", "split", "(", "'\\n'", ")", ":", "accum", ".", "append", "(", "(", "prefix", "+", "' '", "+", "line", ")", ".", "rstrip", "(", ")"...
https://github.com/google/amber/blob/4bbce8528cc2a4258302e4df710a344f405a0fa4/tools/copyright.py#L76-L85
goldeneye-source/ges-code
2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d
thirdparty/protobuf-2.3.0/python/mox.py
python
MockMethod.InAnyOrder
(self, group_name="default")
return self._CheckAndCreateNewGroup(group_name, UnorderedGroup)
Move this method into a group of unordered calls. A group of unordered calls must be defined together, and must be executed in full before the next expected method can be called. There can be multiple groups that are expected serially, if they are given different group names. The same group name can ...
Move this method into a group of unordered calls.
[ "Move", "this", "method", "into", "a", "group", "of", "unordered", "calls", "." ]
def InAnyOrder(self, group_name="default"): """Move this method into a group of unordered calls. A group of unordered calls must be defined together, and must be executed in full before the next expected method can be called. There can be multiple groups that are expected serially, if they are given ...
[ "def", "InAnyOrder", "(", "self", ",", "group_name", "=", "\"default\"", ")", ":", "return", "self", ".", "_CheckAndCreateNewGroup", "(", "group_name", ",", "UnorderedGroup", ")" ]
https://github.com/goldeneye-source/ges-code/blob/2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d/thirdparty/protobuf-2.3.0/python/mox.py#L686-L702
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/framework.py
python
IrVarNode.shape
(self)
return self.node.var().shape()
Return the variable shape. Returns: list: the variable shape.
Return the variable shape.
[ "Return", "the", "variable", "shape", "." ]
def shape(self): """ Return the variable shape. Returns: list: the variable shape. """ assert self.node.var() is not None, \ "The node variable description can not be None." return self.node.var().shape()
[ "def", "shape", "(", "self", ")", ":", "assert", "self", ".", "node", ".", "var", "(", ")", "is", "not", "None", ",", "\"The node variable description can not be None.\"", "return", "self", ".", "node", ".", "var", "(", ")", ".", "shape", "(", ")" ]
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/framework.py#L4024-L4033
infinisql/infinisql
6e858e142196e20b6779e1ee84c4a501e246c1f8
manager/infinisqlmgr/management/__init__.py
python
Controller.get_nodes
(self)
return self.nodes
Provides a set of node ids. :return: A set of node ids.
Provides a set of node ids. :return: A set of node ids.
[ "Provides", "a", "set", "of", "node", "ids", ".", ":", "return", ":", "A", "set", "of", "node", "ids", "." ]
def get_nodes(self): """ Provides a set of node ids. :return: A set of node ids. """ return self.nodes
[ "def", "get_nodes", "(", "self", ")", ":", "return", "self", ".", "nodes" ]
https://github.com/infinisql/infinisql/blob/6e858e142196e20b6779e1ee84c4a501e246c1f8/manager/infinisqlmgr/management/__init__.py#L426-L431
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/incubate/fleet/utils/fleet_util.py
python
FleetUtil.get_last_save_xbox_base
(self, output_path, hadoop_fs_name, hadoop_fs_ugi, hadoop_home="$HADOOP_HOME")
return [last_day, last_path, xbox_base_key]
r""" get last saved base xbox info from xbox_base_done.txt Args: output_path(str): output path hadoop_fs_name(str): hdfs/afs fs_name hadoop_fs_ugi(str): hdfs/afs fs_ugi hadoop_home(str): hadoop home, default is "$HADOOP_HOME" Returns: ...
r""" get last saved base xbox info from xbox_base_done.txt
[ "r", "get", "last", "saved", "base", "xbox", "info", "from", "xbox_base_done", ".", "txt" ]
def get_last_save_xbox_base(self, output_path, hadoop_fs_name, hadoop_fs_ugi, hadoop_home="$HADOOP_HOME"): r""" get last saved base xbox info from xbox_base_done.txt A...
[ "def", "get_last_save_xbox_base", "(", "self", ",", "output_path", ",", "hadoop_fs_name", ",", "hadoop_fs_ugi", ",", "hadoop_home", "=", "\"$HADOOP_HOME\"", ")", ":", "donefile_path", "=", "output_path", "+", "\"/xbox_base_done.txt\"", "configs", "=", "{", "\"fs.defau...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/incubate/fleet/utils/fleet_util.py#L1047-L1090
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/bisect-perf-regression.py
python
BisectPerformanceMetrics.SyncBuildAndRunRevision
(self, revision, depot, command_to_run, metric, skippable=False)
Performs a full sync/build/run of the specified revision. Args: revision: The revision to sync to. depot: The depot that's being used at the moment (src, webkit, etc.) command_to_run: The command to execute the performance test. metric: The performance metric being tested. Returns: ...
Performs a full sync/build/run of the specified revision.
[ "Performs", "a", "full", "sync", "/", "build", "/", "run", "of", "the", "specified", "revision", "." ]
def SyncBuildAndRunRevision(self, revision, depot, command_to_run, metric, skippable=False): """Performs a full sync/build/run of the specified revision. Args: revision: The revision to sync to. depot: The depot that's being used at the moment (src, webkit, etc.) command_to_run: The com...
[ "def", "SyncBuildAndRunRevision", "(", "self", ",", "revision", ",", "depot", ",", "command_to_run", ",", "metric", ",", "skippable", "=", "False", ")", ":", "sync_client", "=", "None", "if", "depot", "==", "'chromium'", "or", "depot", "==", "'android-chrome'"...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/bisect-perf-regression.py#L1556-L1640
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/factorization/python/ops/clustering_ops.py
python
KMeans._init_clusters_random
(self)
Does random initialization of clusters. Returns: Tensor of randomly initialized clusters.
Does random initialization of clusters.
[ "Does", "random", "initialization", "of", "clusters", "." ]
def _init_clusters_random(self): """Does random initialization of clusters. Returns: Tensor of randomly initialized clusters. """ num_data = tf.add_n([tf.shape(inp)[0] for inp in self._inputs]) # Note that for mini-batch k-means, we should ensure that the batch size of # data used during ...
[ "def", "_init_clusters_random", "(", "self", ")", ":", "num_data", "=", "tf", ".", "add_n", "(", "[", "tf", ".", "shape", "(", "inp", ")", "[", "0", "]", "for", "inp", "in", "self", ".", "_inputs", "]", ")", "# Note that for mini-batch k-means, we should e...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/factorization/python/ops/clustering_ops.py#L202-L221
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/learn/python/learn/graph_actions.py
python
infer
(restore_checkpoint_path, output_dict, feed_dict=None)
return run_feeds(output_dict=output_dict, feed_dicts=[feed_dict] if feed_dict is not None else [None], restore_checkpoint_path=restore_checkpoint_path)[0]
Restore graph from `restore_checkpoint_path` and run `output_dict` tensors. If `restore_checkpoint_path` is supplied, restore from checkpoint. Otherwise, init all variables. Args: restore_checkpoint_path: A string containing the path to a checkpoint to restore. output_dict: A `dict` mapping string...
Restore graph from `restore_checkpoint_path` and run `output_dict` tensors.
[ "Restore", "graph", "from", "restore_checkpoint_path", "and", "run", "output_dict", "tensors", "." ]
def infer(restore_checkpoint_path, output_dict, feed_dict=None): """Restore graph from `restore_checkpoint_path` and run `output_dict` tensors. If `restore_checkpoint_path` is supplied, restore from checkpoint. Otherwise, init all variables. Args: restore_checkpoint_path: A string containing the path to a...
[ "def", "infer", "(", "restore_checkpoint_path", ",", "output_dict", ",", "feed_dict", "=", "None", ")", ":", "return", "run_feeds", "(", "output_dict", "=", "output_dict", ",", "feed_dicts", "=", "[", "feed_dict", "]", "if", "feed_dict", "is", "not", "None", ...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/graph_actions.py#L855-L878
etotheipi/BitcoinArmory
2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98
armoryengine/PyBtcAddress.py
python
PyBtcAddress.touch
(self, unixTime=None, blkNum=None)
Just like "touching" a file, this makes sure that the firstSeen and lastSeen fields for this address are updated to include "now" If we include only a block number, we will fill in the timestamp with the unix-time for that block (if the BlockDataManager is availabled)
Just like "touching" a file, this makes sure that the firstSeen and lastSeen fields for this address are updated to include "now"
[ "Just", "like", "touching", "a", "file", "this", "makes", "sure", "that", "the", "firstSeen", "and", "lastSeen", "fields", "for", "this", "address", "are", "updated", "to", "include", "now" ]
def touch(self, unixTime=None, blkNum=None): """ Just like "touching" a file, this makes sure that the firstSeen and lastSeen fields for this address are updated to include "now" If we include only a block number, we will fill in the timestamp with the unix-time for that block (if the Blo...
[ "def", "touch", "(", "self", ",", "unixTime", "=", "None", ",", "blkNum", "=", "None", ")", ":", "if", "self", ".", "blkRange", "[", "0", "]", "==", "0", ":", "self", ".", "blkRange", "[", "0", "]", "=", "2", "**", "32", "-", "1", "if", "self...
https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/armoryengine/PyBtcAddress.py#L178-L209
lukasmonk/lucaschess
13e2e5cb13b38a720ccf897af649054a64bcb914
Code/QT/QTUtil.py
python
qtAlineacion
(cAlin)
return dAlineacion.get(cAlin, QtCore.Qt.AlignLeft)
Convierte alineacion en letras (i-c-d) en constantes qt
Convierte alineacion en letras (i-c-d) en constantes qt
[ "Convierte", "alineacion", "en", "letras", "(", "i", "-", "c", "-", "d", ")", "en", "constantes", "qt" ]
def qtAlineacion(cAlin): """ Convierte alineacion en letras (i-c-d) en constantes qt """ return dAlineacion.get(cAlin, QtCore.Qt.AlignLeft)
[ "def", "qtAlineacion", "(", "cAlin", ")", ":", "return", "dAlineacion", ".", "get", "(", "cAlin", ",", "QtCore", ".", "Qt", ".", "AlignLeft", ")" ]
https://github.com/lukasmonk/lucaschess/blob/13e2e5cb13b38a720ccf897af649054a64bcb914/Code/QT/QTUtil.py#L87-L91
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/seq2seq/python/ops/sampler.py
python
categorical_sample
(logits, dtype=dtypes.int32, sample_shape=(), seed=None)
return _call_sampler(_sample_n, sample_shape)
Samples from categorical distribution.
Samples from categorical distribution.
[ "Samples", "from", "categorical", "distribution", "." ]
def categorical_sample(logits, dtype=dtypes.int32, sample_shape=(), seed=None): """Samples from categorical distribution.""" logits = ops.convert_to_tensor(logits, name="logits") event_size = array_ops.shape(logits)[-1] batch_shape_tensor = array_ops.shape(logits)[:-1] def _sample_n(n): """Sample vector ...
[ "def", "categorical_sample", "(", "logits", ",", "dtype", "=", "dtypes", ".", "int32", ",", "sample_shape", "=", "(", ")", ",", "seed", "=", "None", ")", ":", "logits", "=", "ops", ".", "convert_to_tensor", "(", "logits", ",", "name", "=", "\"logits\"", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/seq2seq/python/ops/sampler.py#L738-L758
tangzhenyu/Scene-Text-Understanding
0f7ffc7aea5971a50cdc03d33d0a41075285948b
SynthText_Chinese/gen_more.py
python
add_res_to_db
(imgname,res,db)
Add the synthetically generated text image instance and other metadata to the dataset.
Add the synthetically generated text image instance and other metadata to the dataset.
[ "Add", "the", "synthetically", "generated", "text", "image", "instance", "and", "other", "metadata", "to", "the", "dataset", "." ]
def add_res_to_db(imgname,res,db): """ Add the synthetically generated text image instance and other metadata to the dataset. """ ninstance = len(res) for i in xrange(ninstance): print colorize(Color.GREEN,'added into the db %s '%res[i]['txt']) dname = "%s_%d"%(imgname, i) db['data'].create...
[ "def", "add_res_to_db", "(", "imgname", ",", "res", ",", "db", ")", ":", "ninstance", "=", "len", "(", "res", ")", "for", "i", "in", "xrange", "(", "ninstance", ")", ":", "print", "colorize", "(", "Color", ".", "GREEN", ",", "'added into the db %s '", ...
https://github.com/tangzhenyu/Scene-Text-Understanding/blob/0f7ffc7aea5971a50cdc03d33d0a41075285948b/SynthText_Chinese/gen_more.py#L64-L88
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/nturl2path.py
python
pathname2url
(p)
return path
OS-specific conversion from a file system path to a relative URL of the 'file' scheme; not recommended for general use.
OS-specific conversion from a file system path to a relative URL of the 'file' scheme; not recommended for general use.
[ "OS", "-", "specific", "conversion", "from", "a", "file", "system", "path", "to", "a", "relative", "URL", "of", "the", "file", "scheme", ";", "not", "recommended", "for", "general", "use", "." ]
def pathname2url(p): """OS-specific conversion from a file system path to a relative URL of the 'file' scheme; not recommended for general use.""" # e.g. # C:\foo\bar\spam.foo # becomes # ///C|/foo/bar/spam.foo import urllib if not ':' in p: # No drive specifier, just convert sla...
[ "def", "pathname2url", "(", "p", ")", ":", "# e.g.", "# C:\\foo\\bar\\spam.foo", "# becomes", "# ///C|/foo/bar/spam.foo", "import", "urllib", "if", "not", "':'", "in", "p", ":", "# No drive specifier, just convert slashes and quote the name", "if", "p", "[", ":", "2", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/nturl2path.py#L38-L66
plumonito/dtslam
5994bb9cf7a11981b830370db206bceb654c085d
3rdparty/opencv-git/3rdparty/jinja2/filters.py
python
do_title
(s)
return ''.join(rv)
Return a titlecased version of the value. I.e. words will start with uppercase letters, all remaining characters are lowercase.
Return a titlecased version of the value. I.e. words will start with uppercase letters, all remaining characters are lowercase.
[ "Return", "a", "titlecased", "version", "of", "the", "value", ".", "I", ".", "e", ".", "words", "will", "start", "with", "uppercase", "letters", "all", "remaining", "characters", "are", "lowercase", "." ]
def do_title(s): """Return a titlecased version of the value. I.e. words will start with uppercase letters, all remaining characters are lowercase. """ rv = [] for item in re.compile(r'([-\s]+)(?u)').split(s): if not item: continue rv.append(item[0].upper() + item[1:].low...
[ "def", "do_title", "(", "s", ")", ":", "rv", "=", "[", "]", "for", "item", "in", "re", ".", "compile", "(", "r'([-\\s]+)(?u)'", ")", ".", "split", "(", "s", ")", ":", "if", "not", "item", ":", "continue", "rv", ".", "append", "(", "item", "[", ...
https://github.com/plumonito/dtslam/blob/5994bb9cf7a11981b830370db206bceb654c085d/3rdparty/opencv-git/3rdparty/jinja2/filters.py#L181-L190
simsong/bulk_extractor
738911df22b7066ca9e1662f4131fb44090a4196
python/dfxml.py
python
fileobject.name_type
(self)
return self.tag("name_type")
Return the contents of the name_type tag
Return the contents of the name_type tag
[ "Return", "the", "contents", "of", "the", "name_type", "tag" ]
def name_type(self): """Return the contents of the name_type tag""" return self.tag("name_type")
[ "def", "name_type", "(", "self", ")", ":", "return", "self", ".", "tag", "(", "\"name_type\"", ")" ]
https://github.com/simsong/bulk_extractor/blob/738911df22b7066ca9e1662f4131fb44090a4196/python/dfxml.py#L719-L721
microsoft/EdgeML
ef9f8a77f096acbdeb941014791f8eda1c1bc35b
examples/pytorch/FastCells/helpermethods.py
python
createTimeStampDir
(dataDir, cell)
return None
Creates a Directory with timestamp as it's name
Creates a Directory with timestamp as it's name
[ "Creates", "a", "Directory", "with", "timestamp", "as", "it", "s", "name" ]
def createTimeStampDir(dataDir, cell): ''' Creates a Directory with timestamp as it's name ''' if os.path.isdir(os.path.join(dataDir, str(cell) + 'Results')) is False: try: os.mkdir(os.path.join(dataDir, str(cell) + 'Results')) except OSError: print("Creation of t...
[ "def", "createTimeStampDir", "(", "dataDir", ",", "cell", ")", ":", "if", "os", ".", "path", ".", "isdir", "(", "os", ".", "path", ".", "join", "(", "dataDir", ",", "str", "(", "cell", ")", "+", "'Results'", ")", ")", "is", "False", ":", "try", "...
https://github.com/microsoft/EdgeML/blob/ef9f8a77f096acbdeb941014791f8eda1c1bc35b/examples/pytorch/FastCells/helpermethods.py#L178-L199
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/joblib/joblib/numpy_pickle_compat.py
python
read_zfile
(file_handle)
return data
Read the z-file and return the content as a string. Z-files are raw data compressed with zlib used internally by joblib for persistence. Backward compatibility is not guaranteed. Do not use for external purposes.
Read the z-file and return the content as a string.
[ "Read", "the", "z", "-", "file", "and", "return", "the", "content", "as", "a", "string", "." ]
def read_zfile(file_handle): """Read the z-file and return the content as a string. Z-files are raw data compressed with zlib used internally by joblib for persistence. Backward compatibility is not guaranteed. Do not use for external purposes. """ file_handle.seek(0) header_length = len(_Z...
[ "def", "read_zfile", "(", "file_handle", ")", ":", "file_handle", ".", "seek", "(", "0", ")", "header_length", "=", "len", "(", "_ZFILE_PREFIX", ")", "+", "_MAX_LEN", "length", "=", "file_handle", ".", "read", "(", "header_length", ")", "length", "=", "len...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/joblib/joblib/numpy_pickle_compat.py#L29-L59
HKUST-Aerial-Robotics/grad_traj_optimization
019701be8d660fc18cc482a95adeae8d9f415d82
third_party/arc_utilities/src/arc_utilities/ros_helpers.py
python
Xbox.wait_for_button
(self, button, message=True)
Waits for button press on xbox. Parameters: button (str): Name of xbox button. "A", "B", "X", ... message (bool): log a message informing the user?
Waits for button press on xbox.
[ "Waits", "for", "button", "press", "on", "xbox", "." ]
def wait_for_button(self, button, message=True): """ Waits for button press on xbox. Parameters: button (str): Name of xbox button. "A", "B", "X", ... message (bool): log a message informing the user? """ if message: rospy.loginfo("Waiting for xbox ...
[ "def", "wait_for_button", "(", "self", ",", "button", ",", "message", "=", "True", ")", ":", "if", "message", ":", "rospy", ".", "loginfo", "(", "\"Waiting for xbox button: \"", "+", "button", ")", "wait_for", "(", "lambda", ":", "not", "self", ".", "get_b...
https://github.com/HKUST-Aerial-Robotics/grad_traj_optimization/blob/019701be8d660fc18cc482a95adeae8d9f415d82/third_party/arc_utilities/src/arc_utilities/ros_helpers.py#L98-L109
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/layers/utils.py
python
deconv_output_length
(input_length, filter_size, padding, stride)
return input_length
Determines output length of a transposed convolution given input length. Args: input_length: integer. filter_size: integer. padding: one of "same", "valid", "full". stride: integer. Returns: The output length (integer).
Determines output length of a transposed convolution given input length.
[ "Determines", "output", "length", "of", "a", "transposed", "convolution", "given", "input", "length", "." ]
def deconv_output_length(input_length, filter_size, padding, stride): """Determines output length of a transposed convolution given input length. Args: input_length: integer. filter_size: integer. padding: one of "same", "valid", "full". stride: integer. Returns: The output length ...
[ "def", "deconv_output_length", "(", "input_length", ",", "filter_size", ",", "padding", ",", "stride", ")", ":", "if", "input_length", "is", "None", ":", "return", "None", "input_length", "*=", "stride", "if", "padding", "==", "'valid'", ":", "input_length", "...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/layers/utils.py#L154-L173
bulletphysics/bullet3
f0f2a952e146f016096db6f85cf0c44ed75b0b9a
examples/pybullet/gym/pybullet_envs/agents/ppo/algorithm.py
python
PPOAlgorithm.experience
(self, agent_indices, observ, action, reward, unused_done, unused_nextob)
Process the transition tuple of the current step. When training, add the current transition tuple to the memory and update the streaming statistics for observations and rewards. A summary string is returned if requested at this step. Args: agent_indices: Tensor containing current batch indices. ...
Process the transition tuple of the current step.
[ "Process", "the", "transition", "tuple", "of", "the", "current", "step", "." ]
def experience(self, agent_indices, observ, action, reward, unused_done, unused_nextob): """Process the transition tuple of the current step. When training, add the current transition tuple to the memory and update the streaming statistics for observations and rewards. A summary string is returned if r...
[ "def", "experience", "(", "self", ",", "agent_indices", ",", "observ", ",", "action", ",", "reward", ",", "unused_done", ",", "unused_nextob", ")", ":", "with", "tf", ".", "name_scope", "(", "'experience/'", ")", ":", "return", "tf", ".", "cond", "(", "s...
https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/agents/ppo/algorithm.py#L160-L183
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/shape.py
python
_DistributionShape.event_ndims
(self)
return self._event_ndims
Returns number of dimensions needed to index a sample's coordinates.
Returns number of dimensions needed to index a sample's coordinates.
[ "Returns", "number", "of", "dimensions", "needed", "to", "index", "a", "sample", "s", "coordinates", "." ]
def event_ndims(self): """Returns number of dimensions needed to index a sample's coordinates.""" return self._event_ndims
[ "def", "event_ndims", "(", "self", ")", ":", "return", "self", ".", "_event_ndims" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/shape.py#L239-L241
facebookresearch/ELF
1f790173095cd910976d9f651b80beb872ec5d12
rlpytorch/runner/single_process.py
python
SingleProcessRun.run_multithread
(self)
Start training in a multithreaded environment
Start training in a multithreaded environment
[ "Start", "training", "in", "a", "multithreaded", "environment" ]
def run_multithread(self): ''' Start training in a multithreaded environment ''' def train_thread(): args = self.args for i in range(args.num_episode): for k in range(args.num_minibatch): if self.episode_start is not None: ...
[ "def", "run_multithread", "(", "self", ")", ":", "def", "train_thread", "(", ")", ":", "args", "=", "self", ".", "args", "for", "i", "in", "range", "(", "args", ".", "num_episode", ")", ":", "for", "k", "in", "range", "(", "args", ".", "num_minibatch...
https://github.com/facebookresearch/ELF/blob/1f790173095cd910976d9f651b80beb872ec5d12/rlpytorch/runner/single_process.py#L64-L93
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/ndimage/measurements.py
python
median
(input, labels=None, index=None)
return _select(input, labels, index, find_median=True)[0]
Calculate the median of the values of an array over labeled regions. Parameters ---------- input : array_like Array_like of values. For each region specified by `labels`, the median value of `input` over the region is computed. labels : array_like, optional An array_like of inte...
Calculate the median of the values of an array over labeled regions.
[ "Calculate", "the", "median", "of", "the", "values", "of", "an", "array", "over", "labeled", "regions", "." ]
def median(input, labels=None, index=None): """ Calculate the median of the values of an array over labeled regions. Parameters ---------- input : array_like Array_like of values. For each region specified by `labels`, the median value of `input` over the region is computed. lab...
[ "def", "median", "(", "input", ",", "labels", "=", "None", ",", "index", "=", "None", ")", ":", "return", "_select", "(", "input", ",", "labels", ",", "index", ",", "find_median", "=", "True", ")", "[", "0", "]" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/ndimage/measurements.py#L997-L1055
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/aui/auibar.py
python
AuiToolBar.OnPaint
(self, event)
Handles the ``wx.EVT_PAINT`` event for :class:`AuiToolBar`. :param `event`: a :class:`PaintEvent` event to be processed.
Handles the ``wx.EVT_PAINT`` event for :class:`AuiToolBar`.
[ "Handles", "the", "wx", ".", "EVT_PAINT", "event", "for", ":", "class", ":", "AuiToolBar", "." ]
def OnPaint(self, event): """ Handles the ``wx.EVT_PAINT`` event for :class:`AuiToolBar`. :param `event`: a :class:`PaintEvent` event to be processed. """ dc = wx.AutoBufferedPaintDC(self) cli_rect = wx.RectPS(wx.Point(0, 0), self.GetClientSize()) horiz...
[ "def", "OnPaint", "(", "self", ",", "event", ")", ":", "dc", "=", "wx", ".", "AutoBufferedPaintDC", "(", "self", ")", "cli_rect", "=", "wx", ".", "RectPS", "(", "wx", ".", "Point", "(", "0", ",", "0", ")", ",", "self", ".", "GetClientSize", "(", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/auibar.py#L3413-L3503
alibaba/MNN
c4d9566171d589c3ded23aa18ffb197016995a12
pymnn/pip_package/MNN/expr/__init__.py
python
log1p
(x)
return _F.log1p(x)
log1p(x) Return the ``log(1 + x)``, element-wise. Parameters ---------- x : var_like, input value, available range is (-1, +inf). Returns ------- y : Var. The ``log(1 + x)`` of `x`. Example: ------- >>> expr.log1p([9., 0.5]) var([2.3025851, 0.4054651])
log1p(x) Return the ``log(1 + x)``, element-wise.
[ "log1p", "(", "x", ")", "Return", "the", "log", "(", "1", "+", "x", ")", "element", "-", "wise", "." ]
def log1p(x): ''' log1p(x) Return the ``log(1 + x)``, element-wise. Parameters ---------- x : var_like, input value, available range is (-1, +inf). Returns ------- y : Var. The ``log(1 + x)`` of `x`. Example: ------- >>> expr.log1p([9., 0.5]) var([2.3025851, 0.4054...
[ "def", "log1p", "(", "x", ")", ":", "x", "=", "_to_var", "(", "x", ")", "return", "_F", ".", "log1p", "(", "x", ")" ]
https://github.com/alibaba/MNN/blob/c4d9566171d589c3ded23aa18ffb197016995a12/pymnn/pip_package/MNN/expr/__init__.py#L617-L636
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
ppapi/generators/idl_c_header.py
python
CheckTypedefs
(filenode, releases)
Checks that typedefs don't specify callbacks that take some structs. See http://crbug.com/233439 for details.
Checks that typedefs don't specify callbacks that take some structs.
[ "Checks", "that", "typedefs", "don", "t", "specify", "callbacks", "that", "take", "some", "structs", "." ]
def CheckTypedefs(filenode, releases): """Checks that typedefs don't specify callbacks that take some structs. See http://crbug.com/233439 for details. """ cgen = CGen() for node in filenode.GetListOf('Typedef'): build_list = node.GetUniqueReleases(releases) callnode = node.GetOneOf('Callspec') i...
[ "def", "CheckTypedefs", "(", "filenode", ",", "releases", ")", ":", "cgen", "=", "CGen", "(", ")", "for", "node", "in", "filenode", ".", "GetListOf", "(", "'Typedef'", ")", ":", "build_list", "=", "node", ".", "GetUniqueReleases", "(", "releases", ")", "...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/ppapi/generators/idl_c_header.py#L142-L163
tensorflow/io
92b44e180674a8af0e12e405530f7343e3e693e4
tensorflow_io/python/ops/io_tensor.py
python
IOTensor.graph
(cls, dtype)
return v
Obtain a GraphIOTensor to be used in graph mode. Args: dtype: Data type of the GraphIOTensor. Returns: A class of `GraphIOTensor`.
Obtain a GraphIOTensor to be used in graph mode.
[ "Obtain", "a", "GraphIOTensor", "to", "be", "used", "in", "graph", "mode", "." ]
def graph(cls, dtype): """Obtain a GraphIOTensor to be used in graph mode. Args: dtype: Data type of the GraphIOTensor. Returns: A class of `GraphIOTensor`. """ v = GraphIOTensor v._dtype = dtype # pylint: disable=protected-access return v
[ "def", "graph", "(", "cls", ",", "dtype", ")", ":", "v", "=", "GraphIOTensor", "v", ".", "_dtype", "=", "dtype", "# pylint: disable=protected-access", "return", "v" ]
https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/tensorflow_io/python/ops/io_tensor.py#L201-L212
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/network/session.py
python
user_agent
()
return "{data[installer][name]}/{data[installer][version]} {json}".format( data=data, json=json.dumps(data, separators=(",", ":"), sort_keys=True), )
Return a string representing the user agent.
[]
def user_agent(): """ Return a string representing the user agent. """ data = { "installer": {"name": "pip", "version": __version__}, "python": platform.python_version(), "implementation": { "name": platform.python_implementation(), }, } i...
[ "def", "user_agent", "(", ")", ":", "data", "=", "{", "\"installer\"", ":", "{", "\"name\"", ":", "\"pip\"", ",", "\"version\"", ":", "__version__", "}", ",", "\"python\"", ":", "platform", ".", "python_version", "(", ")", ",", "\"implementation\"", ":", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/network/session.py#L197-L351
glotzerlab/hoomd-blue
f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a
hoomd/mpcd/collide.py
python
at.set_params
(self, shift=None, kT=None)
Set parameters for the SRD collision method Args: shift (bool): If True, perform a random shift of the underlying cell list. kT (:py:mod:`hoomd.variant` or :py:obj:`float`): Temperature set point for the thermostat (in energy units). Examples:: srd....
Set parameters for the SRD collision method
[ "Set", "parameters", "for", "the", "SRD", "collision", "method" ]
def set_params(self, shift=None, kT=None): """ Set parameters for the SRD collision method Args: shift (bool): If True, perform a random shift of the underlying cell list. kT (:py:mod:`hoomd.variant` or :py:obj:`float`): Temperature set point for the thermostat (...
[ "def", "set_params", "(", "self", ",", "shift", "=", "None", ",", "kT", "=", "None", ")", ":", "if", "shift", "is", "not", "None", ":", "self", ".", "shift", "=", "shift", "self", ".", "_cpp", ".", "enableGridShifting", "(", "shift", ")", "if", "kT...
https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/mpcd/collide.py#L236-L257
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/v8/third_party/jinja2/filters.py
python
do_groupby
(environment, value, attribute)
return [_GroupTuple(key, list(values)) for key, values in groupby(sorted(value, key=expr), expr)]
Group a sequence of objects by a common attribute. If you for example have a list of dicts or objects that represent persons with `gender`, `first_name` and `last_name` attributes and you want to group all users by genders you can do something like the following snippet: .. sourcecode:: html+jinja...
Group a sequence of objects by a common attribute.
[ "Group", "a", "sequence", "of", "objects", "by", "a", "common", "attribute", "." ]
def do_groupby(environment, value, attribute): """Group a sequence of objects by a common attribute. If you for example have a list of dicts or objects that represent persons with `gender`, `first_name` and `last_name` attributes and you want to group all users by genders you can do something like the ...
[ "def", "do_groupby", "(", "environment", ",", "value", ",", "attribute", ")", ":", "expr", "=", "make_attrgetter", "(", "environment", ",", "attribute", ")", "return", "[", "_GroupTuple", "(", "key", ",", "list", "(", "values", ")", ")", "for", "key", ",...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/v8/third_party/jinja2/filters.py#L812-L852
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py3/prompt_toolkit/key_binding/bindings/search.py
python
_previous_buffer_is_returnable
()
return bool(prev_control and prev_control.buffer.is_returnable)
True if the previously focused buffer has a return handler.
True if the previously focused buffer has a return handler.
[ "True", "if", "the", "previously", "focused", "buffer", "has", "a", "return", "handler", "." ]
def _previous_buffer_is_returnable() -> bool: """ True if the previously focused buffer has a return handler. """ prev_control = get_app().layout.search_target_buffer_control return bool(prev_control and prev_control.buffer.is_returnable)
[ "def", "_previous_buffer_is_returnable", "(", ")", "->", "bool", ":", "prev_control", "=", "get_app", "(", ")", ".", "layout", ".", "search_target_buffer_control", "return", "bool", "(", "prev_control", "and", "prev_control", ".", "buffer", ".", "is_returnable", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/key_binding/bindings/search.py#L79-L84
bareos/bareos
56a10bb368b0a81e977bb51304033fe49d59efb0
python-bareos/bareos/bsock/lowlevel.py
python
LowLevel.call
(self, command)
return self._send_a_command_and_receive_result(command)
Call a Bareos command. Args: command (str or list): Command to execute. Best provided as a list. Returns: bytes: Result received from the Daemon.
Call a Bareos command.
[ "Call", "a", "Bareos", "command", "." ]
def call(self, command): """Call a Bareos command. Args: command (str or list): Command to execute. Best provided as a list. Returns: bytes: Result received from the Daemon. """ if isinstance(command, list): command = " ".join(command) ...
[ "def", "call", "(", "self", ",", "command", ")", ":", "if", "isinstance", "(", "command", ",", "list", ")", ":", "command", "=", "\" \"", ".", "join", "(", "command", ")", "return", "self", ".", "_send_a_command_and_receive_result", "(", "command", ")" ]
https://github.com/bareos/bareos/blob/56a10bb368b0a81e977bb51304033fe49d59efb0/python-bareos/bareos/bsock/lowlevel.py#L390-L401
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mailbox.py
python
_PartialFile.tell
(self)
return _ProxyFile.tell(self) - self._start
Return the position with respect to start.
Return the position with respect to start.
[ "Return", "the", "position", "with", "respect", "to", "start", "." ]
def tell(self): """Return the position with respect to start.""" return _ProxyFile.tell(self) - self._start
[ "def", "tell", "(", "self", ")", ":", "return", "_ProxyFile", ".", "tell", "(", "self", ")", "-", "self", ".", "_start" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mailbox.py#L1931-L1933
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/factory.py
python
Factory.get_wheel_cache_entry
(self, link, name)
return self._wheel_cache.get_cache_entry( link=link, package_name=name, supported_tags=get_supported(), )
Look up the link in the wheel cache. If ``preparer.require_hashes`` is True, don't use the wheel cache, because cached wheels, always built locally, have different hashes than the files downloaded from the index server and thus throw false hash mismatches. Furthermore, cached wheels at ...
Look up the link in the wheel cache.
[ "Look", "up", "the", "link", "in", "the", "wheel", "cache", "." ]
def get_wheel_cache_entry(self, link, name): # type: (Link, Optional[str]) -> Optional[CacheEntry] """Look up the link in the wheel cache. If ``preparer.require_hashes`` is True, don't use the wheel cache, because cached wheels, always built locally, have different hashes than t...
[ "def", "get_wheel_cache_entry", "(", "self", ",", "link", ",", "name", ")", ":", "# type: (Link, Optional[str]) -> Optional[CacheEntry]", "if", "self", ".", "_wheel_cache", "is", "None", "or", "self", ".", "preparer", ".", "require_hashes", ":", "return", "None", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/factory.py#L340-L356
digibyte/digibyte
0b8a04fb06d5470a15168e2f675aec57bcc24dac
contrib/devtools/update-translations.py
python
remove_invalid_characters
(s)
return FIX_RE.sub(b'', s)
Remove invalid characters from translation string
Remove invalid characters from translation string
[ "Remove", "invalid", "characters", "from", "translation", "string" ]
def remove_invalid_characters(s): '''Remove invalid characters from translation string''' return FIX_RE.sub(b'', s)
[ "def", "remove_invalid_characters", "(", "s", ")", ":", "return", "FIX_RE", ".", "sub", "(", "b''", ",", "s", ")" ]
https://github.com/digibyte/digibyte/blob/0b8a04fb06d5470a15168e2f675aec57bcc24dac/contrib/devtools/update-translations.py#L114-L116
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tix.py
python
Grid.delete_row
(self, from_, to=None)
Delete rows between from_ and to inclusive. If to is not provided, delete only row at from_
Delete rows between from_ and to inclusive. If to is not provided, delete only row at from_
[ "Delete", "rows", "between", "from_", "and", "to", "inclusive", ".", "If", "to", "is", "not", "provided", "delete", "only", "row", "at", "from_" ]
def delete_row(self, from_, to=None): """Delete rows between from_ and to inclusive. If to is not provided, delete only row at from_""" if to is None: self.tk.call(self, 'delete', 'row', from_) else: self.tk.call(self, 'delete', 'row', from_, to)
[ "def", "delete_row", "(", "self", ",", "from_", ",", "to", "=", "None", ")", ":", "if", "to", "is", "None", ":", "self", ".", "tk", ".", "call", "(", "self", ",", "'delete'", ",", "'row'", ",", "from_", ")", "else", ":", "self", ".", "tk", ".",...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tix.py#L1830-L1836
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py
python
MainWindow._get_lattice_parameters
(self)
return True, (a, b, c, alpha, beta, gamma)
Get lattice parameters from GUI :return: (Boolean, Object). True, 6-tuple as a, b, c, alpha, beta, gamm False: error message
Get lattice parameters from GUI :return: (Boolean, Object). True, 6-tuple as a, b, c, alpha, beta, gamm False: error message
[ "Get", "lattice", "parameters", "from", "GUI", ":", "return", ":", "(", "Boolean", "Object", ")", ".", "True", "6", "-", "tuple", "as", "a", "b", "c", "alpha", "beta", "gamm", "False", ":", "error", "message" ]
def _get_lattice_parameters(self): """ Get lattice parameters from GUI :return: (Boolean, Object). True, 6-tuple as a, b, c, alpha, beta, gamm False: error message """ status, ret_list = gutil.parse_float_editors([self.ui.lineEdit_a, ...
[ "def", "_get_lattice_parameters", "(", "self", ")", ":", "status", ",", "ret_list", "=", "gutil", ".", "parse_float_editors", "(", "[", "self", ".", "ui", ".", "lineEdit_a", ",", "self", ".", "ui", ".", "lineEdit_b", ",", "self", ".", "ui", ".", "lineEdi...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py#L3900-L3919
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/propgrid.py
python
PropertyGrid.GetPropertyRect
(*args, **kwargs)
return _propgrid.PropertyGrid_GetPropertyRect(*args, **kwargs)
GetPropertyRect(self, PGProperty p1, PGProperty p2) -> Rect
GetPropertyRect(self, PGProperty p1, PGProperty p2) -> Rect
[ "GetPropertyRect", "(", "self", "PGProperty", "p1", "PGProperty", "p2", ")", "-", ">", "Rect" ]
def GetPropertyRect(*args, **kwargs): """GetPropertyRect(self, PGProperty p1, PGProperty p2) -> Rect""" return _propgrid.PropertyGrid_GetPropertyRect(*args, **kwargs)
[ "def", "GetPropertyRect", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGrid_GetPropertyRect", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L2375-L2377
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/catapult_build/js_checks.py
python
_ErrorHighlight
(start, length)
return start * ' ' + length * '^'
Produces a row of '^'s to underline part of a string.
Produces a row of '^'s to underline part of a string.
[ "Produces", "a", "row", "of", "^", "s", "to", "underline", "part", "of", "a", "string", "." ]
def _ErrorHighlight(start, length): """Produces a row of '^'s to underline part of a string.""" return start * ' ' + length * '^'
[ "def", "_ErrorHighlight", "(", "start", ",", "length", ")", ":", "return", "start", "*", "' '", "+", "length", "*", "'^'" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/catapult_build/js_checks.py#L186-L188
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
TimeSpan.GetHours
(*args, **kwargs)
return _misc_.TimeSpan_GetHours(*args, **kwargs)
GetHours(self) -> int
GetHours(self) -> int
[ "GetHours", "(", "self", ")", "-", ">", "int" ]
def GetHours(*args, **kwargs): """GetHours(self) -> int""" return _misc_.TimeSpan_GetHours(*args, **kwargs)
[ "def", "GetHours", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "TimeSpan_GetHours", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L4522-L4524