def convert_keys(d):
 special = {'started_before': 'StartTime<', 'started_after': 'StartTime>', 'started': 'StartTime', 'ended_before': 'EndTime<', 'ended_after': 'EndTime>', 'ended': 'EndTime', 'from_': 'From'}
 result = {}
 for (k, v) in iteritems(d):
  if (k in special):
   result[special[k]] = v
  else:
   result[convert_case(k)] = v
 return result

def convert_keys ( d ) : special = { 'started_before' : 'StartTime<' , 'started_after' : 'StartTime>' , 'started' : 'StartTime' , 'ended_before' : 'EndTime<' , 'ended_after' : 'EndTime>' , 'ended' : 'EndTime' , 'from_' : 'From' } result = { } for ( k , v ) in iteritems ( d ) : if ( k in special ) : result [ special [ k ] ] = v else : result [ convert_case ( k ) ] = v return result
return a dictionary with all keys converted from arguments .