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
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
uCSIsSuperscriptsandSubscripts
(code)
return ret
Check whether the character is part of SuperscriptsandSubscripts UCS Block
Check whether the character is part of SuperscriptsandSubscripts UCS Block
[ "Check", "whether", "the", "character", "is", "part", "of", "SuperscriptsandSubscripts", "UCS", "Block" ]
def uCSIsSuperscriptsandSubscripts(code): """Check whether the character is part of SuperscriptsandSubscripts UCS Block """ ret = libxml2mod.xmlUCSIsSuperscriptsandSubscripts(code) return ret
[ "def", "uCSIsSuperscriptsandSubscripts", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsSuperscriptsandSubscripts", "(", "code", ")", "return", "ret" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L2866-L2870
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/lib2to3/pytree.py
python
WildcardPattern.__init__
(self, content=None, min=0, max=HUGE, name=None)
Initializer. Args: content: optional sequence of subsequences of patterns; if absent, matches one node; if present, each subsequence is an alternative [*] min: optional minimum number of times to match, default 0 max: optional maximu...
Initializer.
[ "Initializer", "." ]
def __init__(self, content=None, min=0, max=HUGE, name=None): """ Initializer. Args: content: optional sequence of subsequences of patterns; if absent, matches one node; if present, each subsequence is an alternative [*] min: opt...
[ "def", "__init__", "(", "self", ",", "content", "=", "None", ",", "min", "=", "0", ",", "max", "=", "HUGE", ",", "name", "=", "None", ")", ":", "assert", "0", "<=", "min", "<=", "max", "<=", "HUGE", ",", "(", "min", ",", "max", ")", "if", "co...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/lib2to3/pytree.py#L619-L652
kushview/Element
1cc16380caa2ab79461246ba758b9de1f46db2a5
waflib/Tools/xlc.py
python
xlc_common_flags
(conf)
Flags required for executing the Aix C compiler
Flags required for executing the Aix C compiler
[ "Flags", "required", "for", "executing", "the", "Aix", "C", "compiler" ]
def xlc_common_flags(conf): """ Flags required for executing the Aix C compiler """ v = conf.env v.CC_SRC_F = [] v.CC_TGT_F = ['-c', '-o'] if not v.LINK_CC: v.LINK_CC = v.CC v.CCLNK_SRC_F = [] v.CCLNK_TGT_F = ['-o'] v.CPPPATH_ST = '-I%s' v.DEFINES_ST ...
[ "def", "xlc_common_flags", "(", "conf", ")", ":", "v", "=", "conf", ".", "env", "v", ".", "CC_SRC_F", "=", "[", "]", "v", ".", "CC_TGT_F", "=", "[", "'-c'", ",", "'-o'", "]", "if", "not", "v", ".", "LINK_CC", ":", "v", ".", "LINK_CC", "=", "v",...
https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Tools/xlc.py#L21-L56
gemrb/gemrb
730206eed8d1dd358ca5e69a62f9e099aa22ffc6
gemrb/GUIScripts/LUSpellSelection.py
python
MarkButton
(i, select)
return
Shows enabled, disabled, or highlighted button. If selected is true, the button is highlighted. Be sure i is sent with +SpellTopIndex!
Shows enabled, disabled, or highlighted button.
[ "Shows", "enabled", "disabled", "or", "highlighted", "button", "." ]
def MarkButton (i, select): """Shows enabled, disabled, or highlighted button. If selected is true, the button is highlighted. Be sure i is sent with +SpellTopIndex!""" j = RowIndex() if select: state = IE_GUI_BUTTON_SELECTED else: if Spells[SpellLevel][i][1] == 1: state = IE_GUI_BUTTON_ENABLED elif S...
[ "def", "MarkButton", "(", "i", ",", "select", ")", ":", "j", "=", "RowIndex", "(", ")", "if", "select", ":", "state", "=", "IE_GUI_BUTTON_SELECTED", "else", ":", "if", "Spells", "[", "SpellLevel", "]", "[", "i", "]", "[", "1", "]", "==", "1", ":", ...
https://github.com/gemrb/gemrb/blob/730206eed8d1dd358ca5e69a62f9e099aa22ffc6/gemrb/GUIScripts/LUSpellSelection.py#L547-L569
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
tools/mo/openvino/tools/mo/utils/cli_parser.py
python
writable_dir
(path: str)
Checks that specified directory is writable. The directory may not exist but it's parent or grandparent must exist. :param path: path to check that it is writable. :return: path if it is writable
Checks that specified directory is writable. The directory may not exist but it's parent or grandparent must exist. :param path: path to check that it is writable. :return: path if it is writable
[ "Checks", "that", "specified", "directory", "is", "writable", ".", "The", "directory", "may", "not", "exist", "but", "it", "s", "parent", "or", "grandparent", "must", "exist", ".", ":", "param", "path", ":", "path", "to", "check", "that", "it", "is", "wr...
def writable_dir(path: str): """ Checks that specified directory is writable. The directory may not exist but it's parent or grandparent must exist. :param path: path to check that it is writable. :return: path if it is writable """ if path is None: raise Error('The directory parameter i...
[ "def", "writable_dir", "(", "path", ":", "str", ")", ":", "if", "path", "is", "None", ":", "raise", "Error", "(", "'The directory parameter is None'", ")", "if", "os", ".", "path", ".", "exists", "(", "path", ")", ":", "if", "os", ".", "path", ".", "...
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/utils/cli_parser.py#L201-L228
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/base.py
python
OverloadSelector._best_signature
(self, candidates)
return ordered[0]
Returns the best signature out of the candidates
Returns the best signature out of the candidates
[ "Returns", "the", "best", "signature", "out", "of", "the", "candidates" ]
def _best_signature(self, candidates): """ Returns the best signature out of the candidates """ ordered, genericity = self._sort_signatures(candidates) # check for ambiguous signatures if len(ordered) > 1: firstscore = genericity[ordered[0]] same =...
[ "def", "_best_signature", "(", "self", ",", "candidates", ")", ":", "ordered", ",", "genericity", "=", "self", ".", "_sort_signatures", "(", "candidates", ")", "# check for ambiguous signatures", "if", "len", "(", "ordered", ")", ">", "1", ":", "firstscore", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/base.py#L71-L86
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/generic.py
python
NDFrame.first
(self: FrameOrSeries, offset)
return self.loc[:end]
Method to subset initial periods of time series data based on a date offset. Parameters ---------- offset : str, DateOffset, dateutil.relativedelta Returns ------- subset : same type as caller Raises ------ TypeError If the index is ...
Method to subset initial periods of time series data based on a date offset.
[ "Method", "to", "subset", "initial", "periods", "of", "time", "series", "data", "based", "on", "a", "date", "offset", "." ]
def first(self: FrameOrSeries, offset) -> FrameOrSeries: """ Method to subset initial periods of time series data based on a date offset. Parameters ---------- offset : str, DateOffset, dateutil.relativedelta Returns ------- subset : same type as caller ...
[ "def", "first", "(", "self", ":", "FrameOrSeries", ",", "offset", ")", "->", "FrameOrSeries", ":", "if", "not", "isinstance", "(", "self", ".", "index", ",", "DatetimeIndex", ")", ":", "raise", "TypeError", "(", "\"'first' only supports a DatetimeIndex index\"", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/generic.py#L8118-L8178
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/traitlets/py3/traitlets/traitlets.py
python
HasTraits.hold_trait_notifications
(self)
Context manager for bundling trait change notifications and cross validation. Use this when doing multiple trait assignments (init, config), to avoid race conditions in trait notifiers requesting other trait values. All trait notifications will fire after all values have been assigned.
Context manager for bundling trait change notifications and cross validation.
[ "Context", "manager", "for", "bundling", "trait", "change", "notifications", "and", "cross", "validation", "." ]
def hold_trait_notifications(self): """Context manager for bundling trait change notifications and cross validation. Use this when doing multiple trait assignments (init, config), to avoid race conditions in trait notifiers requesting other trait values. All trait notifications ...
[ "def", "hold_trait_notifications", "(", "self", ")", ":", "if", "self", ".", "_cross_validation_lock", ":", "yield", "return", "else", ":", "cache", "=", "{", "}", "notify_change", "=", "self", ".", "notify_change", "def", "compress", "(", "past_changes", ",",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/traitlets/py3/traitlets/traitlets.py#L1153-L1216
bh107/bohrium
5b83e7117285fefc7779ed0e9acb0f8e74c7e068
thirdparty/pyratemp/pyratemp.py
python
Parser._parse_sub
(self, parsetree, text, fpos=0)
Parse substitutions, and append them to the parse-tree. Additionally, remove comments.
Parse substitutions, and append them to the parse-tree.
[ "Parse", "substitutions", "and", "append", "them", "to", "the", "parse", "-", "tree", "." ]
def _parse_sub(self, parsetree, text, fpos=0): """Parse substitutions, and append them to the parse-tree. Additionally, remove comments. """ curr = 0 for match in self._reSubstitution.finditer(text): start = match.start() if start > curr: ...
[ "def", "_parse_sub", "(", "self", ",", "parsetree", ",", "text", ",", "fpos", "=", "0", ")", ":", "curr", "=", "0", "for", "match", "in", "self", ".", "_reSubstitution", ".", "finditer", "(", "text", ")", ":", "start", "=", "match", ".", "start", "...
https://github.com/bh107/bohrium/blob/5b83e7117285fefc7779ed0e9acb0f8e74c7e068/thirdparty/pyratemp/pyratemp.py#L567-L597
shogun-toolbox/shogun
9b8d856971af5a295dd6ad70623ae45647a6334c
applications/easysvm/esvm/mldata.py
python
convert
(infile,outfile,extype)
Copy data from infile to outfile, possibly converting the file format.
Copy data from infile to outfile, possibly converting the file format.
[ "Copy", "data", "from", "infile", "to", "outfile", "possibly", "converting", "the", "file", "format", "." ]
def convert(infile,outfile,extype): """Copy data from infile to outfile, possibly converting the file format.""" fp1 = init_datasetfile(infile,extype) (examples,labels) = fp1.readlines() fp2 = init_datasetfile(outfile,extype) fp2.writelines(examples,labels)
[ "def", "convert", "(", "infile", ",", "outfile", ",", "extype", ")", ":", "fp1", "=", "init_datasetfile", "(", "infile", ",", "extype", ")", "(", "examples", ",", "labels", ")", "=", "fp1", ".", "readlines", "(", ")", "fp2", "=", "init_datasetfile", "(...
https://github.com/shogun-toolbox/shogun/blob/9b8d856971af5a295dd6ad70623ae45647a6334c/applications/easysvm/esvm/mldata.py#L278-L283
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py
python
Metrowerks_Shell_Suite_Events.Remove_Files
(self, _object, _attributes={}, **_arguments)
Remove Files: Remove the specified file(s) from the current project Required argument: List of files to remove Keyword argument _attributes: AppleEvent attribute dictionary Returns: Error code for each file removed
Remove Files: Remove the specified file(s) from the current project Required argument: List of files to remove Keyword argument _attributes: AppleEvent attribute dictionary Returns: Error code for each file removed
[ "Remove", "Files", ":", "Remove", "the", "specified", "file", "(", "s", ")", "from", "the", "current", "project", "Required", "argument", ":", "List", "of", "files", "to", "remove", "Keyword", "argument", "_attributes", ":", "AppleEvent", "attribute", "diction...
def Remove_Files(self, _object, _attributes={}, **_arguments): """Remove Files: Remove the specified file(s) from the current project Required argument: List of files to remove Keyword argument _attributes: AppleEvent attribute dictionary Returns: Error code for each file removed ...
[ "def", "Remove_Files", "(", "self", ",", "_object", ",", "_attributes", "=", "{", "}", ",", "*", "*", "_arguments", ")", ":", "_code", "=", "'MMPR'", "_subcode", "=", "'RemF'", "if", "_arguments", ":", "raise", "TypeError", ",", "'No optional args expected'"...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py#L517-L536
wyrover/book-code
7f4883d9030d553bc6bcfa3da685e34789839900
3rdparty/protobuf/python/google/protobuf/symbol_database.py
python
SymbolDatabase.RegisterEnumDescriptor
(self, enum_descriptor)
return enum_descriptor
Registers the given enum descriptor in the local database. Args: enum_descriptor: a descriptor.EnumDescriptor. Returns: The provided descriptor.
Registers the given enum descriptor in the local database.
[ "Registers", "the", "given", "enum", "descriptor", "in", "the", "local", "database", "." ]
def RegisterEnumDescriptor(self, enum_descriptor): """Registers the given enum descriptor in the local database. Args: enum_descriptor: a descriptor.EnumDescriptor. Returns: The provided descriptor. """ self.pool.AddEnumDescriptor(enum_descriptor) return enum_descriptor
[ "def", "RegisterEnumDescriptor", "(", "self", ",", "enum_descriptor", ")", ":", "self", ".", "pool", ".", "AddEnumDescriptor", "(", "enum_descriptor", ")", "return", "enum_descriptor" ]
https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/google/protobuf/symbol_database.py#L85-L95
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/debug/wrappers/framework.py
python
NonInteractiveDebugWrapperSession.on_run_start
(self, request)
return OnRunStartResponse( OnRunStartAction.DEBUG_RUN, debug_urls, debug_ops=watch_opts.debug_ops, node_name_regex_whitelist=watch_opts.node_name_regex_whitelist, op_type_regex_whitelist=watch_opts.op_type_regex_whitelist, tensor_dtype_regex_whitelist=watch_opts.tensor_dt...
See doc of BaseDebugWrapperSession.on_run_start.
See doc of BaseDebugWrapperSession.on_run_start.
[ "See", "doc", "of", "BaseDebugWrapperSession", ".", "on_run_start", "." ]
def on_run_start(self, request): """See doc of BaseDebugWrapperSession.on_run_start.""" debug_urls, watch_opts = self._prepare_run_watch_config( request.fetches, request.feed_dict) return OnRunStartResponse( OnRunStartAction.DEBUG_RUN, debug_urls, debug_ops=watch_opts.debug...
[ "def", "on_run_start", "(", "self", ",", "request", ")", ":", "debug_urls", ",", "watch_opts", "=", "self", ".", "_prepare_run_watch_config", "(", "request", ".", "fetches", ",", "request", ".", "feed_dict", ")", "return", "OnRunStartResponse", "(", "OnRunStartA...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/wrappers/framework.py#L853-L867
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/externals/_arff.py
python
ArffDecoder.decode
(self, s, encode_nominal=False, return_type=DENSE)
Returns the Python representation of a given ARFF file. When a file object is passed as an argument, this method reads lines iteratively, avoiding to load unnecessary information to the memory. :param s: a string or file object with the ARFF file. :param encode_nominal: boolean, if Tru...
Returns the Python representation of a given ARFF file.
[ "Returns", "the", "Python", "representation", "of", "a", "given", "ARFF", "file", "." ]
def decode(self, s, encode_nominal=False, return_type=DENSE): '''Returns the Python representation of a given ARFF file. When a file object is passed as an argument, this method reads lines iteratively, avoiding to load unnecessary information to the memory. :param s: a string or file ...
[ "def", "decode", "(", "self", ",", "s", ",", "encode_nominal", "=", "False", ",", "return_type", "=", "DENSE", ")", ":", "try", ":", "return", "self", ".", "_decode", "(", "s", ",", "encode_nominal", "=", "encode_nominal", ",", "matrix_type", "=", "retur...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/externals/_arff.py#L875-L895
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
Log_SetLogLevel
(*args, **kwargs)
return _misc_.Log_SetLogLevel(*args, **kwargs)
Log_SetLogLevel(LogLevel logLevel)
Log_SetLogLevel(LogLevel logLevel)
[ "Log_SetLogLevel", "(", "LogLevel", "logLevel", ")" ]
def Log_SetLogLevel(*args, **kwargs): """Log_SetLogLevel(LogLevel logLevel)""" return _misc_.Log_SetLogLevel(*args, **kwargs)
[ "def", "Log_SetLogLevel", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "Log_SetLogLevel", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L1636-L1638
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
deprecated/algorithms/sfm/OpenSfM/opensfm/io.py
python
shot_from_json
(key, obj, cameras)
return shot
Read shot from a json object
Read shot from a json object
[ "Read", "shot", "from", "a", "json", "object" ]
def shot_from_json(key, obj, cameras): """ Read shot from a json object """ pose = types.Pose() pose.rotation = obj["rotation"] if "translation" in obj: pose.translation = obj["translation"] metadata = types.ShotMetadata() metadata.orientation = obj.get("orientation") metada...
[ "def", "shot_from_json", "(", "key", ",", "obj", ",", "cameras", ")", ":", "pose", "=", "types", ".", "Pose", "(", ")", "pose", ".", "rotation", "=", "obj", "[", "\"rotation\"", "]", "if", "\"translation\"", "in", "obj", ":", "pose", ".", "translation"...
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/deprecated/algorithms/sfm/OpenSfM/opensfm/io.py#L90-L122
ucbrise/confluo
578883a4f7fbbb4aea78c342d366f5122ef598f7
pyclient/confluo/rpc/schema.py
python
Schema.pack
(self, rec)
return packed
Pack data into a record. Args: rec: The record to pack Returns: Packed record
Pack data into a record.
[ "Pack", "data", "into", "a", "record", "." ]
def pack(self, rec): """ Pack data into a record. Args: rec: The record to pack Returns: Packed record """ packed = "" if len(rec) == len(self.columns_): off = 1 packed += struct.pack('Q', rec[0]) elif len(rec) == l...
[ "def", "pack", "(", "self", ",", "rec", ")", ":", "packed", "=", "\"\"", "if", "len", "(", "rec", ")", "==", "len", "(", "self", ".", "columns_", ")", ":", "off", "=", "1", "packed", "+=", "struct", ".", "pack", "(", "'Q'", ",", "rec", "[", "...
https://github.com/ucbrise/confluo/blob/578883a4f7fbbb4aea78c342d366f5122ef598f7/pyclient/confluo/rpc/schema.py#L64-L84
ZintrulCre/LeetCode_Archiver
de23e16ead29336b5ee7aa1898a392a5d6463d27
LeetCode/python3/289.py
python
Solution.gameOfLife
(self, board)
:type board: List[List[int]] :rtype: void Do not return anything, modify board in-place instead.
:type board: List[List[int]] :rtype: void Do not return anything, modify board in-place instead.
[ ":", "type", "board", ":", "List", "[", "List", "[", "int", "]]", ":", "rtype", ":", "void", "Do", "not", "return", "anything", "modify", "board", "in", "-", "place", "instead", "." ]
def gameOfLife(self, board): """ :type board: List[List[int]] :rtype: void Do not return anything, modify board in-place instead. """ ret = copy.deepcopy(board) m = len(board) n = len(board[0]) if m > 0 else 0 for i in range(m): for j in range(...
[ "def", "gameOfLife", "(", "self", ",", "board", ")", ":", "ret", "=", "copy", ".", "deepcopy", "(", "board", ")", "m", "=", "len", "(", "board", ")", "n", "=", "len", "(", "board", "[", "0", "]", ")", "if", "m", ">", "0", "else", "0", "for", ...
https://github.com/ZintrulCre/LeetCode_Archiver/blob/de23e16ead29336b5ee7aa1898a392a5d6463d27/LeetCode/python3/289.py#L2-L22
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/optimizer.py
python
_get_processor
(v)
The processor of v.
The processor of v.
[ "The", "processor", "of", "v", "." ]
def _get_processor(v): """The processor of v.""" if context.executing_eagerly(): if isinstance(v, ops.Tensor): return _TensorProcessor(v) else: return _DenseResourceVariableProcessor(v) if resource_variable_ops.is_resource_variable(v) and not v._in_graph_mode: # pylint: disable=protected-acce...
[ "def", "_get_processor", "(", "v", ")", ":", "if", "context", ".", "executing_eagerly", "(", ")", ":", "if", "isinstance", "(", "v", ",", "ops", ".", "Tensor", ")", ":", "return", "_TensorProcessor", "(", "v", ")", "else", ":", "return", "_DenseResourceV...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/optimizer.py#L197-L213
s9xie/hed
94fb22f10cbfec8d84fbc0642b224022014b6bd6
scripts/cpp_lint.py
python
CheckCStyleCast
(filename, linenum, line, raw_line, cast_type, pattern, error)
return True
Checks for a C-style cast by looking for the pattern. Args: filename: The name of the current file. linenum: The number of the line to check. line: The line of code to check. raw_line: The raw line of code to check, with comments. cast_type: The string for the C++ cast to recommend. This is eith...
Checks for a C-style cast by looking for the pattern.
[ "Checks", "for", "a", "C", "-", "style", "cast", "by", "looking", "for", "the", "pattern", "." ]
def CheckCStyleCast(filename, linenum, line, raw_line, cast_type, pattern, error): """Checks for a C-style cast by looking for the pattern. Args: filename: The name of the current file. linenum: The number of the line to check. line: The line of code to check. raw_line: The raw ...
[ "def", "CheckCStyleCast", "(", "filename", ",", "linenum", ",", "line", ",", "raw_line", ",", "cast_type", ",", "pattern", ",", "error", ")", ":", "match", "=", "Search", "(", "pattern", ",", "line", ")", "if", "not", "match", ":", "return", "False", "...
https://github.com/s9xie/hed/blob/94fb22f10cbfec8d84fbc0642b224022014b6bd6/scripts/cpp_lint.py#L4247-L4338
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/py/py/_path/common.py
python
PathBase.relto
(self, relpath)
return ""
return a string which is the relative part of the path to the given 'relpath'.
return a string which is the relative part of the path to the given 'relpath'.
[ "return", "a", "string", "which", "is", "the", "relative", "part", "of", "the", "path", "to", "the", "given", "relpath", "." ]
def relto(self, relpath): """ return a string which is the relative part of the path to the given 'relpath'. """ if not isinstance(relpath, (str, PathBase)): raise TypeError("%r: not a string or path object" %(relpath,)) strrelpath = str(relpath) if strrelpath...
[ "def", "relto", "(", "self", ",", "relpath", ")", ":", "if", "not", "isinstance", "(", "relpath", ",", "(", "str", ",", "PathBase", ")", ")", ":", "raise", "TypeError", "(", "\"%r: not a string or path object\"", "%", "(", "relpath", ",", ")", ")", "strr...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/py/py/_path/common.py#L262-L280
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/grid.py
python
GridCellAttr.SetSize
(*args, **kwargs)
return _grid.GridCellAttr_SetSize(*args, **kwargs)
SetSize(self, int num_rows, int num_cols)
SetSize(self, int num_rows, int num_cols)
[ "SetSize", "(", "self", "int", "num_rows", "int", "num_cols", ")" ]
def SetSize(*args, **kwargs): """SetSize(self, int num_rows, int num_cols)""" return _grid.GridCellAttr_SetSize(*args, **kwargs)
[ "def", "SetSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "GridCellAttr_SetSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L559-L561
SpaceNetChallenge/BuildingDetectors
3def3c44b5847c744cd2f3356182892d92496579
qinhaifang/src/evalTools/script/preprocess_space_net_data.py
python
generate_label_map_worker
(image_name)
docstring for generate_label_map_worker
docstring for generate_label_map_worker
[ "docstring", "for", "generate_label_map_worker" ]
def generate_label_map_worker(image_name): """docstring for generate_label_map_worker""" try: image_id = '_'.join(image_name.split('.')[0].split('_')[1:]) image_name = os.path.join(setting.PIC_3BAND_DIR, image_name) pixel_geojson_file = os.path.join(setting.PIXEL_GEO_JSON_DIR, ...
[ "def", "generate_label_map_worker", "(", "image_name", ")", ":", "try", ":", "image_id", "=", "'_'", ".", "join", "(", "image_name", ".", "split", "(", "'.'", ")", "[", "0", "]", ".", "split", "(", "'_'", ")", "[", "1", ":", "]", ")", "image_name", ...
https://github.com/SpaceNetChallenge/BuildingDetectors/blob/3def3c44b5847c744cd2f3356182892d92496579/qinhaifang/src/evalTools/script/preprocess_space_net_data.py#L105-L123
MythTV/mythtv
d282a209cb8be85d036f85a62a8ec971b67d45f4
mythtv/programs/scripts/internetcontent/nv_python_libs/mainProcess.py
python
OutStreamEncoder.__getattr__
(self, attr)
return getattr(self.out, attr)
Delegate everything but write to the stream
Delegate everything but write to the stream
[ "Delegate", "everything", "but", "write", "to", "the", "stream" ]
def __getattr__(self, attr): """Delegate everything but write to the stream""" return getattr(self.out, attr)
[ "def", "__getattr__", "(", "self", ",", "attr", ")", ":", "return", "getattr", "(", "self", ".", "out", ",", "attr", ")" ]
https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/internetcontent/nv_python_libs/mainProcess.py#L56-L58
bh107/bohrium
5b83e7117285fefc7779ed0e9acb0f8e74c7e068
thirdparty/pyratemp/pyratemp.py
python
EvalPseudoSandbox.eval
(self, expr, variables)
return x
Eval a Python-eval-expression. Sets ``self.vars_ptr`` to ``variables`` and compiles the code before evaluating.
Eval a Python-eval-expression.
[ "Eval", "a", "Python", "-", "eval", "-", "expression", "." ]
def eval(self, expr, variables): """Eval a Python-eval-expression. Sets ``self.vars_ptr`` to ``variables`` and compiles the code before evaluating. """ sav = self.vars_ptr self.vars_ptr = variables try: x = eval(self.compile(expr), {"__builtins__": s...
[ "def", "eval", "(", "self", ",", "expr", ",", "variables", ")", ":", "sav", "=", "self", ".", "vars_ptr", "self", ".", "vars_ptr", "=", "variables", "try", ":", "x", "=", "eval", "(", "self", ".", "compile", "(", "expr", ")", ",", "{", "\"__builtin...
https://github.com/bh107/bohrium/blob/5b83e7117285fefc7779ed0e9acb0f8e74c7e068/thirdparty/pyratemp/pyratemp.py#L895-L913
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/coremltools/models/nearest_neighbors/builder.py
python
KNearestNeighborsClassifierBuilder.__init__
( self, input_name, output_name, number_of_dimensions, default_class_label, **kwargs )
Create a KNearestNeighborsClassifierBuilder object. :param input_name: Name of the model input :param output_name: Name of the output :param number_of_dimensions: Number of dimensions of the input data :param default_class_label: The default class label to use for predictions. Must be ei...
Create a KNearestNeighborsClassifierBuilder object. :param input_name: Name of the model input :param output_name: Name of the output :param number_of_dimensions: Number of dimensions of the input data :param default_class_label: The default class label to use for predictions. Must be ei...
[ "Create", "a", "KNearestNeighborsClassifierBuilder", "object", ".", ":", "param", "input_name", ":", "Name", "of", "the", "model", "input", ":", "param", "output_name", ":", "Name", "of", "the", "output", ":", "param", "number_of_dimensions", ":", "Number", "of"...
def __init__( self, input_name, output_name, number_of_dimensions, default_class_label, **kwargs ): """ Create a KNearestNeighborsClassifierBuilder object. :param input_name: Name of the model input :param output_name: Name of the outpu...
[ "def", "__init__", "(", "self", ",", "input_name", ",", "output_name", ",", "number_of_dimensions", ",", "default_class_label", ",", "*", "*", "kwargs", ")", ":", "super", "(", "KNearestNeighborsClassifierBuilder", ",", "self", ")", ".", "__init__", "(", ")", ...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/models/nearest_neighbors/builder.py#L63-L172
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/ragged/ragged_array_ops.py
python
zeros
(shape: ragged_shape.RaggedShape, dtype=dtypes.float32, name=None)
return ragged_tensor.RaggedTensor._from_nested_row_partitions( # pylint: disable=protected-access flat_values, shape.row_partitions)
Returns ones shaped like x.
Returns ones shaped like x.
[ "Returns", "ones", "shaped", "like", "x", "." ]
def zeros(shape: ragged_shape.RaggedShape, dtype=dtypes.float32, name=None) -> ragged_tensor.RaggedOrDense: """Returns ones shaped like x.""" flat_values = array_ops.zeros(shape.inner_shape, dtype=dtype, name=name) return ragged_tensor.RaggedTensor._from_nested_row_partitions( # pylint: disab...
[ "def", "zeros", "(", "shape", ":", "ragged_shape", ".", "RaggedShape", ",", "dtype", "=", "dtypes", ".", "float32", ",", "name", "=", "None", ")", "->", "ragged_tensor", ".", "RaggedOrDense", ":", "flat_values", "=", "array_ops", ".", "zeros", "(", "shape"...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/ragged/ragged_array_ops.py#L1116-L1122
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/training/tensorboard_logging.py
python
_clear_summary_writer
()
Makes all subsequent log invocations error. This is only used for testing. If you want to disable TensorBoard logging, call `set_summary_writer(None)` instead.
Makes all subsequent log invocations error.
[ "Makes", "all", "subsequent", "log", "invocations", "error", "." ]
def _clear_summary_writer(): """Makes all subsequent log invocations error. This is only used for testing. If you want to disable TensorBoard logging, call `set_summary_writer(None)` instead. """ global _summary_writer _summary_writer = _sentinel_summary_writer
[ "def", "_clear_summary_writer", "(", ")", ":", "global", "_summary_writer", "_summary_writer", "=", "_sentinel_summary_writer" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/training/tensorboard_logging.py#L107-L114
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/compatibility/ast_edits.py
python
PastaAnalyzeVisitor.visit_Import
(self, node)
Handle visiting an import node in the AST. Args: node: Current Node
Handle visiting an import node in the AST.
[ "Handle", "visiting", "an", "import", "node", "in", "the", "AST", "." ]
def visit_Import(self, node): # pylint: disable=invalid-name """Handle visiting an import node in the AST. Args: node: Current Node """ for import_alias in node.names: # Detect based on full import name and alias) full_import = (import_alias.name, import_alias.asname) detection...
[ "def", "visit_Import", "(", "self", ",", "node", ")", ":", "# pylint: disable=invalid-name", "for", "import_alias", "in", "node", ".", "names", ":", "# Detect based on full import name and alias)", "full_import", "=", "(", "import_alias", ".", "name", ",", "import_ali...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/compatibility/ast_edits.py#L830-L847
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/signal/ltisys.py
python
lsim2
(system, U=None, T=None, X0=None, **kwargs)
return T, squeeze(transpose(yout)), xout
Simulate output of a continuous-time linear system, by using the ODE solver `scipy.integrate.odeint`. Parameters ---------- system : an instance of the `lti` class or a tuple describing the system. The following gives the number of elements in the tuple and the interpretation: ...
Simulate output of a continuous-time linear system, by using the ODE solver `scipy.integrate.odeint`.
[ "Simulate", "output", "of", "a", "continuous", "-", "time", "linear", "system", "by", "using", "the", "ODE", "solver", "scipy", ".", "integrate", ".", "odeint", "." ]
def lsim2(system, U=None, T=None, X0=None, **kwargs): """ Simulate output of a continuous-time linear system, by using the ODE solver `scipy.integrate.odeint`. Parameters ---------- system : an instance of the `lti` class or a tuple describing the system. The following gives the number ...
[ "def", "lsim2", "(", "system", ",", "U", "=", "None", ",", "T", "=", "None", ",", "X0", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "isinstance", "(", "system", ",", "lti", ")", ":", "sys", "=", "system", ".", "_as_ss", "(", ")", "e...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/signal/ltisys.py#L1745-L1853
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/DocXMLRPCServer.py
python
ServerHTMLDoc.markup
(self, text, escape=None, funcs={}, classes={}, methods={})
return ''.join(results)
Mark up some plain text, given a context of symbols to look for. Each context dictionary maps object names to anchor names.
Mark up some plain text, given a context of symbols to look for. Each context dictionary maps object names to anchor names.
[ "Mark", "up", "some", "plain", "text", "given", "a", "context", "of", "symbols", "to", "look", "for", ".", "Each", "context", "dictionary", "maps", "object", "names", "to", "anchor", "names", "." ]
def markup(self, text, escape=None, funcs={}, classes={}, methods={}): """Mark up some plain text, given a context of symbols to look for. Each context dictionary maps object names to anchor names.""" escape = escape or self.escape results = [] here = 0 # XXX Note that t...
[ "def", "markup", "(", "self", ",", "text", ",", "escape", "=", "None", ",", "funcs", "=", "{", "}", ",", "classes", "=", "{", "}", ",", "methods", "=", "{", "}", ")", ":", "escape", "=", "escape", "or", "self", ".", "escape", "results", "=", "[...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/DocXMLRPCServer.py#L26-L65
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/macpath.py
python
lexists
(path)
return True
Test whether a path exists. Returns True for broken symbolic links
Test whether a path exists. Returns True for broken symbolic links
[ "Test", "whether", "a", "path", "exists", ".", "Returns", "True", "for", "broken", "symbolic", "links" ]
def lexists(path): """Test whether a path exists. Returns True for broken symbolic links""" try: st = os.lstat(path) except os.error: return False return True
[ "def", "lexists", "(", "path", ")", ":", "try", ":", "st", "=", "os", ".", "lstat", "(", "path", ")", "except", "os", ".", "error", ":", "return", "False", "return", "True" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/macpath.py#L111-L118
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/ctc_ops.py
python
ctc_beam_search_decoder_v2
(inputs, sequence_length, beam_width=100, top_paths=1)
return ctc_beam_search_decoder( inputs, sequence_length=sequence_length, beam_width=beam_width, top_paths=top_paths, merge_repeated=False)
Performs beam search decoding on the logits given in input. **Note** The `ctc_greedy_decoder` is a special case of the `ctc_beam_search_decoder` with `top_paths=1` and `beam_width=1` (but that decoder is faster for this special case). Args: inputs: 3-D `float` `Tensor`, size `[max_time, batch_size, num_cl...
Performs beam search decoding on the logits given in input.
[ "Performs", "beam", "search", "decoding", "on", "the", "logits", "given", "in", "input", "." ]
def ctc_beam_search_decoder_v2(inputs, sequence_length, beam_width=100, top_paths=1): """Performs beam search decoding on the logits given in input. **Note** The `ctc_greedy_decoder` is a special case of the `ctc_beam_se...
[ "def", "ctc_beam_search_decoder_v2", "(", "inputs", ",", "sequence_length", ",", "beam_width", "=", "100", ",", "top_paths", "=", "1", ")", ":", "# Note, merge_repeated is an invalid optimization that is removed from the", "# public API: it returns low probability paths.", "retur...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/ctc_ops.py#L444-L488
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/cpu.py
python
remove_null_refct_call
(bb)
Remove refct api calls to NULL pointer
Remove refct api calls to NULL pointer
[ "Remove", "refct", "api", "calls", "to", "NULL", "pointer" ]
def remove_null_refct_call(bb): """ Remove refct api calls to NULL pointer """ pass
[ "def", "remove_null_refct_call", "(", "bb", ")", ":", "pass" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/cpu.py#L235-L239
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/sequence_feature_column.py
python
SequenceNumericColumn.variable_shape
(self)
return tensor_shape.TensorShape(self.shape)
Returns a `TensorShape` representing the shape of sequence input.
Returns a `TensorShape` representing the shape of sequence input.
[ "Returns", "a", "TensorShape", "representing", "the", "shape", "of", "sequence", "input", "." ]
def variable_shape(self): """Returns a `TensorShape` representing the shape of sequence input.""" return tensor_shape.TensorShape(self.shape)
[ "def", "variable_shape", "(", "self", ")", ":", "return", "tensor_shape", ".", "TensorShape", "(", "self", ".", "shape", ")" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/sequence_feature_column.py#L544-L546
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_windows.py
python
Dialog.GetLayoutAdapter
(*args, **kwargs)
return _windows_.Dialog_GetLayoutAdapter(*args, **kwargs)
GetLayoutAdapter() -> DialogLayoutAdapter
GetLayoutAdapter() -> DialogLayoutAdapter
[ "GetLayoutAdapter", "()", "-", ">", "DialogLayoutAdapter" ]
def GetLayoutAdapter(*args, **kwargs): """GetLayoutAdapter() -> DialogLayoutAdapter""" return _windows_.Dialog_GetLayoutAdapter(*args, **kwargs)
[ "def", "GetLayoutAdapter", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "Dialog_GetLayoutAdapter", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L872-L874
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/decent_q/python/decent_q.py
python
_parse_input_graph
(input_graph)
return graph_def
Parse input_graph configurations
Parse input_graph configurations
[ "Parse", "input_graph", "configurations" ]
def _parse_input_graph(input_graph): """Parse input_graph configurations""" if input_frozen_graph == '': raise ValueError("No --input_graph assigned.") if not gfile.Exists(input_graph): raise ValueError("Input graph file '" + input_graph + "' does not exist!") graph_def = graph_pb2.GraphDef() with gfi...
[ "def", "_parse_input_graph", "(", "input_graph", ")", ":", "if", "input_frozen_graph", "==", "''", ":", "raise", "ValueError", "(", "\"No --input_graph assigned.\"", ")", "if", "not", "gfile", ".", "Exists", "(", "input_graph", ")", ":", "raise", "ValueError", "...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/decent_q/python/decent_q.py#L139-L148
msitt/blpapi-python
bebcf43668c9e5f5467b1f685f9baebbfc45bc87
src/blpapi/debug.py
python
_linker_env
()
return env
Return the name of the right environment variable for linking in the current platform.
Return the name of the right environment variable for linking in the current platform.
[ "Return", "the", "name", "of", "the", "right", "environment", "variable", "for", "linking", "in", "the", "current", "platform", "." ]
def _linker_env(): """Return the name of the right environment variable for linking in the current platform. """ s = platform.system() if s == 'Windows': env = 'PATH' elif s == 'Darwin': env = 'DYLD_LIBRARY_PATH' else: env = 'LD_LIBRARY_PATH' return env
[ "def", "_linker_env", "(", ")", ":", "s", "=", "platform", ".", "system", "(", ")", "if", "s", "==", "'Windows'", ":", "env", "=", "'PATH'", "elif", "s", "==", "'Darwin'", ":", "env", "=", "'DYLD_LIBRARY_PATH'", "else", ":", "env", "=", "'LD_LIBRARY_PA...
https://github.com/msitt/blpapi-python/blob/bebcf43668c9e5f5467b1f685f9baebbfc45bc87/src/blpapi/debug.py#L56-L67
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/wizard.py
python
PyWizardPage.DoGetVirtualSize
(*args, **kwargs)
return _wizard.PyWizardPage_DoGetVirtualSize(*args, **kwargs)
DoGetVirtualSize(self) -> Size
DoGetVirtualSize(self) -> Size
[ "DoGetVirtualSize", "(", "self", ")", "-", ">", "Size" ]
def DoGetVirtualSize(*args, **kwargs): """DoGetVirtualSize(self) -> Size""" return _wizard.PyWizardPage_DoGetVirtualSize(*args, **kwargs)
[ "def", "DoGetVirtualSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_wizard", ".", "PyWizardPage_DoGetVirtualSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/wizard.py#L179-L181
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
contrib/gizmos/osx_cocoa/gizmos.py
python
LEDNumberCtrl.__init__
(self, *args, **kwargs)
__init__(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=wxLED_ALIGN_LEFT|wxLED_DRAW_FADED) -> LEDNumberCtrl
__init__(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=wxLED_ALIGN_LEFT|wxLED_DRAW_FADED) -> LEDNumberCtrl
[ "__init__", "(", "self", "Window", "parent", "int", "id", "=", "-", "1", "Point", "pos", "=", "DefaultPosition", "Size", "size", "=", "DefaultSize", "long", "style", "=", "wxLED_ALIGN_LEFT|wxLED_DRAW_FADED", ")", "-", ">", "LEDNumberCtrl" ]
def __init__(self, *args, **kwargs): """ __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=wxLED_ALIGN_LEFT|wxLED_DRAW_FADED) -> LEDNumberCtrl """ _gizmos.LEDNumberCtrl_swiginit(self,_gizmos.new_LEDNumberCtrl(*args, **kwar...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_gizmos", ".", "LEDNumberCtrl_swiginit", "(", "self", ",", "_gizmos", ".", "new_LEDNumberCtrl", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")", "self", ".", "_...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/osx_cocoa/gizmos.py#L305-L311
stitchEm/stitchEm
0f399501d41ab77933677f2907f41f80ceb704d7
lib/bindings/samples/server/display.py
python
Display._to_swig
(self, window)
return swig_object
Converts a ctypes-bound window to SWIG
Converts a ctypes-bound window to SWIG
[ "Converts", "a", "ctypes", "-", "bound", "window", "to", "SWIG" ]
def _to_swig(self, window): """ Converts a ctypes-bound window to SWIG""" window_addr = ctypes.cast(ctypes.pointer(window), ctypes.POINTER(ctypes.c_ulong)).contents.value swig_object = vs.castToSwigGLFWwindow(window_addr) return swig_object
[ "def", "_to_swig", "(", "self", ",", "window", ")", ":", "window_addr", "=", "ctypes", ".", "cast", "(", "ctypes", ".", "pointer", "(", "window", ")", ",", "ctypes", ".", "POINTER", "(", "ctypes", ".", "c_ulong", ")", ")", ".", "contents", ".", "valu...
https://github.com/stitchEm/stitchEm/blob/0f399501d41ab77933677f2907f41f80ceb704d7/lib/bindings/samples/server/display.py#L152-L157
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/requests/exceptions.py
python
RequestException.__init__
(self, *args, **kwargs)
Initialize RequestException with `request` and `response` objects.
Initialize RequestException with `request` and `response` objects.
[ "Initialize", "RequestException", "with", "request", "and", "response", "objects", "." ]
def __init__(self, *args, **kwargs): """Initialize RequestException with `request` and `response` objects.""" response = kwargs.pop('response', None) self.response = response self.request = kwargs.pop('request', None) if (response is not None and not self.request and ...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "response", "=", "kwargs", ".", "pop", "(", "'response'", ",", "None", ")", "self", ".", "response", "=", "response", "self", ".", "request", "=", "kwargs", ".", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/requests/exceptions.py#L17-L25
netket/netket
0d534e54ecbf25b677ea72af6b85947979420652
netket/nn/linear.py
python
DenseGeneral.__call__
(self, inputs: Array)
return out
Applies a linear transformation to the inputs along multiple dimensions. Args: inputs: The nd-array to be transformed. Returns: The transformed input.
Applies a linear transformation to the inputs along multiple dimensions. Args: inputs: The nd-array to be transformed. Returns: The transformed input.
[ "Applies", "a", "linear", "transformation", "to", "the", "inputs", "along", "multiple", "dimensions", ".", "Args", ":", "inputs", ":", "The", "nd", "-", "array", "to", "be", "transformed", ".", "Returns", ":", "The", "transformed", "input", "." ]
def __call__(self, inputs: Array) -> Array: """Applies a linear transformation to the inputs along multiple dimensions. Args: inputs: The nd-array to be transformed. Returns: The transformed input. """ features = _canonicalize_tuple(self.features) axis...
[ "def", "__call__", "(", "self", ",", "inputs", ":", "Array", ")", "->", "Array", ":", "features", "=", "_canonicalize_tuple", "(", "self", ".", "features", ")", "axis", "=", "_canonicalize_tuple", "(", "self", ".", "axis", ")", "batch_dims", "=", "_canonic...
https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/nn/linear.py#L72-L151
cathywu/Sentiment-Analysis
eb501fd1375c0c3f3ab430f963255f1bb858e659
PyML-0.7.9/PyML/utils/salstat_stats.py
python
betai
(a,b,x)
Returns the incomplete beta function: I-sub-x(a,b) = 1/B(a,b)*(Integral(0,x) of t^(a-1)(1-t)^(b-1) dt) where a,b>0 and B(a,b) = G(a)*G(b)/(G(a+b)) where G(a) is the gamma function of a. The continued fraction formulation is implemented here, using the betacf function. (Adapted from: Numerical Recipies in C.) U...
Returns the incomplete beta function:
[ "Returns", "the", "incomplete", "beta", "function", ":" ]
def betai(a,b,x): """ Returns the incomplete beta function: I-sub-x(a,b) = 1/B(a,b)*(Integral(0,x) of t^(a-1)(1-t)^(b-1) dt) where a,b>0 and B(a,b) = G(a)*G(b)/(G(a+b)) where G(a) is the gamma function of a. The continued fraction formulation is implemented here, using the betacf function. (Adapted from: Nu...
[ "def", "betai", "(", "a", ",", "b", ",", "x", ")", ":", "if", "(", "x", "<", "0.0", "or", "x", ">", "1.0", ")", ":", "raise", "ValueError", ",", "'Bad x in lbetai'", "if", "(", "x", "==", "0.0", "or", "x", "==", "1.0", ")", ":", "bt", "=", ...
https://github.com/cathywu/Sentiment-Analysis/blob/eb501fd1375c0c3f3ab430f963255f1bb858e659/PyML-0.7.9/PyML/utils/salstat_stats.py#L406-L428
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/lockfile/pidlockfile.py
python
PIDLockFile.i_am_locking
(self)
return self.is_locked() and os.getpid() == self.read_pid()
Test if the lock is held by the current process. Returns ``True`` if the current process ID matches the number stored in the PID file.
Test if the lock is held by the current process.
[ "Test", "if", "the", "lock", "is", "held", "by", "the", "current", "process", "." ]
def i_am_locking(self): """ Test if the lock is held by the current process. Returns ``True`` if the current process ID matches the number stored in the PID file. """ return self.is_locked() and os.getpid() == self.read_pid()
[ "def", "i_am_locking", "(", "self", ")", ":", "return", "self", ".", "is_locked", "(", ")", "and", "os", ".", "getpid", "(", ")", "==", "self", ".", "read_pid", "(", ")" ]
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/lockfile/pidlockfile.py#L58-L64
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Tools/fcbt/CreatePyModule.py
python
validateApp
(AppName)
Validates the class name
Validates the class name
[ "Validates", "the", "class", "name" ]
def validateApp(AppName): """ Validates the class name """ if(len(AppName) < 2): sys.stdout.write("Too short name: '"+AppName+"'\n") sys.exit() # name is long enough clName="class "+AppName+": self=0" try: exec(clName) except Exception: # Invalid class name sys.stdout.write("Invalid name: '"+AppName+...
[ "def", "validateApp", "(", "AppName", ")", ":", "if", "(", "len", "(", "AppName", ")", "<", "2", ")", ":", "sys", ".", "stdout", ".", "write", "(", "\"Too short name: '\"", "+", "AppName", "+", "\"'\\n\"", ")", "sys", ".", "exit", "(", ")", "# name i...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Tools/fcbt/CreatePyModule.py#L101-L115
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/SANS/sans/common/log_tagger.py
python
has_tag
(tag, workspace)
return tag in run
Checks if workspace has a certain tag. :param tag: the tag name. :param workspace: the workspace to check. :return: true if the tag exists else false.
Checks if workspace has a certain tag.
[ "Checks", "if", "workspace", "has", "a", "certain", "tag", "." ]
def has_tag(tag, workspace): """ Checks if workspace has a certain tag. :param tag: the tag name. :param workspace: the workspace to check. :return: true if the tag exists else false. """ if workspace is None: return False check_if_valid_tag_and_workspace(tag, workspace) run...
[ "def", "has_tag", "(", "tag", ",", "workspace", ")", ":", "if", "workspace", "is", "None", ":", "return", "False", "check_if_valid_tag_and_workspace", "(", "tag", ",", "workspace", ")", "run", "=", "workspace", ".", "getRun", "(", ")", "return", "tag", "in...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/sans/common/log_tagger.py#L66-L78
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/cgi.py
python
test
(environ=os.environ)
Robust test CGI script, usable as main program. Write minimal HTTP headers and dump all information provided to the script in HTML form.
Robust test CGI script, usable as main program.
[ "Robust", "test", "CGI", "script", "usable", "as", "main", "program", "." ]
def test(environ=os.environ): """Robust test CGI script, usable as main program. Write minimal HTTP headers and dump all information provided to the script in HTML form. """ print "Content-type: text/html" print sys.stderr = sys.stdout try: form = FieldStorage() # Replace wit...
[ "def", "test", "(", "environ", "=", "os", ".", "environ", ")", ":", "print", "\"Content-type: text/html\"", "print", "sys", ".", "stderr", "=", "sys", ".", "stdout", "try", ":", "form", "=", "FieldStorage", "(", ")", "# Replace with other classes to test those",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/cgi.py#L882-L919
netket/netket
0d534e54ecbf25b677ea72af6b85947979420652
netket/optimizer/qgt/qgt_jacobian_pytree_logic.py
python
_rescale
(centered_oks)
return centered_oks, scale
compute ΔOₖ/√Sₖₖ and √Sₖₖ to do scale-invariant regularization (Becca & Sorella 2017, pp. 143) Sₖₗ/(√Sₖₖ√Sₗₗ) = ΔOₖᴴΔOₗ/(√Sₖₖ√Sₗₗ) = (ΔOₖ/√Sₖₖ)ᴴ(ΔOₗ/√Sₗₗ)
compute ΔOₖ/√Sₖₖ and √Sₖₖ to do scale-invariant regularization (Becca & Sorella 2017, pp. 143) Sₖₗ/(√Sₖₖ√Sₗₗ) = ΔOₖᴴΔOₗ/(√Sₖₖ√Sₗₗ) = (ΔOₖ/√Sₖₖ)ᴴ(ΔOₗ/√Sₗₗ)
[ "compute", "ΔOₖ", "/", "√Sₖₖ", "and", "√Sₖₖ", "to", "do", "scale", "-", "invariant", "regularization", "(", "Becca", "&", "Sorella", "2017", "pp", ".", "143", ")", "Sₖₗ", "/", "(", "√Sₖₖ√Sₗₗ", ")", "=", "ΔOₖᴴΔOₗ", "/", "(", "√Sₖₖ√Sₗₗ", ")", "=", "(",...
def _rescale(centered_oks): """ compute ΔOₖ/√Sₖₖ and √Sₖₖ to do scale-invariant regularization (Becca & Sorella 2017, pp. 143) Sₖₗ/(√Sₖₖ√Sₗₗ) = ΔOₖᴴΔOₗ/(√Sₖₖ√Sₗₗ) = (ΔOₖ/√Sₖₖ)ᴴ(ΔOₗ/√Sₗₗ) """ scale = jax.tree_map( lambda x: mpi.mpi_sum_jax(jnp.sum((x * x.conj()).real, axis=0, keepdims=Tru...
[ "def", "_rescale", "(", "centered_oks", ")", ":", "scale", "=", "jax", ".", "tree_map", "(", "lambda", "x", ":", "mpi", ".", "mpi_sum_jax", "(", "jnp", ".", "sum", "(", "(", "x", "*", "x", ".", "conj", "(", ")", ")", ".", "real", ",", "axis", "...
https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/optimizer/qgt/qgt_jacobian_pytree_logic.py#L156-L171
apache/singa
93fd9da72694e68bfe3fb29d0183a65263d238a1
python/singa/device.py
python
create_cuda_gpus
(num)
return singa.Platform.CreateCudaGPUs(num)
Create a list of CudaGPU devices. Args: num (int): number of device to create. Returns: a list of swig converted CudaGPU devices.
Create a list of CudaGPU devices.
[ "Create", "a", "list", "of", "CudaGPU", "devices", "." ]
def create_cuda_gpus(num): '''Create a list of CudaGPU devices. Args: num (int): number of device to create. Returns: a list of swig converted CudaGPU devices. ''' assert singa.USE_CUDA, 'SINGA has not been compiled with CUDA enabled.' return singa.Platform.CreateCudaGPUs(num)
[ "def", "create_cuda_gpus", "(", "num", ")", ":", "assert", "singa", ".", "USE_CUDA", ",", "'SINGA has not been compiled with CUDA enabled.'", "return", "singa", ".", "Platform", ".", "CreateCudaGPUs", "(", "num", ")" ]
https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/device.py#L68-L77
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/pdb.py
python
Pdb.do_tbreak
(self, arg)
tbreak [ ([filename:]lineno | function) [, condition] ] Same arguments as break, but sets a temporary breakpoint: it is automatically deleted when first hit.
tbreak [ ([filename:]lineno | function) [, condition] ] Same arguments as break, but sets a temporary breakpoint: it is automatically deleted when first hit.
[ "tbreak", "[", "(", "[", "filename", ":", "]", "lineno", "|", "function", ")", "[", "condition", "]", "]", "Same", "arguments", "as", "break", "but", "sets", "a", "temporary", "breakpoint", ":", "it", "is", "automatically", "deleted", "when", "first", "h...
def do_tbreak(self, arg): """tbreak [ ([filename:]lineno | function) [, condition] ] Same arguments as break, but sets a temporary breakpoint: it is automatically deleted when first hit. """ self.do_break(arg, 1)
[ "def", "do_tbreak", "(", "self", ",", "arg", ")", ":", "self", ".", "do_break", "(", "arg", ",", "1", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/pdb.py#L704-L709
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py
python
uCSIsHighPrivateUseSurrogates
(code)
return ret
Check whether the character is part of HighPrivateUseSurrogates UCS Block
Check whether the character is part of HighPrivateUseSurrogates UCS Block
[ "Check", "whether", "the", "character", "is", "part", "of", "HighPrivateUseSurrogates", "UCS", "Block" ]
def uCSIsHighPrivateUseSurrogates(code): """Check whether the character is part of HighPrivateUseSurrogates UCS Block """ ret = libxml2mod.xmlUCSIsHighPrivateUseSurrogates(code) return ret
[ "def", "uCSIsHighPrivateUseSurrogates", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsHighPrivateUseSurrogates", "(", "code", ")", "return", "ret" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L1810-L1814
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
FileDataObject.GetFilenames
(*args, **kwargs)
return _misc_.FileDataObject_GetFilenames(*args, **kwargs)
GetFilenames(self) -> [names] Returns a list of file names.
GetFilenames(self) -> [names]
[ "GetFilenames", "(", "self", ")", "-", ">", "[", "names", "]" ]
def GetFilenames(*args, **kwargs): """ GetFilenames(self) -> [names] Returns a list of file names. """ return _misc_.FileDataObject_GetFilenames(*args, **kwargs)
[ "def", "GetFilenames", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "FileDataObject_GetFilenames", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L5339-L5345
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/drafttaskpanels/task_polararray.py
python
TaskPanelPolarArray.get_number_angle
(self)
return number, angle
Get the number and angle parameters from the widgets.
Get the number and angle parameters from the widgets.
[ "Get", "the", "number", "and", "angle", "parameters", "from", "the", "widgets", "." ]
def get_number_angle(self): """Get the number and angle parameters from the widgets.""" number = self.form.spinbox_number.value() angle_str = self.form.spinbox_angle.text() angle = U.Quantity(angle_str).Value return number, angle
[ "def", "get_number_angle", "(", "self", ")", ":", "number", "=", "self", ".", "form", ".", "spinbox_number", ".", "value", "(", ")", "angle_str", "=", "self", ".", "form", ".", "spinbox_angle", ".", "text", "(", ")", "angle", "=", "U", ".", "Quantity",...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/drafttaskpanels/task_polararray.py#L264-L270
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_grad.py
python
_SparseMatrixAddGrad
(op, grad)
return (sparse_csr_matrix_ops.sparse_matrix_mul( _PruneCSRMatrix(grad, a_csr), alpha), sparse_csr_matrix_ops.sparse_matrix_mul( _PruneCSRMatrix(grad, b_csr), beta), None, None)
Gradient for sparse_matrix_add op.
Gradient for sparse_matrix_add op.
[ "Gradient", "for", "sparse_matrix_add", "op", "." ]
def _SparseMatrixAddGrad(op, grad): """Gradient for sparse_matrix_add op.""" # input to sparse_matrix_add is (a, b, alpha, beta) # with a, b CSR and alpha beta scalars. # output is: alpha * a + beta * b # d(a*A + b*B)/dA . grad = a * grad # May have gotten the transposes wrong below. # d(a*A + b*B)/da ....
[ "def", "_SparseMatrixAddGrad", "(", "op", ",", "grad", ")", ":", "# input to sparse_matrix_add is (a, b, alpha, beta)", "# with a, b CSR and alpha beta scalars.", "# output is: alpha * a + beta * b", "# d(a*A + b*B)/dA . grad = a * grad", "# May have gotten the transposes wrong below.", "#...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_grad.py#L111-L129
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/ao/sparsity/experimental/pruner/base_pruner.py
python
BasePruner._prepare
(self, use_path=False, *args, **kwargs)
r"""Adds mask parametrization to the layer weight
r"""Adds mask parametrization to the layer weight
[ "r", "Adds", "mask", "parametrization", "to", "the", "layer", "weight" ]
def _prepare(self, use_path=False, *args, **kwargs): r"""Adds mask parametrization to the layer weight """ self.activation_handles = [] # store removable hook handles self.bias_handles = [] for config in self.module_groups: modules = [] if use_path: ...
[ "def", "_prepare", "(", "self", ",", "use_path", "=", "False", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "self", ".", "activation_handles", "=", "[", "]", "# store removable hook handles", "self", ".", "bias_handles", "=", "[", "]", "for", "co...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/ao/sparsity/experimental/pruner/base_pruner.py#L47-L101
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/ctc_ops.py
python
_sum_states
(idx, states)
Take logsumexp for each unique state out of all label states. Args: idx: tensor of shape [batch, label_length] For each sequence, indices into a set of unique labels as computed by calling unique. states: tensor of shape [frames, batch, label_length] Log probabilities for each label state. Ret...
Take logsumexp for each unique state out of all label states.
[ "Take", "logsumexp", "for", "each", "unique", "state", "out", "of", "all", "label", "states", "." ]
def _sum_states(idx, states): """Take logsumexp for each unique state out of all label states. Args: idx: tensor of shape [batch, label_length] For each sequence, indices into a set of unique labels as computed by calling unique. states: tensor of shape [frames, batch, label_length] Log probabilities...
[ "def", "_sum_states", "(", "idx", ",", "states", ")", ":", "with", "ops", ".", "name_scope", "(", "\"sum_states\"", ")", ":", "idx", "=", "ops", ".", "convert_to_tensor", "(", "idx", ",", "name", "=", "\"idx\"", ")", "num_states", "=", "_get_dim", "(", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/ctc_ops.py#L1251-L1275
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/framework/graph_util.py
python
tensor_shape_from_node_def_name
(graph, input_name)
return shape
Convenience function to get a shape from a NodeDef's input string.
Convenience function to get a shape from a NodeDef's input string.
[ "Convenience", "function", "to", "get", "a", "shape", "from", "a", "NodeDef", "s", "input", "string", "." ]
def tensor_shape_from_node_def_name(graph, input_name): """Convenience function to get a shape from a NodeDef's input string.""" # To get a tensor, the name must be in the form <input>:<port>, for example # 'Mul:0'. The GraphDef input strings don't always have the port specified # though, so if there isn't a co...
[ "def", "tensor_shape_from_node_def_name", "(", "graph", ",", "input_name", ")", ":", "# To get a tensor, the name must be in the form <input>:<port>, for example", "# 'Mul:0'. The GraphDef input strings don't always have the port specified", "# though, so if there isn't a colon we need to add a ...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/framework/graph_util.py#L181-L192
lballabio/quantlib-old
136336947ed4fea9ecc1da6edad188700e821739
gensrc/gensrc/addins/excel.py
python
ExcelAddin.serialize
(self, serializer)
Load/unload class state to/from serializer object.
Load/unload class state to/from serializer object.
[ "Load", "/", "unload", "class", "state", "to", "/", "from", "serializer", "object", "." ]
def serialize(self, serializer): """Load/unload class state to/from serializer object.""" super(ExcelAddin, self).serialize(serializer) serializer.serializeBoolean(self, 'exportSymbols')
[ "def", "serialize", "(", "self", ",", "serializer", ")", ":", "super", "(", "ExcelAddin", ",", "self", ")", ".", "serialize", "(", "serializer", ")", "serializer", ".", "serializeBoolean", "(", "self", ",", "'exportSymbols'", ")" ]
https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/addins/excel.py#L378-L381
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/feature_column/feature_column_v2.py
python
HashedCategoricalColumn.parents
(self)
return [self.key]
See 'FeatureColumn` base class.
See 'FeatureColumn` base class.
[ "See", "FeatureColumn", "base", "class", "." ]
def parents(self): """See 'FeatureColumn` base class.""" return [self.key]
[ "def", "parents", "(", "self", ")", ":", "return", "[", "self", ".", "key", "]" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/feature_column/feature_column_v2.py#L3456-L3458
devsisters/libquic
8954789a056d8e7d5fcb6452fd1572ca57eb5c4e
src/third_party/protobuf/python/google/protobuf/internal/containers.py
python
RepeatedCompositeFieldContainer.__eq__
(self, other)
return self._values == other._values
Compares the current instance with another one.
Compares the current instance with another one.
[ "Compares", "the", "current", "instance", "with", "another", "one", "." ]
def __eq__(self, other): """Compares the current instance with another one.""" if self is other: return True if not isinstance(other, self.__class__): raise TypeError('Can only compare repeated composite fields against ' 'other repeated composite fields.') return self._...
[ "def", "__eq__", "(", "self", ",", "other", ")", ":", "if", "self", "is", "other", ":", "return", "True", "if", "not", "isinstance", "(", "other", ",", "self", ".", "__class__", ")", ":", "raise", "TypeError", "(", "'Can only compare repeated composite field...
https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/internal/containers.py#L424-L431
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
clang/tools/scan-build-py/lib/libscanbuild/intercept.py
python
setup_environment
(args, destination)
return environment
Sets up the environment for the build command. It sets the required environment variables and execute the given command. The exec calls will be logged by the 'libear' preloaded library or by the 'wrapper' programs.
Sets up the environment for the build command.
[ "Sets", "up", "the", "environment", "for", "the", "build", "command", "." ]
def setup_environment(args, destination): """ Sets up the environment for the build command. It sets the required environment variables and execute the given command. The exec calls will be logged by the 'libear' preloaded library or by the 'wrapper' programs. """ c_compiler = args.cc if 'cc' in a...
[ "def", "setup_environment", "(", "args", ",", "destination", ")", ":", "c_compiler", "=", "args", ".", "cc", "if", "'cc'", "in", "args", "else", "'cc'", "cxx_compiler", "=", "args", ".", "cxx", "if", "'cxx'", "in", "args", "else", "'c++'", "libear_path", ...
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/clang/tools/scan-build-py/lib/libscanbuild/intercept.py#L102-L135
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/PreprocessWindow.py
python
ScanPreProcessWindow.do_fix_calibration_settings
(self)
disable the settings to be modifiable :return:
disable the settings to be modifiable :return:
[ "disable", "the", "settings", "to", "be", "modifiable", ":", "return", ":" ]
def do_fix_calibration_settings(self): """ disable the settings to be modifiable :return: """ self.enable_calibration_settings(False)
[ "def", "do_fix_calibration_settings", "(", "self", ")", ":", "self", ".", "enable_calibration_settings", "(", "False", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/PreprocessWindow.py#L124-L129
TimoSaemann/caffe-segnet-cudnn5
abcf30dca449245e101bf4ced519f716177f0885
python/caffe/io.py
python
datum_to_array
(datum)
Converts a datum to an array. Note that the label is not returned, as one can easily get it by calling datum.label.
Converts a datum to an array. Note that the label is not returned, as one can easily get it by calling datum.label.
[ "Converts", "a", "datum", "to", "an", "array", ".", "Note", "that", "the", "label", "is", "not", "returned", "as", "one", "can", "easily", "get", "it", "by", "calling", "datum", ".", "label", "." ]
def datum_to_array(datum): """Converts a datum to an array. Note that the label is not returned, as one can easily get it by calling datum.label. """ if len(datum.data): return np.fromstring(datum.data, dtype=np.uint8).reshape( datum.channels, datum.height, datum.width) else: ...
[ "def", "datum_to_array", "(", "datum", ")", ":", "if", "len", "(", "datum", ".", "data", ")", ":", "return", "np", ".", "fromstring", "(", "datum", ".", "data", ",", "dtype", "=", "np", ".", "uint8", ")", ".", "reshape", "(", "datum", ".", "channel...
https://github.com/TimoSaemann/caffe-segnet-cudnn5/blob/abcf30dca449245e101bf4ced519f716177f0885/python/caffe/io.py#L84-L93
MegEngine/MegEngine
ce9ad07a27ec909fb8db4dd67943d24ba98fb93a
imperative/python/megengine/core/tensor/array_method.py
python
ArrayMethodMixin.flatten
(self)
return self.reshape(-1)
r"""See :func:`~.flatten`.
r"""See :func:`~.flatten`.
[ "r", "See", ":", "func", ":", "~", ".", "flatten", "." ]
def flatten(self): r"""See :func:`~.flatten`.""" return self.reshape(-1)
[ "def", "flatten", "(", "self", ")", ":", "return", "self", ".", "reshape", "(", "-", "1", ")" ]
https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/core/tensor/array_method.py#L486-L488
Tencent/TurboTransformers
4532fa118c07375b3650f0768b70982c914be4ce
turbo_transformers/python/turbo_transformers/layers/bert_tensor_usage.py
python
get_bert_tensor_usage_record
(batch_size, seq_len, num_head=12, hidden_size=768, num_layer=12)
return TUR_list
build a tensor usage recorders for bert. Inputs : parameters to define a BERT. Outputs : tensor usage records (TURs) (name, start_op, end_op, size)
build a tensor usage recorders for bert. Inputs : parameters to define a BERT. Outputs : tensor usage records (TURs) (name, start_op, end_op, size)
[ "build", "a", "tensor", "usage", "recorders", "for", "bert", ".", "Inputs", ":", "parameters", "to", "define", "a", "BERT", ".", "Outputs", ":", "tensor", "usage", "records", "(", "TURs", ")", "(", "name", "start_op", "end_op", "size", ")" ]
def get_bert_tensor_usage_record(batch_size, seq_len, num_head=12, hidden_size=768, num_layer=12): """ build a tensor usage recorders for bert. Inputs : parameters to define a ...
[ "def", "get_bert_tensor_usage_record", "(", "batch_size", ",", "seq_len", ",", "num_head", "=", "12", ",", "hidden_size", "=", "768", ",", "num_layer", "=", "12", ")", ":", "item_bytes", "=", "4", "id_bytes", "=", "8", "from_seq_len", "=", "seq_len", "to_seq...
https://github.com/Tencent/TurboTransformers/blob/4532fa118c07375b3650f0768b70982c914be4ce/turbo_transformers/python/turbo_transformers/layers/bert_tensor_usage.py#L17-L73
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py
python
StateManager.get_variable
(self, feature_column, name)
Returns an existing variable. Args: feature_column: A `FeatureColumn` object this variable corresponds to. name: variable name.
Returns an existing variable.
[ "Returns", "an", "existing", "variable", "." ]
def get_variable(self, feature_column, name): """Returns an existing variable. Args: feature_column: A `FeatureColumn` object this variable corresponds to. name: variable name. """ del feature_column, name raise NotImplementedError('StateManager.get_var')
[ "def", "get_variable", "(", "self", ",", "feature_column", ",", "name", ")", ":", "del", "feature_column", ",", "name", "raise", "NotImplementedError", "(", "'StateManager.get_var'", ")" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py#L225-L233
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/rnn/python/ops/rnn_cell.py
python
CFNCell.call
(self, inputs, state)
return new_h, new_h
Run one step of CFN. Args: inputs: input Tensor, must be 2-D, `[batch, input_size]`. state: state Tensor, must be 2-D, `[batch, state_size]`. Returns: A tuple containing: - Output: A `2-D` tensor with shape `[batch_size, state_size]`. - New state: A `2-D` tensor with shape `[bat...
Run one step of CFN.
[ "Run", "one", "step", "of", "CFN", "." ]
def call(self, inputs, state): """Run one step of CFN. Args: inputs: input Tensor, must be 2-D, `[batch, input_size]`. state: state Tensor, must be 2-D, `[batch, state_size]`. Returns: A tuple containing: - Output: A `2-D` tensor with shape `[batch_size, state_size]`. - New ...
[ "def", "call", "(", "self", ",", "inputs", ",", "state", ")", ":", "input_size", "=", "inputs", ".", "get_shape", "(", ")", "[", "-", "1", "]", "if", "tensor_shape", ".", "dimension_value", "(", "input_size", ")", "is", "None", ":", "raise", "ValueErro...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/rnn/python/ops/rnn_cell.py#L3961-L4006
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/mvn.py
python
MultivariateNormalOperatorPD.get_batch_shape
(self)
return self._cov.get_batch_shape()
`TensorShape` available at graph construction time.
`TensorShape` available at graph construction time.
[ "TensorShape", "available", "at", "graph", "construction", "time", "." ]
def get_batch_shape(self): """`TensorShape` available at graph construction time.""" # Recall _check_mu ensures mu and self._cov have same batch shape. return self._cov.get_batch_shape()
[ "def", "get_batch_shape", "(", "self", ")", ":", "# Recall _check_mu ensures mu and self._cov have same batch shape.", "return", "self", ".", "_cov", ".", "get_batch_shape", "(", ")" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/mvn.py#L206-L209
cvxpy/cvxpy
5165b4fb750dfd237de8659383ef24b4b2e33aaf
cvxpy/atoms/gen_lambda_max.py
python
gen_lambda_max.is_atom_quasiconcave
(self)
return False
Is the atom quasiconcave?
Is the atom quasiconcave?
[ "Is", "the", "atom", "quasiconcave?" ]
def is_atom_quasiconcave(self) -> bool: """Is the atom quasiconcave? """ return False
[ "def", "is_atom_quasiconcave", "(", "self", ")", "->", "bool", ":", "return", "False" ]
https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/gen_lambda_max.py#L98-L101
mongodb/mongo-cxx-driver
eb86512b05be20d2f51d53ba9b860c709e0799b3
etc/make_release.py
python
generate_release_notes
(issues, release_version)
return release_notes
Produce HTML release notes which can be used as part of the project release announcement.
Produce HTML release notes which can be used as part of the project release announcement.
[ "Produce", "HTML", "release", "notes", "which", "can", "be", "used", "as", "part", "of", "the", "project", "release", "announcement", "." ]
def generate_release_notes(issues, release_version): """ Produce HTML release notes which can be used as part of the project release announcement. """ release_notes = '<h1>Release Notes - C++ Driver - Version {}</h1>\n'.format(release_version) release_notes += '<h2>Bug</h2>\n' release_notes...
[ "def", "generate_release_notes", "(", "issues", ",", "release_version", ")", ":", "release_notes", "=", "'<h1>Release Notes - C++ Driver - Version {}</h1>\\n'", ".", "format", "(", "release_version", ")", "release_notes", "+=", "'<h2>Bug</h2>\\n'", "release_notes", "+=", "'...
https://github.com/mongodb/mongo-cxx-driver/blob/eb86512b05be20d2f51d53ba9b860c709e0799b3/etc/make_release.py#L482-L505
dmlc/nnvm
dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38
python/nnvm/top/tensor.py
python
compute_zeros
(attrs, inputs, _)
return topi.tensor.full(shape, dtype, 0)
Compute definition of zeros
Compute definition of zeros
[ "Compute", "definition", "of", "zeros" ]
def compute_zeros(attrs, inputs, _): """Compute definition of zeros""" shape = attrs.get_int_tuple("shape") dtype = attrs.get_string("dtype") return topi.tensor.full(shape, dtype, 0)
[ "def", "compute_zeros", "(", "attrs", ",", "inputs", ",", "_", ")", ":", "shape", "=", "attrs", ".", "get_int_tuple", "(", "\"shape\"", ")", "dtype", "=", "attrs", ".", "get_string", "(", "\"dtype\"", ")", "return", "topi", ".", "tensor", ".", "full", ...
https://github.com/dmlc/nnvm/blob/dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38/python/nnvm/top/tensor.py#L183-L187
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
v8_7_5/tools/grokdump.py
python
FullDump
(reader, heap)
Dump all available memory regions.
Dump all available memory regions.
[ "Dump", "all", "available", "memory", "regions", "." ]
def FullDump(reader, heap): """Dump all available memory regions.""" def dump_region(reader, start, size, location): print() while start & 3 != 0: start += 1 size -= 1 location += 1 is_executable = reader.IsProbableExecutableRegion(location, size) is_ascii = reader.IsProbableASCIIR...
[ "def", "FullDump", "(", "reader", ",", "heap", ")", ":", "def", "dump_region", "(", "reader", ",", "start", ",", "size", ",", "location", ")", ":", "print", "(", ")", "while", "start", "&", "3", "!=", "0", ":", "start", "+=", "1", "size", "-=", "...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/v8_7_5/tools/grokdump.py#L126-L181
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/pkg_resources/__init__.py
python
EntryPoint.load
(self, require=True, *args, **kwargs)
return self.resolve()
Require packages for this EntryPoint, then resolve it.
Require packages for this EntryPoint, then resolve it.
[ "Require", "packages", "for", "this", "EntryPoint", "then", "resolve", "it", "." ]
def load(self, require=True, *args, **kwargs): """ Require packages for this EntryPoint, then resolve it. """ if not require or args or kwargs: warnings.warn( "Parameters to load are deprecated. Call .resolve and " ".require separately.", ...
[ "def", "load", "(", "self", ",", "require", "=", "True", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "not", "require", "or", "args", "or", "kwargs", ":", "warnings", ".", "warn", "(", "\"Parameters to load are deprecated. Call .resolve and \"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/pkg_resources/__init__.py#L2452-L2465
InsightSoftwareConsortium/ITK
87acfce9a93d928311c38bc371b666b515b9f19d
Modules/ThirdParty/pygccxml/src/pygccxml/parser/directory_cache.py
python
directory_cache_t.__init__
(self, directory="cache", compression=False, sha1_sigs=True)
:param directory: cache directory path, it is created, if it does not exist :param compression: if `True`, the cache files will be compressed using `gzip` :param sha1_sigs: `sha1_sigs` determines whether file modifications is ...
:param directory: cache directory path, it is created, if it does not exist
[ ":", "param", "directory", ":", "cache", "directory", "path", "it", "is", "created", "if", "it", "does", "not", "exist" ]
def __init__(self, directory="cache", compression=False, sha1_sigs=True): """ :param directory: cache directory path, it is created, if it does not exist :param compression: if `True`, the cache files will be compressed using `gzip` ...
[ "def", "__init__", "(", "self", ",", "directory", "=", "\"cache\"", ",", "compression", "=", "False", ",", "sha1_sigs", "=", "True", ")", ":", "declarations_cache", ".", "cache_base_t", ".", "__init__", "(", "self", ")", "# Cache directory", "self", ".", "__...
https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Modules/ThirdParty/pygccxml/src/pygccxml/parser/directory_cache.py#L73-L121
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/richtext.py
python
RichTextBuffer.SetHandlerFlags
(*args, **kwargs)
return _richtext.RichTextBuffer_SetHandlerFlags(*args, **kwargs)
SetHandlerFlags(self, int flags)
SetHandlerFlags(self, int flags)
[ "SetHandlerFlags", "(", "self", "int", "flags", ")" ]
def SetHandlerFlags(*args, **kwargs): """SetHandlerFlags(self, int flags)""" return _richtext.RichTextBuffer_SetHandlerFlags(*args, **kwargs)
[ "def", "SetHandlerFlags", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextBuffer_SetHandlerFlags", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L2261-L2263
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/turtle.py
python
TurtleScreen.screensize
(self, canvwidth=None, canvheight=None, bg=None)
return self._resize(canvwidth, canvheight, bg)
Resize the canvas the turtles are drawing on. Optional arguments: canvwidth -- positive integer, new width of canvas in pixels canvheight -- positive integer, new height of canvas in pixels bg -- colorstring or color-tuple, new backgroundcolor If no arguments are given, return ...
Resize the canvas the turtles are drawing on.
[ "Resize", "the", "canvas", "the", "turtles", "are", "drawing", "on", "." ]
def screensize(self, canvwidth=None, canvheight=None, bg=None): """Resize the canvas the turtles are drawing on. Optional arguments: canvwidth -- positive integer, new width of canvas in pixels canvheight -- positive integer, new height of canvas in pixels bg -- colorstring or ...
[ "def", "screensize", "(", "self", ",", "canvwidth", "=", "None", ",", "canvheight", "=", "None", ",", "bg", "=", "None", ")", ":", "return", "self", ".", "_resize", "(", "canvwidth", ",", "canvheight", ",", "bg", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/turtle.py#L1485-L1502
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/dis.py
python
disassemble
(co, lasti=-1, *, file=None)
Disassemble a code object.
Disassemble a code object.
[ "Disassemble", "a", "code", "object", "." ]
def disassemble(co, lasti=-1, *, file=None): """Disassemble a code object.""" cell_names = co.co_cellvars + co.co_freevars linestarts = dict(findlinestarts(co)) _disassemble_bytes(co.co_code, lasti, co.co_varnames, co.co_names, co.co_consts, cell_names, linestarts, file=file)
[ "def", "disassemble", "(", "co", ",", "lasti", "=", "-", "1", ",", "*", ",", "file", "=", "None", ")", ":", "cell_names", "=", "co", ".", "co_cellvars", "+", "co", ".", "co_freevars", "linestarts", "=", "dict", "(", "findlinestarts", "(", "co", ")", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/dis.py#L365-L370
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/manifold/mds.py
python
MDS.fit
(self, X, y=None, init=None)
return self
Computes the position of the points in the embedding space Parameters ---------- X : array, shape=[n_samples, n_features], or [n_samples, n_samples] \ if dissimilarity='precomputed' Input data. init : {None or ndarray, shape (n_samples,)}, optional ...
Computes the position of the points in the embedding space
[ "Computes", "the", "position", "of", "the", "points", "in", "the", "embedding", "space" ]
def fit(self, X, y=None, init=None): """ Computes the position of the points in the embedding space Parameters ---------- X : array, shape=[n_samples, n_features], or [n_samples, n_samples] \ if dissimilarity='precomputed' Input data. init : ...
[ "def", "fit", "(", "self", ",", "X", ",", "y", "=", "None", ",", "init", "=", "None", ")", ":", "self", ".", "fit_transform", "(", "X", ",", "init", "=", "init", ")", "return", "self" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/manifold/mds.py#L362-L377
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/internals/construction.py
python
masked_rec_array_to_mgr
(data, index, columns, dtype, copy)
return mgr
Extract from a masked rec array and create the manager.
Extract from a masked rec array and create the manager.
[ "Extract", "from", "a", "masked", "rec", "array", "and", "create", "the", "manager", "." ]
def masked_rec_array_to_mgr(data, index, columns, dtype, copy): """ Extract from a masked rec array and create the manager. """ # essentially process a record array then fill it fill_value = data.fill_value fdata = ma.getdata(data) if index is None: index = get_names_from_index(fdat...
[ "def", "masked_rec_array_to_mgr", "(", "data", ",", "index", ",", "columns", ",", "dtype", ",", "copy", ")", ":", "# essentially process a record array then fill it", "fill_value", "=", "data", ".", "fill_value", "fdata", "=", "ma", ".", "getdata", "(", "data", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/internals/construction.py#L77-L116
linyouhappy/kongkongxiyou
7a69b2913eb29f4be77f9a62fb90cdd72c4160f1
cocosjs/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py
python
TranslationUnit.get_location
(self, filename, position)
return SourceLocation.from_position(self, f, position[0], position[1])
Obtain a SourceLocation for a file in this translation unit. The position can be specified by passing: - Integer file offset. Initial file offset is 0. - 2-tuple of (line number, column number). Initial file position is (0, 0)
Obtain a SourceLocation for a file in this translation unit.
[ "Obtain", "a", "SourceLocation", "for", "a", "file", "in", "this", "translation", "unit", "." ]
def get_location(self, filename, position): """Obtain a SourceLocation for a file in this translation unit. The position can be specified by passing: - Integer file offset. Initial file offset is 0. - 2-tuple of (line number, column number). Initial file position is (0,...
[ "def", "get_location", "(", "self", ",", "filename", ",", "position", ")", ":", "f", "=", "self", ".", "get_file", "(", "filename", ")", "if", "isinstance", "(", "position", ",", "int", ")", ":", "return", "SourceLocation", ".", "from_offset", "(", "self...
https://github.com/linyouhappy/kongkongxiyou/blob/7a69b2913eb29f4be77f9a62fb90cdd72c4160f1/cocosjs/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L2299-L2313
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/grappler/tf_optimizer.py
python
OptimizeGraph
(rewriter_config, metagraph, graph_id=b'graph_to_optimize')
return out_graph
Optimize the provided metagraph.
Optimize the provided metagraph.
[ "Optimize", "the", "provided", "metagraph", "." ]
def OptimizeGraph(rewriter_config, metagraph, graph_id=b'graph_to_optimize'): """Optimize the provided metagraph.""" with errors.raise_exception_on_not_ok_status() as status: ret_from_swig = tf_opt.TF_OptimizeGraph(rewriter_config.SerializeToString(), metagraph.Serial...
[ "def", "OptimizeGraph", "(", "rewriter_config", ",", "metagraph", ",", "graph_id", "=", "b'graph_to_optimize'", ")", ":", "with", "errors", ".", "raise_exception_on_not_ok_status", "(", ")", "as", "status", ":", "ret_from_swig", "=", "tf_opt", ".", "TF_OptimizeGraph...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/grappler/tf_optimizer.py#L26-L35
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/models/rnn/translate/data_utils.py
python
gunzip_file
(gz_path, new_path)
Unzips from gz_path into new_path.
Unzips from gz_path into new_path.
[ "Unzips", "from", "gz_path", "into", "new_path", "." ]
def gunzip_file(gz_path, new_path): """Unzips from gz_path into new_path.""" print("Unpacking %s to %s" % (gz_path, new_path)) with gzip.open(gz_path, "rb") as gz_file: with open(new_path, "wb") as new_file: for line in gz_file: new_file.write(line)
[ "def", "gunzip_file", "(", "gz_path", ",", "new_path", ")", ":", "print", "(", "\"Unpacking %s to %s\"", "%", "(", "gz_path", ",", "new_path", ")", ")", "with", "gzip", ".", "open", "(", "gz_path", ",", "\"rb\"", ")", "as", "gz_file", ":", "with", "open"...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/models/rnn/translate/data_utils.py#L66-L72
neoml-lib/neoml
a0d370fba05269a1b2258cef126f77bbd2054a3e
NeoML/Python/neoml/Dnn/Reorg.py
python
Reorg.stride
(self, stride)
Sets the divider value.
Sets the divider value.
[ "Sets", "the", "divider", "value", "." ]
def stride(self, stride): """Sets the divider value. """ if stride < 1: raise ValueError('The `stride` must be > 0.') self._internal.set_stride(int(stride))
[ "def", "stride", "(", "self", ",", "stride", ")", ":", "if", "stride", "<", "1", ":", "raise", "ValueError", "(", "'The `stride` must be > 0.'", ")", "self", ".", "_internal", ".", "set_stride", "(", "int", "(", "stride", ")", ")" ]
https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Reorg.py#L79-L85
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/Inelastic/dos/load_phonon.py
python
parse_phonon_file
(file_name, record_eigenvectors)
return file_data, element_isotope
Read frequencies from a <>.phonon file @param file_name - file path of the file to read @return the frequencies, infra red and raman intensities and weights of frequency blocks
Read frequencies from a <>.phonon file
[ "Read", "frequencies", "from", "a", "<", ">", ".", "phonon", "file" ]
def parse_phonon_file(file_name, record_eigenvectors): """ Read frequencies from a <>.phonon file @param file_name - file path of the file to read @return the frequencies, infra red and raman intensities and weights of frequency blocks """ file_data = {} # Get regex strings from load_helpe...
[ "def", "parse_phonon_file", "(", "file_name", ",", "record_eigenvectors", ")", ":", "file_data", "=", "{", "}", "# Get regex strings from load_helper", "header_regex", "=", "re", ".", "compile", "(", "load_helper", ".", "PHONON_HEADER_REGEX", ")", "eigenvectors_regex", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Inelastic/dos/load_phonon.py#L16-L86
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/idlelib/EditorWindow.py
python
EditorWindow.__extra_help_callback
(self, helpfile)
return display_extra_help
Create a callback with the helpfile value frozen at definition time
Create a callback with the helpfile value frozen at definition time
[ "Create", "a", "callback", "with", "the", "helpfile", "value", "frozen", "at", "definition", "time" ]
def __extra_help_callback(self, helpfile): "Create a callback with the helpfile value frozen at definition time" def display_extra_help(helpfile=helpfile): if not helpfile.startswith(('www', 'http')): helpfile = os.path.normpath(helpfile) if sys.platform[:3] == 'w...
[ "def", "__extra_help_callback", "(", "self", ",", "helpfile", ")", ":", "def", "display_extra_help", "(", "helpfile", "=", "helpfile", ")", ":", "if", "not", "helpfile", ".", "startswith", "(", "(", "'www'", ",", "'http'", ")", ")", ":", "helpfile", "=", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/idlelib/EditorWindow.py#L845-L858
networkit/networkit
695b7a786a894a303fa8587597d5ef916e797729
networkit/profiling/plot.py
python
Theme.getEdgeWidth
(self)
return self.__edgeWidth
returns the edge width value of the theme
returns the edge width value of the theme
[ "returns", "the", "edge", "width", "value", "of", "the", "theme" ]
def getEdgeWidth(self): """ returns the edge width value of the theme """ return self.__edgeWidth
[ "def", "getEdgeWidth", "(", "self", ")", ":", "return", "self", ".", "__edgeWidth" ]
https://github.com/networkit/networkit/blob/695b7a786a894a303fa8587597d5ef916e797729/networkit/profiling/plot.py#L131-L133
mysql/mysql-router
cc0179f982bb9739a834eb6fd205a56224616133
ext/gmock/scripts/gmock_doctor.py
python
_NeedToUseSymbolDiagnoser
(msg)
Diagnoses the NUS disease, given the error messages by the compiler.
Diagnoses the NUS disease, given the error messages by the compiler.
[ "Diagnoses", "the", "NUS", "disease", "given", "the", "error", "messages", "by", "the", "compiler", "." ]
def _NeedToUseSymbolDiagnoser(msg): """Diagnoses the NUS disease, given the error messages by the compiler.""" gcc_regex = (_GCC_FILE_LINE_RE + r'error: \'(?P<symbol>.+)\' ' r'(was not declared in this scope|has not been declared)') clang_regex = (_CLANG_FILE_LINE_RE + r'error: (u...
[ "def", "_NeedToUseSymbolDiagnoser", "(", "msg", ")", ":", "gcc_regex", "=", "(", "_GCC_FILE_LINE_RE", "+", "r'error: \\'(?P<symbol>.+)\\' '", "r'(was not declared in this scope|has not been declared)'", ")", "clang_regex", "=", "(", "_CLANG_FILE_LINE_RE", "+", "r'error: (use of...
https://github.com/mysql/mysql-router/blob/cc0179f982bb9739a834eb6fd205a56224616133/ext/gmock/scripts/gmock_doctor.py#L392-L409
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/groupby/groupby.py
python
GroupBy._get_cythonized_result
(self, how, grouper, aggregate=False, cython_dtype=None, needs_values=False, needs_mask=False, needs_ngroups=False, result_is_index=False, pre_processing=None, post_processing=None, ...
Get result for Cythonized functions. Parameters ---------- how : str, Cythonized function name to be called grouper : Grouper object containing pertinent group info aggregate : bool, default False Whether the result should be aggregated to match the number of ...
Get result for Cythonized functions.
[ "Get", "result", "for", "Cythonized", "functions", "." ]
def _get_cythonized_result(self, how, grouper, aggregate=False, cython_dtype=None, needs_values=False, needs_mask=False, needs_ngroups=False, result_is_index=False, pre_processing=None, post_proce...
[ "def", "_get_cythonized_result", "(", "self", ",", "how", ",", "grouper", ",", "aggregate", "=", "False", ",", "cython_dtype", "=", "None", ",", "needs_values", "=", "False", ",", "needs_mask", "=", "False", ",", "needs_ngroups", "=", "False", ",", "result_i...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/groupby/groupby.py#L1896-L1992
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/site_compare/command_line.py
python
Command.SortArgs
(self)
return ArgSorter
Returns a method that can be passed to sort() to sort arguments.
Returns a method that can be passed to sort() to sort arguments.
[ "Returns", "a", "method", "that", "can", "be", "passed", "to", "sort", "()", "to", "sort", "arguments", "." ]
def SortArgs(self): """Returns a method that can be passed to sort() to sort arguments.""" def ArgSorter(arg1, arg2): """Helper for sorting arguments in the usage string. Positional arguments come first, then required arguments, then optional arguments. Pylint demands this trivial function ...
[ "def", "SortArgs", "(", "self", ")", ":", "def", "ArgSorter", "(", "arg1", ",", "arg2", ")", ":", "\"\"\"Helper for sorting arguments in the usage string.\n\n Positional arguments come first, then required arguments,\n then optional arguments. Pylint demands this trivial functi...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/site_compare/command_line.py#L449-L469
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/grid.py
python
PyGridCellAttrProvider.SetColAttr
(*args, **kwargs)
return _grid.PyGridCellAttrProvider_SetColAttr(*args, **kwargs)
SetColAttr(self, GridCellAttr attr, int col)
SetColAttr(self, GridCellAttr attr, int col)
[ "SetColAttr", "(", "self", "GridCellAttr", "attr", "int", "col", ")" ]
def SetColAttr(*args, **kwargs): """SetColAttr(self, GridCellAttr attr, int col)""" return _grid.PyGridCellAttrProvider_SetColAttr(*args, **kwargs)
[ "def", "SetColAttr", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "PyGridCellAttrProvider_SetColAttr", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L737-L739
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/propgrid.py
python
PGCell.SetEmptyData
(*args, **kwargs)
return _propgrid.PGCell_SetEmptyData(*args, **kwargs)
SetEmptyData(self)
SetEmptyData(self)
[ "SetEmptyData", "(", "self", ")" ]
def SetEmptyData(*args, **kwargs): """SetEmptyData(self)""" return _propgrid.PGCell_SetEmptyData(*args, **kwargs)
[ "def", "SetEmptyData", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGCell_SetEmptyData", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L143-L145
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/variable_scope.py
python
VariableScope.reuse_variables
(self)
Reuse variables in this scope.
Reuse variables in this scope.
[ "Reuse", "variables", "in", "this", "scope", "." ]
def reuse_variables(self): """Reuse variables in this scope.""" self._reuse = True
[ "def", "reuse_variables", "(", "self", ")", ":", "self", ".", "_reuse", "=", "True" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/variable_scope.py#L972-L974
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_aarch64/python2.7/dist-packages/rosdep2/installers.py
python
InstallerContext.set_default_os_installer_key
(self, os_key, installer_key)
Set the default OS installer to use for OS. :meth:`InstallerContext.add_os_installer` must have previously been called with the same arguments. :param os_key: Key for OS :param installer_key: Key for installer to add to OS :raises: :exc:`KeyError`: if installer for *installer_ke...
Set the default OS installer to use for OS. :meth:`InstallerContext.add_os_installer` must have previously been called with the same arguments.
[ "Set", "the", "default", "OS", "installer", "to", "use", "for", "OS", ".", ":", "meth", ":", "InstallerContext", ".", "add_os_installer", "must", "have", "previously", "been", "called", "with", "the", "same", "arguments", "." ]
def set_default_os_installer_key(self, os_key, installer_key): """ Set the default OS installer to use for OS. :meth:`InstallerContext.add_os_installer` must have previously been called with the same arguments. :param os_key: Key for OS :param installer_key: Key for inst...
[ "def", "set_default_os_installer_key", "(", "self", ",", "os_key", ",", "installer_key", ")", ":", "if", "not", "os_key", "in", "self", ".", "os_installers", ":", "raise", "KeyError", "(", "\"unknown OS: %s\"", "%", "(", "os_key", ")", ")", "if", "not", "has...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/rosdep2/installers.py#L201-L220
shedskin/shedskin
ae88dbca7b1d9671cd8be448cb0b497122758936
examples/c64/cpu.py
python
CPU.SED
(self, opcode = 0xF8)
Set Decimal
Set Decimal
[ "Set", "Decimal" ]
def SED(self, opcode = 0xF8): """ Set Decimal """ self.flags.add("D")
[ "def", "SED", "(", "self", ",", "opcode", "=", "0xF8", ")", ":", "self", ".", "flags", ".", "add", "(", "\"D\"", ")" ]
https://github.com/shedskin/shedskin/blob/ae88dbca7b1d9671cd8be448cb0b497122758936/examples/c64/cpu.py#L1393-L1395
MegEngine/MegEngine
ce9ad07a27ec909fb8db4dd67943d24ba98fb93a
imperative/python/megengine/core/tensor/array_method.py
python
ArrayMethodMixin.astype
(self, dtype)
return astype(self, dtype)
r"""Returns a :class:`Tensor` with the same data and number of elements with the specified :attr:`~.Tensor.dtype`.
r"""Returns a :class:`Tensor` with the same data and number of elements with the specified :attr:`~.Tensor.dtype`.
[ "r", "Returns", "a", ":", "class", ":", "Tensor", "with", "the", "same", "data", "and", "number", "of", "elements", "with", "the", "specified", ":", "attr", ":", "~", ".", "Tensor", ".", "dtype", "." ]
def astype(self, dtype): r"""Returns a :class:`Tensor` with the same data and number of elements with the specified :attr:`~.Tensor.dtype`. """ return astype(self, dtype)
[ "def", "astype", "(", "self", ",", "dtype", ")", ":", "return", "astype", "(", "self", ",", "dtype", ")" ]
https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/core/tensor/array_method.py#L460-L464
p4lang/p4c
3272e79369f20813cc1a555a5eb26f44432f84a4
tools/cpplint.py
python
IsInitializerList
(clean_lines, linenum)
return False
Check if current line is inside constructor initializer list. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line appears to be inside constructor initializer list, False otherwise.
Check if current line is inside constructor initializer list.
[ "Check", "if", "current", "line", "is", "inside", "constructor", "initializer", "list", "." ]
def IsInitializerList(clean_lines, linenum): """Check if current line is inside constructor initializer list. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line appears to be inside constructor initializer list,...
[ "def", "IsInitializerList", "(", "clean_lines", ",", "linenum", ")", ":", "for", "i", "in", "xrange", "(", "linenum", ",", "1", ",", "-", "1", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "i", "]", "if", "i", "==", "linenum", ":", "rem...
https://github.com/p4lang/p4c/blob/3272e79369f20813cc1a555a5eb26f44432f84a4/tools/cpplint.py#L5520-L5559
indutny/candor
48e7260618f5091c80a3416828e2808cad3ea22e
tools/gyp/pylib/gyp/generator/msvs.py
python
_GenerateProject
(project, options, version, generator_flags)
Generates a vcproj file. Arguments: project: the MSVSProject object. options: global generator options. version: the MSVSVersion object. generator_flags: dict of generator-specific flags. Returns: A list of source files that cannot be found on disk.
Generates a vcproj file.
[ "Generates", "a", "vcproj", "file", "." ]
def _GenerateProject(project, options, version, generator_flags): """Generates a vcproj file. Arguments: project: the MSVSProject object. options: global generator options. version: the MSVSVersion object. generator_flags: dict of generator-specific flags. Returns: A list of source files that...
[ "def", "_GenerateProject", "(", "project", ",", "options", ",", "version", ",", "generator_flags", ")", ":", "default_config", "=", "_GetDefaultConfiguration", "(", "project", ".", "spec", ")", "# Skip emitting anything if told to with msvs_existing_vcproj option.", "if", ...
https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/generator/msvs.py#L859-L879
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/dataset.py
python
InMemoryDataset.wait_preload_done
(self)
Wait preload_into_memory done Examples: .. code-block:: python # required: skiptest import paddle.fluid as fluid dataset = fluid.DatasetFactory().create_dataset("InMemoryDataset") filelist = ["a.txt", "b.txt"] dataset.set_fileli...
Wait preload_into_memory done
[ "Wait", "preload_into_memory", "done" ]
def wait_preload_done(self): """ Wait preload_into_memory done Examples: .. code-block:: python # required: skiptest import paddle.fluid as fluid dataset = fluid.DatasetFactory().create_dataset("InMemoryDataset") filelist = ["...
[ "def", "wait_preload_done", "(", "self", ")", ":", "self", ".", "dataset", ".", "wait_preload_done", "(", ")", "self", ".", "dataset", ".", "destroy_preload_readers", "(", ")" ]
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/dataset.py#L800-L816
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/robotsim.py
python
RobotModelLink.drawWorldGL
(self, keepAppearance: bool=True)
return _robotsim.RobotModelLink_drawWorldGL(self, keepAppearance)
r""" Draws the link's geometry in the world frame. If keepAppearance=true, the current Appearance is honored. Otherwise, just the geometry is drawn. Args: keepAppearance (bool, optional): default value True
r""" Draws the link's geometry in the world frame. If keepAppearance=true, the current Appearance is honored. Otherwise, just the geometry is drawn.
[ "r", "Draws", "the", "link", "s", "geometry", "in", "the", "world", "frame", ".", "If", "keepAppearance", "=", "true", "the", "current", "Appearance", "is", "honored", ".", "Otherwise", "just", "the", "geometry", "is", "drawn", "." ]
def drawWorldGL(self, keepAppearance: bool=True) ->None: r""" Draws the link's geometry in the world frame. If keepAppearance=true, the current Appearance is honored. Otherwise, just the geometry is drawn. Args: keepAppearance (bool, optional): default value True "...
[ "def", "drawWorldGL", "(", "self", ",", "keepAppearance", ":", "bool", "=", "True", ")", "->", "None", ":", "return", "_robotsim", ".", "RobotModelLink_drawWorldGL", "(", "self", ",", "keepAppearance", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L4356-L4364