def METHOD_NAME(self, d):
    """
    Apply options from a serialized body to the current instance. Modifies
    the object in-place. Used mostly by ``from_dict``.
    """
    d = d.copy()
    if "query" in d:
        self.query._proxied = Q(d.pop("query"))
    if "script" in d:
        self._script = d.pop("script")
    self._extra.update(d)
    return self