@staticmethod
    def load(f, model, nper=None, ext_unit_dict=None):

        if model.verbose:
            sys.stdout.write('loading oc package file...\n')

        if nper is None:
            nrow, ncol, nlay, nper = model.get_nrow_ncol_nlay_nper()

        # initialize
        ihedfm = 0
        iddnfm = 0
        ihedun = 0
        iddnun = 0
        compact = False
        chedfm = None
        cddnfm = None
        words = []
        wordrec = []

        # open file
        if not hasattr(f, 'read'):
            filename = f
            f = open(filename, 'r')

        # process each line
        for line in f:
            lnlst = line.strip().split()
            if line[0] == '#':
                continue

            # added by JJS 12/12/14 to avoid error when there is a blank line in the OC file
            if lnlst == []:
                continue
            # end add

            # dataset 1 values
            elif ('HEAD' in lnlst[0].upper() and
                          'PRINT' in lnlst[1].upper() and
                          'FORMAT' in lnlst[2].upper()
                  ):
                ihedfm = int(lnlst[3])
            elif ('HEAD' in lnlst[0].upper() and
                          'SAVE' in lnlst[1].upper() and
                          'FORMAT' in lnlst[2].upper()
                  ):
                chedfm = lnlst[3]
            elif ('HEAD' in lnlst[0].upper() and
                          'SAVE' in lnlst[1].upper() and
                          'UNIT' in lnlst[2].upper()
                  ):
                ihedun = int(lnlst[3])
            elif ('DRAWDOWN' in lnlst[0].upper() and
                          'PRINT' in lnlst[1].upper() and
                          'FORMAT' in lnlst[2].upper()
                  ):
                iddnfm = int(lnlst[3])
            elif ('DRAWDOWN' in lnlst[0].upper() and
                          'SAVE' in lnlst[1].upper() and
                          'FORMAT' in lnlst[2].upper()
                  ):
                cddnfm = lnlst[3]
            elif ('DRAWDOWN' in lnlst[0].upper() and
                          'SAVE' in lnlst[1].upper() and
                          'UNIT' in lnlst[2].upper()
                  ):
                iddnun = int(lnlst[3])
            elif ('IBOUND' in lnlst[0].upper() and
                          'SAVE' in lnlst[1].upper() and
                          'FORMAT' in lnlst[2].upper()
                  ):
                cboufm = lnlst[3]
            elif ('IBOUND' in lnlst[0].upper() and
                          'SAVE' in lnlst[1].upper() and
                          'UNIT' in lnlst[2].upper()
                  ):
                ibouun = int(lnlst[3])
            elif 'COMPACT' in lnlst[0].upper():
                compact = True

            # dataset 2
            elif 'PERIOD' in lnlst[0].upper():
                if len(wordrec) > 3:
                    words.append(wordrec)
                iperoc = int(lnlst[1])
                itsoc = int(lnlst[3])
                wordrec = [iperoc, itsoc]

            # dataset 3
            elif 'PRINT' in lnlst[0].upper() and 'HEAD' in lnlst[1].upper():
                wordrec.append('PHEAD')
            elif ('PRINT' in lnlst[0].upper() and
                          'DRAWDOWN' in lnlst[1].upper()):
                wordrec.append('PDRAWDOWN')
            elif 'PRINT' in lnlst[0].upper() and 'BUDGET' in lnlst[1].upper():
                wordrec.append('PBUDGET')
            elif 'SAVE' in lnlst[0].upper() and 'HEAD' in lnlst[1].upper():
                wordrec.append('HEAD')
            elif ('SAVE' in lnlst[0].upper() and
                          'DRAWDOWN' in lnlst[1].upper()):
                wordrec.append('DRAWDOWN')
            elif 'SAVE' in lnlst[0].upper() and 'IBOUND' in lnlst[1].upper():
                wordrec.append('IBOUND')
            elif 'SAVE' in lnlst[0].upper() and 'BUDGET' in lnlst[1].upper():
                wordrec.append('BUDGET')
            else:
                print('Old style oc files not supported for import.')
                print('Convert to words.')
                return ModflowOc88(model)

        # store the last record in word
        if len(wordrec) > 3:
            words.append(wordrec)

        # reset unit numbers
        unitnumber = [14, 51, 52, 53]
        if ihedun > 0:
            model.add_pop_key_list(ihedun)
            # unitnumber[1] = ihedun
        if iddnun > 0:
            model.add_pop_key_list(iddnun)
            # unitnumber[2] = iddnun

        # create instance of oc class
        oc = ModflowOc88(model, ihedfm=ihedfm, iddnfm=iddnfm,
                         extension=['oc', 'hds', 'ddn', 'cbc'],
                         unitnumber=unitnumber, words=words, compact=compact,
                         chedfm=chedfm, cddnfm=cddnfm)

        return oc
Helper function to output a function call
dataset/ETHPy150Open modflowpy/flopy/flopy/modflow/mfoc88.py/ModflowOc88.load--crossover with--dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/externals/joblib/func_inspect.py/_function_called_str