def _net_lock(network_id):
 lock_name = ('dhcp-agent-network-lock-%s' % network_id)
 return lockutils.lock(lock_name, utils.SYNCHRONIZED_PREFIX)

def _net_lock ( network_id ) : lock_name = ( 'dhcp-agent-network-lock-%s' % network_id ) return lockutils . lock ( lock_name , utils . SYNCHRONIZED_PREFIX )
returns a context manager lock based on network_id .