code: def ffd(items, targets, **kwargs):
      sizes = zip(items, weight(items, **kwargs))
      sizes = sorted(sizes, key=operator.itemgetter(1), reverse=True)
      items = map(operator.itemgetter(0), sizes)
      return ff(items, targets)