'Static factory method. Creates a Key from an entity_pb.Reference.
Not intended to be used by application developers. Enforced by hiding the
entity_pb classes.
Args:
pb: entity_pb.Reference'

@staticmethod
def _FromPb(pb):

    if (not isinstance(pb, entity_pb.Reference)):
        raise datastore_errors.BadArgumentError(('Key    constructor    takes    an    entity_pb.Reference;    received    %s    (a    %s).' % (pb, typename(pb))))
    key = Key()
    key.__reference = entity_pb.Reference()
    key.__reference.CopyFrom(pb)
    return key
