'Internal method: return tc commands for delay and loss'

@staticmethod
def delayCmds(parent, delay=None, jitter=None, loss=None, max_queue_size=None):

    cmds = []
    if (delay and (delay < 0)):
        error('Negative    delay', delay, '\n')
    elif (jitter and (jitter < 0)):
        error('Negative    jitter', jitter, '\n')
    elif (loss and ((loss < 0) or (loss > 100))):
        error('Bad    loss    percentage', loss, '%%\n')
    else:
        netemargs = ('%s%s%s%s' % ((('delay    %s    ' % delay) if (delay is not None) else ''), (('%s    ' % jitter) if (jitter is not None) else ''), (('loss    %.5f    ' % loss) if (loss is not None) else ''), (('limit    %d' % max_queue_size) if (max_queue_size is not None) else '')))
        if netemargs:
            cmds = [((('%s    qdisc    add    dev    %s    ' + parent) + '    handle    10:    netem    ') + netemargs)]
            parent = '    parent    10:1    '
    return (cmds, parent)
