# Path: sparsereg/model/base.py
# def print_model(coef, input_features, errors=None, intercept=None, error_intercept=None, precision=3, pm="±"):
#     """
# 
#     Args:
#         coef:
#         input_features:
#         errors:
#         intercept:
#         sigma_intercept:
#         precision:
#         pm:
# 
#     Returns:
# 
#     """
# 
#     def term(c, sigma, name):
#         rounded_coef = np.round(c, precision)
#         if rounded_coef == 0 and sigma is None:
#             return ""
#         elif sigma is None:
#             return f"{c:.{precision}f} {name}"
#         elif rounded_coef == 0 and np.round(sigma, precision) == 0:
#             return ""
#         else:
#             return f"({c:.{precision}f} {pm} {sigma:.{precision}f}) {name}"
# 
#     errors = errors if errors is not None else repeat(None)
#     # components = map(term, coef, errors, input_features)
#     components = [term(c, e, i) for c, e, i in zip(coef, errors, input_features)]
#     eq = " + ".join(filter(bool, components))
# 
#     if not eq or intercept or error_intercept is not None:
#         intercept = intercept or 0
#         intercept_str = term(intercept, error_intercept, "").strip()
#         if eq and intercept_str:
#             eq += " + "
#             eq += intercept_str
#         elif not eq:
#             eq = f"{intercept:.{precision}f}"
#     return eq


import pytest
from sparsereg.model.base import print_model



@pytest.mark.parametrize(
    "case, res",
    [

# Path: sparsereg/model/base.py
# def print_model(coef, input_features, errors=None, intercept=None, error_intercept=None, precision=3, pm="±"):
#     """
# 
#     Args:
#         coef:
#         input_features:
#         errors:
#         intercept:
#         sigma_intercept:
#         precision:
#         pm:
# 
#     Returns:
# 
#     """
# 
#     def term(c, sigma, name):
#         rounded_coef = np.round(c, precision)
#         if rounded_coef == 0 and sigma is None:
#             return ""
#         elif sigma is None:
#             return f"{c:.{precision}f} {name}"
#         elif rounded_coef == 0 and np.round(sigma, precision) == 0:
#             return ""
#         else:
#             return f"({c:.{precision}f} {pm} {sigma:.{precision}f}) {name}"
# 
#     errors = errors if errors is not None else repeat(None)
#     # components = map(term, coef, errors, input_features)
#     components = [term(c, e, i) for c, e, i in zip(coef, errors, input_features)]
#     eq = " + ".join(filter(bool, components))
# 
#     if not eq or intercept or error_intercept is not None:
#         intercept = intercept or 0
#         intercept_str = term(intercept, error_intercept, "").strip()
#         if eq and intercept_str:
#             eq += " + "
#             eq += intercept_str
#         elif not eq:
#             eq = f"{intercept:.{precision}f}"
#     return eq


# Path: test/model/test_base.py
import pytest
from sparsereg.model.base import print_model




@pytest.mark.parametrize(
    "case, res",
    [

        (