<s> import sys <EOL> import logging <EOL> import antd . ant as ant <EOL> import antd . hw as hw <EOL> logging . basicConfig ( <EOL> level = logging . DEBUG , <EOL> out = sys . stderr , <EOL> format = "<STR_LIT>" ) <EOL> _LOG = logging . getLogger ( ) <EOL> dev = hw . UsbHardware ( ) <EOL> core = ant . Core ( dev ) <EOL> session = ant . Session ( core ) <EOL> try : <EOL> channel = session . channels [ <NUM_LIT:0> ] <EOL> network = session . networks [ <NUM_LIT:0> ] <EOL> network . set_key ( "<STR_LIT:\x00>" * <NUM_LIT:8> ) <EOL> channel . assign ( channel_type = <NUM_LIT> , network_number = <NUM_LIT:0> ) <EOL> channel . set_id ( device_number = <NUM_LIT:0> , device_type_id = <NUM_LIT:0> , trans_type = <NUM_LIT:0> ) <EOL> channel . set_period ( <NUM_LIT> ) <EOL> channel . set_search_timeout ( <NUM_LIT:4> ) <EOL> channel . set_rf_freq ( <NUM_LIT> ) <EOL> channel . open ( ) <EOL> _LOG . info ( "<STR_LIT>" , channel . recv_broadcast ( timeout = <NUM_LIT:0> ) ) <EOL> channel . send_acknowledged ( "<STR_LIT>" ) <EOL> channel . send_burst ( "<STR_LIT>" ) <EOL> channel . send_burst ( "<STR_LIT>" * <NUM_LIT:10> ) <EOL> channel . write ( "<STR_LIT>" ) <EOL> finally : <EOL> try : session . close ( ) <EOL> except : _LOG . warning ( "<STR_LIT>" , exc_info = True ) </s>
