def _getbce(obj, i):
    """Get broadcasted element"""
    if not isinstance(obj, list) or len(obj) == 0:
        return obj
    elif len(obj) == 1:
        return obj[0]
    elif len(obj) > i:
        return obj[i]
    else:
        raise IndexError("failed to broadcast")