code: def _is_valid_format(
      coo_indices=None,
      crow_indices=None,
      col_indices=None,
      ccol_indices=None,
      row_indices=None,
      values=None,
      dense_shape=None,
      format="coo",
  ):
      valid_formats = ["coo", "csr", "csc", "csc", "bsc", "bsr"]
  
      if (
          not isinstance(format, str)
          or format.lower() not in valid_formats
      ):
          return False
  
      if format.endswith("o"):
          # format is coo
          return (
              ivy.exists(coo_indices)
              and ivy.exists(values)
              and ivy.exists(dense_shape)
              and crow_indices is None
              and col_indices is None
              and ccol_indices is None
              and row_indices is None
          )
  
      if format.endswith("r"):
          # format is either csr or bsr
          return (
              ivy.exists(crow_indices)
              and ivy.exists(col_indices)
              and ivy.exists(values)
              and ivy.exists(dense_shape)
              and coo_indices is None
              and ccol_indices is None
              and row_indices is None
          )
      # format is either csc or bsc
      return (
          ivy.exists(ccol_indices)
          and ivy.exists(row_indices)
          and ivy.exists(values)
          and ivy.exists(dense_shape)
          and coo_indices is None
          and crow_indices is None
          and col_indices is None
      )
  
imports: import ivy
  from ivy.func_wrapper import inputs_to_native_arrays
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 9 for calling a global function with example usage: _is_valid_format(coo_indices, crow_indices, col_indices, ccol_indices, row_indices, values, dense_shape, format) and returns: unknown, False, unknown, unknown