code: def get_pool(arg = None, opts = None, abort = False):
      
      # yep, global variables are evil
      global pool
  
      try:
          pool = Pool.list({ 'name': arg })[0]
      except IndexError:
          if abort:
              print("Pool '%s' not found." % str(arg), file=sys.stderr)
              sys.exit(1)
          else:
              pool = None
  
      return pool
docs: Returns pool to work with
  
          Returns a pynipap.Pool object representing the pool we are working with.