code: def _sprite_position(map, sprite, offset_x=None, offset_y=None):
      
      map = StringValue(map).value
      sprite_name = StringValue(sprite).value
      sprite_map = sprite_maps.get(map)
      sprite = sprite_map and sprite_map.get(sprite_name)
      if not sprite_map:
          log.error("No sprite map found: %s", map)
      elif not sprite:
          log.error("No sprite found: %s in %s", sprite_name, sprite_map['*n*'])
      if sprite:
          x = None
          if offset_x is not None and not isinstance(offset_x, NumberValue):
              x = str(offset_x)
          if x not in ('left', 'right', 'center'):
              if x:
                  offset_x = None
              x = NumberValue(offset_x or 0, 'px')
              if not x or (x <= -1 or x >= 1) and x.unit != '%':
                  x -= sprite[2]
          y = None
          if offset_y is not None and not isinstance(offset_y, NumberValue):
              y = str(offset_y)
          if y not in ('top', 'bottom', 'center'):
              if y:
                  offset_y = None
              y = NumberValue(offset_y or 0, 'px')
              if not y or (y <= -1 or y >= 1) and y.unit != '%':
                  y -= sprite[3]
          pos = '%s %s' % (x, y)
          return StringValue(pos)
      return StringValue('0 0')
docs: Returns the position for the original image in the sprite.
      This is suitable for use as a value to background-position.