def iterator(dictionary):
 if (PY_MAJOR_VERSION > 2):
  return dictionary.items()
 else:
  return dictionary.iteritems()

def iterator ( dictionary ) : if ( PY_MAJOR_VERSION > 2 ) : return dictionary . items ( ) else : return dictionary . iteritems ( )
for cross compatibility between python 2 and python 3 dictionaries .