code: def gen_edge_knots(data, dtype, verbose=True):
      
      if dtype not in ['categorical', 'numerical']:
          raise ValueError('unsupported dtype: {}'.format(dtype))
      if dtype == 'categorical':
          return np.r_[np.min(data) - 0.5, np.max(data) + 0.5]
      else:
          knots = np.r_[np.min(data), np.max(data)]
          if knots[0] == knots[1] and verbose:
              warnings.warn('Data contains constant feature. '\
                            'Consider removing and setting fit_intercept=True',
                            stacklevel=2)
          return knots
docs: generate uniform knots from data including the edges of the data
  
      for discrete data, assumes k categories in [0, k-1] interval
  
      Parameters
      ----------
      data : array-like with one dimension
      dtype : str in {'categorical', 'numerical'}
      verbose : bool, default: True
          whether to print warnings
  
      Returns
      -------
      np.array containing ordered knots