code: def list_datasets(
      workspace: Optional[str] = None,
      type: Optional[Union[str, DatasetType]] = None,
  ) -> List[Union[DatasetModel, "RemoteFeedbackDataset"]]:
      """Lists all the available datasets for the current user in Argilla.
  
      Args:
          workspace: If provided, list datasets from that workspace only. Note that
              the workspace must exist in advance, otherwise a HTTP 400 error will be
              raised.
  
      Returns:
          A list of `DatasetModel` objects, containing the dataset
          attributes: tags, metadata, name, id, task, owner, workspace, created_at,
          and last_updated.
      """
      if type is not None:
          type = (
              type
              if isinstance(type, DatasetType)
              else DatasetType(type)
          )
  
      old_datasets = []
      if type is None or type == DatasetType.other:
          old_datasets = ArgillaSingleton.get().list_datasets(
              workspace=workspace
          )
  
      datasets = []
      if type is None or type == DatasetType.feedback:
          datasets = FeedbackDataset.list(workspace=workspace)
  
      return old_datasets + datasets
  
imports: import asyncio
  import warnings
  from asyncio import Future
  from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Tuple, Union
  from argilla.client.client import Argilla
  from argilla.client.datasets import Dataset
  from argilla.client.enums import DatasetType
  from argilla.client.feedback.dataset.local.dataset import FeedbackDataset
  from argilla.client.models import BulkResponse, Record
  from argilla.client.sdk.commons import errors
  from argilla.client.sdk.datasets.models import Dataset
  from argilla.client.sdk.v1.workspaces.models import WorkspaceModel
  from argilla.client.singleton import ArgillaSingleton
label_desc: Use image node_id 9 for calling a global function with example usage: list_datasets(workspace, type) and returns: unknown