<commit_before>#coding: utf8

class Token(object):
    
    def __init__(self, content):
        self.content = content
        self.tp = self.__class__.__name__
#         print (self)

    def compile(self, writer):
        pass
    
    def render(self, buff):
        pass
    
    def __str__(self):
        return 'Node[type=%s; name=%s]' % (self.tp, self.content) 
    

class TextToken(Token):
    """ Text Token
    """
    def compile(self, writer):
        writer.write_line("'''%s'''" % self.content)
        

class CommentToken(Token):
    
    def render(self, **kwargs):
        return ''


class ExpressionToken(Token):
    
    def compile(self, writer):
        writer.write_line("str(%s)" % self.content)
        

class IfExpressionToken(Token):

    def compile(self, writer):
        writer.write_line("%s:" % self.content, True)
        writer.backward_indent()


class ElifExpressionToken(Token):

    def compile(self, writer):
        writer.forward_indent()
        writer.write_line("%s:" % self.content, True)
        writer.backward_indent()

        
class ElseExpressionToken(Token):

    def compile(self, writer):
        writer.forward_indent()
        writer.write_line("%s:" % self.content, True)
        writer.backward_indent()

    
class EndExpressionToken(Token):

    def compile(self, writer):
        writer.forward_indent()<commit_msg>remove the codes which will not to be used<commit_after>#coding: utf8

class Token(object):
    
    def __init__(self, content):
        self.content = content
        self.tp = self.__class__.__name__
#         print (self)

    def compile(self, writer):
        pass
    
    def __str__(self):
        return 'Node[type=%s; name=%s]' % (self.tp, self.content) 
    

class TextToken(Token):
    """ Text Token
    """
    def compile(self, writer):
        writer.write_line("'''%s'''" % self.content)
        

class CommentToken(Token):
    pass
    

class ExpressionToken(Token):
    
    def compile(self, writer):
        writer.write_line("str(%s)" % self.content)
        

class IfExpressionToken(Token):

    def compile(self, writer):
        writer.write_line("%s:" % self.content, True)
        writer.backward_indent()


class ElifExpressionToken(Token):

    def compile(self, writer):
        writer.forward_indent()
        writer.write_line("%s:" % self.content, True)
        writer.backward_indent()

        
class ElseExpressionToken(Token):

    def compile(self, writer):
        writer.forward_indent()
        writer.write_line("%s:" % self.content, True)
        writer.backward_indent()


class EndExpressionToken(Token):

    def compile(self, writer):
        writer.forward_indent()
{'fraction_non_alphanumeric': 0.1274546128195628, 'fraction_numerical': 0.0007410151908114116, 'mean_word_length': 2.576158940397351, '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': '2669315', 'n_tokens_mistral': 818, 'n_tokens_neox': 792, 'n_words': 170}