'Creates an entity from a list of property values.
Args:
values: list/tuple of str
key_name: if provided, the name for the (single) resulting Entity
Returns:
list of datastore.Entity
The returned entities are populated with the property values from the
argument, converted to native types using the properties map given in
the constructor, and passed through HandleEntity. They\'re ready to be
inserted.
Raises:
AssertionError if the number of values doesn\'t match the number
of properties in the properties map.'

def CreateEntity(self, values, key_name=None):

    Validate(values, (list, tuple))
    assert (len(values) == len(self.__properties)), ('Expected    %d    CSV    columns,    found    %d.' % (len(self.__properties), len(values)))
    entity = datastore.Entity(self.__kind, name=key_name)
    for ((name, converter), val) in zip(self.__properties, values):
        if ((converter is bool) and (val.lower() in ('0', 'false', 'no'))):
            val = False
        entity[name] = converter(val)
    entities = self.HandleEntity(entity)
    if (entities is not None):
        if (not isinstance(entities, (list, tuple))):
            entities = [entities]
        for entity in entities:
            if (not isinstance(entity, datastore.Entity)):
                raise TypeError(('Expected    a    datastore.Entity,    received    %s    (a    %s).' % (entity, entity.__class__)))
    return entities
