human
Complete the below
def filter(func):

    ''''Filters out unwanted items using the specified function.
    Supports both dicts and sequences, key/value pairs are
    expanded when applied to a dict.'
    '''
assistant
#Here is the Python program you requested.
    def expand_kv(kv):
        return func(*kv)
    def filter_values(value):
        cls = type(value)
        if isinstance(value, dict):
            return cls(_filter(expand_kv, value.items()))
        else:
            return cls(_filter(func, value))
    return transform(filter_values)