def METHOD_NAME(
    self, part_name: str, *, recursive: bool = False
) -> Set[pluginhandler.PluginHandler]:
    """Returns a set of all the parts upon which part_name depends."""
    dependency_names = set(self.after_requests.get(part_name, []))
    dependencies = {p for p in self.all_parts if p.name in dependency_names}
    if recursive:
        # No need to worry about infinite recursion due to circular
        # dependencies since the YAML validation won't allow it.
        for dependency_name in dependency_names:
            dependencies |= self.METHOD_NAME(
                dependency_name, recursive=recursive
            )
    return dependencies