code: def test_select_traces_string(select_traces_fixture):
      fig = select_traces_fixture
      # check we can select traces by type simply by passing a string to selector
      trs = list(fig.select_traces(selector="bar"))
      assert len(trs) == 2 and reduce(
          lambda last, cur: last
          and (cur[0]["type"] == "bar")
          and (cur[0]["y"][1] == cur[1]),
          zip(trs, [10, 20]),
          True,
      )
      # check we can select traces by type regardless of the subplots they are on
      trs = list(fig.select_traces(selector="scatter"))
      assert len(trs) == 4 and reduce(
          lambda last, cur: last
          and (cur[0]["type"] == "scatter")
          and (cur[0]["y"][1] == cur[1]),
          zip(trs, [0, 1, 2, 0]),
          True,
      )
      # check that we can select traces by type but only on a specific subplot
      trs = list(fig.select_traces(row=2, col=3, selector="scatter"))
      assert len(trs) == 3 and reduce(
          lambda last, cur: last
          and (cur[0]["type"] == "scatter")
          and (cur[0]["y"][1] == cur[1]),
          zip(trs, [0, 1, 2]),
          True,
      )
      # check that if selector matches no trace types then no traces are returned
      trs = list(fig.select_traces(selector="bogus"))
      assert len(trs) == 0
  
imports: from unittest import TestCase
  import inspect
  import copy
  import pytest
  import plotly.graph_objs
  from plotly.subplots import make_subplots
  from functools import reduce
label_desc: Use image node_id 3 for calling a global function with example usage: test_select_traces_string(select_traces_fixture) without return types