<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def viewvalues(obj, **kwargs):
 """ Function for iterating over dictionary values with the same set-like behaviour on Py2.7 as on Py3. Passes kwargs to method."""

    func = getattr(obj, "viewvalues", None)
    if not func:
        func = obj.values
    return func(**kwargs)