KOSASIH / HealthGuard-Refugee-Initiative

Consider using f-strings PYL-C0209
Performance
Minor
5 months ago5 months old
Formatting a regular string which could be a f-string
62    numpy.ndarray: The patient's brain data.
63    """
64    # Load the patient's brain data from a file or database
65    brain_data = np.load("brain_data/{}.npy".format(patient_id))66
67    return brain_data
68
Formatting a regular string which could be a f-string
126
127    plt.figure()
128    plt.plot(
129        fpr, tpr, color="darkorange", lw=2, label="ROC curve (area = %0.2f)" % roc_auc130    )
131    plt.plot([0, 1], [0, 1], color="navy", lw=2, linestyle="--")
132    plt.xlim([0.0, 1.0])
Formatting a regular string which could be a f-string
 92    num_devices = random.randint(1, 3)
 93    devices = []
 94    for i in range(num_devices):
 95        device_name = 'Device {}'.format(i) 96        devices.append(device_name)
 97        simulate_iot_device(device_name, sensor_data)
 98
Formatting a regular string which could be a f-string
 87    anomalies = analyze_sensor_data(sensor_data)
 88    print('Anomalies detected:')
 89    for i, j in anomalies:
 90        print('Sensor {} at sample {}'.format(i, j)) 91    print()
 92    num_devices = random.randint(1, 3)
 93    devices = []
Formatting a regular string which could be a f-string
 71    sensor_readings = {}
 72    for i in range(sensor_data.shape[0]):
 73        sensor_readings[i] = sensor_data[i][-1]
 74    print('IoT device {} readings: {}'.format(name, sensor_readings)) 75
 76# Define a function to simulate a sensor network
 77def simulate_sensor_network(num_sensors, num_samples):