def check(self, f=None, verbose=True, level=1):
    "\n        Check model data for common errors.\n\n        Parameters\n        ----------\n        f : str or file handle\n            String defining file name or file handle for summary file\n            of check method output. If a string is passed a file handle\n            is created. If f is None, check method does not write\n            results to a summary file. (default is None)\n        verbose : bool\n            Boolean flag used to determine if check method results are\n            written to the screen\n        level : int\n            Check method analysis level. If level=0, summary checks are\n            performed. If level=1, full checks are performed.\n\n        Returns\n        -------\n        None\n\n        Examples\n        --------\n\n        >>> import flopy\n        >>> m = flopy.modflow.Modflow.load('model.nam')\n        >>> m.check()\n        "
    chk = utils.check(self, f=f, verbose=verbose, level=level)
    package_units = {}
    duplicate_units = {}
    for p in self.packagelist:
        for i in range(len(p.name)):
            if (p.unit_number[i] != 0):
                if (p.unit_number[i] in package_units.values()):
                    duplicate_units[p.name[i]] = p.unit_number[i]
                    otherpackage = [k for (k, v) in package_units.items() if (v == p.unit_number[i])][0]
                    duplicate_units[otherpackage] = p.unit_number[i]
    if (len(duplicate_units) > 0):
        for (k, v) in duplicate_units.items():
            chk._add_to_summary('Error', package=k, value=v, desc='unit number conflict')
    else:
        chk.passed.append('Unit number conflicts')
    return self._check(chk, level)
Check model data for common errors.

Parameters
----------
f : str or file handle
    String defining file name or file handle for summary file
    of check method output. If a string is passed a file handle
    is created. If f is None, check method does not write
    results to a summary file. (default is None)
verbose : bool
    Boolean flag used to determine if check method results are
    written to the screen
level : int
    Check method analysis level. If level=0, summary checks are
    performed. If level=1, full checks are performed.

Returns
-------
None

Examples
--------

>>> import flopy
>>> m = flopy.modflow.Modflow.load('model.nam')
>>> m.check()
def check(self, f=None, verbose=True, level=1):
    "\n        Check model data for common errors.\n\n        Parameters\n        ----------\n        f : str or file handle\n            String defining file name or file handle for summary file\n            of check method output. If a string is passed a file handle\n            is created. If f is None, check method does not write\n            results to a summary file. (default is None)\n        verbose : bool\n            Boolean flag used to determine if check method results are\n            written to the screen\n        level : int\n            Check method analysis level. If level=0, summary checks are\n            performed. If level=1, full checks are performed.\n\n        Returns\n        -------\n        None\n\n        Examples\n        --------\n\n        >>> import flopy\n        >>> m = flopy.modflow.Modflow.load('model.nam')\n        >>> m.check()\n        "
    chk = utils.check(self, f=f, verbose=verbose, level=level)
    package_units = {}
    duplicate_units = {}
    for p in self.packagelist:
        for i in range(len(p.name)):
            if (p.unit_number[i] != 0):
                if (p.unit_number[i] in package_units.values()):
                    duplicate_units[p.name[i]] = p.unit_number[i]
                    otherpackage = [k for (k, v) in package_units.items() if (v == p.unit_number[i])][0]
                    duplicate_units[otherpackage] = p.unit_number[i]
    if (len(duplicate_units) > 0):
        for (k, v) in duplicate_units.items():
            chk._add_to_summary('Error', package=k, value=v, desc='unit number conflict')
    else:
        chk.passed.append('Unit number conflicts')
    return self._check(chk, level)