code: def test_px_defaults():
      px.defaults.labels = dict(x="hey x")
      px.defaults.category_orders = dict(color=["b", "a"])
      px.defaults.color_discrete_map = dict(b="red")
      fig = px.scatter(x=[1, 2], y=[1, 2], color=["a", "b"])
      try:
          assert fig.data[0].name == "b"
          assert fig.data[0].marker.color == "red"
          assert fig.layout.xaxis.title.text == "hey x"
      finally:
          # reset defaults to prevent all other tests from failing if this one does
          px.defaults.reset()
          pio.templates.default = "plotly"
  
file_path: plotly.py/packages/python/plotly/plotly/tests/test_optional/test_px/test_px.py
imports: import plotly.express
  import plotly.io
  import numpy
  import pytest
  from itertools import permutations
label_desc: Use image node_id 6 for calling a global function with example usage: test_px_defaults() without return types