code: def _get_tridiagonal_dtype_matrix_format(draw):
      input_dtype_strategy = st.shared(
          st.sampled_from(
              draw(helpers.get_dtypes("float_and_complex"))
          ),
          key="shared_dtype",
      )
      input_dtype = draw(input_dtype_strategy)
      shared_size = draw(
          st.shared(
              helpers.ints(min_value=2, max_value=4), key="shared_size"
          )
      )
      diagonals_format = draw(
          st.sampled_from(["compact", "sequence", "matrix"])
      )
      if diagonals_format == "matrix":
          matrix = draw(
              helpers.array_values(
                  dtype=input_dtype,
                  shape=(shared_size, shared_size),
                  min_value=2,
                  max_value=5,
              ).filter(tridiagonal_matrix_filter)
          )
      elif diagonals_format in ["compact", "sequence"]:
          matrix = draw(
              helpers.array_values(
                  dtype=input_dtype,
                  shape=(3, shared_size),
                  min_value=2,
                  max_value=5,
              ).filter(tridiagonal_compact_filter)
          )
          if diagonals_format == "sequence":
              matrix = list(matrix)
  
      return input_dtype, matrix, diagonals_format
  
imports: import numpy
  from hypothesis import assume, strategies
  import sys
  import ivy
  import ivy_tests.test_ivy.helpers
  from ivy_tests.test_ivy.helpers import handle_frontend_test, assert_all_close
  from ivy_tests.test_ivy.test_functional.test_core.test_linalg import _get_dtype_value1_value2_axis_for_tensordot
  from ivy_tests.test_ivy.helpers.hypothesis_helpers.general_helpers import matrix_is_stable
  from ivy_tests.test_ivy.test_functional.test_core.test_linalg import _matrix_rank_helper
label_desc: Use image node_id 8 for calling a global function with example usage: _get_tridiagonal_dtype_matrix_format(draw) and returns: input_dtype,  matrix,  diagonals_format