<s> from . base import BaseSerializer 
 from . base import BaseSerializer <EOL> import json <EOL> import os <EOL> class JSONSerializer ( BaseSerializer ) : <EOL> name = '<STR_LIT>' <EOL> @ staticmethod <EOL> def generate_cassette_name ( cassette_library_dir , cassette_name ) : <EOL> return os . path . join ( cassette_library_dir , <EOL> '<STR_LIT>' . format ( cassette_name , '<STR_LIT>' ) ) <EOL> def serialize ( self , cassette_data ) : <EOL> return json . dumps ( cassette_data ) <EOL> def deserialize ( self , cassette_data ) : <EOL> try : <EOL> deserialized_data = json . loads ( cassette_data ) <EOL> except ValueError : <EOL> deserialized_data = { } <EOL> return deserialized_data </s>
