class_docstr: Functions related to (negative) Hamming Distance Sampling.
code: def _sample_position(self, tokens, distance):
      n_tokens = len(tokens)
      chosen_indices = random.sample(range(n_tokens), k=distance)
      return chosen_indices
  
imports: import random
  import numpy
  from onmt.constants import DefaultTokens
  from onmt.transforms import register_transform
  from .transform import Transform, ObservableStats
label_desc: Use image node_id 4 for calling the HammingDistanceSampling obj's underlying member method code with example usage: obj._sample_position(tokens, distance) and returns: chosen_indices