def slice(obj, keys=[], skip=[], full=False):
    """ return a slice of an object. """
    from mads.object import Object
    o = Object()
    if not keys:
        keys = obj.keys()
    for key in keys:
        if key in skip:
            continue
        if not full and key.startswith('_'):
            continue
        val = obj.get(key, None)
        if val and 'keys' in dir(val):
            o[key] = slice(val)
        else:
            o[key] = val
    return o
