<commit_before>all = [
    'TwoFileReaderBase',
    'ubcMeshReaderBase',
]

from .. import _helpers

# Outside Imports:
from ..base import PVGeoAlgorithmBase
import numpy as np


# Two File Reader Base
class TwoFileReaderBase(PVGeoAlgorithmBase):
    def __init__(self, nOutputPorts=1, outputType='vtkUnstructuredGrid'):
        PVGeoAlgorithmBase.__init__(self,
            nInputPorts=0,
            nOutputPorts=nOutputPorts, outputType=outputType)
        self.__dt = 1.0
        self.__timesteps = None
        self.__meshFileName = None # Can only be one!
        self.__modelFileNames = [] # Can be many (single attribute, manytimesteps)


    def _GetTimeSteps(self):
        return self.__timesteps.tolist() if self.__timesteps is not None else None

    def _UpdateTimeSteps(self):
        """for internal use only"""
        if len(self.__modelFileNames) < 1:
            return -1
        self.__timesteps = _helpers.UpdateTimesteps(self, self.__modelFileNames, self.__dt)
        return 1

    def RequestInformation(self, request, inInfo, outInfo):
        self._UpdateTimeSteps()
        return 1


    #### Seters and Geters ####


    @staticmethod
    def HasModels(modelfiles):
        if isinstance(modelfiles, list):
            return len(modelfiles) > 0
        return modelfiles is not None

    def ThisHasModels(self):
        return TwoFileReaderBase.HasModels(self.__modelFileNames)

    def GetTimestepValues(self):
        """Use this in ParaView decorator to register timesteps"""
        return self._GetTimeSteps()

    def SetTimeDelta(self, dt):
        """An advanced property for the time step in seconds."""
        if dt != self.__dt:
            self.__dt = dt
            self.Modified()

    def ClearMeshFileName(self):
        """Use to clear mesh file name"""
        self.__meshFileName = None

    def ClearModelFileNames(self):
        """Use to clear data file names"""
        self.__modelFileNames = []
<commit_msg>Modified fix<commit_after>all = [
    'TwoFileReaderBase',
    'ubcMeshReaderBase',
]

from .. import _helpers
from ..base import PVGeoAlgorithmBase
# Outside Imports:
import numpy as np


# Two File Reader Base
class TwoFileReaderBase(PVGeoAlgorithmBase):
    def __init__(self, nOutputPorts=1, outputType='vtkUnstructuredGrid'):
        PVGeoAlgorithmBase.__init__(self,
            nInputPorts=0,
            nOutputPorts=nOutputPorts, outputType=outputType)
        self.__dt = 1.0
        self.__timesteps = None
        self.__meshFileName = None # Can only be one!
        self.__modelFileNames = [] # Can be many (single attribute, manytimesteps)
        self.__needToRead = True


    def _GetTimeSteps(self):
        return self.__timesteps.tolist() if self.__timesteps is not None else None

    def _UpdateTimeSteps(self):
        """for internal use only"""
        if len(self.__modelFileNames) < 1:
            return -1
        self.__timesteps = _helpers.UpdateTimesteps(self, self.__modelFileNames, self.__dt)
        return 1

    def Modified(self, readAgain=True):
        """Call modified if the files needs to be read again again"""
        self.__needToRead = readAgain
        PVGeoAlgorithmBase.Modified(self)

    def RequestInformation(self, request, inInfo, outInfo):
        self._UpdateTimeSteps()
        return 1


    #### Seters and Geters ####


    @staticmethod
    def HasModels(modelfiles):
        if isinstance(modelfiles, list):
            return len(modelfiles) > 0
        return modelfiles is not None

    def ThisHasModels(self):
        return TwoFileReaderBase.HasModels(self.__modelFileNames)

    def GetTimestepValues(self):
        """Use this in ParaView decorator to register timesteps"""
        return self._GetTimeSteps()

    def SetTimeDelta(self, dt):
        """An advanced property for the time step in seconds."""
        if dt != self.__dt:
            self.__dt = dt
            self.Modified(readAgain=False)

    def ClearMeshFileName(self):
        """Use to clear mesh file name"""
        self.__meshFileName = None

    def ClearModelFileNames(self):
        """Use to clear data file names"""
        self.__modelFileNames = []

{'fraction_non_alphanumeric': 0.09090909090909091, 'fraction_numerical': 0.004317582153993763, 'mean_word_length': 2.690265486725664, 'pattern_counts': {'":': 0, '<': 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': '209420', 'n_tokens_mistral': 1218, 'n_tokens_neox': 1169, 'n_words': 326}