import random


def check_episode_has_noise(lat_noise_percent, long_noise_percent):
    """
    Checks if the noise is to be added to the current episode (only for inject triangular perturbations)

    Args:
        lat_noise_percent: % noise to inject in steering
        long_noise_percent: % noise to inject in throttle / brake

    Returns:
        lat_noise: bool value whether to inject noise in the current episode
        long_noise: bool value whether to inject noise in the current episode
    """
    lat_noise = False
    long_noise = False
    if random.randint(0, 101) < lat_noise_percent:
        lat_noise = True

    if random.randint(0, 101) < long_noise_percent:
        long_noise = True
    return lat_noise, long_noise