code: def from_geom(geom):
          
          name = geom.params['position']
          if issubclass(type(name), position):
              return name
  
          if isinstance(name, type) and issubclass(name, position):
              klass = name
          elif is_string(name):
              if not name.startswith('position_'):
                  name = 'position_{}'.format(name)
              klass = Registry[name]
          else:
              raise PlotnineError(
                  'Unknown position of type {}'.format(type(name)))
  
          return klass()
docs: Create and return a position object for the geom
  
          Parameters
          ----------
          geom : geom
              An instantiated geom object.
  
          Returns
          -------
          out : position
              A position object
  
          Raises :class:`PlotnineError` if unable to create a `position`.