<commit_before>import networkx as nx
from specs import *

filename = 'simple_circuit_with_sensor.net'
resultfile = 'example_with_sensor.txt'
G = nx.DiGraph()
G = read_netlist(filename)
uncon_comp_tups = []
contactor_tups = []
declaration = init(G, uncon_comp_tups, contactor_tups)

# define the states
states = {'G1': 1, 'G2': 0, 'T1': 0, 'T2': 0, 'C1': 1, 'C2': 1, 'C3': 1, 'C4': 0, 'C5': 0, 'C6': 0}
# get the measurement
sensor = sensor_measurement(G, uncon_comp_tups, contactor_tups, states)
print sensor<commit_msg>add the example of finding the compatible states<commit_after>import networkx as nx
from specs import *

filename = 'simple_circuit_with_sensor.net'
resultfile = 'example_with_sensor.txt'
G = nx.DiGraph()
G = read_netlist(filename)
uncon_comp_tups = []
contactor_tups = []
declaration = init(G, uncon_comp_tups, contactor_tups)

# define the states
states = {'G1': 1, 'G2': 0, 'T1': 0, 'T2': 0, 'C1': 1, 'C2': 1, 'C3': 1, 'C4': 0, 'C5': 0, 'C6': 0}
# get the measurement
sensor = sensor_measurement(G, uncon_comp_tups, contactor_tups, states)

# example of finding the compatible states
C_c = {'C1': 1, 'C2': 1, 'C3': 1}
S_readings = {'S1': 0, 'S2': 0}
compatible_states(G, S_readings, C_c, '0.csv')
S_readings = {'S1': 0, 'S2': 1}
compatible_states(G, S_readings, C_c, '1.csv')
S_readings = {'S1': 1, 'S2': 0}
compatible_states(G, S_readings, C_c, '2.csv')
S_readings = {'S1': 1, 'S2': 1}
compatible_states(G, S_readings, C_c, '3.csv')
{'fraction_non_alphanumeric': 0.16964285714285715, 'fraction_numerical': 0.04532967032967033, 'mean_word_length': 5.872641509433962, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1642676', 'n_tokens_mistral': 646, 'n_tokens_neox': 606, 'n_words': 163}