<commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import

import datetime
import functools
import re
from builtins import range

import boto
from mock import patch
from moto import mock_swf

import swf.models
import swf.models.decision
import swf.models.workflow
from simpleflow import (
    futures,
)
from simpleflow.history import History
from simpleflow.swf import constants
from simpleflow.swf.executor import Executor
from simpleflow.swf.task import NonPythonicActivityTask
from simpleflow.task import ActivityTask
from simpleflow.utils import json_dumps
from swf.models.history import builder
from swf.responses import Response
from tests.data import (
    BaseTestWorkflow, DOMAIN, Tetra, double, increment, increment_retry, non_pythonic, print_message,
    raise_error, raise_on_failure, triple,
)


def check_task_scheduled_decision(decision, task):
    """
    Asserts that *decision* schedules *task*.
    """
    assert decision['decisionType'] == 'ScheduleActivityTask'

    attributes = decision['scheduleActivityTaskDecisionAttributes']
    assert attributes['activityType'] == {
        'name': task.name,
        'version': task.version
    }


class ATestDefinitionWithInput(BaseTestWorkflow):
    """
    Execute a single task with an argument passed as the workflow's input.
    """

    def run(self, a):
        b = self.submit(increment, a)
        return b.result


@mock_swf
def test_workflow_with_input():<commit_msg>Revert to one lime per import<commit_after># -*- coding: utf-8 -*-
from __future__ import absolute_import

import datetime
import functools
import re
from builtins import range

import boto
from mock import patch
from moto import mock_swf

import swf.models
import swf.models.decision
import swf.models.workflow
from simpleflow import (
    futures,
)
from simpleflow.history import History
from simpleflow.swf import constants
from simpleflow.swf.executor import Executor
from simpleflow.swf.task import NonPythonicActivityTask
from simpleflow.task import ActivityTask
from simpleflow.utils import json_dumps
from swf.models.history import builder
from swf.responses import Response
from tests.data import (
    BaseTestWorkflow,
    DOMAIN,
    Tetra,
    double,
    increment,
    increment_retry,
    non_pythonic,
    print_message,
    raise_error,
    raise_on_failure,
    triple,
)


def check_task_scheduled_decision(decision, task):
    """
    Asserts that *decision* schedules *task*.
    """
    assert decision['decisionType'] == 'ScheduleActivityTask'

    attributes = decision['scheduleActivityTaskDecisionAttributes']
    assert attributes['activityType'] == {
        'name': task.name,
        'version': task.version
    }


class ATestDefinitionWithInput(BaseTestWorkflow):
    """
    Execute a single task with an argument passed as the workflow's input.
    """

    def run(self, a):
        b = self.submit(increment, a)
        return b.result


@mock_swf
def test_workflow_with_input():
{'fraction_non_alphanumeric': 0.07712944332662643, 'fraction_numerical': 0.0006706908115358819, 'mean_word_length': 4.143103448275862, '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': '1443644', 'n_tokens_mistral': 877, 'n_tokens_neox': 856, 'n_words': 258}