This code block checks if the key 'lamda' is present in the dictionary 'mem'. If it is present, then the value associated with the key 'lamda' in 'mem' is assigned to the key 'lamda' in the dictionary 'dic'. After that, the function 'fit' is called with the arguments passed in 'dic'. The returned values are assigned to different keys in 'mem'. Then, the contents of 'mem' are saved in a numpy file using 'np.save'. Finally, the time taken to run this code block is printed.

# if 'lamda' in mem:
#     dic['lamda'] = mem['lamda']
mem['lamda'],mem['P'],mem['miu'],mem['xx_exp'],mem['xy_exp'],mem['xx_fig'],mem['xy_fig'],mem['f1'],mem['f2'] = fit(**dic)
np.save('./save/%s/%s--%s--%s'%(label,title,T,3), mem)
time_end = time.time()
print(T)
print('time cost:',time_end - time_star,'s')
# sigma_xxdata,sigma_xydata = make_data(Bdata, 2, 10, 1e23, 1e23, noise = 0)
Python Code for Fitting Data and Saving Results