def zk_group_path(key):
 project = key.app()
 if key.name_space():
  namespace = key.name_space()
 else:
  namespace = ':default'
 first_element = key.path().element(0)
 kind = first_element.type()
 if first_element.has_id():
  suffix = ':{}'.format(first_element.id())
 else:
  suffix = '::{}'.format(first_element.name())
 return LOCK_PATH_TEMPLATE.format(project=project, namespace=namespace, group=(kind + suffix))

def zk_group_path ( key ) : project = key . app ( ) if key . name_space ( ) : namespace = key . name_space ( ) else : namespace = ':default' first_element = key . path ( ) . element ( 0 ) kind = first_element . type ( ) if first_element . has_id ( ) : suffix = ':{}' . format ( first_element . id ( ) ) else : suffix = '::{}' . format ( first_element . name ( ) ) return LOCK_PATH_TEMPLATE . format ( project = project , namespace = namespace , group = ( kind + suffix ) )
retrieve the zookeeper lock path for a given entity key .