I seems find another two issue in Cell  in Clone Portal sample notebook. clone portal users groups and content | ArcGIS for Developers
Below is the screen shot of code that may have issue.
Issue 1: In this line,
I checked API of create_folder() method, it writes
create_folder(folder, owner=None), we have folder first, then the owner
But in the sample notebook code, the order is opposite.
Shouldn't we use, target.content.create_folder(folder, user) instead?
I got another error when I access the folder title using folder.title. It returns following error message. For testing I create a test script.
The folder does have the key title, but for some reason we can't access it using folder.title in API. It causes problem in this sample notebook, since it uses folder.title to access the folder title.