<commit_before>import datetime
import pytz

from app.models import Match
from app.business.slot_business import create_slot_from_json
from app.util.dota_util import GAME_MODES, LOBBY_TYPES

def create_from_json(match_json):
    utc=pytz.UTC
    match = Match(
        match_id = match_json['match_id'], \
        match_seq_num = match_json['match_seq_num'], \
        radiant_win = match_json['radiant_win'], \
        duration = match_json['duration'], \
        start_time = utc.localize(datetime.datetime.fromtimestamp(match_json['start_time'])), \
        patch = match_json['patch'], \
        tower_status_radiant = match_json['tower_status_radiant'], \
        tower_status_dire = match_json['tower_status_dire'], \
        barracks_status_radiant = match_json['barracks_status_radiant'], \
        barracks_status_dire = match_json['barracks_status_dire'], \
        cluster = match_json['cluster'], \
        first_blood_time = match_json['first_blood_time'], \
        lobby_type = LOBBY_TYPES[match_json['lobby_type']], \
        human_players = match_json['human_players'], \
        leagueid = match_json['leagueid'], \
        game_mode = GAME_MODES[match_json['game_mode']], \
        flags = match_json['flags'], \
        engine = match_json['engine'], \
        radiant_score = match_json['radiant_score'], \
        dire_score = match_json['dire_score'], \
    )
    match.save()
    for slot_json in match_json['players']:<commit_msg>add skill to create_from_json method<commit_after>import datetime
import pytz

from app.models import Match
from app.business.slot_business import create_slot_from_json
from app.util.dota_util import GAME_MODES, LOBBY_TYPES

def create_from_json(match_json):
    utc=pytz.UTC
    match = Match(
        match_id = match_json['match_id'], \
        match_seq_num = match_json['match_seq_num'], \
        radiant_win = match_json['radiant_win'], \
        duration = match_json['duration'], \
        start_time = utc.localize(datetime.datetime.fromtimestamp(match_json['start_time'])), \
        patch = match_json['patch'], \
        tower_status_radiant = match_json['tower_status_radiant'], \
        tower_status_dire = match_json['tower_status_dire'], \
        barracks_status_radiant = match_json['barracks_status_radiant'], \
        barracks_status_dire = match_json['barracks_status_dire'], \
        cluster = match_json['cluster'], \
        first_blood_time = match_json['first_blood_time'], \
        lobby_type = LOBBY_TYPES[match_json['lobby_type']], \
        human_players = match_json['human_players'], \
        leagueid = match_json['leagueid'], \
        game_mode = GAME_MODES[match_json['game_mode']], \
        flags = match_json['flags'], \
        engine = match_json['engine'], \
        radiant_score = match_json['radiant_score'], \
        dire_score = match_json['dire_score'], \
        skill = match_json['skill'] \
    )
    match.save()
    for slot_json in match_json['players']:
{'fraction_non_alphanumeric': 0.12057931963624116, 'fraction_numerical': 0.0, 'mean_word_length': 3.513677811550152, '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': '5604332', 'n_tokens_mistral': 956, 'n_tokens_neox': 979, 'n_words': 139}