def osx_standby():
 try:
  subprocess.call(['osascript', '-e', 'tell app "System Events" to sleep'])
  time.sleep(10)
 except:
  logging.error(T('Failed to standby system'))
  logging.info('Traceback: ', exc_info=True)

def osx_standby ( ) : try : subprocess . call ( [ 'osascript' , '-e' , 'tell app "System Events" to sleep' ] ) time . sleep ( 10 ) except : logging . error ( T ( 'Failed to standby system' ) ) logging . info ( 'Traceback: ' , exc_info = True )
make osx system sleep .