code: def bads_report(bads, path_prefix=None):
      
      path_processor = ((lambda x : x) if path_prefix is None
                        else get_rp_stripper(path_prefix))
      reports = []
      for result in bads:
          if len(result) == 3:
              depended_lib, depending_lib, missing_archs = result
              reports.append("{0} needs {1} {2} missing from {3}".format(
                  path_processor(depending_lib),
                  'archs' if len(missing_archs) > 1 else 'arch',
                  ', '.join(sorted(missing_archs)),
                  path_processor(depended_lib)))
          elif len(result) == 2:
              depending_lib, missing_archs = result
              reports.append("Required {0} {1} missing from {2}".format(
                  'archs' if len(missing_archs) > 1 else 'arch',
                  ', '.join(sorted(missing_archs)),
                  path_processor(depending_lib)))
          else:
              raise ValueError('Report tuple should be length 2 or 3')
      return '\n'.join(sorted(reports))
docs: Return a nice report of bad architectures in `bads`
  
      Parameters
      ----------
      bads : set
          set of length 2 or 3 tuples. A length 2 tuple is of form
          ``(depending_lib, missing_archs)`` meaning that an arch in
          `require_archs` was missing from ``depending_lib``.  A length 3 tuple
          is of form ``(depended_lib, depending_lib, missing_archs)`` where
          ``depended_lib`` is the filename of the library depended on,
          ``depending_lib`` is the library depending on ``depending_lib`` and
          ``missing_archs`` is a set of missing architecture strings giving
          architectures present in ``depending_lib`` and missing in
          ``depended_lib``.  An empty set means all architectures were present as
          required.
      path_prefix : None or str, optional
          Path prefix to strip from ``depended_lib`` and ``depending_lib``. None
          means do not strip anything.
  
      Returns
      -------
      report : str
          A nice report for printing