def METHOD_NAME(p):
    params = p.copy()
    for key, item in p.items():
        if hasattr(item, "unit"):
            params[key] = item.value
            params[key + "_unit"] = str(item.unit)
        if hasattr(params[key], "tolist"):  # convert array to list
            params[key] = params[key].tolist()
    return params