def robustApply(receiver, *arguments, **named):
 (receiver, codeObject, startIndex) = function(receiver)
 acceptable = codeObject.co_varnames[(startIndex + len(arguments)):codeObject.co_argcount]
 for name in codeObject.co_varnames[startIndex:(startIndex + len(arguments))]:
  if named.has_key(name):
   raise TypeError(('Argument %r specified both positionally and as a keyword for calling %r' % (name, receiver)))
 if (not (codeObject.co_flags & 8)):
  for arg in named.keys():
   if (arg not in acceptable):
    del named[arg]
 return receiver(*arguments, **named)

def robustApply ( receiver , * arguments , ** named ) : ( receiver , codeObject , startIndex ) = function ( receiver ) acceptable = codeObject . co_varnames [ ( startIndex + len ( arguments ) ) : codeObject . co_argcount ] for name in codeObject . co_varnames [ startIndex : ( startIndex + len ( arguments ) ) ] : if named . has_key ( name ) : raise TypeError ( ( 'Argument %r specified both positionally and as a keyword for calling %r' % ( name , receiver ) ) ) if ( not ( codeObject . co_flags & 8 ) ) : for arg in named . keys ( ) : if ( arg not in acceptable ) : del named [ arg ] return receiver ( * arguments , ** named )
call receiver with arguments and an appropriate subset of named .