class_docstr: Base for image providers: handle pathname and filename & URLs
class_docstr_tok: ["Base","for","image","providers",":","handle","pathname","and","filename","&","URLs"]
docstr: Release any image memory
  
  Possibly delete the temporary file
docstr_tok: ["Release","any","image","memory","Possibly","delete","the","temporary","file"]
code: def release_memory(self):
      """Release any image memory
  
      Possibly delete the temporary file"""
      if self.__is_cached:
          if is_matlab_file(self.__filename) or is_numpy_file(
              self.__filename
          ):
              try:
                  os.remove(self.__cached_file)
              except:
                  LOGGER.warning(
                      "Could not delete file %s",
                      self.__cached_file,
                      exc_info=True,
                  )
          self.__is_cached = False
          self.__cacheing_tried = False
          self.__cached_file = None
  
      rdr = self.get_reader(create=False)
      if rdr is not None:
          rdr.close()
          self.__reader = None
          if self in ACTIVE_READERS:
              ACTIVE_READERS.remove(self)
      self.__image = None
  
imports: import atexit
  import hashlib
  import logging
  import os
  import tempfile
  import urllib.parse
  import urllib.request
  import weakref
  import numpy
  import cellprofiler_core.preferences
  from .._abstract_image import AbstractImage
  from ..._image import Image
  from ....reader import get_image_reader, get_image_reader_class
  from ....utilities.image import is_numpy_file, download_to_temp_file
  from ....utilities.image import is_matlab_file
  from ....utilities.image import loadmat
  from ....utilities.image import load_data_file
  from ....utilities.image import generate_presigned_url
  from ....constants.image import FILE_SCHEME, PASSTHROUGH_SCHEMES
  from ....utilities.pathname import pathname2url, url2pathname
label_desc: Use image node_id 18 for calling the FileImage obj's underlying member method code with example usage: obj.release_memory() without return types