class_docstr: Base class for all positions
docstr: Create and return a position object for the geom
  
  Parameters
  ----------
  geom : geom
      An instantiated geom object.
  
  Returns
  -------
  out : position
      A position object
  
  Raises
  ------
  PlotnineError
      If unable to create a `position`.
docstr_tok: ["Create","and","return","a","position","object","for","the","geom","Parameters","--","--","--","--","--","geom",":","geom","An","instantiated","geom","object",".","Returns","--","--","--","-","out",":","position","A","position","object","Raises","--","--","--","PlotnineError","If","unable","to","create","a","`","position","`","."]
code: def from_geom(geom: Geom) -> position:
      """
      Create and return a position object for the geom
  
      Parameters
      ----------
      geom : geom
          An instantiated geom object.
  
      Returns
      -------
      out : position
          A position object
  
      Raises
      ------
      PlotnineError
          If unable to create a `position`.
      """
      name = geom.params["position"]
      if issubclass(type(name), position):
          return name
  
      if isinstance(name, type) and issubclass(name, position):
          klass = name
      elif isinstance(name, str):
          if not name.startswith("position_"):
              name = f"position_{name}"
          klass = Registry[name]
      else:
          raise PlotnineError(f"Unknown position of type {type(name)}")
  
      return klass()
  
imports: from __future__ import annotations
  import typing
  from abc import ABC
  from copy import copy
  from warnings import warn
  import numpy
  from .._utils import check_required_aesthetics, groupby_apply
  from .._utils.registry import Register, Registry
  from ..exceptions import PlotnineError, PlotnineWarning
  from ..mapping.aes import X_AESTHETICS, Y_AESTHETICS
label_desc: Use image node_id 7 for calling the position obj's underlying member method code with example usage: obj.from_geom(geom) and returns: klass, name