code: def viewkeys(obj, **kwargs):
      
      func = getattr(obj, "viewkeys", None)
      if not func:
          func = obj.keys
      return func(**kwargs)
docs: Function for iterating over dictionary keys with the same set-like
      behaviour on Py2.7 as on Py3.
  
      Passes kwargs to method.