@staticmethod
    def removeNameSpace(ns, nuke=0):

        # parse ns
        parentNS, childNS = ns.split(':')

        # create new children NS
        if childNS not in namespaceInfo(lon=1):
            Namespace.create(childNS)

        namespace(set=':')  #@UndefinedVariable
        if nuke:
            childNS = ':'
        namespace(mv=(ns, childNS), f=1)  #@UndefinedVariable

        # delete it
        Namespace(ns).remove()

        try:
            # try to remove parent if it is not part of another child namespace
            nss = listNamespaces(recursive=True, internal=False)
            if not [ns for ns in nss if re.search(parentNS % '%s:', ns)]:
                Namespace(parentNS).clean()
                Namespace(parentNS).remove()
        except:
            pass  # still stuff in it
dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/core/mayaCore.py/MayaNamespaceCore.removeNameSpace/swapped operands of `%`