code: def _get_splits(
      draw,
      allow_none=True,
      min_num_dims=1,
      axis=None,
      allow_array_indices=True,
      is_mod_split=False,
  ):
      """Generate valid splits, either by generating an integer that evenly
      divides the axis or a list of splits that sum to the length of the axis
      being split."""
      shape = draw(
          st.shared(
              helpers.get_shape(min_num_dims=min_num_dims),
              key="value_shape",
          )
      )
      if axis is None:
          axis = draw(
              st.shared(
                  helpers.get_axis(shape=shape, force_int=True),
                  key="target_axis",
              )
          )
  
      @st.composite
      def _get_int_split(draw):
          if shape[axis] == 0:
              return 0
          factors = []
          for i in range(1, shape[axis] + 1):
              if shape[axis] % i == 0:
                  factors.append(i)
          return draw(st.sampled_from(factors))
  
      @st.composite
      def _get_list_split(
          draw, allow_arr_indices=True, is_other_split=False
      ):
          num_or_size_splits = []
          while sum(num_or_size_splits) < shape[axis]:
              split_value = draw(
                  helpers.ints(
                      min_value=1,
                      max_value=shape[axis] - sum(num_or_size_splits),
                  )
              )
              num_or_size_splits.append(split_value)
          if is_other_split:
              num_or_size_splits = list(set(num_or_size_splits))
          if allow_arr_indices:
              gen_random_native = draw(st.booleans())
              if gen_random_native:
                  return np.asarray(num_or_size_splits, dtype=np.int32)
          return num_or_size_splits
  
      if allow_none:
          return draw(
              _get_list_split(
                  allow_arr_indices=allow_array_indices,
                  is_other_split=is_mod_split,
              )
              | _get_int_split()
              | st.none()
          )
      else:
          return draw(
              _get_list_split(
                  allow_arr_indices=allow_array_indices,
                  is_other_split=is_mod_split,
              )
              | _get_int_split()
          )
  
imports: import numpy
  from hypothesis import strategies, assume
  import ivy
  import ivy_tests.test_ivy.helpers
  from ivy_tests.test_ivy.helpers import handle_test
label_desc: Use image node_id 5 for calling a global function with example usage: _get_splits(draw, allow_none, min_num_dims, axis, allow_array_indices, is_mod_split) and returns: draw, num_or_size_splits, draw, draw, int, np