# Path: bambi/utils.py
# def multilinify(sequence, sep=","):
#     """Make a multi-line string out of a sequence of strings."""
#     sep += "\n"
#     return "\n" + sep.join(sequence)
# 
# def spacify(string):
#     """Add 2 spaces to the beginning of each line in a multi-line string."""
#     return "  " + "  ".join(string.splitlines(True))


import numpy as np
from scipy import special
from bambi.utils import multilinify, spacify
        A function that maps the response to the linear predictor. Known as the :math:`g` function
        in GLM jargon. Does not need to be specified when ``name`` is a known name.
    linkinv: function
        A function that maps the linear predictor to the response. Known as the :math:`g^{-1}`
        function in GLM jargon. Does not need to be specified when ``name`` is a known name.
    linkinv_backend: function
        Same than ``linkinv`` but must be something that works with PyMC3 backend (i.e. it must
        work with Theano tensors). Does not need to be specified when ``name`` is a known
        name.

    """

    def __init__(self, name, link=None, linkinv=None, linkinv_backend=None):
        self.name = name
        self.link = link
        self.linkinv = linkinv
        self.linkinv_backend = linkinv_backend

        if name in LINKS:
            self.link = LINKS[name]["link"]
            self.linkinv = LINKS[name]["linkinv"]
        else:
            if not link or not linkinv or not linkinv_backend:
                raise ValueError(
                    f"Link name '{name}' is not supported and at least one of 'link', "
                    "'linkinv' or 'linkinv_backend' are unespecified."
                )

    def __str__(self):
        args = [f"name: {self.name}", f"link: {self.link}", f"linkinv: {self.linkinv}"]

# Path: bambi/utils.py
# def multilinify(sequence, sep=","):
#     """Make a multi-line string out of a sequence of strings."""
#     sep += "\n"
#     return "\n" + sep.join(sequence)
# 
# def spacify(string):
#     """Add 2 spaces to the beginning of each line in a multi-line string."""
#     return "  " + "  ".join(string.splitlines(True))


# Path: bambi/families/link.py
import numpy as np
from scipy import special
from bambi.utils import multilinify, spacify

        A function that maps the response to the linear predictor. Known as the :math:`g` function
        in GLM jargon. Does not need to be specified when ``name`` is a known name.
    linkinv: function
        A function that maps the linear predictor to the response. Known as the :math:`g^{-1}`
        function in GLM jargon. Does not need to be specified when ``name`` is a known name.
    linkinv_backend: function
        Same than ``linkinv`` but must be something that works with PyMC3 backend (i.e. it must
        work with Theano tensors). Does not need to be specified when ``name`` is a known
        name.

    """

    def __init__(self, name, link=None, linkinv=None, linkinv_backend=None):
        self.name = name
        self.link = link
        self.linkinv = linkinv
        self.linkinv_backend = linkinv_backend

        if name in LINKS:
            self.link = LINKS[name]["link"]
            self.linkinv = LINKS[name]["linkinv"]
        else:
            if not link or not linkinv or not linkinv_backend:
                raise ValueError(
                    f"Link name '{name}' is not supported and at least one of 'link', "
                    "'linkinv' or 'linkinv_backend' are unespecified."
                )

    def __str__(self):
        args = [f"name: {self.name}", f"link: {self.link}", f"linkinv: {self.linkinv}"]

        return f"{self.__class__.__name__}({spacify(multilinify(args))}\n)"