def parallel_simple(function, arglist, log=True, timeout=None, return_results=False):
 if (not arglist):
  logging.warn('parallel_simple was called with an empty arglist, did you forget to pass in a list of machines?')
 if (len(arglist) == 1):
  arg = arglist[0]
  if return_results:
   try:
    result = function(arg)
   except Exception as e:
    return [e]
   return [result]
  else:
   function(arg)
   return
 subcommands = []
 for arg in arglist:
  args = [arg]
  if log:
   subdir = str(arg)
  else:
   subdir = None
  subcommands.append(subcommand(function, args, subdir))
 return parallel(subcommands, timeout, return_results=return_results)

def parallel_simple ( function , arglist , log = True , timeout = None , return_results = False ) : if ( not arglist ) : logging . warn ( 'parallel_simple was called with an empty arglist, did you forget to pass in a list of machines?' ) if ( len ( arglist ) == 1 ) : arg = arglist [ 0 ] if return_results : try : result = function ( arg ) except Exception as e : return [ e ] return [ result ] else : function ( arg ) return subcommands = [ ] for arg in arglist : args = [ arg ] if log : subdir = str ( arg ) else : subdir = None subcommands . append ( subcommand ( function , args , subdir ) ) return parallel ( subcommands , timeout , return_results = return_results )
each element in the arglist used to create a subcommand object .