input: Write a python function to generate a summary report of user data from a MySQL database.
  assert generate_user_report() == {'report_name': 'User data summary', 'summary': [{'Total': 3, 'Male': 1, 'Female': 2, 'Average Age': 30.0}]}
  assert generate_user_report() == {'report_name': 'User data summary', 'summary': [{'Total': 5, 'Male': 3, 'Female': 2, 'Average Age': 25.4}]}
  assert generate_user_report() == {'report_name': 'User data summary', 'summary': [{'Total': 0, 'Male': 0, 'Female': 0, 'Average Age': 0}]}
output: def generate_user_report():
      import mysql.connector
  
      # Connect to the MySQL database
      conn = mysql.connector.connect(
          host="localhost",
          user="yourusername",
          password="yourpassword",
          database="yourdatabase"
      )
  
      cursor = conn.cursor(dictionary=True)
  
      # Execute the SQL query to get user data
      cursor.execute("SELECT gender, age FROM users")
  
      rows = cursor.fetchall()
  
      total_users = len(rows)
      male_count = sum(1 for row in rows if row['gender'] == 'Male')
      female_count = sum(1 for row in rows if row['gender'] == 'Female')
      average_age = sum(row['age'] for row in rows) / total_users if total_users > 0 else 0
  
      # Close the cursor and connection
      cursor.close()
      conn.close()
  
      # Generate the summary report
      report = {
          'report_name': 'User data summary',
          'summary': [
              {
                  'Total': total_users,
                  'Male': male_count,
                  'Female': female_count,
                  'Average Age': average_age
              }
          ]
      }
  
      return report