class_docstr: Memory context to provide caching for interfaces
  
  Parameters
  ==========
  base_dir: string
      The directory name of the location for the caching
  
  Methods
  =======
  cache
      Creates a cacheable function from an nipype Interface class
  clear_previous_runs
      Removes from the disk all the runs that where not used after
      the creation time of the specific Memory instance
  clear_previous_runs
      Removes from the disk all the runs that where not used after
      the given time
class_docstr_tok: ["Memory","context","to","provide","caching","for","interfaces","Parameters","==========","base_dir",":","string","The","directory","name","of","the","location","for","the","caching","Methods","=======","cache","Creates","a","cacheable","function","from","an","nipype","Interface","class","clear_previous_runs","Removes","from","the","disk","all","the","runs","that","where","not","used","after","the","creation","time","of","the","specific","Memory","instance","clear_previous_runs","Removes","from","the","disk","all","the","runs","that","where","not","used","after","the","given","time"]
docstr: Remove all the cache that where not used in the latest run of
  the memory object: i.e. since the corresponding Python object
  was created.
  
  Parameters
  ==========
  warn: boolean, optional
      If true, echoes warning messages for all directory
      removed
docstr_tok: ["Remove","all","the","cache","that","where","not","used","in","the","latest","run","of","the","memory","object",":","i.e",".","since","the","corresponding","Python","object","was","created",".","Parameters","==========","warn",":","boolean",",","optional","If","true",",","echoes","warning","messages","for","all","directory","removed"]
code: def clear_previous_runs(self, warn=True):
      """Remove all the cache that where not used in the latest run of
      the memory object: i.e. since the corresponding Python object
      was created.
  
      Parameters
      ==========
      warn: boolean, optional
          If true, echoes warning messages for all directory
          removed
      """
      base_dir = self.base_dir
      latest_runs = read_log(os.path.join(base_dir, "log.current"))
      self._clear_all_but(latest_runs, warn=warn)
  
imports: import os
  import hashlib
  import pickle
  import time
  import shutil
  import glob
  from ..interfaces.base import BaseInterface
  from ..pipeline.engine import Node
  from ..pipeline.engine.utils import modify_paths
label_desc: Use image node_id 4 for calling the Memory obj's underlying member method code with example usage: obj.clear_previous_runs(warn) without return types