code: def anisotropic_Gaussian(ksize=15, theta=np.pi, l1=6, l2=6):
      """generate an anisotropic Gaussian kernel
      Args:
          ksize : e.g., 15, kernel size
          theta : [0,  pi], rotation angle range
          l1    : [0.1,50], scaling of eigenvalues
          l2    : [0.1,l1], scaling of eigenvalues
          If l1 = l2, will get an isotropic Gaussian kernel.
      Returns:
          k     : kernel
      """
  
      v = np.dot(
          np.array(
              [
                  [np.cos(theta), -np.sin(theta)],
                  [np.sin(theta), np.cos(theta)],
              ]
          ),
          np.array([1.0, 0.0]),
      )
      V = np.array([[v[0], v[1]], [v[1], -v[0]]])
      D = np.array([[l1, 0], [0, l2]])
      Sigma = np.dot(np.dot(V, D), np.linalg.inv(V))
      k = gm_blur_kernel(mean=[0, 0], cov=Sigma, size=ksize)
  
      return k
  
imports: import random
  from functools import partial
  import albumentations
  import cv2
  import ldm.modules.image_degradation.utils_image
  import numpy
  import scipy
  import scipy.stats
  import torch
  from scipy import ndimage
  from scipy.interpolate import interp2d
  from scipy.linalg import orth
label_desc: Use image node_id 3 for calling a global function with example usage: anisotropic_Gaussian(ksize, theta, l1, l2) and returns: k