code: def mk_sample(
      tok: Sequence[int] = None, batch_size: int = 2
  ) -> Dict[str, Any]:
      if not tok:
          tok = [10, 11, 12, 13, 14, 15, 2]
  
      batch = torch.stack(
          [torch.tensor(tok, dtype=torch.long)] * batch_size
      )
      sample = {
          "net_input": {
              "src_tokens": batch,
              "prev_output_tokens": batch,
              "src_lengths": torch.tensor(
                  [len(tok)] * batch_size,
                  dtype=torch.long,
                  device=batch.device,
              ),
          },
          "target": batch[:, 1:],
      }
      return sample
  
file_path: fairseq/tests/test_transformer.py
imports: import argparse
  import unittest
  from typing import Any, Dict, Sequence
  import torch
  from fairseq.models import transformer
  from tests.test_roberta import FakeTask
label_desc: Use image node_id 1 for calling a global function with example usage: mk_sample(tok, batch_size) and returns: sample