code: def _skip(x, mask):
      """
      Getting sliced (dim=0) tensor by mask. Supporting tensor and list/dict of tensors.
      """
      if isinstance(x, int):
          return x
  
      if x is None:
          return None
  
      if isinstance(x, torch.Tensor):
          if x.size(0) == mask.size(0):
              return x[mask]
          elif x.size(1) == mask.size(0):
              return x[:, mask]
  
      if isinstance(x, list):
          return [_skip(x_i, mask) for x_i in x]
  
      if isinstance(x, dict):
          return {k: _skip(v, mask) for k, v in x.items()}
  
      raise NotImplementedError
  
file_path: fairseq/fairseq/models/nat/levenshtein_utils.py
imports: import torch
  from fairseq.utils import new_arange
label_desc: Use image node_id 7 for calling a global function with example usage: _skip(x, mask) and returns: x, None, unknown, unknown, x, x