def is_mainthread(thread=None):
    thread = thread if thread is not None else current_thread()
    return isinstance(thread, threading._MainThread)
Check if thread is the main thread.
dataset/ETHPy150Open quantmind/pulsar/pulsar/async/access.py/is_mainthread