<commit_before>require 'twitter'
require 'yaml'

class TwitterAccess

	def initialize
		config = YAML::load_file(File.join(__dir__, "../config/twitter_config.yml"))
		@app_key = config['app_key']
		@app_secret = config['app_secret']
		@client = create_client
	end

	def get_mentions_to_user(name)
		@client.search("@#{name}", result_type: 'recent')
	end

	private
<commit_msg>Added a method to check if a user exists<commit_after>require 'twitter'
require 'yaml'

class TwitterAccess

	def initialize
		config = YAML::load_file(File.join(__dir__, "../config/twitter_config.yml"))
		@app_key = config['app_key']
		@app_secret = config['app_secret']
		@client = create_client
	end

	def exists_user?(name)
		@client.user?(name)
	end

	def get_mentions_to_user(name)
		@client.search("@#{name}", result_type: 'recent')
	end

	private

{'fraction_non_alphanumeric': 0.1371841155234657, 'fraction_numerical': 0.0, 'mean_word_length': 5.449612403100775, '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': '4187999', 'n_tokens_mistral': 310, 'n_tokens_neox': 289, 'n_words': 62}