def returns_arg(function):
 def call_and_assert(arg, context=None):
  if (context is None):
   context = {}
  result = function(arg, context=context)
  assert (result == arg), 'Should return the argument that was passed to it, unchanged ({arg})'.format(arg=repr(arg))
  return result
 return call_and_assert

def returns_arg ( function ) : def call_and_assert ( arg , context = None ) : if ( context is None ) : context = { } result = function ( arg , context = context ) assert ( result == arg ) , 'Should return the argument that was passed to it, unchanged ({arg})' . format ( arg = repr ( arg ) ) return result return call_and_assert
a decorator that tests that the decorated function returns the argument that it is called with .