class_docstr: Turns a folder into a parametrized function
  (with nevergrad tokens)
  
  Parameters
  ----------
  folder: Path/str
      path to the folder to instrument
  command: list
      command to run from inside the folder. The last line in stdout will
      be the output of the function.
      The command must be performed from just outside the instrument
      directory
  verbose: bool
      whether to print the run command and from where it is run.
  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)
  
  Returns
  -------
  Any
      the post-processed output of the called command
  
  Note
  ----
  By default, the postprocessing attribute holds a function which recovers the last line
  and converts it to float. The sequence of postprocessing can however be tampered
  with directly in order to change it
  
  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: ["Turns","a","folder","into","a","parametrized","function","(","with","nevergrad","tokens",")","Parameters","--","--","--","--","--","folder",":","Path\/str","path","to","the","folder","to","instrument","command",":","list","command","to","run","from","inside","the","folder",".","The","last","line","in","stdout","will","be","the","output","of","the","function",".","The","command","must","be","performed","from","just","outside","the","instrument","directory","verbose",":","bool","whether","to","print","the","run","command","and","from","where","it","is","run",".","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",")","Returns","--","--","--","-","Any","the","post-processed","output","of","the","called","command","Note","--","--","By","default",",","the","postprocessing","attribute","holds","a","function","which","recovers","the","last","line","and","converts","it","to","float",".","The","sequence","of","postprocessing","can","however","be","tampered","with","directly","in","order","to","change","it","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 __call__(self, **kwargs: tp.Any) -> tp.Any:
      with self.instantiator.instantiate(**kwargs) as folder:
          if self.verbose:
              print(
                  f"Running {self.command} from {folder.parent} which holds {folder}"
              )
          output: tp.Any = utils.CommandFunction(
              self.command, cwd=folder.parent
          )()
      if self.verbose:
          print(f"FolderFunction recovered full output:\n{output}")
      self.last_full_output = output.strip()
      if not output:
          raise ValueError("No output")
      for postproc in self.postprocessings:
          output = postproc(output)
      if self.verbose:
          print(f"FolderFunction returns: {output}")
      return output
  
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 FolderFunction obj's underlying member method code with example usage: obj.__call__() and returns: output