code: def sprite_position(map, sprite, offset_x=None, offset_y=None):
      
      map = map.render()
      sprite_maps = _get_cache('sprite_maps')
      sprite_map = sprite_maps.get(map)
      sprite_name = String.unquoted(sprite).value
      sprite = sprite_map and sprite_map.get(sprite_name)
      if not sprite_map:
          log.error("No sprite map found: %s", map, extra={'stack': True})
      elif not sprite:
          log.error("No sprite found: %s in %s", sprite_name, sprite_map['*n*'], extra={'stack': True})
      if sprite:
          x = None
          if offset_x is not None and not isinstance(offset_x, Number):
              x = offset_x
          if not x or x.value not in ('left', 'right', 'center'):
              if x:
                  offset_x = None
              x = Number(offset_x or 0, 'px')
              if not x.value or (x.value <= -1 or x.value >= 1) and not x.is_simple_unit('%'):
                  x -= Number(sprite[2], 'px')
          y = None
          if offset_y is not None and not isinstance(offset_y, Number):
              y = offset_y
          if not y or y.value not in ('top', 'bottom', 'center'):
              if y:
                  offset_y = None
              y = Number(offset_y or 0, 'px')
              if not y.value or (y.value <= -1 or y.value >= 1) and not y.is_simple_unit('%'):
                  y -= Number(sprite[3], 'px')
          return List([x, y])
      return List([Number(0), Number(0)])
docs: Returns the position for the original image in the sprite.
      This is suitable for use as a value to background-position.