code: def either_or(primary, fallback, fallback_includes=None):
      def validator(data):
          schema = primary
          if (
              isinstance(data, Mapping)
              and set(fallback_includes or []) & data.keys()
          ):
              schema = fallback
          return vol.Schema(schema)(data)
  
      return validator
  
file_path: dvc/dvc/schema.py
imports: from collections.abc import Mapping
  from typing import Any, Dict
  import voluptuous
  from dvc import dependency, output
  from dvc.annotations import ANNOTATION_SCHEMA, ARTIFACT_SCHEMA
  from dvc.output import CHECKSUMS_SCHEMA, CLOUD_SCHEMA, DIR_FILES_SCHEMA, META_SCHEMA, Output
  from dvc.parsing import DO_KWD, FOREACH_KWD, MATRIX_KWD, VARS_KWD
  from dvc.stage.params import StageParams
label_desc: Use image node_id 1 for calling a global function with example usage: either_or(primary, fallback, fallback_includes) and returns: validator, vol