def get_vrf(arg = None, default_var = '<STR_LIT>', abort = False):
<EOL>global vrf<EOL>if vrf is not None:<EOL><INDENT>return vrf<EOL><DEDENT>if arg is None:<EOL><INDENT>try:<EOL><INDENT>vrf_rt = cfg.get('<STR_LIT>', default_var)<EOL><DEDENT>except configparser.NoOptionError:<EOL><INDENT>vrf_rt = '<STR_LIT:all>'<EOL><DEDENT><DEDENT>else:<EOL><INDENT>vrf_rt = arg<EOL><DEDENT>if vrf_rt.lower() == '<STR_LIT:all>':<EOL><INDENT>vrf = VRF()<EOL>vrf.rt = '<STR_LIT:all>'<EOL><DEDENT>else:<EOL><INDENT>if vrf_rt.lower() in ('<STR_LIT:->', '<STR_LIT:none>'):<EOL><INDENT>vrf_rt = None<EOL><DEDENT>try:<EOL><INDENT>vrf = VRF.search({ '<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': vrf_rt<EOL>})['<STR_LIT:result>'][<NUM_LIT:0>]<EOL><DEDENT>except (KeyError, IndexError):<EOL><INDENT>if abort:<EOL><INDENT>print("<STR_LIT>" % str(vrf_rt), file=sys.stderr)<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>else:<EOL><INDENT>vrf = False<EOL><DEDENT><DEDENT><DEDENT>return vrf<EOL>
Returns VRF to work in

        Returns a pynipap.VRF object representing the VRF we are working
        in. If there is a VRF set globally, return this. If not, fetch the
        VRF named 'arg'. If 'arg' is None, fetch the default_vrf
        attribute from the config file and return this VRF.