Prevent MacBook Pro 2016 from sleeping (High Sierra)
Use this on the terminal : 

caffeinate -u -t &lt;time_awake_in_secs&gt;


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