def record_factory(app, fields=None):
<EOL>record = Record(app, {<EOL>'<STR_LIT>': Record._type,<EOL>'<STR_LIT>': True,<EOL>'<STR_LIT>': app.id,<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': '<STR_LIT>'<EOL>},<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': '<STR_LIT>'<EOL>}<EOL>})<EOL>fields = fields or {}<EOL>for name, value in six.iteritems(fields):<EOL><INDENT>record[name] = value<EOL><DEDENT>copy_raw = copy.copy(record._raw)<EOL>values_dict = {}<EOL>for key, value in six.iteritems(copy_raw['<STR_LIT>']):<EOL><INDENT>if value is not None:<EOL><INDENT>values_dict[key] = value<EOL><DEDENT><DEDENT>record._raw['<STR_LIT>'] = values_dict<EOL>return record<EOL>
Return a temporary Record instance to be used for field validation and value parsing

    Args:
        app (App): Target App to create a transient Record instance for
        fields (dict): Optional dict of fields and values to set on new Record instance before returning

    Returns:
        Record: Unsaved Record instance to be used for validation, creation, etc.