code: def test_lsx(start_ray, tmpdir):
      """This test captures output of list_experiments."""
      project_path = str(tmpdir)
      num_experiments = 3
      for i in range(num_experiments):
          experiment_name = "test_lsx{}".format(i)
          tune.run(
              "__fake",
              name=experiment_name,
              stop={"training_iteration": 1},
              num_samples=1,
              storage_path=project_path,
          )
  
      limit = 2
      with Capturing() as output:
          commands.list_experiments(
              project_path, info_keys=("total_trials",), limit=limit
          )
      lines = output.captured
      assert "total_trials" in lines[1]
      assert lines[1].count("|") == 2
      assert len(lines) == 3 + limit + 1
  
      with Capturing() as output:
          commands.list_experiments(
              project_path,
              sort=["total_trials"],
              info_keys=("total_trials",),
              filter_op="total_trials == 1",
          )
      lines = output.captured
      assert sum("1" in line for line in lines) >= num_experiments
      assert len(lines) == 3 + num_experiments + 1
  
imports: import click
  import os
  import pytest
  import random
  import subprocess
  import sys
  import time
  from unittest import mock
  import ray
  import ray.train
  from ray import tune
  from ray.rllib import _register_all
  from ray.tune.cli import commands
  from ray.tune.result import CONFIG_PREFIX
  from ray.train.tests.util import create_dict_checkpoint
label_desc: Use image node_id 5 for calling a global function with example usage: test_lsx(start_ray, tmpdir) without return types