code: def new(img, readonly=False):
      access_type = mode_map.get(img.mode, None)
      if not access_type:
          logger.debug("PyAccess Not Implemented: %s", img.mode)
          return None
      return access_type(img, readonly)
  
imports: from __future__ import annotations
  import logging
  import sys
  from ._deprecate import deprecate
label_desc: Use image node_id 1 for calling a global function with example usage: new(img, readonly) and returns: access_type, None