code: def __P_circuit(P):
      """
      Computes the Propagate Tree circuit for input P.
      The P circuit will return 1 only if the binary of
      the input is all ones (i.e. the value is -1).
  
      Otherwise this circuit returns 0
  
      At each stage:
          P <- P0 & P1
      """
      shift = __BITS // 2
      for _ in range(__LOG_BITS):
          P &= (
              P << shift
          )  # using lshift since rshift was modified to arithmetic
          shift //= 2
      return P
  
file_path: FATE/python/fate/arch/protocol/mpc/primitives/circuit.py
imports: import functools
  import math
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: __P_circuit(P) and returns: P