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 instantiate_to_folder(
      self, outfolder: tp.Union[Path, str], kwargs: tp.Dict[str, tp.Any]
  ) -> None:
      testing.assert_set_equal(
          kwargs,
          {x.name for x in self.placeholders},
          err_msg="Wrong input parameters.",
      )
      outfolder = Path(outfolder).expanduser().absolute()
      assert (
          outfolder != self.folder
      ), "Do not instantiate on same folder!"
      symlink_folder_tree(self.folder, outfolder)
      for file_func in self.file_functions:
          inst_fp = outfolder / file_func.filepath.relative_to(
              self.folder
          )
          os.remove(
              str(inst_fp)
          )  # remove symlink to avoid writing in original dir
          with inst_fp.open("w") as f:
              f.write(
                  file_func(
                      **{
                          x: y
                          for x, y in kwargs.items()
                          if x in file_func.parameters
                      }
                  )
              )
  
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 4 for calling the FolderInstantiator obj's underlying member method code with example usage: obj.instantiate_to_folder(outfolder, kwargs) without return types