@meta
    def primary_attribute(self, **kwargs):
        def _primary_attribute(s, header, value, **kwargs):
            try:
                _, s._primary_attr = map(
                    lambda s: s.strip(), header.split('%')
                )
            except __HOLE__:
                raise ValidationError(
                    "The primary_attribute header must be in the form "
                    "'primary_attribute%<system-attribute-header>'"
                )
            s._primary_value = getattr(
                self.get_related(header, value, sys_models.System),
                s._primary_attr
            )
            return s

        bundle = {
            'name': 'primary_attribute',
            'filter_fields': ['asset_tag', 'hostname'],
            'values': ['primary_attribute'],
            'handler': _primary_attribute,
        }
        return bundle
dataset/ETHPy150Open mozilla/inventory/mcsv/resolver.py/Resolver.primary_attribute