def _bitstring_format_helper(
    measured_bitstrings: npt.NDArray[np.int8], subsystem: Sequence[int] | None = None
) -> npt.NDArray[np.int8]:
    """Formats the bitstring for analysis based on the selected subsystem.
    Args:
        measured_bitstrings: List of sampled measurement outcomes as a numpy array of bitstrings.
        subsystem: Subsystem of interest
    Returns: The bitstring string for the subsystem
    """
    if subsystem is None:
        return measured_bitstrings

    return measured_bitstrings[:, :, subsystem]
Formats the bitstring for analysis based on the selected subsystem.
    Args:
        measured_bitstrings: List of sampled measurement outcomes as a numpy array of bitstrings.
        subsystem: Subsystem of interest
    Returns: The bitstring string for the subsystem
    
cirq-core/cirq/qis/entropy.py