def _getniters(self, filename):
        """Convenience function to get the number of iterations in the file.

        If `niterations` hasn't been written to the file yet, just returns 0.
        """
        with self.sampler.io(filename, 'r') as fp:
            try:
                niters = fp.niterations
            except KeyError:
                niters = 0
        return niters
def _getniters ( self , filename ) : with self . sampler . io ( filename , 'r' ) as fp : try : niters = fp . niterations except KeyError : niters = 0 return niters
Convenience function to get the number of iterations in the file.

        If `niterations` hasn't been written to the file yet, just returns 0.