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
QMCPACK/qmcpack
d0948ab455e38364458740cc8e2239600a14c5cd
utils/afqmctools/bin/kp_to_sparse.py
python
parse_args
(args)
return options
Parse command-line arguments. Parameters ---------- args : list of strings command-line arguments. Returns ------- options : :class:`argparse.ArgumentParser` Command line arguments.
Parse command-line arguments.
[ "Parse", "command", "-", "line", "arguments", "." ]
def parse_args(args): """Parse command-line arguments. Parameters ---------- args : list of strings command-line arguments. Returns ------- options : :class:`argparse.ArgumentParser` Command line arguments. """ parser = argparse.ArgumentParser(description = __doc__...
[ "def", "parse_args", "(", "args", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "__doc__", ")", "parser", ".", "add_argument", "(", "'-i'", ",", "'--input'", ",", "dest", "=", "'input_file'", ",", "type", "=", "str", ...
https://github.com/QMCPACK/qmcpack/blob/d0948ab455e38364458740cc8e2239600a14c5cd/utils/afqmctools/bin/kp_to_sparse.py#L11-L44
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/fastparquet/writer.py
python
encode_dict
(data, se)
return o.so_far().tostring() + data.values.tostring()
The data part of dictionary encoding is always int8, with RLE/bitpack
The data part of dictionary encoding is always int8, with RLE/bitpack
[ "The", "data", "part", "of", "dictionary", "encoding", "is", "always", "int8", "with", "RLE", "/", "bitpack" ]
def encode_dict(data, se): """ The data part of dictionary encoding is always int8, with RLE/bitpack """ width = data.values.dtype.itemsize * 8 o = encoding.Numpy8(np.empty(10, dtype=np.uint8)) o.write_byte(width) bit_packed_count = (len(data) + 7) // 8 encode_unsigned_varint(bit_packed_coun...
[ "def", "encode_dict", "(", "data", ",", "se", ")", ":", "width", "=", "data", ".", "values", ".", "dtype", ".", "itemsize", "*", "8", "o", "=", "encoding", ".", "Numpy8", "(", "np", ".", "empty", "(", "10", ",", "dtype", "=", "np", ".", "uint8", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/fastparquet/writer.py#L368-L376
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
contrib/gizmos/gtk/gizmos.py
python
TreeListCtrl.GetSelections
(*args, **kwargs)
return _gizmos.TreeListCtrl_GetSelections(*args, **kwargs)
GetSelections(self) -> PyObject
GetSelections(self) -> PyObject
[ "GetSelections", "(", "self", ")", "-", ">", "PyObject" ]
def GetSelections(*args, **kwargs): """GetSelections(self) -> PyObject""" return _gizmos.TreeListCtrl_GetSelections(*args, **kwargs)
[ "def", "GetSelections", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gizmos", ".", "TreeListCtrl_GetSelections", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/gtk/gizmos.py#L754-L756
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/traitlets/py2/traitlets/config/configurable.py
python
Configurable.class_get_help
(cls, inst=None)
return '\n'.join(final_help)
Get the help string for this class in ReST format. If `inst` is given, it's current trait values will be used in place of class defaults.
Get the help string for this class in ReST format.
[ "Get", "the", "help", "string", "for", "this", "class", "in", "ReST", "format", "." ]
def class_get_help(cls, inst=None): """Get the help string for this class in ReST format. If `inst` is given, it's current trait values will be used in place of class defaults. """ assert inst is None or isinstance(inst, cls) final_help = [] final_help.append(u'%...
[ "def", "class_get_help", "(", "cls", ",", "inst", "=", "None", ")", ":", "assert", "inst", "is", "None", "or", "isinstance", "(", "inst", ",", "cls", ")", "final_help", "=", "[", "]", "final_help", ".", "append", "(", "u'%s options'", "%", "cls", ".", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/traitlets/py2/traitlets/config/configurable.py#L205-L218
ApolloAuto/apollo
463fb82f9e979d02dcb25044e60931293ab2dba0
modules/tools/common/proto_utils.py
python
write_pb_to_text_file
(topic_pb, file_path)
write pb message to file
write pb message to file
[ "write", "pb", "message", "to", "file" ]
def write_pb_to_text_file(topic_pb, file_path): """write pb message to file""" with open(file_path, 'w') as f: f.write(str(topic_pb))
[ "def", "write_pb_to_text_file", "(", "topic_pb", ",", "file_path", ")", ":", "with", "open", "(", "file_path", ",", "'w'", ")", "as", "f", ":", "f", ".", "write", "(", "str", "(", "topic_pb", ")", ")" ]
https://github.com/ApolloAuto/apollo/blob/463fb82f9e979d02dcb25044e60931293ab2dba0/modules/tools/common/proto_utils.py#L22-L25
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/encodings/hex_codec.py
python
hex_decode
(input,errors='strict')
return (output, len(input))
Decodes the object input and returns a tuple (output object, length consumed). input must be an object which provides the bf_getreadbuf buffer slot. Python strings, buffer objects and memory mapped files are examples of objects providing this slot. errors defines the error hand...
Decodes the object input and returns a tuple (output object, length consumed).
[ "Decodes", "the", "object", "input", "and", "returns", "a", "tuple", "(", "output", "object", "length", "consumed", ")", "." ]
def hex_decode(input,errors='strict'): """ Decodes the object input and returns a tuple (output object, length consumed). input must be an object which provides the bf_getreadbuf buffer slot. Python strings, buffer objects and memory mapped files are examples of objects providing t...
[ "def", "hex_decode", "(", "input", ",", "errors", "=", "'strict'", ")", ":", "assert", "errors", "==", "'strict'", "output", "=", "binascii", ".", "a2b_hex", "(", "input", ")", "return", "(", "output", ",", "len", "(", "input", ")", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/encodings/hex_codec.py#L27-L43
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/calendar.py
python
HTMLCalendar.formatmonthname
(self, theyear, themonth, withyear=True)
return '<tr><th colspan="7" class="month">%s</th></tr>' % s
Return a month name as a table row.
Return a month name as a table row.
[ "Return", "a", "month", "name", "as", "a", "table", "row", "." ]
def formatmonthname(self, theyear, themonth, withyear=True): """ Return a month name as a table row. """ if withyear: s = '%s %s' % (month_name[themonth], theyear) else: s = '%s' % month_name[themonth] return '<tr><th colspan="7" class="month">%s</...
[ "def", "formatmonthname", "(", "self", ",", "theyear", ",", "themonth", ",", "withyear", "=", "True", ")", ":", "if", "withyear", ":", "s", "=", "'%s %s'", "%", "(", "month_name", "[", "themonth", "]", ",", "theyear", ")", "else", ":", "s", "=", "'%s...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/calendar.py#L413-L421
happynear/caffe-windows
967eedf25009e334b7f6f933bb5e17aaaff5bef6
scripts/cpp_lint.py
python
ReplaceAll
(pattern, rep, s)
return _regexp_compile_cache[pattern].sub(rep, s)
Replaces instances of pattern in a string with a replacement. The compiled regex is kept in a cache shared by Match and Search. Args: pattern: regex pattern rep: replacement text s: search string Returns: string with replacements made (or original string if no replacements)
Replaces instances of pattern in a string with a replacement.
[ "Replaces", "instances", "of", "pattern", "in", "a", "string", "with", "a", "replacement", "." ]
def ReplaceAll(pattern, rep, s): """Replaces instances of pattern in a string with a replacement. The compiled regex is kept in a cache shared by Match and Search. Args: pattern: regex pattern rep: replacement text s: search string Returns: string with replacements made (or original string if...
[ "def", "ReplaceAll", "(", "pattern", ",", "rep", ",", "s", ")", ":", "if", "pattern", "not", "in", "_regexp_compile_cache", ":", "_regexp_compile_cache", "[", "pattern", "]", "=", "sre_compile", ".", "compile", "(", "pattern", ")", "return", "_regexp_compile_c...
https://github.com/happynear/caffe-windows/blob/967eedf25009e334b7f6f933bb5e17aaaff5bef6/scripts/cpp_lint.py#L529-L544
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
StdDialogButtonSizer.SetCancelButton
(*args, **kwargs)
return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
SetCancelButton(self, wxButton button)
SetCancelButton(self, wxButton button)
[ "SetCancelButton", "(", "self", "wxButton", "button", ")" ]
def SetCancelButton(*args, **kwargs): """SetCancelButton(self, wxButton button)""" return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
[ "def", "SetCancelButton", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "StdDialogButtonSizer_SetCancelButton", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L15516-L15518
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/s3transfer/futures.py
python
TransferCoordinator.done
(self)
return self.status in ['failed', 'cancelled', 'success']
Determines if a TransferFuture has completed :returns: False if status is equal to 'failed', 'cancelled', or 'success'. True, otherwise
Determines if a TransferFuture has completed
[ "Determines", "if", "a", "TransferFuture", "has", "completed" ]
def done(self): """Determines if a TransferFuture has completed :returns: False if status is equal to 'failed', 'cancelled', or 'success'. True, otherwise """ return self.status in ['failed', 'cancelled', 'success']
[ "def", "done", "(", "self", ")", ":", "return", "self", ".", "status", "in", "[", "'failed'", ",", "'cancelled'", ",", "'success'", "]" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/s3transfer/futures.py#L328-L334
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/client/timeline.py
python
_ChromeTraceFormatter.emit_obj_create
(self, category, name, timestamp, pid, tid, object_id)
Adds an object creation event to the trace. Args: category: The event category as a string. name: The event name as a string. timestamp: The timestamp of this event as a long integer. pid: Identifier of the process generating this event as an integer. tid: Identifier of the thread...
Adds an object creation event to the trace.
[ "Adds", "an", "object", "creation", "event", "to", "the", "trace", "." ]
def emit_obj_create(self, category, name, timestamp, pid, tid, object_id): """Adds an object creation event to the trace. Args: category: The event category as a string. name: The event name as a string. timestamp: The timestamp of this event as a long integer. pid: Identifier of the...
[ "def", "emit_obj_create", "(", "self", ",", "category", ",", "name", ",", "timestamp", ",", "pid", ",", "tid", ",", "object_id", ")", ":", "event", "=", "self", ".", "_create_event", "(", "'N'", ",", "category", ",", "name", ",", "pid", ",", "tid", "...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/client/timeline.py#L138-L151
google/clif
cab24d6a105609a65c95a36a1712ae3c20c7b5df
clif/pyclif.py
python
GenerateFrom
(ast)
Traverse ast and generate output files.
Traverse ast and generate output files.
[ "Traverse", "ast", "and", "generate", "output", "files", "." ]
def GenerateFrom(ast): """Traverse ast and generate output files.""" inc_headers = list(ast.usertype_includes) api_header = _GetHeaders(ast) modname = FLAGS.modname or StripExt(os.path.basename(ast.source )).replace('-', '_') m = pyext.Module( modnam...
[ "def", "GenerateFrom", "(", "ast", ")", ":", "inc_headers", "=", "list", "(", "ast", ".", "usertype_includes", ")", "api_header", "=", "_GetHeaders", "(", "ast", ")", "modname", "=", "FLAGS", ".", "modname", "or", "StripExt", "(", "os", ".", "path", ".",...
https://github.com/google/clif/blob/cab24d6a105609a65c95a36a1712ae3c20c7b5df/clif/pyclif.py#L98-L119
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/ccompiler.py
python
CCompiler.runtime_library_dir_option
(self, dir)
Return the compiler option to add 'dir' to the list of directories searched for runtime libraries.
Return the compiler option to add 'dir' to the list of directories searched for runtime libraries.
[ "Return", "the", "compiler", "option", "to", "add", "dir", "to", "the", "list", "of", "directories", "searched", "for", "runtime", "libraries", "." ]
def runtime_library_dir_option(self, dir): """Return the compiler option to add 'dir' to the list of directories searched for runtime libraries. """ raise NotImplementedError
[ "def", "runtime_library_dir_option", "(", "self", ",", "dir", ")", ":", "raise", "NotImplementedError" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/ccompiler.py#L714-L718
google/nucleus
68d3947fafba1337f294c0668a6e1c7f3f1273e3
nucleus/io/vcf.py
python
VcfHeaderCache.format_field_get_fn
(self, field_name)
return self._format_get_cache[field_name]
Returns a callable that gets the given FORMAT field based on its type.
Returns a callable that gets the given FORMAT field based on its type.
[ "Returns", "a", "callable", "that", "gets", "the", "given", "FORMAT", "field", "based", "on", "its", "type", "." ]
def format_field_get_fn(self, field_name): """Returns a callable that gets the given FORMAT field based on its type.""" return self._format_get_cache[field_name]
[ "def", "format_field_get_fn", "(", "self", ",", "field_name", ")", ":", "return", "self", ".", "_format_get_cache", "[", "field_name", "]" ]
https://github.com/google/nucleus/blob/68d3947fafba1337f294c0668a6e1c7f3f1273e3/nucleus/io/vcf.py#L130-L132
htcondor/htcondor
4829724575176d1d6c936e4693dfd78a728569b0
bindings/python/htcondor/htchirp/htchirp.py
python
HTChirp._check_response
(self, response)
Check the response from the Chirp server for validity :raises ChirpError: Many different subclasses of ChirpError
Check the response from the Chirp server for validity
[ "Check", "the", "response", "from", "the", "Chirp", "server", "for", "validity" ]
def _check_response(self, response): """Check the response from the Chirp server for validity :raises ChirpError: Many different subclasses of ChirpError """ chirp_errors = { -1: self.NotAuthenticated("The client has not authenticated its identity."), -2: self....
[ "def", "_check_response", "(", "self", ",", "response", ")", ":", "chirp_errors", "=", "{", "-", "1", ":", "self", ".", "NotAuthenticated", "(", "\"The client has not authenticated its identity.\"", ")", ",", "-", "2", ":", "self", ".", "NotAuthorized", "(", "...
https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/bindings/python/htcondor/htchirp/htchirp.py#L260-L295
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailbox.py
python
Babyl.get_file
(self, key)
return StringIO.StringIO(self.get_string(key).replace('\n', os.linesep))
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.""" return StringIO.StringIO(self.get_string(key).replace('\n', os.linesep))
[ "def", "get_file", "(", "self", ",", "key", ")", ":", "return", "StringIO", ".", "StringIO", "(", "self", ".", "get_string", "(", "key", ")", ".", "replace", "(", "'\\n'", ",", "os", ".", "linesep", ")", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailbox.py#L1292-L1295
jiaxiang-wu/quantized-cnn
4d020e17026df90e40111d219e3eb74e0afb1588
cpplint.py
python
IsRValueType
(typenames, clean_lines, nesting_state, linenum, column)
return False
Check if the token ending on (linenum, column) is a type. Assumes that text to the right of the column is "&&" or a function name. Args: typenames: set of type names from template-argument-list. clean_lines: A CleansedLines instance containing the file. nesting_state: A NestingState instance which m...
Check if the token ending on (linenum, column) is a type.
[ "Check", "if", "the", "token", "ending", "on", "(", "linenum", "column", ")", "is", "a", "type", "." ]
def IsRValueType(typenames, clean_lines, nesting_state, linenum, column): """Check if the token ending on (linenum, column) is a type. Assumes that text to the right of the column is "&&" or a function name. Args: typenames: set of type names from template-argument-list. clean_lines: A CleansedLines i...
[ "def", "IsRValueType", "(", "typenames", ",", "clean_lines", ",", "nesting_state", ",", "linenum", ",", "column", ")", ":", "prefix", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "[", "0", ":", "column", "]", "# Get one word to the left. If we failed...
https://github.com/jiaxiang-wu/quantized-cnn/blob/4d020e17026df90e40111d219e3eb74e0afb1588/cpplint.py#L3431-L3632
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/multiprocessing/context.py
python
BaseContext.SimpleQueue
(self)
return SimpleQueue(ctx=self.get_context())
Returns a queue object
Returns a queue object
[ "Returns", "a", "queue", "object" ]
def SimpleQueue(self): '''Returns a queue object''' from .queues import SimpleQueue return SimpleQueue(ctx=self.get_context())
[ "def", "SimpleQueue", "(", "self", ")", ":", "from", ".", "queues", "import", "SimpleQueue", "return", "SimpleQueue", "(", "ctx", "=", "self", ".", "get_context", "(", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/multiprocessing/context.py#L109-L112
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
pygimli/solver/solverFiniteVolume.py
python
cellToFaceArithmetic
(boundary, AMM)
TODO Documentme.
TODO Documentme.
[ "TODO", "Documentme", "." ]
def cellToFaceArithmetic(boundary, AMM): """TODO Documentme.""" leftCell = boundary.leftCell() rightCell = boundary.rightCell() df1 = 0. df2 = 0. harmonic = False if leftCell: df1 = boundary.center().distance(leftCell.center()) if rightCell: df2 = boundary.center().distan...
[ "def", "cellToFaceArithmetic", "(", "boundary", ",", "AMM", ")", ":", "leftCell", "=", "boundary", ".", "leftCell", "(", ")", "rightCell", "=", "boundary", ".", "rightCell", "(", ")", "df1", "=", "0.", "df2", "=", "0.", "harmonic", "=", "False", "if", ...
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/solver/solverFiniteVolume.py#L121-L149
soui3/soui
c588024b2f4f6d3fadb53c1bfed5ccf00d0b7046
third-part/jsoncpp/makerelease.py
python
fix_sources_eol
(dist_dir)
Set file EOL for tarball distribution.
Set file EOL for tarball distribution.
[ "Set", "file", "EOL", "for", "tarball", "distribution", "." ]
def fix_sources_eol(dist_dir): """Set file EOL for tarball distribution. """ print('Preparing exported source file EOL for distribution...') prune_dirs = antglob.prune_dirs + 'scons-local* ./build* ./libs ./dist' win_sources = antglob.glob(dist_dir, includes = '**/*.sln **/*.vcproj', ...
[ "def", "fix_sources_eol", "(", "dist_dir", ")", ":", "print", "(", "'Preparing exported source file EOL for distribution...'", ")", "prune_dirs", "=", "antglob", ".", "prune_dirs", "+", "'scons-local* ./build* ./libs ./dist'", "win_sources", "=", "antglob", ".", "glob", "...
https://github.com/soui3/soui/blob/c588024b2f4f6d3fadb53c1bfed5ccf00d0b7046/third-part/jsoncpp/makerelease.py#L124-L140
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/dataset/audio/validators.py
python
check_fade
(method)
return new_method
Wrapper method to check the parameters of Fade.
Wrapper method to check the parameters of Fade.
[ "Wrapper", "method", "to", "check", "the", "parameters", "of", "Fade", "." ]
def check_fade(method): """Wrapper method to check the parameters of Fade.""" @wraps(method) def new_method(self, *args, **kwargs): [fade_in_len, fade_out_len, fade_shape], _ = parse_user_args(method, *args, **kwargs) type_check(fade_in_len, (int,), "fade_in_len") check_non_negative...
[ "def", "check_fade", "(", "method", ")", ":", "@", "wraps", "(", "method", ")", "def", "new_method", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "[", "fade_in_len", ",", "fade_out_len", ",", "fade_shape", "]", ",", "_", "=", "...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/audio/validators.py#L534-L547
eclipse/omr
056e7c9ce9d503649190bc5bd9931fac30b4e4bc
jitbuilder/apigen/genutils.py
python
APIClass.base
(self)
return self.api.get_class_by_name(self.api.base_of(self.name())) if self.has_parent() else self
Returns the base class of the current class. If the class does not extend another class, the current class is returned.
Returns the base class of the current class. If the class does not extend another class, the current class is returned.
[ "Returns", "the", "base", "class", "of", "the", "current", "class", ".", "If", "the", "class", "does", "not", "extend", "another", "class", "the", "current", "class", "is", "returned", "." ]
def base(self): """ Returns the base class of the current class. If the class does not extend another class, the current class is returned. """ return self.api.get_class_by_name(self.api.base_of(self.name())) if self.has_parent() else self
[ "def", "base", "(", "self", ")", ":", "return", "self", ".", "api", ".", "get_class_by_name", "(", "self", ".", "api", ".", "base_of", "(", "self", ".", "name", "(", ")", ")", ")", "if", "self", ".", "has_parent", "(", ")", "else", "self" ]
https://github.com/eclipse/omr/blob/056e7c9ce9d503649190bc5bd9931fac30b4e4bc/jitbuilder/apigen/genutils.py#L339-L344
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
xmlTextReader.Close
(self)
return ret
This method releases any resources allocated by the current instance changes the state to Closed and close any underlying input.
This method releases any resources allocated by the current instance changes the state to Closed and close any underlying input.
[ "This", "method", "releases", "any", "resources", "allocated", "by", "the", "current", "instance", "changes", "the", "state", "to", "Closed", "and", "close", "any", "underlying", "input", "." ]
def Close(self): """This method releases any resources allocated by the current instance changes the state to Closed and close any underlying input. """ ret = libxml2mod.xmlTextReaderClose(self._o) return ret
[ "def", "Close", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlTextReaderClose", "(", "self", ".", "_o", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L5762-L5767
ideawu/ssdb-rocks
a3cbb322cafb2f493252829c608e2239df98c9ac
deps/cpy/antlr3/tokens.py
python
Token.setLine
(self, line)
@brief Set the line number on which this token was matched Using setter/getter methods is deprecated. Use o.line instead.
@brief Set the line number on which this token was matched
[ "@brief", "Set", "the", "line", "number", "on", "which", "this", "token", "was", "matched" ]
def setLine(self, line): """@brief Set the line number on which this token was matched Using setter/getter methods is deprecated. Use o.line instead.""" raise NotImplementedError
[ "def", "setLine", "(", "self", ",", "line", ")", ":", "raise", "NotImplementedError" ]
https://github.com/ideawu/ssdb-rocks/blob/a3cbb322cafb2f493252829c608e2239df98c9ac/deps/cpy/antlr3/tokens.py#L83-L88
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/platform.py
python
uname
()
return _uname_cache
Fairly portable uname interface. Returns a tuple of strings (system,node,release,version,machine,processor) identifying the underlying platform. Note that unlike the os.uname function this also returns possible processor information as an additional tuple entry. Entries which c...
Fairly portable uname interface. Returns a tuple of strings (system,node,release,version,machine,processor) identifying the underlying platform.
[ "Fairly", "portable", "uname", "interface", ".", "Returns", "a", "tuple", "of", "strings", "(", "system", "node", "release", "version", "machine", "processor", ")", "identifying", "the", "underlying", "platform", "." ]
def uname(): """ Fairly portable uname interface. Returns a tuple of strings (system,node,release,version,machine,processor) identifying the underlying platform. Note that unlike the os.uname function this also returns possible processor information as an additional tuple entry. ...
[ "def", "uname", "(", ")", ":", "global", "_uname_cache", "no_os_uname", "=", "0", "if", "_uname_cache", "is", "not", "None", ":", "return", "_uname_cache", "processor", "=", "''", "# Get some infos from the builtin os.uname API...", "try", ":", "system", ",", "nod...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/platform.py#L1166-L1299
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/lib/arrayterator.py
python
Arrayterator.__getitem__
(self, index)
return out
Return a new arrayterator.
Return a new arrayterator.
[ "Return", "a", "new", "arrayterator", "." ]
def __getitem__(self, index): """ Return a new arrayterator. """ # Fix index, handling ellipsis and incomplete slices. if not isinstance(index, tuple): index = (index,) fixed = [] length, dims = len(index), self.ndim for slice_ in index: ...
[ "def", "__getitem__", "(", "self", ",", "index", ")", ":", "# Fix index, handling ellipsis and incomplete slices.", "if", "not", "isinstance", "(", "index", ",", "tuple", ")", ":", "index", "=", "(", "index", ",", ")", "fixed", "=", "[", "]", "length", ",", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/lib/arrayterator.py#L100-L130
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/spatial/kdtree.py
python
KDTree.query_pairs
(self, r, p=2., eps=0)
return results
Find all pairs of points within a distance. Parameters ---------- r : positive float The maximum distance. p : float, optional Which Minkowski norm to use. `p` has to meet the condition ``1 <= p <= infinity``. eps : float, optional ...
Find all pairs of points within a distance.
[ "Find", "all", "pairs", "of", "points", "within", "a", "distance", "." ]
def query_pairs(self, r, p=2., eps=0): """ Find all pairs of points within a distance. Parameters ---------- r : positive float The maximum distance. p : float, optional Which Minkowski norm to use. `p` has to meet the condition ``1 <...
[ "def", "query_pairs", "(", "self", ",", "r", ",", "p", "=", "2.", ",", "eps", "=", "0", ")", ":", "results", "=", "set", "(", ")", "def", "traverse_checking", "(", "node1", ",", "rect1", ",", "node2", ",", "rect2", ")", ":", "if", "rect1", ".", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/spatial/kdtree.py#L698-L803
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/metrics_impl.py
python
root_mean_squared_error
(labels, predictions, weights=None, metrics_collections=None, updates_collections=None, name=None)
return rmse, update_rmse_op
Computes the root mean squared error between the labels and predictions. The `root_mean_squared_error` function creates two local variables, `total` and `count` that are used to compute the root mean squared error. This average is weighted by `weights`, and it is ultimately returned as `root_mean_squared_error...
Computes the root mean squared error between the labels and predictions.
[ "Computes", "the", "root", "mean", "squared", "error", "between", "the", "labels", "and", "predictions", "." ]
def root_mean_squared_error(labels, predictions, weights=None, metrics_collections=None, updates_collections=None, name=None): """Computes the root mean squared error between the...
[ "def", "root_mean_squared_error", "(", "labels", ",", "predictions", ",", "weights", "=", "None", ",", "metrics_collections", "=", "None", ",", "updates_collections", "=", "None", ",", "name", "=", "None", ")", ":", "if", "context", ".", "executing_eagerly", "...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/metrics_impl.py#L2916-L2983
apache/qpid-proton
6bcdfebb55ea3554bc29b1901422532db331a591
python/proton/_data.py
python
SymbolList.__add__
(self, t: Iterable[Any])
return SymbolList(super(SymbolList, self).__add__(self._check_list(t)), raise_on_error=self.raise_on_error)
Handles list1 + list2
Handles list1 + list2
[ "Handles", "list1", "+", "list2" ]
def __add__(self, t: Iterable[Any]) -> 'SymbolList': """ Handles list1 + list2 """ return SymbolList(super(SymbolList, self).__add__(self._check_list(t)), raise_on_error=self.raise_on_error)
[ "def", "__add__", "(", "self", ",", "t", ":", "Iterable", "[", "Any", "]", ")", "->", "'SymbolList'", ":", "return", "SymbolList", "(", "super", "(", "SymbolList", ",", "self", ")", ".", "__add__", "(", "self", ".", "_check_list", "(", "t", ")", ")",...
https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_data.py#L536-L538
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/managers.py
python
all_methods
(obj)
return temp
Return a list of names of methods of `obj`
Return a list of names of methods of `obj`
[ "Return", "a", "list", "of", "names", "of", "methods", "of", "obj" ]
def all_methods(obj): ''' Return a list of names of methods of `obj` ''' temp = [] for name in dir(obj): func = getattr(obj, name) if callable(func): temp.append(name) return temp
[ "def", "all_methods", "(", "obj", ")", ":", "temp", "=", "[", "]", "for", "name", "in", "dir", "(", "obj", ")", ":", "func", "=", "getattr", "(", "obj", ",", "name", ")", "if", "callable", "(", "func", ")", ":", "temp", ".", "append", "(", "nam...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/managers.py#L107-L116
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/idl/idl/generator.py
python
_CppHeaderFileWriter.gen_derived_class_declaration_block
(self, class_name)
return writer.IndentedScopedBlock( self._writer, 'class %s : public TypedCommand<Derived> {' % class_name, '};')
Generate a command's base class declaration block.
Generate a command's base class declaration block.
[ "Generate", "a", "command", "s", "base", "class", "declaration", "block", "." ]
def gen_derived_class_declaration_block(self, class_name): # type: (str) -> writer.IndentedScopedBlock """Generate a command's base class declaration block.""" return writer.IndentedScopedBlock( self._writer, 'class %s : public TypedCommand<Derived> {' % class_name, '};')
[ "def", "gen_derived_class_declaration_block", "(", "self", ",", "class_name", ")", ":", "# type: (str) -> writer.IndentedScopedBlock", "return", "writer", ".", "IndentedScopedBlock", "(", "self", ".", "_writer", ",", "'class %s : public TypedCommand<Derived> {'", "%", "class_...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/generator.py#L858-L862
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/closure_linter/closure_linter/tokenutil.py
python
DeleteToken
(token)
Deletes the given token from the linked list. Args: token: The token to delete
Deletes the given token from the linked list.
[ "Deletes", "the", "given", "token", "from", "the", "linked", "list", "." ]
def DeleteToken(token): """Deletes the given token from the linked list. Args: token: The token to delete """ # When deleting a token, we do not update the deleted token itself to make # sure the previous and next pointers are still pointing to tokens which are # not deleted. Also it is very hard to k...
[ "def", "DeleteToken", "(", "token", ")", ":", "# When deleting a token, we do not update the deleted token itself to make", "# sure the previous and next pointers are still pointing to tokens which are", "# not deleted. Also it is very hard to keep track of all previously deleted", "# tokens to u...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/tokenutil.py#L212-L234
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/calendar.py
python
CalendarDateAttr.HasBorderColour
(*args, **kwargs)
return _calendar.CalendarDateAttr_HasBorderColour(*args, **kwargs)
HasBorderColour(self) -> bool
HasBorderColour(self) -> bool
[ "HasBorderColour", "(", "self", ")", "-", ">", "bool" ]
def HasBorderColour(*args, **kwargs): """HasBorderColour(self) -> bool""" return _calendar.CalendarDateAttr_HasBorderColour(*args, **kwargs)
[ "def", "HasBorderColour", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_calendar", ".", "CalendarDateAttr_HasBorderColour", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/calendar.py#L130-L132
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
sdhash-ui/serverui/sdhashsrv/sdhashsrv.py
python
Client.getHashsetName
(self, num1)
return self.recv_getHashsetName()
Parameters: - num1
Parameters: - num1
[ "Parameters", ":", "-", "num1" ]
def getHashsetName(self, num1): """ Parameters: - num1 """ self.send_getHashsetName(num1) return self.recv_getHashsetName()
[ "def", "getHashsetName", "(", "self", ",", "num1", ")", ":", "self", ".", "send_getHashsetName", "(", "num1", ")", "return", "self", ".", "recv_getHashsetName", "(", ")" ]
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/serverui/sdhashsrv/sdhashsrv.py#L470-L476
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/grid.py
python
GridTableBase.IsEmptyCell
(*args, **kwargs)
return _grid.GridTableBase_IsEmptyCell(*args, **kwargs)
IsEmptyCell(self, int row, int col) -> bool
IsEmptyCell(self, int row, int col) -> bool
[ "IsEmptyCell", "(", "self", "int", "row", "int", "col", ")", "-", ">", "bool" ]
def IsEmptyCell(*args, **kwargs): """IsEmptyCell(self, int row, int col) -> bool""" return _grid.GridTableBase_IsEmptyCell(*args, **kwargs)
[ "def", "IsEmptyCell", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "GridTableBase_IsEmptyCell", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L810-L812
bundy-dns/bundy
3d41934996b82b0cd2fe22dd74d2abc1daba835d
src/lib/python/bundy/datasrc/sqlite3_ds.py
python
get_zoneid
(zonename, cur)
Get the zone_id for a given zone name. Arguments: zonename - the zone's origin name. cur - sqlite3 cursor. Return zone id for the given zone name, or an empty string if the zone is not found.
Get the zone_id for a given zone name.
[ "Get", "the", "zone_id", "for", "a", "given", "zone", "name", "." ]
def get_zoneid(zonename, cur): """ Get the zone_id for a given zone name. Arguments: zonename - the zone's origin name. cur - sqlite3 cursor. Return zone id for the given zone name, or an empty string if the zone is not found. """ cur.execute("SELECT id FROM zones WHERE name = ...
[ "def", "get_zoneid", "(", "zonename", ",", "cur", ")", ":", "cur", ".", "execute", "(", "\"SELECT id FROM zones WHERE name = ?\"", ",", "[", "zonename", "]", ")", "row", "=", "cur", ".", "fetchone", "(", ")", "if", "row", ":", "return", "row", "[", "0", ...
https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/src/lib/python/bundy/datasrc/sqlite3_ds.py#L215-L230
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exodus2.in.py
python
exodus.set_side_set_variable_number
(self, number)
return True
status = exo.set_side_set_variable_number(num_ssvars) -> update the number of side set variables in the model input value(s): <int> num_ssvars return value(s): <bool> status True = successful execution
status = exo.set_side_set_variable_number(num_ssvars)
[ "status", "=", "exo", ".", "set_side_set_variable_number", "(", "num_ssvars", ")" ]
def set_side_set_variable_number(self, number): """ status = exo.set_side_set_variable_number(num_ssvars) -> update the number of side set variables in the model input value(s): <int> num_ssvars return value(s): <bool> status True = suc...
[ "def", "set_side_set_variable_number", "(", "self", ",", "number", ")", ":", "ssType", "=", "ex_entity_type", "(", "\"EX_SIDE_SET\"", ")", "self", ".", "__ex_put_variable_param", "(", "ssType", ",", "number", ")", "return", "True" ]
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus2.in.py#L2893-L2907
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/PhactoriDriver.py
python
PhactoriIntersectNodeNormalsWithSurface.CreateParaViewFilter
(self, inInputFilter)
return newParaViewFilter
create the filter for ParaView
create the filter for ParaView
[ "create", "the", "filter", "for", "ParaView" ]
def CreateParaViewFilter(self, inInputFilter): "create the filter for ParaView" if PhactoriDbg(100): myDebugPrint3("PhactoriIntersectNodeNormalsWithSurface." \ "CreateParaViewFilter entered\n", 100) #info in block class should already be parsed and checked savedActiveSource = GetActiveS...
[ "def", "CreateParaViewFilter", "(", "self", ",", "inInputFilter", ")", ":", "if", "PhactoriDbg", "(", "100", ")", ":", "myDebugPrint3", "(", "\"PhactoriIntersectNodeNormalsWithSurface.\"", "\"CreateParaViewFilter entered\\n\"", ",", "100", ")", "#info in block class should ...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/PhactoriDriver.py#L9086-L9161
tiny-dnn/tiny-dnn
c0f576f5cb7b35893f62127cb7aec18f77a3bcc5
third_party/cpplint.py
python
ParseArguments
(args)
return filenames
Parses the command line arguments. This may set the output format and verbosity level as side-effects. Args: args: The command line arguments: Returns: The list of filenames to lint.
Parses the command line arguments.
[ "Parses", "the", "command", "line", "arguments", "." ]
def ParseArguments(args): """Parses the command line arguments. This may set the output format and verbosity level as side-effects. Args: args: The command line arguments: Returns: The list of filenames to lint. """ try: (opts, filenames) = getopt.getopt(args, '', ['help', 'output=', 'verbose...
[ "def", "ParseArguments", "(", "args", ")", ":", "try", ":", "(", "opts", ",", "filenames", ")", "=", "getopt", ".", "getopt", "(", "args", ",", "''", ",", "[", "'help'", ",", "'output='", ",", "'verbose='", ",", "'counting='", ",", "'filter='", ",", ...
https://github.com/tiny-dnn/tiny-dnn/blob/c0f576f5cb7b35893f62127cb7aec18f77a3bcc5/third_party/cpplint.py#L6312-L6411
goldeneye-source/ges-code
2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d
thirdparty/protobuf-2.3.0/python/google/protobuf/internal/encoder.py
python
_SignedVarintSize
(value)
return 10
Compute the size of a signed varint value.
Compute the size of a signed varint value.
[ "Compute", "the", "size", "of", "a", "signed", "varint", "value", "." ]
def _SignedVarintSize(value): """Compute the size of a signed varint value.""" if value < 0: return 10 if value <= 0x7f: return 1 if value <= 0x3fff: return 2 if value <= 0x1fffff: return 3 if value <= 0xfffffff: return 4 if value <= 0x7ffffffff: return 5 if value <= 0x3ffffffffff: return 6 if value <...
[ "def", "_SignedVarintSize", "(", "value", ")", ":", "if", "value", "<", "0", ":", "return", "10", "if", "value", "<=", "0x7f", ":", "return", "1", "if", "value", "<=", "0x3fff", ":", "return", "2", "if", "value", "<=", "0x1fffff", ":", "return", "3",...
https://github.com/goldeneye-source/ges-code/blob/2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/encoder.py#L87-L99
facebook/proxygen
a9ca025af207787815cb01eee1971cd572c7a81e
build/fbcode_builder/getdeps/cache.py
python
ArtifactCache.upload_from_file
(self, name, source_file_name)
Causes `name` to be populated in the cache by uploading the contents of `source_file_name` to the storage system. If a transient issue was encountered a TransientFailure shall be raised. If the upload failed for some other reason, an appropriate exception shall be raised.
Causes `name` to be populated in the cache by uploading the contents of `source_file_name` to the storage system. If a transient issue was encountered a TransientFailure shall be raised. If the upload failed for some other reason, an appropriate exception shall be raised.
[ "Causes", "name", "to", "be", "populated", "in", "the", "cache", "by", "uploading", "the", "contents", "of", "source_file_name", "to", "the", "storage", "system", ".", "If", "a", "transient", "issue", "was", "encountered", "a", "TransientFailure", "shall", "be...
def upload_from_file(self, name, source_file_name): """Causes `name` to be populated in the cache by uploading the contents of `source_file_name` to the storage system. If a transient issue was encountered a TransientFailure shall be raised. If the upload failed for some other re...
[ "def", "upload_from_file", "(", "self", ",", "name", ",", "source_file_name", ")", ":", "pass" ]
https://github.com/facebook/proxygen/blob/a9ca025af207787815cb01eee1971cd572c7a81e/build/fbcode_builder/getdeps/cache.py#L24-L31
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/rds/__init__.py
python
RDSConnection.delete_option_group
(self, name)
return self.get_status('DeleteOptionGroup', params)
Delete an OptionGroup from your account. :type key_name: string :param key_name: The name of the OptionGroup to delete
Delete an OptionGroup from your account.
[ "Delete", "an", "OptionGroup", "from", "your", "account", "." ]
def delete_option_group(self, name): """ Delete an OptionGroup from your account. :type key_name: string :param key_name: The name of the OptionGroup to delete """ params = {'OptionGroupName': name} return self.get_status('DeleteOptionGroup', params)
[ "def", "delete_option_group", "(", "self", ",", "name", ")", ":", "params", "=", "{", "'OptionGroupName'", ":", "name", "}", "return", "self", ".", "get_status", "(", "'DeleteOptionGroup'", ",", "params", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/rds/__init__.py#L1529-L1537
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py
python
SourceifyAndQuoteSpaces
(path)
return QuoteSpaces(Sourceify(path))
Convert a path to its source directory form and quote spaces.
Convert a path to its source directory form and quote spaces.
[ "Convert", "a", "path", "to", "its", "source", "directory", "form", "and", "quote", "spaces", "." ]
def SourceifyAndQuoteSpaces(path): """Convert a path to its source directory form and quote spaces.""" return QuoteSpaces(Sourceify(path))
[ "def", "SourceifyAndQuoteSpaces", "(", "path", ")", ":", "return", "QuoteSpaces", "(", "Sourceify", "(", "path", ")", ")" ]
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py#L667-L669
Kronuz/Xapiand
a71570859dcfc9f48090d845053f359b07f4f78c
contrib/python/xapiand-py/example/load.py
python
parse_commits
(name)
Go through the git repository log and generate a document per commit containing all the metadata.
Go through the git repository log and generate a document per commit containing all the metadata.
[ "Go", "through", "the", "git", "repository", "log", "and", "generate", "a", "document", "per", "commit", "containing", "all", "the", "metadata", "." ]
def parse_commits(name): """ Go through the git repository log and generate a document per commit containing all the metadata. """ for commit in iter_commits(): yield { '_id': commit['hexsha'], 'repository': name, 'committed_date': datetime.fromtimestamp...
[ "def", "parse_commits", "(", "name", ")", ":", "for", "commit", "in", "iter_commits", "(", ")", ":", "yield", "{", "'_id'", ":", "commit", "[", "'hexsha'", "]", ",", "'repository'", ":", "name", ",", "'committed_date'", ":", "datetime", ".", "fromtimestamp...
https://github.com/Kronuz/Xapiand/blob/a71570859dcfc9f48090d845053f359b07f4f78c/contrib/python/xapiand-py/example/load.py#L118-L143
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/ribbon/toolbar.py
python
RibbonToolBar.DoGetNextLargerSize
(self, direction, relative_to)
return result
Implementation of :meth:`RibbonControl.GetNextLargerSize() <lib.agw.ribbon.control.RibbonControl.GetNextLargerSize>`. Controls which have non-continuous sizing must override this virtual function rather than :meth:`RibbonControl.GetNextLargerSize() <lib.agw.ribbon.control.RibbonControl.GetNextLargerSiz...
Implementation of :meth:`RibbonControl.GetNextLargerSize() <lib.agw.ribbon.control.RibbonControl.GetNextLargerSize>`.
[ "Implementation", "of", ":", "meth", ":", "RibbonControl", ".", "GetNextLargerSize", "()", "<lib", ".", "agw", ".", "ribbon", ".", "control", ".", "RibbonControl", ".", "GetNextLargerSize", ">", "." ]
def DoGetNextLargerSize(self, direction, relative_to): """ Implementation of :meth:`RibbonControl.GetNextLargerSize() <lib.agw.ribbon.control.RibbonControl.GetNextLargerSize>`. Controls which have non-continuous sizing must override this virtual function rather than :meth:`RibbonControl...
[ "def", "DoGetNextLargerSize", "(", "self", ",", "direction", ",", "relative_to", ")", ":", "# Pick the smallest of our sizes which are larger than the given size", "result", "=", "wx", ".", "Size", "(", "*", "relative_to", ")", "area", "=", "10000", "tobreak", "=", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ribbon/toolbar.py#L913-L951
sigmaai/self-driving-golf-cart
8d891600af3d851add27a10ae45cf3c2108bb87c
ros/src/ros_carla_bridge/carla_ros_bridge/src/carla_ros_bridge/traffic_participant.py
python
TrafficParticipant.get_object_info
(self)
return obj
Function to send object messages of this traffic participant. A derived_object_msgs.msg.Object is prepared to be published via '/carla/objects' :return:
Function to send object messages of this traffic participant.
[ "Function", "to", "send", "object", "messages", "of", "this", "traffic", "participant", "." ]
def get_object_info(self): """ Function to send object messages of this traffic participant. A derived_object_msgs.msg.Object is prepared to be published via '/carla/objects' :return: """ obj = Object(header=self.get_msg_header("map")) # ID obj.id = self...
[ "def", "get_object_info", "(", "self", ")", ":", "obj", "=", "Object", "(", "header", "=", "self", ".", "get_msg_header", "(", "\"map\"", ")", ")", "# ID", "obj", ".", "id", "=", "self", ".", "get_id", "(", ")", "# Pose", "obj", ".", "pose", "=", "...
https://github.com/sigmaai/self-driving-golf-cart/blob/8d891600af3d851add27a10ae45cf3c2108bb87c/ros/src/ros_carla_bridge/carla_ros_bridge/src/carla_ros_bridge/traffic_participant.py#L74-L105
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/mach/mach/config.py
python
ConfigSettings.load_files
(self, filenames)
Load a config from files specified by their paths. Files are loaded in the order given. Subsequent files will overwrite values from previous files. If a file does not exist, it will be ignored.
Load a config from files specified by their paths.
[ "Load", "a", "config", "from", "files", "specified", "by", "their", "paths", "." ]
def load_files(self, filenames): """Load a config from files specified by their paths. Files are loaded in the order given. Subsequent files will overwrite values from previous files. If a file does not exist, it will be ignored. """ filtered = [f for f in filenames if o...
[ "def", "load_files", "(", "self", ",", "filenames", ")", ":", "filtered", "=", "[", "f", "for", "f", "in", "filenames", "if", "os", ".", "path", ".", "exists", "(", "f", ")", "]", "fps", "=", "[", "open", "(", "f", ",", "'rt'", ")", "for", "f",...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mach/mach/config.py#L367-L380
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/stc.py
python
StyledTextCtrl.GetTechnology
(*args, **kwargs)
return _stc.StyledTextCtrl_GetTechnology(*args, **kwargs)
GetTechnology(self) -> int
GetTechnology(self) -> int
[ "GetTechnology", "(", "self", ")", "-", ">", "int" ]
def GetTechnology(*args, **kwargs): """GetTechnology(self) -> int""" return _stc.StyledTextCtrl_GetTechnology(*args, **kwargs)
[ "def", "GetTechnology", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_GetTechnology", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L6389-L6391
bairdzhang/smallhardface
76fa1d87a9602d9b13d7a7fe693fc7aec91cab80
caffe/scripts/cpp_lint.py
python
CheckBraces
(filename, clean_lines, linenum, error)
Looks for misplaced braces (e.g. at the end of line). Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Looks for misplaced braces (e.g. at the end of line).
[ "Looks", "for", "misplaced", "braces", "(", "e", ".", "g", ".", "at", "the", "end", "of", "line", ")", "." ]
def CheckBraces(filename, clean_lines, linenum, error): """Looks for misplaced braces (e.g. at the end of line). Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any er...
[ "def", "CheckBraces", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# get rid of comments and strings", "if", "Match", "(", "r'\\s*{\\s*$'", ",", "line", ")", ":", ...
https://github.com/bairdzhang/smallhardface/blob/76fa1d87a9602d9b13d7a7fe693fc7aec91cab80/caffe/scripts/cpp_lint.py#L3073-L3244
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/Chem/BuildFragmentCatalog.py
python
ProcessGainsData
(inF, delim=',', idCol=0, gainCol=1)
return res
reads a list of ids and info gains out of an input file
reads a list of ids and info gains out of an input file
[ "reads", "a", "list", "of", "ids", "and", "info", "gains", "out", "of", "an", "input", "file" ]
def ProcessGainsData(inF, delim=',', idCol=0, gainCol=1): """ reads a list of ids and info gains out of an input file """ res = [] _ = inF.readline() for line in inF: splitL = line.strip().split(delim) res.append((splitL[idCol], float(splitL[gainCol]))) return res
[ "def", "ProcessGainsData", "(", "inF", ",", "delim", "=", "','", ",", "idCol", "=", "0", ",", "gainCol", "=", "1", ")", ":", "res", "=", "[", "]", "_", "=", "inF", ".", "readline", "(", ")", "for", "line", "in", "inF", ":", "splitL", "=", "line...
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/Chem/BuildFragmentCatalog.py#L365-L374
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/robotsim.py
python
Simulator.__init__
(self, model)
__init__(Simulator self, WorldModel model) -> Simulator Constructs the simulator from a WorldModel. If the WorldModel was loaded from an XML file, then the simulation setup is loaded from it.
__init__(Simulator self, WorldModel model) -> Simulator
[ "__init__", "(", "Simulator", "self", "WorldModel", "model", ")", "-", ">", "Simulator" ]
def __init__(self, model): """ __init__(Simulator self, WorldModel model) -> Simulator Constructs the simulator from a WorldModel. If the WorldModel was loaded from an XML file, then the simulation setup is loaded from it. """ this = _robotsim.new_Simulator(model) ...
[ "def", "__init__", "(", "self", ",", "model", ")", ":", "this", "=", "_robotsim", ".", "new_Simulator", "(", "model", ")", "try", ":", "self", ".", "this", ".", "append", "(", "this", ")", "except", "Exception", ":", "self", ".", "this", "=", "this" ...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L8154-L8168
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBCommunication.__init__
(self, *args)
__init__(lldb::SBCommunication self) -> SBCommunication __init__(lldb::SBCommunication self, char const * broadcaster_name) -> SBCommunication
__init__(lldb::SBCommunication self) -> SBCommunication __init__(lldb::SBCommunication self, char const * broadcaster_name) -> SBCommunication
[ "__init__", "(", "lldb", "::", "SBCommunication", "self", ")", "-", ">", "SBCommunication", "__init__", "(", "lldb", "::", "SBCommunication", "self", "char", "const", "*", "broadcaster_name", ")", "-", ">", "SBCommunication" ]
def __init__(self, *args): """ __init__(lldb::SBCommunication self) -> SBCommunication __init__(lldb::SBCommunication self, char const * broadcaster_name) -> SBCommunication """ this = _lldb.new_SBCommunication(*args) try: self.this.append(this) except...
[ "def", "__init__", "(", "self", ",", "*", "args", ")", ":", "this", "=", "_lldb", ".", "new_SBCommunication", "(", "*", "args", ")", "try", ":", "self", ".", "this", ".", "append", "(", "this", ")", "except", "__builtin__", ".", "Exception", ":", "se...
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L2997-L3006
gv22ga/dlib-face-recognition-android
42d6305cbd85833f2b85bb79b70ab9ab004153c9
tools/lint/cpplint.py
python
CheckForNonStandardConstructs
(filename, clean_lines, linenum, nesting_state, error)
r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2. Complain about several constructs which gcc-2 accepts, but which are not standard C++. Warning about these in lint is one way to ease the transition to new compilers. - put storage class first (e.g. "static const" instead of "const stati...
r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2. Complain about several constructs which gcc-2 accepts, but which are not standard C++. Warning about these in lint is one way to ease the transition to new compilers. - put storage class first (e.g. "static const" instead of "const stati...
[ "r", "Logs", "an", "error", "if", "we", "see", "certain", "non", "-", "ANSI", "constructs", "ignored", "by", "gcc", "-", "2", ".", "Complain", "about", "several", "constructs", "which", "gcc", "-", "2", "accepts", "but", "which", "are", "not", "standard"...
def CheckForNonStandardConstructs(filename, clean_lines, linenum, nesting_state, error): r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2. Complain about several constructs which gcc-2 accepts, but which are not standard C++. Warning about these in lint i...
[ "def", "CheckForNonStandardConstructs", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "# Remove comments from the line, but leave in strings for now.", "line", "=", "clean_lines", ".", "lines", "[", "linenum", "]", "i...
https://github.com/gv22ga/dlib-face-recognition-android/blob/42d6305cbd85833f2b85bb79b70ab9ab004153c9/tools/lint/cpplint.py#L2549-L2702
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/turtle.py
python
RawTurtle._clear
(self)
Delete all of pen's drawings
Delete all of pen's drawings
[ "Delete", "all", "of", "pen", "s", "drawings" ]
def _clear(self): """Delete all of pen's drawings""" self._fillitem = self._fillpath = None for item in self.items: self.screen._delete(item) self.currentLineItem = self.screen._createline() self.currentLine = [] if self._drawing: self.currentLine....
[ "def", "_clear", "(", "self", ")", ":", "self", ".", "_fillitem", "=", "self", ".", "_fillpath", "=", "None", "for", "item", "in", "self", ".", "items", ":", "self", ".", "screen", ".", "_delete", "(", "item", ")", "self", ".", "currentLineItem", "="...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/turtle.py#L2616-L2627
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
src/bindings/python/src/compatibility/ngraph/utils/types.py
python
get_ndarray
(data: NumericData)
return np.array(data)
Wrap data into a numpy ndarray.
Wrap data into a numpy ndarray.
[ "Wrap", "data", "into", "a", "numpy", "ndarray", "." ]
def get_ndarray(data: NumericData) -> np.ndarray: """Wrap data into a numpy ndarray.""" if type(data) == np.ndarray: return data return np.array(data)
[ "def", "get_ndarray", "(", "data", ":", "NumericData", ")", "->", "np", ".", "ndarray", ":", "if", "type", "(", "data", ")", "==", "np", ".", "ndarray", ":", "return", "data", "return", "np", ".", "array", "(", "data", ")" ]
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/src/bindings/python/src/compatibility/ngraph/utils/types.py#L108-L112
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/input.py
python
Filter
(l, item)
return [res.setdefault(e, e) for e in l if e != item]
Removes item from l.
Removes item from l.
[ "Removes", "item", "from", "l", "." ]
def Filter(l, item): """Removes item from l.""" res = {} return [res.setdefault(e, e) for e in l if e != item]
[ "def", "Filter", "(", "l", ",", "item", ")", ":", "res", "=", "{", "}", "return", "[", "res", ".", "setdefault", "(", "e", ",", "e", ")", "for", "e", "in", "l", "if", "e", "!=", "item", "]" ]
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/input.py#L1482-L1485
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
sdhash-ui/jinja2/environment.py
python
Environment.handle_exception
(self, exc_info=None, rendered=False, source_hint=None)
Exception handling helper. This is used internally to either raise rewritten exceptions or return a rendered traceback for the template.
Exception handling helper. This is used internally to either raise rewritten exceptions or return a rendered traceback for the template.
[ "Exception", "handling", "helper", ".", "This", "is", "used", "internally", "to", "either", "raise", "rewritten", "exceptions", "or", "return", "a", "rendered", "traceback", "for", "the", "template", "." ]
def handle_exception(self, exc_info=None, rendered=False, source_hint=None): """Exception handling helper. This is used internally to either raise rewritten exceptions or return a rendered traceback for the template. """ global _make_traceback if exc_info is None: ex...
[ "def", "handle_exception", "(", "self", ",", "exc_info", "=", "None", ",", "rendered", "=", "False", ",", "source_hint", "=", "None", ")", ":", "global", "_make_traceback", "if", "exc_info", "is", "None", ":", "exc_info", "=", "sys", ".", "exc_info", "(", ...
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/jinja2/environment.py#L650-L670
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/legacy_seq2seq/python/ops/seq2seq.py
python
embedding_attention_seq2seq
(encoder_inputs, decoder_inputs, cell, num_encoder_symbols, num_decoder_symbols, embedding_size, num_heads=1, ...
Embedding sequence-to-sequence model with attention. This model first embeds encoder_inputs by a newly created embedding (of shape [num_encoder_symbols x input_size]). Then it runs an RNN to encode embedded encoder_inputs into a state vector. It keeps the outputs of this RNN at every step to use for attention ...
Embedding sequence-to-sequence model with attention.
[ "Embedding", "sequence", "-", "to", "-", "sequence", "model", "with", "attention", "." ]
def embedding_attention_seq2seq(encoder_inputs, decoder_inputs, cell, num_encoder_symbols, num_decoder_symbols, embedding_size, ...
[ "def", "embedding_attention_seq2seq", "(", "encoder_inputs", ",", "decoder_inputs", ",", "cell", ",", "num_encoder_symbols", ",", "num_decoder_symbols", ",", "embedding_size", ",", "num_heads", "=", "1", ",", "output_projection", "=", "None", ",", "feed_previous", "="...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/legacy_seq2seq/python/ops/seq2seq.py#L793-L918
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/chigger/annotations/ImageAnnotation.py
python
ImageAnnotation.update
(self, **kwargs)
Updates the 3D camera to place the image in the defined location.
Updates the 3D camera to place the image in the defined location.
[ "Updates", "the", "3D", "camera", "to", "place", "the", "image", "in", "the", "defined", "location", "." ]
def update(self, **kwargs): """ Updates the 3D camera to place the image in the defined location. """ super(ImageAnnotation, self).update(**kwargs) renderer = self.getVTKRenderer() # Coordinate transormation object tr = vtk.vtkCoordinate() tr.SetCoordina...
[ "def", "update", "(", "self", ",", "*", "*", "kwargs", ")", ":", "super", "(", "ImageAnnotation", ",", "self", ")", ".", "update", "(", "*", "*", "kwargs", ")", "renderer", "=", "self", ".", "getVTKRenderer", "(", ")", "# Coordinate transormation object", ...
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/chigger/annotations/ImageAnnotation.py#L49-L109
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/metrics/python/ops/metric_ops.py
python
streaming_false_negatives
(predictions, labels, weights=None, metrics_collections=None, updates_collections=None, name=None)
return metrics.false_negatives( predictions=predictions, labels=labels, weights=weights, metrics_collections=metrics_collections, updates_collections=updates_collections, name=name)
Computes the total number of false negatives. If `weights` is `None`, weights default to 1. Use weights of 0 to mask values. Args: predictions: The predicted values, a `Tensor` of arbitrary dimensions. Will be cast to `bool`. labels: The ground truth values, a `Tensor` whose dimensions must match ...
Computes the total number of false negatives.
[ "Computes", "the", "total", "number", "of", "false", "negatives", "." ]
def streaming_false_negatives(predictions, labels, weights=None, metrics_collections=None, updates_collections=None, name=None): """Computes the total number of false n...
[ "def", "streaming_false_negatives", "(", "predictions", ",", "labels", ",", "weights", "=", "None", ",", "metrics_collections", "=", "None", ",", "updates_collections", "=", "None", ",", "name", "=", "None", ")", ":", "return", "metrics", ".", "false_negatives",...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/metrics/python/ops/metric_ops.py#L185-L224
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_windows.py
python
PyWindow.DoGetVirtualSize
(*args, **kwargs)
return _windows_.PyWindow_DoGetVirtualSize(*args, **kwargs)
DoGetVirtualSize(self) -> Size
DoGetVirtualSize(self) -> Size
[ "DoGetVirtualSize", "(", "self", ")", "-", ">", "Size" ]
def DoGetVirtualSize(*args, **kwargs): """DoGetVirtualSize(self) -> Size""" return _windows_.PyWindow_DoGetVirtualSize(*args, **kwargs)
[ "def", "DoGetVirtualSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "PyWindow_DoGetVirtualSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L4182-L4184
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/sgmllib.py
python
SGMLParser.reset
(self)
Reset this instance. Loses all unprocessed data.
Reset this instance. Loses all unprocessed data.
[ "Reset", "this", "instance", ".", "Loses", "all", "unprocessed", "data", "." ]
def reset(self): """Reset this instance. Loses all unprocessed data.""" self.__starttag_text = None self.rawdata = '' self.stack = [] self.lasttag = '???' self.nomoretags = 0 self.literal = 0 markupbase.ParserBase.reset(self)
[ "def", "reset", "(", "self", ")", ":", "self", ".", "__starttag_text", "=", "None", "self", ".", "rawdata", "=", "''", "self", ".", "stack", "=", "[", "]", "self", ".", "lasttag", "=", "'???'", "self", ".", "nomoretags", "=", "0", "self", ".", "lit...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/sgmllib.py#L71-L79
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/composite/multitype_ops/not_in_impl.py
python
_number_not_in_list
(x, y)
return not const_utils.scalar_in_sequence(x, y)
Determine if a number not in list. Args: x (Number): x y (list): y Returns: bool, if x not in y return true, x in y return false.
Determine if a number not in list.
[ "Determine", "if", "a", "number", "not", "in", "list", "." ]
def _number_not_in_list(x, y): """ Determine if a number not in list. Args: x (Number): x y (list): y Returns: bool, if x not in y return true, x in y return false. """ return not const_utils.scalar_in_sequence(x, y)
[ "def", "_number_not_in_list", "(", "x", ",", "y", ")", ":", "return", "not", "const_utils", ".", "scalar_in_sequence", "(", "x", ",", "y", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/composite/multitype_ops/not_in_impl.py#L46-L57
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
tools/symsrc/pefile.py
python
PE.parse_sections
(self, offset)
Fetch the PE file sections. The sections will be readily available in the "sections" attribute. Its attributes will contain all the section information plus "data" a buffer containing the section's data. The "Characteristics" member will be processed and attributes ...
Fetch the PE file sections. The sections will be readily available in the "sections" attribute. Its attributes will contain all the section information plus "data" a buffer containing the section's data. The "Characteristics" member will be processed and attributes ...
[ "Fetch", "the", "PE", "file", "sections", ".", "The", "sections", "will", "be", "readily", "available", "in", "the", "sections", "attribute", ".", "Its", "attributes", "will", "contain", "all", "the", "section", "information", "plus", "data", "a", "buffer", ...
def parse_sections(self, offset): """Fetch the PE file sections. The sections will be readily available in the "sections" attribute. Its attributes will contain all the section information plus "data" a buffer containing the section's data. The "Characteristics"...
[ "def", "parse_sections", "(", "self", ",", "offset", ")", ":", "self", ".", "sections", "=", "[", "]", "for", "i", "in", "xrange", "(", "self", ".", "FILE_HEADER", ".", "NumberOfSections", ")", ":", "section", "=", "SectionStructure", "(", "self", ".", ...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/symsrc/pefile.py#L1692-L1780
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/aui/framemanager.py
python
AuiCenterDockingGuide.CreateShapesWithStyle
(self)
Creates the docking guide window shape based on which docking bitmaps are used.
Creates the docking guide window shape based on which docking bitmaps are used.
[ "Creates", "the", "docking", "guide", "window", "shape", "based", "on", "which", "docking", "bitmaps", "are", "used", "." ]
def CreateShapesWithStyle(self): """ Creates the docking guide window shape based on which docking bitmaps are used. """ useAero = (GetManager(self.GetParent()).GetAGWFlags() & AUI_MGR_AERO_DOCKING_GUIDES) != 0 useWhidbey = (GetManager(self.GetParent()).GetAGWFlags() & AUI_MGR_WHIDBEY_DOCKING_G...
[ "def", "CreateShapesWithStyle", "(", "self", ")", ":", "useAero", "=", "(", "GetManager", "(", "self", ".", "GetParent", "(", ")", ")", ".", "GetAGWFlags", "(", ")", "&", "AUI_MGR_AERO_DOCKING_GUIDES", ")", "!=", "0", "useWhidbey", "=", "(", "GetManager", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/framemanager.py#L2413-L2506
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
xmlNode.addPrevSibling
(self, elem)
return __tmp
Add a new node @elem as the previous sibling of @cur merging adjacent TEXT nodes (@elem may be freed) If the new node was already inserted in a document it is first unlinked from its existing context. If the new node is ATTRIBUTE, it is added into properties instead of children. ...
Add a new node
[ "Add", "a", "new", "node" ]
def addPrevSibling(self, elem): """Add a new node @elem as the previous sibling of @cur merging adjacent TEXT nodes (@elem may be freed) If the new node was already inserted in a document it is first unlinked from its existing context. If the new node is ATTRIBUTE, it is ...
[ "def", "addPrevSibling", "(", "self", ",", "elem", ")", ":", "if", "elem", "is", "None", ":", "elem__o", "=", "None", "else", ":", "elem__o", "=", "elem", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlAddPrevSibling", "(", "self", ".", "_o", ",", "el...
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L3079-L3092
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/retdec-3.2/scripts/type_extractor/type_extractor/func_info.py
python
FuncInfo.header_text
(self)
return object_attr_string_repr(self.header)
Returns a textual representation of the header.
Returns a textual representation of the header.
[ "Returns", "a", "textual", "representation", "of", "the", "header", "." ]
def header_text(self): """Returns a textual representation of the header.""" return object_attr_string_repr(self.header)
[ "def", "header_text", "(", "self", ")", ":", "return", "object_attr_string_repr", "(", "self", ".", "header", ")" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/retdec-3.2/scripts/type_extractor/type_extractor/func_info.py#L29-L31
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/webapp2/webapp2.py
python
Request.get
(self, argument_name, default_value='', allow_multiple=False)
Returns the query or POST argument with the given name. We parse the query string and POST payload lazily, so this will be a slower operation on the first call. :param argument_name: The name of the query or POST argument. :param default_value: The value to retu...
Returns the query or POST argument with the given name.
[ "Returns", "the", "query", "or", "POST", "argument", "with", "the", "given", "name", "." ]
def get(self, argument_name, default_value='', allow_multiple=False): """Returns the query or POST argument with the given name. We parse the query string and POST payload lazily, so this will be a slower operation on the first call. :param argument_name: The name of the qu...
[ "def", "get", "(", "self", ",", "argument_name", ",", "default_value", "=", "''", ",", "allow_multiple", "=", "False", ")", ":", "param_value", "=", "self", ".", "get_all", "(", "argument_name", ")", "if", "allow_multiple", ":", "logging", ".", "warning", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/webapp2/webapp2.py#L158-L189
NERSC/timemory
431912b360ff50d1a160d7826e2eea04fbd1037f
timemory/profiler/profiler.py
python
Profiler.is_enabled
()
return False
Checks whether the profiler is enabled
Checks whether the profiler is enabled
[ "Checks", "whether", "the", "profiler", "is", "enabled" ]
def is_enabled(): """Checks whether the profiler is enabled""" try: return Profiler._conditional_functor() except Exception: pass return False
[ "def", "is_enabled", "(", ")", ":", "try", ":", "return", "Profiler", ".", "_conditional_functor", "(", ")", "except", "Exception", ":", "pass", "return", "False" ]
https://github.com/NERSC/timemory/blob/431912b360ff50d1a160d7826e2eea04fbd1037f/timemory/profiler/profiler.py#L97-L104
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/tools/gyp/pylib/gyp/xcode_emulation.py
python
GetXcodeArchsDefault
()
return XCODE_ARCHS_DEFAULT_CACHE
Returns the |XcodeArchsDefault| object to use to expand ARCHS for the installed version of Xcode. The default values used by Xcode for ARCHS and the expansion of the variables depends on the version of Xcode used. For all version anterior to Xcode 5.0 or posterior to Xcode 5.1 included uses $(ARCHS_STANDARD) i...
Returns the |XcodeArchsDefault| object to use to expand ARCHS for the installed version of Xcode. The default values used by Xcode for ARCHS and the expansion of the variables depends on the version of Xcode used.
[ "Returns", "the", "|XcodeArchsDefault|", "object", "to", "use", "to", "expand", "ARCHS", "for", "the", "installed", "version", "of", "Xcode", ".", "The", "default", "values", "used", "by", "Xcode", "for", "ARCHS", "and", "the", "expansion", "of", "the", "var...
def GetXcodeArchsDefault(): """Returns the |XcodeArchsDefault| object to use to expand ARCHS for the installed version of Xcode. The default values used by Xcode for ARCHS and the expansion of the variables depends on the version of Xcode used. For all version anterior to Xcode 5.0 or posterior to Xcode 5.1 in...
[ "def", "GetXcodeArchsDefault", "(", ")", ":", "global", "XCODE_ARCHS_DEFAULT_CACHE", "if", "XCODE_ARCHS_DEFAULT_CACHE", ":", "return", "XCODE_ARCHS_DEFAULT_CACHE", "xcode_version", ",", "_", "=", "XcodeVersion", "(", ")", "if", "xcode_version", "<", "'0500'", ":", "XC...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/xcode_emulation.py#L99-L145
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/mailbox.py
python
_lock_file
(f, dotlock=True)
Lock file f using lockf and dot locking.
Lock file f using lockf and dot locking.
[ "Lock", "file", "f", "using", "lockf", "and", "dot", "locking", "." ]
def _lock_file(f, dotlock=True): """Lock file f using lockf and dot locking.""" dotlock_done = False try: if fcntl: try: fcntl.lockf(f, fcntl.LOCK_EX | fcntl.LOCK_NB) except OSError as e: if e.errno in (errno.EAGAIN, errno.EACCES, errno.EROFS):...
[ "def", "_lock_file", "(", "f", ",", "dotlock", "=", "True", ")", ":", "dotlock_done", "=", "False", "try", ":", "if", "fcntl", ":", "try", ":", "fcntl", ".", "lockf", "(", "f", ",", "fcntl", ".", "LOCK_EX", "|", "fcntl", ".", "LOCK_NB", ")", "excep...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/mailbox.py#L2058-L2098
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/data_structures/sarray.py
python
SArray.__has_size__
(self)
return self.__proxy__.has_size()
Returns whether or not the size of the SArray is known.
Returns whether or not the size of the SArray is known.
[ "Returns", "whether", "or", "not", "the", "size", "of", "the", "SArray", "is", "known", "." ]
def __has_size__(self): """ Returns whether or not the size of the SArray is known. """ return self.__proxy__.has_size()
[ "def", "__has_size__", "(", "self", ")", ":", "return", "self", ".", "__proxy__", ".", "has_size", "(", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/data_structures/sarray.py#L1357-L1361
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Spinbox.selection_clear
(self)
return self.selection("clear")
Clear the selection If the selection isn't in this widget then the command has no effect. Returns an empty string.
Clear the selection
[ "Clear", "the", "selection" ]
def selection_clear(self): """Clear the selection If the selection isn't in this widget then the command has no effect. Returns an empty string. """ return self.selection("clear")
[ "def", "selection_clear", "(", "self", ")", ":", "return", "self", ".", "selection", "(", "\"clear\"", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py#L3511-L3517
ros-perception/vision_opencv
c791220cefd0abf02c6719e2ce0fea465857a88e
image_geometry/src/image_geometry/cameramodels.py
python
PinholeCameraModel.rectifyImage
(self, raw, rectified)
:param raw: input image :type raw: :class:`CvMat` or :class:`IplImage` :param rectified: rectified output image :type rectified: :class:`CvMat` or :class:`IplImage` Applies the rectification specified by camera parameters :math:`K` and and :math:`D` to image `raw` and writ...
:param raw: input image :type raw: :class:`CvMat` or :class:`IplImage` :param rectified: rectified output image :type rectified: :class:`CvMat` or :class:`IplImage`
[ ":", "param", "raw", ":", "input", "image", ":", "type", "raw", ":", ":", "class", ":", "CvMat", "or", ":", "class", ":", "IplImage", ":", "param", "rectified", ":", "rectified", "output", "image", ":", "type", "rectified", ":", ":", "class", ":", "C...
def rectifyImage(self, raw, rectified): """ :param raw: input image :type raw: :class:`CvMat` or :class:`IplImage` :param rectified: rectified output image :type rectified: :class:`CvMat` or :class:`IplImage` Applies the rectification specified by camera pa...
[ "def", "rectifyImage", "(", "self", ",", "raw", ",", "rectified", ")", ":", "self", ".", "mapx", "=", "numpy", ".", "ndarray", "(", "shape", "=", "(", "self", ".", "height", ",", "self", ".", "width", ",", "1", ")", ",", "dtype", "=", "'float32'", ...
https://github.com/ros-perception/vision_opencv/blob/c791220cefd0abf02c6719e2ce0fea465857a88e/image_geometry/src/image_geometry/cameramodels.py#L76-L92
SpenceKonde/megaTinyCore
1c4a70b18a149fe6bcb551dfa6db11ca50b8997b
megaavr/tools/libs/pyedbglib/protocols/ati.py
python
AsynchronousTransportInterface.read_response_buffer
(self, num_bytes=None)
return self.read_buffer(0, num_bytes, buffer_type=ATI_CTRL_TYPE_CMDRSP)
Read data from the response buffer :param num_bytes: Number of bytes to read from buffer :return: bytearray of data bytes read from the buffer
Read data from the response buffer
[ "Read", "data", "from", "the", "response", "buffer" ]
def read_response_buffer(self, num_bytes=None): """ Read data from the response buffer :param num_bytes: Number of bytes to read from buffer :return: bytearray of data bytes read from the buffer """ return self.read_buffer(0, num_bytes, buffer_type=ATI_CTRL_TYPE_CMDRSP)
[ "def", "read_response_buffer", "(", "self", ",", "num_bytes", "=", "None", ")", ":", "return", "self", ".", "read_buffer", "(", "0", ",", "num_bytes", ",", "buffer_type", "=", "ATI_CTRL_TYPE_CMDRSP", ")" ]
https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/pyedbglib/protocols/ati.py#L113-L120
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/training/supervisor.py
python
Supervisor.summary_op
(self)
return self._summary_op
Return the Summary Tensor used by the chief supervisor. Returns: A string Tensor for the summary or `None`.
Return the Summary Tensor used by the chief supervisor.
[ "Return", "the", "Summary", "Tensor", "used", "by", "the", "chief", "supervisor", "." ]
def summary_op(self): """Return the Summary Tensor used by the chief supervisor. Returns: A string Tensor for the summary or `None`. """ return self._summary_op
[ "def", "summary_op", "(", "self", ")", ":", "return", "self", ".", "_summary_op" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/training/supervisor.py#L566-L572
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py2/setuptools/command/easy_install.py
python
CommandSpec.best
(cls)
return cls
Choose the best CommandSpec class based on environmental conditions.
Choose the best CommandSpec class based on environmental conditions.
[ "Choose", "the", "best", "CommandSpec", "class", "based", "on", "environmental", "conditions", "." ]
def best(cls): """ Choose the best CommandSpec class based on environmental conditions. """ return cls
[ "def", "best", "(", "cls", ")", ":", "return", "cls" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/command/easy_install.py#L1982-L1986
NVIDIA/TensorRT
42805f078052daad1a98bc5965974fcffaad0960
samples/python/yolov3_onnx/data_processing.py
python
PreprocessYOLO._load_and_resize
(self, input_image_path)
return image_raw, image_resized
Load an image from the specified path and resize it to the input resolution. Return the input image before resizing as a PIL Image (required for visualization), and the resized image as a NumPy float array. Keyword arguments: input_image_path -- string path of the image to be loaded
Load an image from the specified path and resize it to the input resolution. Return the input image before resizing as a PIL Image (required for visualization), and the resized image as a NumPy float array.
[ "Load", "an", "image", "from", "the", "specified", "path", "and", "resize", "it", "to", "the", "input", "resolution", ".", "Return", "the", "input", "image", "before", "resizing", "as", "a", "PIL", "Image", "(", "required", "for", "visualization", ")", "an...
def _load_and_resize(self, input_image_path): """Load an image from the specified path and resize it to the input resolution. Return the input image before resizing as a PIL Image (required for visualization), and the resized image as a NumPy float array. Keyword arguments: inpu...
[ "def", "_load_and_resize", "(", "self", ",", "input_image_path", ")", ":", "image_raw", "=", "Image", ".", "open", "(", "input_image_path", ")", "# Expecting yolo_input_resolution in (height, width) format, adjusting to PIL", "# convention (width, height) in PIL:", "new_resolutio...
https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/samples/python/yolov3_onnx/data_processing.py#L65-L83
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/procrouting/wrappers_cfour.py
python
vpt2
(name, **kwargs)
Perform vibrational second-order perturbation computation through Cfour to get anharmonic frequencies. This version uses c4 for the disp and pt2 but gets gradients from p4. :type c4full: :ref:`boolean <op_py_boolean>` :param c4full: ``'on'`` || |dl| ``'off'`` |dr| Indicates whether when *name*...
Perform vibrational second-order perturbation computation through Cfour to get anharmonic frequencies. This version uses c4 for the disp and pt2 but gets gradients from p4.
[ "Perform", "vibrational", "second", "-", "order", "perturbation", "computation", "through", "Cfour", "to", "get", "anharmonic", "frequencies", ".", "This", "version", "uses", "c4", "for", "the", "disp", "and", "pt2", "but", "gets", "gradients", "from", "p4", "...
def vpt2(name, **kwargs): """Perform vibrational second-order perturbation computation through Cfour to get anharmonic frequencies. This version uses c4 for the disp and pt2 but gets gradients from p4. :type c4full: :ref:`boolean <op_py_boolean>` :param c4full: ``'on'`` || |dl| ``'off'`` |dr| ...
[ "def", "vpt2", "(", "name", ",", "*", "*", "kwargs", ")", ":", "lowername", "=", "name", ".", "lower", "(", ")", "kwargs", "=", "p4util", ".", "kwargs_lower", "(", "kwargs", ")", "optstash", "=", "p4util", ".", "OptionsState", "(", "[", "'BASIS'", "]...
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/procrouting/wrappers_cfour.py#L84-L496
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
CondCore/Utilities/scripts/uploadConditions.py
python
HTTP.discardCookies
(self)
Discards cookies.
Discards cookies.
[ "Discards", "cookies", "." ]
def discardCookies(self): '''Discards cookies. ''' self.curl.setopt(self.curl.COOKIELIST, 'ALL')
[ "def", "discardCookies", "(", "self", ")", ":", "self", ".", "curl", ".", "setopt", "(", "self", ".", "curl", ".", "COOKIELIST", ",", "'ALL'", ")" ]
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/CondCore/Utilities/scripts/uploadConditions.py#L248-L251
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/util/filelike/fifo.py
python
FIFO.seek
(self, offset, whence=os.SEEK_SET)
Unsupported because this is a FIFO.
Unsupported because this is a FIFO.
[ "Unsupported", "because", "this", "is", "a", "FIFO", "." ]
def seek(self, offset, whence=os.SEEK_SET): """ Unsupported because this is a FIFO. """ del offset, whence # unused raise UnsupportedOperation("unseekable stream")
[ "def", "seek", "(", "self", ",", "offset", ",", "whence", "=", "os", ".", "SEEK_SET", ")", ":", "del", "offset", ",", "whence", "# unused", "raise", "UnsupportedOperation", "(", "\"unseekable stream\"", ")" ]
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/util/filelike/fifo.py#L51-L57
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/compatibility/tf_upgrade_v2.py
python
_contrib_layers_xavier_initializer_transformer
( parent, node, full_name, name, logs)
return node
Updates references to contrib.layers.xavier_initializer. Transforms: tf.contrib.layers.xavier_initializer(uniform, seed, dtype) to tf.compat.v1.keras.initializers.VarianceScaling( scale=1.0, mode="fan_avg", distribution=("uniform" if uniform else "truncated_normal"), seed=seed, dtype=dtype) ...
Updates references to contrib.layers.xavier_initializer.
[ "Updates", "references", "to", "contrib", ".", "layers", ".", "xavier_initializer", "." ]
def _contrib_layers_xavier_initializer_transformer( parent, node, full_name, name, logs): """Updates references to contrib.layers.xavier_initializer. Transforms: tf.contrib.layers.xavier_initializer(uniform, seed, dtype) to tf.compat.v1.keras.initializers.VarianceScaling( scale=1.0, mode="fan_avg", ...
[ "def", "_contrib_layers_xavier_initializer_transformer", "(", "parent", ",", "node", ",", "full_name", ",", "name", ",", "logs", ")", ":", "def", "_get_distribution", "(", "old_value", ")", ":", "\"\"\"Returns an AST matching the following:\n (\"uniform\" if (old_value) el...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/compatibility/tf_upgrade_v2.py#L2161-L2236
MythTV/mythtv
d282a209cb8be85d036f85a62a8ec971b67d45f4
mythtv/bindings/python/MythTV/database.py
python
DBCache.getStorageGroup
(self, groupname=None, hostname=None)
obj.getStorageGroup(groupname=None, hostname=None) -> tuple of StorageGroup objects groupname and hostname can be used as optional filters
obj.getStorageGroup(groupname=None, hostname=None) -> tuple of StorageGroup objects groupname and hostname can be used as optional filters
[ "obj", ".", "getStorageGroup", "(", "groupname", "=", "None", "hostname", "=", "None", ")", "-", ">", "tuple", "of", "StorageGroup", "objects", "groupname", "and", "hostname", "can", "be", "used", "as", "optional", "filters" ]
def getStorageGroup(self, groupname=None, hostname=None): """ obj.getStorageGroup(groupname=None, hostname=None) -> tuple of StorageGroup objects groupname and hostname can be used as optional filters """ where = [] wheredat = [...
[ "def", "getStorageGroup", "(", "self", ",", "groupname", "=", "None", ",", "hostname", "=", "None", ")", ":", "where", "=", "[", "]", "wheredat", "=", "[", "]", "if", "groupname", ":", "where", ".", "append", "(", "\"groupname=?\"", ")", "wheredat", "....
https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/bindings/python/MythTV/database.py#L1357-L1381
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
GraphicsPen.__init__
(self, *args, **kwargs)
__init__(self) -> GraphicsPen A wx.GraphicsPen is a native representation of a pen. It is used for stroking a path on a `wx.GraphicsContext`. The contents are specific and private to the respective renderer. The only way to get a valid instance is via a CreatePen call on the graphics co...
__init__(self) -> GraphicsPen
[ "__init__", "(", "self", ")", "-", ">", "GraphicsPen" ]
def __init__(self, *args, **kwargs): """ __init__(self) -> GraphicsPen A wx.GraphicsPen is a native representation of a pen. It is used for stroking a path on a `wx.GraphicsContext`. The contents are specific and private to the respective renderer. The only way to get a valid i...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_gdi_", ".", "GraphicsPen_swiginit", "(", "self", ",", "_gdi_", ".", "new_GraphicsPen", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L5498-L5508
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/learning_rate_decay.py
python
natural_exp_decay
(learning_rate, global_step, decay_steps, decay_rate, staircase=False, name=None)
return decayed_lr
Applies natural exponential decay to the initial learning rate. When training a model, it is often recommended to lower the learning rate as the training progresses. This function applies an exponential decay function to a provided initial learning rate. It requires an `global_step` value to compute the deca...
Applies natural exponential decay to the initial learning rate.
[ "Applies", "natural", "exponential", "decay", "to", "the", "initial", "learning", "rate", "." ]
def natural_exp_decay(learning_rate, global_step, decay_steps, decay_rate, staircase=False, name=None): """Applies natural exponential decay to the initial learning rate. When training a model, it is often...
[ "def", "natural_exp_decay", "(", "learning_rate", ",", "global_step", ",", "decay_steps", ",", "decay_rate", ",", "staircase", "=", "False", ",", "name", "=", "None", ")", ":", "natural_exp_rate", "=", "math_ops", ".", "exp", "(", "math_ops", ".", "negative", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/learning_rate_decay.py#L284-L368
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/binhex.py
python
hexbin
(inp, out)
(infilename, outfilename) - Decode binhexed file
(infilename, outfilename) - Decode binhexed file
[ "(", "infilename", "outfilename", ")", "-", "Decode", "binhexed", "file" ]
def hexbin(inp, out): """(infilename, outfilename) - Decode binhexed file""" ifp = HexBin(inp) finfo = ifp.FInfo if not out: out = ifp.FName ofp = open(out, 'wb') # XXXX Do translation on non-mac systems while 1: d = ifp.read(128000) if not d: break ofp.write...
[ "def", "hexbin", "(", "inp", ",", "out", ")", ":", "ifp", "=", "HexBin", "(", "inp", ")", "finfo", "=", "ifp", ".", "FInfo", "if", "not", "out", ":", "out", "=", "ifp", ".", "FName", "ofp", "=", "open", "(", "out", ",", "'wb'", ")", "# XXXX Do ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/binhex.py#L472-L498
apache/kudu
90895ce76590f10730ad7aac3613b69d89ff5422
src/kudu/scripts/dump_breakpad_symbols.py
python
is_elf_file
(path)
return is_regular_file(path) and 'ELF' in magic.from_file(path)
Check whether 'path' is an ELF file.
Check whether 'path' is an ELF file.
[ "Check", "whether", "path", "is", "an", "ELF", "file", "." ]
def is_elf_file(path): """Check whether 'path' is an ELF file.""" return is_regular_file(path) and 'ELF' in magic.from_file(path)
[ "def", "is_elf_file", "(", "path", ")", ":", "return", "is_regular_file", "(", "path", ")", "and", "'ELF'", "in", "magic", ".", "from_file", "(", "path", ")" ]
https://github.com/apache/kudu/blob/90895ce76590f10730ad7aac3613b69d89ff5422/src/kudu/scripts/dump_breakpad_symbols.py#L166-L168
ucsb-seclab/difuze
bb59a12ff87ad5ae45d9c60e349891bf80d72877
helper_scripts/components/driver_linker.py
python
DriverLinker.perform
(self)
p = subprocess.Popen(self.dr_link_bin + " " + self.llvm_bc_out + " " + str(self.chipset_numer), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) (stdout, stderr) = p.communicate()
p = subprocess.Popen(self.dr_link_bin + " " + self.llvm_bc_out + " " + str(self.chipset_numer), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) (stdout, stderr) = p.communicate()
[ "p", "=", "subprocess", ".", "Popen", "(", "self", ".", "dr_link_bin", "+", "+", "self", ".", "llvm_bc_out", "+", "+", "str", "(", "self", ".", "chipset_numer", ")", "stdout", "=", "subprocess", ".", "PIPE", "stderr", "=", "subprocess", ".", "PIPE", "s...
def perform(self): log_info("Running dr_linker. This might take time. Please wait.") cmd_to_run = self.dr_link_bin + " " + self.llvm_bc_out + " " + str(self.chipset_numer) returncode = os.system(cmd_to_run) '''p = subprocess.Popen(self.dr_link_bin + " " + self.llvm_bc_out + " " + str(sel...
[ "def", "perform", "(", "self", ")", ":", "log_info", "(", "\"Running dr_linker. This might take time. Please wait.\"", ")", "cmd_to_run", "=", "self", ".", "dr_link_bin", "+", "\" \"", "+", "self", ".", "llvm_bc_out", "+", "\" \"", "+", "str", "(", "self", ".", ...
https://github.com/ucsb-seclab/difuze/blob/bb59a12ff87ad5ae45d9c60e349891bf80d72877/helper_scripts/components/driver_linker.py#L34-L47
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py3/IPython/core/interactiveshell.py
python
InteractiveShell.drop_by_id
(self, variables)
Remove a dict of variables from the user namespace, if they are the same as the values in the dictionary. This is intended for use by extensions: variables that they've added can be taken back out if they are unloaded, without removing any that the user has overwritten. ...
Remove a dict of variables from the user namespace, if they are the same as the values in the dictionary. This is intended for use by extensions: variables that they've added can be taken back out if they are unloaded, without removing any that the user has overwritten. ...
[ "Remove", "a", "dict", "of", "variables", "from", "the", "user", "namespace", "if", "they", "are", "the", "same", "as", "the", "values", "in", "the", "dictionary", ".", "This", "is", "intended", "for", "use", "by", "extensions", ":", "variables", "that", ...
def drop_by_id(self, variables): """Remove a dict of variables from the user namespace, if they are the same as the values in the dictionary. This is intended for use by extensions: variables that they've added can be taken back out if they are unloaded, without removing any tha...
[ "def", "drop_by_id", "(", "self", ",", "variables", ")", ":", "for", "name", ",", "obj", "in", "variables", ".", "items", "(", ")", ":", "if", "name", "in", "self", ".", "user_ns", "and", "self", ".", "user_ns", "[", "name", "]", "is", "obj", ":", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/interactiveshell.py#L1600-L1616
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/configprovider.py
python
ScopedConfigProvider.provide
(self)
return scoped_config.get(self._config_var_name)
Provide a value from a config file property.
Provide a value from a config file property.
[ "Provide", "a", "value", "from", "a", "config", "file", "property", "." ]
def provide(self): """Provide a value from a config file property.""" scoped_config = self._session.get_scoped_config() if isinstance(self._config_var_name, tuple): section_config = scoped_config.get(self._config_var_name[0]) if not isinstance(section_config, dict): ...
[ "def", "provide", "(", "self", ")", ":", "scoped_config", "=", "self", ".", "_session", ".", "get_scoped_config", "(", ")", "if", "isinstance", "(", "self", ".", "_config_var_name", ",", "tuple", ")", ":", "section_config", "=", "scoped_config", ".", "get", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/configprovider.py#L449-L457
deepmind/streetlearn
ccf1d60b9c45154894d45a897748aee85d7eb69b
streetlearn/python/environment/courier_game.py
python
CourierGame._compute_spl_current_goal
(self, streetlearn)
return shortest_path_len / max(actual_path_len, shortest_path_len)
Compute the success weighted by inverse path length for the current goal. We use the SPL definition from Eq. 1 in the following paper: Anderson et al. (2018) "On Evaluation of Embodied Navigation Agents" https://arxiv.org/pdf/1807.06757.pdf Args: streetlearn: The StreetLearn environment. Ret...
Compute the success weighted by inverse path length for the current goal.
[ "Compute", "the", "success", "weighted", "by", "inverse", "path", "length", "for", "the", "current", "goal", "." ]
def _compute_spl_current_goal(self, streetlearn): """Compute the success weighted by inverse path length for the current goal. We use the SPL definition from Eq. 1 in the following paper: Anderson et al. (2018) "On Evaluation of Embodied Navigation Agents" https://arxiv.org/pdf/1807.06757.pdf Args...
[ "def", "_compute_spl_current_goal", "(", "self", ",", "streetlearn", ")", ":", "# Since reaching the goal is defined as being within a circle around the", "# goal pano, we subtract the panoramas within that circle from the shortest", "# path length estimate, as well as from the actual path lengt...
https://github.com/deepmind/streetlearn/blob/ccf1d60b9c45154894d45a897748aee85d7eb69b/streetlearn/python/environment/courier_game.py#L263-L285
livecode/livecode
4606a10ea10b16d5071d0f9f263ccdd7ede8b31d
gyp/pylib/gyp/generator/ninja.py
python
NinjaWriter.WriteNewNinjaRule
(self, name, args, description, is_cygwin, env, pool, depfile=None)
return rule_name, args
Write out a new ninja "rule" statement for a given command. Returns the name of the new rule, and a copy of |args| with variables expanded.
Write out a new ninja "rule" statement for a given command.
[ "Write", "out", "a", "new", "ninja", "rule", "statement", "for", "a", "given", "command", "." ]
def WriteNewNinjaRule(self, name, args, description, is_cygwin, env, pool, depfile=None): """Write out a new ninja "rule" statement for a given command. Returns the name of the new rule, and a copy of |args| with variables expanded.""" if self.flavor == 'win': args = [sel...
[ "def", "WriteNewNinjaRule", "(", "self", ",", "name", ",", "args", ",", "description", ",", "is_cygwin", ",", "env", ",", "pool", ",", "depfile", "=", "None", ")", ":", "if", "self", ".", "flavor", "==", "'win'", ":", "args", "=", "[", "self", ".", ...
https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/generator/ninja.py#L1511-L1575
cyberbotics/webots
af7fa7d68dcf7b4550f1f2e132092b41e83698fc
resources/osm_importer/osm_objects.py
python
OSMMultipolygon.add_intermediate_point
(self)
If last and first points are not the same we need to compute an intermediate point location.
If last and first points are not the same we need to compute an intermediate point location.
[ "If", "last", "and", "first", "points", "are", "not", "the", "same", "we", "need", "to", "compute", "an", "intermediate", "point", "location", "." ]
def add_intermediate_point(self): """If last and first points are not the same we need to compute an intermediate point location.""" """The point is used to close the polygon.""" coordBegin = OSMCoord.coordDictionnary[self.ref[0]] coordEnd = OSMCoord.coordDictionnary[self.ref[-1]] ...
[ "def", "add_intermediate_point", "(", "self", ")", ":", "\"\"\"The point is used to close the polygon.\"\"\"", "coordBegin", "=", "OSMCoord", ".", "coordDictionnary", "[", "self", ".", "ref", "[", "0", "]", "]", "coordEnd", "=", "OSMCoord", ".", "coordDictionnary", ...
https://github.com/cyberbotics/webots/blob/af7fa7d68dcf7b4550f1f2e132092b41e83698fc/resources/osm_importer/osm_objects.py#L198-L220
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_cmdbar.py
python
CommandBarBase.OnShowBar
(self, evt)
Update the session list
Update the session list
[ "Update", "the", "session", "list" ]
def OnShowBar(self, evt): """Update the session list""" if evt.IsShown(): if self and evt.EventObject is self: self.OnBarShown() evt.Skip()
[ "def", "OnShowBar", "(", "self", ",", "evt", ")", ":", "if", "evt", ".", "IsShown", "(", ")", ":", "if", "self", "and", "evt", ".", "EventObject", "is", "self", ":", "self", ".", "OnBarShown", "(", ")", "evt", ".", "Skip", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_cmdbar.py#L168-L173
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/framework/docs.py
python
Index.__init__
(self, module_to_name, members, filename_to_library_map, path_prefix)
Creates a new Index. Args: module_to_name: Dictionary mapping modules to short names. members: Dictionary mapping member name to (fullname, member). filename_to_library_map: A list of (filename, Library) pairs. The order corresponds to the order in which the libraries appear in the index....
Creates a new Index.
[ "Creates", "a", "new", "Index", "." ]
def __init__(self, module_to_name, members, filename_to_library_map, path_prefix): """Creates a new Index. Args: module_to_name: Dictionary mapping modules to short names. members: Dictionary mapping member name to (fullname, member). filename_to_library_map: A list of (filenam...
[ "def", "__init__", "(", "self", ",", "module_to_name", ",", "members", ",", "filename_to_library_map", ",", "path_prefix", ")", ":", "self", ".", "_module_to_name", "=", "module_to_name", "self", ".", "_members", "=", "members", "self", ".", "_filename_to_library_...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/framework/docs.py#L56-L70
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/propgrid.py
python
PGProperty.GetAttributesAsList
(*args, **kwargs)
return _propgrid.PGProperty_GetAttributesAsList(*args, **kwargs)
GetAttributesAsList(self) -> wxVariant
GetAttributesAsList(self) -> wxVariant
[ "GetAttributesAsList", "(", "self", ")", "-", ">", "wxVariant" ]
def GetAttributesAsList(*args, **kwargs): """GetAttributesAsList(self) -> wxVariant""" return _propgrid.PGProperty_GetAttributesAsList(*args, **kwargs)
[ "def", "GetAttributesAsList", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGProperty_GetAttributesAsList", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L547-L549
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/timeseries/python/timeseries/model.py
python
TimeSeriesModel._process_exogenous_features
(self, times, features)
return exogenous_regressors
Create a single vector from exogenous features. Args: times: A [batch size, window size] vector of times for this batch, primarily used to check the shape information of exogenous features. features: A dictionary of exogenous features corresponding to the columns in self._exogenous_...
Create a single vector from exogenous features.
[ "Create", "a", "single", "vector", "from", "exogenous", "features", "." ]
def _process_exogenous_features(self, times, features): """Create a single vector from exogenous features. Args: times: A [batch size, window size] vector of times for this batch, primarily used to check the shape information of exogenous features. features: A dictionary of exogenous feat...
[ "def", "_process_exogenous_features", "(", "self", ",", "times", ",", "features", ")", ":", "if", "self", ".", "_exogenous_feature_columns", ":", "exogenous_features_single_batch_dimension", "=", "{", "}", "for", "name", ",", "tensor", "in", "features", ".", "item...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/timeseries/python/timeseries/model.py#L220-L281
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/util/fslike/path.py
python
Path.resolve_native_path_w
(self)
return None
Resolve the path for write access and try to return a native equivalent. If no native path could be determined, return None.
Resolve the path for write access and try to return a native equivalent. If no native path could be determined, return None.
[ "Resolve", "the", "path", "for", "write", "access", "and", "try", "to", "return", "a", "native", "equivalent", ".", "If", "no", "native", "path", "could", "be", "determined", "return", "None", "." ]
def resolve_native_path_w(self): """ Resolve the path for write access and try to return a native equivalent. If no native path could be determined, return None. """ resolved_path = self._resolve_w() if resolved_path: # pylint: disable=protected-access...
[ "def", "resolve_native_path_w", "(", "self", ")", ":", "resolved_path", "=", "self", ".", "_resolve_w", "(", ")", "if", "resolved_path", ":", "# pylint: disable=protected-access", "return", "resolved_path", ".", "_get_native_path", "(", ")", "return", "None" ]
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/util/fslike/path.py#L190-L200
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
python/mxnet/module/bucketing_module.py
python
BucketingModule.data_shapes
(self)
return self._curr_module.data_shapes
Get data shapes. Returns ------- A list of `(name, shape)` pairs.
Get data shapes.
[ "Get", "data", "shapes", "." ]
def data_shapes(self): """Get data shapes. Returns ------- A list of `(name, shape)` pairs. """ assert self.binded return self._curr_module.data_shapes
[ "def", "data_shapes", "(", "self", ")", ":", "assert", "self", ".", "binded", "return", "self", ".", "_curr_module", ".", "data_shapes" ]
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/module/bucketing_module.py#L123-L131
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
Rect2D.Contains
(*args, **kwargs)
return _core_.Rect2D_Contains(*args, **kwargs)
Contains(self, Point2D pt) -> bool
Contains(self, Point2D pt) -> bool
[ "Contains", "(", "self", "Point2D", "pt", ")", "-", ">", "bool" ]
def Contains(*args, **kwargs): """Contains(self, Point2D pt) -> bool""" return _core_.Rect2D_Contains(*args, **kwargs)
[ "def", "Contains", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Rect2D_Contains", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L1967-L1969