def handle_var(value, context):
 if (isinstance(value, FilterExpression) or isinstance(value, Variable)):
  return value.resolve(context)
 stringval = QUOTED_STRING.search(value)
 if stringval:
  return stringval.group(u'noquotes')
 try:
  return Variable(value).resolve(context)
 except VariableDoesNotExist:
  return value

def handle_var ( value , context ) : if ( isinstance ( value , FilterExpression ) or isinstance ( value , Variable ) ) : return value . resolve ( context ) stringval = QUOTED_STRING . search ( value ) if stringval : return stringval . group ( u'noquotes' ) try : return Variable ( value ) . resolve ( context ) except VariableDoesNotExist : return value
handle template tag variable .