def rewrite_file_imports(item, vendored_libs):
text = item.read_text(encoding='<STR_LIT:utf-8>')<EOL>for lib in vendored_libs:<EOL><INDENT>text = re.sub(<EOL>r'<STR_LIT>' % lib,<EOL>r'<STR_LIT>' % lib,<EOL>text,<EOL>)<EOL>text = re.sub(<EOL>r'<STR_LIT>' % lib,<EOL>r'<STR_LIT>' % lib,<EOL>text,<EOL>)<EOL><DEDENT>item.write_text(text, encoding='<STR_LIT:utf-8>')<EOL>
Rewrite 'import xxx' and 'from xxx import' for vendored_libs