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):
          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]