def add_package(self, p):
        for u in p.unit_number:
            if u in self.package_units or u in self.external_units:
                print("WARNING: unit {0} of package {1} already in use".format(
                    u, p.name))
            self.package_units.append(u)
        for i, pp in enumerate(self.packagelist):
            if pp.allowDuplicates:
                continue
            elif isinstance(p, type(pp)):
                print('****Warning -- two packages of the same type: ',
                      type(p), type(pp))
                print('replacing existing Package...')
                self.packagelist[i] = p
                return
        if self.verbose:
            print('adding Package: ', p.name[0])
        self.packagelist.append(p)
Add a package.
dataset/ETHPy150Open modflowpy/flopy/flopy/mbase.py/BaseModel.add_package