<commit_before>from . import AWSObject, Tags
from .validators import boolean

Bursting = 'bursting'
Provisioned = 'provisioned'


def throughput_mode_validator(mode):
    valid_modes = [Bursting, Provisioned]
    if mode not in valid_modes:
        raise ValueError(
            'ThroughputMode must be one of: "%s"' % (', '.join(valid_modes))
        )
    return mode


def provisioned_throughput_validator(throughput):
    if throughput < 0.0:
        raise ValueError(
            'ProvisionedThroughputInMibps must be greater than or equal to 0.0'
        )
    return throughput


class FileSystem(AWSObject):
    resource_type = "AWS::EFS::FileSystem"

    props = {
        'Encrypted': (boolean, False),
        'FileSystemTags': (Tags, False),
        'KmsKeyId': (basestring, False),
        'PerformanceMode': (basestring, False),
        'ProvisionedThroughputInMibps': (float, False),
        'ThroughputMode': (throughput_mode_validator, False),
    }


class MountTarget(AWSObject):
    resource_type = "AWS::EFS::MountTarget"

    props = {
        'FileSystemId': (basestring, True),
        'IpAddress': (basestring, False),
        'SecurityGroups': ([basestring], True),
        'SubnetId': (basestring, True),
    }<commit_msg>Add EFS FileSystem LifecyclePolicies (#1456)<commit_after>from . import AWSObject, AWSProperty, Tags
from .validators import boolean

Bursting = 'bursting'
Provisioned = 'provisioned'


def throughput_mode_validator(mode):
    valid_modes = [Bursting, Provisioned]
    if mode not in valid_modes:
        raise ValueError(
            'ThroughputMode must be one of: "%s"' % (', '.join(valid_modes))
        )
    return mode


def provisioned_throughput_validator(throughput):
    if throughput < 0.0:
        raise ValueError(
            'ProvisionedThroughputInMibps must be greater than or equal to 0.0'
        )
    return throughput


class LifecyclePolicy(AWSProperty):
    props = {
        'TransitionToIA': (basestring, True),
    }


class FileSystem(AWSObject):
    resource_type = "AWS::EFS::FileSystem"

    props = {
        'Encrypted': (boolean, False),
        'FileSystemTags': (Tags, False),
        'KmsKeyId': (basestring, False),
        'LifecyclePolicies': ([LifecyclePolicy], False),
        'PerformanceMode': (basestring, False),
        'ProvisionedThroughputInMibps': (float, False),
        'ThroughputMode': (throughput_mode_validator, False),
    }


class MountTarget(AWSObject):
    resource_type = "AWS::EFS::MountTarget"

    props = {
        'FileSystemId': (basestring, True),
        'IpAddress': (basestring, False),
        'SecurityGroups': ([basestring], True),
        'SubnetId': (basestring, True),
    }
{'fraction_non_alphanumeric': 0.11764705882352941, 'fraction_numerical': 0.004439511653718091, 'mean_word_length': 3.16, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2085666', 'n_tokens_mistral': 877, 'n_tokens_neox': 829, 'n_words': 196}