<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def dim_extent_size(self, *args, **kwargs):
 """ Returns extent sizes of the dimensions in args. .. code-block:: python ts, bs, cs = cube.dim_extent_size('ntime', 'nbl', 'nchan') or .. code-block:: python ts, bs, cs, ss = cube.dim_extent_size('ntime,nbl:nchan nsrc') """



        extents = self.dim_extents(*args, **kwargs)

        # Handle tuples and sequences differently
        if isinstance(extents, tuple):
            return extents[1] - extents[0]
        else: # isinstance(extents, collections.Sequence):
            return (u-l for l, u in extents)