def agent_formatter(metric, value, timestamp, tags, hostname, device_name=None, metric_type=None, interval=None):
 attributes = {}
 if tags:
  attributes['tags'] = list(tags)
 if hostname:
  attributes['hostname'] = hostname
 if device_name:
  attributes['device_name'] = device_name
 if metric_type:
  attributes['type'] = metric_type
 if interval:
  pass
 if attributes:
  return (metric, int(timestamp), value, attributes)
 return (metric, int(timestamp), value)

def agent_formatter ( metric , value , timestamp , tags , hostname , device_name = None , metric_type = None , interval = None ) : attributes = { } if tags : attributes [ 'tags' ] = list ( tags ) if hostname : attributes [ 'hostname' ] = hostname if device_name : attributes [ 'device_name' ] = device_name if metric_type : attributes [ 'type' ] = metric_type if interval : pass if attributes : return ( metric , int ( timestamp ) , value , attributes ) return ( metric , int ( timestamp ) , value )
formats metrics coming from the metricsaggregator .