input: Write a python function to detect faces in an image using Haar cascades.
  assert detect_face('path_to_image_with_faces.jpg')==None
  assert detect_face('path_to_image_without_faces.jpg')==None
output: def detect_face(image_path):
      import cv2
      
      # Load the pre-trained Haar cascade for face detection
      face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')
      
      # Read the image from the given path
      img = cv2.imread(image_path)
      
      # Convert the image to grayscale as the face detector expects a grayscale image
      gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
      
      # Perform face detection
      faces = face_cascade.detectMultiScale(gray, scaleFactor=1.1, minNeighbors=5, minSize=(30, 30))
      
      # Draw rectangles around detected faces
      for (x, y, w, h) in faces:
          cv2.rectangle(img, (x, y), (x+w, y+h), (255, 0, 0), 2)
      
      # Save the output image with detected faces
      output_image_path = 'detected_faces.jpg'
      cv2.imwrite(output_image_path, img)
      
      # Function does not need to return anything
      return None