human
Complete this python program:
def build_js():
assistant
#Here is the Python program you requested.

    """Build BokehJS files (CSS, JS, etc) under the ``bokehjs`` source
    subdirectory.
    Also prints a table of statistics about the generated assets (file sizes,
    etc.) or any error messages if the build fails.
    Note this function only builds BokehJS assets, it does not install them
    into the python source tree.
    """
    print('Building    BokehJS...    ', end='')
    sys.stdout.flush()
    os.chdir('bokehjs')
    if (sys.platform != 'win32'):
        cmd = [join('node_modules', '.bin', 'gulp'), 'build']
    else:
        cmd = [join('node_modules', '.bin', 'gulp.cmd'), 'build']
    t0 = time.time()
    try:
        proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    except OSError as e:
        print((BUILD_EXEC_FAIL_MSG % (cmd, e)))
        sys.exit(1)
    finally:
        os.chdir('..')
    result = proc.wait()
    t1 = time.time()
    if (result != 0):
        indented_msg = ''
        outmsg = proc.stdout.read().decode('ascii', errors='ignore')
        outmsg = '\n'.join([('                ' + x) for x in outmsg.split('\n')])
        errmsg = proc.stderr.read().decode('ascii', errors='ignore')
        errmsg = '\n'.join([('                ' + x) for x in errmsg.split('\n')])
        print((BUILD_FAIL_MSG % (red(outmsg), red(errmsg))))
        sys.exit(1)
    indented_msg = ''
    msg = proc.stdout.read().decode('ascii', errors='ignore')
    pat = re.compile('(\\[.*\\])    (.*)', re.DOTALL)
    for line in msg.strip().split('\n'):
        m = pat.match(line)
        if (not m):
            continue
        (stamp, txt) = m.groups()
        indented_msg += (((('            ' + dim(green(stamp))) + '    ') + dim(txt)) + '\n')
    msg = '\n'.join([('                ' + x) for x in msg.split('\n')])
    print((BUILD_SUCCESS_MSG % indented_msg))
    print(('Build    time:    %s' % bright(yellow(('%0.1f    seconds' % (t1 - t0))))))
    print()
    print('Build    artifact    sizes:')
    try:
        def size(*path):
            return (os.stat(join('bokehjs', 'build', *path)).st_size / (2 ** 10))
        print(('        -    bokeh.js                                                        :    %6.1f    KB' % size('js', 'bokeh.js')))
        print(('        -    bokeh.css                                                    :    %6.1f    KB' % size('css', 'bokeh.css')))
        print(('        -   ...