'Create a new Sequence, using an optional function to
increment to the next number, by default we just increment by one.
Every parameter here is optional, if you don\'t specify any options
then you\'ll get a new SequenceGenerator with a random ID stored in the
default domain that increments by one and uses the default botoweb
environment
:param id: Optional ID (name) for this counter
:type id: str
:param domain_name: Optional domain name to use, by default we get this out of the
environment configuration
:type domain_name:str
:param fnc: Optional function to use for the incrementation, by default we just increment by one
There are several functions defined in this module.
Your function must accept "None" to get the initial value
:type fnc: function, str
:param init_val: Initial value, by default this is the first element in your sequence,
but you can pass in any value, even a string if you pass in a function that uses
strings instead of ints to increment'

def __init__(self, id=None, domain_name=None, fnc=increment_by_one, init_val=None):

    self._db = None
    self._value = None
    self.last_value = None
    self.domain_name = domain_name
    self.id = id
    if (init_val is None):
        init_val = fnc(init_val)
    if (self.id is None):
        import uuid
        self.id = str(uuid.uuid4())
    self.item_type = type(fnc(None))
    self.timestamp = None
    if isinstance(fnc, six.string_types):
        from boto.utils import find_class
        fnc = find_class(fnc)
    self.fnc = fnc
    if (not self.val):
        self.val = init_val
