(self)
Run instance logic.
Run instance logic.
Run instance logic .
def run(self):
        """
        Run instance logic.
        """
        success_flag = os.path.join(self.root, '_SUCCESS')
        if os.path.isfile(success_flag):
            return

        self.instance()

        # mark experiment as finished.
        Path(success_flag).touch()

        if self.freeze_when_done:
            # make experiment directory and its content read-only.
            for root, dirs, files in os.walk(self.root):
                os.chmod(root, 0o555)
                for directory in dirs:
                    os.chmod(os.path.join(root, directory), 0o555)
                for file in files:
                    os.chmod(os.path.join(root, file), 0o444)
def run ( self ) : success_flag = os . path . join ( self . root , '_SUCCESS' ) if os . path . isfile ( success_flag ) : return self . instance ( ) # mark experiment as finished. Path ( success_flag ) . touch ( ) if self . freeze_when_done : # make experiment directory and its content read-only. for root , dirs , files in os . walk ( self . root ) : os . chmod ( root , 0o555 ) for directory in dirs : os . chmod ( os . path . join ( root , directory ) , 0o555 ) for file in files : os . chmod ( os . path . join ( root , file ) , 0o444 )