def ends_in_file(path):
 _RE_ENDEXT = re.compile('\\.%ext[{}]*$', re.I)
 _RE_ENDFN = re.compile('%fn[{}]*$', re.I)
 return bool((_RE_ENDEXT.search(path) or _RE_ENDFN.search(path)))

def ends_in_file ( path ) : _RE_ENDEXT = re . compile ( '\\.%ext[{}]*$' , re . I ) _RE_ENDFN = re . compile ( '%fn[{}]*$' , re . I ) return bool ( ( _RE_ENDEXT . search ( path ) or _RE_ENDFN . search ( path ) ) )
return true when path ends with .