import copy


def offset(cam_file, x_offset, y_offset):
    """ Offset a Cam file by a specified amount in the X and Y directions.

    Parameters
    ----------
    cam_file : :class:`gerber.cam.CamFile` subclass
        Gerber or Excellon file to offset

    x_offset : float
        Amount to offset the file in the X direction

    y_offset : float
        Amount to offset the file in the Y direction

    Returns
    -------
    cam_file : :class:`gerber.cam.CamFile` subclass
        An offset deep copy of the source file.
    """
    cam_file = copy.deepcopy(cam_file)
    cam_file.offset(x_offset, y_offset)
    return cam_file