def expand_models(self, target, data):
if isinstance(data, dict):<EOL><INDENT>data = data.values()<EOL><DEDENT>for chunk in data:<EOL><INDENT>if target in chunk:<EOL><INDENT>yield self.init_target_object(target, chunk)<EOL><DEDENT>else:<EOL><INDENT>for key, item in chunk.items():<EOL><INDENT>yield self.init_single_object(key, item)<EOL><DEDENT><DEDENT><DEDENT>
Generates all objects from given data.