class_docstr: Folder with instrumentation tokens, which can be instantiated.
  
  Parameters
  ----------
  folder: str/Path
      the instrumented folder to instantiate
  clean_copy: bool
      whether to create an initial clean temporary copy of the folder in order to avoid
      versioning problems (instantiations are lightweight symlinks in any case).
  
  Caution
  -------
      The clean copy is generally located in /tmp and may not be accessible for
      computation in a cluster. You may want to create a clean copy yourself
      in the folder of your choice, or set the the TemporaryDirectoryCopy class
      (located in instrumentation.instantiate) CLEAN_COPY_DIRECTORY environment
      variable to a shared directory
class_docstr_tok: ["Folder","with","instrumentation","tokens",",","which","can","be","instantiated",".","Parameters","--","--","--","--","--","folder",":","str\/Path","the","instrumented","folder","to","instantiate","clean_copy",":","bool","whether","to","create","an","initial","clean","temporary","copy","of","the","folder","in","order","to","avoid","versioning","problems","(","instantiations","are","lightweight","symlinks","in","any","case",")",".","Caution","--","--","--","-","The","clean","copy","is","generally","located","in","\/tmp","and","may","not","be","accessible","for","computation","in","a","cluster",".","You","may","want","to","create","a","clean","copy","yourself","in","the","folder","of","your","choice",",","or","set","the","the","TemporaryDirectoryCopy","class","(","located","in","instrumentation.instantiate",")","CLEAN_COPY_DIRECTORY","environment","variable","to","a","shared","directory"]
code: def __init__(
      self, folder: tp.Union[Path, str], clean_copy: bool = False
  ) -> None:
      self._clean_copy = None
      self.folder = Path(folder).expanduser().absolute()
      assert self.folder.exists(), f"{folder} does not seem to exist"
      if clean_copy:
          self._clean_copy = utils.TemporaryDirectoryCopy(str(folder))
          self.folder = self._clean_copy.copyname
      self.file_functions: tp.List[FileTextFunction] = []
      names: tp.Set[str] = set()
      for fp in self.folder.glob(
          "**/*"
      ):  # TODO filter out all hidden files (+ build files?)
          if fp.is_file() and fp.suffix.lower() in COMMENT_CHARS:
              file_func = FileTextFunction(fp)
              fnames = {ph.name for ph in file_func.placeholders}
              if fnames:
                  if fnames & names:
                      raise RuntimeError(
                          f"Found {fp} placeholders in another file (names must be unique): {fnames & names}"
                      )
                  self.file_functions.append(file_func)
      assert self.file_functions, "Found no file with placeholders"
      self.file_functions = sorted(
          self.file_functions, key=operator.attrgetter("filepath")
      )
  
imports: import os
  import re
  import tempfile
  import operator
  import contextlib
  from pathlib import Path
  import numpy
  import nevergrad.common.typing
  from nevergrad.common import testing
  from .None import utils
label_desc: Use image node_id 1 to create a new FolderInstantiator object  with example: obj = FolderInstantiator(folder, clean_copy)