class_docstr: Manager for backend model objects
code: def _upload_model(
      self,
      model_file,
      async_enable=False,
      target_filename=None,
      cb=None,
  ):
      if not self.upload_storage_uri:
          raise ValueError(
              "Model has no storage URI defined (nowhere to upload to)"
          )
      target_filename = target_filename or Path(model_file).name
      dest_path = "/".join(
          (
              self.upload_storage_uri,
              self._upload_storage_suffix or ".",
              target_filename,
          )
      )
      result = StorageHelper.get(dest_path).upload(
          src_path=model_file,
          dest_path=dest_path,
          async_enable=async_enable,
          cb=partial(self._upload_callback, cb=cb),
          return_canonized=False,
      )
      if async_enable:
  
          def msg(num_results):
              self.log.info(
                  "Waiting for previous model to upload (%d pending, %s)"
                  % (num_results, dest_path)
              )
  
          self._add_async_result(
              result, wait_on_max_results=2, wait_cb=msg
          )
      return dest_path
  
imports: from collections import namedtuple
  from functools import partial
  import six
  from pathlib2 import Path
  from .base import IdObjectBase
  from .util import make_message
  from ..backend_api import Session
  from ..backend_api.services import models, tasks
  from ..storage import StorageManager
  from ..storage.helper import StorageHelper
  from ..utilities.async_manager import AsyncManagerMixin
label_desc: Use image node_id 7 for calling the Model obj's underlying member method code with example usage: obj._upload_model(model_file, async_enable, target_filename, cb) and returns: dest_path