def write_file(self):
        """
        Write the package file.

        Returns
        -------
        None

        """
        f_oc = open(self.fn_path, 'w')
        f_oc.write('%s\n' % self.heading)
        nstp = self.parent.get_package('DIS').nstp

        # words option
        if self.words is not None:

            f_oc.write('HEAD PRINT FORMAT {0:3.0f}\n' \
                       .format(self.ihedfm))
            if self.chedfm is not None:
                f_oc.write('HEAD SAVE FORMAT {0:20s} LABEL\n' \
                           .format(self.chedfm))
            f_oc.write('HEAD SAVE UNIT {0:5.0f}\n' \
                       .format(self.unit_number[1]))

            f_oc.write('DRAWDOWN PRINT FORMAT {0:3.0f}\n' \
                       .format(self.iddnfm))
            if self.cddnfm == None:
                f_oc.write('DRAWDOWN SAVE FORMAT {0:20s} LABEL\n' \
                           .format(self.cddnfm))
            f_oc.write('DRAWDOWN SAVE UNIT {0:5.0f}\n' \
                       .format(self.unit_number[2]))
            if self.compact:
                f_oc.write('COMPACT BUDGET FILES')
            f_oc.write('\n')
            for i in self.word_list:
                f_oc.write(i)

        # numeric codes option
        else:
            f_oc.write('%3i%3i%5i%5i\n' % \
                       (self.ihedfm, self.iddnfm, self.unit_number[1], \
                        self.unit_number[2]))

            ss = 0
            # len(nstp) is the number of stress periods
            for p in range(len(nstp)):
                for s in range(nstp[p]):
                    if (ss < len(self.item2)):
                        a = self.item2[ss]
                    else:
                        a = self.item2[-1]
                    if (ss < len(self.item3)):
                        b = self.item3[ss]
                    else:
                        b = self.item3[-1]
                    f_oc.write('%3i%3i%3i%3i  Period %3i, step %3i\n' \
                               % (a[0], a[1], a[2], a[3], p + 1, s + 1))

                    # incode > 0 means that item3 must have one record for each 
                    # layer, so perform check here
                    if (a[0] > 0):
                        nr, nc = b.shape
                        assert nr == nlay, 'item3 must have {0:1d} rows when incode > 0 ' % (nlay)
                        for bb in b:
                            f_oc.write('%3i%3i%3i%3i\n' % (bb[0], bb[1], bb[2], bb[3]))
                    else:
                        f_oc.write('%3i%3i%3i%3i\n' % (b[0], b[1], b[2], b[3]))
                    ss = ss + 1
        f_oc.close()
dataset/ETHPy150Open modflowpy/flopy/flopy/modflow/mfoc88.py/ModflowOc88.write_file/operator `is not` -> `==`