<commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-
import SakaiPy.RequestGenerator



class Announcement(object):

    def __init__(self, rq):
        self.requester = rq

    def getAllForSite(self, siteid):
        return self.requester.executeRequest('/direct/announcement/site/{0}.json'.format(siteid))
<commit_msg>Code cleanup, formatting and documentation fixes.<commit_after>#!/usr/bin/python
# -*- coding: utf-8 -*-


class Announcement(object):
    """
    Contains logic for the Sakai Announcement Tool.

    More information about the RESTful interface can be found at:
    https://sakai.rutgers.edu/direct/announcement/describe
    """
    def __init__(self, rq):
        """
        Create a standalone Announcement Object
        :param rq: The RequestHandler to use.
        :return: An Announcement object
        """
        self.requester = rq

    def getAllAnnouncements(self, siteid):
        """
        Get all of the available announcements for a given site
        :param siteid: The id of the site you wish to get the announcements from
        :return: A JSON representation of the announcements for the given site.
        """
        return self.requester.executeRequest('/direct/announcement/site/{0}.json'.format(siteid))

    def getMessageOfTheDay(self):
        """
        Get the current Message Of The Day if there is one.
        :return: A JSON representation of the current Message Of The Day
        """
        return self.requester.executeRequest('/direct/announcement/motd.json')

    def getMyAnnouncements(self):
        """
        Get all of the current Announcements for the current user.
        :return: A JSON representation of all of the announcements for the current user.
        """
        return self.requester.executeRequest('/direct/announcement/user.json')
{'fraction_non_alphanumeric': 0.09764125068568294, 'fraction_numerical': 0.0021941854086670325, 'mean_word_length': 2.768595041322314, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '649684', 'n_tokens_mistral': 510, 'n_tokens_neox': 487, 'n_words': 158}