nodes: 0, module; 1, function_definition; 2, function_name:competitions_list; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, expression_statement; 12, expression_statement; 13, if_statement; 14, expression_statement; 15, if_statement; 16, expression_statement; 17, if_statement; 18, expression_statement; 19, return_statement; 20, identifier:group; 21, None; 22, identifier:category; 23, None; 24, identifier:sort_by; 25, None; 26, identifier:page; 27, integer:1; 28, identifier:search; 29, None; 30, comment:""" make call to list competitions, format the response, and return
              a list of Competition instances
  
              Parameters
              ==========
  
              page: the page to return (default is 1)
              search: a search term to use (default is empty string)
              sort_by: how to sort the result, see valid_sort_by for options
              category: category to filter result to
              group: group to filter result to
          """; 31, assignment; 32, boolean_operator; 33, block; 34, assignment; 35, boolean_operator; 36, block; 37, assignment; 38, boolean_operator; 39, block; 40, assignment; 41, list_comprehension; 42, identifier:valid_groups; 43, list; 44, identifier:group; 45, comparison_operator:group not in valid_groups; 46, raise_statement; 47, identifier:valid_categories; 48, list; 49, identifier:category; 50, comparison_operator:category not in valid_categories; 51, raise_statement; 52, identifier:valid_sort_by; 53, list; 54, identifier:sort_by; 55, comparison_operator:sort_by not in valid_sort_by; 56, raise_statement; 57, identifier:competitions_list_result; 58, call; 59, call; 60, for_in_clause; 61, string; 62, string; 63, string; 64, identifier:group; 65, identifier:valid_groups; 66, call; 67, string; 68, string; 69, string; 70, string; 71, string; 72, string; 73, string; 74, identifier:category; 75, identifier:valid_categories; 76, call; 77, string; 78, string; 79, string; 80, string; 81, string; 82, string; 83, identifier:sort_by; 84, identifier:valid_sort_by; 85, call; 86, attribute; 87, argument_list; 88, identifier:Competition; 89, argument_list; 90, identifier:c; 91, identifier:competitions_list_result; 92, string_content:general; 93, string_content:entered; 94, string_content:inClass; 95, identifier:ValueError; 96, argument_list; 97, string_content:all; 98, string_content:featured; 99, string_content:research; 100, string_content:recruitment; 101, string_content:gettingStarted; 102, string_content:masters; 103, string_content:playground; 104, identifier:ValueError; 105, argument_list; 106, string_content:grouped; 107, string_content:prize; 108, string_content:earliestDeadline; 109, string_content:latestDeadline; 110, string_content:numberOfTeams; 111, string_content:recentlyCreated; 112, identifier:ValueError; 113, argument_list; 114, identifier:self; 115, identifier:process_response; 116, call; 117, identifier:c; 118, binary_operator:'Invalid group specified. Valid options are ' +
                               str(valid_groups); 119, binary_operator:'Invalid category specified. Valid options are ' +
                               str(valid_categories); 120, binary_operator:'Invalid sort_by specified. Valid options are ' +
                               str(valid_sort_by); 121, attribute; 122, argument_list; 123, string; 124, call; 125, string; 126, call; 127, string; 128, call; 129, identifier:self; 130, identifier:competitions_list_with_http_info; 131, keyword_argument; 132, keyword_argument; 133, keyword_argument; 134, keyword_argument; 135, keyword_argument; 136, string_content:Invalid group specified. Valid options are; 137, identifier:str; 138, argument_list; 139, string_content:Invalid category specified. Valid options are; 140, identifier:str; 141, argument_list; 142, string_content:Invalid sort_by specified. Valid options are; 143, identifier:str; 144, argument_list; 145, identifier:group; 146, boolean_operator; 147, identifier:category; 148, boolean_operator; 149, identifier:sort_by; 150, boolean_operator; 151, identifier:page; 152, identifier:page; 153, identifier:search; 154, boolean_operator; 155, identifier:valid_groups; 156, identifier:valid_categories; 157, identifier:valid_sort_by; 158, identifier:group; 159, string; 160, identifier:category; 161, string; 162, identifier:sort_by; 163, string; 164, identifier:search; 165, string
code: def competitions_list(self,
                            group=None,
                            category=None,
                            sort_by=None,
                            page=1,
                            search=None):
          """ make call to list competitions, format the response, and return
              a list of Competition instances
  
              Parameters
              ==========
  
              page: the page to return (default is 1)
              search: a search term to use (default is empty string)
              sort_by: how to sort the result, see valid_sort_by for options
              category: category to filter result to
              group: group to filter result to
          """
          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]