docs: def classical_split_filter(srcs, srcfilter, gsims, params, monitor):
      """
      Split the given sources, filter the subsources and the compute the
      PoEs. Yield back subtasks if the split sources contain more than
      maxweight ruptures.
      """
      # first check if we are sampling the sources
      ss = int(os.environ.get('OQ_SAMPLE_SOURCES', 0))
      if ss:
          splits, stime = split_sources(srcs)
          srcs = readinput.random_filtered_sources(splits, srcfilter, ss)
          yield classical(srcs, srcfilter, gsims, params, monitor)
          return
      sources = []
      with monitor("filtering/splitting sources"):
          for src, _sites in srcfilter(srcs):
              if src.num_ruptures >= params['maxweight']:
                  splits, stime = split_sources([src])
                  sources.extend(srcfilter.filter(splits))
              else:
                  sources.append(src)
          blocks = list(block_splitter(sources, params['maxweight'],
                                       operator.attrgetter('num_ruptures')))
      if blocks:
          # yield the first blocks (if any) and compute the last block in core
          # NB: the last block is usually the smallest one
          for block in blocks[:-1]:
              yield classical, block, srcfilter, gsims, params
          yield classical(blocks[-1], srcfilter, gsims, params, monitor)