code: def _scale_to_int(X, max_val=None):
      
  
      if max_val is None:
          X = X / _gcd_array(X)
      else:
          X = X / max(1 / max_val, _gcd_array(X))
      return [int(entry) for entry in X]
docs: Scales the array X such that it contains only integers.