def get_transform_params(
    num_xforms: int,
    rotation_range: tuple[float, float],
    dist_range: tuple[float, float],
    gamma_range: tuple[float, float],
    crop_percent_range: tuple[float, float],
    off_x_range: tuple[float, float],
    off_y_range: tuple[float, float],
    blur_kernels: tuple[int, int] | list[int],
    obj_width: float,
    focal: float,
) -> list[tuple[float, float, float, int, float, float, float, float, float]]:
    """
    Sample transformation params.

    :param num_xforms: The number of transforms to sample.
    :param rotation_range: The range of the rotation in the perspective transform.
    :param dist_range: The range of the distance (in ft) to be added to the focal length in perspective transform.
    :param gamma_range: The range of the gamma in the gamma transform.
    :param crop_percent_range: The range of the crop percent in the perspective transform.
    :param off_x_range: The range of the x offset (percent) in the perspective transform.
    :param off_y_range: The range of the y offset (percent) in the perspective transform.
    :param blur_kernels: The kernels to blur with.
    :param obj_width: The estimated object width (inches) for perspective transform. 30 by default.
    :param focal: The estimated focal length (ft) for perspective transform. 3 by default.
    :return: List of transforms.
    """
    transforms = []
    for _ in range(num_xforms):
        angle = np.random.uniform(rotation_range[0], rotation_range[1])
        dist = np.random.uniform(focal + dist_range[0], focal + dist_range[1])
        gamma = np.random.uniform(gamma_range[0], gamma_range[1])
        flip_flag = np.random.uniform(0.0, 1.0)
        if int(round(flip_flag)) == 1:
            gamma = 1.0 / gamma

        crop_percent = np.random.uniform(crop_percent_range[0], crop_percent_range[1])
        crop_off_x = np.random.uniform(off_x_range[0], off_x_range[1])
        crop_off_y = np.random.uniform(off_y_range[0], off_y_range[1])
        blur = blur_kernels[int(math.floor(np.random.uniform(0.0, 1.0) * len(blur_kernels)))]
        xform = (angle, dist, gamma, blur, crop_percent, crop_off_x, crop_off_y, obj_width, focal)
        transforms.append(xform)

    return transforms

    Sample transformation params.

    :param num_xforms: The number of transforms to sample.
    :param rotation_range: The range of the rotation in the perspective transform.
    :param dist_range: The range of the distance (in ft) to be added to the focal length in perspective transform.
    :param gamma_range: The range of the gamma in the gamma transform.
    :param crop_percent_range: The range of the crop percent in the perspective transform.
    :param off_x_range: The range of the x offset (percent) in the perspective transform.
    :param off_y_range: The range of the y offset (percent) in the perspective transform.
    :param blur_kernels: The kernels to blur with.
    :param obj_width: The estimated object width (inches) for perspective transform. 30 by default.
    :param focal: The estimated focal length (ft) for perspective transform. 3 by default.
    :return: List of transforms.
    
art/attacks/evasion/graphite/utils.py