@classmethod
    def get_transform(cls, spec):
        try:
            return cls.spec_map[spec['type']].wrap(spec)
        except __HOLE__:
            raise BadSpecError(_('Invalid or missing transform type: {}. Valid options are: {}').format(
                spec.get('type', None),
                ', '.join(cls.spec_map.keys()),
            ))
        except BadValueError as e:
            raise BadSpecError(_('Problem creating transform: {}. Message is: {}').format(
                json.dumps(spec, indent=2),
                str(e),
            ))
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/userreports/transforms/factory.py/TransformFactory.get_transform