def compose(self, type, data):
        """Compose text as a format.

        :param type: The unique name of the format
        :param data: The text to compose as the format
        """
        try:
            return self.registered_formats[type]['composer'](data)
        except KeyError:
            raise NotImplementedError("No composer found for "
                                      "type '{type}'".format(type=type))
def compose ( self , type , data ) : try : return self . registered_formats [ type ] [ 'composer' ] ( data ) except KeyError : raise NotImplementedError ( "No composer found for " "type '{type}'" . format ( type = type ) )
Compose text as a format.

        :param type: The unique name of the format
        :param data: The text to compose as the format