code: def extract_traits(self, entity):
          
          traits = getattr(entity, self._characteristic)
          if traits is not None and isinstance(traits, Hashable):
              traits = [traits]
          return Trait(
              traits,
              getattr(entity, self._characteristic + '_match', True)
          )
docs: Extract data required to classify entity.
  
          :param object entity:
          :return: namedtuple consisting of characteristic traits and match flag
          :rtype: matchbox.box.Trait