def parsed2datadict(d):
 if (d['uri'] is None):
  uri = '/'
 else:
  uri = d['uri']
 url = (('http://' + d['vhost']) + uri)
 musecs = int(d['musecs'])
 if ('+' in d['musecs']):
  url = url.replace('http', 'wrong')
 if (d['responsebytes'].strip() == '-'):
  responsebytes = 0
 else:
  responsebytes = int(d['responsebytes'].strip())
 return dict(url=url, musecs=musecs, responsebytes=responsebytes)

def parsed2datadict ( d ) : if ( d [ 'uri' ] is None ) : uri = '/' else : uri = d [ 'uri' ] url = ( ( 'http://' + d [ 'vhost' ] ) + uri ) musecs = int ( d [ 'musecs' ] ) if ( '+' in d [ 'musecs' ] ) : url = url . replace ( 'http' , 'wrong' ) if ( d [ 'responsebytes' ] . strip ( ) == '-' ) : responsebytes = 0 else : responsebytes = int ( d [ 'responsebytes' ] . strip ( ) ) return dict ( url = url , musecs = musecs , responsebytes = responsebytes )
input: raw data from parsing output: a dict with keys .