def _send_request(
        self, route: str, data: dict[str, Any], method: Optional[str] = "POST"
    ) -> Response[Any]:
        """
        Function that communicate Studio API.
        It will raise an exception, and try to retry, if 5xx status code is
        returned, or if Timeout exceptions is thrown from the requests lib
        """
        import requests

        kwargs = (
            {"params": {**data, "team_name": self.team}}
            if method == "GET"
            else {"json": {**data, "team_name": self.team}}
        )

        response = requests.request(
            method=method,  # type: ignore[arg-type]
            url=f"{self.url}/{route}",
            headers={
                "Content-Type": "application/json",
                "Authorization": f"token {self.token}",
            },
            timeout=self.timeout,
            **kwargs,  # type: ignore[arg-type]
        )
        try:
            response.raise_for_status()
        except HTTPError:
            if _is_server_error(response.status_code):
                # going to retry
                raise

        ok = response.ok
        try:
            data = json.loads(response.content.decode("utf-8"))
        except json.decoder.JSONDecodeError:
            data = {}

        if not ok:
            if response.status_code == 403:
                message = f"Not authorized for the team {self.team}"
            else:
                message = data.get("message", "")
        else:
            message = ""

        return Response(data, ok, message)

        Function that communicate Studio API.
        It will raise an exception, and try to retry, if 5xx status code is
        returned, or if Timeout exceptions is thrown from the requests lib
        
src/datachain/remote/studio.py