def _get_object(name):
    try:
        return getattr(sys.modules[__name__], name)
    except AttributeError:
        i = name.rfind(".")
        if i >= 0:
            modname = name[:i]
            try:
                mod = sys.modules[modname]
            except KeyError:
                try:
                    mod = __import__(modname, globals(), locals(), ["*"])
                except ImportError as err:
                    raise UIFindError("Could not find UI module %s: %s" % (modname, err))
            try:
                return getattr(mod, name[i+1:])
            except AttributeError:
                raise UIFindError((name, modname) % "Could not find UI object %r in module %r.")
        else:
            raise UIFindError("%s is not a valid object path." % (name,))

# construct a user interface from object names given as strings.
dataset/ETHPy150Open kdart/pycopia/CLI/pycopia/UI.py/_get_object/swapped operands of `%`