code: def stats(dataset):
      """Return a tuple with raster min, max, and mean."""
      if isinstance(dataset, tuple):
          arr = dataset[0].read(dataset[1])
      else:
          arr = dataset
      return Stats(np.min(arr), np.max(arr), np.mean(arr))
  
file_path: rasterio/rasterio/rio/insp.py
imports: from __future__ import absolute_import
  import code
  import logging
  import sys
  import collections
  import warnings
  import numpy
  import click
  from .None import options
  import rasterio
label_desc: Use image node_id 1 for calling a global function with example usage: stats(dataset) and returns: Stats