code: def _before_after(n_samples):
      
      if not isinstance(n_samples, (tuple, list)):
          before = n_samples // 2
          after = n_samples - before
      else:
          assert len(n_samples) == 2
          before, after = n_samples
          n_samples = before + after
      assert before >= 0
      assert after >= 0
      assert before + after == n_samples
      return before, after
docs: Get the number of samples before and after.