<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def persist_config(run, session, cfg):
 """ Persist the configuration in as key-value pairs. Args: run: The run we attach the config to. session: The db transaction we belong to. cfg: The configuration we want to persist. """

    from benchbuild.utils import schema as s

    for cfg_elem in cfg:
        session.add(
            s.Config(name=cfg_elem, value=cfg[cfg_elem], run_id=run.id))