<commit_before>import subprocess

ADB_COMMAND = "adb"
ADB_COMMAND_DEVICES = "devices"
ADB_COMMAND_KILL = ["shell", "am", "force-stop"]


def list_devices():
    subprocess.run([ADB_COMMAND, ADB_COMMAND_DEVICES])


def get_device_ids():
    output = subprocess.run([ADB_COMMAND, ADB_COMMAND_DEVICES],
                            check=True, stdout=subprocess.PIPE).stdout.decode(
                                "utf-8").splitlines()
    # Delete header text and empty last line
    del output[0]
    del output[len(output) - 1]
    lines = []
    for line in output:
        lines.append(line.split("\t")[0].strip())
    return lines


def kill_app(device, app):
    command = [ADB_COMMAND]
    if device:
        command.append("-s")
        command.append(device)
    command.extend(ADB_COMMAND_KILL)
    command.append(app)
    subprocess.run(command)<commit_msg>Add method to build adb command<commit_after>import subprocess

ADB_COMMAND = "adb"
ADB_COMMAND_DEVICES = "devices"
ADB_COMMAND_KILL = ["shell", "am", "force-stop"]


def __command(device, app, adb_command):
    command = [ADB_COMMAND]
    if device:
        command.append("-s")
        command.append(device)
    command.extend(adb_command)
    command.append(app)
    return command


def list_devices():
    subprocess.run([ADB_COMMAND, ADB_COMMAND_DEVICES])


def get_device_ids():
    output = subprocess.run([ADB_COMMAND, ADB_COMMAND_DEVICES],
                            check=True, stdout=subprocess.PIPE).stdout.decode(
                                "utf-8").splitlines()
    # Delete header text and empty last line
    del output[0]
    del output[len(output) - 1]
    lines = []
    for line in output:
        lines.append(line.split("\t")[0].strip())
    return lines


def kill_app(device, app):
    subprocess.run(__command(device, app, ADB_COMMAND_KILL))
{'fraction_non_alphanumeric': 0.12119565217391304, 'fraction_numerical': 0.004347826086956522, 'mean_word_length': 2.9337606837606836, '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': '2909958', 'n_tokens_mistral': 602, 'n_tokens_neox': 609, 'n_words': 120}