<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _platform_patterns(self, platform='generic', compiled=False):
 """Return all the patterns for specific platform."""

        patterns = self._dict_compiled.get(platform, None) if compiled else self._dict_text.get(platform, None)
        if patterns is None:
            raise KeyError("Unknown platform: {}".format(platform))
        return patterns