# Path: bambi/utils.py
# def listify(obj):
#     """Wrap all non-list or tuple objects in a list.
# 
#     Provides a simple way to accept flexible arguments.
#     """
#     if obj is None:
#         return []
#     else:
#         return obj if isinstance(obj, (list, tuple, type(None))) else [obj]
# 
# Path: bambi/backend/pymc.py
# class PyMC3Model:
#     INVLINKS = {
#         "cloglog": cloglog,
#         "identity": identity,
#         "inverse_squared": inverse_squared,
#         "inverse": tt.inv,
#         "log": tt.exp,
#         "logit": logit,
#         "probit": probit,
#         "tan_2": arctan_2,
#         "softmax": tt.nnet.softmax,
#     }
#             X = self._design_matrix_without_intercept
#     def __init__(self):
#     def build(self, spec):
#     def run(
#         self,
#         draws=1000,
#         tune=1000,
#         discard_tuned_samples=True,
#         omit_offsets=True,
#         include_mean=False,
#         method="mcmc",
#         init="auto",
#         n_init=50000,
#         chains=None,
#         cores=None,
#         random_seed=None,
#         **kwargs,
#     ):
#     def _build_intercept(self, spec):
#     def _build_common_terms(self, spec):
#     def _build_group_specific_terms(self, spec):
#     def _build_response(self, spec):
#     def _build_potentials(self, spec):
#     def _run_mcmc(
#         self,
#         draws=1000,
#         tune=1000,
#         discard_tuned_samples=True,
#         omit_offsets=True,
#         include_mean=False,
#         init="auto",
#         n_init=50000,
#         chains=None,
#         cores=None,
#         random_seed=None,
#         **kwargs,
#     ):
#     def _clean_mcmc_results(self, idata, omit_offsets, include_mean):
#     def _run_advi(self, **kwargs):
#     def _run_laplace(self):
# def add_lkj(backend, terms, eta=1):


import numpy as np
from bambi.utils import listify
from bambi.backend.pymc import probit, cloglog



def test_listify():
    assert listify(None) == []
    assert listify([1, 2, 3]) == [1, 2, 3]
    assert listify("giraffe") == ["giraffe"]


def test_probit():
    x = probit(np.random.normal(scale=10000, size=100)).eval()

# Path: bambi/utils.py
# def listify(obj):
#     """Wrap all non-list or tuple objects in a list.
# 
#     Provides a simple way to accept flexible arguments.
#     """
#     if obj is None:
#         return []
#     else:
#         return obj if isinstance(obj, (list, tuple, type(None))) else [obj]
# 
# Path: bambi/backend/pymc.py
# class PyMC3Model:
#     INVLINKS = {
#         "cloglog": cloglog,
#         "identity": identity,
#         "inverse_squared": inverse_squared,
#         "inverse": tt.inv,
#         "log": tt.exp,
#         "logit": logit,
#         "probit": probit,
#         "tan_2": arctan_2,
#         "softmax": tt.nnet.softmax,
#     }
#             X = self._design_matrix_without_intercept
#     def __init__(self):
#     def build(self, spec):
#     def run(
#         self,
#         draws=1000,
#         tune=1000,
#         discard_tuned_samples=True,
#         omit_offsets=True,
#         include_mean=False,
#         method="mcmc",
#         init="auto",
#         n_init=50000,
#         chains=None,
#         cores=None,
#         random_seed=None,
#         **kwargs,
#     ):
#     def _build_intercept(self, spec):
#     def _build_common_terms(self, spec):
#     def _build_group_specific_terms(self, spec):
#     def _build_response(self, spec):
#     def _build_potentials(self, spec):
#     def _run_mcmc(
#         self,
#         draws=1000,
#         tune=1000,
#         discard_tuned_samples=True,
#         omit_offsets=True,
#         include_mean=False,
#         init="auto",
#         n_init=50000,
#         chains=None,
#         cores=None,
#         random_seed=None,
#         **kwargs,
#     ):
#     def _clean_mcmc_results(self, idata, omit_offsets, include_mean):
#     def _run_advi(self, **kwargs):
#     def _run_laplace(self):
# def add_lkj(backend, terms, eta=1):


# Path: bambi/tests/test_utils.py
import numpy as np
from bambi.utils import listify
from bambi.backend.pymc import probit, cloglog




def test_listify():
    assert listify(None) == []
    assert listify([1, 2, 3]) == [1, 2, 3]
    assert listify("giraffe") == ["giraffe"]


def test_probit():
    x = probit(np.random.normal(scale=10000, size=100)).eval()

    assert (x > 0).all() and (x < 1).all()