@contextmanager
def check_mongo_calls_range(max_finds=float('inf'), min_finds=0, max_sends=None, min_sends=None):
 with check_sum_of_calls(pymongo.message, ['query', 'get_more'], max_finds, min_finds):
  if ((max_sends is not None) or (min_sends is not None)):
   with check_sum_of_calls(pymongo.message, ['insert', 'update', 'delete', '_do_batched_write_command', '_do_batched_insert'], (max_sends if (max_sends is not None) else float('inf')), (min_sends if (min_sends is not None) else 0)):
    (yield)
  else:
   (yield)

@ contextmanager def check_mongo_calls_range ( max_finds = float ( 'inf' ) , min_finds = 0 , max_sends = None , min_sends = None ) : with check_sum_of_calls ( pymongo . message , [ 'query' , 'get_more' ] , max_finds , min_finds ) : if ( ( max_sends is not None ) or ( min_sends is not None ) ) : with check_sum_of_calls ( pymongo . message , [ 'insert' , 'update' , 'delete' , '_do_batched_write_command' , '_do_batched_insert' ] , ( max_sends if ( max_sends is not None ) else float ( 'inf' ) ) , ( min_sends if ( min_sends is not None ) else 0 ) ) : ( yield ) else : ( yield )
instruments the given store to count the number of calls to find and the number of calls to send_message which is for insert .