code: def _load_file(self, filename):
          
          filename = os.path.abspath(os.path.expanduser(filename))
          # check file exists
          if not os.path.isfile(filename):
              raise Exception('%s does not exist' % filename)
  
          # Check file extention
          if '.vtu' in filename:
              reader = vtk.vtkXMLUnstructuredGridReader()
          elif '.vtk' in filename:
              reader = vtk.vtkUnstructuredGridReader()
          else:
              raise Exception('Extension should be either ".vtu" or ".vtk"')
  
          # load file to self
          reader.SetFileName(filename)
          reader.Update()
          grid = reader.GetOutput()
          self.ShallowCopy(grid)
docs: Load an unstructured grid from a file.
  
          The file extension will select the type of reader to use.  A .vtk
          extension will use the legacy reader, while .vtu will select the VTK
          XML reader.
  
          Parameters
          ----------
          filename : str
              Filename of grid to be loaded.