code: def cli():
      """The PennyLane device test command line interface.
  
      The ``pl-device-test`` CLI is a convenience wrapper that calls
      pytest for a particular device.
  
      .. code-block:: console
  
          $ pl-device-test --help
          usage: pl-device-test [-h] [--device DEVICE] [--shots SHOTS]
                                [--skip-ops]
  
          See below for available options and commands for working with the PennyLane
          device tests.
  
          General Options:
            -h, --help           show this help message and exit
            --device DEVICE      The device to test.
            --shots SHOTS        Number of shots to use in stochastic mode.
            --skip-ops           Skip tests that use unsupported device operations.
            --flaky-report       Show the flaky report in the terminal
            --device-kwargs KEY=VAL [KEY=VAL ...]
                                 Additional device kwargs.
  
      Note that additional pytest command line arguments and flags can also be passed:
  
      .. code-block:: console
  
          $ pl-device-test --device default.qubit --shots 1234 --tb=short -x
      """
      from .conftest import pytest_addoption
  
      parser = argparse.ArgumentParser(
          description="See below for available options and commands for working with the PennyLane device tests."
      )
      parser._optionals.title = (
          "General Options"  # pylint: disable=protected-access
      )
      pytest_addoption(parser)
      args, pytest_args = parser.parse_known_args()
  
      flaky = False
      if "--flaky-report" in pytest_args:
          pytest_args.remove("--flaky-report")
          flaky = True
  
      test_device(
          device_name=args.device,
          shots=args.shots,
          skip_ops=args.skip_ops,
          flaky_report=flaky,
          pytest_args=pytest_args,
          **args.device_kwargs,
      )
  
imports: import argparse
  import pathlib
  import subprocess
  import sys
  import __main__
label_desc: Use image node_id 3 for calling a global function with example usage: cli() without return types