class_docstr: Delete older distributions
class_docstr_tok: ["Delete","older","distributions"]
code: def run(self):
      self.run_command("egg_info")
      from glob import glob
  
      for pattern in self.match:
          pattern = self.distribution.get_name() + "*" + pattern
          files = glob(os.path.join(self.dist_dir, pattern))
          files = [(os.path.getmtime(f), f) for f in files]
          files.sort()
          files.reverse()
  
          log.info("%d file(s) matching %s", len(files), pattern)
          files = files[self.keep :]
          for t, f in files:
              log.info("Deleting %s", f)
              if not self.dry_run:
                  if os.path.isdir(f):
                      shutil.rmtree(f)
                  else:
                      os.unlink(f)
  
file_path: catboost/contrib/python/setuptools/py3/setuptools/command/rotate.py
imports: from distutils.util import convert_path
  from distutils import log
  from distutils.errors import DistutilsOptionError
  import os
  import shutil
  from setuptools import Command
label_desc: Use image node_id 3 for calling the rotate obj's underlying member method code with example usage: obj.run() without return types