def get_file_content(url, comes_from=None, session=None):<EOL>
if session is None:<EOL><INDENT>raise TypeError(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>match = _scheme_re.search(url)<EOL>if match:<EOL><INDENT>scheme = match.group(<NUM_LIT:1>).lower()<EOL>if (scheme == '<STR_LIT:file>' and comes_from and<EOL>comes_from.startswith('<STR_LIT:http>')):<EOL><INDENT>raise InstallationError(<EOL>'<STR_LIT>'<EOL>% (comes_from, url))<EOL><DEDENT>if scheme == '<STR_LIT:file>':<EOL><INDENT>path = url.split('<STR_LIT::>', <NUM_LIT:1>)[<NUM_LIT:1>]<EOL>path = path.replace('<STR_LIT:\\>', '<STR_LIT:/>')<EOL>match = _url_slash_drive_re.match(path)<EOL>if match:<EOL><INDENT>path = match.group(<NUM_LIT:1>) + '<STR_LIT::>' + path.split('<STR_LIT:|>', <NUM_LIT:1>)[<NUM_LIT:1>]<EOL><DEDENT>path = urllib_parse.unquote(path)<EOL>if path.startswith('<STR_LIT:/>'):<EOL><INDENT>path = '<STR_LIT:/>' + path.lstrip('<STR_LIT:/>')<EOL><DEDENT>url = path<EOL><DEDENT>else:<EOL><INDENT>resp = session.get(url)<EOL>resp.raise_for_status()<EOL>return resp.url, resp.text<EOL><DEDENT><DEDENT>try:<EOL><INDENT>with open(url, '<STR_LIT:rb>') as f:<EOL><INDENT>content = auto_decode(f.read())<EOL><DEDENT><DEDENT>except IOError as exc:<EOL><INDENT>raise InstallationError(<EOL>'<STR_LIT>' % str(exc)<EOL>)<EOL><DEDENT>return url, content<EOL>
Gets the content of a file; it may be a filename, file: URL, or
    http: URL.  Returns (location, content).  Content is unicode.

    :param url:         File path or url.
    :param comes_from:  Origin description of requirements.
    :param session:     Instance of pip.download.PipSession.