class_docstr: Basic MONAILabel Client to invoke infer/train APIs over http/https
class_docstr_tok: ["Basic","MONAILabel","Client","to","invoke","infer\/train","APIs","over","http\/https"]
docstr: Save/Submit Label
  
  :param image_id: Image Id for which label needs to saved/submitted
  :param label_in: Label File path which shall be saved/submitted
  :param tag: Save label against tag in datastore
  :param params: Additional JSON params for the request
  :return: json response
docstr_tok: ["Save\/Submit","Label",":","param","image_id",":","Image","Id","for","which","label","needs","to","saved\/submitted",":","param","label_in",":","Label","File","path","which","shall","be","saved\/submitted",":","param","tag",":","Save","label","against","tag","in","datastore",":","param","params",":","Additional","JSON","params","for","the","request",":","return",":","json","response"]
code: def save_label(self, image_id, label_in, tag="", params=None):
      """
      Save/Submit Label
  
      :param image_id: Image Id for which label needs to saved/submitted
      :param label_in: Label File path which shall be saved/submitted
      :param tag: Save label against tag in datastore
      :param params: Additional JSON params for the request
      :return: json response
      """
      selector = f"/datastore/label?image={MONAILabelUtils.urllib_quote_plus(image_id)}"
      if tag:
          selector += f"&tag={MONAILabelUtils.urllib_quote_plus(tag)}"
  
      params = self._update_client_id(params)
      fields = {
          "params": json.dumps(params),
      }
      files = {"label": label_in}
  
      status, response, _, _ = MONAILabelUtils.http_multipart(
          "PUT",
          self._server_url,
          selector,
          fields,
          files,
          headers=self._headers,
      )
      if status != 200:
          raise MONAILabelClientException(
              MONAILabelError.SERVER_ERROR,
              f"Status: {status}; Response: {bytes_to_str(response)}",
          )
  
      response = bytes_to_str(response)
      logging.debug(f"Response: {response}")
      return json.loads(response)
  
imports: import cgi
  import http.client
  import json
  import logging
  import mimetypes
  import os
  import re
  import ssl
  import tempfile
  from pathlib import Path
  from urllib.parse import quote_plus, unquote, urlencode, urlparse
  import requests
label_desc: Use image node_id 15 for calling the MONAILabelClient obj's underlying member method code with example usage: obj.save_label(image_id, label_in, tag, params) and returns: json