<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def nurbs_to_bspline(obj, **kwargs):
 """ Extracts the non-rational components from rational parametric shapes, if possible. The possibility of converting a rational shape to a non-rational one depends on the weights vector. :param obj: NURBS shape :type obj: NURBS.Curve, NURBS.Surface or NURBS.Volume :return: B-Spline shape :rtype: BSpline.Curve, BSpline.Surface or BSpline.Volume :raises: TypeError """

    if not obj.rational:
        raise TypeError("The input must be a rational shape")

    # Get keyword arguments
    tol = kwargs.get('tol', 10e-8)

    # Test for non-rational component extraction
    for w in obj.weights:
        if abs(w - 1.0) > tol:
            print("Cannot extract non-rational components")
            return obj

    # NURBS -> B-Spline
    if isinstance(obj, NURBS.Curve):
        return _convert.convert_curve(obj, BSpline)
    elif isinstance(obj, NURBS.Surface):
        return _convert.convert_surface(obj, BSpline)
    elif isinstance(obj, NURBS.Volume):
        return _convert.convert_volume(obj, BSpline)
    else:
        raise TypeError("Input must be an instance of NURBS curve, surface or volume")