<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def nbcompile(filename, html, basenb, agdir):
 """ Compile the baseinteract.ipynb notebook into an analysis notebook for filename """


    filename = os.path.abspath(filename)

    pc.nbcompile(os.path.dirname(filename), os.path.basename(filename), html=html, basenb=basenb, agdir=agdir)