def get_fact(state, hostname, name):

    # Expecting a function to return
    if callable(FACTS[name].command):
        def wrapper(*args):
            fact_data = get_facts(state, name, args=args)

            return fact_data.get(hostname)
        return wrapper

    # Expecting the fact as a return value
    else:
        # Get the fact
        fact_data = get_facts(state, name)

        return fact_data.get(hostname)
Wrapper around ``get_facts`` returning facts for one host or a function that does.
dataset/ETHPy150Open Fizzadar/pyinfra/pyinfra/api/facts.py/get_fact