Fixed #19576 -- Use `six.with_metaclass` uniformously accross code base.