code: def nnabla_opts(request):
      """Parse options and expose as a fixture.
  
      Returns: NNablaOpts
          An  object which has ext, ext_kwargs, benchmark_output_dir and
          function_benchmark_writer as attributes.
      """
      from collections import namedtuple
      from function_benchmark import FunctionBenchmarkCsvWriter
  
      getoption = request.config.getoption
      ext = getoption("--nnabla-ext")
      ext_kwargs = dict(
          device_id=getoption("--nnabla-ext-device-id"),
          type_config=getoption("--nnabla-ext-type-config"),
      )
      benchmark_output_dir = getoption("--nnabla-benchmark-output")
      if not os.path.isdir(benchmark_output_dir):
          os.makedirs(benchmark_output_dir)
      function_benchmark_name = "function_{}_{}_{}.csv".format(
          ext.replace(".", "-"),
          ext_kwargs["device_id"],
          ext_kwargs["type_config"],
      )
      function_benchmark_file = os.path.join(
          benchmark_output_dir, function_benchmark_name
      )
      function_benchmark_writer = FunctionBenchmarkCsvWriter(
          open(function_benchmark_file, "w")
      )
  
      NNablaOpts = namedtuple(
          "NNablaOpts",
          [
              "ext",
              "ext_kwargs",
              "benchmark_output_dir",
              "function_benchmark_writer",
          ],
      )
      return NNablaOpts(
          ext,
          ext_kwargs,
          benchmark_output_dir,
          function_benchmark_writer,
      )
  
label_desc: Use image node_id 2 for calling a global function with example usage: nnabla_opts(request) and returns: NNablaOpts