code: def getCredentials():
      import boto3
      import botocore
  
      endpoint_url = os.environ["MAVEN_PUBLISH_SECRET_ENDPOINT_URL"]
      secret_creds_name = os.environ[
          "MAVEN_PUBLISH_SECRET_NAME_CREDENTIALS"
      ]
      secret_key_name = os.environ["MAVEN_PUBLISH_SECRET_NAME_GPG"]
      region_name = os.environ["DOCKERHUB_SECRET_ENDPOINT_REGION"]
  
      session = boto3.Session()
      client = session.client(
          service_name="secretsmanager",
          region_name=region_name,
          endpoint_url=endpoint_url,
      )
      try:
          get_secret_value_response = client.get_secret_value(
              SecretId=secret_creds_name
          )
          get_secret_key_response = client.get_secret_value(
              SecretId=secret_key_name
          )
      except botocore.exceptions.ClientError as client_error:
          if (
              client_error.response["Error"]["Code"]
              == "ResourceNotFoundException"
          ):
              name = (
                  secret_key_name
                  if get_secret_value_response
                  else secret_creds_name
              )
              logging.exception(
                  "The requested secret %s was not found", name
              )
          elif (
              client_error.response["Error"]["Code"]
              == "InvalidRequestException"
          ):
              logging.exception("The request was invalid due to:")
          elif (
              client_error.response["Error"]["Code"]
              == "InvalidParameterException"
          ):
              logging.exception("The request had invalid params:")
          raise
      else:
          secret = get_secret_value_response["SecretString"]
          secret_dict = json.loads(secret)
          secret_key = get_secret_key_response["SecretString"]
          return secret_dict, secret_key
  
file_path: mxnet/ci/publish/scala/buildkey.py
imports: import os
  import json
  import logging
  import subprocess
label_desc: Use image node_id 1 for calling a global function with example usage: getCredentials() and returns: secret_dict,  secret_key