from typing import List


def _validate_counts(counts: List[int]) -> bool:
    """
    Validates the counts parameter.

    Parameters
    ----------
    counts : List[integers]
        A list of counts.

    Raises
    ------
    TypeError
        The ``counts`` parameter is not a list or one of the elements of this
        list is not an integer.
    ValueError
        One of the counts is a negative integer.

    Returns
    -------
    is_valid : boolean
        ``True`` if counts is valid, ``False`` otherwise.
    """
    is_valid = False

    if isinstance(counts, list):
        for count in counts:
            if isinstance(count, int):
                if count < 0:
                    raise ValueError('Counts cannot be negative integers.')
            else:
                raise TypeError('Counts have to be integers.')
    else:
        raise TypeError('The counts parameter has to be a list of integers.')

    is_valid = True
    return is_valid