discretionary functions — Legal Definition, Examples & Cases