def extract_svg_content(image_file: str | Path) -> str:
    """
    Provided a path or URL to an SVG file, return the SVG content as a string.
    Parameters:
        image_file: Local file path or URL to an SVG file
    Returns:
        str: The SVG content as a string
    """
    image_file = str(image_file)
    if is_http_url_like(image_file):
        response = httpx.get(image_file)
        response.raise_for_status()  # Raise an error for bad status codes
        return response.text
    else:
        with open(image_file) as file:
            svg_content = file.read()
        return svg_content

    Provided a path or URL to an SVG file, return the SVG content as a string.
    Parameters:
        image_file: Local file path or URL to an SVG file
    Returns:
        str: The SVG content as a string
    
gradio/image_utils.py