Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _apply_mixins(self, *args, **kwargs):
"""
apply mixins in defaults.OMEGA_MDF_MIXINS
"""
from omegaml import settings
defaults = settings()
for mixin, applyto in defaults.OMEGA_MDF_MIXINS:
if any(v in self._applyto for v in applyto.split(',')):
extend_instance(self, mixin, *args, **kwargs)
def _apply_mixins(self):
"""
apply mixins in defaults.OMEGA_MDF_APPLY_MIXINS
"""
from omegaml import settings
defaults = settings()
for mixin, applyto in defaults.OMEGA_MDF_APPLY_MIXINS:
if any(v in self.caller._applyto for v in applyto.split(',')):
extend_instance(self, mixin)
def register_mixin(self, mixincls):
"""
register a mixin class
:param mixincls: (class) the mixin class
"""
self.defaults.OMEGA_STORE_MIXINS.append(mixincls)
extend_instance(self, mixincls)
return self
def apply_mixins(self):
"""
apply mixins in defaults.OMEGA_RUNTIME_MIXINS
"""
from omegaml import settings
defaults = settings()
for mixin in defaults.OMEGA_RUNTIME_MIXINS:
extend_instance(self, mixin)
def _apply_mixins(self):
"""
apply mixins in defaults.OMEGA_STORE_MIXINS
"""
for mixin in self.defaults.OMEGA_STORE_MIXINS:
extend_instance(self, mixin)