<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def optimizer_setter( net, param, value, optimizer_attr='optimizer_', optimizer_name='optimizer' ):
 """Handle setting of optimizer parameters such as learning rate and parameter group specific parameters such as momentum. The parameters ``optimizer_attr`` and ``optimizer_name`` can be specified if there exists more than one optimizer (e.g., in seq2seq models). """

    if param == 'lr':
        param_group = 'all'
        param_name = 'lr'
        net.lr = value
    else:
        param_group, param_name = _extract_optimizer_param_name_and_group(
            optimizer_name, param)

    _set_optimizer_param(
        optimizer=getattr(net, optimizer_attr),
        param_group=param_group,
        param_name=param_name,
        value=value
    )