<commit_before># -*- coding: utf-8 -*-
"""Base classes."""

import time


class Result(object):
    """Provides results of a Check.

    Attributes:
        availability (bool): Availability, usually reflects outcome of a check.
        runtime (float): Time consumed running the check, in seconds.
        message (string): Additional explainations for the result.
        timestamp (int): UTC timestamp of the check.
    """

    def __init__(self, availability, runtime, message, timestamp=time.time()):
        """Initialise Result.

        Args:
            See class attributes.
        """
        self.availability = availability
        self.runtime = runtime
        self.message = message
        self.timestamp = timestamp

    @property
    def api_serialised(self):
        """Return serialisable data for API monitor assignments."""
        return {'availability': self.availability,
                'runtime': self.runtime,
                'message': self.message,
                'timestamp': self.timestamp}


class Check(object):
    """Performs checks for availability of resources.

    This should be inherited by checking implementations.
    """

    def __init__(self, **kwargs):
        """Initialise Check."""
        pass

    def check(self):
        """Check if specified resource is availability.<commit_msg>Fix typos in Result and Check docstrings<commit_after># -*- coding: utf-8 -*-
"""Base classes."""

import time


class Result(object):
    """Provides results of a Check.

    Attributes:
        availability (bool): Availability, usually reflects outcome of a check.
        runtime (float): Time consumed running the check, in seconds.
        message (string): Additional explainations for the result.
        timestamp (int): UTC timestamp of the check.
    """

    def __init__(self, availability, runtime, message, timestamp=time.time()):
        """Initialise Result.

        Args:
            See class attributes.
        """
        self.availability = availability
        self.runtime = runtime
        self.message = message
        self.timestamp = timestamp

    @property
    def api_serialised(self):
        """Return serialisable data for API result submissions."""
        return {'availability': self.availability,
                'runtime': self.runtime,
                'message': self.message,
                'timestamp': self.timestamp}


class Check(object):
    """Performs checks for availability of resources.

    This should be inherited by checking implementations.
    """

    def __init__(self, **kwargs):
        """Initialise Check."""
        pass

    def check(self):
        """Check if specified resource is availabile.
{'fraction_non_alphanumeric': 0.10281065088757396, 'fraction_numerical': 0.0007396449704142012, 'mean_word_length': 2.40251572327044, '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': '2602909', 'n_tokens_mistral': 659, 'n_tokens_neox': 625, 'n_words': 235}