code: def pytest_generate_tests(metafunc):
      """Set up device_kwargs fixture from command line options.
  
      The fixture defines a dictionary of keyword argument that can be used to instantiate
      a device via `qml.device(**device_kwargs)` in the test. This allows us to potentially
      change kwargs in the test before creating the device.
      """
  
      opt = metafunc.config.option
  
      list_of_device_kwargs = []
  
      if opt.device is None:
          devices_to_test = LIST_CORE_DEVICES
      else:
          devices_to_test = [opt.device]
  
      for dev in devices_to_test:
          device_kwargs = {"name": dev}
  
          # if shots specified in command line,
          # add to the device kwargs
          if opt.shots is not None:
              # translate command line string to None if necessary
              device_kwargs["shots"] = (
                  None if (opt.shots == "None") else int(opt.shots)
              )
  
          # store user defined device kwargs
          device_kwargs.update(opt.device_kwargs)
  
          list_of_device_kwargs.append(device_kwargs)
  
      # define the device_kwargs parametrization:
      # all tests that take device_kwargs as an argument will be
      # run on the different fixtures
      if "device_kwargs" in metafunc.fixturenames:
          metafunc.parametrize("device_kwargs", list_of_device_kwargs)
  
file_path: pennylane/pennylane/devices/tests/conftest.py
imports: import argparse
  import os
  import numpy
  import pytest
  from _pytest.runner import pytest_runtest_makereport
  import pennylane
label_desc: Use image node_id 8 for calling a global function with example usage: pytest_generate_tests(metafunc) without return types