code: def test_so_few_that_last_slice_would_underflow(self) -> None:
      # All slices have the same size, which is the ratio size/num_parts
      # rounded up. This however may cause earlier slices to get so many
      # elements that later ones end up being empty. We need to be careful
      # about not returning negative slices in that case.
      self.assertEqual(
          list(split_almost_equally(5, num_parts=4)),
          [slice(0, 2), slice(2, 4), slice(4, 5), slice(5, 5)],
      )
      self.assertEqual(
          list(split_almost_equally(6, num_parts=5)),
          [
              slice(0, 2),
              slice(2, 4),
              slice(4, 6),
              slice(6, 6),
              slice(6, 6),
          ],
      )
  
file_path: PyTorch-BigGraph/test/test_util.py
imports: from unittest import main, TestCase
  import torch
  from torchbiggraph.util import match_shape, round_up_to_nearest_multiple, split_almost_equally
label_desc: Use image node_id 4 for calling the TestSplitAlmostEqually obj's underlying member method code with example usage: obj.test_so_few_that_last_slice_would_underflow() without return types