<commit_before># encoding: utf-8

#   Copyright 2012 Red Hat, Inc.
#
#   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.

import logging
import zope
import inspect
from imgfac.CloudDelegate import CloudDelegate

class MockSphere(object):
    zope.interface.implements(CloudDelegate)


    def __init__(self):
        self.log = logging.getLogger('%s.%s' % (__name__, self.__class__.__name__))

    def push_image_to_provider(self, builder, provider, credentials, target, target_image, parameters):
        self.log.info('%s called in MockSphere plugin' % (inspect.stack()[1][3]))

    def snapshot_image_on_provider(self, builder, provider, credentials, target, template, parameters):
        self.log.info('%s called in MockSphere plugin' % (inspect.stack()[1][3]))

    def builder_should_create_target_image(self, builder, target, image_id, template, parameters):
        self.log.info('%s called in MockSphere plugin' % (inspect.stack()[1][3]))
        return True

    def builder_will_create_target_image(self, builder, target, image_id, template, parameters):
        self.log.info('%s called in MockSphere plugin' % (inspect.stack()[1][3]))

    def builder_did_create_target_image(self, builder, target, image_id, template, parameters):
        self.log.info('%s called in MockSphere plugin' % (inspect.stack()[1][3]))

    def delete_from_provider(self, builder, provider, credentials, target, parameters):
        self.log.info('%s called in MockSphere plugin' % (inspect.stack()[1][3]))<commit_msg>Set provider_image identifiers for the Mock cloud provider<commit_after># encoding: utf-8

#   Copyright 2012 Red Hat, Inc.
#
#   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.

import logging
import uuid
import zope
import inspect
from imgfac.CloudDelegate import CloudDelegate

class MockSphere(object):
    zope.interface.implements(CloudDelegate)


    def __init__(self):
        self.log = logging.getLogger('%s.%s' % (__name__, self.__class__.__name__))

    def push_image_to_provider(self, builder, provider, credentials, target, target_image, parameters):
        self.log.info('%s called in MockSphere plugin' % (inspect.stack()[1][3]))
        builder.provider_image.identifier_on_provider = str(uuid.uuid4())
        builder.provider_image.provider_account_identifier = 'mock_user'

    def snapshot_image_on_provider(self, builder, provider, credentials, target, template, parameters):
        self.log.info('%s called in MockSphere plugin' % (inspect.stack()[1][3]))
        builder.provider_image.identifier_on_provider = str(uuid.uuid4())
        builder.provider_image.provider_account_identifier = 'mock_user'

    def builder_should_create_target_image(self, builder, target, image_id, template, parameters):
        self.log.info('%s called in MockSphere plugin' % (inspect.stack()[1][3]))
        return True

    def builder_will_create_target_image(self, builder, target, image_id, template, parameters):
        self.log.info('%s called in MockSphere plugin' % (inspect.stack()[1][3]))

    def builder_did_create_target_image(self, builder, target, image_id, template, parameters):
        self.log.info('%s called in MockSphere plugin' % (inspect.stack()[1][3]))

    def delete_from_provider(self, builder, provider, credentials, target, parameters):
        self.log.info('%s called in MockSphere plugin' % (inspect.stack()[1][3]))
{'fraction_non_alphanumeric': 0.10794807560920064, 'fraction_numerical': 0.01002049647005238, 'mean_word_length': 4.35609756097561, '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': '1206251', 'n_tokens_mistral': 1260, 'n_tokens_neox': 1237, 'n_words': 390}