code: def __init__(self, cred_dict):
      self.logger = logs.get_logger(self.__class__.__name__)
      self.logger.setLevel(storage_setup.get_storage_verbose_level())
  
      self.type = None
      self.key = None
      self.secret_key = None
      self.session_token = None
      self.region = None
      self.profile = None
      if cred_dict is None:
          return
  
      if isinstance(cred_dict, str) and cred_dict == "none":
          return
  
      if not isinstance(cred_dict, dict):
          msg: str = "NOT SUPPORTED credentials format {0}".format(
              repr(cred_dict)
          )
          util.report_fatal(msg, self.logger)
  
      if len(cred_dict) == 0:
          # Empty credentials dictionary is like None:
          return
  
      if len(cred_dict) == 1 and AWS_TYPE in cred_dict.keys():
          aws_creds = cred_dict[AWS_TYPE]
          self.type = AWS_TYPE
          self.key = aws_creds.get(AWS_KEY, None)
          self.secret_key = aws_creds.get(AWS_SECRET_KEY, None)
          self.session_token = aws_creds.get(AWS_SESSION_TOKEN, None)
          self.region = self._get_named(AWS_REGION, aws_creds)
          self.profile = self._get_named(AWS_PROFILE, aws_creds)
  
          if self.key is None or self.secret_key is None:
              msg: str = "INVALID aws credentials format {0}".format(
                  repr(cred_dict)
              )
              util.report_fatal(msg, self.logger)
      else:
          msg: str = "NOT SUPPORTED credentials format {0}".format(
              repr(cred_dict)
          )
          util.report_fatal(msg, self.logger)
  
file_path: studio/studio/credentials/credentials.py
imports: import hashlib
  from typing import Dict
  from studio.util import logs, util
  from studio.storage import storage_setup
label_desc: Use image node_id 1 to create a new Credentials object  with example: obj = Credentials(cred_dict)