def overlay(array1, array2, alpha=<NUM_LIT:0.5>):
if alpha < <NUM_LIT:0.> or alpha > <NUM_LIT:1.>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if array1.shape != array2.shape:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>return (array1 * alpha + array2 * (<NUM_LIT:1.> - alpha)).astype(array1.dtype)<EOL>
Overlays `array1` onto `array2` with `alpha` blending.

    Args:
        array1: The first numpy array.
        array2: The second numpy array.
        alpha: The alpha value of `array1` as overlayed onto `array2`. This value needs to be between [0, 1],
            with 0 being `array2` only to 1 being `array1` only (Default value = 0.5).

    Returns:
        The `array1`, overlayed with `array2` using `alpha` blending.