<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_extents(self, element, ranges, range_type='combined', xdim=None, ydim=None, zdim=None):
 """ Gets the extents for the axes from the current Element. The globally computed ranges can optionally override the extents. The extents are computed by combining the data ranges, extents and dimension ranges. Each of these can be obtained individually by setting the range_type to one of: * 'data': Just the data ranges * 'extents': Element.extents * 'soft': Dimension.soft_range values * 'hard': Dimension.range values To obtain the combined range, which includes range padding the default may be used: * 'combined': All the range types combined and padding applied This allows Overlay plots to obtain each range and combine them appropriately for all the objects in the overlay. """

        num = 6 if self.projection == '3d' else 4
        if self.apply_extents and range_type in ('combined', 'extents'):
            norm_opts = self.lookup_options(element, 'norm').options
            if norm_opts.get('framewise', False) or self.dynamic:
                extents = element.extents
            else:
                extent_list = self.hmap.traverse(lambda x: x.extents, [Element])
                extents = util.max_extents(extent_list, self.projection == '3d')
        else:
            extents = (np.NaN,) * num

        if range_type == 'extents':
            return extents

        if self.apply_ranges:
            range_extents = self._get_range_extents(element, ranges, range_type, xdim, ydim, zdim)
        else:
            range_extents = (np.NaN,) * num

        if getattr(self, 'shared_axes', False) and self.subplot:
            combined = util.max_extents([range_extents, extents], self.projection == '3d')
        else:
            max_extent = []
            for l1, l2 in zip(range_extents, extents):
                if isfinite(l2):
                    max_extent.append(l2)
                else:
                    max_extent.append(l1)
            combined = tuple(max_extent)

        if self.projection == '3d':
            x0, y0, z0, x1, y1, z1 = combined
        else:
            x0, y0, x1, y1 = combined

        x0, x1 = util.dimension_range(x0, x1, self.xlim, (None, None))
        y0, y1 = util.dimension_range(y0, y1, self.ylim, (None, None))
        if self.projection == '3d':
            z0, z1 = util.dimension_range(z0, z1, self.zlim, (None, None))
            return (x0, y0, z0, x1, y1, z1)
        return (x0, y0, x1, y1)