nodes: 0, module; 1, function_definition; 2, function_name:kernels_list; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, default_parameter; 14, default_parameter; 15, default_parameter; 16, default_parameter; 17, default_parameter; 18, expression_statement; 19, if_statement; 20, expression_statement; 21, if_statement; 22, if_statement; 23, expression_statement; 24, if_statement; 25, expression_statement; 26, if_statement; 27, expression_statement; 28, if_statement; 29, expression_statement; 30, if_statement; 31, if_statement; 32, expression_statement; 33, expression_statement; 34, expression_statement; 35, if_statement; 36, expression_statement; 37, return_statement; 38, identifier:page; 39, integer:1; 40, identifier:page_size; 41, integer:20; 42, identifier:dataset; 43, None; 44, identifier:competition; 45, None; 46, identifier:parent_kernel; 47, None; 48, identifier:search; 49, None; 50, identifier:mine; 51, False; 52, identifier:user; 53, None; 54, identifier:language; 55, None; 56, identifier:kernel_type; 57, None; 58, identifier:output_type; 59, None; 60, identifier:sort_by; 61, None; 62, comment:""" list kernels based on a set of search criteria
  
              Parameters
              ==========
              page: the page of results to return (default is 1)
              page_size: results per page (default is 20)
              dataset: if defined, filter to this dataset (default None)
              competition: if defined, filter to this competition (default None)
              parent_kernel: if defined, filter to those with specified parent
              search: a custom search string to pass to the list query
              mine: if true, group is specified as "my" to return personal kernels
              user: filter results to a specific user
              language: the programming language of the kernel
              kernel_type: the type of kernel, one of valid_kernel_types (str)
              output_type: the output type, one of valid_output_types (str)
              sort_by: if defined, sort results by this string (valid_sort_by)
          """; 63, comparison_operator:int(page) <= 0; 64, block; 65, assignment; 66, comparison_operator:page_size <= 0; 67, block; 68, comparison_operator:page_size > 100; 69, block; 70, assignment; 71, boolean_operator; 72, block; 73, assignment; 74, boolean_operator; 75, block; 76, assignment; 77, boolean_operator; 78, block; 79, assignment; 80, boolean_operator; 81, block; 82, boolean_operator; 83, block; 84, call; 85, call; 86, assignment; 87, identifier:mine; 88, block; 89, assignment; 90, list_comprehension; 91, call; 92, integer:0; 93, raise_statement; 94, identifier:page_size; 95, call; 96, identifier:page_size; 97, integer:0; 98, raise_statement; 99, identifier:page_size; 100, integer:100; 101, expression_statement; 102, identifier:valid_languages; 103, list; 104, identifier:language; 105, comparison_operator:language not in valid_languages; 106, raise_statement; 107, identifier:valid_kernel_types; 108, list; 109, identifier:kernel_type; 110, comparison_operator:kernel_type not in valid_kernel_types; 111, raise_statement; 112, identifier:valid_output_types; 113, list; 114, identifier:output_type; 115, comparison_operator:output_type not in valid_output_types; 116, raise_statement; 117, identifier:valid_sort_by; 118, list; 119, identifier:sort_by; 120, comparison_operator:sort_by not in valid_sort_by; 121, raise_statement; 122, comparison_operator:sort_by == 'relevance'; 123, comparison_operator:search == ''; 124, raise_statement; 125, attribute; 126, argument_list; 127, attribute; 128, argument_list; 129, identifier:group; 130, string; 131, expression_statement; 132, identifier:kernels_list_result; 133, call; 134, call; 135, for_in_clause; 136, identifier:int; 137, argument_list; 138, call; 139, identifier:int; 140, argument_list; 141, call; 142, assignment; 143, string; 144, string; 145, string; 146, string; 147, string; 148, identifier:language; 149, identifier:valid_languages; 150, call; 151, string; 152, string; 153, string; 154, identifier:kernel_type; 155, identifier:valid_kernel_types; 156, call; 157, string; 158, string; 159, string; 160, identifier:output_type; 161, identifier:valid_output_types; 162, call; 163, string; 164, string; 165, string; 166, string; 167, string; 168, string; 169, string; 170, string; 171, string; 172, identifier:sort_by; 173, identifier:valid_sort_by; 174, call; 175, identifier:sort_by; 176, string; 177, identifier:search; 178, string; 179, call; 180, identifier:self; 181, identifier:validate_dataset_string; 182, identifier:dataset; 183, identifier:self; 184, identifier:validate_kernel_string; 185, identifier:parent_kernel; 186, string_content:everyone; 187, assignment; 188, attribute; 189, argument_list; 190, identifier:Kernel; 191, argument_list; 192, identifier:k; 193, identifier:kernels_list_result; 194, identifier:page; 195, identifier:ValueError; 196, argument_list; 197, identifier:page_size; 198, identifier:ValueError; 199, argument_list; 200, identifier:page_size; 201, integer:100; 202, string_content:all; 203, string_content:python; 204, string_content:r; 205, string_content:sqlite; 206, string_content:julia; 207, identifier:ValueError; 208, argument_list; 209, string_content:all; 210, string_content:script; 211, string_content:notebook; 212, identifier:ValueError; 213, argument_list; 214, string_content:all; 215, string_content:visualization; 216, string_content:data; 217, identifier:ValueError; 218, argument_list; 219, string_content:hotness; 220, string_content:commentCount; 221, string_content:dateCreated; 222, string_content:dateRun; 223, string_content:relevance; 224, string_content:scoreAscending; 225, string_content:scoreDescending; 226, string_content:viewCount; 227, string_content:voteCount; 228, identifier:ValueError; 229, argument_list; 230, string_content:relevance; 231, identifier:ValueError; 232, argument_list; 233, identifier:group; 234, string; 235, identifier:self; 236, identifier:process_response; 237, call; 238, identifier:k; 239, string; 240, string; 241, binary_operator:'Invalid language specified. Valid options are ' +
                               str(valid_languages); 242, binary_operator:'Invalid kernel type specified. Valid options are ' +
                  str(valid_kernel_types); 243, binary_operator:'Invalid output type specified. Valid options are ' +
                  str(valid_output_types); 244, binary_operator:'Invalid sort by type specified. Valid options are ' +
                  str(valid_sort_by); 245, string; 246, string_content:profile; 247, attribute; 248, argument_list; 249, string_content:Page number must be >= 1; 250, string_content:Page size must be >= 1; 251, string; 252, call; 253, string; 254, call; 255, string; 256, call; 257, string; 258, call; 259, string_content:Cannot sort by relevance without a search term.; 260, identifier:self; 261, identifier:kernels_list_with_http_info; 262, keyword_argument; 263, keyword_argument; 264, keyword_argument; 265, keyword_argument; 266, keyword_argument; 267, keyword_argument; 268, keyword_argument; 269, keyword_argument; 270, keyword_argument; 271, keyword_argument; 272, keyword_argument; 273, keyword_argument; 274, string_content:Invalid language specified. Valid options are; 275, identifier:str; 276, argument_list; 277, string_content:Invalid kernel type specified. Valid options are; 278, identifier:str; 279, argument_list; 280, string_content:Invalid output type specified. Valid options are; 281, identifier:str; 282, argument_list; 283, string_content:Invalid sort by type specified. Valid options are; 284, identifier:str; 285, argument_list; 286, identifier:page; 287, identifier:page; 288, identifier:page_size; 289, identifier:page_size; 290, identifier:group; 291, identifier:group; 292, identifier:user; 293, boolean_operator; 294, identifier:language; 295, boolean_operator; 296, identifier:kernel_type; 297, boolean_operator; 298, identifier:output_type; 299, boolean_operator; 300, identifier:sort_by; 301, boolean_operator; 302, identifier:dataset; 303, boolean_operator; 304, identifier:competition; 305, boolean_operator; 306, identifier:parent_kernel; 307, boolean_operator; 308, identifier:search; 309, boolean_operator; 310, identifier:valid_languages; 311, identifier:valid_kernel_types; 312, identifier:valid_output_types; 313, identifier:valid_sort_by; 314, identifier:user; 315, string; 316, identifier:language; 317, string; 318, identifier:kernel_type; 319, string; 320, identifier:output_type; 321, string; 322, identifier:sort_by; 323, string; 324, identifier:dataset; 325, string; 326, identifier:competition; 327, string; 328, identifier:parent_kernel; 329, string; 330, identifier:search; 331, string; 332, string_content:all; 333, string_content:all; 334, string_content:all; 335, string_content:hotness
code: def kernels_list(self,
                       page=1,
                       page_size=20,
                       dataset=None,
                       competition=None,
                       parent_kernel=None,
                       search=None,
                       mine=False,
                       user=None,
                       language=None,
                       kernel_type=None,
                       output_type=None,
                       sort_by=None):
          """ list kernels based on a set of search criteria
  
              Parameters
              ==========
              page: the page of results to return (default is 1)
              page_size: results per page (default is 20)
              dataset: if defined, filter to this dataset (default None)
              competition: if defined, filter to this competition (default None)
              parent_kernel: if defined, filter to those with specified parent
              search: a custom search string to pass to the list query
              mine: if true, group is specified as "my" to return personal kernels
              user: filter results to a specific user
              language: the programming language of the kernel
              kernel_type: the type of kernel, one of valid_kernel_types (str)
              output_type: the output type, one of valid_output_types (str)
              sort_by: if defined, sort results by this string (valid_sort_by)
          """
          if int(page) <= 0:
              raise ValueError('Page number must be >= 1')
  
          page_size = int(page_size)
          if page_size <= 0:
              raise ValueError('Page size must be >= 1')
          if page_size > 100:
              page_size = 100
  
          valid_languages = ['all', 'python', 'r', 'sqlite', 'julia']
          if language and language not in valid_languages:
              raise ValueError('Invalid language specified. Valid options are ' +
                               str(valid_languages))
  
          valid_kernel_types = ['all', 'script', 'notebook']
          if kernel_type and kernel_type not in valid_kernel_types:
              raise ValueError(
                  'Invalid kernel type specified. Valid options are ' +
                  str(valid_kernel_types))
  
          valid_output_types = ['all', 'visualization', 'data']
          if output_type and output_type not in valid_output_types:
              raise ValueError(
                  'Invalid output type specified. Valid options are ' +
                  str(valid_output_types))
  
          valid_sort_by = [
              'hotness', 'commentCount', 'dateCreated', 'dateRun', 'relevance',
              'scoreAscending', 'scoreDescending', 'viewCount', 'voteCount'
          ]
          if sort_by and sort_by not in valid_sort_by:
              raise ValueError(
                  'Invalid sort by type specified. Valid options are ' +
                  str(valid_sort_by))
          if sort_by == 'relevance' and search == '':
              raise ValueError('Cannot sort by relevance without a search term.')
  
          self.validate_dataset_string(dataset)
          self.validate_kernel_string(parent_kernel)
  
          group = 'everyone'
          if mine:
              group = 'profile'
  
          kernels_list_result = self.process_response(
              self.kernels_list_with_http_info(
                  page=page,
                  page_size=page_size,
                  group=group,
                  user=user or '',
                  language=language or 'all',
                  kernel_type=kernel_type or 'all',
                  output_type=output_type or 'all',
                  sort_by=sort_by or 'hotness',
                  dataset=dataset or '',
                  competition=competition or '',
                  parent_kernel=parent_kernel or '',
                  search=search or ''))
          return [Kernel(k) for k in kernels_list_result]