from collections import namedtuple LocationData = namedtuple('LocationData', 'hwid lat lon eig prec yaw press') def have_location(x): return x.lat != None and x.lon != None def maybe_entry(x): return x.eig < 5 and x.prec > 40 def maybe_indoor(x): return x.eig < 1 and x.prec > 400