def patch_cursor(cursor, batch_size=None, limit=None, skip=None, sort=None, **kwargs):
  if type(batch_size) == int:
    cursor.batch_size(batch_size)
  if limit is not None:
    cursor.limit(limit)
  if sort is not None:
    cursor.sort(sort)
  if skip is not None:
    cursor.skip(skip)