from subprocess import run


def perform_shutdown(body):
    arg = ""
    if body["reboot"]:
        _is_reboot = arg + "-r"
    else:
        _is_reboot = arg + "-h"
    time_to_shutdown = str(body['timeToShutdown'])
    result = run(["/sbin/shutdown", _is_reboot, time_to_shutdown])
    return body

[((11, 13, 11, 66), 'subprocess.run', 'run', ({(11, 17, 11, 65): "['/sbin/shutdown', _is_reboot, time_to_shutdown]"}, {}), "(['/sbin/shutdown', _is_reboot, time_to_shutdown])", False, 'from subprocess import run\n')]