def _ReferenceFromSerialized(serialized):
 if (not isinstance(serialized, basestring)):
  raise TypeError(('serialized must be a string; received %r' % serialized))
 elif isinstance(serialized, unicode):
  serialized = serialized.encode('utf8')
 return entity_pb.Reference(serialized)

def _ReferenceFromSerialized ( serialized ) : if ( not isinstance ( serialized , basestring ) ) : raise TypeError ( ( 'serialized must be a string; received %r' % serialized ) ) elif isinstance ( serialized , unicode ) : serialized = serialized . encode ( 'utf8' ) return entity_pb . Reference ( serialized )
construct a reference from a serialized reference .