def bg(func):
    """Run a function in background, will not block main thread's exit.(thread.daemon=True)
    ::

        from torequests.utils import bg, print_info
        import time

        def test1(n):
            time.sleep(n)
            print_info(n, 'done')

        @bg
        def test2(n):
            time.sleep(n)
            print_info(n, 'done')

        test3 = bg(test1)

        test2(1)
        test3(1)
        print_info('not be blocked')
        time.sleep(2)

        # [2018-06-12 23:46:19](L81): not be blocked
        # [2018-06-12 23:46:20](L81): 1 done
        # [2018-06-12 23:46:20](L81): 1 done
    """

    @wraps(func)
    def wrapper(*args, **kwargs):
        t = Thread(target=func, args=args, kwargs=kwargs)
        t.daemon = True
        t.start()
        return t

    return wrapper