code: def pytest_addoption(parser):
      # Create options to selectively enable test groups
      def bool_env(name, default=None):
          value = os.environ.get(name.upper())
          if not value:  # missing or empty
              return default
          value = value.lower()
          if value in {"1", "true", "on", "yes", "y"}:
              return True
          elif value in {"0", "false", "off", "no", "n"}:
              return False
          else:
              raise ValueError(
                  "{}={} is not parsable as boolean".format(
                      name.upper(), value
                  )
              )
  
      for group in groups:
          default = bool_env(
              "PYARROW_TEST_{}".format(group), defaults[group]
          )
          parser.addoption(
              "--enable-{}".format(group),
              action="store_true",
              default=default,
              help=("Enable the {} test group".format(group)),
          )
          parser.addoption(
              "--disable-{}".format(group),
              action="store_true",
              default=False,
              help=("Disable the {} test group".format(group)),
          )
  
imports: import functools
  import os
  import pathlib
  import subprocess
  import sys
  import time
  import urllib.request
  import pytest
  from pytest_lazyfixture import lazy_fixture
  import hypothesis
  from ..conftest import groups, defaults
  from pyarrow import set_timezone_db_path
  from pyarrow.util import find_free_port
label_desc: Use image node_id 1 for calling a global function with example usage: pytest_addoption(parser) and returns: default, True, False