code: def _compute_dependency_order(skills):
          
          # Key skills by first dependency. Dependency sets can be uniquely
          # identified by one dependency in the set.
          dependency_to_skill = MultiDict([(skill['dependencies_name'][0]
                                            if skill['dependencies_name']
                                            else '',
                                            skill)
                                           for skill in skills])
  
          # Start with the first skill and trace the dependency graph through
          # skill, setting the order it was learned in.
          index = 0
          previous_skill = ''
          while True:
              for skill in dependency_to_skill.getlist(previous_skill):
                  skill['dependency_order'] = index
              index += 1
  
              # Figure out the canonical dependency for the next set of skills.
              skill_names = set([skill['name']
                                 for skill in
                                 dependency_to_skill.getlist(previous_skill)])
              canonical_dependency = skill_names.intersection(
                  set(dependency_to_skill.keys()))
              if canonical_dependency:
                  previous_skill = canonical_dependency.pop()
              else:
                  # Nothing depends on these skills, so we're done.
                  break
  
          return skills
docs: Add a field to each skill indicating the order it was learned
          based on the skill's dependencies. Multiple skills will have the same
          position if they have the same dependencies.