def generate_qr_code(ssid: str, password: str, path: str, show_qr: bool) -> None:
    """
    Generates a QR code from a given ssid and password

    Source: https://git.io/JtLIv
    """
    if ssid == "" or ssid is None:
        print('SSID is not specified, cannot generate QR code.')
        return

    text = f"WIFI:T:WPA;S:{ssid};P:{password};;"

    try:
        qr = qrcode.QRCode(version=1,
                        error_correction=qrcode.constants.ERROR_CORRECT_L,
                        box_size=10,
                        border=4)
        qr.add_data(text)

        if show_qr:
            print(f'---------- {ssid} ----------')
            # This will emulate support for ANSI escape sequences, which is needed
            # in order to display the QR code on Windows
            colorama.init()
            qr.make()
            qr.print_tty()

        if path:
            file_name = ssid.replace(" ", "_") + ".png"

            if path == "STORE_LOCALLY":
                path = file_name

            try:
                img = qr.make_image()
                img.save(path)

                print(f"QR code has been saved to {path}")
            except FileNotFoundError:
                print(f"No such file/directory: '{path}'")
    except Exception as ex:
        print(f'QR Code Error: {ex}')

    Generates a QR code from a given ssid and password

    Source: https://git.io/JtLIv
    
wifi_password/utils.py