<commit_before># This generates Gentoo Linux ebuilds for ROS packages.
from termcolor import colored
import yaml
import sys
import re

try:
    import requests

    def get_http(url):
        return requests.get(url).text
except:
    from urllib.request import urlopen

    def get_http(url):
        response = urlopen(url)
        return response.read()

"""
@todo: change these back to ros/rosdistro (waiting on ros/rosdistro#15179 to merge
"""
base_url = "https://raw.githubusercontent.com/allenh1/rosdistro/master/rosdep/base.yaml"
python_url = "https://raw.githubusercontent.com/allenh1/rosdistro/master/rosdep/python.yaml"
ruby_url = "https://raw.githubusercontent.com/allenh1/rosdistro/master/rosdep/ruby.yaml"

print(colored("Downloading latest base yml...", 'cyan'))
base_yml = yaml.load(get_http(base_url))
print(colored("Downloading latest python yml...", 'cyan'))
python_yml = yaml.load(get_http(python_url))
print(colored("Downloading latest ruby yml...", 'cyan'))
ruby_yml = yaml.load(get_http(ruby_url))

def get_license(l):
    bsd_re = '^(BSD)((.)*([1234]))?'
    gpl_re = '^(GPL)((.)*([123]))?'
    lgpl_re = '^(LGPL)((.)*([23]|2\\.1))?'
    apache_re = '^(Apache)((.)*(1\\.0|1\\.1|2\\.0|2))?'
    none_re = '^(Public Domain)'
    cc_re = '^(Creative Commons)|'<commit_msg>As ros/rosdistro#15179 has been merged, I can change this back to ros/rosdistro.<commit_after># This generates Gentoo Linux ebuilds for ROS packages.
from termcolor import colored
import yaml
import sys
import re

try:
    import requests

    def get_http(url):
        return requests.get(url).text
except:
    from urllib.request import urlopen

    def get_http(url):
        response = urlopen(url)
        return response.read()

base_url = "https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml"
python_url = "https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml"
ruby_url = "https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml"

print(colored("Downloading latest base yml...", 'cyan'))
base_yml = yaml.load(get_http(base_url))
print(colored("Downloading latest python yml...", 'cyan'))
python_yml = yaml.load(get_http(python_url))
print(colored("Downloading latest ruby yml...", 'cyan'))
ruby_yml = yaml.load(get_http(ruby_url))

def get_license(l):
    bsd_re = '^(BSD)((.)*([1234]))?'
    gpl_re = '^(GPL)((.)*([123]))?'
    lgpl_re = '^(LGPL)((.)*([23]|2\\.1))?'
    apache_re = '^(Apache)((.)*(1\\.0|1\\.1|2\\.0|2))?'
    none_re = '^(Public Domain)'
    cc_re = '^(Creative Commons)|'
{'fraction_non_alphanumeric': 0.17778649921507064, 'fraction_numerical': 0.019230769230769232, 'mean_word_length': 4.310416666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4174337', 'n_tokens_mistral': 976, 'n_tokens_neox': 913, 'n_words': 181}