<commit_before>#Copyright 2011 Calxeda, Inc.  All Rights Reserved. 

from chassis import Chassis

__all__ = ['Server']

class Server:
    """A server is managed over IPMI"""

    def __init__(self, bmc):
        self.bmc = bmc
        self._chassis = Chassis(self.bmc.handle)

    def power_off(self):
        if self._chassis.is_powered:
            self._chassis.power_off()

    def power_on(self):
        if not self._chassis.is_powered:
            self._chassis.power_on()

    def power_cycle(self):
        self._chassis.power_cycle()

    def hard_reset(self):
        self._chassis.hard_reset()

    @property
    def is_powered(self):
        return self._chassis.is_powered<commit_msg>server: add docstrings and cleanup pylint warnings<commit_after>#Copyright 2011 Calxeda, Inc.  All Rights Reserved.
"""
A representation of a server.

This may go away - it doesn't do anything other than what chassis does.

Don't add to this.
"""

from chassis import Chassis

__all__ = ['Server']

class Server:
    """A server is managed over IPMI"""

    def __init__(self, bmc):
        """
        Arguments:

        bmc -- the BMC that's managing this server
        """
        self.bmc = bmc
        self._chassis = Chassis(self.bmc.handle)

    def power_off(self):
        """Power off server if it's powered on"""
        if self._chassis.is_powered:
            self._chassis.power_off()

    def power_on(self):
        """Power on server if it's powered off"""
        if not self._chassis.is_powered:
            self._chassis.power_on()

    def power_cycle(self):
        """Power cycle server"""
        self._chassis.power_cycle()

    def hard_reset(self):
        """Warm reset server"""
        self._chassis.hard_reset()

    @property
    def is_powered(self):
        """True if server is powered, otherwise false"""
        return self._chassis.is_powered
{'fraction_non_alphanumeric': 0.10531914893617021, 'fraction_numerical': 0.00425531914893617, 'mean_word_length': 2.4833333333333334, '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': '1151985', 'n_tokens_mistral': 616, 'n_tokens_neox': 560, 'n_words': 162}