'Helper method to set the link for a family.
Raises a ValueError exception if the link is not available. Note that
the error message might not be that informative because it tells you
that the link should be in the base class for the link function.
See glm.GLM for a list of appropriate links for each family but note
that not all of these are currently available.'

def _setlink(self, link):

    self._link = link
    if (not isinstance(link, L.Link)):
        raise TypeError('The    input    should    be    a    valid    Link    object.')
    if hasattr(self, 'links'):
        validlink = (link in self.links)
        validlink = max([isinstance(link, _) for _ in self.links])
        if (not validlink):
            errmsg = 'Invalid    link    for    family,    should    be    in    %s.    (got    %s)'
            raise ValueError((errmsg % (repr(self.links), link)))
