docstr: Returns the record(s) at the given index(es) from Argilla.
  
  Args:
      key: the index(es) of the record(s) to return. Can either be a single index or a slice.
  
  Returns:
      Either the record of the given index, or a list with the records at the given indexes.
docstr_tok: ["Returns","the","record","(","s",")","at","the","given","index","(","es",")","from","Argilla",".","Args",":","key",":","the","index","(","es",")","of","the","record","(","s",")","to","return",".","Can","either","be","a","single","index","or","a","slice",".","Returns",":","Either","the","record","of","the","given","index",",","or","a","list","with","the","records","at","the","given","indexes","."]
code: def __getitem__(
      self: "RemoteFeedbackRecords", key: Union[slice, int]
  ) -> Union["RemoteFeedbackRecord", List["RemoteFeedbackRecord"]]:
      """Returns the record(s) at the given index(es) from Argilla.
  
      Args:
          key: the index(es) of the record(s) to return. Can either be a single index or a slice.
  
      Returns:
          Either the record of the given index, or a list with the records at the given indexes.
      """
      try:
          num_records = len(self)
      except NotImplementedError:
          num_records = None
          if not isinstance(key, int):
              raise NotImplementedError(
                  f"`key`={key} is not supported for this dataset. Only `int` is supported."
              )
  
      offsets = []
      limit = None
  
      if isinstance(key, slice) and num_records is not None:
          start, stop, step = key.indices(num_records)
          if step is not None and step != 1:
              raise ValueError(
                  "When providing a `slice` just `step=None` or `step=1` are allowed."
              )
          if start < 0:
              start += num_records
          if stop < 0:
              stop += num_records
          if start < 0 or stop < 0:
              raise IndexError(
                  f"Index {start if start < 0 else stop} is out of range, dataset has {num_records} records."
              )
          limit = stop - start
          if limit < 0:
              raise ValueError(
                  "Negative slice bounds are not supported."
              )
          elif limit < FETCHING_BATCH_SIZE:
              offsets = [start]
              limits = [limit]
          else:
              offsets = list(range(start, stop, FETCHING_BATCH_SIZE))
              limits = [FETCHING_BATCH_SIZE] * len(offsets)
              if stop % FETCHING_BATCH_SIZE != 0:
                  offsets[-1] = stop - (stop % FETCHING_BATCH_SIZE) + 1
                  limits[-1] = (stop % FETCHING_BATCH_SIZE) - 1
      elif isinstance(key, int):
          if num_records is not None:
              if key < 0:
                  key += num_records
              if key < 0 or key >= num_records:
                  raise IndexError(
                      f"Index {key} is out of range, dataset has {num_records} records."
                  )
          offsets = [key]
          limits = [1]
      else:
          raise TypeError(
              "Only `int` and `slice` are supported as index."
          )
  
      question_id_to_name = {
          question.id: question.name
          for question in self.dataset.questions
      }
  
      records = []
      for offset, limit in zip(offsets, limits):
          fetched_records = self._fetch_records(
              offset=offset, limit=limit
          )
          if len(fetched_records.items) == 0:
              break
          records.extend(
              [
                  RemoteFeedbackRecord.from_api(
                      record,
                      question_id_to_name=question_id_to_name,
                      client=self._client,
                  )
                  for record in fetched_records.items
              ]
          )
      if len(records) == 0:
          raise IndexError(
              "No records were found in the dataset in Argilla for the given index(es) and/or filter(s) if any."
          )
      return records[0] if isinstance(key, int) else records
  
file_path: argilla/src/argilla/client/feedback/dataset/remote/mixins.py
imports: from typing import TYPE_CHECKING, Iterator, List, Union
  from argilla.client.feedback.constants import FETCHING_BATCH_SIZE
  from argilla.client.feedback.schemas.remote.records import RemoteFeedbackRecord
  from argilla.client.sdk.users.models import UserRole
  from argilla.client.utils import allowed_for_roles
label_desc: Use image node_id 1 for calling the ArgillaRecordsMixin obj's underlying member method code with example usage: obj.__getitem__(key) and returns: unknown