<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using Challonge.Data.Properties;
using RestSharp;

namespace Challonge.Data
{
	public sealed class ChallongeClient
	{
		public ChallongeClient()
		{
			m_client = new RestClient
			{
				BaseUrl = Settings.Default.BaseUri + Settings.Default.TournamentId + "/",
			};
			m_participants = new Dictionary<int, Participant>();
		}

		public IEnumerable<Match> GetMatches(string state)
		{
			var result = m_client.Get<List<MatchResult>>(new RestRequest(string.Format("matches.json?state={0}", state) + s_apiKeyString));
			return result.ResponseStatus != ResponseStatus.Completed ?
				null :<commit_msg>Fix crash if GetMatches response is not 200 OK.<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using Challonge.Data.Properties;
using RestSharp;

namespace Challonge.Data
{
	public sealed class ChallongeClient
	{
		public ChallongeClient()
		{
			m_client = new RestClient
			{
				BaseUrl = Settings.Default.BaseUri + Settings.Default.TournamentId + "/",
			};
			m_participants = new Dictionary<int, Participant>();
		}

		public IEnumerable<Match> GetMatches(string state)
		{
			var result = m_client.Get<List<MatchResult>>(new RestRequest(string.Format("matches.json?state={0}", state) + s_apiKeyString));
			return result.ResponseStatus != ResponseStatus.Completed || result.StatusCode != HttpStatusCode.OK ?
				null :
{'fraction_non_alphanumeric': 0.11164383561643836, 'fraction_numerical': 0.003424657534246575, 'mean_word_length': 4.867469879518072, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '3614134', 'n_tokens_mistral': 495, 'n_tokens_neox': 441, 'n_words': 96}