def is_module(name):
 for ext in CODE_FILES:
  if name.endswith(ext):
   return name[:(- len(ext))]

def is_module ( name ) : for ext in CODE_FILES : if name . endswith ( ext ) : return name [ : ( - len ( ext ) ) ]
is this a recognized module type? does this name end in one of the recognized code_files extensions? the file is assumed to exist .