<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update_momentum_by_name(self, name, **kwargs):
 """Updates a momentum by the given name. :param name: the momentum name. :param velocity: (keyword-only) a new value for `velocity`. :param since: (keyword-only) a new value for `since`. :param until: (keyword-only) a new value for `until`. :returns: a momentum updated. :raises TypeError: `name` is ``None``. :raises KeyError: failed to find a momentum named `name`. """

        momentum = self.pop_momentum_by_name(name)
        velocity, since, until = momentum[:3]
        velocity = kwargs.get('velocity', velocity)
        since = kwargs.get('since', since)
        until = kwargs.get('until', until)
        return self.add_momentum(velocity, since, until, name)