def _resize_row(array, new_len):
    """Alter the size of a list to match a specified length

    If the list is too long, trim it. If it is too short, pad it with Nones

    Args:
        array (list): The data set to pad or trim
        new_len int): The desired length for the data set

    Returns:
        list: A copy of the input `array` that has been extended or trimmed
    """
    current_len = len(array)
    if current_len > new_len:
        return array[:new_len]
    else:
        # pad the row with Nones
        padding = [None] * (new_len - current_len)
        return array + padding