<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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]