input: Write a python function to generate a report from a CSV file containing stock data, which includes the start date, end date, opening price, closing price, high price, low price, and average price.
  assert generate_report('sample_data1.csv') == ['2023-01-01', '2023-01-10', 100.0, 110.0, 120.0, 90.0, 105.0]
  assert generate_report('sample_data2.csv') == ['2023-02-01', '2023-02-15', 150.0, 145.0, 160.0, 140.0, 150.0]
  assert generate_report('sample_data3.csv') == ['2023-03-01', '2023-03-20', 200.0, 195.0, 220.0, 180.0, 200.0]
output: import csv
  
  def generate_report(filename):
      with open(filename, mode='r') as file:
          csv_reader = csv.DictReader(file)
          data = list(csv_reader)
          
          start_date = data[0]['Date']
          end_date = data[-1]['Date']
          
          opening_price = float(data[0]['Open'])
          closing_price = float(data[-1]['Close'])
          
          high_price = max(float(row['High']) for row in data)
          low_price = min(float(row['Low']) for row in data)
          
          average_price = sum((float(row['Open']) + float(row['Close'])) / 2 for row in data) / len(data)
          
          return [start_date, end_date, opening_price, closing_price, high_price, low_price, average_price]