def add_existing_package(self, filename, ptype=None, copy_to_model_ws=True):
    '\n        Add an existing package to a model instance.\n\n        Parameters\n        ----------\n\n        filename : str\n            the name of the file to add as a package\n        ptype : optional\n            the model package type (e.g. "lpf", "wel", etc).  If None,\n            then the file extension of the filename arg is used\n        copy_to_model_ws : bool\n            flag to copy the package file into the model_ws directory.\n\n        Returns\n        -------\n        None\n\n        '
    if (ptype is None):
        ptype = filename.split('.')[(- 1)]
    ptype = str(ptype).upper()

    class Obj():
        pass
    fake_package = Obj()
    fake_package.write_file = (lambda : None)
    fake_package.name = [ptype]
    fake_package.extension = [filename.split('.')[(- 1)]]
    fake_package.unit_number = [self.next_ext_unit()]
    if copy_to_model_ws:
        base_filename = os.path.split(filename)[(- 1)]
        fake_package.file_name = [base_filename]
        shutil.copy2(filename, os.path.join(self.model_ws, base_filename))
    else:
        fake_package.file_name = [filename]
    fake_package.allowDuplicates = True
    self.add_package(fake_package)
Add an existing package to a model instance.

Parameters
----------

filename : str
    the name of the file to add as a package
ptype : optional
    the model package type (e.g. "lpf", "wel", etc).  If None,
    then the file extension of the filename arg is used
copy_to_model_ws : bool
    flag to copy the package file into the model_ws directory.

Returns
-------
None
def add_existing_package(self, filename, ptype=None, copy_to_model_ws=True):
    '\n        Add an existing package to a model instance.\n\n        Parameters\n        ----------\n\n        filename : str\n            the name of the file to add as a package\n        ptype : optional\n            the model package type (e.g. "lpf", "wel", etc).  If None,\n            then the file extension of the filename arg is used\n        copy_to_model_ws : bool\n            flag to copy the package file into the model_ws directory.\n\n        Returns\n        -------\n        None\n\n        '
    if (ptype is None):
        ptype = filename.split('.')[(- 1)]
    ptype = str(ptype).upper()

    class Obj():
        pass
    fake_package = Obj()
    fake_package.write_file = (lambda : None)
    fake_package.name = [ptype]
    fake_package.extension = [filename.split('.')[(- 1)]]
    fake_package.unit_number = [self.next_ext_unit()]
    if copy_to_model_ws:
        base_filename = os.path.split(filename)[(- 1)]
        fake_package.file_name = [base_filename]
        shutil.copy2(filename, os.path.join(self.model_ws, base_filename))
    else:
        fake_package.file_name = [filename]
    fake_package.allowDuplicates = True
    self.add_package(fake_package)