<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_dimension(self, name, **update_dict):
 """ Update the dimension size and extents. Parameters **update_dict : : dict: dict A dictionary containing keywords passed through to :meth:`~hypercube.dims.Dimension.update` name : str Name of the dimension to update """

        if not name:
            raise AttributeError("A dimension name is required to update "
                "a dimension. Update dictionary {u}."
                    .format(u=update_dict))

        dim = self._dims.get(name, None)

        # Sanity check dimension existence
        if not dim:
            raise ValueError("'Dimension {n}' cannot be updated as it "
                "is not registered in the dimension dictionary."
                    .format(n=name))

        dim.update(**update_dict)