class_docstr: Factory to create singleton instances of classes inheriting a given ``base`` class.
  
  .. seealso::
  
      :py:class:`orion.core.utils.GenericFactory`
docstr: Create an object, instance of ``self.base``
  
  If the instance is already created, ``self.create`` can only be called without arguments
  and will return the singleton.
  
  Cannot be called without arguments if the singleton was not already created.
  
  Parameters
  ----------
  of_type: str, optional
      Name of class, subclass of ``self.base``. Capitalization insensitive.
  
  args: *
      Positional arguments to construct the given class.
  
  kwargs: **
      Keyword arguments to construct the given class.
  
  Raises
  ------
  `SingletonNotInstantiatedError`
      - If ``self.create()`` was never called and is called without arguments for the first
        time.
      - If ``self.create()`` was never called and the current call raises an error.
  `SingletonAlreadyInstantiatedError`
      If ``self.create()`` was already called with arguments (the singleton exist) and
      is called again with arguments.
docstr_tok: ["Create","an","object",",","instance","of","``","self.base","``","If","the","instance","is","already","created",",","``","self.create","``","can","only","be","called","without","arguments","and","will","return","the","singleton",".","Can","not","be","called","without","arguments","if","the","singleton","was","not","already","created",".","Parameters","--","--","--","--","--","of_type",":","str",",","optional","Name","of","class",",","subclass","of","``","self.base","``",".","Capitalization","insensitive",".","args",":","*","Positional","arguments","to","construct","the","given","class",".","kwargs",":","*","*","Keyword","arguments","to","construct","the","given","class",".","Raises","--","--","--","`","SingletonNotInstantiatedError","`","-","If","``","self.create","(",")","``","was","never","called","and","is","called","without","arguments","for","the","first","time",".","-","If","``","self.create","(",")","``","was","never","called","and","the","current","call","raises","an","error",".","`","SingletonAlreadyInstantiatedError","`","If","``","self.create","(",")","``","was","already","called","with","arguments","(","the","singleton","exist",")","and","is","called","again","with","arguments","."]
code: def create(self, of_type: str | None = None, *args, **kwargs) -> T:
      """Create an object, instance of ``self.base``
  
      If the instance is already created, ``self.create`` can only be called without arguments
      and will return the singleton.
  
      Cannot be called without arguments if the singleton was not already created.
  
      Parameters
      ----------
      of_type: str, optional
          Name of class, subclass of ``self.base``. Capitalization insensitive.
  
      args: *
          Positional arguments to construct the given class.
  
      kwargs: **
          Keyword arguments to construct the given class.
  
      Raises
      ------
      `SingletonNotInstantiatedError`
          - If ``self.create()`` was never called and is called without arguments for the first
            time.
          - If ``self.create()`` was never called and the current call raises an error.
      `SingletonAlreadyInstantiatedError`
          If ``self.create()`` was already called with arguments (the singleton exist) and
          is called again with arguments.
  
      """
  
      if self.instance is None and of_type is None:
          raise SingletonNotInstantiatedError(self.base.__name__)
  
      elif self.instance is None:
          try:
              self.instance = super().create(of_type, *args, **kwargs)
          except TypeError as exception:
              raise SingletonNotInstantiatedError(
                  self.base.__name__
              ) from exception
  
      elif of_type or args or kwargs:
          raise SingletonAlreadyInstantiatedError(self.base.__name__)
  
      return self.instance
  
imports: from __future__ import annotations
  from abc import ABCMeta
  from orion.core.utils import Factory, GenericFactory, T
label_desc: Use image node_id 2 for calling the GenericSingletonFactory obj's underlying member method code with example usage: obj.create(of_type) and returns: self