code: def expand_path(path: Union[str, Path]) -> Path:
      """Convert relative paths to absolute with resolving user directory."""
      return Path(path).expanduser().resolve()
  
file_path: DeepPavlov/deeppavlov/core/commands/utils.py
imports: import os
  from copy import deepcopy
  from pathlib import Path
  from typing import Any, Union, Dict, TypeVar, Optional
  from deeppavlov.core.common.file import read_json, find_config
  from deeppavlov.core.common.registry import inverted_registry
  from deeppavlov.core.data.utils import get_all_elems_from_json
label_desc: Use image node_id 6 for calling a global function with example usage: expand_path(path) and returns: Path