def METHOD_NAME(self, recipe, all_recipes, dep_key, trigger_key, branch_key, alt_branch=None):
    ret = True
    for dep in recipe[dep_key]:
        for dep_recipe in all_recipes:
            if dep_recipe["filename"] == dep:
                branch_same = True
                if branch_key:
                    branch_same = dep_recipe[branch_key] == recipe[branch_key]
                    if not branch_same and alt_branch and recipe[alt_branch]:
                        branch_same = dep_recipe[branch_key] == recipe[alt_branch]
                if (not branch_same
                    or not dep_recipe["active"]
                    or dep_recipe["build_user"] != recipe["build_user"]
                    or dep_recipe["repository"] != recipe["repository"]
                    or not dep_recipe[trigger_key]):
                    print("Recipe: %s: has invalid %s : %s" % (recipe["filename"], dep_key, dep))
                    ret = False
                break
    return ret