code: def set_weight(self, weight):
          
          if weight is not None and np.all(weight == 1):
              weight = None
          self.weight = weight
          if self.handle is not None and weight is not None:
              weight = list_to_1d_numpy(weight, name='weight')
              self.set_field('weight', weight)
          return self
docs: Set weight of each instance.
  
          Parameters
          ----------
          weight : list, numpy 1-D array, pandas Series or None
              Weight to be set for each data point.
  
          Returns
          -------
          self : Dataset
              Dataset with set weight.