<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _nextSequence(cls, name=None):
 """Return a new sequence number for insertion in self._sqlTable. Note that if your sequences are not named tablename_primarykey_seq (ie. for table 'blapp' with primary key 'john_id', sequence name blapp_john_id_seq) you must give the full sequence name as an optional argument to _nextSequence) """

        if not name:
            name = cls._sqlSequence
        if not name:
            # Assume it's tablename_primarykey_seq
            if len(cls._sqlPrimary) <> 1:
                raise "Could not guess sequence name for multi-primary-key"
            primary = cls._sqlPrimary[0]
            name = '%s_%s_seq' % (cls._sqlTable, primary.replace('.','_'))
            # Don't have . as a tablename or column name! =)
        curs = cls.cursor()
        curs.execute("SELECT nextval('%s')" % name)
        value = curs.fetchone()[0]
        curs.close()
        return value