code: def _check_bounds(indices, n_rows, n_cols, **kwargs):
      if not isinstance(indices, tuple):
          indices = (indices,)
      for index, size in zip(indices, [n_rows, n_cols]):
          if isinstance(index, list):
              for ind in index:
                  if not (0 <= ind < size):
                      # CuPy does not check boundaries.
                      # pytest.skip('Out of bounds')
                      return False
      return True
  
imports: import functools
  import itertools
  import numpy
  import pytest
  import cupy
  import cupyx
  from cupy import testing
  from cupy.cuda import runtime
  from cupyx.scipy import sparse
label_desc: Use image node_id 4 for calling a global function with example usage: _check_bounds(indices, n_rows, n_cols) and returns: True, False