(
        self, component: str, root_project_name: str
    )
return candidates.last()
The `generate_X_name` macros are similar to regular ones, but ignore
        imported packages.
            - if there is a `generate_{component}_name` macro in the root
              project, return it
            - return the `generate_{component}_name` macro from the 'dbt'
              internal project
The `generate_X_name` macros are similar to regular ones, but ignore
        imported packages.
            - if there is a `generate_{component}_name` macro in the root
              project, return it
            - return the `generate_{component}_name` macro from the 'dbt'
              internal project
The generate_X_name macros are similar to regular ones but ignore imported packages . - if there is a generate_ { component } _name macro in the root project return it - return the generate_ { component } _name macro from the dbt internal project
def find_generate_macro_by_name(
        self, component: str, root_project_name: str
    ) -> Optional[ParsedMacro]:
        """
        The `generate_X_name` macros are similar to regular ones, but ignore
        imported packages.
            - if there is a `generate_{component}_name` macro in the root
              project, return it
            - return the `generate_{component}_name` macro from the 'dbt'
              internal project
        """
        def filter(candidate: MacroCandidate) -> bool:
            return candidate.locality != Locality.Imported

        candidates: CandidateList = self._find_macros_by_name(
            name=f'generate_{component}_name',
            root_project_name=root_project_name,
            # filter out imported packages
            filter=filter,
        )
        return candidates.last()
def find_generate_macro_by_name ( self , component : str , root_project_name : str ) -> Optional [ ParsedMacro ] : def filter ( candidate : MacroCandidate ) -> bool : return candidate . locality != Locality . Imported candidates : CandidateList = self . _find_macros_by_name ( name = f'generate_{component}_name' , root_project_name = root_project_name , # filter out imported packages filter = filter , ) return candidates . last ( )