class_docstr: Wraps a MonolingualDataset and provides more context for evaluation.
  
  Each item in the new dataset will have a maximum size of
  ``tokens_per_sample + context_window``.
  
  Args:
      dataset: dataset to wrap
      tokens_per_sample (int): the max number of tokens in each dataset item
      context_window (int): the number of accumulated tokens to add to each
          dataset item
      pad_idx (int): padding symbol
code: def __init__(
      self,
      dataset: MonolingualDataset,
      tokens_per_sample: int,
      context_window: int,
      pad_idx: int,
  ):
      assert context_window > 0
      self.dataset = dataset
      self.tokens_per_sample = tokens_per_sample
      self.context_window = context_window
      self.pad_idx = pad_idx
      self.prev_tokens = np.empty([0])
  
file_path: fairseq/fairseq/data/lm_context_window_dataset.py
imports: import numpy
  import torch
  from typing import Dict
  from fairseq.data.monolingual_dataset import MonolingualDataset
  from .None import FairseqDataset
label_desc: Use image node_id 1 to create a new LMContextWindowDataset object from inherited base classes: FairseqDataset with example: obj = LMContextWindowDataset(dataset, tokens_per_sample, context_window, pad_idx)