'Initialise a document or embedded document
:param __auto_convert: Try and will cast python objects to Object types
:param values: A dictionary of values for the document'

def __init__(self, *args, **values):

    self._initialised = False
    self._created = True
    if args:
        field = iter(self._fields_ordered)
        if getattr(self, '_auto_id_field', False):
            next(field)
        for value in args:
            name = next(field)
            if (name in values):
                raise TypeError(('Multiple    values    for    keyword    argument    "%s"' % name))
            values[name] = value
    __auto_convert = values.pop('__auto_convert', True)
    __only_fields = set(values.pop('__only_fields', values))
    _created = values.pop('_created', True)
    signals.pre_init.send(self.__class__, document=self, values=values)
    if ((not self._dynamic) and (self._meta.get('strict', True) or _created)):
        _undefined_fields = (set(values.keys()) - set((self._fields.keys() + ['id', 'pk', '_cls', '_text_score'])))
        if _undefined_fields:
            msg = 'The    fields    "{0}"    do    not    exist    on    the    document    "{1}"'.format(_undefined_fields, self._class_name)
            raise FieldDoesNotExist(msg)
    if (self.STRICT and (not self._dynamic)):
        self._data = StrictDict.create(allowed_keys=self._fields_ordered)()
    else:
        self._data = SemiStrictDict.create(allowed_keys=self._fields_ordered)()
    self._dynamic_fields = SON()
    for (key, field) in self._fields.iteritems():
        if (self._db_field_map.get(key, key) in __only_fields):
            continue
        value = getattr(self, key, None)
        setattr(self, key, value)
    if ('_cls' not in values):
        self._cls = self._class_name
    if self._dynamic:
        dynamic_data = {}
        for (key, value) in values.iteritems():
            if ((key in self._fields) or (key == '_id')):
                setattr(self, key, value)
            elif self._dynamic:
                dynamic_data[key] = value
    else:
        FileField = _import_class('FileField')
        for (key, value) in values.iteritems():
            if (key == '__auto_convert'):
                continue
            key = self._reverse_db_field_map.get(key, key)
            if ((key in self._fields) or (key in ('id', 'pk', '_cls'))):
                if (__auto_convert and (value is not None)):
                    field = self._fields.get(key)
                    if (field and (not isinstance(field, FileField))):
                        value = field.to_python(value)
                setattr(self, key, value)
            else:
                self._data[key] = value
    self.__set_field_display()
    if self._dynamic:
        self._dynamic_lock = False
        for (key, value) in dynamic_data.iteritems():
            setattr(self, key, value)
    self._initialised = True
    self._created = _created
    signals.post_init.send(self.__class__, document=self)
