def normalize(resources_by_categories, largest_epoch):
    """
    Organize all timeseries by the serie with the longest duration
    """
    for resource_axis in resources_by_categories.values():
        number_of_missing_values = largest_epoch - len(resource_axis[0])
        if not number_of_missing_values:
            continue
        resource_axis[0].extend(list(range(largest_epoch -
            number_of_missing_values, largest_epoch)))
        resource_axis[1].extend([resource_axis[1][-1]] *
            number_of_missing_values)
