@Makoto - Now, I am not saying that this is proper, but just to point this out... the answer at
stackoverflow.com/a/75561883/1026459 uses chatGPT to formulate the overall summary above, it may have even had a hand in generating some of the code. However, it isn't necessarily wrong, I have certainly seen worse, and it is also followed below the snippet by the OP's own personal explanation.