def get_imported_namespaces(self,<EOL>must_have_imported_data_type=False,<EOL>consider_annotations=False,<EOL>consider_annotation_types=False):<EOL>
imported_namespaces = []<EOL>for imported_namespace, reason in self._imported_namespaces.items():<EOL><INDENT>if must_have_imported_data_type and not reason.data_type:<EOL><INDENT>continue<EOL><DEDENT>if (not consider_annotations) and not (<EOL>reason.data_type or reason.alias or reason.annotation_type<EOL>):<EOL><INDENT>continue<EOL><DEDENT>if (not consider_annotation_types) and not (<EOL>reason.data_type or reason.alias or reason.annotation<EOL>):<EOL><INDENT>continue<EOL><DEDENT>imported_namespaces.append(imported_namespace)<EOL><DEDENT>imported_namespaces.sort(key=lambda n: n.name)<EOL>return imported_namespaces<EOL>
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.