<commit_before>import yaml
import ConfigParser
import os
from pymclevel import schematic

class BO3:
    
    def __init__(self,filename=''):
        if filename != '':
            pass
        pass
def parse_bo3(bo3_file):
    pass

def save_bo3(bo3_file):
    pass

class BO2:
    _parser = ConfigParser.RawConfigParser()
    
    def __init__(self, filename=''):
        self.__meta = {}
        self.__blocks = {}
        # [0] is lowest point, [1] is highest point, [2] is the amount to shift by
        self._vertical_tracker = [0,0,0]
        self._horizontal_tracker_1 = [0,0,0]
        '''
        for slot in range(0,3):
            self._horizontal_tracker[slot] = 0
            self._vertical_tracker[slot] = 0
        '''
        if filename != '':
            self.__schem = schematic.MCSchematic(shape=(0,0,0))
            self._parser.read(filename)
            self.__version = self._parser.get('META', 'version')
            for item in self._parser.items("META"):
                self.__meta[item[0]] = item[1]
                
            for block in self._parser.items("DATA"):
                
                if int(block[0].split(",")[2]) < self._vertical_tracker[0]:
                    self._vertical_tracker[0] = int(block[0].split(",")[2])
                if int(block[0].split(",")[2]) > self._vertical_tracker[1]:
                    self._vertical_tracker[1] = int(block[0].split(",")[2])
                    
                    
                if int(block[0].split(",")[0]) < self._horizontal_tracker_1[0]:
                    self._horizontal_tracker_1[0] = int(block[0].split(",")[0])
                if int(block[0].split(",")[0]) > self._horizontal_tracker_1[1]:
                    self._horizontal_tracker_1[1] = int(block[0].split(",")[0])
                    
            if self._vertical_tracker[0] < 0:
                self._vertical_tracker[2] = abs(self._vertical_tracker[0])
                self._vertical_tracker[1] += abs(self._vertical_tracker[0])
                #self._vertical_tracker[0] = 0
                
            if self._horizontal_tracker_1[0] < 0:
                self._horizontal_tracker_1[2] = abs(self._horizontal_tracker_1[0])
                self._horizontal_tracker_1[1] += abs(self._horizontal_tracker_1[0])
                
                
                
            print "==== Vertical ===="
            print "Lowest: "+str(self._vertical_tracker[0])
            print "Highest: "+str(self._vertical_tracker[1])
            print "Shift: "+str(self._vertical_tracker[2])
            print "==== Horizontal X ===="
            print "Lowest: "+str(self._horizontal_tracker_1[0])
            print "Highest: "+str(self._horizontal_tracker_1[1])
            print "Shift: "+str(self._horizontal_tracker_1[2])
            self.__schem.height = self._vertical_tracker[1]
            '''
            for block in self._parser.items("DATA"):
                #self.__blocks[block[0]] = block[1]
                coords = block[0].split(",")
                x = int(coords[0])
                y = int(coords[1])
                z = int(coords[2])
                print x,y,z
                self.__schem.Blocks[x,y,z] = block[1]
                self.__schem._update_shape()
            print self.__schem.Blocks
            self.__schem.saveToFile(filename="test_bo2.schematic")
                
            # Format is Y,X,Z where 'Z' is elevation. WHO DECIDED THAT?!?
            print self.__blocks
            '''
        pass
    
    @property
    def meta(self):
        return self.__meta
    
    @property<commit_msg>The schematic object now is reshaped into the dimensions found by shifting the coordinates<commit_after>import yaml
import ConfigParser
import os
from pymclevel import schematic

class BO3:
    
    def __init__(self,filename=''):
        if filename != '':
            pass
        pass
def parse_bo3(bo3_file):
    pass

def save_bo3(bo3_file):
    pass

class BO2:
    _parser = ConfigParser.RawConfigParser()
    
    def __init__(self, filename=''):
        self.__meta = {}
        self.__blocks = {}
        # [0] is lowest point, [1] is highest point, [2] is the amount to shift by
        self._vertical_tracker = [0,0,0]
        self._horizontal_tracker_1 = [0,0,0]
        '''
        for slot in range(0,3):
            self._horizontal_tracker[slot] = 0
            self._vertical_tracker[slot] = 0
        '''
        if filename != '':
            self._parser.read(filename)
            self.__version = self._parser.get('META', 'version')
            for item in self._parser.items("META"):
                self.__meta[item[0]] = item[1]
                
            for block in self._parser.items("DATA"):
                
                if int(block[0].split(",")[2]) < self._vertical_tracker[0]:
                    self._vertical_tracker[0] = int(block[0].split(",")[2])
                if int(block[0].split(",")[2]) > self._vertical_tracker[1]:
                    self._vertical_tracker[1] = int(block[0].split(",")[2])
                    
                    
                if int(block[0].split(",")[0]) < self._horizontal_tracker_1[0]:
                    self._horizontal_tracker_1[0] = int(block[0].split(",")[0])
                if int(block[0].split(",")[0]) > self._horizontal_tracker_1[1]:
                    self._horizontal_tracker_1[1] = int(block[0].split(",")[0])
                    
            if self._vertical_tracker[0] < 0:
                self._vertical_tracker[2] = abs(self._vertical_tracker[0])
                self._vertical_tracker[1] += abs(self._vertical_tracker[0])
                #self._vertical_tracker[0] = 0
                
            if self._horizontal_tracker_1[0] < 0:
                self._horizontal_tracker_1[2] = abs(self._horizontal_tracker_1[0])
                self._horizontal_tracker_1[1] += abs(self._horizontal_tracker_1[0])
                
                
                
            print "==== Vertical ===="
            print "Lowest: "+str(self._vertical_tracker[0])
            print "Highest: "+str(self._vertical_tracker[1])
            print "Shift: "+str(self._vertical_tracker[2])
            print "==== Horizontal X ===="
            print "Lowest: "+str(self._horizontal_tracker_1[0])
            print "Highest: "+str(self._horizontal_tracker_1[1])
            print "Shift: "+str(self._horizontal_tracker_1[2])
            #self.__schem.height = self._vertical_tracker[1]
            #self.__schem.length = self._horizontal_tracker_1[1]
            #self.__schem.Height = self._vertical_tracker[1]
            #self.__schem.Length = self._horizontal_tracker_1[1]
            #self.__schem._update_shape()
            self.__schem = schematic.MCSchematic(shape=(self._horizontal_tracker_1[1], self._vertical_tracker[1], 0))
            print self.__schem
            
        pass
    
    @property
    def meta(self):
        return self.__meta
    
    @property
{'fraction_non_alphanumeric': 0.13255780554358754, 'fraction_numerical': 0.025563693810139308, 'mean_word_length': 1.8240064882400648, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, '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': '881339', 'n_tokens_mistral': 2135, 'n_tokens_neox': 2059, 'n_words': 349}