Lines Matching refs:lines

873         lines = doc.expandtabs().split('\n')
877 # Find minimum indentation of any non-blank lines after first line.
879 for line in lines[1:]:
885 if lines:
886 lines[0] = lines[0].lstrip()
888 for i in range(1, len(lines)): lines[i] = lines[i][margin:]
889 # Remove any trailing or leading blank lines.
890 while lines and not lines[-1]:
891 lines.pop()
892 while lines and not lines[0]:
893 lines.pop(0)
894 return '\n'.join(lines)
1048 # decrement by one since lines starts with indexing by zero
1059 or code object. The source code is returned as a list of all the lines
1077 lines = linecache.getlines(file, module.__dict__)
1079 lines = linecache.getlines(file)
1080 if not lines:
1084 return lines, 0
1088 source = ''.join(lines)
1095 return lines, line_number
1114 line = lines[lnum]
1120 return lines, lnum
1124 """Get lines of comments immediately preceding an object's source code.
1129 lines, lnum = findsource(object)
1136 if lines and lines[0][:2] == '#!': start = 1
1137 while start < len(lines) and lines[start].strip() in ('', '#'):
1139 if start < len(lines) and lines[start][:1] == '#':
1142 while end < len(lines) and lines[end][:1] == '#':
1143 comments.append(lines[end].expandtabs())
1149 indent = indentsize(lines[lnum])
1151 if end >= 0 and lines[end].lstrip()[:1] == '#' and \
1152 indentsize(lines[end]) == indent:
1153 comments = [lines[end].expandtabs().lstrip()]
1156 comment = lines[end].expandtabs().lstrip()
1157 while comment[:1] == '#' and indentsize(lines[end]) == indent:
1161 comment = lines[end].expandtabs().lstrip()
1224 def getblock(lines):
1225 """Extract the block of code at the top of the given list of lines."""
1228 tokens = tokenize.generate_tokens(iter(lines).__next__)
1233 return lines[:blockfinder.last]
1236 """Return a list of source lines and starting line number for an object.
1239 or code object. The source code is returned as a list of the lines
1244 lines, lnum = findsource(object)
1249 # for module or frame that corresponds to module, return all source lines
1252 return lines, 0
1254 return getblock(lines[lnum:]), lnum + 1
1262 lines, lnum = getsourcelines(object)
1263 return ''.join(lines)
1666 the current line, the function name, a list of lines of context from
1668 The optional second argument specifies the number of lines of context
1692 lines, lnum = findsource(frame)
1694 lines = index = None
1696 start = max(0, min(start, len(lines) - context))
1697 lines = lines[start:start+context]
1700 lines = index = None
1702 return Traceback(filename, lineno, frame.f_code.co_name, lines,
1727 name, a list of lines of context, and index within the context."""
1740 name, a list of lines of context, and index within the context."""
2121 lines = [l.encode('ascii') for l in signature.split('\n') if l]
2122 generator = iter(lines).__next__