def common(a, b):
    """
    Calculates the number of unique common elements between two lists.

    Parameters
    ----------
    a: list
        list of strings to be compared to b
    b: list
        list of strings to be compared to a

    Raises
    ------
    TypeError
        if a or b are not lists

    Returns
    -------
    integer
        number of unique common elements

    Example
    --------
    >>> list_1 = ['dog', 'dog', 'cat', 'fish']
    >>> list_2 = ['dog', 'fish']
    >>> common(list_1, list_2)
    2
    """
    # Check variable types
    if not ((isinstance(a, list)) and (isinstance(b, list))):
        raise TypeError('Both variables being compared must contain lists')

    # Number of common elements
    value = len(list(set(filter(lambda x: x in a, b)))
                ) if a is not None and b is not None else None

    return value