<commit_before>class Node:
    def __init__(self):
        self.value = None
        self.left = None
        self.right = None

class BinaryTree:
    def __init__(self):
        self.__root = None
        self.__value_found = None

    def __insert(self,value, tree):
            if value < tree.value:
                if tree.left is None:
                    tree.left = Node()
                    tree.left.value = value
                else:
                    self.__insert(value,tree.left)
            if value >= tree.value:
                if tree.right is None:
                    tree.right = Node()
                    tree.right.value = value
                else:
                    self.__insert(value,tree.right)


    def insert(self, value):
        if self.__root is None:
            self.__root = Node()
            self.__root.value = value
        else:
            self.__insert(value,self.__root)


    def __bfs(self,value,tree):
        queue = []
        leaf = Node()
        queue.append(tree)

        while (queue != []):
            leaf = queue.pop(0)
            if leaf.value == value:
                self.__value_found = True
                return

            if leaf.left != None:
                queue.append(leaf.left)
            if leaf.right != None:
                queue.append(leaf.right)

        return

    def bfs(self, value):
        if self.__root.value == value:
            return True
        else:
            self.__value_found = False
            self.__bfs(value, self.__root)
            return self.__value_found

    def __show(self, tree):
        leaf = Node()
        queue = []
        queue.append(tree)

        while(queue != []):
            leaf = queue.pop(0)
            print leaf.value
            
            if leaf.left is not None:
                queue.append(leaf.left)
            if leaf.right is not None:
                queue.append(leaf.right)

    def show(self):
        self.__show(self.__root)

    def __dfs(self,value,tree, found = False):
        if self.__value_found == True:
            return
        if tree == None:
            return
        if tree.value == value:
            self.__value_found = True
            return
        else:
            self.__dfs(value,tree.left)
            self.__dfs(value,tree.right)
        return

    def dfs(self, value):
        if self.__root.value == value:
            return True
        else:
            self.__value_found = False
            self.__dfs(value, self.__root)
            return self.__value_found
        

def main():
    A = BinaryTree()
    A.insert(4)
    A.insert(5)
    A.insert(3)
    A.insert(6)
    A.insert(2)
    A.show()
    print A.bfs(9)

if __name__ == "__main__":
    main()<commit_msg>Added a few more test cases to bfs and dfs methods<commit_after>class Node:
    def __init__(self):
        self.value = None
        self.left = None
        self.right = None

class BinaryTree:
    def __init__(self):
        self.__root = None
        self.__value_found = None

    def __insert(self,value, tree):
            if value < tree.value:
                if tree.left is None:
                    tree.left = Node()
                    tree.left.value = value
                else:
                    self.__insert(value,tree.left)
            if value >= tree.value:
                if tree.right is None:
                    tree.right = Node()
                    tree.right.value = value
                else:
                    self.__insert(value,tree.right)


    def insert(self, value):
        if self.__root is None:
            self.__root = Node()
            self.__root.value = value
        else:
            self.__insert(value,self.__root)


    def __bfs(self,value,tree):
        queue = []
        leaf = Node()
        queue.append(tree)

        while (queue != []):
            leaf = queue.pop(0)
            if leaf.value == value:
                self.__value_found = True
                return

            if leaf.left != None:
                queue.append(leaf.left)
            if leaf.right != None:
                queue.append(leaf.right)

        return

    def bfs(self, value):
        if self.__root.value == value:
            return True
        else:
            self.__value_found = False
            self.__bfs(value, self.__root)
            return self.__value_found

    def __show(self, tree):
        leaf = Node()
        queue = []
        queue.append(tree)

        while(queue != []):
            leaf = queue.pop(0)
            print leaf.value
            
            if leaf.left is not None:
                queue.append(leaf.left)
            if leaf.right is not None:
                queue.append(leaf.right)

    def show(self):
        self.__show(self.__root)

    def __dfs(self,value,tree, found = False):
        if self.__value_found == True:
            return
        if tree == None:
            return
        if tree.value == value:
            self.__value_found = True
            return
        else:
            self.__dfs(value,tree.left)
            self.__dfs(value,tree.right)
        return

    def dfs(self, value):
        if self.__root.value == value:
            return True
        else:
            self.__value_found = False
            self.__dfs(value, self.__root)
            return self.__value_found
        

def main():
    A = BinaryTree()
    A.insert(4)
    A.insert(5)
    A.insert(3)
    A.insert(6)
    A.insert(2)
    A.show()
    print A.bfs(9)
    print A.bfs(3)
    print A.dfs(3)
    print A.dfs(7)

if __name__ == "__main__":
    main()
{'fraction_non_alphanumeric': 0.09882895670688431, 'fraction_numerical': 0.003371185237757275, 'mean_word_length': 1.2840356564019448, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, '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': '1246196', 'n_tokens_mistral': 1621, 'n_tokens_neox': 1558, 'n_words': 375}