def run():
    
    for i, tc in enumerate([tc0, tc1, tc2]):

        print "## ----------------- ##"
        print "## Building for tc%d ##" % i
        print "## ----------------- ##"

        print "Location Reference..."
        locref.Load_location_reference(tc, load_cached=False)
        print "\nsuccess!\n"
        print "Timezone Reference..."
        tzref.Load_timezone_reference(time_constraint, load_cached=False)
        print "\nsuccess!\n"

        print "\nIterating over datasets:"
        for dataset in ["calllog", "sms", "screen", "stop_locations", "bluetooth"]:
            print "\tBuilding '%s'..." % dataset
            lsd.load(tc, dataset, load_cached=False)
            print "\n\tsuccess!\n"
    def __init__(self, tc, load_cached=True):
        self.fileversion = hash(str(tc))%10000000
        
        self.ROOTPATH = os.path.abspath('').split('build_dataset')[0]
        if self.ROOTPATH[-1] != "/": self.ROOTPATH += "/"
            
        if load_cached:
            try:
                self.location_reference = self._load()
                self.users = set(self.location_reference.keys())
            except IOError:
                load_cached = False

        if not load_cached:
            self.df_stop_locations = lsd.load(tc, "stop_locations")
            self.users = set(self.df_stop_locations['user'])
            self.location_reference = self._build_location_reference()
            self._save(self.location_reference)