code: def get_folder_modules(folder, parentpackage):
      
      if check_writable_by_others(folder):
          print("ERROR: refuse to load modules from world writable folder %r" % folder)
          return
      for filename in get_importable_files(folder):
          fullname = os.path.join(folder, filename)
          modname = parentpackage+"."+filename[:-3]
          try:
              yield imp.load_source(modname, fullname)
          except ImportError as msg:
              print("WARN: could not load file %s: %s" % (fullname, msg))
docs: .