

def to_trait(self, notification_body):
    values = [match for match in self.fields.find(notification_body) if (match.value is not None)]
    if (self.plugin is not None):
        value_map = [('.'.join(self._get_path(match)), match.value) for match in values]
        value = self.plugin.trait_value(value_map)
    else:
        value = (values[0].value if values else None)
    if (value is None):
        return None
    if ((self.trait_type != Datatype.text) and (value == '')):
        return None
    value = self.trait_type.convert(value)
    return Trait(values.name, self.trait_type, value)

dataset/ETHPy150Open openstack/stacktach-stackdistiller/stackdistiller/distiller.py TraitDefinition.to_trait/VarMisuse@160/187 `self`->`values`