<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def save_object(self, obj):
 r""" Saves the given object to a file Parameters obj : OpenPNM object The file to be saved. Depending on the object type, the file extension will be one of 'net', 'geo', 'phase', 'phys' or 'alg'. """

        if not isinstance(obj, list):
            obj = [obj]
        for item in obj:
            filename = item.name + '.' + item.settings['prefix']
            with open(filename, 'wb') as f:
                pickle.dump({item.name: item}, f)