def delete_network_segment(context, segment_id):
 with context.session.begin(subtransactions=True):
  context.session.query(segments_model.NetworkSegment).filter_by(id=segment_id).delete()

def delete_network_segment ( context , segment_id ) : with context . session . begin ( subtransactions = True ) : context . session . query ( segments_model . NetworkSegment ) . filter_by ( id = segment_id ) . delete ( )
release a dynamic segment for the params provided if one exists .