original_docstring: Prepares an entity to be returned to the user.
  
    Args:
      entity: a entity_pb.EntityProto or None
      keys_only: if a keys only result should be produced
      property_names: if not None or empty, cause a projected entity
    to be produced with the given properties.
  
    Returns:
      A user friendly copy of entity or None.
    
docstring: Prepares an entity to be returned to the user.
docstring_tokens: Prepares an entity to be returned to the user .
code: def LoadEntity(entity, keys_only=False, property_names=None):
    """Prepares an entity to be returned to the user.
  
    Args:
      entity: a entity_pb.EntityProto or None
      keys_only: if a keys only result should be produced
      property_names: if not None or empty, cause a projected entity
    to be produced with the given properties.
  
    Returns:
      A user friendly copy of entity or None.
    """
    if entity:
      clone = entity_pb.EntityProto()
      if property_names:
  
        clone.mutable_key().CopyFrom(entity.key())
        clone.mutable_entity_group()
        seen = set()
        for prop in entity.property_list():
          if prop.name() in property_names:
  
            Check(prop.name() not in seen,
                  "datastore dev stub produced bad result",
                  datastore_pb.Error.INTERNAL_ERROR)
            seen.add(prop.name())
            new_prop = clone.add_property()
            new_prop.set_name(prop.name())
            new_prop.set_meaning(entity_pb.Property.INDEX_VALUE)
            new_prop.mutable_value().CopyFrom(prop.value())
            new_prop.set_multiple(False)
      elif keys_only:
  
        clone.mutable_key().CopyFrom(entity.key())
        clone.mutable_entity_group()
      else:
  
        clone.CopyFrom(entity)
      PrepareSpecialPropertiesForLoad(clone)
      return clone
code_tokens: def LoadEntity ( entity , keys_only = False , property_names = None ) : if entity : clone = entity_pb . EntityProto ( ) if property_names : clone . mutable_key ( ) . CopyFrom ( entity . key ( ) ) clone . mutable_entity_group ( ) seen = set ( ) for prop in entity . property_list ( ) : if prop . name ( ) in property_names : Check ( prop . name ( ) not in seen , "datastore dev stub produced bad result" , datastore_pb . Error . INTERNAL_ERROR ) seen . add ( prop . name ( ) ) new_prop = clone . add_property ( ) new_prop . set_name ( prop . name ( ) ) new_prop . set_meaning ( entity_pb . Property . INDEX_VALUE ) new_prop . mutable_value ( ) . CopyFrom ( prop . value ( ) ) new_prop . set_multiple ( False ) elif keys_only : clone . mutable_key ( ) . CopyFrom ( entity . key ( ) ) clone . mutable_entity_group ( ) else : clone . CopyFrom ( entity ) PrepareSpecialPropertiesForLoad ( clone ) return clone
short_docstring: Prepares an entity to be returned to the user.
short_docstring_tokens: Prepares an entity to be returned to the user .
comment: """Prepares an entity to be returned to the user.
  
    Args:
      entity: a entity_pb.EntityProto or None
      keys_only: if a keys only result should be produced
      property_names: if not None or empty, cause a projected entity
    to be produced with the given properties.
  
    Returns:
      A user friendly copy of entity or None.
    """