code: def rest_put(url, data, timeout, show_error=False):
      """Call rest put method"""
      try:
          response = requests.put(
              url,
              headers={
                  "Accept": "application/json",
                  "Content-Type": "application/json",
              },
              data=data,
              timeout=timeout,
          )
          return response
      except requests.exceptions.Timeout:
          print_error("Connect %s timeout." % url)
          return None
      except Exception as exception:
          if show_error:
              print_error(exception)
          return None
  
file_path: nni/nni/tools/nnictl/rest_utils.py
imports: import time
  import requests
  from .url_utils import check_status_url
  from .constants import REST_TIME_OUT
  from .common_utils import print_error
label_desc: Use image node_id 1 for calling a global function with example usage: rest_put(url, data, timeout, show_error) and returns: response, None, None