def generic_kevalue(self, re_patterns):
        def patterns_match(value):
            for pattern in re_patterns:
                if pattern.match(value):
                    return True
            return False

        def create_kv(s, key, value):
            return sys_models.KeyValue.objects.get_or_create(
                obj=s, key=key, value=value
            )[0]

        bundle = {
            'name': 'key_value',
            'match_func': patterns_match,
            'handler': create_kv
        }
        return bundle
Validate a keyvalue header
dataset/ETHPy150Open mozilla/inventory/mcsv/resolver.py/Generics.generic_kevalue