input: Write a function to parse a CSV file and generate a new CSV file that adds the total number of rows, total number of columns, and the total sum of data for each attribute. If the CSV file is empty, the function should return a message indicating that the file is empty.
  
  def parse_csv(filename):
      try:
          with open(filename) as csv_file:
              reader = csv.DictReader(csv_file)
              rows = 0
              cols = 0
              data_totals = {}
              for row in reader:
                  rows += 1
                  if cols == 0:
                      cols = len(row)
                  for col in row:
                      if col not in data_totals:
                          data_totals[col] = float(row[col])
                      else:
                          data_totals[col] += float(row[col])
              if rows == 0:
                  return "File is empty"
              with open('new_csv.csv', mode='w') as new_csv_file:
                  writer = csv.writer(new_csv_file, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
                  writer.writerow(['Rows', 'Columns'])
                  writer.writerow([rows, cols])
                  writer.writerow(['Attribute', 'Total'])
                  for attr, total in data_totals.items():
                      writer.writerow([attr, total])
      except FileNotFoundError:
          return "File not found"
  
  assert parse_csv('test.csv')=="File is empty"
  assert parse_csv('nonexistent.csv')=="File not found"
  assert parse_csv('sample.csv')==None
output: 
  def parse_csv(filename):
      try:
          with open(filename) as csv_file:
              reader = csv.DictReader(csv_file)
              rows = 0
              cols = 0
              data_totals = {}
              for row in reader:
                  rows += 1
                  if cols == 0:
                      cols = len(row)
                  for col in row:
                      if col not in data_totals:
                          data_totals[col] = float(row[col])
                      else:
                          data_totals[col] += float(row[col])
              if rows == 0:
                  return "File is empty"
              with open('new_csv.csv', mode='w') as new_csv_file:
                  writer = csv.writer(new_csv_file, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
                  writer.writerow(['Rows', 'Columns'])
                  writer.writerow([rows, cols])
                  writer.writerow(['Attribute', 'Total'])
                  for attr, total in data_totals.items():
                      writer.writerow([attr, total])
      except FileNotFoundError:
          return "File not found"
  