code: def compile_folder(self, directory, write=True, package=True, *args, **kwargs):
          
          if not isinstance(write, bool) and os.path.isfile(write):
              raise CoconutException("destination path cannot point to a file when compiling a directory")
          filepaths = []
          for dirpath, dirnames, filenames in os.walk(directory):
              if isinstance(write, bool):
                  writedir = write
              else:
                  writedir = os.path.join(write, os.path.relpath(dirpath, directory))
              for filename in filenames:
                  if os.path.splitext(filename)[1] in code_exts:
                      with self.handling_exceptions():
                          destpath = self.compile_file(os.path.join(dirpath, filename), writedir, package, *args, **kwargs)
                          if destpath is not None:
                              filepaths.append(destpath)
              for name in dirnames[:]:
                  if not is_special_dir(name) and name.startswith("."):
                      if logger.verbose:
                          logger.show_tabulated("Skipped directory", name, "(explicitly pass as source to override).")
                      dirnames.remove(name)  # directories removed from dirnames won't appear in further os.walk iterations
          return filepaths
docs: Compile a directory and returns paths to compiled files.