code: def build(
      spec: FilesSpec,
      prefix: Union[str, TreeMaker] = pathlib.Path(),  # type: ignore
  ):
      """
      Build a set of files/directories, as described by the spec.
  
      Each key represents a pathname, and the value represents
      the content. Content may be a nested directory.
  
      >>> spec = {
      ...     'README.txt': "A README file",
      ...     "foo": {
      ...         "__init__.py": "",
      ...         "bar": {
      ...             "__init__.py": "",
      ...         },
      ...         "baz.py": "# Some code",
      ...         "bar.py": Symlink("baz.py"),
      ...     },
      ...     "bing": Symlink("foo"),
      ... }
      >>> target = getfixture('tmp_path')
      >>> build(spec, target)
      >>> target.joinpath('foo/baz.py').read_text(encoding='utf-8')
      '# Some code'
      >>> target.joinpath('bing/bar.py').read_text(encoding='utf-8')
      '# Some code'
      """
      for name, contents in spec.items():
          create(contents, _ensure_tree_maker(prefix) / name)
  
imports: import functools
  import pathlib
  from typing import Dict, Protocol, Union
  from typing import runtime_checkable
label_desc: Use image node_id 2 for calling a global function with example usage: build(spec, prefix) without return types