code: def read_default_args(tool_name):
      
      global opinel_arg_dir
      
      profile_name = 'default'
      # h4ck to have an early read of the profile name
      for i, arg in enumerate(sys.argv):
          if arg == '--profile' and len(sys.argv) >= i + 1:
              profile_name = sys.argv[i + 1]
      #if not os.path.isdir(opinel_arg_dir):
      #    os.makedirs(opinel_arg_dir)            
      if not os.path.isdir(opinel_arg_dir):
          try:
              os.makedirs(opinel_arg_dir)
          except:
              # Within AWS Lambda, home directories are not writable. This attempts to detect that...
              #  ...and uses the /tmp folder, which *is* writable in AWS Lambda
              opinel_arg_dir = os.path.join(tempfile.gettempdir(), '.aws/opinel')
              if not os.path.isdir(opinel_arg_dir):
                  os.makedirs(opinel_arg_dir)
      opinel_arg_file = os.path.join(opinel_arg_dir, '%s.json' % profile_name)
      default_args = {}
      if os.path.isfile(opinel_arg_file):
          with open(opinel_arg_file, 'rt') as f:
              all_args = json.load(f)
          for target in all_args:
              if tool_name.endswith(target):
                  default_args.update(all_args[target])
          for k in all_args['shared']:
              if k not in default_args:
                  default_args[k] = all_args['shared'][k]
      return default_args
docs: Read default argument values for a given tool
  
      :param tool_name:                   Name of the script to read the default arguments for
      :return:                            Dictionary of default arguments (shared + tool-specific)