input: Write a python function to detect outliers using both the Standard Deviation method and the Interquartile Range method.
  assert detect_outliers([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1000, 10000], method='std') == [1000, 10000]
  assert detect_outliers([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1000, 10000], method='iqr') == [1000, 10000]
  assert detect_outliers([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], method='std') == []
  assert detect_outliers([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], method='iqr') == []
output: def detect_outliers(data, method='std'):
      import numpy as np
  
      if method == 'std':
          mean = np.mean(data)
          std = np.std(data)
          outliers = [x for x in data if abs(x - mean) > 3 * std]
      elif method == 'iqr':
          q1 = np.percentile(data, 25)
          q3 = np.percentile(data, 75)
          iqr = q3 - q1
          lower_bound = q1 - 1.5 * iqr
          upper_bound = q3 + 1.5 * iqr
          outliers = [x for x in data if x < lower_bound or x > upper_bound]
      else:
          raise ValueError("Method must be 'std' or 'iqr'")
  
      return outliers