parameters: (self, export_dir_base)
docstring: Deletes older exports, retaining only a given number of the most recent.
  
      Export subdirectories are assumed to be named with monotonically increasing
      integers; the most recent are taken to be those with the largest values.
  
      Args:
        export_dir_base: the base directory under which each export is in a
          versioned subdirectory.
docstring_summary: Deletes older exports, retaining only a given number of the most recent.
docstring_tokens: Deletes older exports retaining only a given number of the most recent .
function: def _garbage_collect_exports(self, export_dir_base):
      """Deletes older exports, retaining only a given number of the most recent.
  
      Export subdirectories are assumed to be named with monotonically increasing
      integers; the most recent are taken to be those with the largest values.
  
      Args:
        export_dir_base: the base directory under which each export is in a
          versioned subdirectory.
      """
      if self._exports_to_keep is None:
        return
  
      def _export_version_parser(path):
        # create a simple parser that pulls the export_version from the directory.
        filename = os.path.basename(path.path)
        if not (len(filename) == 10 and filename.isdigit()):
          return None
        return path._replace(export_version=int(filename))
  
      # pylint: disable=protected-access
      keep_filter = gc._largest_export_versions(self._exports_to_keep)
      delete_filter = gc._negation(keep_filter)
      for p in delete_filter(
          gc._get_paths(export_dir_base, parser=_export_version_parser)):
        try:
          gfile.DeleteRecursively(p.path)
        except errors_impl.NotFoundError as e:
          tf_logging.warn('Can not delete %s recursively: %s', p.path, e)
function_tokens: def _garbage_collect_exports ( self , export_dir_base ) : if self . _exports_to_keep is None : return def _export_version_parser ( path ) : # create a simple parser that pulls the export_version from the directory. filename = os . path . basename ( path . path ) if not ( len ( filename ) == 10 and filename . isdigit ( ) ) : return None return path . _replace ( export_version = int ( filename ) ) # pylint: disable=protected-access keep_filter = gc . _largest_export_versions ( self . _exports_to_keep ) delete_filter = gc . _negation ( keep_filter ) for p in delete_filter ( gc . _get_paths ( export_dir_base , parser = _export_version_parser ) ) : try : gfile . DeleteRecursively ( p . path ) except errors_impl . NotFoundError as e : tf_logging . warn ( 'Can not delete %s recursively: %s' , p . path , e )