def is_kernel_thread(proc):
 try:
  return (os.getpgid(proc.pid) == 0)
 except OSError:
  return False

def is_kernel_thread ( proc ) : try : return ( os . getpgid ( proc . pid ) == 0 ) except OSError : return False
return true if proc is a kernel thread .