<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_pool(arg = None, opts = None, abort = False):
 """ Returns pool to work with Returns a pynipap.Pool object representing the pool we are working with. """

    # 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