def lookup_cmd(ops, cmd_id):
for i in range(ops.o_ncmds):<EOL><INDENT>cmd = ops.o_cmds[i]<EOL>if cmd.c_id == cmd_id:<EOL><INDENT>return cmd<EOL><DEDENT><DEDENT>return None<EOL>
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/mngt.c#L33.

    Positional arguments:
    ops -- genl_ops class instance.
    cmd_id -- integer.

    Returns:
    genl_cmd class instance or None.