code: def _histogram_equalize_one_tile(
      data,
      valid_data_mask,
      std_mult_cutoff,
      do_log_scale,
      log_offset,
      clip_limit,
      slope_limit,
      number_of_bins,
      num_row_tile,
      num_col_tile,
      tile_size,
  ):
      # calculate the range for this tile (min is inclusive, max is
      # exclusive)
      min_row = num_row_tile * tile_size
      max_row = min_row + tile_size
      min_col = num_col_tile * tile_size
      max_col = min_col + tile_size
  
      # for speed of calculation, pull out the mask of pixels that should
      # be used to calculate the histogram
      mask_valid_data_in_tile = valid_data_mask[
          min_row:max_row, min_col:max_col
      ]
  
      # if we have any valid data in this tile, calculate a histogram equalization for this tile
      # (note: even if this tile does not fall in the mask_to_equalize, it's histogram may be used by other tiles)
      if not mask_valid_data_in_tile.any():
          return None, None
  
      # use all valid data in the tile, so separate sections will
      # blend cleanly
      temp_valid_data = data[min_row:max_row, min_col:max_col][
          mask_valid_data_in_tile
      ]
      temp_valid_data = temp_valid_data[
          temp_valid_data >= 0
      ]  # TEMP, testing to see if negative data is messing everything up
      # limit the contrast by only considering data within a certain
      # range of the average
      if std_mult_cutoff is not None:
          avg = np.mean(temp_valid_data)
          std = np.std(temp_valid_data)
          # limit our range to avg +/- std_mult_cutoff*std; e.g. the
          # default std_mult_cutoff is 4.0 so about 99.8% of the data
          concervative_mask = (
              temp_valid_data < (avg + std * std_mult_cutoff)
          ) & (temp_valid_data > (avg - std * std_mult_cutoff))
          temp_valid_data = temp_valid_data[concervative_mask]
  
      # if we are taking the log of our data, do so now
      if do_log_scale:
          temp_valid_data = np.log(temp_valid_data + log_offset)
  
      # do the histogram equalization and get the resulting
      # distribution function and bin information
      if not temp_valid_data.size:
          return None, None
  
      (
          cumulative_dist_function,
          temp_bins,
      ) = _histogram_equalization_helper(
          temp_valid_data,
          number_of_bins,
          clip_limit=clip_limit,
          slope_limit=slope_limit,
      )
      return cumulative_dist_function, temp_bins
  
imports: from __future__ import annotations
  import logging
  import math
  from datetime import datetime
  import dask
  import dask.array
  import numpy
  import xarray
  from satpy.composites import CompositeBase, GenericCompositor
  from satpy.dataset import combine_metadata
label_desc: Use image node_id 5 for calling a global function with example usage: _histogram_equalize_one_tile(data, valid_data_mask, std_mult_cutoff, do_log_scale, log_offset, clip_limit, slope_limit, number_of_bins, num_row_tile, num_col_tile, tile_size) and returns: cumulative_dist_function,  temp_bins, None,  None, None,  None