def load ( raw_bytes ) : try : if not isinstance ( raw_bytes , string_type ) : raw_bytes = raw_bytes . decode ( ) return json . loads ( raw_bytes ) except ValueError as e : raise SerializationException ( str ( e ) )
object of type is not json serializable python
given a bytes object should return a base python data structure that represents the object .
def load(raw_bytes):
        """
        given a bytes object, should return a base python data
        structure that represents the object.
        """
        try:
            if not isinstance(raw_bytes, string_type):
                raw_bytes = raw_bytes.decode()
            return json.loads(raw_bytes)
        except ValueError as e:
            raise SerializationException(str(e))