def get_bets(self, type=None, order_by=None, state=None, project_id=None,<EOL>page=None, page_size=None):
if page is None:<EOL><INDENT>page = <NUM_LIT:1><EOL><DEDENT>if page_size is None:<EOL><INDENT>page_size = <NUM_LIT:100><EOL><DEDENT>if state == '<STR_LIT:all>':<EOL><INDENT>_states = []  <EOL><DEDENT>elif state == '<STR_LIT>':<EOL><INDENT>_states = self.CLOSED_STATES<EOL><DEDENT>else:<EOL><INDENT>_states = self.ACTIVE_STATES<EOL><DEDENT>url = urljoin(<EOL>self.settings['<STR_LIT>'],<EOL>'<STR_LIT>'.format(page, page_size))<EOL>url += '<STR_LIT>'.format('<STR_LIT:U+002C>'.join(_states))<EOL>if type is not None:<EOL><INDENT>url += '<STR_LIT>'.format(type)<EOL><DEDENT>if order_by in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>url += '<STR_LIT>'.format(order_by)<EOL><DEDENT>if project_id is not None:<EOL><INDENT>url += '<STR_LIT>'.format(project_id)<EOL><DEDENT>res = self._req(url)<EOL>return res['<STR_LIT>']['<STR_LIT>']<EOL>
Return bets with given filters and ordering.

        :param type: return bets only with this type.
                     Use None to include all (default).
        :param order_by: '-last_stake' or 'last_stake' to sort by stake's
                         created date or None for default ordering.
        :param state: one of 'active', 'closed', 'all' (default 'active').
        :param project_id: return bets associated with given project id in kava
        :param page: default 1.
        :param page_site: page size (default 100).