code: def list_datasets(
      client: AuthenticatedClient, workspace: Optional[str] = None
  ) -> Response[List[Dataset]]:
      url = f"{client.base_url}/api/datasets"
  
      headers = client.get_headers().copy()
      headers.pop(WORKSPACE_HEADER_NAME, None)
  
      response = httpx.get(
          url=url,
          params={"workspace": workspace} if workspace else None,
          headers=headers,
          cookies=client.get_cookies(),
          timeout=client.get_timeout(),
      )
  
      if response.status_code == 200:
          response_obj = Response.from_httpx_response(response)
          response_obj.parsed = [
              Dataset(**dataset) for dataset in response.json()
          ]
          return response_obj
      handle_response_error(response)
  
file_path: argilla/src/argilla/client/sdk/datasets/api.py
imports: from functools import lru_cache
  from typing import List, Optional, Union
  import httpx
  from argilla._constants import WORKSPACE_HEADER_NAME
  from argilla.client.sdk.client import AuthenticatedClient
  from argilla.client.sdk.commons.errors_handler import handle_response_error
  from argilla.client.sdk.commons.models import Response
  from argilla.client.sdk.datasets.models import CopyDatasetRequest, Dataset
label_desc: Use image node_id 2 for calling a global function with example usage: list_datasets(client, workspace) and returns: response_obj