def count(data_store, record_selector):
    """Get the number of selected records in the data store
    
    Args:
        data_store: a DataStore object
        record_selector: a RecordSelector object. It defines which records
            should be processed.
    Returns:
        number
    """
    n = 0
    for _ in record_selector.get_records(data_store):
        n = n + 1
    return n
