def bokehjsdir(dev=False):
    """ Get the location of the bokehjs source files. If dev is True,
    the files in bokehjs/build are preferred. Otherwise uses the files
    in bokeh/server/static.
    """
    dir1 = join(ROOT_DIR, '..', 'bokehjs', 'build')
    dir2 = join(serverdir(), 'static')
    if dev and isdir(dir1):
        return dir1
    else:
        return dir2