def METHOD_NAME() -> CIProvider:
    """Return a CI provider instance for the current environment."""
    provider = None
    import_plugins('ci')
    candidates = sorted(get_subclasses(CIProvider), key=lambda subclass: (subclass.priority, subclass.__name__))
    for candidate in candidates:
        if candidate.is_supported():
            provider = candidate()
            break
    if provider.code:
        display.info('Detected CI provider: %s' % provider.name)
    return provider