import copy


def offset_bonds(bonds, offset):
    """
    Offset all of the numbers in the bonds array by value 
    offset; useful for adding molecules to a system that's
    already established because the bond arrays start at 0.
    For a system with N atoms, all indices in the new molecule
    to be added's bonds array need to be increased by N.

    bonds : Psi-OMM Bonds Array

    offset : Integer
        number to increase indices in bonds by

    Returns
    -------
    List of lists of lists in the form of the bonds array.
    """
    bc = copy.deepcopy(bonds)
    for b0 in bc[0]:
        # Increment the indices at b0[0] and b0[1] by the offset.
        b0[0] += offset
        b0[1] += offset

    for b1 in bc[1]:
        # Increment every value in the list by offset.
        for ix in range(len(b1)):
            b1[ix] += offset
    return bc