fl4health.mixins.personalized.utils module

ensure_protocol_compliance(func, instance, args, kwargs)[source]

Wrapper to ensure that a the instance is of FlexibleClient type.

NOTE: This should only be used within a FlexibleClient.

Parameters:
  • func (Callable) – The function to be wrapped

  • instance (Any | None) – The associated instance if it is a method belonging to a class or a standalone

  • args (Any) – args passed to func

  • kwargs (Any) – kwargs passed to func

Raises:

TypeError – We raise this error if the instance is not a FlexibleClient.

Returns:

Application of the function to the args and kwargs.

Return type:

Any