def METHOD_NAME(self, anchor, after=False):
    """
    Positions the caret before the given anchor. If after=True position it directly after.
    """
    start_index, end_index, _ = self.anchor_to_range(anchor)
    index = end_index if after else start_index
    self.area.sel = index