+ Return True if token is present in line and is the first element
+ else returns False."""
+
+ return line[:len(token)] == token
+
+
+def is_nonempty_line(line):
+ """ is_nonempty_line(line) -> bool
+
+ Return False if line is either empty or it has only whitespaces,
+ else return True."""
+ return line != " "*len(line)
+
+
+# Utilities for a list of lines
+def find_token(lines, token, start, end = 0, exact = False):
+ """ find_token(lines, token, start[[, end], exact]) -> int
+
+ Return the lowest line where token is found, and is the first
+ element, in lines[start, end].
+
+ Return -1 on failure."""