def parse_csr(csr):
    """
    Helper function that parses a CSR.

    :param csr:
    :return:
    """
    assert isinstance(csr, str)

    return x509.load_pem_x509_csr(csr.encode("utf-8"), default_backend())

    Helper function that parses a CSR.

    :param csr:
    :return:
    
lemur/common/utils.py