def validate_key_names(key_names_list):
 for key_name in key_names_list:
  if (not VALID_KEY_NAME_REGEX.match(key_name)):
   return False
 return True

def validate_key_names ( key_names_list ) : for key_name in key_names_list : if ( not VALID_KEY_NAME_REGEX . match ( key_name ) ) : return False return True
validate each item of the list to match key name regex .