My impressions is that the above block starts including lots of repetition. Maybe at some point we should think about a _check_dics function that does all the argument checking across all dics.