def get_original_factors(factors):
    original_factors = dict()
    while len(original_factors) < len(factors):
        for factor in factors:
            args = get_args(factor)
            unaccounted_args = [a for a in args if a not in original_factors]
            if len(unaccounted_args) == 1:
                original_factors[unaccounted_args[0]] = factor
    return original_factors
For a set of factors, we want to
dataset/ETHPy150Open eBay/bayesian-belief-networks/bayesian/utils.py/get_original_factors