<commit_before>from gfsad import api
from gfsad.auth import load_user
from gfsad.models import Record, RecordHistory, RecordRating, Location, db, User, Notification
from gfsad.tasks import send_email, add
from gfsad.tasks.records import build_static_records
from processors import (
    api_roles,
    add_user_to_posted_data,
    remove_relations
)
import json
from flask_mail import Message
from flask_restless.helpers import to_dict
from flask import render_template
import copy
from json2html import *


def save_record_state_to_history(result=None, **kwargs):
    """
    Saves the current state of the record so that changes can be undone.
    :param result:
    :param kwargs:
    :return:
    """

    # No need to store history array within the history table data
    data = copy.copy(result)
    if 'history' in data:
        del data['history']
<commit_msg>removed unused imports<commit_after>from gfsad import api
from gfsad.auth import load_user
from gfsad.models import Record, RecordHistory, RecordRating, db, Notification
from gfsad.tasks import add
from gfsad.tasks.records import build_static_records
from processors import (
    api_roles,
    add_user_to_posted_data,
    remove_relations
)
import json
from flask_restless.helpers import to_dict
import copy


def save_record_state_to_history(result=None, **kwargs):
    """
    Saves the current state of the record so that changes can be undone.
    :param result:
    :param kwargs:
    :return:
    """

    # No need to store history array within the history table data
    data = copy.copy(result)
    if 'history' in data:
        del data['history']

{'fraction_non_alphanumeric': 0.06265356265356266, 'fraction_numerical': 0.0006142506142506142, 'mean_word_length': 4.090625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5255608', 'n_tokens_mistral': 488, 'n_tokens_neox': 474, 'n_words': 172}