def _faa_di_bruno_partitions(n):
 if (n < 1):
  raise ValueError(('Expected a positive integer; got %s instead' % n))
 try:
  return _faa_di_bruno_cache[n]
 except KeyError:
  raise NotImplementedError('Higher order terms not yet implemented.')

def _faa_di_bruno_partitions ( n ) : if ( n < 1 ) : raise ValueError ( ( 'Expected a positive integer; got %s instead' % n ) ) try : return _faa_di_bruno_cache [ n ] except KeyError : raise NotImplementedError ( 'Higher order terms not yet implemented.' )
return all non-negative integer solutions of the diophantine equation:: n*k_n + .