code: def rewrite_file_imports(item, vendored_libs):
      
      text = item.read_text(encoding='utf-8')
      for lib in vendored_libs:
          text = re.sub(
              r'(\n\s*)import %s(\n\s*)' % lib,
              r'\1from pythonfinder._vendor import %s\2' % lib,
              text,
          )
          text = re.sub(
              r'(\n\s*)from %s' % lib,
              r'\1from pythonfinder._vendor.%s' % lib,
              text,
          )
      item.write_text(text, encoding='utf-8')
docs: Rewrite 'import xxx' and 'from xxx import' for vendored_libs