def _resolve_annotation_type(self, env, annotation_ref):
loc = annotation_ref.lineno, annotation_ref.path<EOL>if annotation_ref.ns:<EOL><INDENT>if annotation_ref.ns not in env:<EOL><INDENT>raise InvalidSpec(<EOL>'<STR_LIT>' % quote(annotation_ref.ns), *loc)<EOL><DEDENT>env = env[annotation_ref.ns]<EOL>if not isinstance(env, Environment):<EOL><INDENT>raise InvalidSpec(<EOL>'<STR_LIT>' % quote(annotation_ref.ns), *loc)<EOL><DEDENT><DEDENT>if annotation_ref.annotation not in env:<EOL><INDENT>raise InvalidSpec(<EOL>'<STR_LIT>' % quote(annotation_ref.annotation), *loc)<EOL><DEDENT>return env[annotation_ref.annotation]<EOL>
Resolves the annotation type referenced by annotation_ref.