<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_plotbounds_from_cf(coord, bounds):
 """ Get plot bounds from the bounds stored as defined by CFConventions Parameters coord: xarray.Coordinate The coordinate to get the bounds for bounds: xarray.DataArray The bounds as inferred from the attributes of the given `coord` Returns ------- %(CFDecoder.get_plotbounds.returns)s Notes ----- this currently only works for rectilinear grids"""


        if bounds.shape[:-1] != coord.shape or bounds.shape[-1] != 2:
            raise ValueError(
                "Cannot interprete bounds with shape {0} for {1} "
                "coordinate with shape {2}.".format(
                    bounds.shape, coord.name, coord.shape))
        ret = np.zeros(tuple(map(lambda i: i+1, coord.shape)))
        ret[tuple(map(slice, coord.shape))] = bounds[..., 0]
        last_slices = tuple(slice(-1, None) for _ in coord.shape)
        ret[last_slices] = bounds[tuple(chain(last_slices, [1]))]
        return ret