import types
import importlib
import inspect


def is_a_cog(module: types.ModuleType) -> bool:
    """Check if the module has a setup function, which implies it's a cog."""
    imported = importlib.import_module(module.name)
    return inspect.isfunction(getattr(imported, "setup", None))