def uuid1(node=None, clock_seq=None):
 if (_uuid_generate_time and (node is clock_seq is None)):
  _buffer = ctypes.create_string_buffer(16)
  _uuid_generate_time(_buffer)
  return UUID(bytes=_buffer.raw)
 global _last_timestamp
 import time
 nanoseconds = int((time.time() * 1000000000.0))
 timestamp = (int((nanoseconds // 100)) + 122192928000000000L)
 if ((_last_timestamp is not None) and (timestamp <= _last_timestamp)):
  timestamp = (_last_timestamp + 1)
 _last_timestamp = timestamp
 if (clock_seq is None):
  import random
  clock_seq = random.randrange((1 << 14L))
 time_low = (timestamp & 4294967295L)
 time_mid = ((timestamp >> 32L) & 65535L)
 time_hi_version = ((timestamp >> 48L) & 4095L)
 clock_seq_low = (clock_seq & 255L)
 clock_seq_hi_variant = ((clock_seq >> 8L) & 63L)
 if (node is None):
  node = getnode()
 return UUID(fields=(time_low, time_mid, time_hi_version, clock_seq_hi_variant, clock_seq_low, node), version=1)

def uuid1 ( node = None , clock_seq = None ) : if ( _uuid_generate_time and ( node is clock_seq is None ) ) : _buffer = ctypes . create_string_buffer ( 16 ) _uuid_generate_time ( _buffer ) return UUID ( bytes = _buffer . raw ) global _last_timestamp import time nanoseconds = int ( ( time . time ( ) * 1000000000.0 ) ) timestamp = ( int ( ( nanoseconds // 100 ) ) + 122192928000000000 L ) if ( ( _last_timestamp is not None ) and ( timestamp <= _last_timestamp ) ) : timestamp = ( _last_timestamp + 1 ) _last_timestamp = timestamp if ( clock_seq is None ) : import random clock_seq = random . randrange ( ( 1 << 14 L ) ) time_low = ( timestamp & 4294967295 L ) time_mid = ( ( timestamp >> 32 L ) & 65535 L ) time_hi_version = ( ( timestamp >> 48 L ) & 4095 L ) clock_seq_low = ( clock_seq & 255 L ) clock_seq_hi_variant = ( ( clock_seq >> 8 L ) & 63 L ) if ( node is None ) : node = getnode ( ) return UUID ( fields = ( time_low , time_mid , time_hi_version , clock_seq_hi_variant , clock_seq_low , node ) , version = 1 )
generate a uuid from a host id .