<commit_before>"""
Problem Autogeneration Handler
"""

import api
import random
import imp
import shutil

import os
from os import path
from functools import partial
from bson import json_util
from api.common import InternalException

log = api.logger.use(__name__)

modifiable_problem_fields = ["score", "description", "name"]
seed = ""

def is_autogen_problem(pid):
    """
    Determines whether or not a problem is autogenerated.

    Arg:
        pid: the problem id
    Returns:
        True or False whether or not the problem is autogenerated.
    """

    return api.problem.get_problem(pid=pid).get("autogen", False)

def get_metadata_path(pid, n):
    """
    Retrieve the path to the metadata file for a given problem instance.<commit_msg>Really only the description should be updated.<commit_after>"""
Problem Autogeneration Handler
"""

import api
import random
import imp
import shutil

import os
from os import path
from functools import partial
from bson import json_util
from api.common import InternalException

log = api.logger.use(__name__)

modifiable_problem_fields = ["description"]
seed = ""

def is_autogen_problem(pid):
    """
    Determines whether or not a problem is autogenerated.

    Arg:
        pid: the problem id
    Returns:
        True or False whether or not the problem is autogenerated.
    """

    return api.problem.get_problem(pid=pid).get("autogen", False)

def get_metadata_path(pid, n):
    """
    Retrieve the path to the metadata file for a given problem instance.
{'fraction_non_alphanumeric': 0.07839262187088274, 'fraction_numerical': 0.0, 'mean_word_length': 3.8685897435897436, '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': '2178764', 'n_tokens_mistral': 451, 'n_tokens_neox': 425, 'n_words': 165}