code: def defenv(**options):
      """Create a default environment if necessary."""
      if local._env:
          log.debug("GDAL environment exists: %r", local._env)
      else:
          log.debug("No GDAL environment exists")
          local._env = GDALEnv()
          local._env.update_config_options(**options)
          log.debug("New GDAL environment %r created", local._env)
      local._env.start()
  
imports: from functools import wraps, total_ordering
  from inspect import getfullargspec
  import logging
  import os
  import re
  import threading
  import warnings
  import attr
  from rasterio._env import GDALEnv, get_gdal_config, set_gdal_config, GDALDataFinder, PROJDataFinder, set_proj_data_search_path
  from rasterio._version import gdal_version
  from rasterio.errors import EnvError, GDALVersionError, RasterioDeprecationWarning
  from rasterio.session import Session, DummySession
label_desc: Use image node_id 1 for calling a global function with example usage: defenv() without return types