@dual_decorator
def enforce_id_param(position=1):
 @decorator
 def wrapper(function, *args, **kw):
  if (not isinstance(args[position], basestring)):
   raise ValueError((u'Invalid param type in position %s; expected an id (did you pass a dictionary?)' % position))
  return function(*args, **kw)
 return wrapper

@ dual_decorator def enforce_id_param ( position = 1 ) : @ decorator def wrapper ( function , * args , ** kw ) : if ( not isinstance ( args [ position ] , basestring ) ) : raise ValueError ( ( u'Invalid param type in position %s; expected an id (did you pass a dictionary?)' % position ) ) return function ( * args , ** kw ) return wrapper
verifies that the caller is passing a single song id .