def _TransformPos(self, pos):
    """Returns a transformed position. Uses 'reverse_x' and 'reverse_y'
    to decide whether to reverse the x and y axes.
    """
    new_pos = copy.copy(pos)
    if self._reverse_x:
      new_pos[0] = iphone_dims[0] - new_pos[0] - 1
    if self._reverse_y:
      new_pos[1] = iphone_dims[1] - new_pos[1] - 1
    new_pos[0] = min(self._width, max(0, new_pos[0] - right_margin))
    new_pos[1] = min(self._height, max(0, int(new_pos[1])))
    return new_pos
dataset/ETHPy150Open viewfinderco/viewfinder/clients/experimental/viewfinder.py/VFTime._TransformPos/original