class_docstr: Placeholder tokens to for external code instrumentation
class_docstr_tok: ["Placeholder","tokens","to","for","external","code","instrumentation"]
code: def sub(
      cls, text: str, extension: str, replacers: tp.Dict[str, tp.Any]
  ) -> str:
      found: tp.Set[str] = set()
      kwargs = {
          x: _convert_to_string(y, extension)
          for x, y in replacers.items()
      }
  
      def _replacer(regex: tp.Match[str]) -> str:
          name = regex.group("name")
          if name in found:
              raise RuntimeError(
                  f'Trying to remplace a second time placeholder "{name}"'
              )
          if name not in kwargs:
              raise KeyError(
                  f'Could not find a value for placeholder "{name}"'
              )
          found.add(name)
          return str(kwargs[name])
  
      text = re.sub(cls.pattern, _replacer, text)
      missing = set(kwargs) - found
      if missing:
          raise RuntimeError(
              f"All values have not been consumed: {missing}"
          )
      return text
  
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 5 for calling the Placeholder obj's underlying member method code with example usage: obj.sub(cls, text, extension, replacers) and returns: text, str