<commit_before>
# forward declaration only.  redefined below.
def pygration_step_subclass(cls):
    pass


class StepType(type):
    steps = []

    def __init__(cls, name, bases, cls_dict):
        super(StepType, cls).__init__(name, bases, cls_dict)
        if not pygration_step_subclass(cls):
            return
        StepType.steps.append(cls)

    @staticmethod
    def extract_steps():
        extract = StepType.steps
        StepType.steps = []
        return extract


class Step(object):
    """A single logical change to the database.

    The Step is composed of multiple Phases to make changes prior to and
    subsequent to the application deployment.
    """

    __metaclass__ = StepType

    def __init__( self ):
        self._failure = False

    def pre_add_check( self, db ):
        """Validate the DB is in the expected state prior to the add."""
        # p = PreAddCheckPygrationDB(db)
        # self.add(p)
        # do nothing for now.  get actual behavior right first.
        pass

    def post_add_check( self, db ):
        """Validate the DB is in the expected state after the add."""
        pass

    def add( self, db ):
        """Add elements to the db"""
        pass

    def drop( self, db ):
        """Hide elements in the db before dropping them"""
        pass

    def commit_drop( self, db ):
        """Permanently drop elements from the db"""
        p = CommitPygrationDB(db)
        self.drop(p)

    def rollback_add( self, db ):
        """Rollback any items that were added to the db"""
        p = RollbackPygrationDB(db)
        self.add(p)

    def rollback_drop( self, db ):
        """Rollback any items that were hidden in the db"""
        p = RollbackPygrationDB(db)
        self.add(p)<commit_msg>removed unimplemented Commit & Rollback DBs<commit_after>
# forward declaration only.  redefined below.
def pygration_step_subclass(cls):
    pass


class StepType(type):
    steps = []

    def __init__(cls, name, bases, cls_dict):
        super(StepType, cls).__init__(name, bases, cls_dict)
        if not pygration_step_subclass(cls):
            return
        StepType.steps.append(cls)

    @staticmethod
    def extract_steps():
        extract = StepType.steps
        StepType.steps = []
        return extract


class Step(object):
    """A single logical change to the database.

    The Step is composed of multiple Phases to make changes prior to and
    subsequent to the application deployment.
    """

    __metaclass__ = StepType

    def __init__( self ):
        self._failure = False

    def pre_add_check( self, db ):
        """Validate the DB is in the expected state prior to the add."""
        # p = PreAddCheckPygrationDB(db)
        # self.add(p)
        # do nothing for now.  get actual behavior right first.
        return True

    def post_add_check( self, db ):
        """Validate the DB is in the expected state after the add."""
        return True

    def add( self, db ):
        """Add elements to the db"""
        pass

    def drop( self, db ):
        """Hide elements in the db before dropping them"""
        pass

    def commit_drop( self, db ):
        """Permanently drop elements from the db"""
        pass

    def rollback_add( self, db ):
        """Rollback any items that were added to the db"""
        pass

    def rollback_drop( self, db ):
        """Rollback any items that were hidden in the db"""
        pass
{'fraction_non_alphanumeric': 0.09040697674418605, 'fraction_numerical': 0.0, 'mean_word_length': 2.2709125475285172, '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': '6391473', 'n_tokens_mistral': 985, 'n_tokens_neox': 967, 'n_words': 361}