code: def extract_nested_type(type_: Any, path: List[str]) -> Any:
      try:
          type_ = unpack_optional(type_)
      except TypeError:
          pass
      if len(path) == 0:
          return type_
      if has_origin(type_, list):
          (element_type,) = type_.__args__
          return extract_nested_type(element_type, path[1:])
      if has_origin(type_, dict):
          _, value_type = type_.__args__
          return extract_nested_type(value_type, path[1:])
      if isclass(type_) and issubclass(type_, Schema):
          child_type = attr.fields_dict(type_)[path[0]].type
          return extract_nested_type(child_type, path[1:])
      raise NotImplementedError("Unknown type %r" % type_)
  
imports: from abc import ABC, abstractmethod
  from enum import Enum
  from inspect import isclass
  from itertools import chain
  from typing import Any, ClassVar, Dict, List, Optional, Sized, Type, TypeVar, Union
  import attr
label_desc: Use image node_id 7 for calling a global function with example usage: extract_nested_type(type_, path) and returns: type_, extract_nested_type, extract_nested_type, extract_nested_type