# Path: opc/utils/prof.py
# def timefunc(f, reference=False):
#     global records
# 
#     records[f.__name__] = Record(f.__name__, reference)
# 
#     @wraps(f)
#     def f_timer(*args, **kwargs):
#         global active
# 
#         if not active:
#             return f(*args, **kwargs)
# 
#         start = time.time()
#         result = f(*args, **kwargs)
#         end = time.time()
# 
#         records[f.__name__].addTime(end-start)
# 
#         return result
# 
#     return f_timer


from random import random
from opc.utils.prof import timefunc
        return power-1

    def _addLfsr(self, bits, base):
        self.content.append(lfsr(seed=0, bits=bits, base=base))

    def _addBucket(self, slots, base):
        self.content.append(LfsrBucket(slots, base))

    def buckets(self):
        return len(self.content)

    @timefunc
    def get(self, level=0):
        """
        Get the next value from the bucket. A candidate can either
        be a LFSR, or it can be a sub-bucket. We'll need to check
        for all and handle exceptions appropriately.
        """
        candidate = self.content[self.ptr]
        self.ptr = (self.ptr+1) % len(self.content)

        try:
            return candidate.get(level+1)
        except AttributeError:
            try:
                return next(candidate)
            except StopIteration:
                return None



# Path: opc/utils/prof.py
# def timefunc(f, reference=False):
#     global records
# 
#     records[f.__name__] = Record(f.__name__, reference)
# 
#     @wraps(f)
#     def f_timer(*args, **kwargs):
#         global active
# 
#         if not active:
#             return f(*args, **kwargs)
# 
#         start = time.time()
#         result = f(*args, **kwargs)
#         end = time.time()
# 
#         records[f.__name__].addTime(end-start)
# 
#         return result
# 
#     return f_timer


# Path: art/utils/lfsr.py
from random import random
from opc.utils.prof import timefunc

        return power-1

    def _addLfsr(self, bits, base):
        self.content.append(lfsr(seed=0, bits=bits, base=base))

    def _addBucket(self, slots, base):
        self.content.append(LfsrBucket(slots, base))

    def buckets(self):
        return len(self.content)

    @timefunc
    def get(self, level=0):
        """
        Get the next value from the bucket. A candidate can either
        be a LFSR, or it can be a sub-bucket. We'll need to check
        for all and handle exceptions appropriately.
        """
        candidate = self.content[self.ptr]
        self.ptr = (self.ptr+1) % len(self.content)

        try:
            return candidate.get(level+1)
        except AttributeError:
            try:
                return next(candidate)
            except StopIteration:
                return None



@timefunc