def check_bgp(net_connect, cmd='show run | inc router bgp'):
 output = net_connect.send_command_expect(cmd)
 return ('bgp' in output)

def check_bgp ( net_connect , cmd = 'show run | inc router bgp' ) : output = net_connect . send_command_expect ( cmd ) return ( 'bgp' in output )
check whether bgp is currently configured on device .