code: def _process_configuration(comments):
      """Extract sampling information."""
      results = {
          "comments": "\n".join(comments),
          "stan_version": {},
      }
  
      comments_gen = iter(comments)
  
      for comment in comments_gen:
          comment = re.sub(
              r"^\s*#\s*|\s*\(Default\)\s*$", "", comment
          ).strip()
          if comment.startswith("stan_version_"):
              key, val = re.sub(
                  r"^\s*stan_version_", "", comment
              ).split("=")
              results["stan_version"][key.strip()] = val.strip()
          elif comment.startswith("Step size"):
              _, val = comment.split("=")
              results["step_size"] = float(val.strip())
          elif "inverse mass matrix" in comment:
              comment = re.sub(
                  r"^\s*#\s*", "", next(comments_gen)
              ).strip()
              results["inverse_mass_matrix"] = [
                  float(item) for item in comment.split(",")
              ]
          elif ("seconds" in comment) and any(
              item in comment
              for item in ("(Warm-up)", "(Sampling)", "(Total)")
          ):
              value = re.sub(
                  (
                      r"^Elapsed\s*Time:\s*|"
                      r"\s*seconds\s*\(Warm-up\)\s*|"
                      r"\s*seconds\s*\(Sampling\)\s*|"
                      r"\s*seconds\s*\(Total\)\s*"
                  ),
                  "",
                  comment,
              )
              key = (
                  "warmup_time_seconds"
                  if "(Warm-up)" in comment
                  else "sampling_time_seconds"
                  if "(Sampling)" in comment
                  else "total_time_seconds"
              )
              results[key] = float(value)
          elif "=" in comment:
              match_int = re.search(
                  r"^(\S+)\s*=\s*([-+]?[0-9]+)$", comment
              )
              match_float = re.search(
                  r"^(\S+)\s*=\s*([-+]?[0-9]+\.[0-9]+)$", comment
              )
              match_str = re.search(r"^(\S+)\s*=\s*(\S+)$", comment)
              match_empty = re.search(r"^(\S+)\s*=\s*$", comment)
              if match_int:
                  key, value = match_int.group(1), match_int.group(2)
                  results[key] = int(value)
              elif match_float:
                  key, value = match_float.group(1), match_float.group(
                      2
                  )
                  results[key] = float(value)
              elif match_str:
                  key, value = match_str.group(1), match_str.group(2)
                  results[key] = value
              elif match_empty:
                  key = match_empty.group(1)
                  results[key] = None
  
      results = {key: str(results[key]) for key in sorted(results)}
      return results
  
imports: import logging
  import os
  import re
  from collections import defaultdict
  from glob import glob
  from pathlib import Path
  from typing import Dict, List, Optional, Union
  import numpy
  from ..None import utils
  from ..rcparams import rcParams
  from .base import CoordSpec, DimSpec, dict_to_dataset, infer_stan_dtypes, requires
  from .inference_data import InferenceData
label_desc: Use image node_id 2 for calling a global function with example usage: _process_configuration(comments) and returns: results