code: def _metis_weight_scale(X):
      """Ensure X is postive integers."""
      X_min = np.min(X)
      X_max = np.max(X)
      X_scaled = (X - X_min) / (X_max - X_min + 1e-5)
      X_scaled = (X_scaled * 1000).astype("int64") + 1
      assert np.any(
          X_scaled > 0
      ), "The weight of METIS input must be postive integers"
      return X_scaled
  
file_path: PGL/pgl/partition.py
imports: import math
  import numpy
  from pgl.graph_kernel import metis_partition
  from pgl.utils.helper import check_is_tensor
  from pgl.utils.logger import log
label_desc: Use image node_id 1 for calling a global function with example usage: _metis_weight_scale(X) and returns: X_scaled