code: def _save_state(self, state_file, last_pk):
          
          fp = open(state_file, 'w+')
          try:
              fp.write(str(last_pk))
          finally:
              fp.close()
docs: Saves the last_pk into the given state_file