<commit_before>#!/usr/bin/env python

import requests
from jobs import AbstractJob


class Atb(AbstractJob):

    def __init__(self, conf):
        self.url = conf['url']
        self.interval = conf['interval']

    def get(self):
        r = requests.get(self.url)

        if r.status_code == 200 and len(r.content) > 0:
            return r.json()
        return {}<commit_msg>atb: Set timeout on request to prevent job hanging<commit_after>#!/usr/bin/env python

import requests
from jobs import AbstractJob


class Atb(AbstractJob):

    def __init__(self, conf):
        self.url = conf['url']
        self.interval = conf['interval']

    def get(self):
        r = requests.get(self.url, timeout=5)

        if r.status_code == 200 and len(r.content) > 0:
            return r.json()
        return {}
{'fraction_non_alphanumeric': 0.12222222222222222, 'fraction_numerical': 0.011111111111111112, 'mean_word_length': 2.4956896551724137, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3775685', 'n_tokens_mistral': 263, 'n_tokens_neox': 244, 'n_words': 69}