code: def btemp_threshold(
      img, min_in, max_in, threshold, threshold_out=None, **kwargs
  ):  # noqa: D417
      """Scale data linearly in two separate regions.
  
      This enhancement scales the input data linearly by splitting the data
      into two regions; min_in to threshold and threshold to max_in. These
      regions are mapped to 1 to threshold_out and threshold_out to 0
      respectively, resulting in the data being "flipped" around the
      threshold. A default threshold_out is set to `176.0 / 255.0` to
      match the behavior of the US National Weather Service's forecasting
      tool called AWIPS.
  
      Args:
          img (XRImage): Image object to be scaled
          min_in (float): Minimum input value to scale
          max_in (float): Maximum input value to scale
          threshold (float): Input value where to split data in to two regions
          threshold_out (float): Output value to map the input `threshold`
              to. Optional, defaults to 176.0 / 255.0.
  
      """
      threshold_out = (
          threshold_out if threshold_out is not None else (176 / 255.0)
      )
      low_factor = (threshold_out - 1.0) / (min_in - threshold)
      low_offset = 1.0 + (low_factor * min_in)
      high_factor = threshold_out / (max_in - threshold)
      high_offset = high_factor * max_in
  
      Coeffs = namedtuple("Coeffs", "factor offset")
      high = Coeffs(high_factor, high_offset)
      low = Coeffs(low_factor, low_offset)
  
      return _bt_threshold(
          img.data,
          threshold=threshold,
          high_coeffs=high,
          low_coeffs=low,
      )
  
imports: import logging
  import os
  from collections import namedtuple
  from functools import wraps
  from numbers import Number
  from typing import Optional
  import dask
  import dask.array
  import numpy
  import xarray
  from trollimage.colormap import Colormap
  from trollimage.xrimage import XRImage
  from satpy._compat import ArrayLike
  from satpy._config import get_config_path
  from satpy.utils import find_in_ancillary
label_desc: Use image node_id 25 for calling a global function with example usage: btemp_threshold(img, min_in, max_in, threshold, threshold_out) and returns: _bt_threshold