# Path: smore/common/config.py
# def parse_args(args=None):


import numpy as np
import random
import torch
import time
import os.path as osp
import torch.multiprocessing as mp
import traceback
import logging
import os
import shutil
import zipfile
import urllib.request as ur
from collections import defaultdict
from functools import wraps
from torch.multiprocessing import Queue
from _thread import start_new_thread
from tqdm import tqdm
from smore.common.config import name_query_dict, query_name_dict

    for query_structure in query_name_dict:
        # if query_name_dict[query_structure] == '2u-DNF':
        #     tmp_structure = ('e', ('r',))
        # elif query_name_dict[query_structure] == 'up-DNF':
        #     tmp_structure = ('e', ('r', 'r'))
        # else:
        #     tmp_structure = query_structure
        query_ent_loc_dict[query_structure] = cal_ent_loc(query_structure, 0)[0]
    return query_ent_loc_dict
       
def list2tuple(l):
    return tuple(list2tuple(x) if type(x)==list else x for x in l)

def tuple2list(t):
    return list(tuple2list(x) if type(x)==tuple else x for x in t)

flatten=lambda l: sum(map(flatten, l),[]) if isinstance(l,tuple) else [l]
flatten_list=lambda l: sum(map(flatten_list, l),[]) if isinstance(l,list) else [l]

def parse_time():
    return time.strftime("%Y.%m.%d-%H:%M:%S", time.localtime())


def set_global_seed(seed):
    torch.manual_seed(seed)
    torch.cuda.manual_seed(seed)
    np.random.seed(seed)
    random.seed(seed)
    torch.backends.cudnn.deterministic=True


# Path: smore/common/config.py
# def parse_args(args=None):


# Path: smore/common/util.py
import numpy as np
import random
import torch
import time
import os.path as osp
import torch.multiprocessing as mp
import traceback
import logging
import os
import shutil
import zipfile
import urllib.request as ur
from collections import defaultdict
from functools import wraps
from torch.multiprocessing import Queue
from _thread import start_new_thread
from tqdm import tqdm
from smore.common.config import name_query_dict, query_name_dict

    for query_structure in query_name_dict:
        # if query_name_dict[query_structure] == '2u-DNF':
        #     tmp_structure = ('e', ('r',))
        # elif query_name_dict[query_structure] == 'up-DNF':
        #     tmp_structure = ('e', ('r', 'r'))
        # else:
        #     tmp_structure = query_structure
        query_ent_loc_dict[query_structure] = cal_ent_loc(query_structure, 0)[0]
    return query_ent_loc_dict
       
def list2tuple(l):
    return tuple(list2tuple(x) if type(x)==list else x for x in l)

def tuple2list(t):
    return list(tuple2list(x) if type(x)==tuple else x for x in t)

flatten=lambda l: sum(map(flatten, l),[]) if isinstance(l,tuple) else [l]
flatten_list=lambda l: sum(map(flatten_list, l),[]) if isinstance(l,list) else [l]

def parse_time():
    return time.strftime("%Y.%m.%d-%H:%M:%S", time.localtime())


def set_global_seed(seed):
    torch.manual_seed(seed)
    torch.cuda.manual_seed(seed)
    np.random.seed(seed)
    random.seed(seed)
    torch.backends.cudnn.deterministic=True


def eval_tuple(arg_return):
