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
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/_ranges.py
python
_generate_range_overflow_safe_signed
( endpoint: int, periods: int, stride: int, side: str )
A special case for _generate_range_overflow_safe where `periods * stride` can be calculated without overflowing int64 bounds.
A special case for _generate_range_overflow_safe where `periods * stride` can be calculated without overflowing int64 bounds.
[ "A", "special", "case", "for", "_generate_range_overflow_safe", "where", "periods", "*", "stride", "can", "be", "calculated", "without", "overflowing", "int64", "bounds", "." ]
def _generate_range_overflow_safe_signed( endpoint: int, periods: int, stride: int, side: str ) -> int: """ A special case for _generate_range_overflow_safe where `periods * stride` can be calculated without overflowing int64 bounds. """ assert side in ["start", "end"] if side == "end": ...
[ "def", "_generate_range_overflow_safe_signed", "(", "endpoint", ":", "int", ",", "periods", ":", "int", ",", "stride", ":", "int", ",", "side", ":", "str", ")", "->", "int", ":", "assert", "side", "in", "[", "\"start\"", ",", "\"end\"", "]", "if", "side"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/_ranges.py#L153-L190
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/mailbox.py
python
Maildir._lookup
(self, key)
Use TOC to return subpath for given key, or raise a KeyError.
Use TOC to return subpath for given key, or raise a KeyError.
[ "Use", "TOC", "to", "return", "subpath", "for", "given", "key", "or", "raise", "a", "KeyError", "." ]
def _lookup(self, key): """Use TOC to return subpath for given key, or raise a KeyError.""" try: if os.path.exists(os.path.join(self._path, self._toc[key])): return self._toc[key] except KeyError: pass self._refresh() try: retur...
[ "def", "_lookup", "(", "self", ",", "key", ")", ":", "try", ":", "if", "os", ".", "path", ".", "exists", "(", "os", ".", "path", ".", "join", "(", "self", ".", "_path", ",", "self", ".", "_toc", "[", "key", "]", ")", ")", ":", "return", "self...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/mailbox.py#L547-L558
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Arch/importIFCHelper.py
python
buildRelGroups
(ifcfile)
return groups
Build the groups relation table.
Build the groups relation table.
[ "Build", "the", "groups", "relation", "table", "." ]
def buildRelGroups(ifcfile): """Build the groups relation table.""" groups = {} # { host:[child,...], ... } # used in structural IFC for r in ifcfile.by_type("IfcRelAssignsToGroup"): groups.setdefault(r.RelatingGroup.id(), []).extend([e.id() for e in r.RelatedObjects]) return groups
[ "def", "buildRelGroups", "(", "ifcfile", ")", ":", "groups", "=", "{", "}", "# { host:[child,...], ... } # used in structural IFC", "for", "r", "in", "ifcfile", ".", "by_type", "(", "\"IfcRelAssignsToGroup\"", ")", ":", "groups", ".", "setdefault", "(", "r", "...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/importIFCHelper.py#L219-L226
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/fixer_util.py
python
is_import
(node)
return node.type in (syms.import_name, syms.import_from)
Returns true if the node is an import statement.
Returns true if the node is an import statement.
[ "Returns", "true", "if", "the", "node", "is", "an", "import", "statement", "." ]
def is_import(node): """Returns true if the node is an import statement.""" return node.type in (syms.import_name, syms.import_from)
[ "def", "is_import", "(", "node", ")", ":", "return", "node", ".", "type", "in", "(", "syms", ".", "import_name", ",", "syms", ".", "import_from", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/fixer_util.py#L290-L292
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/propgrid.py
python
PropertyGridManager.GetCurrentPage
(*args, **kwargs)
return _propgrid.PropertyGridManager_GetCurrentPage(*args, **kwargs)
GetCurrentPage(self) -> PropertyGridPage
GetCurrentPage(self) -> PropertyGridPage
[ "GetCurrentPage", "(", "self", ")", "-", ">", "PropertyGridPage" ]
def GetCurrentPage(*args, **kwargs): """GetCurrentPage(self) -> PropertyGridPage""" return _propgrid.PropertyGridManager_GetCurrentPage(*args, **kwargs)
[ "def", "GetCurrentPage", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGridManager_GetCurrentPage", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L3477-L3479
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/setuptools/command/build_ext.py
python
get_abi3_suffix
()
Return the file extension for an abi3-compliant Extension()
Return the file extension for an abi3-compliant Extension()
[ "Return", "the", "file", "extension", "for", "an", "abi3", "-", "compliant", "Extension", "()" ]
def get_abi3_suffix(): """Return the file extension for an abi3-compliant Extension()""" for suffix in EXTENSION_SUFFIXES: if '.abi3' in suffix: # Unix return suffix elif suffix == '.pyd': # Windows return suffix
[ "def", "get_abi3_suffix", "(", ")", ":", "for", "suffix", "in", "EXTENSION_SUFFIXES", ":", "if", "'.abi3'", "in", "suffix", ":", "# Unix", "return", "suffix", "elif", "suffix", "==", "'.pyd'", ":", "# Windows", "return", "suffix" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/command/build_ext.py#L66-L72
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
Image.SaveFile
(*args, **kwargs)
return _core_.Image_SaveFile(*args, **kwargs)
SaveFile(self, String name, int type) -> bool Saves an image in the named file.
SaveFile(self, String name, int type) -> bool
[ "SaveFile", "(", "self", "String", "name", "int", "type", ")", "-", ">", "bool" ]
def SaveFile(*args, **kwargs): """ SaveFile(self, String name, int type) -> bool Saves an image in the named file. """ return _core_.Image_SaveFile(*args, **kwargs)
[ "def", "SaveFile", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Image_SaveFile", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L3195-L3201
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/filelist.py
python
FileList.include_pattern
(self, pattern, anchor=1, prefix=None, is_regex=0)
return files_found
Select strings (presumably filenames) from 'self.files' that match 'pattern', a Unix-style wildcard (glob) pattern. Patterns are not quite the same as implemented by the 'fnmatch' module: '*' and '?' match non-special characters, where "special" is platform-dependent: slash on Unix; co...
Select strings (presumably filenames) from 'self.files' that match 'pattern', a Unix-style wildcard (glob) pattern.
[ "Select", "strings", "(", "presumably", "filenames", ")", "from", "self", ".", "files", "that", "match", "pattern", "a", "Unix", "-", "style", "wildcard", "(", "glob", ")", "pattern", "." ]
def include_pattern(self, pattern, anchor=1, prefix=None, is_regex=0): """Select strings (presumably filenames) from 'self.files' that match 'pattern', a Unix-style wildcard (glob) pattern. Patterns are not quite the same as implemented by the 'fnmatch' module: '*' and '?' match non-sp...
[ "def", "include_pattern", "(", "self", ",", "pattern", ",", "anchor", "=", "1", ",", "prefix", "=", "None", ",", "is_regex", "=", "0", ")", ":", "# XXX docstring lying about what the special chars are?", "files_found", "=", "0", "pattern_re", "=", "translate_patte...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/filelist.py#L187-L229
fatih/subvim
241b6d170597857105da219c9b7d36059e9f11fb
vim/base/YouCompleteMe/third_party/requests/requests/utils.py
python
dict_from_cookiejar
(cj)
return cookie_dict
Returns a key/value dictionary from a CookieJar. :param cj: CookieJar object to extract cookies from.
Returns a key/value dictionary from a CookieJar.
[ "Returns", "a", "key", "/", "value", "dictionary", "from", "a", "CookieJar", "." ]
def dict_from_cookiejar(cj): """Returns a key/value dictionary from a CookieJar. :param cj: CookieJar object to extract cookies from. """ cookie_dict = {} for cookie in cj: cookie_dict[cookie.name] = cookie.value return cookie_dict
[ "def", "dict_from_cookiejar", "(", "cj", ")", ":", "cookie_dict", "=", "{", "}", "for", "cookie", "in", "cj", ":", "cookie_dict", "[", "cookie", ".", "name", "]", "=", "cookie", ".", "value", "return", "cookie_dict" ]
https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/requests/requests/utils.py#L236-L247
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/training/quantize_training.py
python
do_quantize_training_on_graphdef
(input_graph, num_bits)
return graph
A general quantization scheme is being developed in `tf.contrib.quantize`. Consider using that instead, though since it is in the tf.contrib namespace, it is not subject to backward compatibility guarantees. Args: input_graph: A `GraphDef`. num_bits: The number of bits for quantize training. Returns:...
A general quantization scheme is being developed in `tf.contrib.quantize`.
[ "A", "general", "quantization", "scheme", "is", "being", "developed", "in", "tf", ".", "contrib", ".", "quantize", "." ]
def do_quantize_training_on_graphdef(input_graph, num_bits): """A general quantization scheme is being developed in `tf.contrib.quantize`. Consider using that instead, though since it is in the tf.contrib namespace, it is not subject to backward compatibility guarantees. Args: input_graph: A `GraphDef`. ...
[ "def", "do_quantize_training_on_graphdef", "(", "input_graph", ",", "num_bits", ")", ":", "graph", "=", "graph_pb2", ".", "GraphDef", "(", ")", "result_graph_string", "=", "DoQuantizeTrainingOnGraphDefHelper", "(", "input_graph", ".", "SerializeToString", "(", ")", ",...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/training/quantize_training.py#L27-L46
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/special/orthogonal.py
python
chebys
(n, monic=False)
return p
r"""Chebyshev polynomial of the second kind on :math:`[-2, 2]`. Defined as :math:`S_n(x) = U_n(x/2)` where :math:`U_n` is the nth Chebychev polynomial of the second kind. Parameters ---------- n : int Degree of the polynomial. monic : bool, optional If `True`, scale the leading...
r"""Chebyshev polynomial of the second kind on :math:`[-2, 2]`.
[ "r", "Chebyshev", "polynomial", "of", "the", "second", "kind", "on", ":", "math", ":", "[", "-", "2", "2", "]", "." ]
def chebys(n, monic=False): r"""Chebyshev polynomial of the second kind on :math:`[-2, 2]`. Defined as :math:`S_n(x) = U_n(x/2)` where :math:`U_n` is the nth Chebychev polynomial of the second kind. Parameters ---------- n : int Degree of the polynomial. monic : bool, optional ...
[ "def", "chebys", "(", "n", ",", "monic", "=", "False", ")", ":", "if", "n", "<", "0", ":", "raise", "ValueError", "(", "\"n must be nonnegative.\"", ")", "if", "n", "==", "0", ":", "n1", "=", "n", "+", "1", "else", ":", "n1", "=", "n", "x", ","...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/special/orthogonal.py#L1678-L1731
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/util/decorator_utils.py
python
_normalize_docstring
(docstring)
return '\n'.join(trimmed)
Normalizes the docstring. Replaces tabs with spaces, removes leading and trailing blanks lines, and removes any indentation. Copied from PEP-257: https://www.python.org/dev/peps/pep-0257/#handling-docstring-indentation Args: docstring: the docstring to normalize Returns: The normalized docstring
Normalizes the docstring.
[ "Normalizes", "the", "docstring", "." ]
def _normalize_docstring(docstring): """Normalizes the docstring. Replaces tabs with spaces, removes leading and trailing blanks lines, and removes any indentation. Copied from PEP-257: https://www.python.org/dev/peps/pep-0257/#handling-docstring-indentation Args: docstring: the docstring to normaliz...
[ "def", "_normalize_docstring", "(", "docstring", ")", ":", "if", "not", "docstring", ":", "return", "''", "# Convert tabs to spaces (following the normal Python rules)", "# and split into a list of lines:", "lines", "=", "docstring", ".", "expandtabs", "(", ")", ".", "spl...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/util/decorator_utils.py#L31-L69
rachitiitr/DataStructures-Algorithms
ca63481f86eb6d3fdcb42e20ea87de24d60eccf3
Library/Math/projecteuelr/Euler.py
python
n2words
(num,join=True)
return words
words = {} convert an integer number into words
words = {} convert an integer number into words
[ "words", "=", "{}", "convert", "an", "integer", "number", "into", "words" ]
def n2words(num,join=True): '''words = {} convert an integer number into words''' units = ['','One','Two','Three','Four','Five','Six','Seven','Eight','Nine'] teens = ['','Eleven','Twelve','Thirteen','Fourteen','Fifteen','Sixteen', \ 'Seventeen','Eighteen','Nineteen'] tens = ['','Ten','Twent...
[ "def", "n2words", "(", "num", ",", "join", "=", "True", ")", ":", "units", "=", "[", "''", ",", "'One'", ",", "'Two'", ",", "'Three'", ",", "'Four'", ",", "'Five'", ",", "'Six'", ",", "'Seven'", ",", "'Eight'", ",", "'Nine'", "]", "teens", "=", "...
https://github.com/rachitiitr/DataStructures-Algorithms/blob/ca63481f86eb6d3fdcb42e20ea87de24d60eccf3/Library/Math/projecteuelr/Euler.py#L292-L328
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/distribute_coordinator.py
python
_WorkerContext.task_type
(self)
return self._task_type
Returns the role of the corresponing task.
Returns the role of the corresponing task.
[ "Returns", "the", "role", "of", "the", "corresponing", "task", "." ]
def task_type(self): """Returns the role of the corresponing task.""" return self._task_type
[ "def", "task_type", "(", "self", ")", ":", "return", "self", ".", "_task_type" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/distribute_coordinator.py#L286-L288
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
demo/Ticker.py
python
TestPanel.OnText
(self, evt)
Live update of the ticker text
Live update of the ticker text
[ "Live", "update", "of", "the", "ticker", "text" ]
def OnText(self, evt): """Live update of the ticker text""" self.ticker.SetText(self.txt.GetValue())
[ "def", "OnText", "(", "self", ",", "evt", ")", ":", "self", ".", "ticker", ".", "SetText", "(", "self", ".", "txt", ".", "GetValue", "(", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/demo/Ticker.py#L112-L114
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Source/bindings/scripts/aggregate_generated_bindings.py
python
extract_conditional
(idl_contents)
return match.group(1)
Find [Conditional] interface extended attribute.
Find [Conditional] interface extended attribute.
[ "Find", "[", "Conditional", "]", "interface", "extended", "attribute", "." ]
def extract_conditional(idl_contents): """Find [Conditional] interface extended attribute.""" match = CONDITIONAL_PATTERN.search(idl_contents) if not match: return None return match.group(1)
[ "def", "extract_conditional", "(", "idl_contents", ")", ":", "match", "=", "CONDITIONAL_PATTERN", ".", "search", "(", "idl_contents", ")", "if", "not", "match", ":", "return", "None", "return", "match", ".", "group", "(", "1", ")" ]
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Source/bindings/scripts/aggregate_generated_bindings.py#L103-L109
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/io/mmio.py
python
MMFile._init_attrs
(self, **kwargs)
Initialize each attributes with the corresponding keyword arg value or a default of None
Initialize each attributes with the corresponding keyword arg value or a default of None
[ "Initialize", "each", "attributes", "with", "the", "corresponding", "keyword", "arg", "value", "or", "a", "default", "of", "None" ]
def _init_attrs(self, **kwargs): """ Initialize each attributes with the corresponding keyword arg value or a default of None """ attrs = self.__class__.__slots__ public_attrs = [attr[1:] for attr in attrs] invalid_keys = set(kwargs.keys()) - set(public_attrs) ...
[ "def", "_init_attrs", "(", "self", ",", "*", "*", "kwargs", ")", ":", "attrs", "=", "self", ".", "__class__", ".", "__slots__", "public_attrs", "=", "[", "attr", "[", "1", ":", "]", "for", "attr", "in", "attrs", "]", "invalid_keys", "=", "set", "(", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/io/mmio.py#L459-L475
PJunhyuk/people-counting-pose
8cdaab5281847c296b305643842053d496e2e4e8
sort.py
python
Sort.__init__
(self, max_age=1, min_hits=3)
Sets key parameters for SORT
Sets key parameters for SORT
[ "Sets", "key", "parameters", "for", "SORT" ]
def __init__(self, max_age=1, min_hits=3): """ Sets key parameters for SORT """ self.max_age = max_age self.min_hits = min_hits self.trackers = [] self.frame_count = 0
[ "def", "__init__", "(", "self", ",", "max_age", "=", "1", ",", "min_hits", "=", "3", ")", ":", "self", ".", "max_age", "=", "max_age", "self", ".", "min_hits", "=", "min_hits", "self", ".", "trackers", "=", "[", "]", "self", ".", "frame_count", "=", ...
https://github.com/PJunhyuk/people-counting-pose/blob/8cdaab5281847c296b305643842053d496e2e4e8/sort.py#L178-L185
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
chrome/tools/extract_actions.py
python
AddChromeOSActions
(actions)
Add actions reported by non-Chrome processes in Chrome OS. Arguments: actions: set of actions to add to.
Add actions reported by non-Chrome processes in Chrome OS.
[ "Add", "actions", "reported", "by", "non", "-", "Chrome", "processes", "in", "Chrome", "OS", "." ]
def AddChromeOSActions(actions): """Add actions reported by non-Chrome processes in Chrome OS. Arguments: actions: set of actions to add to. """ # Actions sent by the Chrome OS window manager. actions.add('Accel_NextWindow_Tab') actions.add('Accel_PrevWindow_Tab') actions.add('Accel_NextWindow_F5') ...
[ "def", "AddChromeOSActions", "(", "actions", ")", ":", "# Actions sent by the Chrome OS window manager.", "actions", ".", "add", "(", "'Accel_NextWindow_Tab'", ")", "actions", ".", "add", "(", "'Accel_PrevWindow_Tab'", ")", "actions", ".", "add", "(", "'Accel_NextWindow...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/chrome/tools/extract_actions.py#L203-L224
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/stc.py
python
StyledTextCtrl.BraceHighlightIndicator
(*args, **kwargs)
return _stc.StyledTextCtrl_BraceHighlightIndicator(*args, **kwargs)
BraceHighlightIndicator(self, bool useBraceHighlightIndicator, int indicator)
BraceHighlightIndicator(self, bool useBraceHighlightIndicator, int indicator)
[ "BraceHighlightIndicator", "(", "self", "bool", "useBraceHighlightIndicator", "int", "indicator", ")" ]
def BraceHighlightIndicator(*args, **kwargs): """BraceHighlightIndicator(self, bool useBraceHighlightIndicator, int indicator)""" return _stc.StyledTextCtrl_BraceHighlightIndicator(*args, **kwargs)
[ "def", "BraceHighlightIndicator", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_BraceHighlightIndicator", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L4807-L4809
vslavik/poedit
f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a
deps/boost/tools/build/src/build/type.py
python
__register_features
()
Register features need by this module.
Register features need by this module.
[ "Register", "features", "need", "by", "this", "module", "." ]
def __register_features (): """ Register features need by this module. """ # The feature is optional so that it is never implicitly added. # It's used only for internal purposes, and in all cases we # want to explicitly use it. feature.feature ('target-type', [], ['composite', 'optional']) f...
[ "def", "__register_features", "(", ")", ":", "# The feature is optional so that it is never implicitly added.", "# It's used only for internal purposes, and in all cases we", "# want to explicitly use it.", "feature", ".", "feature", "(", "'target-type'", ",", "[", "]", ",", "[", ...
https://github.com/vslavik/poedit/blob/f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a/deps/boost/tools/build/src/build/type.py#L22-L30
root-project/root
fcd3583bb14852bf2e8cd2415717cbaac0e75896
interpreter/llvm/src/utils/benchmark/tools/gbench/util.py
python
run_or_load_benchmark
(filename, benchmark_flags)
Get the results for a specified benchmark. If 'filename' specifies an executable benchmark then the results are generated by running the benchmark. Otherwise 'filename' must name a valid JSON output file, which is loaded and the result returned.
Get the results for a specified benchmark. If 'filename' specifies an executable benchmark then the results are generated by running the benchmark. Otherwise 'filename' must name a valid JSON output file, which is loaded and the result returned.
[ "Get", "the", "results", "for", "a", "specified", "benchmark", ".", "If", "filename", "specifies", "an", "executable", "benchmark", "then", "the", "results", "are", "generated", "by", "running", "the", "benchmark", ".", "Otherwise", "filename", "must", "name", ...
def run_or_load_benchmark(filename, benchmark_flags): """ Get the results for a specified benchmark. If 'filename' specifies an executable benchmark then the results are generated by running the benchmark. Otherwise 'filename' must name a valid JSON output file, which is loaded and the result return...
[ "def", "run_or_load_benchmark", "(", "filename", ",", "benchmark_flags", ")", ":", "ftype", "=", "check_input_file", "(", "filename", ")", "if", "ftype", "==", "IT_JSON", ":", "return", "load_benchmark_results", "(", "filename", ")", "elif", "ftype", "==", "IT_E...
https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/interpreter/llvm/src/utils/benchmark/tools/gbench/util.py#L146-L159
google/or-tools
2cb85b4eead4c38e1c54b48044f92087cf165bce
examples/python/cover_rectangle_sat.py
python
cover_rectangle
(num_squares)
return status == cp_model.FEASIBLE
Try to fill the rectangle with a given number of squares.
Try to fill the rectangle with a given number of squares.
[ "Try", "to", "fill", "the", "rectangle", "with", "a", "given", "number", "of", "squares", "." ]
def cover_rectangle(num_squares): """Try to fill the rectangle with a given number of squares.""" size_x = 72 size_y = 37 model = cp_model.CpModel() areas = [] sizes = [] x_intervals = [] y_intervals = [] x_starts = [] y_starts = [] # Creates intervals for the NoOverlap2D ...
[ "def", "cover_rectangle", "(", "num_squares", ")", ":", "size_x", "=", "72", "size_y", "=", "37", "model", "=", "cp_model", ".", "CpModel", "(", ")", "areas", "=", "[", "]", "sizes", "=", "[", "]", "x_intervals", "=", "[", "]", "y_intervals", "=", "[...
https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/examples/python/cover_rectangle_sat.py#L19-L102
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/importlib-metadata/py3/importlib_metadata/_text.py
python
FoldedCase.in_
(self, other)
return self in FoldedCase(other)
Does self appear in other?
Does self appear in other?
[ "Does", "self", "appear", "in", "other?" ]
def in_(self, other): "Does self appear in other?" return self in FoldedCase(other)
[ "def", "in_", "(", "self", ",", "other", ")", ":", "return", "self", "in", "FoldedCase", "(", "other", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/importlib-metadata/py3/importlib_metadata/_text.py#L85-L87
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/client/timeline.py
python
Timeline._assign_lanes
(self)
Assigns non-overlapping lanes for the activities on each device.
Assigns non-overlapping lanes for the activities on each device.
[ "Assigns", "non", "-", "overlapping", "lanes", "for", "the", "activities", "on", "each", "device", "." ]
def _assign_lanes(self): """Assigns non-overlapping lanes for the activities on each device.""" for device_stats in self._step_stats.dev_stats: # TODO(pbar): Genuine thread IDs in NodeExecStats might be helpful. lanes = [0] for ns in device_stats.node_stats: l = -1 for (i, lts)...
[ "def", "_assign_lanes", "(", "self", ")", ":", "for", "device_stats", "in", "self", ".", "_step_stats", ".", "dev_stats", ":", "# TODO(pbar): Genuine thread IDs in NodeExecStats might be helpful.", "lanes", "=", "[", "0", "]", "for", "ns", "in", "device_stats", ".",...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/client/timeline.py#L399-L414
scanner-research/scanner
04a0c4b4196341995985acd729c0788aab823e1c
python/scannerpy/storage.py
python
StoredStream.len
(self)
Get the number of elements in this stream.
Get the number of elements in this stream.
[ "Get", "the", "number", "of", "elements", "in", "this", "stream", "." ]
def len(self) -> int: """Get the number of elements in this stream.""" raise NotImplementedError
[ "def", "len", "(", "self", ")", "->", "int", ":", "raise", "NotImplementedError" ]
https://github.com/scanner-research/scanner/blob/04a0c4b4196341995985acd729c0788aab823e1c/python/scannerpy/storage.py#L118-L120
neopenx/Dragon
0e639a7319035ddc81918bd3df059230436ee0a1
Dragon/python/dragon/core/tensor.py
python
Tensor.__sub__
(self, other)
return output
Calculate x - y. Parameters ---------- other : Tensor The y. Returns ------- Tensor The output tensor.
Calculate x - y.
[ "Calculate", "x", "-", "y", "." ]
def __sub__(self, other): """Calculate x - y. Parameters ---------- other : Tensor The y. Returns ------- Tensor The output tensor. """ if not isinstance(other, Tensor): if not isinstance(other, np.ndarray): ...
[ "def", "__sub__", "(", "self", ",", "other", ")", ":", "if", "not", "isinstance", "(", "other", ",", "Tensor", ")", ":", "if", "not", "isinstance", "(", "other", ",", "np", ".", "ndarray", ")", ":", "if", "not", "isinstance", "(", "other", ",", "li...
https://github.com/neopenx/Dragon/blob/0e639a7319035ddc81918bd3df059230436ee0a1/Dragon/python/dragon/core/tensor.py#L512-L536
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/core/getlimits.py
python
_get_machar
(ftype)
return _discovered_machar(ftype)
Get MachAr instance or MachAr-like instance Get parameters for floating point type, by first trying signatures of various known floating point types, then, if none match, attempting to identify parameters by analysis. Parameters ---------- ftype : class Numpy floating point type class ...
Get MachAr instance or MachAr-like instance
[ "Get", "MachAr", "instance", "or", "MachAr", "-", "like", "instance" ]
def _get_machar(ftype): """ Get MachAr instance or MachAr-like instance Get parameters for floating point type, by first trying signatures of various known floating point types, then, if none match, attempting to identify parameters by analysis. Parameters ---------- ftype : class ...
[ "def", "_get_machar", "(", "ftype", ")", ":", "params", "=", "_MACHAR_PARAMS", ".", "get", "(", "ftype", ")", "if", "params", "is", "None", ":", "raise", "ValueError", "(", "repr", "(", "ftype", ")", ")", "# Detect known / suspected types", "key", "=", "ft...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/core/getlimits.py#L237-L281
RamadhanAmizudin/malware
2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1
Fuzzbunch/fuzzbunch/pyreadline/rlmain.py
python
GetOutputFile
()
return rl.console
Return the console object used by readline so that it can be used for printing in color.
Return the console object used by readline so that it can be used for printing in color.
[ "Return", "the", "console", "object", "used", "by", "readline", "so", "that", "it", "can", "be", "used", "for", "printing", "in", "color", "." ]
def GetOutputFile(): '''Return the console object used by readline so that it can be used for printing in color.''' return rl.console
[ "def", "GetOutputFile", "(", ")", ":", "return", "rl", ".", "console" ]
https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/rlmain.py#L431-L433
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/metrics.py
python
_ConfusionMatrixConditionCount.update_state
(self, y_true, y_pred, sample_weight=None)
return metrics_utils.update_confusion_matrix_variables( {self._confusion_matrix_cond: self.accumulator}, y_true, y_pred, thresholds=self.thresholds, sample_weight=sample_weight)
Accumulates the given confusion matrix condition statistics. Args: y_true: The ground truth values. y_pred: The predicted values. sample_weight: Optional weighting of each example. Defaults to 1. Can be a `Tensor` whose rank is either 0, or the same rank as `y_true`, and must be b...
Accumulates the given confusion matrix condition statistics.
[ "Accumulates", "the", "given", "confusion", "matrix", "condition", "statistics", "." ]
def update_state(self, y_true, y_pred, sample_weight=None): """Accumulates the given confusion matrix condition statistics. Args: y_true: The ground truth values. y_pred: The predicted values. sample_weight: Optional weighting of each example. Defaults to 1. Can be a `Tensor` whose ra...
[ "def", "update_state", "(", "self", ",", "y_true", ",", "y_pred", ",", "sample_weight", "=", "None", ")", ":", "return", "metrics_utils", ".", "update_confusion_matrix_variables", "(", "{", "self", ".", "_confusion_matrix_cond", ":", "self", ".", "accumulator", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/metrics.py#L866-L884
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
gr-digital/python/digital/qa_diff_encoder_nrzi.py
python
test_nrzi.test_encode
(self)
Performs NRZI encode and checks the result
Performs NRZI encode and checks the result
[ "Performs", "NRZI", "encode", "and", "checks", "the", "result" ]
def test_encode(self): """Performs NRZI encode and checks the result""" encoder = digital.diff_encoder_bb(2, digital.DIFF_NRZI) self.tb.connect(self.source, encoder, self.sink) self.tb.start() self.tb.wait() expected = np.cumsum((1 ^ self.data) & 1) & 1 np.test...
[ "def", "test_encode", "(", "self", ")", ":", "encoder", "=", "digital", ".", "diff_encoder_bb", "(", "2", ",", "digital", ".", "DIFF_NRZI", ")", "self", ".", "tb", ".", "connect", "(", "self", ".", "source", ",", "encoder", ",", "self", ".", "sink", ...
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-digital/python/digital/qa_diff_encoder_nrzi.py#L29-L41
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/command/config.py
python
config.try_run
(self, body, headers=None, include_dirs=None, libraries=None, library_dirs=None, lang="c")
return ok
Try to compile, link to an executable, and run a program built from 'body' and 'headers'. Return true on success, false otherwise.
Try to compile, link to an executable, and run a program built from 'body' and 'headers'. Return true on success, false otherwise.
[ "Try", "to", "compile", "link", "to", "an", "executable", "and", "run", "a", "program", "built", "from", "body", "and", "headers", ".", "Return", "true", "on", "success", "false", "otherwise", "." ]
def try_run(self, body, headers=None, include_dirs=None, libraries=None, library_dirs=None, lang="c"): """Try to compile, link to an executable, and run a program built from 'body' and 'headers'. Return true on success, false otherwise. """ from distutils.ccompil...
[ "def", "try_run", "(", "self", ",", "body", ",", "headers", "=", "None", ",", "include_dirs", "=", "None", ",", "libraries", "=", "None", ",", "library_dirs", "=", "None", ",", "lang", "=", "\"c\"", ")", ":", "from", "distutils", ".", "ccompiler", "imp...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/command/config.py#L260-L278
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/debug/cli/evaluator.py
python
ExpressionEvaluator.__init__
(self, dump)
Constructor of ExpressionEvaluator. Args: dump: an instance of `DebugDumpDir`.
Constructor of ExpressionEvaluator.
[ "Constructor", "of", "ExpressionEvaluator", "." ]
def __init__(self, dump): """Constructor of ExpressionEvaluator. Args: dump: an instance of `DebugDumpDir`. """ self._dump = dump self._cached_tensor_values = dict()
[ "def", "__init__", "(", "self", ",", "dump", ")", ":", "self", ".", "_dump", "=", "dump", "self", ".", "_cached_tensor_values", "=", "dict", "(", ")" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/cli/evaluator.py#L109-L116
zerotier/libzt
41eb9aebc80a5f1c816fa26a06cefde9de906676
src/bindings/python/sockets.py
python
socket.listen
(self, backlog=None)
listen([backlog]) Put the socket in a listening state. Backlog specifies the number of outstanding connections the OS will queue without being accepted. If less than 0, it is set to 0. If not specified, a reasonable default will be used.
listen([backlog])
[ "listen", "(", "[", "backlog", "]", ")" ]
def listen(self, backlog=None): """listen([backlog]) Put the socket in a listening state. Backlog specifies the number of outstanding connections the OS will queue without being accepted. If less than 0, it is set to 0. If not specified, a reasonable default will be used.""" ...
[ "def", "listen", "(", "self", ",", "backlog", "=", "None", ")", ":", "if", "backlog", "is", "not", "None", "and", "backlog", "<", "0", ":", "backlog", "=", "0", "if", "backlog", "is", "None", ":", "backlog", "=", "-", "1", "# Lower-level code picks def...
https://github.com/zerotier/libzt/blob/41eb9aebc80a5f1c816fa26a06cefde9de906676/src/bindings/python/sockets.py#L311-L326
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/builder.py
python
NeuralNetworkBuilder.add_expand_dims
(self, name, input_name, output_name, axes)
return spec_layer
Add an expand dims layer to the model that increases the rank of the input tensor by adding unit dimensions. Refer to the **ExpandDimsLayerParams** message in specification (NeuralNetwork.proto) for more details. Parameters ---------- name: str The name of th...
Add an expand dims layer to the model that increases the rank of the input tensor by adding unit dimensions. Refer to the **ExpandDimsLayerParams** message in specification (NeuralNetwork.proto) for more details.
[ "Add", "an", "expand", "dims", "layer", "to", "the", "model", "that", "increases", "the", "rank", "of", "the", "input", "tensor", "by", "adding", "unit", "dimensions", ".", "Refer", "to", "the", "**", "ExpandDimsLayerParams", "**", "message", "in", "specific...
def add_expand_dims(self, name, input_name, output_name, axes): """ Add an expand dims layer to the model that increases the rank of the input tensor by adding unit dimensions. Refer to the **ExpandDimsLayerParams** message in specification (NeuralNetwork.proto) for more details....
[ "def", "add_expand_dims", "(", "self", ",", "name", ",", "input_name", ",", "output_name", ",", "axes", ")", ":", "spec_layer", "=", "self", ".", "_add_generic_layer", "(", "name", ",", "[", "input_name", "]", ",", "[", "output_name", "]", ")", "spec_layer...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/builder.py#L7033-L7060
BVLC/caffe
9b891540183ddc834a02b2bd81b31afae71b2153
python/caffe/io.py
python
Transformer.set_transpose
(self, in_, order)
Set the order of dimensions, e.g. to convert OpenCV's HxWxC images into CxHxW. Parameters ---------- in_ : which input to assign this dimension order order : the order to transpose the dimensions for example (2,0,1) changes HxWxC into CxHxW and (1,2,0) reverts
Set the order of dimensions, e.g. to convert OpenCV's HxWxC images into CxHxW.
[ "Set", "the", "order", "of", "dimensions", "e", ".", "g", ".", "to", "convert", "OpenCV", "s", "HxWxC", "images", "into", "CxHxW", "." ]
def set_transpose(self, in_, order): """ Set the order of dimensions, e.g. to convert OpenCV's HxWxC images into CxHxW. Parameters ---------- in_ : which input to assign this dimension order order : the order to transpose the dimensions for example (2...
[ "def", "set_transpose", "(", "self", ",", "in_", ",", "order", ")", ":", "self", ".", "__check_input", "(", "in_", ")", "if", "len", "(", "order", ")", "!=", "len", "(", "self", ".", "inputs", "[", "in_", "]", ")", "-", "1", ":", "raise", "Except...
https://github.com/BVLC/caffe/blob/9b891540183ddc834a02b2bd81b31afae71b2153/python/caffe/io.py#L187-L202
lmb-freiburg/flownet2
b92e198b56b0e52e1ba0a5a98dc0e39fa5ae70cc
scripts/cpp_lint.py
python
RemoveMultiLineCommentsFromRange
(lines, begin, end)
Clears a range of lines for multi-line comments.
Clears a range of lines for multi-line comments.
[ "Clears", "a", "range", "of", "lines", "for", "multi", "-", "line", "comments", "." ]
def RemoveMultiLineCommentsFromRange(lines, begin, end): """Clears a range of lines for multi-line comments.""" # Having // dummy comments makes the lines non-empty, so we will not get # unnecessary blank line warnings later in the code. for i in range(begin, end): lines[i] = '// dummy'
[ "def", "RemoveMultiLineCommentsFromRange", "(", "lines", ",", "begin", ",", "end", ")", ":", "# Having // dummy comments makes the lines non-empty, so we will not get", "# unnecessary blank line warnings later in the code.", "for", "i", "in", "range", "(", "begin", ",", "end", ...
https://github.com/lmb-freiburg/flownet2/blob/b92e198b56b0e52e1ba0a5a98dc0e39fa5ae70cc/scripts/cpp_lint.py#L1143-L1148
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/version.py
python
_suggest_normalized_version
(s)
return rs
Suggest a normalized version close to the given version string. If you have a version string that isn't rational (i.e. NormalizedVersion doesn't like it) then you might be able to get an equivalent (or close) rational version from this function. This does a number of simple normalizations to the...
Suggest a normalized version close to the given version string.
[ "Suggest", "a", "normalized", "version", "close", "to", "the", "given", "version", "string", "." ]
def _suggest_normalized_version(s): """Suggest a normalized version close to the given version string. If you have a version string that isn't rational (i.e. NormalizedVersion doesn't like it) then you might be able to get an equivalent (or close) rational version from this function. This d...
[ "def", "_suggest_normalized_version", "(", "s", ")", ":", "try", ":", "_normalized_key", "(", "s", ")", "return", "s", "# already rational", "except", "UnsupportedVersionError", ":", "pass", "rs", "=", "s", ".", "lower", "(", ")", "# part of this could use maketra...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/version.py#L903-L1119
peterljq/OpenMMD
795d4dd660cf7e537ceb599fdb038c5388b33390
3D Pose Baseline to VMD/src/predict_3dpose.py
python
evaluate_batches
( sess, model, data_mean_3d, data_std_3d, dim_to_use_3d, dim_to_ignore_3d, data_mean_2d, data_std_2d, dim_to_use_2d, dim_to_ignore_2d, current_step, encoder_inputs, decoder_outputs, current_epoch=0 )
return total_err, joint_err, step_time, loss
Generic method that evaluates performance of a list of batches. May be used to evaluate all actions or a single action. Args sess model data_mean_3d data_std_3d dim_to_use_3d dim_to_ignore_3d data_mean_2d data_std_2d dim_to_use_2d dim_to_ignore_2d current_step encode...
Generic method that evaluates performance of a list of batches. May be used to evaluate all actions or a single action.
[ "Generic", "method", "that", "evaluates", "performance", "of", "a", "list", "of", "batches", ".", "May", "be", "used", "to", "evaluate", "all", "actions", "or", "a", "single", "action", "." ]
def evaluate_batches( sess, model, data_mean_3d, data_std_3d, dim_to_use_3d, dim_to_ignore_3d, data_mean_2d, data_std_2d, dim_to_use_2d, dim_to_ignore_2d, current_step, encoder_inputs, decoder_outputs, current_epoch=0 ): """ Generic method that evaluates performance of a list of batches. May be used to eval...
[ "def", "evaluate_batches", "(", "sess", ",", "model", ",", "data_mean_3d", ",", "data_std_3d", ",", "dim_to_use_3d", ",", "dim_to_ignore_3d", ",", "data_mean_2d", ",", "data_std_2d", ",", "dim_to_use_2d", ",", "dim_to_ignore_2d", ",", "current_step", ",", "encoder_i...
https://github.com/peterljq/OpenMMD/blob/795d4dd660cf7e537ceb599fdb038c5388b33390/3D Pose Baseline to VMD/src/predict_3dpose.py#L322-L414
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/multinomial.py
python
Multinomial.logits
(self)
return self._logits
Log-odds.
Log-odds.
[ "Log", "-", "odds", "." ]
def logits(self): """Log-odds.""" return self._logits
[ "def", "logits", "(", "self", ")", ":", "return", "self", ".", "_logits" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/multinomial.py#L177-L179
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/SimpleXMLRPCServer.py
python
CGIXMLRPCRequestHandler.handle_request
(self, request_text = None)
Handle a single XML-RPC request passed through a CGI post method. If no XML data is given then it is read from stdin. The resulting XML-RPC response is printed to stdout along with the correct HTTP headers.
Handle a single XML-RPC request passed through a CGI post method.
[ "Handle", "a", "single", "XML", "-", "RPC", "request", "passed", "through", "a", "CGI", "post", "method", "." ]
def handle_request(self, request_text = None): """Handle a single XML-RPC request passed through a CGI post method. If no XML data is given then it is read from stdin. The resulting XML-RPC response is printed to stdout along with the correct HTTP headers. """ if reques...
[ "def", "handle_request", "(", "self", ",", "request_text", "=", "None", ")", ":", "if", "request_text", "is", "None", "and", "os", ".", "environ", ".", "get", "(", "'REQUEST_METHOD'", ",", "None", ")", "==", "'GET'", ":", "self", ".", "handle_get", "(", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/SimpleXMLRPCServer.py#L680-L700
wy1iu/LargeMargin_Softmax_Loss
c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec
scripts/cpp_lint.py
python
ProcessFile
(filename, vlevel, extra_check_functions=[])
Does google-lint on a single file. Args: filename: The name of the file to parse. vlevel: The level of errors to report. Every error of confidence >= verbose_level will be reported. 0 is a good default. extra_check_functions: An array of additional check functions that will be ...
Does google-lint on a single file.
[ "Does", "google", "-", "lint", "on", "a", "single", "file", "." ]
def ProcessFile(filename, vlevel, extra_check_functions=[]): """Does google-lint on a single file. Args: filename: The name of the file to parse. vlevel: The level of errors to report. Every error of confidence >= verbose_level will be reported. 0 is a good default. extra_check_functions: An ar...
[ "def", "ProcessFile", "(", "filename", ",", "vlevel", ",", "extra_check_functions", "=", "[", "]", ")", ":", "_SetVerboseLevel", "(", "vlevel", ")", "try", ":", "# Support the UNIX convention of using \"-\" for stdin. Note that", "# we are not opening the file with universal...
https://github.com/wy1iu/LargeMargin_Softmax_Loss/blob/c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec/scripts/cpp_lint.py#L4689-L4754
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/aui/auibar.py
python
CommandToolBarEvent.SetToolId
(self, id)
Sets the :class:`AuiToolBarItem` identifier. :param integer `id`: the toolbar item identifier.
Sets the :class:`AuiToolBarItem` identifier.
[ "Sets", "the", ":", "class", ":", "AuiToolBarItem", "identifier", "." ]
def SetToolId(self, id): """ Sets the :class:`AuiToolBarItem` identifier. :param integer `id`: the toolbar item identifier. """ self.tool_id = id
[ "def", "SetToolId", "(", "self", ",", "id", ")", ":", "self", ".", "tool_id", "=", "id" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/auibar.py#L123-L130
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/decimal.py
python
Decimal.__rpow__
(self, other, context=None)
return other.__pow__(self, context=context)
Swaps self/other and returns __pow__.
Swaps self/other and returns __pow__.
[ "Swaps", "self", "/", "other", "and", "returns", "__pow__", "." ]
def __rpow__(self, other, context=None): """Swaps self/other and returns __pow__.""" other = _convert_other(other) if other is NotImplemented: return other return other.__pow__(self, context=context)
[ "def", "__rpow__", "(", "self", ",", "other", ",", "context", "=", "None", ")", ":", "other", "=", "_convert_other", "(", "other", ")", "if", "other", "is", "NotImplemented", ":", "return", "other", "return", "other", ".", "__pow__", "(", "self", ",", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/decimal.py#L2390-L2395
devpack/android-python27
d42dd67565e104cf7b0b50eb473f615db3e69901
python-build-with-qt/sip-4.11.2/siputils.py
python
Configuration.__init__
(self, sub_cfg=None)
Initialise an instance of the class. sub_cfg is the list of sub-class configurations. It should be None when called normally.
Initialise an instance of the class.
[ "Initialise", "an", "instance", "of", "the", "class", "." ]
def __init__(self, sub_cfg=None): """Initialise an instance of the class. sub_cfg is the list of sub-class configurations. It should be None when called normally. """ # Find the build macros in the closest imported module from where this # was originally defined. ...
[ "def", "__init__", "(", "self", ",", "sub_cfg", "=", "None", ")", ":", "# Find the build macros in the closest imported module from where this", "# was originally defined.", "self", ".", "_macros", "=", "None", "for", "cls", "in", "self", ".", "__class__", ".", "__mro...
https://github.com/devpack/android-python27/blob/d42dd67565e104cf7b0b50eb473f615db3e69901/python-build-with-qt/sip-4.11.2/siputils.py#L37-L65
RamadhanAmizudin/malware
2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1
Fuzzbunch/fuzzbunch/edfmeta.py
python
parse_forward
(xmlFile)
return arches
Forward-deployment (i.e., DARINGVETERAN/DARINGNEOPHYTE) DLL Configuration INPUT ----- Path to plugin's standard FB file. OUTPUT ------ Dictionary mapping archOs tag (e.g., "x86-Windows") to a tuple containing plugin proxy and core DLLs. Note that either element may be None!
Forward-deployment (i.e., DARINGVETERAN/DARINGNEOPHYTE) DLL Configuration INPUT ----- Path to plugin's standard FB file. OUTPUT ------ Dictionary mapping archOs tag (e.g., "x86-Windows") to a tuple containing plugin proxy and core DLLs. Note that either element may be None!
[ "Forward", "-", "deployment", "(", "i", ".", "e", ".", "DARINGVETERAN", "/", "DARINGNEOPHYTE", ")", "DLL", "Configuration", "INPUT", "-----", "Path", "to", "plugin", "s", "standard", "FB", "file", ".", "OUTPUT", "------", "Dictionary", "mapping", "archOs", "...
def parse_forward(xmlFile): """ Forward-deployment (i.e., DARINGVETERAN/DARINGNEOPHYTE) DLL Configuration INPUT ----- Path to plugin's standard FB file. OUTPUT ------ Dictionary mapping archOs tag (e.g., "x86-Windows") to a tuple containing plugin proxy and core DLLs. Note...
[ "def", "parse_forward", "(", "xmlFile", ")", ":", "xmldoc", "=", "ElementTree", ".", "parse", "(", "xmlFile", ")", "arches", "=", "{", "}", "for", "arch", "in", "xmldoc", ".", "findall", "(", "\"package/arch\"", ")", ":", "proxy", "=", "getattr", "(", ...
https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/edfmeta.py#L257-L276
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/_vendor/packaging/markers.py
python
Marker.evaluate
(self, environment=None)
return _evaluate_markers(self._markers, current_environment)
Evaluate a marker. Return the boolean from evaluating the given marker against the environment. environment is an optional argument to override all or part of the determined environment. The environment is determined from the current Python process.
Evaluate a marker.
[ "Evaluate", "a", "marker", "." ]
def evaluate(self, environment=None): """Evaluate a marker. Return the boolean from evaluating the given marker against the environment. environment is an optional argument to override all or part of the determined environment. The environment is determined from the current Pyt...
[ "def", "evaluate", "(", "self", ",", "environment", "=", "None", ")", ":", "current_environment", "=", "default_environment", "(", ")", "if", "environment", "is", "not", "None", ":", "current_environment", ".", "update", "(", "environment", ")", "return", "_ev...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/_vendor/packaging/markers.py#L283-L296
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/framework/indexed_slices.py
python
convert_to_tensor_or_indexed_slices
(value, dtype=None, name=None)
return internal_convert_to_tensor_or_indexed_slices( value=value, dtype=dtype, name=name, as_ref=False)
Converts the given object to a `Tensor` or an `IndexedSlices`. If `value` is an `IndexedSlices` or `SparseTensor` it is returned unmodified. Otherwise, it is converted to a `Tensor` using `convert_to_tensor()`. Args: value: An `IndexedSlices`, `SparseTensor`, or an object that can be consumed by `co...
Converts the given object to a `Tensor` or an `IndexedSlices`.
[ "Converts", "the", "given", "object", "to", "a", "Tensor", "or", "an", "IndexedSlices", "." ]
def convert_to_tensor_or_indexed_slices(value, dtype=None, name=None): """Converts the given object to a `Tensor` or an `IndexedSlices`. If `value` is an `IndexedSlices` or `SparseTensor` it is returned unmodified. Otherwise, it is converted to a `Tensor` using `convert_to_tensor()`. Args: value: An `In...
[ "def", "convert_to_tensor_or_indexed_slices", "(", "value", ",", "dtype", "=", "None", ",", "name", "=", "None", ")", ":", "return", "internal_convert_to_tensor_or_indexed_slices", "(", "value", "=", "value", ",", "dtype", "=", "dtype", ",", "name", "=", "name",...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/framework/indexed_slices.py#L268-L289
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/cluster/bicluster.py
python
_log_normalize
(X)
return L - row_avg - col_avg + avg
Normalize ``X`` according to Kluger's log-interactions scheme.
Normalize ``X`` according to Kluger's log-interactions scheme.
[ "Normalize", "X", "according", "to", "Kluger", "s", "log", "-", "interactions", "scheme", "." ]
def _log_normalize(X): """Normalize ``X`` according to Kluger's log-interactions scheme.""" X = make_nonnegative(X, min_value=1) if issparse(X): raise ValueError("Cannot compute log of a sparse matrix," " because log(x) diverges to -infinity as x" " ...
[ "def", "_log_normalize", "(", "X", ")", ":", "X", "=", "make_nonnegative", "(", "X", ",", "min_value", "=", "1", ")", "if", "issparse", "(", "X", ")", ":", "raise", "ValueError", "(", "\"Cannot compute log of a sparse matrix,\"", "\" because log(x) diverges to -in...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/cluster/bicluster.py#L75-L86
papyrussolution/OpenPapyrus
bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91
Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/python_message.py
python
_AddEqualsMethod
(message_descriptor, cls)
Helper for _AddMessageMethods().
Helper for _AddMessageMethods().
[ "Helper", "for", "_AddMessageMethods", "()", "." ]
def _AddEqualsMethod(message_descriptor, cls): """Helper for _AddMessageMethods().""" def __eq__(self, other): if (not isinstance(other, message_mod.Message) or other.DESCRIPTOR != self.DESCRIPTOR): return False if self is other: return True if self.DESCRIPTOR.full_name == _AnyFull...
[ "def", "_AddEqualsMethod", "(", "message_descriptor", ",", "cls", ")", ":", "def", "__eq__", "(", "self", ",", "other", ")", ":", "if", "(", "not", "isinstance", "(", "other", ",", "message_mod", ".", "Message", ")", "or", "other", ".", "DESCRIPTOR", "!=...
https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/python_message.py#L978-L1005
may0324/DeepCompression-caffe
0aff6c1287bda4cfc7f378ed8a16524e1afabd8c
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/may0324/DeepCompression-caffe/blob/0aff6c1287bda4cfc7f378ed8a16524e1afabd8c/scripts/cpp_lint.py#L525-L540
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/aui.py
python
AuiTabContainer.GetIdxFromWindow
(*args, **kwargs)
return _aui.AuiTabContainer_GetIdxFromWindow(*args, **kwargs)
GetIdxFromWindow(self, Window page) -> int
GetIdxFromWindow(self, Window page) -> int
[ "GetIdxFromWindow", "(", "self", "Window", "page", ")", "-", ">", "int" ]
def GetIdxFromWindow(*args, **kwargs): """GetIdxFromWindow(self, Window page) -> int""" return _aui.AuiTabContainer_GetIdxFromWindow(*args, **kwargs)
[ "def", "GetIdxFromWindow", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiTabContainer_GetIdxFromWindow", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/aui.py#L1188-L1190
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/operator.py
python
CustomOpProp.list_auxiliary_states
(self)
return []
list_auxiliary_states interface. Can override when creating new operators. Returns ------- auxs : list list of auxiliary state blob names.
list_auxiliary_states interface. Can override when creating new operators.
[ "list_auxiliary_states", "interface", ".", "Can", "override", "when", "creating", "new", "operators", "." ]
def list_auxiliary_states(self): """list_auxiliary_states interface. Can override when creating new operators. Returns ------- auxs : list list of auxiliary state blob names. """ return []
[ "def", "list_auxiliary_states", "(", "self", ")", ":", "return", "[", "]" ]
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/operator.py#L634-L642
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
htmlReadFd
(fd, URL, encoding, options)
return xmlDoc(_obj=ret)
parse an XML from a file descriptor and build a tree.
parse an XML from a file descriptor and build a tree.
[ "parse", "an", "XML", "from", "a", "file", "descriptor", "and", "build", "a", "tree", "." ]
def htmlReadFd(fd, URL, encoding, options): """parse an XML from a file descriptor and build a tree. """ ret = libxml2mod.htmlReadFd(fd, URL, encoding, options) if ret is None:raise treeError('htmlReadFd() failed') return xmlDoc(_obj=ret)
[ "def", "htmlReadFd", "(", "fd", ",", "URL", ",", "encoding", ",", "options", ")", ":", "ret", "=", "libxml2mod", ".", "htmlReadFd", "(", "fd", ",", "URL", ",", "encoding", ",", "options", ")", "if", "ret", "is", "None", ":", "raise", "treeError", "("...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L834-L838
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/dis.py
python
code_info
(x)
return _format_code_info(_get_code_object(x))
Formatted details of methods, functions, or code.
Formatted details of methods, functions, or code.
[ "Formatted", "details", "of", "methods", "functions", "or", "code", "." ]
def code_info(x): """Formatted details of methods, functions, or code.""" return _format_code_info(_get_code_object(x))
[ "def", "code_info", "(", "x", ")", ":", "return", "_format_code_info", "(", "_get_code_object", "(", "x", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/dis.py#L142-L144
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/indexes/numeric.py
python
NumericIndex._assert_safe_casting
(cls, data, subarr)
Subclasses need to override this only if the process of casting data from some accepted dtype to the internal dtype(s) bears the risk of truncation (e.g. float to int).
Subclasses need to override this only if the process of casting data from some accepted dtype to the internal dtype(s) bears the risk of truncation (e.g. float to int).
[ "Subclasses", "need", "to", "override", "this", "only", "if", "the", "process", "of", "casting", "data", "from", "some", "accepted", "dtype", "to", "the", "internal", "dtype", "(", "s", ")", "bears", "the", "risk", "of", "truncation", "(", "e", ".", "g",...
def _assert_safe_casting(cls, data, subarr): """ Subclasses need to override this only if the process of casting data from some accepted dtype to the internal dtype(s) bears the risk of truncation (e.g. float to int). """ pass
[ "def", "_assert_safe_casting", "(", "cls", ",", "data", ",", "subarr", ")", ":", "pass" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/indexes/numeric.py#L102-L108
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/network/session.py
python
user_agent
()
return "{data[installer][name]}/{data[installer][version]} {json}".format( data=data, json=json.dumps(data, separators=(",", ":"), sort_keys=True), )
Return a string representing the user agent.
Return a string representing the user agent.
[ "Return", "a", "string", "representing", "the", "user", "agent", "." ]
def user_agent(): """ Return a string representing the user agent. """ data = { "installer": {"name": "pip", "version": __version__}, "python": platform.python_version(), "implementation": { "name": platform.python_implementation(), }, } if data["impl...
[ "def", "user_agent", "(", ")", ":", "data", "=", "{", "\"installer\"", ":", "{", "\"name\"", ":", "\"pip\"", ",", "\"version\"", ":", "__version__", "}", ",", "\"python\"", ":", "platform", ".", "python_version", "(", ")", ",", "\"implementation\"", ":", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/network/session.py#L99-L176
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/framework/device.py
python
check_valid
(spec)
Check that a device spec is valid. Args: spec: a string. Raises: An exception if the spec is invalid.
Check that a device spec is valid.
[ "Check", "that", "a", "device", "spec", "is", "valid", "." ]
def check_valid(spec): """Check that a device spec is valid. Args: spec: a string. Raises: An exception if the spec is invalid. """ # Construct a DeviceSpec. It will assert a failure if spec is invalid. DeviceSpec.from_string(spec)
[ "def", "check_valid", "(", "spec", ")", ":", "# Construct a DeviceSpec. It will assert a failure if spec is invalid.", "DeviceSpec", ".", "from_string", "(", "spec", ")" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/framework/device.py#L231-L241
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/curses_ui.py
python
CursesUI._info_toast
(self, message)
Display a one-line informational message on screen. Args: message: The informational message.
Display a one-line informational message on screen.
[ "Display", "a", "one", "-", "line", "informational", "message", "on", "screen", "." ]
def _info_toast(self, message): """Display a one-line informational message on screen. Args: message: The informational message. """ self._toast( self.INFO_MESSAGE_PREFIX + message, color=self._INFO_TOAST_COLOR_PAIR)
[ "def", "_info_toast", "(", "self", ",", "message", ")", ":", "self", ".", "_toast", "(", "self", ".", "INFO_MESSAGE_PREFIX", "+", "message", ",", "color", "=", "self", ".", "_INFO_TOAST_COLOR_PAIR", ")" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/curses_ui.py#L1644-L1652
bundy-dns/bundy
3d41934996b82b0cd2fe22dd74d2abc1daba835d
src/lib/python/bundy/config/config_data.py
python
MultiConfigData.get_value_maps
(self, identifier = None, all = False)
return result
Returns a list of dicts, containing the following values: name: name of the entry (string) type: string containing the type of the value (or 'module') value: value of the entry if it is a string, int, double or bool modified: true if the value is a local change that has not ...
Returns a list of dicts, containing the following values: name: name of the entry (string) type: string containing the type of the value (or 'module') value: value of the entry if it is a string, int, double or bool modified: true if the value is a local change that has not ...
[ "Returns", "a", "list", "of", "dicts", "containing", "the", "following", "values", ":", "name", ":", "name", "of", "the", "entry", "(", "string", ")", "type", ":", "string", "containing", "the", "type", "of", "the", "value", "(", "or", "module", ")", "...
def get_value_maps(self, identifier = None, all = False): """Returns a list of dicts, containing the following values: name: name of the entry (string) type: string containing the type of the value (or 'module') value: value of the entry if it is a string, int, double or bool ...
[ "def", "get_value_maps", "(", "self", ",", "identifier", "=", "None", ",", "all", "=", "False", ")", ":", "result", "=", "[", "]", "if", "not", "identifier", "or", "identifier", "==", "\"/\"", ":", "# No identifier, so we need the list of current modules", "for"...
https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/src/lib/python/bundy/config/config_data.py#L734-L769
ArduPilot/ardupilot
6e684b3496122b8158ac412b609d00004b7ac306
libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py
python
write_USB_config
(f)
write USB config defines
write USB config defines
[ "write", "USB", "config", "defines" ]
def write_USB_config(f): '''write USB config defines''' if not have_type_prefix('OTG'): return f.write('// USB configuration\n') (USB_VID, USB_PID) = get_USB_IDs() f.write('#define HAL_USB_VENDOR_ID 0x%04x\n' % int(USB_VID)) f.write('#define HAL_USB_PRODUCT_ID 0x%04x\n' % int(USB_PID)) ...
[ "def", "write_USB_config", "(", "f", ")", ":", "if", "not", "have_type_prefix", "(", "'OTG'", ")", ":", "return", "f", ".", "write", "(", "'// USB configuration\\n'", ")", "(", "USB_VID", ",", "USB_PID", ")", "=", "get_USB_IDs", "(", ")", "f", ".", "writ...
https://github.com/ArduPilot/ardupilot/blob/6e684b3496122b8158ac412b609d00004b7ac306/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py#L1194-L1209
google/certificate-transparency
2588562fd306a447958471b6f06c1069619c1641
python/ct/crypto/asn1/print_util.py
python
bits_to_hex
(bit_array, delimiter=":")
return bytes_to_hex(byte_array, delimiter=delimiter)
Convert a bit array to a prettily formated hex string. If the array length is not a multiple of 8, it is padded with 0-bits from the left. For example, [1,0,0,1,1,0,1,0,0,1,0] becomes 04:d2. Args: bit_array: the bit array to convert Returns: the formatted hex string.
Convert a bit array to a prettily formated hex string. If the array length is not a multiple of 8, it is padded with 0-bits from the left. For example, [1,0,0,1,1,0,1,0,0,1,0] becomes 04:d2. Args: bit_array: the bit array to convert Returns: the formatted hex string.
[ "Convert", "a", "bit", "array", "to", "a", "prettily", "formated", "hex", "string", ".", "If", "the", "array", "length", "is", "not", "a", "multiple", "of", "8", "it", "is", "padded", "with", "0", "-", "bits", "from", "the", "left", ".", "For", "exam...
def bits_to_hex(bit_array, delimiter=":"): """Convert a bit array to a prettily formated hex string. If the array length is not a multiple of 8, it is padded with 0-bits from the left. For example, [1,0,0,1,1,0,1,0,0,1,0] becomes 04:d2. Args: bit_array: the bit array to convert Returns: ...
[ "def", "bits_to_hex", "(", "bit_array", ",", "delimiter", "=", "\":\"", ")", ":", "# Pad the first partial byte.", "partial_bits", "=", "len", "(", "bit_array", ")", "%", "8", "pad_length", "=", "8", "-", "partial_bits", "if", "partial_bits", "else", "0", "bit...
https://github.com/google/certificate-transparency/blob/2588562fd306a447958471b6f06c1069619c1641/python/ct/crypto/asn1/print_util.py#L3-L19
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/tools/compatibility/ast_edits.py
python
_ASTCallVisitor.visit_Attribute
(self, node)
Handle bare Attributes i.e. [tf.foo, tf.bar]. Args: node: Node that is of type ast.Attribute
Handle bare Attributes i.e. [tf.foo, tf.bar].
[ "Handle", "bare", "Attributes", "i", ".", "e", ".", "[", "tf", ".", "foo", "tf", ".", "bar", "]", "." ]
def visit_Attribute(self, node): # pylint: disable=invalid-name """Handle bare Attributes i.e. [tf.foo, tf.bar]. Args: node: Node that is of type ast.Attribute """ full_name = self._get_attribute_full_path(node) if full_name: self._rename_functions(node, full_name) if full_name in ...
[ "def", "visit_Attribute", "(", "self", ",", "node", ")", ":", "# pylint: disable=invalid-name", "full_name", "=", "self", ".", "_get_attribute_full_path", "(", "node", ")", "if", "full_name", ":", "self", ".", "_rename_functions", "(", "node", ",", "full_name", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/tools/compatibility/ast_edits.py#L342-L357
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_windows.py
python
VarHVScrollHelper.ScrollLayout
(*args, **kwargs)
return _windows_.VarHVScrollHelper_ScrollLayout(*args, **kwargs)
ScrollLayout(self) -> bool
ScrollLayout(self) -> bool
[ "ScrollLayout", "(", "self", ")", "-", ">", "bool" ]
def ScrollLayout(*args, **kwargs): """ScrollLayout(self) -> bool""" return _windows_.VarHVScrollHelper_ScrollLayout(*args, **kwargs)
[ "def", "ScrollLayout", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "VarHVScrollHelper_ScrollLayout", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L2391-L2393
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/ntpath.py
python
normcase
(s)
return s.replace("/", "\\").lower()
Normalize case of pathname. Makes all characters lowercase and all slashes into backslashes.
Normalize case of pathname.
[ "Normalize", "case", "of", "pathname", "." ]
def normcase(s): """Normalize case of pathname. Makes all characters lowercase and all slashes into backslashes.""" return s.replace("/", "\\").lower()
[ "def", "normcase", "(", "s", ")", ":", "return", "s", ".", "replace", "(", "\"/\"", ",", "\"\\\\\"", ")", ".", "lower", "(", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/ntpath.py#L42-L46
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/tkwidgets/Dial.py
python
Dial._setRollover
(self)
Menu command to turn Dial rollover on/off (i.e. does value accumulate every time you complete a revolution of the dial?)
Menu command to turn Dial rollover on/off (i.e. does value accumulate every time you complete a revolution of the dial?)
[ "Menu", "command", "to", "turn", "Dial", "rollover", "on", "/", "off", "(", "i", ".", "e", ".", "does", "value", "accumulate", "every", "time", "you", "complete", "a", "revolution", "of", "the", "dial?", ")" ]
def _setRollover(self): """ Menu command to turn Dial rollover on/off (i.e. does value accumulate every time you complete a revolution of the dial?) """ self._valuator['fRollover'] = self._fRollover.get()
[ "def", "_setRollover", "(", "self", ")", ":", "self", ".", "_valuator", "[", "'fRollover'", "]", "=", "self", ".", "_fRollover", ".", "get", "(", ")" ]
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/tkwidgets/Dial.py#L118-L123
yuxng/DA-RNN
77fbb50b4272514588a10a9f90b7d5f8d46974fb
lib/gt_single_data_layer/layer.py
python
GtSingleDataLayer.forward
(self)
return blobs
Get blobs and copy them into this layer's top blob vector.
Get blobs and copy them into this layer's top blob vector.
[ "Get", "blobs", "and", "copy", "them", "into", "this", "layer", "s", "top", "blob", "vector", "." ]
def forward(self): """Get blobs and copy them into this layer's top blob vector.""" blobs = self._get_next_minibatch() return blobs
[ "def", "forward", "(", "self", ")", ":", "blobs", "=", "self", ".", "_get_next_minibatch", "(", ")", "return", "blobs" ]
https://github.com/yuxng/DA-RNN/blob/77fbb50b4272514588a10a9f90b7d5f8d46974fb/lib/gt_single_data_layer/layer.py#L47-L51
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/stc.py
python
StyledTextCtrl.AnnotationSetStyles
(*args, **kwargs)
return _stc.StyledTextCtrl_AnnotationSetStyles(*args, **kwargs)
AnnotationSetStyles(self, int line, String styles) Set the annotation styles for a line
AnnotationSetStyles(self, int line, String styles)
[ "AnnotationSetStyles", "(", "self", "int", "line", "String", "styles", ")" ]
def AnnotationSetStyles(*args, **kwargs): """ AnnotationSetStyles(self, int line, String styles) Set the annotation styles for a line """ return _stc.StyledTextCtrl_AnnotationSetStyles(*args, **kwargs)
[ "def", "AnnotationSetStyles", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_AnnotationSetStyles", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L5951-L5957
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/re.py
python
purge
()
Clear the regular expression cache
Clear the regular expression cache
[ "Clear", "the", "regular", "expression", "cache" ]
def purge(): "Clear the regular expression cache" _cache.clear() _cache_repl.clear()
[ "def", "purge", "(", ")", ":", "_cache", ".", "clear", "(", ")", "_cache_repl", ".", "clear", "(", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/re.py#L192-L195
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/turtle.py
python
TNavigator.ycor
(self)
return self._position[1]
Return the turtle's y coordinate --- No arguments. Example (for a Turtle instance named turtle): >>> reset() >>> turtle.left(60) >>> turtle.forward(100) >>> print turtle.ycor() 86.6025403784
Return the turtle's y coordinate --- No arguments.
[ "Return", "the", "turtle", "s", "y", "coordinate", "---", "No", "arguments", "." ]
def ycor(self): """ Return the turtle's y coordinate --- No arguments. Example (for a Turtle instance named turtle): >>> reset() >>> turtle.left(60) >>> turtle.forward(100) >>> print turtle.ycor() 86.6025403784 """ return self._pos...
[ "def", "ycor", "(", "self", ")", ":", "return", "self", ".", "_position", "[", "1", "]" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/turtle.py#L1643-L1655
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/model/trajectory.py
python
Trajectory.split
(self,time)
return (front,back)
Returns a pair of trajectories obtained from splitting this one at the given time
Returns a pair of trajectories obtained from splitting this one at the given time
[ "Returns", "a", "pair", "of", "trajectories", "obtained", "from", "splitting", "this", "one", "at", "the", "given", "time" ]
def split(self,time): """Returns a pair of trajectories obtained from splitting this one at the given time""" if time <= self.times[0]: #split before start of trajectory return self.constructor()([time],[self.milestones[0]]),self.constructor()([time]+self.times,[self.mile...
[ "def", "split", "(", "self", ",", "time", ")", ":", "if", "time", "<=", "self", ".", "times", "[", "0", "]", ":", "#split before start of trajectory", "return", "self", ".", "constructor", "(", ")", "(", "[", "time", "]", ",", "[", "self", ".", "mile...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/model/trajectory.py#L299-L320
whai362/PSENet
4d95395658662f2223805c36dcd573d9e190ce26
eval/ic15/rrc_evaluation_funcs.py
python
main_evaluation
(p,default_evaluation_params_fn,validate_data_fn,evaluate_method_fn,show_result=True,per_sample=True)
return resDict
This process validates a method, evaluates it and if it succed generates a ZIP file with a JSON entry for each sample. Params: p: Dictionary of parmeters with the GT/submission locations. If None is passed, the parameters send by the system are used. default_evaluation_params_fn: points to a function that r...
This process validates a method, evaluates it and if it succed generates a ZIP file with a JSON entry for each sample. Params: p: Dictionary of parmeters with the GT/submission locations. If None is passed, the parameters send by the system are used. default_evaluation_params_fn: points to a function that r...
[ "This", "process", "validates", "a", "method", "evaluates", "it", "and", "if", "it", "succed", "generates", "a", "ZIP", "file", "with", "a", "JSON", "entry", "for", "each", "sample", ".", "Params", ":", "p", ":", "Dictionary", "of", "parmeters", "with", ...
def main_evaluation(p,default_evaluation_params_fn,validate_data_fn,evaluate_method_fn,show_result=True,per_sample=True): """ This process validates a method, evaluates it and if it succed generates a ZIP file with a JSON entry for each sample. Params: p: Dictionary of parmeters with the GT/submission l...
[ "def", "main_evaluation", "(", "p", ",", "default_evaluation_params_fn", ",", "validate_data_fn", ",", "evaluate_method_fn", ",", "show_result", "=", "True", ",", "per_sample", "=", "True", ")", ":", "if", "(", "p", "==", "None", ")", ":", "p", "=", "dict", ...
https://github.com/whai362/PSENet/blob/4d95395658662f2223805c36dcd573d9e190ce26/eval/ic15/rrc_evaluation_funcs.py#L285-L349
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/Node/FS.py
python
Dir.get_contents
(self)
return SCons.Node._get_contents_map[self._func_get_contents](self)
Return content signatures and names of all our children separated by new-lines. Ensure that the nodes are sorted.
Return content signatures and names of all our children separated by new-lines. Ensure that the nodes are sorted.
[ "Return", "content", "signatures", "and", "names", "of", "all", "our", "children", "separated", "by", "new", "-", "lines", ".", "Ensure", "that", "the", "nodes", "are", "sorted", "." ]
def get_contents(self): """Return content signatures and names of all our children separated by new-lines. Ensure that the nodes are sorted.""" return SCons.Node._get_contents_map[self._func_get_contents](self)
[ "def", "get_contents", "(", "self", ")", ":", "return", "SCons", ".", "Node", ".", "_get_contents_map", "[", "self", ".", "_func_get_contents", "]", "(", "self", ")" ]
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Node/FS.py#L1856-L1859
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/mailbox.py
python
Maildir.__len__
(self)
return len(self._toc)
Return a count of messages in the mailbox.
Return a count of messages in the mailbox.
[ "Return", "a", "count", "of", "messages", "in", "the", "mailbox", "." ]
def __len__(self): """Return a count of messages in the mailbox.""" self._refresh() return len(self._toc)
[ "def", "__len__", "(", "self", ")", ":", "self", ".", "_refresh", "(", ")", "return", "len", "(", "self", ".", "_toc", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/mailbox.py#L410-L413
neoml-lib/neoml
a0d370fba05269a1b2258cef126f77bbd2054a3e
NeoML/samples/python/linear.py
python
accuracy
(model, X, y)
return float(correct)/len(y)
Returns the accuracy of model on the given data
Returns the accuracy of model on the given data
[ "Returns", "the", "accuracy", "of", "model", "on", "the", "given", "data" ]
def accuracy(model, X, y): """Returns the accuracy of model on the given data""" correct = sum(1 for label, probs in zip(y, model.classify(X)) if label == np.argmax(probs)) return float(correct)/len(y)
[ "def", "accuracy", "(", "model", ",", "X", ",", "y", ")", ":", "correct", "=", "sum", "(", "1", "for", "label", ",", "probs", "in", "zip", "(", "y", ",", "model", ".", "classify", "(", "X", ")", ")", "if", "label", "==", "np", ".", "argmax", ...
https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/samples/python/linear.py#L36-L40
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/gluon/rnn/rnn_cell.py
python
HybridSequentialRNNCell.add
(self, cell)
Appends a cell into the stack. Parameters ---------- cell : RecurrentCell The cell to add.
Appends a cell into the stack.
[ "Appends", "a", "cell", "into", "the", "stack", "." ]
def add(self, cell): """Appends a cell into the stack. Parameters ---------- cell : RecurrentCell The cell to add. """ self.register_child(cell)
[ "def", "add", "(", "self", ",", "cell", ")", ":", "self", ".", "register_child", "(", "cell", ")" ]
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/gluon/rnn/rnn_cell.py#L771-L779
CMA-ES/libcmaes
1c39d7f931b267117d365370c6da5334a6948942
python/lcmaes_interface.py
python
to_params
(x0, sigma0, str_algo=b'acmaes', fplot=None, lbounds=None, ubounds=None, scaling=False, vscaling=None, vshift=None, **kwargs)
return p
return parameter object instance for `lcmaes.pcmaes`. Keys in `kwargs` must correspond to `name` in `set_name` attributes of `lcmaes.CMAParameters`, e.g. ``ftarget=1e-7``. Details: when `fplot is None` (default), the default output filename is used.
return parameter object instance for `lcmaes.pcmaes`.
[ "return", "parameter", "object", "instance", "for", "lcmaes", ".", "pcmaes", "." ]
def to_params(x0, sigma0, str_algo=b'acmaes', fplot=None, lbounds=None, ubounds=None, scaling=False, vscaling=None, vshift=None, **kwargs): """return parameter object instance for `lcmaes.pcmaes`. Keys in `kwargs` must correspond to `name` in `set_name` attributes of `lcmaes.CMAParameters`, e.g. ``ftarget=...
[ "def", "to_params", "(", "x0", ",", "sigma0", ",", "str_algo", "=", "b'acmaes'", ",", "fplot", "=", "None", ",", "lbounds", "=", "None", ",", "ubounds", "=", "None", ",", "scaling", "=", "False", ",", "vscaling", "=", "None", ",", "vshift", "=", "Non...
https://github.com/CMA-ES/libcmaes/blob/1c39d7f931b267117d365370c6da5334a6948942/python/lcmaes_interface.py#L28-L63
wujixiu/helmet-detection
8eff5c59ddfba5a29e0b76aeb48babcb49246178
hardhat-wearing-detection/SSD-RPA/scripts/cpp_lint.py
python
GetLineWidth
(line)
Determines the width of the line in column positions. Args: line: A string, which may be a Unicode string. Returns: The width of the line in column positions, accounting for Unicode combining characters and wide characters.
Determines the width of the line in column positions.
[ "Determines", "the", "width", "of", "the", "line", "in", "column", "positions", "." ]
def GetLineWidth(line): """Determines the width of the line in column positions. Args: line: A string, which may be a Unicode string. Returns: The width of the line in column positions, accounting for Unicode combining characters and wide characters. """ if isinstance(line, unicode): width =...
[ "def", "GetLineWidth", "(", "line", ")", ":", "if", "isinstance", "(", "line", ",", "unicode", ")", ":", "width", "=", "0", "for", "uc", "in", "unicodedata", ".", "normalize", "(", "'NFC'", ",", "line", ")", ":", "if", "unicodedata", ".", "east_asian_w...
https://github.com/wujixiu/helmet-detection/blob/8eff5c59ddfba5a29e0b76aeb48babcb49246178/hardhat-wearing-detection/SSD-RPA/scripts/cpp_lint.py#L3441-L3460
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/traceback.py
python
extract_stack
(f=None, limit = None)
return list
Extract the raw traceback from the current stack frame. The return value has the same format as for extract_tb(). The optional 'f' and 'limit' arguments have the same meaning as for print_stack(). Each item in the list is a quadruple (filename, line number, function name, text), and the entries are i...
Extract the raw traceback from the current stack frame.
[ "Extract", "the", "raw", "traceback", "from", "the", "current", "stack", "frame", "." ]
def extract_stack(f=None, limit = None): """Extract the raw traceback from the current stack frame. The return value has the same format as for extract_tb(). The optional 'f' and 'limit' arguments have the same meaning as for print_stack(). Each item in the list is a quadruple (filename, line num...
[ "def", "extract_stack", "(", "f", "=", "None", ",", "limit", "=", "None", ")", ":", "if", "f", "is", "None", ":", "try", ":", "raise", "ZeroDivisionError", "except", "ZeroDivisionError", ":", "f", "=", "sys", ".", "exc_info", "(", ")", "[", "2", "]",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/traceback.py#L280-L312
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
python/artm/scores.py
python
ClassPrecisionScore.__init__
(self, name=None, config=None)
:param str name: the identifier of score, will be auto-generated if not specified :param config: the low-level config of this score :type config: protobuf object
:param str name: the identifier of score, will be auto-generated if not specified :param config: the low-level config of this score :type config: protobuf object
[ ":", "param", "str", "name", ":", "the", "identifier", "of", "score", "will", "be", "auto", "-", "generated", "if", "not", "specified", ":", "param", "config", ":", "the", "low", "-", "level", "config", "of", "this", "score", ":", "type", "config", ":"...
def __init__(self, name=None, config=None): """ :param str name: the identifier of score, will be auto-generated if not specified :param config: the low-level config of this score :type config: protobuf object """ BaseScore.__init__(self, name=n...
[ "def", "__init__", "(", "self", ",", "name", "=", "None", ",", "config", "=", "None", ")", ":", "BaseScore", ".", "__init__", "(", "self", ",", "name", "=", "name", ",", "class_id", "=", "None", ",", "topic_names", "=", "None", ",", "model_name", "="...
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/python/artm/scores.py#L744-L755
NVIDIA/thrust
627dccb359a635afdd69e95a6cc59698f23f70e2
internal/benchmark/compare_benchmark_results.py
python
io_manager.write_header
(self)
Write the header for the output CSV file.
Write the header for the output CSV file.
[ "Write", "the", "header", "for", "the", "output", "CSV", "file", "." ]
def write_header(self): """Write the header for the output CSV file.""" # Write the first line of the header. self.writer.writeheader() # Write the second line of the header. self.writer.writerow(self.variable_units)
[ "def", "write_header", "(", "self", ")", ":", "# Write the first line of the header.", "self", ".", "writer", ".", "writeheader", "(", ")", "# Write the second line of the header.", "self", ".", "writer", ".", "writerow", "(", "self", ".", "variable_units", ")" ]
https://github.com/NVIDIA/thrust/blob/627dccb359a635afdd69e95a6cc59698f23f70e2/internal/benchmark/compare_benchmark_results.py#L786-L792
facebookarchive/LogDevice
ce7726050edc49a1e15d9160e81c890736b779e2
logdevice/ops/ldops/admin_api.py
python
remove_nodes
( client: AdminAPI, req: RemoveNodesRequest )
return await client.removeNodes(req)
Wrapper for removeNodes() Thrift method
Wrapper for removeNodes() Thrift method
[ "Wrapper", "for", "removeNodes", "()", "Thrift", "method" ]
async def remove_nodes( client: AdminAPI, req: RemoveNodesRequest ) -> RemoveNodesResponse: """ Wrapper for removeNodes() Thrift method """ return await client.removeNodes(req)
[ "async", "def", "remove_nodes", "(", "client", ":", "AdminAPI", ",", "req", ":", "RemoveNodesRequest", ")", "->", "RemoveNodesResponse", ":", "return", "await", "client", ".", "removeNodes", "(", "req", ")" ]
https://github.com/facebookarchive/LogDevice/blob/ce7726050edc49a1e15d9160e81c890736b779e2/logdevice/ops/ldops/admin_api.py#L81-L87
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/estimator/canned/head.py
python
_weights
(features, weight_column)
Fetches weights from features.
Fetches weights from features.
[ "Fetches", "weights", "from", "features", "." ]
def _weights(features, weight_column): """Fetches weights from features.""" with ops.name_scope(None, 'weights', values=features.values()): if weight_column is None: return 1. if isinstance(weight_column, six.string_types): weight_column = feature_column_lib.numeric_column(key=weight_column) ...
[ "def", "_weights", "(", "features", ",", "weight_column", ")", ":", "with", "ops", ".", "name_scope", "(", "None", ",", "'weights'", ",", "values", "=", "features", ".", "values", "(", ")", ")", ":", "if", "weight_column", "is", "None", ":", "return", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/estimator/canned/head.py#L766-L782
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py
python
_TopologicallySortedEnvVarKeys
(env)
Takes a dict |env| whose values are strings that can refer to other keys, for example env['foo'] = '$(bar) and $(baz)'. Returns a list L of all keys of env such that key2 is after key1 in L if env[key2] refers to env[key1]. Throws an Exception in case of dependency cycles.
Takes a dict |env| whose values are strings that can refer to other keys, for example env['foo'] = '$(bar) and $(baz)'. Returns a list L of all keys of env such that key2 is after key1 in L if env[key2] refers to env[key1].
[ "Takes", "a", "dict", "|env|", "whose", "values", "are", "strings", "that", "can", "refer", "to", "other", "keys", "for", "example", "env", "[", "foo", "]", "=", "$", "(", "bar", ")", "and", "$", "(", "baz", ")", ".", "Returns", "a", "list", "L", ...
def _TopologicallySortedEnvVarKeys(env): """Takes a dict |env| whose values are strings that can refer to other keys, for example env['foo'] = '$(bar) and $(baz)'. Returns a list L of all keys of env such that key2 is after key1 in L if env[key2] refers to env[key1]. Throws an Exception in case of dependency c...
[ "def", "_TopologicallySortedEnvVarKeys", "(", "env", ")", ":", "# Since environment variables can refer to other variables, the evaluation", "# order is important. Below is the logic to compute the dependency graph", "# and sort it.", "regex", "=", "re", ".", "compile", "(", "r'\\$\\{(...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py#L1578-L1609
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
modules/freetype2/src/tools/docmaker/tohtml.py
python
HtmlFormatter.make_html_para
( self, words )
return para_header + line + para_footer
convert words of a paragraph into tagged HTML text, handle xrefs
convert words of a paragraph into tagged HTML text, handle xrefs
[ "convert", "words", "of", "a", "paragraph", "into", "tagged", "HTML", "text", "handle", "xrefs" ]
def make_html_para( self, words ): """ convert words of a paragraph into tagged HTML text, handle xrefs """ line = "" if words: line = self.make_html_word( words[0] ) for word in words[1:]: line = line + " " + self.make_html_word( word ) # han...
[ "def", "make_html_para", "(", "self", ",", "words", ")", ":", "line", "=", "\"\"", "if", "words", ":", "line", "=", "self", ".", "make_html_word", "(", "words", "[", "0", "]", ")", "for", "word", "in", "words", "[", "1", ":", "]", ":", "line", "=...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/modules/freetype2/src/tools/docmaker/tohtml.py#L258-L274
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/requests/cookies.py
python
RequestsCookieJar.copy
(self)
return new_cj
Return a copy of this RequestsCookieJar.
Return a copy of this RequestsCookieJar.
[ "Return", "a", "copy", "of", "this", "RequestsCookieJar", "." ]
def copy(self): """Return a copy of this RequestsCookieJar.""" new_cj = RequestsCookieJar() new_cj.update(self) return new_cj
[ "def", "copy", "(", "self", ")", ":", "new_cj", "=", "RequestsCookieJar", "(", ")", "new_cj", ".", "update", "(", "self", ")", "return", "new_cj" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/requests/cookies.py#L415-L419
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
RichTextFileHandler.SetEncoding
(*args, **kwargs)
return _richtext.RichTextFileHandler_SetEncoding(*args, **kwargs)
SetEncoding(self, String encoding)
SetEncoding(self, String encoding)
[ "SetEncoding", "(", "self", "String", "encoding", ")" ]
def SetEncoding(*args, **kwargs): """SetEncoding(self, String encoding)""" return _richtext.RichTextFileHandler_SetEncoding(*args, **kwargs)
[ "def", "SetEncoding", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextFileHandler_SetEncoding", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L2824-L2826
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/rnn/python/ops/rnn_cell.py
python
AttentionCellWrapper.__call__
(self, inputs, state, scope=None)
Long short-term memory cell with attention (LSTMA).
Long short-term memory cell with attention (LSTMA).
[ "Long", "short", "-", "term", "memory", "cell", "with", "attention", "(", "LSTMA", ")", "." ]
def __call__(self, inputs, state, scope=None): """Long short-term memory cell with attention (LSTMA).""" with vs.variable_scope(scope or type(self).__name__): if self._state_is_tuple: state, attns, attn_states = state else: states = state state = array_ops.slice(states, [0, 0...
[ "def", "__call__", "(", "self", ",", "inputs", ",", "state", ",", "scope", "=", "None", ")", ":", "with", "vs", ".", "variable_scope", "(", "scope", "or", "type", "(", "self", ")", ".", "__name__", ")", ":", "if", "self", ".", "_state_is_tuple", ":",...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/rnn/python/ops/rnn_cell.py#L737-L771
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
Treebook.GetTreeCtrl
(*args, **kwargs)
return _controls_.Treebook_GetTreeCtrl(*args, **kwargs)
GetTreeCtrl(self) -> TreeCtrl
GetTreeCtrl(self) -> TreeCtrl
[ "GetTreeCtrl", "(", "self", ")", "-", ">", "TreeCtrl" ]
def GetTreeCtrl(*args, **kwargs): """GetTreeCtrl(self) -> TreeCtrl""" return _controls_.Treebook_GetTreeCtrl(*args, **kwargs)
[ "def", "GetTreeCtrl", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "Treebook_GetTreeCtrl", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L3339-L3341
NVIDIA/MDL-SDK
aa9642b2546ad7b6236b5627385d882c2ed83c5d
src/mdl/jit/generator_jit/gen_libbsdf_runtime_header.py
python
print_wrapped
(parser, fileobj, line, wrap_pos = 99)
print the given line (provided without newline at end) and wrap it at wrap_pos, splitting the line at commas. Also handles commented out lines.
print the given line (provided without newline at end) and wrap it at wrap_pos, splitting the line at commas. Also handles commented out lines.
[ "print", "the", "given", "line", "(", "provided", "without", "newline", "at", "end", ")", "and", "wrap", "it", "at", "wrap_pos", "splitting", "the", "line", "at", "commas", ".", "Also", "handles", "commented", "out", "lines", "." ]
def print_wrapped(parser, fileobj, line, wrap_pos = 99): """print the given line (provided without newline at end) and wrap it at wrap_pos, splitting the line at commas. Also handles commented out lines.""" orig_line = line prefix = "" next_prefix = "// " if line.startswith("//") else " " while parser....
[ "def", "print_wrapped", "(", "parser", ",", "fileobj", ",", "line", ",", "wrap_pos", "=", "99", ")", ":", "orig_line", "=", "line", "prefix", "=", "\"\"", "next_prefix", "=", "\"// \"", "if", "line", ".", "startswith", "(", "\"//\"", ")", "else", "\"...
https://github.com/NVIDIA/MDL-SDK/blob/aa9642b2546ad7b6236b5627385d882c2ed83c5d/src/mdl/jit/generator_jit/gen_libbsdf_runtime_header.py#L165-L180
rampageX/firmware-mod-kit
c94cd6aeee50d92ec5280a6dba6d74828fd3606b
src/binwalk-2.1.1/src/binwalk/core/module.py
python
Kwarg.__init__
(self, name="", default=None, description="")
Class constructor. @name - Kwarg name. @default - Default kwarg value. @description - Description string. Return None.
Class constructor.
[ "Class", "constructor", "." ]
def __init__(self, name="", default=None, description=""): ''' Class constructor. @name - Kwarg name. @default - Default kwarg value. @description - Description string. Return None. ''' self.name = name self.default = default s...
[ "def", "__init__", "(", "self", ",", "name", "=", "\"\"", ",", "default", "=", "None", ",", "description", "=", "\"\"", ")", ":", "self", ".", "name", "=", "name", "self", ".", "default", "=", "default", "self", ".", "description", "=", "description" ]
https://github.com/rampageX/firmware-mod-kit/blob/c94cd6aeee50d92ec5280a6dba6d74828fd3606b/src/binwalk-2.1.1/src/binwalk/core/module.py#L77-L89
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/random.py
python
Random.gauss
(self, mu, sigma)
return mu + z*sigma
Gaussian distribution. mu is the mean, and sigma is the standard deviation. This is slightly faster than the normalvariate() function. Not thread-safe without a lock around calls.
Gaussian distribution.
[ "Gaussian", "distribution", "." ]
def gauss(self, mu, sigma): """Gaussian distribution. mu is the mean, and sigma is the standard deviation. This is slightly faster than the normalvariate() function. Not thread-safe without a lock around calls. """ # When x and y are two variables from [0, 1), unifor...
[ "def", "gauss", "(", "self", ",", "mu", ",", "sigma", ")", ":", "# When x and y are two variables from [0, 1), uniformly", "# distributed, then", "#", "# cos(2*pi*x)*sqrt(-2*log(1-y))", "# sin(2*pi*x)*sqrt(-2*log(1-y))", "#", "# are two *independent* variables with normal distr...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/random.py#L576-L613
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/clang/scripts/run_tool.py
python
_CompilerDispatcher.__ProcessResult
(self, result)
Handles result processing. Args: result: The result dictionary returned by _ExecuteTool.
Handles result processing.
[ "Handles", "result", "processing", "." ]
def __ProcessResult(self, result): """Handles result processing. Args: result: The result dictionary returned by _ExecuteTool. """ if result['status']: self.__success_count += 1 for k, v in result['edits'].iteritems(): self.__edits[k].extend(v) self.__edit_count += len...
[ "def", "__ProcessResult", "(", "self", ",", "result", ")", ":", "if", "result", "[", "'status'", "]", ":", "self", ".", "__success_count", "+=", "1", "for", "k", ",", "v", "in", "result", "[", "'edits'", "]", ".", "iteritems", "(", ")", ":", "self", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/clang/scripts/run_tool.py#L188-L209
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/stc.py
python
StyledTextCtrl.GetMarginOptions
(*args, **kwargs)
return _stc.StyledTextCtrl_GetMarginOptions(*args, **kwargs)
GetMarginOptions(self) -> int
GetMarginOptions(self) -> int
[ "GetMarginOptions", "(", "self", ")", "-", ">", "int" ]
def GetMarginOptions(*args, **kwargs): """GetMarginOptions(self) -> int""" return _stc.StyledTextCtrl_GetMarginOptions(*args, **kwargs)
[ "def", "GetMarginOptions", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_GetMarginOptions", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L5915-L5917
papyrussolution/OpenPapyrus
bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91
Src/OSF/abseil/absl/abseil.podspec.gen.py
python
generate
(args)
Generates a podspec file from all BUILD files under absl directory.
Generates a podspec file from all BUILD files under absl directory.
[ "Generates", "a", "podspec", "file", "from", "all", "BUILD", "files", "under", "absl", "directory", "." ]
def generate(args): """Generates a podspec file from all BUILD files under absl directory.""" rules = filter(relevant_rule, collect_rules("absl")) with open(args.output, "wt") as f: write_podspec(f, rules, vars(args))
[ "def", "generate", "(", "args", ")", ":", "rules", "=", "filter", "(", "relevant_rule", ",", "collect_rules", "(", "\"absl\"", ")", ")", "with", "open", "(", "args", ".", "output", ",", "\"wt\"", ")", "as", "f", ":", "write_podspec", "(", "f", ",", "...
https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/abseil/absl/abseil.podspec.gen.py#L200-L204
milvus-io/milvus
3b1030de2b6c39e3512833e97f6044d63eb24237
internal/core/build-support/cpplint.py
python
CheckInvalidIncrement
(filename, clean_lines, linenum, error)
Checks for invalid increment *count++. For example following function: void increment_counter(int* count) { *count++; } is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*count, (*count)++ or *count += 1. Args: filename: The name of the current file. ...
Checks for invalid increment *count++.
[ "Checks", "for", "invalid", "increment", "*", "count", "++", "." ]
def CheckInvalidIncrement(filename, clean_lines, linenum, error): """Checks for invalid increment *count++. For example following function: void increment_counter(int* count) { *count++; } is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*count, (*count)++ ...
[ "def", "CheckInvalidIncrement", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "if", "_RE_PATTERN_INVALID_INCREMENT", ".", "match", "(", "line", ")", ":", "error", ...
https://github.com/milvus-io/milvus/blob/3b1030de2b6c39e3512833e97f6044d63eb24237/internal/core/build-support/cpplint.py#L2660-L2679
Kitware/VTK
5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8
Wrapping/Python/vtkmodules/util/vtkAlgorithm.py
python
VTKAlgorithm.RequestData
(self, vtkself, request, inInfo, outInfo)
Overwritten by subclass to execute the algorithm.
Overwritten by subclass to execute the algorithm.
[ "Overwritten", "by", "subclass", "to", "execute", "the", "algorithm", "." ]
def RequestData(self, vtkself, request, inInfo, outInfo): """Overwritten by subclass to execute the algorithm.""" raise NotImplementedError('RequestData must be implemented')
[ "def", "RequestData", "(", "self", ",", "vtkself", ",", "request", ",", "inInfo", ",", "outInfo", ")", ":", "raise", "NotImplementedError", "(", "'RequestData must be implemented'", ")" ]
https://github.com/Kitware/VTK/blob/5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8/Wrapping/Python/vtkmodules/util/vtkAlgorithm.py#L69-L71
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/distutils/ccompiler_opt.py
python
_Parse._parse_policy_werror
(self, has_baseline, final_targets, extra_flags)
return has_baseline, final_targets, extra_flags
force warnings to treated as errors
force warnings to treated as errors
[ "force", "warnings", "to", "treated", "as", "errors" ]
def _parse_policy_werror(self, has_baseline, final_targets, extra_flags): """force warnings to treated as errors""" flags = self.cc_flags["werror"] if not flags: self.dist_log( "current compiler doesn't support werror flags, " "warnings will 'not' trea...
[ "def", "_parse_policy_werror", "(", "self", ",", "has_baseline", ",", "final_targets", ",", "extra_flags", ")", ":", "flags", "=", "self", ".", "cc_flags", "[", "\"werror\"", "]", "if", "not", "flags", ":", "self", ".", "dist_log", "(", "\"current compiler doe...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/distutils/ccompiler_opt.py#L2086-L2097
esa/pagmo
80281d549c8f1b470e1489a5d37c8f06b2e429c0
PyGMO/problem/__init__.py
python
_dejong_ctor
(self, dim=10)
Constructs a De Jong problem (Box-Constrained Continuous Single-Objective) USAGE: problem.dejong(dim=10) * dim: problem dimension
Constructs a De Jong problem (Box-Constrained Continuous Single-Objective)
[ "Constructs", "a", "De", "Jong", "problem", "(", "Box", "-", "Constrained", "Continuous", "Single", "-", "Objective", ")" ]
def _dejong_ctor(self, dim=10): """ Constructs a De Jong problem (Box-Constrained Continuous Single-Objective) USAGE: problem.dejong(dim=10) * dim: problem dimension """ # We construct the arg list for the original constructor exposed by # boost_python arg_list = [] arg_list.appen...
[ "def", "_dejong_ctor", "(", "self", ",", "dim", "=", "10", ")", ":", "# We construct the arg list for the original constructor exposed by", "# boost_python", "arg_list", "=", "[", "]", "arg_list", ".", "append", "(", "dim", ")", "self", ".", "_orig_init", "(", "*"...
https://github.com/esa/pagmo/blob/80281d549c8f1b470e1489a5d37c8f06b2e429c0/PyGMO/problem/__init__.py#L166-L179
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/rsa/rsa/key.py
python
PublicKey.load_pkcs1_openssl_der
(cls, keyfile)
return cls._load_pkcs1_der(keyinfo['key'][1:])
Loads a PKCS#1 DER-encoded public key file from OpenSSL. @param keyfile: contents of a DER-encoded file that contains the public key, from OpenSSL. @return: a PublicKey object
Loads a PKCS#1 DER-encoded public key file from OpenSSL.
[ "Loads", "a", "PKCS#1", "DER", "-", "encoded", "public", "key", "file", "from", "OpenSSL", "." ]
def load_pkcs1_openssl_der(cls, keyfile): '''Loads a PKCS#1 DER-encoded public key file from OpenSSL. @param keyfile: contents of a DER-encoded file that contains the public key, from OpenSSL. @return: a PublicKey object ''' from rsa.asn1 import OpenSSLPubKey ...
[ "def", "load_pkcs1_openssl_der", "(", "cls", ",", "keyfile", ")", ":", "from", "rsa", ".", "asn1", "import", "OpenSSLPubKey", "from", "pyasn1", ".", "codec", ".", "der", "import", "decoder", "from", "pyasn1", ".", "type", "import", "univ", "(", "keyinfo", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/rsa/rsa/key.py#L222-L239