code: def competitions_list(self,
                            group=None,
                            category=None,
                            sort_by=None,
                            page=1,
                            search=None):
          valid_groups = ['general', 'entered', 'inClass']
          if group and group not in valid_groups:
              raise ValueError('Invalid group specified. Valid options are ' +
                               str(valid_groups))
          valid_categories = [
              'all', 'featured', 'research', 'recruitment', 'gettingStarted',
              'masters', 'playground'
          ]
          if category and category not in valid_categories:
              raise ValueError('Invalid category specified. Valid options are ' +
                               str(valid_categories))
          valid_sort_by = [
              'grouped', 'prize', 'earliestDeadline', 'latestDeadline',
              'numberOfTeams', 'recentlyCreated'
          ]
          if sort_by and sort_by not in valid_sort_by:
              raise ValueError('Invalid sort_by specified. Valid options are ' +
                               str(valid_sort_by))
          competitions_list_result = self.process_response(
              self.competitions_list_with_http_info(
                  group=group or '',
                  category=category or '',
                  sort_by=sort_by or '',
                  page=page,
                  search=search or ''))
          return [Competition(c) for c in competitions_list_result]