docstr: Add a post-save/load callback for weights files and return its handle.
  If the callback was already added, return the existing handle.
  
  :param callback_function: A function accepting action type ("load" or "save"),
      callback_function('load' or 'save', WeightsFileHandler.ModelInfo) -> WeightsFileHandler.ModelInfo
  :return Callback handle
docstr_tok: ["Add","a","post-save\/load","callback","for","weights","files","and","return","its","handle",".","If","the","callback","was","already","added",",","return","the","existing","handle",".",":","param","callback_function",":","A","function","accepting","action","type","(","``","load","''","or","``","save","''",")",",","callback_function","(","'load","'","or","'save","'",",","WeightsFileHandler.ModelInfo",")","-",">","WeightsFileHandler.ModelInfo",":","return","Callback","handle"]
code: def add_post_callback(cls, callback_function):
      # type: (Callable[[Union[str, WeightsFileHandler.CallbackType], WeightsFileHandler.ModelInfo], WeightsFileHandler.ModelInfo]) -> int  # noqa
      """
      Add a post-save/load callback for weights files and return its handle.
      If the callback was already added, return the existing handle.
  
      :param callback_function: A function accepting action type ("load" or "save"),
          callback_function('load' or 'save', WeightsFileHandler.ModelInfo) -> WeightsFileHandler.ModelInfo
      :return Callback handle
      """
      return cls._add_callback(
          callback_function, cls._model_post_callbacks
      )
  
imports: import os
  import shutil
  import sys
  import threading
  from enum import Enum
  from random import randint
  from tempfile import mkstemp
  from typing import TYPE_CHECKING, Callable, Dict, Optional, Any, Union
  import six
  from pathlib2 import Path
  from ...backend_interface.model import Model
  from ...config import running_remotely
  from ...debugging.log import get_logger
  from ...model import InputModel, OutputModel
label_desc: Use image node_id 4 for calling the WeightsFileHandler obj's underlying member method code with example usage: obj.add_post_callback(cls, callback_function) and returns: cls