<commit_before># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import timeutils

from senlin.common import exception
from senlin.common.i18n import _LE
from senlin.db import api as db_api
from senlin.engine import event as event_mod
from senlin.engine import node as node_mod
from senlin.openstack.common import periodic_task
from senlin.profiles import base as profiles_base

LOG = logging.getLogger(__name__)

CONF = cfg.CONF


class Cluster(periodic_task.PeriodicTasks):
    '''A cluster is a set of homogeneous objects of the same profile.

    All operations are performed without further checking because the
    checkings are supposed to be de done before/after/during an action is
    excuted.
    '''

    STATUSES = (
        INIT, CREATING, ACTIVE, ERROR, CRITICAL, DELETING, DELETED, WARNING,
        UPDATING, UPDATE_CANCELLED,
    ) = (
        'INIT', 'CREATING', 'ACTIVE', 'ERROR', 'CRITICAL', 'DELETING',
        'DELETED', 'WARNING', 'UPDATING', 'UPDATE_CANCELLED',
    )

    def __init__(self, name, desired_capacity, profile_id,
                 context=None, **kwargs):
        '''Intialize a cluster object.

        The cluster defaults to have 0 nodes with no profile assigned.
        '''

        self.id = kwargs.get('id', None)
        self.name = name
        self.profile_id = profile_id

        # Initialize the fields using kwargs passed in
        self.user = kwargs.get('user', '')
        self.project = kwargs.get('project', '')
        self.domain = kwargs.get('domain', '')
        self.parent = kwargs.get('parent', '')

        self.init_time = kwargs.get('init_time', None)
        self.created_time = kwargs.get('created_time', None)
        self.updated_time = kwargs.get('updated_time', None)
        self.deleted_time = kwargs.get('deleted_time', None)
<commit_msg>Remove UPDATE_CANCELLED cluster state<commit_after># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import timeutils

from senlin.common import exception
from senlin.common.i18n import _LE
from senlin.db import api as db_api
from senlin.engine import event as event_mod
from senlin.engine import node as node_mod
from senlin.openstack.common import periodic_task
from senlin.profiles import base as profiles_base

LOG = logging.getLogger(__name__)

CONF = cfg.CONF


class Cluster(periodic_task.PeriodicTasks):
    '''A cluster is a set of homogeneous objects of the same profile.

    All operations are performed without further checking because the
    checkings are supposed to be de done before/after/during an action is
    excuted.
    '''

    STATUSES = (
        INIT, ACTIVE, DELETED, CREATING, UPDATING, DELETING,
        CRITICAL, ERROR, WARNING,
    ) = (
        'INIT', 'ACTIVE', 'DELETED', 'CREATING', 'UPDATING', 'DELETING',
        'CRITICAL', 'ERROR', 'WARNING',
    )

    def __init__(self, name, desired_capacity, profile_id,
                 context=None, **kwargs):
        '''Intialize a cluster object.

        The cluster defaults to have 0 nodes with no profile assigned.
        '''

        self.id = kwargs.get('id', None)
        self.name = name
        self.profile_id = profile_id

        # Initialize the fields using kwargs passed in
        self.user = kwargs.get('user', '')
        self.project = kwargs.get('project', '')
        self.domain = kwargs.get('domain', '')
        self.parent = kwargs.get('parent', '')

        self.init_time = kwargs.get('init_time', None)
        self.created_time = kwargs.get('created_time', None)
        self.updated_time = kwargs.get('updated_time', None)
        self.deleted_time = kwargs.get('deleted_time', None)

{'fraction_non_alphanumeric': 0.09010896898575022, 'fraction_numerical': 0.002933780385582565, 'mean_word_length': 3.2768817204301075, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3916242', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1327, 'n_words': 491}