def set(self, key, val):
self._create_file_if_none_exists()<EOL>with open(self.filename, '<STR_LIT>') as file_object:<EOL><INDENT>cache_pickle = pickle.load(file_object)<EOL>cache_pickle[key] = val<EOL>file_object.seek(<NUM_LIT:0>)<EOL>pickle.dump(cache_pickle, file_object)<EOL><DEDENT>
Sets a value in a key.

        Args:
          key (str): Key for the value.
          val: Value to set.

        Returns:
          Retrieved value.