code: def test_write_panel_to_tsfile_equal_length(
      dataset_name, return_type, tmpdir
  ):
      """Test function to write a dataset.
  
      Loads equal and unequal length problems into both data frames and numpy arrays,
      writes locally, reloads, then compares all class labels. It then delete the files.
      """
      X, y = _load_provided_dataset(
          dataset_name, split="TRAIN", return_type=return_type
      )
      write_panel_to_tsfile(
          data=X, path=tmpdir, target=y, problem_name=dataset_name
      )
      load_path = tmpdir / dataset_name / f"{dataset_name}.ts"
      newX, newy = load_from_tsfile(
          full_file_path_and_name=load_path,
          return_data_type=return_type,
      )
      assert np.array_equal(y, newy)
  
imports: import os
  import tempfile
  import numpy
  import pandas
  import pytest
  from pandas._testing import assert_frame_equal
  import sktime
  from sktime.datasets import generate_example_long_table, load_from_long_to_dataframe, load_from_tsfile, load_from_tsfile_to_dataframe, load_tsf_to_dataframe, write_dataframe_to_tsfile, write_panel_to_tsfile
  from sktime.datasets._data_io import MODULE, _load_provided_dataset
  from sktime.datasets._readers_writers.tsf import _convert_tsf_to_hierarchical
  from sktime.datatypes import check_is_mtype
label_desc: Use image node_id 7 for calling a global function with example usage: test_write_panel_to_tsfile_equal_length(dataset_name, return_type, tmpdir) without return types