def _get_document(self, source):
scheme_url = source<EOL>if not source.startswith("<STR_LIT:http>"):<EOL><INDENT>scheme_url = "<STR_LIT>" % source<EOL><DEDENT>text = source<EOL>try:<EOL><INDENT>text = urllib.urlopen(scheme_url).read()<EOL><DEDENT>except:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>return (text, scheme_url)<EOL><DEDENT>try:<EOL><INDENT>text = open(source, "<STR_LIT:r>").read()<EOL><DEDENT>except:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>return (text, source)<EOL><DEDENT>return (text, None)<EOL>
helper, open a file or url and return the content and identifier