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
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
gr-digital/python/digital/gfsk.py
python
gfsk_mod.add_options
(parser)
Adds GFSK modulation-specific options to the standard parser
Adds GFSK modulation-specific options to the standard parser
[ "Adds", "GFSK", "modulation", "-", "specific", "options", "to", "the", "standard", "parser" ]
def add_options(parser): """ Adds GFSK modulation-specific options to the standard parser """ parser.add_option("", "--bt", type="float", default=_def_bt, help="set bandwidth-time product [default=%default] (GFSK)")
[ "def", "add_options", "(", "parser", ")", ":", "parser", ".", "add_option", "(", "\"\"", ",", "\"--bt\"", ",", "type", "=", "\"float\"", ",", "default", "=", "_def_bt", ",", "help", "=", "\"set bandwidth-time product [default=%default] (GFSK)\"", ")" ]
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-digital/python/digital/gfsk.py#L151-L156
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/signal/ltisys.py
python
dlti.__new__
(cls, *system, **kwargs)
return super(dlti, cls).__new__(cls)
Create an instance of the appropriate subclass.
Create an instance of the appropriate subclass.
[ "Create", "an", "instance", "of", "the", "appropriate", "subclass", "." ]
def __new__(cls, *system, **kwargs): """Create an instance of the appropriate subclass.""" if cls is dlti: N = len(system) if N == 2: return TransferFunctionDiscrete.__new__( TransferFunctionDiscrete, *system, **kwargs) elif N == 3:...
[ "def", "__new__", "(", "cls", ",", "*", "system", ",", "*", "*", "kwargs", ")", ":", "if", "cls", "is", "dlti", ":", "N", "=", "len", "(", "system", ")", "if", "N", "==", "2", ":", "return", "TransferFunctionDiscrete", ".", "__new__", "(", "Transfe...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/signal/ltisys.py#L550-L567
ros-planning/moveit2
dd240ef6fd8b9932a7a53964140f2952786187a9
moveit_commander/src/moveit_commander/move_group.py
python
MoveGroupCommander.set_joint_value_target
(self, arg1, arg2=None, arg3=None)
Specify a target joint configuration for the group. - if the type of arg1 is one of the following: dict, list, JointState message, then no other arguments should be provided. The dict should specify pairs of joint variable names and their target values, the list should specify all the variable values ...
Specify a target joint configuration for the group. - if the type of arg1 is one of the following: dict, list, JointState message, then no other arguments should be provided. The dict should specify pairs of joint variable names and their target values, the list should specify all the variable values ...
[ "Specify", "a", "target", "joint", "configuration", "for", "the", "group", ".", "-", "if", "the", "type", "of", "arg1", "is", "one", "of", "the", "following", ":", "dict", "list", "JointState", "message", "then", "no", "other", "arguments", "should", "be",...
def set_joint_value_target(self, arg1, arg2=None, arg3=None): """ Specify a target joint configuration for the group. - if the type of arg1 is one of the following: dict, list, JointState message, then no other arguments should be provided. The dict should specify pairs of joint variable...
[ "def", "set_joint_value_target", "(", "self", ",", "arg1", ",", "arg2", "=", "None", ",", "arg3", "=", "None", ")", ":", "if", "isinstance", "(", "arg1", ",", "RobotState", ")", ":", "if", "not", "self", ".", "_g", ".", "set_state_value_target", "(", "...
https://github.com/ros-planning/moveit2/blob/dd240ef6fd8b9932a7a53964140f2952786187a9/moveit_commander/src/moveit_commander/move_group.py#L199-L290
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/data_structures/sarray.py
python
SArray.nnz
(self)
Number of non-zero elements in the SArray. Returns ------- out : int Number of non-zero elements.
Number of non-zero elements in the SArray.
[ "Number", "of", "non", "-", "zero", "elements", "in", "the", "SArray", "." ]
def nnz(self): """ Number of non-zero elements in the SArray. Returns ------- out : int Number of non-zero elements. """ with cython_context(): return self.__proxy__.nnz()
[ "def", "nnz", "(", "self", ")", ":", "with", "cython_context", "(", ")", ":", "return", "self", ".", "__proxy__", ".", "nnz", "(", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/data_structures/sarray.py#L2382-L2392
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
uCSIsCatMc
(code)
return ret
Check whether the character is part of Mc UCS Category
Check whether the character is part of Mc UCS Category
[ "Check", "whether", "the", "character", "is", "part", "of", "Mc", "UCS", "Category" ]
def uCSIsCatMc(code): """Check whether the character is part of Mc UCS Category """ ret = libxml2mod.xmlUCSIsCatMc(code) return ret
[ "def", "uCSIsCatMc", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsCatMc", "(", "code", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L2304-L2307
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TIntHI.__ref__
(self)
return _snap.TIntHI___ref__(self)
__ref__(TIntHI self) -> THashKeyDatI< TInt,TInt >::THKeyDat & Parameters: self: THashKeyDatI< TInt,TInt > const *
__ref__(TIntHI self) -> THashKeyDatI< TInt,TInt >::THKeyDat &
[ "__ref__", "(", "TIntHI", "self", ")", "-", ">", "THashKeyDatI<", "TInt", "TInt", ">", "::", "THKeyDat", "&" ]
def __ref__(self): """ __ref__(TIntHI self) -> THashKeyDatI< TInt,TInt >::THKeyDat & Parameters: self: THashKeyDatI< TInt,TInt > const * """ return _snap.TIntHI___ref__(self)
[ "def", "__ref__", "(", "self", ")", ":", "return", "_snap", ".", "TIntHI___ref__", "(", "self", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L18997-L19005
seqan/seqan
f5f658343c366c9c3d44ba358ffc9317e78a09ed
util/py_lib/clang/cindex.py
python
CursorKind.is_invalid
(self)
return CursorKind_is_inv(self)
Test if this is an invalid kind.
Test if this is an invalid kind.
[ "Test", "if", "this", "is", "an", "invalid", "kind", "." ]
def is_invalid(self): """Test if this is an invalid kind.""" return CursorKind_is_inv(self)
[ "def", "is_invalid", "(", "self", ")", ":", "return", "CursorKind_is_inv", "(", "self", ")" ]
https://github.com/seqan/seqan/blob/f5f658343c366c9c3d44ba358ffc9317e78a09ed/util/py_lib/clang/cindex.py#L328-L330
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/dataview.py
python
PyDataViewCustomRenderer.LeftClick
(*args, **kwargs)
return _dataview.PyDataViewCustomRenderer_LeftClick(*args, **kwargs)
LeftClick(self, Point cursor, Rect cell, DataViewModel model, DataViewItem item, unsigned int col) -> bool Overrride this to react to a left click.
LeftClick(self, Point cursor, Rect cell, DataViewModel model, DataViewItem item, unsigned int col) -> bool
[ "LeftClick", "(", "self", "Point", "cursor", "Rect", "cell", "DataViewModel", "model", "DataViewItem", "item", "unsigned", "int", "col", ")", "-", ">", "bool" ]
def LeftClick(*args, **kwargs): """ LeftClick(self, Point cursor, Rect cell, DataViewModel model, DataViewItem item, unsigned int col) -> bool Overrride this to react to a left click. """ return _dataview.PyDataViewCustomRenderer_LeftClick(*args, **kwargs)
[ "def", "LeftClick", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "PyDataViewCustomRenderer_LeftClick", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L1483-L1490
ducha-aiki/LSUVinit
a42ecdc0d44c217a29b65e98748d80b90d5c6279
scripts/cpp_lint.py
python
PrintUsage
(message)
Prints a brief usage string and exits, optionally with an error message. Args: message: The optional error message.
Prints a brief usage string and exits, optionally with an error message.
[ "Prints", "a", "brief", "usage", "string", "and", "exits", "optionally", "with", "an", "error", "message", "." ]
def PrintUsage(message): """Prints a brief usage string and exits, optionally with an error message. Args: message: The optional error message. """ sys.stderr.write(_USAGE) if message: sys.exit('\nFATAL ERROR: ' + message) else: sys.exit(1)
[ "def", "PrintUsage", "(", "message", ")", ":", "sys", ".", "stderr", ".", "write", "(", "_USAGE", ")", "if", "message", ":", "sys", ".", "exit", "(", "'\\nFATAL ERROR: '", "+", "message", ")", "else", ":", "sys", ".", "exit", "(", "1", ")" ]
https://github.com/ducha-aiki/LSUVinit/blob/a42ecdc0d44c217a29b65e98748d80b90d5c6279/scripts/cpp_lint.py#L4757-L4767
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/six.py
python
python_2_unicode_compatible
(klass)
return klass
A decorator that defines __unicode__ and __str__ methods under Python 2. Under Python 3 it does nothing. To support Python 2 and 3 with a single code base, define a __str__ method returning text and apply this decorator to the class.
A decorator that defines __unicode__ and __str__ methods under Python 2. Under Python 3 it does nothing.
[ "A", "decorator", "that", "defines", "__unicode__", "and", "__str__", "methods", "under", "Python", "2", ".", "Under", "Python", "3", "it", "does", "nothing", "." ]
def python_2_unicode_compatible(klass): """ A decorator that defines __unicode__ and __str__ methods under Python 2. Under Python 3 it does nothing. To support Python 2 and 3 with a single code base, define a __str__ method returning text and apply this decorator to the class. """ if PY2: ...
[ "def", "python_2_unicode_compatible", "(", "klass", ")", ":", "if", "PY2", ":", "if", "'__str__'", "not", "in", "klass", ".", "__dict__", ":", "raise", "ValueError", "(", "\"@python_2_unicode_compatible cannot be applied \"", "\"to %s because it doesn't define __str__().\""...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/six.py#L817-L832
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/tools/gyp/pylib/gyp/input.py
python
DependencyGraphNode.FindCycles
(self)
return results
Returns a list of cycles in the graph, where each cycle is its own list.
Returns a list of cycles in the graph, where each cycle is its own list.
[ "Returns", "a", "list", "of", "cycles", "in", "the", "graph", "where", "each", "cycle", "is", "its", "own", "list", "." ]
def FindCycles(self): """ Returns a list of cycles in the graph, where each cycle is its own list. """ results = [] visited = set() def Visit(node, path): for child in node.dependents: if child in path: results.append([child] + path[:path.index(child) + 1]) elif ...
[ "def", "FindCycles", "(", "self", ")", ":", "results", "=", "[", "]", "visited", "=", "set", "(", ")", "def", "Visit", "(", "node", ",", "path", ")", ":", "for", "child", "in", "node", ".", "dependents", ":", "if", "child", "in", "path", ":", "re...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/input.py#L1596-L1614
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBWatchpoint.SetCondition
(self, *args)
return _lldb.SBWatchpoint_SetCondition(self, *args)
SetCondition(self, str condition) The watchpoint stops only if the condition expression evaluates to true.
SetCondition(self, str condition)
[ "SetCondition", "(", "self", "str", "condition", ")" ]
def SetCondition(self, *args): """ SetCondition(self, str condition) The watchpoint stops only if the condition expression evaluates to true. """ return _lldb.SBWatchpoint_SetCondition(self, *args)
[ "def", "SetCondition", "(", "self", ",", "*", "args", ")", ":", "return", "_lldb", ".", "SBWatchpoint_SetCondition", "(", "self", ",", "*", "args", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L12646-L12652
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/hapi/model.py
python
Model.eval_batch
(self, inputs, labels=None)
return loss
Run one evaluating step on a batch of data. Args: inputs (numpy.ndarray|Tensor|list): Batch of input data. It could be a numpy array or paddle.Tensor, or a list of arrays or tensors (in case the model has multiple inputs). labels (numpy.ndarray|Tensor|l...
Run one evaluating step on a batch of data.
[ "Run", "one", "evaluating", "step", "on", "a", "batch", "of", "data", "." ]
def eval_batch(self, inputs, labels=None): """ Run one evaluating step on a batch of data. Args: inputs (numpy.ndarray|Tensor|list): Batch of input data. It could be a numpy array or paddle.Tensor, or a list of arrays or tensors (in case the model h...
[ "def", "eval_batch", "(", "self", ",", "inputs", ",", "labels", "=", "None", ")", ":", "loss", "=", "self", ".", "_adapter", ".", "eval_batch", "(", "inputs", ",", "labels", ")", "if", "fluid", ".", "in_dygraph_mode", "(", ")", "and", "self", ".", "_...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/hapi/model.py#L1098-L1147
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
config/configobj.py
python
ConfigObj._set_configspec_value
(self, configspec, section)
Used to recursively set configspec values.
Used to recursively set configspec values.
[ "Used", "to", "recursively", "set", "configspec", "values", "." ]
def _set_configspec_value(self, configspec, section): """Used to recursively set configspec values.""" if '__many__' in configspec.sections: section.configspec['__many__'] = configspec['__many__'] if len(configspec.sections) > 1: # FIXME: can we supply any useful ...
[ "def", "_set_configspec_value", "(", "self", ",", "configspec", ",", "section", ")", ":", "if", "'__many__'", "in", "configspec", ".", "sections", ":", "section", ".", "configspec", "[", "'__many__'", "]", "=", "configspec", "[", "'__many__'", "]", "if", "le...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/config/configobj.py#L1796-L1824
lilypond/lilypond
2a14759372979f5b796ee802b0ee3bc15d28b06b
python/book_base.py
python
find_linestarts
(s)
return nls
Return a list of indices indicating the first char of a line.
Return a list of indices indicating the first char of a line.
[ "Return", "a", "list", "of", "indices", "indicating", "the", "first", "char", "of", "a", "line", "." ]
def find_linestarts(s): """Return a list of indices indicating the first char of a line.""" nls = [0] start = 0 end = len(s) while True: i = s.find('\n', start) if i < 0: break i = i + 1 nls.append(i) start = i nls.append(len(s)) return n...
[ "def", "find_linestarts", "(", "s", ")", ":", "nls", "=", "[", "0", "]", "start", "=", "0", "end", "=", "len", "(", "s", ")", "while", "True", ":", "i", "=", "s", ".", "find", "(", "'\\n'", ",", "start", ")", "if", "i", "<", "0", ":", "brea...
https://github.com/lilypond/lilypond/blob/2a14759372979f5b796ee802b0ee3bc15d28b06b/python/book_base.py#L240-L255
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
StaticText.IsEllipsized
(*args, **kwargs)
return _controls_.StaticText_IsEllipsized(*args, **kwargs)
IsEllipsized(self) -> bool
IsEllipsized(self) -> bool
[ "IsEllipsized", "(", "self", ")", "-", ">", "bool" ]
def IsEllipsized(*args, **kwargs): """IsEllipsized(self) -> bool""" return _controls_.StaticText_IsEllipsized(*args, **kwargs)
[ "def", "IsEllipsized", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "StaticText_IsEllipsized", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L1019-L1021
GrammaTech/gtirb
415dd72e1e3c475004d013723c16cdcb29c0826e
python/gtirb/serialization.py
python
Serialization._decode_tree
( self, raw_bytes: BinaryIO, type_tree: SubtypeTree, get_by_uuid: CacheLookupFn, )
return codec.decode( raw_bytes, serialization=self, subtypes=type_tree.subtypes, get_by_uuid=get_by_uuid, )
Decode the data in ``raw_bytes`` given a parsed type tree. :param raw_bytes: The binary stream to read bytes from. :param type_tree: The parsed type of the object encoded by ``raw_bytes``.
Decode the data in ``raw_bytes`` given a parsed type tree.
[ "Decode", "the", "data", "in", "raw_bytes", "given", "a", "parsed", "type", "tree", "." ]
def _decode_tree( self, raw_bytes: BinaryIO, type_tree: SubtypeTree, get_by_uuid: CacheLookupFn, ) -> object: """Decode the data in ``raw_bytes`` given a parsed type tree. :param raw_bytes: The binary stream to read bytes from. :param type_tree: The parsed ty...
[ "def", "_decode_tree", "(", "self", ",", "raw_bytes", ":", "BinaryIO", ",", "type_tree", ":", "SubtypeTree", ",", "get_by_uuid", ":", "CacheLookupFn", ",", ")", "->", "object", ":", "if", "type_tree", ".", "name", "not", "in", "self", ".", "codecs", ":", ...
https://github.com/GrammaTech/gtirb/blob/415dd72e1e3c475004d013723c16cdcb29c0826e/python/gtirb/serialization.py#L670-L691
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/ultimatelistctrl.py
python
UltimateListMainWindow.SetHyperTextVisitedColour
(self, colour)
Sets the colour used to render a visited hypertext item. :param `colour`: a valid :class:`Colour` instance.
Sets the colour used to render a visited hypertext item.
[ "Sets", "the", "colour", "used", "to", "render", "a", "visited", "hypertext", "item", "." ]
def SetHyperTextVisitedColour(self, colour): """ Sets the colour used to render a visited hypertext item. :param `colour`: a valid :class:`Colour` instance. """ self._hypertextvisitedcolour = colour self._dirty = True
[ "def", "SetHyperTextVisitedColour", "(", "self", ",", "colour", ")", ":", "self", ".", "_hypertextvisitedcolour", "=", "colour", "self", ".", "_dirty", "=", "True" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L9246-L9254
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
Printout.SetPPIScreen
(*args, **kwargs)
return _windows_.Printout_SetPPIScreen(*args, **kwargs)
SetPPIScreen(self, int x, int y)
SetPPIScreen(self, int x, int y)
[ "SetPPIScreen", "(", "self", "int", "x", "int", "y", ")" ]
def SetPPIScreen(*args, **kwargs): """SetPPIScreen(self, int x, int y)""" return _windows_.Printout_SetPPIScreen(*args, **kwargs)
[ "def", "SetPPIScreen", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "Printout_SetPPIScreen", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L5347-L5349
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/stats/_multivariate.py
python
multivariate_normal_gen.pdf
(self, x, mean=None, cov=1, allow_singular=False)
return _squeeze_output(out)
Multivariate normal probability density function. Parameters ---------- x : array_like Quantiles, with the last axis of `x` denoting the components. %(_mvn_doc_default_callparams)s Returns ------- pdf : ndarray or scalar Probability densi...
Multivariate normal probability density function.
[ "Multivariate", "normal", "probability", "density", "function", "." ]
def pdf(self, x, mean=None, cov=1, allow_singular=False): """ Multivariate normal probability density function. Parameters ---------- x : array_like Quantiles, with the last axis of `x` denoting the components. %(_mvn_doc_default_callparams)s Returns...
[ "def", "pdf", "(", "self", ",", "x", ",", "mean", "=", "None", ",", "cov", "=", "1", ",", "allow_singular", "=", "False", ")", ":", "dim", ",", "mean", ",", "cov", "=", "self", ".", "_process_parameters", "(", "None", ",", "mean", ",", "cov", ")"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/stats/_multivariate.py#L498-L522
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/mhlib.py
python
Folder.setlast
(self, last)
Set the last message number.
Set the last message number.
[ "Set", "the", "last", "message", "number", "." ]
def setlast(self, last): """Set the last message number.""" if last is None: if hasattr(self, 'last'): del self.last else: self.last = last
[ "def", "setlast", "(", "self", ",", "last", ")", ":", "if", "last", "is", "None", ":", "if", "hasattr", "(", "self", ",", "'last'", ")", ":", "del", "self", ".", "last", "else", ":", "self", ".", "last", "=", "last" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/mhlib.py#L655-L661
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/sparse_ops.py
python
sparse_cross_hashed
(inputs, num_buckets=0, hash_key=None, name=None)
return _sparse_cross_internal( inputs=inputs, hashed_output=True, num_buckets=num_buckets, hash_key=hash_key, name=name)
Generates hashed sparse cross from a list of sparse and dense tensors. For example, if the inputs are * inputs[0]: SparseTensor with shape = [2, 2] [0, 0]: "a" [1, 0]: "b" [1, 1]: "c" * inputs[1]: SparseTensor with shape = [2, 1] [0, 0]: "d" [1, 0]: "e" * in...
Generates hashed sparse cross from a list of sparse and dense tensors.
[ "Generates", "hashed", "sparse", "cross", "from", "a", "list", "of", "sparse", "and", "dense", "tensors", "." ]
def sparse_cross_hashed(inputs, num_buckets=0, hash_key=None, name=None): """Generates hashed sparse cross from a list of sparse and dense tensors. For example, if the inputs are * inputs[0]: SparseTensor with shape = [2, 2] [0, 0]: "a" [1, 0]: "b" [1, 1]: "c" * inputs[1]: Spar...
[ "def", "sparse_cross_hashed", "(", "inputs", ",", "num_buckets", "=", "0", ",", "hash_key", "=", "None", ",", "name", "=", "None", ")", ":", "return", "_sparse_cross_internal", "(", "inputs", "=", "inputs", ",", "hashed_output", "=", "True", ",", "num_bucket...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/sparse_ops.py#L658-L701
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/v7.9.317/tools/sanitizers/sancov_formatter.py
python
merge_instrumented_line_results
(exe_list, results)
return { 'version': 1, 'tests': sorted(map(os.path.basename, exe_list)), 'files': {f: map(lambda l: [l, 0], sorted(result[f])) for f in result}, }
Merge multiprocessing results for all instrumented lines. Args: exe_list: List of all executable names with absolute paths. results: List of results as returned by get_instrumented_lines. Returns: Dict to be used as json data as specified on the top of this page. The dictionary contains all ins...
Merge multiprocessing results for all instrumented lines.
[ "Merge", "multiprocessing", "results", "for", "all", "instrumented", "lines", "." ]
def merge_instrumented_line_results(exe_list, results): """Merge multiprocessing results for all instrumented lines. Args: exe_list: List of all executable names with absolute paths. results: List of results as returned by get_instrumented_lines. Returns: Dict to be used as json data as specified on the...
[ "def", "merge_instrumented_line_results", "(", "exe_list", ",", "results", ")", ":", "def", "merge_files", "(", "x", ",", "y", ")", ":", "for", "file_name", ",", "lines", "in", "y", ".", "iteritems", "(", ")", ":", "x", ".", "setdefault", "(", "file_name...
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/tools/sanitizers/sancov_formatter.py#L188-L215
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/difflib.py
python
get_close_matches
(word, possibilities, n=3, cutoff=0.6)
return [x for score, x in result]
Use SequenceMatcher to return list of the best "good enough" matches. word is a sequence for which close matches are desired (typically a string). possibilities is a list of sequences against which to match word (typically a list of strings). Optional arg n (default 3) is the maximum number of cl...
Use SequenceMatcher to return list of the best "good enough" matches.
[ "Use", "SequenceMatcher", "to", "return", "list", "of", "the", "best", "good", "enough", "matches", "." ]
def get_close_matches(word, possibilities, n=3, cutoff=0.6): """Use SequenceMatcher to return list of the best "good enough" matches. word is a sequence for which close matches are desired (typically a string). possibilities is a list of sequences against which to match word (typically a list of s...
[ "def", "get_close_matches", "(", "word", ",", "possibilities", ",", "n", "=", "3", ",", "cutoff", "=", "0.6", ")", ":", "if", "not", "n", ">", "0", ":", "raise", "ValueError", "(", "\"n must be > 0: %r\"", "%", "(", "n", ",", ")", ")", "if", "not", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/difflib.py#L703-L749
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/estimator.py
python
BaseEstimator.get_variable_names
(self)
return [name for name, _ in checkpoints.list_variables(self.model_dir)]
Returns list of all variable names in this model. Returns: List of names.
Returns list of all variable names in this model.
[ "Returns", "list", "of", "all", "variable", "names", "in", "this", "model", "." ]
def get_variable_names(self): """Returns list of all variable names in this model. Returns: List of names. """ return [name for name, _ in checkpoints.list_variables(self.model_dir)]
[ "def", "get_variable_names", "(", "self", ")", ":", "return", "[", "name", "for", "name", ",", "_", "in", "checkpoints", ".", "list_variables", "(", "self", ".", "model_dir", ")", "]" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/estimator.py#L338-L344
sebastianstarke/AI4Animation
e2cd539816b1cb1fa0a57e9d21df21d48467b313
AI4Animation/SIGGRAPH_2020/DeepLearning/Models/ExpertModel/ExpertWeights.py
python
ExpertWeights.__init__
(self, rng, shape , name)
rng
rng
[ "rng" ]
def __init__(self, rng, shape , name): """rng""" self.initialRNG = rng """shape""" self.weight_shape = shape #4/8 * out * in self.bias_shape = (shape[0],shape[1],1) #4/8 * out * 1 """alpha and beta""" self.alpha ...
[ "def", "__init__", "(", "self", ",", "rng", ",", "shape", ",", "name", ")", ":", "self", ".", "initialRNG", "=", "rng", "\"\"\"shape\"\"\"", "self", ".", "weight_shape", "=", "shape", "#4/8 * out * in", "self", ".", "bias_shape", "=", "(", "shape", "[", ...
https://github.com/sebastianstarke/AI4Animation/blob/e2cd539816b1cb1fa0a57e9d21df21d48467b313/AI4Animation/SIGGRAPH_2020/DeepLearning/Models/ExpertModel/ExpertWeights.py#L10-L20
devsisters/libquic
8954789a056d8e7d5fcb6452fd1572ca57eb5c4e
src/third_party/protobuf/third_party/six/six.py
python
add_move
(move)
Add an item to six.moves.
Add an item to six.moves.
[ "Add", "an", "item", "to", "six", ".", "moves", "." ]
def add_move(move): """Add an item to six.moves.""" setattr(_MovedItems, move.name, move)
[ "def", "add_move", "(", "move", ")", ":", "setattr", "(", "_MovedItems", ",", "move", ".", "name", ",", "move", ")" ]
https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/third_party/six/six.py#L486-L488
scribusproject/scribus
41ec7c775a060912cf251682a8b1437f753f80f4
codegen/cheetah/Cheetah/Parser.py
python
_LowLevelParser.getCheetahVarNameChunks
(self)
return chunks
nameChunks = list of Cheetah $var subcomponents represented as tuples [ (namemapperPart,autoCall,restOfName), ] where: namemapperPart = the dottedName base autocall = where NameMapper should use autocalling on namemapperPart restOfName = any arglist, index, or s...
nameChunks = list of Cheetah $var subcomponents represented as tuples [ (namemapperPart,autoCall,restOfName), ] where: namemapperPart = the dottedName base autocall = where NameMapper should use autocalling on namemapperPart restOfName = any arglist, index, or s...
[ "nameChunks", "=", "list", "of", "Cheetah", "$var", "subcomponents", "represented", "as", "tuples", "[", "(", "namemapperPart", "autoCall", "restOfName", ")", "]", "where", ":", "namemapperPart", "=", "the", "dottedName", "base", "autocall", "=", "where", "NameM...
def getCheetahVarNameChunks(self): """ nameChunks = list of Cheetah $var subcomponents represented as tuples [ (namemapperPart,autoCall,restOfName), ] where: namemapperPart = the dottedName base autocall = where NameMapper should use autocalling o...
[ "def", "getCheetahVarNameChunks", "(", "self", ")", ":", "chunks", "=", "[", "]", "while", "self", ".", "pos", "(", ")", "<", "len", "(", "self", ")", ":", "rest", "=", "''", "autoCall", "=", "True", "if", "not", "self", ".", "peek", "(", ")", "i...
https://github.com/scribusproject/scribus/blob/41ec7c775a060912cf251682a8b1437f753f80f4/codegen/cheetah/Cheetah/Parser.py#L863-L919
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/setuptools/command/easy_install.py
python
easy_install.exe_to_egg
(self, dist_filename, egg_tmp)
Extract a bdist_wininst to the directories an egg would use
Extract a bdist_wininst to the directories an egg would use
[ "Extract", "a", "bdist_wininst", "to", "the", "directories", "an", "egg", "would", "use" ]
def exe_to_egg(self, dist_filename, egg_tmp): """Extract a bdist_wininst to the directories an egg would use""" # Check for .pth file and set up prefix translations prefixes = get_exe_prefixes(dist_filename) to_compile = [] native_libs = [] top_level = {} def pro...
[ "def", "exe_to_egg", "(", "self", ",", "dist_filename", ",", "egg_tmp", ")", ":", "# Check for .pth file and set up prefix translations", "prefixes", "=", "get_exe_prefixes", "(", "dist_filename", ")", "to_compile", "=", "[", "]", "native_libs", "=", "[", "]", "top_...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/setuptools/command/easy_install.py#L999-L1050
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/keras/python/keras/backend.py
python
learning_phase
()
return _GRAPH_LEARNING_PHASES[graph]
Returns the learning phase flag. The learning phase flag is a bool tensor (0 = test, 1 = train) to be passed as input to any Keras function that uses a different behavior at train time and test time. Returns: Learning phase (scalar integer tensor or Python integer).
Returns the learning phase flag.
[ "Returns", "the", "learning", "phase", "flag", "." ]
def learning_phase(): """Returns the learning phase flag. The learning phase flag is a bool tensor (0 = test, 1 = train) to be passed as input to any Keras function that uses a different behavior at train time and test time. Returns: Learning phase (scalar integer tensor or Python integer). """ gr...
[ "def", "learning_phase", "(", ")", ":", "graph", "=", "ops", ".", "get_default_graph", "(", ")", "if", "graph", "not", "in", "_GRAPH_LEARNING_PHASES", ":", "phase", "=", "array_ops", ".", "placeholder", "(", "dtype", "=", "'bool'", ",", "name", "=", "'kera...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/keras/python/keras/backend.py#L313-L327
qgis/QGIS
15a77662d4bb712184f6aa60d0bd663010a76a75
python/utils.py
python
startServerPlugin
(packageName: str)
return True
initialize the plugin
initialize the plugin
[ "initialize", "the", "plugin" ]
def startServerPlugin(packageName: str): """ initialize the plugin """ global server_plugins, server_active_plugins, serverIface if packageName in server_active_plugins: return False if packageName not in sys.modules: return False package = sys.modules[packageName] errMsg = QC...
[ "def", "startServerPlugin", "(", "packageName", ":", "str", ")", ":", "global", "server_plugins", ",", "server_active_plugins", ",", "serverIface", "if", "packageName", "in", "server_active_plugins", ":", "return", "False", "if", "packageName", "not", "in", "sys", ...
https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/utils.py#L714-L739
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/html.py
python
HtmlCell.GetMouseCursor
(*args, **kwargs)
return _html.HtmlCell_GetMouseCursor(*args, **kwargs)
GetMouseCursor(self, HtmlWindowInterface window) -> Cursor
GetMouseCursor(self, HtmlWindowInterface window) -> Cursor
[ "GetMouseCursor", "(", "self", "HtmlWindowInterface", "window", ")", "-", ">", "Cursor" ]
def GetMouseCursor(*args, **kwargs): """GetMouseCursor(self, HtmlWindowInterface window) -> Cursor""" return _html.HtmlCell_GetMouseCursor(*args, **kwargs)
[ "def", "GetMouseCursor", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html", ".", "HtmlCell_GetMouseCursor", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/html.py#L658-L660
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/tools/gyp/pylib/gyp/generator/ninja.py
python
NinjaWriter.WriteMacInfoPlist
(self, partial_info_plist, bundle_depends)
Write build rules for bundle Info.plist files.
Write build rules for bundle Info.plist files.
[ "Write", "build", "rules", "for", "bundle", "Info", ".", "plist", "files", "." ]
def WriteMacInfoPlist(self, partial_info_plist, bundle_depends): """Write build rules for bundle Info.plist files.""" info_plist, out, defines, extra_env = gyp.xcode_emulation.GetMacInfoPlist( generator_default_variables["PRODUCT_DIR"], self.xcode_settings, self.GypPa...
[ "def", "WriteMacInfoPlist", "(", "self", ",", "partial_info_plist", ",", "bundle_depends", ")", ":", "info_plist", ",", "out", ",", "defines", ",", "extra_env", "=", "gyp", ".", "xcode_emulation", ".", "GetMacInfoPlist", "(", "generator_default_variables", "[", "\...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/generator/ninja.py#L969-L1010
cornell-zhang/heterocl
6d9e4b4acc2ee2707b2d25b27298c0335bccedfd
python/heterocl/tvm/_ffi/_ctypes/function.py
python
_set_class_module
(module_class)
Initialize the module.
Initialize the module.
[ "Initialize", "the", "module", "." ]
def _set_class_module(module_class): """Initialize the module.""" global _CLASS_MODULE _CLASS_MODULE = module_class
[ "def", "_set_class_module", "(", "module_class", ")", ":", "global", "_CLASS_MODULE", "_CLASS_MODULE", "=", "module_class" ]
https://github.com/cornell-zhang/heterocl/blob/6d9e4b4acc2ee2707b2d25b27298c0335bccedfd/python/heterocl/tvm/_ffi/_ctypes/function.py#L215-L218
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/util/tf_inspect.py
python
getmro
(cls)
return _inspect.getmro(cls)
TFDecorator-aware replacement for inspect.getmro.
TFDecorator-aware replacement for inspect.getmro.
[ "TFDecorator", "-", "aware", "replacement", "for", "inspect", ".", "getmro", "." ]
def getmro(cls): """TFDecorator-aware replacement for inspect.getmro.""" return _inspect.getmro(cls)
[ "def", "getmro", "(", "cls", ")", ":", "return", "_inspect", ".", "getmro", "(", "cls", ")" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/util/tf_inspect.py#L108-L110
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/analogclock/analogclock.py
python
AnalogClock._recalcCoords
(self, size)
Recalculates all coordinates/geometry and inits the faceBitmap to make sure the buffer is always the same size as the window.
Recalculates all coordinates/geometry and inits the faceBitmap to make sure the buffer is always the same size as the window.
[ "Recalculates", "all", "coordinates", "/", "geometry", "and", "inits", "the", "faceBitmap", "to", "make", "sure", "the", "buffer", "is", "always", "the", "same", "size", "as", "the", "window", "." ]
def _recalcCoords(self, size): """ Recalculates all coordinates/geometry and inits the faceBitmap to make sure the buffer is always the same size as the window. """ self.faceBitmap = wx.EmptyBitmap(*size.Get()) # Recalc all coords. scale = min([float(size.width)...
[ "def", "_recalcCoords", "(", "self", ",", "size", ")", ":", "self", ".", "faceBitmap", "=", "wx", ".", "EmptyBitmap", "(", "*", "size", ".", "Get", "(", ")", ")", "# Recalc all coords.", "scale", "=", "min", "(", "[", "float", "(", "size", ".", "widt...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/analogclock/analogclock.py#L163-L185
google/skia
82d65d0487bd72f5f7332d002429ec2dc61d2463
infra/bots/recipe_modules/doxygen/resources/generate_and_upload_doxygen.py
python
generate_and_upload_doxygen
()
Generate Doxygen.
Generate Doxygen.
[ "Generate", "Doxygen", "." ]
def generate_and_upload_doxygen(): """Generate Doxygen.""" # Create empty dir and add static_footer.txt recreate_dir(DOXYGEN_WORKING_DIR) static_footer_path = os.path.join(DOXYGEN_WORKING_DIR, 'static_footer.txt') shutil.copyfile(os.path.join('tools', 'doxygen_footer.txt'), static_footer_pat...
[ "def", "generate_and_upload_doxygen", "(", ")", ":", "# Create empty dir and add static_footer.txt", "recreate_dir", "(", "DOXYGEN_WORKING_DIR", ")", "static_footer_path", "=", "os", ".", "path", ".", "join", "(", "DOXYGEN_WORKING_DIR", ",", "'static_footer.txt'", ")", "s...
https://github.com/google/skia/blob/82d65d0487bd72f5f7332d002429ec2dc61d2463/infra/bots/recipe_modules/doxygen/resources/generate_and_upload_doxygen.py#L42-L70
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/_abcoll.py
python
MutableSequence.remove
(self, value)
S.remove(value) -- remove first occurrence of value. Raise ValueError if the value is not present.
S.remove(value) -- remove first occurrence of value. Raise ValueError if the value is not present.
[ "S", ".", "remove", "(", "value", ")", "--", "remove", "first", "occurrence", "of", "value", ".", "Raise", "ValueError", "if", "the", "value", "is", "not", "present", "." ]
def remove(self, value): '''S.remove(value) -- remove first occurrence of value. Raise ValueError if the value is not present. ''' del self[self.index(value)]
[ "def", "remove", "(", "self", ",", "value", ")", ":", "del", "self", "[", "self", ".", "index", "(", "value", ")", "]" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/_abcoll.py#L661-L665
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
uCSIsGreekandCoptic
(code)
return ret
Check whether the character is part of GreekandCoptic UCS Block
Check whether the character is part of GreekandCoptic UCS Block
[ "Check", "whether", "the", "character", "is", "part", "of", "GreekandCoptic", "UCS", "Block" ]
def uCSIsGreekandCoptic(code): """Check whether the character is part of GreekandCoptic UCS Block """ ret = libxml2mod.xmlUCSIsGreekandCoptic(code) return ret
[ "def", "uCSIsGreekandCoptic", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsGreekandCoptic", "(", "code", ")", "return", "ret" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L2549-L2553
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/turtle.py
python
TurtleScreenBase.numinput
(self, title, prompt, default=None, minval=None, maxval=None)
return simpledialog.askfloat(title, prompt, initialvalue=default, minvalue=minval, maxvalue=maxval)
Pop up a dialog window for input of a number. Arguments: title is the title of the dialog window, prompt is a text mostly describing what numerical information to input. default: default value minval: minimum value for imput maxval: maximum value for input The number in...
Pop up a dialog window for input of a number.
[ "Pop", "up", "a", "dialog", "window", "for", "input", "of", "a", "number", "." ]
def numinput(self, title, prompt, default=None, minval=None, maxval=None): """Pop up a dialog window for input of a number. Arguments: title is the title of the dialog window, prompt is a text mostly describing what numerical information to input. default: default value minval: ...
[ "def", "numinput", "(", "self", ",", "title", ",", "prompt", ",", "default", "=", "None", ",", "minval", "=", "None", ",", "maxval", "=", "None", ")", ":", "return", "simpledialog", ".", "askfloat", "(", "title", ",", "prompt", ",", "initialvalue", "="...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/turtle.py#L830-L849
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/Chem/GraphDescriptors.py
python
_pyKappa1
(mol)
return kappa
Hall-Kier Kappa1 value From equations (58) and (59) of Rev. Comp. Chem. vol 2, 367-422, (1991)
Hall-Kier Kappa1 value
[ "Hall", "-", "Kier", "Kappa1", "value" ]
def _pyKappa1(mol): """ Hall-Kier Kappa1 value From equations (58) and (59) of Rev. Comp. Chem. vol 2, 367-422, (1991) """ P1 = mol.GetNumBonds(1) A = mol.GetNumHeavyAtoms() alpha = HallKierAlpha(mol) denom = P1 + alpha if denom: kappa = (A + alpha) * (A + alpha - 1)**2 / denom**2 else: kap...
[ "def", "_pyKappa1", "(", "mol", ")", ":", "P1", "=", "mol", ".", "GetNumBonds", "(", "1", ")", "A", "=", "mol", ".", "GetNumHeavyAtoms", "(", ")", "alpha", "=", "HallKierAlpha", "(", "mol", ")", "denom", "=", "P1", "+", "alpha", "if", "denom", ":",...
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/Chem/GraphDescriptors.py#L134-L148
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/factorization/python/ops/gmm_ops.py
python
GmmAlgorithm._create_variables
(self, data, initial_means=None)
Initializes GMM algorithm. Args: data: a list of Tensors with data, each row is a new example. initial_means: a Tensor with a matrix of means.
Initializes GMM algorithm.
[ "Initializes", "GMM", "algorithm", "." ]
def _create_variables(self, data, initial_means=None): """Initializes GMM algorithm. Args: data: a list of Tensors with data, each row is a new example. initial_means: a Tensor with a matrix of means. """ first_shard = data[0] # Initialize means: num_classes X 1 X dimensions. if ini...
[ "def", "_create_variables", "(", "self", ",", "data", ",", "initial_means", "=", "None", ")", ":", "first_shard", "=", "data", "[", "0", "]", "# Initialize means: num_classes X 1 X dimensions.", "if", "initial_means", "is", "not", "None", ":", "self", ".", "_mea...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L135-L170
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/command/sdist.py
python
sdist.prune_file_list
(self)
Prune off branches that might slip into the file list as created by 'read_template()', but really don't belong there: * the build tree (typically "build") * the release tree itself (only an issue if we ran "sdist" previously with --keep-temp, or it aborted) * any RCS, C...
Prune off branches that might slip into the file list as created by 'read_template()', but really don't belong there: * the build tree (typically "build") * the release tree itself (only an issue if we ran "sdist" previously with --keep-temp, or it aborted) * any RCS, C...
[ "Prune", "off", "branches", "that", "might", "slip", "into", "the", "file", "list", "as", "created", "by", "read_template", "()", "but", "really", "don", "t", "belong", "there", ":", "*", "the", "build", "tree", "(", "typically", "build", ")", "*", "the"...
def prune_file_list(self): """Prune off branches that might slip into the file list as created by 'read_template()', but really don't belong there: * the build tree (typically "build") * the release tree itself (only an issue if we ran "sdist" previously with --keep-temp,...
[ "def", "prune_file_list", "(", "self", ")", ":", "build", "=", "self", ".", "get_finalized_command", "(", "'build'", ")", "base_dir", "=", "self", ".", "distribution", ".", "get_fullname", "(", ")", "self", ".", "filelist", ".", "exclude_pattern", "(", "None...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/command/sdist.py#L333-L357
mingchen/protobuf-ios
0958df34558cd54cb7b6e6ca5c8855bf3d475046
compiler/python/google/protobuf/reflection.py
python
_ExtensionDict._AddMissingHandle
(self, extension_handle, handle_id)
Helper internal to ExtensionDict.
Helper internal to ExtensionDict.
[ "Helper", "internal", "to", "ExtensionDict", "." ]
def _AddMissingHandle(self, extension_handle, handle_id): """Helper internal to ExtensionDict.""" # Special handling for non-repeated message extensions, which (like # normal fields of this kind) are initialized lazily. # REQUIRES: _lock already held. cpp_type = extension_handle.cpp_type label =...
[ "def", "_AddMissingHandle", "(", "self", ",", "extension_handle", ",", "handle_id", ")", ":", "# Special handling for non-repeated message extensions, which (like", "# normal fields of this kind) are initialized lazily.", "# REQUIRES: _lock already held.", "cpp_type", "=", "extension_h...
https://github.com/mingchen/protobuf-ios/blob/0958df34558cd54cb7b6e6ca5c8855bf3d475046/compiler/python/google/protobuf/reflection.py#L1542-L1554
binarly-io/efiXplorer
d6d2cdb8c9ea30e5d4dec4541c3d65a69f239bfd
build.py
python
build_plugin
(idasdk: str, hexrays_sdk: str, batch: bool)
Build efiXplorer plugin
Build efiXplorer plugin
[ "Build", "efiXplorer", "plugin" ]
def build_plugin(idasdk: str, hexrays_sdk: str, batch: bool): """Build efiXplorer plugin""" os.chdir("efiXplorer") if not os.path.isdir("build"): os.mkdir("build") os.chdir("build") command = ["cmake", "..", f"-DIdaSdk_ROOT_DIR={idasdk}"] if batch: command.append("-DBATCH=1")...
[ "def", "build_plugin", "(", "idasdk", ":", "str", ",", "hexrays_sdk", ":", "str", ",", "batch", ":", "bool", ")", ":", "os", ".", "chdir", "(", "\"efiXplorer\"", ")", "if", "not", "os", ".", "path", ".", "isdir", "(", "\"build\"", ")", ":", "os", "...
https://github.com/binarly-io/efiXplorer/blob/d6d2cdb8c9ea30e5d4dec4541c3d65a69f239bfd/build.py#L30-L48
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/mapreduce/mapreduce/map_job_context.py
python
SliceContext.__init__
(self, shard_context, shard_state, tstate)
Init. The signature of __init__ is subject to change. Read only properties: job_context: JobContext object. shard_context: ShardContext object. number: int. slice number. 0 indexed. attempt: int. The current attempt at executing this slice. starting at 1. Args: shard...
Init.
[ "Init", "." ]
def __init__(self, shard_context, shard_state, tstate): """Init. The signature of __init__ is subject to change. Read only properties: job_context: JobContext object. shard_context: ShardContext object. number: int. slice number. 0 indexed. attempt: int. The current attempt at exec...
[ "def", "__init__", "(", "self", ",", "shard_context", ",", "shard_state", ",", "tstate", ")", ":", "self", ".", "_tstate", "=", "tstate", "self", ".", "job_context", "=", "shard_context", ".", "job_context", "self", ".", "shard_context", "=", "shard_context", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mapreduce/mapreduce/map_job_context.py#L75-L96
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/stc.py
python
StyledTextCtrl.HomeDisplayExtend
(*args, **kwargs)
return _stc.StyledTextCtrl_HomeDisplayExtend(*args, **kwargs)
HomeDisplayExtend(self) Move caret to first position on display line extending selection to new caret position.
HomeDisplayExtend(self)
[ "HomeDisplayExtend", "(", "self", ")" ]
def HomeDisplayExtend(*args, **kwargs): """ HomeDisplayExtend(self) Move caret to first position on display line extending selection to new caret position. """ return _stc.StyledTextCtrl_HomeDisplayExtend(*args, **kwargs)
[ "def", "HomeDisplayExtend", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_HomeDisplayExtend", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L4717-L4724
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/string.py
python
center
(s, width, *args)
return s.center(width, *args)
center(s, width[, fillchar]) -> string Return a center version of s, in a field of the specified width. padded with spaces as needed. The string is never truncated. If specified the fillchar is used instead of spaces.
center(s, width[, fillchar]) -> string
[ "center", "(", "s", "width", "[", "fillchar", "]", ")", "-", ">", "string" ]
def center(s, width, *args): """center(s, width[, fillchar]) -> string Return a center version of s, in a field of the specified width. padded with spaces as needed. The string is never truncated. If specified the fillchar is used instead of spaces. """ return s.center(width, *args)
[ "def", "center", "(", "s", ",", "width", ",", "*", "args", ")", ":", "return", "s", ".", "center", "(", "width", ",", "*", "args", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/string.py#L445-L453
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/masked/timectrl.py
python
TimeCtrl.__LimitSelection
(self, event)
Event handler for motion events; this handler changes limits the selection to the new cell boundaries.
Event handler for motion events; this handler changes limits the selection to the new cell boundaries.
[ "Event", "handler", "for", "motion", "events", ";", "this", "handler", "changes", "limits", "the", "selection", "to", "the", "new", "cell", "boundaries", "." ]
def __LimitSelection(self, event): """ Event handler for motion events; this handler changes limits the selection to the new cell boundaries. """ ## dbg('TimeCtrl::LimitSelection', indent=1) pos = self.GetInsertionPoint() self.__posCurrent = pos sel_start, ...
[ "def", "__LimitSelection", "(", "self", ",", "event", ")", ":", "## dbg('TimeCtrl::LimitSelection', indent=1)", "pos", "=", "self", ".", "GetInsertionPoint", "(", ")", "self", ".", "__posCurrent", "=", "pos", "sel_start", ",", "sel_to", "=", "self", ".", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/masked/timectrl.py#L1224-L1243
KratosMultiphysics/Kratos
0000833054ed0503424eb28205d6508d9ca6cbbc
kratos/python_scripts/set_initial_state_process.py
python
SetInitialStateProcess.__init__
(self, Model, settings)
The default constructor of the class Keyword arguments: self -- It signifies an instance of a class. Model -- the container of the different model parts. settings -- Kratos parameters containing solver settings.
The default constructor of the class
[ "The", "default", "constructor", "of", "the", "class" ]
def __init__(self, Model, settings): """The default constructor of the class Keyword arguments: self -- It signifies an instance of a class. Model -- the container of the different model parts. settings -- Kratos parameters containing solver settings. """ KratosM...
[ "def", "__init__", "(", "self", ",", "Model", ",", "settings", ")", ":", "KratosMultiphysics", ".", "Process", ".", "__init__", "(", "self", ")", "# The value can be a double or a string (function)", "default_settings", "=", "KratosMultiphysics", ".", "Parameters", "(...
https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/kratos/python_scripts/set_initial_state_process.py#L57-L108
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/tkinter/ttk.py
python
Treeview.tag_bind
(self, tagname, sequence=None, callback=None)
Bind a callback for the given event sequence to the tag tagname. When an event is delivered to an item, the callbacks for each of the item's tags option are called.
Bind a callback for the given event sequence to the tag tagname. When an event is delivered to an item, the callbacks for each of the item's tags option are called.
[ "Bind", "a", "callback", "for", "the", "given", "event", "sequence", "to", "the", "tag", "tagname", ".", "When", "an", "event", "is", "delivered", "to", "an", "item", "the", "callbacks", "for", "each", "of", "the", "item", "s", "tags", "option", "are", ...
def tag_bind(self, tagname, sequence=None, callback=None): """Bind a callback for the given event sequence to the tag tagname. When an event is delivered to an item, the callbacks for each of the item's tags option are called.""" self._bind((self._w, "tag", "bind", tagname), sequence, ca...
[ "def", "tag_bind", "(", "self", ",", "tagname", ",", "sequence", "=", "None", ",", "callback", "=", "None", ")", ":", "self", ".", "_bind", "(", "(", "self", ".", "_w", ",", "\"tag\"", ",", "\"bind\"", ",", "tagname", ")", ",", "sequence", ",", "ca...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/ttk.py#L1491-L1495
swift/swift
12d031cf8177fdec0137f9aa7e2912fa23c4416b
3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/midl.py
python
midl_emitter
(target, source, env)
return (targets, source)
Produces a list of outputs from the MIDL compiler
Produces a list of outputs from the MIDL compiler
[ "Produces", "a", "list", "of", "outputs", "from", "the", "MIDL", "compiler" ]
def midl_emitter(target, source, env): """Produces a list of outputs from the MIDL compiler""" base, _ = SCons.Util.splitext(str(target[0])) tlb = target[0] incl = base + '.h' interface = base + '_i.c' targets = [tlb, incl, interface] midlcom = env['MIDLCOM'] if midlcom.find('/proxy') ...
[ "def", "midl_emitter", "(", "target", ",", "source", ",", "env", ")", ":", "base", ",", "_", "=", "SCons", ".", "Util", ".", "splitext", "(", "str", "(", "target", "[", "0", "]", ")", ")", "tlb", "=", "target", "[", "0", "]", "incl", "=", "base...
https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/midl.py#L44-L61
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/tensor_array_ops.py
python
TensorArray.stack
(self, name=None)
Return the values in the TensorArray as a stacked `Tensor`. All of the values must have been written and their shapes must all match. If input shapes have rank-`R`, then output shape will have rank-`(R+1)`. Args: name: A name for the operation (optional). Returns: All the tensors in the T...
Return the values in the TensorArray as a stacked `Tensor`.
[ "Return", "the", "values", "in", "the", "TensorArray", "as", "a", "stacked", "Tensor", "." ]
def stack(self, name=None): """Return the values in the TensorArray as a stacked `Tensor`. All of the values must have been written and their shapes must all match. If input shapes have rank-`R`, then output shape will have rank-`(R+1)`. Args: name: A name for the operation (optional). Retu...
[ "def", "stack", "(", "self", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "colocate_with", "(", "self", ".", "_handle", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "\"TensorArrayStack\"", ",", "[", "self", ".", "_handle", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/tensor_array_ops.py#L321-L335
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/losses.py
python
binary_crossentropy
(y_true, y_pred, from_logits=False, label_smoothing=0, axis=-1)
return backend.mean( backend.binary_crossentropy(y_true, y_pred, from_logits=from_logits), axis=axis)
Computes the binary crossentropy loss. Standalone usage: >>> y_true = [[0, 1], [0, 0]] >>> y_pred = [[0.6, 0.4], [0.4, 0.6]] >>> loss = tf.keras.losses.binary_crossentropy(y_true, y_pred) >>> assert loss.shape == (2,) >>> loss.numpy() array([0.916 , 0.714], dtype=float32) Args: y_true: Ground tru...
Computes the binary crossentropy loss.
[ "Computes", "the", "binary", "crossentropy", "loss", "." ]
def binary_crossentropy(y_true, y_pred, from_logits=False, label_smoothing=0, axis=-1): """Computes the binary crossentropy loss. Standalone usage: >>> y_true = [[0, 1], [0, 0]] >>> y_pred = [[0.6, 0.4], [0.4, 0.6]...
[ "def", "binary_crossentropy", "(", "y_true", ",", "y_pred", ",", "from_logits", "=", "False", ",", "label_smoothing", "=", "0", ",", "axis", "=", "-", "1", ")", ":", "y_pred", "=", "ops", ".", "convert_to_tensor_v2_with_dispatch", "(", "y_pred", ")", "y_true...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/losses.py#L1782-L1824
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/psutil/_psbsd.py
python
boot_time
()
return cext.boot_time()
The system boot time expressed in seconds since the epoch.
The system boot time expressed in seconds since the epoch.
[ "The", "system", "boot", "time", "expressed", "in", "seconds", "since", "the", "epoch", "." ]
def boot_time(): """The system boot time expressed in seconds since the epoch.""" return cext.boot_time()
[ "def", "boot_time", "(", ")", ":", "return", "cext", ".", "boot_time", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/psutil/_psbsd.py#L475-L477
msitt/blpapi-python
bebcf43668c9e5f5467b1f685f9baebbfc45bc87
src/blpapi/service.py
python
Operation._sessions
(self)
return self.__sessions
Return session(s) this object is related to. For internal use.
Return session(s) this object is related to. For internal use.
[ "Return", "session", "(", "s", ")", "this", "object", "is", "related", "to", ".", "For", "internal", "use", "." ]
def _sessions(self): """Return session(s) this object is related to. For internal use.""" return self.__sessions
[ "def", "_sessions", "(", "self", ")", ":", "return", "self", ".", "__sessions" ]
https://github.com/msitt/blpapi-python/blob/bebcf43668c9e5f5467b1f685f9baebbfc45bc87/src/blpapi/service.py#L102-L104
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/common.py
python
is_s3_url
(url)
return parse_url(url).scheme in ["s3", "s3n", "s3a"]
Check for an s3, s3n, or s3a url
Check for an s3, s3n, or s3a url
[ "Check", "for", "an", "s3", "s3n", "or", "s3a", "url" ]
def is_s3_url(url) -> bool: """Check for an s3, s3n, or s3a url""" if not isinstance(url, str): return False return parse_url(url).scheme in ["s3", "s3n", "s3a"]
[ "def", "is_s3_url", "(", "url", ")", "->", "bool", ":", "if", "not", "isinstance", "(", "url", ",", "str", ")", ":", "return", "False", "return", "parse_url", "(", "url", ")", ".", "scheme", "in", "[", "\"s3\"", ",", "\"s3n\"", ",", "\"s3a\"", "]" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/common.py#L120-L124
cztomczak/cefpython
5679f28cec18a57a56e298da2927aac8d8f83ad6
examples/wxpython.py
python
scale_window_size_for_high_dpi
(width, height)
return width, height
Scale window size for high DPI devices. This func can be called on all operating systems, but scales only for Windows. If scaled value is bigger than the work area on the display then it will be reduced.
Scale window size for high DPI devices. This func can be called on all operating systems, but scales only for Windows. If scaled value is bigger than the work area on the display then it will be reduced.
[ "Scale", "window", "size", "for", "high", "DPI", "devices", ".", "This", "func", "can", "be", "called", "on", "all", "operating", "systems", "but", "scales", "only", "for", "Windows", ".", "If", "scaled", "value", "is", "bigger", "than", "the", "work", "...
def scale_window_size_for_high_dpi(width, height): """Scale window size for high DPI devices. This func can be called on all operating systems, but scales only for Windows. If scaled value is bigger than the work area on the display then it will be reduced.""" if not WINDOWS: return width, h...
[ "def", "scale_window_size_for_high_dpi", "(", "width", ",", "height", ")", ":", "if", "not", "WINDOWS", ":", "return", "width", ",", "height", "(", "_", ",", "_", ",", "max_width", ",", "max_height", ")", "=", "wx", ".", "GetClientDisplayRect", "(", ")", ...
https://github.com/cztomczak/cefpython/blob/5679f28cec18a57a56e298da2927aac8d8f83ad6/examples/wxpython.py#L71-L85
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/Blast/3rdParty/assimp/port/PyAssimp/pyassimp/core.py
python
pythonize_assimp
(type, obj, scene)
This method modify the Assimp data structures to make them easier to work with in Python. Supported operations: - MESH: replace a list of mesh IDs by reference to these meshes - ADDTRANSFORMATION: add a reference to an object's transformation taken from their associated node. :param type: the ty...
This method modify the Assimp data structures to make them easier to work with in Python.
[ "This", "method", "modify", "the", "Assimp", "data", "structures", "to", "make", "them", "easier", "to", "work", "with", "in", "Python", "." ]
def pythonize_assimp(type, obj, scene): """ This method modify the Assimp data structures to make them easier to work with in Python. Supported operations: - MESH: replace a list of mesh IDs by reference to these meshes - ADDTRANSFORMATION: add a reference to an object's transformation taken from...
[ "def", "pythonize_assimp", "(", "type", ",", "obj", ",", "scene", ")", ":", "if", "type", "==", "\"MESH\"", ":", "meshes", "=", "[", "]", "for", "i", "in", "obj", ":", "meshes", ".", "append", "(", "scene", ".", "meshes", "[", "i", "]", ")", "ret...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/Blast/3rdParty/assimp/port/PyAssimp/pyassimp/core.py#L233-L262
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
mlir/python/mlir/dialects/_scf_ops_ext.py
python
ForOp.body
(self)
return self.regions[0].blocks[0]
Returns the body (block) of the loop.
Returns the body (block) of the loop.
[ "Returns", "the", "body", "(", "block", ")", "of", "the", "loop", "." ]
def body(self): """Returns the body (block) of the loop.""" return self.regions[0].blocks[0]
[ "def", "body", "(", "self", ")", ":", "return", "self", ".", "regions", "[", "0", "]", ".", "blocks", "[", "0", "]" ]
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/mlir/python/mlir/dialects/_scf_ops_ext.py#L51-L53
interpretml/interpret
29466bffc04505fe4f836a83fcfebfd313ac8454
python/interpret-core/interpret/develop.py
python
sizeof_fmt
(num, suffix="B")
return "%.1f%s%s" % (num, "Yi", suffix)
Returns bytes in human readable form. Taken from below link: https://stackoverflow.com/questions/1094841/reusable-library-to-get-human-readable-version-of-file-size Args: num: Number (bytes) to represent in human readable form. suffix: Suffix required for Python format string. Returns: ...
Returns bytes in human readable form. Taken from below link: https://stackoverflow.com/questions/1094841/reusable-library-to-get-human-readable-version-of-file-size
[ "Returns", "bytes", "in", "human", "readable", "form", ".", "Taken", "from", "below", "link", ":", "https", ":", "//", "stackoverflow", ".", "com", "/", "questions", "/", "1094841", "/", "reusable", "-", "library", "-", "to", "-", "get", "-", "human", ...
def sizeof_fmt(num, suffix="B"): """ Returns bytes in human readable form. Taken from below link: https://stackoverflow.com/questions/1094841/reusable-library-to-get-human-readable-version-of-file-size Args: num: Number (bytes) to represent in human readable form. suffix: Suffix required fo...
[ "def", "sizeof_fmt", "(", "num", ",", "suffix", "=", "\"B\"", ")", ":", "for", "unit", "in", "[", "\"\"", ",", "\"Ki\"", ",", "\"Mi\"", ",", "\"Gi\"", ",", "\"Ti\"", ",", "\"Pi\"", ",", "\"Ei\"", ",", "\"Zi\"", "]", ":", "if", "abs", "(", "num", ...
https://github.com/interpretml/interpret/blob/29466bffc04505fe4f836a83fcfebfd313ac8454/python/interpret-core/interpret/develop.py#L113-L128
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/webapp2/webapp2.py
python
RequestHandler.uri_for
(self, _name, *args, **kwargs)
return self.app.router.build(self.request, _name, args, kwargs)
Returns a URI for a named :class:`Route`. .. seealso:: :meth:`Router.build`.
Returns a URI for a named :class:`Route`.
[ "Returns", "a", "URI", "for", "a", "named", ":", "class", ":", "Route", "." ]
def uri_for(self, _name, *args, **kwargs): """Returns a URI for a named :class:`Route`. .. seealso:: :meth:`Router.build`. """ return self.app.router.build(self.request, _name, args, kwargs)
[ "def", "uri_for", "(", "self", ",", "_name", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "app", ".", "router", ".", "build", "(", "self", ".", "request", ",", "_name", ",", "args", ",", "kwargs", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/webapp2/webapp2.py#L620-L625
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/nntplib.py
python
NNTP.artcmd
(self, line, file=None)
return resp, nr, id, list
Internal: process a HEAD, BODY or ARTICLE command.
Internal: process a HEAD, BODY or ARTICLE command.
[ "Internal", ":", "process", "a", "HEAD", "BODY", "or", "ARTICLE", "command", "." ]
def artcmd(self, line, file=None): """Internal: process a HEAD, BODY or ARTICLE command.""" resp, list = self.longcmd(line, file) resp, nr, id = self.statparse(resp) return resp, nr, id, list
[ "def", "artcmd", "(", "self", ",", "line", ",", "file", "=", "None", ")", ":", "resp", ",", "list", "=", "self", ".", "longcmd", "(", "line", ",", "file", ")", "resp", ",", "nr", ",", "id", "=", "self", ".", "statparse", "(", "resp", ")", "retu...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/nntplib.py#L405-L409
google/skia
82d65d0487bd72f5f7332d002429ec2dc61d2463
infra/bots/recipe_modules/flavor/api.py
python
SkiaFlavorApi._copy_lotties
(self)
return version
Copy test lotties if needed.
Copy test lotties if needed.
[ "Copy", "test", "lotties", "if", "needed", "." ]
def _copy_lotties(self): """Copy test lotties if needed.""" version = self.m.run.asset_version('lottie-samples', self._skia_dir) self.m.run.writefile( self.m.path.join(self.m.vars.tmp_dir, VERSION_FILE_LOTTIE), version) self._copy_dir( version, VERSION_FILE_LOTTIE, ...
[ "def", "_copy_lotties", "(", "self", ")", ":", "version", "=", "self", ".", "m", ".", "run", ".", "asset_version", "(", "'lottie-samples'", ",", "self", ".", "_skia_dir", ")", "self", ".", "m", ".", "run", ".", "writefile", "(", "self", ".", "m", "."...
https://github.com/google/skia/blob/82d65d0487bd72f5f7332d002429ec2dc61d2463/infra/bots/recipe_modules/flavor/api.py#L169-L181
Dovyski/cvui
d1b40267bdee34fcc193a375911415222f1409b3
cvui.py
python
iarea
(theX, theY, theWidth, theHeight)
return __internal.iarea(theX, theY, theWidth, theHeight)
Create an interaction area that reports activity with the mouse cursor. The tracked interactions are returned by the function and they are: `OUT` when the cursor is not over the iarea. `OVER` when the cursor is over the iarea. `DOWN` when the cursor is pressed over the iarea, but not released yet. `CLICK` when th...
Create an interaction area that reports activity with the mouse cursor. The tracked interactions are returned by the function and they are:
[ "Create", "an", "interaction", "area", "that", "reports", "activity", "with", "the", "mouse", "cursor", ".", "The", "tracked", "interactions", "are", "returned", "by", "the", "function", "and", "they", "are", ":" ]
def iarea(theX, theY, theWidth, theHeight): """ Create an interaction area that reports activity with the mouse cursor. The tracked interactions are returned by the function and they are: `OUT` when the cursor is not over the iarea. `OVER` when the cursor is over the iarea. `DOWN` when the cursor is pressed over...
[ "def", "iarea", "(", "theX", ",", "theY", ",", "theWidth", ",", "theHeight", ")", ":", "return", "__internal", ".", "iarea", "(", "theX", ",", "theY", ",", "theWidth", ",", "theHeight", ")" ]
https://github.com/Dovyski/cvui/blob/d1b40267bdee34fcc193a375911415222f1409b3/cvui.py#L1714-L1747
esa/pykep
b410363653623730b577de257c04b0e0289f2014
pykep/phasing/_knn.py
python
knn._make_kdtree
(self, t)
return cKDTree(e)
Returns a kd-tree data structure indexing the normalized ephemerides of planets_list, at epoch t. make_kdtree( planets_list, t, ref_r=AU, ref_v=EARTH_VELOCITY ) - planets_list: list of pykep.planet objects - t: epoch The returned kd-tree can then be used for efficient nearest-...
Returns a kd-tree data structure indexing the normalized ephemerides of planets_list, at epoch t.
[ "Returns", "a", "kd", "-", "tree", "data", "structure", "indexing", "the", "normalized", "ephemerides", "of", "planets_list", "at", "epoch", "t", "." ]
def _make_kdtree(self, t): """ Returns a kd-tree data structure indexing the normalized ephemerides of planets_list, at epoch t. make_kdtree( planets_list, t, ref_r=AU, ref_v=EARTH_VELOCITY ) - planets_list: list of pykep.planet objects - t: epoch The returned ...
[ "def", "_make_kdtree", "(", "self", ",", "t", ")", ":", "from", "scipy", ".", "spatial", "import", "cKDTree", "import", "numpy", "as", "np", "if", "self", ".", "_metric", "==", "'euclidean'", ":", "e", "=", "np", ".", "array", "(", "[", "a", ".", "...
https://github.com/esa/pykep/blob/b410363653623730b577de257c04b0e0289f2014/pykep/phasing/_knn.py#L53-L93
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/lib2to3/pgen2/driver.py
python
Driver.parse_file
(self, filename, encoding=None, debug=False)
Parse a file and return the syntax tree.
Parse a file and return the syntax tree.
[ "Parse", "a", "file", "and", "return", "the", "syntax", "tree", "." ]
def parse_file(self, filename, encoding=None, debug=False): """Parse a file and return the syntax tree.""" with io.open(filename, "r", encoding=encoding) as stream: return self.parse_stream(stream, debug)
[ "def", "parse_file", "(", "self", ",", "filename", ",", "encoding", "=", "None", ",", "debug", "=", "False", ")", ":", "with", "io", ".", "open", "(", "filename", ",", "\"r\"", ",", "encoding", "=", "encoding", ")", "as", "stream", ":", "return", "se...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/lib2to3/pgen2/driver.py#L96-L99
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/email/_parseaddr.py
python
AddrlistClass.getdomainliteral
(self)
return '[%s]' % self.getdelimited('[', ']\r', False)
Parse an RFC 2822 domain-literal.
Parse an RFC 2822 domain-literal.
[ "Parse", "an", "RFC", "2822", "domain", "-", "literal", "." ]
def getdomainliteral(self): """Parse an RFC 2822 domain-literal.""" return '[%s]' % self.getdelimited('[', ']\r', False)
[ "def", "getdomainliteral", "(", "self", ")", ":", "return", "'[%s]'", "%", "self", ".", "getdelimited", "(", "'['", ",", "']\\r'", ",", "False", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/email/_parseaddr.py#L405-L407
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/fsm/FSM.py
python
FSM.requestNext
(self, *args)
Request the 'next' state in the predefined state array.
Request the 'next' state in the predefined state array.
[ "Request", "the", "next", "state", "in", "the", "predefined", "state", "array", "." ]
def requestNext(self, *args): """Request the 'next' state in the predefined state array.""" self.fsmLock.acquire() try: if self.stateArray: if not self.state in self.stateArray: return self.request(self.stateArray[0]) else: ...
[ "def", "requestNext", "(", "self", ",", "*", "args", ")", ":", "self", ".", "fsmLock", ".", "acquire", "(", ")", "try", ":", "if", "self", ".", "stateArray", ":", "if", "not", "self", ".", "state", "in", "self", ".", "stateArray", ":", "return", "s...
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/fsm/FSM.py#L476-L492
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/autograph/operators/data_structures.py
python
_py_list_append
(list_, x)
return list_
Overload of list_append that executes a Python list append.
Overload of list_append that executes a Python list append.
[ "Overload", "of", "list_append", "that", "executes", "a", "Python", "list", "append", "." ]
def _py_list_append(list_, x): """Overload of list_append that executes a Python list append.""" # Revert to the original call. list_.append(x) return list_
[ "def", "_py_list_append", "(", "list_", ",", "x", ")", ":", "# Revert to the original call.", "list_", ".", "append", "(", "x", ")", "return", "list_" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/autograph/operators/data_structures.py#L223-L227
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/cephfs/kernel_mount.py
python
KernelMount.read_debug_file
(self, filename)
Read the debug file "filename", return None if the file doesn't exist.
Read the debug file "filename", return None if the file doesn't exist.
[ "Read", "the", "debug", "file", "filename", "return", "None", "if", "the", "file", "doesn", "t", "exist", "." ]
def read_debug_file(self, filename): """ Read the debug file "filename", return None if the file doesn't exist. """ path = os.path.join(self._get_debug_dir(), filename) stdout = StringIO() stderr = StringIO() try: self.run_shell_payload(f"sudo dd if=...
[ "def", "read_debug_file", "(", "self", ",", "filename", ")", ":", "path", "=", "os", ".", "path", ".", "join", "(", "self", ".", "_get_debug_dir", "(", ")", ",", "filename", ")", "stdout", "=", "StringIO", "(", ")", "stderr", "=", "StringIO", "(", ")...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/cephfs/kernel_mount.py#L205-L221
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/gluon/parameter.py
python
Parameter._init_grad
(self)
Initialize grad buffers.
Initialize grad buffers.
[ "Initialize", "grad", "buffers", "." ]
def _init_grad(self): """Initialize grad buffers.""" if self.grad_req == 'null': self._grad = None return self._grad = [ndarray.zeros(shape=i.shape, dtype=i.dtype, ctx=i.context, stype=self._grad_stype) for i in self._data] au...
[ "def", "_init_grad", "(", "self", ")", ":", "if", "self", ".", "grad_req", "==", "'null'", ":", "self", ".", "_grad", "=", "None", "return", "self", ".", "_grad", "=", "[", "ndarray", ".", "zeros", "(", "shape", "=", "i", ".", "shape", ",", "dtype"...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/gluon/parameter.py#L349-L359
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBTarget.FindTypes
(self, *args)
return _lldb.SBTarget_FindTypes(self, *args)
FindTypes(self, str type) -> SBTypeList
FindTypes(self, str type) -> SBTypeList
[ "FindTypes", "(", "self", "str", "type", ")", "-", ">", "SBTypeList" ]
def FindTypes(self, *args): """FindTypes(self, str type) -> SBTypeList""" return _lldb.SBTarget_FindTypes(self, *args)
[ "def", "FindTypes", "(", "self", ",", "*", "args", ")", ":", "return", "_lldb", ".", "SBTarget_FindTypes", "(", "self", ",", "*", "args", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L8957-L8959
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/numerics.py
python
add_check_numerics_ops
()
return control_flow_ops.group(*check_op)
Connect a `tf.debugging.check_numerics` to every floating point tensor. `check_numerics` operations themselves are added for each `half`, `float`, or `double` tensor in the current default graph. For all ops in the graph, the `check_numerics` op for all of its (`half`, `float`, or `double`) inputs is guarantee...
Connect a `tf.debugging.check_numerics` to every floating point tensor.
[ "Connect", "a", "tf", ".", "debugging", ".", "check_numerics", "to", "every", "floating", "point", "tensor", "." ]
def add_check_numerics_ops(): """Connect a `tf.debugging.check_numerics` to every floating point tensor. `check_numerics` operations themselves are added for each `half`, `float`, or `double` tensor in the current default graph. For all ops in the graph, the `check_numerics` op for all of its (`half`, `float`,...
[ "def", "add_check_numerics_ops", "(", ")", ":", "if", "context", ".", "executing_eagerly", "(", ")", ":", "raise", "RuntimeError", "(", "\"add_check_numerics_ops() is not compatible with eager execution. \"", "\"To check for Inf's and NaN's under eager execution, call \"", "\"tf.de...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/numerics.py#L72-L121
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
TextAttr.IsDefault
(*args, **kwargs)
return _controls_.TextAttr_IsDefault(*args, **kwargs)
IsDefault(self) -> bool
IsDefault(self) -> bool
[ "IsDefault", "(", "self", ")", "-", ">", "bool" ]
def IsDefault(*args, **kwargs): """IsDefault(self) -> bool""" return _controls_.TextAttr_IsDefault(*args, **kwargs)
[ "def", "IsDefault", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "TextAttr_IsDefault", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L1908-L1910
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBTypeSummary.SetSummaryString
(self, data)
return _lldb.SBTypeSummary_SetSummaryString(self, data)
SetSummaryString(SBTypeSummary self, char const * data)
SetSummaryString(SBTypeSummary self, char const * data)
[ "SetSummaryString", "(", "SBTypeSummary", "self", "char", "const", "*", "data", ")" ]
def SetSummaryString(self, data): """SetSummaryString(SBTypeSummary self, char const * data)""" return _lldb.SBTypeSummary_SetSummaryString(self, data)
[ "def", "SetSummaryString", "(", "self", ",", "data", ")", ":", "return", "_lldb", ".", "SBTypeSummary_SetSummaryString", "(", "self", ",", "data", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L13870-L13872
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/cluster/_kmeans.py
python
KMeans.fit_transform
(self, X, y=None, sample_weight=None)
return self.fit(X, sample_weight=sample_weight)._transform(X)
Compute clustering and transform X to cluster-distance space. Equivalent to fit(X).transform(X), but more efficiently implemented. Parameters ---------- X : {array-like, sparse matrix} of shape (n_samples, n_features) New data to transform. y : Ignored ...
Compute clustering and transform X to cluster-distance space.
[ "Compute", "clustering", "and", "transform", "X", "to", "cluster", "-", "distance", "space", "." ]
def fit_transform(self, X, y=None, sample_weight=None): """Compute clustering and transform X to cluster-distance space. Equivalent to fit(X).transform(X), but more efficiently implemented. Parameters ---------- X : {array-like, sparse matrix} of shape (n_samples, n_features) ...
[ "def", "fit_transform", "(", "self", ",", "X", ",", "y", "=", "None", ",", "sample_weight", "=", "None", ")", ":", "# Currently, this just skips a copy of the data if it is not in", "# np.array or CSR format already.", "# XXX This skips _check_test_data, which may change the dtyp...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/cluster/_kmeans.py#L1010-L1036
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/android/pylib/local/emulator/ini.py
python
update_ini_file
(ini_file_path)
Load and update the contents of an ini file. Args: ini_file_path: A string containing the absolute path of the ini file. Yields: The contents of the file, as a dict
Load and update the contents of an ini file.
[ "Load", "and", "update", "the", "contents", "of", "an", "ini", "file", "." ]
def update_ini_file(ini_file_path): """Load and update the contents of an ini file. Args: ini_file_path: A string containing the absolute path of the ini file. Yields: The contents of the file, as a dict """ if os.path.exists(ini_file_path): with open(ini_file_path) as ini_file: ini_content...
[ "def", "update_ini_file", "(", "ini_file_path", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "ini_file_path", ")", ":", "with", "open", "(", "ini_file_path", ")", "as", "ini_file", ":", "ini_contents", "=", "load", "(", "ini_file", ")", "else", ...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/pylib/local/emulator/ini.py#L41-L58
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
StaticLine.GetDefaultSize
(*args, **kwargs)
return _controls_.StaticLine_GetDefaultSize(*args, **kwargs)
GetDefaultSize() -> int
GetDefaultSize() -> int
[ "GetDefaultSize", "()", "-", ">", "int" ]
def GetDefaultSize(*args, **kwargs): """GetDefaultSize() -> int""" return _controls_.StaticLine_GetDefaultSize(*args, **kwargs)
[ "def", "GetDefaultSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "StaticLine_GetDefaultSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L930-L932
CleverRaven/Cataclysm-DDA
03e7363df0835ec1b39da973ea29f26f27833b38
tools/json_tools/generate_overmap_sprites.py
python
output_sprite
( name: str, image: Image, generate_json: bool, output_dir: Optional[Path] = None, duplicates_dir: Optional[Path] = None, rotation: int = 0, # rotation: Union[None, int, list] = None, # single_terrain: bool = False )
Handle single sprite
Handle single sprite
[ "Handle", "single", "sprite" ]
def output_sprite( name: str, image: Image, generate_json: bool, output_dir: Optional[Path] = None, duplicates_dir: Optional[Path] = None, rotation: int = 0, # rotation: Union[None, int, list] = None, # single_terrain: bool = False ) -> None: """ Handle single sprite """ ...
[ "def", "output_sprite", "(", "name", ":", "str", ",", "image", ":", "Image", ",", "generate_json", ":", "bool", ",", "output_dir", ":", "Optional", "[", "Path", "]", "=", "None", ",", "duplicates_dir", ":", "Optional", "[", "Path", "]", "=", "None", ",...
https://github.com/CleverRaven/Cataclysm-DDA/blob/03e7363df0835ec1b39da973ea29f26f27833b38/tools/json_tools/generate_overmap_sprites.py#L310-L385
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/tools/inspector_protocol/jinja2/filters.py
python
do_truncate
(env, s, length=255, killwords=False, end='...', leeway=None)
return result + end
Return a truncated copy of the string. The length is specified with the first parameter which defaults to ``255``. If the second parameter is ``true`` the filter will cut the text at length. Otherwise it will discard the last word. If the text was in fact truncated it will append an ellipsis sign (``".....
Return a truncated copy of the string. The length is specified with the first parameter which defaults to ``255``. If the second parameter is ``true`` the filter will cut the text at length. Otherwise it will discard the last word. If the text was in fact truncated it will append an ellipsis sign (``".....
[ "Return", "a", "truncated", "copy", "of", "the", "string", ".", "The", "length", "is", "specified", "with", "the", "first", "parameter", "which", "defaults", "to", "255", ".", "If", "the", "second", "parameter", "is", "true", "the", "filter", "will", "cut"...
def do_truncate(env, s, length=255, killwords=False, end='...', leeway=None): """Return a truncated copy of the string. The length is specified with the first parameter which defaults to ``255``. If the second parameter is ``true`` the filter will cut the text at length. Otherwise it will discard the la...
[ "def", "do_truncate", "(", "env", ",", "s", ",", "length", "=", "255", ",", "killwords", "=", "False", ",", "end", "=", "'...'", ",", "leeway", "=", "None", ")", ":", "if", "leeway", "is", "None", ":", "leeway", "=", "env", ".", "policies", "[", ...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/inspector_protocol/jinja2/filters.py#L578-L611
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/pyyaml/lib/yaml/__init__.py
python
emit
(events, stream=None, Dumper=Dumper, canonical=None, indent=None, width=None, allow_unicode=None, line_break=None)
Emit YAML parsing events into a stream. If stream is None, return the produced string instead.
Emit YAML parsing events into a stream. If stream is None, return the produced string instead.
[ "Emit", "YAML", "parsing", "events", "into", "a", "stream", ".", "If", "stream", "is", "None", "return", "the", "produced", "string", "instead", "." ]
def emit(events, stream=None, Dumper=Dumper, canonical=None, indent=None, width=None, allow_unicode=None, line_break=None): """ Emit YAML parsing events into a stream. If stream is None, return the produced string instead. """ getvalue = None if stream is None: from Strin...
[ "def", "emit", "(", "events", ",", "stream", "=", "None", ",", "Dumper", "=", "Dumper", ",", "canonical", "=", "None", ",", "indent", "=", "None", ",", "width", "=", "None", ",", "allow_unicode", "=", "None", ",", "line_break", "=", "None", ")", ":",...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/pyyaml/lib/yaml/__init__.py#L103-L123
PaddlePaddle/Anakin
5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730
tools/external_converter_v2/parser/caffe/caffe_helper.py
python
SplitBlobName
(layer_name, blob_name, blob_idx, split_idx)
return "_".join([layer_name, blob_name, str(blob_idx), "split", str(split_idx)])
Used for caffe parser.
Used for caffe parser.
[ "Used", "for", "caffe", "parser", "." ]
def SplitBlobName(layer_name, blob_name, blob_idx, split_idx): """ Used for caffe parser. """ return "_".join([layer_name, blob_name, str(blob_idx), "split", str(split_idx)])
[ "def", "SplitBlobName", "(", "layer_name", ",", "blob_name", ",", "blob_idx", ",", "split_idx", ")", ":", "return", "\"_\"", ".", "join", "(", "[", "layer_name", ",", "blob_name", ",", "str", "(", "blob_idx", ")", ",", "\"split\"", ",", "str", "(", "spli...
https://github.com/PaddlePaddle/Anakin/blob/5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730/tools/external_converter_v2/parser/caffe/caffe_helper.py#L89-L93
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/stc.py
python
StyledTextCtrl.ClearSelections
(*args, **kwargs)
return _stc.StyledTextCtrl_ClearSelections(*args, **kwargs)
ClearSelections(self) Clear selections to a single empty stream selection
ClearSelections(self)
[ "ClearSelections", "(", "self", ")" ]
def ClearSelections(*args, **kwargs): """ ClearSelections(self) Clear selections to a single empty stream selection """ return _stc.StyledTextCtrl_ClearSelections(*args, **kwargs)
[ "def", "ClearSelections", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_ClearSelections", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L6112-L6118
vtraag/leidenalg
b53366829360e10922a2dbf57eb405a516c23bc9
setup.py
python
building_on_windows_msvc
()
return platform.system() == "Windows" and sysconfig.get_platform() != "mingw"
Returns True when using the non-MinGW CPython interpreter on Windows
Returns True when using the non-MinGW CPython interpreter on Windows
[ "Returns", "True", "when", "using", "the", "non", "-", "MinGW", "CPython", "interpreter", "on", "Windows" ]
def building_on_windows_msvc(): """Returns True when using the non-MinGW CPython interpreter on Windows""" return platform.system() == "Windows" and sysconfig.get_platform() != "mingw"
[ "def", "building_on_windows_msvc", "(", ")", ":", "return", "platform", ".", "system", "(", ")", "==", "\"Windows\"", "and", "sysconfig", ".", "get_platform", "(", ")", "!=", "\"mingw\"" ]
https://github.com/vtraag/leidenalg/blob/b53366829360e10922a2dbf57eb405a516c23bc9/setup.py#L41-L43
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/operations/math_ops.py
python
Sin.__init__
(self)
Initialize Sin.
Initialize Sin.
[ "Initialize", "Sin", "." ]
def __init__(self): """Initialize Sin."""
[ "def", "__init__", "(", "self", ")", ":" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/math_ops.py#L4429-L4430
OSGeo/gdal
3748fc4ba4fba727492774b2b908a2130c864a83
swig/python/osgeo/osr.py
python
SpatialReference.SetAxisMappingStrategy
(self, *args)
return _osr.SpatialReference_SetAxisMappingStrategy(self, *args)
r"""SetAxisMappingStrategy(SpatialReference self, OSRAxisMappingStrategy strategy)
r"""SetAxisMappingStrategy(SpatialReference self, OSRAxisMappingStrategy strategy)
[ "r", "SetAxisMappingStrategy", "(", "SpatialReference", "self", "OSRAxisMappingStrategy", "strategy", ")" ]
def SetAxisMappingStrategy(self, *args): r"""SetAxisMappingStrategy(SpatialReference self, OSRAxisMappingStrategy strategy)""" return _osr.SpatialReference_SetAxisMappingStrategy(self, *args)
[ "def", "SetAxisMappingStrategy", "(", "self", ",", "*", "args", ")", ":", "return", "_osr", ".", "SpatialReference_SetAxisMappingStrategy", "(", "self", ",", "*", "args", ")" ]
https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/osr.py#L470-L472
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/debug/lib/profiling.py
python
AggregateProfile.add
(self, profile_datum)
Accumulate a new instance of ProfileDatum. Args: profile_datum: (`ProfileDatum`) an instance of `ProfileDatum` to accumulate to this object.
Accumulate a new instance of ProfileDatum.
[ "Accumulate", "a", "new", "instance", "of", "ProfileDatum", "." ]
def add(self, profile_datum): """Accumulate a new instance of ProfileDatum. Args: profile_datum: (`ProfileDatum`) an instance of `ProfileDatum` to accumulate to this object. """ self.total_op_time += profile_datum.op_time self.total_exec_time += profile_datum.exec_time device_and...
[ "def", "add", "(", "self", ",", "profile_datum", ")", ":", "self", ".", "total_op_time", "+=", "profile_datum", ".", "op_time", "self", ".", "total_exec_time", "+=", "profile_datum", ".", "exec_time", "device_and_node", "=", "\"%s:%s\"", "%", "(", "profile_datum...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/debug/lib/profiling.py#L78-L96
CGRU/cgru
1881a4128530e3d31ac6c25314c18314fc50c2c7
plugins/maya/afanasy/meArnoldRender.py
python
meArnoldRender.generate_ass
( self, isSubmitingJob=False )
generate_ass :param isSubmitingJob: if job assumed to be submited after .ass generation
generate_ass
[ "generate_ass" ]
def generate_ass ( self, isSubmitingJob=False ) : """generate_ass :param isSubmitingJob: if job assumed to be submited after .ass generation """ skipExport = False exportAllRenderLayers = self.ass_param['ass_export_all_layers'] animation = self.job_param['job_animation'] start = self.job_param['job_star...
[ "def", "generate_ass", "(", "self", ",", "isSubmitingJob", "=", "False", ")", ":", "skipExport", "=", "False", "exportAllRenderLayers", "=", "self", ".", "ass_param", "[", "'ass_export_all_layers'", "]", "animation", "=", "self", ".", "job_param", "[", "'job_ani...
https://github.com/CGRU/cgru/blob/1881a4128530e3d31ac6c25314c18314fc50c2c7/plugins/maya/afanasy/meArnoldRender.py#L523-L689
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/valgrind/memcheck_analyze.py
python
ValgrindError.UniqueString
(self)
return rep
String to use for object identity. Don't print this, use str(obj) instead.
String to use for object identity. Don't print this, use str(obj) instead.
[ "String", "to", "use", "for", "object", "identity", ".", "Don", "t", "print", "this", "use", "str", "(", "obj", ")", "instead", "." ]
def UniqueString(self): ''' String to use for object identity. Don't print this, use str(obj) instead.''' rep = self._kind + " " for backtrace in self._backtraces: for frame in backtrace[1]: rep += frame[FUNCTION_NAME] if frame[SRC_FILE_DIR] != "": rep += frame[SRC_FILE_...
[ "def", "UniqueString", "(", "self", ")", ":", "rep", "=", "self", ".", "_kind", "+", "\" \"", "for", "backtrace", "in", "self", ".", "_backtraces", ":", "for", "frame", "in", "backtrace", "[", "1", "]", ":", "rep", "+=", "frame", "[", "FUNCTION_NAME", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/valgrind/memcheck_analyze.py#L333-L346
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
native_client_sdk/src/build_tools/path_set.py
python
PathSet.links
(self)
return self._links
The dictionary of hard links.
The dictionary of hard links.
[ "The", "dictionary", "of", "hard", "links", "." ]
def links(self): '''The dictionary of hard links.''' return self._links
[ "def", "links", "(", "self", ")", ":", "return", "self", ".", "_links" ]
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/native_client_sdk/src/build_tools/path_set.py#L121-L123
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pkg_resources/_vendor/pyparsing.py
python
ParserElement.setDebugActions
( self, startAction, successAction, exceptionAction )
return self
Enable display of debugging messages while doing pattern matching.
Enable display of debugging messages while doing pattern matching.
[ "Enable", "display", "of", "debugging", "messages", "while", "doing", "pattern", "matching", "." ]
def setDebugActions( self, startAction, successAction, exceptionAction ): """ Enable display of debugging messages while doing pattern matching. """ self.debugActions = (startAction or _defaultStartDebugAction, successAction or _defaultSuccessDebugAction, ...
[ "def", "setDebugActions", "(", "self", ",", "startAction", ",", "successAction", ",", "exceptionAction", ")", ":", "self", ".", "debugActions", "=", "(", "startAction", "or", "_defaultStartDebugAction", ",", "successAction", "or", "_defaultSuccessDebugAction", ",", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pkg_resources/_vendor/pyparsing.py#L2103-L2111
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
xpathParserContext.xpathTrueFunction
(self, nargs)
Implement the true() XPath function boolean true()
Implement the true() XPath function boolean true()
[ "Implement", "the", "true", "()", "XPath", "function", "boolean", "true", "()" ]
def xpathTrueFunction(self, nargs): """Implement the true() XPath function boolean true() """ libxml2mod.xmlXPathTrueFunction(self._o, nargs)
[ "def", "xpathTrueFunction", "(", "self", ",", "nargs", ")", ":", "libxml2mod", ".", "xmlXPathTrueFunction", "(", "self", ".", "_o", ",", "nargs", ")" ]
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L7904-L7906
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/dygraph/dygraph_to_static/utils.py
python
is_candidate_node
(node)
return is_compare_node or has_numpy_attr
Nodes with specified type will be dependent on tensor.
Nodes with specified type will be dependent on tensor.
[ "Nodes", "with", "specified", "type", "will", "be", "dependent", "on", "tensor", "." ]
def is_candidate_node(node): """ Nodes with specified type will be dependent on tensor. """ is_compare_node = isinstance(node, (gast.Compare, gast.BoolOp, gast.UnaryOp, gast.For, gast.If, gast.While)) # TODO(Aurelius84): `.numpy()` may be an customized functio...
[ "def", "is_candidate_node", "(", "node", ")", ":", "is_compare_node", "=", "isinstance", "(", "node", ",", "(", "gast", ".", "Compare", ",", "gast", ".", "BoolOp", ",", "gast", ".", "UnaryOp", ",", "gast", ".", "For", ",", "gast", ".", "If", ",", "ga...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/dygraph/dygraph_to_static/utils.py#L577-L586
facebook/redex
fac189a289bca2647061f9e364016afc1096500d
tools/python/file_extract.py
python
FileExtract.get_uint16
(self, fail_value=0)
return self._unpack("H", s) if s else fail_value
Extract a uint16_t from the current file position.
Extract a uint16_t from the current file position.
[ "Extract", "a", "uint16_t", "from", "the", "current", "file", "position", "." ]
def get_uint16(self, fail_value=0): """Extract a uint16_t from the current file position.""" s = self.read_size(2) return self._unpack("H", s) if s else fail_value
[ "def", "get_uint16", "(", "self", ",", "fail_value", "=", "0", ")", ":", "s", "=", "self", ".", "read_size", "(", "2", ")", "return", "self", ".", "_unpack", "(", "\"H\"", ",", "s", ")", "if", "s", "else", "fail_value" ]
https://github.com/facebook/redex/blob/fac189a289bca2647061f9e364016afc1096500d/tools/python/file_extract.py#L333-L336
cmu-sei/pharos
af54b6ada58d50c046fa899452addce80e9ce8da
tools/ooanalyzer/ida/OOAnalyzer.py
python
PyOOAnalyzerExpForm.__setup_form
(self)
return True
set up form data
set up form data
[ "set", "up", "form", "data" ]
def __setup_form(self): ''' set up form data ''' objd = self.__load_from_idb() if objd: print("OOAnalyzer class information found in IDB, opening Class Viewer") # mark previously applied classes self.__ooanalyzer = objd else: ...
[ "def", "__setup_form", "(", "self", ")", ":", "objd", "=", "self", ".", "__load_from_idb", "(", ")", "if", "objd", ":", "print", "(", "\"OOAnalyzer class information found in IDB, opening Class Viewer\"", ")", "# mark previously applied classes", "self", ".", "__ooanaly...
https://github.com/cmu-sei/pharos/blob/af54b6ada58d50c046fa899452addce80e9ce8da/tools/ooanalyzer/ida/OOAnalyzer.py#L2240-L2293
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
clang-tools-extra/clangd/quality/CompletionModelCodegen.py
python
CppClass.ns_begin
(self)
return "\n".join(open_ns)
Returns snippet for opening namespace declarations.
Returns snippet for opening namespace declarations.
[ "Returns", "snippet", "for", "opening", "namespace", "declarations", "." ]
def ns_begin(self): """Returns snippet for opening namespace declarations.""" open_ns = ["namespace %s {" % ns for ns in self.ns] return "\n".join(open_ns)
[ "def", "ns_begin", "(", "self", ")", ":", "open_ns", "=", "[", "\"namespace %s {\"", "%", "ns", "for", "ns", "in", "self", ".", "ns", "]", "return", "\"\\n\"", ".", "join", "(", "open_ns", ")" ]
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/clang-tools-extra/clangd/quality/CompletionModelCodegen.py#L24-L27
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/lib2to3/pgen2/grammar.py
python
Grammar.loads
(self, pkl)
Load the grammar tables from a pickle bytes object.
Load the grammar tables from a pickle bytes object.
[ "Load", "the", "grammar", "tables", "from", "a", "pickle", "bytes", "object", "." ]
def loads(self, pkl): """Load the grammar tables from a pickle bytes object.""" self.__dict__.update(pickle.loads(pkl))
[ "def", "loads", "(", "self", ",", "pkl", ")", ":", "self", ".", "__dict__", ".", "update", "(", "pickle", ".", "loads", "(", "pkl", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib2to3/pgen2/grammar.py#L112-L114
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/lookup_ops.py
python
TextFileStringTableInitializer.__init__
(self, filename, key_column_index=TextFileIndex.LINE_NUMBER, value_column_index=TextFileIndex.WHOLE_LINE, vocab_size=None, delimiter="\t", name="text_file_string_table_init")
Constructs an initializer for an id-to-string table from a text file. It populates a table that its key and value types are int64 and string, respectively. It generates one key-value pair per line. The content of the key and value are specified by `key_column_index` and `value_column_index`. - Tex...
Constructs an initializer for an id-to-string table from a text file.
[ "Constructs", "an", "initializer", "for", "an", "id", "-", "to", "-", "string", "table", "from", "a", "text", "file", "." ]
def __init__(self, filename, key_column_index=TextFileIndex.LINE_NUMBER, value_column_index=TextFileIndex.WHOLE_LINE, vocab_size=None, delimiter="\t", name="text_file_string_table_init"): """Constructs an initializer for an id...
[ "def", "__init__", "(", "self", ",", "filename", ",", "key_column_index", "=", "TextFileIndex", ".", "LINE_NUMBER", ",", "value_column_index", "=", "TextFileIndex", ".", "WHOLE_LINE", ",", "vocab_size", "=", "None", ",", "delimiter", "=", "\"\\t\"", ",", "name",...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/lookup_ops.py#L812-L857
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectCylinderAbsorption.py
python
IndirectCylinderAbsorption.validateInputs
(self)
return issues
Validate algorithm options.
Validate algorithm options.
[ "Validate", "algorithm", "options", "." ]
def validateInputs(self): """ Validate algorithm options. """ self._setup() issues = dict() if self._sample_radius > self._can_radius: issues['CanRadius'] = 'Must be greater than SampleRadius' if self._use_can_corrections and self._can_chemical_form...
[ "def", "validateInputs", "(", "self", ")", ":", "self", ".", "_setup", "(", ")", "issues", "=", "dict", "(", ")", "if", "self", ".", "_sample_radius", ">", "self", ".", "_can_radius", ":", "issues", "[", "'CanRadius'", "]", "=", "'Must be greater than Samp...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectCylinderAbsorption.py#L247-L264