@outside_root_to_404<EOL><INDENT>def guess_type(self, path, allow_directory=True):<DEDENT>
if path.endswith('<STR_LIT>'):<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>elif allow_directory and self.dir_exists(path):<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>return '<STR_LIT:file>'<EOL><DEDENT>
Guess the type of a file.

If allow_directory is False, don't consider the possibility that the
file is a directory.