<jupyter_start><jupyter_text>sandbox<jupyter_code>from path import Path
from PIL import Image
import cv2
import random
import pandas as pd
import pickle
def reset_start_position(value=0):    
    with open('../pickle/start_position.pickle', 'wb') as f:
        start_pos = value
        pickle.dump(start_pos, f)
        
reset_start_position(value=2450)
try:
    with open('../pickle/start_position.pickle', 'rb') as f:
        start_pos = pickle.load(f)
except:
    start_pos = 0
    
start_pos
tmp = [0 for _ in range(500)]
num = 3000
with open('../pickle/start_position.pickle', 'wb') as f:
    start_pos = int((start_pos + num) % (len(tmp) * 10 / 2))
    print(start_pos)
    pickle.dump(start_pos, f)
    
try:
    with open('../pickle/start_position.pickle', 'rb') as f:
        start_pos = pickle.load(f)
except:
    start_pos = 0
    
start_pos
def reset_start_position(value=0):    
    with open('../pickle/start_position.pickle', 'wb') as f:
        start_pos = value
        pickle.dump(start_pos, f)
        
reset_start_position()
with open('../pickle/start_position.pickle', 'rb') as f:
    start_pos = pickle.load(f)
start_pos
def check_start_position():
    with open('../pickle/start_position.pickle', 'rb') as f:
        start_pos = pickle.load(f)
        
    print(start_pos)
    
check_start_position()
def create_new_dataframe(path_list):
    df = pd.DataFrame(columns=['filename', 'score', 'num_of_evaluations'])
    df['filename'] = [path.rsplit('/')[-1] for path in path_list]
    df['score'] = [0 for i in range(len(path_list))]
    df['num_of_evaluations'] = [0 for i in range(len(path_list))]
    
    return df
def df_reset():
    df = pd.DataFrame(columns=['filename', 'score', 'num_of_evaluations'])
    filepath_list = get_filepath_list('../images/omelette_rice_500/images/')
    df['filename'] = [path.rsplit('/')[-1] for path in filepath_list]
    df['score'] = [0 for i in range(len(filepath_list))]
    df['num_of_evaluations'] = [0 for i in range(len(filepath_list))]
    df.to_csv('../output/df_omelette500_all.csv')
def data_reset():
    reset_start_position()
    df_reset()
    
# data_reset()
def df_check():
    df = pd.read_csv('../output/df_omelette500_all.csv')
    return df

df_test = df_check()
df_test[df_test['num_of_evaluations']<10].head()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14974182444061962, 'fraction_numerical': 0.015920826161790018, 'mean_word_length': 3.6407185628742513, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 5, '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}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '639828', 'license': 'MIT', 'n_tokens_mistral': 872, 'n_tokens_neox': 849, 'n_words': 173, 'path': 'ml/annotation_tools/notebooks/sandbox_annotation.ipynb', 'repo_name': 'jphacks/TK_1810', 'size': '2324'}