class_docstr: Generate a LORIS API token by making a request to the
  LORIS login API endpoint with the given username
  and password.
  
  url is the complete URL of the $LORIS/api/$VERSION/login
  endpoint.
code: def generate_token(self, user=None, password=None):
      data = {"username": user, "password": password}
      encoded_data = json.dumps(data).encode("utf-8")
  
      request = Request(self.url, encoded_data)
  
      try:
          response = urlopen(request)
      except HTTPError:
          raise AccessDeniedError("Could not authenticate into LORIS")
  
      str_response = ensure_unicode(response.read())
      data = json.loads(str_response)
      return data["token"]
  
file_path: datalad/datalad/support/third/loris_token_generator.py
imports: import sys
  import json
  from urllib.request import Request, urlopen
  from urllib.error import HTTPError
  from datalad.support.exceptions import AccessDeniedError
  from datalad.utils import ensure_unicode
label_desc: Use image node_id 2 for calling the LORISTokenGenerator obj's underlying member method code with example usage: obj.generate_token(user, password) and returns: data