def _check(self, chk, 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        summarize : bool\n            Boolean flag used to determine if summary of results is written\n            to the screen\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        "
    results = {}
    for p in self.packagelist:
        if (chk.package_check_levels.get(p.name[0].lower(), 0) <= level):
            results[p.name[0]] = p.check(f=None, verbose=False, level=(level - 1), checktype=chk.__class__)
    if (self.version in chk.solver_packages.keys()):
        solvers = set(chk.solver_packages[self.version]).intersection(set(self.get_package_list()))
        if (not solvers):
            chk._add_to_summary('Error', desc='\r    No solver package', package='model')
        elif (len(list(solvers)) > 1):
            for s in solvers:
                chk._add_to_summary('Error', desc='\r    Multiple solver packages', package=s)
        else:
            chk.passed.append('Compatible solver package')
    for r in results.values():
        if ((r is not None) and (r.summary_array is not None)):
            chk.summary_array = np.append(chk.summary_array, r.summary_array).view(np.recarray)
            chk.passed += [f'{r.package.name[0]} package: {psd}' for psd in r.passed]
    chk.summarize()
    return chk
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.
summarize : bool
    Boolean flag used to determine if summary of results is written
    to the screen

Returns
-------
None

Examples
--------

>>> import flopy
>>> m = flopy.modflow.Modflow.load('model.nam')
>>> m.check()
def _check(self, chk, 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        summarize : bool\n            Boolean flag used to determine if summary of results is written\n            to the screen\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        "
    results = {}
    for p in self.packagelist:
        if (chk.package_check_levels.get(p.name[0].lower(), 0) <= level):
            results[p.name[0]] = p.check(f=None, verbose=False, level=(level - 1), checktype=chk.__class__)
    if (self.version in chk.solver_packages.keys()):
        solvers = set(chk.solver_packages[self.version]).intersection(set(self.get_package_list()))
        if (not solvers):
            chk._add_to_summary('Error', desc='\r    No solver package', package='model')
        elif (len(list(solvers)) > 1):
            for s in solvers:
                chk._add_to_summary('Error', desc='\r    Multiple solver packages', package=s)
        else:
            chk.passed.append('Compatible solver package')
    for r in results.values():
        if ((r is not None) and (r.summary_array is not None)):
            chk.summary_array = np.append(chk.summary_array, r.summary_array).view(np.recarray)
            chk.passed += [f'{r.package.name[0]} package: {psd}' for psd in r.passed]
    chk.summarize()
    return chk