partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
valid
_ShouldPrintError
If confidence >= verbose, category passes filter and is not suppressed.
third_party/python/cpplint/cpplint.py
def _ShouldPrintError(category, confidence, linenum): """If confidence >= verbose, category passes filter and is not suppressed.""" # There are three ways we might decide not to print an error message: # a "NOLINT(category)" comment appears in the source, # the verbosity level isn't high enough, or the filters...
def _ShouldPrintError(category, confidence, linenum): """If confidence >= verbose, category passes filter and is not suppressed.""" # There are three ways we might decide not to print an error message: # a "NOLINT(category)" comment appears in the source, # the verbosity level isn't high enough, or the filters...
[ "If", "confidence", ">", "=", "verbose", "category", "passes", "filter", "and", "is", "not", "suppressed", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1355-L1380
[ "def", "_ShouldPrintError", "(", "category", ",", "confidence", ",", "linenum", ")", ":", "# There are three ways we might decide not to print an error message:", "# a \"NOLINT(category)\" comment appears in the source,", "# the verbosity level isn't high enough, or the filters filter it out...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
IsCppString
Does line terminate so, that the next symbol is in string constant. This function does not consider single-line nor multi-line comments. Args: line: is a partial line of code starting from the 0..n. Returns: True, if next character appended to 'line' is inside a string constant.
third_party/python/cpplint/cpplint.py
def IsCppString(line): """Does line terminate so, that the next symbol is in string constant. This function does not consider single-line nor multi-line comments. Args: line: is a partial line of code starting from the 0..n. Returns: True, if next character appended to 'line' is inside a string c...
def IsCppString(line): """Does line terminate so, that the next symbol is in string constant. This function does not consider single-line nor multi-line comments. Args: line: is a partial line of code starting from the 0..n. Returns: True, if next character appended to 'line' is inside a string c...
[ "Does", "line", "terminate", "so", "that", "the", "next", "symbol", "is", "in", "string", "constant", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1441-L1455
[ "def", "IsCppString", "(", "line", ")", ":", "line", "=", "line", ".", "replace", "(", "r'\\\\'", ",", "'XX'", ")", "# after this, \\\\\" does not match to \\\"", "return", "(", "(", "line", ".", "count", "(", "'\"'", ")", "-", "line", ".", "count", "(", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CleanseRawStrings
Removes C++11 raw strings from lines. Before: static const char kData[] = R"( multi-line string )"; After: static const char kData[] = "" (replaced by blank line) ""; Args: raw_lines: list of raw lines. Returns: list of lines with C++11 raw str...
third_party/python/cpplint/cpplint.py
def CleanseRawStrings(raw_lines): """Removes C++11 raw strings from lines. Before: static const char kData[] = R"( multi-line string )"; After: static const char kData[] = "" (replaced by blank line) ""; Args: raw_lines: list of raw lines. Return...
def CleanseRawStrings(raw_lines): """Removes C++11 raw strings from lines. Before: static const char kData[] = R"( multi-line string )"; After: static const char kData[] = "" (replaced by blank line) ""; Args: raw_lines: list of raw lines. Return...
[ "Removes", "C", "++", "11", "raw", "strings", "from", "lines", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1458-L1531
[ "def", "CleanseRawStrings", "(", "raw_lines", ")", ":", "delimiter", "=", "None", "lines_without_raw_strings", "=", "[", "]", "for", "line", "in", "raw_lines", ":", "if", "delimiter", ":", "# Inside a raw string, look for the end", "end", "=", "line", ".", "find",...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
FindNextMultiLineCommentStart
Find the beginning marker for a multiline comment.
third_party/python/cpplint/cpplint.py
def FindNextMultiLineCommentStart(lines, lineix): """Find the beginning marker for a multiline comment.""" while lineix < len(lines): if lines[lineix].strip().startswith('/*'): # Only return this marker if the comment goes beyond this line if lines[lineix].strip().find('*/', 2) < 0: return l...
def FindNextMultiLineCommentStart(lines, lineix): """Find the beginning marker for a multiline comment.""" while lineix < len(lines): if lines[lineix].strip().startswith('/*'): # Only return this marker if the comment goes beyond this line if lines[lineix].strip().find('*/', 2) < 0: return l...
[ "Find", "the", "beginning", "marker", "for", "a", "multiline", "comment", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1534-L1542
[ "def", "FindNextMultiLineCommentStart", "(", "lines", ",", "lineix", ")", ":", "while", "lineix", "<", "len", "(", "lines", ")", ":", "if", "lines", "[", "lineix", "]", ".", "strip", "(", ")", ".", "startswith", "(", "'/*'", ")", ":", "# Only return this...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
FindNextMultiLineCommentEnd
We are inside a comment, find the end marker.
third_party/python/cpplint/cpplint.py
def FindNextMultiLineCommentEnd(lines, lineix): """We are inside a comment, find the end marker.""" while lineix < len(lines): if lines[lineix].strip().endswith('*/'): return lineix lineix += 1 return len(lines)
def FindNextMultiLineCommentEnd(lines, lineix): """We are inside a comment, find the end marker.""" while lineix < len(lines): if lines[lineix].strip().endswith('*/'): return lineix lineix += 1 return len(lines)
[ "We", "are", "inside", "a", "comment", "find", "the", "end", "marker", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1545-L1551
[ "def", "FindNextMultiLineCommentEnd", "(", "lines", ",", "lineix", ")", ":", "while", "lineix", "<", "len", "(", "lines", ")", ":", "if", "lines", "[", "lineix", "]", ".", "strip", "(", ")", ".", "endswith", "(", "'*/'", ")", ":", "return", "lineix", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
RemoveMultiLineCommentsFromRange
Clears a range of lines for multi-line comments.
third_party/python/cpplint/cpplint.py
def RemoveMultiLineCommentsFromRange(lines, begin, end): """Clears a range of lines for multi-line comments.""" # Having // dummy comments makes the lines non-empty, so we will not get # unnecessary blank line warnings later in the code. for i in range(begin, end): lines[i] = '/**/'
def RemoveMultiLineCommentsFromRange(lines, begin, end): """Clears a range of lines for multi-line comments.""" # Having // dummy comments makes the lines non-empty, so we will not get # unnecessary blank line warnings later in the code. for i in range(begin, end): lines[i] = '/**/'
[ "Clears", "a", "range", "of", "lines", "for", "multi", "-", "line", "comments", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1554-L1559
[ "def", "RemoveMultiLineCommentsFromRange", "(", "lines", ",", "begin", ",", "end", ")", ":", "# Having // dummy comments makes the lines non-empty, so we will not get", "# unnecessary blank line warnings later in the code.", "for", "i", "in", "range", "(", "begin", ",", "end", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
RemoveMultiLineComments
Removes multiline (c-style) comments from lines.
third_party/python/cpplint/cpplint.py
def RemoveMultiLineComments(filename, lines, error): """Removes multiline (c-style) comments from lines.""" lineix = 0 while lineix < len(lines): lineix_begin = FindNextMultiLineCommentStart(lines, lineix) if lineix_begin >= len(lines): return lineix_end = FindNextMultiLineCommentEnd(lines, line...
def RemoveMultiLineComments(filename, lines, error): """Removes multiline (c-style) comments from lines.""" lineix = 0 while lineix < len(lines): lineix_begin = FindNextMultiLineCommentStart(lines, lineix) if lineix_begin >= len(lines): return lineix_end = FindNextMultiLineCommentEnd(lines, line...
[ "Removes", "multiline", "(", "c", "-", "style", ")", "comments", "from", "lines", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1562-L1575
[ "def", "RemoveMultiLineComments", "(", "filename", ",", "lines", ",", "error", ")", ":", "lineix", "=", "0", "while", "lineix", "<", "len", "(", "lines", ")", ":", "lineix_begin", "=", "FindNextMultiLineCommentStart", "(", "lines", ",", "lineix", ")", "if", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CleanseComments
Removes //-comments and single-line C-style /* */ comments. Args: line: A line of C++ source. Returns: The line with single-line comments removed.
third_party/python/cpplint/cpplint.py
def CleanseComments(line): """Removes //-comments and single-line C-style /* */ comments. Args: line: A line of C++ source. Returns: The line with single-line comments removed. """ commentpos = line.find('//') if commentpos != -1 and not IsCppString(line[:commentpos]): line = line[:commentpos]...
def CleanseComments(line): """Removes //-comments and single-line C-style /* */ comments. Args: line: A line of C++ source. Returns: The line with single-line comments removed. """ commentpos = line.find('//') if commentpos != -1 and not IsCppString(line[:commentpos]): line = line[:commentpos]...
[ "Removes", "//", "-", "comments", "and", "single", "-", "line", "C", "-", "style", "/", "*", "*", "/", "comments", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1578-L1591
[ "def", "CleanseComments", "(", "line", ")", ":", "commentpos", "=", "line", ".", "find", "(", "'//'", ")", "if", "commentpos", "!=", "-", "1", "and", "not", "IsCppString", "(", "line", "[", ":", "commentpos", "]", ")", ":", "line", "=", "line", "[", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
FindEndOfExpressionInLine
Find the position just after the end of current parenthesized expression. Args: line: a CleansedLines line. startpos: start searching at this position. stack: nesting stack at startpos. Returns: On finding matching end: (index just after matching end, None) On finding an unclosed expression: (...
third_party/python/cpplint/cpplint.py
def FindEndOfExpressionInLine(line, startpos, stack): """Find the position just after the end of current parenthesized expression. Args: line: a CleansedLines line. startpos: start searching at this position. stack: nesting stack at startpos. Returns: On finding matching end: (index just after m...
def FindEndOfExpressionInLine(line, startpos, stack): """Find the position just after the end of current parenthesized expression. Args: line: a CleansedLines line. startpos: start searching at this position. stack: nesting stack at startpos. Returns: On finding matching end: (index just after m...
[ "Find", "the", "position", "just", "after", "the", "end", "of", "current", "parenthesized", "expression", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1689-L1764
[ "def", "FindEndOfExpressionInLine", "(", "line", ",", "startpos", ",", "stack", ")", ":", "for", "i", "in", "xrange", "(", "startpos", ",", "len", "(", "line", ")", ")", ":", "char", "=", "line", "[", "i", "]", "if", "char", "in", "'([{'", ":", "# ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CloseExpression
If input points to ( or { or [ or <, finds the position that closes it. If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the linenum/pos that correspond to the closing of the expression. TODO(unknown): cpplint spends a fair bit of time matching parentheses. Ideally we would want to index all...
third_party/python/cpplint/cpplint.py
def CloseExpression(clean_lines, linenum, pos): """If input points to ( or { or [ or <, finds the position that closes it. If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the linenum/pos that correspond to the closing of the expression. TODO(unknown): cpplint spends a fair bit of time match...
def CloseExpression(clean_lines, linenum, pos): """If input points to ( or { or [ or <, finds the position that closes it. If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the linenum/pos that correspond to the closing of the expression. TODO(unknown): cpplint spends a fair bit of time match...
[ "If", "input", "points", "to", "(", "or", "{", "or", "[", "or", "<", "finds", "the", "position", "that", "closes", "it", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1767-L1808
[ "def", "CloseExpression", "(", "clean_lines", ",", "linenum", ",", "pos", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "if", "(", "line", "[", "pos", "]", "not", "in", "'({[<'", ")", "or", "Match", "(", "r'<[<=]'", ",", "...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
FindStartOfExpressionInLine
Find position at the matching start of current expression. This is almost the reverse of FindEndOfExpressionInLine, but note that the input position and returned position differs by 1. Args: line: a CleansedLines line. endpos: start searching at this position. stack: nesting stack at endpos. Retu...
third_party/python/cpplint/cpplint.py
def FindStartOfExpressionInLine(line, endpos, stack): """Find position at the matching start of current expression. This is almost the reverse of FindEndOfExpressionInLine, but note that the input position and returned position differs by 1. Args: line: a CleansedLines line. endpos: start searching at...
def FindStartOfExpressionInLine(line, endpos, stack): """Find position at the matching start of current expression. This is almost the reverse of FindEndOfExpressionInLine, but note that the input position and returned position differs by 1. Args: line: a CleansedLines line. endpos: start searching at...
[ "Find", "position", "at", "the", "matching", "start", "of", "current", "expression", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1811-L1885
[ "def", "FindStartOfExpressionInLine", "(", "line", ",", "endpos", ",", "stack", ")", ":", "i", "=", "endpos", "while", "i", ">=", "0", ":", "char", "=", "line", "[", "i", "]", "if", "char", "in", "')]}'", ":", "# Found end of expression, push to expression s...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
ReverseCloseExpression
If input points to ) or } or ] or >, finds the position that opens it. If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the linenum/pos that correspond to the opening of the expression. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to ...
third_party/python/cpplint/cpplint.py
def ReverseCloseExpression(clean_lines, linenum, pos): """If input points to ) or } or ] or >, finds the position that opens it. If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the linenum/pos that correspond to the opening of the expression. Args: clean_lines: A CleansedLines instance ...
def ReverseCloseExpression(clean_lines, linenum, pos): """If input points to ) or } or ] or >, finds the position that opens it. If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the linenum/pos that correspond to the opening of the expression. Args: clean_lines: A CleansedLines instance ...
[ "If", "input", "points", "to", ")", "or", "}", "or", "]", "or", ">", "finds", "the", "position", "that", "opens", "it", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1888-L1923
[ "def", "ReverseCloseExpression", "(", "clean_lines", ",", "linenum", ",", "pos", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "if", "line", "[", "pos", "]", "not", "in", "')}]>'", ":", "return", "(", "line", ",", "0", ",", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckForCopyright
Logs an error if no Copyright message appears at the top of the file.
third_party/python/cpplint/cpplint.py
def CheckForCopyright(filename, lines, error): """Logs an error if no Copyright message appears at the top of the file.""" # We'll say it should occur by line 10. Don't forget there's a # dummy line at the front. for line in range(1, min(len(lines), 11)): if re.search(r'Copyright', lines[line], re.I): brea...
def CheckForCopyright(filename, lines, error): """Logs an error if no Copyright message appears at the top of the file.""" # We'll say it should occur by line 10. Don't forget there's a # dummy line at the front. for line in range(1, min(len(lines), 11)): if re.search(r'Copyright', lines[line], re.I): brea...
[ "Logs", "an", "error", "if", "no", "Copyright", "message", "appears", "at", "the", "top", "of", "the", "file", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1926-L1936
[ "def", "CheckForCopyright", "(", "filename", ",", "lines", ",", "error", ")", ":", "# We'll say it should occur by line 10. Don't forget there's a", "# dummy line at the front.", "for", "line", "in", "range", "(", "1", ",", "min", "(", "len", "(", "lines", ")", ",",...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
GetIndentLevel
Return the number of leading spaces in line. Args: line: A string to check. Returns: An integer count of leading spaces, possibly zero.
third_party/python/cpplint/cpplint.py
def GetIndentLevel(line): """Return the number of leading spaces in line. Args: line: A string to check. Returns: An integer count of leading spaces, possibly zero. """ indent = Match(r'^( *)\S', line) if indent: return len(indent.group(1)) else: return 0
def GetIndentLevel(line): """Return the number of leading spaces in line. Args: line: A string to check. Returns: An integer count of leading spaces, possibly zero. """ indent = Match(r'^( *)\S', line) if indent: return len(indent.group(1)) else: return 0
[ "Return", "the", "number", "of", "leading", "spaces", "in", "line", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1939-L1952
[ "def", "GetIndentLevel", "(", "line", ")", ":", "indent", "=", "Match", "(", "r'^( *)\\S'", ",", "line", ")", "if", "indent", ":", "return", "len", "(", "indent", ".", "group", "(", "1", ")", ")", "else", ":", "return", "0" ]
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
GetHeaderGuardCPPVariable
Returns the CPP variable that should be used as a header guard. Args: filename: The name of a C++ header file. Returns: The CPP variable that should be used as a header guard in the named file.
third_party/python/cpplint/cpplint.py
def GetHeaderGuardCPPVariable(filename): """Returns the CPP variable that should be used as a header guard. Args: filename: The name of a C++ header file. Returns: The CPP variable that should be used as a header guard in the named file. """ # Restores original filename in case that cpplint is...
def GetHeaderGuardCPPVariable(filename): """Returns the CPP variable that should be used as a header guard. Args: filename: The name of a C++ header file. Returns: The CPP variable that should be used as a header guard in the named file. """ # Restores original filename in case that cpplint is...
[ "Returns", "the", "CPP", "variable", "that", "should", "be", "used", "as", "a", "header", "guard", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1955-L1983
[ "def", "GetHeaderGuardCPPVariable", "(", "filename", ")", ":", "# Restores original filename in case that cpplint is invoked from Emacs's", "# flymake.", "filename", "=", "re", ".", "sub", "(", "r'_flymake\\.h$'", ",", "'.h'", ",", "filename", ")", "filename", "=", "re", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckForHeaderGuard
Checks that the file contains a header guard. Logs an error if no #ifndef header guard is present. For other headers, checks that the full pathname is used. Args: filename: The name of the C++ header file. clean_lines: A CleansedLines instance containing the file. error: The function to call with a...
third_party/python/cpplint/cpplint.py
def CheckForHeaderGuard(filename, clean_lines, error): """Checks that the file contains a header guard. Logs an error if no #ifndef header guard is present. For other headers, checks that the full pathname is used. Args: filename: The name of the C++ header file. clean_lines: A CleansedLines instance...
def CheckForHeaderGuard(filename, clean_lines, error): """Checks that the file contains a header guard. Logs an error if no #ifndef header guard is present. For other headers, checks that the full pathname is used. Args: filename: The name of the C++ header file. clean_lines: A CleansedLines instance...
[ "Checks", "that", "the", "file", "contains", "a", "header", "guard", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1986-L2086
[ "def", "CheckForHeaderGuard", "(", "filename", ",", "clean_lines", ",", "error", ")", ":", "# Don't check for header guards if there are error suppression", "# comments somewhere in this file.", "#", "# Because this is silencing a warning for a nonexistent line, we", "# only support the ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckHeaderFileIncluded
Logs an error if a source file does not include its header.
third_party/python/cpplint/cpplint.py
def CheckHeaderFileIncluded(filename, include_state, error): """Logs an error if a source file does not include its header.""" # Do not check test files fileinfo = FileInfo(filename) if Search(_TEST_FILE_SUFFIX, fileinfo.BaseName()): return for ext in GetHeaderExtensions(): basefilename = filename...
def CheckHeaderFileIncluded(filename, include_state, error): """Logs an error if a source file does not include its header.""" # Do not check test files fileinfo = FileInfo(filename) if Search(_TEST_FILE_SUFFIX, fileinfo.BaseName()): return for ext in GetHeaderExtensions(): basefilename = filename...
[ "Logs", "an", "error", "if", "a", "source", "file", "does", "not", "include", "its", "header", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L2089-L2113
[ "def", "CheckHeaderFileIncluded", "(", "filename", ",", "include_state", ",", "error", ")", ":", "# Do not check test files", "fileinfo", "=", "FileInfo", "(", "filename", ")", "if", "Search", "(", "_TEST_FILE_SUFFIX", ",", "fileinfo", ".", "BaseName", "(", ")", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckForBadCharacters
Logs an error for each line containing bad characters. Two kinds of bad characters: 1. Unicode replacement characters: These indicate that either the file contained invalid UTF-8 (likely) or Unicode replacement characters (which it shouldn't). Note that it's possible for this to throw off line numbering if...
third_party/python/cpplint/cpplint.py
def CheckForBadCharacters(filename, lines, error): """Logs an error for each line containing bad characters. Two kinds of bad characters: 1. Unicode replacement characters: These indicate that either the file contained invalid UTF-8 (likely) or Unicode replacement characters (which it shouldn't). Note that...
def CheckForBadCharacters(filename, lines, error): """Logs an error for each line containing bad characters. Two kinds of bad characters: 1. Unicode replacement characters: These indicate that either the file contained invalid UTF-8 (likely) or Unicode replacement characters (which it shouldn't). Note that...
[ "Logs", "an", "error", "for", "each", "line", "containing", "bad", "characters", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L2116-L2138
[ "def", "CheckForBadCharacters", "(", "filename", ",", "lines", ",", "error", ")", ":", "for", "linenum", ",", "line", "in", "enumerate", "(", "lines", ")", ":", "if", "unicode_escape_decode", "(", "'\\ufffd'", ")", "in", "line", ":", "error", "(", "filenam...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckForNewlineAtEOF
Logs an error if there is no newline char at the end of the file. Args: filename: The name of the current file. lines: An array of strings, each representing a line of the file. error: The function to call with any errors found.
third_party/python/cpplint/cpplint.py
def CheckForNewlineAtEOF(filename, lines, error): """Logs an error if there is no newline char at the end of the file. Args: filename: The name of the current file. lines: An array of strings, each representing a line of the file. error: The function to call with any errors found. """ # The array ...
def CheckForNewlineAtEOF(filename, lines, error): """Logs an error if there is no newline char at the end of the file. Args: filename: The name of the current file. lines: An array of strings, each representing a line of the file. error: The function to call with any errors found. """ # The array ...
[ "Logs", "an", "error", "if", "there", "is", "no", "newline", "char", "at", "the", "end", "of", "the", "file", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L2141-L2156
[ "def", "CheckForNewlineAtEOF", "(", "filename", ",", "lines", ",", "error", ")", ":", "# The array lines() was created by adding two newlines to the", "# original file (go figure), then splitting on \\n.", "# To verify that the file ends in \\n, we just have to make sure the", "# last-but-...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckForMultilineCommentsAndStrings
Logs an error if we see /* ... */ or "..." that extend past one line. /* ... */ comments are legit inside macros, for one line. Otherwise, we prefer // comments, so it's ok to warn about the other. Likewise, it's ok for strings to extend across multiple lines, as long as a line continuation character (backsla...
third_party/python/cpplint/cpplint.py
def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error): """Logs an error if we see /* ... */ or "..." that extend past one line. /* ... */ comments are legit inside macros, for one line. Otherwise, we prefer // comments, so it's ok to warn about the other. Likewise, it's ok for strings...
def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error): """Logs an error if we see /* ... */ or "..." that extend past one line. /* ... */ comments are legit inside macros, for one line. Otherwise, we prefer // comments, so it's ok to warn about the other. Likewise, it's ok for strings...
[ "Logs", "an", "error", "if", "we", "see", "/", "*", "...", "*", "/", "or", "...", "that", "extend", "past", "one", "line", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L2159-L2194
[ "def", "CheckForMultilineCommentsAndStrings", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Remove all \\\\ (escaped backslashes) from the line. They are OK, and the", "# secon...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckPosixThreading
Checks for calls to thread-unsafe functions. Much code has been originally written without consideration of multi-threading. Also, engineers are relying on their old experience; they have learned posix before threading extensions were added. These tests guide the engineers to use thread-safe functions (when us...
third_party/python/cpplint/cpplint.py
def CheckPosixThreading(filename, clean_lines, linenum, error): """Checks for calls to thread-unsafe functions. Much code has been originally written without consideration of multi-threading. Also, engineers are relying on their old experience; they have learned posix before threading extensions were added. Th...
def CheckPosixThreading(filename, clean_lines, linenum, error): """Checks for calls to thread-unsafe functions. Much code has been originally written without consideration of multi-threading. Also, engineers are relying on their old experience; they have learned posix before threading extensions were added. Th...
[ "Checks", "for", "calls", "to", "thread", "-", "unsafe", "functions", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L2227-L2250
[ "def", "CheckPosixThreading", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "for", "single_thread_func", ",", "multithread_safe_func", ",", "pattern", "in", "_THREADIN...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckVlogArguments
Checks that VLOG() is only used for defining a logging level. For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and VLOG(FATAL) are not. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to ...
third_party/python/cpplint/cpplint.py
def CheckVlogArguments(filename, clean_lines, linenum, error): """Checks that VLOG() is only used for defining a logging level. For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and VLOG(FATAL) are not. Args: filename: The name of the current file. clean_lines: A CleansedLines i...
def CheckVlogArguments(filename, clean_lines, linenum, error): """Checks that VLOG() is only used for defining a logging level. For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and VLOG(FATAL) are not. Args: filename: The name of the current file. clean_lines: A CleansedLines i...
[ "Checks", "that", "VLOG", "()", "is", "only", "used", "for", "defining", "a", "logging", "level", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L2253-L2269
[ "def", "CheckVlogArguments", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "if", "Search", "(", "r'\\bVLOG\\((INFO|ERROR|WARNING|DFATAL|FATAL)\\)'", ",", "line", ")", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckInvalidIncrement
Checks for invalid increment *count++. For example following function: void increment_counter(int* count) { *count++; } is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*count, (*count)++ or *count += 1. Args: filename: The name of the current file. ...
third_party/python/cpplint/cpplint.py
def CheckInvalidIncrement(filename, clean_lines, linenum, error): """Checks for invalid increment *count++. For example following function: void increment_counter(int* count) { *count++; } is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*count, (*count)++ ...
def CheckInvalidIncrement(filename, clean_lines, linenum, error): """Checks for invalid increment *count++. For example following function: void increment_counter(int* count) { *count++; } is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*count, (*count)++ ...
[ "Checks", "for", "invalid", "increment", "*", "count", "++", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L2277-L2296
[ "def", "CheckInvalidIncrement", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "if", "_RE_PATTERN_INVALID_INCREMENT", ".", "match", "(", "line", ")", ":", "error", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckSpacingForFunctionCall
Checks for the correctness of various spacing around function calls. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
third_party/python/cpplint/cpplint.py
def CheckSpacingForFunctionCall(filename, clean_lines, linenum, error): """Checks for the correctness of various spacing around function calls. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: T...
def CheckSpacingForFunctionCall(filename, clean_lines, linenum, error): """Checks for the correctness of various spacing around function calls. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: T...
[ "Checks", "for", "the", "correctness", "of", "various", "spacing", "around", "function", "calls", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L3051-L3125
[ "def", "CheckSpacingForFunctionCall", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Since function calls often occur inside if/for/while/switch", "# expressions - which have th...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckForFunctionLengths
Reports for long function bodies. For an overview why this is done, see: https://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions Uses a simplistic algorithm assuming other style guidelines (especially spacing) are followed. Only checks unindented functions, so class members are...
third_party/python/cpplint/cpplint.py
def CheckForFunctionLengths(filename, clean_lines, linenum, function_state, error): """Reports for long function bodies. For an overview why this is done, see: https://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions Uses a simplistic algorithm assuming...
def CheckForFunctionLengths(filename, clean_lines, linenum, function_state, error): """Reports for long function bodies. For an overview why this is done, see: https://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions Uses a simplistic algorithm assuming...
[ "Reports", "for", "long", "function", "bodies", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L3157-L3222
[ "def", "CheckForFunctionLengths", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "function_state", ",", "error", ")", ":", "lines", "=", "clean_lines", ".", "lines", "line", "=", "lines", "[", "linenum", "]", "joined_line", "=", "''", "starting_func...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckComment
Checks for common mistakes in comments. Args: line: The line in question. filename: The name of the current file. linenum: The number of the line to check. next_line_start: The first non-whitespace column of the next line. error: The function to call with any errors found.
third_party/python/cpplint/cpplint.py
def CheckComment(line, filename, linenum, next_line_start, error): """Checks for common mistakes in comments. Args: line: The line in question. filename: The name of the current file. linenum: The number of the line to check. next_line_start: The first non-whitespace column of the next line. er...
def CheckComment(line, filename, linenum, next_line_start, error): """Checks for common mistakes in comments. Args: line: The line in question. filename: The name of the current file. linenum: The number of the line to check. next_line_start: The first non-whitespace column of the next line. er...
[ "Checks", "for", "common", "mistakes", "in", "comments", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L3228-L3279
[ "def", "CheckComment", "(", "line", ",", "filename", ",", "linenum", ",", "next_line_start", ",", "error", ")", ":", "commentpos", "=", "line", ".", "find", "(", "'//'", ")", "if", "commentpos", "!=", "-", "1", ":", "# Check if the // may be in quotes. If so,...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckAccess
Checks for improper use of DISALLOW* macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A NestingState instance which maintains information about the current stack...
third_party/python/cpplint/cpplint.py
def CheckAccess(filename, clean_lines, linenum, nesting_state, error): """Checks for improper use of DISALLOW* macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A NestingState ins...
def CheckAccess(filename, clean_lines, linenum, nesting_state, error): """Checks for improper use of DISALLOW* macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A NestingState ins...
[ "Checks", "for", "improper", "use", "of", "DISALLOW", "*", "macros", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L3282-L3309
[ "def", "CheckAccess", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# get rid of comments and strings", "matched", "=", "Match", "(", "(", "r'...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckSpacing
Checks for the correctness of various spacing issues in the code. Things we check for: spaces around operators, spaces after if/for/while/switch, no spaces around parens in function calls, two spaces between code and comment, don't start a block with a blank line, don't end a function with a blank line, don't ...
third_party/python/cpplint/cpplint.py
def CheckSpacing(filename, clean_lines, linenum, nesting_state, error): """Checks for the correctness of various spacing issues in the code. Things we check for: spaces around operators, spaces after if/for/while/switch, no spaces around parens in function calls, two spaces between code and comment, don't star...
def CheckSpacing(filename, clean_lines, linenum, nesting_state, error): """Checks for the correctness of various spacing issues in the code. Things we check for: spaces around operators, spaces after if/for/while/switch, no spaces around parens in function calls, two spaces between code and comment, don't star...
[ "Checks", "for", "the", "correctness", "of", "various", "spacing", "issues", "in", "the", "code", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L3312-L3437
[ "def", "CheckSpacing", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "# Don't use \"elided\" lines here, otherwise we can't check commented lines.", "# Don't want to use \"raw\" either, because we don't want to check inside C++11", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckParenthesisSpacing
Checks for horizontal spacing around parentheses. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
third_party/python/cpplint/cpplint.py
def CheckParenthesisSpacing(filename, clean_lines, linenum, error): """Checks for horizontal spacing around parentheses. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call wit...
def CheckParenthesisSpacing(filename, clean_lines, linenum, error): """Checks for horizontal spacing around parentheses. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call wit...
[ "Checks", "for", "horizontal", "spacing", "around", "parentheses", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L3555-L3590
[ "def", "CheckParenthesisSpacing", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# No spaces after an if, while, switch, or for", "match", "=", "Search", "(", "r' (if\\(|f...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckCommaSpacing
Checks for horizontal spacing near commas and semicolons. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
third_party/python/cpplint/cpplint.py
def CheckCommaSpacing(filename, clean_lines, linenum, error): """Checks for horizontal spacing near commas and semicolons. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call w...
def CheckCommaSpacing(filename, clean_lines, linenum, error): """Checks for horizontal spacing near commas and semicolons. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call w...
[ "Checks", "for", "horizontal", "spacing", "near", "commas", "and", "semicolons", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L3593-L3626
[ "def", "CheckCommaSpacing", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "raw", "=", "clean_lines", ".", "lines_without_raw_strings", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# You should always have a space af...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
_IsType
Check if expression looks like a type name, returns true if so. Args: clean_lines: A CleansedLines instance containing the file. nesting_state: A NestingState instance which maintains information about the current stack of nested blocks being parsed. expr: The expression to check. Re...
third_party/python/cpplint/cpplint.py
def _IsType(clean_lines, nesting_state, expr): """Check if expression looks like a type name, returns true if so. Args: clean_lines: A CleansedLines instance containing the file. nesting_state: A NestingState instance which maintains information about the current stack of nested blocks b...
def _IsType(clean_lines, nesting_state, expr): """Check if expression looks like a type name, returns true if so. Args: clean_lines: A CleansedLines instance containing the file. nesting_state: A NestingState instance which maintains information about the current stack of nested blocks b...
[ "Check", "if", "expression", "looks", "like", "a", "type", "name", "returns", "true", "if", "so", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L3629-L3689
[ "def", "_IsType", "(", "clean_lines", ",", "nesting_state", ",", "expr", ")", ":", "# Keep only the last token in the expression", "last_word", "=", "Match", "(", "r'^.*(\\b\\S+)$'", ",", "expr", ")", "if", "last_word", ":", "token", "=", "last_word", ".", "group"...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckBracesSpacing
Checks for horizontal spacing near commas. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A NestingState instance which maintains information about the current stack o...
third_party/python/cpplint/cpplint.py
def CheckBracesSpacing(filename, clean_lines, linenum, nesting_state, error): """Checks for horizontal spacing near commas. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A NestingStat...
def CheckBracesSpacing(filename, clean_lines, linenum, nesting_state, error): """Checks for horizontal spacing near commas. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A NestingStat...
[ "Checks", "for", "horizontal", "spacing", "near", "commas", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L3692-L3778
[ "def", "CheckBracesSpacing", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Except after an opening paren, or after another opening brace (in case of", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
IsDecltype
Check if the token ending on (linenum, column) is decltype(). Args: clean_lines: A CleansedLines instance containing the file. linenum: the number of the line to check. column: end column of the token to check. Returns: True if this token is decltype() expression, False otherwise.
third_party/python/cpplint/cpplint.py
def IsDecltype(clean_lines, linenum, column): """Check if the token ending on (linenum, column) is decltype(). Args: clean_lines: A CleansedLines instance containing the file. linenum: the number of the line to check. column: end column of the token to check. Returns: True if this token is declty...
def IsDecltype(clean_lines, linenum, column): """Check if the token ending on (linenum, column) is decltype(). Args: clean_lines: A CleansedLines instance containing the file. linenum: the number of the line to check. column: end column of the token to check. Returns: True if this token is declty...
[ "Check", "if", "the", "token", "ending", "on", "(", "linenum", "column", ")", "is", "decltype", "()", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L3781-L3796
[ "def", "IsDecltype", "(", "clean_lines", ",", "linenum", ",", "column", ")", ":", "(", "text", ",", "_", ",", "start_col", ")", "=", "ReverseCloseExpression", "(", "clean_lines", ",", "linenum", ",", "column", ")", "if", "start_col", "<", "0", ":", "retu...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckSectionSpacing
Checks for additional blank line issues related to sections. Currently the only thing checked here is blank line before protected/private. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. class_info: A _ClassInfo objects. linenum: The number ...
third_party/python/cpplint/cpplint.py
def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error): """Checks for additional blank line issues related to sections. Currently the only thing checked here is blank line before protected/private. Args: filename: The name of the current file. clean_lines: A CleansedLines instance co...
def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error): """Checks for additional blank line issues related to sections. Currently the only thing checked here is blank line before protected/private. Args: filename: The name of the current file. clean_lines: A CleansedLines instance co...
[ "Checks", "for", "additional", "blank", "line", "issues", "related", "to", "sections", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L3798-L3850
[ "def", "CheckSectionSpacing", "(", "filename", ",", "clean_lines", ",", "class_info", ",", "linenum", ",", "error", ")", ":", "# Skip checks if the class is small, where small means 25 lines or less.", "# 25 lines seems like a good cutoff since that's the usual height of", "# termina...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
GetPreviousNonBlankLine
Return the most recent non-blank line and its line number. Args: clean_lines: A CleansedLines instance containing the file contents. linenum: The number of the line to check. Returns: A tuple with two elements. The first element is the contents of the last non-blank line before the current line, ...
third_party/python/cpplint/cpplint.py
def GetPreviousNonBlankLine(clean_lines, linenum): """Return the most recent non-blank line and its line number. Args: clean_lines: A CleansedLines instance containing the file contents. linenum: The number of the line to check. Returns: A tuple with two elements. The first element is the contents ...
def GetPreviousNonBlankLine(clean_lines, linenum): """Return the most recent non-blank line and its line number. Args: clean_lines: A CleansedLines instance containing the file contents. linenum: The number of the line to check. Returns: A tuple with two elements. The first element is the contents ...
[ "Return", "the", "most", "recent", "non", "-", "blank", "line", "and", "its", "line", "number", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L3853-L3873
[ "def", "GetPreviousNonBlankLine", "(", "clean_lines", ",", "linenum", ")", ":", "prevlinenum", "=", "linenum", "-", "1", "while", "prevlinenum", ">=", "0", ":", "prevline", "=", "clean_lines", ".", "elided", "[", "prevlinenum", "]", "if", "not", "IsBlankLine",...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckTrailingSemicolon
Looks for redundant trailing semicolon. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
third_party/python/cpplint/cpplint.py
def CheckTrailingSemicolon(filename, clean_lines, linenum, error): """Looks for redundant trailing semicolon. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any error...
def CheckTrailingSemicolon(filename, clean_lines, linenum, error): """Looks for redundant trailing semicolon. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any error...
[ "Looks", "for", "redundant", "trailing", "semicolon", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L3995-L4139
[ "def", "CheckTrailingSemicolon", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Block bodies should not be followed by a semicolon. Due to C++11", "# brace initialization, ther...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckEmptyBlockBody
Look for empty loop/conditional body with only a single semicolon. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
third_party/python/cpplint/cpplint.py
def CheckEmptyBlockBody(filename, clean_lines, linenum, error): """Look for empty loop/conditional body with only a single semicolon. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The functio...
def CheckEmptyBlockBody(filename, clean_lines, linenum, error): """Look for empty loop/conditional body with only a single semicolon. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The functio...
[ "Look", "for", "empty", "loop", "/", "conditional", "body", "with", "only", "a", "single", "semicolon", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L4142-L4243
[ "def", "CheckEmptyBlockBody", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "# Search for loop keywords at the beginning of the line. Because only", "# whitespaces are allowed before the keywords, this will also ignore most", "# do-while-loops, since those...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
FindCheckMacro
Find a replaceable CHECK-like macro. Args: line: line to search on. Returns: (macro name, start position), or (None, -1) if no replaceable macro is found.
third_party/python/cpplint/cpplint.py
def FindCheckMacro(line): """Find a replaceable CHECK-like macro. Args: line: line to search on. Returns: (macro name, start position), or (None, -1) if no replaceable macro is found. """ for macro in _CHECK_MACROS: i = line.find(macro) if i >= 0: # Find opening parenthesis. Do a r...
def FindCheckMacro(line): """Find a replaceable CHECK-like macro. Args: line: line to search on. Returns: (macro name, start position), or (None, -1) if no replaceable macro is found. """ for macro in _CHECK_MACROS: i = line.find(macro) if i >= 0: # Find opening parenthesis. Do a r...
[ "Find", "a", "replaceable", "CHECK", "-", "like", "macro", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L4246-L4266
[ "def", "FindCheckMacro", "(", "line", ")", ":", "for", "macro", "in", "_CHECK_MACROS", ":", "i", "=", "line", ".", "find", "(", "macro", ")", "if", "i", ">=", "0", ":", "# Find opening parenthesis. Do a regular expression match here", "# to make sure that we are ma...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckCheck
Checks the use of CHECK and EXPECT macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
third_party/python/cpplint/cpplint.py
def CheckCheck(filename, clean_lines, linenum, error): """Checks the use of CHECK and EXPECT macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. ...
def CheckCheck(filename, clean_lines, linenum, error): """Checks the use of CHECK and EXPECT macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. ...
[ "Checks", "the", "use", "of", "CHECK", "and", "EXPECT", "macros", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L4269-L4384
[ "def", "CheckCheck", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "# Decide the set of replacement macros that should be suggested", "lines", "=", "clean_lines", ".", "elided", "(", "check_macro", ",", "start_pos", ")", "=", "FindCheckM...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckAltTokens
Check alternative keywords being used in boolean expressions. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
third_party/python/cpplint/cpplint.py
def CheckAltTokens(filename, clean_lines, linenum, error): """Check alternative keywords being used in boolean expressions. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call ...
def CheckAltTokens(filename, clean_lines, linenum, error): """Check alternative keywords being used in boolean expressions. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call ...
[ "Check", "alternative", "keywords", "being", "used", "in", "boolean", "expressions", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L4387-L4416
[ "def", "CheckAltTokens", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Avoid preprocessor lines", "if", "Match", "(", "r'^\\s*#'", ",", "line", ")", ":", "retur...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
GetLineWidth
Determines the width of the line in column positions. Args: line: A string, which may be a Unicode string. Returns: The width of the line in column positions, accounting for Unicode combining characters and wide characters.
third_party/python/cpplint/cpplint.py
def GetLineWidth(line): """Determines the width of the line in column positions. Args: line: A string, which may be a Unicode string. Returns: The width of the line in column positions, accounting for Unicode combining characters and wide characters. """ if isinstance(line, unicode): width =...
def GetLineWidth(line): """Determines the width of the line in column positions. Args: line: A string, which may be a Unicode string. Returns: The width of the line in column positions, accounting for Unicode combining characters and wide characters. """ if isinstance(line, unicode): width =...
[ "Determines", "the", "width", "of", "the", "line", "in", "column", "positions", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L4419-L4438
[ "def", "GetLineWidth", "(", "line", ")", ":", "if", "isinstance", "(", "line", ",", "unicode", ")", ":", "width", "=", "0", "for", "uc", "in", "unicodedata", ".", "normalize", "(", "'NFC'", ",", "line", ")", ":", "if", "unicodedata", ".", "east_asian_w...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
_DropCommonSuffixes
Drops common suffixes like _test.cc or -inl.h from filename. For example: >>> _DropCommonSuffixes('foo/foo-inl.h') 'foo/foo' >>> _DropCommonSuffixes('foo/bar/foo.cc') 'foo/bar/foo' >>> _DropCommonSuffixes('foo/foo_internal.h') 'foo/foo' >>> _DropCommonSuffixes('foo/foo_unusualinternal.h')...
third_party/python/cpplint/cpplint.py
def _DropCommonSuffixes(filename): """Drops common suffixes like _test.cc or -inl.h from filename. For example: >>> _DropCommonSuffixes('foo/foo-inl.h') 'foo/foo' >>> _DropCommonSuffixes('foo/bar/foo.cc') 'foo/bar/foo' >>> _DropCommonSuffixes('foo/foo_internal.h') 'foo/foo' >>> _DropCom...
def _DropCommonSuffixes(filename): """Drops common suffixes like _test.cc or -inl.h from filename. For example: >>> _DropCommonSuffixes('foo/foo-inl.h') 'foo/foo' >>> _DropCommonSuffixes('foo/bar/foo.cc') 'foo/bar/foo' >>> _DropCommonSuffixes('foo/foo_internal.h') 'foo/foo' >>> _DropCom...
[ "Drops", "common", "suffixes", "like", "_test", ".", "cc", "or", "-", "inl", ".", "h", "from", "filename", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L4577-L4604
[ "def", "_DropCommonSuffixes", "(", "filename", ")", ":", "for", "suffix", "in", "itertools", ".", "chain", "(", "(", "'%s.%s'", "%", "(", "test_suffix", ".", "lstrip", "(", "'_'", ")", ",", "ext", ")", "for", "test_suffix", ",", "ext", "in", "itertools",...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
_ClassifyInclude
Figures out what kind of header 'include' is. Args: fileinfo: The current file cpplint is running over. A FileInfo instance. include: The path to a #included file. is_system: True if the #include used <> rather than "". Returns: One of the _XXX_HEADER constants. For example: >>> _ClassifyIn...
third_party/python/cpplint/cpplint.py
def _ClassifyInclude(fileinfo, include, is_system): """Figures out what kind of header 'include' is. Args: fileinfo: The current file cpplint is running over. A FileInfo instance. include: The path to a #included file. is_system: True if the #include used <> rather than "". Returns: One of the _...
def _ClassifyInclude(fileinfo, include, is_system): """Figures out what kind of header 'include' is. Args: fileinfo: The current file cpplint is running over. A FileInfo instance. include: The path to a #included file. is_system: True if the #include used <> rather than "". Returns: One of the _...
[ "Figures", "out", "what", "kind", "of", "header", "include", "is", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L4607-L4669
[ "def", "_ClassifyInclude", "(", "fileinfo", ",", "include", ",", "is_system", ")", ":", "# This is a list of all standard c++ header files, except", "# those already checked for above.", "is_cpp_h", "=", "include", "in", "_CPP_HEADERS", "# Headers with C++ extensions shouldn't be c...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckIncludeLine
Check rules that are applicable to #include lines. Strings on #include lines are NOT removed from elided line, to make certain tasks easier. However, to prevent false positives, checks applicable to #include lines in CheckLanguage must be put here. Args: filename: The name of the current file. clean_l...
third_party/python/cpplint/cpplint.py
def CheckIncludeLine(filename, clean_lines, linenum, include_state, error): """Check rules that are applicable to #include lines. Strings on #include lines are NOT removed from elided line, to make certain tasks easier. However, to prevent false positives, checks applicable to #include lines in CheckLanguage m...
def CheckIncludeLine(filename, clean_lines, linenum, include_state, error): """Check rules that are applicable to #include lines. Strings on #include lines are NOT removed from elided line, to make certain tasks easier. However, to prevent false positives, checks applicable to #include lines in CheckLanguage m...
[ "Check", "rules", "that", "are", "applicable", "to", "#include", "lines", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L4673-L4748
[ "def", "CheckIncludeLine", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "include_state", ",", "error", ")", ":", "fileinfo", "=", "FileInfo", "(", "filename", ")", "line", "=", "clean_lines", ".", "lines", "[", "linenum", "]", "# \"include\" shoul...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
_GetTextInside
r"""Retrieves all the text between matching open and close parentheses. Given a string of lines and a regular expression string, retrieve all the text following the expression and between opening punctuation symbols like (, [, or {, and the matching close-punctuation symbol. This properly nested occurrences of...
third_party/python/cpplint/cpplint.py
def _GetTextInside(text, start_pattern): r"""Retrieves all the text between matching open and close parentheses. Given a string of lines and a regular expression string, retrieve all the text following the expression and between opening punctuation symbols like (, [, or {, and the matching close-punctuation sy...
def _GetTextInside(text, start_pattern): r"""Retrieves all the text between matching open and close parentheses. Given a string of lines and a regular expression string, retrieve all the text following the expression and between opening punctuation symbols like (, [, or {, and the matching close-punctuation sy...
[ "r", "Retrieves", "all", "the", "text", "between", "matching", "open", "and", "close", "parentheses", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L4752-L4805
[ "def", "_GetTextInside", "(", "text", ",", "start_pattern", ")", ":", "# TODO(unknown): Audit cpplint.py to see what places could be profitably", "# rewritten to use _GetTextInside (and use inferior regexp matching today).", "# Give opening punctuations to get the matching close-punctuations.", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckLanguage
Checks rules from the 'C++ language rules' section of cppguide.html. Some of these rules are hard to test (function overloading, using uint32 inappropriately), but we do the best we can. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum:...
third_party/python/cpplint/cpplint.py
def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state, nesting_state, error): """Checks rules from the 'C++ language rules' section of cppguide.html. Some of these rules are hard to test (function overloading, using uint32 inappropriately), but we do the best we can. ...
def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state, nesting_state, error): """Checks rules from the 'C++ language rules' section of cppguide.html. Some of these rules are hard to test (function overloading, using uint32 inappropriately), but we do the best we can. ...
[ "Checks", "rules", "from", "the", "C", "++", "language", "rules", "section", "of", "cppguide", ".", "html", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L4837-L4995
[ "def", "CheckLanguage", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "file_extension", ",", "include_state", ",", "nesting_state", ",", "error", ")", ":", "# If the line is empty or consists of entirely a comment, no need to", "# check it.", "line", "=", "cle...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckGlobalStatic
Check for unsafe global or static objects. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
third_party/python/cpplint/cpplint.py
def CheckGlobalStatic(filename, clean_lines, linenum, error): """Check for unsafe global or static objects. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors ...
def CheckGlobalStatic(filename, clean_lines, linenum, error): """Check for unsafe global or static objects. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors ...
[ "Check", "for", "unsafe", "global", "or", "static", "objects", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L4998-L5056
[ "def", "CheckGlobalStatic", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Match two lines at a time to support multiline declarations", "if", "linenum", "+", "1", "<", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckPrintf
Check for printf related issues. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
third_party/python/cpplint/cpplint.py
def CheckPrintf(filename, clean_lines, linenum, error): """Check for printf related issues. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. """ l...
def CheckPrintf(filename, clean_lines, linenum, error): """Check for printf related issues. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. """ l...
[ "Check", "for", "printf", "related", "issues", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L5059-L5085
[ "def", "CheckPrintf", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# When snprintf is used, the second argument shouldn't be a literal.", "match", "=", "Search", "(", "r...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
IsDerivedFunction
Check if current line contains an inherited function. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line contains a function with "override" virt-specifier.
third_party/python/cpplint/cpplint.py
def IsDerivedFunction(clean_lines, linenum): """Check if current line contains an inherited function. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line contains a function with "override" virt-specifier. """ ...
def IsDerivedFunction(clean_lines, linenum): """Check if current line contains an inherited function. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line contains a function with "override" virt-specifier. """ ...
[ "Check", "if", "current", "line", "contains", "an", "inherited", "function", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L5088-L5107
[ "def", "IsDerivedFunction", "(", "clean_lines", ",", "linenum", ")", ":", "# Scan back a few lines for start of current function", "for", "i", "in", "xrange", "(", "linenum", ",", "max", "(", "-", "1", ",", "linenum", "-", "10", ")", ",", "-", "1", ")", ":",...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
IsOutOfLineMethodDefinition
Check if current line contains an out-of-line method definition. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line contains an out-of-line method definition.
third_party/python/cpplint/cpplint.py
def IsOutOfLineMethodDefinition(clean_lines, linenum): """Check if current line contains an out-of-line method definition. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line contains an out-of-line method definition...
def IsOutOfLineMethodDefinition(clean_lines, linenum): """Check if current line contains an out-of-line method definition. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line contains an out-of-line method definition...
[ "Check", "if", "current", "line", "contains", "an", "out", "-", "of", "-", "line", "method", "definition", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L5110-L5123
[ "def", "IsOutOfLineMethodDefinition", "(", "clean_lines", ",", "linenum", ")", ":", "# Scan back a few lines for start of current function", "for", "i", "in", "xrange", "(", "linenum", ",", "max", "(", "-", "1", ",", "linenum", "-", "10", ")", ",", "-", "1", "...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
IsInitializerList
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.
third_party/python/cpplint/cpplint.py
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): """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,...
[ "Check", "if", "current", "line", "is", "inside", "constructor", "initializer", "list", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L5126-L5165
[ "def", "IsInitializerList", "(", "clean_lines", ",", "linenum", ")", ":", "for", "i", "in", "xrange", "(", "linenum", ",", "1", ",", "-", "1", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "i", "]", "if", "i", "==", "linenum", ":", "rem...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckForNonConstReference
Check for non-const references. Separate from CheckLanguage since it scans backwards from current line, instead of scanning forward. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A...
third_party/python/cpplint/cpplint.py
def CheckForNonConstReference(filename, clean_lines, linenum, nesting_state, error): """Check for non-const references. Separate from CheckLanguage since it scans backwards from current line, instead of scanning forward. Args: filename: The name of the current file. clean...
def CheckForNonConstReference(filename, clean_lines, linenum, nesting_state, error): """Check for non-const references. Separate from CheckLanguage since it scans backwards from current line, instead of scanning forward. Args: filename: The name of the current file. clean...
[ "Check", "for", "non", "-", "const", "references", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L5168-L5304
[ "def", "CheckForNonConstReference", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "# Do nothing if there is no '&' on current line.", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "if", "'&'", "n...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckCasts
Various cast related checks. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
third_party/python/cpplint/cpplint.py
def CheckCasts(filename, clean_lines, linenum, error): """Various cast related checks. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. """ line =...
def CheckCasts(filename, clean_lines, linenum, error): """Various cast related checks. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. """ line =...
[ "Various", "cast", "related", "checks", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L5307-L5423
[ "def", "CheckCasts", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Check to see if they're using an conversion function cast.", "# I just try to capture the most common basic t...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckCStyleCast
Checks for a C-style cast by looking for the pattern. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. cast_type: The string for the C++ cast to recommend. This is either reinterpret_cast, static_...
third_party/python/cpplint/cpplint.py
def CheckCStyleCast(filename, clean_lines, linenum, cast_type, pattern, error): """Checks for a C-style cast by looking for the pattern. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. cast_type: The ...
def CheckCStyleCast(filename, clean_lines, linenum, cast_type, pattern, error): """Checks for a C-style cast by looking for the pattern. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. cast_type: The ...
[ "Checks", "for", "a", "C", "-", "style", "cast", "by", "looking", "for", "the", "pattern", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L5426-L5476
[ "def", "CheckCStyleCast", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "cast_type", ",", "pattern", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "match", "=", "Search", "(", "pattern", ",", "line", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
ExpectingFunctionArgs
Checks whether where function type arguments are expected. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if the line at 'linenum' is inside something that expects arguments of function types.
third_party/python/cpplint/cpplint.py
def ExpectingFunctionArgs(clean_lines, linenum): """Checks whether where function type arguments are expected. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if the line at 'linenum' is inside something that expects arguments ...
def ExpectingFunctionArgs(clean_lines, linenum): """Checks whether where function type arguments are expected. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if the line at 'linenum' is inside something that expects arguments ...
[ "Checks", "whether", "where", "function", "type", "arguments", "are", "expected", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L5479-L5498
[ "def", "ExpectingFunctionArgs", "(", "clean_lines", ",", "linenum", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "return", "(", "Match", "(", "r'^\\s*MOCK_(CONST_)?METHOD\\d+(_T)?\\('", ",", "line", ")", "or", "(", "linenum", ">=", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
FilesBelongToSameModule
Check if these two filenames belong to the same module. The concept of a 'module' here is a as follows: foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the same 'module' if they are in the same directory. some/path/public/xyzzy and some/path/internal/xyzzy are also considered to belong to...
third_party/python/cpplint/cpplint.py
def FilesBelongToSameModule(filename_cc, filename_h): """Check if these two filenames belong to the same module. The concept of a 'module' here is a as follows: foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the same 'module' if they are in the same directory. some/path/public/xyzzy and ...
def FilesBelongToSameModule(filename_cc, filename_h): """Check if these two filenames belong to the same module. The concept of a 'module' here is a as follows: foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the same 'module' if they are in the same directory. some/path/public/xyzzy and ...
[ "Check", "if", "these", "two", "filenames", "belong", "to", "the", "same", "module", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L5568-L5623
[ "def", "FilesBelongToSameModule", "(", "filename_cc", ",", "filename_h", ")", ":", "fileinfo_cc", "=", "FileInfo", "(", "filename_cc", ")", "if", "not", "fileinfo_cc", ".", "Extension", "(", ")", ".", "lstrip", "(", "'.'", ")", "in", "GetNonHeaderExtensions", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
UpdateIncludeState
Fill up the include_dict with new includes found from the file. Args: filename: the name of the header to read. include_dict: a dictionary in which the headers are inserted. io: The io factory to use to read the file. Provided for testability. Returns: True if a header was successfully added. Fals...
third_party/python/cpplint/cpplint.py
def UpdateIncludeState(filename, include_dict, io=codecs): """Fill up the include_dict with new includes found from the file. Args: filename: the name of the header to read. include_dict: a dictionary in which the headers are inserted. io: The io factory to use to read the file. Provided for testabilit...
def UpdateIncludeState(filename, include_dict, io=codecs): """Fill up the include_dict with new includes found from the file. Args: filename: the name of the header to read. include_dict: a dictionary in which the headers are inserted. io: The io factory to use to read the file. Provided for testabilit...
[ "Fill", "up", "the", "include_dict", "with", "new", "includes", "found", "from", "the", "file", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L5626-L5650
[ "def", "UpdateIncludeState", "(", "filename", ",", "include_dict", ",", "io", "=", "codecs", ")", ":", "headerfile", "=", "None", "try", ":", "headerfile", "=", "io", ".", "open", "(", "filename", ",", "'r'", ",", "'utf8'", ",", "'replace'", ")", "except...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckMakePairUsesDeduction
Check that make_pair's template arguments are deduced. G++ 4.6 in C++11 mode fails badly if make_pair's template arguments are specified explicitly, and such use isn't intended in any case. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linen...
third_party/python/cpplint/cpplint.py
def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error): """Check that make_pair's template arguments are deduced. G++ 4.6 in C++11 mode fails badly if make_pair's template arguments are specified explicitly, and such use isn't intended in any case. Args: filename: The name of the current fi...
def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error): """Check that make_pair's template arguments are deduced. G++ 4.6 in C++11 mode fails badly if make_pair's template arguments are specified explicitly, and such use isn't intended in any case. Args: filename: The name of the current fi...
[ "Check", "that", "make_pair", "s", "template", "arguments", "are", "deduced", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L5752-L5770
[ "def", "CheckMakePairUsesDeduction", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "match", "=", "_RE_PATTERN_EXPLICIT_MAKEPAIR", ".", "search", "(", "line", ")", "i...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckRedundantVirtual
Check if line contains a redundant "virtual" function-specifier. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
third_party/python/cpplint/cpplint.py
def CheckRedundantVirtual(filename, clean_lines, linenum, error): """Check if line contains a redundant "virtual" function-specifier. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The functio...
def CheckRedundantVirtual(filename, clean_lines, linenum, error): """Check if line contains a redundant "virtual" function-specifier. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The functio...
[ "Check", "if", "line", "contains", "a", "redundant", "virtual", "function", "-", "specifier", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L5773-L5834
[ "def", "CheckRedundantVirtual", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "# Look for \"virtual\" on current line.", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "virtual", "=", "Match", "(", "r'^(.*)(\\bvirtual\...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CheckRedundantOverrideOrFinal
Check if line contains a redundant "override" or "final" virt-specifier. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
third_party/python/cpplint/cpplint.py
def CheckRedundantOverrideOrFinal(filename, clean_lines, linenum, error): """Check if line contains a redundant "override" or "final" virt-specifier. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. er...
def CheckRedundantOverrideOrFinal(filename, clean_lines, linenum, error): """Check if line contains a redundant "override" or "final" virt-specifier. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. er...
[ "Check", "if", "line", "contains", "a", "redundant", "override", "or", "final", "virt", "-", "specifier", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L5837-L5863
[ "def", "CheckRedundantOverrideOrFinal", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "# Look for closing parenthesis nearby. We need one to confirm where", "# the declarator ends and where the virt-specifier starts to avoid", "# false positives.", "line...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
IsBlockInNameSpace
Checks that the new block is directly in a namespace. Args: nesting_state: The _NestingState object that contains info about our state. is_forward_declaration: If the class is a forward declared class. Returns: Whether or not the new block is directly in a namespace.
third_party/python/cpplint/cpplint.py
def IsBlockInNameSpace(nesting_state, is_forward_declaration): """Checks that the new block is directly in a namespace. Args: nesting_state: The _NestingState object that contains info about our state. is_forward_declaration: If the class is a forward declared class. Returns: Whether or not the new b...
def IsBlockInNameSpace(nesting_state, is_forward_declaration): """Checks that the new block is directly in a namespace. Args: nesting_state: The _NestingState object that contains info about our state. is_forward_declaration: If the class is a forward declared class. Returns: Whether or not the new b...
[ "Checks", "that", "the", "new", "block", "is", "directly", "in", "a", "namespace", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L5870-L5886
[ "def", "IsBlockInNameSpace", "(", "nesting_state", ",", "is_forward_declaration", ")", ":", "if", "is_forward_declaration", ":", "return", "len", "(", "nesting_state", ".", "stack", ")", ">=", "1", "and", "(", "isinstance", "(", "nesting_state", ".", "stack", "[...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
ShouldCheckNamespaceIndentation
This method determines if we should apply our namespace indentation check. Args: nesting_state: The current nesting state. is_namespace_indent_item: If we just put a new class on the stack, True. If the top of the stack is not a class, or we did not recently add the class, False. raw_lines_no...
third_party/python/cpplint/cpplint.py
def ShouldCheckNamespaceIndentation(nesting_state, is_namespace_indent_item, raw_lines_no_comments, linenum): """This method determines if we should apply our namespace indentation check. Args: nesting_state: The current nesting state. is_namespace_indent_item: If we jus...
def ShouldCheckNamespaceIndentation(nesting_state, is_namespace_indent_item, raw_lines_no_comments, linenum): """This method determines if we should apply our namespace indentation check. Args: nesting_state: The current nesting state. is_namespace_indent_item: If we jus...
[ "This", "method", "determines", "if", "we", "should", "apply", "our", "namespace", "indentation", "check", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L5889-L5916
[ "def", "ShouldCheckNamespaceIndentation", "(", "nesting_state", ",", "is_namespace_indent_item", ",", "raw_lines_no_comments", ",", "linenum", ")", ":", "is_forward_declaration", "=", "IsForwardClassDeclaration", "(", "raw_lines_no_comments", ",", "linenum", ")", "if", "not...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
FlagCxx14Features
Flag those C++14 features that we restrict. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
third_party/python/cpplint/cpplint.py
def FlagCxx14Features(filename, clean_lines, linenum, error): """Flag those C++14 features that we restrict. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors...
def FlagCxx14Features(filename, clean_lines, linenum, error): """Flag those C++14 features that we restrict. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors...
[ "Flag", "those", "C", "++", "14", "features", "that", "we", "restrict", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L6022-L6038
[ "def", "FlagCxx14Features", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "include", "=", "Match", "(", "r'\\s*#\\s*include\\s+[<\"]([^<\"]+)[\">]'", ",", "line", ")",...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
ProcessFileData
Performs lint checks and reports any errors to the given error function. Args: filename: Filename of the file that is being processed. file_extension: The extension (dot not included) of the file. lines: An array of strings, each representing a line of the file, with the last element being emp...
third_party/python/cpplint/cpplint.py
def ProcessFileData(filename, file_extension, lines, error, extra_check_functions=None): """Performs lint checks and reports any errors to the given error function. Args: filename: Filename of the file that is being processed. file_extension: The extension (dot not included) of the file...
def ProcessFileData(filename, file_extension, lines, error, extra_check_functions=None): """Performs lint checks and reports any errors to the given error function. Args: filename: Filename of the file that is being processed. file_extension: The extension (dot not included) of the file...
[ "Performs", "lint", "checks", "and", "reports", "any", "errors", "to", "the", "given", "error", "function", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L6041-L6090
[ "def", "ProcessFileData", "(", "filename", ",", "file_extension", ",", "lines", ",", "error", ",", "extra_check_functions", "=", "None", ")", ":", "lines", "=", "(", "[", "'// marker so line numbers and indices both start at 1'", "]", "+", "lines", "+", "[", "'// ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
ProcessConfigOverrides
Loads the configuration files and processes the config overrides. Args: filename: The name of the file being processed by the linter. Returns: False if the current |filename| should not be processed further.
third_party/python/cpplint/cpplint.py
def ProcessConfigOverrides(filename): """ Loads the configuration files and processes the config overrides. Args: filename: The name of the file being processed by the linter. Returns: False if the current |filename| should not be processed further. """ abs_filename = os.path.abspath(filename) cf...
def ProcessConfigOverrides(filename): """ Loads the configuration files and processes the config overrides. Args: filename: The name of the file being processed by the linter. Returns: False if the current |filename| should not be processed further. """ abs_filename = os.path.abspath(filename) cf...
[ "Loads", "the", "configuration", "files", "and", "processes", "the", "config", "overrides", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L6092-L6185
[ "def", "ProcessConfigOverrides", "(", "filename", ")", ":", "abs_filename", "=", "os", ".", "path", ".", "abspath", "(", "filename", ")", "cfg_filters", "=", "[", "]", "keep_looking", "=", "True", "while", "keep_looking", ":", "abs_path", ",", "base_name", "...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
ProcessFile
Does google-lint on a single file. Args: filename: The name of the file to parse. vlevel: The level of errors to report. Every error of confidence >= verbose_level will be reported. 0 is a good default. extra_check_functions: An array of additional check functions that will be ...
third_party/python/cpplint/cpplint.py
def ProcessFile(filename, vlevel, extra_check_functions=None): """Does google-lint on a single file. Args: filename: The name of the file to parse. vlevel: The level of errors to report. Every error of confidence >= verbose_level will be reported. 0 is a good default. extra_check_functions: An ...
def ProcessFile(filename, vlevel, extra_check_functions=None): """Does google-lint on a single file. Args: filename: The name of the file to parse. vlevel: The level of errors to report. Every error of confidence >= verbose_level will be reported. 0 is a good default. extra_check_functions: An ...
[ "Does", "google", "-", "lint", "on", "a", "single", "file", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L6188-L6282
[ "def", "ProcessFile", "(", "filename", ",", "vlevel", ",", "extra_check_functions", "=", "None", ")", ":", "_SetVerboseLevel", "(", "vlevel", ")", "_BackupFilters", "(", ")", "if", "not", "ProcessConfigOverrides", "(", "filename", ")", ":", "_RestoreFilters", "(...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
PrintCategories
Prints a list of all the error-categories used by error messages. These are the categories used to filter messages via --filter.
third_party/python/cpplint/cpplint.py
def PrintCategories(): """Prints a list of all the error-categories used by error messages. These are the categories used to filter messages via --filter. """ sys.stderr.write(''.join(' %s\n' % cat for cat in _ERROR_CATEGORIES)) sys.exit(0)
def PrintCategories(): """Prints a list of all the error-categories used by error messages. These are the categories used to filter messages via --filter. """ sys.stderr.write(''.join(' %s\n' % cat for cat in _ERROR_CATEGORIES)) sys.exit(0)
[ "Prints", "a", "list", "of", "all", "the", "error", "-", "categories", "used", "by", "error", "messages", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L6299-L6305
[ "def", "PrintCategories", "(", ")", ":", "sys", ".", "stderr", ".", "write", "(", "''", ".", "join", "(", "' %s\\n'", "%", "cat", "for", "cat", "in", "_ERROR_CATEGORIES", ")", ")", "sys", ".", "exit", "(", "0", ")" ]
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
ParseArguments
Parses the command line arguments. This may set the output format and verbosity level as side-effects. Args: args: The command line arguments: Returns: The list of filenames to lint.
third_party/python/cpplint/cpplint.py
def ParseArguments(args): """Parses the command line arguments. This may set the output format and verbosity level as side-effects. Args: args: The command line arguments: Returns: The list of filenames to lint. """ try: (opts, filenames) = getopt.getopt(args, '', ['help', 'output=', 'verbose...
def ParseArguments(args): """Parses the command line arguments. This may set the output format and verbosity level as side-effects. Args: args: The command line arguments: Returns: The list of filenames to lint. """ try: (opts, filenames) = getopt.getopt(args, '', ['help', 'output=', 'verbose...
[ "Parses", "the", "command", "line", "arguments", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L6308-L6407
[ "def", "ParseArguments", "(", "args", ")", ":", "try", ":", "(", "opts", ",", "filenames", ")", "=", "getopt", ".", "getopt", "(", "args", ",", "''", ",", "[", "'help'", ",", "'output='", ",", "'verbose='", ",", "'counting='", ",", "'filter='", ",", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
_ExpandDirectories
Searches a list of filenames and replaces directories in the list with all files descending from those directories. Files with extensions not in the valid extensions list are excluded. Args: filenames: A list of files or directories Returns: A list of all files that are members of filenames or descend...
third_party/python/cpplint/cpplint.py
def _ExpandDirectories(filenames): """Searches a list of filenames and replaces directories in the list with all files descending from those directories. Files with extensions not in the valid extensions list are excluded. Args: filenames: A list of files or directories Returns: A list of all files ...
def _ExpandDirectories(filenames): """Searches a list of filenames and replaces directories in the list with all files descending from those directories. Files with extensions not in the valid extensions list are excluded. Args: filenames: A list of files or directories Returns: A list of all files ...
[ "Searches", "a", "list", "of", "filenames", "and", "replaces", "directories", "in", "the", "list", "with", "all", "files", "descending", "from", "those", "directories", ".", "Files", "with", "extensions", "not", "in", "the", "valid", "extensions", "list", "are...
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L6409-L6439
[ "def", "_ExpandDirectories", "(", "filenames", ")", ":", "expanded", "=", "set", "(", ")", "for", "filename", "in", "filenames", ":", "if", "not", "os", ".", "path", ".", "isdir", "(", "filename", ")", ":", "expanded", ".", "add", "(", "filename", ")",...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
_FilterExcludedFiles
Filters out files listed in the --exclude command line switch. File paths in the switch are evaluated relative to the current working directory
third_party/python/cpplint/cpplint.py
def _FilterExcludedFiles(filenames): """Filters out files listed in the --exclude command line switch. File paths in the switch are evaluated relative to the current working directory """ exclude_paths = [os.path.abspath(f) for f in _excludes] return [f for f in filenames if os.path.abspath(f) not in exclude_...
def _FilterExcludedFiles(filenames): """Filters out files listed in the --exclude command line switch. File paths in the switch are evaluated relative to the current working directory """ exclude_paths = [os.path.abspath(f) for f in _excludes] return [f for f in filenames if os.path.abspath(f) not in exclude_...
[ "Filters", "out", "files", "listed", "in", "the", "--", "exclude", "command", "line", "switch", ".", "File", "paths", "in", "the", "switch", "are", "evaluated", "relative", "to", "the", "current", "working", "directory" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L6441-L6446
[ "def", "_FilterExcludedFiles", "(", "filenames", ")", ":", "exclude_paths", "=", "[", "os", ".", "path", ".", "abspath", "(", "f", ")", "for", "f", "in", "_excludes", "]", "return", "[", "f", "for", "f", "in", "filenames", "if", "os", ".", "path", "....
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
_IncludeState.FindHeader
Check if a header has already been included. Args: header: header to check. Returns: Line number of previous occurrence, or -1 if the header has not been seen before.
third_party/python/cpplint/cpplint.py
def FindHeader(self, header): """Check if a header has already been included. Args: header: header to check. Returns: Line number of previous occurrence, or -1 if the header has not been seen before. """ for section_list in self.include_list: for f in section_list: i...
def FindHeader(self, header): """Check if a header has already been included. Args: header: header to check. Returns: Line number of previous occurrence, or -1 if the header has not been seen before. """ for section_list in self.include_list: for f in section_list: i...
[ "Check", "if", "a", "header", "has", "already", "been", "included", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L838-L851
[ "def", "FindHeader", "(", "self", ",", "header", ")", ":", "for", "section_list", "in", "self", ".", "include_list", ":", "for", "f", "in", "section_list", ":", "if", "f", "[", "0", "]", "==", "header", ":", "return", "f", "[", "1", "]", "return", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
_IncludeState.ResetSection
Reset section checking for preprocessor directive. Args: directive: preprocessor directive (e.g. "if", "else").
third_party/python/cpplint/cpplint.py
def ResetSection(self, directive): """Reset section checking for preprocessor directive. Args: directive: preprocessor directive (e.g. "if", "else"). """ # The name of the current section. self._section = self._INITIAL_SECTION # The path of last found header. self._last_header = '' ...
def ResetSection(self, directive): """Reset section checking for preprocessor directive. Args: directive: preprocessor directive (e.g. "if", "else"). """ # The name of the current section. self._section = self._INITIAL_SECTION # The path of last found header. self._last_header = '' ...
[ "Reset", "section", "checking", "for", "preprocessor", "directive", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L853-L869
[ "def", "ResetSection", "(", "self", ",", "directive", ")", ":", "# The name of the current section.", "self", ".", "_section", "=", "self", ".", "_INITIAL_SECTION", "# The path of last found header.", "self", ".", "_last_header", "=", "''", "# Update list of includes. No...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
_IncludeState.IsInAlphabeticalOrder
Check if a header is in alphabetical order with the previous header. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. header_path: Canonicalized header to be checked. Returns: Returns true if the header is in alphabetical order.
third_party/python/cpplint/cpplint.py
def IsInAlphabeticalOrder(self, clean_lines, linenum, header_path): """Check if a header is in alphabetical order with the previous header. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. header_path: Canonicalized header to be checke...
def IsInAlphabeticalOrder(self, clean_lines, linenum, header_path): """Check if a header is in alphabetical order with the previous header. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. header_path: Canonicalized header to be checke...
[ "Check", "if", "a", "header", "is", "in", "alphabetical", "order", "with", "the", "previous", "header", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L889-L908
[ "def", "IsInAlphabeticalOrder", "(", "self", ",", "clean_lines", ",", "linenum", ",", "header_path", ")", ":", "# If previous section is different from current section, _last_header will", "# be reset to empty string, so it's always less than current header.", "#", "# If previous line ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
_IncludeState.CheckNextIncludeOrder
Returns a non-empty error message if the next header is out of order. This function also updates the internal state to be ready to check the next include. Args: header_type: One of the _XXX_HEADER constants defined above. Returns: The empty string if the header is in the right order, or a...
third_party/python/cpplint/cpplint.py
def CheckNextIncludeOrder(self, header_type): """Returns a non-empty error message if the next header is out of order. This function also updates the internal state to be ready to check the next include. Args: header_type: One of the _XXX_HEADER constants defined above. Returns: The e...
def CheckNextIncludeOrder(self, header_type): """Returns a non-empty error message if the next header is out of order. This function also updates the internal state to be ready to check the next include. Args: header_type: One of the _XXX_HEADER constants defined above. Returns: The e...
[ "Returns", "a", "non", "-", "empty", "error", "message", "if", "the", "next", "header", "is", "out", "of", "order", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L910-L961
[ "def", "CheckNextIncludeOrder", "(", "self", ",", "header_type", ")", ":", "error_message", "=", "(", "'Found %s after %s'", "%", "(", "self", ".", "_TYPE_NAMES", "[", "header_type", "]", ",", "self", ".", "_SECTION_NAMES", "[", "self", ".", "_section", "]", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
_CppLintState.SetVerboseLevel
Sets the module's verbosity, and returns the previous setting.
third_party/python/cpplint/cpplint.py
def SetVerboseLevel(self, level): """Sets the module's verbosity, and returns the previous setting.""" last_verbose_level = self.verbose_level self.verbose_level = level return last_verbose_level
def SetVerboseLevel(self, level): """Sets the module's verbosity, and returns the previous setting.""" last_verbose_level = self.verbose_level self.verbose_level = level return last_verbose_level
[ "Sets", "the", "module", "s", "verbosity", "and", "returns", "the", "previous", "setting", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L993-L997
[ "def", "SetVerboseLevel", "(", "self", ",", "level", ")", ":", "last_verbose_level", "=", "self", ".", "verbose_level", "self", ".", "verbose_level", "=", "level", "return", "last_verbose_level" ]
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
_CppLintState.AddFilters
Adds more filters to the existing list of error-message filters.
third_party/python/cpplint/cpplint.py
def AddFilters(self, filters): """ Adds more filters to the existing list of error-message filters. """ for filt in filters.split(','): clean_filt = filt.strip() if clean_filt: self.filters.append(clean_filt) for filt in self.filters: if not (filt.startswith('+') or filt.startswith...
def AddFilters(self, filters): """ Adds more filters to the existing list of error-message filters. """ for filt in filters.split(','): clean_filt = filt.strip() if clean_filt: self.filters.append(clean_filt) for filt in self.filters: if not (filt.startswith('+') or filt.startswith...
[ "Adds", "more", "filters", "to", "the", "existing", "list", "of", "error", "-", "message", "filters", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1021-L1030
[ "def", "AddFilters", "(", "self", ",", "filters", ")", ":", "for", "filt", "in", "filters", ".", "split", "(", "','", ")", ":", "clean_filt", "=", "filt", ".", "strip", "(", ")", "if", "clean_filt", ":", "self", ".", "filters", ".", "append", "(", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
_CppLintState.IncrementErrorCount
Bumps the module's error statistic.
third_party/python/cpplint/cpplint.py
def IncrementErrorCount(self, category): """Bumps the module's error statistic.""" self.error_count += 1 if self.counting in ('toplevel', 'detailed'): if self.counting != 'detailed': category = category.split('/')[0] if category not in self.errors_by_category: self.errors_by_cate...
def IncrementErrorCount(self, category): """Bumps the module's error statistic.""" self.error_count += 1 if self.counting in ('toplevel', 'detailed'): if self.counting != 'detailed': category = category.split('/')[0] if category not in self.errors_by_category: self.errors_by_cate...
[ "Bumps", "the", "module", "s", "error", "statistic", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1045-L1053
[ "def", "IncrementErrorCount", "(", "self", ",", "category", ")", ":", "self", ".", "error_count", "+=", "1", "if", "self", ".", "counting", "in", "(", "'toplevel'", ",", "'detailed'", ")", ":", "if", "self", ".", "counting", "!=", "'detailed'", ":", "cat...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
_CppLintState.PrintErrorCounts
Print a summary of errors by category, and the total.
third_party/python/cpplint/cpplint.py
def PrintErrorCounts(self): """Print a summary of errors by category, and the total.""" for category, count in sorted(iteritems(self.errors_by_category)): self.PrintInfo('Category \'%s\' errors found: %d\n' % (category, count)) if self.error_count > 0: self.PrintInfo('Tota...
def PrintErrorCounts(self): """Print a summary of errors by category, and the total.""" for category, count in sorted(iteritems(self.errors_by_category)): self.PrintInfo('Category \'%s\' errors found: %d\n' % (category, count)) if self.error_count > 0: self.PrintInfo('Tota...
[ "Print", "a", "summary", "of", "errors", "by", "category", "and", "the", "total", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1055-L1061
[ "def", "PrintErrorCounts", "(", "self", ")", ":", "for", "category", ",", "count", "in", "sorted", "(", "iteritems", "(", "self", ".", "errors_by_category", ")", ")", ":", "self", ".", "PrintInfo", "(", "'Category \\'%s\\' errors found: %d\\n'", "%", "(", "cat...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
_FunctionState.Begin
Start analyzing function body. Args: function_name: The name of the function being tracked.
third_party/python/cpplint/cpplint.py
def Begin(self, function_name): """Start analyzing function body. Args: function_name: The name of the function being tracked. """ self.in_a_function = True self.lines_in_function = 0 self.current_function = function_name
def Begin(self, function_name): """Start analyzing function body. Args: function_name: The name of the function being tracked. """ self.in_a_function = True self.lines_in_function = 0 self.current_function = function_name
[ "Start", "analyzing", "function", "body", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1197-L1205
[ "def", "Begin", "(", "self", ",", "function_name", ")", ":", "self", ".", "in_a_function", "=", "True", "self", ".", "lines_in_function", "=", "0", "self", ".", "current_function", "=", "function_name" ]
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
FileInfo.RepositoryName
r"""FullName after removing the local path to the repository. If we have a real absolute path name here we can try to do something smart: detecting the root of the checkout and truncating /path/to/checkout from the name so that we get header guards that don't include things like "C:\Documents and Setti...
third_party/python/cpplint/cpplint.py
def RepositoryName(self): r"""FullName after removing the local path to the repository. If we have a real absolute path name here we can try to do something smart: detecting the root of the checkout and truncating /path/to/checkout from the name so that we get header guards that don't include things li...
def RepositoryName(self): r"""FullName after removing the local path to the repository. If we have a real absolute path name here we can try to do something smart: detecting the root of the checkout and truncating /path/to/checkout from the name so that we get header guards that don't include things li...
[ "r", "FullName", "after", "removing", "the", "local", "path", "to", "the", "repository", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1264-L1322
[ "def", "RepositoryName", "(", "self", ")", ":", "fullname", "=", "self", ".", "FullName", "(", ")", "if", "os", ".", "path", ".", "exists", "(", "fullname", ")", ":", "project_dir", "=", "os", ".", "path", ".", "dirname", "(", "fullname", ")", "# If ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
FileInfo.Split
Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension).
third_party/python/cpplint/cpplint.py
def Split(self): """Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension). """ googlename = self.RepositoryName() project, rest = os...
def Split(self): """Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension). """ googlename = self.RepositoryName() project, rest = os...
[ "Splits", "the", "file", "into", "the", "directory", "basename", "and", "extension", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1324-L1336
[ "def", "Split", "(", "self", ")", ":", "googlename", "=", "self", ".", "RepositoryName", "(", ")", "project", ",", "rest", "=", "os", ".", "path", ".", "split", "(", "googlename", ")", "return", "(", "project", ",", ")", "+", "os", ".", "path", "."...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
CleansedLines._CollapseStrings
Collapses strings and chars on a line to simple "" or '' blocks. We nix strings first so we're not fooled by text like '"http://"' Args: elided: The line being processed. Returns: The line with collapsed strings.
third_party/python/cpplint/cpplint.py
def _CollapseStrings(elided): """Collapses strings and chars on a line to simple "" or '' blocks. We nix strings first so we're not fooled by text like '"http://"' Args: elided: The line being processed. Returns: The line with collapsed strings. """ if _RE_PATTERN_INCLUDE.match(el...
def _CollapseStrings(elided): """Collapses strings and chars on a line to simple "" or '' blocks. We nix strings first so we're not fooled by text like '"http://"' Args: elided: The line being processed. Returns: The line with collapsed strings. """ if _RE_PATTERN_INCLUDE.match(el...
[ "Collapses", "strings", "and", "chars", "on", "a", "line", "to", "simple", "or", "blocks", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L1622-L1686
[ "def", "_CollapseStrings", "(", "elided", ")", ":", "if", "_RE_PATTERN_INCLUDE", ".", "match", "(", "elided", ")", ":", "return", "elided", "# Remove escaped characters first to make quote/single quote collapsing", "# basic. Things that look like escaped characters shouldn't occur...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
_NamespaceInfo.CheckEnd
Check end of namespace comments.
third_party/python/cpplint/cpplint.py
def CheckEnd(self, filename, clean_lines, linenum, error): """Check end of namespace comments.""" line = clean_lines.raw_lines[linenum] # Check how many lines is enclosed in this namespace. Don't issue # warning for missing namespace comments if there aren't enough # lines. However, do apply chec...
def CheckEnd(self, filename, clean_lines, linenum, error): """Check end of namespace comments.""" line = clean_lines.raw_lines[linenum] # Check how many lines is enclosed in this namespace. Don't issue # warning for missing namespace comments if there aren't enough # lines. However, do apply chec...
[ "Check", "end", "of", "namespace", "comments", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L2447-L2497
[ "def", "CheckEnd", "(", "self", ",", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "raw_lines", "[", "linenum", "]", "# Check how many lines is enclosed in this namespace. Don't issue", "# warning for missing n...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
NestingState.InTemplateArgumentList
Check if current position is inside template argument list. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. pos: position just after the suspected template argument. Returns: True if (linenum, pos) is inside template arguments.
third_party/python/cpplint/cpplint.py
def InTemplateArgumentList(self, clean_lines, linenum, pos): """Check if current position is inside template argument list. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. pos: position just after the suspected template argument. ...
def InTemplateArgumentList(self, clean_lines, linenum, pos): """Check if current position is inside template argument list. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. pos: position just after the suspected template argument. ...
[ "Check", "if", "current", "position", "is", "inside", "template", "argument", "list", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L2581-L2631
[ "def", "InTemplateArgumentList", "(", "self", ",", "clean_lines", ",", "linenum", ",", "pos", ")", ":", "while", "linenum", "<", "clean_lines", ".", "NumLines", "(", ")", ":", "# Find the earliest character that might indicate a template argument", "line", "=", "clean...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
NestingState.UpdatePreprocessor
Update preprocessor stack. We need to handle preprocessors due to classes like this: #ifdef SWIG struct ResultDetailsPageElementExtensionPoint { #else struct ResultDetailsPageElementExtensionPoint : public Extension { #endif We make the following assumptions (good enough for most...
third_party/python/cpplint/cpplint.py
def UpdatePreprocessor(self, line): """Update preprocessor stack. We need to handle preprocessors due to classes like this: #ifdef SWIG struct ResultDetailsPageElementExtensionPoint { #else struct ResultDetailsPageElementExtensionPoint : public Extension { #endif We make the ...
def UpdatePreprocessor(self, line): """Update preprocessor stack. We need to handle preprocessors due to classes like this: #ifdef SWIG struct ResultDetailsPageElementExtensionPoint { #else struct ResultDetailsPageElementExtensionPoint : public Extension { #endif We make the ...
[ "Update", "preprocessor", "stack", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L2633-L2687
[ "def", "UpdatePreprocessor", "(", "self", ",", "line", ")", ":", "if", "Match", "(", "r'^\\s*#\\s*(if|ifdef|ifndef)\\b'", ",", "line", ")", ":", "# Beginning of #if block, save the nesting stack here. The saved", "# stack will allow us to restore the parsing state in the #else cas...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
NestingState.Update
Update nesting state with current line. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
third_party/python/cpplint/cpplint.py
def Update(self, filename, clean_lines, linenum, error): """Update nesting state with current line. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any err...
def Update(self, filename, clean_lines, linenum, error): """Update nesting state with current line. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any err...
[ "Update", "nesting", "state", "with", "current", "line", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L2690-L2852
[ "def", "Update", "(", "self", ",", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Remember top of the previous nesting stack.", "#", "# The stack is always pushed/popped and no...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
NestingState.InnermostClass
Get class info on the top of the stack. Returns: A _ClassInfo object if we are inside a class, or None otherwise.
third_party/python/cpplint/cpplint.py
def InnermostClass(self): """Get class info on the top of the stack. Returns: A _ClassInfo object if we are inside a class, or None otherwise. """ for i in range(len(self.stack), 0, -1): classinfo = self.stack[i - 1] if isinstance(classinfo, _ClassInfo): return classinfo r...
def InnermostClass(self): """Get class info on the top of the stack. Returns: A _ClassInfo object if we are inside a class, or None otherwise. """ for i in range(len(self.stack), 0, -1): classinfo = self.stack[i - 1] if isinstance(classinfo, _ClassInfo): return classinfo r...
[ "Get", "class", "info", "on", "the", "top", "of", "the", "stack", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L2854-L2864
[ "def", "InnermostClass", "(", "self", ")", ":", "for", "i", "in", "range", "(", "len", "(", "self", ".", "stack", ")", ",", "0", ",", "-", "1", ")", ":", "classinfo", "=", "self", ".", "stack", "[", "i", "-", "1", "]", "if", "isinstance", "(", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
NestingState.CheckCompletedBlocks
Checks that all classes and namespaces have been completely parsed. Call this when all lines in a file have been processed. Args: filename: The name of the current file. error: The function to call with any errors found.
third_party/python/cpplint/cpplint.py
def CheckCompletedBlocks(self, filename, error): """Checks that all classes and namespaces have been completely parsed. Call this when all lines in a file have been processed. Args: filename: The name of the current file. error: The function to call with any errors found. """ # Note: Th...
def CheckCompletedBlocks(self, filename, error): """Checks that all classes and namespaces have been completely parsed. Call this when all lines in a file have been processed. Args: filename: The name of the current file. error: The function to call with any errors found. """ # Note: Th...
[ "Checks", "that", "all", "classes", "and", "namespaces", "have", "been", "completely", "parsed", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/third_party/python/cpplint/cpplint.py#L2866-L2885
[ "def", "CheckCompletedBlocks", "(", "self", ",", "filename", ",", "error", ")", ":", "# Note: This test can result in false positives if #ifdef constructs", "# get in the way of brace matching. See the testBuildClass test in", "# cpplint_unittest.py for an example of this.", "for", "obj"...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
Streamlet.map
Return a new Streamlet by applying map_function to each element of this Streamlet.
heronpy/streamlet/streamlet.py
def map(self, map_function): """Return a new Streamlet by applying map_function to each element of this Streamlet. """ from heronpy.streamlet.impl.mapbolt import MapStreamlet map_streamlet = MapStreamlet(map_function, self) self._add_child(map_streamlet) return map_streamlet
def map(self, map_function): """Return a new Streamlet by applying map_function to each element of this Streamlet. """ from heronpy.streamlet.impl.mapbolt import MapStreamlet map_streamlet = MapStreamlet(map_function, self) self._add_child(map_streamlet) return map_streamlet
[ "Return", "a", "new", "Streamlet", "by", "applying", "map_function", "to", "each", "element", "of", "this", "Streamlet", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/streamlet/streamlet.py#L59-L65
[ "def", "map", "(", "self", ",", "map_function", ")", ":", "from", "heronpy", ".", "streamlet", ".", "impl", ".", "mapbolt", "import", "MapStreamlet", "map_streamlet", "=", "MapStreamlet", "(", "map_function", ",", "self", ")", "self", ".", "_add_child", "(",...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
Streamlet.flat_map
Return a new Streamlet by applying map_function to each element of this Streamlet and flattening the result
heronpy/streamlet/streamlet.py
def flat_map(self, flatmap_function): """Return a new Streamlet by applying map_function to each element of this Streamlet and flattening the result """ from heronpy.streamlet.impl.flatmapbolt import FlatMapStreamlet fm_streamlet = FlatMapStreamlet(flatmap_function, self) self._add_child(fm_s...
def flat_map(self, flatmap_function): """Return a new Streamlet by applying map_function to each element of this Streamlet and flattening the result """ from heronpy.streamlet.impl.flatmapbolt import FlatMapStreamlet fm_streamlet = FlatMapStreamlet(flatmap_function, self) self._add_child(fm_s...
[ "Return", "a", "new", "Streamlet", "by", "applying", "map_function", "to", "each", "element", "of", "this", "Streamlet", "and", "flattening", "the", "result" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/streamlet/streamlet.py#L67-L74
[ "def", "flat_map", "(", "self", ",", "flatmap_function", ")", ":", "from", "heronpy", ".", "streamlet", ".", "impl", ".", "flatmapbolt", "import", "FlatMapStreamlet", "fm_streamlet", "=", "FlatMapStreamlet", "(", "flatmap_function", ",", "self", ")", "self", "."...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
Streamlet.filter
Return a new Streamlet containing only the elements that satisfy filter_function
heronpy/streamlet/streamlet.py
def filter(self, filter_function): """Return a new Streamlet containing only the elements that satisfy filter_function """ from heronpy.streamlet.impl.filterbolt import FilterStreamlet filter_streamlet = FilterStreamlet(filter_function, self) self._add_child(filter_streamlet) return filter_strea...
def filter(self, filter_function): """Return a new Streamlet containing only the elements that satisfy filter_function """ from heronpy.streamlet.impl.filterbolt import FilterStreamlet filter_streamlet = FilterStreamlet(filter_function, self) self._add_child(filter_streamlet) return filter_strea...
[ "Return", "a", "new", "Streamlet", "containing", "only", "the", "elements", "that", "satisfy", "filter_function" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/streamlet/streamlet.py#L76-L82
[ "def", "filter", "(", "self", ",", "filter_function", ")", ":", "from", "heronpy", ".", "streamlet", ".", "impl", ".", "filterbolt", "import", "FilterStreamlet", "filter_streamlet", "=", "FilterStreamlet", "(", "filter_function", ",", "self", ")", "self", ".", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
Streamlet.repartition
Return a new Streamlet containing all elements of the this streamlet but having num_partitions partitions. Note that this is different from num_partitions(n) in that new streamlet will be created by the repartition call. If repartiton_function is not None, it is used to decide which parititons (from 0 t...
heronpy/streamlet/streamlet.py
def repartition(self, num_partitions, repartition_function=None): """Return a new Streamlet containing all elements of the this streamlet but having num_partitions partitions. Note that this is different from num_partitions(n) in that new streamlet will be created by the repartition call. If repartiton_...
def repartition(self, num_partitions, repartition_function=None): """Return a new Streamlet containing all elements of the this streamlet but having num_partitions partitions. Note that this is different from num_partitions(n) in that new streamlet will be created by the repartition call. If repartiton_...
[ "Return", "a", "new", "Streamlet", "containing", "all", "elements", "of", "the", "this", "streamlet", "but", "having", "num_partitions", "partitions", ".", "Note", "that", "this", "is", "different", "from", "num_partitions", "(", "n", ")", "in", "that", "new",...
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/streamlet/streamlet.py#L84-L98
[ "def", "repartition", "(", "self", ",", "num_partitions", ",", "repartition_function", "=", "None", ")", ":", "from", "heronpy", ".", "streamlet", ".", "impl", ".", "repartitionbolt", "import", "RepartitionStreamlet", "if", "repartition_function", "is", "None", ":...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
Streamlet.clone
Return num_clones number of streamlets each containing all elements of the current streamlet
heronpy/streamlet/streamlet.py
def clone(self, num_clones): """Return num_clones number of streamlets each containing all elements of the current streamlet """ retval = [] for i in range(num_clones): retval.append(self.repartition(self.get_num_partitions())) return retval
def clone(self, num_clones): """Return num_clones number of streamlets each containing all elements of the current streamlet """ retval = [] for i in range(num_clones): retval.append(self.repartition(self.get_num_partitions())) return retval
[ "Return", "num_clones", "number", "of", "streamlets", "each", "containing", "all", "elements", "of", "the", "current", "streamlet" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/streamlet/streamlet.py#L101-L108
[ "def", "clone", "(", "self", ",", "num_clones", ")", ":", "retval", "=", "[", "]", "for", "i", "in", "range", "(", "num_clones", ")", ":", "retval", ".", "append", "(", "self", ".", "repartition", "(", "self", ".", "get_num_partitions", "(", ")", ")"...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
Streamlet.reduce_by_window
Return a new Streamlet in which each element of this Streamlet are collected over a window defined by window_config and then reduced using the reduce_function reduce_function takes two element at one time and reduces them to one element that is used in the subsequent operations.
heronpy/streamlet/streamlet.py
def reduce_by_window(self, window_config, reduce_function): """Return a new Streamlet in which each element of this Streamlet are collected over a window defined by window_config and then reduced using the reduce_function reduce_function takes two element at one time and reduces them to one element that...
def reduce_by_window(self, window_config, reduce_function): """Return a new Streamlet in which each element of this Streamlet are collected over a window defined by window_config and then reduced using the reduce_function reduce_function takes two element at one time and reduces them to one element that...
[ "Return", "a", "new", "Streamlet", "in", "which", "each", "element", "of", "this", "Streamlet", "are", "collected", "over", "a", "window", "defined", "by", "window_config", "and", "then", "reduced", "using", "the", "reduce_function", "reduce_function", "takes", ...
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/streamlet/streamlet.py#L110-L119
[ "def", "reduce_by_window", "(", "self", ",", "window_config", ",", "reduce_function", ")", ":", "from", "heronpy", ".", "streamlet", ".", "impl", ".", "reducebywindowbolt", "import", "ReduceByWindowStreamlet", "reduce_streamlet", "=", "ReduceByWindowStreamlet", "(", "...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
Streamlet.union
Returns a new Streamlet that consists of elements of both this and other_streamlet
heronpy/streamlet/streamlet.py
def union(self, other_streamlet): """Returns a new Streamlet that consists of elements of both this and other_streamlet """ from heronpy.streamlet.impl.unionbolt import UnionStreamlet union_streamlet = UnionStreamlet(self, other_streamlet) self._add_child(union_streamlet) other_streamlet._add_ch...
def union(self, other_streamlet): """Returns a new Streamlet that consists of elements of both this and other_streamlet """ from heronpy.streamlet.impl.unionbolt import UnionStreamlet union_streamlet = UnionStreamlet(self, other_streamlet) self._add_child(union_streamlet) other_streamlet._add_ch...
[ "Returns", "a", "new", "Streamlet", "that", "consists", "of", "elements", "of", "both", "this", "and", "other_streamlet" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/streamlet/streamlet.py#L122-L129
[ "def", "union", "(", "self", ",", "other_streamlet", ")", ":", "from", "heronpy", ".", "streamlet", ".", "impl", ".", "unionbolt", "import", "UnionStreamlet", "union_streamlet", "=", "UnionStreamlet", "(", "self", ",", "other_streamlet", ")", "self", ".", "_ad...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
Streamlet.transform
Returns a new Streamlet by applying the transform_operator on each element of this streamlet. The transform_function is of the type TransformOperator. Before starting to cycle over the Streamlet, the open function of the transform_operator is called. This allows the transform_operator to do any kind of ini...
heronpy/streamlet/streamlet.py
def transform(self, transform_operator): """Returns a new Streamlet by applying the transform_operator on each element of this streamlet. The transform_function is of the type TransformOperator. Before starting to cycle over the Streamlet, the open function of the transform_operator is called. This all...
def transform(self, transform_operator): """Returns a new Streamlet by applying the transform_operator on each element of this streamlet. The transform_function is of the type TransformOperator. Before starting to cycle over the Streamlet, the open function of the transform_operator is called. This all...
[ "Returns", "a", "new", "Streamlet", "by", "applying", "the", "transform_operator", "on", "each", "element", "of", "this", "streamlet", ".", "The", "transform_function", "is", "of", "the", "type", "TransformOperator", ".", "Before", "starting", "to", "cycle", "ov...
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/streamlet/streamlet.py#L131-L140
[ "def", "transform", "(", "self", ",", "transform_operator", ")", ":", "from", "heronpy", ".", "streamlet", ".", "impl", ".", "transformbolt", "import", "TransformStreamlet", "transform_streamlet", "=", "TransformStreamlet", "(", "transform_operator", ",", "self", ")...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
Streamlet.log
Logs all elements of this streamlet. This returns nothing
heronpy/streamlet/streamlet.py
def log(self): """Logs all elements of this streamlet. This returns nothing """ from heronpy.streamlet.impl.logbolt import LogStreamlet log_streamlet = LogStreamlet(self) self._add_child(log_streamlet) return
def log(self): """Logs all elements of this streamlet. This returns nothing """ from heronpy.streamlet.impl.logbolt import LogStreamlet log_streamlet = LogStreamlet(self) self._add_child(log_streamlet) return
[ "Logs", "all", "elements", "of", "this", "streamlet", ".", "This", "returns", "nothing" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/streamlet/streamlet.py#L142-L148
[ "def", "log", "(", "self", ")", ":", "from", "heronpy", ".", "streamlet", ".", "impl", ".", "logbolt", "import", "LogStreamlet", "log_streamlet", "=", "LogStreamlet", "(", "self", ")", "self", ".", "_add_child", "(", "log_streamlet", ")", "return" ]
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
Streamlet.consume
Calls consume_function for each element of this streamlet. This function returns nothing
heronpy/streamlet/streamlet.py
def consume(self, consume_function): """Calls consume_function for each element of this streamlet. This function returns nothing """ from heronpy.streamlet.impl.consumebolt import ConsumeStreamlet consume_streamlet = ConsumeStreamlet(consume_function, self) self._add_child(consume_streamlet) ret...
def consume(self, consume_function): """Calls consume_function for each element of this streamlet. This function returns nothing """ from heronpy.streamlet.impl.consumebolt import ConsumeStreamlet consume_streamlet = ConsumeStreamlet(consume_function, self) self._add_child(consume_streamlet) ret...
[ "Calls", "consume_function", "for", "each", "element", "of", "this", "streamlet", ".", "This", "function", "returns", "nothing" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/streamlet/streamlet.py#L150-L156
[ "def", "consume", "(", "self", ",", "consume_function", ")", ":", "from", "heronpy", ".", "streamlet", ".", "impl", ".", "consumebolt", "import", "ConsumeStreamlet", "consume_streamlet", "=", "ConsumeStreamlet", "(", "consume_function", ",", "self", ")", "self", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
Streamlet.join
Return a new Streamlet by joining join_streamlet with this streamlet
heronpy/streamlet/streamlet.py
def join(self, join_streamlet, window_config, join_function): """Return a new Streamlet by joining join_streamlet with this streamlet """ from heronpy.streamlet.impl.joinbolt import JoinStreamlet, JoinBolt join_streamlet_result = JoinStreamlet(JoinBolt.INNER, window_config, ...
def join(self, join_streamlet, window_config, join_function): """Return a new Streamlet by joining join_streamlet with this streamlet """ from heronpy.streamlet.impl.joinbolt import JoinStreamlet, JoinBolt join_streamlet_result = JoinStreamlet(JoinBolt.INNER, window_config, ...
[ "Return", "a", "new", "Streamlet", "by", "joining", "join_streamlet", "with", "this", "streamlet" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/streamlet/streamlet.py#L158-L166
[ "def", "join", "(", "self", ",", "join_streamlet", ",", "window_config", ",", "join_function", ")", ":", "from", "heronpy", ".", "streamlet", ".", "impl", ".", "joinbolt", "import", "JoinStreamlet", ",", "JoinBolt", "join_streamlet_result", "=", "JoinStreamlet", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
Streamlet.outer_right_join
Return a new Streamlet by outer right join_streamlet with this streamlet
heronpy/streamlet/streamlet.py
def outer_right_join(self, join_streamlet, window_config, join_function): """Return a new Streamlet by outer right join_streamlet with this streamlet """ from heronpy.streamlet.impl.joinbolt import JoinStreamlet, JoinBolt join_streamlet_result = JoinStreamlet(JoinBolt.OUTER_RIGHT, window_config, ...
def outer_right_join(self, join_streamlet, window_config, join_function): """Return a new Streamlet by outer right join_streamlet with this streamlet """ from heronpy.streamlet.impl.joinbolt import JoinStreamlet, JoinBolt join_streamlet_result = JoinStreamlet(JoinBolt.OUTER_RIGHT, window_config, ...
[ "Return", "a", "new", "Streamlet", "by", "outer", "right", "join_streamlet", "with", "this", "streamlet" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/streamlet/streamlet.py#L168-L176
[ "def", "outer_right_join", "(", "self", ",", "join_streamlet", ",", "window_config", ",", "join_function", ")", ":", "from", "heronpy", ".", "streamlet", ".", "impl", ".", "joinbolt", "import", "JoinStreamlet", ",", "JoinBolt", "join_streamlet_result", "=", "JoinS...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac