def MaskList(inputList, mask):
  """
  Return a list containing elements of the input list where the corresponding
  elements of the input mask are True
  """
  
  assert(len(inputList) == len(mask))
  
  outputList = []
  for i, entry in enumerate(inputList):
    if mask[i]:
      outputList.append(entry)
      
  return outputList