class_docstr: Datasets DAO
class_docstr_tok: ["Datasets","DAO"]
docstr: Gets or creates the dao instance
  
  Parameters
  ----------
  es:
      The elasticsearch wrapper dependency
  
  records_dao:
      The dataset records dao
  
  Returns
  -------
      The dao instance
docstr_tok: ["Gets","or","creates","the","dao","instance","Parameters","--","--","--","--","--","es",":","The","elasticsearch","wrapper","dependency","records_dao",":","The","dataset","records","dao","Returns","--","--","--","-","The","dao","instance"]
code: def get_instance(
      cls,
      es: GenericElasticEngineBackend = Depends(
          GenericElasticEngineBackend.get_instance
      ),
      records_dao: DatasetRecordsDAO = Depends(
          DatasetRecordsDAO.get_instance
      ),
  ) -> "DatasetsDAO":
      """
      Gets or creates the dao instance
  
      Parameters
      ----------
      es:
          The elasticsearch wrapper dependency
  
      records_dao:
          The dataset records dao
  
      Returns
      -------
          The dao instance
  
      """
      if cls._INSTANCE is None:
          cls._INSTANCE = cls(es, records_dao)
      return cls._INSTANCE
  
imports: import json
  from typing import Any, Dict, List, Optional, Type
  from fastapi import Depends
  from argilla.server.daos.backend import BaseDatasetsQuery, GenericElasticEngineBackend
  from argilla.server.daos.models.datasets import BaseDatasetDB, BaseDatasetSettingsDB, DatasetDB, DatasetSettingsDB, EmbeddingsConfig
  from argilla.server.daos.records import DatasetRecordsDAO
  from argilla.server.errors import WrongTaskError
label_desc: Use image node_id 1 for calling the DatasetsDAO obj's underlying member method code with example usage: obj.get_instance(cls, es, records_dao) and returns: cls