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
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/buildscripts/packager-enterprise.py
python
tarfile
(build_os, arch, spec)
return "dl/mongodb-linux-%s-enterprise-%s-%s.tar.gz" % (spec.version(), build_os, arch)
Return the location where we store the downloaded tarball for this package
Return the location where we store the downloaded tarball for this package
[ "Return", "the", "location", "where", "we", "store", "the", "downloaded", "tarball", "for", "this", "package" ]
def tarfile(build_os, arch, spec): """Return the location where we store the downloaded tarball for this package""" return "dl/mongodb-linux-%s-enterprise-%s-%s.tar.gz" % (spec.version(), build_os, arch)
[ "def", "tarfile", "(", "build_os", ",", "arch", ",", "spec", ")", ":", "return", "\"dl/mongodb-linux-%s-enterprise-%s-%s.tar.gz\"", "%", "(", "spec", ".", "version", "(", ")", ",", "build_os", ",", "arch", ")" ]
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/packager-enterprise.py#L183-L186
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
bindings/python/cntk/layers/blocks.py
python
_inject_name
(f, name)
return f
Call this at the end of any layer or block that takes an optional name argument.
Call this at the end of any layer or block that takes an optional name argument.
[ "Call", "this", "at", "the", "end", "of", "any", "layer", "or", "block", "that", "takes", "an", "optional", "name", "argument", "." ]
def _inject_name(f, name): ''' Call this at the end of any layer or block that takes an optional name argument. ''' if name: if not isinstance(f, Function): f = Function(f) if len(f.outputs) == 1: f = alias(f, name=name) else: f = combine(list(...
[ "def", "_inject_name", "(", "f", ",", "name", ")", ":", "if", "name", ":", "if", "not", "isinstance", "(", "f", ",", "Function", ")", ":", "f", "=", "Function", "(", "f", ")", "if", "len", "(", "f", ".", "outputs", ")", "==", "1", ":", "f", "...
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/layers/blocks.py#L70-L81
continental/ecal
204dab80a24fe01abca62541133b311bf0c09608
lang/python/core/ecal/core/publisher.py
python
MessagePublisher.__init__
(self, name, topic_type="", topic_descriptor="")
Initialize a message publisher :param name: subscription name of the publisher :type name: string :param topic_type: optional, type of the transported payload, eg a a string, a protobuf message :type topic_type: string :param topic_descriptor: optional, a strin...
Initialize a message publisher
[ "Initialize", "a", "message", "publisher" ]
def __init__(self, name, topic_type="", topic_descriptor=""): """ Initialize a message publisher :param name: subscription name of the publisher :type name: string :param topic_type: optional, type of the transported payload, eg a a string, a protobuf message :type to...
[ "def", "__init__", "(", "self", ",", "name", ",", "topic_type", "=", "\"\"", ",", "topic_descriptor", "=", "\"\"", ")", ":", "self", ".", "c_publisher", "=", "ecal_core", ".", "publisher", "(", "name", ",", "topic_type", ",", "topic_descriptor", ")" ]
https://github.com/continental/ecal/blob/204dab80a24fe01abca62541133b311bf0c09608/lang/python/core/ecal/core/publisher.py#L28-L40
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/database.py
python
Distribution.__hash__
(self)
return hash(self.name) + hash(self.version) + hash(self.source_url)
Compute hash in a way which matches the equality test.
Compute hash in a way which matches the equality test.
[ "Compute", "hash", "in", "a", "way", "which", "matches", "the", "equality", "test", "." ]
def __hash__(self): """ Compute hash in a way which matches the equality test. """ return hash(self.name) + hash(self.version) + hash(self.source_url)
[ "def", "__hash__", "(", "self", ")", ":", "return", "hash", "(", "self", ".", "name", ")", "+", "hash", "(", "self", ".", "version", ")", "+", "hash", "(", "self", ".", "source_url", ")" ]
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/database.py#L467-L471
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
Wrapping/Python/paraview/coprocessing.py
python
CoProcessor.RegisterView
(self, view, filename, freq, fittoscreen, magnification, width, height, cinema=None, compression=None)
return view
Register a view for image capture with extra meta-data such as magnification, size and frequency.
Register a view for image capture with extra meta-data such as magnification, size and frequency.
[ "Register", "a", "view", "for", "image", "capture", "with", "extra", "meta", "-", "data", "such", "as", "magnification", "size", "and", "frequency", "." ]
def RegisterView(self, view, filename, freq, fittoscreen, magnification, width, height, cinema=None, compression=None): """Register a view for image capture with extra meta-data such as magnification, size and frequency.""" if not isinstance(view, servermanager.Proxy): ...
[ "def", "RegisterView", "(", "self", ",", "view", ",", "filename", ",", "freq", ",", "fittoscreen", ",", "magnification", ",", "width", ",", "height", ",", "cinema", "=", "None", ",", "compression", "=", "None", ")", ":", "if", "not", "isinstance", "(", ...
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/coprocessing.py#L587-L601
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/polynomial/_polybase.py
python
ABCPolyBase.trim
(self, tol=0)
return self.__class__(coef, self.domain, self.window)
Remove trailing coefficients Remove trailing coefficients until a coefficient is reached whose absolute value greater than `tol` or the beginning of the series is reached. If all the coefficients would be removed the series is set to ``[0]``. A new series instance is returned with the n...
Remove trailing coefficients
[ "Remove", "trailing", "coefficients" ]
def trim(self, tol=0): """Remove trailing coefficients Remove trailing coefficients until a coefficient is reached whose absolute value greater than `tol` or the beginning of the series is reached. If all the coefficients would be removed the series is set to ``[0]``. A new seri...
[ "def", "trim", "(", "self", ",", "tol", "=", "0", ")", ":", "coef", "=", "pu", ".", "trimcoef", "(", "self", ".", "coef", ",", "tol", ")", "return", "self", ".", "__class__", "(", "coef", ",", "self", ".", "domain", ",", "self", ".", "window", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/polynomial/_polybase.py#L587-L608
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/rabbits-in-forest.py
python
Solution.numRabbits
(self, answers)
return sum((((k+1)+v-1)//(k+1))*(k+1) for k, v in count.iteritems())
:type answers: List[int] :rtype: int
:type answers: List[int] :rtype: int
[ ":", "type", "answers", ":", "List", "[", "int", "]", ":", "rtype", ":", "int" ]
def numRabbits(self, answers): """ :type answers: List[int] :rtype: int """ count = collections.Counter(answers) return sum((((k+1)+v-1)//(k+1))*(k+1) for k, v in count.iteritems())
[ "def", "numRabbits", "(", "self", ",", "answers", ")", ":", "count", "=", "collections", ".", "Counter", "(", "answers", ")", "return", "sum", "(", "(", "(", "(", "k", "+", "1", ")", "+", "v", "-", "1", ")", "//", "(", "k", "+", "1", ")", ")"...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/rabbits-in-forest.py#L8-L14
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/compiler_machinery.py
python
PassManager.finalize
(self)
Finalize the PassManager, after which no more passes may be added without re-finalization.
Finalize the PassManager, after which no more passes may be added without re-finalization.
[ "Finalize", "the", "PassManager", "after", "which", "no", "more", "passes", "may", "be", "added", "without", "re", "-", "finalization", "." ]
def finalize(self): """ Finalize the PassManager, after which no more passes may be added without re-finalization. """ self._analysis = self.dependency_analysis() self._print_after, self._print_before, self._print_wrap = \ self._debug_init() self._fina...
[ "def", "finalize", "(", "self", ")", ":", "self", ".", "_analysis", "=", "self", ".", "dependency_analysis", "(", ")", "self", ".", "_print_after", ",", "self", ".", "_print_before", ",", "self", ".", "_print_wrap", "=", "self", ".", "_debug_init", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/compiler_machinery.py#L239-L247
hfinkel/llvm-project-cxxjit
91084ef018240bbb8e24235ff5cd8c355a9c1a1e
lldb/third_party/Python/module/pexpect-2.4/examples/rippy.py
python
input_option
(message, default_value="", help=None, level=0, max_level=0)
return user_input
This is a fancy raw_input function. If the user enters '?' then the contents of help is printed. The 'level' and 'max_level' are used to adjust which advanced options are printed. 'max_level' is the level of options that the user wants to see. 'level' is the level of difficulty for this particular opti...
This is a fancy raw_input function. If the user enters '?' then the contents of help is printed.
[ "This", "is", "a", "fancy", "raw_input", "function", ".", "If", "the", "user", "enters", "?", "then", "the", "contents", "of", "help", "is", "printed", "." ]
def input_option(message, default_value="", help=None, level=0, max_level=0): """This is a fancy raw_input function. If the user enters '?' then the contents of help is printed. The 'level' and 'max_level' are used to adjust which advanced options are printed. 'max_level' is the level of options that t...
[ "def", "input_option", "(", "message", ",", "default_value", "=", "\"\"", ",", "help", "=", "None", ",", "level", "=", "0", ",", "max_level", "=", "0", ")", ":", "if", "default_value", "!=", "''", ":", "message", "=", "\"%s [%s] \"", "%", "(", "message...
https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/lldb/third_party/Python/module/pexpect-2.4/examples/rippy.py#L339-L362
lightvector/KataGo
20d34784703c5b4000643d3ccc43bb37d418f3b5
python/sgfmill/sgf.py
python
Node.has_property
(self, identifier)
return identifier in self._property_map
Check whether the node has the specified property.
Check whether the node has the specified property.
[ "Check", "whether", "the", "node", "has", "the", "specified", "property", "." ]
def has_property(self, identifier): """Check whether the node has the specified property.""" return identifier in self._property_map
[ "def", "has_property", "(", "self", ",", "identifier", ")", ":", "return", "identifier", "in", "self", ".", "_property_map" ]
https://github.com/lightvector/KataGo/blob/20d34784703c5b4000643d3ccc43bb37d418f3b5/python/sgfmill/sgf.py#L47-L49
RapidsAtHKUST/CommunityDetectionCodes
23dbafd2e57ab0f5f0528b1322c4a409f21e5892
Algorithms/2008-CliquePercolation/src_python/seq_clique_percolation.py
python
kcliquesByEdges
(edges, k)
Phase I in the SCP-algorithm. Generator function that generates a list of cliques of size k in the order they are formed when edges are added in the order defined by the 'edges' argument. If many cliques is formed by adding one edge, the order of the cliques is arbitrary. This generator will pass t...
Phase I in the SCP-algorithm.
[ "Phase", "I", "in", "the", "SCP", "-", "algorithm", "." ]
def kcliquesByEdges(edges, k): """ Phase I in the SCP-algorithm. Generator function that generates a list of cliques of size k in the order they are formed when edges are added in the order defined by the 'edges' argument. If many cliques is formed by adding one edge, the order of the cliques is ...
[ "def", "kcliquesByEdges", "(", "edges", ",", "k", ")", ":", "newNet", "=", "SymmNet", "(", ")", "# Edges are added to a empty network one by one", "for", "edge", "in", "edges", ":", "if", "isinstance", "(", "edge", ",", "EvaluationEvent", ")", ":", "yield", "e...
https://github.com/RapidsAtHKUST/CommunityDetectionCodes/blob/23dbafd2e57ab0f5f0528b1322c4a409f21e5892/Algorithms/2008-CliquePercolation/src_python/seq_clique_percolation.py#L727-L754
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/cudnn_rnn/python/layers/cudnn_rnn.py
python
_CudnnRNNNoInputC.state_shape
(self, batch_size)
return [self.num_layers * self.num_dirs, batch_size, self.num_units],
Shape of the state of Cudnn RNN cells w/o. input_c. Shape is a 1-element tuple, [num_layers * num_dirs, batch_size, num_units] Args: batch_size: an int Returns: a tuple of python arrays.
Shape of the state of Cudnn RNN cells w/o. input_c.
[ "Shape", "of", "the", "state", "of", "Cudnn", "RNN", "cells", "w", "/", "o", ".", "input_c", "." ]
def state_shape(self, batch_size): """Shape of the state of Cudnn RNN cells w/o. input_c. Shape is a 1-element tuple, [num_layers * num_dirs, batch_size, num_units] Args: batch_size: an int Returns: a tuple of python arrays. """ return [self.num_layers * self.num_dirs, batch_siz...
[ "def", "state_shape", "(", "self", ",", "batch_size", ")", ":", "return", "[", "self", ".", "num_layers", "*", "self", ".", "num_dirs", ",", "batch_size", ",", "self", ".", "num_units", "]", "," ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/cudnn_rnn/python/layers/cudnn_rnn.py#L525-L535
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Misc.winfo_width
(self)
return getint( self.tk.call('winfo', 'width', self._w))
Return the width of this widget.
Return the width of this widget.
[ "Return", "the", "width", "of", "this", "widget", "." ]
def winfo_width(self): """Return the width of this widget.""" return getint( self.tk.call('winfo', 'width', self._w))
[ "def", "winfo_width", "(", "self", ")", ":", "return", "getint", "(", "self", ".", "tk", ".", "call", "(", "'winfo'", ",", "'width'", ",", "self", ".", "_w", ")", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py#L946-L949
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/third_party/pyserial/serial/serialposix.py
python
PosixSerial.sendBreak
(self, duration=0.25)
Send break condition. Timed, returns to idle state after given duration.
Send break condition. Timed, returns to idle state after given duration.
[ "Send", "break", "condition", ".", "Timed", "returns", "to", "idle", "state", "after", "given", "duration", "." ]
def sendBreak(self, duration=0.25): """Send break condition. Timed, returns to idle state after given duration.""" if not self._isOpen: raise portNotOpenError termios.tcsendbreak(self.fd, int(duration/0.25))
[ "def", "sendBreak", "(", "self", ",", "duration", "=", "0.25", ")", ":", "if", "not", "self", ".", "_isOpen", ":", "raise", "portNotOpenError", "termios", ".", "tcsendbreak", "(", "self", ".", "fd", ",", "int", "(", "duration", "/", "0.25", ")", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/pyserial/serial/serialposix.py#L537-L540
emscripten-core/emscripten
0d413d3c5af8b28349682496edc14656f5700c2f
third_party/ply/example/newclasscalc/calc.py
python
Calc.p_expression_uminus
(self, p)
expression : MINUS expression %prec UMINUS
expression : MINUS expression %prec UMINUS
[ "expression", ":", "MINUS", "expression", "%prec", "UMINUS" ]
def p_expression_uminus(self, p): 'expression : MINUS expression %prec UMINUS' p[0] = -p[2]
[ "def", "p_expression_uminus", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "-", "p", "[", "2", "]" ]
https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/newclasscalc/calc.py#L132-L134
VowpalWabbit/vowpal_wabbit
866b8fa88ff85a957c7eb72065ea44518b9ba416
python/vowpalwabbit/dftovw.py
python
MulticlassLabel.__init__
(self, label: Hashable, weight: Optional[Hashable] = None)
Initialize a MulticlassLabel instance. Args: label: The column name with the multi class label. weight: The column name with the (importance) weight of the multi class label.
Initialize a MulticlassLabel instance.
[ "Initialize", "a", "MulticlassLabel", "instance", "." ]
def __init__(self, label: Hashable, weight: Optional[Hashable] = None): """Initialize a MulticlassLabel instance. Args: label: The column name with the multi class label. weight: The column name with the (importance) weight of the multi class label. """ self.labe...
[ "def", "__init__", "(", "self", ",", "label", ":", "Hashable", ",", "weight", ":", "Optional", "[", "Hashable", "]", "=", "None", ")", ":", "self", ".", "label", "=", "label", "self", ".", "weight", "=", "weight" ]
https://github.com/VowpalWabbit/vowpal_wabbit/blob/866b8fa88ff85a957c7eb72065ea44518b9ba416/python/vowpalwabbit/dftovw.py#L256-L264
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
PlatformInformation.SetPortId
(*args, **kwargs)
return _misc_.PlatformInformation_SetPortId(*args, **kwargs)
SetPortId(self, int n)
SetPortId(self, int n)
[ "SetPortId", "(", "self", "int", "n", ")" ]
def SetPortId(*args, **kwargs): """SetPortId(self, int n)""" return _misc_.PlatformInformation_SetPortId(*args, **kwargs)
[ "def", "SetPortId", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "PlatformInformation_SetPortId", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L1162-L1164
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftviewproviders/view_draft_annotation.py
python
ViewProviderDraftAnnotation.set_properties
(self, vobj)
Set the properties only if they don't already exist.
Set the properties only if they don't already exist.
[ "Set", "the", "properties", "only", "if", "they", "don", "t", "already", "exist", "." ]
def set_properties(self, vobj): """Set the properties only if they don't already exist.""" properties = vobj.PropertiesList self.set_annotation_properties(vobj, properties) self.set_graphics_properties(vobj, properties)
[ "def", "set_properties", "(", "self", ",", "vobj", ")", ":", "properties", "=", "vobj", ".", "PropertiesList", "self", ".", "set_annotation_properties", "(", "vobj", ",", "properties", ")", "self", ".", "set_graphics_properties", "(", "vobj", ",", "properties", ...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftviewproviders/view_draft_annotation.py#L67-L71
KhronosGroup/Vulkan-ValidationLayers
f9b894b68a712ba0f7880c176074ac9fbb67cc7d
scripts/thread_safety_generator.py
python
ThreadOutputGenerator.makeThreadUseBlock
(self, cmd, name, functionprefix)
Generate C function pointer typedef for <command> Element
Generate C function pointer typedef for <command> Element
[ "Generate", "C", "function", "pointer", "typedef", "for", "<command", ">", "Element" ]
def makeThreadUseBlock(self, cmd, name, functionprefix): """Generate C function pointer typedef for <command> Element""" paramdecl = '' # Find and add any parameters that are thread unsafe params = cmd.findall('param') for param in params: paramname = param.find('name...
[ "def", "makeThreadUseBlock", "(", "self", ",", "cmd", ",", "name", ",", "functionprefix", ")", ":", "paramdecl", "=", "''", "# Find and add any parameters that are thread unsafe", "params", "=", "cmd", ".", "findall", "(", "'param'", ")", "for", "param", "in", "...
https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/f9b894b68a712ba0f7880c176074ac9fbb67cc7d/scripts/thread_safety_generator.py#L1421-L1574
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/build/pymake/pymake/globrelative.py
python
globpattern
(dir, pattern)
return leaves
Return leaf names in the specified directory which match the pattern.
Return leaf names in the specified directory which match the pattern.
[ "Return", "leaf", "names", "in", "the", "specified", "directory", "which", "match", "the", "pattern", "." ]
def globpattern(dir, pattern): """ Return leaf names in the specified directory which match the pattern. """ if not hasglob(pattern): if pattern == '': if os.path.isdir(dir): return [''] return [] if os.path.exists(util.normaljoin(dir, pattern)):...
[ "def", "globpattern", "(", "dir", ",", "pattern", ")", ":", "if", "not", "hasglob", "(", "pattern", ")", ":", "if", "pattern", "==", "''", ":", "if", "os", ".", "path", ".", "isdir", "(", "dir", ")", ":", "return", "[", "''", "]", "return", "[", ...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/build/pymake/pymake/globrelative.py#L42-L68
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
3rdparty/protobuf-3.0.0/python/google/protobuf/service.py
python
Service.GetDescriptor
()
Retrieves this service's descriptor.
Retrieves this service's descriptor.
[ "Retrieves", "this", "service", "s", "descriptor", "." ]
def GetDescriptor(): """Retrieves this service's descriptor.""" raise NotImplementedError
[ "def", "GetDescriptor", "(", ")", ":", "raise", "NotImplementedError" ]
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/service.py#L61-L63
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/plot_widget/plotting_canvas/plotting_canvas_presenter_interface.py
python
PlottingCanvasPresenterInterface.plot_guess_workspace
(self, guess_ws_name: str)
Plots the guess workspace from a fit
Plots the guess workspace from a fit
[ "Plots", "the", "guess", "workspace", "from", "a", "fit" ]
def plot_guess_workspace(self, guess_ws_name: str): """Plots the guess workspace from a fit""" pass
[ "def", "plot_guess_workspace", "(", "self", ",", "guess_ws_name", ":", "str", ")", ":", "pass" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/plot_widget/plotting_canvas/plotting_canvas_presenter_interface.py#L96-L98
google/llvm-propeller
45c226984fe8377ebfb2ad7713c680d652ba678d
lldb/third_party/Python/module/pexpect-4.6/pexpect/FSM.py
python
FSM.reset
(self)
This sets the current_state to the initial_state and sets input_symbol to None. The initial state was set by the constructor __init__().
This sets the current_state to the initial_state and sets input_symbol to None. The initial state was set by the constructor __init__().
[ "This", "sets", "the", "current_state", "to", "the", "initial_state", "and", "sets", "input_symbol", "to", "None", ".", "The", "initial", "state", "was", "set", "by", "the", "constructor", "__init__", "()", "." ]
def reset (self): '''This sets the current_state to the initial_state and sets input_symbol to None. The initial state was set by the constructor __init__(). ''' self.current_state = self.initial_state self.input_symbol = None
[ "def", "reset", "(", "self", ")", ":", "self", ".", "current_state", "=", "self", ".", "initial_state", "self", ".", "input_symbol", "=", "None" ]
https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/lldb/third_party/Python/module/pexpect-4.6/pexpect/FSM.py#L122-L129
openthread/openthread
9fcdbed9c526c70f1556d1ed84099c1535c7cd32
tools/harness-sniffer/OT_Sniffer.py
python
OT_Sniffer.stopSniffer
(self)
Method for ending the sniffer capture. Should stop background capturing, No further file I/O in capture file.
Method for ending the sniffer capture. Should stop background capturing, No further file I/O in capture file.
[ "Method", "for", "ending", "the", "sniffer", "capture", ".", "Should", "stop", "background", "capturing", "No", "further", "file", "I", "/", "O", "in", "capture", "file", "." ]
def stopSniffer(self): """ Method for ending the sniffer capture. Should stop background capturing, No further file I/O in capture file. """ if self.is_active: self.is_active = False if self.subprocess: self.subprocess.terminate() ...
[ "def", "stopSniffer", "(", "self", ")", ":", "if", "self", ".", "is_active", ":", "self", ".", "is_active", "=", "False", "if", "self", ".", "subprocess", ":", "self", ".", "subprocess", ".", "terminate", "(", ")", "self", ".", "subprocess", ".", "wait...
https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/harness-sniffer/OT_Sniffer.py#L106-L115
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/closure_linter/closure_linter/statetracker.py
python
StateTracker.InParentheses
(self)
return bool(self._paren_depth)
Returns true if the current token is within parentheses. Returns: True if the current token is within parentheses.
Returns true if the current token is within parentheses.
[ "Returns", "true", "if", "the", "current", "token", "is", "within", "parentheses", "." ]
def InParentheses(self): """Returns true if the current token is within parentheses. Returns: True if the current token is within parentheses. """ return bool(self._paren_depth)
[ "def", "InParentheses", "(", "self", ")", ":", "return", "bool", "(", "self", ".", "_paren_depth", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/statetracker.py#L901-L907
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/email/message.py
python
Message.get_param
(self, param, failobj=None, header='content-type', unquote=True)
return failobj
Return the parameter value if found in the Content-Type header. Optional failobj is the object to return if there is no Content-Type header, or the Content-Type header has no such parameter. Optional header is the header to search instead of Content-Type. Parameter keys are always com...
Return the parameter value if found in the Content-Type header.
[ "Return", "the", "parameter", "value", "if", "found", "in", "the", "Content", "-", "Type", "header", "." ]
def get_param(self, param, failobj=None, header='content-type', unquote=True): """Return the parameter value if found in the Content-Type header. Optional failobj is the object to return if there is no Content-Type header, or the Content-Type header has no such parameter. Opt...
[ "def", "get_param", "(", "self", ",", "param", ",", "failobj", "=", "None", ",", "header", "=", "'content-type'", ",", "unquote", "=", "True", ")", ":", "if", "header", "not", "in", "self", ":", "return", "failobj", "for", "k", ",", "v", "in", "self"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/email/message.py#L667-L699
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/_bootstrap_external.py
python
_calc_mode
(path)
return mode
Calculate the mode permissions for a bytecode file.
Calculate the mode permissions for a bytecode file.
[ "Calculate", "the", "mode", "permissions", "for", "a", "bytecode", "file", "." ]
def _calc_mode(path): """Calculate the mode permissions for a bytecode file.""" try: mode = _path_stat(path).st_mode except OSError: mode = 0o666 # We always ensure write access so we can update cached files # later even when the source files are read-only on Windows (#6074) mode...
[ "def", "_calc_mode", "(", "path", ")", ":", "try", ":", "mode", "=", "_path_stat", "(", "path", ")", ".", "st_mode", "except", "OSError", ":", "mode", "=", "0o666", "# We always ensure write access so we can update cached files", "# later even when the source files are ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/_bootstrap_external.py#L381-L390
gromacs/gromacs
7dec3a3f99993cf5687a122de3e12de31c21c399
docs/doxygen/gmxtree.py
python
GromacsTree.report_unused_cycle_suppressions
(self, reporter)
Reports unused cycle suppressions.
Reports unused cycle suppressions.
[ "Reports", "unused", "cycle", "suppressions", "." ]
def report_unused_cycle_suppressions(self, reporter): """Reports unused cycle suppressions.""" for module in self.get_modules(): for dep in module.get_dependencies(): if not dep.suppression_used: reporter.cyclic_issue("unused cycle suppression: {0} -> {1}"...
[ "def", "report_unused_cycle_suppressions", "(", "self", ",", "reporter", ")", ":", "for", "module", "in", "self", ".", "get_modules", "(", ")", ":", "for", "dep", "in", "module", ".", "get_dependencies", "(", ")", ":", "if", "not", "dep", ".", "suppression...
https://github.com/gromacs/gromacs/blob/7dec3a3f99993cf5687a122de3e12de31c21c399/docs/doxygen/gmxtree.py#L1021-L1026
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
src/bindings/python/src/openvino/runtime/opset8/ops.py
python
adaptive_avg_pool
( data: NodeInput, output_shape: NodeInput )
return _get_node_factory_opset8().create("AdaptiveAvgPool", inputs)
Return a node which performs AdaptiveAvgPool operation. @param data: The list of input nodes @param output_shape: the shape of spatial dimentions after operation @return: The new node performing AdaptiveAvgPool operation on the data
Return a node which performs AdaptiveAvgPool operation.
[ "Return", "a", "node", "which", "performs", "AdaptiveAvgPool", "operation", "." ]
def adaptive_avg_pool( data: NodeInput, output_shape: NodeInput ) -> Node: """Return a node which performs AdaptiveAvgPool operation. @param data: The list of input nodes @param output_shape: the shape of spatial dimentions after operation @return: The new node performing AdaptiveAvgPoo...
[ "def", "adaptive_avg_pool", "(", "data", ":", "NodeInput", ",", "output_shape", ":", "NodeInput", ")", "->", "Node", ":", "inputs", "=", "as_nodes", "(", "data", ",", "output_shape", ")", "return", "_get_node_factory_opset8", "(", ")", ".", "create", "(", "\...
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/src/bindings/python/src/openvino/runtime/opset8/ops.py#L89-L100
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py
python
_GetMSBuildPropertyGroup
(spec, label, properties)
return [group]
Returns a PropertyGroup definition for the specified properties. Arguments: spec: The target project dict. label: An optional label for the PropertyGroup. properties: The dictionary to be converted. The key is the name of the property. The value is itself a dictionary; its key is the value and ...
Returns a PropertyGroup definition for the specified properties.
[ "Returns", "a", "PropertyGroup", "definition", "for", "the", "specified", "properties", "." ]
def _GetMSBuildPropertyGroup(spec, label, properties): """Returns a PropertyGroup definition for the specified properties. Arguments: spec: The target project dict. label: An optional label for the PropertyGroup. properties: The dictionary to be converted. The key is the name of the property...
[ "def", "_GetMSBuildPropertyGroup", "(", "spec", ",", "label", ",", "properties", ")", ":", "group", "=", "[", "\"PropertyGroup\"", "]", "if", "label", ":", "group", ".", "append", "(", "{", "\"Label\"", ":", "label", "}", ")", "num_configurations", "=", "l...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py#L3259-L3312
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
UpdateUIEvent.Enable
(*args, **kwargs)
return _core_.UpdateUIEvent_Enable(*args, **kwargs)
Enable(self, bool enable) Enable or disable the UI element.
Enable(self, bool enable)
[ "Enable", "(", "self", "bool", "enable", ")" ]
def Enable(*args, **kwargs): """ Enable(self, bool enable) Enable or disable the UI element. """ return _core_.UpdateUIEvent_Enable(*args, **kwargs)
[ "def", "Enable", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "UpdateUIEvent_Enable", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L6825-L6831
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
build/android/play_services/update.py
python
AddBasicArguments
(parser)
Defines the common arguments on subparser rather than the main one. This allows to put arguments after the command: `foo.py upload --debug --force` instead of `foo.py --debug upload --force`
Defines the common arguments on subparser rather than the main one. This allows to put arguments after the command: `foo.py upload --debug --force` instead of `foo.py --debug upload --force`
[ "Defines", "the", "common", "arguments", "on", "subparser", "rather", "than", "the", "main", "one", ".", "This", "allows", "to", "put", "arguments", "after", "the", "command", ":", "foo", ".", "py", "upload", "--", "debug", "--", "force", "instead", "of", ...
def AddBasicArguments(parser): ''' Defines the common arguments on subparser rather than the main one. This allows to put arguments after the command: `foo.py upload --debug --force` instead of `foo.py --debug upload --force` ''' parser.add_argument('--sdk-root', help='base path to th...
[ "def", "AddBasicArguments", "(", "parser", ")", ":", "parser", ".", "add_argument", "(", "'--sdk-root'", ",", "help", "=", "'base path to the Android SDK tools root'", ",", "default", "=", "constants", ".", "ANDROID_SDK_ROOT", ")", "parser", ".", "add_argument", "("...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/build/android/play_services/update.py#L102-L115
citizenfx/fivem
88276d40cc7baf8285d02754cc5ae42ec7a8563f
vendor/chromium/base/PRESUBMIT.py
python
_CheckNoInterfacesInBase
(input_api, output_api)
return []
Checks to make sure no files in libbase.a have |@interface|.
Checks to make sure no files in libbase.a have |
[ "Checks", "to", "make", "sure", "no", "files", "in", "libbase", ".", "a", "have", "|" ]
def _CheckNoInterfacesInBase(input_api, output_api): """Checks to make sure no files in libbase.a have |@interface|.""" pattern = input_api.re.compile(r'^\s*@interface', input_api.re.MULTILINE) files = [] for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile): if (f.LocalPath().startswith('base/...
[ "def", "_CheckNoInterfacesInBase", "(", "input_api", ",", "output_api", ")", ":", "pattern", "=", "input_api", ".", "re", ".", "compile", "(", "r'^\\s*@interface'", ",", "input_api", ".", "re", ".", "MULTILINE", ")", "files", "=", "[", "]", "for", "f", "in...
https://github.com/citizenfx/fivem/blob/88276d40cc7baf8285d02754cc5ae42ec7a8563f/vendor/chromium/base/PRESUBMIT.py#L11-L31
tangjianpku/LINE
d5f840941e0f4026090d1b1feeaf15da38e2b24b
windows/evaluate/liblinear/python/liblinearutil.py
python
load_model
(model_file_name)
return model
load_model(model_file_name) -> model Load a LIBLINEAR model from model_file_name and return.
load_model(model_file_name) -> model
[ "load_model", "(", "model_file_name", ")", "-", ">", "model" ]
def load_model(model_file_name): """ load_model(model_file_name) -> model Load a LIBLINEAR model from model_file_name and return. """ model = liblinear.load_model(model_file_name.encode()) if not model: print("can't open model file %s" % model_file_name) return None model = toPyModel(model) return model
[ "def", "load_model", "(", "model_file_name", ")", ":", "model", "=", "liblinear", ".", "load_model", "(", "model_file_name", ".", "encode", "(", ")", ")", "if", "not", "model", ":", "print", "(", "\"can't open model file %s\"", "%", "model_file_name", ")", "re...
https://github.com/tangjianpku/LINE/blob/d5f840941e0f4026090d1b1feeaf15da38e2b24b/windows/evaluate/liblinear/python/liblinearutil.py#L29-L40
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/logging/__init__.py
python
setLoggerClass
(klass)
Set the class to be used when instantiating a logger. The class should define __init__() such that only a name argument is required, and the __init__() should call Logger.__init__()
Set the class to be used when instantiating a logger. The class should define __init__() such that only a name argument is required, and the __init__() should call Logger.__init__()
[ "Set", "the", "class", "to", "be", "used", "when", "instantiating", "a", "logger", ".", "The", "class", "should", "define", "__init__", "()", "such", "that", "only", "a", "name", "argument", "is", "required", "and", "the", "__init__", "()", "should", "call...
def setLoggerClass(klass): """ Set the class to be used when instantiating a logger. The class should define __init__() such that only a name argument is required, and the __init__() should call Logger.__init__() """ if klass != Logger: if not issubclass(klass, Logger): raise...
[ "def", "setLoggerClass", "(", "klass", ")", ":", "if", "klass", "!=", "Logger", ":", "if", "not", "issubclass", "(", "klass", ",", "Logger", ")", ":", "raise", "TypeError", "(", "\"logger not derived from logging.Logger: \"", "+", "klass", ".", "__name__", ")"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/logging/__init__.py#L997-L1008
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
in_range
(symbol, section)
Test whether a symbol is within the range of a section.
Test whether a symbol is within the range of a section.
[ "Test", "whether", "a", "symbol", "is", "within", "the", "range", "of", "a", "section", "." ]
def in_range(symbol, section): """Test whether a symbol is within the range of a section.""" symSA = symbol.GetStartAddress().GetFileAddress() symEA = symbol.GetEndAddress().GetFileAddress() secSA = section.GetFileAddress() secEA = secSA + section.GetByteSize() if symEA != LLDB_INVALID_ADDRESS:...
[ "def", "in_range", "(", "symbol", ",", "section", ")", ":", "symSA", "=", "symbol", ".", "GetStartAddress", "(", ")", ".", "GetFileAddress", "(", ")", "symEA", "=", "symbol", ".", "GetEndAddress", "(", ")", ".", "GetFileAddress", "(", ")", "secSA", "=", ...
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L7042-L7058
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
CommonTools/ParticleFlow/python/Tools/enablePileUpCorrection.py
python
enablePileUpCorrection
( process, postfix, sequence='patPF2PATSequence')
Enables the pile-up correction for jets in a PF2PAT+PAT sequence to be called after the usePF2PAT function.
Enables the pile-up correction for jets in a PF2PAT+PAT sequence to be called after the usePF2PAT function.
[ "Enables", "the", "pile", "-", "up", "correction", "for", "jets", "in", "a", "PF2PAT", "+", "PAT", "sequence", "to", "be", "called", "after", "the", "usePF2PAT", "function", "." ]
def enablePileUpCorrection( process, postfix, sequence='patPF2PATSequence'): """ Enables the pile-up correction for jets in a PF2PAT+PAT sequence to be called after the usePF2PAT function. """ enablePileUpCorrectionInPF2PAT( process, postfix, sequence) enablePileUpCorrectionInPAT( process, post...
[ "def", "enablePileUpCorrection", "(", "process", ",", "postfix", ",", "sequence", "=", "'patPF2PATSequence'", ")", ":", "enablePileUpCorrectionInPF2PAT", "(", "process", ",", "postfix", ",", "sequence", ")", "enablePileUpCorrectionInPAT", "(", "process", ",", "postfix...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/CommonTools/ParticleFlow/python/Tools/enablePileUpCorrection.py#L31-L38
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Variable.trace_vinfo
(self)
return map(self._tk.split, self._tk.splitlist( self._tk.call("trace", "vinfo", self._name)))
Return all trace callback information.
Return all trace callback information.
[ "Return", "all", "trace", "callback", "information", "." ]
def trace_vinfo(self): """Return all trace callback information.""" return map(self._tk.split, self._tk.splitlist( self._tk.call("trace", "vinfo", self._name)))
[ "def", "trace_vinfo", "(", "self", ")", ":", "return", "map", "(", "self", ".", "_tk", ".", "split", ",", "self", ".", "_tk", ".", "splitlist", "(", "self", ".", "_tk", ".", "call", "(", "\"trace\"", ",", "\"vinfo\"", ",", "self", ".", "_name", ")"...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L261-L264
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/email/iterators.py
python
body_line_iterator
(msg, decode=False)
Iterate over the parts, returning string payloads line-by-line. Optional decode (default False) is passed through to .get_payload().
Iterate over the parts, returning string payloads line-by-line.
[ "Iterate", "over", "the", "parts", "returning", "string", "payloads", "line", "-", "by", "-", "line", "." ]
def body_line_iterator(msg, decode=False): """Iterate over the parts, returning string payloads line-by-line. Optional decode (default False) is passed through to .get_payload(). """ for subpart in msg.walk(): payload = subpart.get_payload(decode=decode) if isinstance(payload, basestrin...
[ "def", "body_line_iterator", "(", "msg", ",", "decode", "=", "False", ")", ":", "for", "subpart", "in", "msg", ".", "walk", "(", ")", ":", "payload", "=", "subpart", ".", "get_payload", "(", "decode", "=", "decode", ")", "if", "isinstance", "(", "paylo...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/email/iterators.py#L35-L44
bundy-dns/bundy
3d41934996b82b0cd2fe22dd74d2abc1daba835d
src/lib/python/bundy/config/ccsession.py
python
UIModuleCCSession.update_specs_and_config
(self)
Convenience function to both clear and update the known list of module specifications, and update the current configuration on the server side. There are a few cases where the caller might only want to run one of these tasks, but often they are both needed.
Convenience function to both clear and update the known list of module specifications, and update the current configuration on the server side. There are a few cases where the caller might only want to run one of these tasks, but often they are both needed.
[ "Convenience", "function", "to", "both", "clear", "and", "update", "the", "known", "list", "of", "module", "specifications", "and", "update", "the", "current", "configuration", "on", "the", "server", "side", ".", "There", "are", "a", "few", "cases", "where", ...
def update_specs_and_config(self): """Convenience function to both clear and update the known list of module specifications, and update the current configuration on the server side. There are a few cases where the caller might only want to run one of these tasks, but often they ...
[ "def", "update_specs_and_config", "(", "self", ")", ":", "self", ".", "request_specifications", "(", ")", "self", ".", "request_current_config", "(", ")" ]
https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/src/lib/python/bundy/config/ccsession.py#L691-L697
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
tools/linter/clang_tidy/run.py
python
get_all_files
(paths: List[str])
return str(output).strip().splitlines()
Returns all files that are tracked by git in the given paths.
Returns all files that are tracked by git in the given paths.
[ "Returns", "all", "files", "that", "are", "tracked", "by", "git", "in", "the", "given", "paths", "." ]
async def get_all_files(paths: List[str]) -> List[str]: """Returns all files that are tracked by git in the given paths.""" output = await run_shell_command(["git", "ls-files"] + paths) return str(output).strip().splitlines()
[ "async", "def", "get_all_files", "(", "paths", ":", "List", "[", "str", "]", ")", "->", "List", "[", "str", "]", ":", "output", "=", "await", "run_shell_command", "(", "[", "\"git\"", ",", "\"ls-files\"", "]", "+", "paths", ")", "return", "str", "(", ...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/tools/linter/clang_tidy/run.py#L389-L392
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/cygwinccompiler.py
python
CygwinCCompiler.link
(self, target_desc, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None, target_lang=None)
Link the objects.
Link the objects.
[ "Link", "the", "objects", "." ]
def link(self, target_desc, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None, target_lang=None): """Link the objects.""" #...
[ "def", "link", "(", "self", ",", "target_desc", ",", "objects", ",", "output_filename", ",", "output_dir", "=", "None", ",", "libraries", "=", "None", ",", "library_dirs", "=", "None", ",", "runtime_library_dirs", "=", "None", ",", "export_symbols", "=", "No...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/cygwinccompiler.py#L174-L248
nci/drishti
89cd8b740239c5b2c8222dffd4e27432fde170a1
bin/assets/scripts/unet++/unet_collection/swin.py
python
swin_transformer_stack
(X, stack_num, embed_dim, num_patch, num_heads, window_size, num_mlp, shift_window=True, name='')
return X
Stacked Swin Transformers that share the same token size. Alternated Window-MSA and Swin-MSA will be configured if `shift_window=True`, Window-MSA only otherwise. *Dropout is turned off.
Stacked Swin Transformers that share the same token size. Alternated Window-MSA and Swin-MSA will be configured if `shift_window=True`, Window-MSA only otherwise. *Dropout is turned off.
[ "Stacked", "Swin", "Transformers", "that", "share", "the", "same", "token", "size", ".", "Alternated", "Window", "-", "MSA", "and", "Swin", "-", "MSA", "will", "be", "configured", "if", "shift_window", "=", "True", "Window", "-", "MSA", "only", "otherwise", ...
def swin_transformer_stack(X, stack_num, embed_dim, num_patch, num_heads, window_size, num_mlp, shift_window=True, name=''): ''' Stacked Swin Transformers that share the same token size. Alternat...
[ "def", "swin_transformer_stack", "(", "X", ",", "stack_num", ",", "embed_dim", ",", "num_patch", ",", "num_heads", ",", "window_size", ",", "num_mlp", ",", "shift_window", "=", "True", ",", "name", "=", "''", ")", ":", "# Turn-off dropouts", "mlp_drop_rate", "...
https://github.com/nci/drishti/blob/89cd8b740239c5b2c8222dffd4e27432fde170a1/bin/assets/scripts/unet++/unet_collection/swin.py#L14-L54
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/xml/sax/xmlreader.py
python
Locator.getPublicId
(self)
return None
Return the public identifier for the current event.
Return the public identifier for the current event.
[ "Return", "the", "public", "identifier", "for", "the", "current", "event", "." ]
def getPublicId(self): "Return the public identifier for the current event." return None
[ "def", "getPublicId", "(", "self", ")", ":", "return", "None" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/xml/sax/xmlreader.py#L177-L179
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Misc.winfo_rootx
(self)
return getint( self.tk.call('winfo', 'rootx', self._w))
Return x coordinate of upper left corner of this widget on the root window.
Return x coordinate of upper left corner of this widget on the root window.
[ "Return", "x", "coordinate", "of", "upper", "left", "corner", "of", "this", "widget", "on", "the", "root", "window", "." ]
def winfo_rootx(self): """Return x coordinate of upper left corner of this widget on the root window.""" return getint( self.tk.call('winfo', 'rootx', self._w))
[ "def", "winfo_rootx", "(", "self", ")", ":", "return", "getint", "(", "self", ".", "tk", ".", "call", "(", "'winfo'", ",", "'rootx'", ",", "self", ".", "_w", ")", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py#L838-L842
cyberbotics/webots
af7fa7d68dcf7b4550f1f2e132092b41e83698fc
resources/osm_importer/webots_objects/road.py
python
Road.is_similar
(self, other)
Determine if a road has the same graphical shape than another in order to be merged.
Determine if a road has the same graphical shape than another in order to be merged.
[ "Determine", "if", "a", "road", "has", "the", "same", "graphical", "shape", "than", "another", "in", "order", "to", "be", "merged", "." ]
def is_similar(self, other): """Determine if a road has the same graphical shape than another in order to be merged.""" if (self.oneway and not other.oneway) or (not self.oneway and other.oneway): return False # reject if the oneway attribute is not matching if self.oneway: ...
[ "def", "is_similar", "(", "self", ",", "other", ")", ":", "if", "(", "self", ".", "oneway", "and", "not", "other", ".", "oneway", ")", "or", "(", "not", "self", ".", "oneway", "and", "other", ".", "oneway", ")", ":", "return", "False", "# reject if t...
https://github.com/cyberbotics/webots/blob/af7fa7d68dcf7b4550f1f2e132092b41e83698fc/resources/osm_importer/webots_objects/road.py#L212-L232
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/tools/gyp/pylib/gyp/msvs_emulation.py
python
MsvsSettings.AdjustLibraries
(self, libraries)
return [lib + '.lib' if not lib.lower().endswith('.lib') \ and not lib.lower().endswith('.obj') else lib for lib in libs]
Strip -l from library if it's specified with that.
Strip -l from library if it's specified with that.
[ "Strip", "-", "l", "from", "library", "if", "it", "s", "specified", "with", "that", "." ]
def AdjustLibraries(self, libraries): """Strip -l from library if it's specified with that.""" libs = [lib[2:] if lib.startswith('-l') else lib for lib in libraries] return [lib + '.lib' if not lib.lower().endswith('.lib') \ and not lib.lower().endswith('.obj') else lib for lib in libs]
[ "def", "AdjustLibraries", "(", "self", ",", "libraries", ")", ":", "libs", "=", "[", "lib", "[", "2", ":", "]", "if", "lib", ".", "startswith", "(", "'-l'", ")", "else", "lib", "for", "lib", "in", "libraries", "]", "return", "[", "lib", "+", "'.lib...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/msvs_emulation.py#L281-L285
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/setuptools/package_index.py
python
ContentChecker.feed
(self, block)
return
Feed a block of data to the hash.
Feed a block of data to the hash.
[ "Feed", "a", "block", "of", "data", "to", "the", "hash", "." ]
def feed(self, block): """ Feed a block of data to the hash. """ return
[ "def", "feed", "(", "self", ",", "block", ")", ":", "return" ]
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/setuptools/package_index.py#L245-L249
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/turtle.py
python
RawTurtle._tracer
(self, flag=None, delay=None)
return self.screen.tracer(flag, delay)
Turns turtle animation on/off and set delay for update drawings. Optional arguments: n -- nonnegative integer delay -- nonnegative integer If n is given, only each n-th regular screen update is really performed. (Can be used to accelerate the drawing of complex graphics.) ...
Turns turtle animation on/off and set delay for update drawings.
[ "Turns", "turtle", "animation", "on", "/", "off", "and", "set", "delay", "for", "update", "drawings", "." ]
def _tracer(self, flag=None, delay=None): """Turns turtle animation on/off and set delay for update drawings. Optional arguments: n -- nonnegative integer delay -- nonnegative integer If n is given, only each n-th regular screen update is really performed. (Can be use...
[ "def", "_tracer", "(", "self", ",", "flag", "=", "None", ",", "delay", "=", "None", ")", ":", "return", "self", ".", "screen", ".", "tracer", "(", "flag", ",", "delay", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/turtle.py#L2672-L2691
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exomerge3.py
python
ExodusModel.side_set_exists
(self, side_set_id)
return side_set_id in self.get_side_set_ids()
Return 'True' if the given side set exists. Examples: >>> model.side_set_exists(1) >>> model.node_set_exists('sideset_name')
Return 'True' if the given side set exists.
[ "Return", "True", "if", "the", "given", "side", "set", "exists", "." ]
def side_set_exists(self, side_set_id): """ Return 'True' if the given side set exists. Examples: >>> model.side_set_exists(1) >>> model.node_set_exists('sideset_name') """ if isinstance(side_set_id, str): return side_set_id in self.get_all_side_set_...
[ "def", "side_set_exists", "(", "self", ",", "side_set_id", ")", ":", "if", "isinstance", "(", "side_set_id", ",", "str", ")", ":", "return", "side_set_id", "in", "self", ".", "get_all_side_set_names", "(", ")", "return", "side_set_id", "in", "self", ".", "ge...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge3.py#L4806-L4817
jsk-ros-pkg/jsk_recognition
be6e319d29797bafb10c589fdff364c3d333a605
jsk_recognition_utils/python/jsk_recognition_utils/put_text.py
python
put_text_to_image
( img, text, pos, font_path, font_size, color, background_color=None, offset_x=0, offset_y=0)
return img
Put text to image using pillow. You can put text to an image including non-ASCII characters. Parameters ========== img : numpy.ndarray cv2 image. bgr order. text : str text information. pos : tuple(float) xy position of text. font_path : str path to font. ...
Put text to image using pillow.
[ "Put", "text", "to", "image", "using", "pillow", "." ]
def put_text_to_image( img, text, pos, font_path, font_size, color, background_color=None, offset_x=0, offset_y=0): """Put text to image using pillow. You can put text to an image including non-ASCII characters. Parameters ========== img : numpy.ndarray cv2 image. bgr order...
[ "def", "put_text_to_image", "(", "img", ",", "text", ",", "pos", ",", "font_path", ",", "font_size", ",", "color", ",", "background_color", "=", "None", ",", "offset_x", "=", "0", ",", "offset_y", "=", "0", ")", ":", "if", "sys", ".", "version_info", "...
https://github.com/jsk-ros-pkg/jsk_recognition/blob/be6e319d29797bafb10c589fdff364c3d333a605/jsk_recognition_utils/python/jsk_recognition_utils/put_text.py#L9-L79
OSGeo/gdal
3748fc4ba4fba727492774b2b908a2130c864a83
swig/python/osgeo/gdal.py
python
Band.SetDefaultRAT
(self, *args)
return _gdal.Band_SetDefaultRAT(self, *args)
r"""SetDefaultRAT(Band self, RasterAttributeTable table) -> int
r"""SetDefaultRAT(Band self, RasterAttributeTable table) -> int
[ "r", "SetDefaultRAT", "(", "Band", "self", "RasterAttributeTable", "table", ")", "-", ">", "int" ]
def SetDefaultRAT(self, *args): r"""SetDefaultRAT(Band self, RasterAttributeTable table) -> int""" return _gdal.Band_SetDefaultRAT(self, *args)
[ "def", "SetDefaultRAT", "(", "self", ",", "*", "args", ")", ":", "return", "_gdal", ".", "Band_SetDefaultRAT", "(", "self", ",", "*", "args", ")" ]
https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gdal.py#L3528-L3530
OkCupid/okws
1c337392c676ccb4e9a4c92d11d5d2fada6427d2
py/okws/pubast.py
python
walk
(node)
Recursively yield all descendant nodes in the tree starting at *node* (including *node* itself), in no specified order. This is useful if you only want to modify nodes in place and don't care about the context.
Recursively yield all descendant nodes in the tree starting at *node* (including *node* itself), in no specified order. This is useful if you only want to modify nodes in place and don't care about the context.
[ "Recursively", "yield", "all", "descendant", "nodes", "in", "the", "tree", "starting", "at", "*", "node", "*", "(", "including", "*", "node", "*", "itself", ")", "in", "no", "specified", "order", ".", "This", "is", "useful", "if", "you", "only", "want", ...
def walk(node): """ Recursively yield all descendant nodes in the tree starting at *node* (including *node* itself), in no specified order. This is useful if you only want to modify nodes in place and don't care about the context. """ from collections import deque todo = deque([node]) w...
[ "def", "walk", "(", "node", ")", ":", "from", "collections", "import", "deque", "todo", "=", "deque", "(", "[", "node", "]", ")", "while", "todo", ":", "node", "=", "todo", ".", "popleft", "(", ")", "todo", ".", "extend", "(", "iter_child_nodes", "("...
https://github.com/OkCupid/okws/blob/1c337392c676ccb4e9a4c92d11d5d2fada6427d2/py/okws/pubast.py#L87-L98
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
openmp/runtime/tools/summarizeStats.py
python
extractSI
(s)
return num*factor if factor > 0 else num/-factor
Convert a measurement with a range suffix into a suitably scaled value
Convert a measurement with a range suffix into a suitably scaled value
[ "Convert", "a", "measurement", "with", "a", "range", "suffix", "into", "a", "suitably", "scaled", "value" ]
def extractSI(s): """Convert a measurement with a range suffix into a suitably scaled value""" du = s.split() num = float(du[0]) units = du[1] if len(du) == 2 else ' ' # http://physics.nist.gov/cuu/Units/prefixes.html factor = {'Y': 1e24, 'Z': 1e21, 'E': 1e...
[ "def", "extractSI", "(", "s", ")", ":", "du", "=", "s", ".", "split", "(", ")", "num", "=", "float", "(", "du", "[", "0", "]", ")", "units", "=", "du", "[", "1", "]", "if", "len", "(", "du", ")", "==", "2", "else", "' '", "# http://physics.ni...
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/openmp/runtime/tools/summarizeStats.py#L77-L105
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/groupby/groupby.py
python
_GroupBy._transform_should_cast
(self, func_nm: str)
return (self.size().fillna(0) > 0).any() and ( func_nm not in base.cython_cast_blacklist )
Parameters ---------- func_nm: str The name of the aggregation function being performed Returns ------- bool Whether transform should attempt to cast the result of aggregation
Parameters ---------- func_nm: str The name of the aggregation function being performed
[ "Parameters", "----------", "func_nm", ":", "str", "The", "name", "of", "the", "aggregation", "function", "being", "performed" ]
def _transform_should_cast(self, func_nm: str) -> bool: """ Parameters ---------- func_nm: str The name of the aggregation function being performed Returns ------- bool Whether transform should attempt to cast the result of aggregation ...
[ "def", "_transform_should_cast", "(", "self", ",", "func_nm", ":", "str", ")", "->", "bool", ":", "return", "(", "self", ".", "size", "(", ")", ".", "fillna", "(", "0", ")", ">", "0", ")", ".", "any", "(", ")", "and", "(", "func_nm", "not", "in",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/groupby/groupby.py#L825-L839
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/codecs.py
python
Codec.encode
(self, input, errors='strict')
Encodes the object input and returns a tuple (output object, length consumed). errors defines the error handling to apply. It defaults to 'strict' handling. The method may not store state in the Codec instance. Use StreamWriter for codecs which have to keep ...
Encodes the object input and returns a tuple (output object, length consumed).
[ "Encodes", "the", "object", "input", "and", "returns", "a", "tuple", "(", "output", "object", "length", "consumed", ")", "." ]
def encode(self, input, errors='strict'): """ Encodes the object input and returns a tuple (output object, length consumed). errors defines the error handling to apply. It defaults to 'strict' handling. The method may not store state in the Codec instance. Use ...
[ "def", "encode", "(", "self", ",", "input", ",", "errors", "=", "'strict'", ")", ":", "raise", "NotImplementedError" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/codecs.py#L138-L155
gamedev-net/nehe-opengl
9f073e5b092ad8dbcb21393871a2855fe86a65c6
python/lesson42/ztv10E/lesson42.py
python
UpdateTex
(dmx, dmy)
return
// Update Pixel dmx, dmy On The Texture
// Update Pixel dmx, dmy On The Texture
[ "//", "Update", "Pixel", "dmx", "dmy", "On", "The", "Texture" ]
def UpdateTex(dmx, dmy): """ // Update Pixel dmx, dmy On The Texture """ global tex_data tex_data[0+((dmx+(width*dmy))*3)]=255; # // Set Red Pixel To Full Bright tex_data[1+((dmx+(width*dmy))*3)]=255; # // Set Green Pixel To Full Bright tex_data[2+((dmx+(width*dmy))*3)]=255; # // Set Blue Pixel To ...
[ "def", "UpdateTex", "(", "dmx", ",", "dmy", ")", ":", "global", "tex_data", "tex_data", "[", "0", "+", "(", "(", "dmx", "+", "(", "width", "*", "dmy", ")", ")", "*", "3", ")", "]", "=", "255", "# // Set Red Pixel To Full Bright", "tex_data", "[", "1"...
https://github.com/gamedev-net/nehe-opengl/blob/9f073e5b092ad8dbcb21393871a2855fe86a65c6/python/lesson42/ztv10E/lesson42.py#L114-L121
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/keras/_impl/keras/engine/topology.py
python
load_weights_from_hdf5_group_by_name
(f, layers)
Implements name-based weight loading. (instead of topological weight loading). Layers that have no matching name are skipped. Arguments: f: A pointer to a HDF5 group. layers: a list of target layers. Raises: ValueError: in case of mismatch between provided layers and weights file...
Implements name-based weight loading.
[ "Implements", "name", "-", "based", "weight", "loading", "." ]
def load_weights_from_hdf5_group_by_name(f, layers): """Implements name-based weight loading. (instead of topological weight loading). Layers that have no matching name are skipped. Arguments: f: A pointer to a HDF5 group. layers: a list of target layers. Raises: ValueError: in case of m...
[ "def", "load_weights_from_hdf5_group_by_name", "(", "f", ",", "layers", ")", ":", "if", "'keras_version'", "in", "f", ".", "attrs", ":", "original_keras_version", "=", "f", ".", "attrs", "[", "'keras_version'", "]", ".", "decode", "(", "'utf8'", ")", "else", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/keras/_impl/keras/engine/topology.py#L1492-L1545
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
Rect.__init__
(self, *args, **kwargs)
__init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect Create a new Rect object.
__init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
[ "__init__", "(", "self", "int", "x", "=", "0", "int", "y", "=", "0", "int", "width", "=", "0", "int", "height", "=", "0", ")", "-", ">", "Rect" ]
def __init__(self, *args, **kwargs): """ __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect Create a new Rect object. """ _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_core_", ".", "Rect_swiginit", "(", "self", ",", "_core_", ".", "new_Rect", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L1260-L1266
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/logging/handlers.py
python
NTEventLogHandler.emit
(self, record)
Emit a record. Determine the message ID, event category and event type. Then log the message in the NT event log.
Emit a record.
[ "Emit", "a", "record", "." ]
def emit(self, record): """ Emit a record. Determine the message ID, event category and event type. Then log the message in the NT event log. """ if self._welu: try: id = self.getMessageID(record) cat = self.getEventCategory(re...
[ "def", "emit", "(", "self", ",", "record", ")", ":", "if", "self", ".", "_welu", ":", "try", ":", "id", "=", "self", ".", "getMessageID", "(", "record", ")", "cat", "=", "self", ".", "getEventCategory", "(", "record", ")", "type", "=", "self", ".",...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/logging/handlers.py#L949-L966
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/learn/python/learn/supervised_session.py
python
SupervisedSession._create_session
(self)
return coordinated_session.CoordinatedSession( monitored_session.MonitoredSession(tf_sess, self._monitors, self._scaffold.global_step_tensor), coord, coordinated_threads_to_join)
Factory for the RecoverableSession. Returns: A session, initialized or recovered as needed.
Factory for the RecoverableSession.
[ "Factory", "for", "the", "RecoverableSession", "." ]
def _create_session(self): """Factory for the RecoverableSession. Returns: A session, initialized or recovered as needed. """ if self._is_chief: tf_sess = self._session_manager.prepare_session( self._master, saver=self._scaffold.saver, checkpoint_dir=self._checkpoint_dir...
[ "def", "_create_session", "(", "self", ")", ":", "if", "self", ".", "_is_chief", ":", "tf_sess", "=", "self", ".", "_session_manager", ".", "prepare_session", "(", "self", ".", "_master", ",", "saver", "=", "self", ".", "_scaffold", ".", "saver", ",", "c...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/supervised_session.py#L268-L293
trailofbits/llvm-sanitizer-tutorial
d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99
llvm/bindings/python/llvm/object.py
python
Section.has_symbol
(self, symbol)
return lib.LLVMGetSectionContainsSymbol(self, symbol)
Returns whether a Symbol instance is present in this Section.
Returns whether a Symbol instance is present in this Section.
[ "Returns", "whether", "a", "Symbol", "instance", "is", "present", "in", "this", "Section", "." ]
def has_symbol(self, symbol): """Returns whether a Symbol instance is present in this Section.""" if self.expired: raise Exception('Section instance has expired.') assert isinstance(symbol, Symbol) return lib.LLVMGetSectionContainsSymbol(self, symbol)
[ "def", "has_symbol", "(", "self", ",", "symbol", ")", ":", "if", "self", ".", "expired", ":", "raise", "Exception", "(", "'Section instance has expired.'", ")", "assert", "isinstance", "(", "symbol", ",", "Symbol", ")", "return", "lib", ".", "LLVMGetSectionCon...
https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/bindings/python/llvm/object.py#L232-L238
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/aui.py
python
AuiToolBar.GetToolToggled
(*args, **kwargs)
return _aui.AuiToolBar_GetToolToggled(*args, **kwargs)
GetToolToggled(self, int toolId) -> bool
GetToolToggled(self, int toolId) -> bool
[ "GetToolToggled", "(", "self", "int", "toolId", ")", "-", ">", "bool" ]
def GetToolToggled(*args, **kwargs): """GetToolToggled(self, int toolId) -> bool""" return _aui.AuiToolBar_GetToolToggled(*args, **kwargs)
[ "def", "GetToolToggled", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiToolBar_GetToolToggled", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/aui.py#L2150-L2152
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/dataview.py
python
DataViewModel.GetValue
(*args, **kwargs)
return _dataview.DataViewModel_GetValue(*args, **kwargs)
GetValue(self, DataViewItem item, unsigned int col) -> wxVariant Override this and return the value to be used for the item, in the given column. The type of the return value should match that given by `GetColumnType`.
GetValue(self, DataViewItem item, unsigned int col) -> wxVariant
[ "GetValue", "(", "self", "DataViewItem", "item", "unsigned", "int", "col", ")", "-", ">", "wxVariant" ]
def GetValue(*args, **kwargs): """ GetValue(self, DataViewItem item, unsigned int col) -> wxVariant Override this and return the value to be used for the item, in the given column. The type of the return value should match that given by `GetColumnType`. """ retu...
[ "def", "GetValue", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewModel_GetValue", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/dataview.py#L459-L467
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
PanedWindow.paneconfigure
(self, tagOrId, cnf=None, **kw)
Query or modify the management options for window. If no option is specified, returns a list describing all of the available options for pathName. If option is specified with no value, then the command returns a list describing the one named option (this list will be identical ...
Query or modify the management options for window.
[ "Query", "or", "modify", "the", "management", "options", "for", "window", "." ]
def paneconfigure(self, tagOrId, cnf=None, **kw): """Query or modify the management options for window. If no option is specified, returns a list describing all of the available options for pathName. If option is specified with no value, then the command returns a list describi...
[ "def", "paneconfigure", "(", "self", ",", "tagOrId", ",", "cnf", "=", "None", ",", "*", "*", "kw", ")", ":", "if", "cnf", "is", "None", "and", "not", "kw", ":", "cnf", "=", "{", "}", "for", "x", "in", "self", ".", "tk", ".", "split", "(", "se...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py#L3658-L3738
JDAI-CV/DNNLibrary
e17f11e966b2cce7d747799b76bb9843813d4b01
quant.py
python
modify_pb
(m: onnx.ModelProto, quant_layers: List[str])
Modify proto buffers when all quantization infos are set correctly :param m: the model :param quant_layers: layers need to be quantized
Modify proto buffers when all quantization infos are set correctly :param m: the model :param quant_layers: layers need to be quantized
[ "Modify", "proto", "buffers", "when", "all", "quantization", "infos", "are", "set", "correctly", ":", "param", "m", ":", "the", "model", ":", "param", "quant_layers", ":", "layers", "need", "to", "be", "quantized" ]
def modify_pb(m: onnx.ModelProto, quant_layers: List[str]) -> None: """ Modify proto buffers when all quantization infos are set correctly :param m: the model :param quant_layers: layers need to be quantized """ for node in m.graph.node: if node.name not in quant_layers: cont...
[ "def", "modify_pb", "(", "m", ":", "onnx", ".", "ModelProto", ",", "quant_layers", ":", "List", "[", "str", "]", ")", "->", "None", ":", "for", "node", "in", "m", ".", "graph", ".", "node", ":", "if", "node", ".", "name", "not", "in", "quant_layers...
https://github.com/JDAI-CV/DNNLibrary/blob/e17f11e966b2cce7d747799b76bb9843813d4b01/quant.py#L67-L95
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/nn/cell.py
python
Cell.update_parameters_name
(self, prefix='', recurse=True)
Updates the names of parameters with given prefix string. Adds the given prefix to the names of parameters. Args: prefix (str): The prefix string. Default: ''. recurse (bool): Whether contains the parameters of subcells. Default: True.
Updates the names of parameters with given prefix string.
[ "Updates", "the", "names", "of", "parameters", "with", "given", "prefix", "string", "." ]
def update_parameters_name(self, prefix='', recurse=True): """ Updates the names of parameters with given prefix string. Adds the given prefix to the names of parameters. Args: prefix (str): The prefix string. Default: ''. recurse (bool): Whether contains the pa...
[ "def", "update_parameters_name", "(", "self", ",", "prefix", "=", "''", ",", "recurse", "=", "True", ")", ":", "Validator", ".", "check_str_by_regular", "(", "prefix", ")", "for", "name", ",", "param", "in", "self", ".", "parameters_and_names", "(", "expand"...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/cell.py#L1045-L1060
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
example/ssd/dataset/pycocotools/coco.py
python
COCO.getCatIds
(self, catNms=[], supNms=[], catIds=[])
return ids
filtering parameters. default skips that filter. :param catNms (str array) : get cats for given cat names :param supNms (str array) : get cats for given supercategory names :param catIds (int array) : get cats for given cat ids :return: ids (int array) : integer array of cat ids
filtering parameters. default skips that filter. :param catNms (str array) : get cats for given cat names :param supNms (str array) : get cats for given supercategory names :param catIds (int array) : get cats for given cat ids :return: ids (int array) : integer array of cat ids
[ "filtering", "parameters", ".", "default", "skips", "that", "filter", ".", ":", "param", "catNms", "(", "str", "array", ")", ":", "get", "cats", "for", "given", "cat", "names", ":", "param", "supNms", "(", "str", "array", ")", ":", "get", "cats", "for"...
def getCatIds(self, catNms=[], supNms=[], catIds=[]): """ filtering parameters. default skips that filter. :param catNms (str array) : get cats for given cat names :param supNms (str array) : get cats for given supercategory names :param catIds (int array) : get cats for given...
[ "def", "getCatIds", "(", "self", ",", "catNms", "=", "[", "]", ",", "supNms", "=", "[", "]", ",", "catIds", "=", "[", "]", ")", ":", "catNms", "=", "catNms", "if", "type", "(", "catNms", ")", "==", "list", "else", "[", "catNms", "]", "supNms", ...
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/example/ssd/dataset/pycocotools/coco.py#L169-L189
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/richtext.py
python
RichTextFileHandler.GetName
(*args, **kwargs)
return _richtext.RichTextFileHandler_GetName(*args, **kwargs)
GetName(self) -> String
GetName(self) -> String
[ "GetName", "(", "self", ")", "-", ">", "String" ]
def GetName(*args, **kwargs): """GetName(self) -> String""" return _richtext.RichTextFileHandler_GetName(*args, **kwargs)
[ "def", "GetName", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextFileHandler_GetName", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L2792-L2794
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
parserCtxt.setupParserForBuffer
(self, buffer, filename)
Setup the parser context to parse a new buffer; Clears any prior contents from the parser context. The buffer parameter must not be None, but the filename parameter can be
Setup the parser context to parse a new buffer; Clears any prior contents from the parser context. The buffer parameter must not be None, but the filename parameter can be
[ "Setup", "the", "parser", "context", "to", "parse", "a", "new", "buffer", ";", "Clears", "any", "prior", "contents", "from", "the", "parser", "context", ".", "The", "buffer", "parameter", "must", "not", "be", "None", "but", "the", "filename", "parameter", ...
def setupParserForBuffer(self, buffer, filename): """Setup the parser context to parse a new buffer; Clears any prior contents from the parser context. The buffer parameter must not be None, but the filename parameter can be """ libxml2mod.xmlSetupParserForBuffer(self._o, ...
[ "def", "setupParserForBuffer", "(", "self", ",", "buffer", ",", "filename", ")", ":", "libxml2mod", ".", "xmlSetupParserForBuffer", "(", "self", ".", "_o", ",", "buffer", ",", "filename", ")" ]
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L5058-L5063
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/algorithms/noisy_policy.py
python
NoisyPolicy.action_probabilities
(self, state, player_id=None)
return self._policy.action_probabilities(state, player_id)
Returns the policy for a player in a state. Args: state: A `pyspiel.State` object. player_id: Optional, the player id for whom we want an action. Optional unless this is a simultabeous state at which multiple players can act. Returns: A `dict` of `{action: probability}` for the speci...
Returns the policy for a player in a state.
[ "Returns", "the", "policy", "for", "a", "player", "in", "a", "state", "." ]
def action_probabilities(self, state, player_id=None): """Returns the policy for a player in a state. Args: state: A `pyspiel.State` object. player_id: Optional, the player id for whom we want an action. Optional unless this is a simultabeous state at which multiple players can act. Re...
[ "def", "action_probabilities", "(", "self", ",", "state", ",", "player_id", "=", "None", ")", ":", "# If self._player_id is None, or if self.player_id == current_player, add", "# noise.", "if", "(", "(", "self", ".", "player_id", "is", "None", ")", "or", "(", "state...
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/noisy_policy.py#L113-L137
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/factorization/python/ops/gmm_ops.py
python
GmmAlgorithm._define_loglikelihood_operation
(self)
Defines the total log-likelihood of current iteration.
Defines the total log-likelihood of current iteration.
[ "Defines", "the", "total", "log", "-", "likelihood", "of", "current", "iteration", "." ]
def _define_loglikelihood_operation(self): """Defines the total log-likelihood of current iteration.""" self._ll_op = [] for prior_probs in self._prior_probs: self._ll_op.append(tf.reduce_sum(tf.log(prior_probs))) tf.scalar_summary('ll', tf.reduce_sum(self._ll_op))
[ "def", "_define_loglikelihood_operation", "(", "self", ")", ":", "self", ".", "_ll_op", "=", "[", "]", "for", "prior_probs", "in", "self", ".", "_prior_probs", ":", "self", ".", "_ll_op", ".", "append", "(", "tf", ".", "reduce_sum", "(", "tf", ".", "log"...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L410-L415
cvxpy/cvxpy
5165b4fb750dfd237de8659383ef24b4b2e33aaf
cvxpy/atoms/sign.py
python
sign.numeric
(self, values)
return x
Returns the sign of x.
Returns the sign of x.
[ "Returns", "the", "sign", "of", "x", "." ]
def numeric(self, values): """Returns the sign of x. """ x = values[0].copy() x[x > 0] = 1.0 x[x <= 0] = -1.0 return x
[ "def", "numeric", "(", "self", ",", "values", ")", ":", "x", "=", "values", "[", "0", "]", ".", "copy", "(", ")", "x", "[", "x", ">", "0", "]", "=", "1.0", "x", "[", "x", "<=", "0", "]", "=", "-", "1.0", "return", "x" ]
https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/sign.py#L28-L34
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/cython/Cython/Compiler/ExprNodes.py
python
IndexNode.analyse_as_buffer_operation
(self, env, getting)
return replacement_node
Analyse buffer indexing and memoryview indexing/slicing
Analyse buffer indexing and memoryview indexing/slicing
[ "Analyse", "buffer", "indexing", "and", "memoryview", "indexing", "/", "slicing" ]
def analyse_as_buffer_operation(self, env, getting): """ Analyse buffer indexing and memoryview indexing/slicing """ if isinstance(self.index, TupleNode): indices = self.index.args else: indices = [self.index] base = self.base base_type = ...
[ "def", "analyse_as_buffer_operation", "(", "self", ",", "env", ",", "getting", ")", ":", "if", "isinstance", "(", "self", ".", "index", ",", "TupleNode", ")", ":", "indices", "=", "self", ".", "index", ".", "args", "else", ":", "indices", "=", "[", "se...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/cython/Cython/Compiler/ExprNodes.py#L3786-L3837
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/difflib.py
python
IS_CHARACTER_JUNK
(ch, ws=" \t")
return ch in ws
r""" Return 1 for ignorable character: iff `ch` is a space or tab. Examples: >>> IS_CHARACTER_JUNK(' ') True >>> IS_CHARACTER_JUNK('\t') True >>> IS_CHARACTER_JUNK('\n') False >>> IS_CHARACTER_JUNK('x') False
r""" Return 1 for ignorable character: iff `ch` is a space or tab.
[ "r", "Return", "1", "for", "ignorable", "character", ":", "iff", "ch", "is", "a", "space", "or", "tab", "." ]
def IS_CHARACTER_JUNK(ch, ws=" \t"): r""" Return 1 for ignorable character: iff `ch` is a space or tab. Examples: >>> IS_CHARACTER_JUNK(' ') True >>> IS_CHARACTER_JUNK('\t') True >>> IS_CHARACTER_JUNK('\n') False >>> IS_CHARACTER_JUNK('x') False """ return ch in ws
[ "def", "IS_CHARACTER_JUNK", "(", "ch", ",", "ws", "=", "\" \\t\"", ")", ":", "return", "ch", "in", "ws" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/difflib.py#L1124-L1140
maierfelix/dawn-ray-tracing
cfd8511ce95e197ec56fa4880223290554030684
generator/generator_lib.py
python
Generator.get_file_renders
(self, args)
return []
Return the list of FileRender objects to process.
Return the list of FileRender objects to process.
[ "Return", "the", "list", "of", "FileRender", "objects", "to", "process", "." ]
def get_file_renders(self, args): """Return the list of FileRender objects to process.""" return []
[ "def", "get_file_renders", "(", "self", ",", "args", ")", ":", "return", "[", "]" ]
https://github.com/maierfelix/dawn-ray-tracing/blob/cfd8511ce95e197ec56fa4880223290554030684/generator/generator_lib.py#L67-L69
OpenChemistry/tomviz
0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a
tomviz/python/tomviz/executor.py
python
JsonProgress.write
(self, data)
Method the write JSON progress message. Implemented by subclass.
Method the write JSON progress message. Implemented by subclass.
[ "Method", "the", "write", "JSON", "progress", "message", ".", "Implemented", "by", "subclass", "." ]
def write(self, data): """ Method the write JSON progress message. Implemented by subclass. """
[ "def", "write", "(", "self", ",", "data", ")", ":" ]
https://github.com/OpenChemistry/tomviz/blob/0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a/tomviz/python/tomviz/executor.py#L125-L128
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/ops/gradients.py
python
_StopOps
(from_ops, pending_count)
return stop_ops
The set of ops that terminate the gradient computation. This computes the frontier of the forward graph *before* which backprop should stop. Operations in the returned set will not be differentiated. This set is defined as the subset of `from_ops` containing ops that have no predecessor in `from_ops`. `pending...
The set of ops that terminate the gradient computation.
[ "The", "set", "of", "ops", "that", "terminate", "the", "gradient", "computation", "." ]
def _StopOps(from_ops, pending_count): """The set of ops that terminate the gradient computation. This computes the frontier of the forward graph *before* which backprop should stop. Operations in the returned set will not be differentiated. This set is defined as the subset of `from_ops` containing ops that h...
[ "def", "_StopOps", "(", "from_ops", ",", "pending_count", ")", ":", "stop_ops", "=", "set", "(", ")", "for", "op", "in", "from_ops", ":", "is_stop_op", "=", "True", "for", "inp", "in", "op", ".", "inputs", ":", "if", "pending_count", "[", "inp", ".", ...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/gradients.py#L268-L294
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/idlelib/config.py
python
IdleConf.GetCoreKeys
(self, keySetName=None)
return keyBindings
Return dict of core virtual-key keybindings for keySetName. The default keySetName None corresponds to the keyBindings base dict. If keySetName is not None, bindings from the config file(s) are loaded _over_ these defaults, so if there is a problem getting any core binding there will be...
Return dict of core virtual-key keybindings for keySetName.
[ "Return", "dict", "of", "core", "virtual", "-", "key", "keybindings", "for", "keySetName", "." ]
def GetCoreKeys(self, keySetName=None): """Return dict of core virtual-key keybindings for keySetName. The default keySetName None corresponds to the keyBindings base dict. If keySetName is not None, bindings from the config file(s) are loaded _over_ these defaults, so if there is a ...
[ "def", "GetCoreKeys", "(", "self", ",", "keySetName", "=", "None", ")", ":", "keyBindings", "=", "{", "'<<copy>>'", ":", "[", "'<Control-c>'", ",", "'<Control-C>'", "]", ",", "'<<cut>>'", ":", "[", "'<Control-x>'", ",", "'<Control-X>'", "]", ",", "'<<paste>>...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/config.py#L591-L685
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/inspect.py
python
getattr_static
(obj, attr, default=_sentinel)
Retrieve attributes without triggering dynamic lookup via the descriptor protocol, __getattr__ or __getattribute__. Note: this function may not be able to retrieve all attributes that getattr can fetch (like dynamically created attributes) and may find attributes that getattr can't (like d...
Retrieve attributes without triggering dynamic lookup via the descriptor protocol, __getattr__ or __getattribute__.
[ "Retrieve", "attributes", "without", "triggering", "dynamic", "lookup", "via", "the", "descriptor", "protocol", "__getattr__", "or", "__getattribute__", "." ]
def getattr_static(obj, attr, default=_sentinel): """Retrieve attributes without triggering dynamic lookup via the descriptor protocol, __getattr__ or __getattribute__. Note: this function may not be able to retrieve all attributes that getattr can fetch (like dynamically created attributes) ...
[ "def", "getattr_static", "(", "obj", ",", "attr", ",", "default", "=", "_sentinel", ")", ":", "instance_result", "=", "_sentinel", "if", "not", "_is_type", "(", "obj", ")", ":", "klass", "=", "type", "(", "obj", ")", "dict_attr", "=", "_shadowed_dict", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/inspect.py#L1566-L1609
widelands/widelands
e9f047d46a23d81312237d52eabf7d74e8de52d6
utils/build_deps.py
python
extract_includes
(srcdir, source)
return includes
Returns all locally included files.
Returns all locally included files.
[ "Returns", "all", "locally", "included", "files", "." ]
def extract_includes(srcdir, source): """Returns all locally included files.""" includes = set() for line in io.open(source, encoding='utf-8'): match = __INCLUDE.match(line) if match: includes.add(path.join(srcdir, match.group(1))) return includes
[ "def", "extract_includes", "(", "srcdir", ",", "source", ")", ":", "includes", "=", "set", "(", ")", "for", "line", "in", "io", ".", "open", "(", "source", ",", "encoding", "=", "'utf-8'", ")", ":", "match", "=", "__INCLUDE", ".", "match", "(", "line...
https://github.com/widelands/widelands/blob/e9f047d46a23d81312237d52eabf7d74e8de52d6/utils/build_deps.py#L63-L70
facebookincubator/BOLT
88c70afe9d388ad430cc150cc158641701397f70
lldb/utils/lui/lldbutil.py
python
get_symbol_names
(thread)
return [GetSymbol(i) for i in range(thread.GetNumFrames())]
Returns a sequence of symbols for this thread.
Returns a sequence of symbols for this thread.
[ "Returns", "a", "sequence", "of", "symbols", "for", "this", "thread", "." ]
def get_symbol_names(thread): """ Returns a sequence of symbols for this thread. """ def GetSymbol(i): return thread.GetFrameAtIndex(i).GetSymbol().GetName() return [GetSymbol(i) for i in range(thread.GetNumFrames())]
[ "def", "get_symbol_names", "(", "thread", ")", ":", "def", "GetSymbol", "(", "i", ")", ":", "return", "thread", ".", "GetFrameAtIndex", "(", "i", ")", ".", "GetSymbol", "(", ")", ".", "GetName", "(", ")", "return", "[", "GetSymbol", "(", "i", ")", "f...
https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/lldb/utils/lui/lldbutil.py#L714-L721
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/metrics/python/ops/set_ops.py
python
set_difference
(a, b, aminusb=True, validate_indices=True)
return _set_operation(a, b, "a-b" if aminusb else "b-a", validate_indices)
Compute set difference of elements in last dimension of `a` and `b`. All but the last dimension of `a` and `b` must match. Args: a: `Tensor` or `SparseTensor` of the same type as `b`. If sparse, indices must be sorted in row-major order. b: `Tensor` or `SparseTensor` of the same type as `a`. Must ...
Compute set difference of elements in last dimension of `a` and `b`.
[ "Compute", "set", "difference", "of", "elements", "in", "last", "dimension", "of", "a", "and", "b", "." ]
def set_difference(a, b, aminusb=True, validate_indices=True): """Compute set difference of elements in last dimension of `a` and `b`. All but the last dimension of `a` and `b` must match. Args: a: `Tensor` or `SparseTensor` of the same type as `b`. If sparse, indices must be sorted in row-major ord...
[ "def", "set_difference", "(", "a", ",", "b", ",", "aminusb", "=", "True", ",", "validate_indices", "=", "True", ")", ":", "return", "_set_operation", "(", "a", ",", "b", ",", "\"a-b\"", "if", "aminusb", "else", "\"b-a\"", ",", "validate_indices", ")" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/metrics/python/ops/set_ops.py#L161-L181
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/third_party/pyserial/serial/rfc2217.py
python
RFC2217Serial.getCTS
(self)
return bool(self.getModemState() & MODEMSTATE_MASK_CTS)
Read terminal status line: Clear To Send.
Read terminal status line: Clear To Send.
[ "Read", "terminal", "status", "line", ":", "Clear", "To", "Send", "." ]
def getCTS(self): """Read terminal status line: Clear To Send.""" if not self._isOpen: raise portNotOpenError return bool(self.getModemState() & MODEMSTATE_MASK_CTS)
[ "def", "getCTS", "(", "self", ")", ":", "if", "not", "self", ".", "_isOpen", ":", "raise", "portNotOpenError", "return", "bool", "(", "self", ".", "getModemState", "(", ")", "&", "MODEMSTATE_MASK_CTS", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/pyserial/serial/rfc2217.py#L659-L662
facebookincubator/BOLT
88c70afe9d388ad430cc150cc158641701397f70
mlir/utils/jupyter/mlir_opt_kernel/kernel.py
python
MlirOptKernel.banner
(self)
return "mlir-opt kernel %s" % __version__
Returns kernel banner.
Returns kernel banner.
[ "Returns", "kernel", "banner", "." ]
def banner(self): """Returns kernel banner.""" # Just a placeholder. return "mlir-opt kernel %s" % __version__
[ "def", "banner", "(", "self", ")", ":", "# Just a placeholder.", "return", "\"mlir-opt kernel %s\"", "%", "__version__" ]
https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/mlir/utils/jupyter/mlir_opt_kernel/kernel.py#L70-L73
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/control_flow_ops.py
python
_Identity
(tensor, name=None)
Return a tensor with the same shape and contents as the input tensor. Args: tensor: A Tensor. name: A name for this operation (optional). Returns: A Tensor with the same type and value as the input Tensor.
Return a tensor with the same shape and contents as the input tensor.
[ "Return", "a", "tensor", "with", "the", "same", "shape", "and", "contents", "as", "the", "input", "tensor", "." ]
def _Identity(tensor, name=None): """Return a tensor with the same shape and contents as the input tensor. Args: tensor: A Tensor. name: A name for this operation (optional). Returns: A Tensor with the same type and value as the input Tensor. """ tensor = ops.internal_convert_to_tensor_or_compos...
[ "def", "_Identity", "(", "tensor", ",", "name", "=", "None", ")", ":", "tensor", "=", "ops", ".", "internal_convert_to_tensor_or_composite", "(", "tensor", ",", "as_ref", "=", "True", ")", "if", "isinstance", "(", "tensor", ",", "ops", ".", "Tensor", ")", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/control_flow_ops.py#L182-L202
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pdb.py
python
Pdb.do_jump
(self, arg)
j(ump) lineno Set the next line that will be executed. Only available in the bottom-most frame. This lets you jump back and execute code again, or jump forward to skip code that you don't want to run. It should be noted that not all jumps are allowed -- for instance it...
j(ump) lineno Set the next line that will be executed. Only available in the bottom-most frame. This lets you jump back and execute code again, or jump forward to skip code that you don't want to run.
[ "j", "(", "ump", ")", "lineno", "Set", "the", "next", "line", "that", "will", "be", "executed", ".", "Only", "available", "in", "the", "bottom", "-", "most", "frame", ".", "This", "lets", "you", "jump", "back", "and", "execute", "code", "again", "or", ...
def do_jump(self, arg): """j(ump) lineno Set the next line that will be executed. Only available in the bottom-most frame. This lets you jump back and execute code again, or jump forward to skip code that you don't want to run. It should be noted that not all jumps are...
[ "def", "do_jump", "(", "self", ",", "arg", ")", ":", "if", "self", ".", "curindex", "+", "1", "!=", "len", "(", "self", ".", "stack", ")", ":", "self", ".", "error", "(", "'You can only jump within the bottom frame'", ")", "return", "try", ":", "arg", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pdb.py#L1056-L1082
BertaBescos/DynaSLAM
8f894a8b9d63c0a608fd871d63c10796491b9312
src/python/model.py
python
mrcnn_bbox_loss_graph
(target_bbox, target_class_ids, pred_bbox)
return loss
Loss for Mask R-CNN bounding box refinement. target_bbox: [batch, num_rois, (dy, dx, log(dh), log(dw))] target_class_ids: [batch, num_rois]. Integer class IDs. pred_bbox: [batch, num_rois, num_classes, (dy, dx, log(dh), log(dw))]
Loss for Mask R-CNN bounding box refinement.
[ "Loss", "for", "Mask", "R", "-", "CNN", "bounding", "box", "refinement", "." ]
def mrcnn_bbox_loss_graph(target_bbox, target_class_ids, pred_bbox): """Loss for Mask R-CNN bounding box refinement. target_bbox: [batch, num_rois, (dy, dx, log(dh), log(dw))] target_class_ids: [batch, num_rois]. Integer class IDs. pred_bbox: [batch, num_rois, num_classes, (dy, dx, log(dh), log(dw))] ...
[ "def", "mrcnn_bbox_loss_graph", "(", "target_bbox", ",", "target_class_ids", ",", "pred_bbox", ")", ":", "# Reshape to merge batch and roi dimensions for simplicity.", "target_class_ids", "=", "K", ".", "reshape", "(", "target_class_ids", ",", "(", "-", "1", ",", ")", ...
https://github.com/BertaBescos/DynaSLAM/blob/8f894a8b9d63c0a608fd871d63c10796491b9312/src/python/model.py#L1034-L1062
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/resource_prefetch_predictor/prefetch_predictor_tool.py
python
Entry._Score
(self)
return multiplier * 100 - self.average_position
Mirrors ResourcePrefetchPredictorTables::ResourceRow::UpdateScore.
Mirrors ResourcePrefetchPredictorTables::ResourceRow::UpdateScore.
[ "Mirrors", "ResourcePrefetchPredictorTables", "::", "ResourceRow", "::", "UpdateScore", "." ]
def _Score(self): """Mirrors ResourcePrefetchPredictorTables::ResourceRow::UpdateScore.""" multiplier = 1 if self.resource_type in (ResourceType.STYLESHEET, ResourceType.SCRIPT, ResourceType.FONT_RESOURCE): multiplier = 2 return multiplier * 100 - self.average_positio...
[ "def", "_Score", "(", "self", ")", ":", "multiplier", "=", "1", "if", "self", ".", "resource_type", "in", "(", "ResourceType", ".", "STYLESHEET", ",", "ResourceType", ".", "SCRIPT", ",", "ResourceType", ".", "FONT_RESOURCE", ")", ":", "multiplier", "=", "2...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/resource_prefetch_predictor/prefetch_predictor_tool.py#L47-L53
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/ops/math_grad.py
python
_AddNGrad
(op, grad)
return [grad] * len(op.inputs)
Copies the gradient to all inputs.
Copies the gradient to all inputs.
[ "Copies", "the", "gradient", "to", "all", "inputs", "." ]
def _AddNGrad(op, grad): """Copies the gradient to all inputs.""" # Not broadcasting. return [grad] * len(op.inputs)
[ "def", "_AddNGrad", "(", "op", ",", "grad", ")", ":", "# Not broadcasting.", "return", "[", "grad", "]", "*", "len", "(", "op", ".", "inputs", ")" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/math_grad.py#L487-L490
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/html.py
python
HtmlWindow.SelectionToText
(*args, **kwargs)
return _html.HtmlWindow_SelectionToText(*args, **kwargs)
SelectionToText(self) -> String
SelectionToText(self) -> String
[ "SelectionToText", "(", "self", ")", "-", ">", "String" ]
def SelectionToText(*args, **kwargs): """SelectionToText(self) -> String""" return _html.HtmlWindow_SelectionToText(*args, **kwargs)
[ "def", "SelectionToText", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html", ".", "HtmlWindow_SelectionToText", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/html.py#L1106-L1108
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/server/wsgi/serve/snippets/util/dbroot_writer.py
python
_AddSearchServers
(dbroot, search_def_list, search_tab_id, supplemental_search_label, supplemental_search_url, log)
Adds search servers into end_snippet proto section. Args: dbroot: a proto dbroot object to add search servers. search_def_list: the list of search definition objects (basic_types.SearchDef) describing search services: label, service_url,... search_tab_id: a search tab ID to append to a sear...
Adds search servers into end_snippet proto section.
[ "Adds", "search", "servers", "into", "end_snippet", "proto", "section", "." ]
def _AddSearchServers(dbroot, search_def_list, search_tab_id, supplemental_search_label, supplemental_search_url, log): """Adds search servers into end_snippet proto section. Args: dbroot: a proto dbro...
[ "def", "_AddSearchServers", "(", "dbroot", ",", "search_def_list", ",", "search_tab_id", ",", "supplemental_search_label", ",", "supplemental_search_url", ",", "log", ")", ":", "if", "not", "search_def_list", ":", "search_server", "=", "dbroot", ".", "end_snippet", ...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/serve/snippets/util/dbroot_writer.py#L286-L365
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
pygimli/frameworks/inversion.py
python
Inversion.model
(self)
return self._model
The last active model.
The last active model.
[ "The", "last", "active", "model", "." ]
def model(self): """The last active model.""" if self._model is None: if hasattr(self.inv, 'model'): # inv is RInversion() if len(self.inv.model()) > 0: return self.inv.model() else: raise pg.critical( ...
[ "def", "model", "(", "self", ")", ":", "if", "self", ".", "_model", "is", "None", ":", "if", "hasattr", "(", "self", ".", "inv", ",", "'model'", ")", ":", "# inv is RInversion()", "if", "len", "(", "self", ".", "inv", ".", "model", "(", ")", ")", ...
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/frameworks/inversion.py#L171-L183
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/tlslite/tlslite/utils/keyfactory.py
python
parsePrivateKey
(s)
Parse an XML or PEM-formatted private key. @type s: str @param s: A string containing an XML or PEM-encoded private key. @rtype: L{tlslite.utils.RSAKey.RSAKey} @return: An RSA private key. @raise SyntaxError: If the key is not properly formatted.
Parse an XML or PEM-formatted private key.
[ "Parse", "an", "XML", "or", "PEM", "-", "formatted", "private", "key", "." ]
def parsePrivateKey(s): """Parse an XML or PEM-formatted private key. @type s: str @param s: A string containing an XML or PEM-encoded private key. @rtype: L{tlslite.utils.RSAKey.RSAKey} @return: An RSA private key. @raise SyntaxError: If the key is not properly formatted. """ try: ...
[ "def", "parsePrivateKey", "(", "s", ")", ":", "try", ":", "return", "parsePEMKey", "(", "s", ",", "private", "=", "True", ")", "except", ":", "return", "parseXMLKey", "(", "s", ",", "private", "=", "True", ")" ]
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/tlslite/tlslite/utils/keyfactory.py#L189-L203
Tencent/Pebble
68315f176d9e328a233ace29b7579a829f89879f
thirdparty/gflags/gflags.py
python
_RegisterBoundsValidatorIfNeeded
(parser, name, flag_values)
Enforce lower and upper bounds for numeric flags. Args: parser: NumericParser (either FloatParser or IntegerParser). Provides lower and upper bounds, and help text to display. name: string, name of the flag flag_values: FlagValues
Enforce lower and upper bounds for numeric flags.
[ "Enforce", "lower", "and", "upper", "bounds", "for", "numeric", "flags", "." ]
def _RegisterBoundsValidatorIfNeeded(parser, name, flag_values): """Enforce lower and upper bounds for numeric flags. Args: parser: NumericParser (either FloatParser or IntegerParser). Provides lower and upper bounds, and help text to display. name: string, name of the flag flag_values: FlagValue...
[ "def", "_RegisterBoundsValidatorIfNeeded", "(", "parser", ",", "name", ",", "flag_values", ")", ":", "if", "parser", ".", "lower_bound", "is", "not", "None", "or", "parser", ".", "upper_bound", "is", "not", "None", ":", "def", "Checker", "(", "value", ")", ...
https://github.com/Tencent/Pebble/blob/68315f176d9e328a233ace29b7579a829f89879f/thirdparty/gflags/gflags.py#L2040-L2059
naver/sling
5671cd445a2caae0b4dd0332299e4cfede05062c
webkit/Tools/Scripts/webkitpy/style/checker.py
python
StyleProcessor.should_process
(self, file_path)
return True
Return whether the file should be checked for style.
Return whether the file should be checked for style.
[ "Return", "whether", "the", "file", "should", "be", "checked", "for", "style", "." ]
def should_process(self, file_path): """Return whether the file should be checked for style.""" if self._dispatcher.should_skip_without_warning(file_path): return False if self._dispatcher.should_skip_with_warning(file_path): _log.warn('File exempt from style guide. Skipp...
[ "def", "should_process", "(", "self", ",", "file_path", ")", ":", "if", "self", ".", "_dispatcher", ".", "should_skip_without_warning", "(", "file_path", ")", ":", "return", "False", "if", "self", ".", "_dispatcher", ".", "should_skip_with_warning", "(", "file_p...
https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/style/checker.py#L850-L858
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/idlelib/WidgetRedirector.py
python
WidgetRedirector.register
(self, operation, function)
return OriginalCommand(self, operation)
Return OriginalCommand(operation) after registering function. Registration adds an operation: function pair to ._operations. It also adds a widget function attribute that masks the Tkinter class instance method. Method masking operates independently from command dispatch. If a...
Return OriginalCommand(operation) after registering function.
[ "Return", "OriginalCommand", "(", "operation", ")", "after", "registering", "function", "." ]
def register(self, operation, function): '''Return OriginalCommand(operation) after registering function. Registration adds an operation: function pair to ._operations. It also adds a widget function attribute that masks the Tkinter class instance method. Method masking operates indepe...
[ "def", "register", "(", "self", ",", "operation", ",", "function", ")", ":", "self", ".", "_operations", "[", "operation", "]", "=", "function", "setattr", "(", "self", ".", "widget", ",", "operation", ",", "function", ")", "return", "OriginalCommand", "("...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/idlelib/WidgetRedirector.py#L67-L80
strasdat/Sophus
36b08885e094fda63e92ad89d65be380c288265a
sympy/sophus/se3.py
python
Se3.__mul__
(self, right)
left-multiplication either rotation concatenation or point-transform
left-multiplication either rotation concatenation or point-transform
[ "left", "-", "multiplication", "either", "rotation", "concatenation", "or", "point", "-", "transform" ]
def __mul__(self, right): """ left-multiplication either rotation concatenation or point-transform """ if isinstance(right, sympy.Matrix): assert right.shape == (3, 1), right.shape return self.so3 * right + self.t elif isinstance(right, Se3): r = s...
[ "def", "__mul__", "(", "self", ",", "right", ")", ":", "if", "isinstance", "(", "right", ",", "sympy", ".", "Matrix", ")", ":", "assert", "right", ".", "shape", "==", "(", "3", ",", "1", ")", ",", "right", ".", "shape", "return", "self", ".", "so...
https://github.com/strasdat/Sophus/blob/36b08885e094fda63e92ad89d65be380c288265a/sympy/sophus/se3.py#L87-L97
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/checkpoint/python/python_state.py
python
NumpyState.__setattr__
(self, name, value)
Automatically wrap NumPy arrays assigned to attributes.
Automatically wrap NumPy arrays assigned to attributes.
[ "Automatically", "wrap", "NumPy", "arrays", "assigned", "to", "attributes", "." ]
def __setattr__(self, name, value): """Automatically wrap NumPy arrays assigned to attributes.""" # TODO(allenl): Consider supporting lists/tuples, either ad-hoc or by making # ndarrays trackable natively and using standard trackable list # tracking. if isinstance(value, (numpy.ndarray, numpy.generi...
[ "def", "__setattr__", "(", "self", ",", "name", ",", "value", ")", ":", "# TODO(allenl): Consider supporting lists/tuples, either ad-hoc or by making", "# ndarrays trackable natively and using standard trackable list", "# tracking.", "if", "isinstance", "(", "value", ",", "(", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/checkpoint/python/python_state.py#L98-L126
fatih/subvim
241b6d170597857105da219c9b7d36059e9f11fb
vim/base/ultisnips/plugin/UltiSnips/__init__.py
python
Snippet._re_match
(self, trigger)
return False
Test if a the current regex trigger matches `trigger`. If so, set _last_re and _matched.
Test if a the current regex trigger matches `trigger`. If so, set _last_re and _matched.
[ "Test", "if", "a", "the", "current", "regex", "trigger", "matches", "trigger", ".", "If", "so", "set", "_last_re", "and", "_matched", "." ]
def _re_match(self, trigger): """ Test if a the current regex trigger matches `trigger`. If so, set _last_re and _matched. """ for match in re.finditer(self._t, trigger): if match.end() != len(trigger): continue else: self._matched ...
[ "def", "_re_match", "(", "self", ",", "trigger", ")", ":", "for", "match", "in", "re", ".", "finditer", "(", "self", ".", "_t", ",", "trigger", ")", ":", "if", "match", ".", "end", "(", ")", "!=", "len", "(", "trigger", ")", ":", "continue", "els...
https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/ultisnips/plugin/UltiSnips/__init__.py#L277-L289