class_docstr: Creates ResourceManager object
  
  This class should be only created by arena instance to manage its resources.
  
  Parameters
  ----------
  arena : dalex.Arena
      Instance of Arena.
  
  Attributes
  --------
  arena : Arena
      Instance of dalex.Arena
  cache : list of Resource objects
      List of already requested resources (both calculated and in progress)
  mutex : _thread.lock
      Mutex for params, plots and resources cache. Should be common with mutex from Arena instance.
  resources : list of classes extending PlotContainer
      List of available resource classes
docstr: Clears cache
  
  Parameters
  -----------
  resource_type : str or None
      If None all cache is cleared. Otherwise only resources with
      provided resource_type are removed.
  
  Notes
  -------
  This function must be called from mutex context
docstr_tok: ["Clears","cache","Parameters","--","--","--","--","--","-","resource_type",":","str","or","None","If","None","all","cache","is","cleared",".","Otherwise","only","resources","with","provided","resource_type","are","removed",".","Notes","--","--","--","-","This","function","must","be","called","from","mutex","context"]
code: def clear_cache(self, resource_type=None):
      """Clears cache
  
      Parameters
      -----------
      resource_type : str or None
          If None all cache is cleared. Otherwise only resources with
          provided resource_type are removed.
  
      Notes
      -------
      This function must be called from mutex context
      """
      if resource_type is None:
          for r in self.cache:
              r.cancel()
          self.cache = []
      else:
          for r in self.cache:
              if r.resource_type == resource_type:
                  r.cancel()
          self.cache = list(
              filter(
                  lambda r: r.resource_type != resource_type, self.cache
              )
          )
      self.arena.update_timestamp()
  
file_path: DALEX/python/dalex/dalex/arena/_resource_manager.py
imports: from ._resource import Resource
  from .None import resources
label_desc: Use image node_id 4 for calling the ResourceManager obj's underlying member method code with example usage: obj.clear_cache(resource_type) without return types