<commit_before>#!/usr/bin/env python
from __future__ import print_function
import argparse
import sys
import yaml
import json
import urllib
import requests

def get_appservice_token(reg):
    with open(reg, "r") as f:
        reg_yaml = yaml.load(f)
        return reg_yaml["as_token"]

def get_rooms(hs_url, token, user_id):
    res = requests.get(hs_url + "/_matrix/client/r0/sync?access_token=" + token).json()
    room_ids = []
    for r in res["rooms"]["join"]:
        room = res["rooms"]["join"][r]
        for s in room["state"]["events"]:
            if s["type"] == "m.room.member" and s["state_key"] == user_id and s["content"]["membership"] == "join":
                room_ids.append(r)
    return room_ids

def kick(hs_url, token, room_id, user_id):<commit_msg>Review comments<commit_after>#!/usr/bin/env python
from __future__ import print_function
import argparse
import sys
import yaml
import json
import urllib
import requests

def get_appservice_token(reg):
    with open(reg, "r") as f:
        reg_yaml = yaml.load(f)
        return reg_yaml["as_token"]

def get_rooms(hs_url, token, user_id):
    res = requests.get(hs_url + "/_matrix/client/r0/sync?access_token=" + token).json()
    room_ids = []
    for room_id in res["rooms"]["join"]:
        room = res["rooms"]["join"][room_id]
        for s in room["state"]["events"]:
            if s["type"] == "m.room.member" and s["state_key"] == user_id and s["content"]["membership"] == "join":
                room_ids.append(room_id)
    return room_ids

def kick(hs_url, token, room_id, user_id):
{'fraction_non_alphanumeric': 0.14923469387755103, 'fraction_numerical': 0.0012755102040816326, 'mean_word_length': 3.587719298245614, 'pattern_counts': {'":': 2, '<': 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': '3477655', 'n_tokens_mistral': 536, 'n_tokens_neox': 543, 'n_words': 130}