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"]
code: def download_label(self, label_id, tag):
      selector = "/datastore/label?label={}&tag={}".format(
          MONAILabelUtils.urllib_quote_plus(label_id),
          MONAILabelUtils.urllib_quote_plus(tag),
      )
      status, response, _, headers = MONAILabelUtils.http_method(
          "GET", self._server_url, selector, headers=self._headers
      )
      if status != 200:
          raise MONAILabelClientException(
              MONAILabelError.SERVER_ERROR,
              f"Status: {status}; Response: {bytes_to_str(response)}",
              status,
              response,
          )
  
      content_disposition = headers.get("content-disposition")
  
      if not content_disposition:
          logging.warning(
              "Filename not found. Fall back to no loaded labels"
          )
      file_name = MONAILabelUtils.get_filename(content_disposition)
  
      file_ext = "".join(Path(file_name).suffixes)
      local_filename = tempfile.NamedTemporaryFile(
          dir=self._tmpdir, suffix=file_ext
      ).name
      with open(local_filename, "wb") as f:
          f.write(response)
  
      return local_filename
  
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 17 for calling the MONAILabelClient obj's underlying member method code with example usage: obj.download_label(label_id, tag) and returns: local_filename