def _direct_children_with_cmdline(p):
    'Helper to fetch cmdline from children process list'
    children_with_cmdline = []
    for c in p.children():
        try:
            cmdline = ' '.join(c.cmdline())
            if ((not c.is_running()) or (not cmdline)):
                continue
            children_with_cmdline.append((c, cmdline))
        except (OSError, psutil.NoSuchProcess, psutil.AccessDenied):
            pass
    return children_with_cmdline
Helper to fetch cmdline from children process list
def _direct_children_with_cmdline(p):
    
    children_with_cmdline = []
    for c in p.children():
        try:
            cmdline = ' '.join(c.cmdline())
            if ((not c.is_running()) or (not cmdline)):
                continue
            children_with_cmdline.append((c, cmdline))
        except (OSError, psutil.NoSuchProcess, psutil.AccessDenied):
            pass
    return children_with_cmdline