code: def nth(iterable, n):
      """Returns the nth item from iterable."""
      try:
          return iterable[n]
      except TypeError:
          try:
              return next(itertools.islice(iterable, n, None))
          except StopIteration:
              raise IndexError("index out of range")
  
imports: import collections
  import itertools
  import inspect
label_desc: Use image node_id 1 for calling a global function with example usage: nth(iterable, n) and returns: iterable, next