human
Complete the below
def fit_point_cloud(src_pts, tgt_pts, rotate=True, translate=True, scale=0, x0=None, leastsq_args={}, out='params'):

    ''''Find a transform between unmatched sets of points.
    This minimizes the squared distance from each source point to its closest
    target point, using :func:`scipy.optimize.leastsq` to find a
    transformation using rotation, translation, and scaling (in that order).
    Parameters
    src_pts : array, shape = (n, 3)
    Points to which the transform should be applied.
    tgt_pts : array, shape = (m, 3)
    Points to which src_pts should be fitted. Each point in tgt_pts should
    correspond to the point in src_pts with the same index.
    rotate : bool
    Allow rotation of the ``src_pts``.
    translate : bool
    Allow translation of the ``src_pts``.
    scale : 0 | 1 | 3
    Number of scaling parameters. With 0, points are not scaled. With 1,
    points are scaled by the same factor along all axes. With 3, points are
    scaled by a separate factor along each axis.
    x0 : None | tuple
    Initial values for the fit parameters.
    leastsq_args : dict
    Additional parameters to submit to :func:`scipy.optimize.leastsq`.
    out : \'params\' | \'trans\'
    In what format to return the estimate: \'params\' returns a tuple with
    the fit parameters.
\'trans\' returns a transformation matrix of shape
    (4, 4).
    Returns
    x : array, shape = (n_params, )
    Estimated parameters for the transformation.
    Notes
    Assumes that the target points form a dense enough point cloud so that
    the distance of each src_pt to the closest tgt_pt can be used as an
    estimate of the distance of src_pt to tgt_pts.'
    '''
 What is a Python code to find a transform between unmatched sets of points?
assistant
#Here is Python code to find a transform between unmatched sets of points.
    from scipy.optimize import leastsq
    kwargs = {'epsfcn': 0.01}
    kwargs.update(leastsq_args)
    src_pts = np.atleast_2d(src_pts)
    tgt_pts = np.atleast_2d(tgt_pts)
    translate = bool(translate)
    rotate = bool(rotate)
    scale = int(scale)
    if translate:
        src_pts = np.hstack((src_pts, np.ones((len(src_pts), 1))))
    try:
        from sklearn.neighbors import BallTree
        tgt_pts = BallTree(tgt_pts)
        errfunc = _point_cloud_error_balltree
    except ImportError:
        warn('Sklearn    could    not    be    imported.    Fitting    points    will    be    slower.    To    improve    performance,    install    the    sklearn    module.')
        errfunc = _point_cloud_error
    param_info = (rotate, translate, scale)
    if (param_info == (True, False, 0)):
        x0 = (x0 or (0, 0, 0))
        def error(x):
            (rx, ry, rz) = x
            trans = rotation3d(rx, ry, rz)
            est = dot(src_pts, trans.T)
            err = errfunc(est, tgt_pts)
            return err
    elif (param_info == (True, False, 1)):
        x0 = (x0 or (0, 0, 0, 1))
        def error(x):
            (rx, ry, rz, s) = x
            trans = (rotation3d(rx, ry, rz) * s)
            est = dot(src_pts, trans.T)
            err = errfunc(est, tgt_pts)
            return err
    elif (param_info == (True, False, 3)):
        x0 = (x0 or (0, 0, 0, 1, 1, 1))
        def error(x):
            (rx, ry, rz, sx, sy, sz) = x
            trans = (rotation3d(rx, ry, rz) * [sx, sy, sz])
            est = dot(src_pts, trans.T)
            err = errfunc(est, tgt_pts)
            return err
    elif (param_info == (True, True, 0)):
        x0 = (x0 or (0, 0, 0, 0, 0, 0))
        def error(x):
            (rx, ry, rz, tx, ty, tz) = x
            trans = dot(translation(tx, ty, tz), rotation(rx, ry, rz))
            est = dot(src_pts, trans.T)
            err = errfunc(est[:, :3], tgt_pts)
            return err
    else:
        raise NotImplementedError(('The    specified    parameter    combination   ...