code: def stack_exists(args, *, stack_name):
      client = boto3.client(
          "cloudformation", region_name=args.aws_region
      )
      waiter = client.get_waiter("stack_exists")
      try:
          waiter.wait(
              StackName=stack_name, WaiterConfig={"MaxAttempts": 1}
          )
          return True
      except botocore.exceptions.WaiterError as e:
          return False
  
imports: import re
  import boto3
  import botocore
label_desc: Use image node_id 1 for calling a global function with example usage: stack_exists(args) and returns: True, False