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
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/toolkits/graph_analytics/connected_components.py
python
create
(graph, verbose=True)
return ConnectedComponentsModel(params["model"])
Compute the number of weakly connected components in the graph. Return a model object with total number of weakly connected components as well as the component ID for each vertex in the graph. Parameters ---------- graph : SGraph The graph on which to compute the triangle counts. verbo...
Compute the number of weakly connected components in the graph. Return a model object with total number of weakly connected components as well as the component ID for each vertex in the graph.
[ "Compute", "the", "number", "of", "weakly", "connected", "components", "in", "the", "graph", ".", "Return", "a", "model", "object", "with", "total", "number", "of", "weakly", "connected", "components", "as", "well", "as", "the", "component", "ID", "for", "ea...
def create(graph, verbose=True): """ Compute the number of weakly connected components in the graph. Return a model object with total number of weakly connected components as well as the component ID for each vertex in the graph. Parameters ---------- graph : SGraph The graph on whi...
[ "def", "create", "(", "graph", ",", "verbose", "=", "True", ")", ":", "from", "turicreate", ".", "_cython", ".", "cy_server", "import", "QuietProgress", "if", "not", "isinstance", "(", "graph", ",", "_SGraph", ")", ":", "raise", "TypeError", "(", "'\"graph...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/graph_analytics/connected_components.py#L77-L141
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/base_events.py
python
BaseEventLoop.stop
(self)
Stop running the event loop. Every callback already scheduled will still run. This simply informs run_forever to stop looping after a complete iteration.
Stop running the event loop.
[ "Stop", "running", "the", "event", "loop", "." ]
def stop(self): """Stop running the event loop. Every callback already scheduled will still run. This simply informs run_forever to stop looping after a complete iteration. """ self._stopping = True
[ "def", "stop", "(", "self", ")", ":", "self", ".", "_stopping", "=", "True" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/base_events.py#L589-L595
Manu343726/siplasplas
9fae7559f87087cf8ef34f04bd1e774b84b2ea9c
reference/cindex.py
python
Cursor.raw_comment
(self)
return conf.lib.clang_Cursor_getRawCommentText(self)
Returns the raw comment text associated with that Cursor
Returns the raw comment text associated with that Cursor
[ "Returns", "the", "raw", "comment", "text", "associated", "with", "that", "Cursor" ]
def raw_comment(self): """Returns the raw comment text associated with that Cursor""" return conf.lib.clang_Cursor_getRawCommentText(self)
[ "def", "raw_comment", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_Cursor_getRawCommentText", "(", "self", ")" ]
https://github.com/Manu343726/siplasplas/blob/9fae7559f87087cf8ef34f04bd1e774b84b2ea9c/reference/cindex.py#L1468-L1470
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
demo/DPU-for-RNN/rnnt_asr_vck5000/model_rnnt.py
python
label_collate
(labels)
return labels
Collates the label inputs for the rnn-t prediction network. If `labels` is already in torch.Tensor form this is a no-op. Args: labels: A torch.Tensor List of label indexes or a torch.Tensor. Returns: A padded torch.Tensor of shape (batch, max_seq_len).
Collates the label inputs for the rnn-t prediction network.
[ "Collates", "the", "label", "inputs", "for", "the", "rnn", "-", "t", "prediction", "network", "." ]
def label_collate(labels): """Collates the label inputs for the rnn-t prediction network. If `labels` is already in torch.Tensor form this is a no-op. Args: labels: A torch.Tensor List of label indexes or a torch.Tensor. Returns: A padded torch.Tensor of shape (batch, max_seq_len). ...
[ "def", "label_collate", "(", "labels", ")", ":", "if", "isinstance", "(", "labels", ",", "torch", ".", "Tensor", ")", ":", "return", "labels", ".", "type", "(", "torch", ".", "int64", ")", "if", "not", "isinstance", "(", "labels", ",", "(", "list", "...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/demo/DPU-for-RNN/rnnt_asr_vck5000/model_rnnt.py#L297-L324
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/cubecolourdialog.py
python
BasePyControl.OnSize
(self, event)
Handles the ``wx.EVT_SIZE`` for :class:`BasePyControl`. :param `event`: a :class:`SizeEvent` event to be processed.
Handles the ``wx.EVT_SIZE`` for :class:`BasePyControl`.
[ "Handles", "the", "wx", ".", "EVT_SIZE", "for", ":", "class", ":", "BasePyControl", "." ]
def OnSize(self, event): """ Handles the ``wx.EVT_SIZE`` for :class:`BasePyControl`. :param `event`: a :class:`SizeEvent` event to be processed. """ self.Refresh()
[ "def", "OnSize", "(", "self", ",", "event", ")", ":", "self", ".", "Refresh", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/cubecolourdialog.py#L1772-L1779
tensorflow/deepmath
b5b721f54de1d5d6a02d78f5da5995237f9995f9
deepmath/treegen/arith_model.py
python
ArithmeticRecursiveGenerativeModel.build_expr_downward
(self, loom_input, expr, embedding)
Call SplitLoomOp and WhichLoomOp downward on `expr` recursively. Args: loom_input: LoomInput object that we'll use for calling LoomOps. expr: The expression which we want the model to produce. embedding: A LoomResult containing the contextual embedding for the generation of `expr`.
Call SplitLoomOp and WhichLoomOp downward on `expr` recursively.
[ "Call", "SplitLoomOp", "and", "WhichLoomOp", "downward", "on", "expr", "recursively", "." ]
def build_expr_downward(self, loom_input, expr, embedding): """Call SplitLoomOp and WhichLoomOp downward on `expr` recursively. Args: loom_input: LoomInput object that we'll use for calling LoomOps. expr: The expression which we want the model to produce. embedding: A LoomResult containing th...
[ "def", "build_expr_downward", "(", "self", ",", "loom_input", ",", "expr", ",", "embedding", ")", ":", "# 'plus', 'minus', 'number', 0-9", "term_type", "=", "expr", "[", "0", "]", "# The output of this is put through a softmax to determine", "# the term_type. During training,...
https://github.com/tensorflow/deepmath/blob/b5b721f54de1d5d6a02d78f5da5995237f9995f9/deepmath/treegen/arith_model.py#L181-L205
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/math_grad.py
python
_MinOrMaxGrad
(op, grad)
return [math_ops.divide(indicators, num_selected) * grad, None]
Gradient for Min or Max. Amazingly it's precisely the same code.
Gradient for Min or Max. Amazingly it's precisely the same code.
[ "Gradient", "for", "Min", "or", "Max", ".", "Amazingly", "it", "s", "precisely", "the", "same", "code", "." ]
def _MinOrMaxGrad(op, grad): """Gradient for Min or Max. Amazingly it's precisely the same code.""" input_shape = array_ops.shape(op.inputs[0]) output_shape_kept_dims = math_ops.reduced_shape(input_shape, op.inputs[1]) y = op.outputs[0] y = array_ops.reshape(y, output_shape_kept_dims) grad = array_ops.resha...
[ "def", "_MinOrMaxGrad", "(", "op", ",", "grad", ")", ":", "input_shape", "=", "array_ops", ".", "shape", "(", "op", ".", "inputs", "[", "0", "]", ")", "output_shape_kept_dims", "=", "math_ops", ".", "reduced_shape", "(", "input_shape", ",", "op", ".", "i...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/math_grad.py#L205-L220
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/tools/inspector_protocol/jinja2/bccache.py
python
BytecodeCache.get_source_checksum
(self, source)
return sha1(source.encode('utf-8')).hexdigest()
Returns a checksum for the source.
Returns a checksum for the source.
[ "Returns", "a", "checksum", "for", "the", "source", "." ]
def get_source_checksum(self, source): """Returns a checksum for the source.""" return sha1(source.encode('utf-8')).hexdigest()
[ "def", "get_source_checksum", "(", "self", ",", "source", ")", ":", "return", "sha1", "(", "source", ".", "encode", "(", "'utf-8'", ")", ")", ".", "hexdigest", "(", ")" ]
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/inspector_protocol/jinja2/bccache.py#L176-L178
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/SCD_Reduction/ICCFitTools.py
python
getTOFWS
(box, flightPath, scatteringHalfAngle, tofPeak, peak, qMask, zBG=-1.0, dtSpread=0.02, minFracPixels=0.005, workspaceNumber=None, neigh_length_m=0, pp_lambda=None, calc_pp_lambda=False, padeCoefficients=None, pplmin_frac=0.8, pplmax_frac=1.5, peakMaskSize=5, mindtBinWidth=1, maxdtB...
return tofWS, float(pp_lambda)
Builds a TOF profile from the data in box which is nominally centered around a peak. Input: box - in a binned MD box. flightPath - L1+L2 (units: m) scatteringHalfAngle - the scattering half angle (units: rad) tofPeak - the nominal TOF of the peak (units: us) peak - the IPeak ...
Builds a TOF profile from the data in box which is nominally centered around a peak. Input: box - in a binned MD box. flightPath - L1+L2 (units: m) scatteringHalfAngle - the scattering half angle (units: rad) tofPeak - the nominal TOF of the peak (units: us) peak - the IPeak ...
[ "Builds", "a", "TOF", "profile", "from", "the", "data", "in", "box", "which", "is", "nominally", "centered", "around", "a", "peak", ".", "Input", ":", "box", "-", "in", "a", "binned", "MD", "box", ".", "flightPath", "-", "L1", "+", "L2", "(", "units"...
def getTOFWS(box, flightPath, scatteringHalfAngle, tofPeak, peak, qMask, zBG=-1.0, dtSpread=0.02, minFracPixels=0.005, workspaceNumber=None, neigh_length_m=0, pp_lambda=None, calc_pp_lambda=False, padeCoefficients=None, pplmin_frac=0.8, pplmax_frac=1.5, peakMaskSize=5, mindtBinWid...
[ "def", "getTOFWS", "(", "box", ",", "flightPath", ",", "scatteringHalfAngle", ",", "tofPeak", ",", "peak", ",", "qMask", ",", "zBG", "=", "-", "1.0", ",", "dtSpread", "=", "0.02", ",", "minFracPixels", "=", "0.005", ",", "workspaceNumber", "=", "None", "...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SCD_Reduction/ICCFitTools.py#L559-L664
rodeofx/OpenWalter
6116fbe3f04f1146c854afbfbdbe944feaee647e
walter/maya/scripts/walterPanel/walterOutliner.py
python
OutlinerTreeView.__init__
(self, traverser, parent=None)
Called after the instance has been created.
Called after the instance has been created.
[ "Called", "after", "the", "instance", "has", "been", "created", "." ]
def __init__(self, traverser, parent=None): """Called after the instance has been created.""" super(OutlinerTreeView, self).__init__(parent) self.traverser = traverser self.layer = self.traverser.currentLayer() # Set the custom tree model model = TreeModel(self, self.tra...
[ "def", "__init__", "(", "self", ",", "traverser", ",", "parent", "=", "None", ")", ":", "super", "(", "OutlinerTreeView", ",", "self", ")", ".", "__init__", "(", "parent", ")", "self", ".", "traverser", "=", "traverser", "self", ".", "layer", "=", "sel...
https://github.com/rodeofx/OpenWalter/blob/6116fbe3f04f1146c854afbfbdbe944feaee647e/walter/maya/scripts/walterPanel/walterOutliner.py#L63-L97
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/re.py
python
search
(pattern, string, flags=0)
return _compile(pattern, flags).search(string)
Scan through string looking for a match to the pattern, returning a match object, or None if no match was found.
Scan through string looking for a match to the pattern, returning a match object, or None if no match was found.
[ "Scan", "through", "string", "looking", "for", "a", "match", "to", "the", "pattern", "returning", "a", "match", "object", "or", "None", "if", "no", "match", "was", "found", "." ]
def search(pattern, string, flags=0): """Scan through string looking for a match to the pattern, returning a match object, or None if no match was found.""" return _compile(pattern, flags).search(string)
[ "def", "search", "(", "pattern", ",", "string", ",", "flags", "=", "0", ")", ":", "return", "_compile", "(", "pattern", ",", "flags", ")", ".", "search", "(", "string", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/re.py#L139-L142
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/securetransport.py
python
WrappedSocket._set_ciphers
(self)
Sets up the allowed ciphers. By default this matches the set in util.ssl_.DEFAULT_CIPHERS, at least as supported by macOS. This is done custom and doesn't allow changing at this time, mostly because parsing OpenSSL cipher strings is going to be a freaking nightmare.
Sets up the allowed ciphers. By default this matches the set in util.ssl_.DEFAULT_CIPHERS, at least as supported by macOS. This is done custom and doesn't allow changing at this time, mostly because parsing OpenSSL cipher strings is going to be a freaking nightmare.
[ "Sets", "up", "the", "allowed", "ciphers", ".", "By", "default", "this", "matches", "the", "set", "in", "util", ".", "ssl_", ".", "DEFAULT_CIPHERS", "at", "least", "as", "supported", "by", "macOS", ".", "This", "is", "done", "custom", "and", "doesn", "t"...
def _set_ciphers(self): """ Sets up the allowed ciphers. By default this matches the set in util.ssl_.DEFAULT_CIPHERS, at least as supported by macOS. This is done custom and doesn't allow changing at this time, mostly because parsing OpenSSL cipher strings is going to be a freak...
[ "def", "_set_ciphers", "(", "self", ")", ":", "ciphers", "=", "(", "Security", ".", "SSLCipherSuite", "*", "len", "(", "CIPHER_SUITES", ")", ")", "(", "*", "CIPHER_SUITES", ")", "result", "=", "Security", ".", "SSLSetEnabledCiphers", "(", "self", ".", "con...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/securetransport.py#L371-L382
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/robotsim.py
python
RobotModelLink.getTransform
(self)
return _robotsim.RobotModelLink_getTransform(self)
r""" Gets the link's current transformation (R,t) to the world frame. Returns: se3 object: a pair (R,t), with R a 9-list and t a 3-list of floats.
r""" Gets the link's current transformation (R,t) to the world frame.
[ "r", "Gets", "the", "link", "s", "current", "transformation", "(", "R", "t", ")", "to", "the", "world", "frame", "." ]
def getTransform(self) ->None: r""" Gets the link's current transformation (R,t) to the world frame. Returns: se3 object: a pair (R,t), with R a 9-list and t a 3-list of floats. """ return _robotsim.RobotModelLink_getTransform(self)
[ "def", "getTransform", "(", "self", ")", "->", "None", ":", "return", "_robotsim", ".", "RobotModelLink_getTransform", "(", "self", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L4138-L4148
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
FontPickerEvent.SetFont
(*args, **kwargs)
return _controls_.FontPickerEvent_SetFont(*args, **kwargs)
SetFont(self, Font c)
SetFont(self, Font c)
[ "SetFont", "(", "self", "Font", "c", ")" ]
def SetFont(*args, **kwargs): """SetFont(self, Font c)""" return _controls_.FontPickerEvent_SetFont(*args, **kwargs)
[ "def", "SetFont", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "FontPickerEvent_SetFont", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L7288-L7290
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_windows.py
python
PyScrolledWindow.DoSetClientSize
(*args, **kwargs)
return _windows_.PyScrolledWindow_DoSetClientSize(*args, **kwargs)
DoSetClientSize(self, int width, int height)
DoSetClientSize(self, int width, int height)
[ "DoSetClientSize", "(", "self", "int", "width", "int", "height", ")" ]
def DoSetClientSize(*args, **kwargs): """DoSetClientSize(self, int width, int height)""" return _windows_.PyScrolledWindow_DoSetClientSize(*args, **kwargs)
[ "def", "DoSetClientSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "PyScrolledWindow_DoSetClientSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L4520-L4522
nlohmann/json
eb2182414749825be086c825edb5229e5c28503d
third_party/cpplint/cpplint.py
python
FileInfo.Split
(self)
return (project,) + os.path.splitext(rest)
Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension).
Splits the file into the directory, basename, and extension.
[ "Splits", "the", "file", "into", "the", "directory", "basename", "and", "extension", "." ]
def Split(self): """Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension). """ googlename = self.RepositoryName() project, rest = os...
[ "def", "Split", "(", "self", ")", ":", "googlename", "=", "self", ".", "RepositoryName", "(", ")", "project", ",", "rest", "=", "os", ".", "path", ".", "split", "(", "googlename", ")", "return", "(", "project", ",", ")", "+", "os", ".", "path", "."...
https://github.com/nlohmann/json/blob/eb2182414749825be086c825edb5229e5c28503d/third_party/cpplint/cpplint.py#L1624-L1636
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/numpy_support.py
python
select_array_wrapper
(inputs)
return selected_index
Given the array-compatible input types to an operation (e.g. ufunc), select the appropriate input for wrapping the operation output, according to each input's __array_priority__. An index into *inputs* is returned.
Given the array-compatible input types to an operation (e.g. ufunc), select the appropriate input for wrapping the operation output, according to each input's __array_priority__.
[ "Given", "the", "array", "-", "compatible", "input", "types", "to", "an", "operation", "(", "e", ".", "g", ".", "ufunc", ")", "select", "the", "appropriate", "input", "for", "wrapping", "the", "operation", "output", "according", "to", "each", "input", "s",...
def select_array_wrapper(inputs): """ Given the array-compatible input types to an operation (e.g. ufunc), select the appropriate input for wrapping the operation output, according to each input's __array_priority__. An index into *inputs* is returned. """ max_prio = float('-inf') selec...
[ "def", "select_array_wrapper", "(", "inputs", ")", ":", "max_prio", "=", "float", "(", "'-inf'", ")", "selected_index", "=", "None", "for", "index", ",", "ty", "in", "enumerate", "(", "inputs", ")", ":", "# Ties are broken by choosing the first winner, as in Numpy",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/numpy_support.py#L229-L247
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/io/matlab/mio4.py
python
MatFile4Reader.initialize_read
(self)
Run when beginning read of variables Sets up readers from parameters in `self`
Run when beginning read of variables
[ "Run", "when", "beginning", "read", "of", "variables" ]
def initialize_read(self): ''' Run when beginning read of variables Sets up readers from parameters in `self` ''' self.dtypes = convert_dtypes(mdtypes_template, self.byte_order) self._matrix_reader = VarReader4(self)
[ "def", "initialize_read", "(", "self", ")", ":", "self", ".", "dtypes", "=", "convert_dtypes", "(", "mdtypes_template", ",", "self", ".", "byte_order", ")", "self", ".", "_matrix_reader", "=", "VarReader4", "(", "self", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/io/matlab/mio4.py#L328-L334
microsoft/onnxruntime
f92e47e95b13a240e37caf7b36577983544f98fc
tools/python/util/ort_format_model/operator_type_usage_processors.py
python
OperatorTypeUsageManager.process_node
(self, node: fbs.Node, value_name_to_typeinfo: dict)
Process a Node and record info on the types used. :param node: Node from ORT format model :param value_name_to_typeinfo: Map of value names to TypeInfo instances
Process a Node and record info on the types used. :param node: Node from ORT format model :param value_name_to_typeinfo: Map of value names to TypeInfo instances
[ "Process", "a", "Node", "and", "record", "info", "on", "the", "types", "used", ".", ":", "param", "node", ":", "Node", "from", "ORT", "format", "model", ":", "param", "value_name_to_typeinfo", ":", "Map", "of", "value", "names", "to", "TypeInfo", "instance...
def process_node(self, node: fbs.Node, value_name_to_typeinfo: dict): ''' Process a Node and record info on the types used. :param node: Node from ORT format model :param value_name_to_typeinfo: Map of value names to TypeInfo instances ''' optype = node.OpType().decode() ...
[ "def", "process_node", "(", "self", ",", "node", ":", "fbs", ".", "Node", ",", "value_name_to_typeinfo", ":", "dict", ")", ":", "optype", "=", "node", ".", "OpType", "(", ")", ".", "decode", "(", ")", "domain", "=", "node", ".", "Domain", "(", ")", ...
https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/tools/python/util/ort_format_model/operator_type_usage_processors.py#L474-L486
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/linalg_grad.py
python
_MatmulExtractingThreeDiagonals
(x, y_tr)
return array_ops.stack([superdiag, diag, subdiag], axis=-2)
Multiplies matrices and extracts three diagonals from the product. With sizes M x K and K x M, this function takes O(MK) time and O(M) space, while using math_ops.matmul, and then extracting the diagonals would take O(M^2 K) time and O(M^2) space. Args: x: first matrix y_tr: second matrix transposed ...
Multiplies matrices and extracts three diagonals from the product.
[ "Multiplies", "matrices", "and", "extracts", "three", "diagonals", "from", "the", "product", "." ]
def _MatmulExtractingThreeDiagonals(x, y_tr): """Multiplies matrices and extracts three diagonals from the product. With sizes M x K and K x M, this function takes O(MK) time and O(M) space, while using math_ops.matmul, and then extracting the diagonals would take O(M^2 K) time and O(M^2) space. Args: x...
[ "def", "_MatmulExtractingThreeDiagonals", "(", "x", ",", "y_tr", ")", ":", "diag", "=", "math_ops", ".", "reduce_sum", "(", "x", "*", "y_tr", ",", "axis", "=", "-", "1", ")", "if", "y_tr", ".", "shape", ".", "is_fully_defined", "(", ")", ":", "zeros", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/linalg_grad.py#L558-L594
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
uCSIsCatC
(code)
return ret
Check whether the character is part of C UCS Category
Check whether the character is part of C UCS Category
[ "Check", "whether", "the", "character", "is", "part", "of", "C", "UCS", "Category" ]
def uCSIsCatC(code): """Check whether the character is part of C UCS Category """ ret = libxml2mod.xmlUCSIsCatC(code) return ret
[ "def", "uCSIsCatC", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsCatC", "(", "code", ")", "return", "ret" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L2246-L2249
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py
python
IMetadataProvider.metadata_listdir
(name)
List of metadata names in the directory (like ``os.listdir()``)
List of metadata names in the directory (like ``os.listdir()``)
[ "List", "of", "metadata", "names", "in", "the", "directory", "(", "like", "os", ".", "listdir", "()", ")" ]
def metadata_listdir(name): """List of metadata names in the directory (like ``os.listdir()``)"""
[ "def", "metadata_listdir", "(", "name", ")", ":" ]
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py#L568-L569
epam/Indigo
30e40b4b1eb9bae0207435a26cfcb81ddcc42be1
api/python/indigo/__init__.py
python
IndigoObject.setSGroupDescription
(self, description)
return self.dispatcher._checkResult( Indigo._lib.indigoSetSGroupDescription( self.id, description.encode(ENCODE_ENCODING) ) )
SGroup method sets description Args: description (str): description string Returns: int: 1 if there are no errors
SGroup method sets description
[ "SGroup", "method", "sets", "description" ]
def setSGroupDescription(self, description): """SGroup method sets description Args: description (str): description string Returns: int: 1 if there are no errors """ self.dispatcher._setSessionId() return self.dispatcher._checkResult( ...
[ "def", "setSGroupDescription", "(", "self", ",", "description", ")", ":", "self", ".", "dispatcher", ".", "_setSessionId", "(", ")", "return", "self", ".", "dispatcher", ".", "_checkResult", "(", "Indigo", ".", "_lib", ".", "indigoSetSGroupDescription", "(", "...
https://github.com/epam/Indigo/blob/30e40b4b1eb9bae0207435a26cfcb81ddcc42be1/api/python/indigo/__init__.py#L1673-L1687
weichengkuo/DeepBox
c4f8c065b6a51cf296540cc453a44f0519aaacc9
caffe-fast-rcnn/scripts/cpp_lint.py
python
CheckPosixThreading
(filename, clean_lines, linenum, error)
Checks for calls to thread-unsafe functions. Much code has been originally written without consideration of multi-threading. Also, engineers are relying on their old experience; they have learned posix before threading extensions were added. These tests guide the engineers to use thread-safe functions (when us...
Checks for calls to thread-unsafe functions.
[ "Checks", "for", "calls", "to", "thread", "-", "unsafe", "functions", "." ]
def CheckPosixThreading(filename, clean_lines, linenum, error): """Checks for calls to thread-unsafe functions. Much code has been originally written without consideration of multi-threading. Also, engineers are relying on their old experience; they have learned posix before threading extensions were added. Th...
[ "def", "CheckPosixThreading", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "for", "single_thread_function", ",", "multithread_safe_function", "in", "threading_list", ":...
https://github.com/weichengkuo/DeepBox/blob/c4f8c065b6a51cf296540cc453a44f0519aaacc9/caffe-fast-rcnn/scripts/cpp_lint.py#L1681-L1705
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
chrome/common/extensions/docs/server2/servlet.py
python
Response.AddHeaders
(self, headers)
Adds several headers to the response.
Adds several headers to the response.
[ "Adds", "several", "headers", "to", "the", "response", "." ]
def AddHeaders(self, headers): '''Adds several headers to the response. ''' self.headers.update(headers)
[ "def", "AddHeaders", "(", "self", ",", "headers", ")", ":", "self", ".", "headers", ".", "update", "(", "headers", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/chrome/common/extensions/docs/server2/servlet.py#L95-L98
apiaryio/drafter
4634ebd07f6c6f257cc656598ccd535492fdfb55
tools/gyp/pylib/gyp/MSVSProject.py
python
Tool.__init__
(self, name, attrs=None)
Initializes the tool. Args: name: Tool name. attrs: Dict of tool attributes; may be None.
Initializes the tool.
[ "Initializes", "the", "tool", "." ]
def __init__(self, name, attrs=None): """Initializes the tool. Args: name: Tool name. attrs: Dict of tool attributes; may be None. """ self._attrs = attrs or {} self._attrs['Name'] = name
[ "def", "__init__", "(", "self", ",", "name", ",", "attrs", "=", "None", ")", ":", "self", ".", "_attrs", "=", "attrs", "or", "{", "}", "self", ".", "_attrs", "[", "'Name'", "]", "=", "name" ]
https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/MSVSProject.py#L16-L24
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/count-odd-numbers-in-an-interval-range.py
python
Solution.countOdds
(self, low, high)
return (high+1)//2 - ((low-1)+1)//2
:type low: int :type high: int :rtype: int
:type low: int :type high: int :rtype: int
[ ":", "type", "low", ":", "int", ":", "type", "high", ":", "int", ":", "rtype", ":", "int" ]
def countOdds(self, low, high): """ :type low: int :type high: int :rtype: int """ return (high+1)//2 - ((low-1)+1)//2
[ "def", "countOdds", "(", "self", ",", "low", ",", "high", ")", ":", "return", "(", "high", "+", "1", ")", "//", "2", "-", "(", "(", "low", "-", "1", ")", "+", "1", ")", "//", "2" ]
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/count-odd-numbers-in-an-interval-range.py#L5-L11
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
CondCore/Utilities/python/conddblib.py
python
connect
(url, authPath=None, verbose=0, as_admin=False)
return Connection(url)
Returns a Connection instance to the CMS Condition DB. See database_help for the description of the database parameter. The verbosity level is as follows: 0 = No output (default). 1 = SQL statements issued, including their parameters. 2 = In addition, results of the queries (all rows ...
Returns a Connection instance to the CMS Condition DB.
[ "Returns", "a", "Connection", "instance", "to", "the", "CMS", "Condition", "DB", "." ]
def connect(url, authPath=None, verbose=0, as_admin=False): '''Returns a Connection instance to the CMS Condition DB. See database_help for the description of the database parameter. The verbosity level is as follows: 0 = No output (default). 1 = SQL statements issued, including their par...
[ "def", "connect", "(", "url", ",", "authPath", "=", "None", ",", "verbose", "=", "0", ",", "as_admin", "=", "False", ")", ":", "check_admin", "=", "as_admin", "if", "url", ".", "drivername", "==", "'oracle'", ":", "if", "url", ".", "username", "is", ...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/CondCore/Utilities/python/conddblib.py#L533-L606
nest/nest-simulator
f2623eb78518cdbd55e77e0ed486bf1111bcb62f
pynest/nest/lib/hl_api_parallel_computing.py
python
GetLocalVPs
()
return range(Rank(), n_vp, NumProcesses())
Return iterable representing the VPs local to the MPI rank.
Return iterable representing the VPs local to the MPI rank.
[ "Return", "iterable", "representing", "the", "VPs", "local", "to", "the", "MPI", "rank", "." ]
def GetLocalVPs(): """Return iterable representing the VPs local to the MPI rank. """ # Compute local VPs as range based on round-robin logic in # VPManager::get_vp(). mpitest_get_local_vps ensures this is in # sync with the kernel. n_vp = sli_func("GetKernelStatus /total_num_virtual_procs get"...
[ "def", "GetLocalVPs", "(", ")", ":", "# Compute local VPs as range based on round-robin logic in", "# VPManager::get_vp(). mpitest_get_local_vps ensures this is in", "# sync with the kernel.", "n_vp", "=", "sli_func", "(", "\"GetKernelStatus /total_num_virtual_procs get\"", ")", "return"...
https://github.com/nest/nest-simulator/blob/f2623eb78518cdbd55e77e0ed486bf1111bcb62f/pynest/nest/lib/hl_api_parallel_computing.py#L120-L128
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
IndividualLayoutConstraint.GetOtherWindow
(*args, **kwargs)
return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
GetOtherWindow(self) -> Window
GetOtherWindow(self) -> Window
[ "GetOtherWindow", "(", "self", ")", "-", ">", "Window" ]
def GetOtherWindow(*args, **kwargs): """GetOtherWindow(self) -> Window""" return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
[ "def", "GetOtherWindow", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "IndividualLayoutConstraint_GetOtherWindow", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L16224-L16226
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/syntax/synxml.py
python
Syntax.startElement
(self, name, attrs)
Parse the Syntax Xml
Parse the Syntax Xml
[ "Parse", "the", "Syntax", "Xml" ]
def startElement(self, name, attrs): """Parse the Syntax Xml""" if name == EXML_COMMENTPAT: val = attrs.get(EXML_VALUE, '') tmp = val.split() # Trailing space may be significant for some comments if len(tmp) == 1: comment = [val,] ...
[ "def", "startElement", "(", "self", ",", "name", ",", "attrs", ")", ":", "if", "name", "==", "EXML_COMMENTPAT", ":", "val", "=", "attrs", ".", "get", "(", "EXML_VALUE", ",", "''", ")", "tmp", "=", "val", ".", "split", "(", ")", "# Trailing space may be...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/syntax/synxml.py#L496-L521
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py
python
Pack.pack_configure
(self, cnf={}, **kw)
Pack a widget in the parent widget. Use as options: after=widget - pack it after you have packed widget anchor=NSEW (or subset) - position widget according to given direction before=widget - pack it before you will pack widget expand=bool - expand widget...
Pack a widget in the parent widget. Use as options: after=widget - pack it after you have packed widget anchor=NSEW (or subset) - position widget according to given direction before=widget - pack it before you will pack widget expand=bool - expand widget...
[ "Pack", "a", "widget", "in", "the", "parent", "widget", ".", "Use", "as", "options", ":", "after", "=", "widget", "-", "pack", "it", "after", "you", "have", "packed", "widget", "anchor", "=", "NSEW", "(", "or", "subset", ")", "-", "position", "widget",...
def pack_configure(self, cnf={}, **kw): """Pack a widget in the parent widget. Use as options: after=widget - pack it after you have packed widget anchor=NSEW (or subset) - position widget according to given direction before=widget - pack it before you w...
[ "def", "pack_configure", "(", "self", ",", "cnf", "=", "{", "}", ",", "*", "*", "kw", ")", ":", "self", ".", "tk", ".", "call", "(", "(", "'pack'", ",", "'configure'", ",", "self", ".", "_w", ")", "+", "self", ".", "_options", "(", "cnf", ",", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L2125-L2143
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/ndlstm/python/misc.py
python
one_hot_mask
(labels, num_classes, scope=None)
Compute 1-hot encodings for masks. Given a label image, this computes the one hot encoding at each pixel. Args: labels: (batch_size, width, height, 1) tensor containing labels. num_classes: number of classes scope: optional scope name Returns: Tensor of shape (batch_size, width, height, num_c...
Compute 1-hot encodings for masks.
[ "Compute", "1", "-", "hot", "encodings", "for", "masks", "." ]
def one_hot_mask(labels, num_classes, scope=None): """Compute 1-hot encodings for masks. Given a label image, this computes the one hot encoding at each pixel. Args: labels: (batch_size, width, height, 1) tensor containing labels. num_classes: number of classes scope: optional scope name Return...
[ "def", "one_hot_mask", "(", "labels", ",", "num_classes", ",", "scope", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "scope", ",", "\"OneHotMask\"", ",", "[", "labels", "]", ")", ":", "height", ",", "width", ",", "depth", "=", "_shape"...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/ndlstm/python/misc.py#L73-L99
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/toolkits/_feature_engineering/_autovectorizer.py
python
AutoVectorizer._setup
(self)
Sets stuff up.
Sets stuff up.
[ "Sets", "stuff", "up", "." ]
def _setup(self): """ Sets stuff up. """ self.__proxy__ = _PythonProxy()
[ "def", "_setup", "(", "self", ")", ":", "self", ".", "__proxy__", "=", "_PythonProxy", "(", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/_feature_engineering/_autovectorizer.py#L553-L557
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/signal/window_ops.py
python
hann_window
(window_length, periodic=True, dtype=dtypes.float32, name=None)
return _raised_cosine_window(name, 'hann_window', window_length, periodic, dtype, 0.5, 0.5)
Generate a [Hann window][hann]. Args: window_length: A scalar `Tensor` indicating the window length to generate. periodic: A bool `Tensor` indicating whether to generate a periodic or symmetric window. Periodic windows are typically used for spectral analysis while symmetric windows are typically...
Generate a [Hann window][hann].
[ "Generate", "a", "[", "Hann", "window", "]", "[", "hann", "]", "." ]
def hann_window(window_length, periodic=True, dtype=dtypes.float32, name=None): """Generate a [Hann window][hann]. Args: window_length: A scalar `Tensor` indicating the window length to generate. periodic: A bool `Tensor` indicating whether to generate a periodic or symmetric window. Periodic windows...
[ "def", "hann_window", "(", "window_length", ",", "periodic", "=", "True", ",", "dtype", "=", "dtypes", ".", "float32", ",", "name", "=", "None", ")", ":", "return", "_raised_cosine_window", "(", "name", ",", "'hann_window'", ",", "window_length", ",", "perio...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/signal/window_ops.py#L147-L168
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/distributions/python/ops/bijector.py
python
_Bijector.dtype
(self)
return self._dtype
dtype of `Tensor`s transformable by this distribution.
dtype of `Tensor`s transformable by this distribution.
[ "dtype", "of", "Tensor", "s", "transformable", "by", "this", "distribution", "." ]
def dtype(self): """dtype of `Tensor`s transformable by this distribution.""" return self._dtype
[ "def", "dtype", "(", "self", ")", ":", "return", "self", ".", "_dtype" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/distributions/python/ops/bijector.py#L230-L232
hunterlew/mstar_deeplearning_project
3761624dcbd7d44af257200542d13d1444dc634a
classification/caffe/build/Release/pycaffe/caffe/io.py
python
blobproto_to_array
(blob, return_diff=False)
Convert a blob proto to an array. In default, we will just return the data, unless return_diff is True, in which case we will return the diff.
Convert a blob proto to an array. In default, we will just return the data, unless return_diff is True, in which case we will return the diff.
[ "Convert", "a", "blob", "proto", "to", "an", "array", ".", "In", "default", "we", "will", "just", "return", "the", "data", "unless", "return_diff", "is", "True", "in", "which", "case", "we", "will", "return", "the", "diff", "." ]
def blobproto_to_array(blob, return_diff=False): """ Convert a blob proto to an array. In default, we will just return the data, unless return_diff is True, in which case we will return the diff. """ # Read the data into an array if return_diff: data = np.array(blob.diff) else: ...
[ "def", "blobproto_to_array", "(", "blob", ",", "return_diff", "=", "False", ")", ":", "# Read the data into an array", "if", "return_diff", ":", "data", "=", "np", ".", "array", "(", "blob", ".", "diff", ")", "else", ":", "data", "=", "np", ".", "array", ...
https://github.com/hunterlew/mstar_deeplearning_project/blob/3761624dcbd7d44af257200542d13d1444dc634a/classification/caffe/build/Release/pycaffe/caffe/io.py#L18-L34
lawy623/SVS
b7c7ae367c82a4797ff4a896a2ff304f02e7f724
caffe/python/caffe/io.py
python
oversample
(images, crop_dims)
return crops
Crop images into the four corners, center, and their mirrored versions. Parameters ---------- image : iterable of (H x W x K) ndarrays crop_dims : (height, width) tuple for the crops. Returns ------- crops : (10*N x H x W x K) ndarray of crops for number of inputs N.
Crop images into the four corners, center, and their mirrored versions.
[ "Crop", "images", "into", "the", "four", "corners", "center", "and", "their", "mirrored", "versions", "." ]
def oversample(images, crop_dims): """ Crop images into the four corners, center, and their mirrored versions. Parameters ---------- image : iterable of (H x W x K) ndarrays crop_dims : (height, width) tuple for the crops. Returns ------- crops : (10*N x H x W x K) ndarray of crops...
[ "def", "oversample", "(", "images", ",", "crop_dims", ")", ":", "# Dimensions and center.", "im_shape", "=", "np", ".", "array", "(", "images", "[", "0", "]", ".", "shape", ")", "crop_dims", "=", "np", ".", "array", "(", "crop_dims", ")", "im_center", "=...
https://github.com/lawy623/SVS/blob/b7c7ae367c82a4797ff4a896a2ff304f02e7f724/caffe/python/caffe/io.py#L341-L383
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SimulatedDensityOfStates.py
python
SimulatedDensityOfStates._parse_chemical_and_ws_name
(self, ion_name, isotope)
@param ion_name :: Name of the element used @param isotope :: Isotope of the element @return The chemical formula of the element and isotope expected by SetSampleMaterial AND The expected suffix for the partial workspace
[]
def _parse_chemical_and_ws_name(self, ion_name, isotope): """ @param ion_name :: Name of the element used @param isotope :: Isotope of the element @return The chemical formula of the element and isotope expected by SetSampleMaterial AND ...
[ "def", "_parse_chemical_and_ws_name", "(", "self", ",", "ion_name", ",", "isotope", ")", ":", "# Get the index of the element (if present)", "match", "=", "re", ".", "search", "(", "r'\\d'", ",", "ion_name", ")", "element_index", "=", "''", "if", "match", ":", "...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SimulatedDensityOfStates.py#L572-L599
linyouhappy/kongkongxiyou
7a69b2913eb29f4be77f9a62fb90cdd72c4160f1
cocosjs/frameworks/cocos2d-x/tools/bindings-generator/generator.py
python
Generator.in_listed_extend_classed
(self, class_name)
return False
returns True if the class is in the list of required classes that need to extend
returns True if the class is in the list of required classes that need to extend
[ "returns", "True", "if", "the", "class", "is", "in", "the", "list", "of", "required", "classes", "that", "need", "to", "extend" ]
def in_listed_extend_classed(self, class_name): """ returns True if the class is in the list of required classes that need to extend """ for key in self.classes_need_extend: md = re.match("^" + key + "$", class_name) if md: return True retu...
[ "def", "in_listed_extend_classed", "(", "self", ",", "class_name", ")", ":", "for", "key", "in", "self", ".", "classes_need_extend", ":", "md", "=", "re", ".", "match", "(", "\"^\"", "+", "key", "+", "\"$\"", ",", "class_name", ")", "if", "md", ":", "r...
https://github.com/linyouhappy/kongkongxiyou/blob/7a69b2913eb29f4be77f9a62fb90cdd72c4160f1/cocosjs/frameworks/cocos2d-x/tools/bindings-generator/generator.py#L1124-L1132
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/__init__.py
python
LoggerAdapter.error
(self, msg, *args, **kwargs)
Delegate an error call to the underlying logger, after adding contextual information from this adapter instance.
Delegate an error call to the underlying logger, after adding contextual information from this adapter instance.
[ "Delegate", "an", "error", "call", "to", "the", "underlying", "logger", "after", "adding", "contextual", "information", "from", "this", "adapter", "instance", "." ]
def error(self, msg, *args, **kwargs): """ Delegate an error call to the underlying logger, after adding contextual information from this adapter instance. """ msg, kwargs = self.process(msg, kwargs) self.logger.error(msg, *args, **kwargs)
[ "def", "error", "(", "self", ",", "msg", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "msg", ",", "kwargs", "=", "self", ".", "process", "(", "msg", ",", "kwargs", ")", "self", ".", "logger", ".", "error", "(", "msg", ",", "*", "args", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/__init__.py#L1440-L1446
microsoft/clang
86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5
bindings/python/clang/cindex.py
python
Diagnostic.disable_option
(self)
return _CXString.from_result(disable)
The command-line option that disables this diagnostic.
The command-line option that disables this diagnostic.
[ "The", "command", "-", "line", "option", "that", "disables", "this", "diagnostic", "." ]
def disable_option(self): """The command-line option that disables this diagnostic.""" disable = _CXString() conf.lib.clang_getDiagnosticOption(self, byref(disable)) return _CXString.from_result(disable)
[ "def", "disable_option", "(", "self", ")", ":", "disable", "=", "_CXString", "(", ")", "conf", ".", "lib", ".", "clang_getDiagnosticOption", "(", "self", ",", "byref", "(", "disable", ")", ")", "return", "_CXString", ".", "from_result", "(", "disable", ")"...
https://github.com/microsoft/clang/blob/86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5/bindings/python/clang/cindex.py#L461-L465
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/interpolate/_bsplines.py
python
_get_dtype
(dtype)
Return np.complex128 for complex dtypes, np.float64 otherwise.
Return np.complex128 for complex dtypes, np.float64 otherwise.
[ "Return", "np", ".", "complex128", "for", "complex", "dtypes", "np", ".", "float64", "otherwise", "." ]
def _get_dtype(dtype): """Return np.complex128 for complex dtypes, np.float64 otherwise.""" if np.issubdtype(dtype, np.complexfloating): return np.complex_ else: return np.float_
[ "def", "_get_dtype", "(", "dtype", ")", ":", "if", "np", ".", "issubdtype", "(", "dtype", ",", "np", ".", "complexfloating", ")", ":", "return", "np", ".", "complex_", "else", ":", "return", "np", ".", "float_" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/interpolate/_bsplines.py#L25-L30
rdiankov/openrave
d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7
python/ikfast_sympy0_6.py
python
IKFastSolver.solvePairVariablesHalfAngle
(self,raweqns,var0,var1,othersolvedvars,subs=None)
return [solution]
solves equations of two variables in sin and cos
solves equations of two variables in sin and cos
[ "solves", "equations", "of", "two", "variables", "in", "sin", "and", "cos" ]
def solvePairVariablesHalfAngle(self,raweqns,var0,var1,othersolvedvars,subs=None): """solves equations of two variables in sin and cos """ varsym0 = self.Variable(var0) varsym1 = self.Variable(var1) varsyms = [varsym0,varsym1] unknownvars=[varsym0.cvar,varsym0.svar,varsym...
[ "def", "solvePairVariablesHalfAngle", "(", "self", ",", "raweqns", ",", "var0", ",", "var1", ",", "othersolvedvars", ",", "subs", "=", "None", ")", ":", "varsym0", "=", "self", ".", "Variable", "(", "var0", ")", "varsym1", "=", "self", ".", "Variable", "...
https://github.com/rdiankov/openrave/blob/d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7/python/ikfast_sympy0_6.py#L4289-L4541
msitt/blpapi-python
bebcf43668c9e5f5467b1f685f9baebbfc45bc87
src/blpapi/auth.py
python
AuthUser.createWithLogonName
(cls)
return cls(handle)
Creates an :class:`AuthUser` instance configured for Operating System Login (Domain/User) authorization mode (OS_LOGON). Returns: AuthUser: Configured for Operating System Login (Domain/User) mode.
Creates an :class:`AuthUser` instance configured for Operating System Login (Domain/User) authorization mode (OS_LOGON).
[ "Creates", "an", ":", "class", ":", "AuthUser", "instance", "configured", "for", "Operating", "System", "Login", "(", "Domain", "/", "User", ")", "authorization", "mode", "(", "OS_LOGON", ")", "." ]
def createWithLogonName(cls): """Creates an :class:`AuthUser` instance configured for Operating System Login (Domain/User) authorization mode (OS_LOGON). Returns: AuthUser: Configured for Operating System Login (Domain/User) mode. """ retcode, handle = internals \ ...
[ "def", "createWithLogonName", "(", "cls", ")", ":", "retcode", ",", "handle", "=", "internals", ".", "blpapi_AuthUser_createWithLogonName", "(", ")", "_ExceptionUtil", ".", "raiseOnError", "(", "retcode", ")", "return", "cls", "(", "handle", ")" ]
https://github.com/msitt/blpapi-python/blob/bebcf43668c9e5f5467b1f685f9baebbfc45bc87/src/blpapi/auth.py#L143-L153
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_gdi.py
python
NativePixelData.GetPixels
(*args, **kwargs)
return _gdi_.NativePixelData_GetPixels(*args, **kwargs)
GetPixels(self) -> NativePixelData_Accessor
GetPixels(self) -> NativePixelData_Accessor
[ "GetPixels", "(", "self", ")", "-", ">", "NativePixelData_Accessor" ]
def GetPixels(*args, **kwargs): """GetPixels(self) -> NativePixelData_Accessor""" return _gdi_.NativePixelData_GetPixels(*args, **kwargs)
[ "def", "GetPixels", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "NativePixelData_GetPixels", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L1026-L1028
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/image/image.py
python
SequentialAug.__call__
(self, src)
return src
Augmenter body
Augmenter body
[ "Augmenter", "body" ]
def __call__(self, src): """Augmenter body""" for aug in self.ts: src = aug(src) return src
[ "def", "__call__", "(", "self", ",", "src", ")", ":", "for", "aug", "in", "self", ".", "ts", ":", "src", "=", "aug", "(", "src", ")", "return", "src" ]
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/image/image.py#L647-L651
albertz/openlierox
d316c14a8eb57848ef56e9bfa7b23a56f694a51b
tools/DedicatedServerVideo/gdata/spreadsheets/client.py
python
CellQuery.__init__
(self, min_row=None, max_row=None, min_col=None, max_col=None, range=None, return_empty=None, **kwargs)
Adds Cells-feed specific query parameters to a request. Args: min_row: str or int Positional number of minimum row returned in query. max_row: str or int Positional number of maximum row returned in query. min_col: str or int Positional number of minimum column returned in query. max_col: s...
Adds Cells-feed specific query parameters to a request.
[ "Adds", "Cells", "-", "feed", "specific", "query", "parameters", "to", "a", "request", "." ]
def __init__(self, min_row=None, max_row=None, min_col=None, max_col=None, range=None, return_empty=None, **kwargs): """Adds Cells-feed specific query parameters to a request. Args: min_row: str or int Positional number of minimum row returned in query. max_row: str or int Positional...
[ "def", "__init__", "(", "self", ",", "min_row", "=", "None", ",", "max_row", "=", "None", ",", "min_col", "=", "None", ",", "max_col", "=", "None", ",", "range", "=", "None", ",", "return_empty", "=", "None", ",", "*", "*", "kwargs", ")", ":", "gda...
https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/spreadsheets/client.py#L379-L403
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/tempfile.py
python
gettempdirb
()
return _os.fsencode(gettempdir())
A bytes version of tempfile.gettempdir().
A bytes version of tempfile.gettempdir().
[ "A", "bytes", "version", "of", "tempfile", ".", "gettempdir", "()", "." ]
def gettempdirb(): """A bytes version of tempfile.gettempdir().""" return _os.fsencode(gettempdir())
[ "def", "gettempdirb", "(", ")", ":", "return", "_os", ".", "fsencode", "(", "gettempdir", "(", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tempfile.py#L299-L301
giuspen/cherrytree
84712f206478fcf9acf30174009ad28c648c6344
pygtk2/modules/pgsc_spellcheck.py
python
SpellChecker.buffer_initialize
(self)
Initialize the GtkTextBuffer associated with the GtkTextView. If you have associated a new GtkTextBuffer with the GtkTextView call this method.
Initialize the GtkTextBuffer associated with the GtkTextView. If you have associated a new GtkTextBuffer with the GtkTextView call this method.
[ "Initialize", "the", "GtkTextBuffer", "associated", "with", "the", "GtkTextView", ".", "If", "you", "have", "associated", "a", "new", "GtkTextBuffer", "with", "the", "GtkTextView", "call", "this", "method", "." ]
def buffer_initialize(self): """ Initialize the GtkTextBuffer associated with the GtkTextView. If you have associated a new GtkTextBuffer with the GtkTextView call this method. """ #self._misspelled = gtk.TextTag('{}-misspelled'.format(self._prefix)) #self._misspe...
[ "def", "buffer_initialize", "(", "self", ")", ":", "#self._misspelled = gtk.TextTag('{}-misspelled'.format(self._prefix))", "#self._misspelled.set_property('underline', 4)", "self", ".", "_buffer", "=", "self", ".", "_view", ".", "get_buffer", "(", ")", "self", ".", "_buffe...
https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/pgsc_spellcheck.py#L244-L280
jeog/TDAmeritradeAPI
91c738afd7d57b54f6231170bd64c2550fafd34d
python/tdma_api/get.py
python
get_def_wait_msec
()
return clib.get_val('APIGetter_GetDefWaitMSec_ABI', c_ulonglong)
get default minimum wait milliseconds between .get() calls
get default minimum wait milliseconds between .get() calls
[ "get", "default", "minimum", "wait", "milliseconds", "between", ".", "get", "()", "calls" ]
def get_def_wait_msec(): """get default minimum wait milliseconds between .get() calls""" return clib.get_val('APIGetter_GetDefWaitMSec_ABI', c_ulonglong)
[ "def", "get_def_wait_msec", "(", ")", ":", "return", "clib", ".", "get_val", "(", "'APIGetter_GetDefWaitMSec_ABI'", ",", "c_ulonglong", ")" ]
https://github.com/jeog/TDAmeritradeAPI/blob/91c738afd7d57b54f6231170bd64c2550fafd34d/python/tdma_api/get.py#L168-L170
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
PhysicsTools/Heppy/python/physicsobjects/Muon.py
python
Muon.mvaId
(self)
return -99
For a transparent treatment of electrons and muons. Returns -99
For a transparent treatment of electrons and muons. Returns -99
[ "For", "a", "transparent", "treatment", "of", "electrons", "and", "muons", ".", "Returns", "-", "99" ]
def mvaId(self): '''For a transparent treatment of electrons and muons. Returns -99''' return -99
[ "def", "mvaId", "(", "self", ")", ":", "return", "-", "99" ]
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/PhysicsTools/Heppy/python/physicsobjects/Muon.py#L53-L55
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/training/checkpoint_management.py
python
checkpoint_exists
(checkpoint_prefix)
return checkpoint_exists_internal(checkpoint_prefix)
Checks whether a V1 or V2 checkpoint exists with the specified prefix. This is the recommended way to check if a checkpoint exists, since it takes into account the naming difference between V1 and V2 formats. Args: checkpoint_prefix: the prefix of a V1 or V2 checkpoint, with V2 taking priority. Typic...
Checks whether a V1 or V2 checkpoint exists with the specified prefix.
[ "Checks", "whether", "a", "V1", "or", "V2", "checkpoint", "exists", "with", "the", "specified", "prefix", "." ]
def checkpoint_exists(checkpoint_prefix): """Checks whether a V1 or V2 checkpoint exists with the specified prefix. This is the recommended way to check if a checkpoint exists, since it takes into account the naming difference between V1 and V2 formats. Args: checkpoint_prefix: the prefix of a V1 or V2 ch...
[ "def", "checkpoint_exists", "(", "checkpoint_prefix", ")", ":", "return", "checkpoint_exists_internal", "(", "checkpoint_prefix", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/training/checkpoint_management.py#L392-L407
Yelp/MOE
5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c
moe/optimal_learning/python/python_version/expected_improvement.py
python
ExpectedImprovement.problem_size
(self)
return self.num_to_sample * self.dim
Return the number of independent parameters to optimize.
Return the number of independent parameters to optimize.
[ "Return", "the", "number", "of", "independent", "parameters", "to", "optimize", "." ]
def problem_size(self): """Return the number of independent parameters to optimize.""" return self.num_to_sample * self.dim
[ "def", "problem_size", "(", "self", ")", ":", "return", "self", ".", "num_to_sample", "*", "self", ".", "dim" ]
https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/optimal_learning/python/python_version/expected_improvement.py#L214-L216
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/flatmenu.py
python
FlatMenuButton.GetClientRect
(self)
return wx.RectPS(self._pos, self._size)
Returns the client rectangle for :class:`FlatMenuButton`.
Returns the client rectangle for :class:`FlatMenuButton`.
[ "Returns", "the", "client", "rectangle", "for", ":", "class", ":", "FlatMenuButton", "." ]
def GetClientRect(self): """ Returns the client rectangle for :class:`FlatMenuButton`. """ return wx.RectPS(self._pos, self._size)
[ "def", "GetClientRect", "(", "self", ")", ":", "return", "wx", ".", "RectPS", "(", "self", ".", "_pos", ",", "self", ".", "_size", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L4114-L4117
openmm/openmm
cb293447c4fc8b03976dfe11399f107bab70f3d9
wrappers/python/openmm/app/topology.py
python
Topology.addResidue
(self, name, chain, id=None, insertionCode='')
return residue
Create a new Residue and add it to the Topology. Parameters ---------- name : string The name of the residue to add chain : Chain The Chain to add it to id : string=None An optional identifier for the residue. If this is omitted, an id ...
Create a new Residue and add it to the Topology.
[ "Create", "a", "new", "Residue", "and", "add", "it", "to", "the", "Topology", "." ]
def addResidue(self, name, chain, id=None, insertionCode=''): """Create a new Residue and add it to the Topology. Parameters ---------- name : string The name of the residue to add chain : Chain The Chain to add it to id : string=None ...
[ "def", "addResidue", "(", "self", ",", "name", ",", "chain", ",", "id", "=", "None", ",", "insertionCode", "=", "''", ")", ":", "if", "len", "(", "chain", ".", "_residues", ")", ">", "0", "and", "self", ".", "_numResidues", "!=", "chain", ".", "_re...
https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/topology.py#L140-L167
apache/impala
8ddac48f3428c86f2cbd037ced89cfb903298b12
shell/pkg_resources.py
python
WorkingSet.resolve
(self, requirements, env=None, installer=None, replacement=True)
return to_activate
List all distributions needed to (recursively) meet `requirements` `requirements` must be a sequence of ``Requirement`` objects. `env`, if supplied, should be an ``Environment`` instance. If not supplied, it defaults to all distributions available within any entry or distribution in t...
List all distributions needed to (recursively) meet `requirements`
[ "List", "all", "distributions", "needed", "to", "(", "recursively", ")", "meet", "requirements" ]
def resolve(self, requirements, env=None, installer=None, replacement=True): """List all distributions needed to (recursively) meet `requirements` `requirements` must be a sequence of ``Requirement`` objects. `env`, if supplied, should be an ``Environment`` instance. If not supplied, ...
[ "def", "resolve", "(", "self", ",", "requirements", ",", "env", "=", "None", ",", "installer", "=", "None", ",", "replacement", "=", "True", ")", ":", "requirements", "=", "list", "(", "requirements", ")", "[", ":", ":", "-", "1", "]", "# set up the st...
https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/shell/pkg_resources.py#L519-L567
smilehao/xlua-framework
a03801538be2b0e92d39332d445b22caca1ef61f
ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/ez_setup.py
python
use_setuptools
( version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, download_delay=15 )
return do_download()
Automatically find/download setuptools and make it available on sys.path `version` should be a valid setuptools version number that is available as an egg for download under the `download_base` URL (which should end with a '/'). `to_dir` is the directory where setuptools will be downloaded, if it is n...
Automatically find/download setuptools and make it available on sys.path
[ "Automatically", "find", "/", "download", "setuptools", "and", "make", "it", "available", "on", "sys", ".", "path" ]
def use_setuptools( version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, download_delay=15 ): """Automatically find/download setuptools and make it available on sys.path `version` should be a valid setuptools version number that is available as an egg for download under the `downlo...
[ "def", "use_setuptools", "(", "version", "=", "DEFAULT_VERSION", ",", "download_base", "=", "DEFAULT_URL", ",", "to_dir", "=", "os", ".", "curdir", ",", "download_delay", "=", "15", ")", ":", "was_imported", "=", "'pkg_resources'", "in", "sys", ".", "modules",...
https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/ez_setup.py#L85-L124
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/seq2seq/python/ops/basic_decoder.py
python
BasicDecoder.step
(self, time, inputs, state, name=None)
return (outputs, next_state, next_inputs, finished)
Perform a decoding step. Args: time: scalar `int32` tensor. inputs: A (structure of) input tensors. state: A (structure of) state tensors and TensorArrays. name: Name scope for any created operations. Returns: `(outputs, next_state, next_inputs, finished)`.
Perform a decoding step.
[ "Perform", "a", "decoding", "step", "." ]
def step(self, time, inputs, state, name=None): """Perform a decoding step. Args: time: scalar `int32` tensor. inputs: A (structure of) input tensors. state: A (structure of) state tensors and TensorArrays. name: Name scope for any created operations. Returns: `(outputs, next...
[ "def", "step", "(", "self", ",", "time", ",", "inputs", ",", "state", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "\"BasicDecoderStep\"", ",", "(", "time", ",", "inputs", ",", "state", ")", ")", ":", "cel...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/seq2seq/python/ops/basic_decoder.py#L125-L149
lightvector/KataGo
20d34784703c5b4000643d3ccc43bb37d418f3b5
python/sgfmill/sgf_properties.py
python
serialise_real
(f, context=None)
return s.encode("ascii")
Serialise a Real value. f -- real number (int or float) If the absolute value is too small to conveniently express as a decimal, returns b"0" (this currently happens if abs(f) is less than 0.0001).
Serialise a Real value.
[ "Serialise", "a", "Real", "value", "." ]
def serialise_real(f, context=None): """Serialise a Real value. f -- real number (int or float) If the absolute value is too small to conveniently express as a decimal, returns b"0" (this currently happens if abs(f) is less than 0.0001). """ f = float(f) try: i = int(f) except...
[ "def", "serialise_real", "(", "f", ",", "context", "=", "None", ")", ":", "f", "=", "float", "(", "f", ")", "try", ":", "i", "=", "int", "(", "f", ")", "except", "OverflowError", ":", "# infinity", "raise", "ValueError", "if", "f", "==", "i", ":", ...
https://github.com/lightvector/KataGo/blob/20d34784703c5b4000643d3ccc43bb37d418f3b5/python/sgfmill/sgf_properties.py#L142-L163
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/response.py
python
HTTPResponse.read
(self, amt=None, decode_content=None, cache_content=False)
return data
Similar to :meth:`httplib.HTTPResponse.read`, but with two additional parameters: ``decode_content`` and ``cache_content``. :param amt: How much of the content to read. If specified, caching is skipped because it doesn't make sense to cache partial content as the full ...
Similar to :meth:`httplib.HTTPResponse.read`, but with two additional parameters: ``decode_content`` and ``cache_content``.
[ "Similar", "to", ":", "meth", ":", "httplib", ".", "HTTPResponse", ".", "read", "but", "with", "two", "additional", "parameters", ":", "decode_content", "and", "cache_content", "." ]
def read(self, amt=None, decode_content=None, cache_content=False): """ Similar to :meth:`httplib.HTTPResponse.read`, but with two additional parameters: ``decode_content`` and ``cache_content``. :param amt: How much of the content to read. If specified, caching is skipped ...
[ "def", "read", "(", "self", ",", "amt", "=", "None", ",", "decode_content", "=", "None", ",", "cache_content", "=", "False", ")", ":", "self", ".", "_init_decoder", "(", ")", "if", "decode_content", "is", "None", ":", "decode_content", "=", "self", ".", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/response.py#L469-L541
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/SANS/ISISCommandInterface.py
python
FindBeamCentre
(rlow, rupp, MaxIter=10, xstart=None, ystart=None, tolerance=1.251e-4, find_direction=FindDirectionEnum.ALL)
return coord1_centre, coord2_centre
Estimates the location of the effective beam centre given a good initial estimate. For more information go to this page mantidproject.org/Using_the_SANS_GUI_Beam_Centre_Finder @param rlow: mask around the (estimated) centre to this radius (in millimetres) @param rupp: don't include furth...
Estimates the location of the effective beam centre given a good initial estimate. For more information go to this page mantidproject.org/Using_the_SANS_GUI_Beam_Centre_Finder
[ "Estimates", "the", "location", "of", "the", "effective", "beam", "centre", "given", "a", "good", "initial", "estimate", ".", "For", "more", "information", "go", "to", "this", "page", "mantidproject", ".", "org", "/", "Using_the_SANS_GUI_Beam_Centre_Finder" ]
def FindBeamCentre(rlow, rupp, MaxIter=10, xstart=None, ystart=None, tolerance=1.251e-4, find_direction=FindDirectionEnum.ALL): """ Estimates the location of the effective beam centre given a good initial estimate. For more information go to this page mantidproject.org/Usi...
[ "def", "FindBeamCentre", "(", "rlow", ",", "rupp", ",", "MaxIter", "=", "10", ",", "xstart", "=", "None", ",", "ystart", "=", "None", ",", "tolerance", "=", "1.251e-4", ",", "find_direction", "=", "FindDirectionEnum", ".", "ALL", ")", ":", "COORD1STEP", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/ISISCommandInterface.py#L1106-L1233
google/filament
d21f092645b8e1e312307cbf89f1484891347c63
third_party/benchmark/tools/gbench/report.py
python
find_longest_name
(benchmark_list)
return longest_name
Return the length of the longest benchmark name in a given list of benchmark JSON objects
Return the length of the longest benchmark name in a given list of benchmark JSON objects
[ "Return", "the", "length", "of", "the", "longest", "benchmark", "name", "in", "a", "given", "list", "of", "benchmark", "JSON", "objects" ]
def find_longest_name(benchmark_list): """ Return the length of the longest benchmark name in a given list of benchmark JSON objects """ longest_name = 1 for bc in benchmark_list: if len(bc['name']) > longest_name: longest_name = len(bc['name']) return longest_name
[ "def", "find_longest_name", "(", "benchmark_list", ")", ":", "longest_name", "=", "1", "for", "bc", "in", "benchmark_list", ":", "if", "len", "(", "bc", "[", "'name'", "]", ")", ">", "longest_name", ":", "longest_name", "=", "len", "(", "bc", "[", "'name...
https://github.com/google/filament/blob/d21f092645b8e1e312307cbf89f1484891347c63/third_party/benchmark/tools/gbench/report.py#L58-L67
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/json_schema_compiler/cc_generator.py
python
_Generator._GenerateTypes
(self, namespace, types)
return c
Generates the member functions for a list of types.
Generates the member functions for a list of types.
[ "Generates", "the", "member", "functions", "for", "a", "list", "of", "types", "." ]
def _GenerateTypes(self, namespace, types): """Generates the member functions for a list of types. """ c = Code() for type_ in types: c.Cblock(self._GenerateType(namespace, type_)) return c
[ "def", "_GenerateTypes", "(", "self", ",", "namespace", ",", "types", ")", ":", "c", "=", "Code", "(", ")", "for", "type_", "in", "types", ":", "c", ".", "Cblock", "(", "self", ".", "_GenerateType", "(", "namespace", ",", "type_", ")", ")", "return",...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/json_schema_compiler/cc_generator.py#L1002-L1008
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/sdk.py
python
get_default_sdk
()
return InstalledSDKList[0]
Set up the default Platform/Windows SDK.
Set up the default Platform/Windows SDK.
[ "Set", "up", "the", "default", "Platform", "/", "Windows", "SDK", "." ]
def get_default_sdk(): """Set up the default Platform/Windows SDK.""" get_installed_sdks() if not InstalledSDKList: return None return InstalledSDKList[0]
[ "def", "get_default_sdk", "(", ")", ":", "get_installed_sdks", "(", ")", "if", "not", "InstalledSDKList", ":", "return", "None", "return", "InstalledSDKList", "[", "0", "]" ]
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/sdk.py#L316-L321
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/toolkits/graph_analytics/_model_base.py
python
GraphAnalyticsModel._metric_fields
(self)
return {"training time (secs)": "training_time"}
Return model fields related to training metric Fields SHOULD be wrapped by _precomputed_field, if necessary
Return model fields related to training metric Fields SHOULD be wrapped by _precomputed_field, if necessary
[ "Return", "model", "fields", "related", "to", "training", "metric", "Fields", "SHOULD", "be", "wrapped", "by", "_precomputed_field", "if", "necessary" ]
def _metric_fields(self): """ Return model fields related to training metric Fields SHOULD be wrapped by _precomputed_field, if necessary """ return {"training time (secs)": "training_time"}
[ "def", "_metric_fields", "(", "self", ")", ":", "return", "{", "\"training time (secs)\"", ":", "\"training_time\"", "}" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/graph_analytics/_model_base.py#L186-L191
fasiondog/hikyuu
842751aa25283f9fdafc6f560ea262f79e67a307
hikyuu/extend.py
python
__new_Datetime_sub__
(self, td)
减去指定的时长, 时长对象可为 TimeDelta 或 datetime.timedelta 类型 :param TimeDelta td: 指定时长 :rtype: Datetime
减去指定的时长, 时长对象可为 TimeDelta 或 datetime.timedelta 类型
[ "减去指定的时长", "时长对象可为", "TimeDelta", "或", "datetime", ".", "timedelta", "类型" ]
def __new_Datetime_sub__(self, td): """减去指定的时长, 时长对象可为 TimeDelta 或 datetime.timedelta 类型 :param TimeDelta td: 指定时长 :rtype: Datetime """ if isinstance(td, TimeDelta): return __old_Datetime_sub__(self, td) elif isinstance(td, timedelta): return __old_Datetime_sub__(self, TimeDelta...
[ "def", "__new_Datetime_sub__", "(", "self", ",", "td", ")", ":", "if", "isinstance", "(", "td", ",", "TimeDelta", ")", ":", "return", "__old_Datetime_sub__", "(", "self", ",", "td", ")", "elif", "isinstance", "(", "td", ",", "timedelta", ")", ":", "retur...
https://github.com/fasiondog/hikyuu/blob/842751aa25283f9fdafc6f560ea262f79e67a307/hikyuu/extend.py#L79-L92
protocolbuffers/protobuf
b5ab0b7a18b7336c60130f4ddb2d97c51792f896
python/mox.py
python
MockMethod.AndReturn
(self, return_value)
return return_value
Set the value to return when this method is called. Args: # return_value can be anything.
Set the value to return when this method is called.
[ "Set", "the", "value", "to", "return", "when", "this", "method", "is", "called", "." ]
def AndReturn(self, return_value): """Set the value to return when this method is called. Args: # return_value can be anything. """ self._return_value = return_value return return_value
[ "def", "AndReturn", "(", "self", ",", "return_value", ")", ":", "self", ".", "_return_value", "=", "return_value", "return", "return_value" ]
https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/mox.py#L718-L726
microsoft/DirectXShaderCompiler
8348ff8d9e0287610ba05d3a828e10af981a1c05
tools/clang/bindings/python/clang/cindex.py
python
Cursor.translation_unit
(self)
return self._tu
Returns the TranslationUnit to which this Cursor belongs.
Returns the TranslationUnit to which this Cursor belongs.
[ "Returns", "the", "TranslationUnit", "to", "which", "this", "Cursor", "belongs", "." ]
def translation_unit(self): """Returns the TranslationUnit to which this Cursor belongs.""" # If this triggers an AttributeError, the instance was not properly # created. return self._tu
[ "def", "translation_unit", "(", "self", ")", ":", "# If this triggers an AttributeError, the instance was not properly", "# created.", "return", "self", ".", "_tu" ]
https://github.com/microsoft/DirectXShaderCompiler/blob/8348ff8d9e0287610ba05d3a828e10af981a1c05/tools/clang/bindings/python/clang/cindex.py#L1389-L1393
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/mapreduce/mapreduce/key_ranges.py
python
KeyRangesFactory.from_json
(cls, json)
Deserialize from json. Args: json: a dict of json compatible fields. Returns: a KeyRanges object. Raises: ValueError: if the json is invalid.
Deserialize from json.
[ "Deserialize", "from", "json", "." ]
def from_json(cls, json): """Deserialize from json. Args: json: a dict of json compatible fields. Returns: a KeyRanges object. Raises: ValueError: if the json is invalid. """ if json["name"] in _KEYRANGES_CLASSES: return _KEYRANGES_CLASSES[json["name"]].from_json(json)...
[ "def", "from_json", "(", "cls", ",", "json", ")", ":", "if", "json", "[", "\"name\"", "]", "in", "_KEYRANGES_CLASSES", ":", "return", "_KEYRANGES_CLASSES", "[", "json", "[", "\"name\"", "]", "]", ".", "from_json", "(", "json", ")", "raise", "ValueError", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mapreduce/mapreduce/key_ranges.py#L45-L59
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/SANS/isis_reducer.py
python
ISISReducer.deep_copy
(self)
return copy.deepcopy(current_settings)
Returns a copy of the reducer that was created when the settings were set but before first execution @return: deep copy of the settings
Returns a copy of the reducer that was created when the settings were set but before first execution
[ "Returns", "a", "copy", "of", "the", "reducer", "that", "was", "created", "when", "the", "settings", "were", "set", "but", "before", "first", "execution" ]
def deep_copy(self): """ Returns a copy of the reducer that was created when the settings were set but before first execution @return: deep copy of the settings """ global current_settings return copy.deepcopy(current_settings)
[ "def", "deep_copy", "(", "self", ")", ":", "global", "current_settings", "return", "copy", ".", "deepcopy", "(", "current_settings", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/isis_reducer.py#L475-L482
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/ir/builder.py
python
IRBuilder.udiv
(self, lhs, rhs, name='')
Unsigned integer division: name = lhs / rhs
Unsigned integer division: name = lhs / rhs
[ "Unsigned", "integer", "division", ":", "name", "=", "lhs", "/", "rhs" ]
def udiv(self, lhs, rhs, name=''): """ Unsigned integer division: name = lhs / rhs """
[ "def", "udiv", "(", "self", ",", "lhs", ",", "rhs", ",", "name", "=", "''", ")", ":" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/ir/builder.py#L402-L406
freesurfer/freesurfer
6dbe527d43ffa611acb2cd112e9469f9bfec8e36
python/freesurfer/deeplearn/losses.py
python
spherical_loss.ncc
(self, I, J)
return retval
local (over window) normalized cross correlation
local (over window) normalized cross correlation
[ "local", "(", "over", "window", ")", "normalized", "cross", "correlation" ]
def ncc(self, I, J): """ local (over window) normalized cross correlation """ # get dimension of volume # assumes I, J are sized [batch_size, *vol_shape, nb_feats] ndims = len(I.get_shape().as_list()) - 2 assert ndims in [1, 2, 3], "volumes should be 1 to 3 dimens...
[ "def", "ncc", "(", "self", ",", "I", ",", "J", ")", ":", "# get dimension of volume", "# assumes I, J are sized [batch_size, *vol_shape, nb_feats]", "ndims", "=", "len", "(", "I", ".", "get_shape", "(", ")", ".", "as_list", "(", ")", ")", "-", "2", "assert", ...
https://github.com/freesurfer/freesurfer/blob/6dbe527d43ffa611acb2cd112e9469f9bfec8e36/python/freesurfer/deeplearn/losses.py#L416-L465
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
build/android/gyp/util/md5_check.py
python
_Metadata.AddFile
(self, path, tag)
Adds metadata for a non-zip file. Args: path: Path to the file. tag: A short string representative of the file contents.
Adds metadata for a non-zip file.
[ "Adds", "metadata", "for", "a", "non", "-", "zip", "file", "." ]
def AddFile(self, path, tag): """Adds metadata for a non-zip file. Args: path: Path to the file. tag: A short string representative of the file contents. """ self._AssertNotQueried() self._files.append({ 'path': path, 'tag': tag, })
[ "def", "AddFile", "(", "self", ",", "path", ",", "tag", ")", ":", "self", ".", "_AssertNotQueried", "(", ")", "self", ".", "_files", ".", "append", "(", "{", "'path'", ":", "path", ",", "'tag'", ":", "tag", ",", "}", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/build/android/gyp/util/md5_check.py#L282-L293
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
gr-digital/python/digital/psk_constellations.py
python
psk_4_0x1_1_0
()
return constellation_map_generator(psk_4()[0], psk_4()[1], k, pi)
| 00 | 10 | ------- | 01 | 11
| 00 | 10 | ------- | 01 | 11
[ "|", "00", "|", "10", "|", "-------", "|", "01", "|", "11" ]
def psk_4_0x1_1_0(): ''' | 00 | 10 | ------- | 01 | 11 ''' k = 0x1 pi = [1, 0] return constellation_map_generator(psk_4()[0], psk_4()[1], k, pi)
[ "def", "psk_4_0x1_1_0", "(", ")", ":", "k", "=", "0x1", "pi", "=", "[", "1", ",", "0", "]", "return", "constellation_map_generator", "(", "psk_4", "(", ")", "[", "0", "]", ",", "psk_4", "(", ")", "[", "1", "]", ",", "k", ",", "pi", ")" ]
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-digital/python/digital/psk_constellations.py#L186-L194
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/requests/utils.py
python
stream_decode_response_unicode
(iterator, r)
Stream decodes a iterator.
Stream decodes a iterator.
[ "Stream", "decodes", "a", "iterator", "." ]
def stream_decode_response_unicode(iterator, r): """Stream decodes a iterator.""" if r.encoding is None: for item in iterator: yield item return decoder = codecs.getincrementaldecoder(r.encoding)(errors='replace') for chunk in iterator: rv = decoder.decode(chunk) ...
[ "def", "stream_decode_response_unicode", "(", "iterator", ",", "r", ")", ":", "if", "r", ".", "encoding", "is", "None", ":", "for", "item", "in", "iterator", ":", "yield", "item", "return", "decoder", "=", "codecs", ".", "getincrementaldecoder", "(", "r", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/requests/utils.py#L511-L526
etotheipi/BitcoinArmory
2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98
urllib3/fields.py
python
RequestField.from_tuples
(cls, fieldname, value)
return request_param
A :class:`~urllib3.fields.RequestField` factory from old-style tuple parameters. Supports constructing :class:`~urllib3.fields.RequestField` from parameter of key/value strings AND key/filetuple. A filetuple is a (filename, data, MIME type) tuple where the MIME type is optional. For example: ::...
A :class:`~urllib3.fields.RequestField` factory from old-style tuple parameters.
[ "A", ":", "class", ":", "~urllib3", ".", "fields", ".", "RequestField", "factory", "from", "old", "-", "style", "tuple", "parameters", "." ]
def from_tuples(cls, fieldname, value): """ A :class:`~urllib3.fields.RequestField` factory from old-style tuple parameters. Supports constructing :class:`~urllib3.fields.RequestField` from parameter of key/value strings AND key/filetuple. A filetuple is a (filename, data, MIME type) ...
[ "def", "from_tuples", "(", "cls", ",", "fieldname", ",", "value", ")", ":", "if", "isinstance", "(", "value", ",", "tuple", ")", ":", "if", "len", "(", "value", ")", "==", "3", ":", "filename", ",", "data", ",", "content_type", "=", "value", "else", ...
https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/urllib3/fields.py#L77-L107
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py
python
outputBuffer.writeString
(self, str)
return ret
Write the content of the string in the output I/O buffer This routine handle the I18N transcoding from internal UTF-8 The buffer is lossless, i.e. will store in case of partial or delayed writes.
Write the content of the string in the output I/O buffer This routine handle the I18N transcoding from internal UTF-8 The buffer is lossless, i.e. will store in case of partial or delayed writes.
[ "Write", "the", "content", "of", "the", "string", "in", "the", "output", "I", "/", "O", "buffer", "This", "routine", "handle", "the", "I18N", "transcoding", "from", "internal", "UTF", "-", "8", "The", "buffer", "is", "lossless", "i", ".", "e", ".", "wi...
def writeString(self, str): """Write the content of the string in the output I/O buffer This routine handle the I18N transcoding from internal UTF-8 The buffer is lossless, i.e. will store in case of partial or delayed writes. """ ret = libxml2mod.xmlOutputBufferWriteStrin...
[ "def", "writeString", "(", "self", ",", "str", ")", ":", "ret", "=", "libxml2mod", ".", "xmlOutputBufferWriteString", "(", "self", ".", "_o", ",", "str", ")", "return", "ret" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L5332-L5338
RobotLocomotion/drake
0e18a34604c45ed65bc9018a54f7610f91cdad5b
bindings/pydrake/common/cpp_template.py
python
TemplateBase.get_param_set
(self, instantiation)
return set(param_list)
Returns all parameters for a given `instantiation`. Returns: A set of instantiations.
Returns all parameters for a given `instantiation`.
[ "Returns", "all", "parameters", "for", "a", "given", "instantiation", "." ]
def get_param_set(self, instantiation): """Returns all parameters for a given `instantiation`. Returns: A set of instantiations. """ param_list = [] for param, check in self._instantiation_map.items(): if check == instantiation: param_list...
[ "def", "get_param_set", "(", "self", ",", "instantiation", ")", ":", "param_list", "=", "[", "]", "for", "param", ",", "check", "in", "self", ".", "_instantiation_map", ".", "items", "(", ")", ":", "if", "check", "==", "instantiation", ":", "param_list", ...
https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/bindings/pydrake/common/cpp_template.py#L241-L251
google/or-tools
2cb85b4eead4c38e1c54b48044f92087cf165bce
ortools/sat/samples/cp_is_fun_sat.py
python
main
()
Solve the CP+IS+FUN==TRUE cryptarithm.
Solve the CP+IS+FUN==TRUE cryptarithm.
[ "Solve", "the", "CP", "+", "IS", "+", "FUN", "==", "TRUE", "cryptarithm", "." ]
def main(): """Solve the CP+IS+FUN==TRUE cryptarithm.""" # Constraint programming engine # [START model] model = cp_model.CpModel() # [END model] # [START variables] base = 10 c = model.NewIntVar(1, base - 1, 'C') p = model.NewIntVar(0, base - 1, 'P') i = model.NewIntVar(1, bas...
[ "def", "main", "(", ")", ":", "# Constraint programming engine", "# [START model]", "model", "=", "cp_model", ".", "CpModel", "(", ")", "# [END model]", "# [START variables]", "base", "=", "10", "c", "=", "model", ".", "NewIntVar", "(", "1", ",", "base", "-", ...
https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/ortools/sat/samples/cp_is_fun_sat.py#L47-L101
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/waflib/extras/codelite.py
python
vsnode_target.__init__
(self, ctx, tg)
A project is more or less equivalent to a file/folder
A project is more or less equivalent to a file/folder
[ "A", "project", "is", "more", "or", "less", "equivalent", "to", "a", "file", "/", "folder" ]
def __init__(self, ctx, tg): """ A project is more or less equivalent to a file/folder """ base = getattr(ctx, 'projects_dir', None) or tg.path node = base.make_node(quote(tg.name) + ctx.project_extension) # the project file as a Node ...
[ "def", "__init__", "(", "self", ",", "ctx", ",", "tg", ")", ":", "base", "=", "getattr", "(", "ctx", ",", "'projects_dir'", ",", "None", ")", "or", "tg", ".", "path", "node", "=", "base", ".", "make_node", "(", "quote", "(", "tg", ".", "name", ")...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/extras/codelite.py#L620-L628
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Tool/packaging/msi.py
python
create_feature_dict
(files)
return dict
X_MSI_FEATURE and doc FileTag's can be used to collect files in a hierarchy. This function collects the files into this hierarchy.
X_MSI_FEATURE and doc FileTag's can be used to collect files in a hierarchy. This function collects the files into this hierarchy.
[ "X_MSI_FEATURE", "and", "doc", "FileTag", "s", "can", "be", "used", "to", "collect", "files", "in", "a", "hierarchy", ".", "This", "function", "collects", "the", "files", "into", "this", "hierarchy", "." ]
def create_feature_dict(files): """ X_MSI_FEATURE and doc FileTag's can be used to collect files in a hierarchy. This function collects the files into this hierarchy. """ dict = {} def add_to_dict( feature, file ): if not SCons.Util.is_List( feature ): feature = [ feature ] ...
[ "def", "create_feature_dict", "(", "files", ")", ":", "dict", "=", "{", "}", "def", "add_to_dict", "(", "feature", ",", "file", ")", ":", "if", "not", "SCons", ".", "Util", ".", "is_List", "(", "feature", ")", ":", "feature", "=", "[", "feature", "]"...
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Tool/packaging/msi.py#L127-L151
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/typing/_add_docstring.py
python
_parse_docstrings
()
return "\n".join(type_list_ret)
Convert all docstrings in ``_docstrings_list`` into a single sphinx-legible text block.
Convert all docstrings in ``_docstrings_list`` into a single sphinx-legible text block.
[ "Convert", "all", "docstrings", "in", "_docstrings_list", "into", "a", "single", "sphinx", "-", "legible", "text", "block", "." ]
def _parse_docstrings() -> str: """Convert all docstrings in ``_docstrings_list`` into a single sphinx-legible text block. """ type_list_ret = [] for name, value, doc in _docstrings_list: s = textwrap.dedent(doc).replace("\n", "\n ") # Replace sections by rubrics lines =...
[ "def", "_parse_docstrings", "(", ")", "->", "str", ":", "type_list_ret", "=", "[", "]", "for", "name", ",", "value", ",", "doc", "in", "_docstrings_list", ":", "s", "=", "textwrap", ".", "dedent", "(", "doc", ")", ".", "replace", "(", "\"\\n\"", ",", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/typing/_add_docstring.py#L27-L57
mingchen/protobuf-ios
0958df34558cd54cb7b6e6ca5c8855bf3d475046
compiler/python/mox.py
python
Mox.CreateMockAnything
(self)
return new_mock
Create a mock that will accept any method calls. This does not enforce an interface.
Create a mock that will accept any method calls.
[ "Create", "a", "mock", "that", "will", "accept", "any", "method", "calls", "." ]
def CreateMockAnything(self): """Create a mock that will accept any method calls. This does not enforce an interface. """ new_mock = MockAnything() self._mock_objects.append(new_mock) return new_mock
[ "def", "CreateMockAnything", "(", "self", ")", ":", "new_mock", "=", "MockAnything", "(", ")", "self", ".", "_mock_objects", ".", "append", "(", "new_mock", ")", "return", "new_mock" ]
https://github.com/mingchen/protobuf-ios/blob/0958df34558cd54cb7b6e6ca5c8855bf3d475046/compiler/python/mox.py#L179-L187
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
LogWindow.IsPassingMessages
(*args, **kwargs)
return _misc_.LogWindow_IsPassingMessages(*args, **kwargs)
IsPassingMessages(self) -> bool
IsPassingMessages(self) -> bool
[ "IsPassingMessages", "(", "self", ")", "-", ">", "bool" ]
def IsPassingMessages(*args, **kwargs): """IsPassingMessages(self) -> bool""" return _misc_.LogWindow_IsPassingMessages(*args, **kwargs)
[ "def", "IsPassingMessages", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "LogWindow_IsPassingMessages", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L1782-L1784
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/urllib.py
python
unquote
(s)
return ''.join(res)
unquote('abc%20def') -> 'abc def'.
unquote('abc%20def') -> 'abc def'.
[ "unquote", "(", "abc%20def", ")", "-", ">", "abc", "def", "." ]
def unquote(s): """unquote('abc%20def') -> 'abc def'.""" if _is_unicode(s): if '%' not in s: return s bits = _asciire.split(s) res = [bits[0]] append = res.append for i in range(1, len(bits), 2): append(unquote(str(bits[i])).decode('latin1')) ...
[ "def", "unquote", "(", "s", ")", ":", "if", "_is_unicode", "(", "s", ")", ":", "if", "'%'", "not", "in", "s", ":", "return", "s", "bits", "=", "_asciire", ".", "split", "(", "s", ")", "res", "=", "[", "bits", "[", "0", "]", "]", "append", "="...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/urllib.py#L1204-L1230
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/generator/make.py
python
Compilable
(filename)
return False
Return true if the file is compilable (should be in OBJS).
Return true if the file is compilable (should be in OBJS).
[ "Return", "true", "if", "the", "file", "is", "compilable", "(", "should", "be", "in", "OBJS", ")", "." ]
def Compilable(filename): """Return true if the file is compilable (should be in OBJS).""" for res in (filename.endswith(e) for e in COMPILABLE_EXTENSIONS): if res: return True return False
[ "def", "Compilable", "(", "filename", ")", ":", "for", "res", "in", "(", "filename", ".", "endswith", "(", "e", ")", "for", "e", "in", "COMPILABLE_EXTENSIONS", ")", ":", "if", "res", ":", "return", "True", "return", "False" ]
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/generator/make.py#L609-L614
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/configure.py
python
is_arm_hard_float_abi
()
return '__ARM_PCS_VFP' in cc_macros()
Check for hardfloat or softfloat eabi on ARM
Check for hardfloat or softfloat eabi on ARM
[ "Check", "for", "hardfloat", "or", "softfloat", "eabi", "on", "ARM" ]
def is_arm_hard_float_abi(): """Check for hardfloat or softfloat eabi on ARM""" # GCC versions 4.6 and above define __ARM_PCS or __ARM_PCS_VFP to specify # the Floating Point ABI used (PCS stands for Procedure Call Standard). # We use these as well as a couple of other defines to statically determine # what F...
[ "def", "is_arm_hard_float_abi", "(", ")", ":", "# GCC versions 4.6 and above define __ARM_PCS or __ARM_PCS_VFP to specify", "# the Floating Point ABI used (PCS stands for Procedure Call Standard).", "# We use these as well as a couple of other defines to statically determine", "# what FP ABI used.",...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/configure.py#L824-L831
giuspen/cherrytree
84712f206478fcf9acf30174009ad28c648c6344
pygtk2/modules/core.py
python
CherryTree.on_hscrollbar_text_value_changed
(self, hscrollbar)
Catches Text Horizontal Scrollbar Movements
Catches Text Horizontal Scrollbar Movements
[ "Catches", "Text", "Horizontal", "Scrollbar", "Movements" ]
def on_hscrollbar_text_value_changed(self, hscrollbar): """Catches Text Horizontal Scrollbar Movements""" curr_val = hscrollbar.get_value() #print curr_val if curr_val == 7: hscrollbar.set_value(0)
[ "def", "on_hscrollbar_text_value_changed", "(", "self", ",", "hscrollbar", ")", ":", "curr_val", "=", "hscrollbar", ".", "get_value", "(", ")", "#print curr_val", "if", "curr_val", "==", "7", ":", "hscrollbar", ".", "set_value", "(", "0", ")" ]
https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/core.py#L606-L611
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/waflib/Task.py
python
TaskBase.attr
(self, att, default=None)
return ret
Retrieve an attribute from the instance or from the class. :param att: variable name :type att: string :param default: default value
Retrieve an attribute from the instance or from the class.
[ "Retrieve", "an", "attribute", "from", "the", "instance", "or", "from", "the", "class", "." ]
def attr(self, att, default=None): """ Retrieve an attribute from the instance or from the class. :param att: variable name :type att: string :param default: default value """ ret = getattr(self, att, self) if ret is self: return getattr(self.__class__, att, default) return ret
[ "def", "attr", "(", "self", ",", "att", ",", "default", "=", "None", ")", ":", "ret", "=", "getattr", "(", "self", ",", "att", ",", "self", ")", "if", "ret", "is", "self", ":", "return", "getattr", "(", "self", ".", "__class__", ",", "att", ",", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Task.py#L330-L340
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
IndividualLayoutConstraint.LeftOf
(*args, **kwargs)
return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
LeftOf(self, Window sibling, int marg=0) Constrains this edge to be to the left of the given window, with an optional margin. Implicitly, this is relative to the left edge of the other window.
LeftOf(self, Window sibling, int marg=0)
[ "LeftOf", "(", "self", "Window", "sibling", "int", "marg", "=", "0", ")" ]
def LeftOf(*args, **kwargs): """ LeftOf(self, Window sibling, int marg=0) Constrains this edge to be to the left of the given window, with an optional margin. Implicitly, this is relative to the left edge of the other window. """ return _core_.IndividualLayoutCon...
[ "def", "LeftOf", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "IndividualLayoutConstraint_LeftOf", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L16136-L16144
Slicer/SlicerGitSVNArchive
65e92bb16c2b32ea47a1a66bee71f238891ee1ca
Modules/Scripted/EditorLib/EditUtil.py
python
EditUtil.setCurrentEffect
(name)
set current effect on the editor parameter node.
set current effect on the editor parameter node.
[ "set", "current", "effect", "on", "the", "editor", "parameter", "node", "." ]
def setCurrentEffect(name): """set current effect on the editor parameter node. """ if name != 'EraseLabel': EditUtil.getParameterNode().SetParameter('effect', name) else: EditUtil.toggleLabel()
[ "def", "setCurrentEffect", "(", "name", ")", ":", "if", "name", "!=", "'EraseLabel'", ":", "EditUtil", ".", "getParameterNode", "(", ")", ".", "SetParameter", "(", "'effect'", ",", "name", ")", "else", ":", "EditUtil", ".", "toggleLabel", "(", ")" ]
https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Modules/Scripted/EditorLib/EditUtil.py#L69-L75
alibaba/weex_js_engine
2bdf4b6f020c1fc99c63f649718f6faf7e27fdde
jni/v8core/v8/build/gyp/pylib/gyp/generator/msvs.py
python
_CreateMSVSUserFile
(proj_path, version, spec)
return user_file
Generates a .user file for the user running this Gyp program. Arguments: proj_path: The path of the project file being created. The .user file shares the same path (with an appropriate suffix). version: The VisualStudioVersion object. spec: The target dictionary containing the properties ...
Generates a .user file for the user running this Gyp program.
[ "Generates", "a", ".", "user", "file", "for", "the", "user", "running", "this", "Gyp", "program", "." ]
def _CreateMSVSUserFile(proj_path, version, spec): """Generates a .user file for the user running this Gyp program. Arguments: proj_path: The path of the project file being created. The .user file shares the same path (with an appropriate suffix). version: The VisualStudioVersion object. ...
[ "def", "_CreateMSVSUserFile", "(", "proj_path", ",", "version", ",", "spec", ")", ":", "(", "domain", ",", "username", ")", "=", "_GetDomainAndUserName", "(", ")", "vcuser_filename", "=", "'.'", ".", "join", "(", "[", "proj_path", ",", "domain", ",", "user...
https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/generator/msvs.py#L965-L980
microsoft/ivy
9f3c7ecc0b2383129fdd0953e10890d98d09a82d
ivy/ivy_logic_utils.py
python
substitute_constants_ast
(ast,subs)
Substitute terms for *constants*. Here, subs is a dict from string names of constants to terms.
Substitute terms for *constants*. Here, subs is a dict from string names of constants to terms.
[ "Substitute", "terms", "for", "*", "constants", "*", ".", "Here", "subs", "is", "a", "dict", "from", "string", "names", "of", "constants", "to", "terms", "." ]
def substitute_constants_ast(ast,subs): """ Substitute terms for *constants*. Here, subs is a dict from string names of constants to terms. """ if is_constant(ast): return subs.get(ast.rep,ast) else: return ast.clone(substitute_constants_ast(x,subs) for x in ast.args)
[ "def", "substitute_constants_ast", "(", "ast", ",", "subs", ")", ":", "if", "is_constant", "(", "ast", ")", ":", "return", "subs", ".", "get", "(", "ast", ".", "rep", ",", "ast", ")", "else", ":", "return", "ast", ".", "clone", "(", "substitute_constan...
https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_logic_utils.py#L172-L180
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py
python
ResourceManager.cleanup_resources
(self, force=False)
Delete all extracted resource files and directories, returning a list of the file and directory names that could not be successfully removed. This function does not have any concurrency protection, so it should generally only be called when the extraction path is a temporary director...
[]
def cleanup_resources(self, force=False): """ Delete all extracted resource files and directories, returning a list of the file and directory names that could not be successfully removed. This function does not have any concurrency protection, so it should generally only be ...
[ "def", "cleanup_resources", "(", "self", ",", "force", "=", "False", ")", ":" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py#L2581-L2601
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/boost/boost_1_68_0/tools/build/src/build/feature.py
python
reset
()
Clear the module state. This is mainly for testing purposes.
Clear the module state. This is mainly for testing purposes.
[ "Clear", "the", "module", "state", ".", "This", "is", "mainly", "for", "testing", "purposes", "." ]
def reset (): """ Clear the module state. This is mainly for testing purposes. """ global __all_attributes, __all_features, __implicit_features, __composite_properties global __subfeature_from_value, __all_top_features, __free_features global __all_subfeatures # sets the default value of False ...
[ "def", "reset", "(", ")", ":", "global", "__all_attributes", ",", "__all_features", ",", "__implicit_features", ",", "__composite_properties", "global", "__subfeature_from_value", ",", "__all_top_features", ",", "__free_features", "global", "__all_subfeatures", "# sets the ...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/boost/boost_1_68_0/tools/build/src/build/feature.py#L85-L116
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
Validation/RecoTrack/python/plotting/validation.py
python
Sample.sample
(self)
return self._sample
Get the sample name
Get the sample name
[ "Get", "the", "sample", "name" ]
def sample(self): """Get the sample name""" return self._sample
[ "def", "sample", "(", "self", ")", ":", "return", "self", ".", "_sample" ]
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Validation/RecoTrack/python/plotting/validation.py#L534-L536
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py
python
_Enter
(data, frame_name, is_constant=False, parallel_iterations=10, use_ref=True, name=None)
Creates or finds a child frame, and makes `data` available to it. The unique `frame_name` is used by the `Executor` to identify frames. If `is_constant` is true, `data` is a constant in the child frame; otherwise it may be changed in the child frame. At most `parallel_iterations` iterations are run in parallel...
Creates or finds a child frame, and makes `data` available to it.
[ "Creates", "or", "finds", "a", "child", "frame", "and", "makes", "data", "available", "to", "it", "." ]
def _Enter(data, frame_name, is_constant=False, parallel_iterations=10, use_ref=True, name=None): """Creates or finds a child frame, and makes `data` available to it. The unique `frame_name` is used by the `Executor` to identify frames. If `is_constant` is true, `data` is a constant in the child frame...
[ "def", "_Enter", "(", "data", ",", "frame_name", ",", "is_constant", "=", "False", ",", "parallel_iterations", "=", "10", ",", "use_ref", "=", "True", ",", "name", "=", "None", ")", ":", "data", "=", "ops", ".", "convert_to_tensor_or_indexed_slices", "(", ...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py#L157-L201
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pkg_resources/__init__.py
python
invalid_marker
(text)
return False
Validate text as a PEP 508 environment marker; return an exception if invalid or False otherwise.
Validate text as a PEP 508 environment marker; return an exception if invalid or False otherwise.
[ "Validate", "text", "as", "a", "PEP", "508", "environment", "marker", ";", "return", "an", "exception", "if", "invalid", "or", "False", "otherwise", "." ]
def invalid_marker(text): """ Validate text as a PEP 508 environment marker; return an exception if invalid or False otherwise. """ try: evaluate_marker(text) except SyntaxError as e: e.filename = None e.lineno = None return e return False
[ "def", "invalid_marker", "(", "text", ")", ":", "try", ":", "evaluate_marker", "(", "text", ")", "except", "SyntaxError", "as", "e", ":", "e", ".", "filename", "=", "None", "e", ".", "lineno", "=", "None", "return", "e", "return", "False" ]
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pkg_resources/__init__.py#L1354-L1365
p4lang/p4c
3272e79369f20813cc1a555a5eb26f44432f84a4
tools/cpplint.py
python
CheckTrailingSemicolon
(filename, clean_lines, linenum, error)
Looks for redundant trailing semicolon. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Looks for redundant trailing semicolon.
[ "Looks", "for", "redundant", "trailing", "semicolon", "." ]
def CheckTrailingSemicolon(filename, clean_lines, linenum, error): """Looks for redundant trailing semicolon. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any error...
[ "def", "CheckTrailingSemicolon", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Block bodies should not be followed by a semicolon. Due to C++11", "# brace initialization, ther...
https://github.com/p4lang/p4c/blob/3272e79369f20813cc1a555a5eb26f44432f84a4/tools/cpplint.py#L4359-L4503