def evaluate(flag, user, store, event_factory): sanitized_user = stringify_attrs( user, __USER_ATTRS_TO_STRINGIFY_FOR_EVALUATION__) prereq_events = [] detail = _evaluate(flag, sanitized_user, store, prereq_events, event_factory) return EvalResult(detail=detail, events=prereq_events)
def evaluate(flag, user, store, include_reasons_in_events=False): sanitized_user = stringify_attrs( user, __USER_ATTRS_TO_STRINGIFY_FOR_EVALUATION__) prereq_events = [] detail = _evaluate(flag, sanitized_user, store, prereq_events, include_reasons_in_events) return EvalResult(detail=detail, events=prereq_events)
def evaluate(flag, user, store, event_factory): sanitized_user = stringify_attrs( user, __USER_ATTRS_TO_STRINGIFY_FOR_EVALUATION__) value = flag.get('value') version = flag.get('version') variation_index = flag.get('variation') reason = flag.get('reason') detail = EvaluationDetail(value, variation_index, reason) return EvalResult(detail=detail, events=None)
def _process_user(self, event): filtered = self._user_filter.filter_user_props(event['user']) return stringify_attrs(filtered, __USER_ATTRS_TO_STRINGIFY_FOR_EVENTS__)
def evaluate(flag, user, store, include_reasons_in_events = False): sanitized_user = stringify_attrs(user, __USER_ATTRS_TO_STRINGIFY_FOR_EVALUATION__) prereq_events = [] detail = _evaluate(flag, sanitized_user, store, prereq_events, include_reasons_in_events) return EvalResult(detail = detail, events = prereq_events)