code: def get_as(self, key, units='pt'):
          
          dpi = 72
          size = self.element.properties.get('size', 0)
          value = self[key]
  
          functions = {
              'pt-lines': lambda x: x/size,
              'pt-in': lambda x: x/dpi,
              'lines-pt': lambda x: x*size,
              'lines-in': lambda x: x*size/dpi,
              'in-pt': lambda x: x*dpi,
              'in-lines': lambda x: x*dpi/size
          }
  
          if self['units'] != units:
              conversion = '{}-{}'.format(self['units'], units)
              try:
                  value = functions[conversion](value)
              except ZeroDivisionError:
                  value = 0
  
          return value
docs: Return key in given units