def _to_pb(self, pb=None, allow_partial=False, set_key=True):
    if not allow_partial:
      self._check_initialized()
    if pb is None:
      pb = entity_pb.EntityProto()

    if set_key:
      # TODO: Move the key stuff into ModelAdapter.entity_to_pb()?
      self._key_to_pb(pb)

    for unused_name, prop in sorted(self._properties.iteritems()):
      prop._serialize(self, pb, projection=self._projection)

    return pb
PyInstaller binaries need to be repaired.
dataset/ETHPy150Open GoogleCloudPlatform/datastore-ndb-python/ndb/model.py/Model._to_pb--crossover with--dataset/ETHPy150Open google/grr/grr/lib/builders/linux.py/LinuxClientBuilder.PatchUpPyinstaller