<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def pool_attr_add(arg, opts, shell_opts):
 """ Add attributes to a pool """


    res = Pool.list({ 'name': arg })
    if len(res) < 1:
        print("No pool with name '%s' found." % arg, file=sys.stderr)
        sys.exit(1)

    p = res[0]

    for avp in opts.get('extra-attribute', []):
        try:
            key, value = avp.split('=', 1)
        except ValueError:
            print("ERROR: Incorrect extra-attribute: %s. Accepted form: 'key=value'\n" % avp, file=sys.stderr)
            sys.exit(1)

        if key in p.avps:
            print("Unable to add extra-attribute: '%s' already exists." % key, file=sys.stderr)
            sys.exit(1)

        p.avps[key] = value

    try:
        p.save()
    except NipapError as exc:
        print("Could not save pool changes: %s" % str(exc), file=sys.stderr)
        sys.exit(1)

    print("Pool '%s' saved." % p.name)