Use six.with_metaclass to replace __metaclass__