def get_relative_position(self, position, location):
    """Return a position that has relative position to given position."""
    if location == "next to":
      relative_position = self.sample_nearby_position(position)
    else:
      dir_vec = DIR_TO_DIR_VEC[location]
      relative_position = world.Position(
          column=position.column - dir_vec[0], row=position.row - dir_vec[1])
    return relative_position
Return a position that has relative position to given position.
language/gscan/data/world.py