def filter(self):
if self.filter_expression is not None:<EOL><INDENT>new_metrics = []<EOL>metrics = self.metrics['<STR_LIT:result>']<EOL>for m in metrics:<EOL><INDENT>if self.filter_expression.search(m['<STR_LIT:name>']):<EOL><INDENT>new_metrics.append(m)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>new_metrics = self.metrics['<STR_LIT:result>']<EOL><DEDENT>self.metrics = self.extract_dictionary(new_metrics)<EOL>
Apply the criteria to filter out on the metrics required