<commit_before>import os
from libraries.models import Tweet, User
from config import app_config as cfg
from libraries.graphs.graph import Graph

# Twitter API configuration
consumer_key = cfg.twitter["consumer_key"]
consumer_secret = cfg.twitter["consumer_secret"]

access_token = cfg.twitter["access_token"]
access_token_secret = cfg.twitter["access_token_secret"]



# Start
current_path = os.path.dirname(os.path.abspath(__file__))

# Average mentions per user
path ="{}/images/avg_mentions.png".format(current_path)
graph = Graph(path)
avg_mentions_per_user = Tweet.avg_mentions_per_user().values()
avg_mentions_per_bot = Tweet.avg_mentions_per_user(True).values()
graph.avg_tweets(avg_mentions_per_user, avg_mentions_per_bot, path)

path ="{}/images/vocabulary.png".format(current_path)
graph.vocabulary(Tweet.vocabulary_size().values(), Tweet.vocabulary_size(True).values(), path)

path ="{}/images/followers_following.png".format(current_path)
graph.ratio_followers_following(
    User.ratio_followers_following_per_users(),
    User.ratio_followers_following_per_users(),
    path
)






<commit_msg>Fix ratio followers/following only displayed for "humans"<commit_after>import os
from libraries.models import Tweet, User
from config import app_config as cfg
from libraries.graphs.graph import Graph

# Twitter API configuration
consumer_key = cfg.twitter["consumer_key"]
consumer_secret = cfg.twitter["consumer_secret"]

access_token = cfg.twitter["access_token"]
access_token_secret = cfg.twitter["access_token_secret"]


# Start
current_path = os.path.dirname(os.path.abspath(__file__))

# Average mentions per user
path ="{}/images/avg_mentions.png".format(current_path)
graph = Graph(path)
avg_mentions_per_user = Tweet.avg_mentions_per_user().values()
avg_mentions_per_bot = Tweet.avg_mentions_per_user(True).values()
graph.avg_tweets(avg_mentions_per_user, avg_mentions_per_bot, path)

path ="{}/images/vocabulary.png".format(current_path)
graph.vocabulary(Tweet.vocabulary_size().values(), Tweet.vocabulary_size(True).values(), path)

path ="{}/images/followers_following.png".format(current_path)
graph.ratio_followers_following(
    User.ratio_followers_following_per_users(),
    User.ratio_followers_following_per_users(is_bot=True),
    path
)







{'fraction_non_alphanumeric': 0.11267605633802817, 'fraction_numerical': 0.0, 'mean_word_length': 7.449814126394052, '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': '5337973', 'n_tokens_mistral': 782, 'n_tokens_neox': 747, 'n_words': 120}