This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def flatten_lists(integer_list): | |
list_to_return = [] | |
for element in integer_list: | |
""" | |
if element is a list, recursivelly call flatten_lists and extend the list | |
else, append the element to the list to return | |
""" | |
if type(element) == list: | |
list_to_return.extend(flatten_lists(element)) | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# # http://stackoverflow.com/a/15613104/3041998 | |
import random | |
th_min = 0.8 | |
th_max = 1.6 | |
def request_ok(lat_avg, th_min, th_max): |