<commit_before># -*- coding:utf-8 -*-
"""
=====================================================================
Provide energy-related file class which do operations on these files.
=====================================================================
Written by PytLab <<EMAIL>>, August 2015
Updated by PytLab <<EMAIL>>, August 2015
==============================================================

"""
import re

import numpy as np
import matplotlib.pyplot as plt

from vaspy import VasPy


class OsziCar(VasPy):
    def __init__(self, filename='OSZICAR'):
        """
        Create a OSZICAR file class.

        Example:

        >>> a = OsziCar(filename='OSZICAR')

        Class attributes descriptions
        =======================================================================
          Attribute      Description
          ============  =======================================================
          filename       string, name of the file the direct coordiante data
                         stored in
          vars           list of strings, 每次迭代得到的数据
          esort()        method, 对数据进行排序
          plot()         method, 对数据绘图
          ============  =======================================================
        """
        VasPy.__init__(self, filename)

        #set regex patterns
        float_regex = r'[\+|-]?\d*\.\d*(?:[e|E][\+|-]?\d+)?'
        eq_regex = r'\s*([\w|\d|\s]+)\=\s*(' + float_regex + r')\s*'
        split_regex = r'^\s*(\d+)\s*((' + eq_regex + r')+)$'  # 将step和其余部分分开

        self.eq_regex = re.compile(eq_regex)
        self.split_regex = re.compile(split_regex)

        self.load()

    def __repr__(self):
        return self.content

    def __str__(self):
        return self.__repr__()

    def match(self, line):<commit_msg>remove custom __repr__ & __str__ method<commit_after># -*- coding:utf-8 -*-
"""
=====================================================================
Provide energy-related file class which do operations on these files.
=====================================================================
Written by PytLab <<EMAIL>>, August 2015
Updated by PytLab <<EMAIL>>, August 2015
==============================================================

"""
import re

import numpy as np
import matplotlib.pyplot as plt

from vaspy import VasPy


class OsziCar(VasPy):
    def __init__(self, filename='OSZICAR'):
        """
        Create a OSZICAR file class.

        Example:

        >>> a = OsziCar(filename='OSZICAR')

        Class attributes descriptions
        =======================================================================
          Attribute      Description
          ============  =======================================================
          filename       string, name of the file the direct coordiante data
                         stored in
          vars           list of strings, 每次迭代得到的数据
          esort()        method, 对数据进行排序
          plot()         method, 对数据绘图
          ============  =======================================================
        """
        VasPy.__init__(self, filename)

        #set regex patterns
        float_regex = r'[\+|-]?\d*\.\d*(?:[e|E][\+|-]?\d+)?'
        eq_regex = r'\s*([\w|\d|\s]+)\=\s*(' + float_regex + r')\s*'
        split_regex = r'^\s*(\d+)\s*((' + eq_regex + r')+)$'  # 将step和其余部分分开

        self.eq_regex = re.compile(eq_regex)
        self.split_regex = re.compile(split_regex)

        self.load()

    def match(self, line):
{'fraction_non_alphanumeric': 0.3341954022988506, 'fraction_numerical': 0.005172413793103448, 'mean_word_length': 2.808533916849015, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, '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': '1150325', 'n_tokens_mistral': 989, 'n_tokens_neox': 898, 'n_words': 217}