<commit_before>#!/usr/bin/python2
# -*- coding: utf-8 -*-

import os
import requests

token = os.getenv("PACKAGECLOUD_TOKEN")
repository = "jollheef/henhouse"
api_url = "https://%s:@packagecloud.io/api/v1/repos/%s/" % (token, repository)
name = 'henhouse'

def delete_package(filename):
    response = requests.delete(api_url+filename)
    print("Delete package status: %d" % response.status_code)

packages = requests.get(api_url+"/packages.json").json()

for pkg in packages[:-2]:
    if pkg['name'] == name:
        delete_package(pkg['distro_version']+"/"+pkg['filename'])<commit_msg>Do not clean release version on packagecloud<commit_after>#!/usr/bin/python2
# -*- coding: utf-8 -*-

import os
import requests

token = os.getenv("PACKAGECLOUD_TOKEN")
repository = "jollheef/henhouse"
api_url = "https://%s:@packagecloud.io/api/v1/repos/%s/" % (token, repository)
name = 'henhouse'

def delete_package(filename):
    response = requests.delete(api_url+filename)
    print("Delete package status: %d" % response.status_code)

packages = requests.get(api_url+"/packages.json").json()

for pkg in packages[:-9]:
    if pkg['name'] == name:
        if pkg['release'] != '0':
            delete_package(pkg['distro_version']+"/"+pkg['filename'])
{'fraction_non_alphanumeric': 0.17590361445783131, 'fraction_numerical': 0.007228915662650603, 'mean_word_length': 4.689497716894977, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '5065072', 'n_tokens_mistral': 426, 'n_tokens_neox': 420, 'n_words': 80}