nodes: 0, module; 1, function_definition; 2, function_name:patch_cursor; 3, parameters; 4, block; 5, identifier:cursor; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, dictionary_splat_pattern; 11, expression_statement; 12, if_statement; 13, if_statement; 14, if_statement; 15, if_statement; 16, identifier:batch_size; 17, None; 18, identifier:limit; 19, None; 20, identifier:skip; 21, None; 22, identifier:sort; 23, None; 24, identifier:kwargs; 25, comment:"""
      Adds batch_size, limit, sort parameters to a DB cursor
    """; 26, comparison_operator:type(batch_size) == int; 27, block; 28, comparison_operator:limit is not None; 29, block; 30, comparison_operator:sort is not None; 31, block; 32, comparison_operator:skip is not None; 33, block; 34, call; 35, identifier:int; 36, expression_statement; 37, identifier:limit; 38, None; 39, expression_statement; 40, identifier:sort; 41, None; 42, expression_statement; 43, identifier:skip; 44, None; 45, expression_statement; 46, identifier:type; 47, argument_list; 48, call; 49, call; 50, call; 51, call; 52, identifier:batch_size; 53, attribute; 54, argument_list; 55, attribute; 56, argument_list; 57, attribute; 58, argument_list; 59, attribute; 60, argument_list; 61, identifier:cursor; 62, identifier:batch_size; 63, identifier:batch_size; 64, identifier:cursor; 65, identifier:limit; 66, identifier:limit; 67, identifier:cursor; 68, identifier:sort; 69, identifier:sort; 70, identifier:cursor; 71, identifier:skip; 72, identifier:skip
code: 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)