code: def _add_callback(func, target):
      # type: (Callable, Dict[int, Callable]) -> int
  
      if func in target.values():
          return [k for k, v in target.items() if v == func][0]
  
      while True:
          h = randint(0, 1 << 31)
          if h not in target:
              break
  
      target[h] = func
      return h
  
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 1 for calling the WeightsFileHandler obj's underlying member method code with example usage: obj._add_callback(func, target) and returns: h, unknown