'Constructor. Takes the kind and transaction root, which cannot be
changed after the entity is constructed, and an optional parent. Raises
BadArgumentError or BadKeyError if kind is invalid or parent is not an
existing Entity or Key in the datastore.
Args:
# this entity\'s kind
kind: string
# if provided, this entity\'s parent. Its key must be complete.
parent: Entity or Key
# if provided, this entity\'s name.
name: string
# if provided, this entity\'s id.
id: integer
# if provided, a sequence of property names that should not be indexed
# by the built-in single property indices.
unindexed_properties: list or tuple of strings
namespace: string
# if provided, overrides the default namespace_manager setting.'

def __init__(self, kind, parent=None, _app=None, name=None, id=None, unindexed_properties=[], namespace=None, **kwds):

    ref = entity_pb.Reference()
    _app = datastore_types.ResolveAppId(_app)
    ref.set_app(_app)
    _namespace = kwds.pop('_namespace', None)
    if kwds:
        raise datastore_errors.BadArgumentError(('Excess    keyword    arguments    ' + repr(kwds)))
    if (namespace is None):
        namespace = _namespace
    elif (_namespace is not None):
        raise datastore_errors.BadArgumentError('Must    not    set    both    _namespace    and    namespace    parameters.')
    datastore_types.ValidateString(kind, 'kind', datastore_errors.BadArgumentError)
    if (parent is not None):
        parent = _GetCompleteKeyOrError(parent)
        if (_app != parent.app()):
            raise datastore_errors.BadArgumentError(("    %s    doesn't    match    parent's    app    %s" % (_app, parent.app())))
        if (namespace is None):
            namespace = parent.namespace()
        elif (namespace != parent.namespace()):
            raise datastore_errors.BadArgumentError(("    %s    doesn't    match    parent's    namespace    %s" % (namespace, parent.namespace())))
        ref.CopyFrom(parent._Key__reference)
    namespace = datastore_types.ResolveNamespace(namespace)
    datastore_types.SetNamespace(ref, namespace)
    last_path = ref.mutable_path().add_element()
    last_path.set_type(kind.encode('utf-8'))
    if ((name is not None) and (id is not None)):
        raise datastore_errors.BadArgumentError('Cannot    set    both    name    and    id    on    an    Entity')
    if (name is not None):
        datastore_types.ValidateString(name, 'name')
        last_path.set_name(name.encode('utf-8'))
    if (id is not None):
        datastore_types.ValidateInteger(id, 'id')
        last_path.set_id(id)
    self.set_unindexed_properties(unindexed_properties)
    self.__key = Key._FromPb(ref)
