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
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/training/supervisor.py
python
Supervisor.stop
(self, threads=None, close_summary_writer=True, ignore_live_threads=False)
Stop the services and the coordinator. This does not close the session. Args: threads: Optional list of threads to join with the coordinator. If `None`, defaults to the threads running the standard services, the threads started for `QueueRunners`, and the threads started by the ...
Stop the services and the coordinator.
[ "Stop", "the", "services", "and", "the", "coordinator", "." ]
def stop(self, threads=None, close_summary_writer=True, ignore_live_threads=False): """Stop the services and the coordinator. This does not close the session. Args: threads: Optional list of threads to join with the coordinator. If `None`, defaults to the th...
[ "def", "stop", "(", "self", ",", "threads", "=", "None", ",", "close_summary_writer", "=", "True", ",", "ignore_live_threads", "=", "False", ")", ":", "self", ".", "_coord", ".", "request_stop", "(", ")", "try", ":", "# coord.join() re-raises the first reported ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/training/supervisor.py#L771-L808
nasa/fprime
595cf3682d8365943d86c1a6fe7c78f0a116acf0
Autocoders/Python/src/fprime_ac/generators/Protected.py
python
Protected.addVisitor
(self, visitor)
Add a visitor to the list of visitors. @param visitor: the visitor to add, must be derived from AbstractVisitor.
Add a visitor to the list of visitors.
[ "Add", "a", "visitor", "to", "the", "list", "of", "visitors", "." ]
def addVisitor(self, visitor): """ Add a visitor to the list of visitors. @param visitor: the visitor to add, must be derived from AbstractVisitor. """ if issubclass(visitor.__class__, AbstractVisitor.AbstractVisitor): self.__visitor_list.append(visitor) else:...
[ "def", "addVisitor", "(", "self", ",", "visitor", ")", ":", "if", "issubclass", "(", "visitor", ".", "__class__", ",", "AbstractVisitor", ".", "AbstractVisitor", ")", ":", "self", ".", "__visitor_list", ".", "append", "(", "visitor", ")", "else", ":", "DEB...
https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/Protected.py#L86-L99
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/framework/subscribe.py
python
_subscribe_new
(tensor, side_effects, control_cache)
return out
Helper method that subscribes a single tensor to a list of side_effects. Args: tensor: `tf.Tensor` side_effects: List of side_effect functions see subscribe for details. control_cache: `_ControlOutputCache` helper to get control_outputs faster. Returns: The modified replacement to the passed in te...
Helper method that subscribes a single tensor to a list of side_effects.
[ "Helper", "method", "that", "subscribes", "a", "single", "tensor", "to", "a", "list", "of", "side_effects", "." ]
def _subscribe_new(tensor, side_effects, control_cache): """Helper method that subscribes a single tensor to a list of side_effects. Args: tensor: `tf.Tensor` side_effects: List of side_effect functions see subscribe for details. control_cache: `_ControlOutputCache` helper to get control_outputs faster...
[ "def", "_subscribe_new", "(", "tensor", ",", "side_effects", ",", "control_cache", ")", ":", "update_input", "=", "[", "]", "for", "consumer_op", "in", "list", "(", "tensor", ".", "consumers", "(", ")", ")", ":", "# explicit copy", "update_input", ".", "appe...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/framework/subscribe.py#L105-L149
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/ops/data_flow_ops.py
python
ConditionalAccumulatorBase.dtype
(self)
return self._dtype
The datatype of the gradients accumulated by this accumulator.
The datatype of the gradients accumulated by this accumulator.
[ "The", "datatype", "of", "the", "gradients", "accumulated", "by", "this", "accumulator", "." ]
def dtype(self): """The datatype of the gradients accumulated by this accumulator.""" return self._dtype
[ "def", "dtype", "(", "self", ")", ":", "return", "self", ".", "_dtype" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/data_flow_ops.py#L1189-L1191
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/notebook/callback.py
python
PandasLogger.all_dataframes
(self)
return self._dataframes
Return a dict of dataframes
Return a dict of dataframes
[ "Return", "a", "dict", "of", "dataframes" ]
def all_dataframes(self): """Return a dict of dataframes """ return self._dataframes
[ "def", "all_dataframes", "(", "self", ")", ":", "return", "self", ".", "_dataframes" ]
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/notebook/callback.py#L120-L123
Genius-x/genius-x
9fc9f194e6d1fb92dd0e33d43db19ddb67cda7b0
cocos2d/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py
python
SourceRange.end
(self)
return conf.lib.clang_getRangeEnd(self)
Return a SourceLocation representing the last character within a source range.
Return a SourceLocation representing the last character within a source range.
[ "Return", "a", "SourceLocation", "representing", "the", "last", "character", "within", "a", "source", "range", "." ]
def end(self): """ Return a SourceLocation representing the last character within a source range. """ return conf.lib.clang_getRangeEnd(self)
[ "def", "end", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getRangeEnd", "(", "self", ")" ]
https://github.com/Genius-x/genius-x/blob/9fc9f194e6d1fb92dd0e33d43db19ddb67cda7b0/cocos2d/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L256-L261
wywu/LAB
4b6debd302ae109fd104d4dd04dccc3418ae7471
examples/pycaffe/layers/pascal_multilabel_datalayers.py
python
PascalMultilabelDataLayerSync.backward
(self, top, propagate_down, bottom)
These layers does not back propagate
These layers does not back propagate
[ "These", "layers", "does", "not", "back", "propagate" ]
def backward(self, top, propagate_down, bottom): """ These layers does not back propagate """ pass
[ "def", "backward", "(", "self", ",", "top", ",", "propagate_down", ",", "bottom", ")", ":", "pass" ]
https://github.com/wywu/LAB/blob/4b6debd302ae109fd104d4dd04dccc3418ae7471/examples/pycaffe/layers/pascal_multilabel_datalayers.py#L74-L78
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/transforms/hashes.py
python
HashFast.__init__
(self, num_buckets)
Initialize `CSVParser`. Args: num_buckets: The number of hash buckets to use.
Initialize `CSVParser`.
[ "Initialize", "CSVParser", "." ]
def __init__(self, num_buckets): """Initialize `CSVParser`. Args: num_buckets: The number of hash buckets to use. """ # TODO(soergel): allow seed? super(HashFast, self).__init__() self._num_buckets = num_buckets
[ "def", "__init__", "(", "self", ",", "num_buckets", ")", ":", "# TODO(soergel): allow seed?", "super", "(", "HashFast", ",", "self", ")", ".", "__init__", "(", ")", "self", ".", "_num_buckets", "=", "num_buckets" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/transforms/hashes.py#L29-L37
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_windows.py
python
VarHScrollHelper.GetVisibleColumnsBegin
(*args, **kwargs)
return _windows_.VarHScrollHelper_GetVisibleColumnsBegin(*args, **kwargs)
GetVisibleColumnsBegin(self) -> size_t
GetVisibleColumnsBegin(self) -> size_t
[ "GetVisibleColumnsBegin", "(", "self", ")", "-", ">", "size_t" ]
def GetVisibleColumnsBegin(*args, **kwargs): """GetVisibleColumnsBegin(self) -> size_t""" return _windows_.VarHScrollHelper_GetVisibleColumnsBegin(*args, **kwargs)
[ "def", "GetVisibleColumnsBegin", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "VarHScrollHelper_GetVisibleColumnsBegin", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L2348-L2350
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Arch/ArchSite.py
python
_ViewProviderSite.updateDeclination
(self,vobj)
Update the declination of the compass Update the declination by adding together how the site has been rotated within the document, and the rotation of the site compass.
Update the declination of the compass
[ "Update", "the", "declination", "of", "the", "compass" ]
def updateDeclination(self,vobj): """Update the declination of the compass Update the declination by adding together how the site has been rotated within the document, and the rotation of the site compass. """ if not hasattr(vobj, 'UpdateDeclination') or not vobj.UpdateDeclinat...
[ "def", "updateDeclination", "(", "self", ",", "vobj", ")", ":", "if", "not", "hasattr", "(", "vobj", ",", "'UpdateDeclination'", ")", "or", "not", "vobj", ".", "UpdateDeclination", ":", "return", "compassRotation", "=", "vobj", ".", "CompassRotation", ".", "...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchSite.py#L1079-L1090
google/tink
59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14
python/tink/core/_primitive_set.py
python
PrimitiveSet.add_primitive
(self, primitive: P, key: tink_pb2.Keyset.Key)
return entry
Adds a new primitive and key entry to the set, and returns the entry.
Adds a new primitive and key entry to the set, and returns the entry.
[ "Adds", "a", "new", "primitive", "and", "key", "entry", "to", "the", "set", "and", "returns", "the", "entry", "." ]
def add_primitive(self, primitive: P, key: tink_pb2.Keyset.Key) -> Entry: """Adds a new primitive and key entry to the set, and returns the entry.""" if not isinstance(primitive, self._primitive_class): raise _tink_error.TinkError( 'The primitive is not an instance of {}'.format( s...
[ "def", "add_primitive", "(", "self", ",", "primitive", ":", "P", ",", "key", ":", "tink_pb2", ".", "Keyset", ".", "Key", ")", "->", "Entry", ":", "if", "not", "isinstance", "(", "primitive", ",", "self", ".", "_primitive_class", ")", ":", "raise", "_ti...
https://github.com/google/tink/blob/59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14/python/tink/core/_primitive_set.py#L73-L85
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
components/cronet/tools/link_dependencies.py
python
extract_inputs
(query_result, prefix='')
return inputs
Extracts inputs from ninja query output. Given 'ninja -t query' output for a target, extracts all the inputs of that target, prefixing them with an optional prefix. Inputs prefixed with '|' are implicit, so we discard them as they shouldn't be linked into the resulting binary (these are things like the .ninja ...
Extracts inputs from ninja query output.
[ "Extracts", "inputs", "from", "ninja", "query", "output", "." ]
def extract_inputs(query_result, prefix=''): """Extracts inputs from ninja query output. Given 'ninja -t query' output for a target, extracts all the inputs of that target, prefixing them with an optional prefix. Inputs prefixed with '|' are implicit, so we discard them as they shouldn't be linked into the res...
[ "def", "extract_inputs", "(", "query_result", ",", "prefix", "=", "''", ")", ":", "extracting", "=", "False", "inputs", "=", "[", "]", "for", "line", "in", "query_result", ".", "splitlines", "(", ")", ":", "if", "line", ".", "startswith", "(", "' input:...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/components/cronet/tools/link_dependencies.py#L28-L70
chromiumembedded/cef
80caf947f3fe2210e5344713c5281d8af9bdc295
tools/cef_parser.py
python
obj_function.has_attrib
(self, name)
return name in self.attribs
Return true if the specified attribute exists.
Return true if the specified attribute exists.
[ "Return", "true", "if", "the", "specified", "attribute", "exists", "." ]
def has_attrib(self, name): """ Return true if the specified attribute exists. """ return name in self.attribs
[ "def", "has_attrib", "(", "self", ",", "name", ")", ":", "return", "name", "in", "self", ".", "attribs" ]
https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/cef_parser.py#L1169-L1171
bh107/bohrium
5b83e7117285fefc7779ed0e9acb0f8e74c7e068
bridge/npbackend/bohrium/loop.py
python
DynamicViewInfo.dims_with_changes
(self)
return self.dynamic_changes.keys()
Returns a list of all dimensions with dynamic changes.
Returns a list of all dimensions with dynamic changes.
[ "Returns", "a", "list", "of", "all", "dimensions", "with", "dynamic", "changes", "." ]
def dims_with_changes(self): """Returns a list of all dimensions with dynamic changes.""" return self.dynamic_changes.keys()
[ "def", "dims_with_changes", "(", "self", ")", ":", "return", "self", ".", "dynamic_changes", ".", "keys", "(", ")" ]
https://github.com/bh107/bohrium/blob/5b83e7117285fefc7779ed0e9acb0f8e74c7e068/bridge/npbackend/bohrium/loop.py#L201-L203
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/browser.py
python
ChildBrowserTreeItem.IsExpandable
(self)
return self.obj.children != {}
Return True if self.obj has nested objects.
Return True if self.obj has nested objects.
[ "Return", "True", "if", "self", ".", "obj", "has", "nested", "objects", "." ]
def IsExpandable(self): "Return True if self.obj has nested objects." return self.obj.children != {}
[ "def", "IsExpandable", "(", "self", ")", ":", "return", "self", ".", "obj", ".", "children", "!=", "{", "}" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/browser.py#L214-L216
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/aui/dockart.py
python
AuiDefaultDockArt.DrawCaption
(self, dc, window, text, rect, pane)
Draws the text in the pane caption. :param `dc`: a :class:`DC` device context; :param `window`: an instance of :class:`Window`; :param string `text`: the text to be displayed; :param Rect `rect`: the pane caption rectangle; :param `pane`: the pane for which the text is drawn.
Draws the text in the pane caption.
[ "Draws", "the", "text", "in", "the", "pane", "caption", "." ]
def DrawCaption(self, dc, window, text, rect, pane): """ Draws the text in the pane caption. :param `dc`: a :class:`DC` device context; :param `window`: an instance of :class:`Window`; :param string `text`: the text to be displayed; :param Rect `rect`: the pane caption r...
[ "def", "DrawCaption", "(", "self", ",", "dc", ",", "window", ",", "text", ",", "rect", ",", "pane", ")", ":", "dc", ".", "SetPen", "(", "wx", ".", "TRANSPARENT_PEN", ")", "dc", ".", "SetFont", "(", "self", ".", "_caption_font", ")", "self", ".", "D...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/dockart.py#L556-L604
JoseExposito/touchegg
1f3fda214358d071c05da4bf17c070c33d67b5eb
cmake/cpplint.py
python
_GetTextInside
(text, start_pattern)
return text[start_position:position - 1]
r"""Retrieves all the text between matching open and close parentheses. Given a string of lines and a regular expression string, retrieve all the text following the expression and between opening punctuation symbols like (, [, or {, and the matching close-punctuation symbol. This properly nested occurrences of...
r"""Retrieves all the text between matching open and close parentheses.
[ "r", "Retrieves", "all", "the", "text", "between", "matching", "open", "and", "close", "parentheses", "." ]
def _GetTextInside(text, start_pattern): r"""Retrieves all the text between matching open and close parentheses. Given a string of lines and a regular expression string, retrieve all the text following the expression and between opening punctuation symbols like (, [, or {, and the matching close-punctuation sy...
[ "def", "_GetTextInside", "(", "text", ",", "start_pattern", ")", ":", "# TODO(unknown): Audit cpplint.py to see what places could be profitably", "# rewritten to use _GetTextInside (and use inferior regexp matching today).", "# Give opening punctuations to get the matching close-punctuations.", ...
https://github.com/JoseExposito/touchegg/blob/1f3fda214358d071c05da4bf17c070c33d67b5eb/cmake/cpplint.py#L4600-L4653
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/ufunclike.py
python
_fix_out_named_y
(f)
return func
Allow the out argument to be passed as the name `y` (deprecated) This decorator should only be used if _deprecate_out_named_y is used on a corresponding dispatcher function.
Allow the out argument to be passed as the name `y` (deprecated)
[ "Allow", "the", "out", "argument", "to", "be", "passed", "as", "the", "name", "y", "(", "deprecated", ")" ]
def _fix_out_named_y(f): """ Allow the out argument to be passed as the name `y` (deprecated) This decorator should only be used if _deprecate_out_named_y is used on a corresponding dispatcher function. """ @functools.wraps(f) def func(x, out=None, **kwargs): if 'y' in kwargs: ...
[ "def", "_fix_out_named_y", "(", "f", ")", ":", "@", "functools", ".", "wraps", "(", "f", ")", "def", "func", "(", "x", ",", "out", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "'y'", "in", "kwargs", ":", "# we already did error checking in _de...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/ufunclike.py#L43-L57
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/graph_editor/reroute.py
python
_reroute_sgv_remap
(sgv0, sgv1, mode)
Remap in place the inputs of two subgraph views to mimic the reroute. This function is meant to used by reroute_inputs only. Args: sgv0: the first subgraph to have its inputs remapped. sgv1: the second subgraph to have its inputs remapped. mode: reroute mode, see _reroute_ts(...). Raises: TypeEr...
Remap in place the inputs of two subgraph views to mimic the reroute.
[ "Remap", "in", "place", "the", "inputs", "of", "two", "subgraph", "views", "to", "mimic", "the", "reroute", "." ]
def _reroute_sgv_remap(sgv0, sgv1, mode): """Remap in place the inputs of two subgraph views to mimic the reroute. This function is meant to used by reroute_inputs only. Args: sgv0: the first subgraph to have its inputs remapped. sgv1: the second subgraph to have its inputs remapped. mode: reroute m...
[ "def", "_reroute_sgv_remap", "(", "sgv0", ",", "sgv1", ",", "mode", ")", ":", "a2b", ",", "b2a", "=", "_RerouteMode", ".", "check", "(", "mode", ")", "if", "not", "isinstance", "(", "sgv0", ",", "_subgraph", ".", "SubGraphView", ")", ":", "raise", "Typ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/graph_editor/reroute.py#L259-L310
shogun-toolbox/shogun
9b8d856971af5a295dd6ad70623ae45647a6334c
applications/easysvm/esvm/experiment.py
python
train_and_test
(trainex,trainlab,testex,C,kname,kparam, seq_source, nuc_con)
return output
Trains a SVM with the given kernel, and predict on the test examples
Trains a SVM with the given kernel, and predict on the test examples
[ "Trains", "a", "SVM", "with", "the", "given", "kernel", "and", "predict", "on", "the", "test", "examples" ]
def train_and_test(trainex,trainlab,testex,C,kname,kparam, seq_source, nuc_con): """Trains a SVM with the given kernel, and predict on the test examples""" (svm, kernel, feats_train, preproc) = train(trainex,trainlab,C,kname,kparam,seq_source,nuc_con) (feats_test, preproc) = create_features(kname, testex, ...
[ "def", "train_and_test", "(", "trainex", ",", "trainlab", ",", "testex", ",", "C", ",", "kname", ",", "kparam", ",", "seq_source", ",", "nuc_con", ")", ":", "(", "svm", ",", "kernel", ",", "feats_train", ",", "preproc", ")", "=", "train", "(", "trainex...
https://github.com/shogun-toolbox/shogun/blob/9b8d856971af5a295dd6ad70623ae45647a6334c/applications/easysvm/esvm/experiment.py#L325-L344
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
Window.PopEventHandler
(*args, **kwargs)
return _core_.Window_PopEventHandler(*args, **kwargs)
PopEventHandler(self, bool deleteHandler=False) -> EvtHandler Removes and returns the top-most event handler on the event handler stack. If deleteHandler is True then the wx.EvtHandler object will be destroyed after it is popped, and ``None`` will be returned instead.
PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
[ "PopEventHandler", "(", "self", "bool", "deleteHandler", "=", "False", ")", "-", ">", "EvtHandler" ]
def PopEventHandler(*args, **kwargs): """ PopEventHandler(self, bool deleteHandler=False) -> EvtHandler Removes and returns the top-most event handler on the event handler stack. If deleteHandler is True then the wx.EvtHandler object will be destroyed after it is popped, and ``...
[ "def", "PopEventHandler", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_PopEventHandler", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L10404-L10412
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/polynomial/_polybase.py
python
ABCPolyBase.basis
(cls, deg, domain=None, window=None)
return cls([0]*ideg + [1], domain, window)
Series basis polynomial of degree `deg`. Returns the series representing the basis polynomial of degree `deg`. .. versionadded:: 1.7.0 Parameters ---------- deg : int Degree of the basis polynomial for the series. Must be >= 0. domain : {None, array_like}, ...
Series basis polynomial of degree `deg`.
[ "Series", "basis", "polynomial", "of", "degree", "deg", "." ]
def basis(cls, deg, domain=None, window=None): """Series basis polynomial of degree `deg`. Returns the series representing the basis polynomial of degree `deg`. .. versionadded:: 1.7.0 Parameters ---------- deg : int Degree of the basis polynomial for the s...
[ "def", "basis", "(", "cls", ",", "deg", ",", "domain", "=", "None", ",", "window", "=", "None", ")", ":", "if", "domain", "is", "None", ":", "domain", "=", "cls", ".", "domain", "if", "window", "is", "None", ":", "window", "=", "cls", ".", "windo...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/polynomial/_polybase.py#L960-L996
genn-team/genn
75e1eb218cafa228bf36ae4613d1ce26e877b12c
pygenn/genn_model.py
python
GeNNModel.add_current_source
(self, cs_name, current_source_model, pop, param_space, var_space)
return c_source
Add a current source to the GeNN model Args: cs_name -- name of the new current source current_source_model -- type of the CurrentSourceModels class as string or instance of CurrentSourceModels class de...
Add a current source to the GeNN model
[ "Add", "a", "current", "source", "to", "the", "GeNN", "model" ]
def add_current_source(self, cs_name, current_source_model, pop, param_space, var_space): """Add a current source to the GeNN model Args: cs_name -- name of the new current source current_source_model -- type of the CurrentSourceModels cla...
[ "def", "add_current_source", "(", "self", ",", "cs_name", ",", "current_source_model", ",", "pop", ",", "param_space", ",", "var_space", ")", ":", "if", "self", ".", "_built", ":", "raise", "Exception", "(", "\"GeNN model already built\"", ")", "if", "cs_name", ...
https://github.com/genn-team/genn/blob/75e1eb218cafa228bf36ae4613d1ce26e877b12c/pygenn/genn_model.py#L474-L509
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
python/mxnet/image/image.py
python
random_size_crop
(src, size, min_area, ratio, interp=2)
return center_crop(src, size, interp)
Randomly crop src with size. Randomize area and aspect ratio. Parameters ---------- src : NDArray Input image size : tuple of (int, int) Size of the crop formatted as (width, height). min_area : int Minimum area to be maintained after cropping ratio : tuple of (float, fl...
Randomly crop src with size. Randomize area and aspect ratio.
[ "Randomly", "crop", "src", "with", "size", ".", "Randomize", "area", "and", "aspect", "ratio", "." ]
def random_size_crop(src, size, min_area, ratio, interp=2): """Randomly crop src with size. Randomize area and aspect ratio. Parameters ---------- src : NDArray Input image size : tuple of (int, int) Size of the crop formatted as (width, height). min_area : int Minimum a...
[ "def", "random_size_crop", "(", "src", ",", "size", ",", "min_area", ",", "ratio", ",", "interp", "=", "2", ")", ":", "h", ",", "w", ",", "_", "=", "src", ".", "shape", "area", "=", "h", "*", "w", "for", "_", "in", "range", "(", "10", ")", ":...
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/image/image.py#L435-L479
baidu/bigflow
449245016c0df7d1252e85581e588bfc60cefad3
bigflow_python/python/bigflow/output.py
python
TextFile.transform_to_node
(self, ptype)
return node
内部接口
内部接口
[ "内部接口" ]
def transform_to_node(self, ptype): """ 内部接口 """ from bigflow.core import entity node = ptype.node() plan = node.plan() shuffle_scope = plan.shuffle(plan.global_scope(), [node]) node = shuffle_scope.node(0) if self.partition_fn is None: ...
[ "def", "transform_to_node", "(", "self", ",", "ptype", ")", ":", "from", "bigflow", ".", "core", "import", "entity", "node", "=", "ptype", ".", "node", "(", ")", "plan", "=", "node", ".", "plan", "(", ")", "shuffle_scope", "=", "plan", ".", "shuffle", ...
https://github.com/baidu/bigflow/blob/449245016c0df7d1252e85581e588bfc60cefad3/bigflow_python/python/bigflow/output.py#L243-L278
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/polynomial/laguerre.py
python
lagline
(off, scl)
Laguerre series whose graph is a straight line. Parameters ---------- off, scl : scalars The specified line is given by ``off + scl*x``. Returns ------- y : ndarray This module's representation of the Laguerre series for ``off + scl*x``. See Also -------- ...
Laguerre series whose graph is a straight line.
[ "Laguerre", "series", "whose", "graph", "is", "a", "straight", "line", "." ]
def lagline(off, scl) : """ Laguerre series whose graph is a straight line. Parameters ---------- off, scl : scalars The specified line is given by ``off + scl*x``. Returns ------- y : ndarray This module's representation of the Laguerre series for ``off + scl...
[ "def", "lagline", "(", "off", ",", "scl", ")", ":", "if", "scl", "!=", "0", ":", "return", "np", ".", "array", "(", "[", "off", "+", "scl", ",", "-", "scl", "]", ")", "else", ":", "return", "np", ".", "array", "(", "[", "off", "]", ")" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/polynomial/laguerre.py#L196-L229
zhaoweicai/mscnn
534bcac5710a579d60827f192035f7eef6d8c585
python/caffe/draw.py
python
draw_net_to_file
(caffe_net, filename, rankdir='LR', phase=None)
Draws a caffe net, and saves it to file using the format given as the file extension. Use '.raw' to output raw text that you can manually feed to graphviz to draw graphs. Parameters ---------- caffe_net : a caffe.proto.caffe_pb2.NetParameter protocol buffer. filename : string The path t...
Draws a caffe net, and saves it to file using the format given as the file extension. Use '.raw' to output raw text that you can manually feed to graphviz to draw graphs.
[ "Draws", "a", "caffe", "net", "and", "saves", "it", "to", "file", "using", "the", "format", "given", "as", "the", "file", "extension", ".", "Use", ".", "raw", "to", "output", "raw", "text", "that", "you", "can", "manually", "feed", "to", "graphviz", "t...
def draw_net_to_file(caffe_net, filename, rankdir='LR', phase=None): """Draws a caffe net, and saves it to file using the format given as the file extension. Use '.raw' to output raw text that you can manually feed to graphviz to draw graphs. Parameters ---------- caffe_net : a caffe.proto.caff...
[ "def", "draw_net_to_file", "(", "caffe_net", ",", "filename", ",", "rankdir", "=", "'LR'", ",", "phase", "=", "None", ")", ":", "ext", "=", "filename", "[", "filename", ".", "rfind", "(", "'.'", ")", "+", "1", ":", "]", "with", "open", "(", "filename...
https://github.com/zhaoweicai/mscnn/blob/534bcac5710a579d60827f192035f7eef6d8c585/python/caffe/draw.py#L226-L244
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/markdown/extensions/tables.py
python
TableExtension.extendMarkdown
(self, md, md_globals)
Add an instance of TableProcessor to BlockParser.
Add an instance of TableProcessor to BlockParser.
[ "Add", "an", "instance", "of", "TableProcessor", "to", "BlockParser", "." ]
def extendMarkdown(self, md, md_globals): """ Add an instance of TableProcessor to BlockParser. """ md.parser.blockprocessors.add('table', TableProcessor(md.parser), '<hashheader')
[ "def", "extendMarkdown", "(", "self", ",", "md", ",", "md_globals", ")", ":", "md", ".", "parser", ".", "blockprocessors", ".", "add", "(", "'table'", ",", "TableProcessor", "(", "md", ".", "parser", ")", ",", "'<hashheader'", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/markdown/extensions/tables.py#L124-L128
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/cmdline.py
python
ClassicOptionParser.add_action
(self, dash, dashdash, action_code)
Add a specialized option that is the action to execute.
Add a specialized option that is the action to execute.
[ "Add", "a", "specialized", "option", "that", "is", "the", "action", "to", "execute", "." ]
def add_action(self, dash, dashdash, action_code): """Add a specialized option that is the action to execute.""" option = self.add_option(dash, dashdash, action='callback', callback=self._append_action ) option.action_code = action_code
[ "def", "add_action", "(", "self", ",", "dash", ",", "dashdash", ",", "action_code", ")", ":", "option", "=", "self", ".", "add_option", "(", "dash", ",", "dashdash", ",", "action", "=", "'callback'", ",", "callback", "=", "self", ".", "_append_action", "...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/cmdline.py#L184-L189
lballabio/quantlib-old
136336947ed4fea9ecc1da6edad188700e821739
gensrc/gensrc/parameters/parameter.py
python
Value.default
(self)
return self.default_
Return the default value that was specified for this parameter in the event that no value is available - or None.
Return the default value that was specified for this parameter in the event that no value is available - or None.
[ "Return", "the", "default", "value", "that", "was", "specified", "for", "this", "parameter", "in", "the", "event", "that", "no", "value", "is", "available", "-", "or", "None", "." ]
def default(self): """Return the default value that was specified for this parameter in the event that no value is available - or None.""" return self.default_
[ "def", "default", "(", "self", ")", ":", "return", "self", ".", "default_" ]
https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/parameters/parameter.py#L68-L71
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/lmbrwaflib/cryengine_modules.py
python
CryDedicatedServer
(ctx, *k, **kw)
Wrapper for CryEngine Dedicated Servers
Wrapper for CryEngine Dedicated Servers
[ "Wrapper", "for", "CryEngine", "Dedicated", "Servers" ]
def CryDedicatedServer(ctx, *k, **kw): """ Wrapper for CryEngine Dedicated Servers """ apply_cryengine_module_defines(ctx, kw) active_projects = ctx.get_enabled_game_project_list() # enable ASAN and ASLR by default on dedicated server kw.setdefault('use_asan', True) kw.setdefault('use...
[ "def", "CryDedicatedServer", "(", "ctx", ",", "*", "k", ",", "*", "*", "kw", ")", ":", "apply_cryengine_module_defines", "(", "ctx", ",", "kw", ")", "active_projects", "=", "ctx", ".", "get_enabled_game_project_list", "(", ")", "# enable ASAN and ASLR by default o...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/cryengine_modules.py#L1589-L1606
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/arrayobj.py
python
make_array_flat_cls
(flatiterty)
return _make_flattening_iter_cls(flatiterty, 'flat')
Return the Structure representation of the given *flatiterty* (an instance of types.NumpyFlatType).
Return the Structure representation of the given *flatiterty* (an instance of types.NumpyFlatType).
[ "Return", "the", "Structure", "representation", "of", "the", "given", "*", "flatiterty", "*", "(", "an", "instance", "of", "types", ".", "NumpyFlatType", ")", "." ]
def make_array_flat_cls(flatiterty): """ Return the Structure representation of the given *flatiterty* (an instance of types.NumpyFlatType). """ return _make_flattening_iter_cls(flatiterty, 'flat')
[ "def", "make_array_flat_cls", "(", "flatiterty", ")", ":", "return", "_make_flattening_iter_cls", "(", "flatiterty", ",", "'flat'", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/arrayobj.py#L2479-L2484
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/coremodules/scenario/scenario.py
python
Scenario.set_filepath
(self, filepath)
A new filepath will set the shortname and workdir.
A new filepath will set the shortname and workdir.
[ "A", "new", "filepath", "will", "set", "the", "shortname", "and", "workdir", "." ]
def set_filepath(self, filepath): """ A new filepath will set the shortname and workdir. """ names = os.path.basename(filepath).split('.') dirname = os.path.dirname(filepath) if len(names) >= 3: rootname = '.'.join(names[:-2]) elif len(names) <= 2: ...
[ "def", "set_filepath", "(", "self", ",", "filepath", ")", ":", "names", "=", "os", ".", "path", ".", "basename", "(", "filepath", ")", ".", "split", "(", "'.'", ")", "dirname", "=", "os", ".", "path", ".", "dirname", "(", "filepath", ")", "if", "le...
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/scenario/scenario.py#L232-L245
seqan/seqan
f5f658343c366c9c3d44ba358ffc9317e78a09ed
util/py_lib/seqan/pyclangcheck/app.py
python
CollectViolationsVisitor.getCurrentClassName
(self)
return self.class_stack[-1].spelling
Returns name of current class.
Returns name of current class.
[ "Returns", "name", "of", "current", "class", "." ]
def getCurrentClassName(self): """Returns name of current class.""" if not self.class_stack: ## print 'CURRENT CLASS', None return None ## print 'CURRENT CLASS', self.class_stack[-1].spelling return self.class_stack[-1].spelling
[ "def", "getCurrentClassName", "(", "self", ")", ":", "if", "not", "self", ".", "class_stack", ":", "## print 'CURRENT CLASS', None", "return", "None", "## print 'CURRENT CLASS', self.class_stack[-1].spelling", "return", "self", ".", "class_stack", "[", "-", "1", "]", ...
https://github.com/seqan/seqan/blob/f5f658343c366c9c3d44ba358ffc9317e78a09ed/util/py_lib/seqan/pyclangcheck/app.py#L131-L137
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
deprecated/algorithms/sfm/dataset.py
python
DataSet._load_image_list
(self)
Load image list from image_list.txt or list image/ folder.
Load image list from image_list.txt or list image/ folder.
[ "Load", "image", "list", "from", "image_list", ".", "txt", "or", "list", "image", "/", "folder", "." ]
def _load_image_list(self): """Load image list from image_list.txt or list image/ folder.""" image_list_file = os.path.join(self.data_path, 'image_list.txt') if os.path.isfile(image_list_file): with io.open_rt(image_list_file) as fin: lines = fin.read().splitlines() ...
[ "def", "_load_image_list", "(", "self", ")", ":", "image_list_file", "=", "os", ".", "path", ".", "join", "(", "self", ".", "data_path", ",", "'image_list.txt'", ")", "if", "os", ".", "path", ".", "isfile", "(", "image_list_file", ")", ":", "with", "io",...
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/deprecated/algorithms/sfm/dataset.py#L48-L56
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
python/mozbuild/mozpack/packager/unpack.py
python
UnpackFinder._unjarize
(self, entry, relpath)
return mozpack.path.join(base, jar), entry
Transform a manifest entry pointing to chrome data in a jar in one pointing to the corresponding unpacked path. Return the jar path and the new entry.
Transform a manifest entry pointing to chrome data in a jar in one pointing to the corresponding unpacked path. Return the jar path and the new entry.
[ "Transform", "a", "manifest", "entry", "pointing", "to", "chrome", "data", "in", "a", "jar", "in", "one", "pointing", "to", "the", "corresponding", "unpacked", "path", ".", "Return", "the", "jar", "path", "and", "the", "new", "entry", "." ]
def _unjarize(self, entry, relpath): ''' Transform a manifest entry pointing to chrome data in a jar in one pointing to the corresponding unpacked path. Return the jar path and the new entry. ''' base = entry.base jar, relpath = urlparse(relpath).path.split('!', 1...
[ "def", "_unjarize", "(", "self", ",", "entry", ",", "relpath", ")", ":", "base", "=", "entry", ".", "base", "jar", ",", "relpath", "=", "urlparse", "(", "relpath", ")", ".", "path", ".", "split", "(", "'!'", ",", "1", ")", "entry", "=", "entry", ...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozpack/packager/unpack.py#L149-L160
facebookresearch/ELF
1f790173095cd910976d9f651b80beb872ec5d12
vendor/pybind11/tools/clang/cindex.py
python
File.name
(self)
return conf.lib.clang_getCString(conf.lib.clang_getFileName(self))
Return the complete file and path name of the file.
Return the complete file and path name of the file.
[ "Return", "the", "complete", "file", "and", "path", "name", "of", "the", "file", "." ]
def name(self): """Return the complete file and path name of the file.""" return conf.lib.clang_getCString(conf.lib.clang_getFileName(self))
[ "def", "name", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getCString", "(", "conf", ".", "lib", ".", "clang_getFileName", "(", "self", ")", ")" ]
https://github.com/facebookresearch/ELF/blob/1f790173095cd910976d9f651b80beb872ec5d12/vendor/pybind11/tools/clang/cindex.py#L2807-L2809
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/nn/functional/activation.py
python
hardtanh
(x, min=-1.0, max=1.0, name=None)
return out
r""" hardtanh activation .. math:: hardtanh(x)= \left\{ \begin{array}{cll} max,& & \text{if } x > max \\ min,& & \text{if } x < min \\ x,& & \text{otherwise} \end{array} \right. Par...
r""" hardtanh activation
[ "r", "hardtanh", "activation" ]
def hardtanh(x, min=-1.0, max=1.0, name=None): r""" hardtanh activation .. math:: hardtanh(x)= \left\{ \begin{array}{cll} max,& & \text{if } x > max \\ min,& & \text{if } x < min \\ x,& & \text{otherwise} ...
[ "def", "hardtanh", "(", "x", ",", "min", "=", "-", "1.0", ",", "max", "=", "1.0", ",", "name", "=", "None", ")", ":", "if", "in_dygraph_mode", "(", ")", ":", "return", "_C_ops", ".", "brelu", "(", "x", ",", "'t_min'", ",", "min", ",", "'t_max'", ...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/nn/functional/activation.py#L240-L290
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/lmbrwaflib/project_settings.py
python
_project_xenia_setting_entry
(ctx, project, entry)
return xenia_settings[entry]
Util function to load an entry from the projects.json file
Util function to load an entry from the projects.json file
[ "Util", "function", "to", "load", "an", "entry", "from", "the", "projects", ".", "json", "file" ]
def _project_xenia_setting_entry(ctx, project, entry): """ Util function to load an entry from the projects.json file """ xenia_settings = _project_setting_entry(ctx, project, 'xenia_settings') if not entry in xenia_settings: ctx.cry_file_error('Cannot find entry "%s" for project "%s"' % (...
[ "def", "_project_xenia_setting_entry", "(", "ctx", ",", "project", ",", "entry", ")", ":", "xenia_settings", "=", "_project_setting_entry", "(", "ctx", ",", "project", ",", "'xenia_settings'", ")", "if", "not", "entry", "in", "xenia_settings", ":", "ctx", ".", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/project_settings.py#L49-L60
Z3Prover/z3
d745d03afdfdf638d66093e2bfbacaf87187f35b
src/api/python/z3/z3.py
python
ArithRef.__rmul__
(self, other)
return ArithRef(_mk_bin(Z3_mk_mul, b, a), self.ctx)
Create the Z3 expression `other * self`. >>> x = Real('x') >>> 10 * x 10*x
Create the Z3 expression `other * self`.
[ "Create", "the", "Z3", "expression", "other", "*", "self", "." ]
def __rmul__(self, other): """Create the Z3 expression `other * self`. >>> x = Real('x') >>> 10 * x 10*x """ a, b = _coerce_exprs(self, other) return ArithRef(_mk_bin(Z3_mk_mul, b, a), self.ctx)
[ "def", "__rmul__", "(", "self", ",", "other", ")", ":", "a", ",", "b", "=", "_coerce_exprs", "(", "self", ",", "other", ")", "return", "ArithRef", "(", "_mk_bin", "(", "Z3_mk_mul", ",", "b", ",", "a", ")", ",", "self", ".", "ctx", ")" ]
https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L2421-L2429
martinrotter/textosaurus
4e2ad75abaf5b7e6a823766a2aa8a30f0c965cb8
src/libtextosaurus/3rd-party/scintilla-lt/scripts/FileGenerator.py
python
UpdateLineInPlistFile
(path, key, value)
Replace a single string value preceded by 'key' in an XML plist file.
Replace a single string value preceded by 'key' in an XML plist file.
[ "Replace", "a", "single", "string", "value", "preceded", "by", "key", "in", "an", "XML", "plist", "file", "." ]
def UpdateLineInPlistFile(path, key, value): """Replace a single string value preceded by 'key' in an XML plist file. """ lines = [] keyCurrent = "" with codecs.open(path, "rb", "utf-8") as f: for l in f.readlines(): ls = l.strip() if ls.startswith("<key>"): ...
[ "def", "UpdateLineInPlistFile", "(", "path", ",", "key", ",", "value", ")", ":", "lines", "=", "[", "]", "keyCurrent", "=", "\"\"", "with", "codecs", ".", "open", "(", "path", ",", "\"rb\"", ",", "\"utf-8\"", ")", "as", "f", ":", "for", "l", "in", ...
https://github.com/martinrotter/textosaurus/blob/4e2ad75abaf5b7e6a823766a2aa8a30f0c965cb8/src/libtextosaurus/3rd-party/scintilla-lt/scripts/FileGenerator.py#L140-L157
Z3Prover/z3
d745d03afdfdf638d66093e2bfbacaf87187f35b
src/api/python/z3/z3.py
python
When
(p, t, ctx=None)
return Tactic(Z3_tactic_when(t.ctx.ref(), p.probe, t.tactic), t.ctx)
Return a tactic that applies tactic `t` only if probe `p` evaluates to true. Otherwise, it returns the input goal unmodified. >>> t = When(Probe('size') > 2, Tactic('simplify')) >>> x, y = Ints('x y') >>> g = Goal() >>> g.add(x > 0) >>> g.add(y > 0) >>> t(g) [[x > 0, y > 0]] >>> g.a...
Return a tactic that applies tactic `t` only if probe `p` evaluates to true. Otherwise, it returns the input goal unmodified.
[ "Return", "a", "tactic", "that", "applies", "tactic", "t", "only", "if", "probe", "p", "evaluates", "to", "true", ".", "Otherwise", "it", "returns", "the", "input", "goal", "unmodified", "." ]
def When(p, t, ctx=None): """Return a tactic that applies tactic `t` only if probe `p` evaluates to true. Otherwise, it returns the input goal unmodified. >>> t = When(Probe('size') > 2, Tactic('simplify')) >>> x, y = Ints('x y') >>> g = Goal() >>> g.add(x > 0) >>> g.add(y > 0) >>> t(g)...
[ "def", "When", "(", "p", ",", "t", ",", "ctx", "=", "None", ")", ":", "p", "=", "_to_probe", "(", "p", ",", "ctx", ")", "t", "=", "_to_tactic", "(", "t", ",", "ctx", ")", "return", "Tactic", "(", "Z3_tactic_when", "(", "t", ".", "ctx", ".", "...
https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L8648-L8665
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/training/slot_creator.py
python
create_slot
(primary, val, name, colocate_with_primary=True)
Create a slot initialized to the given value. The type of the slot is determined by the given value. Args: primary: The primary `Variable` or `Tensor`. val: A `Tensor` specifying the initial value of the slot. name: Name to use for the slot variable. colocate_with_primary: Boolean. If True the sl...
Create a slot initialized to the given value.
[ "Create", "a", "slot", "initialized", "to", "the", "given", "value", "." ]
def create_slot(primary, val, name, colocate_with_primary=True): """Create a slot initialized to the given value. The type of the slot is determined by the given value. Args: primary: The primary `Variable` or `Tensor`. val: A `Tensor` specifying the initial value of the slot. name: Name to use for ...
[ "def", "create_slot", "(", "primary", ",", "val", ",", "name", ",", "colocate_with_primary", "=", "True", ")", ":", "# Scope the slot name in the namespace of the primary variable.", "# Set \"primary.op.name + '/' + name\" as default name, so the scope name of", "# optimizer can be s...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/training/slot_creator.py#L89-L115
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/ctc_ops.py
python
_forward_backward_log
(state_trans_log_probs, initial_state_log_probs, final_state_log_probs, observed_log_probs, sequence_length)
return fwd_bwd_log_probs, log_likelihood
Forward-backward algorithm computed in log domain. Args: state_trans_log_probs: tensor of shape [states, states] or if different transition matrix per batch [batch_size, states, states] initial_state_log_probs: tensor of shape [batch_size, states] final_state_log_probs: tensor of shape [batch_size,...
Forward-backward algorithm computed in log domain.
[ "Forward", "-", "backward", "algorithm", "computed", "in", "log", "domain", "." ]
def _forward_backward_log(state_trans_log_probs, initial_state_log_probs, final_state_log_probs, observed_log_probs, sequence_length): """Forward-backward algorithm computed in log domain. Args: state_trans_log_probs: tensor of shape [states, states] or if di...
[ "def", "_forward_backward_log", "(", "state_trans_log_probs", ",", "initial_state_log_probs", ",", "final_state_log_probs", ",", "observed_log_probs", ",", "sequence_length", ")", ":", "if", "state_trans_log_probs", ".", "shape", ".", "ndims", "==", "2", ":", "perm", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/ctc_ops.py#L1278-L1363
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/algorithms/jpsro.py
python
add_meta_dist
( meta_dists, meta_values, meta_solver, meta_game, per_player_repeats, ignore_repeats)
return meta_dist
Returns meta_dist.
Returns meta_dist.
[ "Returns", "meta_dist", "." ]
def add_meta_dist( meta_dists, meta_values, meta_solver, meta_game, per_player_repeats, ignore_repeats): """Returns meta_dist.""" num_players = meta_game.shape[0] meta_solver_func = _FLAG_TO_FUNC[meta_solver] meta_dist, _ = meta_solver_func( meta_game, per_player_repeats, ignore_repeats=ignore_rep...
[ "def", "add_meta_dist", "(", "meta_dists", ",", "meta_values", ",", "meta_solver", ",", "meta_game", ",", "per_player_repeats", ",", "ignore_repeats", ")", ":", "num_players", "=", "meta_game", ".", "shape", "[", "0", "]", "meta_solver_func", "=", "_FLAG_TO_FUNC",...
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/jpsro.py#L1162-L1180
blackberry/Boost
fc90c3fde129c62565c023f091eddc4a7ed9902b
tools/build/v2/build/targets.py
python
BasicTarget.generate_dependency_properties
(self, properties, ps)
return (result_properties, usage_requirements)
Takes a target reference, which might be either target id or a dependency property, and generates that target using 'property_set' as build request. Returns a tuple (result, usage_requirements).
Takes a target reference, which might be either target id or a dependency property, and generates that target using 'property_set' as build request.
[ "Takes", "a", "target", "reference", "which", "might", "be", "either", "target", "id", "or", "a", "dependency", "property", "and", "generates", "that", "target", "using", "property_set", "as", "build", "request", "." ]
def generate_dependency_properties(self, properties, ps): """ Takes a target reference, which might be either target id or a dependency property, and generates that target using 'property_set' as build request. Returns a tuple (result, usage_requirements). """ ...
[ "def", "generate_dependency_properties", "(", "self", ",", "properties", ",", "ps", ")", ":", "result_properties", "=", "[", "]", "usage_requirements", "=", "[", "]", "for", "p", "in", "properties", ":", "result", "=", "generate_from_reference", "(", "p", ".",...
https://github.com/blackberry/Boost/blob/fc90c3fde129c62565c023f091eddc4a7ed9902b/tools/build/v2/build/targets.py#L1062-L1080
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/utils/tensorboard/_pytorch_graph.py
python
graph
(model, args, verbose=False, use_strict_trace=True)
return GraphDef(node=list_of_nodes, versions=VersionDef(producer=22)), stepstats
This method processes a PyTorch model and produces a `GraphDef` proto that can be logged to TensorBoard. Args: model (PyTorch module): The model to be parsed. args (tuple): input tensor[s] for the model. verbose (bool): Whether to print out verbose information while processing. ...
This method processes a PyTorch model and produces a `GraphDef` proto that can be logged to TensorBoard.
[ "This", "method", "processes", "a", "PyTorch", "model", "and", "produces", "a", "GraphDef", "proto", "that", "can", "be", "logged", "to", "TensorBoard", "." ]
def graph(model, args, verbose=False, use_strict_trace=True): """ This method processes a PyTorch model and produces a `GraphDef` proto that can be logged to TensorBoard. Args: model (PyTorch module): The model to be parsed. args (tuple): input tensor[s] for the model. verbose (bool):...
[ "def", "graph", "(", "model", ",", "args", ",", "verbose", "=", "False", ",", "use_strict_trace", "=", "True", ")", ":", "with", "torch", ".", "onnx", ".", "select_model_mode_for_export", "(", "model", ",", "torch", ".", "onnx", ".", "TrainingMode", ".", ...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/utils/tensorboard/_pytorch_graph.py#L275-L313
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/layers/python/layers/target_column.py
python
regression_target
(label_name=None, weight_column_name=None, target_dimension=1)
return _RegressionTargetColumn(loss_fn=_mean_squared_loss, label_name=label_name, weight_column_name=weight_column_name, target_dimension=target_dimension)
Creates a _TargetColumn for linear regression. Args: label_name: String, name of the key in label dict. Can be null if label is a tensor (single headed models). weight_column_name: A string defining feature column name representing weights. It is used to down weight or boost examples during tra...
Creates a _TargetColumn for linear regression.
[ "Creates", "a", "_TargetColumn", "for", "linear", "regression", "." ]
def regression_target(label_name=None, weight_column_name=None, target_dimension=1): """Creates a _TargetColumn for linear regression. Args: label_name: String, name of the key in label dict. Can be null if label is a tensor (single headed models). weight...
[ "def", "regression_target", "(", "label_name", "=", "None", ",", "weight_column_name", "=", "None", ",", "target_dimension", "=", "1", ")", ":", "return", "_RegressionTargetColumn", "(", "loss_fn", "=", "_mean_squared_loss", ",", "label_name", "=", "label_name", "...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/layers/python/layers/target_column.py#L33-L52
stitchEm/stitchEm
0f399501d41ab77933677f2907f41f80ceb704d7
lib/bindings/samples/server/output/stream_output.py
python
StreamOutput._writer_error_is_recoverable
(self, payload_message)
return False
check if we restart the output or we stop here default behavior is stopping
check if we restart the output or we stop here default behavior is stopping
[ "check", "if", "we", "restart", "the", "output", "or", "we", "stop", "here", "default", "behavior", "is", "stopping" ]
def _writer_error_is_recoverable(self, payload_message): """ check if we restart the output or we stop here default behavior is stopping """ # payload is (writer_name, error_stringcode) if payload_message == STREAMING_ERROR_NETWORK_ERROR: return True r...
[ "def", "_writer_error_is_recoverable", "(", "self", ",", "payload_message", ")", ":", "# payload is (writer_name, error_stringcode)", "if", "payload_message", "==", "STREAMING_ERROR_NETWORK_ERROR", ":", "return", "True", "return", "False" ]
https://github.com/stitchEm/stitchEm/blob/0f399501d41ab77933677f2907f41f80ceb704d7/lib/bindings/samples/server/output/stream_output.py#L34-L42
MythTV/mythtv
d282a209cb8be85d036f85a62a8ec971b67d45f4
mythtv/programs/scripts/metadata/Music/musicbrainzngs/musicbrainz.py
python
get_instrument_by_id
(id, includes=[], release_status=[], release_type=[])
return _do_mb_query("instrument", id, includes, params)
Get the instrument with the MusicBrainz `id` as a dict with an 'artist' key. *Available includes*: {includes}
Get the instrument with the MusicBrainz `id` as a dict with an 'artist' key.
[ "Get", "the", "instrument", "with", "the", "MusicBrainz", "id", "as", "a", "dict", "with", "an", "artist", "key", "." ]
def get_instrument_by_id(id, includes=[], release_status=[], release_type=[]): """Get the instrument with the MusicBrainz `id` as a dict with an 'artist' key. *Available includes*: {includes}""" params = _check_filter_and_make_params("instrument", includes, releas...
[ "def", "get_instrument_by_id", "(", "id", ",", "includes", "=", "[", "]", ",", "release_status", "=", "[", "]", ",", "release_type", "=", "[", "]", ")", ":", "params", "=", "_check_filter_and_make_params", "(", "\"instrument\"", ",", "includes", ",", "releas...
https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/metadata/Music/musicbrainzngs/musicbrainz.py#L804-L810
chatopera/clause
dee31153d5ffdef33deedb6bff03e7806c296968
var/assets/clients/gen-py/clause/Serving.py
python
Client.postSysDict
(self, request)
return self.recv_postSysDict()
Parameters: - request
Parameters: - request
[ "Parameters", ":", "-", "request" ]
def postSysDict(self, request): """ Parameters: - request """ self.send_postSysDict(request) return self.recv_postSysDict()
[ "def", "postSysDict", "(", "self", ",", "request", ")", ":", "self", ".", "send_postSysDict", "(", "request", ")", "return", "self", ".", "recv_postSysDict", "(", ")" ]
https://github.com/chatopera/clause/blob/dee31153d5ffdef33deedb6bff03e7806c296968/var/assets/clients/gen-py/clause/Serving.py#L542-L549
amrayn/easyloggingpp
8489989bb26c6371df103f6cbced3fbee1bc3c2f
tools/cpplint.py
python
ProcessFile
(filename, vlevel, extra_check_functions=[])
Does google-lint on a single file. Args: filename: The name of the file to parse. vlevel: The level of errors to report. Every error of confidence >= verbose_level will be reported. 0 is a good default. extra_check_functions: An array of additional check functions that will be ...
Does google-lint on a single file.
[ "Does", "google", "-", "lint", "on", "a", "single", "file", "." ]
def ProcessFile(filename, vlevel, extra_check_functions=[]): """Does google-lint on a single file. Args: filename: The name of the file to parse. vlevel: The level of errors to report. Every error of confidence >= verbose_level will be reported. 0 is a good default. extra_check_functions: An ar...
[ "def", "ProcessFile", "(", "filename", ",", "vlevel", ",", "extra_check_functions", "=", "[", "]", ")", ":", "_SetVerboseLevel", "(", "vlevel", ")", "try", ":", "# Support the UNIX convention of using \"-\" for stdin. Note that", "# we are not opening the file with universal...
https://github.com/amrayn/easyloggingpp/blob/8489989bb26c6371df103f6cbced3fbee1bc3c2f/tools/cpplint.py#L4563-L4629
Slicer/SlicerGitSVNArchive
65e92bb16c2b32ea47a1a66bee71f238891ee1ca
Modules/Scripted/EditorLib/EditUtil.py
python
EditUtil.getCompositeNode
(layoutName='Red')
use the Red slice composite node to define the active volumes
use the Red slice composite node to define the active volumes
[ "use", "the", "Red", "slice", "composite", "node", "to", "define", "the", "active", "volumes" ]
def getCompositeNode(layoutName='Red'): """ use the Red slice composite node to define the active volumes """ count = slicer.mrmlScene.GetNumberOfNodesByClass('vtkMRMLSliceCompositeNode') for n in range(count): compNode = slicer.mrmlScene.GetNthNodeByClass(n, 'vtkMRMLSliceCompositeNode') if comp...
[ "def", "getCompositeNode", "(", "layoutName", "=", "'Red'", ")", ":", "count", "=", "slicer", ".", "mrmlScene", ".", "GetNumberOfNodesByClass", "(", "'vtkMRMLSliceCompositeNode'", ")", "for", "n", "in", "range", "(", "count", ")", ":", "compNode", "=", "slicer...
https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Modules/Scripted/EditorLib/EditUtil.py#L78-L84
ValveSoftware/source-sdk-2013
0d8dceea4310fde5706b3ce1c70609d72a38efdf
mp/src/thirdparty/protobuf-2.3.0/python/mox.py
python
MockMethod.GetPossibleGroup
(self)
return group
Returns a possible group from the end of the call queue or None if no other methods are on the stack.
Returns a possible group from the end of the call queue or None if no other methods are on the stack.
[ "Returns", "a", "possible", "group", "from", "the", "end", "of", "the", "call", "queue", "or", "None", "if", "no", "other", "methods", "are", "on", "the", "stack", "." ]
def GetPossibleGroup(self): """Returns a possible group from the end of the call queue or None if no other methods are on the stack. """ # Remove this method from the tail of the queue so we can add it to a group. this_method = self._call_queue.pop() assert this_method == self # Determine ...
[ "def", "GetPossibleGroup", "(", "self", ")", ":", "# Remove this method from the tail of the queue so we can add it to a group.", "this_method", "=", "self", ".", "_call_queue", ".", "pop", "(", ")", "assert", "this_method", "==", "self", "# Determine if the tail of the queue...
https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/thirdparty/protobuf-2.3.0/python/mox.py#L645-L662
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/Script/SConscript.py
python
get_calling_namespaces
()
return frame.f_locals, frame.f_globals
Return the locals and globals for the function that called into this module in the current call stack.
Return the locals and globals for the function that called into this module in the current call stack.
[ "Return", "the", "locals", "and", "globals", "for", "the", "function", "that", "called", "into", "this", "module", "in", "the", "current", "call", "stack", "." ]
def get_calling_namespaces(): """Return the locals and globals for the function that called into this module in the current call stack.""" try: 1//0 except ZeroDivisionError: # Don't start iterating with the current stack-frame to # prevent creating reference cycles (f_back is safe). ...
[ "def", "get_calling_namespaces", "(", ")", ":", "try", ":", "1", "//", "0", "except", "ZeroDivisionError", ":", "# Don't start iterating with the current stack-frame to", "# prevent creating reference cycles (f_back is safe).", "frame", "=", "sys", ".", "exc_info", "(", ")"...
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Script/SConscript.py#L63-L82
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/linalg/decomp_lu.py
python
lu_factor
(a, overwrite_a=False, check_finite=True)
return lu, piv
Compute pivoted LU decomposition of a matrix. The decomposition is:: A = P L U where P is a permutation matrix, L lower triangular with unit diagonal elements, and U upper triangular. Parameters ---------- a : (M, M) array_like Matrix to decompose overwrite_a : bool, opti...
Compute pivoted LU decomposition of a matrix.
[ "Compute", "pivoted", "LU", "decomposition", "of", "a", "matrix", "." ]
def lu_factor(a, overwrite_a=False, check_finite=True): """ Compute pivoted LU decomposition of a matrix. The decomposition is:: A = P L U where P is a permutation matrix, L lower triangular with unit diagonal elements, and U upper triangular. Parameters ---------- a : (M, M)...
[ "def", "lu_factor", "(", "a", ",", "overwrite_a", "=", "False", ",", "check_finite", "=", "True", ")", ":", "if", "check_finite", ":", "a1", "=", "asarray_chkfinite", "(", "a", ")", "else", ":", "a1", "=", "asarray", "(", "a", ")", "if", "len", "(", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/linalg/decomp_lu.py#L17-L72
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/ftplib.py
python
FTP.retrlines
(self, cmd, callback = None)
return self.voidresp()
Retrieve data in line mode. A new port is created for you. Args: cmd: A RETR, LIST, NLST, or MLSD command. callback: An optional single parameter callable that is called for each line with the trailing CRLF stripped. [default: print_line()] ...
Retrieve data in line mode. A new port is created for you.
[ "Retrieve", "data", "in", "line", "mode", ".", "A", "new", "port", "is", "created", "for", "you", "." ]
def retrlines(self, cmd, callback = None): """Retrieve data in line mode. A new port is created for you. Args: cmd: A RETR, LIST, NLST, or MLSD command. callback: An optional single parameter callable that is called for each line with the trailing CRLF stripped....
[ "def", "retrlines", "(", "self", ",", "cmd", ",", "callback", "=", "None", ")", ":", "if", "callback", "is", "None", ":", "callback", "=", "print_line", "resp", "=", "self", ".", "sendcmd", "(", "'TYPE A'", ")", "conn", "=", "self", ".", "transfercmd",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/ftplib.py#L418-L446
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/dataset/text/utils.py
python
Vocab.vocab
(self)
return self.c_vocab.vocab()
Get the vocabory table in dict type. Returns: A vocabulary consisting of word and id pairs. Examples: >>> vocab = text.Vocab.from_list(["word_1", "word_2", "word_3", "word_4"]) >>> vocabory_dict = vocab.vocab()
Get the vocabory table in dict type.
[ "Get", "the", "vocabory", "table", "in", "dict", "type", "." ]
def vocab(self): """ Get the vocabory table in dict type. Returns: A vocabulary consisting of word and id pairs. Examples: >>> vocab = text.Vocab.from_list(["word_1", "word_2", "word_3", "word_4"]) >>> vocabory_dict = vocab.vocab() """ ...
[ "def", "vocab", "(", "self", ")", ":", "check_vocab", "(", "self", ".", "c_vocab", ")", "return", "self", ".", "c_vocab", ".", "vocab", "(", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/text/utils.py#L44-L56
rsummers11/CADLab
976ed959a0b5208bb4173127a7ef732ac73a9b6f
panreas_hnn/hed-globalweight/python/caffe/pycaffe.py
python
_Net_batch
(self, blobs)
Batch blob lists according to net's batch size. Parameters ---------- blobs: Keys blob names and values are lists of blobs (of any length). Naturally, all the lists should have the same length. Yields ------ batch: {blob name: list of blobs} dict for a single batch.
Batch blob lists according to net's batch size.
[ "Batch", "blob", "lists", "according", "to", "net", "s", "batch", "size", "." ]
def _Net_batch(self, blobs): """ Batch blob lists according to net's batch size. Parameters ---------- blobs: Keys blob names and values are lists of blobs (of any length). Naturally, all the lists should have the same length. Yields ------ batch: {blob name: list of blobs} ...
[ "def", "_Net_batch", "(", "self", ",", "blobs", ")", ":", "num", "=", "len", "(", "blobs", ".", "itervalues", "(", ")", ".", "next", "(", ")", ")", "batch_size", "=", "self", ".", "blobs", ".", "itervalues", "(", ")", ".", "next", "(", ")", ".", ...
https://github.com/rsummers11/CADLab/blob/976ed959a0b5208bb4173127a7ef732ac73a9b6f/panreas_hnn/hed-globalweight/python/caffe/pycaffe.py#L247-L278
jsupancic/deep_hand_pose
22cbeae1a8410ff5d37c060c7315719d0a5d608f
scripts/cpp_lint.py
python
GetHeaderGuardCPPVariable
(filename)
return re.sub(r'[-./\s]', '_', file_path_from_root).upper() + '_'
Returns the CPP variable that should be used as a header guard. Args: filename: The name of a C++ header file. Returns: The CPP variable that should be used as a header guard in the named file.
Returns the CPP variable that should be used as a header guard.
[ "Returns", "the", "CPP", "variable", "that", "should", "be", "used", "as", "a", "header", "guard", "." ]
def GetHeaderGuardCPPVariable(filename): """Returns the CPP variable that should be used as a header guard. Args: filename: The name of a C++ header file. Returns: The CPP variable that should be used as a header guard in the named file. """ # Restores original filename in case that cpplint is...
[ "def", "GetHeaderGuardCPPVariable", "(", "filename", ")", ":", "# Restores original filename in case that cpplint is invoked from Emacs's", "# flymake.", "filename", "=", "re", ".", "sub", "(", "r'_flymake\\.h$'", ",", "'.h'", ",", "filename", ")", "filename", "=", "re", ...
https://github.com/jsupancic/deep_hand_pose/blob/22cbeae1a8410ff5d37c060c7315719d0a5d608f/scripts/cpp_lint.py#L1384-L1405
hfinkel/llvm-project-cxxjit
91084ef018240bbb8e24235ff5cd8c355a9c1a1e
lldb/examples/python/gdbremote.py
python
TerminalColors.underline
(self, on=True)
return ''
Enable or disable underline depending on the "on" parameter.
Enable or disable underline depending on the "on" parameter.
[ "Enable", "or", "disable", "underline", "depending", "on", "the", "on", "parameter", "." ]
def underline(self, on=True): '''Enable or disable underline depending on the "on" parameter.''' if self.enabled: if on: return "\x1b[4m" else: return "\x1b[24m" return ''
[ "def", "underline", "(", "self", ",", "on", "=", "True", ")", ":", "if", "self", ".", "enabled", ":", "if", "on", ":", "return", "\"\\x1b[4m\"", "else", ":", "return", "\"\\x1b[24m\"", "return", "''" ]
https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/lldb/examples/python/gdbremote.py#L73-L80
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/richtext.py
python
TextAttrBorder.SetFlags
(*args, **kwargs)
return _richtext.TextAttrBorder_SetFlags(*args, **kwargs)
SetFlags(self, int flags)
SetFlags(self, int flags)
[ "SetFlags", "(", "self", "int", "flags", ")" ]
def SetFlags(*args, **kwargs): """SetFlags(self, int flags)""" return _richtext.TextAttrBorder_SetFlags(*args, **kwargs)
[ "def", "SetFlags", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "TextAttrBorder_SetFlags", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L410-L412
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/richtext.py
python
RichTextObject.Draw
(*args, **kwargs)
return _richtext.RichTextObject_Draw(*args, **kwargs)
Draw(self, DC dc, RichTextDrawingContext context, RichTextRange range, wxRichTextSelection selection, Rect rect, int descent, int style) -> bool
Draw(self, DC dc, RichTextDrawingContext context, RichTextRange range, wxRichTextSelection selection, Rect rect, int descent, int style) -> bool
[ "Draw", "(", "self", "DC", "dc", "RichTextDrawingContext", "context", "RichTextRange", "range", "wxRichTextSelection", "selection", "Rect", "rect", "int", "descent", "int", "style", ")", "-", ">", "bool" ]
def Draw(*args, **kwargs): """ Draw(self, DC dc, RichTextDrawingContext context, RichTextRange range, wxRichTextSelection selection, Rect rect, int descent, int style) -> bool """ return _richtext.RichTextObject_Draw(*args, **kwargs)
[ "def", "Draw", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextObject_Draw", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L1164-L1170
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/tornado/tornado-6/tornado/routing.py
python
URLSpec.__init__
( self, pattern: Union[str, Pattern], handler: Any, kwargs: Optional[Dict[str, Any]] = None, name: Optional[str] = None, )
Parameters: * ``pattern``: Regular expression to be matched. Any capturing groups in the regex will be passed in to the handler's get/post/etc methods as arguments (by keyword if named, by position if unnamed. Named and unnamed capturing groups may not be mixed in the sa...
Parameters:
[ "Parameters", ":" ]
def __init__( self, pattern: Union[str, Pattern], handler: Any, kwargs: Optional[Dict[str, Any]] = None, name: Optional[str] = None, ) -> None: """Parameters: * ``pattern``: Regular expression to be matched. Any capturing groups in the regex will be...
[ "def", "__init__", "(", "self", ",", "pattern", ":", "Union", "[", "str", ",", "Pattern", "]", ",", "handler", ":", "Any", ",", "kwargs", ":", "Optional", "[", "Dict", "[", "str", ",", "Any", "]", "]", "=", "None", ",", "name", ":", "Optional", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/routing.py#L657-L686
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/timeseries/python/timeseries/estimators.py
python
TimeSeriesRegressor.build_raw_serving_input_receiver_fn
(self, default_batch_size=None, default_series_length=None)
return _serving_input_receiver_fn
Build an input_receiver_fn for export_savedmodel which accepts arrays. Automatically creates placeholders for exogenous `FeatureColumn`s passed to the model. Args: default_batch_size: If specified, must be a scalar integer. Sets the batch size in the static shape information of all feature T...
Build an input_receiver_fn for export_savedmodel which accepts arrays.
[ "Build", "an", "input_receiver_fn", "for", "export_savedmodel", "which", "accepts", "arrays", "." ]
def build_raw_serving_input_receiver_fn(self, default_batch_size=None, default_series_length=None): """Build an input_receiver_fn for export_savedmodel which accepts arrays. Automatically creates placeholders for exogenous `Fea...
[ "def", "build_raw_serving_input_receiver_fn", "(", "self", ",", "default_batch_size", "=", "None", ",", "default_series_length", "=", "None", ")", ":", "def", "_serving_input_receiver_fn", "(", ")", ":", "\"\"\"A receiver function to be passed to export_savedmodel.\"\"\"", "p...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/timeseries/python/timeseries/estimators.py#L224-L299
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
Rect.GetTopRight
(*args, **kwargs)
return _core_.Rect_GetTopRight(*args, **kwargs)
GetTopRight(self) -> Point
GetTopRight(self) -> Point
[ "GetTopRight", "(", "self", ")", "-", ">", "Point" ]
def GetTopRight(*args, **kwargs): """GetTopRight(self) -> Point""" return _core_.Rect_GetTopRight(*args, **kwargs)
[ "def", "GetTopRight", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Rect_GetTopRight", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L1337-L1339
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
python/artm/hierarchy_utils.py
python
hARTM.del_level
(self, level_idx)
:Description: removes i-th level and all following levels. :param int level_idx: the number of level from what to start removing if -1, the last level is removed
:Description: removes i-th level and all following levels.
[ ":", "Description", ":", "removes", "i", "-", "th", "level", "and", "all", "following", "levels", "." ]
def del_level(self, level_idx): """ :Description: removes i-th level and all following levels. :param int level_idx: the number of level from what to start removing if -1, the last level is removed """ if level_idx == -1: del self._levels[-1] ...
[ "def", "del_level", "(", "self", ",", "level_idx", ")", ":", "if", "level_idx", "==", "-", "1", ":", "del", "self", ".", "_levels", "[", "-", "1", "]", "return", "for", "_", "in", "range", "(", "level_idx", ",", "len", "(", "self", ".", "_levels", ...
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/python/artm/hierarchy_utils.py#L288-L299
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/dexml/fields.py
python
Field.parse_attributes
(self,obj,attrs)
return attrs
Parse any attributes for this field from the given list. This method will be called with the Model instance being parsed and a list of attribute nodes from its XML tag. Any attributes of interest to this field should be processed, and a list of the unused attribute nodes returned.
Parse any attributes for this field from the given list.
[ "Parse", "any", "attributes", "for", "this", "field", "from", "the", "given", "list", "." ]
def parse_attributes(self,obj,attrs): """Parse any attributes for this field from the given list. This method will be called with the Model instance being parsed and a list of attribute nodes from its XML tag. Any attributes of interest to this field should be processed, and a list of...
[ "def", "parse_attributes", "(", "self", ",", "obj", ",", "attrs", ")", ":", "return", "attrs" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/dexml/fields.py#L61-L69
yyzybb537/libgo
4af17b7c67643c4d54aa354dcc77963ea07847d0
third_party/boost.context/tools/build/src/build/project.py
python
ProjectRegistry.current
(self)
return self.current_project
Returns the project which is currently being loaded.
Returns the project which is currently being loaded.
[ "Returns", "the", "project", "which", "is", "currently", "being", "loaded", "." ]
def current(self): """Returns the project which is currently being loaded.""" return self.current_project
[ "def", "current", "(", "self", ")", ":", "return", "self", ".", "current_project" ]
https://github.com/yyzybb537/libgo/blob/4af17b7c67643c4d54aa354dcc77963ea07847d0/third_party/boost.context/tools/build/src/build/project.py#L530-L532
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2/instanceinfo.py
python
InstanceInfo.__init__
(self, connection=None, id=None, state=None)
:ivar str id: The instance's EC2 ID. :ivar str state: Specifies the current status of the instance.
:ivar str id: The instance's EC2 ID. :ivar str state: Specifies the current status of the instance.
[ ":", "ivar", "str", "id", ":", "The", "instance", "s", "EC2", "ID", ".", ":", "ivar", "str", "state", ":", "Specifies", "the", "current", "status", "of", "the", "instance", "." ]
def __init__(self, connection=None, id=None, state=None): """ :ivar str id: The instance's EC2 ID. :ivar str state: Specifies the current status of the instance. """ self.connection = connection self.id = id self.state = state
[ "def", "__init__", "(", "self", ",", "connection", "=", "None", ",", "id", "=", "None", ",", "state", "=", "None", ")", ":", "self", ".", "connection", "=", "connection", "self", ".", "id", "=", "id", "self", ".", "state", "=", "state" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2/instanceinfo.py#L28-L35
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/jar.py
python
JarMaker.processJarSection
(self, jarfile, lines, jardir)
return
Internal method called by makeJar to actually process a section of a jar.mn file. jarfile is the basename of the jarfile or the directory name for flat output, lines is a PushbackIter of the lines of jar.mn, the remaining options are carried over from makeJar.
Internal method called by makeJar to actually process a section of a jar.mn file.
[ "Internal", "method", "called", "by", "makeJar", "to", "actually", "process", "a", "section", "of", "a", "jar", ".", "mn", "file", "." ]
def processJarSection(self, jarfile, lines, jardir): '''Internal method called by makeJar to actually process a section of a jar.mn file. jarfile is the basename of the jarfile or the directory name for flat output, lines is a PushbackIter of the lines of jar.mn, the remaining o...
[ "def", "processJarSection", "(", "self", ",", "jarfile", ",", "lines", ",", "jardir", ")", ":", "# chromebasepath is used for chrome registration manifests", "# {0} is getting replaced with chrome/ for chrome.manifest, and with", "# an empty string for jarfile.manifest", "chromebasepat...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/jar.py#L279-L356
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/util/math.py
python
clamp
(val, minval, maxval)
return min(maxval, max(minval, val))
clamps val to be at least minval, and at most maxval. >>> clamp(9, 3, 7) 7 >>> clamp(1, 3, 7) 3 >>> clamp(5, 3, 7) 5
clamps val to be at least minval, and at most maxval.
[ "clamps", "val", "to", "be", "at", "least", "minval", "and", "at", "most", "maxval", "." ]
def clamp(val, minval, maxval): """ clamps val to be at least minval, and at most maxval. >>> clamp(9, 3, 7) 7 >>> clamp(1, 3, 7) 3 >>> clamp(5, 3, 7) 5 """ return min(maxval, max(minval, val))
[ "def", "clamp", "(", "val", ",", "minval", ",", "maxval", ")", ":", "return", "min", "(", "maxval", ",", "max", "(", "minval", ",", "val", ")", ")" ]
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/util/math.py#L17-L28
OpenXRay/xray-15
1390dfb08ed20997d7e8c95147ea8e8cb71f5e86
cs/sdk/3d_sdk/maya/ver-8.5/devkit/plug-ins/scripted/slopeShader.py
python
slopeShaderBehavior.connectNodeToNode
(self, sourceNode, destinationNode, force)
Overloaded function from MPxDragAndDropBehavior this method will handle the connection between the slopeShader and the shader it is assigned to as well as any meshes that it is assigned to.
Overloaded function from MPxDragAndDropBehavior this method will handle the connection between the slopeShader and the shader it is assigned to as well as any meshes that it is assigned to.
[ "Overloaded", "function", "from", "MPxDragAndDropBehavior", "this", "method", "will", "handle", "the", "connection", "between", "the", "slopeShader", "and", "the", "shader", "it", "is", "assigned", "to", "as", "well", "as", "any", "meshes", "that", "it", "is", ...
def connectNodeToNode(self, sourceNode, destinationNode, force): """ Overloaded function from MPxDragAndDropBehavior this method will handle the connection between the slopeShader and the shader it is assigned to as well as any meshes that it is assigned to. """ src = OpenMaya.MFnDependencyNode(sourceNode) ...
[ "def", "connectNodeToNode", "(", "self", ",", "sourceNode", ",", "destinationNode", ",", "force", ")", ":", "src", "=", "OpenMaya", ".", "MFnDependencyNode", "(", "sourceNode", ")", "#if we are dragging from a lambert", "#we want to check what we are dragging", "#onto.", ...
https://github.com/OpenXRay/xray-15/blob/1390dfb08ed20997d7e8c95147ea8e8cb71f5e86/cs/sdk/3d_sdk/maya/ver-8.5/devkit/plug-ins/scripted/slopeShader.py#L220-L315
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exodus3.in.py
python
exodus.get_node_set_dist_facts
(self, object_id)
return node_set_dfs
get the list of distribution factors for nodes in a node set >>> ns_dist_facts = exo.get_node_set_dist_facts(node_set_id) Parameters ---------- <int> node_set_id node set *ID* (not *INDEX*) Returns ------- if array_type == 'ctype': ...
get the list of distribution factors for nodes in a node set
[ "get", "the", "list", "of", "distribution", "factors", "for", "nodes", "in", "a", "node", "set" ]
def get_node_set_dist_facts(self, object_id): """ get the list of distribution factors for nodes in a node set >>> ns_dist_facts = exo.get_node_set_dist_facts(node_set_id) Parameters ---------- <int> node_set_id node set *ID* (not *INDEX*) Returns ...
[ "def", "get_node_set_dist_facts", "(", "self", ",", "object_id", ")", ":", "node_set_dfs", "=", "self", ".", "__ex_get_node_set_dist_fact", "(", "object_id", ")", "node_set_dfs", "=", "list", "(", "node_set_dfs", ")", "if", "self", ".", "use_numpy", ":", "node_s...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus3.in.py#L3313-L3339
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
TreeCtrl.GetClassDefaultAttributes
(*args, **kwargs)
return _controls_.TreeCtrl_GetClassDefaultAttributes(*args, **kwargs)
GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control -- which is a much better idea than hard coding specific co...
GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
[ "GetClassDefaultAttributes", "(", "int", "variant", "=", "WINDOW_VARIANT_NORMAL", ")", "-", ">", "VisualAttributes" ]
def GetClassDefaultAttributes(*args, **kwargs): """ GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control...
[ "def", "GetClassDefaultAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "TreeCtrl_GetClassDefaultAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L5554-L5569
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py
python
_is_unpacked_egg
(path)
return ( _is_egg_path(path) and os.path.isfile(os.path.join(path, 'EGG-INFO', 'PKG-INFO')) )
Determine if given path appears to be an unpacked egg.
Determine if given path appears to be an unpacked egg.
[ "Determine", "if", "given", "path", "appears", "to", "be", "an", "unpacked", "egg", "." ]
def _is_unpacked_egg(path): """ Determine if given path appears to be an unpacked egg. """ return ( _is_egg_path(path) and os.path.isfile(os.path.join(path, 'EGG-INFO', 'PKG-INFO')) )
[ "def", "_is_unpacked_egg", "(", "path", ")", ":", "return", "(", "_is_egg_path", "(", "path", ")", "and", "os", ".", "path", ".", "isfile", "(", "os", ".", "path", ".", "join", "(", "path", ",", "'EGG-INFO'", ",", "'PKG-INFO'", ")", ")", ")" ]
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/pkg_resources/__init__.py#L2360-L2367
alexgkendall/caffe-posenet
62aafbd7c45df91acdba14f5d1406d8295c2bc6f
scripts/cpp_lint.py
python
CheckForIncludeWhatYouUse
(filename, clean_lines, include_state, error, io=codecs)
Reports for missing stl includes. This function will output warnings to make sure you are including the headers necessary for the stl containers and functions that you use. We only give one reason to include a header. For example, if you use both equal_to<> and less<> in a .h file, only one (the latter in the ...
Reports for missing stl includes.
[ "Reports", "for", "missing", "stl", "includes", "." ]
def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error, io=codecs): """Reports for missing stl includes. This function will output warnings to make sure you are including the headers necessary for the stl containers and functions that you use. We only give one r...
[ "def", "CheckForIncludeWhatYouUse", "(", "filename", ",", "clean_lines", ",", "include_state", ",", "error", ",", "io", "=", "codecs", ")", ":", "required", "=", "{", "}", "# A map of header name to linenumber and the template entity.", "# Example of required: { '<functiona...
https://github.com/alexgkendall/caffe-posenet/blob/62aafbd7c45df91acdba14f5d1406d8295c2bc6f/scripts/cpp_lint.py#L4483-L4573
bulletphysics/bullet3
f0f2a952e146f016096db6f85cf0c44ed75b0b9a
examples/pybullet/gym/pybullet_envs/minitaur/agents/ppo/algorithm.py
python
PPOAlgorithm._update_value_step
(self, observ, reward, length)
Compute the current value loss and perform a gradient update step. Args: observ: Sequences of observations. reward: Sequences of reward. length: Batch of sequence lengths. Returns: Tuple of loss tensor and summary tensor.
Compute the current value loss and perform a gradient update step.
[ "Compute", "the", "current", "value", "loss", "and", "perform", "a", "gradient", "update", "step", "." ]
def _update_value_step(self, observ, reward, length): """Compute the current value loss and perform a gradient update step. Args: observ: Sequences of observations. reward: Sequences of reward. length: Batch of sequence lengths. Returns: Tuple of loss tensor and summary tensor. ...
[ "def", "_update_value_step", "(", "self", ",", "observ", ",", "reward", ",", "length", ")", ":", "loss", ",", "summary", "=", "self", ".", "_value_loss", "(", "observ", ",", "reward", ",", "length", ")", "gradients", ",", "variables", "=", "(", "zip", ...
https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/agents/ppo/algorithm.py#L271-L291
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/layers/python/layers/summaries.py
python
_add_histogram_summary
(tensor, tag=None)
return standard_ops.histogram_summary(tag, tensor, name='%s_summary' % tag)
Add a summary operation for the histogram of a tensor. Args: tensor: The tensor to summarize. tag: The tag to use, if None then use tensor's op's name. Returns: The created histogram summary. Raises: ValueError: If the tag is already in use.
Add a summary operation for the histogram of a tensor.
[ "Add", "a", "summary", "operation", "for", "the", "histogram", "of", "a", "tensor", "." ]
def _add_histogram_summary(tensor, tag=None): """Add a summary operation for the histogram of a tensor. Args: tensor: The tensor to summarize. tag: The tag to use, if None then use tensor's op's name. Returns: The created histogram summary. Raises: ValueError: If the tag is already in use. ...
[ "def", "_add_histogram_summary", "(", "tensor", ",", "tag", "=", "None", ")", ":", "tag", "=", "tag", "or", "tensor", ".", "op", ".", "name", "assert_summary_tag_unique", "(", "tag", ")", "return", "standard_ops", ".", "histogram_summary", "(", "tag", ",", ...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/layers/python/layers/summaries.py#L63-L78
emscripten-core/emscripten
0d413d3c5af8b28349682496edc14656f5700c2f
third_party/ply/example/GardenSnake/GardenSnake.py
python
p_atom_number
(p)
atom : NUMBER | STRING
atom : NUMBER | STRING
[ "atom", ":", "NUMBER", "|", "STRING" ]
def p_atom_number(p): """atom : NUMBER | STRING""" p[0] = ast.Const(p[1])
[ "def", "p_atom_number", "(", "p", ")", ":", "p", "[", "0", "]", "=", "ast", ".", "Const", "(", "p", "[", "1", "]", ")" ]
https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/GardenSnake/GardenSnake.py#L558-L561
XCSoar/XCSoar
bc64ca71dbe80df6ebecfdee0609eb0dbba2bdcf
build/python/build/download.py
python
download_and_verify
(url, alternative_url, md5, parent_path)
Download a file, verify its MD5 checksum and return the local path.
Download a file, verify its MD5 checksum and return the local path.
[ "Download", "a", "file", "verify", "its", "MD5", "checksum", "and", "return", "the", "local", "path", "." ]
def download_and_verify(url, alternative_url, md5, parent_path): """Download a file, verify its MD5 checksum and return the local path.""" os.makedirs(parent_path, exist_ok=True) path = os.path.join(parent_path, os.path.basename(url)) # protect concurrent builds by holding an exclusive lock with l...
[ "def", "download_and_verify", "(", "url", ",", "alternative_url", ",", "md5", ",", "parent_path", ")", ":", "os", ".", "makedirs", "(", "parent_path", ",", "exist_ok", "=", "True", ")", "path", "=", "os", ".", "path", ".", "join", "(", "parent_path", ","...
https://github.com/XCSoar/XCSoar/blob/bc64ca71dbe80df6ebecfdee0609eb0dbba2bdcf/build/python/build/download.py#L24-L42
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/setuptools/_distutils/file_util.py
python
write_file
(filename, contents)
Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it.
Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it.
[ "Create", "a", "file", "with", "the", "specified", "name", "and", "write", "contents", "(", "a", "sequence", "of", "strings", "without", "line", "terminators", ")", "to", "it", "." ]
def write_file (filename, contents): """Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it. """ f = open(filename, "w") try: for line in contents: f.write(line + "\n") finally: f.close()
[ "def", "write_file", "(", "filename", ",", "contents", ")", ":", "f", "=", "open", "(", "filename", ",", "\"w\"", ")", "try", ":", "for", "line", "in", "contents", ":", "f", ".", "write", "(", "line", "+", "\"\\n\"", ")", "finally", ":", "f", ".", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_distutils/file_util.py#L229-L238
OpenArkStudio/ARK
a7f8413dd416cd1ac5b12adbdd84f010f59f11e2
build/tools/config_tool/config_xml.py
python
write_xml
(tree, out_path)
write the xml data to file tree: ElementTree out_path: output filepath
write the xml data to file tree: ElementTree out_path: output filepath
[ "write", "the", "xml", "data", "to", "file", "tree", ":", "ElementTree", "out_path", ":", "output", "filepath" ]
def write_xml(tree, out_path): ''' write the xml data to file tree: ElementTree out_path: output filepath ''' tree.write(out_path, encoding='UTF-8', xml_declaration=True)
[ "def", "write_xml", "(", "tree", ",", "out_path", ")", ":", "tree", ".", "write", "(", "out_path", ",", "encoding", "=", "'UTF-8'", ",", "xml_declaration", "=", "True", ")" ]
https://github.com/OpenArkStudio/ARK/blob/a7f8413dd416cd1ac5b12adbdd84f010f59f11e2/build/tools/config_tool/config_xml.py#L26-L32
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
driver/python/pysequoiadb/collection.py
python
collection.query_and_remove
(self, **kwargs)
return result
Get the matching documents in current collection and remove. Parameters: Name Type Info: **kwargs Useful options are below - condition dict The matching rule, update all the documents if not prov...
Get the matching documents in current collection and remove.
[ "Get", "the", "matching", "documents", "in", "current", "collection", "and", "remove", "." ]
def query_and_remove(self, **kwargs): """Get the matching documents in current collection and remove. Parameters: Name Type Info: **kwargs Useful options are below - condition dict The matching rule, update all the ...
[ "def", "query_and_remove", "(", "self", ",", "*", "*", "kwargs", ")", ":", "bson_condition", "=", "None", "bson_selector", "=", "None", "bson_order_by", "=", "None", "bson_hint", "=", "None", "condition", "=", "kwargs", ".", "get", "(", "'condition'", ")", ...
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/driver/python/pysequoiadb/collection.py#L685-L778
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/tracking/tracking.py
python
AutoTrackable.__setattr__
(self, name, value)
Support self.foo = trackable syntax.
Support self.foo = trackable syntax.
[ "Support", "self", ".", "foo", "=", "trackable", "syntax", "." ]
def __setattr__(self, name, value): """Support self.foo = trackable syntax.""" try: if getattr(self, name) is value: # Short circuit for `self.$x = self.$x`. return except AttributeError: pass if getattr(self, "_self_setattr_tracking", True): value = data_structures.st...
[ "def", "__setattr__", "(", "self", ",", "name", ",", "value", ")", ":", "try", ":", "if", "getattr", "(", "self", ",", "name", ")", "is", "value", ":", "# Short circuit for `self.$x = self.$x`.", "return", "except", "AttributeError", ":", "pass", "if", "geta...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/tracking/tracking.py#L76-L88
rootm0s/Protectors
5b3f4d11687a5955caf9c3af30666c4bfc2c19ab
OWASP-ZSC/module/readline_windows/pyreadline/modes/notemacs.py
python
NotEmacsMode.quoted_insert
(self, e)
Add the next character typed to the line verbatim. This is how to insert key sequences like C-q, for example.
Add the next character typed to the line verbatim. This is how to insert key sequences like C-q, for example.
[ "Add", "the", "next", "character", "typed", "to", "the", "line", "verbatim", ".", "This", "is", "how", "to", "insert", "key", "sequences", "like", "C", "-", "q", "for", "example", "." ]
def quoted_insert(self, e): # (C-q or C-v) '''Add the next character typed to the line verbatim. This is how to insert key sequences like C-q, for example.''' e = self.console.getkeypress() self.insert_text(e.char)
[ "def", "quoted_insert", "(", "self", ",", "e", ")", ":", "# (C-q or C-v)", "e", "=", "self", ".", "console", ".", "getkeypress", "(", ")", "self", ".", "insert_text", "(", "e", ".", "char", ")" ]
https://github.com/rootm0s/Protectors/blob/5b3f4d11687a5955caf9c3af30666c4bfc2c19ab/OWASP-ZSC/module/readline_windows/pyreadline/modes/notemacs.py#L272-L276
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/framework/ops.py
python
SparseTensor.eval
(self, feed_dict=None, session=None)
return SparseTensorValue(indices, values, shape)
Evaluates this sparse tensor in a `Session`. Calling this method will execute all preceding operations that produce the inputs needed for the operation that produces this tensor. *N.B.* Before invoking `SparseTensor.eval()`, its graph must have been launched in a session, and either a default sess...
Evaluates this sparse tensor in a `Session`.
[ "Evaluates", "this", "sparse", "tensor", "in", "a", "Session", "." ]
def eval(self, feed_dict=None, session=None): """Evaluates this sparse tensor in a `Session`. Calling this method will execute all preceding operations that produce the inputs needed for the operation that produces this tensor. *N.B.* Before invoking `SparseTensor.eval()`, its graph must have been...
[ "def", "eval", "(", "self", ",", "feed_dict", "=", "None", ",", "session", "=", "None", ")", ":", "indices", ",", "values", ",", "shape", "=", "_eval_using_default_session", "(", "[", "self", ".", "indices", ",", "self", ".", "values", ",", "self", "."...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/framework/ops.py#L1039-L1062
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/cygprofile/profile_android_startup.py
python
WprManager.Start
(self)
Set up the device and host for WPR.
Set up the device and host for WPR.
[ "Set", "up", "the", "device", "and", "host", "for", "WPR", "." ]
def Start(self): """Set up the device and host for WPR.""" self.Stop() # TODO(lizeb,pasko): make self._InstallTestCa() work self._BringUpWpr() self._StartForwarder()
[ "def", "Start", "(", "self", ")", ":", "self", ".", "Stop", "(", ")", "# TODO(lizeb,pasko): make self._InstallTestCa() work", "self", ".", "_BringUpWpr", "(", ")", "self", ".", "_StartForwarder", "(", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/cygprofile/profile_android_startup.py#L84-L89
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mhlib.py
python
MH.getpath
(self)
return self.path
Return the path (the name of the collection's directory).
Return the path (the name of the collection's directory).
[ "Return", "the", "path", "(", "the", "name", "of", "the", "collection", "s", "directory", ")", "." ]
def getpath(self): """Return the path (the name of the collection's directory).""" return self.path
[ "def", "getpath", "(", "self", ")", ":", "return", "self", ".", "path" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mhlib.py#L126-L128
PlatformLab/RAMCloud
b1866af19124325a6dfd8cbc267e2e3ef1f965d1
scripts/upload.py
python
GitVCS.PostProcessDiff
(self, gitdiff)
return "".join(svndiff)
Converts the diff output to include an svn-style "Index:" line as well as record the hashes of the files, so we can upload them along with our diff.
Converts the diff output to include an svn-style "Index:" line as well as record the hashes of the files, so we can upload them along with our diff.
[ "Converts", "the", "diff", "output", "to", "include", "an", "svn", "-", "style", "Index", ":", "line", "as", "well", "as", "record", "the", "hashes", "of", "the", "files", "so", "we", "can", "upload", "them", "along", "with", "our", "diff", "." ]
def PostProcessDiff(self, gitdiff): """Converts the diff output to include an svn-style "Index:" line as well as record the hashes of the files, so we can upload them along with our diff.""" # Special used by git to indicate "no such content". NULL_HASH = "0"*40 def IsFileNew(filename): r...
[ "def", "PostProcessDiff", "(", "self", ",", "gitdiff", ")", ":", "# Special used by git to indicate \"no such content\".", "NULL_HASH", "=", "\"0\"", "*", "40", "def", "IsFileNew", "(", "filename", ")", ":", "return", "filename", "in", "self", ".", "hashes", "and"...
https://github.com/PlatformLab/RAMCloud/blob/b1866af19124325a6dfd8cbc267e2e3ef1f965d1/scripts/upload.py#L1541-L1597
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/speedmeter.py
python
SpeedMeter.GetNumberOfSecondaryTicks
(self)
return self._secondaryticks
Returns the number of secondary (intermediate) ticks.
Returns the number of secondary (intermediate) ticks.
[ "Returns", "the", "number", "of", "secondary", "(", "intermediate", ")", "ticks", "." ]
def GetNumberOfSecondaryTicks(self): """ Returns the number of secondary (intermediate) ticks. """ return self._secondaryticks
[ "def", "GetNumberOfSecondaryTicks", "(", "self", ")", ":", "return", "self", ".", "_secondaryticks" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/speedmeter.py#L1465-L1468
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/macosx.py
python
isXQuartz
()
return _tk_type == "xquartz"
Returns True if IDLE is using an OS X X11 Tk.
Returns True if IDLE is using an OS X X11 Tk.
[ "Returns", "True", "if", "IDLE", "is", "using", "an", "OS", "X", "X11", "Tk", "." ]
def isXQuartz(): """ Returns True if IDLE is using an OS X X11 Tk. """ if not _tk_type: _init_tk_type() return _tk_type == "xquartz"
[ "def", "isXQuartz", "(", ")", ":", "if", "not", "_tk_type", ":", "_init_tk_type", "(", ")", "return", "_tk_type", "==", "\"xquartz\"" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/macosx.py#L62-L68
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/framework/ops.py
python
is_dense_tensor_like
(t)
return isinstance(t, _TENSOR_LIKE_TYPES)
EXPERIMENTAL: Returns true if `t` implements the tensor interface. See `register_dense_tensor_like_type()` for the current definition of a "tensor-like type". Args: t: An object. Returns: True iff `t` is an instance of one of the registered "tensor-like" types.
EXPERIMENTAL: Returns true if `t` implements the tensor interface.
[ "EXPERIMENTAL", ":", "Returns", "true", "if", "t", "implements", "the", "tensor", "interface", "." ]
def is_dense_tensor_like(t): """EXPERIMENTAL: Returns true if `t` implements the tensor interface. See `register_dense_tensor_like_type()` for the current definition of a "tensor-like type". Args: t: An object. Returns: True iff `t` is an instance of one of the registered "tensor-like" types. """...
[ "def", "is_dense_tensor_like", "(", "t", ")", ":", "return", "isinstance", "(", "t", ",", "_TENSOR_LIKE_TYPES", ")" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/framework/ops.py#L143-L155
spencer-project/spencer_people_tracking
09b256ba4bc22c5cae8a5ae88960de1a387cfd7f
tracking/people/spencer_tracking_metrics/src/spencer_tracking_metrics/pymot/__init__.py
python
MOTEvaluation.get_hypotheses_frame
(self, timestamp)
return hypotheses_frames[0]
Get list of hypotheses occuring chronologically close to ground truth timestamp, but at most with time difference self.sync_delta
Get list of hypotheses occuring chronologically close to ground truth timestamp, but at most with time difference self.sync_delta
[ "Get", "list", "of", "hypotheses", "occuring", "chronologically", "close", "to", "ground", "truth", "timestamp", "but", "at", "most", "with", "time", "difference", "self", ".", "sync_delta" ]
def get_hypotheses_frame(self, timestamp): """Get list of hypotheses occuring chronologically close to ground truth timestamp, but at most with time difference self.sync_delta""" # Helper function for filter() def hypothesis_frame_chronologically_close(hypothesis): return ab...
[ "def", "get_hypotheses_frame", "(", "self", ",", "timestamp", ")", ":", "# Helper function for filter()", "def", "hypothesis_frame_chronologically_close", "(", "hypothesis", ")", ":", "return", "abs", "(", "hypothesis", "[", "\"timestamp\"", "]", "-", "timestamp", ")"...
https://github.com/spencer-project/spencer_people_tracking/blob/09b256ba4bc22c5cae8a5ae88960de1a387cfd7f/tracking/people/spencer_tracking_metrics/src/spencer_tracking_metrics/pymot/__init__.py#L84-L103
eyllanesc/stackoverflow
3837cc9ff94541bf5a500aac1b6182f53669537d
questions/55241644/fakeuic/__init__.py
python
loadUi
(uifile, baseinstance=None, package='', resource_suffix='_rc')
return DynamicUILoader(package).loadUi(uifile, baseinstance, resource_suffix)
loadUi(uifile, baseinstance=None, package='') -> widget Load a Qt Designer .ui file and return an instance of the user interface. uifile is a file name or file-like object containing the .ui file. baseinstance is an optional instance of the Qt base class. If specified then the user interface is creat...
loadUi(uifile, baseinstance=None, package='') -> widget
[ "loadUi", "(", "uifile", "baseinstance", "=", "None", "package", "=", ")", "-", ">", "widget" ]
def loadUi(uifile, baseinstance=None, package='', resource_suffix='_rc'): """loadUi(uifile, baseinstance=None, package='') -> widget Load a Qt Designer .ui file and return an instance of the user interface. uifile is a file name or file-like object containing the .ui file. baseinstance is an optional ...
[ "def", "loadUi", "(", "uifile", ",", "baseinstance", "=", "None", ",", "package", "=", "''", ",", "resource_suffix", "=", "'_rc'", ")", ":", "from", ".", "Loader", ".", "loader", "import", "DynamicUILoader", "return", "DynamicUILoader", "(", "package", ")", ...
https://github.com/eyllanesc/stackoverflow/blob/3837cc9ff94541bf5a500aac1b6182f53669537d/questions/55241644/fakeuic/__init__.py#L206-L226
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
docs/scripts/doxy_md_filter.py
python
process
(input_dir, output_dir, exclude_dirs)
Recursively find markdown files in docs_folder and replace links to markdown files with doxygen labels (ex. @ref label_name).
Recursively find markdown files in docs_folder and replace links to markdown files with doxygen labels (ex.
[ "Recursively", "find", "markdown", "files", "in", "docs_folder", "and", "replace", "links", "to", "markdown", "files", "with", "doxygen", "labels", "(", "ex", "." ]
def process(input_dir, output_dir, exclude_dirs): """ Recursively find markdown files in docs_folder and replace links to markdown files with doxygen labels (ex. @ref label_name). """ md_files = input_dir.glob('**/*.md') md_files = filter_paths(md_files, exclude_dirs) file_to_label_map = get...
[ "def", "process", "(", "input_dir", ",", "output_dir", ",", "exclude_dirs", ")", ":", "md_files", "=", "input_dir", ".", "glob", "(", "'**/*.md'", ")", "md_files", "=", "filter_paths", "(", "md_files", ",", "exclude_dirs", ")", "file_to_label_map", "=", "get_f...
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/docs/scripts/doxy_md_filter.py#L159-L172
widelands/widelands
e9f047d46a23d81312237d52eabf7d74e8de52d6
cmake/codecheck/rules/translations_printf.py
python
check_placeholders
(entry)
return ''
Make sure that a string satisfies our placeholder policy.
Make sure that a string satisfies our placeholder policy.
[ "Make", "sure", "that", "a", "string", "satisfies", "our", "placeholder", "policy", "." ]
def check_placeholders(entry): """Make sure that a string satisfies our placeholder policy.""" sanitized_entry = entry.replace('%%', '') unordered = FIND_UNORDERED_placeholders(sanitized_entry) if len(unordered) > 1: return 'Translatable string has multiple sprintf placeholders that are not orde...
[ "def", "check_placeholders", "(", "entry", ")", ":", "sanitized_entry", "=", "entry", ".", "replace", "(", "'%%'", ",", "''", ")", "unordered", "=", "FIND_UNORDERED_placeholders", "(", "sanitized_entry", ")", "if", "len", "(", "unordered", ")", ">", "1", ":"...
https://github.com/widelands/widelands/blob/e9f047d46a23d81312237d52eabf7d74e8de52d6/cmake/codecheck/rules/translations_printf.py#L32-L56
lukasmonk/lucaschess
13e2e5cb13b38a720ccf897af649054a64bcb914
Code/SQL/DBFcache.py
python
DBFcache.borrar
(self, recno)
Borra un registro y lo quita de la lista de IDs.
Borra un registro y lo quita de la lista de IDs.
[ "Borra", "un", "registro", "y", "lo", "quita", "de", "la", "lista", "de", "IDs", "." ]
def borrar(self, recno): """ Borra un registro y lo quita de la lista de IDs. """ if self.borrarBase(recno): del self.liIDs[recno] return True else: return False
[ "def", "borrar", "(", "self", ",", "recno", ")", ":", "if", "self", ".", "borrarBase", "(", "recno", ")", ":", "del", "self", ".", "liIDs", "[", "recno", "]", "return", "True", "else", ":", "return", "False" ]
https://github.com/lukasmonk/lucaschess/blob/13e2e5cb13b38a720ccf897af649054a64bcb914/Code/SQL/DBFcache.py#L265-L273
alibaba/weex_js_engine
2bdf4b6f020c1fc99c63f649718f6faf7e27fdde
jni/v8core/v8/build/gyp/pylib/gyp/msvs_emulation.py
python
MsvsSettings.AdjustIncludeDirs
(self, include_dirs, config)
return [self.ConvertVSMacros(p, config=config) for p in includes]
Updates include_dirs to expand VS specific paths, and adds the system include dirs used for platform SDK and similar.
Updates include_dirs to expand VS specific paths, and adds the system include dirs used for platform SDK and similar.
[ "Updates", "include_dirs", "to", "expand", "VS", "specific", "paths", "and", "adds", "the", "system", "include", "dirs", "used", "for", "platform", "SDK", "and", "similar", "." ]
def AdjustIncludeDirs(self, include_dirs, config): """Updates include_dirs to expand VS specific paths, and adds the system include dirs used for platform SDK and similar.""" config = self._RealConfig(config) includes = include_dirs + self.msvs_system_include_dirs[config] includes.extend(self._Setti...
[ "def", "AdjustIncludeDirs", "(", "self", ",", "include_dirs", ",", "config", ")", ":", "config", "=", "self", ".", "_RealConfig", "(", "config", ")", "includes", "=", "include_dirs", "+", "self", ".", "msvs_system_include_dirs", "[", "config", "]", "includes",...
https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/msvs_emulation.py#L245-L252
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/neighbors/_lof.py
python
LocalOutlierFactor._fit_predict
(self, X, y=None)
return self.fit(X)._predict()
Fits the model to the training set X and returns the labels. Label is 1 for an inlier and -1 for an outlier according to the LOF score and the contamination parameter. Parameters ---------- X : array-like, shape (n_samples, n_features), default=None The query sample...
Fits the model to the training set X and returns the labels.
[ "Fits", "the", "model", "to", "the", "training", "set", "X", "and", "returns", "the", "labels", "." ]
def _fit_predict(self, X, y=None): """"Fits the model to the training set X and returns the labels. Label is 1 for an inlier and -1 for an outlier according to the LOF score and the contamination parameter. Parameters ---------- X : array-like, shape (n_samples, n_featu...
[ "def", "_fit_predict", "(", "self", ",", "X", ",", "y", "=", "None", ")", ":", "# As fit_predict would be different from fit.predict, fit_predict is", "# only available for outlier detection (novelty=False)", "return", "self", ".", "fit", "(", "X", ")", ".", "_predict", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/neighbors/_lof.py#L208-L229