find_remote_file/re.split
def find_remote_file(data_json, task_name_version, data_type, traj_num, train_or_val):
"""
Find appropriate least dataset in remote (data_json) according to num.
"""
least_num = np.Inf
for k, v in data_json.items():
if task_name_version in k and train_or_val in k and data_type in k:
name_list = re.split("[-.]", k)
for tmp in name_list:
if tmp.isdigit():
num = int(tmp)
import pdb
pdb.set_trace()
if traj_num <= num < least_num:
least_num = num
return least_num
references:
Offlinerl/nerol