def write_input(self, SelPackList=False, check=False):
        """
        Write the input.

        Parameters
        ----------
        SelPackList : False or list of packages

        """
        if check:
            # run check prior to writing input
            self.check(f='{}.chk'.format(self.name), verbose=self.verbose,
                       level=1)

        # org_dir = os.getcwd()
        # os.chdir(self.model_ws)
        if self.verbose:
            print('\nWriting packages:')
        if SelPackList == False:
            for p in self.packagelist:
                if self.verbose:
                    print('   Package: ', p.name[0])
                # prevent individual package checks from running after model-level package check above
                # otherwise checks are run twice
                # or the model level check proceedure would have to be split up
                # or each package would need a check arguemnt,
                # or default for package level check would have to be False
                try:
                    p.write_file(check=False)
                except TypeError:
                    p.write_file()
        else:
            for pon in SelPackList:
                for i, p in enumerate(self.packagelist):
                    if pon in p.name:
                        if self.verbose:
                            print('   Package: ', p.name[0])
                    try:
                        p.write_file(check=False)
                    except __HOLE__:
                        p.write_file()
                        break
        if self.verbose:
            print(' ')
        # write name file
        self.write_name_file()
        # os.chdir(org_dir)
        return
dataset/ETHPy150Open modflowpy/flopy/flopy/mbase.py/BaseModel.write_input