code: def load_from_file_object(cls, fd, format=None):
          
          format = 'pickle' if format is None else format
          load = getattr(cls, "load_%s" % format, None)
          if load is None:
              raise ValueError("Unknown format '%s'." % format)
          return load(fd)
docs: Load the object from a given file like object in the given format.