<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def calc_DUP_parameter(self, modeln, label, fig=10, color='r', marker_type='*', h_core_mass=False):
 """ Method to calculate the DUP parameter evolution for different TPs specified specified by their model number. Parameters fig : integer Figure number to plot. modeln : list Array containing pairs of models each corresponding to a TP. First model where h boundary mass will be taken before DUP, second model where DUP reaches lowest mass. leg : string Plot label. color : string Color of the plot. marker_type : string marker type. h_core_mass : boolean, optional If True: plot dependence from h free core , else star mass. The default is False. """

        number_DUP=(old_div(len(modeln),2) -1) #START WITH SECOND
        try:
           h1_bnd_m=self.get('h1_boundary_mass')
        except:
           try:
                h1_bnd_m=self.get('he_core_mass')
           except:
                pass
        star_mass=self.get('star_mass')
        age=self.get("star_age")
        firstTP=h1_bnd_m[modeln[0]]
        first_m_dredge=h1_bnd_m[modeln[1]]
        DUP_parameter=np.zeros(number_DUP)
        DUP_xaxis=np.zeros(number_DUP)
        j=0
        for i in np.arange(2,len(modeln),2):
            TP=h1_bnd_m[modeln[i]]
            m_dredge=h1_bnd_m[modeln[i+1]]
            if i ==2:
                last_m_dredge=first_m_dredge
            #print "testest"
            #print modeln[i]
            if h_core_mass==True:
                DUP_xaxis[j]=h1_bnd_m[modeln[i]]                        #age[modeln[i]] - age[modeln[0]]
            else:
                DUP_xaxis[j]=star_mass[modeln[i]]
            #DUP_xaxis[j]=modeln[i]
            DUP_parameter[j]=old_div((TP-m_dredge),(TP-last_m_dredge))
            last_m_dredge=m_dredge
            j+=1

        pl.figure(fig)
        pl.rcParams.update({'font.size': 18})
        pl.rc('xtick', labelsize=18)
        pl.rc('ytick', labelsize=18)

        pl.plot(DUP_xaxis,DUP_parameter,marker=marker_type,markersize=12,mfc=color,color='k',linestyle='-',label=label)
        if h_core_mass==True:
            pl.xlabel("$M_H$",fontsize=20)
        else:
            pl.xlabel("M/M$_{\odot}$",fontsize=24)
        pl.ylabel("$\lambda_{DUP}$",fontsize=24)
        pl.minorticks_on()
        pl.legend()