Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_decoder_class(cls, type_string, data=None, **kwargs):
"""
:param type_string:
:param data:
:param kwargs:
:return: ScaleType
"""
type_string = cls.convert_type(type_string)
decoder_class = RuntimeConfiguration().get_decoder_class(
type_string.lower(),
spec_version_id=kwargs.get('spec_version_id', 'default')
)
if decoder_class:
return decoder_class(data, **kwargs)
raise NotImplementedError('Decoder class for "{}" not found'.format(type_string))