def extract_bits(bit, bit_dict):
    """Extract bits which is turend on (1).

    Args:
        bit (int): Bit to check.
        bit_dict (dict): Correspondance dict of bit and status.

    Return:
        valid_bit (:obj:`list` of :obj:`str`): List of bit which is
            turned on (1).

    Example:
        >>> sample_dict = {
        ...     "S1": 0b001,
        ...     "S2": 0b010,
        ...     "S3": 0b100,
        ... }
        >>> extract_bits(0b101, sample_dict)
        ["S1", "S3"]
    """
    assert all(isinstance(val, int) for val in bit_dict.values()), \
        "bit_dict: all elements are expected to be 'int'"

    valid_bit = [
        key for key, val in bit_dict.items() if not int(bit) & val == 0
    ]
    return valid_bit