<commit_before>'''
tAngel angel-mortal matching code
Author: <NAME>
Version: 0.0.1



Program input: List of participants
Program output: Participants matched to each other forming either a) one complete ring or b) multiple complete rings. No lone particpants are allowed.

Priorities (decreasing order) [must be done]:
1) Forming complete circles (everyone MUST have an angel and mortal)
2) Respecting gender choices

Optimization objective - get people you DON'T KNOW AT ALL
Optimization priorities:
1) Angel - Mortal relationship - they must not know each other as much as possible
- Achieved by separating by HOUSE (floor) and FACULTY

Distance (or whether an edge exists between two nodes) is a function of:
1) Whether they are of different houses
2) Whether their faculties are different
'''
# IMPORTS
import csv
import time
import random

# FROMS
from models import Player
from arrange import angel_mortal_arrange

# GLOBALS
PLAYERFILE = "ora2017/playerlist.tsv"

# Constants
GENDER_MALE = "Male"
GENDER_FEMALE = "Female"
GENDER_NONBINARY = "Non-binary"
GENDER_NOPREF = "No preference"

GENDER_SWAP_PREFERENCE_PERCENTAGE = 0.00

def read_csv(filename):
    '''
    Reads a CSV file and outputs a list of Player objects
    '''
    person_list = []
    with open(filename, 'rb') as f:
        reader = csv.reader(f, delimiter="\t")
        for row in reader:
            new_person = Player(name=row[1].decode('ascii', errors='ignore'),
                                fbname=row[2],<commit_msg>Change reference .tsv file to playerlist.tsv<commit_after>'''
tAngel angel-mortal matching code
Author: <NAME>
Version: 0.0.1



Program input: List of participants
Program output: Participants matched to each other forming either a) one complete ring or b) multiple complete rings. No lone particpants are allowed.

Priorities (decreasing order) [must be done]:
1) Forming complete circles (everyone MUST have an angel and mortal)
2) Respecting gender choices

Optimization objective - get people you DON'T KNOW AT ALL
Optimization priorities:
1) Angel - Mortal relationship - they must not know each other as much as possible
- Achieved by separating by HOUSE (floor) and FACULTY

Distance (or whether an edge exists between two nodes) is a function of:
1) Whether they are of different houses
2) Whether their faculties are different
'''
# IMPORTS
import csv
import time
import random

# FROMS
from models import Player
from arrange import angel_mortal_arrange

# GLOBALS
PLAYERFILE = "playerlist.tsv"

# Constants
GENDER_MALE = "Male"
GENDER_FEMALE = "Female"
GENDER_NONBINARY = "Non-binary"
GENDER_NOPREF = "No preference"

GENDER_SWAP_PREFERENCE_PERCENTAGE = 0.00

def read_csv(filename):
    '''
    Reads a CSV file and outputs a list of Player objects
    '''
    person_list = []
    with open(filename, 'rb') as f:
        reader = csv.reader(f, delimiter="\t")
        for row in reader:
            new_person = Player(name=row[1].decode('ascii', errors='ignore'),
                                fbname=row[2],
{'fraction_non_alphanumeric': 0.07702479338842975, 'fraction_numerical': 0.009917355371900827, 'mean_word_length': 3.9043760129659644, 'pattern_counts': {'":': 0, '<': 5, '<?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}}
{'dir': 'git-commits-cleaned', 'id': '4831133', 'n_tokens_mistral': 954, 'n_tokens_neox': 888, 'n_words': 360}