code: def fully_qualified_type(argument_type: str) -> str:
      def maybe_optional_type(type: str, is_opt: bool) -> str:
          return f"c10::optional<{type}>" if is_opt else type
  
      opt_match = OPTIONAL_TYPE_PATTERN.match(argument_type)
      is_opt = opt_match is not None
      if opt_match:
          argument_type = argument_type[
              opt_match.start(1) : opt_match.end(1)
          ]
      match = TYPE_PATTERN.match(argument_type)
      if match is None:
          return maybe_optional_type(argument_type, is_opt)
      index = match.start(1)
      qualified_type = (
          f"{argument_type[:index]}at::{argument_type[index:]}"
      )
      return maybe_optional_type(qualified_type, is_opt)
  
file_path: pytorch/tools/autograd/gen_variable_factories.py
imports: import re
  from typing import List, Optional
  import torchgen.api.python
  from torchgen.api import cpp
  from torchgen.api.types import CppSignatureGroup
  from torchgen.context import with_native_function
  from torchgen.gen import parse_native_yaml
  from torchgen.model import NativeFunction, TensorOptionsArguments, Variant
  from torchgen.utils import FileManager, mapMaybe
label_desc: Use image node_id 1 for calling a global function with example usage: fully_qualified_type(argument_type) and returns: maybe_optional_type, unknown, maybe_optional_type