human
Complete the below
def map(func):

    ''''Apply function to each value inside the sequence or dict.
    Supports both dicts and sequences, key/value pairs are
    expanded when applied to a dict.'
    '''

Can you provide a the Python program you requested?
assistant
#Here is the Python program you requested.
    if (is_py2 and (text == func)):
        func = unicode
    def expand_kv(kv):
        return func(*kv)
    def map_values(value):
        cls = type(value)
        if isinstance(value, dict):
            return cls(_map(expand_kv, value.items()))
        else:
            return cls(_map(func, value))
    return transform(map_values)