code: def router(name, args, kwargs, options, task=None, **kw):
      '''
      A celery router using the predeclared :class:`ContextTask`
      attributes (`router` or `default_queue` and/or `default routing_key`).
      '''
      # Fetch task by name if necessary
      task = task or celery.tasks.get(name)
      if not task:
          return
      # Single route param override everything
      if task.route:
          queue = task.route.split('.', 1)[0]
          return {'queue': queue, 'routing_key': task.route}
      # queue parameter, routing_key computed if not present
      if task.default_queue:
          key = task.default_routing_key
          key = key or '{0.default_queue}.{0.name}'.format(task)
          return {'queue': task.default_queue, 'routing_key': key}
      # only routing_key, queue should not be returned to fallback on default
      elif task.default_routing_key:
          return {'routing_key': task.default_routing_keyf router(name, args, kwargs, options, task=None, **kw):
      '''
      A celery router using the predeclared :class:`ContextTask`
      attributes (`router` or `default_queue` and/or `default routing_key`).
      '''
      # Fetch task by name if necessary
      task = task or celery.tasks.get(name)
      if not task:
          return
      # Single route param override everything
      if task.route:
          queue = task.route.split('.', 1)[0]
          return {'queue': queue, 'routing_key': task.route}
      # queue parameter, routing_key computed if not present
      if task.default_queue:
          key = task.default_routing_key
          key = key or '{0.default_queue}.{0.name}'.format(task)
          return {'queue': task.default_queue, 'routing_key': key}
      # only routing_key, queue should not be returned to fallback on default
      elif task.default_routing_key:
          return {'routing_key': task.default_routing_key}
docs: A celery router using the predeclared :class:`ContextTask`
      attributes (`router` or `default_queue` and/or `default routing_key`).