def METHOD_NAME(self, patterns: typing.Iterable[str]):
    for line_num, rule in enumerate(patterns, 1):
        orig_rule = rule
        rule = rule.lstrip().rstrip("\r\n")
        if not rule or rule.startswith("#"):
            continue
        invert = False
        if rule.startswith("!"):
            invert = True
            rule = rule.lstrip("!")
        rule = _unescape_rule(rule)
        only_dirs = False
        if rule.endswith("/"):
            only_dirs = True
            rule = rule.rstrip("/")
        if not rule.startswith("/"):
            # A rule that doesn't start with '/' means to match any
            # subdirectory
            rule = "**/" + rule
        regex = _rule_to_regex(rule)
        m = _Matcher(
            line_num=line_num,
            orig_rule=orig_rule,
            invert=invert,
            only_dirs=only_dirs,
            regex=regex,
        )
        self._matchers.append(m)
        print(f"Translated .jujuignore {line_num:d} {orig_rule!r} => {regex!r}")