code: def permute_features(
      feature_samples: np.ndarray,
      features_to_permute: Union[List[int], np.ndarray],
      randomize_features_jointly: bool,
  ) -> np.ndarray:
      # Making copy to ensure that the original object is not modified.
      feature_samples = np.array(feature_samples)
  
      if randomize_features_jointly:
          # Permute samples jointly. This still represents an interventional distribution.
          feature_samples[:, features_to_permute] = feature_samples[
              np.random.choice(
                  feature_samples.shape[0],
                  feature_samples.shape[0],
                  replace=False,
              )
          ][:, features_to_permute]
      else:
          # Permute samples independently.
          for feature in features_to_permute:
              np.random.shuffle(feature_samples[:, feature])
  
      return feature_samples
  
file_path: dowhy/dowhy/gcm/stats.py
imports: from typing import Callable, List, Optional, Union
  import numpy
  from numpy.matlib import repmat
  from scipy import stats
  from sklearn.linear_model import LinearRegression
  from dowhy.gcm.constant import EPS
  from dowhy.gcm.util.general import shape_into_2d
label_desc: Use image node_id 3 for calling a global function with example usage: permute_features(feature_samples, features_to_permute, randomize_features_jointly) and returns: feature_samples