def METHOD_NAME(self, item, n):
    """get the nth child of an item"""
    if '__getitem__' in dir(item):
        #either list like or dict like
        if 'keys' in dir(item):
            #dict like
            return item[list(item.keys())[n]]
        else:
            return item[n]
    else:
        return list(item.__dict__.values())[n]