Since those are chunks of code based on our codebase, it's easiest to use the same license.
We check the same condition at various places. Let's add a trivial, common helper for this, and use it everywhere. It's not going to make things much faster or much shorter, but I think a lot more readable