class_docstr: Extension of fairseq.data.BacktranslationDataset where each example
  has a weight in [0.0, 1.0], which will be used to weigh the loss.
  
  Args:
      weights (list): list of per example weight values; each example
      has a weight in [0.0, 1.0]. Alternatively, when weights consists of a
      single value, that value is broadcast as weight to all examples. [0.0]
      gives 0 weight to all examples.
code: def collater(self, samples):
      if len(samples) == 0:
          return {}
      unweighted_data = self.dataset.collater(samples)
      original_weights = torch.FloatTensor(
          [s.get("weight", 1.0) for s in samples]
      )
      # sort by descending source length
      src_lengths = torch.LongTensor(
          [s["source"].numel() for s in samples]
      )
      src_lengths, sort_order = src_lengths.sort(descending=True)
      weights = original_weights.index_select(0, sort_order)
      unweighted_data["weights"] = weights
      return unweighted_data
  
imports: import torch
  from fairseq import data
label_desc: Use image node_id 4 for calling the WeightedBacktranslationDataset obj's underlying member method code with example usage: obj.collater(samples) and returns: unweighted_data, dict