code: def _resolve_annotation_type(self, env, annotation_ref):
          
          loc = annotation_ref.lineno, annotation_ref.path
          if annotation_ref.ns:
              if annotation_ref.ns not in env:
                  raise InvalidSpec(
                      'Namespace %s is not imported' % quote(annotation_ref.ns), *loc)
              env = env[annotation_ref.ns]
              if not isinstance(env, Environment):
                  raise InvalidSpec(
                      '%s is not a namespace.' % quote(annotation_ref.ns), *loc)
  
          if annotation_ref.annotation not in env:
              raise InvalidSpec(
                  'Annotation %s does not exist.' % quote(annotation_ref.annotation), *loc)
  
          return env[annotation_ref.annotation]
docs: Resolves the annotation type referenced by annotation_ref.