<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_nb_theme(name):
 """Set theme from within notebook """

    from IPython.core.display import HTML
    styles_dir = os.path.join(package_dir, 'styles/compiled/')
    css_path = glob('{0}/{1}.css'.format(styles_dir, name))[0]
    customcss = open(css_path, "r").read()

    return HTML(''.join(['<style> ', customcss, ' </style>']))