Prevent MacBook Pro 2016 from sleeping (High Sierra)
Use this on the terminal :
caffeinate -u -t <time_awake_in_secs>
It will keep the screen awake, avoid any restart till the time specified.
Use only
caffeinate
if you want to endlessly keep the system awake.
To end this mode press control c or kill the terminal
Anti Sleep is a free app available on the App Store. It prevents Mac from going into sleep mode.
NoSleep is a MacOS X kernel extension, preventing sleep when you close the lid.