from typing import OrderedDict


def flatten_parameters(params):
    """
    Takes an OrderedDict or a list of lists, and flattens it into a
    list containing the items.

    # Arguments:
        params (OrderedDict | list of lists): The parameters that were
            provided by the engine, either as an OrderedDict or a list
            of list representation.

    # Returns:
        a flattened python list containing just the sampled values.
    """
    if isinstance(params, OrderedDict):
        params = list(params.values())

    params = [item
              for sublist in params
              for item in sublist]

    return params