def _remove_network_profile(self, nprofile_id, db_session=None):
        db_session = db_session or db.get_session()
        with db_session.begin(subtransactions=True):
            nprofile = (db_session.query(n1kv_models.NetworkProfile).
                        filter_by(id=nprofile_id).first())
            if nprofile:
                db_session.delete(nprofile)
            # also delete all bindings with this profile
            db_session.query(n1kv_models.ProfileBinding).filter_by(
                profile_id=nprofile_id).delete()
            return nprofile
Delete a network profile.
dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/plugins/ml2/drivers/cisco/n1kv/network_profile_service.py/NetworkProfile_db_mixin._remove_network_profile