docstr: Read from recv and return a HTTPResponse object if possible.
  Either
  1 - The client has succesfully closed the connection: Return ''
  2 - The server has already closed the connection: Return the response
      if possible.
docstr_tok: ["Read","from","recv","and","return","a","HTTPResponse","object","if","possible",".","Either","1","-","The","client","has","succesfully","closed","the","connection",":","Return","``","2","-","The","server","has","already","closed","the","connection",":","Return","the","response","if","possible","."]
code: def _getresponse(self):
      """Read from recv and return a HTTPResponse object if possible.
      Either
      1 - The client has succesfully closed the connection: Return ''
      2 - The server has already closed the connection: Return the response
          if possible.
      """
      # Wait for a response
      self._conn.sock.setblocking(True)
      # Parse the response
      response = self._bytes
      while True:
          try:
              _bytes = self._conn.sock.recv(1)
          except http.client.socket.error:
              # For error 54: Connection reset by peer
              # (and perhaps others)
              return b""
          if _bytes == b"":
              break
          else:
              response += _bytes
      # Set recv to be non-blocking again
      self._conn.sock.setblocking(False)
  
      # Convert the response string to a http.client.HTTPResponse
      # object with a bit of a hack
      if response != b"":
          # Taken from
          # http://pythonwise.blogspot.ca/2010/02/parse-http-response.html
          try:
              response = http.client.HTTPResponse(_FakeSocket(response))
              response.begin()
          except:
              # Bad headers ... etc.
              response = b""
      return response
  
imports: import http.client
  import os
  import ssl
  import time
  from io import StringIO
  from urllib.parse import urlparse, unquote
  from chart_studio.api import utils
label_desc: Use image node_id 7 for calling the Stream obj's underlying member method code with example usage: obj._getresponse() and returns: response, bytes