code: def get_dipydir():
      """Get dipy directory from command line, or assume it's the one above."""
  
      # Initialize arguments and check location
      try:
          dipydir = sys.argv[1]
      except IndexError:
          dipydir = ".."
  
      dipydir = os.path.abspath(dipydir)
  
      cd(dipydir)
      if not os.path.isdir("dipy") and os.path.isfile("setup.py"):
          raise SystemExit(f"Invalid dipy directory: {dipydir}")
      return dipydir
  
imports: import os
  import sys
label_desc: Use image node_id 2 for calling a global function with example usage: get_dipydir() and returns: dipydir