def _version_from_file(lines):
def is_version_line(line):<EOL><INDENT>return line.lower().startswith('<STR_LIT>')<EOL><DEDENT>version_lines = filter(is_version_line, lines)<EOL>line = next(iter(version_lines), '<STR_LIT>')<EOL>_, _, value = line.partition('<STR_LIT::>')<EOL>return safe_version(value.strip()) or None<EOL>
Given an iterable of lines from a Metadata file, return
the value of the Version field, if present, or None otherwise.