code: def init(
      self,
      X,
      y,
      sample_weight,
      missing_values_in_feature_mask,
      *args,
  ):
      n_samples = X.shape[0]
      self.samples = ivy.empty(n_samples, dtype=ivy.int32)
      samples = self.samples
      j = 0
      weighted_n_samples = 0.0
  
      for i in range(n_samples):
          if sample_weight is None or sample_weight[i] != 0.0:
              samples[j] = i
              j += 1
          if sample_weight is not None:
              weighted_n_samples += sample_weight[i]
          else:
              weighted_n_samples += 1.0
  
      self.n_samples = j
      self.weighted_n_samples = weighted_n_samples
      n_features = X.shape[1]
      self.features = ivy.arange(n_features, dtype=ivy.int32)
      self.n_features = n_features
      self.feature_values = ivy.empty(n_samples, dtype=ivy.float32)
      self.constant_features = ivy.empty(n_features, dtype=ivy.int32)
      self.y = y
      self.sample_weight = sample_weight
      if missing_values_in_feature_mask is not None:
          self.criterion.init_sum_missing()
      return 0
  
imports: import ivy
label_desc: Use image node_id 2 for calling the Splitter obj's underlying member method code with example usage: obj.init(X, y, sample_weight, missing_values_in_feature_mask) and returns: int