def reference_property_to_reference(refprop):
 ref = entity_pb.Reference()
 app_id = clean_app_id(refprop.app())
 ref.set_app(app_id)
 if refprop.has_name_space():
  ref.set_name_space(refprop.name_space())
 for pathelem in refprop.pathelement_list():
  ref.mutable_path().add_element().CopyFrom(pathelem)
 return ref

def reference_property_to_reference ( refprop ) : ref = entity_pb . Reference ( ) app_id = clean_app_id ( refprop . app ( ) ) ref . set_app ( app_id ) if refprop . has_name_space ( ) : ref . set_name_space ( refprop . name_space ( ) ) for pathelem in refprop . pathelement_list ( ) : ref . mutable_path ( ) . add_element ( ) . CopyFrom ( pathelem ) return ref
creates a reference from a referenceproperty .