code: def partition_samples_final(
      self,
      best_pos,
      best_threshold,
      best_feature,
      best_n_missing,
  ):
      start = self.start
      p = start
      end = self.end - 1
      partition_end = end - best_n_missing
      samples = self.samples
      X = self.X
  
      if best_n_missing != 0:
          while p < partition_end:
              if ivy.isnan(X[samples[end], best_feature]):
                  end -= 1
                  continue
              current_value = X[samples[p], best_feature]
              if ivy.isnan(current_value):
                  samples[p], samples[end] = samples[end], samples[p]
                  end -= 1
                  current_value = X[samples[p], best_feature]
              if current_value <= best_threshold:
                  p += 1
              else:
                  samples[p], samples[partition_end] = (
                      samples[partition_end],
                      samples[p],
                  )
                  partition_end -= 1
      else:
          while p < partition_end:
              if X[samples[p], best_feature] <= best_threshold:
                  p += 1
              else:
                  samples[p], samples[partition_end] = (
                      samples[partition_end],
                      samples[p],
                  )
                  partition_end -= 1
      self.samples = samples
  
imports: import ivy
label_desc: Use image node_id 7 for calling the DensePartitioner obj's underlying member method code with example usage: obj.partition_samples_final(best_pos, best_threshold, best_feature, best_n_missing) without return types