def to_list(obj):
    """
    Checks if obj is a list and returns it. If not, returns an empty list.
    :param obj:
    :return:
    """
    if isinstance(obj, list):
        return obj
    else:
        return []