code: def parse_types(func: Callable) -> List[Tuple[Dict[str, str], str]]:
      source = inspect.getsource(func)
      signature = inspect.signature(func)
  
      # Parse `# type: (...) -> ...` annotation. Note that it is allowed to pass
      # multiple `# type:` annotations in `forward()`.
      iterator = re.finditer(
          r"#\s*type:\s*\((.*)\)\s*->\s*(.*)\s*\n", source
      )
      matches = list(iterator)
  
      if len(matches) > 0:
          out = []
          args = list(signature.parameters.keys())
          for match in matches:
              arg_types_repr, return_type = match.groups()
              arg_types = split_types_repr(arg_types_repr)
              arg_types = OrderedDict(
                  (k, v) for k, v in zip(args, arg_types)
              )
              return_type = return_type.split("#")[0].strip()
              out.append((arg_types, return_type))
          return out
  
      # Alternatively, parse annotations using the inspected signature.
      else:
          ps = signature.parameters
          arg_types = OrderedDict(
              (k, param_type_repr(v)) for k, v in ps.items()
          )
          return [(arg_types, return_type_repr(signature))]
  
file_path: AutoGL/autogl/module/nas/space/gasso_space/utils/typing.py
imports: import re
  import inspect
  import pyparsing
  from itertools import product
  from collections import OrderedDict
  from typing import Callable, Tuple, Dict, List
label_desc: Use image node_id 5 for calling a global function with example usage: parse_types(func) and returns: out, list