UnboundLocalError: local variable 'g_now_epoch' referenced before assignment