class_docstr: Wraps a command as a function in order to make sure it goes through the
  pipeline and notify when it is finished.
  The output is a string containing everything that has been sent to stdout
  
  Parameters
  ----------
  command: list
      command to run, as a list
  verbose: bool
      prints the command and stdout at runtime
  cwd: Path/str
      path to the location where the command must run from
  
  Returns
  -------
  str
     Everything that has been sent to stdout
class_docstr_tok: ["Wraps","a","command","as","a","function","in","order","to","make","sure","it","goes","through","the","pipeline","and","notify","when","it","is","finished",".","The","output","is","a","string","containing","everything","that","has","been","sent","to","stdout","Parameters","--","--","--","--","--","command",":","list","command","to","run",",","as","a","list","verbose",":","bool","prints","the","command","and","stdout","at","runtime","cwd",":","Path\/str","path","to","the","location","where","the","command","must","run","from","Returns","--","--","--","-","str","Everything","that","has","been","sent","to","stdout"]
docstr: Call the cammand line with addidional arguments
  The keyword arguments will be sent as --{key}={val}
  The logs are bufferized. They will be printed if the job fails, or sent as output of the function
  Errors are provided with the internal stderr
docstr_tok: ["Call","the","cammand","line","with","addidional","arguments","The","keyword","arguments","will","be","sent","as","--","{","key","}","=","{","val","}","The","logs","are","bufferized",".","They","will","be","printed","if","the","job","fails",",","or","sent","as","output","of","the","function","Errors","are","provided","with","the","internal","stderr"]
code: def __call__(self, *args: tp.Any, **kwargs: tp.Any) -> str:
      """Call the cammand line with addidional arguments
      The keyword arguments will be sent as --{key}={val}
      The logs are bufferized. They will be printed if the job fails, or sent as output of the function
      Errors are provided with the internal stderr
      """
      # TODO make the following command more robust (probably fails in multiple cases)
      full_command = (
          self.command
          + [str(x) for x in args]
          + ["--{}={}".format(x, y) for x, y in kwargs.items()]
      )
      if self.verbose:
          print(f"The following command is sent: {full_command}")
      outlines: tp.List[str] = []
      with subprocess.Popen(
          full_command,
          stdout=subprocess.PIPE,
          stderr=subprocess.PIPE,
          shell=False,
          cwd=self.cwd,
          env=self.env,
      ) as process:
          try:
              assert process.stdout is not None
              for line in iter(process.stdout.readline, b""):
                  if not line:
                      break
                  outlines.append(line.decode().strip())
                  if self.verbose:
                      print(outlines[-1], flush=True)
          except Exception:  # pylint: disable=broad-except
              process.kill()
              process.wait()
              raise FailedJobError(
                  "Job got killed for an unknown reason."
              )
          stderr = process.communicate()[1]  # we already got stdout
          stdout = "\n".join(outlines)
          retcode = process.poll()
          if stderr and (retcode or self.verbose):
              print(stderr.decode(), file=sys.stderr)
          if retcode:
              subprocess_error = subprocess.CalledProcessError(
                  retcode, process.args, output=stdout, stderr=stderr
              )
              raise FailedJobError(
                  stderr.decode()
              ) from subprocess_error
      return stdout
  
imports: import os
  import sys
  import shutil
  import tempfile
  import subprocess
  from pathlib import Path
  import numpy
  from nevergrad.common import typing
label_desc: Use image node_id 2 for calling the CommandFunction obj's underlying member method code with example usage: obj.__call__() and returns: stdout