code: def formatannotation(annotation, base_module=None):
      if isinstance(annotation, type):
          if annotation.__module__ in (
              "builtins",
              "__builtin__",
              base_module,
          ):
              return annotation.__name__
          return annotation.__module__ + "." + annotation.__name__
      return repr(annotation)
  
imports: from __future__ import absolute_import, division, print_function
  import itertools
  import functools
  import re
  import types
  import inspect
  from collections import OrderedDict
label_desc: Use image node_id 1 for calling a global function with example usage: formatannotation(annotation, base_module) and returns: repr, unknown, annotation