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: Create New Session
  
  :param image_in: filepath for image to be sent to server as part of session creation
  :param params: additional JSON params as part of session reqeust
  :return: json response which contains session id and other details
docstr_tok: ["Create","New","Session",":","param","image_in",":","filepath","for","image","to","be","sent","to","server","as","part","of","session","creation",":","param","params",":","additional","JSON","params","as","part","of","session","reqeust",":","return",":","json","response","which","contains","session","id","and","other","details"]
code: def create_session(self, image_in, params=None):
      """
      Create New Session
  
      :param image_in: filepath for image to be sent to server as part of session creation
      :param params: additional JSON params as part of session reqeust
      :return: json response which contains session id and other details
      """
      selector = "/session/"
      params = self._update_client_id(params)
  
      status, response, _ = MONAILabelUtils.http_upload(
          "PUT",
          self._server_url,
          selector,
          params,
          [image_in],
          headers=self._headers,
      )
      if status != 200:
          raise MONAILabelClientException(
              MONAILabelError.SERVER_ERROR,
              f"Status: {status}; Response: {bytes_to_str(response)}",
              status,
              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 11 for calling the MONAILabelClient obj's underlying member method code with example usage: obj.create_session(image_in, params) and returns: json