This is the documentation page for Module:Is infobox in lead

{{#invoke:Is infobox in lead|main|[Ii]nfobox [Ff]oo [Bb]ar}}

This checks if Infobox foo bar is in the lead, and is also the only infobox in the lead, and if so returns true, and if not returns nothing.