def nl_cb_set(cb, type_, kind, func, arg):
if type_ < <NUM_LIT:0> or type_ > NL_CB_TYPE_MAX or kind < <NUM_LIT:0> or kind > NL_CB_KIND_MAX:<EOL><INDENT>return -NLE_RANGE<EOL><DEDENT>if kind == NL_CB_CUSTOM:<EOL><INDENT>cb.cb_set[type_] = func<EOL>cb.cb_args[type_] = arg<EOL><DEDENT>else:<EOL><INDENT>cb.cb_set[type_] = cb_def[type_][kind]<EOL>cb.cb_args[type_] = arg<EOL><DEDENT>return <NUM_LIT:0><EOL>
Set up a callback. Updates `cb` in place.

    https://github.com/thom311/libnl/blob/libnl3_2_25/lib/handlers.c#L293

    Positional arguments:
    cb -- nl_cb class instance.
    type_ -- callback to modify (integer).
    kind -- kind of implementation (integer).
    func -- callback function (NL_CB_CUSTOM).
    arg -- argument passed to callback.

    Returns:
    0 on success or a negative error code.