#NEWLINE# def EntityFullName( entity ) : #NEWLINE# #INDENT# "Given entity primary key as a Reference Proto, returns full name.\n\n  This is a concatenation of entity information along the entire\n  path, and includes entity kind and entity name (or id) at each level.\n\n  Args:\n    entity: primary key of entity in ReferenceProto form\n\n  Returns:\n    Full name of entity in string format with dots delimiting each element in\n    the path. Each element is represented as 'entity_kind:entity_id' or\n    'entity_kind:entity_name' as applicable.\n  " #NEWLINE# names = [ ] #NEWLINE# for element in entity . path ( ) . element_list ( ) : #NEWLINE# #INDENT# if element . has_id ( ) : #NEWLINE# #INDENT# name = ( '%s:%s' % ( element . type ( ) , str ( element . id ( ) ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if element . has_name ( ) : #NEWLINE# #INDENT# name = ( '%s:%s' % ( element . type ( ) , str ( element . name ( ) ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# name = ( '%s:None' % element . type ( ) ) #NEWLINE# #UNINDENT# #UNINDENT# names . append ( entity ) #NEWLINE# #UNINDENT# fullname = '.' . join ( names ) #NEWLINE# return fullname