<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def patch_cursor(cursor, batch_size=None, limit=None, skip=None, sort=None, **kwargs):
 """ Adds batch_size, limit, sort parameters to a DB cursor """


  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)