<commit_before>import sys

if len(sys.argv) != 2:
    sys.stderr.write('Exactly one argument is required\n')
    sys.exit(1)

def swap(a, i, j):
    a[i], a[j] = a[j], a[i]

def generatePermutations(n, a):
    if n == 0:
        print ''.join(a)
    else:
        for i in range(n+1):
            generatePermutations(n-1, a)
            swap(a, i if n % 2 == 0 else 0, n)

word = sys.argv[1]
generatePermutations(len(word)-1, list(word))
<commit_msg>Write python anagrams in same style as other languages<commit_after>import sys

def swap(a, i, j):
    a[i], a[j] = a[j], a[i]

def generatePermutations(n, a):
    if n == 0:
        print ''.join(a)
    else:
        for i in range(n+1):
            generatePermutations(n-1, a)
            swap(a, i if n % 2 == 0 else 0, n)

if len(sys.argv) != 2:
    sys.stderr.write('Exactly one argument is required\n')
    sys.exit(1)
word = sys.argv[1]
generatePermutations(len(word)-1, list(word))

{'fraction_non_alphanumeric': 0.1592356687898089, 'fraction_numerical': 0.021231422505307854, 'mean_word_length': 2.626923076923077, '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': '4779782', 'n_tokens_mistral': 376, 'n_tokens_neox': 357, 'n_words': 102}