from typing import List
from typing import Any


def flatten(matrix: List[Any]) -> list:
    """Flatten a matrix (list of lists) into a single list.

    :param list matrix: a list of lists to be flattened
    :returns: all values of matrix in a single list
    :rtype: list
    """
    matrix = [list(x) if isinstance(x, tuple) else
              [x] if not isinstance(x, list) else x for x in matrix]
    return [x for row in matrix for x in row]