code: def test_x_or_y(fn):
      categorical = ["a", "a", "b", "b"]
      numerical = [1, 2, 3, 4]
      constant = [1, 1, 1, 1]
      range_4 = [0, 1, 2, 3]
      index = [11, 12, 13, 14]
      numerical_df = pd.DataFrame(dict(col=numerical), index=index)
      categorical_df = pd.DataFrame(dict(col=categorical), index=index)
  
      fig = fn(x=numerical)
      assert list(fig.data[0].x) == numerical
      assert list(fig.data[0].y) == range_4
      assert fig.data[0].orientation == "h"
      fig = fn(y=numerical)
      assert list(fig.data[0].x) == range_4
      assert list(fig.data[0].y) == numerical
      assert fig.data[0].orientation == "v"
      fig = fn(numerical_df, x="col")
      assert list(fig.data[0].x) == numerical
      assert list(fig.data[0].y) == index
      assert fig.data[0].orientation == "h"
      fig = fn(numerical_df, y="col")
      assert list(fig.data[0].x) == index
      assert list(fig.data[0].y) == numerical
      assert fig.data[0].orientation == "v"
  
      if fn != px.bar:
          fig = fn(x=categorical)
          assert list(fig.data[0].x) == categorical
          assert list(fig.data[0].y) == range_4
          assert fig.data[0].orientation == "h"
          fig = fn(y=categorical)
          assert list(fig.data[0].x) == range_4
          assert list(fig.data[0].y) == categorical
          assert fig.data[0].orientation == "v"
          fig = fn(categorical_df, x="col")
          assert list(fig.data[0].x) == categorical
          assert list(fig.data[0].y) == index
          assert fig.data[0].orientation == "h"
          fig = fn(categorical_df, y="col")
          assert list(fig.data[0].x) == index
          assert list(fig.data[0].y) == categorical
          assert fig.data[0].orientation == "v"
  
      else:
          fig = fn(x=categorical)
          assert list(fig.data[0].x) == categorical
          assert list(fig.data[0].y) == constant
          assert fig.data[0].orientation == "v"
          fig = fn(y=categorical)
          assert list(fig.data[0].x) == constant
          assert list(fig.data[0].y) == categorical
          assert fig.data[0].orientation == "h"
          fig = fn(categorical_df, x="col")
          assert list(fig.data[0].x) == categorical
          assert list(fig.data[0].y) == constant
          assert fig.data[0].orientation == "v"
          fig = fn(categorical_df, y="col")
          assert list(fig.data[0].x) == constant
          assert list(fig.data[0].y) == categorical
          assert fig.data[0].orientation == "h"
  
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 36 for calling a global function with example usage: test_x_or_y(fn) without return types