def _read(obj):
if _is_url(obj):<EOL><INDENT>with urlopen(obj) as url:<EOL><INDENT>text = url.read()<EOL><DEDENT><DEDENT>elif hasattr(obj, '<STR_LIT>'):<EOL><INDENT>text = obj.read()<EOL><DEDENT>elif isinstance(obj, (str, bytes)):<EOL><INDENT>text = obj<EOL>try:<EOL><INDENT>if os.path.isfile(text):<EOL><INDENT>with open(text, '<STR_LIT:rb>') as f:<EOL><INDENT>return f.read()<EOL><DEDENT><DEDENT><DEDENT>except (TypeError, ValueError):<EOL><INDENT>pass<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise TypeError("<STR_LIT>" % type(obj).__name__)<EOL><DEDENT>return text<EOL>
Try to read from a url, file or string.

    Parameters
    ----------
    obj : str, unicode, or file-like

    Returns
    -------
    raw_text : str