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


    v = VRF()
    v.rt = opts.get('rt')
    v.name = opts.get('name')
    v.description = opts.get('description')
    v.tags = list(csv.reader([opts.get('tags', '')], escapechar='\\'))[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)
            return
        v.avps[key] = value

    try:
        v.save()
    except pynipap.NipapError as exc:
        print("Could not add VRF to NIPAP: %s" % str(exc), file=sys.stderr)
        sys.exit(1)

    print("Added %s" % (vrf_format(v)))