code: def test_placeholder_substitution() -> None:
      text = "bfkes\nsgrdgrgbdrkNG_ARG{truc|blublu}sehn NG_ARG{bidule}"
      expected = "bfkes\nsgrdgrgbdrk'#12#'sehn 24"
      output = Placeholder.sub(
          text, ".py", {"truc": "#12#", "bidule": 24}
      )
      np.testing.assert_equal(output, expected)
      np.testing.assert_raises(
          KeyError, Placeholder.sub, text, ".py", {"truc": "#12#"}
      )
      np.testing.assert_raises(
          RuntimeError,
          Placeholder.sub,
          text,
          ".py",
          {"truc": "#12#", "bidule": 24, "chouette": 2},
      )
      text = "bfkes\nsgrdgrgbdrkNG_ARG{truc|blublu}sehnNG_ARG{bidule}NG_ARG{bidule|bis}"
      np.testing.assert_raises(
          RuntimeError,
          Placeholder.sub,
          text,
          ".py",
          {"truc": "#12#", "bidule": 24},
      )
  
file_path: nevergrad/nevergrad/parametrization/test_instantiate.py
imports: import sys
  import tempfile
  import typing
  from pathlib import Path
  import numpy
  from nevergrad.common import testing
  from .None import instantiate
  from .instantiate import LINETOKEN
  from .instantiate import Placeholder
label_desc: Use image node_id 8 for calling a global function with example usage: test_placeholder_substitution() without return types