text: import autofit as af
  import autolens as al
  from test_autolens.integration.tests.interferometer import runner
  
  test_type = "lens__source_inversion"
  test_name = "lens_mass__source_adaptive_magnification__offset_centre"
  data_type = "lens_sie__source_smooth__offset_centre"
  data_resolution = "sma"
  
  
  def make_pipeline(
      name,
      phase_folders,
      real_space_shape_2d=(100, 100),
      real_space_pixel_scales=(0.1, 0.1),
      optimizer_class=af.MultiNest,
  ):
      class SourcePix(al.PhaseInterferometer):
          def customize_priors(self, results):
  
              self.galaxies.lens.mass.centre.centre_0 = 2.0
              self.galaxies.lens.mass.centre.centre_1 = 2.0
              self.galaxies.lens.mass.einstein_radius = 1.2
  
      phase1 = SourcePix(
          phase_name="phase_1",
          phase_folders=phase_folders,
          galaxies=dict(
              lens=al.GalaxyModel(redshift=0.5, mass=al.mp.EllipticalIsothermal),
              source=al.GalaxyModel(
                  redshift=1.0,
                  pixelization=al.pix.VoronoiMagnification,
                  regularization=al.reg.Constant,
              ),
          ),
          real_space_shape_2d=real_space_shape_2d,
          real_space_pixel_scales=real_space_pixel_scales,
          optimizer_class=optimizer_class,
      )
  
      phase1.optimizer.const_efficiency_mode = True
      phase1.optimizer.n_live_points = 60
      phase1.optimizer.sampling_efficiency = 0.8
  
      phase1 = phase1.extend_with_inversion_phase()
  
      phase2 = al.PhaseInterferometer(
          phase_name="phase_2",
          phase_folders=phase_folders,
          galaxies=dict(
              lens=al.GalaxyModel(
                  redshift=0.5, mass=phase1.result.model.galaxies.lens.mass
              ),
              source=al.GalaxyModel(
                  redshift=1.0,
                  pixelization=phase1.result.inversion.instance.galaxies.source.pixelization,
                  regularization=phase1.result.inversion.instance.galaxies.source.regularization,
              ),
          ),
          real_space_shape_2d=real_space_shape_2d,
          real_space_pixel_scales=real_space_pixel_scales,
          optimizer_class=optimizer_class,
      )
  
      phase2.optimizer.const_efficiency_mode = True
      phase2.optimizer.n_live_points = 60
      phase2.optimizer.sampling_efficiency = 0.8
  
      phase2 = phase2.extend_with_inversion_phase()
  
      return al.PipelineDataset(name, phase1, phase2)
  
  
  if __name__ == "__main__":
      import sys
  
      runner.run(sys.modules[__name__])
  