text: import asyncio
  import io
  import glob
  import os
  import sys
  import time
  import uuid
  import requests
  from urllib.parse import urlparse
  from io import BytesIO
  # To install this module, run:
  # python -m pip install Pillow
  from PIL import Image, ImageDraw
  from azure.cognitiveservices.vision.face import FaceClient
  from msrest.authentication import CognitiveServicesCredentials
  from azure.cognitiveservices.vision.face.models import TrainingStatusType, Person
  
  # This key will serve all examples in this document.
  KEY = ""
  
  # This endpoint will be used in all examples in this quickstart.
  ENDPOINT = ""
  
  # Create an authenticated FaceClient.
  face_client = FaceClient(ENDPOINT, CognitiveServicesCredentials(KEY))
  
  # Detect a face in an image that contains a single face
  single_face_image_url = 'https://media.discordapp.net/attachments/866808656892788766/931044592344780810/9109d0e9-b230-477b-8d92-6a41b9e12991.png'
  single_image_name = os.path.basename(single_face_image_url)
  # We use detection model 3 to get better performance.
  detected_faces = face_client.face.detect_with_url(url=single_face_image_url, detection_model='detection_03')
  if not detected_faces:
      raise Exception('No face detected from image {}'.format(single_image_name))
  
  # Convert width height to a point in a rectangle
  def getRectangle(faceDictionary):
      rect = faceDictionary.face_rectangle
      left = rect.left
      top = rect.top
      right = left + rect.width
      bottom = top + rect.height
      
      return ((left, top), (right, bottom))
  
  def drawFaceRectangles() :
  # Download the image from the url
      response = requests.get(single_face_image_url)
      img = Image.open(BytesIO(response.content))
  
  # For each face returned use the face rectangle and draw a red box.
      print('Drawing rectangle around face... see popup for results.')
      draw = ImageDraw.Draw(img)
      for face in detected_faces:
          draw.rectangle(getRectangle(face), outline='red')
  
  # Display the image in the default image browser.
      img.show()
  
  # Uncomment this to show the face rectangles.
      drawFaceRectangles()
  