def object_list_to_dictionary_list(obj_list):
    """ Utility function to convert list of objects to list of dictionaries. 
        The objects must have the function ``to_dict(.)`` associated with it.
    
        :param obj_list: List of objects.
        :paramtype obj_list: list, cls or cls

        :return: List of dictionaries.
        :rtype: list, dict

    """
    dict_list = None
    if obj_list is not None:
        if isinstance(obj_list, list):
            dict_list = [x.to_dict() for x in obj_list]
        else:
            dict_list = [obj_list.to_dict()] 
    return dict_list