code: def complete_path(
      path: str,
      extra_search_paths: Optional[List[str]] = None,
      raise_nonexist: bool = True,
  ) -> str:
      """
      Complete the path of file via searching in abs and relative paths.
  
      :param path: path of file.
      :param extra_search_paths: extra paths to conduct search
      :param raise_nonexist: raise exception if the file does not exist
      :return: Completed file path.
      """
      _p = _search_file_in_paths(path, extra_search_paths)
      if _p is None and os.path.exists(path):
          # this checks both abs and relative paths already
          _p = path
      if _p:
          return os.path.abspath(_p)
      elif raise_nonexist:
          raise FileNotFoundError(f"can not find {path}")
      else:
          return path
  
imports: import collections
  import json
  import os
  import urllib.parse
  import urllib.request
  from typing import Any, Dict, List, Optional, TextIO, Tuple, Union
  from yaml import MappingNode
  from yaml.composer import Composer
  from yaml.constructor import ConstructorError, FullConstructor
  from yaml.parser import Parser
  from yaml.reader import Reader
  from yaml.resolver import Resolver
  from yaml.scanner import Scanner
  from jina.excepts import BadConfigSource
  from jina.helper import is_yaml_filepath
  from jina.importer import PathImporter
label_desc: Use image node_id 3 for calling a global function with example usage: complete_path(path, extra_search_paths, raise_nonexist) and returns: os, path