import typing


def lane_offset_width_meters(shape: typing.Sequence[int],
                             poly_evals: typing.Tuple[typing.List[float], typing.List[float]],
                             xm_per_pix: float) -> typing.Tuple[float, float]:
    """Calculate center-offset of the lane, given polynomial curves for both lane lines.

    The vehicle is left of lane-center for values less than 0, and right of lane-center for values greater than 0.
    """
    y_shape, x_shape = shape[:2]
    y_eval = y_shape - 1
    left_eval, right_eval = poly_evals

    vehicle_center = x_shape // 2
    lane_center = sum(poly[y_eval] for poly in poly_evals) / len(poly_evals)
    offset_pix = vehicle_center - lane_center
    offset_m = offset_pix * xm_per_pix

    lane_width_m = abs(left_eval[y_eval] - right_eval[y_eval]) * xm_per_pix
    return (offset_m, lane_width_m)