# Path: py3status/exceptions.py
# class RequestTimeout(RequestException):
#     """
#     A timeout has occurred during a request made via Py3.request().
#     """
# 
# class RequestURLError(RequestException):
#     """
#     A URL related error has occurred during a request made via Py3.request().
#     """
# 
# class RequestInvalidJSON(RequestException):
#     """
#     The request has not returned valid JSON
#     """


import base64
import json
import socket
from urllib.error import URLError, HTTPError
from urllib.parse import urlsplit, urlunsplit, parse_qsl, urlencode
from urllib.request import (
    urlopen,
    Request,
    build_opener,
    install_opener,
    HTTPCookieProcessor,
)
from py3status.exceptions import RequestTimeout, RequestURLError, RequestInvalidJSON
        """
        try:
            return self._status_code
        except AttributeError:
            self._status_code = self._response.getcode()
        return self._status_code

    @property
    def text(self):
        """
        Get the raw text for the response
        """
        try:
            return self._text
        except AttributeError:
            encoding = self._response.headers.get_content_charset("utf-8")
            self._text = self._response.read().decode(encoding or "utf-8")
        return self._text

    def json(self):
        """
        Return an object representing the return json for the request
        """
        try:
            return self._json
        except AttributeError:
            try:
                self._json = json.loads(self.text)
                return self._json
            except:  # noqa e722

# Path: py3status/exceptions.py
# class RequestTimeout(RequestException):
#     """
#     A timeout has occurred during a request made via Py3.request().
#     """
# 
# class RequestURLError(RequestException):
#     """
#     A URL related error has occurred during a request made via Py3.request().
#     """
# 
# class RequestInvalidJSON(RequestException):
#     """
#     The request has not returned valid JSON
#     """


# Path: py3status/request.py
import base64
import json
import socket
from urllib.error import URLError, HTTPError
from urllib.parse import urlsplit, urlunsplit, parse_qsl, urlencode
from urllib.request import (
    urlopen,
    Request,
    build_opener,
    install_opener,
    HTTPCookieProcessor,
)
from py3status.exceptions import RequestTimeout, RequestURLError, RequestInvalidJSON

        """
        try:
            return self._status_code
        except AttributeError:
            self._status_code = self._response.getcode()
        return self._status_code

    @property
    def text(self):
        """
        Get the raw text for the response
        """
        try:
            return self._text
        except AttributeError:
            encoding = self._response.headers.get_content_charset("utf-8")
            self._text = self._response.read().decode(encoding or "utf-8")
        return self._text

    def json(self):
        """
        Return an object representing the return json for the request
        """
        try:
            return self._json
        except AttributeError:
            try:
                self._json = json.loads(self.text)
                return self._json
            except:  # noqa e722

                raise RequestInvalidJSON("Invalid JSON received")