# Buggy code
def get_worksetcleaners():
    workset_funcs = []

    # copying functions is not implemented in IronPython 2.7.3
    if compat.IRONPY273:
        return workset_funcs

    # if model is workshared, get a list of current worksets
    if revit.doc.IsWorkshared:
        cl = DB.FilteredWorksetCollector(revit.doc)
        worksetlist = cl.OfKind(DB.WorksetKind.UserWorkset)
        # duplicate the workset element remover function for each workset
        for workset in worksetlist:
            workset_funcs.append(copy_func(template_workset_remover, workset.Name))

    return workset_funcs


# Traceback (NotImplementedError)
IronPython Traceback:
Traceback (most recent call last):
File "C:\Users\user05\AppData\Roaming\pyRevit\pyRevit-v4\pyRevit\extensions\pyRevitTools.extension\pyRevit.tab\Project.panel\Wipe.pulldown\Wipe Model Components.pushbutton\script.py", line 51, in
File "C:\Users\user05\AppData\Roaming\pyRevit\pyRevit-v4\pyRevit\extensions\pyRevitTools.extension\lib\pyrevittoolslib\wipeactions.py", line 804, in get_worksetcleaners
File "C:\Users\user05\AppData\Roaming\pyRevit\pyRevit-v4\pyRevit\extensions\pyRevitTools.extension\lib\pyrevittoolslib\wipeactions.py", line 780, in copy_func
NotImplementedError: The method or operation is not implemented.

Script Executor Traceback:
System.NotImplementedException: The method or operation is not implemented.
at Microsoft.Scripting.Interpreter.NewInstruction.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run8[T0,T1,T2,T3,T4,T5,T6,T7,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7)
at System.Dynamic.UpdateDelegates.UpdateAndExecute7[T0,T1,T2,T3,T4,T5,T6,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)
at Microsoft.Scripting.Interpreter.FuncCallInstruction`10.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run8[T0,T1,T2,T3,T4,T5,T6,T7,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7)
at IronPython.Compiler.Ast.CallExpression.Invoke5Instruction.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
at Microsoft.Scripting.Interpreter.FuncCallInstruction`7.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run5[T0,T1,T2,T3,T4,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
at IronPython.Compiler.Ast.CallExpression.Invoke2Instruction.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0)
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope)
at PyRevitBaseClasses.ScriptExecutor.ExecuteScript(PyRevitCommandRuntime&amp; pyrvtCmd)

# Fixed code
def get_worksetcleaners():
    workset_funcs = []
    # if model is workshared, get a list of current worksets
    if revit.doc.IsWorkshared:
        cl = DB.FilteredWorksetCollector(revit.doc)
        worksetlist = cl.OfKind(DB.WorksetKind.UserWorkset)
        # duplicate the workset element remover function for each workset
        for workset in worksetlist:
            # copying functions is not implemented in IronPython 2.7.3
            # this method initially used copy_func to create a func for
            # each workset but now passes on the template func
            # with appropriate arguments
            docstr = WORKSET_FUNC_DOCSTRING_TEMPLATE.format(workset.Name)
            workset_funcs.append(
                WorksetFuncData(
                    func=template_workset_remover,
                    docstring=docstr,
                    args=(workset.Name,),
                )
            )

    return workset_funcs