def METHOD_NAME(model_data, path, dropna=True):
    """
    If termination condition was not optimal, filters inputs only, and
    warns that results will not be saved.
    """
    os.makedirs(path, exist_ok=False)
    # a MILP model which optimises to within the MIP gap, but does not fully
    # converge on the LP relaxation, may return as 'feasible', not 'optimal'
    if "termination_condition" not in model_data.attrs or model_data.attrs[
        "termination_condition"
    ] in ["optimal", "feasible"]:
        data_vars = model_data.data_vars
    else:
        data_vars = model_data.filter_by_attrs(is_result=0).data_vars
        exceptions.warn(
            "Model termination condition was not optimal, saving inputs only."
        )
    for var_name, var in data_vars.items():
        in_out = "results" if var.attrs["is_result"] else "inputs"
        out_path = os.path.join(path, "{}_{}.csv".format(in_out, var_name))
        if not var.shape:
            series = pd.Series(var.item())
            keep_index = False
        else:
            series = var.to_series()
            keep_index = True
        if dropna:
            series = series.dropna()
        series.to_csv(out_path, header=True, index=keep_index)