def _create_model(data):
 model = base.BaseCompletionModel()
 for catdata in data:
  cat = model.new_category('')
  for itemdata in catdata:
   model.new_item(cat, *itemdata)
 return model

def _create_model ( data ) : model = base . BaseCompletionModel ( ) for catdata in data : cat = model . new_category ( '' ) for itemdata in catdata : model . new_item ( cat , * itemdata ) return model
create a completion model populated with the given data .