def __instantiate_from_dict(self, data):

        if type(data) == dict:
            for key in data.keys():
                if self.has_key(key):
                    val = data[key]
                    if isinstance(val, dict):
                        model_instance = self.__class__.__dict__[key].to(val)
                        self.__field_map[key].value = model_instance
                        self.__dict__[key] = self.__field_map[key].value
                        self[key] = self.__field_map[key].value

                    else:
                        self.__field_map[key].value = data[key]
                        self.__dict__[key] = self.__field_map[key].value
                        self[key] = self.__field_map[key].value


                else:
                    logging.warning("Ignoring '%s' from input, couldn't find matching model Field entry" % (key) )

        else:
            raise ValueError('Input data to model must be a dictionary')
Delegate to our commands
dataset/ETHPy150Open lonelycode/Mojo/Mojo/ObjectMapper/ModelPrototype.py/Model.__instantiate_from_dict--crossover with--dataset/ETHPy150Open stackstrap/stackstrap/stackstrap/commands/template/__init__.py/Template.main