code: def flatten(S):
      if S == []:
          return S
      if isinstance(S[0], list):
          return flatten(S[0]) + flatten(S[1:])
      return S[:1] + flatten(S[1:])
  
file_path: nipype/nipype/utils/misc.py
imports: import os
  import sys
  import re
  from collections.abc import Iterator
  from warnings import warn
  from looseversion import LooseVersion
  import numpy
  import textwrap
label_desc: Use image node_id 8 for calling a global function with example usage: flatten(S) and returns: unknown, S, unknown