def _validate_response(
        response: Any,
    ) -> list[dict[Any, Any]] | list[list[dict[Any, Any]]]:
        """
        Validate Oxylabs response format and unpack data.
        """
        validated_results = []
        try:
            result_pages = response.raw["results"]
            if not isinstance(result_pages, list) or not result_pages:
                raise ValueError("No results returned!")

            for result_page in result_pages:
                result_page = dict(result_page)
                content = result_page["content"]

                if isinstance(content, list):
                    validated_results.append(content)
                    continue

                if not isinstance(content, dict):
                    raise ValueError(
                        "Result `content` format error,"
                        " try setting parameter `parse` to True"
                    )

                if "results" in content:
                    result = content["results"]
                    if isinstance(result, list):
                        validated_results.append(result)
                    elif isinstance(result, dict):
                        validated_results.append(result)
                    else:
                        raise ValueError("Response format Error!")
                else:
                    validated_results.append(content)

            return validated_results

        except (KeyError, IndexError, TypeError, ValueError) as exc:
            raise RuntimeError(f"Response Validation Error: {exc!s}") from exc

        Validate Oxylabs response format and unpack data.
        
llama-index-integrations/readers/llama-index-readers-oxylabs/llama_index/readers/oxylabs/base.py