code: def on_train_end(self, logs=None):
      self.tf_callback.on_train_end(logs)
      if self.copy_return == 0:
          if os.path.exists(
              os.path.dirname(self.local_checkpoint_path)
          ):
              shutil.rmtree(os.path.dirname(self.local_checkpoint_path))
      else:
          logger.warning(
              "Error when copy local checkpoint {} to {}, "
              "please get the local checkpoint manually".format(
                  self.local_checkpoint_path,
                  self.original_checkpoint_path,
              )
          )
  
imports: import os
  import logging
  import shutil
  import tensorflow
  from bigdl.orca.learn.utils import get_replaced_path
  from bigdl.orca.data.file import put_local_files_with_prefix_to_remote, put_local_dir_tree_to_remote, put_local_file_to_remote
label_desc: Use image node_id 4 for calling the ModelCheckpoint obj's underlying member method code with example usage: obj.on_train_end(logs) without return types