def run(self, packs_status, nested):
        """
        :param packs_status: Name of the pack in Exchange or a git repo URL and download status.
        :type: packs_status: ``dict``

        :param nested: Nested level of dependencies to prevent infinite or really
        long download loops.
        :type nested: ``integer``
        """
        result = {}
        dependency_list = []
        conflict_list = []

        if not packs_status or nested == 0:
            return result

        for pack, status in six.iteritems(packs_status):
            if "success" not in status.lower():
                continue

            dependency_packs = get_dependency_list(pack)
            if not dependency_packs:
                continue

            for dep_pack in dependency_packs:
                name_or_url, pack_version = self.get_name_and_version(dep_pack)

                if len(name_or_url.split("/")) == 1:
                    pack_name = name_or_url
                else:
                    name_or_git = name_or_url.split("/")[-1]
                    pack_name = (
                        name_or_git
                        if ".git" not in name_or_git
                        else name_or_git.split(".")[0]
                    )

                # Check existing pack by pack name
                existing_pack_version = get_pack_version(pack_name)

                # Try one more time to get existing pack version by name if 'stackstorm-' is in
                # pack name
                if not existing_pack_version and "stackstorm-" in pack_name.lower():
                    existing_pack_version = get_pack_version(
                        pack_name.split("stackstorm-")[-1]
                    )

                if existing_pack_version:
                    if existing_pack_version and not existing_pack_version.startswith(
                        "v"
                    ):
                        existing_pack_version = "v" + existing_pack_version
                    if pack_version and not pack_version.startswith("v"):
                        pack_version = "v" + pack_version
                    if (
                        pack_version
                        and existing_pack_version != pack_version
                        and dep_pack not in conflict_list
                    ):
                        conflict_list.append(dep_pack)
                else:
                    conflict = self.check_dependency_list_for_conflict(
                        name_or_url, pack_version, dependency_list
                    )
                    if conflict:
                        conflict_list.append(dep_pack)
                    elif dep_pack not in dependency_list:
                        dependency_list.append(dep_pack)

        result["dependency_list"] = dependency_list
        result["conflict_list"] = conflict_list
        result["nested"] = nested - 1

        return result

        :param packs_status: Name of the pack in Exchange or a git repo URL and download status.
        :type: packs_status: ``dict``

        :param nested: Nested level of dependencies to prevent infinite or really
        long download loops.
        :type nested: ``integer``
        
contrib/packs/actions/pack_mgmt/get_pack_dependencies.py