code: def filter_broker_list(brokers, filter_by):
      
      filter_by_set = set(filter_by)
      return [(id, host) for id, host in brokers if id in filter_by_set]
docs: Returns sorted list, a subset of elements from brokers in the form [(id, host)].
      Passing empty list for filter_by will return empty list.
  
      :param brokers: list of brokers to filter, assumes the data is in so`rted order
      :type brokers: list of (id, host)
      :param filter_by: the list of ids of brokers to keep
      :type filter_by: list of integers