code: def task_pidigits():
      """Pi calculation (Python)"""
      _map = map
      _count = itertools.count
      _islice = itertools.islice
  
      def calc_ndigits(n):
          # From http://shootout.alioth.debian.org/
          def gen_x():
              return _map(
                  lambda k: (k, 4 * k + 2, 0, 2 * k + 1), _count(1)
              )
  
          def compose(a, b):
              aq, ar, as_, at = a
              bq, br, bs, bt = b
              return (
                  aq * bq,
                  aq * br + ar * bt,
                  as_ * bq + at * bs,
                  as_ * br + at * bt,
              )
  
          def extract(z, j):
              q, r, s, t = z
              return (q * j + r) // (s * j + t)
  
          def pi_digits():
              z = (1, 0, 0, 1)
              x = gen_x()
              while 1:
                  y = extract(z, 3)
                  while y != extract(z, 4):
                      z = compose(z, next(x))
                      y = extract(z, 3)
                  z = compose((10, -10 * y, 0, 1), z)
                  yield y
  
          return list(_islice(pi_digits(), n))
  
      return calc_ndigits, (50,)
  
imports: from __future__ import division
  from __future__ import print_function
  import time
  import os
  import sys
  import itertools
  import threading
  import subprocess
  import socket
  from optparse import OptionParser, SUPPRESS_HELP
  import platform
label_desc: Use image node_id 1 for calling a global function with example usage: task_pidigits() and returns: calc_ndigits,  int, list, _map, unknown,  unknown,  unknown,  unknown, unknown