code: def optimize(dirpath, filename):
      
      filepath = os.path.join(dirpath, filename)
      logger.info('optimizing %s', filepath)
  
      ext = os.path.splitext(filename)[1]
      command, silent, verbose = COMMANDS[ext]
      flags = verbose if SHOW_OUTPUT else silent
      command = command.format(filename=filepath, flags=flags)
      call(command, shell=True)
docs: Check if the name is a type of file that should be optimized.
      And optimizes it if required.
  
      :param dirpath: Path of the file to be optimzed
      :param name: A file name to be optimized