docs: def match_unit(data, p, m='a'):
      """Match data to basic match unit."""
      if data is None:
          return p is None
  
      # compile search value only once for non exact search
      if m != 'e' and isinstance(p, six.string_types):
          p = re.compile(p)
  
      if isinstance(data, Sequence) and not isinstance(data, six.string_types):
          return any([match_unit(field, p, m=m)
                      for field in data])
      elif isinstance(data, MutableMapping):
          return any([match_unit(field, p, m=m)
                      for field in data.values()])
  
      # Inclusive range query
      if isinstance(p, tuple):
          left, right = p
          return (left <= data) and (data <= right)
  
      if m == 'e':
          return six.text_type(data) == p
      return p.search(six.text_type(data)) is not None