import copy


def get_restraint_force(system):
    """Extract the radially symmetric restraint Custom(Centroid)BondForce of the system."""
    restraint_force = None
    for i, force in enumerate(system.getForces()):
        if force.__class__.__name__ in ['CustomCentroidBondForce', 'CustomBondForce']:
            if force.getGlobalParameterName(0) == 'lambda_restraints':
                restraint_force = copy.deepcopy(force)
                break
    return restraint_force