code: def validate_value(value, key):
      from .context import PRIMITIVES
  
      not_primitive = value is not None and not isinstance(
          value, PRIMITIVES
      )
      not_foreach = key is not None and "foreach" not in key
      if not_primitive and not_foreach:
          if isinstance(value, dict) and key == "cmd":
              return True
          raise ParseError(
              f"Cannot interpolate data of type '{type(value).__name__}'"
          )
  
imports: import os
  import re
  import typing
  from collections.abc import Iterable, Mapping
  from functools import singledispatch
  from funcy import memoize, rpartial
  from dvc.exceptions import DvcException
  from dvc.utils.flatten import flatten
label_desc: Use image node_id 17 for calling a global function with example usage: validate_value(value, key) and returns: True