def is_my_process(pid):
 pid_existence = pid_exists(pid)
 if ((not psutil) or (not pid_existence)):
  return pid_existence
 if Platform.is_windows():
  return True
 else:
  try:
   command = (psutil.Process(pid).cmdline() or [])
  except psutil.Error:
   return False
  exec_name = os.path.basename(inspect.stack()[(-1)][1]).lower()
  return ((len(command) > 1) and (exec_name in command[1].lower()))

def is_my_process ( pid ) : pid_existence = pid_exists ( pid ) if ( ( not psutil ) or ( not pid_existence ) ) : return pid_existence if Platform . is_windows ( ) : return True else : try : command = ( psutil . Process ( pid ) . cmdline ( ) or [ ] ) except psutil . Error : return False exec_name = os . path . basename ( inspect . stack ( ) [ ( - 1 ) ] [ 1 ] ) . lower ( ) return ( ( len ( command ) > 1 ) and ( exec_name in command [ 1 ] . lower ( ) ) )
check if the pid in the pid given corresponds to a running process and if psutil is available .