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

import panoptes.utils as utils


def state_shutdown():
    '''
    The shutdown state happens during the day, before components have been
    connected.
    
    From the shutdown state, you can go to sleeping.
    '''
    pass


def state_sleeping():
    '''
    The sleeping state happens during the day, after components have been
    connected, while we are waiting for darkness.
    
    From the sleeping state you can go to parking and getting ready.
    '''
    pass


def state_getting_ready():
    '''
    The getting ready state happens while it is dark, it checks if we are ready
    to observe.
    
    From the getting ready state, you can go to slewing to park and scheduling.
    '''
    pass


def state_scheduling():
    '''
    The scheduling state happend while it is dark after we have requested a
    target from the scheduler, but before the target has been returned.  This
    assumes that the scheduling happens in another thread.
    '''
    pass


def main():
    logger = utils.Logger()

    mount = panoptes.mount.Mount()
    cameras = [panoptes.camera.Camera(), panoptes.camera.Camera()]
    observatory = panoptes.observatory.Observatory()

    states = {
              'shutdown':state_shutdown,
              'sleeping':state_sleeping,
              'getting ready':state_getting_ready,
              'scheduling':state_scheduling,
              'slewing':state_slewing,
              'analyzing':state_analyzing,
              'parking':state_parking,
              'parked':state_parked,
              'imaging':state_imaging
             }

    thingtoexectute = states['sleeping']
    thingtoexectute()

if __name__ == '__main__':
    start_session()<commit_msg>Changed name of "state functions" (i.e. state_shutdown) to while_shutdown, while_sleepint, etc. as I think this better reflects what they are and what they do.<commit_after>#!/usr/bin/env python

import panoptes.utils as utils


def while_shutdown():
    '''
    The shutdown state happens during the day, before components have been
    connected.
    
    From the shutdown state, you can go to sleeping.
    '''
    pass


def while_sleeping():
    '''
    The sleeping state happens during the day, after components have been
    connected, while we are waiting for darkness.
    
    From the sleeping state you can go to parking and getting ready.
    '''
    pass


def while_getting_ready():
    '''
    The getting ready state happens while it is dark, it checks if we are ready
    to observe.
    
    From the getting ready state, you can go to slewing to park and scheduling.
    '''
    pass


def while_scheduling():
    '''
    The scheduling state happend while it is dark after we have requested a
    target from the scheduler, but before the target has been returned.  This
    assumes that the scheduling happens in another thread.
    '''
    pass


def main():
    logger = utils.Logger()

    mount = panoptes.mount.Mount()
    cameras = [panoptes.camera.Camera(), panoptes.camera.Camera()]
    observatory = panoptes.observatory.Observatory()

    states = {
              'shutdown':while_shutdown,
              'sleeping':while_sleeping,
              'getting ready':while_getting_ready,
              'scheduling':while_scheduling,
              'slewing':while_slewing,
              'analyzing':while_analyzing,
              'parking':while_parking,
              'parked':while_parked,
              'imaging':while_imaging
             }

    thingtoexectute = states['sleeping']
    thingtoexectute()

if __name__ == '__main__':
    start_session()
{'fraction_non_alphanumeric': 0.08061844284925455, 'fraction_numerical': 0.0, 'mean_word_length': 2.545009784735812, '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': '3565956', 'n_tokens_mistral': 1019, 'n_tokens_neox': 984, 'n_words': 346}