code: def get_s3_key_prefix(
      args: argparse.Namespace, subdir: str = ""
  ) -> str:
      """
      Returns the S3 key prefix given the arguments namespace
      :param args: The arguments passed in by the user or derived by the script
      :param subdir: An optional subdirectory in which to store the files. Post-pended to the end of the prefix.
      :return: A string containing the S3 key prefix to be used to uploading and downloading files to the artifact repository
      """
      prefix = "{git_sha}/{libtype}/{os}/{variant}/".format(
          **vars(args)
      )
      if subdir:
          return "{}{}/".format(prefix, subdir)
      return prefix
  
imports: import argparse
  import ctypes
  import glob
  import logging
  import os
  import re
  import sys
  from itertools import chain
  from subprocess import CalledProcessError, check_output
  from typing import Dict, List, Optional
  import boto3
  import botocore.exceptions
  import yaml
label_desc: Use image node_id 17 for calling a global function with example usage: get_s3_key_prefix(args, subdir) and returns: prefix, str