<commit_before>#!/usr/bin/env python
"""
Example script to move torrents based on their label set in ruTorrent.

./move-by-label.py USERNAME HOSTNAME [PATH]
"""
from __future__ import print_function
from time import sleep
import sys

from xirvik.client import ruTorrentClient

USERNAME = sys.argv[1]
HOST = sys.arg[2]
try:
    PATH = sys.argv[3]
except IndexError:
    PATH = ''
PREFIX = '/torrents/{}/{}'.format(USERNAME, PATH)


if __name__ == '__main__':
    client = ruTorrentClient(HOST)
    count = 0

    for hash, info in client.list_torrents_dict().iteritems():
        name = info['name'].encode('utf-8')
        label = info['custom1']<commit_msg>Fix accessing argv<commit_after>#!/usr/bin/env python
"""
Example script to move torrents based on their label set in ruTorrent.

./move-by-label.py USERNAME HOSTNAME [PATH]
"""
from __future__ import print_function
from time import sleep
import sys

from xirvik.client import ruTorrentClient

USERNAME = sys.argv[1]
HOST = sys.argv[2]
try:
    PATH = sys.argv[3]
except IndexError:
    PATH = ''
PREFIX = '/torrents/{}/{}'.format(USERNAME, PATH)


if __name__ == '__main__':
    client = ruTorrentClient(HOST)
    count = 0

    for hash, info in client.list_torrents_dict().iteritems():
        name = info['name'].encode('utf-8')
        label = info['custom1']
{'fraction_non_alphanumeric': 0.13161875945537066, 'fraction_numerical': 0.009077155824508321, 'mean_word_length': 3.810909090909091, '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': '6580170', 'n_tokens_mistral': 456, 'n_tokens_neox': 438, 'n_words': 123}