def _get_for_dict(self, entity):
    value = self._get_value(entity)
    if self._repeated:
      value = [v._to_dict() for v in value]
    elif value is not None:
      value = value._to_dict()
    return value
dataset/ETHPy150Open GoogleCloudPlatform/datastore-ndb-python/ndb/model.py/_StructuredGetForDictMixin._get_for_dict/original