# AUTOGENERATED - modify shared_anyscale_util in root directory to make changes
import itertools
from typing import List, Optional, TypeVar


T = TypeVar("T")


def flatten(*lists: List[T]) -> List[T]:
    return list(itertools.chain(*lists))


def as_list(o: Optional[T]) -> List[T]:
    """Converts "container" holding optional value into a list"""
    return [o] if o else []
