docs: def selectImports(pth, xtrapath=None):
      """
      Return the dependencies of a binary that should be included.
  
      Return a list of pairs (name, fullpath)
      """
      rv = []
      if xtrapath is None:
          xtrapath = [os.path.dirname(pth)]
      else:
          assert isinstance(xtrapath, list)
          xtrapath = [os.path.dirname(pth)] + xtrapath  # make a copy
      dlls = getImports(pth)
      for lib in dlls:
          if seen.get(lib.upper(), 0):
              continue
          if not is_win and not is_cygwin:
              # all other platforms
              npth = lib
              dir, lib = os.path.split(lib)
          else:
              # plain win case
              npth = getfullnameof(lib, xtrapath)
  
          # now npth is a candidate lib if found
          # check again for excludes but with regex FIXME: split the list
          if npth:
              candidatelib = npth
          else:
              candidatelib = lib
  
          if not dylib.include_library(candidatelib):
              if (candidatelib.find('libpython') < 0 and
                 candidatelib.find('Python.framework') < 0):
                  # skip libs not containing (libpython or Python.framework)
                  if not seen.get(npth.upper(), 0):
                      logger.debug("Skipping %s dependency of %s",
                                   lib, os.path.basename(pth))
                  continue
              else:
                  pass
  
          if npth:
              if not seen.get(npth.upper(), 0):
                  logger.debug("Adding %s dependency of %s",
                               lib, os.path.basename(pth))
                  rv.append((lib, npth))
          else:
              logger.error("lib not found: %s dependency of %s", lib, pth)
  
      return rv