def next_job(self) -> CIRCUIT_SAMPLE_JOB_TREE | None:
        """Determines what to sample next.

        This method is called by driving code when more samples can be
        requested.

        Returns:
            A CircuitSampleJob describing the circuit to sample, how many
            samples to take, and a key value that can be used in the
            `on_job_result` method to recognize which job this is.

            Can also return a nested iterable of such jobs.

            Returning None, an empty list, or any other result which flattens
            into an empty list of work, indicates that the driving code should
            await more results (and pass them into on_job_results) before
            bothering to ask for more jobs again.
        """
Determines what to sample next.

        This method is called by driving code when more samples can be
        requested.

        Returns:
            A CircuitSampleJob describing the circuit to sample, how many
            samples to take, and a key value that can be used in the
            `on_job_result` method to recognize which job this is.

            Can also return a nested iterable of such jobs.

            Returning None, an empty list, or any other result which flattens
            into an empty list of work, indicates that the driving code should
            await more results (and pass them into on_job_results) before
            bothering to ask for more jobs again.
        
cirq-core/cirq/work/collector.py