code: def competence(stochastic):
          
          if stochastic.dtype in bool_dtypes:
              return 2
  
          elif isinstance(stochastic, distributions.Bernoulli):
              return 2
              
          elif (isinstance(stochastic, distributions.Categorical) and 
              (len(stochastic.parents['p'])==2)):
              return 2
  
          else:
              return 0
docs: The competence function for Binary One-At-A-Time Metropolis