Save the object to a given file like object in the given format.

def save_to_file_object(self, fd, format=None, **kwargs):
        """ Save the object to a given file like object in the given format.
        """
        format = 'pickle' if format is None else format
        save = getattr(self, "save_%s" % format, None)
        if save is None:
            raise ValueError("Unknown format '%s'." % format)
        save(fd, **kwargs)