class (file multiset pyit needs to replace only two methods in the original set the class' documentation string explains how it worksfrom setwrapper import set class multiset(set)""inherits all set namesbut extends intersect and union to support multiple operandsnote that "selfis still the first argument (stored in the *args argument now)also note that the inherited and operators call the new methods here with argumentsbut processing more than requires method callnot an expressionintersect doesn' remove duplicates herethe set constructor does""def intersect(self*others)res [for in selfscan first sequence for other in othersfor all other args if not in otherbreak item in each oneelsenobreak out of loop res append(xyesadd item to end return set(resdef union(*args)res [for seq in argsfor in seqif not in resres append(xreturn set(resself is args[ for all args for all nodes add new items to result your interaction with the extension will look something like the following note that you can intersect by using or calling intersectbut you must call inter sect for three or more operandsis binary (two-sidedoperator alsonote that we could have called multiset simply set to make this change more transparent if we used setwrapper set to refer to the original within multiset (the as clause in an import could rename the class too if desired)from multiset import multiset([ ] multiset([ ] multiset([ ] yx (set:[ ]set:[ ]two operands intersect(yzset:[ union(yzset:[ intersect([ , , ][ , , ][ , , ]set:[ union(range( )three operands appendix dsolutions to end-of-part exercises four operands non-multisets worktoo