code: def from_stat(stat):
          
          name = stat.params['geom']
          if issubclass(type(name), geom):
              return name
  
          if isinstance(name, type) and issubclass(name, geom):
              klass = name
          elif is_string(name):
              if not name.startswith('geom_'):
                  name = 'geom_{}'.format(name)
              klass = Registry[name]
          else:
              raise PlotnineError(
                  'Unknown geom of type {}'.format(type(name)))
  
          return klass(stat=stat, **stat._kwargs)
docs: Return an instantiated geom object
  
          geoms should not override this method.
  
          Parameters
          ----------
          stat : stat
              `stat`
  
          Returns
          -------
          out : geom
              A geom object
  
          Raises
          ------
          :class:`PlotnineError` if unable to create a `geom`.