code: def compat_py2_py3():
      
      if (sys.version_info > (3, 0)):
          def iteritems(dictionary):
              return dictionary.items()
  
          def itervalues(dictionary):
              return dictionary.values()
  
      else:
          def iteritems(dictionary):
              return dictionary.iteritems()
  
          def itervalues(dictionary):
              return dictionary.itervalues()
  
      return iteritems, itervalues
docs: For Python 2, 3 compatibility.