code: def test_example(self, example_name, benchmark_returns):
      actual_perf = examples.run_example(
          EXAMPLE_MODULES,
          example_name,
          # This should match the invocation in
          # zipline/tests/resources/rebuild_example_data
          environ={
              "ZIPLINE_ROOT": self.tmpdir.getpath("example_data/root"),
          },
          benchmark_returns=benchmark_returns,
      )
      if benchmark_returns is not None:
          expected_perf = self.expected_perf[example_name]
      else:
          expected_perf = self.no_benchmark_expected_perf[example_name]
  
      # Exclude positions column as the positions do not always have the
      # same order
      columns = [
          column
          for column in examples._cols_to_check
          if column != "positions"
      ]
      assert_equal(
          actual_perf[columns],
          expected_perf[columns],
          # There is a difference in the datetime columns in pandas
          # 0.16 and 0.17 because in 16 they are object and in 17 they are
          # datetime[ns, UTC]. We will just ignore the dtypes for now.
          check_dtype=False,
      )
      # Sort positions by SID before comparing
      assert_equal(
          expected_perf["positions"].apply(
              sorted, key=itemgetter("sid")
          ),
          actual_perf["positions"].apply(sorted, key=itemgetter("sid")),
      )
  
file_path: zipline/tests/test_examples.py
imports: from functools import partial
  from operator import itemgetter
  import tarfile
  import matplotlib
  import pandas
  from zipline import examples
  from zipline.data.bundles import register, unregister
  from zipline.testing import test_resource_path, parameter_space
  from zipline.testing.fixtures import WithTmpDir, ZiplineTestCase, read_checked_in_benchmark_data
  from zipline.testing.predicates import assert_equal
  from zipline.utils.cache import dataframe_cache
label_desc: Use image node_id 3 for calling the ExamplesTests obj's underlying member method code with example usage: obj.test_example(example_name, benchmark_returns) without return types