def _ReferenceFromSerialized(serialized):
if not isinstance(serialized, str):<EOL><INDENT>raise TypeError('<STR_LIT>' % serialized)<EOL><DEDENT>elif isinstance(serialized, str):<EOL><INDENT>serialized = serialized.encode('<STR_LIT:utf8>')<EOL><DEDENT>return entity_pb.Reference(serialized)<EOL>
Construct a Reference from a serialized Reference.