def network_io_counters(interface=None):
 if (not interface):
  return dict(psutil.net_io_counters()._asdict())
 else:
  stats = psutil.net_io_counters(pernic=True)
  if (interface in stats):
   return dict(stats[interface]._asdict())
  else:
   return False

def network_io_counters ( interface = None ) : if ( not interface ) : return dict ( psutil . net_io_counters ( ) . _asdict ( ) ) else : stats = psutil . net_io_counters ( pernic = True ) if ( interface in stats ) : return dict ( stats [ interface ] . _asdict ( ) ) else : return False
return network i/o statistics .