<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _adjust_for_anisotropy(X, center, scaling, angle):
 """Adjusts data coordinates to take into account anisotropy. Can also be used to take into account data scaling. Angles are CCW about specified axes. Scaling is applied in rotated coordinate system. Parameters X : ndarray float array [n_samples, n_dim], the input array of coordinates center : ndarray float array [n_dim], the coordinate of centers scaling : ndarray float array [n_dim - 1], the scaling of last two dimensions angle : ndarray float array [2*n_dim - 3], the anisotropy angle (degrees) Returns ------- X_adj : ndarray float array [n_samples, n_dim], the X array adjusted for anisotropy. """


    center = np.asarray(center)[None, :]
    angle = np.asarray(angle)*np.pi/180

    X -= center

    Ndim = X.shape[1]

    if Ndim == 1:
        raise NotImplementedError('Not implemnented yet?')
    elif Ndim == 2:
        stretch = np.array([[1, 0], [0, scaling[0]]])
        rot_tot = np.array([[np.cos(-angle[0]), -np.sin(-angle[0])],
                           [np.sin(-angle[0]), np.cos(-angle[0])]])
    elif Ndim == 3:
        stretch = np.array([[1., 0., 0.], [0., scaling[0], 0.], [0., 0., scaling[1]]])
        rotate_x = np.array([[1., 0., 0.],
                             [0., np.cos(-angle[0]), -np.sin(-angle[0])],
                             [0., np.sin(-angle[0]), np.cos(-angle[0])]])
        rotate_y = np.array([[np.cos(-angle[1]), 0., np.sin(-angle[1])],
                             [0., 1., 0.],
                             [-np.sin(-angle[1]), 0., np.cos(-angle[1])]])
        rotate_z = np.array([[np.cos(-angle[2]), -np.sin(-angle[2]), 0.],
                             [np.sin(-angle[2]), np.cos(-angle[2]), 0.],
                             [0., 0., 1.]])
        rot_tot = np.dot(rotate_z, np.dot(rotate_y, rotate_x))
    else:
        raise ValueError("Adjust for anisotropy function doesn't "
                         "support ND spaces where N>3")
    X_adj = np.dot(stretch, np.dot(rot_tot, X.T)).T

    X_adj += center

    return X_adj