An enzyme that utilizes NADH or NADPH to reduce FLAVINS. It is involved in a number of biological processes that require reduced flavin for their functions such as bacterial bioluminescence. Formerly listed as EC 1.6.8.1 and EC 1.5.1.29.