<commit_before>"""
    femagtools.amazon
    ~~~~~~~~~~~~~~~~

    Running FEMAG on Amazon Cloud EC2

    :copyright: 2016 Semafor Informatik & Energie AG, Basel
    :license: BSD, see LICENSE for more details.

    .. note: To use this engine you have to install the boto3 module from amazon
"""
import os
import threading
import time
import logging

import femagtools.job
from .config import Config

logger = logging.getLogger(__name__)

class MissingConfigurationException(Exception):
    def __init__(self, message):
        Exception.__init__(self, "Missing configuration: {}".format(message))


class Engine(object):

    config_class = Config

    default_config = {
        'ENGINE': 'amazon',
        'SERVER_LOCATION': 'eu-central-1',
        'INSTANCE_TYPE': 't2.micro',
        'ACL': 'authenticated-read',
        'IMAGE_ID': 'ami-b0cc23df',
        'FINISH_TASK_FILENAME': 'exit_code',
        'COMPANY_NAME': 'femag'
    }

    """The Amazon Engine

    This enginge uses the boto3 Python module to interact 
       with the amazon ec2 and s3 services

    :param list buckets: Existing buckets with femag calculation files
    :param str configfile: Filename of config file

    .. :note: If possible you should use the same location for all services

    """
    def __init__(self, buckets=None, configfile='config.ini'):
        self.buckets = buckets
        self.job = None

        # Amazon file storage
        self.s3_resource = self._create_amazon_resource('s3')
        # Amazon Server administration
        self.ec2_resource = self._create_amazon_resource('ec2')

        # Create instance of config
        self.config = Config(self.default_config, configfile)
        self.config.from_ini_file(configfile)
        
    def _create_amazon_resource(self, resource):
        import boto3
        return boto3.resource(resource)

    def _create_data_buckets(self):
        """Create unique S3 Buckets for calculation

        :param str ACL: ACL-Rules for Amazon
        """<commit_msg>fix test<commit_after>"""
    femagtools.amazon
    ~~~~~~~~~~~~~~~~

    Running FEMAG on Amazon Cloud EC2

    :copyright: 2016 Semafor Informatik & Energie AG, Basel
    :license: BSD, see LICENSE for more details.

    .. note: To use this engine you have to install the boto3 module from amazon
"""
import os
import threading
import time
import logging

import femagtools.job
from .config import Config

logger = logging.getLogger(__name__)

class MissingConfigurationException(Exception):
    def __init__(self, message):
        Exception.__init__(self, "Missing configuration: {}".format(message))


class Engine(object):

    config_class = Config

    default_config = {
        'ENGINE': 'amazon',
        'SERVER_LOCATION': 'eu-central-1',
        'INSTANCE_TYPE': 't2.micro',
        'ACL': 'authenticated-read',
        'IMAGE_ID': 'ami-b0cc23df',
        'FINISH_TASK_FILENAME': 'exit_code',
        'COMPANY_NAME': 'femag'
    }

    """The Amazon Engine

    This enginge uses the boto3 Python module to interact 
       with the amazon ec2 and s3 services

    :param list buckets: Existing buckets with femag calculation files
    :param str configfile: Filename of config file

    .. :note: If possible you should use the same location for all services

    """
    def __init__(self, buckets=None, configfile='config.ini'):
        self.buckets = buckets
        self.job = None

        # Amazon file storage
        self.s3_resource = self._create_amazon_resource('s3')
        # Amazon Server administration
        self.ec2_resource = self._create_amazon_resource('ec2')

        # Create instance of config
        self.config = Config(self.default_config)
        self.config.from_ini_file(configfile)
        
    def _create_amazon_resource(self, resource):
        import boto3
        return boto3.resource(resource)

    def _create_data_buckets(self):
        """Create unique S3 Buckets for calculation

        :param str ACL: ACL-Rules for Amazon
        """
{'fraction_non_alphanumeric': 0.09408535063638633, 'fraction_numerical': 0.010481657100074869, 'mean_word_length': 2.9255631733594516, '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': '5653240', 'n_tokens_mistral': 1181, 'n_tokens_neox': 1116, 'n_words': 348}