code: def error_if_not_in_dbt_project(func: Callable) -> Callable:
      """Decorator to output an error message and exit if caller is not in a root directory of a dbt project."""
  
      @click.pass_context
      def new_func(ctx: click.core.Context, *args: Any, **kwargs: Any) -> Any:  # type: ignore[misc]
          if not dbt_project_file_exists():
              click.echo(
                  "❌ Unable to locate 'dbt_project.yml' in the current directory\n"
                  "In order to run the MetricFlow CLI, you must be running in the root directory of a working dbt project.\n"
                  "Please check out `https://docs.getdbt.com/reference/commands/init` if you want to get started on building a dbt project."
              )
              exit(1)
          return ctx.invoke(func, *args, **kwargs)
  
      return update_wrapper(new_func, func)
  
file_path: metricflow/metricflow/cli/utils.py
imports: from __future__ import annotations
  import datetime
  import logging
  import pathlib
  import traceback
  from functools import update_wrapper, wraps
  from typing import Any, Callable, List, Optional
  import click
  from dateutil.parser import parse
  import metricflow.cli.custom_click_types
  from metricflow.cli.cli_context import CLIContext
label_desc: Use image node_id 8 for calling a global function with example usage: error_if_not_in_dbt_project(func) and returns: update_wrapper, ctx