def METHOD_NAME(
    bytes_to_serve: bytes, bytes_downloaded: threading.Event
) -> Type[http.server.BaseHTTPRequestHandler]:
    """
    Dynamically create a new subclass of http.server.BaseHTTPRequestHandler and return it to the
    caller.
    Because Python's http.server.HTTPServer accepts a class and creates a new object to
    handle each request it receives, any state that needs to be shared between requests must be
    stored as class variables. Creating the request handler classes dynamically at runtime allows
    multiple HTTPBytesServers, each with it's own unique state, to run concurrently.
    """
    def do_GET(self):
        with self.download_lock:
            if self.bytes_downloaded.is_set():
                self.send_error(
                    HTTPStatus.TOO_MANY_REQUESTS,
                    "A download has already been requested",
                )
                return
            logger.info("Received a GET request!")
            self.send_response(HTTPStatus.OK)
            self.send_header("Content-type", "application/octet-stream")
            self.end_headers()
            logger.info("Sending the bytes to the requester")
            self.wfile.write(self.bytes_to_serve)
            self.bytes_downloaded.set()
    return type(
        "HTTPHandler",
        (http.server.BaseHTTPRequestHandler,),
        {
            "bytes_to_serve": bytes_to_serve,
            "bytes_downloaded": bytes_downloaded,
            "download_lock": threading.Lock(),
            "do_GET": do_GET,
        },
    )