code: def test_check_x_y_reassings_index_when_only_one_input_is_pandas():
      # case 1: X is dataframe, y is something else
      df = pd.DataFrame(
          {"0": [1, 2, 3, 4], "1": [5, 6, 7, 8]},
          index=[22, 99, 101, 212],
      )
      s = np.array([1, 2, 3, 4])
      s_exp = pd.Series([1, 2, 3, 4], index=[22, 99, 101, 212])
      x, y = check_X_y(df, s)
      assert_frame_equal(df, x)
      assert_series_equal(s_exp.astype(int), y.astype(int))
  
      # case 2: X is not a df, y is a series
      df = np.array([[1, 2, 3, 4], [5, 6, 7, 8]]).T
      s = pd.Series([1, 2, 3, 4], index=[22, 99, 101, 212])
      df_exp = pd.DataFrame(df, columns=["x0", "x1"])
      df_exp.index = s.index
  
      x, y = check_X_y(df, s)
      assert_frame_equal(df_exp, x)
      assert_series_equal(s, y)
  
imports: import numpy
  import pandas
  import pytest
  from pandas.testing import assert_frame_equal, assert_series_equal
  from scipy.sparse import csr_matrix
  from feature_engine.dataframe_checks import _check_contains_inf, _check_contains_na, _check_X_matches_training_df, check_X, check_X_y, check_y
label_desc: Use image node_id 14 for calling a global function with example usage: test_check_x_y_reassings_index_when_only_one_input_is_pandas() without return types