code: def sort_run(run):
          
          # Sort errors first, then by name. Also show errors that were manually
          # approved, so the paging sort order stays the same even after users
          # approve a diff on the run page.
          if run.status in models.Run.DIFF_NEEDED_STATES:
              return (0, run.name)
          return (1, run.name)
docs: Sort function for runs within a release.