class_docstr: Base class of all Geoms
class_docstr_tok: ["Base","class","of","all","Geoms"]
docstr: Return an instantiated geom object
  
  geoms should not override this method.
  
  Parameters
  ----------
  stat :
      `stat`
  
  Returns
  -------
  :
      A geom object
  
  Raises
  ------
  PlotnineError
      If unable to create a `geom`.
docstr_tok: ["Return","an","instantiated","geom","object","geoms","should","not","override","this","method",".","Parameters","--","--","--","--","--","stat",":","`","stat","`","Returns","--","--","--","-",":","A","geom","object","Raises","--","--","--","PlotnineError","If","unable","to","create","a","`","geom","`","."]
code: def from_stat(stat: stat) -> geom:
      """
      Return an instantiated geom object
  
      geoms should not override this method.
  
      Parameters
      ----------
      stat :
          `stat`
  
      Returns
      -------
      :
          A geom object
  
      Raises
      ------
      PlotnineError
          If unable to create a `geom`.
      """
      name = stat.params["geom"]
  
      if isinstance(name, geom):
          return name
  
      if isinstance(name, type) and issubclass(name, geom):
          klass = name
      elif isinstance(name, str):
          if not name.startswith("geom_"):
              name = f"geom_{name}"
          klass = Registry[name]
      else:
          raise PlotnineError(f"Unknown geom of type {type(name)}")
  
      return klass(stat=stat, **stat._kwargs)
  
imports: from __future__ import annotations
  import typing
  from abc import ABC
  from copy import deepcopy
  from itertools import chain, repeat
  from .._utils import copy_keys, data_mapping_as_kwargs, is_list_like, remove_missing
  from .._utils.registry import Register, Registry
  from ..exceptions import PlotnineError
  from ..layer import layer
  from ..mapping.aes import is_valid_aesthetic, rename_aesthetics
  from ..mapping.evaluation import evaluate
  from ..positions.position import position
  from ..stats.stat import stat
label_desc: Use image node_id 2 for calling the geom obj's underlying member method code with example usage: obj.from_stat(stat) and returns: klass, name