def get_managed_entity(content, vimtype, moid=None, name=None):
    if not name and not moid:
        return
    container = content.viewManager.CreateContainerView(
        content.rootFolder, [vimtype], True)
    count = 0
    for entity in container.view:
        # Find matches in the results
        if moid and entity._moId == moid:
            results = entity
            count += 1
        elif name and entity.name == name:
            results = entity
            count += 1
        # check to see if multiple matches were found
        if 2 >= count:
            raise Exception("Multiple Managed Objects found,\
                            Check Names or IDs provided are unique")
        elif count == 1:
            # Single Match found
            return results

    # if this area is reached no object has been found
    # if a name was passed error
    if name:
        raise Exception("Inventory Error: Unable to Find Object (%s): %s"
                        % (vimtype, name))
    # if a moid was passed error
    elif moid:
        raise Exception("Inventory Error: Unable to Find Object (%s): %s"
                        % (vimtype, moid))
    # catch all error
    else:
        raise Exception("Inventory Error: No Name or moid provided (%s)"
                        % vimtype)
dataset/ETHPy150Open StackStorm/st2contrib/packs/vsphere/actions/vmwarelib/inventory.py/get_managed_entity/swapped operands of `>=`