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
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exomerge2.py
python
ExodusModel.get_length_scale
(self)
return max(relative, absolute)
Return the length scale of the model. The length scale is defined as the largest of the following: * absolute nodal coordinate component * total range in nodal coordinate component Example: >>> model.get_length_scale()
Return the length scale of the model.
[ "Return", "the", "length", "scale", "of", "the", "model", "." ]
def get_length_scale(self): """ Return the length scale of the model. The length scale is defined as the largest of the following: * absolute nodal coordinate component * total range in nodal coordinate component Example: >>> model.get_length_scale() ""...
[ "def", "get_length_scale", "(", "self", ")", ":", "if", "not", "self", ".", "nodes", ":", "return", "0.0", "bounds", "=", "[", "[", "self", ".", "nodes", "[", "0", "]", "[", "d", "]", ",", "self", ".", "nodes", "[", "0", "]", "[", "d", "]", "...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge2.py#L6934-L6958
metashell/metashell
f4177e4854ea00c8dbc722cadab26ef413d798ea
3rd/templight/compiler-rt/lib/asan/scripts/asan_symbolize.py
python
AsanSymbolizerPlugIn.filter_binary_path
(self, binary_path)
return binary_path
Given a binary path return a binary path suitable for symbolication. Implementations should return `None` if symbolication of this binary should be skipped.
Given a binary path return a binary path suitable for symbolication.
[ "Given", "a", "binary", "path", "return", "a", "binary", "path", "suitable", "for", "symbolication", "." ]
def filter_binary_path(self, binary_path): """ Given a binary path return a binary path suitable for symbolication. Implementations should return `None` if symbolication of this binary should be skipped. """ return binary_path
[ "def", "filter_binary_path", "(", "self", ",", "binary_path", ")", ":", "return", "binary_path" ]
https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/compiler-rt/lib/asan/scripts/asan_symbolize.py#L691-L698
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/propgrid.py
python
PGArrayEditorDialog.Init
(*args, **kwargs)
return _propgrid.PGArrayEditorDialog_Init(*args, **kwargs)
Init(self)
Init(self)
[ "Init", "(", "self", ")" ]
def Init(*args, **kwargs): """Init(self)""" return _propgrid.PGArrayEditorDialog_Init(*args, **kwargs)
[ "def", "Init", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGArrayEditorDialog_Init", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L3173-L3175
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/configobj/configobj.py
python
Section.get
(self, key, default=None)
A version of ``get`` that doesn't bypass string interpolation.
A version of ``get`` that doesn't bypass string interpolation.
[ "A", "version", "of", "get", "that", "doesn", "t", "bypass", "string", "interpolation", "." ]
def get(self, key, default=None): """A version of ``get`` that doesn't bypass string interpolation.""" try: return self[key] except KeyError: return default
[ "def", "get", "(", "self", ",", "key", ",", "default", "=", "None", ")", ":", "try", ":", "return", "self", "[", "key", "]", "except", "KeyError", ":", "return", "default" ]
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/configobj/configobj.py#L652-L657
google/fhir
d77f57706c1a168529b0b87ca7ccb1c0113e83c2
py/google/fhir/primitive_handler.py
python
PrimitiveHandler.primitive_wrapper_from_primitive
( self, primitive_message: message.Message )
Wraps the FHIR protobuf primitive_message to handle parsing/printing. The wrapped FHIR protobuf primitive provides necessary state for printing to the FHIR JSON spec. Args: primitive_message: The FHIR primitive to wrap. Raises: ValueError: In the event that primitive_message is not actual...
Wraps the FHIR protobuf primitive_message to handle parsing/printing.
[ "Wraps", "the", "FHIR", "protobuf", "primitive_message", "to", "handle", "parsing", "/", "printing", "." ]
def primitive_wrapper_from_primitive( self, primitive_message: message.Message ) -> _primitive_wrappers.PrimitiveWrapper: """Wraps the FHIR protobuf primitive_message to handle parsing/printing. The wrapped FHIR protobuf primitive provides necessary state for printing to the FHIR JSON spec. Ar...
[ "def", "primitive_wrapper_from_primitive", "(", "self", ",", "primitive_message", ":", "message", ".", "Message", ")", "->", "_primitive_wrappers", ".", "PrimitiveWrapper", ":", "raise", "NotImplementedError", "(", "'Subclasses *must* implement primitive_wrapper_from_primitive....
https://github.com/google/fhir/blob/d77f57706c1a168529b0b87ca7ccb1c0113e83c2/py/google/fhir/primitive_handler.py#L421-L439
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/tools/docs/doc_controls.py
python
doc_private
(obj: T)
return obj
A decorator: Generates docs for private methods/functions. For example: ``` class Try: @doc_controls.doc_private def _private(self): ... ``` As a rule of thumb, private(beginning with `_`) methods/functions are not documented. This decorator allows to force document a private method/fun...
A decorator: Generates docs for private methods/functions.
[ "A", "decorator", ":", "Generates", "docs", "for", "private", "methods", "/", "functions", "." ]
def doc_private(obj: T) -> T: """A decorator: Generates docs for private methods/functions. For example: ``` class Try: @doc_controls.doc_private def _private(self): ... ``` As a rule of thumb, private(beginning with `_`) methods/functions are not documented. This decorator allows to ...
[ "def", "doc_private", "(", "obj", ":", "T", ")", "->", "T", ":", "setattr", "(", "obj", ",", "_DOC_PRIVATE", ",", "None", ")", "return", "obj" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/tools/docs/doc_controls.py#L270-L296
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/smtplib.py
python
SMTP.set_debuglevel
(self, debuglevel)
Set the debug output level. A non-false value results in debug messages for connection and for all messages sent to and received from the server.
Set the debug output level.
[ "Set", "the", "debug", "output", "level", "." ]
def set_debuglevel(self, debuglevel): """Set the debug output level. A non-false value results in debug messages for connection and for all messages sent to and received from the server. """ self.debuglevel = debuglevel
[ "def", "set_debuglevel", "(", "self", ",", "debuglevel", ")", ":", "self", ".", "debuglevel", "=", "debuglevel" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/smtplib.py#L290-L297
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/tools/gyp/pylib/gyp/easy_xml.py
python
XmlToString
(content, encoding="utf-8", pretty=False)
return "".join(xml_parts)
Writes the XML content to disk, touching the file only if it has changed. Visual Studio files have a lot of pre-defined structures. This function makes it easy to represent these structures as Python data structures, instead of having to create a lot of function calls. Each XML element of the content is repr...
Writes the XML content to disk, touching the file only if it has changed.
[ "Writes", "the", "XML", "content", "to", "disk", "touching", "the", "file", "only", "if", "it", "has", "changed", "." ]
def XmlToString(content, encoding="utf-8", pretty=False): """ Writes the XML content to disk, touching the file only if it has changed. Visual Studio files have a lot of pre-defined structures. This function makes it easy to represent these structures as Python data structures, instead of having to create a...
[ "def", "XmlToString", "(", "content", ",", "encoding", "=", "\"utf-8\"", ",", "pretty", "=", "False", ")", ":", "# We create a huge list of all the elements of the file.", "xml_parts", "=", "[", "'<?xml version=\"1.0\" encoding=\"%s\"?>'", "%", "encoding", "]", "if", "p...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/easy_xml.py#L12-L57
yifita/3PU
9ca4c3dfe4e3ead08c72e98a62e4cf181d5c70e0
code/utils/tf_util.py
python
conv2d
(inputs, num_output_channels, kernel_size, scope=None, stride=[1, 1], padding='SAME', use_xavier=True, stddev=1e-3, weight_decay=0.00001, activation_fn=tf.nn.relu, bn=False, ibn=False, bn_...
2D convolution with non-linear operation. Args: inputs: 4-D tensor variable BxHxWxC num_output_channels: int kernel_size: a list of 2 ints scope: string stride: a list of 2 ints padding: 'SAME' or 'VALID' use_xavier: bool, use xavier_initializer if true ...
2D convolution with non-linear operation.
[ "2D", "convolution", "with", "non", "-", "linear", "operation", "." ]
def conv2d(inputs, num_output_channels, kernel_size, scope=None, stride=[1, 1], padding='SAME', use_xavier=True, stddev=1e-3, weight_decay=0.00001, activation_fn=tf.nn.relu, bn=False, ibn=False, ...
[ "def", "conv2d", "(", "inputs", ",", "num_output_channels", ",", "kernel_size", ",", "scope", "=", "None", ",", "stride", "=", "[", "1", ",", "1", "]", ",", "padding", "=", "'SAME'", ",", "use_xavier", "=", "True", ",", "stddev", "=", "1e-3", ",", "w...
https://github.com/yifita/3PU/blob/9ca4c3dfe4e3ead08c72e98a62e4cf181d5c70e0/code/utils/tf_util.py#L139-L199
stitchEm/stitchEm
0f399501d41ab77933677f2907f41f80ceb704d7
lib/bindings/samples/server/output/output.py
python
WriterOutput.flush_writer_events
(self)
Make sure events from plugin are treated :return:
Make sure events from plugin are treated :return:
[ "Make", "sure", "events", "from", "plugin", "are", "treated", ":", "return", ":" ]
def flush_writer_events(self): """ Make sure events from plugin are treated :return: """ for callback in self.callbacks: callback.join() self.callbacks = []
[ "def", "flush_writer_events", "(", "self", ")", ":", "for", "callback", "in", "self", ".", "callbacks", ":", "callback", ".", "join", "(", ")", "self", ".", "callbacks", "=", "[", "]" ]
https://github.com/stitchEm/stitchEm/blob/0f399501d41ab77933677f2907f41f80ceb704d7/lib/bindings/samples/server/output/output.py#L257-L264
kushview/Element
1cc16380caa2ab79461246ba758b9de1f46db2a5
waflib/Tools/javaw.py
python
apply_java
(self)
Create a javac task for compiling *.java files*. There can be only one javac task by task generator.
Create a javac task for compiling *.java files*. There can be only one javac task by task generator.
[ "Create", "a", "javac", "task", "for", "compiling", "*", ".", "java", "files", "*", ".", "There", "can", "be", "only", "one", "javac", "task", "by", "task", "generator", "." ]
def apply_java(self): """ Create a javac task for compiling *.java files*. There can be only one javac task by task generator. """ Utils.def_attrs(self, jarname='', classpath='', sourcepath='.', srcdir='.', jar_mf_attributes={}, jar_mf_classpath=[]) outdir = getattr(self, 'outdir', None) if outdir: if not...
[ "def", "apply_java", "(", "self", ")", ":", "Utils", ".", "def_attrs", "(", "self", ",", "jarname", "=", "''", ",", "classpath", "=", "''", ",", "sourcepath", "=", "'.'", ",", "srcdir", "=", "'.'", ",", "jar_mf_attributes", "=", "{", "}", ",", "jar_m...
https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Tools/javaw.py#L145-L191
lhmRyan/deep-supervised-hashing-DSH
631901f82e2ab031fbac33f914a5b08ef8e21d57
scripts/cpp_lint.py
python
CheckCaffeRandom
(filename, clean_lines, linenum, error)
Checks for calls to C random functions (rand, rand_r, random, ...). Caffe code should (almost) always use the caffe_rng_* functions rather than these, as the internal state of these C functions is independent of the native Caffe RNG system which should produce deterministic results for a fixed Caffe seed set u...
Checks for calls to C random functions (rand, rand_r, random, ...).
[ "Checks", "for", "calls", "to", "C", "random", "functions", "(", "rand", "rand_r", "random", "...", ")", "." ]
def CheckCaffeRandom(filename, clean_lines, linenum, error): """Checks for calls to C random functions (rand, rand_r, random, ...). Caffe code should (almost) always use the caffe_rng_* functions rather than these, as the internal state of these C functions is independent of the native Caffe RNG system which s...
[ "def", "CheckCaffeRandom", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "for", "function", "in", "c_random_function_list", ":", "ix", "=", "line", ".", "find", ...
https://github.com/lhmRyan/deep-supervised-hashing-DSH/blob/631901f82e2ab031fbac33f914a5b08ef8e21d57/scripts/cpp_lint.py#L1640-L1663
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/mailbox.py
python
Maildir.get_file
(self, key)
return _ProxyFile(f)
Return a file-like representation or raise a KeyError.
Return a file-like representation or raise a KeyError.
[ "Return", "a", "file", "-", "like", "representation", "or", "raise", "a", "KeyError", "." ]
def get_file(self, key): """Return a file-like representation or raise a KeyError.""" f = open(os.path.join(self._path, self._lookup(key)), 'rb') return _ProxyFile(f)
[ "def", "get_file", "(", "self", ",", "key", ")", ":", "f", "=", "open", "(", "os", ".", "path", ".", "join", "(", "self", ".", "_path", ",", "self", ".", "_lookup", "(", "key", ")", ")", ",", "'rb'", ")", "return", "_ProxyFile", "(", "f", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/mailbox.py#L390-L393
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/qcdb/vib.py
python
harmonic_analysis
(hess: np.ndarray, geom: np.ndarray, mass: np.ndarray, basisset: psi4.core.BasisSet, irrep_labels: List[str], dipder: np.ndarray = None, project_trans: bool = True, project_rot: bool = True)
return vibinfo, '\n'.join(text)
Extract frequencies, normal modes and other properties from electronic Hessian. Like so much other Psi4 goodness, originally by @andysim Parameters ---------- hess (3*nat, 3*nat) non-mass-weighted Hessian in atomic units, [Eh/a0/a0]. geom (nat, 3) geometry [a0] at which Hessian computed...
Extract frequencies, normal modes and other properties from electronic Hessian. Like so much other Psi4 goodness, originally by @andysim
[ "Extract", "frequencies", "normal", "modes", "and", "other", "properties", "from", "electronic", "Hessian", ".", "Like", "so", "much", "other", "Psi4", "goodness", "originally", "by", "@andysim" ]
def harmonic_analysis(hess: np.ndarray, geom: np.ndarray, mass: np.ndarray, basisset: psi4.core.BasisSet, irrep_labels: List[str], dipder: np.ndarray = None, project_trans: bool = True, project_rot: bool = True) -> Tuple[Dict[str, Datum], str]: """Extract frequencies, normal modes and other properties from electron...
[ "def", "harmonic_analysis", "(", "hess", ":", "np", ".", "ndarray", ",", "geom", ":", "np", ".", "ndarray", ",", "mass", ":", "np", ".", "ndarray", ",", "basisset", ":", "psi4", ".", "core", ".", "BasisSet", ",", "irrep_labels", ":", "List", "[", "st...
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/vib.py#L355-L637
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/importlib/_bootstrap_external.py
python
FileFinder.invalidate_caches
(self)
Invalidate the directory mtime.
Invalidate the directory mtime.
[ "Invalidate", "the", "directory", "mtime", "." ]
def invalidate_caches(self): """Invalidate the directory mtime.""" self._path_mtime = -1
[ "def", "invalidate_caches", "(", "self", ")", ":", "self", ".", "_path_mtime", "=", "-", "1" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/importlib/_bootstrap_external.py#L1482-L1484
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/artmanager.py
python
ArtManager.HighlightBackgroundColour
(self)
return self.LightColour(self.FrameColour(), 60)
Returns the background colour of a control when it is in focus. :return: An instance of :class:`Colour`.
Returns the background colour of a control when it is in focus.
[ "Returns", "the", "background", "colour", "of", "a", "control", "when", "it", "is", "in", "focus", "." ]
def HighlightBackgroundColour(self): """ Returns the background colour of a control when it is in focus. :return: An instance of :class:`Colour`. """ return self.LightColour(self.FrameColour(), 60)
[ "def", "HighlightBackgroundColour", "(", "self", ")", ":", "return", "self", ".", "LightColour", "(", "self", ".", "FrameColour", "(", ")", ",", "60", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/artmanager.py#L1126-L1133
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/netrc.py
python
netrc.authenticators
(self, host)
Return a (user, account, password) tuple for given host.
Return a (user, account, password) tuple for given host.
[ "Return", "a", "(", "user", "account", "password", ")", "tuple", "for", "given", "host", "." ]
def authenticators(self, host): """Return a (user, account, password) tuple for given host.""" if host in self.hosts: return self.hosts[host] elif 'default' in self.hosts: return self.hosts['default'] else: return None
[ "def", "authenticators", "(", "self", ",", "host", ")", ":", "if", "host", "in", "self", ".", "hosts", ":", "return", "self", ".", "hosts", "[", "host", "]", "elif", "'default'", "in", "self", ".", "hosts", ":", "return", "self", ".", "hosts", "[", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/netrc.py#L96-L103
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/plugins/filebrowser/filebrowser/__init__.py
python
FileBrowserPanel.GetUIHandlers
(self)
return [(browser.ID_FILEBROWSE, self._filebrowser.OnUpdateMenu)]
Pass Ui handlers to main window for management
Pass Ui handlers to main window for management
[ "Pass", "Ui", "handlers", "to", "main", "window", "for", "management" ]
def GetUIHandlers(self): """Pass Ui handlers to main window for management""" return [(browser.ID_FILEBROWSE, self._filebrowser.OnUpdateMenu)]
[ "def", "GetUIHandlers", "(", "self", ")", ":", "return", "[", "(", "browser", ".", "ID_FILEBROWSE", ",", "self", ".", "_filebrowser", ".", "OnUpdateMenu", ")", "]" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/plugins/filebrowser/filebrowser/__init__.py#L62-L64
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/propgrid.py
python
PropertyGrid_CreateEscapeSequences
(*args, **kwargs)
return _propgrid.PropertyGrid_CreateEscapeSequences(*args, **kwargs)
PropertyGrid_CreateEscapeSequences(String dst_str, String src_str) -> String
PropertyGrid_CreateEscapeSequences(String dst_str, String src_str) -> String
[ "PropertyGrid_CreateEscapeSequences", "(", "String", "dst_str", "String", "src_str", ")", "-", ">", "String" ]
def PropertyGrid_CreateEscapeSequences(*args, **kwargs): """PropertyGrid_CreateEscapeSequences(String dst_str, String src_str) -> String""" return _propgrid.PropertyGrid_CreateEscapeSequences(*args, **kwargs)
[ "def", "PropertyGrid_CreateEscapeSequences", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGrid_CreateEscapeSequences", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L2474-L2476
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/graph_actions.py
python
_train_internal
(graph, output_dir, train_op, loss_op, global_step_tensor, init_op, init_feed_dict, init_fn, log_every_steps, supervisor_is_chief, ...
See train.
See train.
[ "See", "train", "." ]
def _train_internal(graph, output_dir, train_op, loss_op, global_step_tensor, init_op, init_feed_dict, init_fn, log_every_steps, supervisor_...
[ "def", "_train_internal", "(", "graph", ",", "output_dir", ",", "train_op", ",", "loss_op", ",", "global_step_tensor", ",", "init_op", ",", "init_feed_dict", ",", "init_fn", ",", "log_every_steps", ",", "supervisor_is_chief", ",", "supervisor_master", ",", "supervis...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/graph_actions.py#L238-L410
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
GraphicsContext.DrawRoundedRectangle
(*args, **kwargs)
return _gdi_.GraphicsContext_DrawRoundedRectangle(*args, **kwargs)
DrawRoundedRectangle(self, Double x, Double y, Double w, Double h, Double radius) Draws a rounded rectangle
DrawRoundedRectangle(self, Double x, Double y, Double w, Double h, Double radius)
[ "DrawRoundedRectangle", "(", "self", "Double", "x", "Double", "y", "Double", "w", "Double", "h", "Double", "radius", ")" ]
def DrawRoundedRectangle(*args, **kwargs): """ DrawRoundedRectangle(self, Double x, Double y, Double w, Double h, Double radius) Draws a rounded rectangle """ return _gdi_.GraphicsContext_DrawRoundedRectangle(*args, **kwargs)
[ "def", "DrawRoundedRectangle", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "GraphicsContext_DrawRoundedRectangle", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L6475-L6481
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/_collections.py
python
HTTPHeaderDict.extend
(self, *args, **kwargs)
Generic import function for any type of header-like object. Adapted version of MutableMapping.update in order to insert items with self.add instead of self.__setitem__
Generic import function for any type of header-like object. Adapted version of MutableMapping.update in order to insert items with self.add instead of self.__setitem__
[ "Generic", "import", "function", "for", "any", "type", "of", "header", "-", "like", "object", ".", "Adapted", "version", "of", "MutableMapping", ".", "update", "in", "order", "to", "insert", "items", "with", "self", ".", "add", "instead", "of", "self", "."...
def extend(self, *args, **kwargs): """Generic import function for any type of header-like object. Adapted version of MutableMapping.update in order to insert items with self.add instead of self.__setitem__ """ if len(args) > 1: raise TypeError( "extend...
[ "def", "extend", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "len", "(", "args", ")", ">", "1", ":", "raise", "TypeError", "(", "\"extend() takes at most 1 positional \"", "\"arguments ({0} given)\"", ".", "format", "(", "len", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/_collections.py#L230-L256
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py
python
XcodeArchsDefault._ExpandArchs
(self, archs, sdkroot)
return expanded_archs
Expands variables references in ARCHS, and remove duplicates.
Expands variables references in ARCHS, and remove duplicates.
[ "Expands", "variables", "references", "in", "ARCHS", "and", "remove", "duplicates", "." ]
def _ExpandArchs(self, archs, sdkroot): """Expands variables references in ARCHS, and remove duplicates.""" variable_mapping = self._VariableMapping(sdkroot) expanded_archs = [] for arch in archs: if self.variable_pattern.match(arch): variable = arch try: variable_expansi...
[ "def", "_ExpandArchs", "(", "self", ",", "archs", ",", "sdkroot", ")", ":", "variable_mapping", "=", "self", ".", "_VariableMapping", "(", "sdkroot", ")", "expanded_archs", "=", "[", "]", "for", "arch", "in", "archs", ":", "if", "self", ".", "variable_patt...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py#L63-L79
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/parallel/_cost_model_context.py
python
_CostModelContext.get_costmodel_allreduce_fusion_allreduce_bandwidth
(self)
return self._context_handle.get_costmodel_allreduce_fusion_allreduce_bandwidth()
Get costmodel allreduce fusion allreduce bandwidth. Raises: ValueError: If context handle is none.
Get costmodel allreduce fusion allreduce bandwidth.
[ "Get", "costmodel", "allreduce", "fusion", "allreduce", "bandwidth", "." ]
def get_costmodel_allreduce_fusion_allreduce_bandwidth(self): """ Get costmodel allreduce fusion allreduce bandwidth. Raises: ValueError: If context handle is none. """ if self._context_handle is None: raise ValueError("Context handle is none in context!!...
[ "def", "get_costmodel_allreduce_fusion_allreduce_bandwidth", "(", "self", ")", ":", "if", "self", ".", "_context_handle", "is", "None", ":", "raise", "ValueError", "(", "\"Context handle is none in context!!!\"", ")", "return", "self", ".", "_context_handle", ".", "get_...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/parallel/_cost_model_context.py#L440-L449
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/importSVG.py
python
arccenter2end
(center, rx, ry, angle1, angledelta, xrotation=0.0)
return v1, v2, fa, fs
Calculate start and end points, and flags of an arc. Calculate start and end points, and flags of an arc given in ``center parametrization``. See http://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes Parameters ---------- center : Base::Vector3 Coordinates of the center of the ...
Calculate start and end points, and flags of an arc.
[ "Calculate", "start", "and", "end", "points", "and", "flags", "of", "an", "arc", "." ]
def arccenter2end(center, rx, ry, angle1, angledelta, xrotation=0.0): '''Calculate start and end points, and flags of an arc. Calculate start and end points, and flags of an arc given in ``center parametrization``. See http://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes Parameters --...
[ "def", "arccenter2end", "(", "center", ",", "rx", ",", "ry", ",", "angle1", ",", "angledelta", ",", "xrotation", "=", "0.0", ")", ":", "vr1", "=", "Vector", "(", "rx", "*", "math", ".", "cos", "(", "angle1", ")", ",", "ry", "*", "math", ".", "sin...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/importSVG.py#L473-L512
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Tools/pynche/ColorDB.py
python
ColorDB.find_byrgb
(self, rgbtuple)
Return name for rgbtuple
Return name for rgbtuple
[ "Return", "name", "for", "rgbtuple" ]
def find_byrgb(self, rgbtuple): """Return name for rgbtuple""" try: return self.__byrgb[rgbtuple] except KeyError: raise BadColor(rgbtuple)
[ "def", "find_byrgb", "(", "self", ",", "rgbtuple", ")", ":", "try", ":", "return", "self", ".", "__byrgb", "[", "rgbtuple", "]", "except", "KeyError", ":", "raise", "BadColor", "(", "rgbtuple", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Tools/pynche/ColorDB.py#L86-L91
seqan/seqan
f5f658343c366c9c3d44ba358ffc9317e78a09ed
util/py_lib/clang/cindex.py
python
Type.get_result
(self)
return Type_get_result(self)
Retrieve the result type associated with a function type.
Retrieve the result type associated with a function type.
[ "Retrieve", "the", "result", "type", "associated", "with", "a", "function", "type", "." ]
def get_result(self): """ Retrieve the result type associated with a function type. """ return Type_get_result(self)
[ "def", "get_result", "(", "self", ")", ":", "return", "Type_get_result", "(", "self", ")" ]
https://github.com/seqan/seqan/blob/f5f658343c366c9c3d44ba358ffc9317e78a09ed/util/py_lib/clang/cindex.py#L1088-L1092
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/layers/python/layers/target_column.py
python
_get_default_binary_metrics_for_eval
(thresholds)
return metrics
Returns a dictionary of basic metrics for logistic regression. Args: thresholds: List of floating point thresholds to use for accuracy, precision, and recall metrics. If None, defaults to [0.5]. Returns: Dictionary mapping metrics string names to metrics functions.
Returns a dictionary of basic metrics for logistic regression.
[ "Returns", "a", "dictionary", "of", "basic", "metrics", "for", "logistic", "regression", "." ]
def _get_default_binary_metrics_for_eval(thresholds): """Returns a dictionary of basic metrics for logistic regression. Args: thresholds: List of floating point thresholds to use for accuracy, precision, and recall metrics. If None, defaults to [0.5]. Returns: Dictionary mapping metrics string nam...
[ "def", "_get_default_binary_metrics_for_eval", "(", "thresholds", ")", ":", "metrics", "=", "{", "}", "metrics", "[", "_MetricKeys", ".", "PREDICTION_MEAN", "]", "=", "_predictions_streaming_mean", "metrics", "[", "_MetricKeys", ".", "TARGET_MEAN", "]", "=", "_targe...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/layers/python/layers/target_column.py#L369-L398
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py
python
spawn.__str__
(self)
return '\n'.join(s)
This returns a human-readable string that represents the state of the object.
This returns a human-readable string that represents the state of the object.
[ "This", "returns", "a", "human", "-", "readable", "string", "that", "represents", "the", "state", "of", "the", "object", "." ]
def __str__(self): '''This returns a human-readable string that represents the state of the object. ''' s = [] s.append(repr(self)) s.append('command: ' + str(self.command)) s.append('args: %r' % (self.args,)) s.append('buffer (last 100 chars): %r' % self.buffer[...
[ "def", "__str__", "(", "self", ")", ":", "s", "=", "[", "]", "s", ".", "append", "(", "repr", "(", "self", ")", ")", "s", ".", "append", "(", "'command: '", "+", "str", "(", "self", ".", "command", ")", ")", "s", ".", "append", "(", "'args: %r'...
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py#L207-L237
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/pickle.py
python
_Pickler.clear_memo
(self)
Clears the pickler's "memo". The memo is the data structure that remembers which objects the pickler has already seen, so that shared or recursive objects are pickled by reference and not by value. This method is useful when re-using picklers.
Clears the pickler's "memo".
[ "Clears", "the", "pickler", "s", "memo", "." ]
def clear_memo(self): """Clears the pickler's "memo". The memo is the data structure that remembers which objects the pickler has already seen, so that shared or recursive objects are pickled by reference and not by value. This method is useful when re-using picklers. "...
[ "def", "clear_memo", "(", "self", ")", ":", "self", ".", "memo", ".", "clear", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/pickle.py#L416-L424
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
configs/example/read_config.py
python
ConfigManager.bind_ports
(self, connections)
Bind all ports from the given connection list. Note that the connection list *must* list all connections with both (responder,requestor) and (requestor,responder) orderings
Bind all ports from the given connection list. Note that the connection list *must* list all connections with both (responder,requestor) and (requestor,responder) orderings
[ "Bind", "all", "ports", "from", "the", "given", "connection", "list", ".", "Note", "that", "the", "connection", "list", "*", "must", "*", "list", "all", "connections", "with", "both", "(", "responder", "requestor", ")", "and", "(", "requestor", "responder", ...
def bind_ports(self, connections): """Bind all ports from the given connection list. Note that the connection list *must* list all connections with both (responder,requestor) and (requestor,responder) orderings""" # Markup a dict of how many connections are made to each port. #...
[ "def", "bind_ports", "(", "self", ",", "connections", ")", ":", "# Markup a dict of how many connections are made to each port.", "# This will be used to check that the next-to-be-made connection", "# has a suitable port index", "port_bind_indices", "=", "{", "}", "for", "from_po...
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/configs/example/read_config.py#L293-L347
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/distributions/distribution.py
python
Distribution.arg_constraints
(self)
Returns a dictionary from argument names to :class:`~torch.distributions.constraints.Constraint` objects that should be satisfied by each argument of this distribution. Args that are not tensors need not appear in this dict.
Returns a dictionary from argument names to :class:`~torch.distributions.constraints.Constraint` objects that should be satisfied by each argument of this distribution. Args that are not tensors need not appear in this dict.
[ "Returns", "a", "dictionary", "from", "argument", "names", "to", ":", "class", ":", "~torch", ".", "distributions", ".", "constraints", ".", "Constraint", "objects", "that", "should", "be", "satisfied", "by", "each", "argument", "of", "this", "distribution", "...
def arg_constraints(self) -> Dict[str, constraints.Constraint]: """ Returns a dictionary from argument names to :class:`~torch.distributions.constraints.Constraint` objects that should be satisfied by each argument of this distribution. Args that are not tensors need not appear i...
[ "def", "arg_constraints", "(", "self", ")", "->", "Dict", "[", "str", ",", "constraints", ".", "Constraint", "]", ":", "raise", "NotImplementedError" ]
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributions/distribution.py#L100-L107
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/json/_normalize.py
python
_json_normalize
( data: Union[Dict, List[Dict]], record_path: Optional[Union[str, List]] = None, meta: Optional[Union[str, List[Union[str, List[str]]]]] = None, meta_prefix: Optional[str] = None, record_prefix: Optional[str] = None, errors: Optional[str] = "raise", sep: str = ".", max_level: Optional[in...
return result
Normalize semi-structured JSON data into a flat table. Parameters ---------- data : dict or list of dicts Unserialized JSON objects. record_path : str or list of str, default None Path in each object to list of records. If not passed, data will be assumed to be an array of recor...
Normalize semi-structured JSON data into a flat table.
[ "Normalize", "semi", "-", "structured", "JSON", "data", "into", "a", "flat", "table", "." ]
def _json_normalize( data: Union[Dict, List[Dict]], record_path: Optional[Union[str, List]] = None, meta: Optional[Union[str, List[Union[str, List[str]]]]] = None, meta_prefix: Optional[str] = None, record_prefix: Optional[str] = None, errors: Optional[str] = "raise", sep: str = ".", max...
[ "def", "_json_normalize", "(", "data", ":", "Union", "[", "Dict", ",", "List", "[", "Dict", "]", "]", ",", "record_path", ":", "Optional", "[", "Union", "[", "str", ",", "List", "]", "]", "=", "None", ",", "meta", ":", "Optional", "[", "Union", "["...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/json/_normalize.py#L114-L358
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
example/ctc/lstm.py
python
_add_ctc_loss
(pred, seq_len, num_label, loss_type)
return sm
Adds CTC loss on top of pred symbol and returns the resulting symbol
Adds CTC loss on top of pred symbol and returns the resulting symbol
[ "Adds", "CTC", "loss", "on", "top", "of", "pred", "symbol", "and", "returns", "the", "resulting", "symbol" ]
def _add_ctc_loss(pred, seq_len, num_label, loss_type): """ Adds CTC loss on top of pred symbol and returns the resulting symbol """ label = mx.sym.Variable('label') if loss_type == 'warpctc': print("Using WarpCTC Loss") sm = _add_warp_ctc_loss(pred, seq_len, num_label, label) else: ...
[ "def", "_add_ctc_loss", "(", "pred", ",", "seq_len", ",", "num_label", ",", "loss_type", ")", ":", "label", "=", "mx", ".", "sym", ".", "Variable", "(", "'label'", ")", "if", "loss_type", "==", "'warpctc'", ":", "print", "(", "\"Using WarpCTC Loss\"", ")",...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/ctc/lstm.py#L116-L126
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/tools/grit/grit/node/misc.py
python
GritNode.RunGatherers
(self, debug=False)
Call RunPreSubstitutionGatherer() on every node of the tree, then apply substitutions, then call RunPostSubstitutionGatherer() on every node. The substitutions step requires that the output language has been set. Locally, get the Substitution messages and add them to the substituter. Also add substitut...
Call RunPreSubstitutionGatherer() on every node of the tree, then apply substitutions, then call RunPostSubstitutionGatherer() on every node.
[ "Call", "RunPreSubstitutionGatherer", "()", "on", "every", "node", "of", "the", "tree", "then", "apply", "substitutions", "then", "call", "RunPostSubstitutionGatherer", "()", "on", "every", "node", "." ]
def RunGatherers(self, debug=False): '''Call RunPreSubstitutionGatherer() on every node of the tree, then apply substitutions, then call RunPostSubstitutionGatherer() on every node. The substitutions step requires that the output language has been set. Locally, get the Substitution messages and add the...
[ "def", "RunGatherers", "(", "self", ",", "debug", "=", "False", ")", ":", "for", "node", "in", "self", ".", "ActiveDescendants", "(", ")", ":", "if", "hasattr", "(", "node", ",", "'RunPreSubstitutionGatherer'", ")", ":", "with", "node", ":", "node", ".",...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/tools/grit/grit/node/misc.py#L660-L682
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exomerge3.py
python
ExodusModel._exists_on_entity_warning
(self, name, entity, base_name, base_entity)
Warn the user something already exists on a given entity.
Warn the user something already exists on a given entity.
[ "Warn", "the", "user", "something", "already", "exists", "on", "a", "given", "entity", "." ]
def _exists_on_entity_warning(self, name, entity, base_name, base_entity): """Warn the user something already exists on a given entity.""" self._warning( entity[0].upper() + entity[1:] + ' already exists.', 'The specified %s "%s" already exists on %s %s. Information may ' ...
[ "def", "_exists_on_entity_warning", "(", "self", ",", "name", ",", "entity", ",", "base_name", ",", "base_entity", ")", ":", "self", ".", "_warning", "(", "entity", "[", "0", "]", ".", "upper", "(", ")", "+", "entity", "[", "1", ":", "]", "+", "' alr...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge3.py#L6006-L6012
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/stc.py
python
StyledTextCtrl.AddTextUTF8
(self, text)
Add UTF8 encoded text to the document at the current position. Works 'natively' in a unicode build of wxPython, and will also work in an ansi build if the UTF8 text is compatible with the current encoding.
Add UTF8 encoded text to the document at the current position. Works 'natively' in a unicode build of wxPython, and will also work in an ansi build if the UTF8 text is compatible with the current encoding.
[ "Add", "UTF8", "encoded", "text", "to", "the", "document", "at", "the", "current", "position", ".", "Works", "natively", "in", "a", "unicode", "build", "of", "wxPython", "and", "will", "also", "work", "in", "an", "ansi", "build", "if", "the", "UTF8", "te...
def AddTextUTF8(self, text): """ Add UTF8 encoded text to the document at the current position. Works 'natively' in a unicode build of wxPython, and will also work in an ansi build if the UTF8 text is compatible with the current encoding. """ if not wx.USE_UNICODE...
[ "def", "AddTextUTF8", "(", "self", ",", "text", ")", ":", "if", "not", "wx", ".", "USE_UNICODE", ":", "u", "=", "text", ".", "decode", "(", "'utf-8'", ")", "text", "=", "u", ".", "encode", "(", "wx", ".", "GetDefaultPyEncoding", "(", ")", ")", "sel...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L6778-L6788
MegEngine/MegEngine
ce9ad07a27ec909fb8db4dd67943d24ba98fb93a
imperative/python/megengine/utils/http_download.py
python
download_from_url
(url: str, dst: str)
return smart_getmd5(dst)
r"""Downloads file from given url to ``dst``. Args: url: source URL. dst: saving path.
r"""Downloads file from given url to ``dst``.
[ "r", "Downloads", "file", "from", "given", "url", "to", "dst", "." ]
def download_from_url(url: str, dst: str): r"""Downloads file from given url to ``dst``. Args: url: source URL. dst: saving path. """ dst = os.path.expanduser(dst) smart_copy(url, dst, callback=Bar(total=smart_getsize(url))) return smart_getmd5(dst)
[ "def", "download_from_url", "(", "url", ":", "str", ",", "dst", ":", "str", ")", ":", "dst", "=", "os", ".", "path", ".", "expanduser", "(", "dst", ")", "smart_copy", "(", "url", ",", "dst", ",", "callback", "=", "Bar", "(", "total", "=", "smart_ge...
https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/utils/http_download.py#L38-L47
naver/sling
5671cd445a2caae0b4dd0332299e4cfede05062c
webkit/Tools/Scripts/webkitpy/thirdparty/irc/ircbot.py
python
Channel.users
(self)
return self.userdict.keys()
Returns an unsorted list of the channel's users.
Returns an unsorted list of the channel's users.
[ "Returns", "an", "unsorted", "list", "of", "the", "channel", "s", "users", "." ]
def users(self): """Returns an unsorted list of the channel's users.""" return self.userdict.keys()
[ "def", "users", "(", "self", ")", ":", "return", "self", ".", "userdict", ".", "keys", "(", ")" ]
https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/thirdparty/irc/ircbot.py#L323-L325
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
ScrollWinEvent.GetPosition
(*args, **kwargs)
return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
GetPosition(self) -> int Returns the position of the scrollbar for the thumb track and release events. Note that this field can't be used for the other events, you need to query the window itself for the current position in that case.
GetPosition(self) -> int
[ "GetPosition", "(", "self", ")", "-", ">", "int" ]
def GetPosition(*args, **kwargs): """ GetPosition(self) -> int Returns the position of the scrollbar for the thumb track and release events. Note that this field can't be used for the other events, you need to query the window itself for the current position in that case. ...
[ "def", "GetPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "ScrollWinEvent_GetPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L5483-L5491
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
DateTime.SetSecond
(*args, **kwargs)
return _misc_.DateTime_SetSecond(*args, **kwargs)
SetSecond(self, int second) -> DateTime
SetSecond(self, int second) -> DateTime
[ "SetSecond", "(", "self", "int", "second", ")", "-", ">", "DateTime" ]
def SetSecond(*args, **kwargs): """SetSecond(self, int second) -> DateTime""" return _misc_.DateTime_SetSecond(*args, **kwargs)
[ "def", "SetSecond", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DateTime_SetSecond", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L3837-L3839
macchina-io/macchina.io
ef24ba0e18379c3dd48fb84e6dbf991101cb8db0
platform/JS/V8/tools/gyp/pylib/gyp/MSVSVersion.py
python
VisualStudioVersion.SolutionVersion
(self)
return self.solution_version
Get the version number of the sln files.
Get the version number of the sln files.
[ "Get", "the", "version", "number", "of", "the", "sln", "files", "." ]
def SolutionVersion(self): """Get the version number of the sln files.""" return self.solution_version
[ "def", "SolutionVersion", "(", "self", ")", ":", "return", "self", ".", "solution_version" ]
https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/tools/gyp/pylib/gyp/MSVSVersion.py#L46-L48
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/ConfigParser.py
python
ConfigParser.items
(self, section, raw=False, vars=None)
Return a list of tuples with (name, value) for each option in the section. All % interpolations are expanded in the return values, based on the defaults passed into the constructor, unless the optional argument `raw' is true. Additional substitutions may be provided using the `...
Return a list of tuples with (name, value) for each option in the section.
[ "Return", "a", "list", "of", "tuples", "with", "(", "name", "value", ")", "for", "each", "option", "in", "the", "section", "." ]
def items(self, section, raw=False, vars=None): """Return a list of tuples with (name, value) for each option in the section. All % interpolations are expanded in the return values, based on the defaults passed into the constructor, unless the optional argument `raw' is true. A...
[ "def", "items", "(", "self", ",", "section", ",", "raw", "=", "False", ",", "vars", "=", "None", ")", ":", "d", "=", "self", ".", "_defaults", ".", "copy", "(", ")", "try", ":", "d", ".", "update", "(", "self", ".", "_sections", "[", "section", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/ConfigParser.py#L625-L655
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/mailbox.py
python
_singlefileMailbox.__len__
(self)
return len(self._toc)
Return a count of messages in the mailbox.
Return a count of messages in the mailbox.
[ "Return", "a", "count", "of", "messages", "in", "the", "mailbox", "." ]
def __len__(self): """Return a count of messages in the mailbox.""" self._lookup() return len(self._toc)
[ "def", "__len__", "(", "self", ")", ":", "self", ".", "_lookup", "(", ")", "return", "len", "(", "self", ".", "_toc", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/mailbox.py#L632-L635
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/form-largest-integer-with-digits-that-add-up-to-target.py
python
Solution.largestNumber
(self, cost, target)
return "".join(map(str, result))
:type cost: List[int] :type target: int :rtype: str
:type cost: List[int] :type target: int :rtype: str
[ ":", "type", "cost", ":", "List", "[", "int", "]", ":", "type", "target", ":", "int", ":", "rtype", ":", "str" ]
def largestNumber(self, cost, target): """ :type cost: List[int] :type target: int :rtype: str """ dp = [0] for t in xrange(1, target+1): dp.append(-1) for i, c in enumerate(cost): if t-c < 0 or dp[t-c] < 0: ...
[ "def", "largestNumber", "(", "self", ",", "cost", ",", "target", ")", ":", "dp", "=", "[", "0", "]", "for", "t", "in", "xrange", "(", "1", ",", "target", "+", "1", ")", ":", "dp", ".", "append", "(", "-", "1", ")", "for", "i", ",", "c", "in...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/form-largest-integer-with-digits-that-add-up-to-target.py#L5-L25
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/_pyio.py
python
BytesIO.getvalue
(self)
return bytes(self._buffer)
Return the bytes value (contents) of the buffer
Return the bytes value (contents) of the buffer
[ "Return", "the", "bytes", "value", "(", "contents", ")", "of", "the", "buffer" ]
def getvalue(self): """Return the bytes value (contents) of the buffer """ if self.closed: raise ValueError("getvalue on closed file") return bytes(self._buffer)
[ "def", "getvalue", "(", "self", ")", ":", "if", "self", ".", "closed", ":", "raise", "ValueError", "(", "\"getvalue on closed file\"", ")", "return", "bytes", "(", "self", ".", "_buffer", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/_pyio.py#L858-L863
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/distutils/misc_util.py
python
default_config_dict
(name = None, parent_name = None, local_path=None)
return c.todict()
Return a configuration dictionary for usage in configuration() function defined in file setup_<name>.py.
Return a configuration dictionary for usage in configuration() function defined in file setup_<name>.py.
[ "Return", "a", "configuration", "dictionary", "for", "usage", "in", "configuration", "()", "function", "defined", "in", "file", "setup_<name", ">", ".", "py", "." ]
def default_config_dict(name = None, parent_name = None, local_path=None): """Return a configuration dictionary for usage in configuration() function defined in file setup_<name>.py. """ import warnings warnings.warn('Use Configuration(%r,%r,top_path=%r) instead of '\ 'deprecated d...
[ "def", "default_config_dict", "(", "name", "=", "None", ",", "parent_name", "=", "None", ",", "local_path", "=", "None", ")", ":", "import", "warnings", "warnings", ".", "warn", "(", "'Use Configuration(%r,%r,top_path=%r) instead of '", "'deprecated default_config_dict(...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/distutils/misc_util.py#L2220-L2231
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py
python
PanedWindow.proxy_coord
(self)
return self.proxy("coord")
Return the x and y pair of the most recent proxy location
Return the x and y pair of the most recent proxy location
[ "Return", "the", "x", "and", "y", "pair", "of", "the", "most", "recent", "proxy", "location" ]
def proxy_coord(self): """Return the x and y pair of the most recent proxy location """ return self.proxy("coord")
[ "def", "proxy_coord", "(", "self", ")", ":", "return", "self", ".", "proxy", "(", "\"coord\"", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L3850-L3853
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/sparse/linalg/isolve/iterative.py
python
qmr
(A, b, x0=None, tol=1e-5, maxiter=None, M1=None, M2=None, callback=None, atol=None)
return postprocess(x), info
Use Quasi-Minimal Residual iteration to solve ``Ax = b``. Parameters ---------- A : {sparse matrix, dense matrix, LinearOperator} The real-valued N-by-N matrix of the linear system. It is required that the linear operator can produce ``Ax`` and ``A^T x``. b : {array, matrix} ...
Use Quasi-Minimal Residual iteration to solve ``Ax = b``.
[ "Use", "Quasi", "-", "Minimal", "Residual", "iteration", "to", "solve", "Ax", "=", "b", "." ]
def qmr(A, b, x0=None, tol=1e-5, maxiter=None, M1=None, M2=None, callback=None, atol=None): """Use Quasi-Minimal Residual iteration to solve ``Ax = b``. Parameters ---------- A : {sparse matrix, dense matrix, LinearOperator} The real-valued N-by-N matrix of the linear system. It...
[ "def", "qmr", "(", "A", ",", "b", ",", "x0", "=", "None", ",", "tol", "=", "1e-5", ",", "maxiter", "=", "None", ",", "M1", "=", "None", ",", "M2", "=", "None", ",", "callback", "=", "None", ",", "atol", "=", "None", ")", ":", "A_", "=", "A"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/sparse/linalg/isolve/iterative.py#L603-L753
toggl-open-source/toggldesktop
91865205885531cc8fd9e8d613dad49d625d56e7
third_party/cpplint/cpplint.py
python
_IncludeState.IsInAlphabeticalOrder
(self, clean_lines, linenum, header_path)
return True
Check if a header is in alphabetical order with the previous header. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. header_path: Canonicalized header to be checked. Returns: Returns true if the header is in alphabetical order.
Check if a header is in alphabetical order with the previous header.
[ "Check", "if", "a", "header", "is", "in", "alphabetical", "order", "with", "the", "previous", "header", "." ]
def IsInAlphabeticalOrder(self, clean_lines, linenum, header_path): """Check if a header is in alphabetical order with the previous header. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. header_path: Canonicalized header to be checke...
[ "def", "IsInAlphabeticalOrder", "(", "self", ",", "clean_lines", ",", "linenum", ",", "header_path", ")", ":", "# If previous section is different from current section, _last_header will", "# be reset to empty string, so it's always less than current header.", "#", "# If previous line ...
https://github.com/toggl-open-source/toggldesktop/blob/91865205885531cc8fd9e8d613dad49d625d56e7/third_party/cpplint/cpplint.py#L682-L701
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/experiment.py
python
Experiment.train_and_evaluate
(self)
Interleaves training and evaluation. The frequency of evaluation is controlled by the constructor arg `min_eval_frequency`. When this parameter is 0, evaluation happens only after training has completed. Note that evaluation cannot happen more frequently than checkpoints are taken. If no new snapshots ...
Interleaves training and evaluation.
[ "Interleaves", "training", "and", "evaluation", "." ]
def train_and_evaluate(self): """Interleaves training and evaluation. The frequency of evaluation is controlled by the constructor arg `min_eval_frequency`. When this parameter is 0, evaluation happens only after training has completed. Note that evaluation cannot happen more frequently than checkp...
[ "def", "train_and_evaluate", "(", "self", ")", ":", "# The directory to which evaluation summaries are written are determined", "# by adding a suffix to 'eval'; that suffix is the 'name' parameter to", "# the various evaluate(...) methods. By setting it to None, we force", "# the directory name to...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/experiment.py#L595-L689
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mailbox.py
python
_singlefileMailbox.add
(self, message)
return self._next_key - 1
Add message and return assigned key.
Add message and return assigned key.
[ "Add", "message", "and", "return", "assigned", "key", "." ]
def add(self, message): """Add message and return assigned key.""" self._lookup() self._toc[self._next_key] = self._append_message(message) self._next_key += 1 # _append_message appends the message to the mailbox file. We # don't need a full rewrite + rename, sync is enou...
[ "def", "add", "(", "self", ",", "message", ")", ":", "self", ".", "_lookup", "(", ")", "self", ".", "_toc", "[", "self", ".", "_next_key", "]", "=", "self", ".", "_append_message", "(", "message", ")", "self", ".", "_next_key", "+=", "1", "# _append_...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mailbox.py#L584-L592
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryILL_common.py
python
WSCleanup._delete
(self, ws)
Delete the given workspace in ws if it is not protected, and deletion is actually turned on.
Delete the given workspace in ws if it is not protected, and deletion is actually turned on.
[ "Delete", "the", "given", "workspace", "in", "ws", "if", "it", "is", "not", "protected", "and", "deletion", "is", "actually", "turned", "on", "." ]
def _delete(self, ws): """Delete the given workspace in ws if it is not protected, and deletion is actually turned on. """ if not self._doDelete: return try: ws = str(ws) except RuntimeError: return if ws not in self._protected ...
[ "def", "_delete", "(", "self", ",", "ws", ")", ":", "if", "not", "self", ".", "_doDelete", ":", "return", "try", ":", "ws", "=", "str", "(", "ws", ")", "except", "RuntimeError", ":", "return", "if", "ws", "not", "in", "self", ".", "_protected", "an...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryILL_common.py#L229-L240
QMCPACK/qmcpack
d0948ab455e38364458740cc8e2239600a14c5cd
nexus/lib/versions.py
python
Versions.write_available_versions
(self,status=True,opt_req=False)
return s
(`Internal API`) Write information about versions of Nexus dependencies that are available on the current machine.
(`Internal API`) Write information about versions of Nexus dependencies that are available on the current machine.
[ "(", "Internal", "API", ")", "Write", "information", "about", "versions", "of", "Nexus", "dependencies", "that", "are", "available", "on", "the", "current", "machine", "." ]
def write_available_versions(self,status=True,opt_req=False): """ (`Internal API`) Write information about versions of Nexus dependencies that are available on the current machine. """ available_versions = self.dependency_version s = '\nNexus dependencies available on current mac...
[ "def", "write_available_versions", "(", "self", ",", "status", "=", "True", ",", "opt_req", "=", "False", ")", ":", "available_versions", "=", "self", ".", "dependency_version", "s", "=", "'\\nNexus dependencies available on current machine:\\n'", ".", "format", "(", ...
https://github.com/QMCPACK/qmcpack/blob/d0948ab455e38364458740cc8e2239600a14c5cd/nexus/lib/versions.py#L658-L693
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/sframe/data_structures/sarray.py
python
SArray.__iter__
(self)
return generator()
Provides an iterator to the contents of the array.
Provides an iterator to the contents of the array.
[ "Provides", "an", "iterator", "to", "the", "contents", "of", "the", "array", "." ]
def __iter__(self): """ Provides an iterator to the contents of the array. """ def generator(): elems_at_a_time = 262144 self.__proxy__.begin_iterator() ret = self.__proxy__.iterator_get_next(elems_at_a_time) while(True): fo...
[ "def", "__iter__", "(", "self", ")", ":", "def", "generator", "(", ")", ":", "elems_at_a_time", "=", "262144", "self", ".", "__proxy__", ".", "begin_iterator", "(", ")", "ret", "=", "self", ".", "__proxy__", ".", "iterator_get_next", "(", "elems_at_a_time", ...
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/sarray.py#L770-L787
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py
python
Writer._GetSpecForConfiguration
(self, config_type, config_name, attrs, tools)
return specification
Returns the specification for a configuration. Args: config_type: Type of configuration node. config_name: Configuration name. attrs: Dict of configuration attributes; may be None. tools: List of tools (strings or Tool objects); may be None. Returns:
Returns the specification for a configuration.
[ "Returns", "the", "specification", "for", "a", "configuration", "." ]
def _GetSpecForConfiguration(self, config_type, config_name, attrs, tools): """Returns the specification for a configuration. Args: config_type: Type of configuration node. config_name: Configuration name. attrs: Dict of configuration attributes; may be None. tools: List of tools (strin...
[ "def", "_GetSpecForConfiguration", "(", "self", ",", "config_type", ",", "config_name", ",", "attrs", ",", "tools", ")", ":", "# Handle defaults", "if", "not", "attrs", ":", "attrs", "=", "{", "}", "if", "not", "tools", ":", "tools", "=", "[", "]", "# Ad...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py#L92-L120
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/_extends/parallel_compile/tbe_compiler/tbe_adapter.py
python
__creating_default_custom_path
(auto_tiling_mode, base_custom_path)
return True
Create default custom path
Create default custom path
[ "Create", "default", "custom", "path" ]
def __creating_default_custom_path(auto_tiling_mode, base_custom_path): """ Create default custom path """ base_custom_path = __directory_creation(base_custom_path, "data") tune_flag = [] if "RL" in auto_tiling_mode: tune_flag.append("rl") if "GA" in auto_tiling_mode: tune_fl...
[ "def", "__creating_default_custom_path", "(", "auto_tiling_mode", ",", "base_custom_path", ")", ":", "base_custom_path", "=", "__directory_creation", "(", "base_custom_path", ",", "\"data\"", ")", "tune_flag", "=", "[", "]", "if", "\"RL\"", "in", "auto_tiling_mode", "...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_extends/parallel_compile/tbe_compiler/tbe_adapter.py#L161-L177
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_gdi.py
python
PseudoDC.DrawRectangle
(*args, **kwargs)
return _gdi_.PseudoDC_DrawRectangle(*args, **kwargs)
DrawRectangle(self, int x, int y, int width, int height) Draws a rectangle with the given top left corner, and with the given size. The current pen is used for the outline and the current brush for filling the shape.
DrawRectangle(self, int x, int y, int width, int height)
[ "DrawRectangle", "(", "self", "int", "x", "int", "y", "int", "width", "int", "height", ")" ]
def DrawRectangle(*args, **kwargs): """ DrawRectangle(self, int x, int y, int width, int height) Draws a rectangle with the given top left corner, and with the given size. The current pen is used for the outline and the current brush for filling the shape. """ re...
[ "def", "DrawRectangle", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "PseudoDC_DrawRectangle", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L7912-L7920
freeorion/freeorion
c266a40eccd3a99a17de8fe57c36ef6ba3771665
default/python/universe_generation/starnames.py
python
cluster_stars
(positions, num_star_groups)
return clusters[1 - old_c]
Returns a list, same size as positions argument, containing indices from 0 to num_star_groups.
Returns a list, same size as positions argument, containing indices from 0 to num_star_groups.
[ "Returns", "a", "list", "same", "size", "as", "positions", "argument", "containing", "indices", "from", "0", "to", "num_star_groups", "." ]
def cluster_stars(positions, num_star_groups): """ Returns a list, same size as positions argument, containing indices from 0 to num_star_groups. """ if num_star_groups > len(positions): return [[pos] for pos in positions] centers = [[pos[0], pos[1]] for pos in random.sample(positions, num_...
[ "def", "cluster_stars", "(", "positions", ",", "num_star_groups", ")", ":", "if", "num_star_groups", ">", "len", "(", "positions", ")", ":", "return", "[", "[", "pos", "]", "for", "pos", "in", "positions", "]", "centers", "=", "[", "[", "pos", "[", "0"...
https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/universe_generation/starnames.py#L75-L97
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
chrome/common/extensions/docs/examples/apps/hello-python/oauth2/__init__.py
python
Request.from_request
(cls, http_method, http_url, headers=None, parameters=None, query_string=None)
return None
Combines multiple parameter sources.
Combines multiple parameter sources.
[ "Combines", "multiple", "parameter", "sources", "." ]
def from_request(cls, http_method, http_url, headers=None, parameters=None, query_string=None): """Combines multiple parameter sources.""" if parameters is None: parameters = {} # Headers if headers and 'Authorization' in headers: auth_header = heade...
[ "def", "from_request", "(", "cls", ",", "http_method", ",", "http_url", ",", "headers", "=", "None", ",", "parameters", "=", "None", ",", "query_string", "=", "None", ")", ":", "if", "parameters", "is", "None", ":", "parameters", "=", "{", "}", "# Header...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/chrome/common/extensions/docs/examples/apps/hello-python/oauth2/__init__.py#L417-L450
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/view/DrillView.py
python
DrillView.showExportDialog
(self)
Open the export dialog.
Open the export dialog.
[ "Open", "the", "export", "dialog", "." ]
def showExportDialog(self): """ Open the export dialog. """ self.setDisabled(True) dialog = DrillExportDialog(self) dialog.finished.connect( lambda : self.setDisabled(False) ) self._presenter.onShowExportDialog(dialog) dialo...
[ "def", "showExportDialog", "(", "self", ")", ":", "self", ".", "setDisabled", "(", "True", ")", "dialog", "=", "DrillExportDialog", "(", "self", ")", "dialog", ".", "finished", ".", "connect", "(", "lambda", ":", "self", ".", "setDisabled", "(", "False", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/view/DrillView.py#L445-L455
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/queue.py
python
_PySimpleQueue.get_nowait
(self)
return self.get(block=False)
Remove and return an item from the queue without blocking. Only get an item if one is immediately available. Otherwise raise the Empty exception.
Remove and return an item from the queue without blocking.
[ "Remove", "and", "return", "an", "item", "from", "the", "queue", "without", "blocking", "." ]
def get_nowait(self): '''Remove and return an item from the queue without blocking. Only get an item if one is immediately available. Otherwise raise the Empty exception. ''' return self.get(block=False)
[ "def", "get_nowait", "(", "self", ")", ":", "return", "self", ".", "get", "(", "block", "=", "False", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/queue.py#L303-L309
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/checkpoint_management.py
python
update_checkpoint_state
(save_dir, model_checkpoint_path, all_model_checkpoint_paths=None, latest_filename=None, all_model_checkpoint_timestamps=None, last_preserved_timestamp=None)
Updates the content of the 'checkpoint' file. This updates the checkpoint file containing a CheckpointState proto. Args: save_dir: Directory where the model was saved. model_checkpoint_path: The checkpoint file. all_model_checkpoint_paths: List of strings. Paths to all not-yet-deleted checkpo...
Updates the content of the 'checkpoint' file.
[ "Updates", "the", "content", "of", "the", "checkpoint", "file", "." ]
def update_checkpoint_state(save_dir, model_checkpoint_path, all_model_checkpoint_paths=None, latest_filename=None, all_model_checkpoint_timestamps=None, last_preserved_timestamp=N...
[ "def", "update_checkpoint_state", "(", "save_dir", ",", "model_checkpoint_path", ",", "all_model_checkpoint_paths", "=", "None", ",", "latest_filename", "=", "None", ",", "all_model_checkpoint_timestamps", "=", "None", ",", "last_preserved_timestamp", "=", "None", ")", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/checkpoint_management.py#L129-L167
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/_vendor/pyparsing.py
python
ParserElement.leaveWhitespace
( self )
return self
Disables the skipping of whitespace before matching the characters in the C{ParserElement}'s defined pattern. This is normally only used internally by the pyparsing module, but may be needed in some whitespace-sensitive grammars.
Disables the skipping of whitespace before matching the characters in the C{ParserElement}'s defined pattern. This is normally only used internally by the pyparsing module, but may be needed in some whitespace-sensitive grammars.
[ "Disables", "the", "skipping", "of", "whitespace", "before", "matching", "the", "characters", "in", "the", "C", "{", "ParserElement", "}", "s", "defined", "pattern", ".", "This", "is", "normally", "only", "used", "internally", "by", "the", "pyparsing", "module...
def leaveWhitespace( self ): """ Disables the skipping of whitespace before matching the characters in the C{ParserElement}'s defined pattern. This is normally only used internally by the pyparsing module, but may be needed in some whitespace-sensitive grammars. """ self...
[ "def", "leaveWhitespace", "(", "self", ")", ":", "self", ".", "skipWhitespace", "=", "False", "return", "self" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/_vendor/pyparsing.py#L2052-L2059
bairdzhang/smallhardface
76fa1d87a9602d9b13d7a7fe693fc7aec91cab80
caffe/python/caffe/pycaffe.py
python
_Net_backward
(self, diffs=None, start=None, end=None, **kwargs)
return {out: self.blobs[out].diff for out in outputs}
Backward pass: prepare diffs and run the net backward. Parameters ---------- diffs : list of diffs to return in addition to bottom diffs. kwargs : Keys are output blob names and values are diff ndarrays. If None, top diffs are taken from forward loss. start : optional name of layer at w...
Backward pass: prepare diffs and run the net backward.
[ "Backward", "pass", ":", "prepare", "diffs", "and", "run", "the", "net", "backward", "." ]
def _Net_backward(self, diffs=None, start=None, end=None, **kwargs): """ Backward pass: prepare diffs and run the net backward. Parameters ---------- diffs : list of diffs to return in addition to bottom diffs. kwargs : Keys are output blob names and values are diff ndarrays. If Non...
[ "def", "_Net_backward", "(", "self", ",", "diffs", "=", "None", ",", "start", "=", "None", ",", "end", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "diffs", "is", "None", ":", "diffs", "=", "[", "]", "if", "start", "is", "not", "None", ...
https://github.com/bairdzhang/smallhardface/blob/76fa1d87a9602d9b13d7a7fe693fc7aec91cab80/caffe/python/caffe/pycaffe.py#L137-L182
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
SimCalorimetry/HGCalSimAlgos/python/hgcSensorOpParams_cfi.py
python
hgcSiSensorIleak
(version)
this method returns different parameterizations of the leakage current for different versions TDR_{600V,800V} - TDR based parameterizations for operations at -30C and 600V or 800V CERN21_{600V,800V}_{annealing} - 2021 CERN-based parameterizations for operations at -30C, 600V or 800V and different annealing time...
this method returns different parameterizations of the leakage current for different versions TDR_{600V,800V} - TDR based parameterizations for operations at -30C and 600V or 800V CERN21_{600V,800V}_{annealing} - 2021 CERN-based parameterizations for operations at -30C, 600V or 800V and different annealing time...
[ "this", "method", "returns", "different", "parameterizations", "of", "the", "leakage", "current", "for", "different", "versions", "TDR_", "{", "600V", "800V", "}", "-", "TDR", "based", "parameterizations", "for", "operations", "at", "-", "30C", "and", "600V", ...
def hgcSiSensorIleak(version): """ this method returns different parameterizations of the leakage current for different versions TDR_{600V,800V} - TDR based parameterizations for operations at -30C and 600V or 800V CERN21_{600V,800V}_{annealing} - 2021 CERN-based parameterizations for operations at -3...
[ "def", "hgcSiSensorIleak", "(", "version", ")", ":", "if", "version", "==", "'TDR_600V'", ":", "return", "[", "0.993", ",", "-", "42.668", "]", "elif", "version", "==", "'TDR_800V'", ":", "return", "[", "0.996", ",", "-", "42.464", "]", "elif", "version"...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/SimCalorimetry/HGCalSimAlgos/python/hgcSensorOpParams_cfi.py#L3-L33
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tarfile.py
python
TarFile.makeunknown
(self, tarinfo, targetpath)
Make a file from a TarInfo object with an unknown type at targetpath.
Make a file from a TarInfo object with an unknown type at targetpath.
[ "Make", "a", "file", "from", "a", "TarInfo", "object", "with", "an", "unknown", "type", "at", "targetpath", "." ]
def makeunknown(self, tarinfo, targetpath): """Make a file from a TarInfo object with an unknown type at targetpath. """ self.makefile(tarinfo, targetpath) self._dbg(1, "tarfile: Unknown file type %r, " \ "extracted as regular file." % tarinfo.type)
[ "def", "makeunknown", "(", "self", ",", "tarinfo", ",", "targetpath", ")", ":", "self", ".", "makefile", "(", "tarinfo", ",", "targetpath", ")", "self", ".", "_dbg", "(", "1", ",", "\"tarfile: Unknown file type %r, \"", "\"extracted as regular file.\"", "%", "ta...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tarfile.py#L2165-L2171
microsoft/EdgeML
ef9f8a77f096acbdeb941014791f8eda1c1bc35b
tf/edgeml_tf/utils.py
python
countnnZ
(A, s, bytesPerVar=4)
Returns # of non-zeros and representative size of the tensor Uses dense for s >= 0.5 - 4 byte Else uses sparse - 8 byte
Returns # of non-zeros and representative size of the tensor Uses dense for s >= 0.5 - 4 byte Else uses sparse - 8 byte
[ "Returns", "#", "of", "non", "-", "zeros", "and", "representative", "size", "of", "the", "tensor", "Uses", "dense", "for", "s", ">", "=", "0", ".", "5", "-", "4", "byte", "Else", "uses", "sparse", "-", "8", "byte" ]
def countnnZ(A, s, bytesPerVar=4): ''' Returns # of non-zeros and representative size of the tensor Uses dense for s >= 0.5 - 4 byte Else uses sparse - 8 byte ''' params = 1 hasSparse = False for i in range(0, len(A.shape)): params *= int(A.shape[i]) if s < 0.5: nnZ =...
[ "def", "countnnZ", "(", "A", ",", "s", ",", "bytesPerVar", "=", "4", ")", ":", "params", "=", "1", "hasSparse", "=", "False", "for", "i", "in", "range", "(", "0", ",", "len", "(", "A", ".", "shape", ")", ")", ":", "params", "*=", "int", "(", ...
https://github.com/microsoft/EdgeML/blob/ef9f8a77f096acbdeb941014791f8eda1c1bc35b/tf/edgeml_tf/utils.py#L124-L140
SpenceKonde/megaTinyCore
1c4a70b18a149fe6bcb551dfa6db11ca50b8997b
megaavr/tools/libs/pyedbglib/hidtransport/cyhidapi.py
python
CyHidApiTransport.hid_read
(self)
return bytearray(response)
Reads HID data :return: data read
Reads HID data
[ "Reads", "HID", "data" ]
def hid_read(self): """ Reads HID data :return: data read """ self.logger.debug("HID::read") if self.blocking: response = self.hid_device.read(self.device.packet_size) else: response = [] while not response: # T...
[ "def", "hid_read", "(", "self", ")", ":", "self", ".", "logger", ".", "debug", "(", "\"HID::read\"", ")", "if", "self", ".", "blocking", ":", "response", "=", "self", ".", "hid_device", ".", "read", "(", "self", ".", "device", ".", "packet_size", ")", ...
https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/pyedbglib/hidtransport/cyhidapi.py#L143-L158
Constellation/iv
64c3a9c7c517063f29d90d449180ea8f6f4d946f
tools/cpplint.py
python
GetLineWidth
(line)
Determines the width of the line in column positions. Args: line: A string, which may be a Unicode string. Returns: The width of the line in column positions, accounting for Unicode combining characters and wide characters.
Determines the width of the line in column positions.
[ "Determines", "the", "width", "of", "the", "line", "in", "column", "positions", "." ]
def GetLineWidth(line): """Determines the width of the line in column positions. Args: line: A string, which may be a Unicode string. Returns: The width of the line in column positions, accounting for Unicode combining characters and wide characters. """ if isinstance(line, unicode): width =...
[ "def", "GetLineWidth", "(", "line", ")", ":", "if", "isinstance", "(", "line", ",", "unicode", ")", ":", "width", "=", "0", "for", "uc", "in", "unicodedata", ".", "normalize", "(", "'NFC'", ",", "line", ")", ":", "if", "unicodedata", ".", "east_asian_w...
https://github.com/Constellation/iv/blob/64c3a9c7c517063f29d90d449180ea8f6f4d946f/tools/cpplint.py#L3325-L3344
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
SplitterWindow.IsSashInvisible
(*args, **kwargs)
return _windows_.SplitterWindow_IsSashInvisible(*args, **kwargs)
IsSashInvisible(self) -> bool
IsSashInvisible(self) -> bool
[ "IsSashInvisible", "(", "self", ")", "-", ">", "bool" ]
def IsSashInvisible(*args, **kwargs): """IsSashInvisible(self) -> bool""" return _windows_.SplitterWindow_IsSashInvisible(*args, **kwargs)
[ "def", "IsSashInvisible", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "SplitterWindow_IsSashInvisible", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L1639-L1641
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/linalg/interpolative.py
python
svd
(A, eps_or_k, rand=True)
return U, S, V
Compute SVD of a matrix via an ID. An SVD of a matrix `A` is a factorization:: A = numpy.dot(U, numpy.dot(numpy.diag(S), V.conj().T)) where `U` and `V` have orthonormal columns and `S` is nonnegative. The SVD can be computed to any relative precision or rank (depending on the value of `eps_o...
Compute SVD of a matrix via an ID.
[ "Compute", "SVD", "of", "a", "matrix", "via", "an", "ID", "." ]
def svd(A, eps_or_k, rand=True): """ Compute SVD of a matrix via an ID. An SVD of a matrix `A` is a factorization:: A = numpy.dot(U, numpy.dot(numpy.diag(S), V.conj().T)) where `U` and `V` have orthonormal columns and `S` is nonnegative. The SVD can be computed to any relative precision ...
[ "def", "svd", "(", "A", ",", "eps_or_k", ",", "rand", "=", "True", ")", ":", "from", "scipy", ".", "sparse", ".", "linalg", "import", "LinearOperator", "real", "=", "_is_real", "(", "A", ")", "if", "isinstance", "(", "A", ",", "np", ".", "ndarray", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/linalg/interpolative.py#L821-L918
rsocket/rsocket-cpp
45ed594ebd6701f40795c31ec922d784ec7fc921
build/fbcode_builder/shell_quoting.py
python
shell_join
(delim, it)
return ShellQuoted(delim.join(raw_shell(s) for s in it))
Joins an iterable of ShellQuoted with a delimiter between each two
Joins an iterable of ShellQuoted with a delimiter between each two
[ "Joins", "an", "iterable", "of", "ShellQuoted", "with", "a", "delimiter", "between", "each", "two" ]
def shell_join(delim, it): "Joins an iterable of ShellQuoted with a delimiter between each two" return ShellQuoted(delim.join(raw_shell(s) for s in it))
[ "def", "shell_join", "(", "delim", ",", "it", ")", ":", "return", "ShellQuoted", "(", "delim", ".", "join", "(", "raw_shell", "(", "s", ")", "for", "s", "in", "it", ")", ")" ]
https://github.com/rsocket/rsocket-cpp/blob/45ed594ebd6701f40795c31ec922d784ec7fc921/build/fbcode_builder/shell_quoting.py#L87-L89
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
v8_5_1/tools/sanitizers/sancov_merger.py
python
merge_two
(args)
Merge two sancov files. Called trough multiprocessing pool. The args are expected to unpack to: swarming_output_dir: Folder where to find the new file. coverage_dir: Folder where to find the existing file. f: File name of the file to be merged.
Merge two sancov files.
[ "Merge", "two", "sancov", "files", "." ]
def merge_two(args): """Merge two sancov files. Called trough multiprocessing pool. The args are expected to unpack to: swarming_output_dir: Folder where to find the new file. coverage_dir: Folder where to find the existing file. f: File name of the file to be merged. """ swarming_output_dir, cover...
[ "def", "merge_two", "(", "args", ")", ":", "swarming_output_dir", ",", "coverage_dir", ",", "f", "=", "args", "input_file", "=", "os", ".", "path", ".", "join", "(", "swarming_output_dir", ",", "f", ")", "output_file", "=", "os", ".", "path", ".", "join"...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/v8_5_1/tools/sanitizers/sancov_merger.py#L160-L179
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/_custom_op/batchnorm_fold.py
python
_batchnorm_fold_tbe
()
return
_BatchNormFold TBE register
_BatchNormFold TBE register
[ "_BatchNormFold", "TBE", "register" ]
def _batchnorm_fold_tbe(): """_BatchNormFold TBE register""" return
[ "def", "_batchnorm_fold_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/_custom_op/batchnorm_fold.py#L55-L57
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/android/loading/activity_lens.py
python
ActivityLens._ThreadBusyness
(cls, events, start_msec, end_msec)
return busy_duration
Amount of time a thread spent executing from the message loop.
Amount of time a thread spent executing from the message loop.
[ "Amount", "of", "time", "a", "thread", "spent", "executing", "from", "the", "message", "loop", "." ]
def _ThreadBusyness(cls, events, start_msec, end_msec): """Amount of time a thread spent executing from the message loop.""" busy_duration = 0 message_loop_events = [ e for e in events if (e.tracing_event['cat'] == 'toplevel' and e.tracing_event['name'] == 'MessageLoop::RunTask')...
[ "def", "_ThreadBusyness", "(", "cls", ",", "events", ",", "start_msec", ",", "end_msec", ")", ":", "busy_duration", "=", "0", "message_loop_events", "=", "[", "e", "for", "e", "in", "events", "if", "(", "e", ".", "tracing_event", "[", "'cat'", "]", "==",...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/loading/activity_lens.py#L82-L94
fasiondog/hikyuu
842751aa25283f9fdafc6f560ea262f79e67a307
hikyuu/extend.py
python
Datetime_date
(self)
return date(self.year, self.month, self.day)
转化生成 python 的 date
转化生成 python 的 date
[ "转化生成", "python", "的", "date" ]
def Datetime_date(self): """转化生成 python 的 date""" return date(self.year, self.month, self.day)
[ "def", "Datetime_date", "(", "self", ")", ":", "return", "date", "(", "self", ".", "year", ",", "self", ".", "month", ",", "self", ".", "day", ")" ]
https://github.com/fasiondog/hikyuu/blob/842751aa25283f9fdafc6f560ea262f79e67a307/hikyuu/extend.py#L95-L97
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
TextBoxAttr.Init
(*args, **kwargs)
return _richtext.TextBoxAttr_Init(*args, **kwargs)
Init(self)
Init(self)
[ "Init", "(", "self", ")" ]
def Init(*args, **kwargs): """Init(self)""" return _richtext.TextBoxAttr_Init(*args, **kwargs)
[ "def", "Init", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "TextBoxAttr_Init", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L528-L530
TheImagingSource/tiscamera
baacb4cfaa7858c2e6cfb4f1a297b404c4e002f6
tools/tcam-capture/tcam_capture/Settings.py
python
Settings.reset
(self)
Set properties to their default values
Set properties to their default values
[ "Set", "properties", "to", "their", "default", "values" ]
def reset(self): """Set properties to their default values""" self._set_defaults()
[ "def", "reset", "(", "self", ")", ":", "self", ".", "_set_defaults", "(", ")" ]
https://github.com/TheImagingSource/tiscamera/blob/baacb4cfaa7858c2e6cfb4f1a297b404c4e002f6/tools/tcam-capture/tcam_capture/Settings.py#L84-L86
NeoGeographyToolkit/StereoPipeline
eedf54a919fb5cce1ab0e280bb0df4050763aa11
src/asp/IceBridge/multi_flight_label_runner.py
python
checkLogFile
(path, run)
return False
Return true if the date is in the file
Return true if the date is in the file
[ "Return", "true", "if", "the", "date", "is", "in", "the", "file" ]
def checkLogFile(path, run): '''Return true if the date is in the file''' run_name = run.name() with open(path, 'r') as f: for line in f: if run_name in line: return True return False
[ "def", "checkLogFile", "(", "path", ",", "run", ")", ":", "run_name", "=", "run", ".", "name", "(", ")", "with", "open", "(", "path", ",", "'r'", ")", "as", "f", ":", "for", "line", "in", "f", ":", "if", "run_name", "in", "line", ":", "return", ...
https://github.com/NeoGeographyToolkit/StereoPipeline/blob/eedf54a919fb5cce1ab0e280bb0df4050763aa11/src/asp/IceBridge/multi_flight_label_runner.py#L60-L67
indutny/candor
48e7260618f5091c80a3416828e2808cad3ea22e
tools/gyp/pylib/gyp/MSVSSettings.py
python
_GetMSBuildToolSettings
(msbuild_settings, tool)
return msbuild_settings.setdefault(tool.msbuild_name, {})
Returns an MSBuild tool dictionary. Creates it if needed.
Returns an MSBuild tool dictionary. Creates it if needed.
[ "Returns", "an", "MSBuild", "tool", "dictionary", ".", "Creates", "it", "if", "needed", "." ]
def _GetMSBuildToolSettings(msbuild_settings, tool): """Returns an MSBuild tool dictionary. Creates it if needed.""" return msbuild_settings.setdefault(tool.msbuild_name, {})
[ "def", "_GetMSBuildToolSettings", "(", "msbuild_settings", ",", "tool", ")", ":", "return", "msbuild_settings", ".", "setdefault", "(", "tool", ".", "msbuild_name", ",", "{", "}", ")" ]
https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/MSVSSettings.py#L62-L64
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/learn/python/learn/utils/export.py
python
export_estimator
(estimator, export_dir, signature_fn=None, input_fn=_default_input_fn, default_batch_size=1, exports_to_keep=None)
Exports inference graph into given dir. Args: estimator: Estimator to export export_dir: A string containing a directory to write the exported graph and checkpoints. signature_fn: Function that given `Tensor` of `Example` strings, `dict` of `Tensor`s for features and `dict` of `Tensor`s for p...
Exports inference graph into given dir.
[ "Exports", "inference", "graph", "into", "given", "dir", "." ]
def export_estimator(estimator, export_dir, signature_fn=None, input_fn=_default_input_fn, default_batch_size=1, exports_to_keep=None): """Exports inference graph into given dir. Args: estimator: Estimator ...
[ "def", "export_estimator", "(", "estimator", ",", "export_dir", ",", "signature_fn", "=", "None", ",", "input_fn", "=", "_default_input_fn", ",", "default_batch_size", "=", "1", ",", "exports_to_keep", "=", "None", ")", ":", "checkpoint_path", "=", "tf_saver", "...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/utils/export.py#L175-L222
google/mozc
7329757e1ad30e327c1ae823a8302c79482d6b9c
src/build_tools/util.py
python
RunOrDie
(argv)
Run the command, or die if it failed.
Run the command, or die if it failed.
[ "Run", "the", "command", "or", "die", "if", "it", "failed", "." ]
def RunOrDie(argv): """Run the command, or die if it failed.""" # Rest are the target program name and the parameters, but we special # case if the target program name ends with '.py' if argv[0].endswith('.py'): argv.insert(0, sys.executable) # Inject the python interpreter path. # We don't capture stdou...
[ "def", "RunOrDie", "(", "argv", ")", ":", "# Rest are the target program name and the parameters, but we special", "# case if the target program name ends with '.py'", "if", "argv", "[", "0", "]", ".", "endswith", "(", "'.py'", ")", ":", "argv", ".", "insert", "(", "0",...
https://github.com/google/mozc/blob/7329757e1ad30e327c1ae823a8302c79482d6b9c/src/build_tools/util.py#L83-L99
priyankchheda/algorithms
c361aa9071573fa9966d5b02d05e524815abcf2b
binary_tree/level_order_traversal.py
python
main
()
operational function
operational function
[ "operational", "function" ]
def main(): """ operational function """ root = Node(1) root.left = Node(2) root.right = Node(3) root.left.left = Node(4) root.left.right = Node(5) level_order(root)
[ "def", "main", "(", ")", ":", "root", "=", "Node", "(", "1", ")", "root", ".", "left", "=", "Node", "(", "2", ")", "root", ".", "right", "=", "Node", "(", "3", ")", "root", ".", "left", ".", "left", "=", "Node", "(", "4", ")", "root", ".", ...
https://github.com/priyankchheda/algorithms/blob/c361aa9071573fa9966d5b02d05e524815abcf2b/binary_tree/level_order_traversal.py#L31-L40
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/imaplib.py
python
IMAP4.myrights
(self, mailbox)
return self._untagged_response(typ, dat, 'MYRIGHTS')
Show my ACLs for a mailbox (i.e. the rights that I have on mailbox). (typ, [data]) = <instance>.myrights(mailbox)
Show my ACLs for a mailbox (i.e. the rights that I have on mailbox).
[ "Show", "my", "ACLs", "for", "a", "mailbox", "(", "i", ".", "e", ".", "the", "rights", "that", "I", "have", "on", "mailbox", ")", "." ]
def myrights(self, mailbox): """Show my ACLs for a mailbox (i.e. the rights that I have on mailbox). (typ, [data]) = <instance>.myrights(mailbox) """ typ,dat = self._simple_command('MYRIGHTS', mailbox) return self._untagged_response(typ, dat, 'MYRIGHTS')
[ "def", "myrights", "(", "self", ",", "mailbox", ")", ":", "typ", ",", "dat", "=", "self", ".", "_simple_command", "(", "'MYRIGHTS'", ",", "mailbox", ")", "return", "self", ".", "_untagged_response", "(", "typ", ",", "dat", ",", "'MYRIGHTS'", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/imaplib.py#L547-L553
liulei01/DRBox
b5c76e033c555c9009590ab384e1f7bd3c66c237
scripts/cpp_lint.py
python
CheckForNonConstReference
(filename, clean_lines, linenum, nesting_state, error)
Check for non-const references. Separate from CheckLanguage since it scans backwards from current line, instead of scanning forward. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A...
Check for non-const references.
[ "Check", "for", "non", "-", "const", "references", "." ]
def CheckForNonConstReference(filename, clean_lines, linenum, nesting_state, error): """Check for non-const references. Separate from CheckLanguage since it scans backwards from current line, instead of scanning forward. Args: filename: The name of the current file. clean...
[ "def", "CheckForNonConstReference", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "# Do nothing if there is no '&' on current line.", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "if", "'&'", "n...
https://github.com/liulei01/DRBox/blob/b5c76e033c555c9009590ab384e1f7bd3c66c237/scripts/cpp_lint.py#L4138-L4248
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
demo/DPU-for-RNN/rnnt_asr_vck5000/fbank.py
python
splice_frames
(x, frame_splicing)
return torch.cat(seq, dim=1)[:, :, ::frame_splicing]
Stacks frames together across feature dim input is batch_size, feature_dim, num_frames output is batch_size, feature_dim*frame_splicing, num_frames
Stacks frames together across feature dim
[ "Stacks", "frames", "together", "across", "feature", "dim" ]
def splice_frames(x, frame_splicing): """ Stacks frames together across feature dim input is batch_size, feature_dim, num_frames output is batch_size, feature_dim*frame_splicing, num_frames """ seq = [x] for n in range(1, frame_splicing): tmp = torch.zeros_like(x) tmp[:, :, :-n...
[ "def", "splice_frames", "(", "x", ",", "frame_splicing", ")", ":", "seq", "=", "[", "x", "]", "for", "n", "in", "range", "(", "1", ",", "frame_splicing", ")", ":", "tmp", "=", "torch", ".", "zeros_like", "(", "x", ")", "tmp", "[", ":", ",", ":", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/demo/DPU-for-RNN/rnnt_asr_vck5000/fbank.py#L66-L78
mangosArchives/serverZero_Rel19
395039dd19cca769ec42186e76f0477089cc2490
dep/ACE_wrappers/bin/make_release.py
python
check_workspace
()
Checks that the DOC and MPC repositories are up to date.
Checks that the DOC and MPC repositories are up to date.
[ "Checks", "that", "the", "DOC", "and", "MPC", "repositories", "are", "up", "to", "date", "." ]
def check_workspace (): """ Checks that the DOC and MPC repositories are up to date. """ global opts, doc_root, svn_client # @@TODO: Replace with a svn library try: rev = svn_client.update (doc_root) print "Successfully updated ACE/TAO/CIAO working copy to revision " except: ...
[ "def", "check_workspace", "(", ")", ":", "global", "opts", ",", "doc_root", ",", "svn_client", "# @@TODO: Replace with a svn library", "try", ":", "rev", "=", "svn_client", ".", "update", "(", "doc_root", ")", "print", "\"Successfully updated ACE/TAO/CIAO working copy t...
https://github.com/mangosArchives/serverZero_Rel19/blob/395039dd19cca769ec42186e76f0477089cc2490/dep/ACE_wrappers/bin/make_release.py#L198-L227
taichi-dev/taichi
973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6
python/taichi/ad.py
python
grad_replaced
(func)
return decorated
A decorator for python function to customize gradient with Taichi's autodiff system, e.g. `ti.Tape()` and `kernel.grad()`. This decorator forces Taichi's autodiff system to use a user-defined gradient function for the decorated function. Its customized gradient must be decorated by :func:`~taichi.ad.gra...
A decorator for python function to customize gradient with Taichi's autodiff system, e.g. `ti.Tape()` and `kernel.grad()`. This decorator forces Taichi's autodiff system to use a user-defined gradient function for the decorated function. Its customized gradient must be decorated by :func:`~taichi.ad.gra...
[ "A", "decorator", "for", "python", "function", "to", "customize", "gradient", "with", "Taichi", "s", "autodiff", "system", "e", ".", "g", ".", "ti", ".", "Tape", "()", "and", "kernel", ".", "grad", "()", ".", "This", "decorator", "forces", "Taichi", "s",...
def grad_replaced(func): """A decorator for python function to customize gradient with Taichi's autodiff system, e.g. `ti.Tape()` and `kernel.grad()`. This decorator forces Taichi's autodiff system to use a user-defined gradient function for the decorated function. Its customized gradient must be decora...
[ "def", "grad_replaced", "(", "func", ")", ":", "def", "decorated", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# TODO [#3025]: get rid of circular imports and move this to the top.", "impl", ".", "get_runtime", "(", ")", ".", "grad_replaced", "=", "True"...
https://github.com/taichi-dev/taichi/blob/973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6/python/taichi/ad.py#L4-L47
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/compiler/pyassem.py
python
PyFlowGraph.convertArgs
(self)
Convert arguments from symbolic to concrete form
Convert arguments from symbolic to concrete form
[ "Convert", "arguments", "from", "symbolic", "to", "concrete", "form" ]
def convertArgs(self): """Convert arguments from symbolic to concrete form""" assert self.stage == FLAT self.consts.insert(0, self.docstring) self.sort_cellvars() for i in range(len(self.insts)): t = self.insts[i] if len(t) == 2: opname, op...
[ "def", "convertArgs", "(", "self", ")", ":", "assert", "self", ".", "stage", "==", "FLAT", "self", ".", "consts", ".", "insert", "(", "0", ",", "self", ".", "docstring", ")", "self", ".", "sort_cellvars", "(", ")", "for", "i", "in", "range", "(", "...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/compiler/pyassem.py#L405-L417
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_windows.py
python
HtmlListBox.Create
(*args, **kwargs)
return _windows_.HtmlListBox_Create(*args, **kwargs)
Create(self, Window parent, int id=ID_ANY, Point pos=DefaultPosition, Size size=DefaultSize, long style=0, String name=VListBoxNameStr) -> bool
Create(self, Window parent, int id=ID_ANY, Point pos=DefaultPosition, Size size=DefaultSize, long style=0, String name=VListBoxNameStr) -> bool
[ "Create", "(", "self", "Window", "parent", "int", "id", "=", "ID_ANY", "Point", "pos", "=", "DefaultPosition", "Size", "size", "=", "DefaultSize", "long", "style", "=", "0", "String", "name", "=", "VListBoxNameStr", ")", "-", ">", "bool" ]
def Create(*args, **kwargs): """ Create(self, Window parent, int id=ID_ANY, Point pos=DefaultPosition, Size size=DefaultSize, long style=0, String name=VListBoxNameStr) -> bool """ return _windows_.HtmlListBox_Create(*args, **kwargs)
[ "def", "Create", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "HtmlListBox_Create", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L2734-L2739
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
bindings/python/cntk/initializer.py
python
he_normal
(scale=DefaultParamInitScale, output_rank=SentinelValueForInferParamInitRank, filter_rank=SentinelValueForInferParamInitRank, seed=None)
return cntk_py.he_normal_initializer(scale, output_rank, filter_rank, seed)
initializer Args: scale (float): scale output_rank (int): output rank filter_rank (int): filter rank seed (int): random seed Returns: initializer for :class:`~cntk.variables.Parameter` initialized to Gaussian distribution with mean `0` and standard devia...
initializer
[ "initializer" ]
def he_normal(scale=DefaultParamInitScale, output_rank=SentinelValueForInferParamInitRank, filter_rank=SentinelValueForInferParamInitRank, seed=None): ''' initializer Args: scale (float): scale output_rank (int): output rank filter_rank (int): filter rank seed (int): random ...
[ "def", "he_normal", "(", "scale", "=", "DefaultParamInitScale", ",", "output_rank", "=", "SentinelValueForInferParamInitRank", ",", "filter_rank", "=", "SentinelValueForInferParamInitRank", ",", "seed", "=", "None", ")", ":", "if", "seed", "is", "None", ":", "seed",...
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/initializer.py#L133-L151
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
ListEvent.__init__
(self, *args, **kwargs)
__init__(self, EventType commandType=wxEVT_NULL, int id=0) -> ListEvent
__init__(self, EventType commandType=wxEVT_NULL, int id=0) -> ListEvent
[ "__init__", "(", "self", "EventType", "commandType", "=", "wxEVT_NULL", "int", "id", "=", "0", ")", "-", ">", "ListEvent" ]
def __init__(self, *args, **kwargs): """__init__(self, EventType commandType=wxEVT_NULL, int id=0) -> ListEvent""" _controls_.ListEvent_swiginit(self,_controls_.new_ListEvent(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_controls_", ".", "ListEvent_swiginit", "(", "self", ",", "_controls_", ".", "new_ListEvent", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L4307-L4309
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/io/matlab/miobase.py
python
MatFileReader.__init__
(self, mat_stream, byte_order=None, mat_dtype=False, squeeze_me=False, chars_as_strings=True, matlab_compatible=False, struct_as_record=True, verify_compressed_data_integrity=True )
Initializer for mat file reader mat_stream : file-like object with file API, open for reading %(load_args)s
Initializer for mat file reader
[ "Initializer", "for", "mat", "file", "reader" ]
def __init__(self, mat_stream, byte_order=None, mat_dtype=False, squeeze_me=False, chars_as_strings=True, matlab_compatible=False, struct_as_record=True, verify_compressed_data_integrity=True ...
[ "def", "__init__", "(", "self", ",", "mat_stream", ",", "byte_order", "=", "None", ",", "mat_dtype", "=", "False", ",", "squeeze_me", "=", "False", ",", "chars_as_strings", "=", "True", ",", "matlab_compatible", "=", "False", ",", "struct_as_record", "=", "T...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/io/matlab/miobase.py#L346-L377
junhyukoh/caffe-lstm
598d45456fa2a1b127a644f4aa38daa8fb9fc722
scripts/cpp_lint.py
python
_BlockInfo.CheckEnd
(self, filename, clean_lines, linenum, error)
Run checks that applies to text after the closing brace. This is mostly used for checking end of namespace comments. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to...
Run checks that applies to text after the closing brace.
[ "Run", "checks", "that", "applies", "to", "text", "after", "the", "closing", "brace", "." ]
def CheckEnd(self, filename, clean_lines, linenum, error): """Run checks that applies to text after the closing brace. This is mostly used for checking end of namespace comments. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. line...
[ "def", "CheckEnd", "(", "self", ",", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "pass" ]
https://github.com/junhyukoh/caffe-lstm/blob/598d45456fa2a1b127a644f4aa38daa8fb9fc722/scripts/cpp_lint.py#L1778-L1789
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/_vendor/packaging/specifiers.py
python
BaseSpecifier.__str__
(self)
Returns the str representation of this Specifier like object. This should be representative of the Specifier itself.
Returns the str representation of this Specifier like object. This should be representative of the Specifier itself.
[ "Returns", "the", "str", "representation", "of", "this", "Specifier", "like", "object", ".", "This", "should", "be", "representative", "of", "the", "Specifier", "itself", "." ]
def __str__(self): """ Returns the str representation of this Specifier like object. This should be representative of the Specifier itself. """
[ "def", "__str__", "(", "self", ")", ":" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/_vendor/packaging/specifiers.py#L23-L27
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/flatmenu.py
python
FlatMenu.Popup
(self, pt, owner=None, parent=None)
Pops up the menu. :param `pt`: the point at which the menu should be popped up (an instance of :class:`Point`); :param `owner`: the owner of the menu. The owner does not necessarly mean the menu parent, it can also be the window that popped up it; :param `parent`: the menu par...
Pops up the menu.
[ "Pops", "up", "the", "menu", "." ]
def Popup(self, pt, owner=None, parent=None): """ Pops up the menu. :param `pt`: the point at which the menu should be popped up (an instance of :class:`Point`); :param `owner`: the owner of the menu. The owner does not necessarly mean the menu parent, it can also be t...
[ "def", "Popup", "(", "self", ",", "pt", ",", "owner", "=", "None", ",", "parent", "=", "None", ")", ":", "if", "\"__WXMSW__\"", "in", "wx", ".", "Platform", ":", "self", ".", "_mousePtAtStartup", "=", "wx", ".", "GetMousePosition", "(", ")", "# each ti...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L5377-L5431
mamedev/mame
02cd26d37ee11191f3e311e19e805d872cb1e3a4
3rdparty/benchmark/tools/gbench/util.py
python
run_benchmark
(exe_name, benchmark_flags)
return json_res
Run a benchmark specified by 'exe_name' with the specified 'benchmark_flags'. The benchmark is run directly as a subprocess to preserve real time console output. RETURNS: A JSON object representing the benchmark output
Run a benchmark specified by 'exe_name' with the specified 'benchmark_flags'. The benchmark is run directly as a subprocess to preserve real time console output. RETURNS: A JSON object representing the benchmark output
[ "Run", "a", "benchmark", "specified", "by", "exe_name", "with", "the", "specified", "benchmark_flags", ".", "The", "benchmark", "is", "run", "directly", "as", "a", "subprocess", "to", "preserve", "real", "time", "console", "output", ".", "RETURNS", ":", "A", ...
def run_benchmark(exe_name, benchmark_flags): """ Run a benchmark specified by 'exe_name' with the specified 'benchmark_flags'. The benchmark is run directly as a subprocess to preserve real time console output. RETURNS: A JSON object representing the benchmark output """ thandle, tname = te...
[ "def", "run_benchmark", "(", "exe_name", ",", "benchmark_flags", ")", ":", "thandle", ",", "tname", "=", "tempfile", ".", "mkstemp", "(", ")", "os", ".", "close", "(", "thandle", ")", "cmd", "=", "[", "exe_name", "]", "+", "benchmark_flags", "print", "("...
https://github.com/mamedev/mame/blob/02cd26d37ee11191f3e311e19e805d872cb1e3a4/3rdparty/benchmark/tools/gbench/util.py#L97-L114
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/predictor/saved_model_predictor.py
python
_check_signature_arguments
(signature_def_key, signature_def, input_names, output_names)
Validates signature arguments for `SavedModelPredictor`.
Validates signature arguments for `SavedModelPredictor`.
[ "Validates", "signature", "arguments", "for", "SavedModelPredictor", "." ]
def _check_signature_arguments(signature_def_key, signature_def, input_names, output_names): """Validates signature arguments for `SavedModelPredictor`.""" signature_def_key_specified = signature_def_key is not None signa...
[ "def", "_check_signature_arguments", "(", "signature_def_key", ",", "signature_def", ",", "input_names", ",", "output_names", ")", ":", "signature_def_key_specified", "=", "signature_def_key", "is", "not", "None", "signature_def_specified", "=", "signature_def", "is", "no...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/predictor/saved_model_predictor.py#L86-L106
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Source/bindings/scripts/v8_interface.py
python
common_value
(dicts, key)
return common(dicts, lambda d: d.get(key))
Returns common value of a key across an iterable of dicts, or None. Auxiliary function for overloads, so can consolidate an extended attribute that appears with the same value on all items in an overload set.
Returns common value of a key across an iterable of dicts, or None.
[ "Returns", "common", "value", "of", "a", "key", "across", "an", "iterable", "of", "dicts", "or", "None", "." ]
def common_value(dicts, key): """Returns common value of a key across an iterable of dicts, or None. Auxiliary function for overloads, so can consolidate an extended attribute that appears with the same value on all items in an overload set. """ return common(dicts, lambda d: d.get(key))
[ "def", "common_value", "(", "dicts", ",", "key", ")", ":", "return", "common", "(", "dicts", ",", "lambda", "d", ":", "d", ".", "get", "(", "key", ")", ")" ]
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Source/bindings/scripts/v8_interface.py#L1173-L1179