code: def _process_lay_line(line, section):
      """Process a line read from the Lay (INI) file.
  
      Each line in the .lay file will be processed
      into a structured ``status``, ``key`` and ``value``.
  
      Parameters
      ----------
      line : str
          The actual line in the Lay file.
      section : str
          The section in the Lay file.
  
      Returns
      -------
      status : int
          Returns the following integers based on status.
          -1  => unknown string found
          0   => empty line found
          1   => section found
          2   => key-value pair found
      key : str
          The string before the ``'='`` character. If section is "Comments",
          then returns the text comment description.
      value : str
          The string from the line after the ``'='`` character. If section is
          "Comments", then returns the onset and duration as a tuple.
  
      Notes
      -----
      The lay file comprises of multiple "sections" that are documented with
      bracket ``[]`` characters. For example, ``[FileInfo]`` and the lines
      afterward indicate metadata about the data file itself. Within
      each section, there are multiple lines in the format of
      ``<key>=<value>``.
  
      For ``FileInfo``, ``Patient`` and ``ChannelMap``
      each line will be denoted with a ``key`` and a ``value`` that
      can be represented as a dictionary. The keys describe what sort
      of data that line holds, while the values contain the corresponding
      value. In some cases, the ``value``.
  
      For ``SampleTimes``, the ``key`` and ``value`` pair indicate the
      start and end time in seconds of the original data file.
  
      For ``Comments`` section, this denotes an area where users through
      Persyst actually annotate data in time. These are instead
      represented as 5 data points that are ``,`` delimited. These
      data points are ordered as:
  
          1. time (in seconds) of the annotation
          2. duration (in seconds) of the annotation
          3. state (unused)
          4. variable type (unused)
          5. free-form text describing the annotation
      """
      key = ""  # default; only return value possibly not set
      line = line.strip()  # remove leading and trailing spaces
      end_idx = len(line) - 1  # get the last index of the line
  
      # empty sequence evaluates to false
      if not line:
          status = 0
          key = ""
          value = ""
          return status, key, value
      # section found
      elif (
          (line[0] == "[")
          and (line[end_idx] == "]")
          and (end_idx + 1 >= 3)
      ):
          status = 1
          value = line[1:end_idx].lower()
      # key found
      else:
          # handle Comments section differently from all other sections
          # TODO: utilize state and var_type in code.
          #  Currently not used
          if section == "comments":
              # Persyst Comments output 5 variables "," separated
              time_sec, duration, state, var_type, text = line.split(
                  ",", 4
              )
              status = 2
              key = text
              value = (time_sec, duration)
          # all other sections
          else:
              if "=" not in line:
                  raise RuntimeError(
                      "The line %s does not conform "
                      "to the standards. Please check the "
                      ".lay file." % line
                  )  # noqa
              pos = line.index("=")
              status = 2
  
              # the line now is composed of a
              # <key>=<value>
              key = line[0:pos]
              key.strip()
              value = line[pos + 1 : end_idx + 1]
              value.strip()
      return status, key, value
  
file_path: mne-python/mne/io/persyst/persyst.py
imports: import os
  import os.path
  from collections import OrderedDict
  from datetime import datetime, timezone
  import numpy
  from ..._fiff.constants import FIFF
  from ..._fiff.meas_info import create_info
  from ..._fiff.utils import _mult_cal_one
  from ...annotations import Annotations
  from ...utils import _check_fname, fill_doc, logger, verbose, warn
  from ..base import BaseRaw
label_desc: Use image node_id 4 for calling a global function with example usage: _process_lay_line(line, section) and returns: status,  key,  value, status,  key,  value