def assert_cloudtrail_arn_is_valid(trail_arn):
 pattern = re.compile('arn:.+:cloudtrail:.+:\\d{12}:trail/.+')
 if (not pattern.match(trail_arn)):
  raise ValueError(('Invalid trail ARN provided: %s' % trail_arn))

def assert_cloudtrail_arn_is_valid ( trail_arn ) : pattern = re . compile ( 'arn:.+:cloudtrail:.+:\\d{12}:trail/.+' ) if ( not pattern . match ( trail_arn ) ) : raise ValueError ( ( 'Invalid trail ARN provided: %s' % trail_arn ) )
ensures that the arn looks correct .