def append_or_extend(array, mixed):
    """
    Append or extend a list.

    :param array: list to append or extend
    :type array: list
    :param mixed: item or list
    :type mixed: mixed
    :return: list
    :rtype: list
    """

    if isinstance(mixed, list):
        return array.extend(mixed)
    else:
        return array.append(mixed)