def _get_rows_helper(iterableObj, key=None):
    """ Takes an object and returns a list of rows to use for appending.

        :param iterableObj: Iterable
        :param key: If iterableObj had a key to assigned it it's given here """
    row = [key] if key else []
    if isinstance(iterableObj, (list, tuple)):
        row.extend(iterableObj)
    elif isinstance(iterableObj, dict):
        for _, value in sorted(iterableObj.items()):
            row.append(value)
    return row