def walk_service_packages(b, manager, servicename, **kwargs):
    """
    Walk a service's package dependencies and execute callbacks.

    * `service_package(manager,
                       servicename,
                       package_managername,
                       package):`
      Executed when a file service dependency is enumerated.
    """
    deps = b.get('services', {}).get(manager, {}).get(servicename, {})
    if 'packages' not in deps:
        return
    callable = kwargs.get('service_package', lambda *args: None)
    for package_managername, packages in deps['packages'].iteritems():
        for package in packages:
            callable(manager, servicename, package_managername, package)
dataset/ETHPy150Open devstructure/blueprint/blueprint/walk.py/walk_service_packages/original