def boto_supports_profile_name_arg(ec2):
 run_instances_method = getattr(ec2, 'run_instances')
 return ('instance_profile_name' in get_function_code(run_instances_method).co_varnames)

def boto_supports_profile_name_arg ( ec2 ) : run_instances_method = getattr ( ec2 , 'run_instances' ) return ( 'instance_profile_name' in get_function_code ( run_instances_method ) . co_varnames )
check if boto library has instance_profile_name argument .