def EntityFullName(entity):
 names = []
 for element in entity.path().element_list():
  if element.has_id():
   name = ('%s:%s' % (element.type(), str(element.id())))
  elif element.has_name():
   name = ('%s:%s' % (element.type(), str(element.name())))
  else:
   name = ('%s:None' % element.type())
  names.append(name)
 fullname = '.'.join(names)
 return fullname

def EntityFullName ( entity ) : names = [ ] for element in entity . path ( ) . element_list ( ) : if element . has_id ( ) : name = ( '%s:%s' % ( element . type ( ) , str ( element . id ( ) ) ) ) elif element . has_name ( ) : name = ( '%s:%s' % ( element . type ( ) , str ( element . name ( ) ) ) ) else : name = ( '%s:None' % element . type ( ) ) names . append ( name ) fullname = '.' . join ( names ) return fullname
given entity primary key as a reference proto .