import random


def PickFromPool(n, pool, a_as_set):
  """Returns n items from the pool which do not appear in a_as_set.

  Args:
    n: number of items to return.
    pool: an sequence of elements to choose from.
    a_as_set: a set of elements which should not appear in the result.

  Returns:
    List of n items from the pool which do not appear in a_as_set.
  """
  assert isinstance(a_as_set, set)

  # Remove the ones that are in A.
  filtered_pool = list(filter(lambda x: x not in a_as_set, pool))
  # Pick N random numbers out of the pool.
  return random.sample(filtered_pool, k=n)