code: def check_for_nested_dvc_repo(dvcfile: Path):
      from dvc.repo import Repo
  
      if dvcfile.is_absolute():
          raise InvalidArgumentError("Use relative path to dvc.yaml.")
      path = dvcfile.parent
      while path.name:
          if (path / Repo.DVC_DIR).is_dir():
              raise InvalidArgumentError(
                  f"Nested DVC repos like {path} are not supported."
              )
          path = path.parent
  
imports: import os
  import posixpath
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union
  from dvc.annotations import Artifact
  from dvc.dvcfile import PROJECT_FILE
  from dvc.exceptions import ArtifactNotFoundError, DvcException, FileExistsLocallyError, InvalidArgumentError
  from dvc.log import logger
  from dvc.utils import relpath, resolve_output
  from dvc.utils.objects import cached_property
  from dvc.utils.serialize import modify_yaml
label_desc: Use image node_id 3 for calling a global function with example usage: check_for_nested_dvc_repo(dvcfile) without return types