code: def _filter_values(vals, vlist=None, must=False):
      
  
      if not vlist:  # No value specified equals any value
          return vals
  
      if isinstance(vlist, six.string_types):
          vlist = [vlist]
  
      res = []
  
      for val in vlist:
          if val in vals:
              res.append(val)
  
      if must:
          if res:
              return res
          else:
              raise MissingValue("Required attribute value missing")
      else:
          return res
docs: Removes values from *vals* that does not appear in vlist
  
      :param vals: The values that are to be filtered
      :param vlist: required or optional value
      :param must: Whether the allowed values must appear
      :return: The set of values after filtering