code: def create_unique_weight(weight, nbits):
      shape = weight.detach().numpy().shape
      size = weight.detach().numpy().size
  
      unique_number = 1 << nbits
      weight = list(range(unique_number))
      if size > unique_number:
          weight.extend([unique_number - 1] * (size - unique_number))
      weight = np.reshape(
          np.array(weight[:size]).astype(np.float32), shape
      )
      return weight
  
imports: import itertools
  import numpy
  import pytest
  import torch
  import coremltools
  import coremltools.optimize
  from coremltools._deps import _HAS_SKLEARN
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import types
  from coremltools.converters.mil.testing_utils import get_op_types_in_program
  from coremltools.optimize.coreml._post_training_quantization import CoreMLWeightMetaData
  from coremltools.test.ml_program.test_compression import get_test_model_and_data
label_desc: Use image node_id 6 for calling a global function with example usage: create_unique_weight(weight, nbits) and returns: weight