def connect_atoms(model, data_file, model_id):
    """Takes a :py:class:`.Model` and creates :py:class:`.Bond`
    objects between atoms in it based on the ``connections`` in the provided
    :py:class:`.PdbDataFile`.

    :param Model model: the model to update.
    :param PdbDataFile data_file: The source Pdb Data File
    :param int model_id: The ID of the model in the data fileto be used for    conversion."""
    for connection in data_file.connections():
        atom = model.get_atom_by_id(connection['atom_id'])
        if atom:
            for bonded_atom_id in connection['bonded_atoms']:
                bonded_atom = model.get_atom_by_id(bonded_atom_id)
                if bonded_atom and atom is not bonded_atom:
                    atom.bond_to(bonded_atom)
