code: def parse_target(
      target: str, default: Optional[str] = None, isa_glob: bool = False
  ) -> Tuple[Optional[str], Optional[str]]:
      from dvc.dvcfile import LOCK_FILE, PROJECT_FILE, is_valid_filename
      from dvc.exceptions import DvcException
      from dvc.parsing import JOIN
  
      if not target:
          return None, None
  
      default = default or PROJECT_FILE
      if isa_glob:
          path, _, glob = target.rpartition(":")
          return path or default, glob or None
  
      # look for first "@", so as not to assume too much about stage name
      # eg: it might contain ":" in a generated stages from dict which might
      # affect further parsing with the regex.
      group, _, key = target.partition(JOIN)
      match = TARGET_REGEX.match(group)
  
      if not match:
          return target, None
  
      path, name = (match.group("path"), match.group("name"))
  
      if name and key:
          name += f"{JOIN}{key}"
  
      if path:
          if os.path.basename(path) == LOCK_FILE:
              raise DvcException(
                  "Did you mean: `{}`?".format(
                      target.replace(".lock", ".yaml", 1)
                  )
              )
          if not name:
              ret = (target, None)
              return ret if is_valid_filename(target) else ret[::-1]
      return path or default, name
  
imports: import hashlib
  import json
  import os
  import re
  import sys
  from typing import TYPE_CHECKING, Dict, Iterable, Iterator, List, Optional, Tuple
  import colorama
label_desc: Use image node_id 20 for calling a global function with example usage: parse_target(target, default, isa_glob) and returns: unknown,  name, None,  None, unknown,  unknown, target,  None, unknown