code: def aws_start_instance(self):
      assert self.env
  
      if not self.aws_instance_name:
          self.aws_instance_name = (
              f"repro_ci_{self.build_id}_{self.job_id[:8]}"
          )
          self.logger.info(
              f"No instance name provided, using {self.aws_instance_name}"
          )
  
      instance_type = self.env[
          "BUILDKITE_AGENT_META_DATA_AWS_INSTANCE_TYPE"
      ]
      instance_ami = self.env["BUILDKITE_AGENT_META_DATA_AWS_AMI_ID"]
      instance_sg = "sg-0ccfca2ef191c04ae"
      instance_block_device_mappings = [
          {"DeviceName": "/dev/xvda", "Ebs": {"VolumeSize": 500}}
      ]
  
      # Check if instance exists:
      running_instances = self.ec2_resource.instances.filter(
          Filters=[
              {"Name": "tag:Name", "Values": [self.aws_instance_name]},
              {"Name": "instance-state-name", "Values": ["running"]},
          ]
      )
  
      self.logger.info(
          f"Check if instance with name {self.aws_instance_name} "
          f"already exists..."
      )
  
      for instance in running_instances:
          self.aws_instance_id = instance.id
          self.aws_instance_ip = instance.public_ip_address
          self.logger.info(
              f"Found running instance {self.aws_instance_id}."
          )
          return
  
      self.logger.info(
          f"Instance with name {self.aws_instance_name} not found, "
          f"creating..."
      )
  
      # Else, not running, yet, start.
      instance = self.ec2_resource.create_instances(
          BlockDeviceMappings=instance_block_device_mappings,
          ImageId=instance_ami,
          InstanceType=instance_type,
          KeyName=self.ssh_key_name,
          SecurityGroupIds=[instance_sg],
          TagSpecifications=[
              {
                  "ResourceType": "instance",
                  "Tags": [
                      {"Key": "Name", "Value": self.aws_instance_name}
                  ],
              }
          ],
          MinCount=1,
          MaxCount=1,
      )[0]
  
      self.aws_instance_id = instance.id
      self.logger.info(
          f"Created new instance with ID {self.aws_instance_id}"
      )
  
imports: import base64
  import json
  import logging
  import os
  import random
  import re
  import shlex
  import subprocess
  import threading
  import time
  from numbers import Number
  from typing import Any, Dict, List, Optional, Callable
  import boto3
  import click
  import paramiko
  import yaml
  from pybuildkite.buildkite import Buildkite
label_desc: Use image node_id 4 for calling the ReproSession obj's underlying member method code with example usage: obj.aws_start_instance() without return types