def plot(self, axes=None, kstpkper=None, totim=None, mflay=None,
             filename_base=None, **kwargs):

        if 'file_extension' in kwargs:
            fext = kwargs.pop('file_extension')
            fext = fext.replace('.', '')
        else:
            fext = 'png'

        masked_values = kwargs.pop("masked_values", [])
        if self.model is not None:
            if self.model.bas6 is not None:
                masked_values.append(self.model.bas6.hnoflo)
        kwargs["masked_values"] = masked_values

        filenames = None
        if filename_base is not None:
            if mflay is not None:
                i0 = int(mflay)
                if i0 + 1 >= self.nlay:
                    i0 = self.nlay - 1
                i1 = i0 + 1
            else:
                i0 = 0
                i1 = self.nlay
            filenames = []
            [filenames.append(
                '{}_Layer{}.{}'.format(filename_base, k + 1, fext)) for k in
             range(i0, i1)]

        # make sure we have a (lay,row,col) shape plotarray
        plotarray = np.atleast_3d(self.get_data(kstpkper=kstpkper,
                                                totim=totim, mflay=mflay)
                                  .transpose()).transpose()
        import flopy.plot.plotutil as pu
        return pu._plot_array_helper(plotarray, model=self.model, sr=self.sr,
                                     axes=axes,
                                     filenames=filenames,
                                     mflay=mflay, **kwargs)
Ensures we do not add the same package twice.
dataset/ETHPy150Open modflowpy/flopy/flopy/utils/datafile.py/LayerFile.plot--crossover with--dataset/ETHPy150Open enthought/depsolver/depsolver/tests/test_pool.py/TestPool.test_add_repository