code: def monkey_patch(enabled=True):
      
  
      if enabled:
          Image.open = imdirect_open
      else:
          Image.open = pil_open
docs: Monkey patching PIL.Image.open method
  
      Args:
          enabled (bool): If the monkey patch should be activated or deactivated.