code: def test_non_matching_index():
      df = pd.DataFrame(dict(y=[1, 2, 3]), index=["a", "b", "c"])
  
      expected = pd.DataFrame(dict(index=["a", "b", "c"], y=[1, 2, 3]))
  
      args = dict(data_frame=df, x=df.index, y="y")
      out = build_dataframe(args, go.Scatter)
      assert_frame_equal(expected, out["data_frame"])
  
      expected = pd.DataFrame(dict(x=["a", "b", "c"], y=[1, 2, 3]))
  
      args = dict(data_frame=None, x=df.index, y=df.y)
      out = build_dataframe(args, go.Scatter)
      assert_frame_equal(expected, out["data_frame"])
  
      args = dict(data_frame=None, x=["a", "b", "c"], y=df.y)
      out = build_dataframe(args, go.Scatter)
      assert_frame_equal(expected, out["data_frame"])
  
imports: import plotly.express
  import plotly.graph_objects
  import numpy
  import pandas
  import pytest
  from packaging import version
  import unittest.mock
  from plotly.express._core import build_dataframe
  from pandas.testing import assert_frame_equal
label_desc: Use image node_id 22 for calling a global function with example usage: test_non_matching_index() without return types