<commit_before>using System.Net;
using System.Configuration;

private static TraceWriter logger;

/// Extract the topics from the and topics and experts list so there is one master list
/// and topics and experts stay in sync.
private static string[] LoadTopics()
{
    
    string TopicsAndExperts = ConfigurationManager.AppSettings["EXPERTS_LIST"].ToString();
     
    logger.Info($"Got TopicsAndExperts: {TopicsAndExperts}");

    // split each topic and expert pair
    string[] ExpertList = TopicsAndExperts.Split(';');

    // Create container to return
    List<string> Topics = new List<string>();

    foreach (var item in ExpertList)
    {
        // split topic from expert
        string[] TopicDetails = item.Split(',');

        // load topic
        Topics.Add(TopicDetails[0]);
        logger.Info($"Loaded topic: {TopicDetails[0]}");
    }

    return Topics.ToArray();

}

public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
{
    // save the logging context for later use
    logger = log;

    log.Info($"C# HTTP trigger function processed a request. RequestUri={req.RequestUri}");

    string[] Topics = LoadTopics();

    return Topics == null
        ? req.CreateResponse(HttpStatusCode.BadRequest, "Please pass a name on the query string or in the request body")
        : req.CreateResponse(HttpStatusCode.OK, Topics);
}<commit_msg>Changed to use AppSettingsHelper and LogHelper<commit_after>#load "..\shared\LogHelper.csx"
#load "..\shared\AppSettingsHelper.csx"
using System.Net;

private static TraceWriter logger;

/// Extract the topics from the and topics and experts list so there is one master list
/// and topics and experts stay in sync.
private static string[] LoadTopics()
{
    
    string TopicsAndExperts = AppSettingsHelper.GetAppSetting("EXPERTS_LIST");
     
    LogHelper.Info($"Got TopicsAndExperts: {TopicsAndExperts}");

    // split each topic and expert pair
    string[] ExpertList = TopicsAndExperts.Split(';');

    // Create container to return
    List<string> Topics = new List<string>();

    foreach (var item in ExpertList)
    {
        // split topic from expert
        string[] TopicDetails = item.Split(',');

        // load topic
        Topics.Add(TopicDetails[0]);
        LogHelper.Info($"Loaded topic: {TopicDetails[0]}");
    }

    return Topics.ToArray();

}

public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
{
    // save the logging context for later use
    LogHelper.Initialize(log);

    LogHelper.Info($"C# HTTP trigger function processed a request. RequestUri={req.RequestUri}");

    string[] Topics = LoadTopics();

    return Topics == null
        ? req.CreateResponse(HttpStatusCode.BadRequest, "Please pass a name on the query string or in the request body")
        : req.CreateResponse(HttpStatusCode.OK, Topics);
}
{'fraction_non_alphanumeric': 0.10852981969486823, 'fraction_numerical': 0.0013869625520110957, 'mean_word_length': 3.418070444104135, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2194593', 'n_tokens_mistral': 814, 'n_tokens_neox': 791, 'n_words': 256}