def should_validate(filename):
 for extension in INCLUDE_TYPES:
  if filename.endswith(extension):
   return True
 return False

def should_validate ( filename ) : for extension in INCLUDE_TYPES : if filename . endswith ( extension ) : return True return False
check if the filename is a type of file that should be validated .