code: def _construct_dir_placeholder(
      config: MkDocsConfig,
      loader: yaml.BaseLoader,
      node: yaml.ScalarNode,
  ) -> _DirPlaceholder:
      loader.construct_scalar(node)
  
      value: str = (node and node.value) or ""
      prefix, _, suffix = value.partition("/")
      if prefix.startswith("$"):
          if prefix == "$config_dir":
              return ConfigDirPlaceholder(config, suffix)
          elif prefix == "$docs_dir":
              return DocsDirPlaceholder(config, suffix)
          else:
              raise exceptions.ConfigurationError(
                  f"Unknown prefix {prefix!r} in {node.tag} {node.value!r}"
              )
      else:
          return RelativeDirPlaceholder(config, value)
  
imports: from __future__ import annotations
  import functools
  import logging
  import os
  import os.path
  from typing import IO, TYPE_CHECKING, Any
  import mergedeep
  import yaml
  import yaml.constructor
  import yaml_env_tag
  from mkdocs import exceptions
label_desc: Use image node_id 1 for calling a global function with example usage: _construct_dir_placeholder(config, loader, node) and returns: RelativeDirPlaceholder, ConfigDirPlaceholder, DocsDirPlaceholder