<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 This notebook was prepared by Donne Martin. Source and license info is on GitHub.
Nose Unit Tests with IPython Notebook
Nose
Testing is a vital part of software development.  Nose extends unittest to make testing easier.
Install Nose
Run the following command line
Step3:  Create the Code
Save your code to a file with the %%file magic
Step4:  Create the Nose Tests
Save your test to a file with the %%file magic
Step5:  Run the Nose Tests
Run the following command line
<ASSISTANT_TASK:>
Python Code:
!pip install nose
Explanation: This notebook was prepared by Donne Martin. Source and license info is on GitHub.
Nose Unit Tests with IPython Notebook
Nose
Testing is a vital part of software development.  Nose extends unittest to make testing easier.
Install Nose
Run the following command line:
End of explanation
%%file type_util.py
class TypeUtil:
    @classmethod
    def is_iterable(cls, obj):
        Determines if obj is iterable.
        Useful when writing functions that can accept multiple types of
        input (list, tuple, ndarray, iterator).  Pairs well with
        convert_to_list.
        
        try:
            iter(obj)
            return True
        except TypeError:
            return False
    @classmethod
    def convert_to_list(cls, obj):
        Converts obj to a list if it is not a list and it is iterable, 
        else returns the original obj.
        
        if not isinstance(obj, list) and cls.is_iterable(obj):
            obj = list(obj)
        return obj
Explanation: Create the Code
Save your code to a file with the %%file magic:
End of explanation
%%file tests/test_type_util.py
from nose.tools import assert_equal
from ..type_util import TypeUtil
class TestUtil():
    def test_is_iterable(self):
        assert_equal(TypeUtil.is_iterable('foo'), True)
        assert_equal(TypeUtil.is_iterable(7), False)
    def test_convert_to_list(self):
        assert_equal(isinstance(TypeUtil.convert_to_list('foo'), list), True)
        assert_equal(isinstance(TypeUtil.convert_to_list(7), list), False)
Explanation: Create the Nose Tests
Save your test to a file with the %%file magic:
End of explanation
!nosetests tests/test_type_util.py -v
Explanation: Run the Nose Tests
Run the following command line:
End of explanation
<END_TASK>