code: def compute_mask(binned):
      # Use datashader's rules for masking aggregates
      # mask == True --> invalid
      if np.issubdtype(binned.dtype, np.bool_):
          mask = ~binned
      elif binned.dtype.kind == "u":
          mask = binned == 0
      else:
          mask = np.isnan(binned)
      return mask
  
imports: import warnings
  from matplotlib.image import _ImageBase
  from matplotlib.patches import Patch
  from matplotlib.transforms import Bbox, TransformedBbox, BboxTransform
  import matplotlib
  import numpy
  from .None import reductions
  from .None import transfer_functions
  from .colors import Sets1to3
  from .core import bypixel, Canvas
label_desc: Use image node_id 4 for calling a global function with example usage: compute_mask(binned) and returns: mask