code: def get_calculation_dependencies_for(service):
      
  
      def calc_dependencies_gen(service, collector=None):
          """Generator for recursive dependency resolution.
          """
  
          # The UID of the service
          service_uid = api.get_uid(service)
  
          # maintain an internal dependency mapping
          if collector is None:
              collector = {}
  
          # Stop iteration if we processed this service already
          if service_uid in collector:
              raise StopIteration
  
          # Get the calculation of the service.
          # The calculation comes either from an assigned method or the user
          # has set a calculation manually (see content/analysisservice.py).
          calculation = service.getCalculation()
  
          # Stop iteration if there is no calculation
          if not calculation:
              raise StopIteration
  
          # The services used in this calculation.
          # These are the actual dependencies of the used formula.
          dep_services = calculation.getDependentServices()
          for dep_service in dep_services:
              # get the UID of the dependent service
              dep_service_uid = api.get_uid(dep_service)
  
              # remember the dependent service
              collector[dep_service_uid] = dep_service
  
              # yield the dependent service
              yield dep_service
  
              # check the dependencies of the dependent services
              for ddep_service in calc_dependencies_gen(dep_service,
                                                        collector=collector):
                  yield ddep_service
  
      dependencies = {}
      for dep_service in calc_dependencies_gen(service):
          # Skip the initial (requested) service
          if dep_service == service:
              continue
          uid = api.get_uid(dep_service)
          dependencies[uid] = dep_service
  
      return dependencies
docs: Calculation dependencies of this service and the calculation of each
      dependent service (recursively).