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: Check Train Task Status
  
  :param check_if_running: Fast mode.  Only check if training is Running
  :return: boolean if check_if_running is enabled; else json response that contains of full details
docstr_tok: ["Check","Train","Task","Status",":","param","check_if_running",":","Fast","mode",".","Only","check","if","training","is","Running",":","return",":","boolean","if","check_if_running","is","enabled",";","else","json","response","that","contains","of","full","details"]
code: def train_status(self, check_if_running=False):
      """
      Check Train Task Status
  
      :param check_if_running: Fast mode.  Only check if training is Running
      :return: boolean if check_if_running is enabled; else json response that contains of full details
      """
      selector = "/train/"
      if check_if_running:
          selector += "?check_if_running=true"
      status, response, _, _ = MONAILabelUtils.http_method(
          "GET", self._server_url, selector, headers=self._headers
      )
      if check_if_running:
          return status == 200
  
      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 22 for calling the MONAILabelClient obj's underlying member method code with example usage: obj.train_status(check_if_running) and returns: json, unknown