code: def get_compressed_indices(tensor, indices, shape):
      comp_config = tensor.data[2]
      group_size, group_dim = (
          comp_config.group_size,
          comp_config.group_dim,
      )
      assert comp_config.num_bits == 4
  
      if indices is None:
          indices = list(slice(0, x) for x in shape[: group_dim + 1])
      else:
          indices = list(indices) + [
              slice(0, x) for x in shape[len(indices) :]
          ]
      assert indices[group_dim].start % group_size == 0
  
      data_indices = list(indices)
      data_indices[group_dim] = slice(
          indices[group_dim].start // 2,
          (indices[group_dim].stop + 1) // 2,
      )
  
      scale_indices = indices
      scale_indices.insert(group_dim + 1, slice(0, 2))
      scale_indices[group_dim] = slice(
          indices[group_dim].start // group_size,
          (indices[group_dim].stop + group_size - 1) // group_size,
      )
  
      return data_indices, scale_indices
  
imports: import dataclasses
  import torch
  import numpy
  from flexgen.pytorch_backend import TorchTensor, TorchDevice, DeviceType, general_copy, fix_recursive_import
  from flexgen.utils import np_dtype_to_torch_dtype
label_desc: Use image node_id 2 for calling a global function with example usage: get_compressed_indices(tensor, indices, shape) and returns: data_indices,  scale_indices