Repository: kedro-org/kedro
File: kedro/io/catalog_config_resolver.py (Python)

Code before:
        """
        List all patterns available in the catalog.

        Returns:
            A list of dataset patterns.

        Example:
        ::

            >>> config = {
            ...     "{namespace}.int_{name}": {
            ...         "type": "pandas.CSVDataset",
            ...         "filepath": "{name}.csv",
            ...     }
            ... }
            >>> resolver = CatalogConfigResolver(config)
            >>> print(resolver.list_patterns())
            # ['{namespace}.int_{name}', '{default}']
        """
        # User defined patterns
        patterns = list(self._dataset_patterns.keys()) + list(
            self._user_catch_all_pattern.keys()
        )

        # All patterns excluding duplicates
        for p in self._default_runtime_patterns.keys():
            if p not in patterns:
                patterns.append(p)

        return patterns

    @classmethod
    def _get_matches(cls, pattens: Iterable[str], ds_name: str) -> Generator[str]:
        """
        Find all patterns that match a given dataset name.

        This method iterates over a collection of patterns and checks if the given
        dataset name matches any of them using the `parse` function.

        Args:
            pattens: A collection of patterns to match against.
            ds_name: The name of the dataset to match.

        Returns:
            A generator yielding patterns that match the dataset name.

        Example:
        ::

            >>> patterns = ["{namespace}.int_{name}", "{name}"]
            >>> matches = CatalogConfigResolver._get_matches(patterns, "data.int_customers")

Review comment (suggestion):
```suggestion
        for pattern in self._default_runtime_patterns.keys():
```

Code after:
        """
        List all patterns available in the catalog.

        Returns:
            A list of dataset patterns.

        Example:
        ::

            >>> config = {
            ...     "{namespace}.int_{name}": {
            ...         "type": "pandas.CSVDataset",
            ...         "filepath": "{name}.csv",
            ...     }
            ... }
            >>> resolver = CatalogConfigResolver(config)
            >>> print(resolver.list_patterns())
            # ['{namespace}.int_{name}', '{default}']
        """
        # User defined patterns
        patterns = list(self._dataset_patterns.keys()) + list(
            self._user_catch_all_pattern.keys()
        )

        # All patterns excluding duplicates
        for pattern in self._default_runtime_patterns.keys():
            if pattern not in patterns:
                patterns.append(pattern)

        return patterns

    @classmethod
    def _get_matches(cls, pattens: Iterable[str], ds_name: str) -> Generator[str]:
        """
        Find all patterns that match a given dataset name.

        This method iterates over a collection of patterns and checks if the given
        dataset name matches any of them using the `parse` function.

        Args:
            pattens: A collection of patterns to match against.
            ds_name: The name of the dataset to match.

        Returns:
            A generator yielding patterns that match the dataset name.

        Example:
        ::

            >>> patterns = ["{namespace}.int_{name}", "{name}"]
            >>> matches = CatalogConfigResolver._get_matches(patterns, "data.int_customers")