Did I find the right examples for you? yes no

All Samples(5)  |  Call(4)  |  Derive(0)  |  Import(1)
Generate a UID with the specified length.

        def uid(n=5):
    """
    Generate a UID with the specified length.
    """

    global _count
    c = _count.next()
    if len(str(c)) > n:
        raise ValueError('UID width exceeded')
    return re.sub('\s', '0', ('{c:%i}' % n).format(c=c))
        


src/n/e/neurokernel-HEAD/neurokernel/base.py   neurokernel(Download)
from tools.comm import is_poll_in, get_random_port
from routing_table import RoutingTable
from uid import uid
from tools.misc import catch_exception
 
    def __init__(self, port_data=PORT_DATA, port_ctrl=PORT_CTRL, id=None):
 
        # Generate a unique ID if none is specified:
        if id is None:
            id = uid()
    def __init__(self, port_data=PORT_DATA, port_ctrl=PORT_CTRL,
                 routing_table=None):
        super(Broker, self).__init__(port_ctrl, uid())
 
        # Logging:
    def __init__(self, N_A, N_B, N_mult=1, A_id='A', B_id='B'):
 
        # Unique object ID:
        self.id = uid()
 
    def __init__(self, port_data=PORT_DATA, port_ctrl=PORT_CTRL):
 
        # Unique object ID:
        self.id = uid()