def __init__(self, fd, request, chunk_func=None):
    if isinstance(fd, basestring):
      fd = StringIO(fd)
    try:
      banner = read_banner(fd)
      # ASSUMPTION: A response status line contains at least two elements
      #             seperated by a space
      self.http_version, self.status = banner[:2]
      self.reason = banner[2] if len(banner) == 3 else ""
    except __HOLE__:
      raise BadStatusLine(banner)
    self.raw_headers = read_headers(fd)
    self.request = request
    if request.method == "HEAD":
      self.raw_content = self.content = ""
    else:
      self.raw_content = read_content(fd, parse_headers(self.raw_headers), self.status,
                                      chunk_func=chunk_func)
      if self.raw_content:
        self.content = _clear_content(parse_headers(self.raw_headers), self.raw_content)
      else:
        self.content = ""
dataset/ETHPy150Open tweksteen/burst/burst/http.py/Response.__init__