Imports generated from the method.flat_ref_types filter loop need to have # type: ignore added if the imports are from google.api_core. E.g.:
from google.api_core import operation as ga_operation # type: ignore
from google.api_core import operation_async # type: ignore