def _should_trace_with_reason(self, filename, frame):
if not filename:<EOL><INDENT>return None, "<STR_LIT>"<EOL><DEDENT>if filename.startswith('<STR_LIT:<>'):<EOL><INDENT>return None, "<STR_LIT>"<EOL><DEDENT>self._check_for_packages()<EOL>dunder_file = frame.f_globals.get('<STR_LIT>')<EOL>if dunder_file:<EOL><INDENT>filename = self._source_for_file(dunder_file)<EOL><DEDENT>if filename.endswith("<STR_LIT>"):<EOL><INDENT>filename = filename[:-<NUM_LIT:9>] + "<STR_LIT>"<EOL><DEDENT>canonical = self.file_locator.canonical_filename(filename)<EOL>if self.source_match:<EOL><INDENT>if not self.source_match.match(canonical):<EOL><INDENT>return None, "<STR_LIT>"<EOL><DEDENT><DEDENT>elif self.include_match:<EOL><INDENT>if not self.include_match.match(canonical):<EOL><INDENT>return None, "<STR_LIT>"<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if self.pylib_match and self.pylib_match.match(canonical):<EOL><INDENT>return None, "<STR_LIT>"<EOL><DEDENT>if self.cover_match and self.cover_match.match(canonical):<EOL><INDENT>return None, "<STR_LIT>"<EOL><DEDENT><DEDENT>if self.omit_match and self.omit_match.match(canonical):<EOL><INDENT>return None, "<STR_LIT>"<EOL><DEDENT>return canonical, "<STR_LIT>"<EOL>
Decide whether to trace execution in `filename`, with a reason.

        This function is called from the trace function.  As each new file name
        is encountered, this function determines whether it is traced or not.

        Returns a pair of values:  the first indicates whether the file should
        be traced: it's a canonicalized filename if it should be traced, None
        if it should not.  The second value is a string, the resason for the
        decision.