code: def copy_count(
      merged_data, new_data, merged_mask, new_mask, **kwargs
  ):
      """Returns the count of valid pixels."""
      mask = np.empty_like(merged_mask, dtype="bool")
      np.logical_or(merged_mask, new_mask, out=mask)
      np.logical_not(mask, out=mask)
      np.add(
          merged_data,
          mask,
          out=merged_data,
          where=mask,
          casting="unsafe",
      )
      np.logical_not(new_mask, out=mask)
      np.logical_and(merged_mask, mask, out=mask)
      np.copyto(merged_data, mask, where=mask, casting="unsafe")
  
file_path: rasterio/rasterio/merge.py
imports: from contextlib import contextmanager
  import logging
  import os
  import math
  import warnings
  import numpy
  import rasterio
  from rasterio.coords import disjoint_bounds
  from rasterio.enums import Resampling
  from rasterio.errors import RasterioDeprecationWarning, RasterioError
  from rasterio import windows
  from rasterio.transform import Affine
label_desc: Use image node_id 6 for calling a global function with example usage: copy_count(merged_data, new_data, merged_mask, new_mask) without return types