def normalize_factors(factors):
    """Normalize the factor list into a list of individual factors.

    The factor argument has "append" behavior (-f foo -f bar), and each of these
    arguments may be a comma-separated list of factors. Normalize this into a
    flat list of individual factors. e.g.,

        >>> normalize_factors(['py37', 'lint,isort'])
        ['py37', 'lint', 'isort']

    Args:
        factors: A list of comma-separated factor strings.

    Returns:
        The list flattened, individual factors.
    """
    assert isinstance(factors, list), (
        'Expected `factors` list to be a list, got `{cls}`.'
        .format(cls=type(factors).__name__))

    flattened = [
        f.strip()
        for flist in factors
        for f in flist.split(',')
    ]

    # Remove empty strings
    return [f for f in flattened if f]