def get_title(name, ddict=None): if ddict is None: global default_dicts if default_dicts is None: default_dicts = get_complete_dicts(CURRENT_MONTH_DATA_FOLDER) ddict = default_dicts title_abbr = get_var_abbr(name) headline_dict = ddict[0] for title, two_labels_list in headline_dict.items(): if title_abbr == two_labels_list[0]: return title return FILLER
def test_get_complete_dicts(data_folder=CURRENT_MONTH_DATA_FOLDER): hdr, unit = get_complete_dicts(data_folder) assert 'CPI_FOOD' in [z[0] for z in hdr.values()]
def test_get_complete_dicts(self): hdr, unit = get_complete_dicts(CURRENT_MONTH_DATA_FOLDER) self.assertTrue('CPI_FOOD' in [z[0] for z in hdr.values()])
def test_get_complete_dicts(data_folder = CURRENT_MONTH_DATA_FOLDER): hdr, unit = get_complete_dicts(data_folder) assert 'CPI_FOOD' in [z[0] for z in hdr.values()]
flag += 1 return flag rows_with_count = [[r, is_almost_in(r[0], fst_elements)] for r in rows] interest = unique( [x[0][0] for x in rows_with_count if x[1] > 1 and len(x[0][0]) > 1]) # error on printing to screen - Unicode write_file("\n".join(interest), "i.txt") #todo: failures are where too many entries (>1) of spec/cfg dictionaries are found in fst_elements #get big specification #see how many times header_dict keys hit fst_elements header_dict, unit_dict = get_complete_dicts(data_folder) def is_in(x, lst): flag = 0 for y in lst: if x in y: flag += 1 return flag keys_with_count = [[x, is_in(x, fst_elements)] for x in sorted(list(header_dict.keys()))] interest2 = [x for x in keys_with_count if x[1] > 1] write_file("\n".join([str(x[0]) + " : " + str(x[1]) for x in interest2]), "i2.txt")
for y in lst: if x[0:10] in y: flag += 1 return flag rows_with_count = [[r, is_almost_in(r[0], fst_elements)] for r in rows] interest = unique([x[0][0] for x in rows_with_count if x[1] > 1 and len(x[0][0]) > 1]) # error on printing to screen - Unicode write_file("\n".join(interest),"i.txt") #todo: failures are where too many entries (>1) of spec/cfg dictionaries are found in fst_elements #get big specification #see how many times header_dict keys hit fst_elements header_dict, unit_dict = get_complete_dicts(data_folder) def is_in(x, lst): flag = 0 for y in lst: if x in y: flag += 1 return flag keys_with_count = [[x, is_in(x, fst_elements)] for x in sorted(list(header_dict.keys())) ] interest2 = [x for x in keys_with_count if x[1] > 1] write_file("\n".join([str(x[0]) + " : " + str(x[1]) for x in interest2]),"i2.txt")