<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update_dimensions(self, dims):
 """ Update multiple dimension on the cube. .. code-block:: python cube.update_dimensions([ {'name' : 'ntime', 'global_size' : 10, 'lower_extent' : 2, 'upper_extent' : 7 }, {'name' : 'na', 'global_size' : 3, 'lower_extent' : 2, 'upper_extent' : 7 }, ]) Parameters dims : list or dict: A list or dictionary of dimension updates """


        if isinstance(dims, collections.Mapping):
            dims = dims.itervalues()

        for dim in dims:
            # Defer to update dimension for dictionaries
            if isinstance(dim, dict):
                self.update_dimension(**dim)
            # Replace if given a Dimension object
            elif isinstance(dim, Dimension):
                self._dims[dim.name] = dim
            else:
                raise TypeError("Unhandled type '{t}'"
                    "in update_dimensions".format(t=type(dim)))