code: def calc_limits(data, dist=None, padding=0.25):
      
      dmin = sys.float_info.max if dist is None else dist.get('min',
                                                              sys.float_info.max)
      dmax = sys.float_info.min if dist is None else dist.get('max',
                                                              sys.float_info.min)
      _min = min(min(data), dmin)
      _max = max(max(data), dmax)
  
      padding = padding * (_max - _min)
      return _min - padding, _max + padding
docs: Calculate a suitable range for a histogram
  
      Returns:
          tuple of (min, max)