code: def get_deps(dsk):
      """Get dependencies and dependents from task graph.
  
      Examples
      --------
      >>> from flash.core.serve.dag.utils_test import inc
      >>> dsk = {'a': 1, 'b': (inc, 'a'), 'c': (inc, 'b')}
      >>> dependencies, dependents = get_deps(dsk)
      >>> dependencies
      {'a': set(), 'b': {'a'}, 'c': {'b'}}
      >>> dict(dependents)
      {'a': {'b'}, 'b': {'c'}, 'c': set()}
  
      """
      dependencies = {
          k: get_dependencies(dsk, task=v) for k, v in dsk.items()
      }
      dependents = reverse_dict(dependencies)
      return dependencies, dependents
  
imports: from collections import defaultdict
  from typing import List, Sequence
  from flash.core.utilities.imports import _TOPIC_SERVE_AVAILABLE
label_desc: Use image node_id 8 for calling a global function with example usage: get_deps(dsk) and returns: dependencies,  dependents