'Write out the current state to the given path.
Warning: This method is intentionally concurrency-unsafe. It makes no
attempt to control concurrent access to the file at file_path.
:param file_path: The path where the state should be written out to.
Must be writable.
:type file_path: string'

def write_to_file(self, file_path):

    outfile = open(file_path, 'w')
    try:
        pickle.dump(self._state, outfile, self.PICKLE_PROTOCOL)
    finally:
        outfile.close()
