def filter_data(data, **kwargs):
  
  """
  Filter a list of data rows

  Keyword arguments

  Filter these keys, only keeping matches. If value is a list perform an
  in() check, otherwise check for equal values.
  """
  
  rv = []
  for row in data:
    for key, value in kwargs.items():
      if type(value) != list:
        if row.get(key) == value:
          rv.append(row)
      else:
        if row.get(key) in value:
          rv.append(row)
  return rv