def parseLumiFromJSON(data, select=''): runs = json.loads(data) rr = lmap(makeint, select.split('-') + [''])[:2] for run in imap(int, runs.keys()): if (rr[0] and run < rr[0]) or (rr[1] and run > rr[1]): continue for lumi in runs[str(run)]: yield ([run, lumi[0]], [run, lumi[1]])
def parseLumiFromJSON(data, select = ''): runs = json.loads(data) rr = lmap(makeint, select.split('-') + [''])[:2] for run in imap(int, runs.keys()): if (rr[0] and run < rr[0]) or (rr[1] and run > rr[1]): continue for lumi in runs[str(run)]: yield ([run, lumi[0]], [run, lumi[1]])
def _parse_lumi_from_json(data, select=''): run_dict = json.loads(data) run_range = lmap(_parse_lumi_int, select.split('-') + [''])[:2] for run in imap(int, run_dict.keys()): if (run_range[0] and run < run_range[0]) or (run_range[1] and run > run_range[1]): continue for lumi_range in run_dict[str(run)]: yield ([run, lumi_range[0]], [run, lumi_range[1]])
def parse_lumi_from_json(data, select=''): run_dict = json.loads(data) run_range = lmap(_parse_lumi_int, select.split('-') + [''])[:2] for run in imap(int, run_dict.keys()): if (run_range[0] and run < run_range[0]) or (run_range[1] and run > run_range[1]): continue for lumi_range in run_dict[str(run)]: yield ([run, lumi_range[0]], [run, lumi_range[1]])
def parse_json(data): try: return remove_unicode(json.loads(data)) except Exception: clear_current_exception() return remove_unicode(json.loads(data.replace("'", '"')))
def parseJSON(data): try: return removeUnicode(json.loads(data)) except Exception: return removeUnicode(json.loads(data.replace("'", '"')))