gaussian_functions.py
def find_closest_key(sorted_dict, key):
    """
    Find closest key in sorted_dict to 'key'
    """
    keys = list(islice(sorted_dict.irange(minimum=key), 1))
    keys.extend(islice(sorted_dict.irange(maximum=key, reverse=True), 1))
    return min(keys, key=lambda k: abs(key - k))

    Find closest key in sorted_dict to 'key'
    
Find closest key in sorted_dict to 'key'
Find closest key in sorted_dict to ' key '
def find_closest_key(sorted_dict, key):
    keys = list(islice(sorted_dict.irange(minimum=key), 1))
    keys.extend(islice(sorted_dict.irange(maximum=key, reverse=True), 1))
    return min(keys, key=lambda k: abs(key - k))
def find_closest_key ( sorted_dict , key ) : keys = list ( islice ( sorted_dict . irange ( minimum = key ) , 1 ) ) keys . extend ( islice ( sorted_dict . irange ( maximum = key , reverse = True ) , 1 ) ) return min ( keys , key = lambda k : abs ( key - k ) )
Find closest key in sorted_dict to 'key'
Find closest key in sorted_dict to ' key '
"""
    Find closest key in sorted_dict to 'key'
    """
sorted_dict
key