<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _match_magic(self, full_path):
 """Return the first magic that matches this path or None."""

        for magic in self.magics:
            if magic.matches(full_path):
                return magic