code: def calculate_bar_widths(self, size, bardata):
          
          (maxcol, _) = size
  
          if self.bar_width is not None:
              return [self.bar_width] * min(
                  len(bardata), int(maxcol / self.bar_width))
  
          if len(bardata) >= maxcol:
              return [1] * maxcol
  
          widths = []
          grow = maxcol
          remain = len(bardata)
          for _ in bardata:
              w = int(float(grow) / remain + 0.5)
              widths.append(w)
              grow -= w
              remain -= 1
          return widths
docs: Return a list of bar widths, one for each bar in data.
  
          If self.bar_width is None this implementation will stretch
          the bars across the available space specified by maxcol.