simulator_reader.py
def probabilistic_drop(samples, key, drop_rate, center, margin=0.01):
    """
    Removes random selection of entries in `samples` for every entry where the value stored at `key` is within a margin of center.
    Ex: To remove 60% of samples that have an angle within 0.1 of zero
        probabilistic_drop(samples, 'angle', 0.6, 0.0, 0.1)
    :return:
    """
    assert 0 <= drop_rate <= 1.0, 'drop rate must be a fraction'
    assert margin >= 0, 'margin must be non-negative'
    drop_rate = int(drop_rate * 1000)
    return [sample for sample in samples if
            sample[key] > center + margin or sample[key] < center - margin or random.randint(0, 1000) >= drop_rate]

    Removes random selection of entries in `samples` for every entry where the value stored at `key` is within a margin of center.
    Ex: To remove 60% of samples that have an angle within 0.1 of zero
        probabilistic_drop(samples, 'angle', 0.6, 0.0, 0.1)
    :return:
    
Removes random selection of entries in `samples` for every entry where the value stored at `key` is within a margin of center.
Removes random selection of entries in ` samples ` for every entry where the value stored at ` key ` is within a margin of center .
def probabilistic_drop(samples, key, drop_rate, center, margin=0.01):
    assert 0 <= drop_rate <= 1.0, 'drop rate must be a fraction'
    assert margin >= 0, 'margin must be non-negative'
    drop_rate = int(drop_rate * 1000)
    return [sample for sample in samples if
            sample[key] > center + margin or sample[key] < center - margin or random.randint(0, 1000) >= drop_rate]
def probabilistic_drop ( samples , key , drop_rate , center , margin = 0.01 ) : assert 0 <= drop_rate <= 1.0 , 'drop rate must be a fraction' assert margin >= 0 , 'margin must be non-negative' drop_rate = int ( drop_rate * 1000 ) return [ sample for sample in samples if sample [ key ] > center + margin or sample [ key ] < center - margin or random . randint ( 0 , 1000 ) >= drop_rate ]
Removes random selection of entries in `samples` for every entry where the value stored at `key` is within a margin of center.
Removes random selection of entries in ` samples ` for every entry where the value stored at ` key ` is within a margin of center .
"""
    Removes random selection of entries in `samples` for every entry where the value stored at `key` is within a margin of center.
    Ex: To remove 60% of samples that have an angle within 0.1 of zero
        probabilistic_drop(samples, 'angle', 0.6, 0.0, 0.1)
    :return:
    """
None
samples
key
drop_rate
center
margin