code: def delete(name: str, workspace: Optional[str] = None) -> None:
      """
      Deletes an Argilla dataset from the server. It can be used with both `Dataset` and `FeedbackDataset`, although
      for the latter it's recommended to use `rg.FeedbackDataset.delete` instead.
  
      Args:
          name: The name of the dataset to delete.
          workspace: The workspace to which the dataset belongs. If `None` (default) and the env variable
              ``ARGILLA_WORKSPACE`` is not set, it will default to the private user workspace.
  
      Raises:
          ValueError: If no dataset is found with the given name and workspace.
          PermissionError: If the dataset that's being deleted is a `FeedbackDataset` and the user doesn't have enough
              permissions to delete it.
          RuntimeError: If the dataset that's being deleted is a `FeedbackDataset` and some kind of error occurs during
              the deletion process.
  
      Examples:
          >>> import argilla as rg
          >>> rg.delete(name="example-dataset")
      """
      argilla = ArgillaSingleton.get()
      workspace = workspace or argilla.get_workspace()
      try:
          # `delete` method is always successful, even if the dataset does not exist and that's why we need the extra
          # call to `get_dataset` to check if the dataset exists. If it doesn't exist, then we try to delete a `FeedbackDataset`.
          argilla.get_dataset(name=name, workspace=workspace)
          argilla.delete(name=name, workspace=workspace)
      except errors.ArApiResponseError as e:
          try:
              dataset = FeedbackDataset.from_argilla(
                  name=name, workspace=workspace
              )
          except ValueError:
              raise e
  
          dataset.delete()
  
          warnings.warn(
              "Removed dataset was a `FeedbackDataset`. It's recommended to use "
              f"`rg.FeedbackDataset.from_argilla(name='{name}', workspace='{workspace}').delete()` instead.",
              UserWarning,
              stacklevel=2,
          )
  
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 4 for calling a global function with example usage: delete(name, workspace) without return types