'Returns the current thread\'s `IOLoop`.
If an `IOLoop` is currently running or has been marked as
current by `make_current`, returns that instance.  If there is
no current `IOLoop`, returns `IOLoop.instance()` (i.e. the
main thread\'s `IOLoop`, creating one if necessary) if ``instance``
is true.
In general you should use `IOLoop.current` as the default when
constructing an asynchronous object, and use `IOLoop.instance`
when you mean to communicate to the main thread from a different
one.
.. versionchanged:: 4.1
Added ``instance`` argument to control the'

@staticmethod
def current(instance=True):

    current = getattr(IOLoop._current, 'instance', None)
    if ((current is None) and instance):
        return IOLoop.instance()
    return current
