def _diff(state_data, resource_object):
    objects_differ = None

    for k, v in state_data.items():
        if k == 'escalation_rules':
            v = _escalation_rules_to_string(v)
            resource_value = _escalation_rules_to_string(resource_object[k])
        else:
            resource_value = resource_object[k]
        if v != resource_value:
            objects_differ = '{0} {1} {2}'.format(k, v, resource_value)
            break

    if objects_differ:
        return state_data
    else:
        return {}
helper method to compare salt state info with the PagerDuty API json structure,
dataset/ETHPy150Open saltstack/salt/salt/states/pagerduty_escalation_policy.py/_diff