code: def _grouper(
      iterable: Iterable[Any], n: int, fillvalue=None
  ) -> Iterator[Tuple[Any]]:
      """
      Group elements of an iterable by chunks of size `n`, e.g.
      grouper(range(9), 4) ->
          (0, 1, 2, 3), (4, 5, 6, 7), (8, None, None, None)
      """
      it = iter(iterable)
      while True:
          values = []
          for _ in range(n):
              try:
                  value = next(it)
              except StopIteration:
                  if values:
                      values.extend([fillvalue] * (n - len(values)))
                      yield tuple(values)
                  return
              values.append(value)
          yield tuple(values)
  
file_path: detectron2/projects/DensePose/densepose/data/inference_based_loader.py
imports: import random
  from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, Tuple
  import torch
  from torch import nn
label_desc: Use image node_id 1 for calling a global function with example usage: _grouper(iterable, n, fillvalue) without return types