<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def density_profile(self,ixaxis='mass',ifig=None,colour=None,label=None,fname=None):
        '''
        Plot density as a function of either mass coordiate or radius.

        Parameters
        ----------
        ixaxis : string
            'mass' or 'radius'
            The default value is 'mass'
        ifig : integer or string
            The figure label
            The default value is None
        colour : string
            What colour the line should be
            The default value is None
        label : string
            Label for the line
            The default value is None
        fname : integer
            What cycle to plot from (if SE output)
            The default value is None
        '''

        pT=self._classTest()

        # Class-specific things:
        if pT is 'mesa_profile':
            x = self.get(ixaxis)
            if ixaxis is 'radius':
                x = x*ast.rsun_cm
            y = self.get('logRho')
        elif pT is 'se':
            if fname is None:
                raise IOError("Please provide the cycle number fname")
            x = self.se.get(fname,ixaxis)
            y = np.log10(self.se.get(fname,'rho'))
        else:
            raise IOError("Sorry. the density_profile method is not available \
                          for this class")

        # Plot-specific things:
        if ixaxis is 'radius':
            x = np.log10(x)
            xlab='$\log_{10}(r\,/\,{\\rm cm})$'
        else:
            xlab='${\\rm Mass}\,/\,M_\odot$'

        if ifig is not None:
            pl.figure(ifig)
        if label is not None:
            if colour is not None:
                pl.plot(x,y,color=colour,label=label)
            else:
                pl.plot(x,y,label=label)
            pl.legend(loc='best').draw_frame(False)
        else:
            if colour is not None:
                pl.plot(x,y,color=colour)
            else:
                pl.plot(x,y)

        pl.xlabel(xlab)
        pl.ylabel('$\log_{10}(\\rho\,/\,{\\rm g\,cm}^{-3})$')