<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Set-up IPython Notebook Environment
The first step is to set up the IPython notebook so that it can be most useful. This includes creating a profile, installing some extensions and making sure all useful tools are updated. This notebook should only need to be run once.
Create a profile
A profile is the location where Ipython stores all of your settings. To create a profile just run the following
Step1:  Install useful extensions
There are many IPython and IPython notebook extensions available.
Github List of IPython extensions - https
Step2:  Then need to edit the file
Step3:  and add an IPython load statment
Step4:  The following command will download and copy the extension to the appropriate location.
Step5:  Usability tools from the IPython-notebook extensions project
There are three additional extensions from the IPython notebook extension project (https
Step6:  Activate Extensions
Now we need to add the IPython load statments to
Step8:  The following command will install the 4 extensions.
<ASSISTANT_TASK:>
Python Code:
# Initialize profile
import IPython
import os.path as path
# Create a profile
profile, = !ipython locate profile
if not profile:
    !ipython profile create
print 'Your profile is located at:\t', profile
# Get local paths for later use
ip = IPython.get_ipython()
nbext = path.join(ip.ipython_dir, 'nbextensions')
custom = path.join(profile, 'static/custom/custom.js')
print "Extension files should be placed in: ", nbext
print "Extension settings should be added to: ", custom
Explanation: Set-up IPython Notebook Environment
The first step is to set up the IPython notebook so that it can be most useful. This includes creating a profile, installing some extensions and making sure all useful tools are updated. This notebook should only need to be run once.
Create a profile
A profile is the location where Ipython stores all of your settings. To create a profile just run the following:
End of explanation
print nbext
Explanation: Install useful extensions
There are many IPython and IPython notebook extensions available.
Github List of IPython extensions - https://github.com/ipython/ipython/wiki/Extensions-Index
Github List of IPython notebook extensions - https://github.com/ipython-contrib/IPython-notebook-extensions
Lets go ahead and install 4 notebook extensions that I find very useful. To install an extension you first download the extension and place it in:
End of explanation
print custom
Explanation: Then need to edit the file:
End of explanation
from IPython.display import YouTubeVideo
YouTubeVideo('o4xCp3b4oCw')
Explanation: and add an IPython load statment:
`IPython.load_extensions('name_of_extension');`
Download Extensions
Spell checker
IPython notebook does not have spell check by default. There are a variety of spell check extensions that have been created. None of these extensions are perfect, but the 'Spell Checking' extension from the Calico project (http://calicoproject.org/ICalico) does all that I need. Here is a youtube video describing the extension:
End of explanation
!ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-spell-check-1.0.zip --user
Explanation: The following command will download and copy the extension to the appropriate location.
End of explanation
print nbext
%%bash -c "mydir=$nbext bash"
cd $HOME/Downloads
wget https://github.com/ipython-contrib/IPython-notebook-extensions/archive/master.zip --quiet
unzip -q master.zip
mv ./IPython-notebook-extensions-master/usability $mydir/
Explanation: Usability tools from the IPython-notebook extensions project
There are three additional extensions from the IPython notebook extension project (https://github.com/ipython-contrib/IPython-notebook-extensions/wiki). I have only looked at some of the 'usability' extensions.
If you are on unix then the following commands will download and place the exentsions in the correct location. If you are on OSX or Windows you need to download:
https://github.com/ipython-contrib/IPython-notebook-extensions/archive/master.zip
Extract it and copy the 'usability' folder into:
End of explanation
print custom
Explanation: Activate Extensions
Now we need to add the IPython load statments to:
End of explanation
settings=require(["base/js/events"], function (events) {
    events.on("app_initialized.NotebookApp", function () {
        IPython.load_extensions('calico-spell-check');
        IPython.load_extensions('usability/runtools/main');
        IPython.load_extensions('usability/codefolding/main');
        IPython.load_extensions('usability/python-markdown/main');
    });
});
with open(custom, 'w') as OUT:
        OUT.write(settings)
Explanation: The following command will install the 4 extensions.
End of explanation
<END_TASK>