<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load_schema(ldif_file):
 """ Load a schema from the given file into the SamDB """

    samdb = samdb_connect()
    dn = samdb.domain_dn()

    samdb.transaction_start()
    try:
        setup_add_ldif(samdb, ldif_file, {
            "DOMAINDN": dn,
        })
    except:
        samdb.transaction_cancel()
        raise

    samdb.transaction_commit()