old_contents: from nose.tools import assert_equal
  from distributions.models import dd_py, dd_cy, dd_cc
  
  
  VERSIONS = [dd_py, dd_cy, dd_cc]
  MODELS = [v.Model for v in VERSIONS]
  
  
  def test_methods_run():
      alphas = [0.2, 0.5, 1.0, 2.0]
      dim = len(alphas)
      data = [3, 2, 3, 1, 3, 2, 3, 0, 3, 2, 3, 1]
  
      raw_model = {'alphas': alphas}
      models = []
      for Model in MODELS:
          model = Model()
          model.load(raw_model)
          Model.load_model(raw_model)
          models.append(model)
  
      raw_group = {'counts': [0] * dim}
      for model in models:
          group = model.Group()
          group.load(raw_group)
          group2 = model.load_group(raw_group)
  
          model.group_init(group)
          for value in data:
              model.group_add_value(group, value)
          model.sample_value(group)
          model.score_group(group)
          for value in data:
              model.score_value(group, value)
          model.group_merge(group2, group)
          assert_equal(group2.dump(), group.dump())
          for value in data:
              model.group_remove_value(group, value)
  
          model.dump_group(group)
          model.dump()
  
new_contents: from nose.tools import assert_equal
  from distributions.models import dd_py, dd_cy, dd_cc
  
  
  VERSIONS = [dd_py, dd_cy, dd_cc]
  MODELS = [v.Model for v in VERSIONS]
  
  
  def test_methods_run():
      EXAMPLE = MODELS[0].EXAMPLE
      raw_model = EXAMPLE['model']
      values = EXAMPLE['values']
  
      models = [Model.load_model(raw_model) for Model in MODELS]
  
      for model in models:
          group1 = model.Group()
          group2 = model.Group()
          model.group_init(group1)
          model.group_init(group2)
  
          for value in values:
              model.group_add_value(group1, value)
          model.group_merge(group2, group1)
          assert_equal(group1.dump(), group2.dump())
  
subject: Simplify test_dd.py