parameters: (self, group, count=1, default=1, onMissing=None, poison=False)
return_statement: return range(next_id, new_next_id)
docstring: Manages multiple independent sequences of unique numbers.
      Each sequence guarantees the unicity of each produced value within that
      sequence and for <self> instance, and is monotonously increasing by 1 for
      each generated id.
  
      group (string):
        Identifies the sequence to use.
      count (int):
        How many identifiers to generate.
      default (int):
        If the sequence for given <group> did not already exist, initialise it at
        this for the first generated value.
      onMissing (callable):
        If provided, called when requested sequence is missing, "default" is
        ignored and the value returned by this function is used instead.
        Allows seamless migration from another id generator *if* that id
        generator is able to "poison the land" (see next option).
      poison (bool):
        If True, return the next id in requested sequence, and permanently break
        that sequence's state, so that no new id may be successfuly generated
        from it. Useful to ensure seamless migration away from this generator,
        without risking a (few) late generation from happening after migration
        code already moved sequence's state elsewhere.
        Once a sequence has been poisoned, attempting to generate a new value
        from it will raise an exception (exception type may vary).
        "count" must be 1, otherwise a ValueError is raised.
  
      Conflicts & guarantees:
      - If multiple transactions modify the same sequence, ALL BUT ONE get a
        ConflictError. This is by design, to achieve per-sequence unicity.
      - If multiple transactions modify different sequences, NONE will get a
        ConflictError (each sequence state is a separate persistent object).
      - If multiple transactions create new sequences, SOME may get a
        ConflictError. This is a limitation of the chosen data structure.
        It is expected that group creation is a rare event, very unlikely to
        happen concurrently in multiple transactions on the same object.
docstring_summary: Manages multiple independent sequences of unique numbers.
      Each sequence guarantees the unicity of each produced value within that
      sequence and for <self> instance, and is monotonously increasing by 1 for
      each generated id.
docstring_tokens: Manages multiple independent sequences of unique numbers . Each sequence guarantees the unicity of each produced value within that sequence and for <self > instance and is monotonously increasing by 1 for each generated id .
function: def generateIdList(self, group, count=1, default=1, onMissing=None, poison=False):
      """
      Manages multiple independent sequences of unique numbers.
      Each sequence guarantees the unicity of each produced value within that
      sequence and for <self> instance, and is monotonously increasing by 1 for
      each generated id.
  
      group (string):
        Identifies the sequence to use.
      count (int):
        How many identifiers to generate.
      default (int):
        If the sequence for given <group> did not already exist, initialise it at
        this for the first generated value.
      onMissing (callable):
        If provided, called when requested sequence is missing, "default" is
        ignored and the value returned by this function is used instead.
        Allows seamless migration from another id generator *if* that id
        generator is able to "poison the land" (see next option).
      poison (bool):
        If True, return the next id in requested sequence, and permanently break
        that sequence's state, so that no new id may be successfuly generated
        from it. Useful to ensure seamless migration away from this generator,
        without risking a (few) late generation from happening after migration
        code already moved sequence's state elsewhere.
        Once a sequence has been poisoned, attempting to generate a new value
        from it will raise an exception (exception type may vary).
        "count" must be 1, otherwise a ValueError is raised.
  
      Conflicts & guarantees:
      - If multiple transactions modify the same sequence, ALL BUT ONE get a
        ConflictError. This is by design, to achieve per-sequence unicity.
      - If multiple transactions modify different sequences, NONE will get a
        ConflictError (each sequence state is a separate persistent object).
      - If multiple transactions create new sequences, SOME may get a
        ConflictError. This is a limitation of the chosen data structure.
        It is expected that group creation is a rare event, very unlikely to
        happen concurrently in multiple transactions on the same object.
      """
      if not isinstance(group, basestring):
        raise TypeError('group must be a string')
      if not isinstance(default, (int, long)):
        raise TypeError('default must be an integer')
      if not isinstance(count, (int, long)):
        raise TypeError('count must be an integer')
      if count < 0:
        raise ValueError('count cannot be negative')
      if poison and count != 1:
        raise ValueError('sequence generator poisoning requires count=1')
      if count == 0:
        return []
      id_generator_state = self._id_generator_state
      if id_generator_state is None:
        id_generator_state = self._id_generator_state = OOBTree()
      try:
        next_id = id_generator_state[group].value
      except KeyError:
        if onMissing is not None:
          default = onMissing()
          if not isinstance(default, (int, long)):
            raise TypeError('onMissing must return an integer')
        id_generator_state[group] = PersistentContainer(default)
        next_id = default
      new_next_id = None if poison else next_id + count
      id_generator_state[group].value = new_next_id
      return range(next_id, new_next_id)
function_tokens: def generateIdList ( self , group , count = 1 , default = 1 , onMissing = None , poison = False ) : if not isinstance ( group , basestring ) : raise TypeError ( 'group must be a string' ) if not isinstance ( default , ( int , long ) ) : raise TypeError ( 'default must be an integer' ) if not isinstance ( count , ( int , long ) ) : raise TypeError ( 'count must be an integer' ) if count < 0 : raise ValueError ( 'count cannot be negative' ) if poison and count != 1 : raise ValueError ( 'sequence generator poisoning requires count=1' ) if count == 0 : return [ ] id_generator_state = self . _id_generator_state if id_generator_state is None : id_generator_state = self . _id_generator_state = OOBTree ( ) try : next_id = id_generator_state [ group ] . value except KeyError : if onMissing is not None : default = onMissing ( ) if not isinstance ( default , ( int , long ) ) : raise TypeError ( 'onMissing must return an integer' ) id_generator_state [ group ] = PersistentContainer ( default ) next_id = default new_next_id = None if poison else next_id + count id_generator_state [ group ] . value = new_next_id return range ( next_id , new_next_id )