def METHOD_NAME(self):
    """Updates the widths cache."""
    # If we are given a single width, apply it to all levels
    if isinstance(self.widths, float):
        self._widths = [self.widths] * len(self._levels)
    # If the list of widths is shorter than the list of levels,
    # simply repeat widths from the beginning of the list as needed
    else:
        self._widths = []
        for i in range(len(self._levels)):
            self._widths.append(self.widths[i % len(self.widths)])
    self._widths_cache_valid = True