The competence function for Binary One-At-A-Time Metropolis

def competence(stochastic):
        """
        The competence function for Binary One-At-A-Time Metropolis
        """
        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