def boto_supports_associate_public_ip_address(ec2):
 try:
  network_interface = boto.ec2.networkinterface.NetworkInterfaceSpecification()
  getattr(network_interface, 'associate_public_ip_address')
  return True
 except AttributeError:
  return False

def boto_supports_associate_public_ip_address ( ec2 ) : try : network_interface = boto . ec2 . networkinterface . NetworkInterfaceSpecification ( ) getattr ( network_interface , 'associate_public_ip_address' ) return True except AttributeError : return False
check if boto library has associate_public_ip_address in the networkinterfacespecification class .