code: def log(
      records: Union[Record, Iterable[Record], Dataset],
      name: str,
      workspace: Optional[str] = None,
      tags: Optional[Dict[str, str]] = None,
      metadata: Optional[Dict[str, Any]] = None,
      batch_size: int = 100,
      verbose: bool = True,
      background: bool = False,
      chunk_size: Optional[int] = None,
      num_threads: int = 0,
      max_retries: int = 3,
  ) -> Union[BulkResponse, Future]:
      """Logs Records to argilla.
  
      The logging happens asynchronously in a background thread.
  
      Args:
          records: The record, an iterable of records, or a dataset to log.
          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.
          tags: A dictionary of tags related to the dataset.
          metadata: A dictionary of extra info for the dataset.
          batch_size: The batch size for a data bulk.
          verbose: If True, shows a progress bar and prints out a quick summary at the end.
          background: If True, we will NOT wait for the logging process to finish and return an ``asyncio.Future``
              object. You probably want to set ``verbose`` to False in that case.
          chunk_size: DEPRECATED! Use `batch_size` instead.
          num_threads: If > 0, will use num_thread separate number threads to batches, sending data concurrently.
                  Default to `0`, which means no threading at all.
          max_retries: Number of retries when logging a batch of records if a `httpx.TransportError` occurs.
                  Default `3`.
  
      Returns:
          Summary of the response from the REST API.
          If the ``background`` argument is set to True, an ``asyncio.Future`` will be returned instead.
  
      Examples:
          >>> import argilla as rg
          >>> record = rg.TextClassificationRecord(
          ...     text="my first argilla example",
          ...     prediction=[('spam', 0.8), ('ham', 0.2)]
          ... )
          >>> rg.log(record, name="example-dataset")
          1 records logged to http://localhost:6900/datasets/argilla/example-dataset
          BulkResponse(dataset='example-dataset', processed=1, failed=0)
          >>>
          >>> # Logging records in the background
          >>> rg.log(record, name="example-dataset", background=True, verbose=False)
          <Future at 0x7f675a1fffa0 state=pending>
      """
      return ArgillaSingleton.get().log(
          records=records,
          name=name,
          workspace=workspace,
          tags=tags,
          metadata=metadata,
          batch_size=batch_size,
          verbose=verbose,
          background=background,
          chunk_size=chunk_size,
          num_threads=num_threads,
          max_retries=max_retries,
      )
  
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 1 for calling a global function with example usage: log(records, name, workspace, tags, metadata, batch_size, verbose, background, chunk_size, num_threads, max_retries) and returns: ArgillaSingleton