def METHOD_NAME(cls, *args, **kwargs):
    """Returns the current thread’s IOLoop.
    """
    # install ZMQIOLoop as the active IOLoop implementation
    # when using tornado 3
    if tornado_version >= (3,):
        PollIOLoop.configure(cls)
    loop = PollIOLoop.METHOD_NAME(*args, **kwargs)
    if not isinstance(loop, cls):
        warnings.warn("IOLoop.current expected instance of %r, got %r" % (cls, loop),
            RuntimeWarning, stacklevel=2,
        )
    return loop