code: def get_imported_namespaces(self,
                                  must_have_imported_data_type=False,
                                  consider_annotations=False,
                                  consider_annotation_types=False):
          # type: (bool, bool, bool) -> typing.List[ApiNamespace]
          
          imported_namespaces = []
          for imported_namespace, reason in self._imported_namespaces.items():
              if must_have_imported_data_type and not reason.data_type:
                  continue
              if (not consider_annotations) and not (
                      reason.data_type or reason.alias or reason.annotation_type
              ):
                  continue
              if (not consider_annotation_types) and not (
                      reason.data_type or reason.alias or reason.annotation
              ):
                  continue
  
              imported_namespaces.append(imported_namespace)
          imported_namespaces.sort(key=lambda n: n.name)
          return imported_namespaces
docs: Returns a list of Namespace objects. A namespace is a member of this
          list if it is imported by the current namespace and a data type is
          referenced from it. Namespaces are in ASCII order by name.
  
          Args:
              must_have_imported_data_type (bool): If true, result does not
                  include namespaces that were not imported for data types.
              consider_annotations (bool): If false, result does not include
                  namespaces that were only imported for annotations
              consider_annotation_types (bool): If false, result does not
                  include namespaces that were only imported for annotation types.
  
          Returns:
              List[Namespace]: A list of imported namespaces.