code: def delete_records(
      name: str,
      workspace: Optional[str] = None,
      query: Optional[str] = None,
      ids: Optional[List[Union[str, int]]] = None,
      discard_only: bool = False,
      discard_when_forbidden: bool = True,
  ) -> Tuple[int, int]:
      """Delete records from a argilla dataset.
  
      Args:
          name: The dataset name.
          workspace: The workspace to which records will be logged/loaded. If `None` (default) and the
              env variable ``ARGILLA_WORKSPACE`` is not set, it will default to the private user workspace.
          query: An ElasticSearch query with the `query string syntax
              <https://docs.argilla.io/en/latest/practical_guides/filter_dataset.html>`_
          ids: If provided, deletes dataset records with given ids.
          discard_only: If `True`, matched records won't be deleted. Instead, they will be marked as `Discarded`
          discard_when_forbidden: Only super-user or dataset creator can delete records from a dataset.
              So, running "hard" deletion for other users will raise an `ForbiddenApiError` error.
              If this parameter is `True`, the client API will automatically try to mark as ``Discarded``
              records instead. Default, `True`
  
      Returns:
          The total of matched records and real number of processed errors. These numbers could not
          be the same if some data conflicts are found during operations (some matched records change during
          deletion).
  
      Examples:
          >>> ## Delete by id
          >>> import argilla as rg
          >>> rg.delete_records(name="example-dataset", ids=[1,3,5])
          >>> ## Discard records by query
          >>> import argilla as rg
          >>> rg.delete_records(name="example-dataset", query="metadata.code=33", discard_only=True)
      """
      return ArgillaSingleton.get().delete_records(
          name=name,
          workspace=workspace,
          query=query,
          ids=ids,
          discard_only=discard_only,
          discard_when_forbidden=discard_when_forbidden,
      )
  
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 5 for calling a global function with example usage: delete_records(name, workspace, query, ids, discard_only, discard_when_forbidden) and returns: ArgillaSingleton