def decoder_res(csv_gen): output = [] for c in csv_gen: if c != 0.0: x = c if x <= 17.5: x = 0 elif 17.5 < x <= 37.5: x = 35 elif 37.5 < x <= 40.5: x = 40 elif 40.5< x <= 42: x = 41 elif 42 < x <= 44: x =43 elif 44 < x <= 45.5: x =45 elif 45.5 < x <= 46.5: x = 46 elif 46.5 < x <=48 : x = 47 elif 48< x <= 49.5: x = 49 elif 49.5< x <= 50.5: x = 50 elif 50.5 < x <=51.5 : x = 51 elif 51.5 < x <=52.5 : x = 52 elif 52.5< x <=53.5 : x = 53 elif 53.5< x <=54.5 : x = 54 elif 54.5< x <=55.5 : x = 55 elif 55.5< x <=58.5 : x = 56 elif 58.5< x <=61.5 : x = 61 elif 61.5 < x <=63 : x = 62 elif 63< x <= 64.5: x = 64 elif 64.5< x <=65.5 : x = 65 elif 65.5 < x <=66.5 : x = 66 elif 66.5< x <=68.5 : x = 67 elif 68.5< x <= 71: x = 70 elif 71 < x <= 72.5: x = 72 elif 72.5< x <=74 : x = 73 elif 74< x <=75.5 : x = 75 elif 75.5< x <=76.5 : x = 76 elif 76.5< x <=77.5 : x = 77 elif 77.5< x <=78.5 : x = 78 elif 78.5< x <=79.5 : x = 79 elif 79.5< x <=81.5 : x = 80 elif 81.5< x <=87.5 : x = 83 elif 87.5< x <=90.5 : x = 90 elif 90.5< x <=91.5 : x = 91 elif 91.5< x <=92.5 : x = 92 elif 92.5< x <=94 : x = 93 elif 94< x <= 96: x = 95 elif 96< x <=98 : x = 97 elif 98< x <=99.5 : x = 99 elif 99.5< x <=100.5 : x = 100 elif 100.5< x <= 102: x = 101 elif 102< x <=104 : x = 103 elif 104< x <=106.5 : x = 105 elif 106.5< x <=109 : x = 108 elif 109 < x <=110.5: x = 110 elif 110.5< x <=112.5: x = 111 elif 112.5< x <=114.5 : x = 114 elif 114.5< x <=116 : x = 115 elif 116< x : x = 117 try: output.append(chr(x)) except: output.append("error") output = listToString(output)