code: def find_mip(self, direction, mechanism, purview, allow_neg=False):
          
          alpha_min = float('inf')
          probability = self.probability(direction, mechanism, purview)
  
          for partition in mip_partitions(mechanism, purview, self.node_labels):
              partitioned_probability = self.partitioned_probability(
                  direction, partition)
              alpha = log2(probability / partitioned_probability)
  
              # First check for 0
              # Default: don't count contrary causes and effects
              if utils.eq(alpha, 0) or (alpha < 0 and not allow_neg):
                  return AcRepertoireIrreducibilityAnalysis(
                      state=self.mechanism_state(direction),
                      direction=direction,
                      mechanism=mechanism,
                      purview=purview,
                      partition=partition,
                      probability=probability,
                      partitioned_probability=partitioned_probability,
                      node_labels=self.node_labels,
                      alpha=0.0
                  )
              # Then take closest to 0
              if (abs(alpha_min) - abs(alpha)) > constants.EPSILON:
                  alpha_min = alpha
                  acria = AcRepertoireIrreducibilityAnalysis(
                      state=self.mechanism_state(direction),
                      direction=direction,
                      mechanism=mechanism,
                      purview=purview,
                      partition=partition,
                      probability=probability,
                      partitioned_probability=partitioned_probability,
                      node_labels=self.node_labels,
                      alpha=alpha_min
                  )
          return acria
docs: Find the ratio minimum information partition for a mechanism
          over a purview.
  
          Args:
              direction (str): |CAUSE| or |EFFECT|
              mechanism (tuple[int]): A mechanism.
              purview (tuple[int]): A purview.
  
          Keyword Args:
              allow_neg (boolean): If true, ``alpha`` is allowed to be negative.
                  Otherwise, negative values of ``alpha`` will be treated as if
                  they were 0.
  
          Returns:
              AcRepertoireIrreducibilityAnalysis: The irreducibility analysis for
              the mechanism.