def fix_aggs(self):
aggs = self.aggs<EOL>for key in list(aggs.keys()):<EOL><INDENT>_type = aggs[key].get("<STR_LIT>", "<STR_LIT>")<EOL>if _type == "<STR_LIT>":<EOL><INDENT>for entry in aggs[key].get("<STR_LIT>", []):<EOL><INDENT>for k, v in list(entry.items()):<EOL><INDENT>if k in ["<STR_LIT:count>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>continue<EOL><DEDENT>if not isinstance(entry[k], datetime):<EOL><INDENT>entry[k] = datetime.utcfromtimestamp(v / <NUM_LIT>)<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>
This function convert date_histogram aggs to datetime