class_docstr: Stream a collection of UDHR translations from disk, either as texts or
  text + metadata pairs.
  
  Download the data (one time only!), saving and extracting its contents to disk::
  
      >>> import textacy.datasets
      >>> ds = textacy.datasets.UDHR()
      >>> ds.download()
      >>> ds.info
      {'name': 'udhr',
       'site_url': 'http://www.ohchr.org/EN/UDHR',
       'description': 'A collection of translations of the Universal Declaration of Human Rights (UDHR), a milestone document in the history of human rights that first, formally established fundamental human rights to be universally protected.'}
  
  Iterate over translations as texts or records with both text and metadata::
  
      >>> for text in ds.texts(limit=5):
      ...     print(text[:500])
      >>> for text, meta in ds.records(limit=5):
      ...     print("\n{} ({})\n{}".format(meta["lang_name"], meta["lang"], text[:500]))
  
  Filter translations by language, and note that some languages have multiple translations::
  
      >>> for text, meta in ds.records(lang="en"):
      ...     print("\n{} ({})\n{}".format(meta["lang_name"], meta["lang"], text[:500]))
      >>> for text, meta in ds.records(lang="zh"):
      ...     print("\n{} ({})\n{}".format(meta["lang_name"], meta["lang"], text[:500]))
  
  Note: Streaming translations into a :class:`textacy.Corpus <textacy.corpus.Corpus>`
  doesn't work as for other available datasets, since this dataset is multilingual.
  
  Args:
      data_dir (str or :class:`pathlib.Path`): Path to directory on disk
          under which the data is stored, i.e. ``/path/to/data_dir/udhr``.
  
  Attributes:
      langs (set[str]): All distinct language codes with texts in this dataset,
          e.g. "en" for English.
code: def __init__(
      self,
      data_dir: types.PathLike = constants.DEFAULT_DATA_DIR.joinpath(
          NAME
      ),
  ):
      super().__init__(NAME, meta=META)
      self.data_dir = utils.to_path(data_dir).resolve()
      self._texts_dirpath = self.data_dir.joinpath("udhr_txt")
      self._index_filepath = self._texts_dirpath.joinpath("index.xml")
      self._index: Optional[list[dict[str, Any]]] = None
      self.langs: Optional[set[str]] = None
  
imports: from __future__ import annotations
  import io
  import itertools
  import logging
  import xml
  from typing import Any, Iterable, Optional
  from xml.etree import ElementTree
  from ..None import constants, preprocessing, types, utils
  from ..None import io
  from .base import Dataset
label_desc: Use image node_id 1 to create a new UDHR object from inherited base classes: Dataset with example: obj = UDHR(data_dir)