def only_dicts_with_givens(dicts, assignments={}):
  """
  Takes a list of dictionaries, and returns a subset
  list only containing dictionaries whose key:value pairs
  are consistent with the parameterized assignments.

  Ex:
  dicts=[{"A": 1, "B": 0}, {"A": 0, "B": 1}], assignments={"A": 0}
    => [{"A": 0, "B": 1}]
  """
  if not assignments:
    return dicts
  res = dicts.copy()
  for d in dicts:
    for a in assignments:
      if d[a] != assignments[a]:
        res.remove(d)
        break
  return res