def send(self, request, **kwargs):
<EOL>if request.method not in ("<STR_LIT:GET>", "<STR_LIT>"):<EOL><INDENT>raise ValueError("<STR_LIT>" % request.method)<EOL><DEDENT>url_parts = urlparse(request.url)<EOL>if is_win32 and url_parts.netloc.endswith("<STR_LIT::>"):<EOL><INDENT>url_parts = url_parts._replace(path="<STR_LIT:/>" + url_parts.netloc + url_parts.path, netloc='<STR_LIT>')<EOL><DEDENT>if url_parts.netloc and url_parts.netloc not in ("<STR_LIT:localhost>", "<STR_LIT:.>", "<STR_LIT:..>", "<STR_LIT:->"):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if url_parts.netloc in ("<STR_LIT:.>", "<STR_LIT:..>"):<EOL><INDENT>pwd = os.path.abspath(url_parts.netloc).replace(os.sep, "<STR_LIT:/>") + "<STR_LIT:/>"<EOL>if is_win32:<EOL><INDENT>pwd = "<STR_LIT:/>" + pwd<EOL><DEDENT>url_parts = url_parts._replace(path=urljoin(pwd, url_parts.path.lstrip("<STR_LIT:/>")))<EOL><DEDENT>resp = Response()<EOL>resp.url = request.url<EOL>try:<EOL><INDENT>if url_parts.netloc == "<STR_LIT:->":<EOL><INDENT>if is_py3:<EOL><INDENT>resp.raw = sys.stdin.buffer<EOL><DEDENT>else:<EOL><INDENT>resp.raw = sys.stdin<EOL><DEDENT>resp.url = "<STR_LIT>" + os.path.abspath("<STR_LIT:.>").replace(os.sep, "<STR_LIT:/>") + "<STR_LIT:/>"<EOL><DEDENT>else:<EOL><INDENT>path_parts = [unquote(p) for p in url_parts.path.split('<STR_LIT:/>')]<EOL>while path_parts and not path_parts[<NUM_LIT:0>]:<EOL><INDENT>path_parts.pop(<NUM_LIT:0>)<EOL><DEDENT>if any(os.sep in p for p in path_parts):<EOL><INDENT>raise IOError(errno.ENOENT, os.strerror(errno.ENOENT))<EOL><DEDENT>if path_parts and (path_parts[<NUM_LIT:0>].endswith('<STR_LIT:|>') or<EOL>path_parts[<NUM_LIT:0>].endswith('<STR_LIT::>')):<EOL><INDENT>path_drive = path_parts.pop(<NUM_LIT:0>)<EOL>if path_drive.endswith('<STR_LIT:|>'):<EOL><INDENT>path_drive = path_drive[:-<NUM_LIT:1>] + '<STR_LIT::>'<EOL><DEDENT>while path_parts and not path_parts[<NUM_LIT:0>]:<EOL><INDENT>path_parts.pop(<NUM_LIT:0>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>path_drive = '<STR_LIT>'<EOL><DEDENT>path = path_drive + os.sep + os.path.join(*path_parts)<EOL>if path_drive and not os.path.splitdrive(path):<EOL><INDENT>path = os.sep + os.path.join(path_drive, *path_parts)<EOL><DEDENT>resp.raw = io.open(path, "<STR_LIT:rb>")<EOL>resp.raw.release_conn = resp.raw.close<EOL><DEDENT><DEDENT>except IOError as e:<EOL><INDENT>if e.errno == errno.EACCES:<EOL><INDENT>resp.status_code = codes.forbidden<EOL><DEDENT>elif e.errno == errno.ENOENT:<EOL><INDENT>resp.status_code = codes.not_found<EOL><DEDENT>else:<EOL><INDENT>resp.status_code = codes.bad_request<EOL><DEDENT>resp_str = str(e).encode(locale.getpreferredencoding(False))<EOL>resp.raw = BytesIO(resp_str)<EOL>resp.headers['<STR_LIT>'] = len(resp_str)<EOL>resp.raw.release_conn = resp.raw.close<EOL><DEDENT>else:<EOL><INDENT>resp.status_code = codes.ok<EOL>resp_stat = os.fstat(resp.raw.fileno())<EOL>if stat.S_ISREG(resp_stat.st_mode):<EOL><INDENT>resp.headers['<STR_LIT>'] = resp_stat.st_size<EOL><DEDENT><DEDENT>return resp<EOL>
Wraps a file, described in request, in a Response object.

            :param request: The PreparedRequest` being "sent".
            :returns: a Response object containing the file