<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_update(cls, update):
 """ Factory for creating an Update expression """

        expressions = []
        if update.set_expr:
            expressions.append(UpdateSetMany.from_clause(update.set_expr))
        if update.remove_expr:
            expressions.append(UpdateRemove.from_clause(update.remove_expr))
        if update.add_expr:
            expressions.append(UpdateAdd.from_clause(update.add_expr))
        if update.delete_expr:
            expressions.append(UpdateDelete.from_clause(update.delete_expr))
        return cls(expressions)