def get_interface_stats(snmp_device, snmp_user, stat_type, row_number):
 oid_dict = {'in_octets': '1.3.6.1.2.1.2.2.1.10', 'out_octets': '1.3.6.1.2.1.2.2.1.16', 'in_ucast_pkts': '1.3.6.1.2.1.2.2.1.11', 'out_ucast_pkts': '1.3.6.1.2.1.2.2.1.17'}
 if (not (stat_type in oid_dict.keys())):
  raise ValueError(('Invalid value for stat_type: {}' % stat_type))
 row_number = int(row_number)
 oid = oid_dict[stat_type]
 oid = ((oid + '.') + str(row_number))
 snmp_data = snmp_get_oid_v3(snmp_device, snmp_user, oid)
 return int(snmp_extract(snmp_data))

def get_interface_stats ( snmp_device , snmp_user , stat_type , row_number ) : oid_dict = { 'in_octets' : '1.3.6.1.2.1.2.2.1.10' , 'out_octets' : '1.3.6.1.2.1.2.2.1.16' , 'in_ucast_pkts' : '1.3.6.1.2.1.2.2.1.11' , 'out_ucast_pkts' : '1.3.6.1.2.1.2.2.1.17' } if ( not ( stat_type in oid_dict . keys ( ) ) ) : raise ValueError ( ( 'Invalid value for stat_type: {}' % stat_type ) ) row_number = int ( row_number ) oid = oid_dict [ stat_type ] oid = ( ( oid + '.' ) + str ( row_number ) ) snmp_data = snmp_get_oid_v3 ( snmp_device , snmp_user , oid ) return int ( snmp_extract ( snmp_data ) )
stat_type can be in_octets .