def new_notebook(metadata=None, worksheets=None):
nb = NotebookNode()<EOL>nb.nbformat = <NUM_LIT:2><EOL>if worksheets is None:<EOL><INDENT>nb.worksheets = []<EOL><DEDENT>else:<EOL><INDENT>nb.worksheets = list(worksheets)<EOL><DEDENT>if metadata is None:<EOL><INDENT>nb.metadata = new_metadata()<EOL><DEDENT>else:<EOL><INDENT>nb.metadata = NotebookNode(metadata)<EOL><DEDENT>return nb<EOL>
Create a notebook by name, id and a list of worksheets.