def get_requirements(requirements_file):
lines = open(requirements_file).readlines()<EOL>dependencies = []<EOL>dependency_links = []<EOL>for line in lines:<EOL><INDENT>package = line.strip()<EOL>if package.startswith('<STR_LIT:#>'):<EOL><INDENT>continue<EOL><DEDENT>if any(package.startswith(prefix) for prefix in VCS_PREFIXES):<EOL><INDENT>package_link, __, package = package.rpartition('<STR_LIT:#>')<EOL>package_link = re.sub(r'<STR_LIT>', r'<STR_LIT>', package_link)<EOL>package = re.sub(r'<STR_LIT>', r'<STR_LIT>', package)<EOL>package_version = re.sub(r'<STR_LIT>', '<STR_LIT>', line.strip())<EOL>if package:<EOL><INDENT>dependency_links.append(<EOL>'<STR_LIT>'.format(<EOL>package_link=package_link,<EOL>package=package,<EOL>package_version=package_version,<EOL>)<EOL>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>package, __, __ = package.partition('<STR_LIT:#>')<EOL>package = package.strip()<EOL><DEDENT>if package:<EOL><INDENT>dependencies.append(package)<EOL><DEDENT><DEDENT>return dependencies, dependency_links<EOL>
Get the contents of a file listing the requirements